@hpcc-js/map 3.1.1 → 3.2.1

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.
@@ -0,0 +1,11 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.map_Layered .background{fill:none}.map_Layered .raster image{fill:#b5d0d0}.map_Layered .hash path{fill:none;stroke:red;stroke-linejoin:round}.map_Layered .checkerFill{fill:red;stroke:red;opacity:.5}.map_Layered .checkerNoFill{fill:none;stroke:none;opacity:.5}.map_Layered .mesh{fill:none;stroke:#6d6e71;stroke-width:.25}.map_Layered .data{stroke:none;stroke-width:.25}.map_Layered .data .shape.selected{stroke:red;stroke-width:1.25px}.map_Layered .map_GeoHash .data{stroke:none}.map_Layered .map_GeoHash .data.selected{stroke:red}.map_Layered .map_GeoHash .data.over{stroke:orange}.map_Layered .map_GeoHash .data.selected.over{stroke:red}.map_GMap .marker{fill:#656565;stroke:none;stroke-width:1px}.map_GMap .map_Layered{pointer-events:auto;cursor:auto}.gm-style img{max-width:none}.gm-style label{width:auto;display:inline}.map_Layered .pin>path{cursor:pointer;stroke:#000}.map_Layered .pin.selected>path{stroke-width:1px;stroke:red}.map_Layered .pin.over>path{stroke:orange}.map_Layered .pin.selected.over>path{stroke-width:1px;stroke:red}.map_Layered .marker{fill:#656565;stroke:none}.map_Layered .marker{fill:#656565;stroke:none;stroke-width:1px}.map_Layered .dataEdge{stroke:#000;fill:none}.map_Layered .graticule{fill:none;stroke:#a9a9a9;stroke-linejoin:round;stroke-width:.25px}.map_Layered .graticuleOutline{fill:none;stroke:#000;stroke-linejoin:round;stroke-width:.25px}.map_Heat canvas{pointer-events:none}.map_OpenStreet .background{fill:#fff}.map_OpenStreet .graticule{fill:none;stroke:#777;stroke-width:.5px;stroke-opacity:.5}.map_Layered .vector{fill:none;stroke:navy;stroke-linejoin:round}.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}.leaflet-draw-section{position:relative}.leaflet-draw-toolbar{margin-top:12px}.leaflet-draw-toolbar-top{margin-top:0}.leaflet-draw-toolbar-notop a:first-child{border-top-right-radius:0}.leaflet-draw-toolbar-nobottom a:last-child{border-bottom-right-radius:0}.leaflet-draw-toolbar a{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAAeCAYAAACWuCNnAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAG7AAABuwBHnU4NQAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAbvSURBVHic7dtdbBxXFQfw/9nZ3SRKwAP7UFFUQOoHqGnUoEAoNghX9tyxVcpD1X0J+WgiUQmpfUB5ACSgG1qJIKASqBIUIauqAbWseIlqb+bOWHVR6y0FKZBEqdIUQROIREGRx3FFvR/38ODZst3a3nE8Ywfv+T2t7hzdM3fle/bOnWtACCGEEEIIIYQQQgghhBBCCCGEEEIIIcRa0EbfgBDdFItFKwzDAa3175LuWylVAvBIR/MxrXUp6Vxx9dp4VyObVEdKKW591lonXgiVUg6AHzPzk9ls9meVSmUh6RzXkz179uQKhcIgM+8CACI6U6vVnp+enm6knXt4ePiuTCbzWQAwxlSDIHg57ZwroDAMnwKwz3XdBzzPG08hxzsTNprQG2lTjtd13WFmfghAP4A+AJcATFiW9YNKpfL3uP0kUliiX4SG1pqUUpx0wXJd9/PMXAGwPWq6yMyPz8/P/7xarf4nyVwt7QV4JWkU52i8YwBu6bh0wRhzJAiCF5POCQCDg4N2Pp//NYDRjkuTxph9QRCESeYrFov5ubm5R5n5AIAPtV1aYOb7BgYGTpZKJeO67lFmPsbM9/i+/8Ja8y6zylhOYquPXhsvAJRKpczMzMwTAIaJ6LFGo+HNzs5eKRQKNxPRAWb+CoAjWuvn4vS35skWFasxAAdbbUlOYqVUPwAPwI4lLr8J4KeWZT1eqVTmksoZ5d2QghUVKx/AlmVCFph5yPf9l5LMCwBKqUksFqszRHQcAJj5GwB2MfOE7/tfTDKf4zjHiejrAE4CuNhqZ+bf2rY9FYbhGBH92/O8o47j3Oj7/uUk86+3XhsvACilHmPmgW3btn3pxIkTVzuvj4yMfNoY85wxZiQIglPd+lvTZIuq5xiAQwCe6evr218ul5tr6bNd9GiiAbyvS+hFrfVHk8oLbEzBih4Dz+G9K6t3IaLXFhYWdib5eBh911UA8wBu1lq/CQBDQ0M3WJb1OoAdRPQZz/NeSSqnUuofAKpa6/vb26MfwacA7AdwFcCdWuu/JpU3yl1C91VHoquNXhvvyMjIx4wxr1iWtbNSqfxruTjHcR4AcMj3/bu79XnNe1hpFyvHcXYT0QS6FysASHR1tVEKhcIguhQrAGDm23K53BcATCWV27KsAWYGgPOtYgUAU1NT/1RKnQewxxjzOQCJFSwANwI4297QtmLfD+AtZr43m83OJ5iz3bGU+l1OT43XGFNk5mdXKlYAYNv2eBiG31dK3aS1vrRSbOZabqRYLFppFisAIKJxAB+MGf56krk30O64gZlMJnZsHMxsoo8fHxoauqHVHn3+BAAQUaxV57Xq2F54i5nvIaJXm81mYoX5etID491JRH/sFlQul5tEdMoYc3u32FUXrLYvObViBQDM/MQqwi8knX8jEJHpHrXIGJNo8WDm1spph2VZgeu6+5RSX7YsK8D/Xnb8Psmcnebm5h7G4uS9ysxutOH8VQC70sy7UTb7eImImTnWlgkzUyaT6fr3v6qC1fGL8EytVjuQRrECANu2fwHg1TixzPyXNO5hvTHz6VWE/znJ3L7vzxBRa9PzDmb+FYBfArgjajvd39+f9vGGKwACZh5te6mwmc8KburxMvO5TCbzqW5xxWLRArDbsqyu8z32HtZSxSrNM0Hlcrnpum6JmZ+NEb4pHglrtdrz+Xz+AoBbu4Ser9fra37d3YEBfBvAkq+XmfmbpVIp9grwWnie9zSAp9PMcT3Z7OPNZrO/aTQaf1BKfbd9X7RTGIaHmPlcnPNYsVZYSikOw7AB4CAzj/f19e1fjwOMnueVEeMxJJfLbYqCNT093TDGHAGw0qHYBQBH0vj+Pc+bYOb3HFRk5nHf9yeTzgfgMhF9uEvMTQD+71/vR3pqvJOTk28AeBJAeXR09P1LxbiuuxfA9wB8LU6fsVdYrUOhtm0fTusxcAlMRN+KziUt5SqAM3v37r00OZnGfFp/QRC86DjOUCaTGWPm2zoun8fiIbuZtPLX6/UH8/n8rQDuippertfrD6aRKyqOR5VS81ji8Z+IbmfmgwB+mEb+9dZr4wWA/v7+R6rV6k+azeYpx3EezeVyJ7dv335lfn7+lkajcZCZDzPzYd/3/xSnv9gFq3UuaR2LFQDA87xAKVUB8BEAZ6N9nrNEdEZr/TcArLVOPG8aJ9jj8n3/pcHBwZ1btmx5519zmPl0vV5/Ie2V7fT09Nujo6Nus9kcA4CtW7ce1lq/nUYu27a/Mzs7CyI6gMVX/u/CzJeZ+Ue2bcc9pb1aXc8lJZms18YLANE2wkOu694N4OFGo3E8DMMPAHiDiCaY+ZOb4YCsEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhEjYfwGO+b5dFNs4OgAAAABJRU5ErkJggg==);background-image:linear-gradient(transparent,transparent),url("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:svg='http://www.w3.org/2000/svg'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20viewBox='0%200%20600%2060'%20height='60'%20width='600'%20id='svg4225'%20version='1.1'%20inkscape:version='0.91%20r13725'%20sodipodi:docname='spritesheet.svg'%20inkscape:export-filename='/home/fpuga/development/upstream/icarto.Leaflet.draw/src/images/spritesheet-2x.png'%20inkscape:export-xdpi='90'%20inkscape:export-ydpi='90'%3e%3cmetadata%20id='metadata4258'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3cdc:title%20/%3e%3c/cc:Work%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%20id='defs4256'%20/%3e%3csodipodi:namedview%20pagecolor='%23ffffff'%20bordercolor='%23666666'%20borderopacity='1'%20objecttolerance='10'%20gridtolerance='10'%20guidetolerance='10'%20inkscape:pageopacity='0'%20inkscape:pageshadow='2'%20inkscape:window-width='1920'%20inkscape:window-height='1056'%20id='namedview4254'%20showgrid='false'%20inkscape:zoom='1.3101852'%20inkscape:cx='237.56928'%20inkscape:cy='7.2419621'%20inkscape:window-x='1920'%20inkscape:window-y='24'%20inkscape:window-maximized='1'%20inkscape:current-layer='svg4225'%20/%3e%3cg%20id='enabled'%20style='fill:%23464646;fill-opacity:1'%3e%3cg%20id='polyline'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%2018,36%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4229'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2036,18%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4231'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2023.142,39.145%20-2.285,-2.29%2016,-15.998%202.285,2.285%20z'%20id='path4233'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cpath%20id='polygon'%20d='M%20100,24.565%2097.904,39.395%2083.07,42%2076,28.773%2086.463,18%20Z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='rectangle'%20d='m%20140,20%2020,0%200,20%20-20,0%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='circle'%20d='m%20221,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='marker'%20d='m%20270,19%20c%20-4.971,0%20-9,4.029%20-9,9%200,4.971%205.001,12%209,14%204.001,-2%209,-9.029%209,-14%200,-4.971%20-4.029,-9%20-9,-9%20z%20m%200,12.5%20c%20-2.484,0%20-4.5,-2.014%20-4.5,-4.5%200,-2.484%202.016,-4.5%204.5,-4.5%202.485,0%204.5,2.016%204.5,4.5%200,2.486%20-2.015,4.5%20-4.5,4.5%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cg%20id='edit'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20337,30.156%200,0.407%200,5.604%20c%200,1.658%20-1.344,3%20-3,3%20l%20-10,0%20c%20-1.655,0%20-3,-1.342%20-3,-3%20l%200,-10%20c%200,-1.657%201.345,-3%203,-3%20l%206.345,0%203.19,-3.17%20-9.535,0%20c%20-3.313,0%20-6,2.687%20-6,6%20l%200,10%20c%200,3.313%202.687,6%206,6%20l%2010,0%20c%203.314,0%206,-2.687%206,-6%20l%200,-8.809%20-3,2.968'%20id='path4240'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.72,24.637%20-8.892,8.892%20-2.828,0%200,-2.829%208.89,-8.89%20z'%20id='path4242'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.697,17.826%204,0%200,4%20-4,0%20z'%20transform='matrix(-0.70698336,-0.70723018,0.70723018,-0.70698336,567.55917,274.78273)'%20id='path4244'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cg%20id='remove'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20381,42%2018,0%200,-18%20-18,0%200,18%20z%20m%2014,-16%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z'%20id='path4247'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20395,20%200,-4%20-10,0%200,4%20-6,0%200,2%2022,0%200,-2%20-6,0%20z%20m%20-2,0%20-6,0%200,-2%206,0%200,2%20z'%20id='path4249'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3c/g%3e%3cg%20id='disabled'%20transform='translate(120,0)'%20style='fill:%23bbbbbb'%3e%3cuse%20xlink:href='%23edit'%20id='edit-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3cuse%20xlink:href='%23remove'%20id='remove-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3c/g%3e%3cpath%20style='fill:none;stroke:%23464646;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1'%20id='circle-3'%20d='m%20581.65725,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20/%3e%3c/svg%3e");background-repeat:no-repeat;background-size:300px 30px;background-clip:padding-box}.leaflet-retina .leaflet-draw-toolbar a{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAAA8CAYAAAC6nMS5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAA16SURBVHic7d1/jBxneQfw7zNzvotdn+9sVQkxoRKoammBqqpbk6uT5mLfvHPn42yn1VFRVCEhoFH5IYpoSaUCKi1NcGkcfrbCVRFKEwG2aHLn83pmLvY2CTqT1AmCOBE0EOT4B0nBPw/snb2dp3/sLr6s77i923dud/a+H8ny7tzMo8f3eud99p133gGIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiFYGaXYCRETUPMYYrWe/MAzZX2QQ27d5OpqdABFROxgZGVlz5cqVrzuOc18QBJPNzofsYvvSYrVcgTVftZ2l6npgYODXHMc5oKoHHcfZHQTB2WbnRETpGRkZWVMoFA6IyO2qutX3/R1Z64TnO8fWOwLSzti+mSKDg4M3l0qlnSJyG4CbAFwP4ByAlwE8paoPX3fddcH4+PjP00yk5QqsrDPGvAZAHsBrReRNqvpeY8x/iMg9QRCcaXJ6ZIHv+xtUdReAHQBej/IHGABOAnhORMY6OjoempiYONe0JC3zPM84jjOqqrfi6r/3RQCPAdgXhmHUvOyaa3R01L1w4cJBALdVNq1W1THP87woir7ZzNyocWzf7PA8b4uI7E6S5A9Frqknb6j8eZOIvKNQKPzU9/1/dhznvlwuV0gjn5YbFapW09Vqu/Z9K9u2bdsNruvmUe50axUAfMV13X/I5XInlzcze2x/28lCu1b19fWt7u7u/hCAvwGwboHdL6jq7unp6T1TU1OXlyG9VAwODv5mkiR7Ady6wK6Plkqldz/yyCPfX468bBkaGuqamZm5E8DbReQNANYscMiLIrI1CILnZ280xrwHwL+hck4VkacBDLTS6HVaIxWt/Blm+zauldu3atOmTas2bNjwWRG5s7LplKp+VUQOuq77/bVr17589uzZ9SKy0XGcAVUdFZE/qOx7zHXdXWn0yy31i6sMw/4MyF6BZYy5XlWPiMhvL7BrrKpfcxznE7Uf4ixYqQWW53kbATw060NZr28nSbJzcnLyRBp5pcnzvNtE5CEAvXUecg7ArjAMH00xLWuGhoZuKpVKEwB+p85DXnRd9/ZcLvcDAOjv778un88XAChwtRMWkW+jxTpfYOV1wGxfO1q1fav6+vpWr1u3blxVtwH4uar+/fT09OcW+mJrjBkBcC+AXwdwBoAJw/AZm7m1zC+uUlyNA9g6189buZH7+/t/tbOz8wiANy7isKKqftV13U8eOnToe2nlZttKLLAqJ+qjAF69xBAnZ2Zmbj58+PApm3mlqTJydRTXFldHAUxVXvcBuLnm5+dU9c1RFP1v2jk2YmhoqKtUKj2B+jvfE0mS3D45OflD4OqcHADPh2H4F6h0wp7nva1YLOby+fz5dDKnerB9Vwzxff8BVX0bgFMAdoZheKzeg4eHh9cXi8WvAfAAvOC67ptzudz/WUvOVqBGVO7OmBCR/vn2adWOuL+/v7ezs3MSwKYlhkgAHBSRjwdB8JTF1FKx0gqsymXBxwH8XoOh/ieO41vz+fwVG3mlzRjzKF55WfA8gD8LwzA3ez/P87aLyIMAeqrbVDUfRdHty5Pp0hhjPgDgM9X3qnq/iNwPYM5RCdd1T1RPvLM63+q/ce/sTpiaj+27Mvi+f6eq/iuAi67r9uVyuWcXG6NSjB8B0KeqE1EUvcVWfk3v3OYZuXosjuPt+Xx+ull51WNgYKBHRKIlXDaaS6Kq+6Mo+lMLsVKz0gosz/M+KiKfsBTub8MwvMdSrNQYYzwAYc3m7bXFVZXv+8OqemD2NlUdiKLokbRybJQx5lsANlfefi4Mww/UedyvADgI4I9mbxeRDwdB8C92s0yHrc9wK3922b6Na+X2BYD+/v61nZ2dz6M8cX00DMP9S421ffv2V83MzDwHoNfmucuxEWSpslxcjYyMrHEcZ8xScQUAjoj8vqVYZIHv+xtE5MMWQ941PDy83mK8VIjIW2s2HZ2vuAKAIAgmADyxQIxWM3uu5J56DhgZGVkDYBw1nS+ApwB82VJeZAfbt82tWrXqPSgXV481UlwBwMGDB3+sqncDgIh81EZ+QBMLrKwXV5Uh5NoPYqMyN+m9nanqHVj4bsHF6InjeKfFeKmoLMUw+/2Ct6KLyOM1m2x/NmxbW30RhuGPFtp5jstGVU+JiNdqE57rEYahzB6lWOz7Fsf2be/2hYj8SeXlvTbiFYvFLwK4DOAWY8z1NmI2pcDKcnE1OjraWSgU9uPaD2LDRKSlJwavQCO2A4rIDtsxU7BxsQeoau2Jeak3BDTDL72kUm/n63neaFoJUkPYvm3G9/0NKN9gc7mrq6t2OsOSVGqPSQCuiAzaiLnsBVaWiysAuHDhwn4AQ2nEVtUfpBGXluwNKcRcaBmPVpDMfiMiW+o4pnafZM69MmYxnW9lsj9lCNs3m1T1tSjXL89aXo39WCX+62wEW9YCK+vFVcXLKcbmJcLW8qoUYmZhZOfFmvc3e563fb6djTFvwdUJxfPFyJx6O1/f999a6Xz5ZIwMYftm2o2Vv60+HUVETldeLnoUfy7LVmC1SXEFVf0YgFSeX5QkCQus9tfyIzsicnSObQ/6vj9cu71SXP1nPTGyplAo5FDT+arqk3Ecb5s9J0dV2flmENs3u0REgTmnJjRkVjwrd2Iuy3+adimuACCKotPGmC8A+GvLoZOZmZkXLMekBojIaVX9DcthTy+8S3MlSTIuIu+q2dyjqgeMMU8A+CYAUdUtAOa8izZJkvG081wG19xN5jjO4ByLTLrLlRBZxfbNrjMAICI3LrTjIlVHrqyMjKU+gtVOxVVVHMf/hHkWrGvAiawsQrlSqOqiF61rRkzbOjo6AsxfCG4G8FcAPvhLlih5qVgsWpl42kIyezcZ1YXtmy0/QvlqwG9V1i6zZRMAiIiV+dCpFljtWFwBQOUbzqcth+XlwdZjfRRGRMZsx7St8mT5zzcQ4r52+LKgqp9S1U8B+GTtZSPKPrZvdlXaagrAalU1NmJWCrVtAEqO4xyyETO1S4TtWlxVXbp06b7u7u6/BHCTjXiqygKrxYjIQ6p6L2Y9BqZB51etWtXyBRYAuK77hVKp9H5cnUxarzOu634xjZyWWxRFdzU7B0oP2zfbVPUbIrLFcZwPAfivRuOJyPtUdbWq5m09jzCVEax2L64AYGpq6rKq/qOteI7jsMBqMUEQnFXV3bbiqerdExMT52zFS1Mul7soIovugETkI7lc7mIaORERVRWLxS8BeElVb/F9v6EnR/i+f6Oq3gUAjuPYejSavQLLGKPVP4VC4Wd4ZXF1pKura7Bdiquq3t7efwfwnKVwLLBa0PT09B5U1kZp0BPFYvGzFuIsmyAI7kf5uWz1OhgEwTV3FLaoX5yLKosWLknNsZcayohsYvu2uUo98TEAUNW9vu8vad3CoaGhLlX9BoBeAONBEByxleNyLNPwWBzHOywvBtYS9u3bV1LVj1sKxwKrBU1NTV12XXcXgFMNhDmpqndkcF6SisifAzhRx76n4jh+Byzd3rwMjldfqOqSV+xPkmT2yvzH592RlhvbdwUIw3AvgAcArFPVcHBwcFHPBvZ9f0OpVDqA8qrwL8Rx/E6b+VkvsGqfZ9ROlwXnEkXRfgDfajCMXrx48Yc28iH7crncSVXdrKpPLvZYEXk6SZItURS1/PIMcwmC4KzjOCMAam9dn+0SgJ35fP4ny5SWDQ/Mer3HGLPoTtgYMyIiv3gOmqpmZfRuJWD7rgwax/G7UH7EzcYkSf7bGHNXX1/f6oUO9H1/Z+WcPoDysgw7bJ/DUl8Hq52LqwoVkb9T1WiRx8UoX158RlWfnJqaupxCbmRJFEWn+/r6buvu7v4ggI9g4Ynv50XknkKh8JkMjly9wqFDh77j+/6oqo4BqD1xXRaRPw6CwMZl1GXjuu6XSqXSOwH8LoD1AMaMMecA1PtF53WV4wCUC+menp699jOlpWD7rhz5fP5Kf3//UFdX132q+l4Ad3d3d7/fGPN1EZlQ1e/19PS8dPbs2fWu694kIgOqOqqqm4Dy4rKlUumOw4cPN3KVYk7WVkE1xsx5aSBLT+duhDEmQrkSnssZlIeXnxWRY6p6PI7j41nveFeq4eHh9XEc7xSRnQBej6t3kp5EuWh+OI7jh+dYsDDTfN/frKrjAKpPmv9pkiS7JicnH29mXku1devWV3d0dBxAuRNeMhF5ulgsjqRxgk7DfOfqxWr1czvbtzGt3r5zGRwc7FPV3ap6y0L7ishPAHx63bp1e/bt2xenkQ8LLEuMMZtE5JCqfhfAMwCeSZLkO2vWrDk+NjbGyZHUFjzP2yginwcAVX1fVi99Vo2OjnaeP3/+3SLydgBvBNBd56GXAHxXVR/s7e3dm9YJOg0rqQNm+y5dFtp3HmKM2QxgF8qr9b8GwA0AzgH4MYBjIjJ28eLFkFeOiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIhWgv8Hnffz4dmwY9cAAAAASUVORK5CYII=);background-image:linear-gradient(transparent,transparent),url("data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'%20standalone='no'?%3e%3csvg%20xmlns:dc='http://purl.org/dc/elements/1.1/'%20xmlns:cc='http://creativecommons.org/ns%23'%20xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns%23'%20xmlns:svg='http://www.w3.org/2000/svg'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20xmlns:sodipodi='http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd'%20xmlns:inkscape='http://www.inkscape.org/namespaces/inkscape'%20viewBox='0%200%20600%2060'%20height='60'%20width='600'%20id='svg4225'%20version='1.1'%20inkscape:version='0.91%20r13725'%20sodipodi:docname='spritesheet.svg'%20inkscape:export-filename='/home/fpuga/development/upstream/icarto.Leaflet.draw/src/images/spritesheet-2x.png'%20inkscape:export-xdpi='90'%20inkscape:export-ydpi='90'%3e%3cmetadata%20id='metadata4258'%3e%3crdf:RDF%3e%3ccc:Work%20rdf:about=''%3e%3cdc:format%3eimage/svg+xml%3c/dc:format%3e%3cdc:type%20rdf:resource='http://purl.org/dc/dcmitype/StillImage'%20/%3e%3cdc:title%20/%3e%3c/cc:Work%3e%3c/rdf:RDF%3e%3c/metadata%3e%3cdefs%20id='defs4256'%20/%3e%3csodipodi:namedview%20pagecolor='%23ffffff'%20bordercolor='%23666666'%20borderopacity='1'%20objecttolerance='10'%20gridtolerance='10'%20guidetolerance='10'%20inkscape:pageopacity='0'%20inkscape:pageshadow='2'%20inkscape:window-width='1920'%20inkscape:window-height='1056'%20id='namedview4254'%20showgrid='false'%20inkscape:zoom='1.3101852'%20inkscape:cx='237.56928'%20inkscape:cy='7.2419621'%20inkscape:window-x='1920'%20inkscape:window-y='24'%20inkscape:window-maximized='1'%20inkscape:current-layer='svg4225'%20/%3e%3cg%20id='enabled'%20style='fill:%23464646;fill-opacity:1'%3e%3cg%20id='polyline'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%2018,36%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4229'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2036,18%200,6%206,0%200,-6%20-6,0%20z%20m%204,4%20-2,0%200,-2%202,0%200,2%20z'%20id='path4231'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%2023.142,39.145%20-2.285,-2.29%2016,-15.998%202.285,2.285%20z'%20id='path4233'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cpath%20id='polygon'%20d='M%20100,24.565%2097.904,39.395%2083.07,42%2076,28.773%2086.463,18%20Z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='rectangle'%20d='m%20140,20%2020,0%200,20%20-20,0%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='circle'%20d='m%20221,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20id='marker'%20d='m%20270,19%20c%20-4.971,0%20-9,4.029%20-9,9%200,4.971%205.001,12%209,14%204.001,-2%209,-9.029%209,-14%200,-4.971%20-4.029,-9%20-9,-9%20z%20m%200,12.5%20c%20-2.484,0%20-4.5,-2.014%20-4.5,-4.5%200,-2.484%202.016,-4.5%204.5,-4.5%202.485,0%204.5,2.016%204.5,4.5%200,2.486%20-2.015,4.5%20-4.5,4.5%20z'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cg%20id='edit'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20337,30.156%200,0.407%200,5.604%20c%200,1.658%20-1.344,3%20-3,3%20l%20-10,0%20c%20-1.655,0%20-3,-1.342%20-3,-3%20l%200,-10%20c%200,-1.657%201.345,-3%203,-3%20l%206.345,0%203.19,-3.17%20-9.535,0%20c%20-3.313,0%20-6,2.687%20-6,6%20l%200,10%20c%200,3.313%202.687,6%206,6%20l%2010,0%20c%203.314,0%206,-2.687%206,-6%20l%200,-8.809%20-3,2.968'%20id='path4240'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.72,24.637%20-8.892,8.892%20-2.828,0%200,-2.829%208.89,-8.89%20z'%20id='path4242'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20338.697,17.826%204,0%200,4%20-4,0%20z'%20transform='matrix(-0.70698336,-0.70723018,0.70723018,-0.70698336,567.55917,274.78273)'%20id='path4244'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3cg%20id='remove'%20style='fill:%23464646;fill-opacity:1'%3e%3cpath%20d='m%20381,42%2018,0%200,-18%20-18,0%200,18%20z%20m%2014,-16%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z%20m%20-4,0%202,0%200,14%20-2,0%200,-14%20z'%20id='path4247'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3cpath%20d='m%20395,20%200,-4%20-10,0%200,4%20-6,0%200,2%2022,0%200,-2%20-6,0%20z%20m%20-2,0%20-6,0%200,-2%206,0%200,2%20z'%20id='path4249'%20inkscape:connector-curvature='0'%20style='fill:%23464646;fill-opacity:1'%20/%3e%3c/g%3e%3c/g%3e%3cg%20id='disabled'%20transform='translate(120,0)'%20style='fill:%23bbbbbb'%3e%3cuse%20xlink:href='%23edit'%20id='edit-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3cuse%20xlink:href='%23remove'%20id='remove-disabled'%20x='0'%20y='0'%20width='100%25'%20height='100%25'%20/%3e%3c/g%3e%3cpath%20style='fill:none;stroke:%23464646;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1'%20id='circle-3'%20d='m%20581.65725,30%20c%200,6.078%20-4.926,11%20-11,11%20-6.074,0%20-11,-4.922%20-11,-11%200,-6.074%204.926,-11%2011,-11%206.074,0%2011,4.926%2011,11%20z'%20inkscape:connector-curvature='0'%20/%3e%3c/svg%3e")}.leaflet-draw a{display:block;text-align:center;text-decoration:none}.leaflet-draw a .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.leaflet-draw-actions{display:none;list-style:none;margin:0;padding:0;position:absolute;left:26px;top:0;white-space:nowrap}.leaflet-touch .leaflet-draw-actions{left:32px}.leaflet-right .leaflet-draw-actions{right:26px;left:auto}.leaflet-touch .leaflet-right .leaflet-draw-actions{right:32px;left:auto}.leaflet-draw-actions li{display:inline-block}.leaflet-draw-actions li:first-child a{border-left:0}.leaflet-draw-actions li:last-child a{-webkit-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.leaflet-right .leaflet-draw-actions li:last-child a{-webkit-border-radius:0;border-radius:0}.leaflet-right .leaflet-draw-actions li:first-child a{-webkit-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.leaflet-draw-actions a{background-color:#919187;border-left:1px solid #AAA;color:#fff;font:11px/19px Helvetica Neue,Arial,Helvetica,sans-serif;line-height:28px;text-decoration:none;padding-left:10px;padding-right:10px;height:28px}.leaflet-touch .leaflet-draw-actions a{font-size:12px;line-height:30px;height:30px}.leaflet-draw-actions-bottom{margin-top:0}.leaflet-draw-actions-top{margin-top:1px}.leaflet-draw-actions-top a,.leaflet-draw-actions-bottom a{height:27px;line-height:27px}.leaflet-draw-actions a:hover{background-color:#a0a098}.leaflet-draw-actions-top.leaflet-draw-actions-bottom a{height:26px;line-height:26px}.leaflet-draw-toolbar .leaflet-draw-draw-polyline{background-position:-2px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-polyline{background-position:0 -1px}.leaflet-draw-toolbar .leaflet-draw-draw-polygon{background-position:-31px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-polygon{background-position:-29px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-rectangle{background-position:-62px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-rectangle{background-position:-60px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-circle{background-position:-92px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-circle{background-position:-90px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-marker{background-position:-122px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-marker{background-position:-120px -1px}.leaflet-draw-toolbar .leaflet-draw-draw-circlemarker{background-position:-273px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-draw-circlemarker{background-position:-271px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-edit{background-position:-152px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-edit{background-position:-150px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-remove{background-position:-182px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-remove{background-position:-180px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-edit.leaflet-disabled{background-position:-212px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-edit.leaflet-disabled{background-position:-210px -1px}.leaflet-draw-toolbar .leaflet-draw-edit-remove.leaflet-disabled{background-position:-242px -2px}.leaflet-touch .leaflet-draw-toolbar .leaflet-draw-edit-remove.leaflet-disabled{background-position:-240px -2px}.leaflet-mouse-marker{background-color:#fff;cursor:crosshair}.leaflet-draw-tooltip{background:#363636;background:#00000080;border:1px solid transparent;-webkit-border-radius:4px;border-radius:4px;color:#fff;font:12px/18px Helvetica Neue,Arial,Helvetica,sans-serif;margin-left:20px;margin-top:-21px;padding:4px 8px;position:absolute;visibility:hidden;white-space:nowrap;z-index:6}.leaflet-draw-tooltip:before{border-right:6px solid black;border-right-color:#00000080;border-top:6px solid transparent;border-bottom:6px solid transparent;content:"";position:absolute;top:7px;left:-7px}.leaflet-error-draw-tooltip{background-color:#f2dede;border:1px solid #e6b6bd;color:#b94a48}.leaflet-error-draw-tooltip:before{border-right-color:#e6b6bd}.leaflet-draw-tooltip-single{margin-top:-12px}.leaflet-draw-tooltip-subtext{color:#f8d5e4}.leaflet-draw-guide-dash{font-size:1%;opacity:.6;position:absolute;width:5px;height:5px}.leaflet-edit-marker-selected{background-color:#fe57a11a;border:4px dashed rgba(254,87,161,.6);-webkit-border-radius:4px;border-radius:4px;box-sizing:content-box}.leaflet-edit-move{cursor:move}.leaflet-edit-resize{cursor:pointer}.leaflet-oldie .leaflet-draw-toolbar{border:1px solid #999}.leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{-webkit-transition:-webkit-transform .3s ease-out,opacity .3s ease-in;-moz-transition:-moz-transform .3s ease-out,opacity .3s ease-in;-o-transition:-o-transform .3s ease-out,opacity .3s ease-in;transition:transform .3s ease-out,opacity .3s ease-in}.leaflet-cluster-spider-leg{-webkit-transition:-webkit-stroke-dashoffset .3s ease-out,-webkit-stroke-opacity .3s ease-in;-moz-transition:-moz-stroke-dashoffset .3s ease-out,-moz-stroke-opacity .3s ease-in;-o-transition:-o-stroke-dashoffset .3s ease-out,-o-stroke-opacity .3s ease-in;transition:stroke-dashoffset .3s ease-out,stroke-opacity .3s ease-in}.marker-cluster-small{background-color:#b5e28c99}.marker-cluster-small div{background-color:#6ecc3999}.marker-cluster-medium{background-color:#f1d35799}.marker-cluster-medium div{background-color:#f0c20c99}.marker-cluster-large{background-color:#fd9c7399}.marker-cluster-large div{background-color:#f1801799}.leaflet-oldie .marker-cluster-small{background-color:#b5e28c}.leaflet-oldie .marker-cluster-small div{background-color:#6ecc39}.leaflet-oldie .marker-cluster-medium{background-color:#f1d357}.leaflet-oldie .marker-cluster-medium div{background-color:#f0c20c}.leaflet-oldie .marker-cluster-large{background-color:#fd9c73}.leaflet-oldie .marker-cluster-large div{background-color:#f18017}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{width:30px;height:30px;margin-left:5px;margin-top:5px;text-align:center;border-radius:15px;font:12px Helvetica Neue,Arial,Helvetica,sans-serif}.marker-cluster span{line-height:30px}.beautify-marker{text-align:center;font-weight:700;font-family:monospace;position:absolute;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.beautify-marker.selected>div{outline:none;border-color:red;box-shadow:0 0 10px red}.beautify-marker.circle,.beautify-marker.circle-dot,.beautify-marker.doughnut{border-radius:100%}.beautify-marker.marker{border-radius:50% 50% 0% 100%/50% 100% 0% 50%;transform:rotate(45deg)}.beautify-marker.marker>*{transform:rotate(-45deg)}g.d3-overlay *{pointer-events:visiblePainted}.map_Leaflet .leaflet-container{background-color:#f000;background:#f000}.cluster-circle{background-clip:padding-box;font:12px Helvetica Neue,Arial,Helvetica,sans-serif}.cluster-circle>div{width:40px;height:40px;text-align:center;border-radius:20px}.cluster-circle>div>div{display:inline-block;margin-top:5px;width:30px;height:30px;text-align:center;border-radius:15px;font:12px Helvetica Neue,Arial,Helvetica,sans-serif}.cluster-circle span{line-height:30px}.leaflet-interactive.selected{stroke:red;stroke-width:1.25px}`)),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ (function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@hpcc-js/common"),require("@hpcc-js/api"),require("@hpcc-js/layout"),require("@hpcc-js/util"),require("@hpcc-js/graph"),require("@hpcc-js/other")):typeof define=="function"&&define.amd?define(["exports","@hpcc-js/common","@hpcc-js/api","@hpcc-js/layout","@hpcc-js/util","@hpcc-js/graph","@hpcc-js/other"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global["@hpcc-js/map"]={},global["@hpcc-js/common"],global["@hpcc-js/api"],global["@hpcc-js/layout"],global["@hpcc-js/util"],global["@hpcc-js/graph"],global["@hpcc-js/other"]))})(this,function(exports2,common,api,layout,util,graph,other){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);function _mergeNamespaces(n,m){for(var i=0;i<m.length;i++){const e=m[i];if(typeof e!="string"&&!Array.isArray(e)){for(const k in e)if(k!=="default"&&!(k in n)){const d=Object.getOwnPropertyDescriptor(e,k);d&&Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:()=>e[k]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}const PKG_NAME="@hpcc-js/map",PKG_VERSION="3.1.1",BUILD_VERSION="3.2.1";function tree_add(d){var x=+this._x.call(null,d),y=+this._y.call(null,d);return add$1(this.cover(x,y),x,y,d)}function add$1(tree,x,y,d){if(isNaN(x)||isNaN(y))return tree;var parent,node=tree._root,leaf={data:d},x02=tree._x0,y02=tree._y0,x12=tree._x1,y12=tree._y1,xm,ym,xp,yp,right,bottom,i,j;if(!node)return tree._root=leaf,tree;for(;node.length;)if((right=x>=(xm=(x02+x12)/2))?x02=xm:x12=xm,(bottom=y>=(ym=(y02+y12)/2))?y02=ym:y12=ym,parent=node,!(node=node[i=bottom<<1|right]))return parent[i]=leaf,tree;if(xp=+tree._x.call(null,node.data),yp=+tree._y.call(null,node.data),x===xp&&y===yp)return leaf.next=node,parent?parent[i]=leaf:tree._root=leaf,tree;do parent=parent?parent[i]=new Array(4):tree._root=new Array(4),(right=x>=(xm=(x02+x12)/2))?x02=xm:x12=xm,(bottom=y>=(ym=(y02+y12)/2))?y02=ym:y12=ym;while((i=bottom<<1|right)===(j=(yp>=ym)<<1|xp>=xm));return parent[j]=node,parent[i]=leaf,tree}function addAll(data){var d,i,n=data.length,x,y,xz=new Array(n),yz=new Array(n),x02=1/0,y02=1/0,x12=-1/0,y12=-1/0;for(i=0;i<n;++i)isNaN(x=+this._x.call(null,d=data[i]))||isNaN(y=+this._y.call(null,d))||(xz[i]=x,yz[i]=y,x<x02&&(x02=x),x>x12&&(x12=x),y<y02&&(y02=y),y>y12&&(y12=y));if(x02>x12||y02>y12)return this;for(this.cover(x02,y02).cover(x12,y12),i=0;i<n;++i)add$1(this,xz[i],yz[i],data[i]);return this}function tree_cover(x,y){if(isNaN(x=+x)||isNaN(y=+y))return this;var x02=this._x0,y02=this._y0,x12=this._x1,y12=this._y1;if(isNaN(x02))x12=(x02=Math.floor(x))+1,y12=(y02=Math.floor(y))+1;else{for(var z=x12-x02,node=this._root,parent,i;x02>x||x>=x12||y02>y||y>=y12;)switch(i=(y<y02)<<1|x<x02,parent=new Array(4),parent[i]=node,node=parent,z*=2,i){case 0:x12=x02+z,y12=y02+z;break;case 1:x02=x12-z,y12=y02+z;break;case 2:x12=x02+z,y02=y12-z;break;case 3:x02=x12-z,y02=y12-z;break}this._root&&this._root.length&&(this._root=node)}return this._x0=x02,this._y0=y02,this._x1=x12,this._y1=y12,this}function tree_data(){var data=[];return this.visit(function(node){if(!node.length)do data.push(node.data);while(node=node.next)}),data}function tree_extent(_){return arguments.length?this.cover(+_[0][0],+_[0][1]).cover(+_[1][0],+_[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function Quad(node,x02,y02,x12,y12){this.node=node,this.x0=x02,this.y0=y02,this.x1=x12,this.y1=y12}function tree_find(x,y,radius2){var data,x02=this._x0,y02=this._y0,x12,y12,x2,y2,x3=this._x1,y3=this._y1,quads=[],node=this._root,q,i;for(node&&quads.push(new Quad(node,x02,y02,x3,y3)),radius2==null?radius2=1/0:(x02=x-radius2,y02=y-radius2,x3=x+radius2,y3=y+radius2,radius2*=radius2);q=quads.pop();)if(!(!(node=q.node)||(x12=q.x0)>x3||(y12=q.y0)>y3||(x2=q.x1)<x02||(y2=q.y1)<y02))if(node.length){var xm=(x12+x2)/2,ym=(y12+y2)/2;quads.push(new Quad(node[3],xm,ym,x2,y2),new Quad(node[2],x12,ym,xm,y2),new Quad(node[1],xm,y12,x2,ym),new Quad(node[0],x12,y12,xm,ym)),(i=(y>=ym)<<1|x>=xm)&&(q=quads[quads.length-1],quads[quads.length-1]=quads[quads.length-1-i],quads[quads.length-1-i]=q)}else{var dx=x-+this._x.call(null,node.data),dy=y-+this._y.call(null,node.data),d2=dx*dx+dy*dy;if(d2<radius2){var d=Math.sqrt(radius2=d2);x02=x-d,y02=y-d,x3=x+d,y3=y+d,data=node.data}}return data}function tree_remove(d){if(isNaN(x=+this._x.call(null,d))||isNaN(y=+this._y.call(null,d)))return this;var parent,node=this._root,retainer,previous,next,x02=this._x0,y02=this._y0,x12=this._x1,y12=this._y1,x,y,xm,ym,right,bottom,i,j;if(!node)return this;if(node.length)for(;;){if((right=x>=(xm=(x02+x12)/2))?x02=xm:x12=xm,(bottom=y>=(ym=(y02+y12)/2))?y02=ym:y12=ym,parent=node,!(node=node[i=bottom<<1|right]))return this;if(!node.length)break;(parent[i+1&3]||parent[i+2&3]||parent[i+3&3])&&(retainer=parent,j=i)}for(;node.data!==d;)if(previous=node,!(node=node.next))return this;return(next=node.next)&&delete node.next,previous?(next?previous.next=next:delete previous.next,this):parent?(next?parent[i]=next:delete parent[i],(node=parent[0]||parent[1]||parent[2]||parent[3])&&node===(parent[3]||parent[2]||parent[1]||parent[0])&&!node.length&&(retainer?retainer[j]=node:this._root=node),this):(this._root=next,this)}function removeAll(data){for(var i=0,n=data.length;i<n;++i)this.remove(data[i]);return this}function tree_root(){return this._root}function tree_size(){var size=0;return this.visit(function(node){if(!node.length)do++size;while(node=node.next)}),size}function tree_visit(callback){var quads=[],q,node=this._root,child,x02,y02,x12,y12;for(node&&quads.push(new Quad(node,this._x0,this._y0,this._x1,this._y1));q=quads.pop();)if(!callback(node=q.node,x02=q.x0,y02=q.y0,x12=q.x1,y12=q.y1)&&node.length){var xm=(x02+x12)/2,ym=(y02+y12)/2;(child=node[3])&&quads.push(new Quad(child,xm,ym,x12,y12)),(child=node[2])&&quads.push(new Quad(child,x02,ym,xm,y12)),(child=node[1])&&quads.push(new Quad(child,xm,y02,x12,ym)),(child=node[0])&&quads.push(new Quad(child,x02,y02,xm,ym))}return this}function tree_visitAfter(callback){var quads=[],next=[],q;for(this._root&&quads.push(new Quad(this._root,this._x0,this._y0,this._x1,this._y1));q=quads.pop();){var node=q.node;if(node.length){var child,x02=q.x0,y02=q.y0,x12=q.x1,y12=q.y1,xm=(x02+x12)/2,ym=(y02+y12)/2;(child=node[0])&&quads.push(new Quad(child,x02,y02,xm,ym)),(child=node[1])&&quads.push(new Quad(child,xm,y02,x12,ym)),(child=node[2])&&quads.push(new Quad(child,x02,ym,xm,y12)),(child=node[3])&&quads.push(new Quad(child,xm,ym,x12,y12))}next.push(q)}for(;q=next.pop();)callback(q.node,q.x0,q.y0,q.x1,q.y1);return this}function defaultX(d){return d[0]}function tree_x(_){return arguments.length?(this._x=_,this):this._x}function defaultY(d){return d[1]}function tree_y(_){return arguments.length?(this._y=_,this):this._y}function quadtree(nodes,x,y){var tree=new Quadtree$1(x??defaultX,y??defaultY,NaN,NaN,NaN,NaN);return nodes==null?tree:tree.addAll(nodes)}function Quadtree$1(x,y,x02,y02,x12,y12){this._x=x,this._y=y,this._x0=x02,this._y0=y02,this._x1=x12,this._y1=y12,this._root=void 0}function leaf_copy(leaf){for(var copy={data:leaf.data},next=copy;leaf=leaf.next;)next=next.next={data:leaf.data};return copy}var treeProto=quadtree.prototype=Quadtree$1.prototype;treeProto.copy=function(){var copy=new Quadtree$1(this._x,this._y,this._x0,this._y0,this._x1,this._y1),node=this._root,nodes,child;if(!node)return copy;if(!node.length)return copy._root=leaf_copy(node),copy;for(nodes=[{source:node,target:copy._root=new Array(4)}];node=nodes.pop();)for(var i=0;i<4;++i)(child=node.source[i])&&(child.length?nodes.push({source:child,target:node.target[i]=new Array(4)}):node.target[i]=leaf_copy(child));return copy},treeProto.add=tree_add,treeProto.addAll=addAll,treeProto.cover=tree_cover,treeProto.data=tree_data,treeProto.extent=tree_extent,treeProto.find=tree_find,treeProto.remove=tree_remove,treeProto.removeAll=removeAll,treeProto.root=tree_root,treeProto.size=tree_size,treeProto.visit=tree_visit,treeProto.visitAfter=tree_visitAfter,treeProto.x=tree_x,treeProto.y=tree_y;class Quadtree{constructor(extent2,raw_data,pin_h,pin_w){__publicField(this,"_pin_h",0);__publicField(this,"_pin_w",0);__publicField(this,"_tree");this._pin_h=pin_h,this._pin_w=pin_w,this._tree=quadtree().extent(extent2).addAll(raw_data)}searchRect(left,top,right,bottom){const ret=[];return this._tree.visit((node,x12,y12,x2,y2)=>{let next_exists=!1;do node.length||node.data&&!node.data.already_flagged&&overlaps({left,right,top,bottom},node.data)&&(node.data.already_flagged=!0,ret.push(node.data)),next_exists=node=node.next;while(next_exists);return x12>=right||y12>=bottom||x2<left||y2<top}),ret;function overlaps(r1,point){return(point[0]<r1.right||point[0]>r1.left)&&(point[1]<r1.bottom||point[1]>r1.top)}}getTreeRects(){const ret=[];return this._tree.visit((node,x12,y12,x2,y2)=>{ret.push([x12,y12,x2-x12,y2-y12])}),ret}}class CanvasPins extends common.CanvasWidget{constructor(){super();__publicField(this,"_quadtree_rect_arr");__publicField(this,"_drawData");__publicField(this,"_overlap_count",0);__publicField(this,"_sub_overlap_count",0)}enter(domNode,element){super.enter.apply(this,arguments),this.resize(this._size)}update(domNode,element){super.update.apply(this,arguments),this._ctx=this.element().node().getContext("2d");const _data=(this.topLeftX_exists()&&this.topLeftY_exists()&&this.bottomRightX_exists()&&this.bottomRightY_exists()?this.skewedData():this.data()).map(row=>[...row]).map(row=>(row.is_cluster=!1,row.already_flagged=!1,row.weight=row[2],row.fillStyle="#FFFFFF",row.strokeStyle="#000000",row.overlap_arr=[],row));this._ctx.clearRect(0,0,this.width(),this.height()),this._drawData=this.enableClustering()?this.applyClustering(_data):_data,this.draw(this._drawData)}applyClustering(_data){const context=this;this._overlap_count=0;const arrow_height=8,pin_h=this.pinHeight(),pin_w=this.pinWidth(),half_w=pin_w/2,half_h=pin_h/2,qt=new Quadtree([[0,0],[this.size().width,this.size().height]],_data,pin_h,pin_w);switch(this._quadtree_rect_arr=qt.getTreeRects(),this.clusterMode()){case"default":const defData=_data.map(row=>{if(!row.already_flagged){const mult=this.searchRectMult(),left=row[0]-half_w*mult,top=row[1]-half_h*mult-arrow_height,right=row[0]+half_w*mult,bottom=row[1]+half_h*mult-arrow_height;row.overlap_arr=qt.searchRect(left,top,right,bottom).filter(n=>n!==row),row.overlap_arr.length===0&&(row.already_flagged=!1)}return row});return defData.forEach(data_row=>{data_row.already_flagged&&data_row.overlap_arr.length&&defData.push(cluster_arr([data_row,...data_row.overlap_arr]))}),defData;case"grid":const gridData=[..._data],grid_cell_w=this.gridCellSize(),grid_cell_h=this.gridCellSize(),grid_row_count=Math.ceil(this.size().width/grid_cell_w),grid_col_count=Math.ceil(this.size().height/grid_cell_h);for(let _col=0;_col<grid_col_count;_col++)for(let _row=0;_row<grid_row_count;_row++){const left=grid_cell_w*_row,top=grid_cell_h*_col,right=grid_cell_w*(_row+1),bottom=grid_cell_h*(_col+1),overlap_arr=qt.searchRect(left,top,right,bottom);if(overlap_arr.length>1){const x=left+grid_cell_w/2,y=top+grid_cell_h/2;gridData.push(cluster_arr(overlap_arr,x,y))}}return gridData}return _data;function cluster_arr(arr,x,y){const arr_weight=arr.reduce((a,b)=>(b.already_flagged=!0,a+b[2]),0),_x=typeof x<"u"?x:context.useAveragePos()?arr.reduce((a,b)=>a+b[0]*b[2],0)/arr_weight:arr[0][0],_y=typeof y<"u"?y:context.useAveragePos()?arr.reduce((a,b)=>a+b[1]*b[2],0)/arr_weight:arr[0][1];return{0:_x,1:_y,weight:arr.reduce((a,b)=>a+b[2],0),is_cluster:!0,already_flagged:!1,fillStyle:"#FFFFFF",strokeStyle:"#000000",overlap_arr:[]}}}drawQuadtree(){this._quadtree_rect_arr&&(this._ctx.strokeStyle="#000000",this._quadtree_rect_arr.forEach(n=>{this._ctx.strokeRect(n[0],n[1],n[2],n[3])}))}draw(data_arr){const context=this,ctx=this._ctx;this.showQuadtree()&&this.drawQuadtree();const arrow_height=this.arrowHeight(),arrow_width=this.arrowWidth(),pin_h=this.pinHeight(),pin_w=this.pinWidth(),weight_bonus=this.radiusWeightMult();let heaviest_cluster=0;this.useWeightedRadius()&&data_arr.filter(n=>n.is_cluster).forEach(n=>{heaviest_cluster<n.weight&&(heaviest_cluster=n.weight)}),data_arr.filter(n=>!n.already_flagged).sort((a,b)=>a[1]>b[1]?1:-1).forEach(d=>{if(d.is_cluster||this.allCircles()){let _radius=pin_w/2;this.useWeightedRadius()&&(_radius+=pin_w*(weight_bonus*d.weight/heaviest_cluster)),drawCirclePin({icon:d.weight,left:Math.floor(d[0]-_radius)+.5,top:Math.floor(d[1]-_radius-arrow_height)+.5,radius:_radius,arrow_height,arrow_width})}else drawSquarePin({fillStyle:d.fillStyle,strokeStyle:d.strokeStyle,icon:d.weight,left:Math.floor(d[0]-pin_w/2)+.5,top:Math.floor(d[1]-pin_h-arrow_height)+.5,width:pin_w,height:pin_h,arrow_height,arrow_width})});function drawCirclePin(p){p.width=p.radius*2,p.height=p.width,ctx.fillStyle="#FFFFFF",ctx.strokeStyle="#000000",ctx.beginPath(),ctx.arc(p.left+p.width/2,p.top+p.height/2,p.radius,0,2*Math.PI),ctx.closePath(),ctx.fill(),ctx.stroke(),drawPinText(p)}function drawSquarePin(p){ctx.fillStyle=p.fillStyle,ctx.strokeStyle="#000000",ctx.fillRect(p.left,p.top,p.width,p.height),ctx.strokeRect(p.left,p.top,p.width,p.height),drawArrow(p),drawPinText(p)}function drawArrow(p,is_offset){const a_x0=p.left+p.width/2-p.arrow_width/2,a_x1=p.left+p.width/2,a_x2=p.left+p.width/2+p.arrow_width/2;let a_y0=p.top+p.height,a_y1=a_y0+p.arrow_height,a_y2=a_y0;is_offset?(ctx.fillStyle="#FFFFFF",ctx.strokeStyle="#FFFFFF",a_y0-=2,a_y1-=2,a_y2-=2):(ctx.fillStyle="#FFFFFF",ctx.strokeStyle="#000000"),ctx.beginPath(),ctx.moveTo(a_x0,a_y0),ctx.lineTo(a_x1,a_y1),ctx.lineTo(a_x2,a_y2),ctx.lineTo(a_x0,a_y0),ctx.closePath(),ctx.stroke(),ctx.fill(),is_offset||drawArrow(p,!0)}function drawPinText(p){ctx.font=`${context.pinFontSize()}px '${context.pinFontFamily()}'`;const x=p.left+p.width/2,y=p.top+p.height/2;ctx.textAlign="center",ctx.textBaseline="middle",ctx.fillStyle="#000000";let size_dec=0,txt_w=ctx.measureText(p.icon).width;for(;txt_w>p.width||!context.shrinkFontToPin();)size_dec++,ctx.font=`${context.pinFontSize()-size_dec}px '${context.pinFontFamily()}'`,txt_w=ctx.measureText(p.icon).width;ctx.fillText(p.icon,x,y)}}skewedData(){const context=this,retArr=[],arr=this.data(),box=this.size(),coordsWidth=this.bottomRightX()-this.topLeftX(),coordsHeight=this.bottomRightY()-this.topLeftY(),pixelValueX=coordsWidth/box.width,pixelValueY=coordsHeight/box.height;return arr.forEach(function(n){const left=Math.abs(n[0]-context.topLeftX()),top=Math.abs(n[1]-context.topLeftY()),newX=left/pixelValueX,newY=top/pixelValueY;retArr.push([newX,newY,n[2]])}),retArr}}CanvasPins.prototype._class+=" map_CanvasPins",CanvasPins.prototype.publish("clusterMode","default","set","clusterMode",["defualt","grid"],{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("gridCellSize",80,"number","gridCellSize",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("allCircles",!1,"boolean","allCircles",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("showQuadtree",!1,"boolean","showQuadtree",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("useAveragePos",!1,"boolean","useAveragePos",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("shrinkFontToPin",!0,"boolean","shrinkFontToPin",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("enableClustering",!0,"boolean","enableClustering",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("useWeightedRadius",!1,"boolean","useWeightedRadius",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("radiusWeightMult",.5,"number","radiusWeightMult",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("searchRectMult",3,"number","searchRectMult",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("bottomRightX",null,"number","Bottom right x-value",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("bottomRightY",null,"number","Bottom right y-value",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("topLeftX",null,"number","Top left x-value",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("topLeftY",null,"number","Top left y-value",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("pinHeight",20,"number","pinHeight",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("pinWidth",20,"number","pinWidth",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("pinFontFamily","Arial","string","pinFontFamily",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("pinFontSize",14,"number","pinFontSize",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("arrowHeight",8,"number","arrowHeight",null,{tags:["Basic"],optional:!0}),CanvasPins.prototype.publish("arrowWidth",8,"number","arrowWidth",null,{tags:["Basic"],optional:!0});function adder(){return new Adder}function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(y){add(temp,y,this.t),add(this,temp.s,this.s),this.s?this.t+=temp.t:this.s=temp.t},valueOf:function(){return this.s}};var temp=new Adder;function add(adder2,a,b){var x=adder2.s=a+b,bv=x-a,av=x-bv;adder2.t=a-av+(b-bv)}var epsilon=1e-6,epsilon2=1e-12,pi=Math.PI,halfPi=pi/2,quarterPi=pi/4,tau=pi*2,degrees=180/pi,radians=pi/180,abs=Math.abs,atan=Math.atan,atan2=Math.atan2,cos=Math.cos,ceil=Math.ceil,exp=Math.exp,log=Math.log,pow=Math.pow,sin=Math.sin,sign=Math.sign||function(x){return x>0?1:x<0?-1:0},sqrt=Math.sqrt,tan=Math.tan;function acos(x){return x>1?0:x<-1?pi:Math.acos(x)}function asin(x){return x>1?halfPi:x<-1?-halfPi:Math.asin(x)}function haversin(x){return(x=sin(x/2))*x}function noop$1(){}function streamGeometry(geometry,stream){geometry&&streamGeometryType.hasOwnProperty(geometry.type)&&streamGeometryType[geometry.type](geometry,stream)}var streamObjectType={Feature:function(object2,stream){streamGeometry(object2.geometry,stream)},FeatureCollection:function(object2,stream){for(var features2=object2.features,i=-1,n=features2.length;++i<n;)streamGeometry(features2[i].geometry,stream)}},streamGeometryType={Sphere:function(object2,stream){stream.sphere()},Point:function(object2,stream){object2=object2.coordinates,stream.point(object2[0],object2[1],object2[2])},MultiPoint:function(object2,stream){for(var coordinates2=object2.coordinates,i=-1,n=coordinates2.length;++i<n;)object2=coordinates2[i],stream.point(object2[0],object2[1],object2[2])},LineString:function(object2,stream){streamLine(object2.coordinates,stream,0)},MultiLineString:function(object2,stream){for(var coordinates2=object2.coordinates,i=-1,n=coordinates2.length;++i<n;)streamLine(coordinates2[i],stream,0)},Polygon:function(object2,stream){streamPolygon(object2.coordinates,stream)},MultiPolygon:function(object2,stream){for(var coordinates2=object2.coordinates,i=-1,n=coordinates2.length;++i<n;)streamPolygon(coordinates2[i],stream)},GeometryCollection:function(object2,stream){for(var geometries=object2.geometries,i=-1,n=geometries.length;++i<n;)streamGeometry(geometries[i],stream)}};function streamLine(coordinates2,stream,closed){var i=-1,n=coordinates2.length-closed,coordinate;for(stream.lineStart();++i<n;)coordinate=coordinates2[i],stream.point(coordinate[0],coordinate[1],coordinate[2]);stream.lineEnd()}function streamPolygon(coordinates2,stream){var i=-1,n=coordinates2.length;for(stream.polygonStart();++i<n;)streamLine(coordinates2[i],stream,1);stream.polygonEnd()}function geoStream(object2,stream){object2&&streamObjectType.hasOwnProperty(object2.type)?streamObjectType[object2.type](object2,stream):streamGeometry(object2,stream)}var areaRingSum$1=adder(),areaSum$1=adder(),lambda00$2,phi00$2,lambda0$2,cosPhi0$1,sinPhi0$1,areaStream$1={point:noop$1,lineStart:noop$1,lineEnd:noop$1,polygonStart:function(){areaRingSum$1.reset(),areaStream$1.lineStart=areaRingStart$1,areaStream$1.lineEnd=areaRingEnd$1},polygonEnd:function(){var areaRing=+areaRingSum$1;areaSum$1.add(areaRing<0?tau+areaRing:areaRing),this.lineStart=this.lineEnd=this.point=noop$1},sphere:function(){areaSum$1.add(tau)}};function areaRingStart$1(){areaStream$1.point=areaPointFirst$1}function areaRingEnd$1(){areaPoint$1(lambda00$2,phi00$2)}function areaPointFirst$1(lambda,phi){areaStream$1.point=areaPoint$1,lambda00$2=lambda,phi00$2=phi,lambda*=radians,phi*=radians,lambda0$2=lambda,cosPhi0$1=cos(phi=phi/2+quarterPi),sinPhi0$1=sin(phi)}function areaPoint$1(lambda,phi){lambda*=radians,phi*=radians,phi=phi/2+quarterPi;var dLambda=lambda-lambda0$2,sdLambda=dLambda>=0?1:-1,adLambda=sdLambda*dLambda,cosPhi=cos(phi),sinPhi=sin(phi),k=sinPhi0$1*sinPhi,u=cosPhi0$1*cosPhi+k*cos(adLambda),v=k*sdLambda*sin(adLambda);areaRingSum$1.add(atan2(v,u)),lambda0$2=lambda,cosPhi0$1=cosPhi,sinPhi0$1=sinPhi}function area(object2){return areaSum$1.reset(),geoStream(object2,areaStream$1),areaSum$1*2}function spherical(cartesian2){return[atan2(cartesian2[1],cartesian2[0]),asin(cartesian2[2])]}function cartesian(spherical2){var lambda=spherical2[0],phi=spherical2[1],cosPhi=cos(phi);return[cosPhi*cos(lambda),cosPhi*sin(lambda),sin(phi)]}function cartesianDot(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]}function cartesianCross(a,b){return[a[1]*b[2]-a[2]*b[1],a[2]*b[0]-a[0]*b[2],a[0]*b[1]-a[1]*b[0]]}function cartesianAddInPlace(a,b){a[0]+=b[0],a[1]+=b[1],a[2]+=b[2]}function cartesianScale(vector,k){return[vector[0]*k,vector[1]*k,vector[2]*k]}function cartesianNormalizeInPlace(d){var l=sqrt(d[0]*d[0]+d[1]*d[1]+d[2]*d[2]);d[0]/=l,d[1]/=l,d[2]/=l}var lambda0$1,phi0,lambda1,phi1,lambda2,lambda00$1,phi00$1,p0,deltaSum=adder(),ranges,range,boundsStream$2={point:boundsPoint$2,lineStart:boundsLineStart,lineEnd:boundsLineEnd,polygonStart:function(){boundsStream$2.point=boundsRingPoint,boundsStream$2.lineStart=boundsRingStart,boundsStream$2.lineEnd=boundsRingEnd,deltaSum.reset(),areaStream$1.polygonStart()},polygonEnd:function(){areaStream$1.polygonEnd(),boundsStream$2.point=boundsPoint$2,boundsStream$2.lineStart=boundsLineStart,boundsStream$2.lineEnd=boundsLineEnd,areaRingSum$1<0?(lambda0$1=-(lambda1=180),phi0=-(phi1=90)):deltaSum>epsilon?phi1=90:deltaSum<-epsilon&&(phi0=-90),range[0]=lambda0$1,range[1]=lambda1},sphere:function(){lambda0$1=-(lambda1=180),phi0=-(phi1=90)}};function boundsPoint$2(lambda,phi){ranges.push(range=[lambda0$1=lambda,lambda1=lambda]),phi<phi0&&(phi0=phi),phi>phi1&&(phi1=phi)}function linePoint(lambda,phi){var p=cartesian([lambda*radians,phi*radians]);if(p0){var normal=cartesianCross(p0,p),equatorial=[normal[1],-normal[0],0],inflection=cartesianCross(equatorial,normal);cartesianNormalizeInPlace(inflection),inflection=spherical(inflection);var delta=lambda-lambda2,sign2=delta>0?1:-1,lambdai=inflection[0]*degrees*sign2,phii,antimeridian=abs(delta)>180;antimeridian^(sign2*lambda2<lambdai&&lambdai<sign2*lambda)?(phii=inflection[1]*degrees,phii>phi1&&(phi1=phii)):(lambdai=(lambdai+360)%360-180,antimeridian^(sign2*lambda2<lambdai&&lambdai<sign2*lambda)?(phii=-inflection[1]*degrees,phii<phi0&&(phi0=phii)):(phi<phi0&&(phi0=phi),phi>phi1&&(phi1=phi))),antimeridian?lambda<lambda2?angle(lambda0$1,lambda)>angle(lambda0$1,lambda1)&&(lambda1=lambda):angle(lambda,lambda1)>angle(lambda0$1,lambda1)&&(lambda0$1=lambda):lambda1>=lambda0$1?(lambda<lambda0$1&&(lambda0$1=lambda),lambda>lambda1&&(lambda1=lambda)):lambda>lambda2?angle(lambda0$1,lambda)>angle(lambda0$1,lambda1)&&(lambda1=lambda):angle(lambda,lambda1)>angle(lambda0$1,lambda1)&&(lambda0$1=lambda)}else ranges.push(range=[lambda0$1=lambda,lambda1=lambda]);phi<phi0&&(phi0=phi),phi>phi1&&(phi1=phi),p0=p,lambda2=lambda}function boundsLineStart(){boundsStream$2.point=linePoint}function boundsLineEnd(){range[0]=lambda0$1,range[1]=lambda1,boundsStream$2.point=boundsPoint$2,p0=null}function boundsRingPoint(lambda,phi){if(p0){var delta=lambda-lambda2;deltaSum.add(abs(delta)>180?delta+(delta>0?360:-360):delta)}else lambda00$1=lambda,phi00$1=phi;areaStream$1.point(lambda,phi),linePoint(lambda,phi)}function boundsRingStart(){areaStream$1.lineStart()}function boundsRingEnd(){boundsRingPoint(lambda00$1,phi00$1),areaStream$1.lineEnd(),abs(deltaSum)>epsilon&&(lambda0$1=-(lambda1=180)),range[0]=lambda0$1,range[1]=lambda1,p0=null}function angle(lambda02,lambda12){return(lambda12-=lambda02)<0?lambda12+360:lambda12}function rangeCompare(a,b){return a[0]-b[0]}function rangeContains(range2,x){return range2[0]<=range2[1]?range2[0]<=x&&x<=range2[1]:x<range2[0]||range2[1]<x}function bounds(feature2){var i,n,a,b,merged,deltaMax,delta;if(phi1=lambda1=-(lambda0$1=phi0=1/0),ranges=[],geoStream(feature2,boundsStream$2),n=ranges.length){for(ranges.sort(rangeCompare),i=1,a=ranges[0],merged=[a];i<n;++i)b=ranges[i],rangeContains(a,b[0])||rangeContains(a,b[1])?(angle(a[0],b[1])>angle(a[0],a[1])&&(a[1]=b[1]),angle(b[0],a[1])>angle(a[0],a[1])&&(a[0]=b[0])):merged.push(a=b);for(deltaMax=-1/0,n=merged.length-1,i=0,a=merged[n];i<=n;a=b,++i)b=merged[i],(delta=angle(a[1],b[0]))>deltaMax&&(deltaMax=delta,lambda0$1=b[0],lambda1=a[1])}return ranges=range=null,lambda0$1===1/0||phi0===1/0?[[NaN,NaN],[NaN,NaN]]:[[lambda0$1,phi0],[lambda1,phi1]]}var W0,W1,X0$1,Y0$1,Z0$1,X1$1,Y1$1,Z1$1,X2$1,Y2$1,Z2$1,lambda00,phi00,x0$5,y0$5,z0,centroidStream$1={sphere:noop$1,point:centroidPoint$1,lineStart:centroidLineStart$1,lineEnd:centroidLineEnd$1,polygonStart:function(){centroidStream$1.lineStart=centroidRingStart$1,centroidStream$1.lineEnd=centroidRingEnd$1},polygonEnd:function(){centroidStream$1.lineStart=centroidLineStart$1,centroidStream$1.lineEnd=centroidLineEnd$1}};function centroidPoint$1(lambda,phi){lambda*=radians,phi*=radians;var cosPhi=cos(phi);centroidPointCartesian(cosPhi*cos(lambda),cosPhi*sin(lambda),sin(phi))}function centroidPointCartesian(x,y,z){++W0,X0$1+=(x-X0$1)/W0,Y0$1+=(y-Y0$1)/W0,Z0$1+=(z-Z0$1)/W0}function centroidLineStart$1(){centroidStream$1.point=centroidLinePointFirst}function centroidLinePointFirst(lambda,phi){lambda*=radians,phi*=radians;var cosPhi=cos(phi);x0$5=cosPhi*cos(lambda),y0$5=cosPhi*sin(lambda),z0=sin(phi),centroidStream$1.point=centroidLinePoint,centroidPointCartesian(x0$5,y0$5,z0)}function centroidLinePoint(lambda,phi){lambda*=radians,phi*=radians;var cosPhi=cos(phi),x=cosPhi*cos(lambda),y=cosPhi*sin(lambda),z=sin(phi),w=atan2(sqrt((w=y0$5*z-z0*y)*w+(w=z0*x-x0$5*z)*w+(w=x0$5*y-y0$5*x)*w),x0$5*x+y0$5*y+z0*z);W1+=w,X1$1+=w*(x0$5+(x0$5=x)),Y1$1+=w*(y0$5+(y0$5=y)),Z1$1+=w*(z0+(z0=z)),centroidPointCartesian(x0$5,y0$5,z0)}function centroidLineEnd$1(){centroidStream$1.point=centroidPoint$1}function centroidRingStart$1(){centroidStream$1.point=centroidRingPointFirst}function centroidRingEnd$1(){centroidRingPoint(lambda00,phi00),centroidStream$1.point=centroidPoint$1}function centroidRingPointFirst(lambda,phi){lambda00=lambda,phi00=phi,lambda*=radians,phi*=radians,centroidStream$1.point=centroidRingPoint;var cosPhi=cos(phi);x0$5=cosPhi*cos(lambda),y0$5=cosPhi*sin(lambda),z0=sin(phi),centroidPointCartesian(x0$5,y0$5,z0)}function centroidRingPoint(lambda,phi){lambda*=radians,phi*=radians;var cosPhi=cos(phi),x=cosPhi*cos(lambda),y=cosPhi*sin(lambda),z=sin(phi),cx=y0$5*z-z0*y,cy=z0*x-x0$5*z,cz=x0$5*y-y0$5*x,m=sqrt(cx*cx+cy*cy+cz*cz),w=asin(m),v=m&&-w/m;X2$1+=v*cx,Y2$1+=v*cy,Z2$1+=v*cz,W1+=w,X1$1+=w*(x0$5+(x0$5=x)),Y1$1+=w*(y0$5+(y0$5=y)),Z1$1+=w*(z0+(z0=z)),centroidPointCartesian(x0$5,y0$5,z0)}function centroid(object2){W0=W1=X0$1=Y0$1=Z0$1=X1$1=Y1$1=Z1$1=X2$1=Y2$1=Z2$1=0,geoStream(object2,centroidStream$1);var x=X2$1,y=Y2$1,z=Z2$1,m=x*x+y*y+z*z;return m<epsilon2&&(x=X1$1,y=Y1$1,z=Z1$1,W1<epsilon&&(x=X0$1,y=Y0$1,z=Z0$1),m=x*x+y*y+z*z,m<epsilon2)?[NaN,NaN]:[atan2(y,x)*degrees,asin(z/sqrt(m))*degrees]}function constant$1(x){return function(){return x}}function compose(a,b){function compose2(x,y){return x=a(x,y),b(x[0],x[1])}return a.invert&&b.invert&&(compose2.invert=function(x,y){return x=b.invert(x,y),x&&a.invert(x[0],x[1])}),compose2}function rotationIdentity(lambda,phi){return[abs(lambda)>pi?lambda+Math.round(-lambda/tau)*tau:lambda,phi]}rotationIdentity.invert=rotationIdentity;function rotateRadians(deltaLambda,deltaPhi,deltaGamma){return(deltaLambda%=tau)?deltaPhi||deltaGamma?compose(rotationLambda(deltaLambda),rotationPhiGamma(deltaPhi,deltaGamma)):rotationLambda(deltaLambda):deltaPhi||deltaGamma?rotationPhiGamma(deltaPhi,deltaGamma):rotationIdentity}function forwardRotationLambda(deltaLambda){return function(lambda,phi){return lambda+=deltaLambda,[lambda>pi?lambda-tau:lambda<-pi?lambda+tau:lambda,phi]}}function rotationLambda(deltaLambda){var rotation2=forwardRotationLambda(deltaLambda);return rotation2.invert=forwardRotationLambda(-deltaLambda),rotation2}function rotationPhiGamma(deltaPhi,deltaGamma){var cosDeltaPhi=cos(deltaPhi),sinDeltaPhi=sin(deltaPhi),cosDeltaGamma=cos(deltaGamma),sinDeltaGamma=sin(deltaGamma);function rotation2(lambda,phi){var cosPhi=cos(phi),x=cos(lambda)*cosPhi,y=sin(lambda)*cosPhi,z=sin(phi),k=z*cosDeltaPhi+x*sinDeltaPhi;return[atan2(y*cosDeltaGamma-k*sinDeltaGamma,x*cosDeltaPhi-z*sinDeltaPhi),asin(k*cosDeltaGamma+y*sinDeltaGamma)]}return rotation2.invert=function(lambda,phi){var cosPhi=cos(phi),x=cos(lambda)*cosPhi,y=sin(lambda)*cosPhi,z=sin(phi),k=z*cosDeltaGamma-y*sinDeltaGamma;return[atan2(y*cosDeltaGamma+z*sinDeltaGamma,x*cosDeltaPhi+k*sinDeltaPhi),asin(k*cosDeltaPhi-x*sinDeltaPhi)]},rotation2}function rotation(rotate){rotate=rotateRadians(rotate[0]*radians,rotate[1]*radians,rotate.length>2?rotate[2]*radians:0);function forward(coordinates2){return coordinates2=rotate(coordinates2[0]*radians,coordinates2[1]*radians),coordinates2[0]*=degrees,coordinates2[1]*=degrees,coordinates2}return forward.invert=function(coordinates2){return coordinates2=rotate.invert(coordinates2[0]*radians,coordinates2[1]*radians),coordinates2[0]*=degrees,coordinates2[1]*=degrees,coordinates2},forward}function circleStream(stream,radius2,delta,direction,t0,t1){if(delta){var cosRadius=cos(radius2),sinRadius=sin(radius2),step=direction*delta;t0==null?(t0=radius2+direction*tau,t1=radius2-step/2):(t0=circleRadius(cosRadius,t0),t1=circleRadius(cosRadius,t1),(direction>0?t0<t1:t0>t1)&&(t0+=direction*tau));for(var point,t=t0;direction>0?t>t1:t<t1;t-=step)point=spherical([cosRadius,-sinRadius*cos(t),-sinRadius*sin(t)]),stream.point(point[0],point[1])}}function circleRadius(cosRadius,point){point=cartesian(point),point[0]-=cosRadius,cartesianNormalizeInPlace(point);var radius2=acos(-point[1]);return((-point[2]<0?-radius2:radius2)+tau-epsilon)%tau}function circle$1(){var center=constant$1([0,0]),radius2=constant$1(90),precision=constant$1(6),ring,rotate,stream={point};function point(x,y){ring.push(x=rotate(x,y)),x[0]*=degrees,x[1]*=degrees}function circle2(){var c=center.apply(this,arguments),r=radius2.apply(this,arguments)*radians,p=precision.apply(this,arguments)*radians;return ring=[],rotate=rotateRadians(-c[0]*radians,-c[1]*radians,0).invert,circleStream(stream,r,p,1),c={type:"Polygon",coordinates:[ring]},ring=rotate=null,c}return circle2.center=function(_){return arguments.length?(center=typeof _=="function"?_:constant$1([+_[0],+_[1]]),circle2):center},circle2.radius=function(_){return arguments.length?(radius2=typeof _=="function"?_:constant$1(+_),circle2):radius2},circle2.precision=function(_){return arguments.length?(precision=typeof _=="function"?_:constant$1(+_),circle2):precision},circle2}function clipBuffer(){var lines=[],line;return{point:function(x,y,m){line.push([x,y,m])},lineStart:function(){lines.push(line=[])},lineEnd:noop$1,rejoin:function(){lines.length>1&&lines.push(lines.pop().concat(lines.shift()))},result:function(){var result=lines;return lines=[],line=null,result}}}function pointEqual(a,b){return abs(a[0]-b[0])<epsilon&&abs(a[1]-b[1])<epsilon}function Intersection(point,points,other2,entry){this.x=point,this.z=points,this.o=other2,this.e=entry,this.v=!1,this.n=this.p=null}function clipRejoin(segments,compareIntersection2,startInside,interpolate2,stream){var subject=[],clip2=[],i,n;if(segments.forEach(function(segment){if(!((n2=segment.length-1)<=0)){var n2,p02=segment[0],p1=segment[n2],x;if(pointEqual(p02,p1)){if(!p02[2]&&!p1[2]){for(stream.lineStart(),i=0;i<n2;++i)stream.point((p02=segment[i])[0],p02[1]);stream.lineEnd();return}p1[0]+=2*epsilon}subject.push(x=new Intersection(p02,segment,null,!0)),clip2.push(x.o=new Intersection(p02,null,x,!1)),subject.push(x=new Intersection(p1,segment,null,!1)),clip2.push(x.o=new Intersection(p1,null,x,!0))}}),!!subject.length){for(clip2.sort(compareIntersection2),link(subject),link(clip2),i=0,n=clip2.length;i<n;++i)clip2[i].e=startInside=!startInside;for(var start=subject[0],points,point;;){for(var current=start,isSubject=!0;current.v;)if((current=current.n)===start)return;points=current.z,stream.lineStart();do{if(current.v=current.o.v=!0,current.e){if(isSubject)for(i=0,n=points.length;i<n;++i)stream.point((point=points[i])[0],point[1]);else interpolate2(current.x,current.n.x,1,stream);current=current.n}else{if(isSubject)for(points=current.p.z,i=points.length-1;i>=0;--i)stream.point((point=points[i])[0],point[1]);else interpolate2(current.x,current.p.x,-1,stream);current=current.p}current=current.o,points=current.z,isSubject=!isSubject}while(!current.v);stream.lineEnd()}}}function link(array){if(n=array.length){for(var n,i=0,a=array[0],b;++i<n;)a.n=b=array[i],b.p=a,a=b;a.n=b=array[0],b.p=a}}var sum=adder();function longitude(point){return abs(point[0])<=pi?point[0]:sign(point[0])*((abs(point[0])+pi)%tau-pi)}function polygonContains(polygon,point){var lambda=longitude(point),phi=point[1],sinPhi=sin(phi),normal=[sin(lambda),-cos(lambda),0],angle2=0,winding=0;sum.reset(),sinPhi===1?phi=halfPi+epsilon:sinPhi===-1&&(phi=-halfPi-epsilon);for(var i=0,n=polygon.length;i<n;++i)if(m=(ring=polygon[i]).length)for(var ring,m,point0=ring[m-1],lambda02=longitude(point0),phi02=point0[1]/2+quarterPi,sinPhi02=sin(phi02),cosPhi02=cos(phi02),j=0;j<m;++j,lambda02=lambda12,sinPhi02=sinPhi1,cosPhi02=cosPhi1,point0=point1){var point1=ring[j],lambda12=longitude(point1),phi12=point1[1]/2+quarterPi,sinPhi1=sin(phi12),cosPhi1=cos(phi12),delta=lambda12-lambda02,sign2=delta>=0?1:-1,absDelta=sign2*delta,antimeridian=absDelta>pi,k=sinPhi02*sinPhi1;if(sum.add(atan2(k*sign2*sin(absDelta),cosPhi02*cosPhi1+k*cos(absDelta))),angle2+=antimeridian?delta+sign2*tau:delta,antimeridian^lambda02>=lambda^lambda12>=lambda){var arc=cartesianCross(cartesian(point0),cartesian(point1));cartesianNormalizeInPlace(arc);var intersection=cartesianCross(normal,arc);cartesianNormalizeInPlace(intersection);var phiArc=(antimeridian^delta>=0?-1:1)*asin(intersection[2]);(phi>phiArc||phi===phiArc&&(arc[0]||arc[1]))&&(winding+=antimeridian^delta>=0?1:-1)}}return(angle2<-epsilon||angle2<epsilon&&sum<-epsilon)^winding&1}function clip(pointVisible,clipLine2,interpolate2,start){return function(sink){var line=clipLine2(sink),ringBuffer=clipBuffer(),ringSink=clipLine2(ringBuffer),polygonStarted=!1,polygon,segments,ring,clip2={point,lineStart,lineEnd,polygonStart:function(){clip2.point=pointRing,clip2.lineStart=ringStart,clip2.lineEnd=ringEnd,segments=[],polygon=[]},polygonEnd:function(){clip2.point=point,clip2.lineStart=lineStart,clip2.lineEnd=lineEnd,segments=common.merge(segments);var startInside=polygonContains(polygon,start);segments.length?(polygonStarted||(sink.polygonStart(),polygonStarted=!0),clipRejoin(segments,compareIntersection,startInside,interpolate2,sink)):startInside&&(polygonStarted||(sink.polygonStart(),polygonStarted=!0),sink.lineStart(),interpolate2(null,null,1,sink),sink.lineEnd()),polygonStarted&&(sink.polygonEnd(),polygonStarted=!1),segments=polygon=null},sphere:function(){sink.polygonStart(),sink.lineStart(),interpolate2(null,null,1,sink),sink.lineEnd(),sink.polygonEnd()}};function point(lambda,phi){pointVisible(lambda,phi)&&sink.point(lambda,phi)}function pointLine(lambda,phi){line.point(lambda,phi)}function lineStart(){clip2.point=pointLine,line.lineStart()}function lineEnd(){clip2.point=point,line.lineEnd()}function pointRing(lambda,phi){ring.push([lambda,phi]),ringSink.point(lambda,phi)}function ringStart(){ringSink.lineStart(),ring=[]}function ringEnd(){pointRing(ring[0][0],ring[0][1]),ringSink.lineEnd();var clean=ringSink.clean(),ringSegments=ringBuffer.result(),i,n=ringSegments.length,m,segment,point2;if(ring.pop(),polygon.push(ring),ring=null,!!n){if(clean&1){if(segment=ringSegments[0],(m=segment.length-1)>0){for(polygonStarted||(sink.polygonStart(),polygonStarted=!0),sink.lineStart(),i=0;i<m;++i)sink.point((point2=segment[i])[0],point2[1]);sink.lineEnd()}return}n>1&&clean&2&&ringSegments.push(ringSegments.pop().concat(ringSegments.shift())),segments.push(ringSegments.filter(validSegment))}}return clip2}}function validSegment(segment){return segment.length>1}function compareIntersection(a,b){return((a=a.x)[0]<0?a[1]-halfPi-epsilon:halfPi-a[1])-((b=b.x)[0]<0?b[1]-halfPi-epsilon:halfPi-b[1])}const clipAntimeridian=clip(function(){return!0},clipAntimeridianLine,clipAntimeridianInterpolate,[-pi,-halfPi]);function clipAntimeridianLine(stream){var lambda02=NaN,phi02=NaN,sign0=NaN,clean;return{lineStart:function(){stream.lineStart(),clean=1},point:function(lambda12,phi12){var sign1=lambda12>0?pi:-pi,delta=abs(lambda12-lambda02);abs(delta-pi)<epsilon?(stream.point(lambda02,phi02=(phi02+phi12)/2>0?halfPi:-halfPi),stream.point(sign0,phi02),stream.lineEnd(),stream.lineStart(),stream.point(sign1,phi02),stream.point(lambda12,phi02),clean=0):sign0!==sign1&&delta>=pi&&(abs(lambda02-sign0)<epsilon&&(lambda02-=sign0*epsilon),abs(lambda12-sign1)<epsilon&&(lambda12-=sign1*epsilon),phi02=clipAntimeridianIntersect(lambda02,phi02,lambda12,phi12),stream.point(sign0,phi02),stream.lineEnd(),stream.lineStart(),stream.point(sign1,phi02),clean=0),stream.point(lambda02=lambda12,phi02=phi12),sign0=sign1},lineEnd:function(){stream.lineEnd(),lambda02=phi02=NaN},clean:function(){return 2-clean}}}function clipAntimeridianIntersect(lambda02,phi02,lambda12,phi12){var cosPhi02,cosPhi1,sinLambda0Lambda1=sin(lambda02-lambda12);return abs(sinLambda0Lambda1)>epsilon?atan((sin(phi02)*(cosPhi1=cos(phi12))*sin(lambda12)-sin(phi12)*(cosPhi02=cos(phi02))*sin(lambda02))/(cosPhi02*cosPhi1*sinLambda0Lambda1)):(phi02+phi12)/2}function clipAntimeridianInterpolate(from,to,direction,stream){var phi;if(from==null)phi=direction*halfPi,stream.point(-pi,phi),stream.point(0,phi),stream.point(pi,phi),stream.point(pi,0),stream.point(pi,-phi),stream.point(0,-phi),stream.point(-pi,-phi),stream.point(-pi,0),stream.point(-pi,phi);else if(abs(from[0]-to[0])>epsilon){var lambda=from[0]<to[0]?pi:-pi;phi=direction*lambda/2,stream.point(-lambda,phi),stream.point(0,phi),stream.point(lambda,phi)}else stream.point(to[0],to[1])}function clipCircle(radius2){var cr=cos(radius2),delta=6*radians,smallRadius=cr>0,notHemisphere=abs(cr)>epsilon;function interpolate2(from,to,direction,stream){circleStream(stream,radius2,delta,direction,from,to)}function visible(lambda,phi){return cos(lambda)*cos(phi)>cr}function clipLine2(stream){var point0,c0,v0,v00,clean;return{lineStart:function(){v00=v0=!1,clean=1},point:function(lambda,phi){var point1=[lambda,phi],point2,v=visible(lambda,phi),c=smallRadius?v?0:code(lambda,phi):v?code(lambda+(lambda<0?pi:-pi),phi):0;if(!point0&&(v00=v0=v)&&stream.lineStart(),v!==v0&&(point2=intersect(point0,point1),(!point2||pointEqual(point0,point2)||pointEqual(point1,point2))&&(point1[2]=1)),v!==v0)clean=0,v?(stream.lineStart(),point2=intersect(point1,point0),stream.point(point2[0],point2[1])):(point2=intersect(point0,point1),stream.point(point2[0],point2[1],2),stream.lineEnd()),point0=point2;else if(notHemisphere&&point0&&smallRadius^v){var t;!(c&c0)&&(t=intersect(point1,point0,!0))&&(clean=0,smallRadius?(stream.lineStart(),stream.point(t[0][0],t[0][1]),stream.point(t[1][0],t[1][1]),stream.lineEnd()):(stream.point(t[1][0],t[1][1]),stream.lineEnd(),stream.lineStart(),stream.point(t[0][0],t[0][1],3)))}v&&(!point0||!pointEqual(point0,point1))&&stream.point(point1[0],point1[1]),point0=point1,v0=v,c0=c},lineEnd:function(){v0&&stream.lineEnd(),point0=null},clean:function(){return clean|(v00&&v0)<<1}}}function intersect(a,b,two){var pa=cartesian(a),pb=cartesian(b),n1=[1,0,0],n2=cartesianCross(pa,pb),n2n2=cartesianDot(n2,n2),n1n2=n2[0],determinant=n2n2-n1n2*n1n2;if(!determinant)return!two&&a;var c1=cr*n2n2/determinant,c2=-cr*n1n2/determinant,n1xn2=cartesianCross(n1,n2),A=cartesianScale(n1,c1),B=cartesianScale(n2,c2);cartesianAddInPlace(A,B);var u=n1xn2,w=cartesianDot(A,u),uu=cartesianDot(u,u),t2=w*w-uu*(cartesianDot(A,A)-1);if(!(t2<0)){var t=sqrt(t2),q=cartesianScale(u,(-w-t)/uu);if(cartesianAddInPlace(q,A),q=spherical(q),!two)return q;var lambda02=a[0],lambda12=b[0],phi02=a[1],phi12=b[1],z;lambda12<lambda02&&(z=lambda02,lambda02=lambda12,lambda12=z);var delta2=lambda12-lambda02,polar=abs(delta2-pi)<epsilon,meridian=polar||delta2<epsilon;if(!polar&&phi12<phi02&&(z=phi02,phi02=phi12,phi12=z),meridian?polar?phi02+phi12>0^q[1]<(abs(q[0]-lambda02)<epsilon?phi02:phi12):phi02<=q[1]&&q[1]<=phi12:delta2>pi^(lambda02<=q[0]&&q[0]<=lambda12)){var q1=cartesianScale(u,(-w+t)/uu);return cartesianAddInPlace(q1,A),[q,spherical(q1)]}}}function code(lambda,phi){var r=smallRadius?radius2:pi-radius2,code2=0;return lambda<-r?code2|=1:lambda>r&&(code2|=2),phi<-r?code2|=4:phi>r&&(code2|=8),code2}return clip(visible,clipLine2,interpolate2,smallRadius?[0,-radius2]:[-pi,radius2-pi])}function clipLine(a,b,x02,y02,x12,y12){var ax=a[0],ay=a[1],bx=b[0],by=b[1],t0=0,t1=1,dx=bx-ax,dy=by-ay,r;if(r=x02-ax,!(!dx&&r>0)){if(r/=dx,dx<0){if(r<t0)return;r<t1&&(t1=r)}else if(dx>0){if(r>t1)return;r>t0&&(t0=r)}if(r=x12-ax,!(!dx&&r<0)){if(r/=dx,dx<0){if(r>t1)return;r>t0&&(t0=r)}else if(dx>0){if(r<t0)return;r<t1&&(t1=r)}if(r=y02-ay,!(!dy&&r>0)){if(r/=dy,dy<0){if(r<t0)return;r<t1&&(t1=r)}else if(dy>0){if(r>t1)return;r>t0&&(t0=r)}if(r=y12-ay,!(!dy&&r<0)){if(r/=dy,dy<0){if(r>t1)return;r>t0&&(t0=r)}else if(dy>0){if(r<t0)return;r<t1&&(t1=r)}return t0>0&&(a[0]=ax+t0*dx,a[1]=ay+t0*dy),t1<1&&(b[0]=ax+t1*dx,b[1]=ay+t1*dy),!0}}}}}var clipMax=1e9,clipMin=-clipMax;function clipRectangle(x02,y02,x12,y12){function visible(x,y){return x02<=x&&x<=x12&&y02<=y&&y<=y12}function interpolate2(from,to,direction,stream){var a=0,a1=0;if(from==null||(a=corner(from,direction))!==(a1=corner(to,direction))||comparePoint(from,to)<0^direction>0)do stream.point(a===0||a===3?x02:x12,a>1?y12:y02);while((a=(a+direction+4)%4)!==a1);else stream.point(to[0],to[1])}function corner(p,direction){return abs(p[0]-x02)<epsilon?direction>0?0:3:abs(p[0]-x12)<epsilon?direction>0?2:1:abs(p[1]-y02)<epsilon?direction>0?1:0:direction>0?3:2}function compareIntersection2(a,b){return comparePoint(a.x,b.x)}function comparePoint(a,b){var ca=corner(a,1),cb=corner(b,1);return ca!==cb?ca-cb:ca===0?b[1]-a[1]:ca===1?a[0]-b[0]:ca===2?a[1]-b[1]:b[0]-a[0]}return function(stream){var activeStream=stream,bufferStream=clipBuffer(),segments,polygon,ring,x__,y__,v__,x_,y_,v_,first,clean,clipStream={point,lineStart,lineEnd,polygonStart,polygonEnd};function point(x,y){visible(x,y)&&activeStream.point(x,y)}function polygonInside(){for(var winding=0,i=0,n=polygon.length;i<n;++i)for(var ring2=polygon[i],j=1,m=ring2.length,point2=ring2[0],a0,a1,b0=point2[0],b1=point2[1];j<m;++j)a0=b0,a1=b1,point2=ring2[j],b0=point2[0],b1=point2[1],a1<=y12?b1>y12&&(b0-a0)*(y12-a1)>(b1-a1)*(x02-a0)&&++winding:b1<=y12&&(b0-a0)*(y12-a1)<(b1-a1)*(x02-a0)&&--winding;return winding}function polygonStart(){activeStream=bufferStream,segments=[],polygon=[],clean=!0}function polygonEnd(){var startInside=polygonInside(),cleanInside=clean&&startInside,visible2=(segments=common.merge(segments)).length;(cleanInside||visible2)&&(stream.polygonStart(),cleanInside&&(stream.lineStart(),interpolate2(null,null,1,stream),stream.lineEnd()),visible2&&clipRejoin(segments,compareIntersection2,startInside,interpolate2,stream),stream.polygonEnd()),activeStream=stream,segments=polygon=ring=null}function lineStart(){clipStream.point=linePoint2,polygon&&polygon.push(ring=[]),first=!0,v_=!1,x_=y_=NaN}function lineEnd(){segments&&(linePoint2(x__,y__),v__&&v_&&bufferStream.rejoin(),segments.push(bufferStream.result())),clipStream.point=point,v_&&activeStream.lineEnd()}function linePoint2(x,y){var v=visible(x,y);if(polygon&&ring.push([x,y]),first)x__=x,y__=y,v__=v,first=!1,v&&(activeStream.lineStart(),activeStream.point(x,y));else if(v&&v_)activeStream.point(x,y);else{var a=[x_=Math.max(clipMin,Math.min(clipMax,x_)),y_=Math.max(clipMin,Math.min(clipMax,y_))],b=[x=Math.max(clipMin,Math.min(clipMax,x)),y=Math.max(clipMin,Math.min(clipMax,y))];clipLine(a,b,x02,y02,x12,y12)?(v_||(activeStream.lineStart(),activeStream.point(a[0],a[1])),activeStream.point(b[0],b[1]),v||activeStream.lineEnd(),clean=!1):v&&(activeStream.lineStart(),activeStream.point(x,y),clean=!1)}x_=x,y_=y,v_=v}return clipStream}}function extent(){var x02=0,y02=0,x12=960,y12=500,cache,cacheStream,clip2;return clip2={stream:function(stream){return cache&&cacheStream===stream?cache:cache=clipRectangle(x02,y02,x12,y12)(cacheStream=stream)},extent:function(_){return arguments.length?(x02=+_[0][0],y02=+_[0][1],x12=+_[1][0],y12=+_[1][1],cache=cacheStream=null,clip2):[[x02,y02],[x12,y12]]}}}var lengthSum$1=adder(),lambda0,sinPhi0,cosPhi0,lengthStream$1={sphere:noop$1,point:noop$1,lineStart:lengthLineStart,lineEnd:noop$1,polygonStart:noop$1,polygonEnd:noop$1};function lengthLineStart(){lengthStream$1.point=lengthPointFirst$1,lengthStream$1.lineEnd=lengthLineEnd}function lengthLineEnd(){lengthStream$1.point=lengthStream$1.lineEnd=noop$1}function lengthPointFirst$1(lambda,phi){lambda*=radians,phi*=radians,lambda0=lambda,sinPhi0=sin(phi),cosPhi0=cos(phi),lengthStream$1.point=lengthPoint$1}function lengthPoint$1(lambda,phi){lambda*=radians,phi*=radians;var sinPhi=sin(phi),cosPhi=cos(phi),delta=abs(lambda-lambda0),cosDelta=cos(delta),sinDelta=sin(delta),x=cosPhi*sinDelta,y=cosPhi0*sinPhi-sinPhi0*cosPhi*cosDelta,z=sinPhi0*sinPhi+cosPhi0*cosPhi*cosDelta;lengthSum$1.add(atan2(sqrt(x*x+y*y),z)),lambda0=lambda,sinPhi0=sinPhi,cosPhi0=cosPhi}function length(object2){return lengthSum$1.reset(),geoStream(object2,lengthStream$1),+lengthSum$1}var coordinates=[null,null],object$1={type:"LineString",coordinates};function distance(a,b){return coordinates[0]=a,coordinates[1]=b,length(object$1)}var containsObjectType={Feature:function(object2,point){return containsGeometry(object2.geometry,point)},FeatureCollection:function(object2,point){for(var features2=object2.features,i=-1,n=features2.length;++i<n;)if(containsGeometry(features2[i].geometry,point))return!0;return!1}},containsGeometryType={Sphere:function(){return!0},Point:function(object2,point){return containsPoint(object2.coordinates,point)},MultiPoint:function(object2,point){for(var coordinates2=object2.coordinates,i=-1,n=coordinates2.length;++i<n;)if(containsPoint(coordinates2[i],point))return!0;return!1},LineString:function(object2,point){return containsLine(object2.coordinates,point)},MultiLineString:function(object2,point){for(var coordinates2=object2.coordinates,i=-1,n=coordinates2.length;++i<n;)if(containsLine(coordinates2[i],point))return!0;return!1},Polygon:function(object2,point){return containsPolygon(object2.coordinates,point)},MultiPolygon:function(object2,point){for(var coordinates2=object2.coordinates,i=-1,n=coordinates2.length;++i<n;)if(containsPolygon(coordinates2[i],point))return!0;return!1},GeometryCollection:function(object2,point){for(var geometries=object2.geometries,i=-1,n=geometries.length;++i<n;)if(containsGeometry(geometries[i],point))return!0;return!1}};function containsGeometry(geometry,point){return geometry&&containsGeometryType.hasOwnProperty(geometry.type)?containsGeometryType[geometry.type](geometry,point):!1}function containsPoint(coordinates2,point){return distance(coordinates2,point)===0}function containsLine(coordinates2,point){for(var ao,bo,ab,i=0,n=coordinates2.length;i<n;i++){if(bo=distance(coordinates2[i],point),bo===0||i>0&&(ab=distance(coordinates2[i],coordinates2[i-1]),ab>0&&ao<=ab&&bo<=ab&&(ao+bo-ab)*(1-Math.pow((ao-bo)/ab,2))<epsilon2*ab))return!0;ao=bo}return!1}function containsPolygon(coordinates2,point){return!!polygonContains(coordinates2.map(ringRadians),pointRadians(point))}function ringRadians(ring){return ring=ring.map(pointRadians),ring.pop(),ring}function pointRadians(point){return[point[0]*radians,point[1]*radians]}function contains(object2,point){return(object2&&containsObjectType.hasOwnProperty(object2.type)?containsObjectType[object2.type]:containsGeometry)(object2,point)}function graticuleX(y02,y12,dy){var y=common.range(y02,y12-epsilon,dy).concat(y12);return function(x){return y.map(function(y2){return[x,y2]})}}function graticuleY(x02,x12,dx){var x=common.range(x02,x12-epsilon,dx).concat(x12);return function(y){return x.map(function(x2){return[x2,y]})}}function graticule(){var x12,x02,X12,X02,y12,y02,Y12,Y02,dx=10,dy=dx,DX=90,DY=360,x,y,X,Y,precision=2.5;function graticule2(){return{type:"MultiLineString",coordinates:lines()}}function lines(){return common.range(ceil(X02/DX)*DX,X12,DX).map(X).concat(common.range(ceil(Y02/DY)*DY,Y12,DY).map(Y)).concat(common.range(ceil(x02/dx)*dx,x12,dx).filter(function(x2){return abs(x2%DX)>epsilon}).map(x)).concat(common.range(ceil(y02/dy)*dy,y12,dy).filter(function(y2){return abs(y2%DY)>epsilon}).map(y))}return graticule2.lines=function(){return lines().map(function(coordinates2){return{type:"LineString",coordinates:coordinates2}})},graticule2.outline=function(){return{type:"Polygon",coordinates:[X(X02).concat(Y(Y12).slice(1),X(X12).reverse().slice(1),Y(Y02).reverse().slice(1))]}},graticule2.extent=function(_){return arguments.length?graticule2.extentMajor(_).extentMinor(_):graticule2.extentMinor()},graticule2.extentMajor=function(_){return arguments.length?(X02=+_[0][0],X12=+_[1][0],Y02=+_[0][1],Y12=+_[1][1],X02>X12&&(_=X02,X02=X12,X12=_),Y02>Y12&&(_=Y02,Y02=Y12,Y12=_),graticule2.precision(precision)):[[X02,Y02],[X12,Y12]]},graticule2.extentMinor=function(_){return arguments.length?(x02=+_[0][0],x12=+_[1][0],y02=+_[0][1],y12=+_[1][1],x02>x12&&(_=x02,x02=x12,x12=_),y02>y12&&(_=y02,y02=y12,y12=_),graticule2.precision(precision)):[[x02,y02],[x12,y12]]},graticule2.step=function(_){return arguments.length?graticule2.stepMajor(_).stepMinor(_):graticule2.stepMinor()},graticule2.stepMajor=function(_){return arguments.length?(DX=+_[0],DY=+_[1],graticule2):[DX,DY]},graticule2.stepMinor=function(_){return arguments.length?(dx=+_[0],dy=+_[1],graticule2):[dx,dy]},graticule2.precision=function(_){return arguments.length?(precision=+_,x=graticuleX(y02,y12,90),y=graticuleY(x02,x12,precision),X=graticuleX(Y02,Y12,90),Y=graticuleY(X02,X12,precision),graticule2):precision},graticule2.extentMajor([[-180,-90+epsilon],[180,90-epsilon]]).extentMinor([[-180,-80-epsilon],[180,80+epsilon]])}function graticule10(){return graticule()()}function interpolate(a,b){var x02=a[0]*radians,y02=a[1]*radians,x12=b[0]*radians,y12=b[1]*radians,cy0=cos(y02),sy0=sin(y02),cy1=cos(y12),sy1=sin(y12),kx0=cy0*cos(x02),ky0=cy0*sin(x02),kx1=cy1*cos(x12),ky1=cy1*sin(x12),d=2*asin(sqrt(haversin(y12-y02)+cy0*cy1*haversin(x12-x02))),k=sin(d),interpolate2=d?function(t){var B=sin(t*=d)/k,A=sin(d-t)/k,x=A*kx0+B*kx1,y=A*ky0+B*ky1,z=A*sy0+B*sy1;return[atan2(y,x)*degrees,atan2(z,sqrt(x*x+y*y))*degrees]}:function(){return[x02*degrees,y02*degrees]};return interpolate2.distance=d,interpolate2}function identity$2(x){return x}var areaSum=adder(),areaRingSum=adder(),x00$2,y00$2,x0$4,y0$4,areaStream={point:noop$1,lineStart:noop$1,lineEnd:noop$1,polygonStart:function(){areaStream.lineStart=areaRingStart,areaStream.lineEnd=areaRingEnd},polygonEnd:function(){areaStream.lineStart=areaStream.lineEnd=areaStream.point=noop$1,areaSum.add(abs(areaRingSum)),areaRingSum.reset()},result:function(){var area2=areaSum/2;return areaSum.reset(),area2}};function areaRingStart(){areaStream.point=areaPointFirst}function areaPointFirst(x,y){areaStream.point=areaPoint,x00$2=x0$4=x,y00$2=y0$4=y}function areaPoint(x,y){areaRingSum.add(y0$4*x-x0$4*y),x0$4=x,y0$4=y}function areaRingEnd(){areaPoint(x00$2,y00$2)}var x0$3=1/0,y0$3=x0$3,x1$1=-x0$3,y1$1=x1$1,boundsStream$1={point:boundsPoint$1,lineStart:noop$1,lineEnd:noop$1,polygonStart:noop$1,polygonEnd:noop$1,result:function(){var bounds2=[[x0$3,y0$3],[x1$1,y1$1]];return x1$1=y1$1=-(y0$3=x0$3=1/0),bounds2}};function boundsPoint$1(x,y){x<x0$3&&(x0$3=x),x>x1$1&&(x1$1=x),y<y0$3&&(y0$3=y),y>y1$1&&(y1$1=y)}var X0=0,Y0=0,Z0=0,X1=0,Y1=0,Z1=0,X2=0,Y2=0,Z2=0,x00$1,y00$1,x0$2,y0$2,centroidStream={point:centroidPoint,lineStart:centroidLineStart,lineEnd:centroidLineEnd,polygonStart:function(){centroidStream.lineStart=centroidRingStart,centroidStream.lineEnd=centroidRingEnd},polygonEnd:function(){centroidStream.point=centroidPoint,centroidStream.lineStart=centroidLineStart,centroidStream.lineEnd=centroidLineEnd},result:function(){var centroid2=Z2?[X2/Z2,Y2/Z2]:Z1?[X1/Z1,Y1/Z1]:Z0?[X0/Z0,Y0/Z0]:[NaN,NaN];return X0=Y0=Z0=X1=Y1=Z1=X2=Y2=Z2=0,centroid2}};function centroidPoint(x,y){X0+=x,Y0+=y,++Z0}function centroidLineStart(){centroidStream.point=centroidPointFirstLine}function centroidPointFirstLine(x,y){centroidStream.point=centroidPointLine,centroidPoint(x0$2=x,y0$2=y)}function centroidPointLine(x,y){var dx=x-x0$2,dy=y-y0$2,z=sqrt(dx*dx+dy*dy);X1+=z*(x0$2+x)/2,Y1+=z*(y0$2+y)/2,Z1+=z,centroidPoint(x0$2=x,y0$2=y)}function centroidLineEnd(){centroidStream.point=centroidPoint}function centroidRingStart(){centroidStream.point=centroidPointFirstRing}function centroidRingEnd(){centroidPointRing(x00$1,y00$1)}function centroidPointFirstRing(x,y){centroidStream.point=centroidPointRing,centroidPoint(x00$1=x0$2=x,y00$1=y0$2=y)}function centroidPointRing(x,y){var dx=x-x0$2,dy=y-y0$2,z=sqrt(dx*dx+dy*dy);X1+=z*(x0$2+x)/2,Y1+=z*(y0$2+y)/2,Z1+=z,z=y0$2*x-x0$2*y,X2+=z*(x0$2+x),Y2+=z*(y0$2+y),Z2+=z*3,centroidPoint(x0$2=x,y0$2=y)}function PathContext(context){this._context=context}PathContext.prototype={_radius:4.5,pointRadius:function(_){return this._radius=_,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(x,y){switch(this._point){case 0:{this._context.moveTo(x,y),this._point=1;break}case 1:{this._context.lineTo(x,y);break}default:{this._context.moveTo(x+this._radius,y),this._context.arc(x,y,this._radius,0,tau);break}}},result:noop$1};var lengthSum=adder(),lengthRing,x00,y00,x0$1,y0$1,lengthStream={point:noop$1,lineStart:function(){lengthStream.point=lengthPointFirst},lineEnd:function(){lengthRing&&lengthPoint(x00,y00),lengthStream.point=noop$1},polygonStart:function(){lengthRing=!0},polygonEnd:function(){lengthRing=null},result:function(){var length2=+lengthSum;return lengthSum.reset(),length2}};function lengthPointFirst(x,y){lengthStream.point=lengthPoint,x00=x0$1=x,y00=y0$1=y}function lengthPoint(x,y){x0$1-=x,y0$1-=y,lengthSum.add(sqrt(x0$1*x0$1+y0$1*y0$1)),x0$1=x,y0$1=y}function PathString(){this._string=[]}PathString.prototype={_radius:4.5,_circle:circle(4.5),pointRadius:function(_){return(_=+_)!==this._radius&&(this._radius=_,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._string.push("Z"),this._point=NaN},point:function(x,y){switch(this._point){case 0:{this._string.push("M",x,",",y),this._point=1;break}case 1:{this._string.push("L",x,",",y);break}default:{this._circle==null&&(this._circle=circle(this._radius)),this._string.push("M",x,",",y,this._circle);break}}},result:function(){if(this._string.length){var result=this._string.join("");return this._string=[],result}else return null}};function circle(radius2){return"m0,"+radius2+"a"+radius2+","+radius2+" 0 1,1 0,"+-2*radius2+"a"+radius2+","+radius2+" 0 1,1 0,"+2*radius2+"z"}function d3GeoPath(projection2,context){var pointRadius=4.5,projectionStream,contextStream;function path(object2){return object2&&(typeof pointRadius=="function"&&contextStream.pointRadius(+pointRadius.apply(this,arguments)),geoStream(object2,projectionStream(contextStream))),contextStream.result()}return path.area=function(object2){return geoStream(object2,projectionStream(areaStream)),areaStream.result()},path.measure=function(object2){return geoStream(object2,projectionStream(lengthStream)),lengthStream.result()},path.bounds=function(object2){return geoStream(object2,projectionStream(boundsStream$1)),boundsStream$1.result()},path.centroid=function(object2){return geoStream(object2,projectionStream(centroidStream)),centroidStream.result()},path.projection=function(_){return arguments.length?(projectionStream=_==null?(projection2=null,identity$2):(projection2=_).stream,path):projection2},path.context=function(_){return arguments.length?(contextStream=_==null?(context=null,new PathString):new PathContext(context=_),typeof pointRadius!="function"&&contextStream.pointRadius(pointRadius),path):context},path.pointRadius=function(_){return arguments.length?(pointRadius=typeof _=="function"?_:(contextStream.pointRadius(+_),+_),path):pointRadius},path.projection(projection2).context(context)}function d3GeoTransform(methods){return{stream:transformer(methods)}}function transformer(methods){return function(stream){var s=new TransformStream;for(var key in methods)s[key]=methods[key];return s.stream=stream,s}}function TransformStream(){}TransformStream.prototype={constructor:TransformStream,point:function(x,y){this.stream.point(x,y)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function fit(projection2,fitBounds,object2){var clip2=projection2.clipExtent&&projection2.clipExtent();return projection2.scale(150).translate([0,0]),clip2!=null&&projection2.clipExtent(null),geoStream(object2,projection2.stream(boundsStream$1)),fitBounds(boundsStream$1.result()),clip2!=null&&projection2.clipExtent(clip2),projection2}function fitExtent$1(projection2,extent2,object2){return fit(projection2,function(b){var w=extent2[1][0]-extent2[0][0],h=extent2[1][1]-extent2[0][1],k=Math.min(w/(b[1][0]-b[0][0]),h/(b[1][1]-b[0][1])),x=+extent2[0][0]+(w-k*(b[1][0]+b[0][0]))/2,y=+extent2[0][1]+(h-k*(b[1][1]+b[0][1]))/2;projection2.scale(150*k).translate([x,y])},object2)}function fitSize$1(projection2,size,object2){return fitExtent$1(projection2,[[0,0],size],object2)}function fitWidth(projection2,width,object2){return fit(projection2,function(b){var w=+width,k=w/(b[1][0]-b[0][0]),x=(w-k*(b[1][0]+b[0][0]))/2,y=-k*b[0][1];projection2.scale(150*k).translate([x,y])},object2)}function fitHeight(projection2,height,object2){return fit(projection2,function(b){var h=+height,k=h/(b[1][1]-b[0][1]),x=-k*b[0][0],y=(h-k*(b[1][1]+b[0][1]))/2;projection2.scale(150*k).translate([x,y])},object2)}var maxDepth=16,cosMinDistance=cos(30*radians);function resample(project,delta2){return+delta2?resample$1(project,delta2):resampleNone(project)}function resampleNone(project){return transformer({point:function(x,y){x=project(x,y),this.stream.point(x[0],x[1])}})}function resample$1(project,delta2){function resampleLineTo(x02,y02,lambda02,a0,b0,c0,x12,y12,lambda12,a1,b1,c1,depth,stream){var dx=x12-x02,dy=y12-y02,d2=dx*dx+dy*dy;if(d2>4*delta2&&depth--){var a=a0+a1,b=b0+b1,c=c0+c1,m=sqrt(a*a+b*b+c*c),phi2=asin(c/=m),lambda22=abs(abs(c)-1)<epsilon||abs(lambda02-lambda12)<epsilon?(lambda02+lambda12)/2:atan2(b,a),p=project(lambda22,phi2),x2=p[0],y2=p[1],dx2=x2-x02,dy2=y2-y02,dz=dy*dx2-dx*dy2;(dz*dz/d2>delta2||abs((dx*dx2+dy*dy2)/d2-.5)>.3||a0*a1+b0*b1+c0*c1<cosMinDistance)&&(resampleLineTo(x02,y02,lambda02,a0,b0,c0,x2,y2,lambda22,a/=m,b/=m,c,depth,stream),stream.point(x2,y2),resampleLineTo(x2,y2,lambda22,a,b,c,x12,y12,lambda12,a1,b1,c1,depth,stream))}}return function(stream){var lambda002,x002,y002,a00,b00,c00,lambda02,x02,y02,a0,b0,c0,resampleStream={point,lineStart,lineEnd,polygonStart:function(){stream.polygonStart(),resampleStream.lineStart=ringStart},polygonEnd:function(){stream.polygonEnd(),resampleStream.lineStart=lineStart}};function point(x,y){x=project(x,y),stream.point(x[0],x[1])}function lineStart(){x02=NaN,resampleStream.point=linePoint2,stream.lineStart()}function linePoint2(lambda,phi){var c=cartesian([lambda,phi]),p=project(lambda,phi);resampleLineTo(x02,y02,lambda02,a0,b0,c0,x02=p[0],y02=p[1],lambda02=lambda,a0=c[0],b0=c[1],c0=c[2],maxDepth,stream),stream.point(x02,y02)}function lineEnd(){resampleStream.point=point,stream.lineEnd()}function ringStart(){lineStart(),resampleStream.point=ringPoint,resampleStream.lineEnd=ringEnd}function ringPoint(lambda,phi){linePoint2(lambda002=lambda,phi),x002=x02,y002=y02,a00=a0,b00=b0,c00=c0,resampleStream.point=linePoint2}function ringEnd(){resampleLineTo(x02,y02,lambda02,a0,b0,c0,x002,y002,lambda002,a00,b00,c00,maxDepth,stream),resampleStream.lineEnd=lineEnd,lineEnd()}return resampleStream}}var transformRadians=transformer({point:function(x,y){this.stream.point(x*radians,y*radians)}});function transformRotate(rotate){return transformer({point:function(x,y){var r=rotate(x,y);return this.stream.point(r[0],r[1])}})}function scaleTranslate(k,dx,dy,sx,sy){function transform2(x,y){return x*=sx,y*=sy,[dx+k*x,dy-k*y]}return transform2.invert=function(x,y){return[(x-dx)/k*sx,(dy-y)/k*sy]},transform2}function scaleTranslateRotate(k,dx,dy,sx,sy,alpha){var cosAlpha=cos(alpha),sinAlpha=sin(alpha),a=cosAlpha*k,b=sinAlpha*k,ai=cosAlpha/k,bi=sinAlpha/k,ci=(sinAlpha*dy-cosAlpha*dx)/k,fi=(sinAlpha*dx+cosAlpha*dy)/k;function transform2(x,y){return x*=sx,y*=sy,[a*x-b*y+dx,dy-b*x-a*y]}return transform2.invert=function(x,y){return[sx*(ai*x-bi*y+ci),sy*(fi-bi*x-ai*y)]},transform2}function projection(project){return projectionMutator(function(){return project})()}function projectionMutator(projectAt){var project,k=150,x=480,y=250,lambda=0,phi=0,deltaLambda=0,deltaPhi=0,deltaGamma=0,rotate,alpha=0,sx=1,sy=1,theta=null,preclip=clipAntimeridian,x02=null,y02,x12,y12,postclip=identity$2,delta2=.5,projectResample,projectTransform,projectRotateTransform,cache,cacheStream;function projection2(point){return projectRotateTransform(point[0]*radians,point[1]*radians)}function invert(point){return point=projectRotateTransform.invert(point[0],point[1]),point&&[point[0]*degrees,point[1]*degrees]}projection2.stream=function(stream){return cache&&cacheStream===stream?cache:cache=transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream=stream)))))},projection2.preclip=function(_){return arguments.length?(preclip=_,theta=void 0,reset()):preclip},projection2.postclip=function(_){return arguments.length?(postclip=_,x02=y02=x12=y12=null,reset()):postclip},projection2.clipAngle=function(_){return arguments.length?(preclip=+_?clipCircle(theta=_*radians):(theta=null,clipAntimeridian),reset()):theta*degrees},projection2.clipExtent=function(_){return arguments.length?(postclip=_==null?(x02=y02=x12=y12=null,identity$2):clipRectangle(x02=+_[0][0],y02=+_[0][1],x12=+_[1][0],y12=+_[1][1]),reset()):x02==null?null:[[x02,y02],[x12,y12]]},projection2.scale=function(_){return arguments.length?(k=+_,recenter()):k},projection2.translate=function(_){return arguments.length?(x=+_[0],y=+_[1],recenter()):[x,y]},projection2.center=function(_){return arguments.length?(lambda=_[0]%360*radians,phi=_[1]%360*radians,recenter()):[lambda*degrees,phi*degrees]},projection2.rotate=function(_){return arguments.length?(deltaLambda=_[0]%360*radians,deltaPhi=_[1]%360*radians,deltaGamma=_.length>2?_[2]%360*radians:0,recenter()):[deltaLambda*degrees,deltaPhi*degrees,deltaGamma*degrees]},projection2.angle=function(_){return arguments.length?(alpha=_%360*radians,recenter()):alpha*degrees},projection2.reflectX=function(_){return arguments.length?(sx=_?-1:1,recenter()):sx<0},projection2.reflectY=function(_){return arguments.length?(sy=_?-1:1,recenter()):sy<0},projection2.precision=function(_){return arguments.length?(projectResample=resample(projectTransform,delta2=_*_),reset()):sqrt(delta2)},projection2.fitExtent=function(extent2,object2){return fitExtent$1(projection2,extent2,object2)},projection2.fitSize=function(size,object2){return fitSize$1(projection2,size,object2)},projection2.fitWidth=function(width,object2){return fitWidth(projection2,width,object2)},projection2.fitHeight=function(height,object2){return fitHeight(projection2,height,object2)};function recenter(){var center=scaleTranslateRotate(k,0,0,sx,sy,alpha).apply(null,project(lambda,phi)),transform2=(alpha?scaleTranslateRotate:scaleTranslate)(k,x-center[0],y-center[1],sx,sy,alpha);return rotate=rotateRadians(deltaLambda,deltaPhi,deltaGamma),projectTransform=compose(project,transform2),projectRotateTransform=compose(rotate,projectTransform),projectResample=resample(projectTransform,delta2),reset()}function reset(){return cache=cacheStream=null,projection2}return function(){return project=projectAt.apply(this,arguments),projection2.invert=project.invert&&invert,recenter()}}function conicProjection(projectAt){var phi02=0,phi12=pi/3,m=projectionMutator(projectAt),p=m(phi02,phi12);return p.parallels=function(_){return arguments.length?m(phi02=_[0]*radians,phi12=_[1]*radians):[phi02*degrees,phi12*degrees]},p}function cylindricalEqualAreaRaw(phi02){var cosPhi02=cos(phi02);function forward(lambda,phi){return[lambda*cosPhi02,sin(phi)/cosPhi02]}return forward.invert=function(x,y){return[x/cosPhi02,asin(y*cosPhi02)]},forward}function conicEqualAreaRaw(y02,y12){var sy0=sin(y02),n=(sy0+sin(y12))/2;if(abs(n)<epsilon)return cylindricalEqualAreaRaw(y02);var c=1+sy0*(2*n-sy0),r0=sqrt(c)/n;function project(x,y){var r=sqrt(c-2*n*sin(y))/n;return[r*sin(x*=n),r0-r*cos(x)]}return project.invert=function(x,y){var r0y=r0-y,l=atan2(x,abs(r0y))*sign(r0y);return r0y*n<0&&(l-=pi*sign(x)*sign(r0y)),[l/n,asin((c-(x*x+r0y*r0y)*n*n)/(2*n))]},project}function geoConicEqualArea(){return conicProjection(conicEqualAreaRaw).scale(155.424).center([0,33.6442])}function geoAlbers(){return geoConicEqualArea().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function multiplex$1(streams){var n=streams.length;return{point:function(x,y){for(var i=-1;++i<n;)streams[i].point(x,y)},sphere:function(){for(var i=-1;++i<n;)streams[i].sphere()},lineStart:function(){for(var i=-1;++i<n;)streams[i].lineStart()},lineEnd:function(){for(var i=-1;++i<n;)streams[i].lineEnd()},polygonStart:function(){for(var i=-1;++i<n;)streams[i].polygonStart()},polygonEnd:function(){for(var i=-1;++i<n;)streams[i].polygonEnd()}}}function albersUsa(){var cache,cacheStream,lower48=geoAlbers(),lower48Point,alaska=geoConicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),alaskaPoint,hawaii=geoConicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),hawaiiPoint,point,pointStream={point:function(x,y){point=[x,y]}};function albersUsa2(coordinates2){var x=coordinates2[0],y=coordinates2[1];return point=null,lower48Point.point(x,y),point||(alaskaPoint.point(x,y),point)||(hawaiiPoint.point(x,y),point)}albersUsa2.invert=function(coordinates2){var k=lower48.scale(),t=lower48.translate(),x=(coordinates2[0]-t[0])/k,y=(coordinates2[1]-t[1])/k;return(y>=.12&&y<.234&&x>=-.425&&x<-.214?alaska:y>=.166&&y<.234&&x>=-.214&&x<-.115?hawaii:lower48).invert(coordinates2)},albersUsa2.stream=function(stream){return cache&&cacheStream===stream?cache:cache=multiplex$1([lower48.stream(cacheStream=stream),alaska.stream(stream),hawaii.stream(stream)])},albersUsa2.precision=function(_){return arguments.length?(lower48.precision(_),alaska.precision(_),hawaii.precision(_),reset()):lower48.precision()},albersUsa2.scale=function(_){return arguments.length?(lower48.scale(_),alaska.scale(_*.35),hawaii.scale(_),albersUsa2.translate(lower48.translate())):lower48.scale()},albersUsa2.translate=function(_){if(!arguments.length)return lower48.translate();var k=lower48.scale(),x=+_[0],y=+_[1];return lower48Point=lower48.translate(_).clipExtent([[x-.455*k,y-.238*k],[x+.455*k,y+.238*k]]).stream(pointStream),alaskaPoint=alaska.translate([x-.307*k,y+.201*k]).clipExtent([[x-.425*k+epsilon,y+.12*k+epsilon],[x-.214*k-epsilon,y+.234*k-epsilon]]).stream(pointStream),hawaiiPoint=hawaii.translate([x-.205*k,y+.212*k]).clipExtent([[x-.214*k+epsilon,y+.166*k+epsilon],[x-.115*k-epsilon,y+.234*k-epsilon]]).stream(pointStream),reset()},albersUsa2.fitExtent=function(extent2,object2){return fitExtent$1(albersUsa2,extent2,object2)},albersUsa2.fitSize=function(size,object2){return fitSize$1(albersUsa2,size,object2)},albersUsa2.fitWidth=function(width,object2){return fitWidth(albersUsa2,width,object2)},albersUsa2.fitHeight=function(height,object2){return fitHeight(albersUsa2,height,object2)};function reset(){return cache=cacheStream=null,albersUsa2}return albersUsa2.scale(1070)}function azimuthalRaw(scale){return function(x,y){var cx=cos(x),cy=cos(y),k=scale(cx*cy);return[k*cy*sin(x),k*sin(y)]}}function azimuthalInvert(angle2){return function(x,y){var z=sqrt(x*x+y*y),c=angle2(z),sc=sin(c),cc=cos(c);return[atan2(x*sc,z*cc),asin(z&&y*sc/z)]}}var azimuthalEqualAreaRaw=azimuthalRaw(function(cxcy){return sqrt(2/(1+cxcy))});azimuthalEqualAreaRaw.invert=azimuthalInvert(function(z){return 2*asin(z/2)});function azimuthalEqualArea(){return projection(azimuthalEqualAreaRaw).scale(124.75).clipAngle(180-.001)}var azimuthalEquidistantRaw=azimuthalRaw(function(c){return(c=acos(c))&&c/sin(c)});azimuthalEquidistantRaw.invert=azimuthalInvert(function(z){return z});function azimuthalEquidistant(){return projection(azimuthalEquidistantRaw).scale(79.4188).clipAngle(180-.001)}function mercatorRaw(lambda,phi){return[lambda,log(tan((halfPi+phi)/2))]}mercatorRaw.invert=function(x,y){return[x,2*atan(exp(y))-halfPi]};function mercator(){return mercatorProjection(mercatorRaw).scale(961/tau)}function mercatorProjection(project){var m=projection(project),center=m.center,scale=m.scale,translate=m.translate,clipExtent=m.clipExtent,x02=null,y02,x12,y12;m.scale=function(_){return arguments.length?(scale(_),reclip()):scale()},m.translate=function(_){return arguments.length?(translate(_),reclip()):translate()},m.center=function(_){return arguments.length?(center(_),reclip()):center()},m.clipExtent=function(_){return arguments.length?(_==null?x02=y02=x12=y12=null:(x02=+_[0][0],y02=+_[0][1],x12=+_[1][0],y12=+_[1][1]),reclip()):x02==null?null:[[x02,y02],[x12,y12]]};function reclip(){var k=pi*scale(),t=m(rotation(m.rotate()).invert([0,0]));return clipExtent(x02==null?[[t[0]-k,t[1]-k],[t[0]+k,t[1]+k]]:project===mercatorRaw?[[Math.max(t[0]-k,x02),y02],[Math.min(t[0]+k,x12),y12]]:[[x02,Math.max(t[1]-k,y02)],[x12,Math.min(t[1]+k,y12)]])}return reclip()}function tany(y){return tan((halfPi+y)/2)}function conicConformalRaw(y02,y12){var cy0=cos(y02),n=y02===y12?sin(y02):log(cy0/cos(y12))/log(tany(y12)/tany(y02)),f=cy0*pow(tany(y02),n)/n;if(!n)return mercatorRaw;function project(x,y){f>0?y<-halfPi+epsilon&&(y=-halfPi+epsilon):y>halfPi-epsilon&&(y=halfPi-epsilon);var r=f/pow(tany(y),n);return[r*sin(n*x),f-r*cos(n*x)]}return project.invert=function(x,y){var fy=f-y,r=sign(n)*sqrt(x*x+fy*fy),l=atan2(x,abs(fy))*sign(fy);return fy*n<0&&(l-=pi*sign(x)*sign(fy)),[l/n,2*atan(pow(f/r,1/n))-halfPi]},project}function conicConformal(){return conicProjection(conicConformalRaw).scale(109.5).parallels([30,30])}function equirectangularRaw(lambda,phi){return[lambda,phi]}equirectangularRaw.invert=equirectangularRaw;function equirectangular(){return projection(equirectangularRaw).scale(152.63)}function conicEquidistantRaw(y02,y12){var cy0=cos(y02),n=y02===y12?sin(y02):(cy0-cos(y12))/(y12-y02),g=cy0/n+y02;if(abs(n)<epsilon)return equirectangularRaw;function project(x,y){var gy=g-y,nx=n*x;return[gy*sin(nx),g-gy*cos(nx)]}return project.invert=function(x,y){var gy=g-y,l=atan2(x,abs(gy))*sign(gy);return gy*n<0&&(l-=pi*sign(x)*sign(gy)),[l/n,g-sign(n)*sqrt(x*x+gy*gy)]},project}function conicEquidistant(){return conicProjection(conicEquidistantRaw).scale(131.154).center([0,13.9389])}var A1=1.340264,A2=-.081106,A3=893e-6,A4=.003796,M=sqrt(3)/2,iterations=12;function equalEarthRaw(lambda,phi){var l=asin(M*sin(phi)),l2=l*l,l6=l2*l2*l2;return[lambda*cos(l)/(M*(A1+3*A2*l2+l6*(7*A3+9*A4*l2))),l*(A1+A2*l2+l6*(A3+A4*l2))]}equalEarthRaw.invert=function(x,y){for(var l=y,l2=l*l,l6=l2*l2*l2,i=0,delta,fy,fpy;i<iterations&&(fy=l*(A1+A2*l2+l6*(A3+A4*l2))-y,fpy=A1+3*A2*l2+l6*(7*A3+9*A4*l2),l-=delta=fy/fpy,l2=l*l,l6=l2*l2*l2,!(abs(delta)<epsilon2));++i);return[M*x*(A1+3*A2*l2+l6*(7*A3+9*A4*l2))/cos(l),asin(sin(l)/M)]};function equalEarth(){return projection(equalEarthRaw).scale(177.158)}function gnomonicRaw(x,y){var cy=cos(y),k=cos(x)*cy;return[cy*sin(x)/k,sin(y)/k]}gnomonicRaw.invert=azimuthalInvert(atan);function gnomonic(){return projection(gnomonicRaw).scale(144.049).clipAngle(60)}function identity$1(){var k=1,tx=0,ty=0,sx=1,sy=1,alpha=0,ca,sa,x02=null,y02,x12,y12,kx=1,ky=1,transform2=transformer({point:function(x,y){var p=projection2([x,y]);this.stream.point(p[0],p[1])}}),postclip=identity$2,cache,cacheStream;function reset(){return kx=k*sx,ky=k*sy,cache=cacheStream=null,projection2}function projection2(p){var x=p[0]*kx,y=p[1]*ky;if(alpha){var t=y*ca-x*sa;x=x*ca+y*sa,y=t}return[x+tx,y+ty]}return projection2.invert=function(p){var x=p[0]-tx,y=p[1]-ty;if(alpha){var t=y*ca+x*sa;x=x*ca-y*sa,y=t}return[x/kx,y/ky]},projection2.stream=function(stream){return cache&&cacheStream===stream?cache:cache=transform2(postclip(cacheStream=stream))},projection2.postclip=function(_){return arguments.length?(postclip=_,x02=y02=x12=y12=null,reset()):postclip},projection2.clipExtent=function(_){return arguments.length?(postclip=_==null?(x02=y02=x12=y12=null,identity$2):clipRectangle(x02=+_[0][0],y02=+_[0][1],x12=+_[1][0],y12=+_[1][1]),reset()):x02==null?null:[[x02,y02],[x12,y12]]},projection2.scale=function(_){return arguments.length?(k=+_,reset()):k},projection2.translate=function(_){return arguments.length?(tx=+_[0],ty=+_[1],reset()):[tx,ty]},projection2.angle=function(_){return arguments.length?(alpha=_%360*radians,sa=sin(alpha),ca=cos(alpha),reset()):alpha*degrees},projection2.reflectX=function(_){return arguments.length?(sx=_?-1:1,reset()):sx<0},projection2.reflectY=function(_){return arguments.length?(sy=_?-1:1,reset()):sy<0},projection2.fitExtent=function(extent2,object2){return fitExtent$1(projection2,extent2,object2)},projection2.fitSize=function(size,object2){return fitSize$1(projection2,size,object2)},projection2.fitWidth=function(width,object2){return fitWidth(projection2,width,object2)},projection2.fitHeight=function(height,object2){return fitHeight(projection2,height,object2)},projection2}function naturalEarth1Raw(lambda,phi){var phi2=phi*phi,phi4=phi2*phi2;return[lambda*(.8707-.131979*phi2+phi4*(-.013791+phi4*(.003971*phi2-.001529*phi4))),phi*(1.007226+phi2*(.015085+phi4*(-.044475+.028874*phi2-.005916*phi4)))]}naturalEarth1Raw.invert=function(x,y){var phi=y,i=25,delta;do{var phi2=phi*phi,phi4=phi2*phi2;phi-=delta=(phi*(1.007226+phi2*(.015085+phi4*(-.044475+.028874*phi2-.005916*phi4)))-y)/(1.007226+phi2*(.015085*3+phi4*(-.044475*7+.028874*9*phi2-.005916*11*phi4)))}while(abs(delta)>epsilon&&--i>0);return[x/(.8707+(phi2=phi*phi)*(-.131979+phi2*(-.013791+phi2*phi2*phi2*(.003971-.001529*phi2)))),phi]};function naturalEarth1(){return projection(naturalEarth1Raw).scale(175.295)}function orthographicRaw(x,y){return[cos(y)*sin(x),sin(y)]}orthographicRaw.invert=azimuthalInvert(asin);function orthographic(){return projection(orthographicRaw).scale(249.5).clipAngle(90+epsilon)}function stereographicRaw(x,y){var cy=cos(y),k=1+cos(x)*cy;return[cy*sin(x)/k,sin(y)/k]}stereographicRaw.invert=azimuthalInvert(function(z){return 2*atan(z)});function stereographic(){return projection(stereographicRaw).scale(250).clipAngle(142)}function transverseMercatorRaw(lambda,phi){return[log(tan((halfPi+phi)/2)),-lambda]}transverseMercatorRaw.invert=function(x,y){return[-y,2*atan(exp(x))-halfPi]};function transverseMercator(){var m=mercatorProjection(transverseMercatorRaw),center=m.center,rotate=m.rotate;return m.center=function(_){return arguments.length?center([-_[1],_[0]]):(_=center(),[_[1],-_[0]])},m.rotate=function(_){return arguments.length?rotate([_[0],_[1],_.length>2?_[2]+90:90]):(_=rotate(),[_[0],_[1],_[2]-90])},rotate([0,0,90]).scale(159.155)}const d3Geo=Object.freeze(Object.defineProperty({__proto__:null,geoAlbers,geoAlbersUsa:albersUsa,geoArea:area,geoAzimuthalEqualArea:azimuthalEqualArea,geoAzimuthalEqualAreaRaw:azimuthalEqualAreaRaw,geoAzimuthalEquidistant:azimuthalEquidistant,geoAzimuthalEquidistantRaw:azimuthalEquidistantRaw,geoBounds:bounds,geoCentroid:centroid,geoCircle:circle$1,geoClipAntimeridian:clipAntimeridian,geoClipCircle:clipCircle,geoClipExtent:extent,geoClipRectangle:clipRectangle,geoConicConformal:conicConformal,geoConicConformalRaw:conicConformalRaw,geoConicEqualArea,geoConicEqualAreaRaw:conicEqualAreaRaw,geoConicEquidistant:conicEquidistant,geoConicEquidistantRaw:conicEquidistantRaw,geoContains:contains,geoDistance:distance,geoEqualEarth:equalEarth,geoEqualEarthRaw:equalEarthRaw,geoEquirectangular:equirectangular,geoEquirectangularRaw:equirectangularRaw,geoGnomonic:gnomonic,geoGnomonicRaw:gnomonicRaw,geoGraticule:graticule,geoGraticule10:graticule10,geoIdentity:identity$1,geoInterpolate:interpolate,geoLength:length,geoMercator:mercator,geoMercatorRaw:mercatorRaw,geoNaturalEarth1:naturalEarth1,geoNaturalEarth1Raw:naturalEarth1Raw,geoOrthographic:orthographic,geoOrthographicRaw:orthographicRaw,geoPath:d3GeoPath,geoProjection:projection,geoProjectionMutator:projectionMutator,geoRotation:rotation,geoStereographic:stereographic,geoStereographicRaw:stereographicRaw,geoStream,geoTransform:d3GeoTransform,geoTransverseMercator:transverseMercator,geoTransverseMercatorRaw:transverseMercatorRaw},Symbol.toStringTag,{value:"Module"}));function noop(){}let x0=1/0,y0=x0,x1=-x0,y1=x1;function boundsPoint(x,y){x<x0&&(x0=x),x>x1&&(x1=x),y<y0&&(y0=y),y>y1&&(y1=y)}const boundsStream={point:boundsPoint,lineStart:noop,lineEnd:noop,polygonStart:noop,polygonEnd:noop,result(){const bounds2=[[x0,y0],[x1,y1]];return x1=y1=-(y0=x0=1/0),bounds2}};function fitExtent(projection2,extent2,object2){const w=extent2[1][0]-extent2[0][0],h=extent2[1][1]-extent2[0][1],clip2=projection2.clipExtent&&projection2.clipExtent();projection2.scale(150).translate([0,0]),clip2!=null&&projection2.clipExtent(null),geoStream(object2,projection2.stream(boundsStream));const b=boundsStream.result(),k=Math.min(w/(b[1][0]-b[0][0]),h/(b[1][1]-b[0][1])),x=+extent2[0][0]+(w-k*(b[1][0]+b[0][0]))/2,y=+extent2[0][1]+(h-k*(b[1][1]+b[0][1]))/2;return clip2!=null&&projection2.clipExtent(clip2),projection2.scale(k*150).translate([x,y])}function fitSize(projection2,size,object2){return fitExtent(projection2,[[0,0],size],object2)}const _Geohash=class _Geohash{encode(lat,lon,precision){if(typeof precision>"u"){for(let p=1;p<=12;p++){const hash=this.encode(lat,lon,p),posn=this.decode(hash);if(posn.lat===lat&&posn.lon===lon)return hash}precision=12}if(lat=Number(lat),lon=Number(lon),precision=Number(precision),isNaN(lat)||isNaN(lon)||isNaN(precision))throw new Error("Invalid geohash");let idx=0,bit=0,evenBit=!0,geohash="",latMin=-90,latMax=90,lonMin=-180,lonMax=180;for(;geohash.length<precision;){if(evenBit){const lonMid=(lonMin+lonMax)/2;lon>lonMid?(idx=idx*2+1,lonMin=lonMid):(idx=idx*2,lonMax=lonMid)}else{const latMid=(latMin+latMax)/2;lat>latMid?(idx=idx*2+1,latMin=latMid):(idx=idx*2,latMax=latMid)}evenBit=!evenBit,++bit===5&&(geohash+=_Geohash.base32.charAt(idx),bit=0,idx=0)}return geohash}decode(geohash){const bounds2=this.bounds(geohash),latMin=bounds2.sw.lat,lonMin=bounds2.sw.lon,latMax=bounds2.ne.lat,lonMax=bounds2.ne.lon;let lat=(latMin+latMax)/2,lon=(lonMin+lonMax)/2;return lat=Number(lat.toFixed(Math.floor(2-Math.log(latMax-latMin)/Math.LN10))),lon=Number(lon.toFixed(Math.floor(2-Math.log(lonMax-lonMin)/Math.LN10))),{lat,lon}}bounds(geohash){if(geohash.length===0)throw new Error("Invalid geohash");geohash=geohash.toLowerCase();let evenBit=!0,latMin=-90,latMax=90,lonMin=-180,lonMax=180;for(let i=0;i<geohash.length;i++){const chr=geohash.charAt(i),idx=_Geohash.base32.indexOf(chr);if(idx===-1)throw new Error("Invalid geohash");for(let n=4;n>=0;n--){const bitN=idx>>n&1;if(evenBit){const lonMid=(lonMin+lonMax)/2;bitN===1?lonMin=lonMid:lonMax=lonMid}else{const latMid=(latMin+latMax)/2;bitN===1?latMin=latMid:latMax=latMid}evenBit=!evenBit}}return{sw:{lat:latMin,lon:lonMin},ne:{lat:latMax,lon:lonMax}}}adjacent(geohash,direction){if(geohash=geohash.toLowerCase(),direction=direction.toLowerCase(),geohash.length===0)throw new Error("Invalid geohash");if("nsew".indexOf(direction)===-1)throw new Error("Invalid direction");const neighbour={n:["p0r21436x8zb9dcf5h7kjnmqesgutwvy","bc01fg45238967deuvhjyznpkmstqrwx"],s:["14365h7k9dcfesgujnmqp0r2twvyx8zb","238967debc01fg45kmstqrwxuvhjyznp"],e:["bc01fg45238967deuvhjyznpkmstqrwx","p0r21436x8zb9dcf5h7kjnmqesgutwvy"],w:["238967debc01fg45kmstqrwxuvhjyznp","14365h7k9dcfesgujnmqp0r2twvyx8zb"]},border={n:["prxz","bcfguvyz"],s:["028b","0145hjnp"],e:["bcfguvyz","prxz"],w:["0145hjnp","028b"]},lastCh=geohash.slice(-1);let parent=geohash.slice(0,-1);const type2=geohash.length%2;return border[direction][type2].indexOf(lastCh)!==-1&&parent!==""&&(parent=this.adjacent(parent,direction)),parent+_Geohash.base32.charAt(neighbour[direction][type2].indexOf(lastCh))}neighbours(geohash){return{n:this.adjacent(geohash,"n"),ne:this.adjacent(this.adjacent(geohash,"n"),"e"),e:this.adjacent(geohash,"e"),se:this.adjacent(this.adjacent(geohash,"s"),"e"),s:this.adjacent(geohash,"s"),sw:this.adjacent(this.adjacent(geohash,"s"),"w"),w:this.adjacent(geohash,"w"),nw:this.adjacent(this.adjacent(geohash,"n"),"w")}}contained(w,n,e,s,precision){(isNaN(n)||n>=90)&&(n=89),(isNaN(e)||e>180)&&(e=180),(isNaN(s)||s<=-90)&&(s=-89),(isNaN(w)||w<-180)&&(w=-180),precision=precision||1;const geoHashNW=this.encode(n,w,precision),geoHashNE=this.encode(n,e,precision),geoHashSE=this.encode(s,e,precision);let currRowHash=geoHashNW,col=0,maxCol=-1;const geoHashes=[geoHashNW,geoHashSE];let currHash=this.adjacent(geoHashNW,"e");for(;currHash!==geoHashSE;)geoHashes.push(currHash),++col,currHash===geoHashNE||maxCol===col?(maxCol=col+1,col=0,currHash=this.adjacent(currRowHash,"s"),currRowHash=currHash):currHash=this.adjacent(currHash,"e");return geoHashes}calculateWidthDegrees(n){let a;return n%2===0?a=-1:a=-.5,180/Math.pow(2,2.5*n+a)}width(n){const parity=n%2;return 180/(2^(5*n+parity)/2-1)}};__publicField(_Geohash,"base32","0123456789bcdefghjkmnpqrstuvwxyz");let Geohash=_Geohash;function multiplex(streams){const n=streams.length;return{point(x,y){let i=-1;for(;++i<n;)streams[i].point(x,y)},sphere(){let i=-1;for(;++i<n;)streams[i].sphere()},lineStart(){let i=-1;for(;++i<n;)streams[i].lineStart()},lineEnd(){let i=-1;for(;++i<n;)streams[i].lineEnd()},polygonStart(){let i=-1;for(;++i<n;)streams[i].polygonStart()},polygonEnd(){let i=-1;for(;++i<n;)streams[i].polygonEnd()}}}function albersUsaPr(){let cache,cacheStream;const lower48=geoAlbers();let lower48Point;const alaska=geoConicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]);let alaskaPoint;const hawaii=geoConicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]);let hawaiiPoint;const puertoRico=geoConicEqualArea().rotate([66,0]).center([0,18]).parallels([8,18]);let puertoRicoPoint,point;const pointStream={point:(x,y)=>{point=[x,y]}},albersUsa2=function(coordinates2){const x=coordinates2[0],y=coordinates2[1];return point=null,lower48Point.point(x,y),point||(alaskaPoint.point(x,y),point)||(hawaiiPoint.point(x,y),point)||puertoRicoPoint.point(x,y),point};albersUsa2.invert=function(coordinates2){const k=lower48.scale(),t=lower48.translate(),x=(coordinates2[0]-t[0])/k,y=(coordinates2[1]-t[1])/k;return(y>=.12&&y<.234&&x>=-.425&&x<-.214?alaska:y>=.166&&y<.234&&x>=-.214&&x<-.115?hawaii:y>=.204&&y<.234&&x>=.32&&x<.38?puertoRico:lower48).invert(coordinates2)},albersUsa2.stream=function(stream){return cache&&cacheStream===stream?cache:cache=multiplex([lower48.stream(cacheStream=stream),alaska.stream(stream),hawaii.stream(stream),puertoRico.stream(stream)])},albersUsa2.precision=function(_){return arguments.length?(lower48.precision(_),alaska.precision(_),hawaii.precision(_),puertoRico.precision(_),reset()):lower48.precision()},albersUsa2.scale=function(_){return arguments.length?(lower48.scale(_),alaska.scale(_*.35),hawaii.scale(_),puertoRico.scale(_),albersUsa2.translate(lower48.translate())):lower48.scale()},albersUsa2.translate=function(_){if(!arguments.length)return lower48.translate();const k=lower48.scale(),x=+_[0],y=+_[1];return lower48Point=lower48.translate(_).clipExtent([[x-.455*k,y-.238*k],[x+.455*k,y+.238*k]]).stream(pointStream),alaskaPoint=alaska.translate([x-.307*k,y+.201*k]).clipExtent([[x-.425*k+1e-6,y+.12*k+1e-6],[x-.214*k-1e-6,y+.234*k-1e-6]]).stream(pointStream),hawaiiPoint=hawaii.translate([x-.205*k,y+.212*k]).clipExtent([[x-.214*k+1e-6,y+.166*k+1e-6],[x-.115*k-1e-6,y+.234*k-1e-6]]).stream(pointStream),puertoRicoPoint=puertoRico.translate([x+.35*k,y+.224*k]).clipExtent([[x+.32*k,y+.204*k],[x+.38*k,y+.234*k]]).stream(pointStream),reset()},albersUsa2.fitExtent=function(extent2,object2){return fitExtent(albersUsa2,extent2,object2)},albersUsa2.fitSize=function(size,object2){return fitSize(albersUsa2,size,object2)};function reset(){return cache=cacheStream=null,albersUsa2}return albersUsa2.scale(1070)}var Type=(Type2=>(Type2[Type2.AzimuthalEqualArea=0]="AzimuthalEqualArea",Type2[Type2.AzimuthalEquidistant=1]="AzimuthalEquidistant",Type2[Type2.Gnomonic=2]="Gnomonic",Type2[Type2.Orthographic=3]="Orthographic",Type2[Type2.Stereographic=4]="Stereographic",Type2[Type2.AlbersUsa=5]="AlbersUsa",Type2[Type2.AlbersUsaPr=6]="AlbersUsaPr",Type2[Type2.Albers=7]="Albers",Type2[Type2.ConicConformal=8]="ConicConformal",Type2[Type2.ConicEqualArea=9]="ConicEqualArea",Type2[Type2.ConicEquidistant=10]="ConicEquidistant",Type2[Type2.Equirectangular=11]="Equirectangular",Type2[Type2.Mercator=12]="Mercator",Type2[Type2.TransverseMercator=13]="TransverseMercator",Type2))(Type||{});const types=[],projections={};for(const key in Type)typeof key=="string"&&(types.push(key),key==="AlbersUsaPr"?projections[key]=albersUsaPr:projections[key]=d3Geo[`geo${key}`]);function resolve(id){const retVal=projections[id];return retVal?retVal():(console.warn("Unknown projection: "+id),mercator())}const projectionFactor$1=4096/2/Math.PI;class Layered extends common.SVGZoomWidget{constructor(){super();__publicField(this,"_autoScaleOnNextRender");__publicField(this,"_layersTarget");__publicField(this,"_prevAutoScaleMode");__publicField(this,"_d3GeoProjection");this._drawStartPos="origin",this.projection("Mercator")}data(_){const retVal=super.data.apply(this,arguments);return arguments.length&&(this._autoScaleOnNextRender=!0),retVal}enter(domNode,element){super.enter(domNode,element),this._layersTarget=this._renderElement.append("g").attr("class","layersTarget")}update(domNode,element){super.update(domNode,element);const layers=this._layersTarget.selectAll(".layerContainer").data(this.layers().filter(function(d){return d.visible()}),function(d){return d.id()}),context=this;layers.enter().append("g").attr("id",function(d){return d.id()}).attr("class","layerContainer").each(function(d){d._svgElement=common.select(this),d._domElement=context._parentOverlay.append("div"),d.layerEnter(context,d._svgElement,d._domElement)}).merge(layers).each(function(d){d.layerUpdate(context)}),layers.exit().each(function(d){d.layerExit(context),d._domElement.remove()}).remove(),layers.order(),this.onZoomed()}exit(domNode,element){super.exit(domNode,element)}onZoomed(){super.onZoomed();const layers=this._layersTarget.selectAll(".layerContainer"),context=this;layers.each(function(d){d.layerZoomed(context)})}preRender(callback){return Promise.all(this.layers().filter(function(layer){return layer.visible()}).map(function(layer){return layer.layerPreRender()}))}render(callback){const context=this;return this.preRender().then(function(){common.SVGZoomWidget.prototype.render.call(context,function(w){context._layersTarget&&(context._renderCount&&context._autoScaleOnNextRender||context._prevAutoScaleMode!==context.autoScaleMode())&&(context._prevAutoScaleMode=context.autoScaleMode(),context._autoScaleOnNextRender=!1,context.autoScale()),callback&&callback(w)})}),this}project(lat,long){return lat>=90?lat=89:lat<=-90&&(lat=-89),this._d3GeoProjection([long,lat])}invert(x,y){return this._d3GeoProjection.invert([x,y])}getBounds(){const bbox=this._layersTarget.node().getBBox();return{x:bbox.x,y:bbox.y,width:bbox.width,height:bbox.height}}autoScale(){switch(this.autoScaleMode()){case"none":return;case"all":this.zoomToBBox(this.getBounds());break}}}Layered.prototype._class+=" map_Layered",Layered.prototype.publish("projection",null,"set","Map projection type",types),Layered.prototype.publish("centerLat",0,"number","Center Latitude",null,{tags:["Basic"]}),Layered.prototype.publish("centerLong",0,"number","Center Longitude",null,{tags:["Basic"]}),Layered.prototype.publish("zoom",1,"number","Zoom Level",null,{tags:["Basic"]}),Layered.prototype.publish("autoScaleMode","all","set","Auto Scale",["none","all"],{tags:["Basic"]}),Layered.prototype.publish("layers",[],"widgetArray","Layers",null,{render:!1});const projection_orig=Layered.prototype.projection;Layered.prototype.projection=function(_){const retVal=projection_orig.apply(this,arguments);if(arguments.length){switch(this._d3GeoProjection=resolve(_).scale(projectionFactor$1).translate([0,0]),_){case"orthographic":this._d3GeoProjection.clipAngle(90).rotate([0,0])}this._d3GeoPath=d3GeoPath().projection(this._d3GeoProjection),this._autoScaleOnNextRender=!0}return retVal};class Layer extends Layered{constructor(){super();__publicField(this,"_svgElement");__publicField(this,"_domElement");__publicField(this,"_topoJsonPromise");api.ITooltip.call(this)}svgGlowID(){return""}layerEnter(base,svgElement,domElement){this._parentOverlay=base._parentOverlay}enter(domNode,element){super.enter(domNode,element),this._svgElement=this._layersTarget.append("g"),this._domElement=this._parentOverlay.append("div"),this.layerEnter(this,this._svgElement,this._domElement)}layerUpdate(base,forcePath){}update(domNode,element){super.update(domNode,element),this.layerUpdate(this)}onZoomed(){super.onZoomed(),this.layerUpdate(this)}layerExit(base){}exit(domNode,element){this.layerExit(this),this._svgElement.remove(),this._domElement.remove(),super.exit(domNode,element)}layerPreRender(){return Promise.resolve()}render(callback){const context=this,args=arguments;return this.layerPreRender().then(function(){Layered.prototype.render.apply(context,args)}),this}layerZoomed(base){}}Layer.prototype._class+=" map_Layer",Layer.prototype.implements(api.ITooltip.prototype);class CanvasPinLayer extends Layer{constructor(){super();__publicField(this,"_pinsTransform");__publicField(this,"pins");__publicField(this,"_prevProjection");this.pins=new CanvasPins}layerEnter(base,svgElement,domElement){Layer.prototype.layerEnter.apply(this,arguments),this._parentOverlay.style("pointer-events","none"),this._pinsTransform=domElement.style("pointer-events","none").append("div").attr("class",this.classID()).style("width",base.width()+"px").style("height",base.height()+"px"),this.pins.target(this._pinsTransform.node())}layerUpdate(base){Layer.prototype.layerUpdate.apply(this,arguments),this._pinsTransform.style("opacity",this.opacity()).style("width",base.width()+"px").style("height",base.height()+"px"),this.pins.resize(base.size()),this.layerZoomed(base)}layerExit(base){delete this._prevProjection,this.pins.target(null),delete this.pins}layerZoomed(base){Layer.prototype.layerZoomed.apply(this,arguments);const latField=this._db.fieldByLabel(this.latColumn()),longField=this._db.fieldByLabel(this.longColumn()),weightField=this._db.fieldByLabel(this.weightColumn());this.pins.columns(this.columns()).data(this.visible()?this.data().map(function(row){const lat=latField?row[latField.idx]:row[0],long=longField?row[longField.idx]:row[1],weight=weightField?row[weightField.idx]:1,transform2=base.zoomTranslate(),pos=base.project(lat,long),scale=base.zoomScale();return pos[0]*=scale,pos[1]*=scale,[transform2[0]+pos[0],transform2[1]+pos[1],weight]}):[]).render()}}CanvasPinLayer.prototype._class+=" map_CanvasPinLayer",CanvasPinLayer.prototype.publishProxy("clusterMode","pins","clusterMode"),CanvasPinLayer.prototype.publishProxy("allCircles","pins","allCircles"),CanvasPinLayer.prototype.publishProxy("showQuadtree","pins","showQuadtree"),CanvasPinLayer.prototype.publishProxy("useAveragePos","pins","useAveragePos"),CanvasPinLayer.prototype.publishProxy("shrinkFontToPin","pins","shrinkFontToPin"),CanvasPinLayer.prototype.publishProxy("enableClustering","pins","enableClustering"),CanvasPinLayer.prototype.publishProxy("useWeightedRadius","pins","useWeightedRadius"),CanvasPinLayer.prototype.publishProxy("radiusWeightMult","pins","radiusWeightMult"),CanvasPinLayer.prototype.publishProxy("searchRectMult","pins","searchRectMult"),CanvasPinLayer.prototype.publishProxy("pinHeight","pins","pinHeight"),CanvasPinLayer.prototype.publishProxy("pinWidth","pins","pinWidth"),CanvasPinLayer.prototype.publishProxy("pinFontFamily","pins","pinFontFamily"),CanvasPinLayer.prototype.publishProxy("pinFontSize","pins","pinFontSize"),CanvasPinLayer.prototype.publishProxy("arrowHeight","pins","arrowHeight"),CanvasPinLayer.prototype.publishProxy("arrowWidth","pins","arrowWidth"),CanvasPinLayer.prototype.publish("latColumn",null,"set","latColumn",function(){return this.columns()},{optional:!0}),CanvasPinLayer.prototype.publish("longColumn",null,"set","longColumn",function(){return this.columns()},{optional:!0}),CanvasPinLayer.prototype.publish("weightColumn",null,"set","weightColumn",function(){return this.columns()},{optional:!0}),CanvasPinLayer.prototype.publish("opacity",1,"number","Opacity",null,{tags:["Advanced"]});function identity(x){return x}function transform(transform2){if(transform2==null)return identity;var x02,y02,kx=transform2.scale[0],ky=transform2.scale[1],dx=transform2.translate[0],dy=transform2.translate[1];return function(input,i){i||(x02=y02=0);var j=2,n=input.length,output=new Array(n);for(output[0]=(x02+=input[0])*kx+dx,output[1]=(y02+=input[1])*ky+dy;j<n;)output[j]=input[j],++j;return output}}function reverse(array,n){for(var t,j=array.length,i=j-n;i<--j;)t=array[i],array[i++]=array[j],array[j]=t}function feature(topology,o){return typeof o=="string"&&(o=topology.objects[o]),o.type==="GeometryCollection"?{type:"FeatureCollection",features:o.geometries.map(function(o2){return feature$1(topology,o2)})}:feature$1(topology,o)}function feature$1(topology,o){var id=o.id,bbox=o.bbox,properties=o.properties==null?{}:o.properties,geometry=object(topology,o);return id==null&&bbox==null?{type:"Feature",properties,geometry}:bbox==null?{type:"Feature",id,properties,geometry}:{type:"Feature",id,bbox,properties,geometry}}function object(topology,o){var transformPoint=transform(topology.transform),arcs=topology.arcs;function arc(i,points){points.length&&points.pop();for(var a=arcs[i<0?~i:i],k=0,n=a.length;k<n;++k)points.push(transformPoint(a[k],k));i<0&&reverse(points,n)}function point(p){return transformPoint(p)}function line(arcs2){for(var points=[],i=0,n=arcs2.length;i<n;++i)arc(arcs2[i],points);return points.length<2&&points.push(points[0]),points}function ring(arcs2){for(var points=line(arcs2);points.length<4;)points.push(points[0]);return points}function polygon(arcs2){return arcs2.map(ring)}function geometry(o2){var type2=o2.type,coordinates2;switch(type2){case"GeometryCollection":return{type:type2,geometries:o2.geometries.map(geometry)};case"Point":coordinates2=point(o2.coordinates);break;case"MultiPoint":coordinates2=o2.coordinates.map(point);break;case"LineString":coordinates2=line(o2.arcs);break;case"MultiLineString":coordinates2=o2.arcs.map(line);break;case"Polygon":coordinates2=polygon(o2.arcs);break;case"MultiPolygon":coordinates2=o2.arcs.map(polygon);break;default:return null}return{type:type2,coordinates:coordinates2}}return geometry(o)}function stitch(topology,arcs){var stitchedArcs={},fragmentByStart={},fragmentByEnd={},fragments=[],emptyIndex=-1;arcs.forEach(function(i,j){var arc=topology.arcs[i<0?~i:i],t;arc.length<3&&!arc[1][0]&&!arc[1][1]&&(t=arcs[++emptyIndex],arcs[emptyIndex]=i,arcs[j]=t)}),arcs.forEach(function(i){var e=ends(i),start=e[0],end=e[1],f,g;if(f=fragmentByEnd[start])if(delete fragmentByEnd[f.end],f.push(i),f.end=end,g=fragmentByStart[end]){delete fragmentByStart[g.start];var fg=g===f?f:f.concat(g);fragmentByStart[fg.start=f.start]=fragmentByEnd[fg.end=g.end]=fg}else fragmentByStart[f.start]=fragmentByEnd[f.end]=f;else if(f=fragmentByStart[end])if(delete fragmentByStart[f.start],f.unshift(i),f.start=start,g=fragmentByEnd[start]){delete fragmentByEnd[g.end];var gf=g===f?f:g.concat(f);fragmentByStart[gf.start=g.start]=fragmentByEnd[gf.end=f.end]=gf}else fragmentByStart[f.start]=fragmentByEnd[f.end]=f;else f=[i],fragmentByStart[f.start=start]=fragmentByEnd[f.end=end]=f});function ends(i){var arc=topology.arcs[i<0?~i:i],p02=arc[0],p1;return topology.transform?(p1=[0,0],arc.forEach(function(dp){p1[0]+=dp[0],p1[1]+=dp[1]})):p1=arc[arc.length-1],i<0?[p1,p02]:[p02,p1]}function flush(fragmentByEnd2,fragmentByStart2){for(var k in fragmentByEnd2){var f=fragmentByEnd2[k];delete fragmentByStart2[f.start],delete f.start,delete f.end,f.forEach(function(i){stitchedArcs[i<0?~i:i]=1}),fragments.push(f)}}return flush(fragmentByEnd,fragmentByStart),flush(fragmentByStart,fragmentByEnd),arcs.forEach(function(i){stitchedArcs[i<0?~i:i]||fragments.push([i])}),fragments}function mesh(topology){return object(topology,meshArcs.apply(this,arguments))}function meshArcs(topology,object2,filter){var arcs,i,n;if(arguments.length>1)arcs=extractArcs(topology,object2,filter);else for(i=0,arcs=new Array(n=topology.arcs.length);i<n;++i)arcs[i]=i;return{type:"MultiLineString",arcs:stitch(topology,arcs)}}function extractArcs(topology,object2,filter){var arcs=[],geomsByArc=[],geom;function extract0(i){var j=i<0?~i:i;(geomsByArc[j]||(geomsByArc[j]=[])).push({i,g:geom})}function extract1(arcs2){arcs2.forEach(extract0)}function extract2(arcs2){arcs2.forEach(extract1)}function extract3(arcs2){arcs2.forEach(extract2)}function geometry(o){switch(geom=o,o.type){case"GeometryCollection":o.geometries.forEach(geometry);break;case"LineString":extract1(o.arcs);break;case"MultiLineString":case"Polygon":extract2(o.arcs);break;case"MultiPolygon":extract3(o.arcs);break}}return geometry(object2),geomsByArc.forEach(filter==null?function(geoms){arcs.push(geoms[0].i)}:function(geoms){filter(geoms[0].g,geoms[geoms.length-1].g)&&arcs.push(geoms[0].i)}),arcs}let _topoJsonFolder=window.__hpcc_topoJsonFolder||"./node_modules/@hpcc-js/map/TopoJSON";function topoJsonFolder(_){if(!arguments.length)return _topoJsonFolder;const retVal=_topoJsonFolder;return _topoJsonFolder=_,retVal}class Choropleth extends Layer{constructor(){super();__publicField(this,"_dataMap",{});__publicField(this,"_path",common.select(null));__publicField(this,"_dataMinWeight");__publicField(this,"_dataMaxWeight");__publicField(this,"_choroplethData");__publicField(this,"_choroplethTransform");__publicField(this,"_choropleth");__publicField(this,"_choroTopology");__publicField(this,"_choroTopologyObjects");__publicField(this,"_prevProjection");__publicField(this,"_prevInternalOnly");common.Utility.SimpleSelectionMixin.call(this)}data(_){const retVal=Layer.prototype.data.apply(this,arguments);if(arguments.length){this._dataMap={},this._dataMinWeight=null,this._dataMaxWeight=null;const context=this;this.data().forEach(function(item){context._dataMap[item[0]]=item,(!context._dataMinWeight||item[1]<context._dataMinWeight)&&(context._dataMinWeight=item[1]),(!context._dataMaxWeight||item[1]>context._dataMaxWeight)&&(context._dataMaxWeight=item[1])})}return retVal}getDataBounds(){const bbox=this._choroplethData.node().getBBox();return{x:bbox.x,y:bbox.y,width:bbox.width,height:bbox.height}}autoScale(){switch(this.autoScaleMode()){case"none":return;case"mesh":this.zoomToBBox(this.getBounds());break;case"data":this.zoomToBBox(this.getDataBounds());break}}layerEnter(base,svgElement,domElement){Layer.prototype.layerEnter.apply(this,arguments),this._choroplethTransform=svgElement,this._choroplethData=this._choroplethTransform.append("g").attr("class","data"),this._choropleth=this._choroplethTransform.append("path").attr("class","mesh")}layerUpdate(base,forcePath){if(Layer.prototype.layerUpdate.apply(this,arguments),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._choroplethTransform.style("stroke",this.meshColor()).style("opacity",this.opacity()),!this.visible()||!this.meshVisible()){this._choropleth.attr("d",""),delete this._prevProjection;return}(forcePath||this._prevProjection!==base.projection()||this._prevInternalOnly!==this.internalOnly())&&(this._choropleth.attr("d",base._d3GeoPath(mesh(this._choroTopology,this._choroTopologyObjects,this.internalOnly()?function(a,b){return a!==b}:function(a,b){return!0}))),this._prevProjection=base.projection(),this._prevInternalOnly=this.internalOnly()),this._choropleth.style("stroke-width",this.meshStrokeWidth()).style("stroke",this.meshColor())}layerExit(base){delete this._prevProjection,delete this._prevInternalOnly}layerZoomed(base){super.layerZoomed.apply(this,arguments),this._choroplethData.style("stroke-width",this.meshVisible()?"0px":`${.5/base.zoomScale()}px`)}click(row,column,selected){}dblclick(row,column,selected){}}Choropleth.prototype._class+=" map_Choropleth",Choropleth.prototype.mixin(common.Utility.SimpleSelectionMixin),Choropleth.prototype._palette=common.Palette.rainbow("default"),Choropleth.prototype.publish("paletteID","YlOrRd","set","Color palette for this widget",Choropleth.prototype._palette.switch(),{tags:["Basic","Shared"]}),Choropleth.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Choropleth.prototype.publish("opacity",1,"number","Opacity",null,{tags:["Advanced"]}),Choropleth.prototype.publish("meshVisible",!0,"boolean","Mesh Visibility"),Choropleth.prototype.publish("meshColor",null,"html-color","Stroke Color",null,{optional:!0}),Choropleth.prototype.publish("meshStrokeWidth",.25,"number","Stroke Width"),Choropleth.prototype.publish("internalOnly",!1,"boolean","Internal mesh only"),Choropleth.prototype.publish("autoScaleMode","mesh","set","Auto Scale",["none","mesh","data"],{tags:["Basic"],override:!0});function request(url,callback){var request2,event=common.dispatch("beforesend","progress","load","error"),mimeType,headers=common.map(),xhr=new XMLHttpRequest,user=null,password=null,response,responseType,timeout=0;typeof XDomainRequest<"u"&&!("withCredentials"in xhr)&&/^(http(s)?:)?\/\//.test(url)&&(xhr=new XDomainRequest),"onload"in xhr?xhr.onload=xhr.onerror=xhr.ontimeout=respond:xhr.onreadystatechange=function(o){xhr.readyState>3&&respond(o)};function respond(o){var status=xhr.status,result;if(!status&&hasResponse(xhr)||status>=200&&status<300||status===304){if(response)try{result=response.call(request2,xhr)}catch(e){event.call("error",request2,e);return}else result=xhr;event.call("load",request2,result)}else event.call("error",request2,o)}return xhr.onprogress=function(e){event.call("progress",request2,e)},request2={header:function(name,value){return name=(name+"").toLowerCase(),arguments.length<2?headers.get(name):(value==null?headers.remove(name):headers.set(name,value+""),request2)},mimeType:function(value){return arguments.length?(mimeType=value==null?null:value+"",request2):mimeType},responseType:function(value){return arguments.length?(responseType=value,request2):responseType},timeout:function(value){return arguments.length?(timeout=+value,request2):timeout},user:function(value){return arguments.length<1?user:(user=value==null?null:value+"",request2)},password:function(value){return arguments.length<1?password:(password=value==null?null:value+"",request2)},response:function(value){return response=value,request2},get:function(data,callback2){return request2.send("GET",data,callback2)},post:function(data,callback2){return request2.send("POST",data,callback2)},send:function(method,data,callback2){return xhr.open(method,url,!0,user,password),mimeType!=null&&!headers.has("accept")&&headers.set("accept",mimeType+",*/*"),xhr.setRequestHeader&&headers.each(function(value,name){xhr.setRequestHeader(name,value)}),mimeType!=null&&xhr.overrideMimeType&&xhr.overrideMimeType(mimeType),responseType!=null&&(xhr.responseType=responseType),timeout>0&&(xhr.timeout=timeout),callback2==null&&typeof data=="function"&&(callback2=data,data=null),callback2!=null&&callback2.length===1&&(callback2=fixCallback(callback2)),callback2!=null&&request2.on("error",callback2).on("load",function(xhr2){callback2(null,xhr2)}),event.call("beforesend",request2,xhr),xhr.send(data??null),request2},abort:function(){return xhr.abort(),request2},on:function(){var value=event.on.apply(event,arguments);return value===event?request2:value}},request2}function fixCallback(callback){return function(error,xhr){callback(error==null?xhr:null)}}function hasResponse(xhr){var type2=xhr.responseType;return type2&&type2!=="text"?xhr.response:xhr.responseText}function type$1(defaultMimeType,response){return function(url,callback){var r=request(url).mimeType(defaultMimeType).response(response);if(callback!=null){if(typeof callback!="function")throw new Error("invalid callback: "+callback);return r.get(callback)}return r}}const d3Json=type$1("application/json",function(xhr){return JSON.parse(xhr.responseText)});let countries$1=null,features$2=null,rFeatures$2=null;class ChoroplethCountries extends Choropleth{constructor(){super();__publicField(this,"_choroTopologyObjectsCountries");__publicField(this,"_choroTopologyObjectsLand");__publicField(this,"choroPaths")}layerEnter(base,svgElement,domElement){Choropleth.prototype.layerEnter.apply(this,arguments),this._choroTopology=countries$1.topology,this._choroTopologyObjectsCountries=countries$1.topology.objects.countries,this._choroTopologyObjectsLand=countries$1.topology.objects.land,this._choroTopologyObjects=this._choroTopologyObjectsCountries,this._selection.widgetElement(this._choroplethData),this.choroPaths=common.select(null);const context=this;this.tooltipHTML(function(d){return context.tooltipFormat({label:d[0],value:d[1]})})}layerUpdate(base){Choropleth.prototype.layerUpdate.apply(this,arguments),this._choroplethData.style("stroke",this.meshVisible()?null:"black"),this.choroPaths=this._choroplethData.selectAll(".shape").data(this.visible()?this.data():[],function(d){return d[0]});const context=this;this.choroPaths.enter().append("path").attr("class","shape").attr("vector-effect","non-scaling-stroke").call(this._selection.enter.bind(this._selection)).on("click",function(d){context._dataMap[d[0]]&&context.click(context.rowToObj(context._dataMap[d[0]]),"weight",context._selection.selected(this))}).on("dblclick",function(d){context._dataMap[d[0]]&&context.dblclick(context.rowToObj(context._dataMap[d[0]]),"weight",context._selection.selected(this))}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).merge(this.choroPaths).attr("d",function(d){const retVal=base._d3GeoPath(rFeatures$2[d[0]]);return retVal||console.warn("Unknown Country: "+d),retVal}).style("fill",function(d){return context._palette(d[1],context._dataMinWeight,context._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){return this._topoJsonPromise||(this._topoJsonPromise=new Promise((resolve2,reject)=>{countries$1&&resolve2(),d3Json(`${topoJsonFolder()}/countries.json`,function(_countries){countries$1=_countries,features$2=feature(countries$1.topology,countries$1.topology.objects.countries).features,rFeatures$2={};for(const key in features$2)features$2[key].id&&countries$1.countryNames[features$2[key].id]&&(rFeatures$2[countries$1.countryNames[features$2[key].id].name]=features$2[key]);resolve2()})})),this._topoJsonPromise}}ChoroplethCountries.prototype._class+=" map_ChoroplethCountries";class ChoroplethContinents extends ChoroplethCountries{constructor(){super()}layerEnter(base,svgElement,domElement){ChoroplethCountries.prototype.layerEnter.apply(this,arguments),this._choroTopologyObjects=this._choroTopologyObjectsLand}}ChoroplethContinents.prototype._class+=" map_ChoroplethContinents";let usCounties$1=null,features$1=null,rFeatures$1=null;class ChoroplethCounties extends Choropleth{constructor(){super();__publicField(this,"choroPaths");this.projection("AlbersUsaPr")}layerEnter(base,svgElement,domElement){Choropleth.prototype.layerEnter.apply(this,arguments),this._choroTopology=usCounties$1.topology,this._choroTopologyObjects=usCounties$1.topology.objects.counties,this._selection.widgetElement(this._choroplethData),this.choroPaths=common.select(null);const context=this;this.tooltipHTML(function(d){const code=d[0];return context.tooltipFormat({label:usCounties$1.countyNames[code],value:context._dataMap[code]?context._dataMap[code][1]:"N/A"})})}layerUpdate(base){Choropleth.prototype.layerUpdate.apply(this,arguments),this._choroplethData.style("stroke",this.meshVisible()?null:"black"),this.choroPaths=this._choroplethData.selectAll(".shape").data(this.visible()?this.data():[],function(d){return d[0]});const context=this;this.choroPaths.enter().append("path").attr("class","shape").attr("vector-effect","non-scaling-stroke").call(this._selection.enter.bind(this._selection)).on("click",function(d){context.click(context.rowToObj(d),"weight",context._selection.selected(this))}).on("dblclick",function(d){context.dblclick(context.rowToObj(d),"weight",context._selection.selected(this))}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).merge(this.choroPaths).attr("d",function(d){const retVal=base._d3GeoPath(rFeatures$1[d.county]);return retVal||console.warn("Unknown US County: "+d.county,d),retVal}).style("fill",function(d){return context._palette(d[1],context._dataMinWeight,context._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){return this._topoJsonPromise||(this._topoJsonPromise=new Promise((resolve2,reject)=>{usCounties$1&&resolve2(),d3Json(`${topoJsonFolder()}/us-counties.json`,function(_usCounties){usCounties$1=_usCounties,features$1=feature(usCounties$1.topology,usCounties$1.topology.objects.counties).features,rFeatures$1={};for(const key in features$1)features$1[key].id&&(rFeatures$1[features$1[key].id]=features$1[key]);resolve2()})})),this._topoJsonPromise}}__publicField(ChoroplethCounties,"__inputs",[{id:"fips",type:"string"},{id:"value",type:"number"}]),ChoroplethCounties.prototype._class+=" map_ChoroplethCounties",ChoroplethCounties.prototype.publish("onClickFormatFIPS",!1,"boolean","format FIPS code as a String on Click");let usStates$1=null,features=null,rFeatures=null;class ChoroplethStates extends Choropleth{constructor(){super();__publicField(this,"choroPaths");this.projection("AlbersUsaPr")}layerEnter(base,svgElement,domElement){Choropleth.prototype.layerEnter.apply(this,arguments),this._choroTopology=usStates$1.topology,this._choroTopologyObjects=usStates$1.topology.objects.states,this._selection.widgetElement(this._choroplethData),this.choroPaths=common.select(null);const context=this;this.tooltipHTML(function(d){const code=rFeatures[d[0]].id;return context.tooltipFormat({label:usStates$1.stateNames[code].name,value:d[1]})})}layerUpdate(base){Choropleth.prototype.layerUpdate.apply(this,arguments),this._choroplethData.style("stroke",this.meshVisible()?null:"black"),this.choroPaths=this._choroplethData.selectAll(".shape").data(this.visible()?this.data():[],function(d){return d[0]});const context=this;this.choroPaths.enter().append("path").attr("class","shape").attr("vector-effect","non-scaling-stroke").call(this._selection.enter.bind(this._selection)).on("click",function(d){context.click(context.rowToObj(d),"weight",context._selection.selected(this))}).on("dblclick",function(d){context.dblclick(context.rowToObj(d),"weight",context._selection.selected(this))}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show).merge(this.choroPaths).attr("d",function(d){const retVal=base._d3GeoPath(rFeatures[d[0]]);return retVal||console.warn("Unknown US State: "+d[0]),retVal}).style("fill",function(d){return context._palette(d[1],context._dataMinWeight,context._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){return this._topoJsonPromise||(this._topoJsonPromise=new Promise((resolve2,reject)=>{usStates$1&&resolve2(),d3Json(`${topoJsonFolder()}/us-states.json`,function(_usStates){usStates$1=_usStates,features=feature(usStates$1.topology,usStates$1.topology.objects.states).features,rFeatures={};for(const key in features)features[key].id&&(rFeatures[usStates$1.stateNames[features[key].id].code]=features[key]);resolve2()})})),this._topoJsonPromise}}__publicField(ChoroplethStates,"__inputs",[{id:"state",type:"string"},{id:"value",type:"number"}]),ChoroplethStates.prototype._class+=" map_ChoroplethStates";class ChoroplethStatesHeat extends Layered{constructor(){super()}}ChoroplethStatesHeat.prototype._class+=" map_ChoroplethStatesHeat";class GeoHash extends Layer{constructor(){super();__publicField(this,"_dataMinWeight");__publicField(this,"_dataMaxWeight");__publicField(this,"geohash");__publicField(this,"_geoHashTransform");__publicField(this,"geoHashPaths")}data(_){const retVal=Layer.prototype.data.apply(this,arguments);return arguments.length&&(this._dataMinWeight=null,this._dataMaxWeight=null,this.data().forEach(function(item){(!this._dataMinWeight||item[1]<this._dataMinWeight)&&(this._dataMinWeight=item[1]),(!this._dataMaxWeight||item[1]>this._dataMaxWeight)&&(this._dataMaxWeight=item[1])},this)),retVal}layerEnter(base,svgElement,domElement){Layer.prototype.layerEnter.apply(this,arguments),this.geohash=new Geohash,this._geoHashTransform=svgElement.append("g").attr("class","map_GeoHash"),this._selection=new common.Utility.SimpleSelection(this,this._geoHashTransform),this.geoHashPaths=common.select(null)}layerUpdate(base){Layer.prototype.layerUpdate.apply(this,arguments),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._geoHashTransform.style("opacity",this.opacity()),this.geoHashPaths=this._geoHashTransform.selectAll(".data").data(this.visible()?this.data():[],function(d){return d[0]});const context=this;this.geoHashPaths.enter().append("path").attr("class","data").call(this._selection.enter.bind(this._selection)).on("click",function(d){context.click(context.rowToObj(d),"weight",context._selection.selected(this))}).on("dblclick",function(d){context.dblclick(context.rowToObj(d),"weight",context._selection.selected(this))}).merge(this.geoHashPaths).attr("d",function(d){const pos=context.geohash.bounds(d[0]),route={type:"LineString",coordinates:[[pos.sw.lon,pos.ne.lat],[pos.ne.lon,pos.ne.lat],[pos.ne.lon,pos.sw.lat],[pos.sw.lon,pos.sw.lat]]};return base._d3GeoPath(route)}).style("fill",function(d){return context._palette(d[1],context._dataMinWeight,context._dataMaxWeight)}),this.geoHashPaths.exit().remove()}click(row,column,selected){}dblclick(row,column,selected){}}GeoHash.prototype._class+=" map_GeoHash",GeoHash.prototype._palette=common.Palette.rainbow("default"),GeoHash.prototype.publish("paletteID","YlOrRd","set","Color palette for this widget",GeoHash.prototype._palette.switch(),{tags:["Basic","Shared"]}),GeoHash.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),GeoHash.prototype.publish("opacity",1,"number","Opacity",null,{tags:["Advanced"]}),GeoHash.prototype.publish("meshVisible",!0,"boolean","Mesh Visibility"),GeoHash.prototype.publish("meshColor",null,"html-color","Stroke Color",null,{optional:!0}),GeoHash.prototype.publish("meshStrokeWidth",.25,"number","Stroke Width");function getDefaultExportFromCjs(x){return x&&x.__esModule&&Object.prototype.hasOwnProperty.call(x,"default")?x.default:x}var Google$1={exports:{}},hasRequiredGoogle;function requireGoogle(){return hasRequiredGoogle||(hasRequiredGoogle=1,function(module2,exports3){(function(root,factory){if(root===null)throw new Error("Google-maps package can be used only in browser");module2.exports=factory()})(typeof window<"u"?window:null,function(){var googleVersion="3.31",script=null,google2=null,loading=!1,callbacks=[],onLoadEvents=[],originalCreateLoaderMethod=null,GoogleMapsLoader2={};GoogleMapsLoader2.URL="https://maps.googleapis.com/maps/api/js",GoogleMapsLoader2.KEY=null,GoogleMapsLoader2.LIBRARIES=[],GoogleMapsLoader2.CLIENT=null,GoogleMapsLoader2.CHANNEL=null,GoogleMapsLoader2.LANGUAGE=null,GoogleMapsLoader2.REGION=null,GoogleMapsLoader2.VERSION=googleVersion,GoogleMapsLoader2.WINDOW_CALLBACK_NAME="__google_maps_api_provider_initializator__",GoogleMapsLoader2._googleMockApiObject={},GoogleMapsLoader2.load=function(fn){google2===null?loading===!0?fn&&callbacks.push(fn):(loading=!0,window[GoogleMapsLoader2.WINDOW_CALLBACK_NAME]=function(){ready(fn)},GoogleMapsLoader2.createLoader()):fn&&fn(google2)},GoogleMapsLoader2.createLoader=function(){script=document.createElement("script"),script.type="text/javascript",script.src=GoogleMapsLoader2.createUrl(),document.body.appendChild(script)},GoogleMapsLoader2.isLoaded=function(){return google2!==null},GoogleMapsLoader2.createUrl=function(){var url=GoogleMapsLoader2.URL;return url+="?callback="+GoogleMapsLoader2.WINDOW_CALLBACK_NAME,GoogleMapsLoader2.KEY&&(url+="&key="+GoogleMapsLoader2.KEY),GoogleMapsLoader2.LIBRARIES.length>0&&(url+="&libraries="+GoogleMapsLoader2.LIBRARIES.join(",")),GoogleMapsLoader2.CLIENT&&(url+="&client="+GoogleMapsLoader2.CLIENT),GoogleMapsLoader2.CHANNEL&&(url+="&channel="+GoogleMapsLoader2.CHANNEL),GoogleMapsLoader2.LANGUAGE&&(url+="&language="+GoogleMapsLoader2.LANGUAGE),GoogleMapsLoader2.REGION&&(url+="&region="+GoogleMapsLoader2.REGION),GoogleMapsLoader2.VERSION&&(url+="&v="+GoogleMapsLoader2.VERSION),url},GoogleMapsLoader2.release=function(fn){var release=function(){GoogleMapsLoader2.KEY=null,GoogleMapsLoader2.LIBRARIES=[],GoogleMapsLoader2.CLIENT=null,GoogleMapsLoader2.CHANNEL=null,GoogleMapsLoader2.LANGUAGE=null,GoogleMapsLoader2.REGION=null,GoogleMapsLoader2.VERSION=googleVersion,google2=null,loading=!1,callbacks=[],onLoadEvents=[],typeof window.google<"u"&&delete window.google,typeof window[GoogleMapsLoader2.WINDOW_CALLBACK_NAME]<"u"&&delete window[GoogleMapsLoader2.WINDOW_CALLBACK_NAME],originalCreateLoaderMethod!==null&&(GoogleMapsLoader2.createLoader=originalCreateLoaderMethod,originalCreateLoaderMethod=null),script!==null&&(script.parentElement.removeChild(script),script=null),fn&&fn()};loading?GoogleMapsLoader2.load(function(){release()}):release()},GoogleMapsLoader2.onLoad=function(fn){onLoadEvents.push(fn)},GoogleMapsLoader2.makeMock=function(){originalCreateLoaderMethod=GoogleMapsLoader2.createLoader,GoogleMapsLoader2.createLoader=function(){window.google=GoogleMapsLoader2._googleMockApiObject,window[GoogleMapsLoader2.WINDOW_CALLBACK_NAME]()}};var ready=function(fn){var i;for(loading=!1,google2===null&&(google2=window.google),i=0;i<onLoadEvents.length;i++)onLoadEvents[i](google2);for(fn&&fn(google2),i=0;i<callbacks.length;i++)callbacks[i](google2);callbacks=[]};return GoogleMapsLoader2})}(Google$1)),Google$1.exports}var GoogleExports=requireGoogle();const Google=getDefaultExportFromCjs(GoogleExports),GoogleMapsLoader=Google||_mergeNamespaces({__proto__:null,default:Google},[GoogleExports]);exports2.google=null;let timout=15e3;function requireGoogleMapTimeout(ms){timout=ms}let _googleMapPromise;function requireGoogleMap(customGoogle){return _googleMapPromise||(_googleMapPromise=util.promiseTimeout(timout,new Promise(function(resolve2,reject){if(exports2.google)resolve2();else if(customGoogle)exports2.google=customGoogle,resolve2();else{window.__hpcc_gmap_apikey||console.warn("__hpcc_gmap_apikey does not contain a valid API key, reverting to developers key (expect limited performance)");try{GoogleMapsLoader.KEY=window.__hpcc_gmap_apikey||"AIzaSyDwGn2i1i_pMZvnqYJN1BksD_tjYaCOWKg",GoogleMapsLoader.LIBRARIES=["geometry","drawing"],GoogleMapsLoader.load(function(_google){exports2.google=_google,resolve2()})}catch(e){console.warn(`Failed to initialize Google Map API: ${e.message}`),resolve2()}}})).catch(e=>{console.warn(`Timed out initializing Google Map API after ${timout}ms.`)})),_googleMapPromise}function createOverlay(map,worldSurface,viewportSurface){function Overlay(map2,worldSurface2,viewportSurface2){exports2.google.maps.OverlayView.call(this),this._div=null,this._worldSurface=worldSurface2,this._viewportSurface=viewportSurface2,this._map=map2,this.setMap(map2);const context=this;exports2.google.maps.event.addListener(map2,"bounds_changed",function(){context.draw()}),exports2.google.maps.event.addListener(map2,"projection_changed",function(){context.draw()}),this._prevWorldMin={x:0,y:0},this._prevWorldMax={x:0,y:0},this._prevMin={x:0,y:0},this._prevMax={x:0,y:0}}return Overlay.prototype=exports2.google.maps.OverlayView.prototype,Overlay.prototype.onAdd=function(){this.div=document.createElement("div"),this._viewportSurface.target(null).target(this.div).units("pixels"),this.getPanes().overlayMouseTarget.appendChild(this.div)},Overlay.prototype.draw=function(){const projection2=this.getProjection();if(!projection2)return;const bounds2=this._map.getBounds(),center=projection2.fromLatLngToDivPixel(bounds2.getCenter()),sw=projection2.fromLatLngToDivPixel(bounds2.getSouthWest()),ne=projection2.fromLatLngToDivPixel(bounds2.getNorthEast()),min={x:sw.x,y:ne.y},max={x:ne.x,y:sw.y},worldWidth=projection2.getWorldWidth();for(;max.x<min.x+100;)max.x+=worldWidth;for(;min.x>center.x;)min.x-=worldWidth,max.x-=worldWidth;(min.x!==this._prevMin.x||min.y!==this._prevMin.y||max.x!==this._prevMax.x||max.y!==this._prevMax.y)&&(this._viewportSurface.resize({width:0,height:0}).widgetX(min.x).widgetY(min.y).widgetWidth(max.x-min.x).widgetHeight(max.y-min.y),this._viewportSurface._renderCount?(this._viewportSurface.render(),this._prevMin=min,this._prevMax=max):this._viewportSurface.lazyRender());const worldMin=projection2.fromLatLngToDivPixel(new exports2.google.maps.LatLng(85,-179.9)),worldMax=projection2.fromLatLngToDivPixel(new exports2.google.maps.LatLng(-85,179.9));for(;worldMax.x<worldMin.x+100;)worldMax.x+=worldWidth;for(;worldMin.x>center.x;)worldMin.x-=worldWidth,worldMax.x-=worldWidth;(worldMin.x!==this._prevWorldMin.x||worldMin.y!==this._prevWorldMin.y||worldMax.x!==this._prevWorldMax.x||worldMax.y!==this._prevWorldMax.y)&&(this._worldSurface.widgetX(worldMin.x).widgetY(worldMin.y).widgetWidth(worldMax.x-worldMin.x).widgetHeight(worldMax.y-worldMin.y).render(),this._prevWorldMin=worldMax,this._prevWorldMax=worldMax)},Overlay.prototype.onRemove=function(){this._viewportSurface.target(null),this._div.parentNode.removeChild(this._div),this._div=null},new Overlay(map,worldSurface,viewportSurface)}class UserShapeSelectionBag{constructor(mapObj){__publicField(this,"_userShapes");__publicField(this,"mapContext");this._userShapes=[],this.mapContext=mapObj}add(_){this._userShapes.indexOf(_)>=0||this._userShapes.push(_)}remove(_){const idx=this._userShapes.indexOf(_);idx>=0&&this._userShapes.splice(idx,1),_.setMap(null)}save(){return this._userShapes.map(shape=>this._saveShape(shape))}load(_){this._deserializeShapes(_)}_saveShape(shape){const retVal={},createShapes={circle:_=>{retVal.type="circle",retVal.pos={lat:_.center.lat(),lng:_.center.lng()},retVal.radius=_.radius},rectangle:_=>{retVal.type="rectangle",retVal.bounds={ne:_.bounds.getNorthEast(),sw:_.bounds.getSouthWest()}},polygon:_=>{retVal.type=_.__hpcc_type;const vertices=_.getPath();retVal.vertices=[];for(let i=0;i<vertices.length;i++)retVal.vertices.push(vertices.getAt(i))},polyline:_=>{createShapes.polygon(_)}};return createShapes[shape.__hpcc_type](shape),retVal.strokeWeight=shape.strokeWeight,retVal.fillColor=shape.fillColor,retVal.fillOpacity=shape.fillOpacity,retVal.editable=shape.editable,retVal.clickable=shape.clickable||!0,retVal}_deserializeShapes(_shapes){const shapes=JSON.parse(_shapes),defOptions={strokeWeight:0,fillOpacity:.45,fillColor:"#1f77b4",editable:!0,clickable:!0},createShapes={circle:(_,map)=>new exports2.google.maps.Circle({strokeWeight:_.strokeWeight||defOptions.strokeWeight,fillColor:_.fillColor||defOptions.fillColor,fillOpacity:_.fillOpacity||defOptions.fillOpacity,editable:_.editable||defOptions.editable,clickable:_.clickable||defOptions.clickable,map,center:_.pos,radius:_.radius}),rectangle:(_,map)=>new exports2.google.maps.Rectangle({strokeWeight:_.strokeWeight||defOptions.strokeWeight,fillColor:_.fillColor||defOptions.fillColor,fillOpacity:_.fillOpacity||defOptions.fillOpacity,editable:_.editable||defOptions.editable,clickable:_.clickable||defOptions.clickable,map,bounds:{north:_.bounds.ne.lat,west:_.bounds.sw.lng,south:_.bounds.sw.lat,east:_.bounds.ne.lng}}),polygon:(_,map)=>new exports2.google.maps.Polygon({strokeWeight:_.strokeWeight||defOptions.strokeWeight,fillColor:_.fillColor||defOptions.fillColor,fillOpacity:_.fillOpacity||defOptions.fillOpacity,editable:_.editable||defOptions.editable,clickable:_.clickable||defOptions.clickable,map,paths:_.vertices}),polyline:(_,map)=>new exports2.google.maps.Polyline({strokeWeight:_.strokeWeight||defOptions.strokeWeight,fillColor:_.fillColor||defOptions.fillColor,fillOpacity:_.fillOpacity||defOptions.fillOpacity,editable:_.editable||defOptions.editable,clickable:_.clickable||defOptions.clickable,map,path:_.vertices})};for(let i=0;i<shapes.length;i++){const shape=createShapes[shapes[i].type](shapes[i],this.mapContext._googleMap);this.mapContext.onDrawingComplete({type:shapes[i].type,overlay:shape})}}}class GMap extends common.HTMLWidget{constructor(){super();__publicField(this,"_overlay");__publicField(this,"_userShapes");__publicField(this,"_worldSurface");__publicField(this,"_viewportSurface");__publicField(this,"_googleMapNode");__publicField(this,"_googleMap");__publicField(this,"_googleGeocoder");__publicField(this,"_prevCenterLat");__publicField(this,"_prevCenterLong");__publicField(this,"_googleStreetViewService");__publicField(this,"_googleMapPanorama");__publicField(this,"_prevZoom");__publicField(this,"_prevStreetView");__publicField(this,"_circleMap");__publicField(this,"_pinMap");__publicField(this,"_drawingManager");__publicField(this,"_prevCenterAddress");__publicField(this,"_userShapeSelection");this._tag="div";const context=this;function calcProjection(surface,lat,long){const projection2=context._overlay.getProjection(),retVal=projection2.fromLatLngToDivPixel(new exports2.google.maps.LatLng(lat,long)),worldWidth=projection2.getWorldWidth(),widgetX=parseFloat(surface.widgetX()),widgetY=parseFloat(surface.widgetY()),widgetWidth=parseFloat(surface.widgetWidth());for(retVal.x-=widgetX,retVal.y-=widgetY;retVal.x<0;)retVal.x+=worldWidth;for(;retVal.x>widgetWidth;)retVal.x-=worldWidth;return retVal}this._userShapes=new UserShapeSelectionBag(this),this._worldSurface=new layout.AbsoluteSurface,this._worldSurface.project=function(lat,long){return calcProjection(this,lat,long)},this._viewportSurface=new layout.AbsoluteSurface,this._viewportSurface.project=function(lat,long){return calcProjection(this,lat,long)}}data(_){return common.HTMLWidget.prototype.data.apply(this,arguments)}getMapType(){switch(this.type()){case"terrain":return exports2.google.maps.MapTypeId.TERRAIN;case"road":return exports2.google.maps.MapTypeId.ROADMAP;case"satellite":return exports2.google.maps.MapTypeId.SATELLITE;case"hybrid":return exports2.google.maps.MapTypeId.HYBRID;default:return exports2.google.maps.MapTypeId.ROADMAP}}getMapOptions(){return{panControl:this.panControl(),zoomControl:this.zoomControl(),fullscreenControl:this.fullscreenControl(),mapTypeControl:this.mapTypeControl(),scaleControl:this.scaleControl(),streetViewControl:this.streetViewControl(),overviewMapControl:this.overviewMapControl(),overviewMapControlOptions:{opened:!0},styles:this.googleMapStyles()}}size(_){const retVal=common.HTMLWidget.prototype.size.apply(this,arguments);return arguments.length&&this._googleMapNode&&(this._googleMapNode.style("width",_.width+"px").style("height",_.height+"px"),exports2.google.maps.event.trigger(this._googleMap,"resize")),retVal}enter(domNode,element){super.enter(domNode,element);const context=this;this._googleGeocoder=new exports2.google.maps.Geocoder,this._googleMapNode=element.append("div").style("width",this.width()+"px").style("height",this.height()+"px"),this._googleMap=new exports2.google.maps.Map(this._googleMapNode.node(),{zoom:this.zoom(),center:new exports2.google.maps.LatLng(this.centerLat(),this.centerLong()),mapTypeId:this.getMapType(),disableDefaultUI:!0}),this._overlay=createOverlay(this._googleMap,this._worldSurface,this._viewportSurface),this._googleMap.addListener("center_changed",function(){context.centerLat(context._googleMap.center.lat()),context._prevCenterLat=context.centerLat(),context.centerLong(context._googleMap.center.lng()),context._prevCenterLong=context.centerLong(),context._googleMapPanorama.setPosition({lat:context.centerLat(),lng:context.centerLong()}),context.zoom(context._googleMap.getZoom()),context._prevZoom=context.zoom(),context._overlay.draw()}),this._googleMap.addListener("zoom_changed",function(){context.zoom(context._googleMap.zoom),context._prevZoom=context.zoom()}),this._googleStreetViewService=new exports2.google.maps.StreetViewService,this._googleMapPanorama=this._googleMap.getStreetView(),this._googleMapPanorama.addListener("visible_changed",function(){context.streetView(context._googleMapPanorama.getVisible()),context._prevStreetView=context.streetView()}),this._circleMap=common.map([]),this._pinMap=common.map([]),this._prevCenterLat=this.centerLat(),this._prevCenterLong=this.centerLong(),this._prevZoom=this.zoom();const defOptions={strokeWeight:0,fillOpacity:.45,fillColor:"#1f77b4",editable:!0,clickable:!0};this._drawingManager=new exports2.google.maps.drawing.DrawingManager({drawingMode:exports2.google.maps.drawing.OverlayType.MARKER,drawingControl:!0,drawingControlOptions:{position:exports2.google.maps.ControlPosition.TOP_CENTER,drawingModes:["polygon","rectangle","circle"]},rectangleOptions:defOptions,circleOptions:defOptions,polygonOptions:defOptions}),this.drawingState()&&this._userShapes.load(this.drawingState())}update(domNode,element){const context=this;this._googleMapNode.style("width",this.width()+"px").style("height",this.height()+"px"),this._googleMap.setMapTypeId(this.getMapType()),this._googleMap.setOptions(this.getMapOptions()),this.centerAddress_exists()&&this._prevCenterAddress!==this.centerAddress()&&(this._prevCenterAddress=this.centerAddress(),this._googleGeocoder.geocode({address:this.centerAddress()},function(results,status){if(status===exports2.google.maps.GeocoderStatus.OK){const bounds2=results[0].geometry.bounds||results[0].geometry.viewport;context._googleMap.fitBounds(bounds2),context.streetView()&&context.useComputedHeading()&&context.streetViewAt({lat:results[0].geometry.location.lat(),lng:results[0].geometry.location.lng()},50)}else context.statusError({data:results,status})})),(this._prevCenterLat!==this.centerLat()||this._prevCenterLong!==this.centerLong())&&(this._googleMap.setCenter(new exports2.google.maps.LatLng(this.centerLat(),this.centerLong())),this._prevCenterLat=this.centerLat(),this._prevCenterLong=this.centerLong()),this._prevZoom!==this.zoom()&&(this._googleMap.setZoom(this.zoom()),this._prevZoom=this.zoom()),this.updateCircles(),this.updatePins(),this._prevStreetView!==this.streetView()&&(this.streetView()?(this._googleMapPanorama.setPosition({lat:this.centerLat(),lng:this.centerLong()}),this._googleMapPanorama.setPov({heading:0,pitch:0}),this._googleMapPanorama.setVisible(!0)):this._googleMapPanorama.setVisible(!1),this._prevStreetView=this.streetView()),this.drawingTools()?(this._drawingManager.setMap(this._googleMap),exports2.google.maps.event.addListener(this._drawingManager,"overlaycomplete",function(){GMap.prototype.onDrawingComplete.apply(context,arguments)})):(this._drawingManager.setMap(null),exports2.google.maps.event.clearInstanceListeners(this._drawingManager))}render(callback){const context=this,args=arguments;return requireGoogleMap().then(()=>{super.render.apply(context,args)}),this}streetViewAt(pos,radius2=1e3){const context=this,source=this.outdoorStreetViewOnly()?exports2.google.maps.StreetViewSource.OUTDOOR:exports2.google.maps.StreetViewSource.DEFAULT;this._googleStreetViewService.getPanorama({location:pos,radius:radius2,source},function(data,status){if(status==="OK"){const marker=new exports2.google.maps.Marker({position:pos,map:context._googleMap}),heading=exports2.google.maps.geometry.spherical.computeHeading(data.location.latLng,new exports2.google.maps.LatLng(pos.lat,pos.lng));context._googleMapPanorama.setPano(data.location.pano),context._googleMapPanorama.setPov({heading,pitch:0}),context.showStreetViewMarker()||marker.setVisible(!1),context._googleMapPanorama.setVisible(!0);const listener=exports2.google.maps.event.addListener(context._googleMap.getStreetView(),"visible_changed",function(){this.getVisible()||(marker.setMap(null),exports2.google.maps.event.removeListener(listener))})}else context.statusError({data,status})})}updateCircles(){function rowID(row){return row[0]+"_"+row[1]}const circle_enter=[],circle_exit=common.map(this._circleMap.keys(),function(d){return d});this.data().forEach(function(row){circle_exit.remove(rowID(row)),row[3]&&!this._circleMap.has(rowID(row))?circle_enter.push(row):row[3]&&this._circleMap.has(rowID(row))||!row[3]&&this._circleMap.has(rowID(row))&&circle_exit.set(rowID(row),!0)},this),circle_enter.forEach(function(row){const marker=this.createCircle(row[0],row[1],row[3]);this._circleMap.set(rowID(row),marker)},this);const context=this;circle_exit.each(function(row){context._circleMap.get(row).setMap(null),context._circleMap.remove(row)})}updatePins(){function rowID(row){return row[0]+"_"+row[1]}const pin_enter=[],pin_update=[],pin_exit=common.map(this._pinMap.keys(),function(d){return d});this.data().forEach(function(row){pin_exit.remove(rowID(row)),row[2]&&!this._pinMap.has(rowID(row))?pin_enter.push(row):row[2]&&this._pinMap.has(rowID(row))?pin_update.push(row):!row[2]&&this._pinMap.has(rowID(row))&&pin_exit.set(rowID(row),!0)},this),pin_enter.forEach(function(row){const marker=this.createMarker(row[0],row[1],row[2]);this._pinMap.set(rowID(row),marker)},this),pin_update.forEach(function(row){this._pinMap.get(rowID(row)).setIcon(this.createIcon(row[2]))},this);const context=this;pin_exit.each(function(row){context._pinMap.get(row).setMap(null),context._pinMap.remove(row)})}createIcon(pinObj){return{path:"M 0,0 C -2,-20 -10,-22 -10,-30 A 10,10 0 1,1 10,-30 C 10,-22 2,-20 0,0 z M -2,-30",fillColor:pinObj.fillColor,fillOpacity:pinObj.fillOpacity||.8,scale:.5,strokeColor:pinObj.strokeColor||"black",strokeWeight:.25}}createMarker(lat,lng,pinObj){return new exports2.google.maps.Marker({position:new exports2.google.maps.LatLng(lat,lng),animation:exports2.google.maps.Animation.DROP,title:pinObj.title||"",icon:this.createIcon(pinObj),map:this._googleMap})}createCircle(lat,lng,circleObj){return circleObj.radius=circleObj.radius||1,new exports2.google.maps.Circle({center:new exports2.google.maps.LatLng(lat,lng),radius:16093*circleObj.radius/10,fillColor:circleObj.fillColor||"red",strokeColor:circleObj.strokeColor||circleObj.fillColor||"black",strokeWeight:.5,map:this._googleMap})}zoomTo(selection,singleMaxZoom){if(!this._renderCount)return this;singleMaxZoom=singleMaxZoom||this.singleZoomToMaxZoom();let foundCount=0;const latlngbounds=new exports2.google.maps.LatLngBounds;switch(selection.forEach(function(item){const gLatLong=new exports2.google.maps.LatLng(item[0],item[1]);latlngbounds.extend(gLatLong),++foundCount}),foundCount){case 0:break;case 1:this._googleMap.setCenter(latlngbounds.getCenter()),this._googleMap.setZoom(singleMaxZoom);break;default:this._googleMap.fitBounds(latlngbounds)}return this}zoomToFit(){return this.zoomTo(this.data())}drawingOptions(_){return arguments.length?(this._drawingManager.setOptions(_),this):this._drawingManager}userShapeSelection(_){return arguments.length?(this._userShapeSelection&&this._userShapeSelection.setEditable(!1),this._userShapeSelection=_,this._userShapeSelection&&this._userShapeSelection.setEditable(!0),this):this._userShapeSelection}deleteUserShape(_){this._userShapeSelection===_&&this.userShapeSelection(null),this._userShapes.remove(_)}onDrawingComplete(event){if(event.type!==exports2.google.maps.drawing.OverlayType.MARKER){this._drawingManager.setDrawingMode(null);const newShape=event.overlay;newShape.__hpcc_type=event.type,this._userShapes.add(newShape);const context=this;let ctrl=!1;window.addEventListener("keydown",function(e){(e.keyIdentifier==="Control"||e.ctrlKey===!0)&&(ctrl=!0)}),window.addEventListener("keyup",function(e){e.ctrlKey===!1&&(ctrl=!1)}),exports2.google.maps.event.addListener(newShape,"click",function(ev){return context.userShapeSelection(newShape),ev&&ctrl===!0&&(context.deleteUserShape(newShape),context.drawingState(JSON.stringify(context._userShapes.save()))),!1}),this.userShapeSelection(newShape),this.drawingState(JSON.stringify(this._userShapes.save()))}}statusError(response){console.warn("Data not found for this location.")}}GMap.prototype._class+=" map_GMap",GMap.prototype.publish("outdoorStreetViewOnly",!1,"boolean","If true, streetView will only display outdoor locations"),GMap.prototype.publish("showStreetViewMarker",!1,"boolean","If true, streetView marker will be hidden"),GMap.prototype.publish("useComputedHeading",!1,"boolean","If true, centerAddress streetView compute the ideal panorama heading"),GMap.prototype.publish("type","road","set","Map Type",["terrain","road","satellite","hybrid"],{tags:["Basic"]}),GMap.prototype.publish("centerLat",42.877742,"number","Center Latitude",null,{tags:["Basic"]}),GMap.prototype.publish("centerLong",-97.380979,"number","Center Longitude",null,{tags:["Basic"]}),GMap.prototype.publish("centerAddress",null,"string","Address to center map on",null,{tags:["Basic"],optional:!0}),GMap.prototype.publish("zoom",4,"number","Zoom Level",null,{tags:["Basic"]}),GMap.prototype.publish("singleZoomToMaxZoom",14,"number","Max zoomTo level with single item"),GMap.prototype.publish("panControl",!0,"boolean","Pan Controls",null,{tags:["Basic"]}),GMap.prototype.publish("zoomControl",!0,"boolean","Zoom Controls",null,{tags:["Basic"]}),GMap.prototype.publish("scaleControl",!0,"boolean","Scale Controls",null,{tags:["Basic"]}),GMap.prototype.publish("mapTypeControl",!1,"boolean","Map Type Controls",null,{tags:["Basic"]}),GMap.prototype.publish("fullscreenControl",!1,"boolean","Fullscreen Controls",null,{tags:["Basic"]}),GMap.prototype.publish("streetViewControl",!1,"boolean","StreetView Controls",null,{tags:["Basic"]}),GMap.prototype.publish("overviewMapControl",!1,"boolean","OverviewMap Controls",null,{tags:["Basic"]}),GMap.prototype.publish("streetView",!1,"boolean","Streetview",null,{tags:["Basic"]}),GMap.prototype.publish("drawingTools",!1,"boolean","Drawing Tools",null,{tags:["Basic"]}),GMap.prototype.publish("drawingState","","string","Map Drawings",null,{disable:w=>w.drawingTools()===!1}),GMap.prototype.publish("googleMapStyles",{},"object","Styling for map colors etc",null,{tags:["Basic"]});const zoomFactor=1/16;class OverlayLayered extends Layered{constructor(gmap,surface){super();__publicField(this,"gmap");__publicField(this,"surface");this.gmap=gmap,this.surface=surface,this.autoScaleMode("none"),this.zoomable(!1).zoomDuration(10)}getProjection(){return this.gmap._overlay.getProjection()}render(callback){return super.render(w=>{const projection2=this.getProjection();if(projection2){const center=new window.google.maps.LatLng(0,0),pos=projection2.fromLatLngToDivPixel(center),widgetX=this.surface.widgetX(),widgetY=this.surface.widgetY(),translate=[pos.x-widgetX,pos.y-widgetY],zoom=this.gmap._googleMap.getZoom();this.zoomTo(translate,zoomFactor*(1<<zoom),0)}callback&&callback(w)}),this}}class GMapLayered extends GMap{constructor(){super();__publicField(this,"layered");this.layered=new OverlayLayered(this,this._viewportSurface),this._viewportSurface.widget(this.layered)}invert(x,y){return this.layered.invert(x,y)}rproject(x,y){const latLng=this.layered.getProjection().fromDivPixelToLatLng(new exports2.google.maps.Point(x,y));return{lat:latLng.lat(),lng:latLng.lng()}}updateCircles(){}updatePins(){}layers(_){return arguments.length?(this.layered.layers(_),this):this.layered.layers()}render(callback){return super.render(w=>{this.layered.preRender().then(()=>{this.layered.render(w2=>{callback&&callback(w2)})})})}}GMapLayered.prototype._class+=" map_GMapLayered";class GMapCounties extends GMapLayered{constructor(){super();__publicField(this,"_counties");__publicField(this,"_view");__publicField(this,"_palette");__publicField(this,"_dataMinWeight");__publicField(this,"_dataMaxWeight");__publicField(this,"_prevBounds");const context=this;this._counties=new ChoroplethCounties().paletteID("Blues").meshVisible(!1).opacity(.8).columns(["fips","weight"]).on("click",function(row,col,sel){context.click(row,col,sel)}).on("dblclick",function(row,col,sel){context.dblclick(row,col,sel)})}enter(domNode,element){super.enter(domNode,element),this.layers([this._counties])}update(domNode,element){this._counties.data(this.data()),super.update(domNode,element),this._palette=this._counties._palette,this._dataMinWeight=this._counties._dataMinWeight,this._dataMaxWeight=this._counties._dataMaxWeight}render(callback){return super.render(w=>{if(this._renderCount>1&&this.autoScale()){const bounds2=this._counties.getDataBounds();if(bounds2.x&&bounds2.y&&(!this._prevBounds||this._prevBounds.x!==bounds2.x||this._prevBounds.y!==bounds2.y||this._prevBounds.width!==bounds2.width||this._prevBounds.height!==bounds2.height)){this._prevBounds=bounds2;const tl=this.invert(bounds2.x,bounds2.y),br=this.invert(bounds2.x+bounds2.width,bounds2.y+bounds2.height);tl&&br&&this.zoomTo([[tl[1],tl[0]],[br[1],br[0]]])}}callback&&callback(w)})}exit(domNode,element){super.exit(domNode,element)}click(row,column,selected){}dblclick(row,column,selected){}}GMapCounties.prototype._class+=" map_GMapCounties",GMapCounties.prototype.publish("autoScale",!1,"boolean","Auto scale to data");class GMapGraph extends GMap{constructor(){super()}enter(){super.enter.apply(this,arguments);const graph$1=new graph.Graph().layout("None").zoomable(!1),origRender=graph$1.render,context=this;graph$1.render=function(callback){const vertices=[],edges=[];let prevAddr=null;return context.data().forEach(function(row){const pos2=context._viewportSurface.project(row[0],row[1]),newAddr=new common.Shape().shape("circle").radius(3).data(row).pos(pos2);vertices.push(newAddr),prevAddr&&edges.push(new graph.Edge().sourceVertex(prevAddr).targetVertex(newAddr).sourceMarker("none").targetMarker("arrow")),prevAddr=newAddr}),this.data({vertices,edges}),origRender.apply(this,arguments)},this._viewportSurface.widget(graph$1)}}GMapGraph.prototype._class+=" map_GMapGraph";class GMapHeat extends GMap{constructor(){super()}enter(){super.enter.apply(this,arguments);const heat=new other.HeatMap,origRender=heat.render,context=this;heat.render=function(callback){return this.data(context.data().map(function(row){const pos=context._viewportSurface.project(row[0],row[1]);return[pos.x,pos.y,row[4]]})),origRender.apply(this,arguments),this},this._viewportSurface.widget(heat)}}GMapHeat.prototype._class+=" map_GMapHeat";let Pins$1=class extends Layer{constructor(){super();__publicField(this,"_geohash");__publicField(this,"_pinsTransform");__publicField(this,"pinsPaths");common.Utility.SimpleSelectionMixin.call(this),this._geohash=new Geohash}pinsData(){const geohashField=this._db.fieldByLabel(this.geohashColumn()),tooltipField=this._db.fieldByLabel(this.tooltipColumn()),latField=this._db.fieldByLabel(this.latColumn()),longField=this._db.fieldByLabel(this.longColumn()),context=this;return this.data().filter(function(row){const lat=latField?row[latField.idx]:row[0],long=longField?row[longField.idx]:row[1];return!(context.omitNullLatLong()&&lat===0&&long===0)}).map(function(row,idx){const lat=latField?row[latField.idx]:row[0],long=longField?row[longField.idx]:row[1],retVal={idx,lat,long,ext:row[2]instanceof Object?row[2]:{},origRow:row};if(geohashField)try{const pos=this._geohash.bounds(row[geohashField.idx]);retVal.lat=(pos.ne.lat+pos.sw.lat)/2,retVal.long=(pos.ne.lon+pos.sw.lon)/2}catch{}return tooltipField&&(retVal.ext.tooltip=row[tooltipField.idx]),retVal},this)}layerEnter(base,svgElement,domElement){Layer.prototype.layerEnter.apply(this,arguments),this._pinsTransform=svgElement,this._selection.widgetElement(this._pinsTransform),this.pinsPaths=common.select(null),this.tooltipHTML(function(d){return d.ext.tooltip===void 0?"":d.ext.tooltip})}layerUpdate(base){Layer.prototype.layerUpdate.apply(this,arguments),this._pinsTransform.style("opacity",this.opacity()),this.pinsPaths=this._pinsTransform.selectAll(".pin").data(this.visible()?this.pinsData():[],d=>d.idx);const context=this,updatesPaths=this.pinsPaths.enter().append("g").attr("class","pin").call(this._selection.enter.bind(this._selection)).on("click",function(d){context.click(context.rowToObj(d.origRow),"geohash",context._selection.selected(this))}).on("dblclick",function(d){context.dblclick(context.rowToObj(d.origRow),"geohash",context._selection.selected(this))}).on("mouseover",function(d){common.Platform.isIE||this.parentNode.appendChild(this)}).on("mouseout.tooltip",function(d){d.ext&&d.ext.tooltip&&context.tooltip.hide.apply(this,arguments)}).on("mousemove.tooltip",function(d){d.ext&&d.ext.tooltip&&context.tooltip.show.apply(this,arguments)}).each(function(d){const element=common.select(this);element.append("path").attr("class","data"),element.append("text").attr("text-anchor","middle")}).merge(this.pinsPaths);updatesPaths.selectAll("text").style("stroke",this.fontColor()).style("fill",this.fontColor()).style("font-size",this.fontSize()).style("font-family",this.fontFamily()).style("dominant-baseline",this.textBaseline()).attr("dx",0).attr("dy",this.pinTextDY()).text(function(d){return d.ext&&d.ext.text?d.ext.text:""});const svgPath=this.svgPinPath();updatesPaths.selectAll("path.data").attr("d",svgPath).attr("stroke-width",this.strokeWidth()+"px").style("display",function(d){return base.project(d.lat,d.long)?null:"none"}).style("stroke",function(d){return d.ext&&d.ext.strokeColor?d.ext.strokeColor:context.strokeColor()}).style("fill",function(d){return d.ext&&d.ext.fillColor?d.ext.fillColor:context.fillColor()}),this.pinsPaths.exit().remove()}layerZoomed(base){Layer.prototype.layerZoomed.apply(this,arguments),this.pinsPaths.attr("transform",function(d){let pos=base.project(d.lat,d.long);return pos||(pos=[0,0]),"translate("+pos[0]+", "+pos[1]+")scale("+1/base.zoomScale()+")"})}pinTextDY(){switch(this.pinType()){case"pin":case"rectangle-pin":return-this.arrowHeight();case"circle":case"rectangle":return 0}}svgPinPath(){switch(this.pinType()){case"pin":return this.circlePinPath();case"circle":return this.circlePath();case"rectangle":return this.rectanglePath();case"rectangle-pin":return this.rectanglePinPath()}}rectanglePinPath(){const width=this.pinWidth(),height=this.pinHeight(),radius2=this.cornerRadius(),arrow_h=this.arrowHeight(),arrow_w=this.arrowWidth(),x=0-width/2,y=0-height+radius2,arrow_b=(width-radius2*2-arrow_w)/2;return"M"+x+","+y+"a"+-radius2+","+-radius2+" 0 0 1 "+radius2+","+-radius2+"h"+(width+-radius2*2)+"a"+radius2+","+radius2+" 0 0 1 "+radius2+","+radius2+"v"+(height+-radius2*2)+"a"+radius2+","+radius2+" 0 0 1 "+-radius2+","+radius2+"h"+-arrow_b+"l"+-arrow_w/2+","+arrow_h+"l"+-arrow_w/2+","+-arrow_h+"h"+-arrow_b+"a"+-radius2+","+-radius2+" 0 0 1 "+-radius2+","+-radius2+"z"}rectanglePath(){const width=this.pinWidth(),height=this.pinHeight(),radius2=this.cornerRadius(),x=-width/2;let y=-height/2;return y+=radius2,"M"+x+","+y+"a"+-radius2+","+-radius2+" 0 0 1 "+radius2+","+-radius2+"h"+(width+-radius2*2)+"a"+radius2+","+radius2+" 0 0 1 "+radius2+","+radius2+"v"+(height+-radius2*2)+"a"+radius2+","+radius2+" 0 0 1 "+-radius2+","+radius2+"h"+(-width+radius2*2)+"a"+-radius2+","+-radius2+" 0 0 1 "+-radius2+","+-radius2+"z"}circlePinPath(){const arrow_h=this.arrowHeight(),arrow_w=this.arrowWidth(),x=0-arrow_w/2,y=0-arrow_h,bezier_x=arrow_w/2,bezier_y=arrow_h,c_dx1=-bezier_x,c_dy1=-bezier_y,c_dx2=arrow_w+bezier_x,c_dy2=c_dy1,c_dx=arrow_w;return"M"+x+","+y+"c"+c_dx1+" "+c_dy1+", "+c_dx2+" "+c_dy2+", "+c_dx+" "+0+"l"+-arrow_w/2+","+arrow_h+"l"+-arrow_w/2+","+-arrow_h+"z"}circlePath(){const radius2=+this.pinRadius();return`M 0, 0 m ${-radius2}, 0 a ${radius2},${radius2} 0 1,0 ${radius2*2},0 a ${radius2},${radius2} 0 1,0 ${-radius2*2},0`}click(row,column,selected){}dblclick(row,column,selected){}};Pins$1.prototype._class+=" map_Pins",Pins$1.prototype.mixin(common.Utility.SimpleSelectionMixin),Pins$1.prototype.publish("geohashColumn",null,"set","Geohash column",function(){return this.columns()},{optional:!0}),Pins$1.prototype.publish("tooltipColumn",null,"set","Tooltip column",function(){return this.columns()},{optional:!0}),Pins$1.prototype.publish("latColumn",null,"set","Latitude column",function(){return this.columns()},{optional:!0}),Pins$1.prototype.publish("longColumn",null,"set","Longitude column",function(){return this.columns()},{optional:!0}),Pins$1.prototype.publish("opacity",1,"number","Opacity",null,{tags:["Advanced"]}),Pins$1.prototype.publish("fillColor","#00FFDD","html-color","Pin Color",null,{optional:!0}),Pins$1.prototype.publish("omitNullLatLong",!1,"boolean","Remove lat=0,lng=0 from pinsData",null,{tags:["Basic"]}),Pins$1.prototype.publish("strokeWidth",.5,"number","Pin Border Thickness (pixels)",null,{tags:["Basic"]}),Pins$1.prototype.publish("strokeColor","","html-color","Pin Border Color",null,{optional:!0}),Pins$1.prototype.publish("fontSize",18,"number","Font Size",null,{tags:["Basic","Shared"]}),Pins$1.prototype.publish("fontFamily","Verdana","string","Font Name",null,{tags:["Basic","Shared","Shared"]}),Pins$1.prototype.publish("fontColor","#000000","html-color","Font Color",null,{tags:["Basic","Shared"]}),Pins$1.prototype.publish("pinType","pin","set","Pin Type",["pin","circle","rectangle","rectangle-pin"],{tags:["Basic"]}),Pins$1.prototype.publish("arrowWidth",8,"number","Pin arrow width (pixels)",null,{tags:["Basic"],disable:w=>["pin","rectangle-pin"].indexOf(w.pinType())===-1}),Pins$1.prototype.publish("arrowHeight",12,"number","Pin arrow height (pixels)",null,{tags:["Basic"],disable:w=>["pin","rectangle-pin"].indexOf(w.pinType())===-1}),Pins$1.prototype.publish("pinWidth",20,"number","Width of pin (pixels)",null,{tags:["Basic"],disable:w=>["rectangle","rectangle-pin"].indexOf(w.pinType())===-1}),Pins$1.prototype.publish("pinHeight",20,"number","Height of pin (pixels) (not including arrow)",null,{tags:["Basic"],disable:w=>["rectangle","rectangle-pin"].indexOf(w.pinType())===-1}),Pins$1.prototype.publish("cornerRadius",10,"number","Radius of rectangular pin corners (pixels)",null,{tags:["Basic"],disable:w=>["rectangle","rectangle-pin"].indexOf(w.pinType())===-1}),Pins$1.prototype.publish("pinRadius",12,"number","Radius of circle (pixels)",null,{tags:["Basic"],disable:w=>w.pinType()!=="circle"}),Pins$1.prototype.publish("textBaseline","central","set","Pin text vertical alignment",["auto","use-script","no-change","reset-size","ideographic","alphabetic","hanging","mathematical","central","middle","text-after-edge","text-before-edge","inherit"],{tags:["Basic"]});class GMapPin extends GMapLayered{constructor(){super();__publicField(this,"_pins");__publicField(this,"_view");__publicField(this,"_prevChecksum");const context=this;this._pins=new Pins$1().columns(["lat","long","ext"]).on("click",function(row,col,sel){context.click(context.rowToObj(row.ext.origRow),"",sel),context.clickStreetView(context.rowToObj(row.ext.origRow),"",sel)}).on("dblclick",function(row,col,sel){context.dblclick(context.rowToObj(row.ext.origRow),"",sel)})}pinsData(){if(this.data().length===0)return[];const columns=this.columns();return this._view=this._db.rollupView([this.latitudeColumn(),this.longitudeColumn()]),this._view.entries().map(function(row){const firstRow=row.values[0].value[0];return[row.key,row.values[0].key,{fillColor:firstRow[columns.indexOf(this.colorColumn())],tooltip:firstRow[columns.indexOf(this.tooltipColumn())],origRow:firstRow}]},this)}enter(domNode,element){super.enter(domNode,element),this.layers([this._pins])}update(domNode,element){super.update(domNode,element),this._pins.data(this.pinsData()),this.autoScale()&&this._prevChecksum!==this._db.checksum()&&(this._prevChecksum=this._db.checksum(),this.zoomTo(this._pins.pinsData().map(function(row){return[row.lat,row.long]})))}exit(domNode,element){super.exit(domNode,element)}click(row,column,selected){}clickStreetView(row,column,selected){this.streetViewOnClick()&&this.streetViewAt({lat:+row[this.latitudeColumn()],lng:+row[this.longitudeColumn()]})}dblclick(row,column,selected){}}GMapPin.prototype._class+=" map_GMapPin",GMapPin.prototype.publish("autoScale",!1,"boolean","Auto scale to data"),GMapPin.prototype.publishProxy("pinColor","_pins","fillColor"),GMapPin.prototype.publishProxy("pinType","_pins","pinType"),GMapPin.prototype.publishProxy("pinWidth","_pins","pinWidth"),GMapPin.prototype.publishProxy("pinHeight","_pins","pinHeight"),GMapPin.prototype.publishProxy("cornerRadius","_pins","cornerRadius"),GMapPin.prototype.publishProxy("pinRadius","_pins","pinRadius"),GMapPin.prototype.publishProxy("arrowWidth","_pins","arrowWidth"),GMapPin.prototype.publishProxy("arrowHeight","_pins","arrowHeight"),GMapPin.prototype.publishProxy("textBaseline","_pins","textBaseline"),GMapPin.prototype.publishProxy("strokeWidth","_pins","strokeWidth"),GMapPin.prototype.publishProxy("omitNullLatLong","_pins","omitNullLatLong"),GMapPin.prototype.publish("latitudeColumn",null,"set","Latitude",function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish("longitudeColumn",null,"set","Longitude",function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish("colorColumn",null,"set","Color",function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish("tooltipColumn",null,"set","Tooltip",function(){return this.columns()},{optional:!0}),GMapPin.prototype.publish("streetViewOnClick",!1,"boolean","Switch to street view when pin clicked");let Lines$1=class extends Layer{constructor(){super();__publicField(this,"dataEdges");__publicField(this,"_edgesTransform");__publicField(this,"_edgesPaths")}data(_){const retVal=Layer.prototype.data.apply(this,arguments);return arguments.length&&(this.dataEdges=[],_.forEach(function(row){this.dataEdges.push({type:"LineString",coordinates:[[row[1],row[0]],[row[3],row[2]]]})},this)),retVal}layerEnter(base,svgElement,domElement){Layer.prototype.layerEnter.apply(this,arguments),svgElement.append("defs").append("marker").attr("class","marker").attr("id",this._id+"_arrowHead").attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerWidth",16).attr("markerHeight",16).attr("markerUnits","strokeWidth").attr("orient","auto").append("polyline").attr("points","0,0 10,5 0,10 1,5"),this._edgesTransform=svgElement.append("g")}layerUpdate(base){Layer.prototype.layerUpdate.apply(this,arguments),this._edgesTransform.style("opacity",this.opacity());const edgesPaths=this._edgesTransform.selectAll(".dataEdge").data(this.visible()?this.dataEdges:[]);this._edgesPaths=edgesPaths.enter().append("path").attr("class","dataEdge").attr("marker-end","url(#"+this._id+"_arrowHead)").merge(edgesPaths).attr("d",base._d3GeoPath),edgesPaths.exit().remove()}layerZoomed(base){Layer.prototype.layerZoomed.apply(this,arguments),this._edgesPaths.attr("stroke-width",`${.5/base.zoomScale()}px`)}};Lines$1.prototype._class+=" map_Lines",Lines$1.prototype.publish("opacity",1,"number","Opacity",null,{tags:["Advanced"]});class GMapPinLine extends GMapLayered{constructor(){super();__publicField(this,"_lines");__publicField(this,"_pins");__publicField(this,"_fromView");__publicField(this,"_toView");__publicField(this,"_linesView");__publicField(this,"_prevChecksum");const context=this;this._lines=new Lines$1,this._pins=new Pins$1().columns(["lat","long","ext"]).on("click",function(row,col,sel){context.click(context.rowToObj(row.ext.origRow),"",sel)}).on("dblclick",function(row,col,sel){context.click(context.rowToObj(row.ext.origRow),"",sel)})}pinsData(){if(this.data().length===0)return[];const columns=this.columns();this._fromView=this._db.rollupView([this.fromLatitudeColumn(),this.fromLongitudeColumn()]),this._toView=this._db.rollupView([this.toLatitudeColumn(),this.toLongitudeColumn()]);const fromRetVal=this._fromView.entries().map(function(row){const firstRow=row.values[0].value[0];return[row.key,row.values[0].key,{fillColor:firstRow[columns.indexOf(this.fromColorColumn())]||this.fromPinColor(),tooltip:firstRow[columns.indexOf(this.fromTooltipColumn())],origRow:firstRow}]},this),toRetVal=this._toView.entries().map(function(row){const firstRow=row.values[0].value[0];return[row.key,row.values[0].key,{fillColor:firstRow[columns.indexOf(this.toColorColumn())]||this.toPinColor(),tooltip:firstRow[columns.indexOf(this.toTooltipColumn())],origRow:firstRow}]},this);return fromRetVal.concat(toRetVal)}linesData(){return this.data().length===0?[]:(this._linesView=this._db.rollupView([this.fromLatitudeColumn(),this.fromLongitudeColumn(),this.toLatitudeColumn(),this.toLongitudeColumn()]),this._linesView.data())}enter(domNode,element){super.enter(domNode,element),this.layers([this._lines,this._pins])}update(domNode,element){super.update(domNode,element),this._pins.data(this.pinsData()),this._lines.data(this.linesData()),this.autoScale()&&this._prevChecksum!==this._db.checksum()&&(this._prevChecksum=this._db.checksum(),this.zoomTo(this._pins.pinsData().map(function(row){return[row.lat,row.long]})))}exit(domNode,element){super.exit(domNode,element)}click(row,column,selected){}dblclick(row,column,selected){}}GMapPinLine.prototype._class+=" map_GMapPinLine",GMapPinLine.prototype.publish("autoScale",!1,"boolean","Auto scale to data"),GMapPinLine.prototype.publish("fromPinColor","green","html-color","From Pin Color"),GMapPinLine.prototype.publish("fromLatitudeColumn",null,"set","From Latitude",function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish("fromLongitudeColumn",null,"set","From Longitude",function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish("fromColorColumn",null,"set","From Color",function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish("fromTooltipColumn",null,"set","From Tooltip",function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish("toPinColor","red","html-color","To Pin Color"),GMapPinLine.prototype.publish("toLatitudeColumn",null,"set","To Latitude",function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish("toLongitudeColumn",null,"set","To Longitude",function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish("toColorColumn",null,"set","To Color",function(){return this.columns()},{optional:!0}),GMapPinLine.prototype.publish("toTooltipColumn",null,"set","To Tooltip",function(){return this.columns()},{optional:!0});class Graph extends Pins$1{constructor(){super();__publicField(this,"dataEdges",[]);__publicField(this,"_edgesTransform");__publicField(this,"_edgesPaths")}importJSON(_){const retVal=Pins$1.prototype.importJSON.apply(this,arguments);if(arguments.length){this.dataEdges=[];let prevPin=null;_.forEach(function(row){prevPin&&this.dataEdges.push({type:"LineString",coordinates:[[prevPin.long,prevPin.lat],[row.long,row.lat]]}),row.eol?prevPin=null:prevPin=row},this)}return retVal}data(_){const retVal=Pins$1.prototype.data.apply(this,arguments);if(arguments.length){this.dataEdges=[];let prevPin=null;_.forEach(function(row){prevPin&&this.dataEdges.push({type:"LineString",coordinates:[[prevPin[1],prevPin[0]],[row[1],row[0]]]}),prevPin=row},this)}return retVal}layerEnter(base,svgElement,domElement){Pins$1.prototype.layerEnter.apply(this,arguments),svgElement.append("defs").append("marker").attr("class","marker").attr("id",this._id+"_arrowHead").attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerWidth",16).attr("markerHeight",16).attr("markerUnits","strokeWidth").attr("orient","auto").append("polyline").attr("points","0,0 10,5 0,10 1,5"),this._edgesTransform=svgElement.append("g")}layerUpdate(base){Pins$1.prototype.layerUpdate.apply(this,arguments),this._edgesTransform.style("opacity",this.opacity());const edgesPaths=this._edgesTransform.selectAll(".dataEdge").data(this.visible()?this.dataEdges:[]);this._edgesPaths=edgesPaths.enter().append("path").attr("class","dataEdge").attr("marker-end","url(#"+this._id+"_arrowHead)").merge(edgesPaths).attr("d",base._d3GeoPath),edgesPaths.exit().remove()}layerZoomed(base){Pins$1.prototype.layerZoomed.apply(this,arguments),this._edgesPaths.attr("stroke-width",`${.5/base.zoomScale()}px`)}}Graph.prototype._class+=" map_Graph";class Graticule extends Layer{constructor(){super();__publicField(this,"_dataMap",{});__publicField(this,"_path",common.select(null));__publicField(this,"_graticule");__publicField(this,"_graticulePath");__publicField(this,"_graticuleOutlinePath");__publicField(this,"_prevProjection")}layerEnter(base,svgElement,domElement){Layer.prototype.layerEnter.apply(this,arguments),this._graticule=graticule(),this._graticulePath=svgElement.append("path").datum(this._graticule).attr("class","graticule").attr("vector-effect","non-scaling-stroke"),this._graticuleOutlinePath=svgElement.append("path").datum(this._graticule.outline).attr("class","graticuleOutline").attr("vector-effect","non-scaling-stroke")}layerUpdate(base){if(!this.visible()){this._graticulePath.attr("d",""),this._graticuleOutlinePath.attr("d",""),delete this._prevProjection;return}this._prevProjection!==base.projection()&&(this._graticulePath.attr("d",base._d3GeoPath),this._graticuleOutlinePath.attr("d",base._d3GeoPath),this._prevProjection=base.projection()),this._graticulePath.style("stroke",this.meshColor()),this._graticuleOutlinePath.style("stroke",this.meshColor())}layerExit(base){delete this._prevProjection}}Graticule.prototype._class+=" map_Graticule",Graticule.prototype.publish("opacity",1,"number","Opacity",null,{tags:["Advanced"]}),Graticule.prototype.publish("meshColor",null,"html-color","Stroke Color",null,{optional:!0}),Graticule.prototype.publish("meshStrokeWidth",.25,"number","Stroke Width");class Heat extends Layer{constructor(){super();__publicField(this,"_heatTransform");__publicField(this,"heat");__publicField(this,"_prevProjection")}layerEnter(base,svgElement,domElement){Layer.prototype.layerEnter.apply(this,arguments),this._parentOverlay.style("pointer-events","none"),this._heatTransform=domElement.style("pointer-events","none").append("div").attr("class",this.classID()).style("width",base.width()+"px").style("height",base.height()+"px"),this.heat=new other.HeatMap().target(this._heatTransform.node())}layerUpdate(base){Layer.prototype.layerUpdate.apply(this,arguments),this._heatTransform.style("opacity",this.opacity()).style("width",base.width()+"px").style("height",base.height()+"px"),this.heat.resize(base.size()),this.layerZoomed(base)}layerExit(base){delete this._prevProjection,this.heat.target(null),delete this.heat}layerZoomed(base){Layer.prototype.layerZoomed.apply(this,arguments);const latField=this._db.fieldByLabel(this.latColumn()),longField=this._db.fieldByLabel(this.longColumn());this.heat.columns(this.columns()).data(this.visible()?this.data().map(function(row){const lat=latField?row[latField.idx]:row[0],long=longField?row[longField.idx]:row[1],transform2=base.zoomTranslate(),pos=base.project(lat,long),scale=base.zoomScale();return pos[0]*=scale,pos[1]*=scale,[transform2[0]+pos[0],transform2[1]+pos[1],row[4]||.5]}):[]).render()}}Heat.prototype._class+=" map_Heat",Heat.prototype.publish("latColumn",null,"set","Latitude column",function(){return this.columns()},{optional:!0}),Heat.prototype.publish("longColumn",null,"set","Longitude column",function(){return this.columns()},{optional:!0}),Heat.prototype.publish("opacity",1,"number","Opacity",null,{tags:["Advanced"]});function IChoropleth(){}IChoropleth.prototype._palette=common.Palette.rainbow("default"),IChoropleth.prototype.click=function(row,column,selected){};function defaultScale(t){return t.k}function defaultTranslate(t){return[t.x,t.y]}function constant(x){return function(){return x}}function d3Tile(){let x02=0,y02=0,x12=960,y12=500,clampX=!0,clampY=!0,tileSize=256,scale=defaultScale,translate=defaultTranslate,zoomDelta=0;function tile(){const scale_=+scale.apply(this,arguments),translate_=translate.apply(this,arguments),z=Math.log2(scale_/tileSize),z02=Math.round(Math.max(z+zoomDelta,0)),k=Math.pow(2,z-z02)*tileSize,x=+translate_[0]-scale_/2,y=+translate_[1]-scale_/2,xmin=Math.max(clampX?0:-1/0,Math.floor((x02-x)/k)),xmax=Math.min(clampX?1<<z02:1/0,Math.ceil((x12-x)/k)),ymin=Math.max(clampY?0:-1/0,Math.floor((y02-y)/k)),ymax=Math.min(clampY?1<<z02:1/0,Math.ceil((y12-y)/k)),tiles=[];for(let y2=ymin;y2<ymax;++y2)for(let x2=xmin;x2<xmax;++x2)tiles.push([x2,y2,z02]);return tiles.translate=[x/k,y/k],tiles.scale=k,tiles}return tile.size=function(_){return arguments.length?(x02=y02=0,x12=+_[0],y12=+_[1],tile):[x12-x02,y12-y02]},tile.extent=function(_){return arguments.length?(x02=+_[0][0],y02=+_[0][1],x12=+_[1][0],y12=+_[1][1],tile):[[x02,y02],[x12,y12]]},tile.scale=function(_){return arguments.length?(scale=typeof _=="function"?_:constant(+_),tile):scale},tile.translate=function(_){return arguments.length?(translate=typeof _=="function"?_:constant([+_[0],+_[1]]),tile):translate},tile.zoomDelta=function(_){return arguments.length?(zoomDelta=+_,tile):zoomDelta},tile.tileSize=function(_){return arguments.length?(tileSize=+_,tile):tileSize},tile.clamp=function(_){return arguments.length?(clampX=clampY=!!_,tile):clampX&&clampY},tile.clampX=function(_){return arguments.length?(clampX=!!_,tile):clampX},tile.clampY=function(_){return arguments.length?(clampY=!!_,tile):clampY},tile}const constScale=4096,_OpenStreet=class _OpenStreet extends Layer{constructor(){super();__publicField(this,"_tile");__publicField(this,"_openStreet");__publicField(this,"_copyright");__publicField(this,"_copyrightBBox");__publicField(this,"_prevTileProvider");__publicField(this,"_zoomLayerID",0);__publicField(this,"_prevZoomLevel");this.autoScaleMode("none")}layerEnter(base,svgElement,domElement){Layer.prototype.layerEnter.apply(this,arguments),base.zoomExtent([.1,constScale*4]),this._openStreet=svgElement.append("g"),this._copyright=svgElement.append("text").attr("x",-100).attr("y",-100).style("opacity",.5).text(_OpenStreet._copyrightText),this._copyrightBBox=this._copyright.node().getBBox()}layerUpdate(base){this._tile=d3Tile().size([base.width(),base.height()]).wrap(!1),this.visible()?this._copyright.attr("x",base.width()-this._copyrightBBox.width-this._copyrightBBox.height/2).attr("y",base.height()-this._copyrightBBox.height/2).text(_OpenStreet._copyrightText):this._copyright.text(""),this.layerZoomed(base)}layerZoomed(base){const scale=base.zoomScale(),transform2=base.zoomTranslate(),tiles=this._tile.scale(scale*constScale).translate(transform2)(),tilesScale=tiles.scale/scale;tiles.translate[0]/tiles.scale,tiles.translate[1]/tiles.scale;const zoomLevel=Math.round(tilesScale*1e3);this._prevZoomLevel!==zoomLevel&&(this._prevZoomLevel=zoomLevel,this._zoomLayerID++);const scaleG=this._openStreet.selectAll(".scaleG").data([this._zoomLayerID],d=>d),scaleGUpdate=scaleG.enter().append("g").attr("class","scaleG").attr("transform",stringify(tilesScale)).merge(scaleG);scaleG.exit().style("opacity",1).transition().duration(1e3).style("opacity",0).on("end",function(d){common.select(this).selectAll(".image").attr("xlink:href",null)}).remove(),scaleGUpdate.selectAll(".image").data(tiles,function(d){return""+d.x+","+d.y}).enter().append("image").attr("class","image").style("opacity",0).attr("x",function(d){return d.tx}).attr("y",function(d){return d.ty}).attr("width",256).attr("height",256).attr("xlink:href",function(d){return"http://"+"abc"[d.y%3]+".tile.openstreetmap.org/"+d.z+"/"+d.x+"/"+d.y+".png"}).transition().duration(500).style("opacity",1)}};__publicField(_OpenStreet,"_copyrightText","© OpenStreetMap contributors");let OpenStreet=_OpenStreet;OpenStreet.prototype._class+=" map_OpenStreet",OpenStreet.prototype.publish("tileProvider","OpenStreetMap","set","Tile Provider",["OpenStreetMap","OpenStreetMap Hot","MapQuest","MapQuest Sat","Stamen Watercolor","OpenCycleMap"],{tags:["Basic","Shared"]});function stringify(scale,translate){const k=scale/256;return"translate("+-constScale/2+","+-constScale/2+") scale("+k+")"}class TopoJSONChoropleth extends Choropleth{constructor(){super();__publicField(this,"_prevRegion");__publicField(this,"choroPaths");__publicField(this,"_choroTopologyIndex");__publicField(this,"_choroTopologyFeatures");this.projection("Mercator")}layerEnter(base,svgElement,domElement){Choropleth.prototype.layerEnter.apply(this,arguments),this._selection.widgetElement(this._choroplethData),this.choroPaths=common.select(null);const context=this;this.tooltipHTML(function(d){const columns=context.columns(),series=columns&&columns.length?columns[0]:"Location",origData=d&&d.length?d[d.length-1]:[""];return context.tooltipFormat({label:origData[0],series,value:d[1]})})}layerUpdate(base){Choropleth.prototype.layerUpdate.apply(this,arguments);const data=[],context=this;this.data().forEach(function(row){if(isNaN(row[0]))for(const key in context._choroTopologyIndex)for(const key2 in context._choroTopologyIndex[key])key2===row[0]&&context._choroTopologyIndex[key][key2].forEach(function(idx){data.push([idx].concat(row.filter(function(d,i){return i>0})).concat([row]))});else data.push(row.concat([row]))}),this.choroPaths=this._choroplethData.selectAll(".data").data(this.visible()?data:[],function(d){return d[0]}),this.choroPaths.enter().append("path").attr("class","data").call(this._selection.enter.bind(this._selection)).on("click",function(d){context._dataMap[d[0]]&&context.click(context.rowToObj(context._dataMap[d[0]]),"weight",context._selection.selected(context))}).on("dblclick",function(d){context._dataMap[d[0]]&&context.dblclick(context.rowToObj(context._dataMap[d[0]]),"weight",context._selection.selected(context))}).on("mouseout.tooltip",this.tooltip.hide).on("mousemove.tooltip",this.tooltip.show),this.choroPaths.attr("d",function(d){const retVal=base._d3GeoPath(context._choroTopologyFeatures[d[0]]);return retVal||console.warn("Unknown Country: "+d),retVal}).style("fill",function(d){return context._palette(d[1],context._dataMinWeight,context._dataMaxWeight)}),this.choroPaths.exit().remove()}layerPreRender(){if(this._prevRegion!==this.region()&&(this._prevRegion=this.region(),delete this._topoJsonPromise),!this._topoJsonPromise){const context=this;this._topoJsonPromise=new Promise(function(resolve2,reject){d3Json(`${topoJsonFolder()}/${context.region()}.json`,function(region){context._choroTopology=region,context._choroTopologyObjects=region.objects.PolbndA,context._choroTopologyFeatures=feature(context._choroTopology,context._choroTopologyObjects).features,d3Json(`${topoJsonFolder()}/${context.region()}_idx.json`,indexLoad).on("error",function(err){indexLoad({})});function indexLoad(index2){context._choroTopologyIndex=index2,resolve2()}})})}return this._topoJsonPromise}}TopoJSONChoropleth.prototype._class+=" map_TopoJSONChoropleth",TopoJSONChoropleth.prototype.publish("region","GB","set","Region Data",["AT","BE","BG","BR","CHLI","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GE","GR","HR","HU","IE","IS","IT","KS","LT","LU","LV","MD","MK","MT","ND","NL","NO","PL","PT","RO","RS","SE","SI","SK","UA"]);var leafletSrc$1={exports:{}};/* @preserve
3
+ * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
4
+ * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
5
+ */var leafletSrc=leafletSrc$1.exports,hasRequiredLeafletSrc;function requireLeafletSrc(){return hasRequiredLeafletSrc||(hasRequiredLeafletSrc=1,function(module2,exports3){(function(global,factory){factory(exports3)})(leafletSrc,function(exports4){var version="1.9.4";function extend(dest){var i,j,len,src;for(j=1,len=arguments.length;j<len;j++){src=arguments[j];for(i in src)dest[i]=src[i]}return dest}var create$2=Object.create||function(){function F(){}return function(proto){return F.prototype=proto,new F}}();function bind(fn,obj){var slice=Array.prototype.slice;if(fn.bind)return fn.bind.apply(fn,slice.call(arguments,1));var args=slice.call(arguments,2);return function(){return fn.apply(obj,args.length?args.concat(slice.call(arguments)):arguments)}}var lastId=0;function stamp(obj){return"_leaflet_id"in obj||(obj._leaflet_id=++lastId),obj._leaflet_id}function throttle(fn,time,context){var lock,args,wrapperFn,later;return later=function(){lock=!1,args&&(wrapperFn.apply(context,args),args=!1)},wrapperFn=function(){lock?args=arguments:(fn.apply(context,arguments),setTimeout(later,time),lock=!0)},wrapperFn}function wrapNum(x,range2,includeMax){var max=range2[1],min=range2[0],d=max-min;return x===max&&includeMax?x:((x-min)%d+d)%d+min}function falseFn(){return!1}function formatNum(num,precision){if(precision===!1)return num;var pow2=Math.pow(10,precision===void 0?6:precision);return Math.round(num*pow2)/pow2}function trim(str){return str.trim?str.trim():str.replace(/^\s+|\s+$/g,"")}function splitWords(str){return trim(str).split(/\s+/)}function setOptions(obj,options){Object.prototype.hasOwnProperty.call(obj,"options")||(obj.options=obj.options?create$2(obj.options):{});for(var i in options)obj.options[i]=options[i];return obj.options}function getParamString(obj,existingUrl,uppercase){var params=[];for(var i in obj)params.push(encodeURIComponent(uppercase?i.toUpperCase():i)+"="+encodeURIComponent(obj[i]));return(!existingUrl||existingUrl.indexOf("?")===-1?"?":"&")+params.join("&")}var templateRe=/\{ *([\w_ -]+) *\}/g;function template(str,data){return str.replace(templateRe,function(str2,key){var value=data[key];if(value===void 0)throw new Error("No value provided for variable "+str2);return typeof value=="function"&&(value=value(data)),value})}var isArray=Array.isArray||function(obj){return Object.prototype.toString.call(obj)==="[object Array]"};function indexOf(array,el){for(var i=0;i<array.length;i++)if(array[i]===el)return i;return-1}var emptyImageUrl="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function getPrefixed(name){return window["webkit"+name]||window["moz"+name]||window["ms"+name]}var lastTime=0;function timeoutDefer(fn){var time=+new Date,timeToCall=Math.max(0,16-(time-lastTime));return lastTime=time+timeToCall,window.setTimeout(fn,timeToCall)}var requestFn=window.requestAnimationFrame||getPrefixed("RequestAnimationFrame")||timeoutDefer,cancelFn=window.cancelAnimationFrame||getPrefixed("CancelAnimationFrame")||getPrefixed("CancelRequestAnimationFrame")||function(id){window.clearTimeout(id)};function requestAnimFrame(fn,context,immediate){if(immediate&&requestFn===timeoutDefer)fn.call(context);else return requestFn.call(window,bind(fn,context))}function cancelAnimFrame(id){id&&cancelFn.call(window,id)}var Util={__proto__:null,extend,create:create$2,bind,get lastId(){return lastId},stamp,throttle,wrapNum,falseFn,formatNum,trim,splitWords,setOptions,getParamString,template,isArray,indexOf,emptyImageUrl,requestFn,cancelFn,requestAnimFrame,cancelAnimFrame};function Class(){}Class.extend=function(props){var NewClass=function(){setOptions(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},parentProto=NewClass.__super__=this.prototype,proto=create$2(parentProto);proto.constructor=NewClass,NewClass.prototype=proto;for(var i in this)Object.prototype.hasOwnProperty.call(this,i)&&i!=="prototype"&&i!=="__super__"&&(NewClass[i]=this[i]);return props.statics&&extend(NewClass,props.statics),props.includes&&(checkDeprecatedMixinEvents(props.includes),extend.apply(null,[proto].concat(props.includes))),extend(proto,props),delete proto.statics,delete proto.includes,proto.options&&(proto.options=parentProto.options?create$2(parentProto.options):{},extend(proto.options,props.options)),proto._initHooks=[],proto.callInitHooks=function(){if(!this._initHooksCalled){parentProto.callInitHooks&&parentProto.callInitHooks.call(this),this._initHooksCalled=!0;for(var i2=0,len=proto._initHooks.length;i2<len;i2++)proto._initHooks[i2].call(this)}},NewClass},Class.include=function(props){var parentOptions=this.prototype.options;return extend(this.prototype,props),props.options&&(this.prototype.options=parentOptions,this.mergeOptions(props.options)),this},Class.mergeOptions=function(options){return extend(this.prototype.options,options),this},Class.addInitHook=function(fn){var args=Array.prototype.slice.call(arguments,1),init=typeof fn=="function"?fn:function(){this[fn].apply(this,args)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(init),this};function checkDeprecatedMixinEvents(includes){if(!(typeof L>"u"||!L||!L.Mixin)){includes=isArray(includes)?includes:[includes];for(var i=0;i<includes.length;i++)includes[i]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Events={on:function(types2,fn,context){if(typeof types2=="object")for(var type2 in types2)this._on(type2,types2[type2],fn);else{types2=splitWords(types2);for(var i=0,len=types2.length;i<len;i++)this._on(types2[i],fn,context)}return this},off:function(types2,fn,context){if(!arguments.length)delete this._events;else if(typeof types2=="object")for(var type2 in types2)this._off(type2,types2[type2],fn);else{types2=splitWords(types2);for(var removeAll2=arguments.length===1,i=0,len=types2.length;i<len;i++)removeAll2?this._off(types2[i]):this._off(types2[i],fn,context)}return this},_on:function(type2,fn,context,_once){if(typeof fn!="function"){console.warn("wrong listener type: "+typeof fn);return}if(this._listens(type2,fn,context)===!1){context===this&&(context=void 0);var newListener={fn,ctx:context};_once&&(newListener.once=!0),this._events=this._events||{},this._events[type2]=this._events[type2]||[],this._events[type2].push(newListener)}},_off:function(type2,fn,context){var listeners,i,len;if(this._events&&(listeners=this._events[type2],!!listeners)){if(arguments.length===1){if(this._firingCount)for(i=0,len=listeners.length;i<len;i++)listeners[i].fn=falseFn;delete this._events[type2];return}if(typeof fn!="function"){console.warn("wrong listener type: "+typeof fn);return}var index3=this._listens(type2,fn,context);if(index3!==!1){var listener=listeners[index3];this._firingCount&&(listener.fn=falseFn,this._events[type2]=listeners=listeners.slice()),listeners.splice(index3,1)}}},fire:function(type2,data,propagate){if(!this.listens(type2,propagate))return this;var event=extend({},data,{type:type2,target:this,sourceTarget:data&&data.sourceTarget||this});if(this._events){var listeners=this._events[type2];if(listeners){this._firingCount=this._firingCount+1||1;for(var i=0,len=listeners.length;i<len;i++){var l=listeners[i],fn=l.fn;l.once&&this.off(type2,fn,l.ctx),fn.call(l.ctx||this,event)}this._firingCount--}}return propagate&&this._propagateEvent(event),this},listens:function(type2,fn,context,propagate){typeof type2!="string"&&console.warn('"string" type argument expected');var _fn=fn;typeof fn!="function"&&(propagate=!!fn,_fn=void 0,context=void 0);var listeners=this._events&&this._events[type2];if(listeners&&listeners.length&&this._listens(type2,_fn,context)!==!1)return!0;if(propagate){for(var id in this._eventParents)if(this._eventParents[id].listens(type2,fn,context,propagate))return!0}return!1},_listens:function(type2,fn,context){if(!this._events)return!1;var listeners=this._events[type2]||[];if(!fn)return!!listeners.length;context===this&&(context=void 0);for(var i=0,len=listeners.length;i<len;i++)if(listeners[i].fn===fn&&listeners[i].ctx===context)return i;return!1},once:function(types2,fn,context){if(typeof types2=="object")for(var type2 in types2)this._on(type2,types2[type2],fn,!0);else{types2=splitWords(types2);for(var i=0,len=types2.length;i<len;i++)this._on(types2[i],fn,context,!0)}return this},addEventParent:function(obj){return this._eventParents=this._eventParents||{},this._eventParents[stamp(obj)]=obj,this},removeEventParent:function(obj){return this._eventParents&&delete this._eventParents[stamp(obj)],this},_propagateEvent:function(e){for(var id in this._eventParents)this._eventParents[id].fire(e.type,extend({layer:e.target,propagatedFrom:e.target},e),!0)}};Events.addEventListener=Events.on,Events.removeEventListener=Events.clearAllEventListeners=Events.off,Events.addOneTimeEventListener=Events.once,Events.fireEvent=Events.fire,Events.hasEventListeners=Events.listens;var Evented=Class.extend(Events);function Point(x,y,round){this.x=round?Math.round(x):x,this.y=round?Math.round(y):y}var trunc=Math.trunc||function(v){return v>0?Math.floor(v):Math.ceil(v)};Point.prototype={clone:function(){return new Point(this.x,this.y)},add:function(point){return this.clone()._add(toPoint(point))},_add:function(point){return this.x+=point.x,this.y+=point.y,this},subtract:function(point){return this.clone()._subtract(toPoint(point))},_subtract:function(point){return this.x-=point.x,this.y-=point.y,this},divideBy:function(num){return this.clone()._divideBy(num)},_divideBy:function(num){return this.x/=num,this.y/=num,this},multiplyBy:function(num){return this.clone()._multiplyBy(num)},_multiplyBy:function(num){return this.x*=num,this.y*=num,this},scaleBy:function(point){return new Point(this.x*point.x,this.y*point.y)},unscaleBy:function(point){return new Point(this.x/point.x,this.y/point.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=trunc(this.x),this.y=trunc(this.y),this},distanceTo:function(point){point=toPoint(point);var x=point.x-this.x,y=point.y-this.y;return Math.sqrt(x*x+y*y)},equals:function(point){return point=toPoint(point),point.x===this.x&&point.y===this.y},contains:function(point){return point=toPoint(point),Math.abs(point.x)<=Math.abs(this.x)&&Math.abs(point.y)<=Math.abs(this.y)},toString:function(){return"Point("+formatNum(this.x)+", "+formatNum(this.y)+")"}};function toPoint(x,y,round){return x instanceof Point?x:isArray(x)?new Point(x[0],x[1]):x==null?x:typeof x=="object"&&"x"in x&&"y"in x?new Point(x.x,x.y):new Point(x,y,round)}function Bounds(a,b){if(a)for(var points=b?[a,b]:a,i=0,len=points.length;i<len;i++)this.extend(points[i])}Bounds.prototype={extend:function(obj){var min2,max2;if(!obj)return this;if(obj instanceof Point||typeof obj[0]=="number"||"x"in obj)min2=max2=toPoint(obj);else if(obj=toBounds(obj),min2=obj.min,max2=obj.max,!min2||!max2)return this;return!this.min&&!this.max?(this.min=min2.clone(),this.max=max2.clone()):(this.min.x=Math.min(min2.x,this.min.x),this.max.x=Math.max(max2.x,this.max.x),this.min.y=Math.min(min2.y,this.min.y),this.max.y=Math.max(max2.y,this.max.y)),this},getCenter:function(round){return toPoint((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,round)},getBottomLeft:function(){return toPoint(this.min.x,this.max.y)},getTopRight:function(){return toPoint(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(obj){var min,max;return typeof obj[0]=="number"||obj instanceof Point?obj=toPoint(obj):obj=toBounds(obj),obj instanceof Bounds?(min=obj.min,max=obj.max):min=max=obj,min.x>=this.min.x&&max.x<=this.max.x&&min.y>=this.min.y&&max.y<=this.max.y},intersects:function(bounds2){bounds2=toBounds(bounds2);var min=this.min,max=this.max,min2=bounds2.min,max2=bounds2.max,xIntersects=max2.x>=min.x&&min2.x<=max.x,yIntersects=max2.y>=min.y&&min2.y<=max.y;return xIntersects&&yIntersects},overlaps:function(bounds2){bounds2=toBounds(bounds2);var min=this.min,max=this.max,min2=bounds2.min,max2=bounds2.max,xOverlaps=max2.x>min.x&&min2.x<max.x,yOverlaps=max2.y>min.y&&min2.y<max.y;return xOverlaps&&yOverlaps},isValid:function(){return!!(this.min&&this.max)},pad:function(bufferRatio){var min=this.min,max=this.max,heightBuffer=Math.abs(min.x-max.x)*bufferRatio,widthBuffer=Math.abs(min.y-max.y)*bufferRatio;return toBounds(toPoint(min.x-heightBuffer,min.y-widthBuffer),toPoint(max.x+heightBuffer,max.y+widthBuffer))},equals:function(bounds2){return bounds2?(bounds2=toBounds(bounds2),this.min.equals(bounds2.getTopLeft())&&this.max.equals(bounds2.getBottomRight())):!1}};function toBounds(a,b){return!a||a instanceof Bounds?a:new Bounds(a,b)}function LatLngBounds(corner1,corner2){if(corner1)for(var latlngs=corner2?[corner1,corner2]:corner1,i=0,len=latlngs.length;i<len;i++)this.extend(latlngs[i])}LatLngBounds.prototype={extend:function(obj){var sw=this._southWest,ne=this._northEast,sw2,ne2;if(obj instanceof LatLng)sw2=obj,ne2=obj;else if(obj instanceof LatLngBounds){if(sw2=obj._southWest,ne2=obj._northEast,!sw2||!ne2)return this}else return obj?this.extend(toLatLng(obj)||toLatLngBounds(obj)):this;return!sw&&!ne?(this._southWest=new LatLng(sw2.lat,sw2.lng),this._northEast=new LatLng(ne2.lat,ne2.lng)):(sw.lat=Math.min(sw2.lat,sw.lat),sw.lng=Math.min(sw2.lng,sw.lng),ne.lat=Math.max(ne2.lat,ne.lat),ne.lng=Math.max(ne2.lng,ne.lng)),this},pad:function(bufferRatio){var sw=this._southWest,ne=this._northEast,heightBuffer=Math.abs(sw.lat-ne.lat)*bufferRatio,widthBuffer=Math.abs(sw.lng-ne.lng)*bufferRatio;return new LatLngBounds(new LatLng(sw.lat-heightBuffer,sw.lng-widthBuffer),new LatLng(ne.lat+heightBuffer,ne.lng+widthBuffer))},getCenter:function(){return new LatLng((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new LatLng(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(obj){typeof obj[0]=="number"||obj instanceof LatLng||"lat"in obj?obj=toLatLng(obj):obj=toLatLngBounds(obj);var sw=this._southWest,ne=this._northEast,sw2,ne2;return obj instanceof LatLngBounds?(sw2=obj.getSouthWest(),ne2=obj.getNorthEast()):sw2=ne2=obj,sw2.lat>=sw.lat&&ne2.lat<=ne.lat&&sw2.lng>=sw.lng&&ne2.lng<=ne.lng},intersects:function(bounds2){bounds2=toLatLngBounds(bounds2);var sw=this._southWest,ne=this._northEast,sw2=bounds2.getSouthWest(),ne2=bounds2.getNorthEast(),latIntersects=ne2.lat>=sw.lat&&sw2.lat<=ne.lat,lngIntersects=ne2.lng>=sw.lng&&sw2.lng<=ne.lng;return latIntersects&&lngIntersects},overlaps:function(bounds2){bounds2=toLatLngBounds(bounds2);var sw=this._southWest,ne=this._northEast,sw2=bounds2.getSouthWest(),ne2=bounds2.getNorthEast(),latOverlaps=ne2.lat>sw.lat&&sw2.lat<ne.lat,lngOverlaps=ne2.lng>sw.lng&&sw2.lng<ne.lng;return latOverlaps&&lngOverlaps},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(bounds2,maxMargin){return bounds2?(bounds2=toLatLngBounds(bounds2),this._southWest.equals(bounds2.getSouthWest(),maxMargin)&&this._northEast.equals(bounds2.getNorthEast(),maxMargin)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function toLatLngBounds(a,b){return a instanceof LatLngBounds?a:new LatLngBounds(a,b)}function LatLng(lat,lng,alt){if(isNaN(lat)||isNaN(lng))throw new Error("Invalid LatLng object: ("+lat+", "+lng+")");this.lat=+lat,this.lng=+lng,alt!==void 0&&(this.alt=+alt)}LatLng.prototype={equals:function(obj,maxMargin){if(!obj)return!1;obj=toLatLng(obj);var margin=Math.max(Math.abs(this.lat-obj.lat),Math.abs(this.lng-obj.lng));return margin<=(maxMargin===void 0?1e-9:maxMargin)},toString:function(precision){return"LatLng("+formatNum(this.lat,precision)+", "+formatNum(this.lng,precision)+")"},distanceTo:function(other2){return Earth.distance(this,toLatLng(other2))},wrap:function(){return Earth.wrapLatLng(this)},toBounds:function(sizeInMeters){var latAccuracy=180*sizeInMeters/40075017,lngAccuracy=latAccuracy/Math.cos(Math.PI/180*this.lat);return toLatLngBounds([this.lat-latAccuracy,this.lng-lngAccuracy],[this.lat+latAccuracy,this.lng+lngAccuracy])},clone:function(){return new LatLng(this.lat,this.lng,this.alt)}};function toLatLng(a,b,c){return a instanceof LatLng?a:isArray(a)&&typeof a[0]!="object"?a.length===3?new LatLng(a[0],a[1],a[2]):a.length===2?new LatLng(a[0],a[1]):null:a==null?a:typeof a=="object"&&"lat"in a?new LatLng(a.lat,"lng"in a?a.lng:a.lon,a.alt):b===void 0?null:new LatLng(a,b,c)}var CRS={latLngToPoint:function(latlng,zoom2){var projectedPoint=this.projection.project(latlng),scale2=this.scale(zoom2);return this.transformation._transform(projectedPoint,scale2)},pointToLatLng:function(point,zoom2){var scale2=this.scale(zoom2),untransformedPoint=this.transformation.untransform(point,scale2);return this.projection.unproject(untransformedPoint)},project:function(latlng){return this.projection.project(latlng)},unproject:function(point){return this.projection.unproject(point)},scale:function(zoom2){return 256*Math.pow(2,zoom2)},zoom:function(scale2){return Math.log(scale2/256)/Math.LN2},getProjectedBounds:function(zoom2){if(this.infinite)return null;var b=this.projection.bounds,s=this.scale(zoom2),min=this.transformation.transform(b.min,s),max=this.transformation.transform(b.max,s);return new Bounds(min,max)},infinite:!1,wrapLatLng:function(latlng){var lng=this.wrapLng?wrapNum(latlng.lng,this.wrapLng,!0):latlng.lng,lat=this.wrapLat?wrapNum(latlng.lat,this.wrapLat,!0):latlng.lat,alt=latlng.alt;return new LatLng(lat,lng,alt)},wrapLatLngBounds:function(bounds2){var center=bounds2.getCenter(),newCenter=this.wrapLatLng(center),latShift=center.lat-newCenter.lat,lngShift=center.lng-newCenter.lng;if(latShift===0&&lngShift===0)return bounds2;var sw=bounds2.getSouthWest(),ne=bounds2.getNorthEast(),newSw=new LatLng(sw.lat-latShift,sw.lng-lngShift),newNe=new LatLng(ne.lat-latShift,ne.lng-lngShift);return new LatLngBounds(newSw,newNe)}},Earth=extend({},CRS,{wrapLng:[-180,180],R:6371e3,distance:function(latlng1,latlng2){var rad=Math.PI/180,lat1=latlng1.lat*rad,lat2=latlng2.lat*rad,sinDLat=Math.sin((latlng2.lat-latlng1.lat)*rad/2),sinDLon=Math.sin((latlng2.lng-latlng1.lng)*rad/2),a=sinDLat*sinDLat+Math.cos(lat1)*Math.cos(lat2)*sinDLon*sinDLon,c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*c}}),earthRadius=6378137,SphericalMercator={R:earthRadius,MAX_LATITUDE:85.0511287798,project:function(latlng){var d=Math.PI/180,max=this.MAX_LATITUDE,lat=Math.max(Math.min(max,latlng.lat),-max),sin2=Math.sin(lat*d);return new Point(this.R*latlng.lng*d,this.R*Math.log((1+sin2)/(1-sin2))/2)},unproject:function(point){var d=180/Math.PI;return new LatLng((2*Math.atan(Math.exp(point.y/this.R))-Math.PI/2)*d,point.x*d/this.R)},bounds:function(){var d=earthRadius*Math.PI;return new Bounds([-d,-d],[d,d])}()};function Transformation(a,b,c,d){if(isArray(a)){this._a=a[0],this._b=a[1],this._c=a[2],this._d=a[3];return}this._a=a,this._b=b,this._c=c,this._d=d}Transformation.prototype={transform:function(point,scale2){return this._transform(point.clone(),scale2)},_transform:function(point,scale2){return scale2=scale2||1,point.x=scale2*(this._a*point.x+this._b),point.y=scale2*(this._c*point.y+this._d),point},untransform:function(point,scale2){return scale2=scale2||1,new Point((point.x/scale2-this._b)/this._a,(point.y/scale2-this._d)/this._c)}};function toTransformation(a,b,c,d){return new Transformation(a,b,c,d)}var EPSG3857=extend({},Earth,{code:"EPSG:3857",projection:SphericalMercator,transformation:function(){var scale2=.5/(Math.PI*SphericalMercator.R);return toTransformation(scale2,.5,-scale2,.5)}()}),EPSG900913=extend({},EPSG3857,{code:"EPSG:900913"});function svgCreate(name){return document.createElementNS("http://www.w3.org/2000/svg",name)}function pointsToPath(rings,closed){var str="",i,j,len,len2,points,p;for(i=0,len=rings.length;i<len;i++){for(points=rings[i],j=0,len2=points.length;j<len2;j++)p=points[j],str+=(j?"L":"M")+p.x+" "+p.y;str+=closed?Browser.svg?"z":"x":""}return str||"M0 0"}var style=document.documentElement.style,ie="ActiveXObject"in window,ielt9=ie&&!document.addEventListener,edge="msLaunchUri"in navigator&&!("documentMode"in document),webkit=userAgentContains("webkit"),android=userAgentContains("android"),android23=userAgentContains("android 2")||userAgentContains("android 3"),webkitVer=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),androidStock=android&&userAgentContains("Google")&&webkitVer<537&&!("AudioNode"in window),opera=!!window.opera,chrome=!edge&&userAgentContains("chrome"),gecko=userAgentContains("gecko")&&!webkit&&!opera&&!ie,safari=!chrome&&userAgentContains("safari"),phantom=userAgentContains("phantom"),opera12="OTransition"in style,win=navigator.platform.indexOf("Win")===0,ie3d=ie&&"transition"in style,webkit3d="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!android23,gecko3d="MozPerspective"in style,any3d=!window.L_DISABLE_3D&&(ie3d||webkit3d||gecko3d)&&!opera12&&!phantom,mobile=typeof orientation<"u"||userAgentContains("mobile"),mobileWebkit=mobile&&webkit,mobileWebkit3d=mobile&&webkit3d,msPointer=!window.PointerEvent&&window.MSPointerEvent,pointer=!!(window.PointerEvent||msPointer),touchNative="ontouchstart"in window||!!window.TouchEvent,touch=!window.L_NO_TOUCH&&(touchNative||pointer),mobileOpera=mobile&&opera,mobileGecko=mobile&&gecko,retina=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,passiveEvents=function(){var supportsPassiveOption=!1;try{var opts=Object.defineProperty({},"passive",{get:function(){supportsPassiveOption=!0}});window.addEventListener("testPassiveEventSupport",falseFn,opts),window.removeEventListener("testPassiveEventSupport",falseFn,opts)}catch{}return supportsPassiveOption}(),canvas$1=function(){return!!document.createElement("canvas").getContext}(),svg$1=!!(document.createElementNS&&svgCreate("svg").createSVGRect),inlineSvg=!!svg$1&&function(){var div=document.createElement("div");return div.innerHTML="<svg/>",(div.firstChild&&div.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),vml=!svg$1&&function(){try{var div=document.createElement("div");div.innerHTML='<v:shape adj="1"/>';var shape=div.firstChild;return shape.style.behavior="url(#default#VML)",shape&&typeof shape.adj=="object"}catch{return!1}}(),mac=navigator.platform.indexOf("Mac")===0,linux=navigator.platform.indexOf("Linux")===0;function userAgentContains(str){return navigator.userAgent.toLowerCase().indexOf(str)>=0}var Browser={ie,ielt9,edge,webkit,android,android23,androidStock,opera,chrome,gecko,safari,phantom,opera12,win,ie3d,webkit3d,gecko3d,any3d,mobile,mobileWebkit,mobileWebkit3d,msPointer,pointer,touch,touchNative,mobileOpera,mobileGecko,retina,passiveEvents,canvas:canvas$1,svg:svg$1,vml,inlineSvg,mac,linux},POINTER_DOWN=Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE=Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP=Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL=Browser.msPointer?"MSPointerCancel":"pointercancel",pEvent={touchstart:POINTER_DOWN,touchmove:POINTER_MOVE,touchend:POINTER_UP,touchcancel:POINTER_CANCEL},handle={touchstart:_onPointerStart,touchmove:_handlePointer,touchend:_handlePointer,touchcancel:_handlePointer},_pointers={},_pointerDocListener=!1;function addPointerListener(obj,type2,handler){return type2==="touchstart"&&_addPointerDocListener(),handle[type2]?(handler=handle[type2].bind(this,handler),obj.addEventListener(pEvent[type2],handler,!1),handler):(console.warn("wrong event specified:",type2),falseFn)}function removePointerListener(obj,type2,handler){if(!pEvent[type2]){console.warn("wrong event specified:",type2);return}obj.removeEventListener(pEvent[type2],handler,!1)}function _globalPointerDown(e){_pointers[e.pointerId]=e}function _globalPointerMove(e){_pointers[e.pointerId]&&(_pointers[e.pointerId]=e)}function _globalPointerUp(e){delete _pointers[e.pointerId]}function _addPointerDocListener(){_pointerDocListener||(document.addEventListener(POINTER_DOWN,_globalPointerDown,!0),document.addEventListener(POINTER_MOVE,_globalPointerMove,!0),document.addEventListener(POINTER_UP,_globalPointerUp,!0),document.addEventListener(POINTER_CANCEL,_globalPointerUp,!0),_pointerDocListener=!0)}function _handlePointer(handler,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){e.touches=[];for(var i in _pointers)e.touches.push(_pointers[i]);e.changedTouches=[e],handler(e)}}function _onPointerStart(handler,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&preventDefault(e),_handlePointer(handler,e)}function makeDblclick(event){var newEvent={},prop,i;for(i in event)prop=event[i],newEvent[i]=prop&&prop.bind?prop.bind(event):prop;return event=newEvent,newEvent.type="dblclick",newEvent.detail=2,newEvent.isTrusted=!1,newEvent._simulated=!0,newEvent}var delay=200;function addDoubleTapListener(obj,handler){obj.addEventListener("dblclick",handler);var last=0,detail;function simDblclick(e){if(e.detail!==1){detail=e.detail;return}if(!(e.pointerType==="mouse"||e.sourceCapabilities&&!e.sourceCapabilities.firesTouchEvents)){var path=getPropagationPath(e);if(!(path.some(function(el){return el instanceof HTMLLabelElement&&el.attributes.for})&&!path.some(function(el){return el instanceof HTMLInputElement||el instanceof HTMLSelectElement}))){var now=Date.now();now-last<=delay?(detail++,detail===2&&handler(makeDblclick(e))):detail=1,last=now}}}return obj.addEventListener("click",simDblclick),{dblclick:handler,simDblclick}}function removeDoubleTapListener(obj,handlers){obj.removeEventListener("dblclick",handlers.dblclick),obj.removeEventListener("click",handlers.simDblclick)}var TRANSFORM=testProp(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),TRANSITION=testProp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),TRANSITION_END=TRANSITION==="webkitTransition"||TRANSITION==="OTransition"?TRANSITION+"End":"transitionend";function get(id){return typeof id=="string"?document.getElementById(id):id}function getStyle(el,style2){var value=el.style[style2]||el.currentStyle&&el.currentStyle[style2];if((!value||value==="auto")&&document.defaultView){var css=document.defaultView.getComputedStyle(el,null);value=css?css[style2]:null}return value==="auto"?null:value}function create$1(tagName,className,container){var el=document.createElement(tagName);return el.className=className||"",container&&container.appendChild(el),el}function remove(el){var parent=el.parentNode;parent&&parent.removeChild(el)}function empty(el){for(;el.firstChild;)el.removeChild(el.firstChild)}function toFront(el){var parent=el.parentNode;parent&&parent.lastChild!==el&&parent.appendChild(el)}function toBack(el){var parent=el.parentNode;parent&&parent.firstChild!==el&&parent.insertBefore(el,parent.firstChild)}function hasClass(el,name){if(el.classList!==void 0)return el.classList.contains(name);var className=getClass(el);return className.length>0&&new RegExp("(^|\\s)"+name+"(\\s|$)").test(className)}function addClass(el,name){if(el.classList!==void 0)for(var classes=splitWords(name),i=0,len=classes.length;i<len;i++)el.classList.add(classes[i]);else if(!hasClass(el,name)){var className=getClass(el);setClass(el,(className?className+" ":"")+name)}}function removeClass(el,name){el.classList!==void 0?el.classList.remove(name):setClass(el,trim((" "+getClass(el)+" ").replace(" "+name+" "," ")))}function setClass(el,name){el.className.baseVal===void 0?el.className=name:el.className.baseVal=name}function getClass(el){return el.correspondingElement&&(el=el.correspondingElement),el.className.baseVal===void 0?el.className:el.className.baseVal}function setOpacity(el,value){"opacity"in el.style?el.style.opacity=value:"filter"in el.style&&_setOpacityIE(el,value)}function _setOpacityIE(el,value){var filter=!1,filterName="DXImageTransform.Microsoft.Alpha";try{filter=el.filters.item(filterName)}catch{if(value===1)return}value=Math.round(value*100),filter?(filter.Enabled=value!==100,filter.Opacity=value):el.style.filter+=" progid:"+filterName+"(opacity="+value+")"}function testProp(props){for(var style2=document.documentElement.style,i=0;i<props.length;i++)if(props[i]in style2)return props[i];return!1}function setTransform(el,offset,scale2){var pos=offset||new Point(0,0);el.style[TRANSFORM]=(Browser.ie3d?"translate("+pos.x+"px,"+pos.y+"px)":"translate3d("+pos.x+"px,"+pos.y+"px,0)")+(scale2?" scale("+scale2+")":"")}function setPosition(el,point){el._leaflet_pos=point,Browser.any3d?setTransform(el,point):(el.style.left=point.x+"px",el.style.top=point.y+"px")}function getPosition(el){return el._leaflet_pos||new Point(0,0)}var disableTextSelection,enableTextSelection,_userSelect;if("onselectstart"in document)disableTextSelection=function(){on(window,"selectstart",preventDefault)},enableTextSelection=function(){off(window,"selectstart",preventDefault)};else{var userSelectProperty=testProp(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);disableTextSelection=function(){if(userSelectProperty){var style2=document.documentElement.style;_userSelect=style2[userSelectProperty],style2[userSelectProperty]="none"}},enableTextSelection=function(){userSelectProperty&&(document.documentElement.style[userSelectProperty]=_userSelect,_userSelect=void 0)}}function disableImageDrag(){on(window,"dragstart",preventDefault)}function enableImageDrag(){off(window,"dragstart",preventDefault)}var _outlineElement,_outlineStyle;function preventOutline(element){for(;element.tabIndex===-1;)element=element.parentNode;element.style&&(restoreOutline(),_outlineElement=element,_outlineStyle=element.style.outlineStyle,element.style.outlineStyle="none",on(window,"keydown",restoreOutline))}function restoreOutline(){_outlineElement&&(_outlineElement.style.outlineStyle=_outlineStyle,_outlineElement=void 0,_outlineStyle=void 0,off(window,"keydown",restoreOutline))}function getSizedParentNode(element){do element=element.parentNode;while((!element.offsetWidth||!element.offsetHeight)&&element!==document.body);return element}function getScale(element){var rect=element.getBoundingClientRect();return{x:rect.width/element.offsetWidth||1,y:rect.height/element.offsetHeight||1,boundingClientRect:rect}}var DomUtil={__proto__:null,TRANSFORM,TRANSITION,TRANSITION_END,get,getStyle,create:create$1,remove,empty,toFront,toBack,hasClass,addClass,removeClass,setClass,getClass,setOpacity,testProp,setTransform,setPosition,getPosition,get disableTextSelection(){return disableTextSelection},get enableTextSelection(){return enableTextSelection},disableImageDrag,enableImageDrag,preventOutline,restoreOutline,getSizedParentNode,getScale};function on(obj,types2,fn,context){if(types2&&typeof types2=="object")for(var type2 in types2)addOne(obj,type2,types2[type2],fn);else{types2=splitWords(types2);for(var i=0,len=types2.length;i<len;i++)addOne(obj,types2[i],fn,context)}return this}var eventsKey="_leaflet_events";function off(obj,types2,fn,context){if(arguments.length===1)batchRemove(obj),delete obj[eventsKey];else if(types2&&typeof types2=="object")for(var type2 in types2)removeOne(obj,type2,types2[type2],fn);else if(types2=splitWords(types2),arguments.length===2)batchRemove(obj,function(type3){return indexOf(types2,type3)!==-1});else for(var i=0,len=types2.length;i<len;i++)removeOne(obj,types2[i],fn,context);return this}function batchRemove(obj,filterFn){for(var id in obj[eventsKey]){var type2=id.split(/\d/)[0];(!filterFn||filterFn(type2))&&removeOne(obj,type2,null,null,id)}}var mouseSubst={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function addOne(obj,type2,fn,context){var id=type2+stamp(fn)+(context?"_"+stamp(context):"");if(obj[eventsKey]&&obj[eventsKey][id])return this;var handler=function(e){return fn.call(context||obj,e||window.event)},originalHandler=handler;!Browser.touchNative&&Browser.pointer&&type2.indexOf("touch")===0?handler=addPointerListener(obj,type2,handler):Browser.touch&&type2==="dblclick"?handler=addDoubleTapListener(obj,handler):"addEventListener"in obj?type2==="touchstart"||type2==="touchmove"||type2==="wheel"||type2==="mousewheel"?obj.addEventListener(mouseSubst[type2]||type2,handler,Browser.passiveEvents?{passive:!1}:!1):type2==="mouseenter"||type2==="mouseleave"?(handler=function(e){e=e||window.event,isExternalTarget(obj,e)&&originalHandler(e)},obj.addEventListener(mouseSubst[type2],handler,!1)):obj.addEventListener(type2,originalHandler,!1):obj.attachEvent("on"+type2,handler),obj[eventsKey]=obj[eventsKey]||{},obj[eventsKey][id]=handler}function removeOne(obj,type2,fn,context,id){id=id||type2+stamp(fn)+(context?"_"+stamp(context):"");var handler=obj[eventsKey]&&obj[eventsKey][id];if(!handler)return this;!Browser.touchNative&&Browser.pointer&&type2.indexOf("touch")===0?removePointerListener(obj,type2,handler):Browser.touch&&type2==="dblclick"?removeDoubleTapListener(obj,handler):"removeEventListener"in obj?obj.removeEventListener(mouseSubst[type2]||type2,handler,!1):obj.detachEvent("on"+type2,handler),obj[eventsKey][id]=null}function stopPropagation(e){return e.stopPropagation?e.stopPropagation():e.originalEvent?e.originalEvent._stopped=!0:e.cancelBubble=!0,this}function disableScrollPropagation(el){return addOne(el,"wheel",stopPropagation),this}function disableClickPropagation(el){return on(el,"mousedown touchstart dblclick contextmenu",stopPropagation),el._leaflet_disable_click=!0,this}function preventDefault(e){return e.preventDefault?e.preventDefault():e.returnValue=!1,this}function stop(e){return preventDefault(e),stopPropagation(e),this}function getPropagationPath(ev){if(ev.composedPath)return ev.composedPath();for(var path=[],el=ev.target;el;)path.push(el),el=el.parentNode;return path}function getMousePosition(e,container){if(!container)return new Point(e.clientX,e.clientY);var scale2=getScale(container),offset=scale2.boundingClientRect;return new Point((e.clientX-offset.left)/scale2.x-container.clientLeft,(e.clientY-offset.top)/scale2.y-container.clientTop)}var wheelPxFactor=Browser.linux&&Browser.chrome?window.devicePixelRatio:Browser.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function getWheelDelta(e){return Browser.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/wheelPxFactor:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function isExternalTarget(el,e){var related=e.relatedTarget;if(!related)return!0;try{for(;related&&related!==el;)related=related.parentNode}catch{return!1}return related!==el}var DomEvent={__proto__:null,on,off,stopPropagation,disableScrollPropagation,disableClickPropagation,preventDefault,stop,getPropagationPath,getMousePosition,getWheelDelta,isExternalTarget,addListener:on,removeListener:off},PosAnimation=Evented.extend({run:function(el,newPos,duration,easeLinearity){this.stop(),this._el=el,this._inProgress=!0,this._duration=duration||.25,this._easeOutPower=1/Math.max(easeLinearity||.5,.2),this._startPos=getPosition(el),this._offset=newPos.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=requestAnimFrame(this._animate,this),this._step()},_step:function(round){var elapsed=+new Date-this._startTime,duration=this._duration*1e3;elapsed<duration?this._runFrame(this._easeOut(elapsed/duration),round):(this._runFrame(1),this._complete())},_runFrame:function(progress,round){var pos=this._startPos.add(this._offset.multiplyBy(progress));round&&pos._round(),setPosition(this._el,pos),this.fire("step")},_complete:function(){cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Map2=Evented.extend({options:{crs:EPSG3857,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(id,options){options=setOptions(this,options),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(id),this._initLayout(),this._onResize=bind(this._onResize,this),this._initEvents(),options.maxBounds&&this.setMaxBounds(options.maxBounds),options.zoom!==void 0&&(this._zoom=this._limitZoom(options.zoom)),options.center&&options.zoom!==void 0&&this.setView(toLatLng(options.center),options.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=TRANSITION&&Browser.any3d&&!Browser.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),on(this._proxy,TRANSITION_END,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(center,zoom2,options){if(zoom2=zoom2===void 0?this._zoom:this._limitZoom(zoom2),center=this._limitCenter(toLatLng(center),zoom2,this.options.maxBounds),options=options||{},this._stop(),this._loaded&&!options.reset&&options!==!0){options.animate!==void 0&&(options.zoom=extend({animate:options.animate},options.zoom),options.pan=extend({animate:options.animate,duration:options.duration},options.pan));var moved=this._zoom!==zoom2?this._tryAnimatedZoom&&this._tryAnimatedZoom(center,zoom2,options.zoom):this._tryAnimatedPan(center,options.pan);if(moved)return clearTimeout(this._sizeTimer),this}return this._resetView(center,zoom2,options.pan&&options.pan.noMoveStart),this},setZoom:function(zoom2,options){return this._loaded?this.setView(this.getCenter(),zoom2,{zoom:options}):(this._zoom=zoom2,this)},zoomIn:function(delta,options){return delta=delta||(Browser.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+delta,options)},zoomOut:function(delta,options){return delta=delta||(Browser.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-delta,options)},setZoomAround:function(latlng,zoom2,options){var scale2=this.getZoomScale(zoom2),viewHalf=this.getSize().divideBy(2),containerPoint=latlng instanceof Point?latlng:this.latLngToContainerPoint(latlng),centerOffset=containerPoint.subtract(viewHalf).multiplyBy(1-1/scale2),newCenter=this.containerPointToLatLng(viewHalf.add(centerOffset));return this.setView(newCenter,zoom2,{zoom:options})},_getBoundsCenterZoom:function(bounds2,options){options=options||{},bounds2=bounds2.getBounds?bounds2.getBounds():toLatLngBounds(bounds2);var paddingTL=toPoint(options.paddingTopLeft||options.padding||[0,0]),paddingBR=toPoint(options.paddingBottomRight||options.padding||[0,0]),zoom2=this.getBoundsZoom(bounds2,!1,paddingTL.add(paddingBR));if(zoom2=typeof options.maxZoom=="number"?Math.min(options.maxZoom,zoom2):zoom2,zoom2===1/0)return{center:bounds2.getCenter(),zoom:zoom2};var paddingOffset=paddingBR.subtract(paddingTL).divideBy(2),swPoint=this.project(bounds2.getSouthWest(),zoom2),nePoint=this.project(bounds2.getNorthEast(),zoom2),center=this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset),zoom2);return{center,zoom:zoom2}},fitBounds:function(bounds2,options){if(bounds2=toLatLngBounds(bounds2),!bounds2.isValid())throw new Error("Bounds are not valid.");var target=this._getBoundsCenterZoom(bounds2,options);return this.setView(target.center,target.zoom,options)},fitWorld:function(options){return this.fitBounds([[-90,-180],[90,180]],options)},panTo:function(center,options){return this.setView(center,this._zoom,{pan:options})},panBy:function(offset,options){if(offset=toPoint(offset).round(),options=options||{},!offset.x&&!offset.y)return this.fire("moveend");if(options.animate!==!0&&!this.getSize().contains(offset))return this._resetView(this.unproject(this.project(this.getCenter()).add(offset)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),options.noMoveStart||this.fire("movestart"),options.animate!==!1){addClass(this._mapPane,"leaflet-pan-anim");var newPos=this._getMapPanePos().subtract(offset).round();this._panAnim.run(this._mapPane,newPos,options.duration||.25,options.easeLinearity)}else this._rawPanBy(offset),this.fire("move").fire("moveend");return this},flyTo:function(targetCenter,targetZoom,options){if(options=options||{},options.animate===!1||!Browser.any3d)return this.setView(targetCenter,targetZoom,options);this._stop();var from=this.project(this.getCenter()),to=this.project(targetCenter),size=this.getSize(),startZoom=this._zoom;targetCenter=toLatLng(targetCenter),targetZoom=targetZoom===void 0?startZoom:targetZoom;var w0=Math.max(size.x,size.y),w1=w0*this.getZoomScale(startZoom,targetZoom),u1=to.distanceTo(from)||1,rho=1.42,rho2=rho*rho;function r(i){var s1=i?-1:1,s2=i?w1:w0,t1=w1*w1-w0*w0+s1*rho2*rho2*u1*u1,b1=2*s2*rho2*u1,b=t1/b1,sq=Math.sqrt(b*b+1)-b,log2=sq<1e-9?-18:Math.log(sq);return log2}function sinh(n){return(Math.exp(n)-Math.exp(-n))/2}function cosh(n){return(Math.exp(n)+Math.exp(-n))/2}function tanh(n){return sinh(n)/cosh(n)}var r0=r(0);function w(s){return w0*(cosh(r0)/cosh(r0+rho*s))}function u(s){return w0*(cosh(r0)*tanh(r0+rho*s)-sinh(r0))/rho2}function easeOut(t){return 1-Math.pow(1-t,1.5)}var start=Date.now(),S=(r(1)-r0)/rho,duration=options.duration?1e3*options.duration:1e3*S*.8;function frame(){var t=(Date.now()-start)/duration,s=easeOut(t)*S;t<=1?(this._flyToFrame=requestAnimFrame(frame,this),this._move(this.unproject(from.add(to.subtract(from).multiplyBy(u(s)/u1)),startZoom),this.getScaleZoom(w0/w(s),startZoom),{flyTo:!0})):this._move(targetCenter,targetZoom)._moveEnd(!0)}return this._moveStart(!0,options.noMoveStart),frame.call(this),this},flyToBounds:function(bounds2,options){var target=this._getBoundsCenterZoom(bounds2,options);return this.flyTo(target.center,target.zoom,options)},setMaxBounds:function(bounds2){return bounds2=toLatLngBounds(bounds2),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),bounds2.isValid()?(this.options.maxBounds=bounds2,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(zoom2){var oldZoom=this.options.minZoom;return this.options.minZoom=zoom2,this._loaded&&oldZoom!==zoom2&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(zoom2):this},setMaxZoom:function(zoom2){var oldZoom=this.options.maxZoom;return this.options.maxZoom=zoom2,this._loaded&&oldZoom!==zoom2&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(zoom2):this},panInsideBounds:function(bounds2,options){this._enforcingBounds=!0;var center=this.getCenter(),newCenter=this._limitCenter(center,this._zoom,toLatLngBounds(bounds2));return center.equals(newCenter)||this.panTo(newCenter,options),this._enforcingBounds=!1,this},panInside:function(latlng,options){options=options||{};var paddingTL=toPoint(options.paddingTopLeft||options.padding||[0,0]),paddingBR=toPoint(options.paddingBottomRight||options.padding||[0,0]),pixelCenter=this.project(this.getCenter()),pixelPoint=this.project(latlng),pixelBounds=this.getPixelBounds(),paddedBounds=toBounds([pixelBounds.min.add(paddingTL),pixelBounds.max.subtract(paddingBR)]),paddedSize=paddedBounds.getSize();if(!paddedBounds.contains(pixelPoint)){this._enforcingBounds=!0;var centerOffset=pixelPoint.subtract(paddedBounds.getCenter()),offset=paddedBounds.extend(pixelPoint).getSize().subtract(paddedSize);pixelCenter.x+=centerOffset.x<0?-offset.x:offset.x,pixelCenter.y+=centerOffset.y<0?-offset.y:offset.y,this.panTo(this.unproject(pixelCenter),options),this._enforcingBounds=!1}return this},invalidateSize:function(options){if(!this._loaded)return this;options=extend({animate:!1,pan:!0},options===!0?{animate:!0}:options);var oldSize=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var newSize=this.getSize(),oldCenter=oldSize.divideBy(2).round(),newCenter=newSize.divideBy(2).round(),offset=oldCenter.subtract(newCenter);return!offset.x&&!offset.y?this:(options.animate&&options.pan?this.panBy(offset):(options.pan&&this._rawPanBy(offset),this.fire("move"),options.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize,newSize}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(options){if(options=this._locateOptions=extend({timeout:1e4,watch:!1},options),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var onResponse=bind(this._handleGeolocationResponse,this),onError=bind(this._handleGeolocationError,this);return options.watch?this._locationWatchId=navigator.geolocation.watchPosition(onResponse,onError,options):navigator.geolocation.getCurrentPosition(onResponse,onError,options),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(error){if(this._container._leaflet_id){var c=error.code,message=error.message||(c===1?"permission denied":c===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:c,message:"Geolocation error: "+message+"."})}},_handleGeolocationResponse:function(pos){if(this._container._leaflet_id){var lat=pos.coords.latitude,lng=pos.coords.longitude,latlng=new LatLng(lat,lng),bounds2=latlng.toBounds(pos.coords.accuracy*2),options=this._locateOptions;if(options.setView){var zoom2=this.getBoundsZoom(bounds2);this.setView(latlng,options.maxZoom?Math.min(zoom2,options.maxZoom):zoom2)}var data={latlng,bounds:bounds2,timestamp:pos.timestamp};for(var i in pos.coords)typeof pos.coords[i]=="number"&&(data[i]=pos.coords[i]);this.fire("locationfound",data)}},addHandler:function(name,HandlerClass){if(!HandlerClass)return this;var handler=this[name]=new HandlerClass(this);return this._handlers.push(handler),this.options[name]&&handler.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),remove(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(cancelAnimFrame(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var i;for(i in this._layers)this._layers[i].remove();for(i in this._panes)remove(this._panes[i]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(name,container){var className="leaflet-pane"+(name?" leaflet-"+name.replace("Pane","")+"-pane":""),pane=create$1("div",className,container||this._mapPane);return name&&(this._panes[name]=pane),pane},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var bounds2=this.getPixelBounds(),sw=this.unproject(bounds2.getBottomLeft()),ne=this.unproject(bounds2.getTopRight());return new LatLngBounds(sw,ne)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(bounds2,inside,padding){bounds2=toLatLngBounds(bounds2),padding=toPoint(padding||[0,0]);var zoom2=this.getZoom()||0,min=this.getMinZoom(),max=this.getMaxZoom(),nw=bounds2.getNorthWest(),se=bounds2.getSouthEast(),size=this.getSize().subtract(padding),boundsSize=toBounds(this.project(se,zoom2),this.project(nw,zoom2)).getSize(),snap=Browser.any3d?this.options.zoomSnap:1,scalex=size.x/boundsSize.x,scaley=size.y/boundsSize.y,scale2=inside?Math.max(scalex,scaley):Math.min(scalex,scaley);return zoom2=this.getScaleZoom(scale2,zoom2),snap&&(zoom2=Math.round(zoom2/(snap/100))*(snap/100),zoom2=inside?Math.ceil(zoom2/snap)*snap:Math.floor(zoom2/snap)*snap),Math.max(min,Math.min(max,zoom2))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new Point(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(center,zoom2){var topLeftPoint=this._getTopLeftPoint(center,zoom2);return new Bounds(topLeftPoint,topLeftPoint.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(zoom2){return this.options.crs.getProjectedBounds(zoom2===void 0?this.getZoom():zoom2)},getPane:function(pane){return typeof pane=="string"?this._panes[pane]:pane},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(toZoom,fromZoom){var crs=this.options.crs;return fromZoom=fromZoom===void 0?this._zoom:fromZoom,crs.scale(toZoom)/crs.scale(fromZoom)},getScaleZoom:function(scale2,fromZoom){var crs=this.options.crs;fromZoom=fromZoom===void 0?this._zoom:fromZoom;var zoom2=crs.zoom(scale2*crs.scale(fromZoom));return isNaN(zoom2)?1/0:zoom2},project:function(latlng,zoom2){return zoom2=zoom2===void 0?this._zoom:zoom2,this.options.crs.latLngToPoint(toLatLng(latlng),zoom2)},unproject:function(point,zoom2){return zoom2=zoom2===void 0?this._zoom:zoom2,this.options.crs.pointToLatLng(toPoint(point),zoom2)},layerPointToLatLng:function(point){var projectedPoint=toPoint(point).add(this.getPixelOrigin());return this.unproject(projectedPoint)},latLngToLayerPoint:function(latlng){var projectedPoint=this.project(toLatLng(latlng))._round();return projectedPoint._subtract(this.getPixelOrigin())},wrapLatLng:function(latlng){return this.options.crs.wrapLatLng(toLatLng(latlng))},wrapLatLngBounds:function(latlng){return this.options.crs.wrapLatLngBounds(toLatLngBounds(latlng))},distance:function(latlng1,latlng2){return this.options.crs.distance(toLatLng(latlng1),toLatLng(latlng2))},containerPointToLayerPoint:function(point){return toPoint(point).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(point){return toPoint(point).add(this._getMapPanePos())},containerPointToLatLng:function(point){var layerPoint=this.containerPointToLayerPoint(toPoint(point));return this.layerPointToLatLng(layerPoint)},latLngToContainerPoint:function(latlng){return this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(latlng)))},mouseEventToContainerPoint:function(e){return getMousePosition(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(id){var container=this._container=get(id);if(container){if(container._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");on(container,"scroll",this._onScroll,this),this._containerId=stamp(container)},_initLayout:function(){var container=this._container;this._fadeAnimated=this.options.fadeAnimation&&Browser.any3d,addClass(container,"leaflet-container"+(Browser.touch?" leaflet-touch":"")+(Browser.retina?" leaflet-retina":"")+(Browser.ielt9?" leaflet-oldie":"")+(Browser.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var position=getStyle(container,"position");position!=="absolute"&&position!=="relative"&&position!=="fixed"&&position!=="sticky"&&(container.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var panes=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),setPosition(this._mapPane,new Point(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(addClass(panes.markerPane,"leaflet-zoom-hide"),addClass(panes.shadowPane,"leaflet-zoom-hide"))},_resetView:function(center,zoom2,noMoveStart){setPosition(this._mapPane,new Point(0,0));var loading=!this._loaded;this._loaded=!0,zoom2=this._limitZoom(zoom2),this.fire("viewprereset");var zoomChanged=this._zoom!==zoom2;this._moveStart(zoomChanged,noMoveStart)._move(center,zoom2)._moveEnd(zoomChanged),this.fire("viewreset"),loading&&this.fire("load")},_moveStart:function(zoomChanged,noMoveStart){return zoomChanged&&this.fire("zoomstart"),noMoveStart||this.fire("movestart"),this},_move:function(center,zoom2,data,supressEvent){zoom2===void 0&&(zoom2=this._zoom);var zoomChanged=this._zoom!==zoom2;return this._zoom=zoom2,this._lastCenter=center,this._pixelOrigin=this._getNewPixelOrigin(center),supressEvent?data&&data.pinch&&this.fire("zoom",data):((zoomChanged||data&&data.pinch)&&this.fire("zoom",data),this.fire("move",data)),this},_moveEnd:function(zoomChanged){return zoomChanged&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return cancelAnimFrame(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(offset){setPosition(this._mapPane,this._getMapPanePos().subtract(offset))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(remove2){this._targets={},this._targets[stamp(this._container)]=this;var onOff=remove2?off:on;onOff(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&onOff(window,"resize",this._onResize,this),Browser.any3d&&this.options.transform3DLimit&&(remove2?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){cancelAnimFrame(this._resizeRequest),this._resizeRequest=requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var pos=this._getMapPanePos();Math.max(Math.abs(pos.x),Math.abs(pos.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,type2){for(var targets=[],target,isHover=type2==="mouseout"||type2==="mouseover",src=e.target||e.srcElement,dragging=!1;src;){if(target=this._targets[stamp(src)],target&&(type2==="click"||type2==="preclick")&&this._draggableMoved(target)){dragging=!0;break}if(target&&target.listens(type2,!0)&&(isHover&&!isExternalTarget(src,e)||(targets.push(target),isHover))||src===this._container)break;src=src.parentNode}return!targets.length&&!dragging&&!isHover&&this.listens(type2,!0)&&(targets=[this]),targets},_isClickDisabled:function(el){for(;el&&el!==this._container;){if(el._leaflet_disable_click)return!0;el=el.parentNode}},_handleDOMEvent:function(e){var el=e.target||e.srcElement;if(!(!this._loaded||el._leaflet_disable_events||e.type==="click"&&this._isClickDisabled(el))){var type2=e.type;type2==="mousedown"&&preventOutline(el),this._fireDOMEvent(e,type2)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,type2,canvasTargets){if(e.type==="click"){var synth=extend({},e);synth.type="preclick",this._fireDOMEvent(synth,synth.type,canvasTargets)}var targets=this._findEventTargets(e,type2);if(canvasTargets){for(var filtered=[],i=0;i<canvasTargets.length;i++)canvasTargets[i].listens(type2,!0)&&filtered.push(canvasTargets[i]);targets=filtered.concat(targets)}if(targets.length){type2==="contextmenu"&&preventDefault(e);var target=targets[0],data={originalEvent:e};if(e.type!=="keypress"&&e.type!=="keydown"&&e.type!=="keyup"){var isMarker=target.getLatLng&&(!target._radius||target._radius<=10);data.containerPoint=isMarker?this.latLngToContainerPoint(target.getLatLng()):this.mouseEventToContainerPoint(e),data.layerPoint=this.containerPointToLayerPoint(data.containerPoint),data.latlng=isMarker?target.getLatLng():this.layerPointToLatLng(data.layerPoint)}for(i=0;i<targets.length;i++)if(targets[i].fire(type2,data,!0),data.originalEvent._stopped||targets[i].options.bubblingMouseEvents===!1&&indexOf(this._mouseEvents,type2)!==-1)return}},_draggableMoved:function(obj){return obj=obj.dragging&&obj.dragging.enabled()?obj:this,obj.dragging&&obj.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var i=0,len=this._handlers.length;i<len;i++)this._handlers[i].disable()},whenReady:function(callback,context){return this._loaded?callback.call(context||this,{target:this}):this.on("load",callback,context),this},_getMapPanePos:function(){return getPosition(this._mapPane)||new Point(0,0)},_moved:function(){var pos=this._getMapPanePos();return pos&&!pos.equals([0,0])},_getTopLeftPoint:function(center,zoom2){var pixelOrigin=center&&zoom2!==void 0?this._getNewPixelOrigin(center,zoom2):this.getPixelOrigin();return pixelOrigin.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(center,zoom2){var viewHalf=this.getSize()._divideBy(2);return this.project(center,zoom2)._subtract(viewHalf)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(latlng,zoom2,center){var topLeft=this._getNewPixelOrigin(center,zoom2);return this.project(latlng,zoom2)._subtract(topLeft)},_latLngBoundsToNewLayerBounds:function(latLngBounds,zoom2,center){var topLeft=this._getNewPixelOrigin(center,zoom2);return toBounds([this.project(latLngBounds.getSouthWest(),zoom2)._subtract(topLeft),this.project(latLngBounds.getNorthWest(),zoom2)._subtract(topLeft),this.project(latLngBounds.getSouthEast(),zoom2)._subtract(topLeft),this.project(latLngBounds.getNorthEast(),zoom2)._subtract(topLeft)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(latlng){return this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint())},_limitCenter:function(center,zoom2,bounds2){if(!bounds2)return center;var centerPoint=this.project(center,zoom2),viewHalf=this.getSize().divideBy(2),viewBounds=new Bounds(centerPoint.subtract(viewHalf),centerPoint.add(viewHalf)),offset=this._getBoundsOffset(viewBounds,bounds2,zoom2);return Math.abs(offset.x)<=1&&Math.abs(offset.y)<=1?center:this.unproject(centerPoint.add(offset),zoom2)},_limitOffset:function(offset,bounds2){if(!bounds2)return offset;var viewBounds=this.getPixelBounds(),newBounds=new Bounds(viewBounds.min.add(offset),viewBounds.max.add(offset));return offset.add(this._getBoundsOffset(newBounds,bounds2))},_getBoundsOffset:function(pxBounds,maxBounds,zoom2){var projectedMaxBounds=toBounds(this.project(maxBounds.getNorthEast(),zoom2),this.project(maxBounds.getSouthWest(),zoom2)),minOffset=projectedMaxBounds.min.subtract(pxBounds.min),maxOffset=projectedMaxBounds.max.subtract(pxBounds.max),dx=this._rebound(minOffset.x,-maxOffset.x),dy=this._rebound(minOffset.y,-maxOffset.y);return new Point(dx,dy)},_rebound:function(left,right){return left+right>0?Math.round(left-right)/2:Math.max(0,Math.ceil(left))-Math.max(0,Math.floor(right))},_limitZoom:function(zoom2){var min=this.getMinZoom(),max=this.getMaxZoom(),snap=Browser.any3d?this.options.zoomSnap:1;return snap&&(zoom2=Math.round(zoom2/snap)*snap),Math.max(min,Math.min(max,zoom2))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(center,options){var offset=this._getCenterOffset(center)._trunc();return(options&&options.animate)!==!0&&!this.getSize().contains(offset)?!1:(this.panBy(offset,options),!0)},_createAnimProxy:function(){var proxy=this._proxy=create$1("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(proxy),this.on("zoomanim",function(e){var prop=TRANSFORM,transform2=this._proxy.style[prop];setTransform(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),transform2===this._proxy.style[prop]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){remove(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var c=this.getCenter(),z=this.getZoom();setTransform(this._proxy,this.project(c,z),this.getZoomScale(z,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(center,zoom2,options){if(this._animatingZoom)return!0;if(options=options||{},!this._zoomAnimated||options.animate===!1||this._nothingToAnimate()||Math.abs(zoom2-this._zoom)>this.options.zoomAnimationThreshold)return!1;var scale2=this.getZoomScale(zoom2),offset=this._getCenterOffset(center)._divideBy(1-1/scale2);return options.animate!==!0&&!this.getSize().contains(offset)?!1:(requestAnimFrame(function(){this._moveStart(!0,options.noMoveStart||!1)._animateZoom(center,zoom2,!0)},this),!0)},_animateZoom:function(center,zoom2,startAnim,noUpdate){this._mapPane&&(startAnim&&(this._animatingZoom=!0,this._animateToCenter=center,this._animateToZoom=zoom2,addClass(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center,zoom:zoom2,noUpdate}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(bind(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&removeClass(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function createMap(id,options){return new Map2(id,options)}var Control=Class.extend({options:{position:"topright"},initialize:function(options){setOptions(this,options)},getPosition:function(){return this.options.position},setPosition:function(position){var map=this._map;return map&&map.removeControl(this),this.options.position=position,map&&map.addControl(this),this},getContainer:function(){return this._container},addTo:function(map){this.remove(),this._map=map;var container=this._container=this.onAdd(map),pos=this.getPosition(),corner=map._controlCorners[pos];return addClass(container,"leaflet-control"),pos.indexOf("bottom")!==-1?corner.insertBefore(container,corner.firstChild):corner.appendChild(container),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(remove(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),control=function(options){return new Control(options)};Map2.include({addControl:function(control2){return control2.addTo(this),this},removeControl:function(control2){return control2.remove(),this},_initControlPos:function(){var corners=this._controlCorners={},l="leaflet-",container=this._controlContainer=create$1("div",l+"control-container",this._container);function createCorner(vSide,hSide){var className=l+vSide+" "+l+hSide;corners[vSide+hSide]=create$1("div",className,container)}createCorner("top","left"),createCorner("top","right"),createCorner("bottom","left"),createCorner("bottom","right")},_clearControlPos:function(){for(var i in this._controlCorners)remove(this._controlCorners[i]);remove(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Layers=Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(layerA,layerB,nameA,nameB){return nameA<nameB?-1:nameB<nameA?1:0}},initialize:function(baseLayers,overlays,options){setOptions(this,options),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var i in baseLayers)this._addLayer(baseLayers[i],i);for(i in overlays)this._addLayer(overlays[i],i,!0)},onAdd:function(map){this._initLayout(),this._update(),this._map=map,map.on("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)this._layers[i].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(map){return Control.prototype.addTo.call(this,map),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)this._layers[i].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(layer,name){return this._addLayer(layer,name),this._map?this._update():this},addOverlay:function(layer,name){return this._addLayer(layer,name,!0),this._map?this._update():this},removeLayer:function(layer){layer.off("add remove",this._onLayerChange,this);var obj=this._getLayer(stamp(layer));return obj&&this._layers.splice(this._layers.indexOf(obj),1),this._map?this._update():this},expand:function(){addClass(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var acceptableHeight=this._map.getSize().y-(this._container.offsetTop+50);return acceptableHeight<this._section.clientHeight?(addClass(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=acceptableHeight+"px"):removeClass(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return removeClass(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var className="leaflet-control-layers",container=this._container=create$1("div",className),collapsed=this.options.collapsed;container.setAttribute("aria-haspopup",!0),disableClickPropagation(container),disableScrollPropagation(container);var section=this._section=create$1("section",className+"-list");collapsed&&(this._map.on("click",this.collapse,this),on(container,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var link2=this._layersLink=create$1("a",className+"-toggle",container);link2.href="#",link2.title="Layers",link2.setAttribute("role","button"),on(link2,{keydown:function(e){e.keyCode===13&&this._expandSafely()},click:function(e){preventDefault(e),this._expandSafely()}},this),collapsed||this.expand(),this._baseLayersList=create$1("div",className+"-base",section),this._separator=create$1("div",className+"-separator",section),this._overlaysList=create$1("div",className+"-overlays",section),container.appendChild(section)},_getLayer:function(id){for(var i=0;i<this._layers.length;i++)if(this._layers[i]&&stamp(this._layers[i].layer)===id)return this._layers[i]},_addLayer:function(layer,name,overlay){this._map&&layer.on("add remove",this._onLayerChange,this),this._layers.push({layer,name,overlay}),this.options.sortLayers&&this._layers.sort(bind(function(a,b){return this.options.sortFunction(a.layer,b.layer,a.name,b.name)},this)),this.options.autoZIndex&&layer.setZIndex&&(this._lastZIndex++,layer.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;empty(this._baseLayersList),empty(this._overlaysList),this._layerControlInputs=[];var baseLayersPresent,overlaysPresent,i,obj,baseLayersCount=0;for(i=0;i<this._layers.length;i++)obj=this._layers[i],this._addItem(obj),overlaysPresent=overlaysPresent||obj.overlay,baseLayersPresent=baseLayersPresent||!obj.overlay,baseLayersCount+=obj.overlay?0:1;return this.options.hideSingleBase&&(baseLayersPresent=baseLayersPresent&&baseLayersCount>1,this._baseLayersList.style.display=baseLayersPresent?"":"none"),this._separator.style.display=overlaysPresent&&baseLayersPresent?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var obj=this._getLayer(stamp(e.target)),type2=obj.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;type2&&this._map.fire(type2,obj)},_createRadioElement:function(name,checked){var radioHtml='<input type="radio" class="leaflet-control-layers-selector" name="'+name+'"'+(checked?' checked="checked"':"")+"/>",radioFragment=document.createElement("div");return radioFragment.innerHTML=radioHtml,radioFragment.firstChild},_addItem:function(obj){var label=document.createElement("label"),checked=this._map.hasLayer(obj.layer),input;obj.overlay?(input=document.createElement("input"),input.type="checkbox",input.className="leaflet-control-layers-selector",input.defaultChecked=checked):input=this._createRadioElement("leaflet-base-layers_"+stamp(this),checked),this._layerControlInputs.push(input),input.layerId=stamp(obj.layer),on(input,"click",this._onInputClick,this);var name=document.createElement("span");name.innerHTML=" "+obj.name;var holder=document.createElement("span");label.appendChild(holder),holder.appendChild(input),holder.appendChild(name);var container=obj.overlay?this._overlaysList:this._baseLayersList;return container.appendChild(label),this._checkDisabledLayers(),label},_onInputClick:function(){if(!this._preventClick){var inputs=this._layerControlInputs,input,layer,addedLayers=[],removedLayers=[];this._handlingClick=!0;for(var i=inputs.length-1;i>=0;i--)input=inputs[i],layer=this._getLayer(input.layerId).layer,input.checked?addedLayers.push(layer):input.checked||removedLayers.push(layer);for(i=0;i<removedLayers.length;i++)this._map.hasLayer(removedLayers[i])&&this._map.removeLayer(removedLayers[i]);for(i=0;i<addedLayers.length;i++)this._map.hasLayer(addedLayers[i])||this._map.addLayer(addedLayers[i]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var inputs=this._layerControlInputs,input,layer,zoom2=this._map.getZoom(),i=inputs.length-1;i>=0;i--)input=inputs[i],layer=this._getLayer(input.layerId).layer,input.disabled=layer.options.minZoom!==void 0&&zoom2<layer.options.minZoom||layer.options.maxZoom!==void 0&&zoom2>layer.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var section=this._section;this._preventClick=!0,on(section,"click",preventDefault),this.expand();var that=this;setTimeout(function(){off(section,"click",preventDefault),that._preventClick=!1})}}),layers=function(baseLayers,overlays,options){return new Layers(baseLayers,overlays,options)},Zoom=Control.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(map){var zoomName="leaflet-control-zoom",container=create$1("div",zoomName+" leaflet-bar"),options=this.options;return this._zoomInButton=this._createButton(options.zoomInText,options.zoomInTitle,zoomName+"-in",container,this._zoomIn),this._zoomOutButton=this._createButton(options.zoomOutText,options.zoomOutTitle,zoomName+"-out",container,this._zoomOut),this._updateDisabled(),map.on("zoomend zoomlevelschange",this._updateDisabled,this),container},onRemove:function(map){map.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(e){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(e.shiftKey?3:1))},_zoomOut:function(e){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(html,title,className,container,fn){var link2=create$1("a",className,container);return link2.innerHTML=html,link2.href="#",link2.title=title,link2.setAttribute("role","button"),link2.setAttribute("aria-label",title),disableClickPropagation(link2),on(link2,"click",stop),on(link2,"click",fn,this),on(link2,"click",this._refocusOnMap,this),link2},_updateDisabled:function(){var map=this._map,className="leaflet-disabled";removeClass(this._zoomInButton,className),removeClass(this._zoomOutButton,className),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||map._zoom===map.getMinZoom())&&(addClass(this._zoomOutButton,className),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||map._zoom===map.getMaxZoom())&&(addClass(this._zoomInButton,className),this._zoomInButton.setAttribute("aria-disabled","true"))}});Map2.mergeOptions({zoomControl:!0}),Map2.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Zoom,this.addControl(this.zoomControl))});var zoom=function(options){return new Zoom(options)},Scale=Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(map){var className="leaflet-control-scale",container=create$1("div",className),options=this.options;return this._addScales(options,className+"-line",container),map.on(options.updateWhenIdle?"moveend":"move",this._update,this),map.whenReady(this._update,this),container},onRemove:function(map){map.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(options,className,container){options.metric&&(this._mScale=create$1("div",className,container)),options.imperial&&(this._iScale=create$1("div",className,container))},_update:function(){var map=this._map,y=map.getSize().y/2,maxMeters=map.distance(map.containerPointToLatLng([0,y]),map.containerPointToLatLng([this.options.maxWidth,y]));this._updateScales(maxMeters)},_updateScales:function(maxMeters){this.options.metric&&maxMeters&&this._updateMetric(maxMeters),this.options.imperial&&maxMeters&&this._updateImperial(maxMeters)},_updateMetric:function(maxMeters){var meters=this._getRoundNum(maxMeters),label=meters<1e3?meters+" m":meters/1e3+" km";this._updateScale(this._mScale,label,meters/maxMeters)},_updateImperial:function(maxMeters){var maxFeet=maxMeters*3.2808399,maxMiles,miles,feet;maxFeet>5280?(maxMiles=maxFeet/5280,miles=this._getRoundNum(maxMiles),this._updateScale(this._iScale,miles+" mi",miles/maxMiles)):(feet=this._getRoundNum(maxFeet),this._updateScale(this._iScale,feet+" ft",feet/maxFeet))},_updateScale:function(scale2,text,ratio){scale2.style.width=Math.round(this.options.maxWidth*ratio)+"px",scale2.innerHTML=text},_getRoundNum:function(num){var pow10=Math.pow(10,(Math.floor(num)+"").length-1),d=num/pow10;return d=d>=10?10:d>=5?5:d>=3?3:d>=2?2:1,pow10*d}}),scale=function(options){return new Scale(options)},ukrainianFlag='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Attribution=Control.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Browser.inlineSvg?ukrainianFlag+" ":"")+"Leaflet</a>"},initialize:function(options){setOptions(this,options),this._attributions={}},onAdd:function(map){map.attributionControl=this,this._container=create$1("div","leaflet-control-attribution"),disableClickPropagation(this._container);for(var i in map._layers)map._layers[i].getAttribution&&this.addAttribution(map._layers[i].getAttribution());return this._update(),map.on("layeradd",this._addAttribution,this),this._container},onRemove:function(map){map.off("layeradd",this._addAttribution,this)},_addAttribution:function(ev){ev.layer.getAttribution&&(this.addAttribution(ev.layer.getAttribution()),ev.layer.once("remove",function(){this.removeAttribution(ev.layer.getAttribution())},this))},setPrefix:function(prefix){return this.options.prefix=prefix,this._update(),this},addAttribution:function(text){return text?(this._attributions[text]||(this._attributions[text]=0),this._attributions[text]++,this._update(),this):this},removeAttribution:function(text){return text?(this._attributions[text]&&(this._attributions[text]--,this._update()),this):this},_update:function(){if(this._map){var attribs=[];for(var i in this._attributions)this._attributions[i]&&attribs.push(i);var prefixAndAttribs=[];this.options.prefix&&prefixAndAttribs.push(this.options.prefix),attribs.length&&prefixAndAttribs.push(attribs.join(", ")),this._container.innerHTML=prefixAndAttribs.join(' <span aria-hidden="true">|</span> ')}}});Map2.mergeOptions({attributionControl:!0}),Map2.addInitHook(function(){this.options.attributionControl&&new Attribution().addTo(this)});var attribution=function(options){return new Attribution(options)};Control.Layers=Layers,Control.Zoom=Zoom,Control.Scale=Scale,Control.Attribution=Attribution,control.layers=layers,control.zoom=zoom,control.scale=scale,control.attribution=attribution;var Handler=Class.extend({initialize:function(map){this._map=map},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Handler.addTo=function(map,name){return map.addHandler(name,this),this};var Mixin={Events},START=Browser.touch?"touchstart mousedown":"mousedown",Draggable=Evented.extend({options:{clickTolerance:3},initialize:function(element,dragStartTarget,preventOutline2,options){setOptions(this,options),this._element=element,this._dragStartTarget=dragStartTarget||element,this._preventOutline=preventOutline2},enable:function(){this._enabled||(on(this._dragStartTarget,START,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Draggable._dragging===this&&this.finishDrag(!0),off(this._dragStartTarget,START,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!hasClass(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){Draggable._dragging===this&&this.finishDrag();return}if(!(Draggable._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Draggable._dragging=this,this._preventOutline&&preventOutline(this._element),disableImageDrag(),disableTextSelection(),!this._moving)){this.fire("down");var first=e.touches?e.touches[0]:e,sizedParent=getSizedParentNode(this._element);this._startPoint=new Point(first.clientX,first.clientY),this._startPos=getPosition(this._element),this._parentScale=getScale(sizedParent);var mouseevent=e.type==="mousedown";on(document,mouseevent?"mousemove":"touchmove",this._onMove,this),on(document,mouseevent?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var first=e.touches&&e.touches.length===1?e.touches[0]:e,offset=new Point(first.clientX,first.clientY)._subtract(this._startPoint);!offset.x&&!offset.y||Math.abs(offset.x)+Math.abs(offset.y)<this.options.clickTolerance||(offset.x/=this._parentScale.x,offset.y/=this._parentScale.y,preventDefault(e),this._moved||(this.fire("dragstart"),this._moved=!0,addClass(document.body,"leaflet-dragging"),this._lastTarget=e.target||e.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),addClass(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(offset),this._moving=!0,this._lastEvent=e,this._updatePosition())}},_updatePosition:function(){var e={originalEvent:this._lastEvent};this.fire("predrag",e),setPosition(this._element,this._newPos),this.fire("drag",e)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(noInertia){removeClass(document.body,"leaflet-dragging"),this._lastTarget&&(removeClass(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),off(document,"mousemove touchmove",this._onMove,this),off(document,"mouseup touchend touchcancel",this._onUp,this),enableImageDrag(),enableTextSelection();var fireDragend=this._moved&&this._moving;this._moving=!1,Draggable._dragging=!1,fireDragend&&this.fire("dragend",{noInertia,distance:this._newPos.distanceTo(this._startPos)})}});function clipPolygon(points,bounds2,round){var clippedPoints,edges=[1,4,2,8],i,j,k,a,b,len,edge2,p;for(i=0,len=points.length;i<len;i++)points[i]._code=_getBitCode(points[i],bounds2);for(k=0;k<4;k++){for(edge2=edges[k],clippedPoints=[],i=0,len=points.length,j=len-1;i<len;j=i++)a=points[i],b=points[j],a._code&edge2?b._code&edge2||(p=_getEdgeIntersection(b,a,edge2,bounds2,round),p._code=_getBitCode(p,bounds2),clippedPoints.push(p)):(b._code&edge2&&(p=_getEdgeIntersection(b,a,edge2,bounds2,round),p._code=_getBitCode(p,bounds2),clippedPoints.push(p)),clippedPoints.push(a));points=clippedPoints}return points}function polygonCenter(latlngs,crs){var i,j,p1,p2,f,area2,x,y,center;if(!latlngs||latlngs.length===0)throw new Error("latlngs not passed");isFlat(latlngs)||(console.warn("latlngs are not flat! Only the first ring will be used"),latlngs=latlngs[0]);var centroidLatLng=toLatLng([0,0]),bounds2=toLatLngBounds(latlngs),areaBounds=bounds2.getNorthWest().distanceTo(bounds2.getSouthWest())*bounds2.getNorthEast().distanceTo(bounds2.getNorthWest());areaBounds<1700&&(centroidLatLng=centroid2(latlngs));var len=latlngs.length,points=[];for(i=0;i<len;i++){var latlng=toLatLng(latlngs[i]);points.push(crs.project(toLatLng([latlng.lat-centroidLatLng.lat,latlng.lng-centroidLatLng.lng])))}for(area2=x=y=0,i=0,j=len-1;i<len;j=i++)p1=points[i],p2=points[j],f=p1.y*p2.x-p2.y*p1.x,x+=(p1.x+p2.x)*f,y+=(p1.y+p2.y)*f,area2+=f*3;area2===0?center=points[0]:center=[x/area2,y/area2];var latlngCenter=crs.unproject(toPoint(center));return toLatLng([latlngCenter.lat+centroidLatLng.lat,latlngCenter.lng+centroidLatLng.lng])}function centroid2(coords){for(var latSum=0,lngSum=0,len=0,i=0;i<coords.length;i++){var latlng=toLatLng(coords[i]);latSum+=latlng.lat,lngSum+=latlng.lng,len++}return toLatLng([latSum/len,lngSum/len])}var PolyUtil={__proto__:null,clipPolygon,polygonCenter,centroid:centroid2};function simplify(points,tolerance){if(!tolerance||!points.length)return points.slice();var sqTolerance=tolerance*tolerance;return points=_reducePoints(points,sqTolerance),points=_simplifyDP(points,sqTolerance),points}function pointToSegmentDistance(p,p1,p2){return Math.sqrt(_sqClosestPointOnSegment(p,p1,p2,!0))}function closestPointOnSegment(p,p1,p2){return _sqClosestPointOnSegment(p,p1,p2)}function _simplifyDP(points,sqTolerance){var len=points.length,ArrayConstructor=typeof Uint8Array<"u"?Uint8Array:Array,markers=new ArrayConstructor(len);markers[0]=markers[len-1]=1,_simplifyDPStep(points,markers,sqTolerance,0,len-1);var i,newPoints=[];for(i=0;i<len;i++)markers[i]&&newPoints.push(points[i]);return newPoints}function _simplifyDPStep(points,markers,sqTolerance,first,last){var maxSqDist=0,index3,i,sqDist;for(i=first+1;i<=last-1;i++)sqDist=_sqClosestPointOnSegment(points[i],points[first],points[last],!0),sqDist>maxSqDist&&(index3=i,maxSqDist=sqDist);maxSqDist>sqTolerance&&(markers[index3]=1,_simplifyDPStep(points,markers,sqTolerance,first,index3),_simplifyDPStep(points,markers,sqTolerance,index3,last))}function _reducePoints(points,sqTolerance){for(var reducedPoints=[points[0]],i=1,prev=0,len=points.length;i<len;i++)_sqDist(points[i],points[prev])>sqTolerance&&(reducedPoints.push(points[i]),prev=i);return prev<len-1&&reducedPoints.push(points[len-1]),reducedPoints}var _lastCode;function clipSegment(a,b,bounds2,useLastCode,round){var codeA=useLastCode?_lastCode:_getBitCode(a,bounds2),codeB=_getBitCode(b,bounds2),codeOut,p,newCode;for(_lastCode=codeB;;){if(!(codeA|codeB))return[a,b];if(codeA&codeB)return!1;codeOut=codeA||codeB,p=_getEdgeIntersection(a,b,codeOut,bounds2,round),newCode=_getBitCode(p,bounds2),codeOut===codeA?(a=p,codeA=newCode):(b=p,codeB=newCode)}}function _getEdgeIntersection(a,b,code,bounds2,round){var dx=b.x-a.x,dy=b.y-a.y,min=bounds2.min,max=bounds2.max,x,y;return code&8?(x=a.x+dx*(max.y-a.y)/dy,y=max.y):code&4?(x=a.x+dx*(min.y-a.y)/dy,y=min.y):code&2?(x=max.x,y=a.y+dy*(max.x-a.x)/dx):code&1&&(x=min.x,y=a.y+dy*(min.x-a.x)/dx),new Point(x,y,round)}function _getBitCode(p,bounds2){var code=0;return p.x<bounds2.min.x?code|=1:p.x>bounds2.max.x&&(code|=2),p.y<bounds2.min.y?code|=4:p.y>bounds2.max.y&&(code|=8),code}function _sqDist(p1,p2){var dx=p2.x-p1.x,dy=p2.y-p1.y;return dx*dx+dy*dy}function _sqClosestPointOnSegment(p,p1,p2,sqDist){var x=p1.x,y=p1.y,dx=p2.x-x,dy=p2.y-y,dot=dx*dx+dy*dy,t;return dot>0&&(t=((p.x-x)*dx+(p.y-y)*dy)/dot,t>1?(x=p2.x,y=p2.y):t>0&&(x+=dx*t,y+=dy*t)),dx=p.x-x,dy=p.y-y,sqDist?dx*dx+dy*dy:new Point(x,y)}function isFlat(latlngs){return!isArray(latlngs[0])||typeof latlngs[0][0]!="object"&&typeof latlngs[0][0]<"u"}function _flat(latlngs){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),isFlat(latlngs)}function polylineCenter(latlngs,crs){var i,halfDist,segDist,dist,p1,p2,ratio,center;if(!latlngs||latlngs.length===0)throw new Error("latlngs not passed");isFlat(latlngs)||(console.warn("latlngs are not flat! Only the first ring will be used"),latlngs=latlngs[0]);var centroidLatLng=toLatLng([0,0]),bounds2=toLatLngBounds(latlngs),areaBounds=bounds2.getNorthWest().distanceTo(bounds2.getSouthWest())*bounds2.getNorthEast().distanceTo(bounds2.getNorthWest());areaBounds<1700&&(centroidLatLng=centroid2(latlngs));var len=latlngs.length,points=[];for(i=0;i<len;i++){var latlng=toLatLng(latlngs[i]);points.push(crs.project(toLatLng([latlng.lat-centroidLatLng.lat,latlng.lng-centroidLatLng.lng])))}for(i=0,halfDist=0;i<len-1;i++)halfDist+=points[i].distanceTo(points[i+1])/2;if(halfDist===0)center=points[0];else for(i=0,dist=0;i<len-1;i++)if(p1=points[i],p2=points[i+1],segDist=p1.distanceTo(p2),dist+=segDist,dist>halfDist){ratio=(dist-halfDist)/segDist,center=[p2.x-ratio*(p2.x-p1.x),p2.y-ratio*(p2.y-p1.y)];break}var latlngCenter=crs.unproject(toPoint(center));return toLatLng([latlngCenter.lat+centroidLatLng.lat,latlngCenter.lng+centroidLatLng.lng])}var LineUtil={__proto__:null,simplify,pointToSegmentDistance,closestPointOnSegment,clipSegment,_getEdgeIntersection,_getBitCode,_sqClosestPointOnSegment,isFlat,_flat,polylineCenter},LonLat={project:function(latlng){return new Point(latlng.lng,latlng.lat)},unproject:function(point){return new LatLng(point.y,point.x)},bounds:new Bounds([-180,-90],[180,90])},Mercator={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Bounds([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(latlng){var d=Math.PI/180,r=this.R,y=latlng.lat*d,tmp=this.R_MINOR/r,e=Math.sqrt(1-tmp*tmp),con=e*Math.sin(y),ts=Math.tan(Math.PI/4-y/2)/Math.pow((1-con)/(1+con),e/2);return y=-r*Math.log(Math.max(ts,1e-10)),new Point(latlng.lng*d*r,y)},unproject:function(point){for(var d=180/Math.PI,r=this.R,tmp=this.R_MINOR/r,e=Math.sqrt(1-tmp*tmp),ts=Math.exp(-point.y/r),phi=Math.PI/2-2*Math.atan(ts),i=0,dphi=.1,con;i<15&&Math.abs(dphi)>1e-7;i++)con=e*Math.sin(phi),con=Math.pow((1-con)/(1+con),e/2),dphi=Math.PI/2-2*Math.atan(ts*con)-phi,phi+=dphi;return new LatLng(phi*d,point.x*d/r)}},index2={__proto__:null,LonLat,Mercator,SphericalMercator},EPSG3395=extend({},Earth,{code:"EPSG:3395",projection:Mercator,transformation:function(){var scale2=.5/(Math.PI*Mercator.R);return toTransformation(scale2,.5,-scale2,.5)}()}),EPSG4326=extend({},Earth,{code:"EPSG:4326",projection:LonLat,transformation:toTransformation(1/180,1,-1/180,.5)}),Simple=extend({},CRS,{projection:LonLat,transformation:toTransformation(1,0,-1,0),scale:function(zoom2){return Math.pow(2,zoom2)},zoom:function(scale2){return Math.log(scale2)/Math.LN2},distance:function(latlng1,latlng2){var dx=latlng2.lng-latlng1.lng,dy=latlng2.lat-latlng1.lat;return Math.sqrt(dx*dx+dy*dy)},infinite:!0});CRS.Earth=Earth,CRS.EPSG3395=EPSG3395,CRS.EPSG3857=EPSG3857,CRS.EPSG900913=EPSG900913,CRS.EPSG4326=EPSG4326,CRS.Simple=Simple;var Layer2=Evented.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(map){return map.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(obj){return obj&&obj.removeLayer(this),this},getPane:function(name){return this._map.getPane(name?this.options[name]||name:this.options.pane)},addInteractiveTarget:function(targetEl){return this._map._targets[stamp(targetEl)]=this,this},removeInteractiveTarget:function(targetEl){return delete this._map._targets[stamp(targetEl)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var map=e.target;if(map.hasLayer(this)){if(this._map=map,this._zoomAnimated=map._zoomAnimated,this.getEvents){var events=this.getEvents();map.on(events,this),this.once("remove",function(){map.off(events,this)},this)}this.onAdd(map),this.fire("add"),map.fire("layeradd",{layer:this})}}});Map2.include({addLayer:function(layer){if(!layer._layerAdd)throw new Error("The provided object is not a Layer.");var id=stamp(layer);return this._layers[id]?this:(this._layers[id]=layer,layer._mapToAdd=this,layer.beforeAdd&&layer.beforeAdd(this),this.whenReady(layer._layerAdd,layer),this)},removeLayer:function(layer){var id=stamp(layer);return this._layers[id]?(this._loaded&&layer.onRemove(this),delete this._layers[id],this._loaded&&(this.fire("layerremove",{layer}),layer.fire("remove")),layer._map=layer._mapToAdd=null,this):this},hasLayer:function(layer){return stamp(layer)in this._layers},eachLayer:function(method,context){for(var i in this._layers)method.call(context,this._layers[i]);return this},_addLayers:function(layers2){layers2=layers2?isArray(layers2)?layers2:[layers2]:[];for(var i=0,len=layers2.length;i<len;i++)this.addLayer(layers2[i])},_addZoomLimit:function(layer){(!isNaN(layer.options.maxZoom)||!isNaN(layer.options.minZoom))&&(this._zoomBoundLayers[stamp(layer)]=layer,this._updateZoomLevels())},_removeZoomLimit:function(layer){var id=stamp(layer);this._zoomBoundLayers[id]&&(delete this._zoomBoundLayers[id],this._updateZoomLevels())},_updateZoomLevels:function(){var minZoom=1/0,maxZoom=-1/0,oldZoomSpan=this._getZoomSpan();for(var i in this._zoomBoundLayers){var options=this._zoomBoundLayers[i].options;minZoom=options.minZoom===void 0?minZoom:Math.min(minZoom,options.minZoom),maxZoom=options.maxZoom===void 0?maxZoom:Math.max(maxZoom,options.maxZoom)}this._layersMaxZoom=maxZoom===-1/0?void 0:maxZoom,this._layersMinZoom=minZoom===1/0?void 0:minZoom,oldZoomSpan!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var LayerGroup=Layer2.extend({initialize:function(layers2,options){setOptions(this,options),this._layers={};var i,len;if(layers2)for(i=0,len=layers2.length;i<len;i++)this.addLayer(layers2[i])},addLayer:function(layer){var id=this.getLayerId(layer);return this._layers[id]=layer,this._map&&this._map.addLayer(layer),this},removeLayer:function(layer){var id=layer in this._layers?layer:this.getLayerId(layer);return this._map&&this._layers[id]&&this._map.removeLayer(this._layers[id]),delete this._layers[id],this},hasLayer:function(layer){var layerId=typeof layer=="number"?layer:this.getLayerId(layer);return layerId in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(methodName){var args=Array.prototype.slice.call(arguments,1),i,layer;for(i in this._layers)layer=this._layers[i],layer[methodName]&&layer[methodName].apply(layer,args);return this},onAdd:function(map){this.eachLayer(map.addLayer,map)},onRemove:function(map){this.eachLayer(map.removeLayer,map)},eachLayer:function(method,context){for(var i in this._layers)method.call(context,this._layers[i]);return this},getLayer:function(id){return this._layers[id]},getLayers:function(){var layers2=[];return this.eachLayer(layers2.push,layers2),layers2},setZIndex:function(zIndex){return this.invoke("setZIndex",zIndex)},getLayerId:function(layer){return stamp(layer)}}),layerGroup=function(layers2,options){return new LayerGroup(layers2,options)},FeatureGroup=LayerGroup.extend({addLayer:function(layer){return this.hasLayer(layer)?this:(layer.addEventParent(this),LayerGroup.prototype.addLayer.call(this,layer),this.fire("layeradd",{layer}))},removeLayer:function(layer){return this.hasLayer(layer)?(layer in this._layers&&(layer=this._layers[layer]),layer.removeEventParent(this),LayerGroup.prototype.removeLayer.call(this,layer),this.fire("layerremove",{layer})):this},setStyle:function(style2){return this.invoke("setStyle",style2)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var bounds2=new LatLngBounds;for(var id in this._layers){var layer=this._layers[id];bounds2.extend(layer.getBounds?layer.getBounds():layer.getLatLng())}return bounds2}}),featureGroup=function(layers2,options){return new FeatureGroup(layers2,options)},Icon=Class.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(options){setOptions(this,options)},createIcon:function(oldIcon){return this._createIcon("icon",oldIcon)},createShadow:function(oldIcon){return this._createIcon("shadow",oldIcon)},_createIcon:function(name,oldIcon){var src=this._getIconUrl(name);if(!src){if(name==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var img=this._createImg(src,oldIcon&&oldIcon.tagName==="IMG"?oldIcon:null);return this._setIconStyles(img,name),(this.options.crossOrigin||this.options.crossOrigin==="")&&(img.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),img},_setIconStyles:function(img,name){var options=this.options,sizeOption=options[name+"Size"];typeof sizeOption=="number"&&(sizeOption=[sizeOption,sizeOption]);var size=toPoint(sizeOption),anchor=toPoint(name==="shadow"&&options.shadowAnchor||options.iconAnchor||size&&size.divideBy(2,!0));img.className="leaflet-marker-"+name+" "+(options.className||""),anchor&&(img.style.marginLeft=-anchor.x+"px",img.style.marginTop=-anchor.y+"px"),size&&(img.style.width=size.x+"px",img.style.height=size.y+"px")},_createImg:function(src,el){return el=el||document.createElement("img"),el.src=src,el},_getIconUrl:function(name){return Browser.retina&&this.options[name+"RetinaUrl"]||this.options[name+"Url"]}});function icon(options){return new Icon(options)}var IconDefault=Icon.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(name){return typeof IconDefault.imagePath!="string"&&(IconDefault.imagePath=this._detectIconPath()),(this.options.imagePath||IconDefault.imagePath)+Icon.prototype._getIconUrl.call(this,name)},_stripUrl:function(path){var strip=function(str,re,idx){var match=re.exec(str);return match&&match[idx]};return path=strip(path,/^url\((['"])?(.+)\1\)$/,2),path&&strip(path,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var el=create$1("div","leaflet-default-icon-path",document.body),path=getStyle(el,"background-image")||getStyle(el,"backgroundImage");if(document.body.removeChild(el),path=this._stripUrl(path),path)return path;var link2=document.querySelector('link[href$="leaflet.css"]');return link2?link2.href.substring(0,link2.href.length-11-1):""}}),MarkerDrag=Handler.extend({initialize:function(marker2){this._marker=marker2},addHooks:function(){var icon2=this._marker._icon;this._draggable||(this._draggable=new Draggable(icon2,icon2,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),addClass(icon2,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(e){var marker2=this._marker,map=marker2._map,speed=this._marker.options.autoPanSpeed,padding=this._marker.options.autoPanPadding,iconPos=getPosition(marker2._icon),bounds2=map.getPixelBounds(),origin=map.getPixelOrigin(),panBounds=toBounds(bounds2.min._subtract(origin).add(padding),bounds2.max._subtract(origin).subtract(padding));if(!panBounds.contains(iconPos)){var movement=toPoint((Math.max(panBounds.max.x,iconPos.x)-panBounds.max.x)/(bounds2.max.x-panBounds.max.x)-(Math.min(panBounds.min.x,iconPos.x)-panBounds.min.x)/(bounds2.min.x-panBounds.min.x),(Math.max(panBounds.max.y,iconPos.y)-panBounds.max.y)/(bounds2.max.y-panBounds.max.y)-(Math.min(panBounds.min.y,iconPos.y)-panBounds.min.y)/(bounds2.min.y-panBounds.min.y)).multiplyBy(speed);map.panBy(movement,{animate:!1}),this._draggable._newPos._add(movement),this._draggable._startPos._add(movement),setPosition(marker2._icon,this._draggable._newPos),this._onDrag(e),this._panRequest=requestAnimFrame(this._adjustPan.bind(this,e))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(e){this._marker.options.autoPan&&(cancelAnimFrame(this._panRequest),this._panRequest=requestAnimFrame(this._adjustPan.bind(this,e)))},_onDrag:function(e){var marker2=this._marker,shadow=marker2._shadow,iconPos=getPosition(marker2._icon),latlng=marker2._map.layerPointToLatLng(iconPos);shadow&&setPosition(shadow,iconPos),marker2._latlng=latlng,e.latlng=latlng,e.oldLatLng=this._oldLatLng,marker2.fire("move",e).fire("drag",e)},_onDragEnd:function(e){cancelAnimFrame(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",e)}}),Marker=Layer2.extend({options:{icon:new IconDefault,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(latlng,options){setOptions(this,options),this._latlng=toLatLng(latlng)},onAdd:function(map){this._zoomAnimated=this._zoomAnimated&&map.options.markerZoomAnimation,this._zoomAnimated&&map.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(map){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&map.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(latlng){var oldLatLng=this._latlng;return this._latlng=toLatLng(latlng),this.update(),this.fire("move",{oldLatLng,latlng:this._latlng})},setZIndexOffset:function(offset){return this.options.zIndexOffset=offset,this.update()},getIcon:function(){return this.options.icon},setIcon:function(icon2){return this.options.icon=icon2,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var pos=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(pos)}return this},_initIcon:function(){var options=this.options,classToAdd="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),icon2=options.icon.createIcon(this._icon),addIcon=!1;icon2!==this._icon&&(this._icon&&this._removeIcon(),addIcon=!0,options.title&&(icon2.title=options.title),icon2.tagName==="IMG"&&(icon2.alt=options.alt||"")),addClass(icon2,classToAdd),options.keyboard&&(icon2.tabIndex="0",icon2.setAttribute("role","button")),this._icon=icon2,options.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&on(icon2,"focus",this._panOnFocus,this);var newShadow=options.icon.createShadow(this._shadow),addShadow=!1;newShadow!==this._shadow&&(this._removeShadow(),addShadow=!0),newShadow&&(addClass(newShadow,classToAdd),newShadow.alt=""),this._shadow=newShadow,options.opacity<1&&this._updateOpacity(),addIcon&&this.getPane().appendChild(this._icon),this._initInteraction(),newShadow&&addShadow&&this.getPane(options.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&off(this._icon,"focus",this._panOnFocus,this),remove(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&remove(this._shadow),this._shadow=null},_setPos:function(pos){this._icon&&setPosition(this._icon,pos),this._shadow&&setPosition(this._shadow,pos),this._zIndex=pos.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(offset){this._icon&&(this._icon.style.zIndex=this._zIndex+offset)},_animateZoom:function(opt){var pos=this._map._latLngToNewLayerPoint(this._latlng,opt.zoom,opt.center).round();this._setPos(pos)},_initInteraction:function(){if(this.options.interactive&&(addClass(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),MarkerDrag)){var draggable=this.options.draggable;this.dragging&&(draggable=this.dragging.enabled(),this.dragging.disable()),this.dragging=new MarkerDrag(this),draggable&&this.dragging.enable()}},setOpacity:function(opacity){return this.options.opacity=opacity,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var opacity=this.options.opacity;this._icon&&setOpacity(this._icon,opacity),this._shadow&&setOpacity(this._shadow,opacity)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var map=this._map;if(map){var iconOpts=this.options.icon.options,size=iconOpts.iconSize?toPoint(iconOpts.iconSize):toPoint(0,0),anchor=iconOpts.iconAnchor?toPoint(iconOpts.iconAnchor):toPoint(0,0);map.panInside(this._latlng,{paddingTopLeft:anchor,paddingBottomRight:size.subtract(anchor)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function marker(latlng,options){return new Marker(latlng,options)}var Path2=Layer2.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(map){this._renderer=map.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(style2){return setOptions(this,style2),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&style2&&Object.prototype.hasOwnProperty.call(style2,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),CircleMarker=Path2.extend({options:{fill:!0,radius:10},initialize:function(latlng,options){setOptions(this,options),this._latlng=toLatLng(latlng),this._radius=this.options.radius},setLatLng:function(latlng){var oldLatLng=this._latlng;return this._latlng=toLatLng(latlng),this.redraw(),this.fire("move",{oldLatLng,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(radius2){return this.options.radius=this._radius=radius2,this.redraw()},getRadius:function(){return this._radius},setStyle:function(options){var radius2=options&&options.radius||this._radius;return Path2.prototype.setStyle.call(this,options),this.setRadius(radius2),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var r=this._radius,r2=this._radiusY||r,w=this._clickTolerance(),p=[r+w,r2+w];this._pxBounds=new Bounds(this._point.subtract(p),this._point.add(p))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(p){return p.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function circleMarker(latlng,options){return new CircleMarker(latlng,options)}var Circle=CircleMarker.extend({initialize:function(latlng,options,legacyOptions){if(typeof options=="number"&&(options=extend({},legacyOptions,{radius:options})),setOptions(this,options),this._latlng=toLatLng(latlng),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(radius2){return this._mRadius=radius2,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var half=[this._radius,this._radiusY||this._radius];return new LatLngBounds(this._map.layerPointToLatLng(this._point.subtract(half)),this._map.layerPointToLatLng(this._point.add(half)))},setStyle:Path2.prototype.setStyle,_project:function(){var lng=this._latlng.lng,lat=this._latlng.lat,map=this._map,crs=map.options.crs;if(crs.distance===Earth.distance){var d=Math.PI/180,latR=this._mRadius/Earth.R/d,top=map.project([lat+latR,lng]),bottom=map.project([lat-latR,lng]),p=top.add(bottom).divideBy(2),lat2=map.unproject(p).lat,lngR=Math.acos((Math.cos(latR*d)-Math.sin(lat*d)*Math.sin(lat2*d))/(Math.cos(lat*d)*Math.cos(lat2*d)))/d;(isNaN(lngR)||lngR===0)&&(lngR=latR/Math.cos(Math.PI/180*lat)),this._point=p.subtract(map.getPixelOrigin()),this._radius=isNaN(lngR)?0:p.x-map.project([lat2,lng-lngR]).x,this._radiusY=p.y-top.y}else{var latlng2=crs.unproject(crs.project(this._latlng).subtract([this._mRadius,0]));this._point=map.latLngToLayerPoint(this._latlng),this._radius=this._point.x-map.latLngToLayerPoint(latlng2).x}this._updateBounds()}});function circle2(latlng,options,legacyOptions){return new Circle(latlng,options,legacyOptions)}var Polyline=Path2.extend({options:{smoothFactor:1,noClip:!1},initialize:function(latlngs,options){setOptions(this,options),this._setLatLngs(latlngs)},getLatLngs:function(){return this._latlngs},setLatLngs:function(latlngs){return this._setLatLngs(latlngs),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(p){for(var minDistance=1/0,minPoint=null,closest=_sqClosestPointOnSegment,p1,p2,j=0,jLen=this._parts.length;j<jLen;j++)for(var points=this._parts[j],i=1,len=points.length;i<len;i++){p1=points[i-1],p2=points[i];var sqDist=closest(p,p1,p2,!0);sqDist<minDistance&&(minDistance=sqDist,minPoint=closest(p,p1,p2))}return minPoint&&(minPoint.distance=Math.sqrt(minDistance)),minPoint},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return polylineCenter(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(latlng,latlngs){return latlngs=latlngs||this._defaultShape(),latlng=toLatLng(latlng),latlngs.push(latlng),this._bounds.extend(latlng),this.redraw()},_setLatLngs:function(latlngs){this._bounds=new LatLngBounds,this._latlngs=this._convertLatLngs(latlngs)},_defaultShape:function(){return isFlat(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(latlngs){for(var result=[],flat=isFlat(latlngs),i=0,len=latlngs.length;i<len;i++)flat?(result[i]=toLatLng(latlngs[i]),this._bounds.extend(result[i])):result[i]=this._convertLatLngs(latlngs[i]);return result},_project:function(){var pxBounds=new Bounds;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,pxBounds),this._bounds.isValid()&&pxBounds.isValid()&&(this._rawPxBounds=pxBounds,this._updateBounds())},_updateBounds:function(){var w=this._clickTolerance(),p=new Point(w,w);this._rawPxBounds&&(this._pxBounds=new Bounds([this._rawPxBounds.min.subtract(p),this._rawPxBounds.max.add(p)]))},_projectLatlngs:function(latlngs,result,projectedBounds){var flat=latlngs[0]instanceof LatLng,len=latlngs.length,i,ring;if(flat){for(ring=[],i=0;i<len;i++)ring[i]=this._map.latLngToLayerPoint(latlngs[i]),projectedBounds.extend(ring[i]);result.push(ring)}else for(i=0;i<len;i++)this._projectLatlngs(latlngs[i],result,projectedBounds)},_clipPoints:function(){var bounds2=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(bounds2))){if(this.options.noClip){this._parts=this._rings;return}var parts=this._parts,i,j,k,len,len2,segment,points;for(i=0,k=0,len=this._rings.length;i<len;i++)for(points=this._rings[i],j=0,len2=points.length;j<len2-1;j++)segment=clipSegment(points[j],points[j+1],bounds2,j,!0),segment&&(parts[k]=parts[k]||[],parts[k].push(segment[0]),(segment[1]!==points[j+1]||j===len2-2)&&(parts[k].push(segment[1]),k++))}},_simplifyPoints:function(){for(var parts=this._parts,tolerance=this.options.smoothFactor,i=0,len=parts.length;i<len;i++)parts[i]=simplify(parts[i],tolerance)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(p,closed){var i,j,k,len,len2,part,w=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(p))return!1;for(i=0,len=this._parts.length;i<len;i++)for(part=this._parts[i],j=0,len2=part.length,k=len2-1;j<len2;k=j++)if(!(!closed&&j===0)&&pointToSegmentDistance(p,part[k],part[j])<=w)return!0;return!1}});function polyline(latlngs,options){return new Polyline(latlngs,options)}Polyline._flat=_flat;var Polygon=Polyline.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return polygonCenter(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(latlngs){var result=Polyline.prototype._convertLatLngs.call(this,latlngs),len=result.length;return len>=2&&result[0]instanceof LatLng&&result[0].equals(result[len-1])&&result.pop(),result},_setLatLngs:function(latlngs){Polyline.prototype._setLatLngs.call(this,latlngs),isFlat(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return isFlat(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var bounds2=this._renderer._bounds,w=this.options.weight,p=new Point(w,w);if(bounds2=new Bounds(bounds2.min.subtract(p),bounds2.max.add(p)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(bounds2))){if(this.options.noClip){this._parts=this._rings;return}for(var i=0,len=this._rings.length,clipped;i<len;i++)clipped=clipPolygon(this._rings[i],bounds2,!0),clipped.length&&this._parts.push(clipped)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(p){var inside=!1,part,p1,p2,i,j,k,len,len2;if(!this._pxBounds||!this._pxBounds.contains(p))return!1;for(i=0,len=this._parts.length;i<len;i++)for(part=this._parts[i],j=0,len2=part.length,k=len2-1;j<len2;k=j++)p1=part[j],p2=part[k],p1.y>p.y!=p2.y>p.y&&p.x<(p2.x-p1.x)*(p.y-p1.y)/(p2.y-p1.y)+p1.x&&(inside=!inside);return inside||Polyline.prototype._containsPoint.call(this,p,!0)}});function polygon(latlngs,options){return new Polygon(latlngs,options)}var GeoJSON=FeatureGroup.extend({initialize:function(geojson,options){setOptions(this,options),this._layers={},geojson&&this.addData(geojson)},addData:function(geojson){var features2=isArray(geojson)?geojson:geojson.features,i,len,feature2;if(features2){for(i=0,len=features2.length;i<len;i++)feature2=features2[i],(feature2.geometries||feature2.geometry||feature2.features||feature2.coordinates)&&this.addData(feature2);return this}var options=this.options;if(options.filter&&!options.filter(geojson))return this;var layer=geometryToLayer(geojson,options);return layer?(layer.feature=asFeature(geojson),layer.defaultOptions=layer.options,this.resetStyle(layer),options.onEachFeature&&options.onEachFeature(geojson,layer),this.addLayer(layer)):this},resetStyle:function(layer){return layer===void 0?this.eachLayer(this.resetStyle,this):(layer.options=extend({},layer.defaultOptions),this._setLayerStyle(layer,this.options.style),this)},setStyle:function(style2){return this.eachLayer(function(layer){this._setLayerStyle(layer,style2)},this)},_setLayerStyle:function(layer,style2){layer.setStyle&&(typeof style2=="function"&&(style2=style2(layer.feature)),layer.setStyle(style2))}});function geometryToLayer(geojson,options){var geometry=geojson.type==="Feature"?geojson.geometry:geojson,coords=geometry?geometry.coordinates:null,layers2=[],pointToLayer=options&&options.pointToLayer,_coordsToLatLng=options&&options.coordsToLatLng||coordsToLatLng,latlng,latlngs,i,len;if(!coords&&!geometry)return null;switch(geometry.type){case"Point":return latlng=_coordsToLatLng(coords),_pointToLayer(pointToLayer,geojson,latlng,options);case"MultiPoint":for(i=0,len=coords.length;i<len;i++)latlng=_coordsToLatLng(coords[i]),layers2.push(_pointToLayer(pointToLayer,geojson,latlng,options));return new FeatureGroup(layers2);case"LineString":case"MultiLineString":return latlngs=coordsToLatLngs(coords,geometry.type==="LineString"?0:1,_coordsToLatLng),new Polyline(latlngs,options);case"Polygon":case"MultiPolygon":return latlngs=coordsToLatLngs(coords,geometry.type==="Polygon"?1:2,_coordsToLatLng),new Polygon(latlngs,options);case"GeometryCollection":for(i=0,len=geometry.geometries.length;i<len;i++){var geoLayer=geometryToLayer({geometry:geometry.geometries[i],type:"Feature",properties:geojson.properties},options);geoLayer&&layers2.push(geoLayer)}return new FeatureGroup(layers2);case"FeatureCollection":for(i=0,len=geometry.features.length;i<len;i++){var featureLayer=geometryToLayer(geometry.features[i],options);featureLayer&&layers2.push(featureLayer)}return new FeatureGroup(layers2);default:throw new Error("Invalid GeoJSON object.")}}function _pointToLayer(pointToLayerFn,geojson,latlng,options){return pointToLayerFn?pointToLayerFn(geojson,latlng):new Marker(latlng,options&&options.markersInheritOptions&&options)}function coordsToLatLng(coords){return new LatLng(coords[1],coords[0],coords[2])}function coordsToLatLngs(coords,levelsDeep,_coordsToLatLng){for(var latlngs=[],i=0,len=coords.length,latlng;i<len;i++)latlng=levelsDeep?coordsToLatLngs(coords[i],levelsDeep-1,_coordsToLatLng):(_coordsToLatLng||coordsToLatLng)(coords[i]),latlngs.push(latlng);return latlngs}function latLngToCoords(latlng,precision){return latlng=toLatLng(latlng),latlng.alt!==void 0?[formatNum(latlng.lng,precision),formatNum(latlng.lat,precision),formatNum(latlng.alt,precision)]:[formatNum(latlng.lng,precision),formatNum(latlng.lat,precision)]}function latLngsToCoords(latlngs,levelsDeep,closed,precision){for(var coords=[],i=0,len=latlngs.length;i<len;i++)coords.push(levelsDeep?latLngsToCoords(latlngs[i],isFlat(latlngs[i])?0:levelsDeep-1,closed,precision):latLngToCoords(latlngs[i],precision));return!levelsDeep&&closed&&coords.length>0&&coords.push(coords[0].slice()),coords}function getFeature(layer,newGeometry){return layer.feature?extend({},layer.feature,{geometry:newGeometry}):asFeature(newGeometry)}function asFeature(geojson){return geojson.type==="Feature"||geojson.type==="FeatureCollection"?geojson:{type:"Feature",properties:{},geometry:geojson}}var PointToGeoJSON={toGeoJSON:function(precision){return getFeature(this,{type:"Point",coordinates:latLngToCoords(this.getLatLng(),precision)})}};Marker.include(PointToGeoJSON),Circle.include(PointToGeoJSON),CircleMarker.include(PointToGeoJSON),Polyline.include({toGeoJSON:function(precision){var multi=!isFlat(this._latlngs),coords=latLngsToCoords(this._latlngs,multi?1:0,!1,precision);return getFeature(this,{type:(multi?"Multi":"")+"LineString",coordinates:coords})}}),Polygon.include({toGeoJSON:function(precision){var holes=!isFlat(this._latlngs),multi=holes&&!isFlat(this._latlngs[0]),coords=latLngsToCoords(this._latlngs,multi?2:holes?1:0,!0,precision);return holes||(coords=[coords]),getFeature(this,{type:(multi?"Multi":"")+"Polygon",coordinates:coords})}}),LayerGroup.include({toMultiPoint:function(precision){var coords=[];return this.eachLayer(function(layer){coords.push(layer.toGeoJSON(precision).geometry.coordinates)}),getFeature(this,{type:"MultiPoint",coordinates:coords})},toGeoJSON:function(precision){var type2=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(type2==="MultiPoint")return this.toMultiPoint(precision);var isGeometryCollection=type2==="GeometryCollection",jsons=[];return this.eachLayer(function(layer){if(layer.toGeoJSON){var json=layer.toGeoJSON(precision);if(isGeometryCollection)jsons.push(json.geometry);else{var feature2=asFeature(json);feature2.type==="FeatureCollection"?jsons.push.apply(jsons,feature2.features):jsons.push(feature2)}}}),isGeometryCollection?getFeature(this,{geometries:jsons,type:"GeometryCollection"}):{type:"FeatureCollection",features:jsons}}});function geoJSON(geojson,options){return new GeoJSON(geojson,options)}var geoJson=geoJSON,ImageOverlay=Layer2.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(url,bounds2,options){this._url=url,this._bounds=toLatLngBounds(bounds2),setOptions(this,options)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(addClass(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){remove(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(opacity){return this.options.opacity=opacity,this._image&&this._updateOpacity(),this},setStyle:function(styleOpts){return styleOpts.opacity&&this.setOpacity(styleOpts.opacity),this},bringToFront:function(){return this._map&&toFront(this._image),this},bringToBack:function(){return this._map&&toBack(this._image),this},setUrl:function(url){return this._url=url,this._image&&(this._image.src=url),this},setBounds:function(bounds2){return this._bounds=toLatLngBounds(bounds2),this._map&&this._reset(),this},getEvents:function(){var events={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(events.zoomanim=this._animateZoom),events},setZIndex:function(value){return this.options.zIndex=value,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var wasElementSupplied=this._url.tagName==="IMG",img=this._image=wasElementSupplied?this._url:create$1("img");if(addClass(img,"leaflet-image-layer"),this._zoomAnimated&&addClass(img,"leaflet-zoom-animated"),this.options.className&&addClass(img,this.options.className),img.onselectstart=falseFn,img.onmousemove=falseFn,img.onload=bind(this.fire,this,"load"),img.onerror=bind(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(img.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),wasElementSupplied){this._url=img.src;return}img.src=this._url,img.alt=this.options.alt},_animateZoom:function(e){var scale2=this._map.getZoomScale(e.zoom),offset=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;setTransform(this._image,offset,scale2)},_reset:function(){var image=this._image,bounds2=new Bounds(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),size=bounds2.getSize();setPosition(image,bounds2.min),image.style.width=size.x+"px",image.style.height=size.y+"px"},_updateOpacity:function(){setOpacity(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var errorUrl=this.options.errorOverlayUrl;errorUrl&&this._url!==errorUrl&&(this._url=errorUrl,this._image.src=errorUrl)},getCenter:function(){return this._bounds.getCenter()}}),imageOverlay=function(url,bounds2,options){return new ImageOverlay(url,bounds2,options)},VideoOverlay=ImageOverlay.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var wasElementSupplied=this._url.tagName==="VIDEO",vid=this._image=wasElementSupplied?this._url:create$1("video");if(addClass(vid,"leaflet-image-layer"),this._zoomAnimated&&addClass(vid,"leaflet-zoom-animated"),this.options.className&&addClass(vid,this.options.className),vid.onselectstart=falseFn,vid.onmousemove=falseFn,vid.onloadeddata=bind(this.fire,this,"load"),wasElementSupplied){for(var sourceElements=vid.getElementsByTagName("source"),sources=[],j=0;j<sourceElements.length;j++)sources.push(sourceElements[j].src);this._url=sourceElements.length>0?sources:[vid.src];return}isArray(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(vid.style,"objectFit")&&(vid.style.objectFit="fill"),vid.autoplay=!!this.options.autoplay,vid.loop=!!this.options.loop,vid.muted=!!this.options.muted,vid.playsInline=!!this.options.playsInline;for(var i=0;i<this._url.length;i++){var source=create$1("source");source.src=this._url[i],vid.appendChild(source)}}});function videoOverlay(video,bounds2,options){return new VideoOverlay(video,bounds2,options)}var SVGOverlay=ImageOverlay.extend({_initImage:function(){var el=this._image=this._url;addClass(el,"leaflet-image-layer"),this._zoomAnimated&&addClass(el,"leaflet-zoom-animated"),this.options.className&&addClass(el,this.options.className),el.onselectstart=falseFn,el.onmousemove=falseFn}});function svgOverlay(el,bounds2,options){return new SVGOverlay(el,bounds2,options)}var DivOverlay=Layer2.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(options,source){options&&(options instanceof LatLng||isArray(options))?(this._latlng=toLatLng(options),setOptions(this,source)):(setOptions(this,options),this._source=source),this.options.content&&(this._content=this.options.content)},openOn:function(map){return map=arguments.length?map:this._source._map,map.hasLayer(this)||map.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(layer){return this._map?this.close():(arguments.length?this._source=layer:layer=this._source,this._prepareOpen(),this.openOn(layer._map)),this},onAdd:function(map){this._zoomAnimated=map._zoomAnimated,this._container||this._initLayout(),map._fadeAnimated&&setOpacity(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),map._fadeAnimated&&setOpacity(this._container,1),this.bringToFront(),this.options.interactive&&(addClass(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(map){map._fadeAnimated?(setOpacity(this._container,0),this._removeTimeout=setTimeout(bind(remove,void 0,this._container),200)):remove(this._container),this.options.interactive&&(removeClass(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(latlng){return this._latlng=toLatLng(latlng),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(content){return this._content=content,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var events={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(events.zoomanim=this._animateZoom),events},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&toFront(this._container),this},bringToBack:function(){return this._map&&toBack(this._container),this},_prepareOpen:function(latlng){var source=this._source;if(!source._map)return!1;if(source instanceof FeatureGroup){source=null;var layers2=this._source._layers;for(var id in layers2)if(layers2[id]._map){source=layers2[id];break}if(!source)return!1;this._source=source}if(!latlng)if(source.getCenter)latlng=source.getCenter();else if(source.getLatLng)latlng=source.getLatLng();else if(source.getBounds)latlng=source.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(latlng),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var node=this._contentNode,content=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof content=="string")node.innerHTML=content;else{for(;node.hasChildNodes();)node.removeChild(node.firstChild);node.appendChild(content)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var pos=this._map.latLngToLayerPoint(this._latlng),offset=toPoint(this.options.offset),anchor=this._getAnchor();this._zoomAnimated?setPosition(this._container,pos.add(anchor)):offset=offset.add(pos).add(anchor);var bottom=this._containerBottom=-offset.y,left=this._containerLeft=-Math.round(this._containerWidth/2)+offset.x;this._container.style.bottom=bottom+"px",this._container.style.left=left+"px"}},_getAnchor:function(){return[0,0]}});Map2.include({_initOverlay:function(OverlayClass,content,latlng,options){var overlay=content;return overlay instanceof OverlayClass||(overlay=new OverlayClass(options).setContent(content)),latlng&&overlay.setLatLng(latlng),overlay}}),Layer2.include({_initOverlay:function(OverlayClass,old,content,options){var overlay=content;return overlay instanceof OverlayClass?(setOptions(overlay,options),overlay._source=this):(overlay=old&&!options?old:new OverlayClass(options,this),overlay.setContent(content)),overlay}});var Popup=DivOverlay.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(map){return map=arguments.length?map:this._source._map,!map.hasLayer(this)&&map._popup&&map._popup.options.autoClose&&map.removeLayer(map._popup),map._popup=this,DivOverlay.prototype.openOn.call(this,map)},onAdd:function(map){DivOverlay.prototype.onAdd.call(this,map),map.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Path2||this._source.on("preclick",stopPropagation))},onRemove:function(map){DivOverlay.prototype.onRemove.call(this,map),map.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Path2||this._source.off("preclick",stopPropagation))},getEvents:function(){var events=DivOverlay.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(events.preclick=this.close),this.options.keepInView&&(events.moveend=this._adjustPan),events},_initLayout:function(){var prefix="leaflet-popup",container=this._container=create$1("div",prefix+" "+(this.options.className||"")+" leaflet-zoom-animated"),wrapper=this._wrapper=create$1("div",prefix+"-content-wrapper",container);if(this._contentNode=create$1("div",prefix+"-content",wrapper),disableClickPropagation(container),disableScrollPropagation(this._contentNode),on(container,"contextmenu",stopPropagation),this._tipContainer=create$1("div",prefix+"-tip-container",container),this._tip=create$1("div",prefix+"-tip",this._tipContainer),this.options.closeButton){var closeButton=this._closeButton=create$1("a",prefix+"-close-button",container);closeButton.setAttribute("role","button"),closeButton.setAttribute("aria-label","Close popup"),closeButton.href="#close",closeButton.innerHTML='<span aria-hidden="true">&#215;</span>',on(closeButton,"click",function(ev){preventDefault(ev),this.close()},this)}},_updateLayout:function(){var container=this._contentNode,style2=container.style;style2.width="",style2.whiteSpace="nowrap";var width=container.offsetWidth;width=Math.min(width,this.options.maxWidth),width=Math.max(width,this.options.minWidth),style2.width=width+1+"px",style2.whiteSpace="",style2.height="";var height=container.offsetHeight,maxHeight=this.options.maxHeight,scrolledClass="leaflet-popup-scrolled";maxHeight&&height>maxHeight?(style2.height=maxHeight+"px",addClass(container,scrolledClass)):removeClass(container,scrolledClass),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var pos=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),anchor=this._getAnchor();setPosition(this._container,pos.add(anchor))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var map=this._map,marginBottom=parseInt(getStyle(this._container,"marginBottom"),10)||0,containerHeight=this._container.offsetHeight+marginBottom,containerWidth=this._containerWidth,layerPos=new Point(this._containerLeft,-containerHeight-this._containerBottom);layerPos._add(getPosition(this._container));var containerPos=map.layerPointToContainerPoint(layerPos),padding=toPoint(this.options.autoPanPadding),paddingTL=toPoint(this.options.autoPanPaddingTopLeft||padding),paddingBR=toPoint(this.options.autoPanPaddingBottomRight||padding),size=map.getSize(),dx=0,dy=0;containerPos.x+containerWidth+paddingBR.x>size.x&&(dx=containerPos.x+containerWidth-size.x+paddingBR.x),containerPos.x-dx-paddingTL.x<0&&(dx=containerPos.x-paddingTL.x),containerPos.y+containerHeight+paddingBR.y>size.y&&(dy=containerPos.y+containerHeight-size.y+paddingBR.y),containerPos.y-dy-paddingTL.y<0&&(dy=containerPos.y-paddingTL.y),(dx||dy)&&(this.options.keepInView&&(this._autopanning=!0),map.fire("autopanstart").panBy([dx,dy]))}},_getAnchor:function(){return toPoint(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),popup=function(options,source){return new Popup(options,source)};Map2.mergeOptions({closePopupOnClick:!0}),Map2.include({openPopup:function(popup2,latlng,options){return this._initOverlay(Popup,popup2,latlng,options).openOn(this),this},closePopup:function(popup2){return popup2=arguments.length?popup2:this._popup,popup2&&popup2.close(),this}}),Layer2.include({bindPopup:function(content,options){return this._popup=this._initOverlay(Popup,this._popup,content,options),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(latlng){return this._popup&&(this instanceof FeatureGroup||(this._popup._source=this),this._popup._prepareOpen(latlng||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(content){return this._popup&&this._popup.setContent(content),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){stop(e);var target=e.layer||e.target;if(this._popup._source===target&&!(target instanceof Path2)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=target,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var Tooltip=DivOverlay.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(map){DivOverlay.prototype.onAdd.call(this,map),this.setOpacity(this.options.opacity),map.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(map){DivOverlay.prototype.onRemove.call(this,map),map.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var events=DivOverlay.prototype.getEvents.call(this);return this.options.permanent||(events.preclick=this.close),events},_initLayout:function(){var prefix="leaflet-tooltip",className=prefix+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=create$1("div",className),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+stamp(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(pos){var subX,subY,map=this._map,container=this._container,centerPoint=map.latLngToContainerPoint(map.getCenter()),tooltipPoint=map.layerPointToContainerPoint(pos),direction=this.options.direction,tooltipWidth=container.offsetWidth,tooltipHeight=container.offsetHeight,offset=toPoint(this.options.offset),anchor=this._getAnchor();direction==="top"?(subX=tooltipWidth/2,subY=tooltipHeight):direction==="bottom"?(subX=tooltipWidth/2,subY=0):direction==="center"?(subX=tooltipWidth/2,subY=tooltipHeight/2):direction==="right"?(subX=0,subY=tooltipHeight/2):direction==="left"?(subX=tooltipWidth,subY=tooltipHeight/2):tooltipPoint.x<centerPoint.x?(direction="right",subX=0,subY=tooltipHeight/2):(direction="left",subX=tooltipWidth+(offset.x+anchor.x)*2,subY=tooltipHeight/2),pos=pos.subtract(toPoint(subX,subY,!0)).add(offset).add(anchor),removeClass(container,"leaflet-tooltip-right"),removeClass(container,"leaflet-tooltip-left"),removeClass(container,"leaflet-tooltip-top"),removeClass(container,"leaflet-tooltip-bottom"),addClass(container,"leaflet-tooltip-"+direction),setPosition(container,pos)},_updatePosition:function(){var pos=this._map.latLngToLayerPoint(this._latlng);this._setPosition(pos)},setOpacity:function(opacity){this.options.opacity=opacity,this._container&&setOpacity(this._container,opacity)},_animateZoom:function(e){var pos=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center);this._setPosition(pos)},_getAnchor:function(){return toPoint(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),tooltip=function(options,source){return new Tooltip(options,source)};Map2.include({openTooltip:function(tooltip2,latlng,options){return this._initOverlay(Tooltip,tooltip2,latlng,options).openOn(this),this},closeTooltip:function(tooltip2){return tooltip2.close(),this}}),Layer2.include({bindTooltip:function(content,options){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Tooltip,this._tooltip,content,options),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(remove2){if(!(!remove2&&this._tooltipHandlersAdded)){var onOff=remove2?"off":"on",events={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?events.add=this._openTooltip:(events.mouseover=this._openTooltip,events.mouseout=this.closeTooltip,events.click=this._openTooltip,this._map?this._addFocusListeners():events.add=this._addFocusListeners),this._tooltip.options.sticky&&(events.mousemove=this._moveTooltip),this[onOff](events),this._tooltipHandlersAdded=!remove2}},openTooltip:function(latlng){return this._tooltip&&(this instanceof FeatureGroup||(this._tooltip._source=this),this._tooltip._prepareOpen(latlng)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(content){return this._tooltip&&this._tooltip.setContent(content),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(layer){var el=typeof layer.getElement=="function"&&layer.getElement();el&&(on(el,"focus",function(){this._tooltip._source=layer,this.openTooltip()},this),on(el,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(layer){var el=typeof layer.getElement=="function"&&layer.getElement();el&&el.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(e){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var that=this;this._map.once("moveend",function(){that._openOnceFlag=!1,that._openTooltip(e)});return}this._tooltip._source=e.layer||e.target,this.openTooltip(this._tooltip.options.sticky?e.latlng:void 0)}},_moveTooltip:function(e){var latlng=e.latlng,containerPoint,layerPoint;this._tooltip.options.sticky&&e.originalEvent&&(containerPoint=this._map.mouseEventToContainerPoint(e.originalEvent),layerPoint=this._map.containerPointToLayerPoint(containerPoint),latlng=this._map.layerPointToLatLng(layerPoint)),this._tooltip.setLatLng(latlng)}});var DivIcon=Icon.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(oldIcon){var div=oldIcon&&oldIcon.tagName==="DIV"?oldIcon:document.createElement("div"),options=this.options;if(options.html instanceof Element?(empty(div),div.appendChild(options.html)):div.innerHTML=options.html!==!1?options.html:"",options.bgPos){var bgPos=toPoint(options.bgPos);div.style.backgroundPosition=-bgPos.x+"px "+-bgPos.y+"px"}return this._setIconStyles(div,"icon"),div},createShadow:function(){return null}});function divIcon(options){return new DivIcon(options)}Icon.Default=IconDefault;var GridLayer=Layer2.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Browser.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(options){setOptions(this,options)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(map){map._addZoomLimit(this)},onRemove:function(map){this._removeAllTiles(),remove(this._container),map._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(toFront(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(toBack(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(opacity){return this.options.opacity=opacity,this._updateOpacity(),this},setZIndex:function(zIndex){return this.options.zIndex=zIndex,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var tileZoom=this._clampZoom(this._map.getZoom());tileZoom!==this._tileZoom&&(this._tileZoom=tileZoom,this._updateLevels()),this._update()}return this},getEvents:function(){var events={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=throttle(this._onMoveEnd,this.options.updateInterval,this)),events.move=this._onMove),this._zoomAnimated&&(events.zoomanim=this._animateZoom),events},createTile:function(){return document.createElement("div")},getTileSize:function(){var s=this.options.tileSize;return s instanceof Point?s:new Point(s,s)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(compare){for(var layers2=this.getPane().children,edgeZIndex=-compare(-1/0,1/0),i=0,len=layers2.length,zIndex;i<len;i++)zIndex=layers2[i].style.zIndex,layers2[i]!==this._container&&zIndex&&(edgeZIndex=compare(edgeZIndex,+zIndex));isFinite(edgeZIndex)&&(this.options.zIndex=edgeZIndex+compare(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Browser.ielt9){setOpacity(this._container,this.options.opacity);var now=+new Date,nextFrame=!1,willPrune=!1;for(var key in this._tiles){var tile=this._tiles[key];if(!(!tile.current||!tile.loaded)){var fade=Math.min(1,(now-tile.loaded)/200);setOpacity(tile.el,fade),fade<1?nextFrame=!0:(tile.active?willPrune=!0:this._onOpaqueTile(tile),tile.active=!0)}}willPrune&&!this._noPrune&&this._pruneTiles(),nextFrame&&(cancelAnimFrame(this._fadeFrame),this._fadeFrame=requestAnimFrame(this._updateOpacity,this))}},_onOpaqueTile:falseFn,_initContainer:function(){this._container||(this._container=create$1("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var zoom2=this._tileZoom,maxZoom=this.options.maxZoom;if(zoom2!==void 0){for(var z in this._levels)z=Number(z),this._levels[z].el.children.length||z===zoom2?(this._levels[z].el.style.zIndex=maxZoom-Math.abs(zoom2-z),this._onUpdateLevel(z)):(remove(this._levels[z].el),this._removeTilesAtZoom(z),this._onRemoveLevel(z),delete this._levels[z]);var level=this._levels[zoom2],map=this._map;return level||(level=this._levels[zoom2]={},level.el=create$1("div","leaflet-tile-container leaflet-zoom-animated",this._container),level.el.style.zIndex=maxZoom,level.origin=map.project(map.unproject(map.getPixelOrigin()),zoom2).round(),level.zoom=zoom2,this._setZoomTransform(level,map.getCenter(),map.getZoom()),falseFn(level.el.offsetWidth),this._onCreateLevel(level)),this._level=level,level}},_onUpdateLevel:falseFn,_onRemoveLevel:falseFn,_onCreateLevel:falseFn,_pruneTiles:function(){if(this._map){var key,tile,zoom2=this._map.getZoom();if(zoom2>this.options.maxZoom||zoom2<this.options.minZoom){this._removeAllTiles();return}for(key in this._tiles)tile=this._tiles[key],tile.retain=tile.current;for(key in this._tiles)if(tile=this._tiles[key],tile.current&&!tile.active){var coords=tile.coords;this._retainParent(coords.x,coords.y,coords.z,coords.z-5)||this._retainChildren(coords.x,coords.y,coords.z,coords.z+2)}for(key in this._tiles)this._tiles[key].retain||this._removeTile(key)}},_removeTilesAtZoom:function(zoom2){for(var key in this._tiles)this._tiles[key].coords.z===zoom2&&this._removeTile(key)},_removeAllTiles:function(){for(var key in this._tiles)this._removeTile(key)},_invalidateAll:function(){for(var z in this._levels)remove(this._levels[z].el),this._onRemoveLevel(Number(z)),delete this._levels[z];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(x,y,z,minZoom){var x2=Math.floor(x/2),y2=Math.floor(y/2),z2=z-1,coords2=new Point(+x2,+y2);coords2.z=+z2;var key=this._tileCoordsToKey(coords2),tile=this._tiles[key];return tile&&tile.active?(tile.retain=!0,!0):(tile&&tile.loaded&&(tile.retain=!0),z2>minZoom?this._retainParent(x2,y2,z2,minZoom):!1)},_retainChildren:function(x,y,z,maxZoom){for(var i=2*x;i<2*x+2;i++)for(var j=2*y;j<2*y+2;j++){var coords=new Point(i,j);coords.z=z+1;var key=this._tileCoordsToKey(coords),tile=this._tiles[key];if(tile&&tile.active){tile.retain=!0;continue}else tile&&tile.loaded&&(tile.retain=!0);z+1<maxZoom&&this._retainChildren(i,j,z+1,maxZoom)}},_resetView:function(e){var animating=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),animating,animating)},_animateZoom:function(e){this._setView(e.center,e.zoom,!0,e.noUpdate)},_clampZoom:function(zoom2){var options=this.options;return options.minNativeZoom!==void 0&&zoom2<options.minNativeZoom?options.minNativeZoom:options.maxNativeZoom!==void 0&&options.maxNativeZoom<zoom2?options.maxNativeZoom:zoom2},_setView:function(center,zoom2,noPrune,noUpdate){var tileZoom=Math.round(zoom2);this.options.maxZoom!==void 0&&tileZoom>this.options.maxZoom||this.options.minZoom!==void 0&&tileZoom<this.options.minZoom?tileZoom=void 0:tileZoom=this._clampZoom(tileZoom);var tileZoomChanged=this.options.updateWhenZooming&&tileZoom!==this._tileZoom;(!noUpdate||tileZoomChanged)&&(this._tileZoom=tileZoom,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),tileZoom!==void 0&&this._update(center),noPrune||this._pruneTiles(),this._noPrune=!!noPrune),this._setZoomTransforms(center,zoom2)},_setZoomTransforms:function(center,zoom2){for(var i in this._levels)this._setZoomTransform(this._levels[i],center,zoom2)},_setZoomTransform:function(level,center,zoom2){var scale2=this._map.getZoomScale(zoom2,level.zoom),translate=level.origin.multiplyBy(scale2).subtract(this._map._getNewPixelOrigin(center,zoom2)).round();Browser.any3d?setTransform(level.el,translate,scale2):setPosition(level.el,translate)},_resetGrid:function(){var map=this._map,crs=map.options.crs,tileSize=this._tileSize=this.getTileSize(),tileZoom=this._tileZoom,bounds2=this._map.getPixelWorldBounds(this._tileZoom);bounds2&&(this._globalTileRange=this._pxBoundsToTileRange(bounds2)),this._wrapX=crs.wrapLng&&!this.options.noWrap&&[Math.floor(map.project([0,crs.wrapLng[0]],tileZoom).x/tileSize.x),Math.ceil(map.project([0,crs.wrapLng[1]],tileZoom).x/tileSize.y)],this._wrapY=crs.wrapLat&&!this.options.noWrap&&[Math.floor(map.project([crs.wrapLat[0],0],tileZoom).y/tileSize.x),Math.ceil(map.project([crs.wrapLat[1],0],tileZoom).y/tileSize.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(center){var map=this._map,mapZoom=map._animatingZoom?Math.max(map._animateToZoom,map.getZoom()):map.getZoom(),scale2=map.getZoomScale(mapZoom,this._tileZoom),pixelCenter=map.project(center,this._tileZoom).floor(),halfSize=map.getSize().divideBy(scale2*2);return new Bounds(pixelCenter.subtract(halfSize),pixelCenter.add(halfSize))},_update:function(center){var map=this._map;if(map){var zoom2=this._clampZoom(map.getZoom());if(center===void 0&&(center=map.getCenter()),this._tileZoom!==void 0){var pixelBounds=this._getTiledPixelBounds(center),tileRange=this._pxBoundsToTileRange(pixelBounds),tileCenter=tileRange.getCenter(),queue=[],margin=this.options.keepBuffer,noPruneRange=new Bounds(tileRange.getBottomLeft().subtract([margin,-margin]),tileRange.getTopRight().add([margin,-margin]));if(!(isFinite(tileRange.min.x)&&isFinite(tileRange.min.y)&&isFinite(tileRange.max.x)&&isFinite(tileRange.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var key in this._tiles){var c=this._tiles[key].coords;(c.z!==this._tileZoom||!noPruneRange.contains(new Point(c.x,c.y)))&&(this._tiles[key].current=!1)}if(Math.abs(zoom2-this._tileZoom)>1){this._setView(center,zoom2);return}for(var j=tileRange.min.y;j<=tileRange.max.y;j++)for(var i=tileRange.min.x;i<=tileRange.max.x;i++){var coords=new Point(i,j);if(coords.z=this._tileZoom,!!this._isValidTile(coords)){var tile=this._tiles[this._tileCoordsToKey(coords)];tile?tile.current=!0:queue.push(coords)}}if(queue.sort(function(a,b){return a.distanceTo(tileCenter)-b.distanceTo(tileCenter)}),queue.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var fragment=document.createDocumentFragment();for(i=0;i<queue.length;i++)this._addTile(queue[i],fragment);this._level.el.appendChild(fragment)}}}},_isValidTile:function(coords){var crs=this._map.options.crs;if(!crs.infinite){var bounds2=this._globalTileRange;if(!crs.wrapLng&&(coords.x<bounds2.min.x||coords.x>bounds2.max.x)||!crs.wrapLat&&(coords.y<bounds2.min.y||coords.y>bounds2.max.y))return!1}if(!this.options.bounds)return!0;var tileBounds=this._tileCoordsToBounds(coords);return toLatLngBounds(this.options.bounds).overlaps(tileBounds)},_keyToBounds:function(key){return this._tileCoordsToBounds(this._keyToTileCoords(key))},_tileCoordsToNwSe:function(coords){var map=this._map,tileSize=this.getTileSize(),nwPoint=coords.scaleBy(tileSize),sePoint=nwPoint.add(tileSize),nw=map.unproject(nwPoint,coords.z),se=map.unproject(sePoint,coords.z);return[nw,se]},_tileCoordsToBounds:function(coords){var bp=this._tileCoordsToNwSe(coords),bounds2=new LatLngBounds(bp[0],bp[1]);return this.options.noWrap||(bounds2=this._map.wrapLatLngBounds(bounds2)),bounds2},_tileCoordsToKey:function(coords){return coords.x+":"+coords.y+":"+coords.z},_keyToTileCoords:function(key){var k=key.split(":"),coords=new Point(+k[0],+k[1]);return coords.z=+k[2],coords},_removeTile:function(key){var tile=this._tiles[key];tile&&(remove(tile.el),delete this._tiles[key],this.fire("tileunload",{tile:tile.el,coords:this._keyToTileCoords(key)}))},_initTile:function(tile){addClass(tile,"leaflet-tile");var tileSize=this.getTileSize();tile.style.width=tileSize.x+"px",tile.style.height=tileSize.y+"px",tile.onselectstart=falseFn,tile.onmousemove=falseFn,Browser.ielt9&&this.options.opacity<1&&setOpacity(tile,this.options.opacity)},_addTile:function(coords,container){var tilePos=this._getTilePos(coords),key=this._tileCoordsToKey(coords),tile=this.createTile(this._wrapCoords(coords),bind(this._tileReady,this,coords));this._initTile(tile),this.createTile.length<2&&requestAnimFrame(bind(this._tileReady,this,coords,null,tile)),setPosition(tile,tilePos),this._tiles[key]={el:tile,coords,current:!0},container.appendChild(tile),this.fire("tileloadstart",{tile,coords})},_tileReady:function(coords,err,tile){err&&this.fire("tileerror",{error:err,tile,coords});var key=this._tileCoordsToKey(coords);tile=this._tiles[key],tile&&(tile.loaded=+new Date,this._map._fadeAnimated?(setOpacity(tile.el,0),cancelAnimFrame(this._fadeFrame),this._fadeFrame=requestAnimFrame(this._updateOpacity,this)):(tile.active=!0,this._pruneTiles()),err||(addClass(tile.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:tile.el,coords})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Browser.ielt9||!this._map._fadeAnimated?requestAnimFrame(this._pruneTiles,this):setTimeout(bind(this._pruneTiles,this),250)))},_getTilePos:function(coords){return coords.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(coords){var newCoords=new Point(this._wrapX?wrapNum(coords.x,this._wrapX):coords.x,this._wrapY?wrapNum(coords.y,this._wrapY):coords.y);return newCoords.z=coords.z,newCoords},_pxBoundsToTileRange:function(bounds2){var tileSize=this.getTileSize();return new Bounds(bounds2.min.unscaleBy(tileSize).floor(),bounds2.max.unscaleBy(tileSize).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var key in this._tiles)if(!this._tiles[key].loaded)return!1;return!0}});function gridLayer(options){return new GridLayer(options)}var TileLayer2=GridLayer.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(url,options){this._url=url,options=setOptions(this,options),options.detectRetina&&Browser.retina&&options.maxZoom>0?(options.tileSize=Math.floor(options.tileSize/2),options.zoomReverse?(options.zoomOffset--,options.minZoom=Math.min(options.maxZoom,options.minZoom+1)):(options.zoomOffset++,options.maxZoom=Math.max(options.minZoom,options.maxZoom-1)),options.minZoom=Math.max(0,options.minZoom)):options.zoomReverse?options.minZoom=Math.min(options.maxZoom,options.minZoom):options.maxZoom=Math.max(options.minZoom,options.maxZoom),typeof options.subdomains=="string"&&(options.subdomains=options.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(url,noRedraw){return this._url===url&&noRedraw===void 0&&(noRedraw=!0),this._url=url,noRedraw||this.redraw(),this},createTile:function(coords,done){var tile=document.createElement("img");return on(tile,"load",bind(this._tileOnLoad,this,done,tile)),on(tile,"error",bind(this._tileOnError,this,done,tile)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(tile.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(tile.referrerPolicy=this.options.referrerPolicy),tile.alt="",tile.src=this.getTileUrl(coords),tile},getTileUrl:function(coords){var data={r:Browser.retina?"@2x":"",s:this._getSubdomain(coords),x:coords.x,y:coords.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var invertedY=this._globalTileRange.max.y-coords.y;this.options.tms&&(data.y=invertedY),data["-y"]=invertedY}return template(this._url,extend(data,this.options))},_tileOnLoad:function(done,tile){Browser.ielt9?setTimeout(bind(done,this,null,tile),0):done(null,tile)},_tileOnError:function(done,tile,e){var errorUrl=this.options.errorTileUrl;errorUrl&&tile.getAttribute("src")!==errorUrl&&(tile.src=errorUrl),done(e,tile)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var zoom2=this._tileZoom,maxZoom=this.options.maxZoom,zoomReverse=this.options.zoomReverse,zoomOffset=this.options.zoomOffset;return zoomReverse&&(zoom2=maxZoom-zoom2),zoom2+zoomOffset},_getSubdomain:function(tilePoint){var index3=Math.abs(tilePoint.x+tilePoint.y)%this.options.subdomains.length;return this.options.subdomains[index3]},_abortLoading:function(){var i,tile;for(i in this._tiles)if(this._tiles[i].coords.z!==this._tileZoom&&(tile=this._tiles[i].el,tile.onload=falseFn,tile.onerror=falseFn,!tile.complete)){tile.src=emptyImageUrl;var coords=this._tiles[i].coords;remove(tile),delete this._tiles[i],this.fire("tileabort",{tile,coords})}},_removeTile:function(key){var tile=this._tiles[key];if(tile)return tile.el.setAttribute("src",emptyImageUrl),GridLayer.prototype._removeTile.call(this,key)},_tileReady:function(coords,err,tile){if(!(!this._map||tile&&tile.getAttribute("src")===emptyImageUrl))return GridLayer.prototype._tileReady.call(this,coords,err,tile)}});function tileLayer(url,options){return new TileLayer2(url,options)}var TileLayerWMS=TileLayer2.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(url,options){this._url=url;var wmsParams=extend({},this.defaultWmsParams);for(var i in options)i in this.options||(wmsParams[i]=options[i]);options=setOptions(this,options);var realRetina=options.detectRetina&&Browser.retina?2:1,tileSize=this.getTileSize();wmsParams.width=tileSize.x*realRetina,wmsParams.height=tileSize.y*realRetina,this.wmsParams=wmsParams},onAdd:function(map){this._crs=this.options.crs||map.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var projectionKey=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[projectionKey]=this._crs.code,TileLayer2.prototype.onAdd.call(this,map)},getTileUrl:function(coords){var tileBounds=this._tileCoordsToNwSe(coords),crs=this._crs,bounds2=toBounds(crs.project(tileBounds[0]),crs.project(tileBounds[1])),min=bounds2.min,max=bounds2.max,bbox=(this._wmsVersion>=1.3&&this._crs===EPSG4326?[min.y,min.x,max.y,max.x]:[min.x,min.y,max.x,max.y]).join(","),url=TileLayer2.prototype.getTileUrl.call(this,coords);return url+getParamString(this.wmsParams,url,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+bbox},setParams:function(params,noRedraw){return extend(this.wmsParams,params),noRedraw||this.redraw(),this}});function tileLayerWMS(url,options){return new TileLayerWMS(url,options)}TileLayer2.WMS=TileLayerWMS,tileLayer.wms=tileLayerWMS;var Renderer=Layer2.extend({options:{padding:.1},initialize:function(options){setOptions(this,options),stamp(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),addClass(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var events={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(events.zoomanim=this._onAnimZoom),events},_onAnimZoom:function(ev){this._updateTransform(ev.center,ev.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(center,zoom2){var scale2=this._map.getZoomScale(zoom2,this._zoom),viewHalf=this._map.getSize().multiplyBy(.5+this.options.padding),currentCenterPoint=this._map.project(this._center,zoom2),topLeftOffset=viewHalf.multiplyBy(-scale2).add(currentCenterPoint).subtract(this._map._getNewPixelOrigin(center,zoom2));Browser.any3d?setTransform(this._container,topLeftOffset,scale2):setPosition(this._container,topLeftOffset)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var id in this._layers)this._layers[id]._reset()},_onZoomEnd:function(){for(var id in this._layers)this._layers[id]._project()},_updatePaths:function(){for(var id in this._layers)this._layers[id]._update()},_update:function(){var p=this.options.padding,size=this._map.getSize(),min=this._map.containerPointToLayerPoint(size.multiplyBy(-p)).round();this._bounds=new Bounds(min,min.add(size.multiplyBy(1+p*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Canvas=Renderer.extend({options:{tolerance:0},getEvents:function(){var events=Renderer.prototype.getEvents.call(this);return events.viewprereset=this._onViewPreReset,events},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Renderer.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var container=this._container=document.createElement("canvas");on(container,"mousemove",this._onMouseMove,this),on(container,"click dblclick mousedown mouseup contextmenu",this._onClick,this),on(container,"mouseout",this._handleMouseOut,this),container._leaflet_disable_events=!0,this._ctx=container.getContext("2d")},_destroyContainer:function(){cancelAnimFrame(this._redrawRequest),delete this._ctx,remove(this._container),off(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var layer;this._redrawBounds=null;for(var id in this._layers)layer=this._layers[id],layer._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Renderer.prototype._update.call(this);var b=this._bounds,container=this._container,size=b.getSize(),m=Browser.retina?2:1;setPosition(container,b.min),container.width=m*size.x,container.height=m*size.y,container.style.width=size.x+"px",container.style.height=size.y+"px",Browser.retina&&this._ctx.scale(2,2),this._ctx.translate(-b.min.x,-b.min.y),this.fire("update")}},_reset:function(){Renderer.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(layer){this._updateDashArray(layer),this._layers[stamp(layer)]=layer;var order=layer._order={layer,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=order),this._drawLast=order,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(layer){this._requestRedraw(layer)},_removePath:function(layer){var order=layer._order,next=order.next,prev=order.prev;next?next.prev=prev:this._drawLast=prev,prev?prev.next=next:this._drawFirst=next,delete layer._order,delete this._layers[stamp(layer)],this._requestRedraw(layer)},_updatePath:function(layer){this._extendRedrawBounds(layer),layer._project(),layer._update(),this._requestRedraw(layer)},_updateStyle:function(layer){this._updateDashArray(layer),this._requestRedraw(layer)},_updateDashArray:function(layer){if(typeof layer.options.dashArray=="string"){var parts=layer.options.dashArray.split(/[, ]+/),dashArray=[],dashValue,i;for(i=0;i<parts.length;i++){if(dashValue=Number(parts[i]),isNaN(dashValue))return;dashArray.push(dashValue)}layer.options._dashArray=dashArray}else layer.options._dashArray=layer.options.dashArray},_requestRedraw:function(layer){this._map&&(this._extendRedrawBounds(layer),this._redrawRequest=this._redrawRequest||requestAnimFrame(this._redraw,this))},_extendRedrawBounds:function(layer){if(layer._pxBounds){var padding=(layer.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Bounds,this._redrawBounds.extend(layer._pxBounds.min.subtract([padding,padding])),this._redrawBounds.extend(layer._pxBounds.max.add([padding,padding]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var bounds2=this._redrawBounds;if(bounds2){var size=bounds2.getSize();this._ctx.clearRect(bounds2.min.x,bounds2.min.y,size.x,size.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var layer,bounds2=this._redrawBounds;if(this._ctx.save(),bounds2){var size=bounds2.getSize();this._ctx.beginPath(),this._ctx.rect(bounds2.min.x,bounds2.min.y,size.x,size.y),this._ctx.clip()}this._drawing=!0;for(var order=this._drawFirst;order;order=order.next)layer=order.layer,(!bounds2||layer._pxBounds&&layer._pxBounds.intersects(bounds2))&&layer._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(layer,closed){if(this._drawing){var i,j,len2,p,parts=layer._parts,len=parts.length,ctx=this._ctx;if(len){for(ctx.beginPath(),i=0;i<len;i++){for(j=0,len2=parts[i].length;j<len2;j++)p=parts[i][j],ctx[j?"lineTo":"moveTo"](p.x,p.y);closed&&ctx.closePath()}this._fillStroke(ctx,layer)}}},_updateCircle:function(layer){if(!(!this._drawing||layer._empty())){var p=layer._point,ctx=this._ctx,r=Math.max(Math.round(layer._radius),1),s=(Math.max(Math.round(layer._radiusY),1)||r)/r;s!==1&&(ctx.save(),ctx.scale(1,s)),ctx.beginPath(),ctx.arc(p.x,p.y/s,r,0,Math.PI*2,!1),s!==1&&ctx.restore(),this._fillStroke(ctx,layer)}},_fillStroke:function(ctx,layer){var options=layer.options;options.fill&&(ctx.globalAlpha=options.fillOpacity,ctx.fillStyle=options.fillColor||options.color,ctx.fill(options.fillRule||"evenodd")),options.stroke&&options.weight!==0&&(ctx.setLineDash&&ctx.setLineDash(layer.options&&layer.options._dashArray||[]),ctx.globalAlpha=options.opacity,ctx.lineWidth=options.weight,ctx.strokeStyle=options.color,ctx.lineCap=options.lineCap,ctx.lineJoin=options.lineJoin,ctx.stroke())},_onClick:function(e){for(var point=this._map.mouseEventToLayerPoint(e),layer,clickedLayer,order=this._drawFirst;order;order=order.next)layer=order.layer,layer.options.interactive&&layer._containsPoint(point)&&(!(e.type==="click"||e.type==="preclick")||!this._map._draggableMoved(layer))&&(clickedLayer=layer);this._fireEvent(clickedLayer?[clickedLayer]:!1,e)},_onMouseMove:function(e){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var point=this._map.mouseEventToLayerPoint(e);this._handleMouseHover(e,point)}},_handleMouseOut:function(e){var layer=this._hoveredLayer;layer&&(removeClass(this._container,"leaflet-interactive"),this._fireEvent([layer],e,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(e,point){if(!this._mouseHoverThrottled){for(var layer,candidateHoveredLayer,order=this._drawFirst;order;order=order.next)layer=order.layer,layer.options.interactive&&layer._containsPoint(point)&&(candidateHoveredLayer=layer);candidateHoveredLayer!==this._hoveredLayer&&(this._handleMouseOut(e),candidateHoveredLayer&&(addClass(this._container,"leaflet-interactive"),this._fireEvent([candidateHoveredLayer],e,"mouseover"),this._hoveredLayer=candidateHoveredLayer)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,e),this._mouseHoverThrottled=!0,setTimeout(bind(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(layers2,e,type2){this._map._fireDOMEvent(e,type2||e.type,layers2)},_bringToFront:function(layer){var order=layer._order;if(order){var next=order.next,prev=order.prev;if(next)next.prev=prev;else return;prev?prev.next=next:next&&(this._drawFirst=next),order.prev=this._drawLast,this._drawLast.next=order,order.next=null,this._drawLast=order,this._requestRedraw(layer)}},_bringToBack:function(layer){var order=layer._order;if(order){var next=order.next,prev=order.prev;if(prev)prev.next=next;else return;next?next.prev=prev:prev&&(this._drawLast=prev),order.prev=null,order.next=this._drawFirst,this._drawFirst.prev=order,this._drawFirst=order,this._requestRedraw(layer)}}});function canvas(options){return Browser.canvas?new Canvas(options):null}var vmlCreate=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(name){return document.createElement("<lvml:"+name+' class="lvml">')}}catch{}return function(name){return document.createElement("<"+name+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),vmlMixin={_initContainer:function(){this._container=create$1("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Renderer.prototype._update.call(this),this.fire("update"))},_initPath:function(layer){var container=layer._container=vmlCreate("shape");addClass(container,"leaflet-vml-shape "+(this.options.className||"")),container.coordsize="1 1",layer._path=vmlCreate("path"),container.appendChild(layer._path),this._updateStyle(layer),this._layers[stamp(layer)]=layer},_addPath:function(layer){var container=layer._container;this._container.appendChild(container),layer.options.interactive&&layer.addInteractiveTarget(container)},_removePath:function(layer){var container=layer._container;remove(container),layer.removeInteractiveTarget(container),delete this._layers[stamp(layer)]},_updateStyle:function(layer){var stroke=layer._stroke,fill=layer._fill,options=layer.options,container=layer._container;container.stroked=!!options.stroke,container.filled=!!options.fill,options.stroke?(stroke||(stroke=layer._stroke=vmlCreate("stroke")),container.appendChild(stroke),stroke.weight=options.weight+"px",stroke.color=options.color,stroke.opacity=options.opacity,options.dashArray?stroke.dashStyle=isArray(options.dashArray)?options.dashArray.join(" "):options.dashArray.replace(/( *, *)/g," "):stroke.dashStyle="",stroke.endcap=options.lineCap.replace("butt","flat"),stroke.joinstyle=options.lineJoin):stroke&&(container.removeChild(stroke),layer._stroke=null),options.fill?(fill||(fill=layer._fill=vmlCreate("fill")),container.appendChild(fill),fill.color=options.fillColor||options.color,fill.opacity=options.fillOpacity):fill&&(container.removeChild(fill),layer._fill=null)},_updateCircle:function(layer){var p=layer._point.round(),r=Math.round(layer._radius),r2=Math.round(layer._radiusY||r);this._setPath(layer,layer._empty()?"M0 0":"AL "+p.x+","+p.y+" "+r+","+r2+" 0,"+65535*360)},_setPath:function(layer,path){layer._path.v=path},_bringToFront:function(layer){toFront(layer._container)},_bringToBack:function(layer){toBack(layer._container)}},create=Browser.vml?vmlCreate:svgCreate,SVG=Renderer.extend({_initContainer:function(){this._container=create("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=create("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){remove(this._container),off(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Renderer.prototype._update.call(this);var b=this._bounds,size=b.getSize(),container=this._container;(!this._svgSize||!this._svgSize.equals(size))&&(this._svgSize=size,container.setAttribute("width",size.x),container.setAttribute("height",size.y)),setPosition(container,b.min),container.setAttribute("viewBox",[b.min.x,b.min.y,size.x,size.y].join(" ")),this.fire("update")}},_initPath:function(layer){var path=layer._path=create("path");layer.options.className&&addClass(path,layer.options.className),layer.options.interactive&&addClass(path,"leaflet-interactive"),this._updateStyle(layer),this._layers[stamp(layer)]=layer},_addPath:function(layer){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(layer._path),layer.addInteractiveTarget(layer._path)},_removePath:function(layer){remove(layer._path),layer.removeInteractiveTarget(layer._path),delete this._layers[stamp(layer)]},_updatePath:function(layer){layer._project(),layer._update()},_updateStyle:function(layer){var path=layer._path,options=layer.options;path&&(options.stroke?(path.setAttribute("stroke",options.color),path.setAttribute("stroke-opacity",options.opacity),path.setAttribute("stroke-width",options.weight),path.setAttribute("stroke-linecap",options.lineCap),path.setAttribute("stroke-linejoin",options.lineJoin),options.dashArray?path.setAttribute("stroke-dasharray",options.dashArray):path.removeAttribute("stroke-dasharray"),options.dashOffset?path.setAttribute("stroke-dashoffset",options.dashOffset):path.removeAttribute("stroke-dashoffset")):path.setAttribute("stroke","none"),options.fill?(path.setAttribute("fill",options.fillColor||options.color),path.setAttribute("fill-opacity",options.fillOpacity),path.setAttribute("fill-rule",options.fillRule||"evenodd")):path.setAttribute("fill","none"))},_updatePoly:function(layer,closed){this._setPath(layer,pointsToPath(layer._parts,closed))},_updateCircle:function(layer){var p=layer._point,r=Math.max(Math.round(layer._radius),1),r2=Math.max(Math.round(layer._radiusY),1)||r,arc="a"+r+","+r2+" 0 1,0 ",d=layer._empty()?"M0 0":"M"+(p.x-r)+","+p.y+arc+r*2+",0 "+arc+-r*2+",0 ";this._setPath(layer,d)},_setPath:function(layer,path){layer._path.setAttribute("d",path)},_bringToFront:function(layer){toFront(layer._path)},_bringToBack:function(layer){toBack(layer._path)}});Browser.vml&&SVG.include(vmlMixin);function svg(options){return Browser.svg||Browser.vml?new SVG(options):null}Map2.include({getRenderer:function(layer){var renderer=layer.options.renderer||this._getPaneRenderer(layer.options.pane)||this.options.renderer||this._renderer;return renderer||(renderer=this._renderer=this._createRenderer()),this.hasLayer(renderer)||this.addLayer(renderer),renderer},_getPaneRenderer:function(name){if(name==="overlayPane"||name===void 0)return!1;var renderer=this._paneRenderers[name];return renderer===void 0&&(renderer=this._createRenderer({pane:name}),this._paneRenderers[name]=renderer),renderer},_createRenderer:function(options){return this.options.preferCanvas&&canvas(options)||svg(options)}});var Rectangle=Polygon.extend({initialize:function(latLngBounds,options){Polygon.prototype.initialize.call(this,this._boundsToLatLngs(latLngBounds),options)},setBounds:function(latLngBounds){return this.setLatLngs(this._boundsToLatLngs(latLngBounds))},_boundsToLatLngs:function(latLngBounds){return latLngBounds=toLatLngBounds(latLngBounds),[latLngBounds.getSouthWest(),latLngBounds.getNorthWest(),latLngBounds.getNorthEast(),latLngBounds.getSouthEast()]}});function rectangle(latLngBounds,options){return new Rectangle(latLngBounds,options)}SVG.create=create,SVG.pointsToPath=pointsToPath,GeoJSON.geometryToLayer=geometryToLayer,GeoJSON.coordsToLatLng=coordsToLatLng,GeoJSON.coordsToLatLngs=coordsToLatLngs,GeoJSON.latLngToCoords=latLngToCoords,GeoJSON.latLngsToCoords=latLngsToCoords,GeoJSON.getFeature=getFeature,GeoJSON.asFeature=asFeature,Map2.mergeOptions({boxZoom:!0});var BoxZoom=Handler.extend({initialize:function(map){this._map=map,this._container=map._container,this._pane=map._panes.overlayPane,this._resetStateTimeout=0,map.on("unload",this._destroy,this)},addHooks:function(){on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){off(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){remove(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),disableTextSelection(),disableImageDrag(),this._startPoint=this._map.mouseEventToContainerPoint(e),on(document,{contextmenu:stop,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=create$1("div","leaflet-zoom-box",this._container),addClass(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var bounds2=new Bounds(this._point,this._startPoint),size=bounds2.getSize();setPosition(this._box,bounds2.min),this._box.style.width=size.x+"px",this._box.style.height=size.y+"px"},_finish:function(){this._moved&&(remove(this._box),removeClass(this._container,"leaflet-crosshair")),enableTextSelection(),enableImageDrag(),off(document,{contextmenu:stop,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(bind(this._resetState,this),0);var bounds2=new LatLngBounds(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(bounds2).fire("boxzoomend",{boxZoomBounds:bounds2})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Map2.addInitHook("addHandler","boxZoom",BoxZoom),Map2.mergeOptions({doubleClickZoom:!0});var DoubleClickZoom=Handler.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var map=this._map,oldZoom=map.getZoom(),delta=map.options.zoomDelta,zoom2=e.originalEvent.shiftKey?oldZoom-delta:oldZoom+delta;map.options.doubleClickZoom==="center"?map.setZoom(zoom2):map.setZoomAround(e.containerPoint,zoom2)}});Map2.addInitHook("addHandler","doubleClickZoom",DoubleClickZoom),Map2.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Drag=Handler.extend({addHooks:function(){if(!this._draggable){var map=this._map;this._draggable=new Draggable(map._mapPane,map._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),map.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),map.on("zoomend",this._onZoomEnd,this),map.whenReady(this._onZoomEnd,this))}addClass(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){removeClass(this._map._container,"leaflet-grab"),removeClass(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var map=this._map;if(map._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var bounds2=toLatLngBounds(this._map.options.maxBounds);this._offsetLimit=toBounds(this._map.latLngToContainerPoint(bounds2.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(bounds2.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;map.fire("movestart").fire("dragstart"),map.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var time=this._lastTime=+new Date,pos=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(pos),this._times.push(time),this._prunePositions(time)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(time){for(;this._positions.length>1&&time-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var pxCenter=this._map.getSize().divideBy(2),pxWorldCenter=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=pxWorldCenter.subtract(pxCenter).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(value,threshold){return value-(value-threshold)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var offset=this._draggable._newPos.subtract(this._draggable._startPos),limit=this._offsetLimit;offset.x<limit.min.x&&(offset.x=this._viscousLimit(offset.x,limit.min.x)),offset.y<limit.min.y&&(offset.y=this._viscousLimit(offset.y,limit.min.y)),offset.x>limit.max.x&&(offset.x=this._viscousLimit(offset.x,limit.max.x)),offset.y>limit.max.y&&(offset.y=this._viscousLimit(offset.y,limit.max.y)),this._draggable._newPos=this._draggable._startPos.add(offset)}},_onPreDragWrap:function(){var worldWidth=this._worldWidth,halfWidth=Math.round(worldWidth/2),dx=this._initialWorldOffset,x=this._draggable._newPos.x,newX1=(x-halfWidth+dx)%worldWidth+halfWidth-dx,newX2=(x+halfWidth+dx)%worldWidth-halfWidth-dx,newX=Math.abs(newX1+dx)<Math.abs(newX2+dx)?newX1:newX2;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=newX},_onDragEnd:function(e){var map=this._map,options=map.options,noInertia=!options.inertia||e.noInertia||this._times.length<2;if(map.fire("dragend",e),noInertia)map.fire("moveend");else{this._prunePositions(+new Date);var direction=this._lastPos.subtract(this._positions[0]),duration=(this._lastTime-this._times[0])/1e3,ease=options.easeLinearity,speedVector=direction.multiplyBy(ease/duration),speed=speedVector.distanceTo([0,0]),limitedSpeed=Math.min(options.inertiaMaxSpeed,speed),limitedSpeedVector=speedVector.multiplyBy(limitedSpeed/speed),decelerationDuration=limitedSpeed/(options.inertiaDeceleration*ease),offset=limitedSpeedVector.multiplyBy(-decelerationDuration/2).round();!offset.x&&!offset.y?map.fire("moveend"):(offset=map._limitOffset(offset,map.options.maxBounds),requestAnimFrame(function(){map.panBy(offset,{duration:decelerationDuration,easeLinearity:ease,noMoveStart:!0,animate:!0})}))}}});Map2.addInitHook("addHandler","dragging",Drag),Map2.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Keyboard=Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(map){this._map=map,this._setPanDelta(map.options.keyboardPanDelta),this._setZoomDelta(map.options.zoomDelta)},addHooks:function(){var container=this._map._container;container.tabIndex<=0&&(container.tabIndex="0"),on(container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),off(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var body=document.body,docEl=document.documentElement,top=body.scrollTop||docEl.scrollTop,left=body.scrollLeft||docEl.scrollLeft;this._map._container.focus(),window.scrollTo(left,top)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(panDelta){var keys=this._panKeys={},codes=this.keyCodes,i,len;for(i=0,len=codes.left.length;i<len;i++)keys[codes.left[i]]=[-1*panDelta,0];for(i=0,len=codes.right.length;i<len;i++)keys[codes.right[i]]=[panDelta,0];for(i=0,len=codes.down.length;i<len;i++)keys[codes.down[i]]=[0,panDelta];for(i=0,len=codes.up.length;i<len;i++)keys[codes.up[i]]=[0,-1*panDelta]},_setZoomDelta:function(zoomDelta){var keys=this._zoomKeys={},codes=this.keyCodes,i,len;for(i=0,len=codes.zoomIn.length;i<len;i++)keys[codes.zoomIn[i]]=zoomDelta;for(i=0,len=codes.zoomOut.length;i<len;i++)keys[codes.zoomOut[i]]=-zoomDelta},_addHooks:function(){on(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){off(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(e){if(!(e.altKey||e.ctrlKey||e.metaKey)){var key=e.keyCode,map=this._map,offset;if(key in this._panKeys){if(!map._panAnim||!map._panAnim._inProgress)if(offset=this._panKeys[key],e.shiftKey&&(offset=toPoint(offset).multiplyBy(3)),map.options.maxBounds&&(offset=map._limitOffset(toPoint(offset),map.options.maxBounds)),map.options.worldCopyJump){var newLatLng=map.wrapLatLng(map.unproject(map.project(map.getCenter()).add(offset)));map.panTo(newLatLng)}else map.panBy(offset)}else if(key in this._zoomKeys)map.setZoom(map.getZoom()+(e.shiftKey?3:1)*this._zoomKeys[key]);else if(key===27&&map._popup&&map._popup.options.closeOnEscapeKey)map.closePopup();else return;stop(e)}}});Map2.addInitHook("addHandler","keyboard",Keyboard),Map2.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var ScrollWheelZoom=Handler.extend({addHooks:function(){on(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){off(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(e){var delta=getWheelDelta(e),debounce=this._map.options.wheelDebounceTime;this._delta+=delta,this._lastMousePos=this._map.mouseEventToContainerPoint(e),this._startTime||(this._startTime=+new Date);var left=Math.max(debounce-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(bind(this._performZoom,this),left),stop(e)},_performZoom:function(){var map=this._map,zoom2=map.getZoom(),snap=this._map.options.zoomSnap||0;map._stop();var d2=this._delta/(this._map.options.wheelPxPerZoomLevel*4),d3=4*Math.log(2/(1+Math.exp(-Math.abs(d2))))/Math.LN2,d4=snap?Math.ceil(d3/snap)*snap:d3,delta=map._limitZoom(zoom2+(this._delta>0?d4:-d4))-zoom2;this._delta=0,this._startTime=null,delta&&(map.options.scrollWheelZoom==="center"?map.setZoom(zoom2+delta):map.setZoomAround(this._lastMousePos,zoom2+delta))}});Map2.addInitHook("addHandler","scrollWheelZoom",ScrollWheelZoom);var tapHoldDelay=600;Map2.mergeOptions({tapHold:Browser.touchNative&&Browser.safari&&Browser.mobile,tapTolerance:15});var TapHold=Handler.extend({addHooks:function(){on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var first=e.touches[0];this._startPos=this._newPos=new Point(first.clientX,first.clientY),this._holdTimeout=setTimeout(bind(function(){this._cancel(),this._isTapValid()&&(on(document,"touchend",preventDefault),on(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",first))},this),tapHoldDelay),on(document,"touchend touchcancel contextmenu",this._cancel,this),on(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function cancelClickPrevent(){off(document,"touchend",preventDefault),off(document,"touchend touchcancel",cancelClickPrevent)},_cancel:function(){clearTimeout(this._holdTimeout),off(document,"touchend touchcancel contextmenu",this._cancel,this),off(document,"touchmove",this._onMove,this)},_onMove:function(e){var first=e.touches[0];this._newPos=new Point(first.clientX,first.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(type2,e){var simulatedEvent=new MouseEvent(type2,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});simulatedEvent._simulated=!0,e.target.dispatchEvent(simulatedEvent)}});Map2.addInitHook("addHandler","tapHold",TapHold),Map2.mergeOptions({touchZoom:Browser.touch,bounceAtZoomLimits:!0});var TouchZoom=Handler.extend({addHooks:function(){addClass(this._map._container,"leaflet-touch-zoom"),on(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){removeClass(this._map._container,"leaflet-touch-zoom"),off(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var map=this._map;if(!(!e.touches||e.touches.length!==2||map._animatingZoom||this._zooming)){var p1=map.mouseEventToContainerPoint(e.touches[0]),p2=map.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=map.getSize()._divideBy(2),this._startLatLng=map.containerPointToLatLng(this._centerPoint),map.options.touchZoom!=="center"&&(this._pinchStartLatLng=map.containerPointToLatLng(p1.add(p2)._divideBy(2))),this._startDist=p1.distanceTo(p2),this._startZoom=map.getZoom(),this._moved=!1,this._zooming=!0,map._stop(),on(document,"touchmove",this._onTouchMove,this),on(document,"touchend touchcancel",this._onTouchEnd,this),preventDefault(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var map=this._map,p1=map.mouseEventToContainerPoint(e.touches[0]),p2=map.mouseEventToContainerPoint(e.touches[1]),scale2=p1.distanceTo(p2)/this._startDist;if(this._zoom=map.getScaleZoom(scale2,this._startZoom),!map.options.bounceAtZoomLimits&&(this._zoom<map.getMinZoom()&&scale2<1||this._zoom>map.getMaxZoom()&&scale2>1)&&(this._zoom=map._limitZoom(this._zoom)),map.options.touchZoom==="center"){if(this._center=this._startLatLng,scale2===1)return}else{var delta=p1._add(p2)._divideBy(2)._subtract(this._centerPoint);if(scale2===1&&delta.x===0&&delta.y===0)return;this._center=map.unproject(map.project(this._pinchStartLatLng,this._zoom).subtract(delta),this._zoom)}this._moved||(map._moveStart(!0,!1),this._moved=!0),cancelAnimFrame(this._animRequest);var moveFn=bind(map._move,map,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=requestAnimFrame(moveFn,this,!0),preventDefault(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,cancelAnimFrame(this._animRequest),off(document,"touchmove",this._onTouchMove,this),off(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Map2.addInitHook("addHandler","touchZoom",TouchZoom),Map2.BoxZoom=BoxZoom,Map2.DoubleClickZoom=DoubleClickZoom,Map2.Drag=Drag,Map2.Keyboard=Keyboard,Map2.ScrollWheelZoom=ScrollWheelZoom,Map2.TapHold=TapHold,Map2.TouchZoom=TouchZoom,exports4.Bounds=Bounds,exports4.Browser=Browser,exports4.CRS=CRS,exports4.Canvas=Canvas,exports4.Circle=Circle,exports4.CircleMarker=CircleMarker,exports4.Class=Class,exports4.Control=Control,exports4.DivIcon=DivIcon,exports4.DivOverlay=DivOverlay,exports4.DomEvent=DomEvent,exports4.DomUtil=DomUtil,exports4.Draggable=Draggable,exports4.Evented=Evented,exports4.FeatureGroup=FeatureGroup,exports4.GeoJSON=GeoJSON,exports4.GridLayer=GridLayer,exports4.Handler=Handler,exports4.Icon=Icon,exports4.ImageOverlay=ImageOverlay,exports4.LatLng=LatLng,exports4.LatLngBounds=LatLngBounds,exports4.Layer=Layer2,exports4.LayerGroup=LayerGroup,exports4.LineUtil=LineUtil,exports4.Map=Map2,exports4.Marker=Marker,exports4.Mixin=Mixin,exports4.Path=Path2,exports4.Point=Point,exports4.PolyUtil=PolyUtil,exports4.Polygon=Polygon,exports4.Polyline=Polyline,exports4.Popup=Popup,exports4.PosAnimation=PosAnimation,exports4.Projection=index2,exports4.Rectangle=Rectangle,exports4.Renderer=Renderer,exports4.SVG=SVG,exports4.SVGOverlay=SVGOverlay,exports4.TileLayer=TileLayer2,exports4.Tooltip=Tooltip,exports4.Transformation=Transformation,exports4.Util=Util,exports4.VideoOverlay=VideoOverlay,exports4.bind=bind,exports4.bounds=toBounds,exports4.canvas=canvas,exports4.circle=circle2,exports4.circleMarker=circleMarker,exports4.control=control,exports4.divIcon=divIcon,exports4.extend=extend,exports4.featureGroup=featureGroup,exports4.geoJSON=geoJSON,exports4.geoJson=geoJson,exports4.gridLayer=gridLayer,exports4.icon=icon,exports4.imageOverlay=imageOverlay,exports4.latLng=toLatLng,exports4.latLngBounds=toLatLngBounds,exports4.layerGroup=layerGroup,exports4.map=createMap,exports4.marker=marker,exports4.point=toPoint,exports4.polygon=polygon,exports4.polyline=polyline,exports4.popup=popup,exports4.rectangle=rectangle,exports4.setOptions=setOptions,exports4.stamp=stamp,exports4.svg=svg,exports4.svgOverlay=svgOverlay,exports4.tileLayer=tileLayer,exports4.tooltip=tooltip,exports4.transformation=toTransformation,exports4.version=version,exports4.videoOverlay=videoOverlay;var oldL=window.L;exports4.noConflict=function(){return window.L=oldL,this},window.L=exports4})}(leafletSrc$1,leafletSrc$1.exports)),leafletSrc$1.exports}var leafletSrcExports=requireLeafletSrc();const L$1=getDefaultExportFromCjs(leafletSrcExports);(function(t,e,i){function o(t2,e2){for(;(t2=t2.parentElement)&&!t2.classList.contains(e2););return t2}L.drawVersion="1.0.4",L.Draw={},L.drawLocal={draw:{toolbar:{actions:{title:"Cancel drawing",text:"Cancel"},finish:{title:"Finish drawing",text:"Finish"},undo:{title:"Delete last point drawn",text:"Delete last point"},buttons:{polyline:"Draw a polyline",polygon:"Draw a polygon",rectangle:"Draw a rectangle",circle:"Draw a circle",marker:"Draw a marker",circlemarker:"Draw a circlemarker"}},handlers:{circle:{tooltip:{start:"Click and drag to draw circle."},radius:"Radius"},circlemarker:{tooltip:{start:"Click map to place circle marker."}},marker:{tooltip:{start:"Click map to place marker."}},polygon:{tooltip:{start:"Click to start drawing shape.",cont:"Click to continue drawing shape.",end:"Click first point to close this shape."}},polyline:{error:"<strong>Error:</strong> shape edges cannot cross!",tooltip:{start:"Click to start drawing line.",cont:"Click to continue drawing line.",end:"Click last point to finish line."}},rectangle:{tooltip:{start:"Click and drag to draw rectangle."}},simpleshape:{tooltip:{end:"Release mouse to finish drawing."}}}},edit:{toolbar:{actions:{save:{title:"Save changes",text:"Save"},cancel:{title:"Cancel editing, discards all changes",text:"Cancel"},clearAll:{title:"Clear all layers",text:"Clear All"}},buttons:{edit:"Edit layers",editDisabled:"No layers to edit",remove:"Delete layers",removeDisabled:"No layers to delete"}},handlers:{edit:{tooltip:{text:"Drag handles or markers to edit features.",subtext:"Click cancel to undo changes."}},remove:{tooltip:{text:"Click on a feature to remove."}}}}},L.Draw.Event={},L.Draw.Event.CREATED="draw:created",L.Draw.Event.EDITED="draw:edited",L.Draw.Event.DELETED="draw:deleted",L.Draw.Event.DRAWSTART="draw:drawstart",L.Draw.Event.DRAWSTOP="draw:drawstop",L.Draw.Event.DRAWVERTEX="draw:drawvertex",L.Draw.Event.EDITSTART="draw:editstart",L.Draw.Event.EDITMOVE="draw:editmove",L.Draw.Event.EDITRESIZE="draw:editresize",L.Draw.Event.EDITVERTEX="draw:editvertex",L.Draw.Event.EDITSTOP="draw:editstop",L.Draw.Event.DELETESTART="draw:deletestart",L.Draw.Event.DELETESTOP="draw:deletestop",L.Draw.Event.TOOLBAROPENED="draw:toolbaropened",L.Draw.Event.TOOLBARCLOSED="draw:toolbarclosed",L.Draw.Event.MARKERCONTEXT="draw:markercontext",L.Draw=L.Draw||{},L.Draw.Feature=L.Handler.extend({initialize:function(t2,e2){this._map=t2,this._container=t2._container,this._overlayPane=t2._panes.overlayPane,this._popupPane=t2._panes.popupPane,e2&&e2.shapeOptions&&(e2.shapeOptions=L.Util.extend({},this.options.shapeOptions,e2.shapeOptions)),L.setOptions(this,e2);var i2=L.version.split(".");parseInt(i2[0],10)===1&&parseInt(i2[1],10)>=2?L.Draw.Feature.include(L.Evented.prototype):L.Draw.Feature.include(L.Mixin.Events)},enable:function(){this._enabled||(L.Handler.prototype.enable.call(this),this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DRAWSTART,{layerType:this.type}))},disable:function(){this._enabled&&(L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DRAWSTOP,{layerType:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t2=this._map;t2&&(L.DomUtil.disableTextSelection(),t2.getContainer().focus(),this._tooltip=new L.Draw.Tooltip(this._map),L.DomEvent.on(this._container,"keyup",this._cancelDrawing,this))},removeHooks:function(){this._map&&(L.DomUtil.enableTextSelection(),this._tooltip.dispose(),this._tooltip=null,L.DomEvent.off(this._container,"keyup",this._cancelDrawing,this))},setOptions:function(t2){L.setOptions(this,t2)},_fireCreatedEvent:function(t2){this._map.fire(L.Draw.Event.CREATED,{layer:t2,layerType:this.type})},_cancelDrawing:function(t2){t2.keyCode===27&&(this._map.fire("draw:canceled",{layerType:this.type}),this.disable())}}),L.Draw.Polyline=L.Draw.Feature.extend({statics:{TYPE:"polyline"},Poly:L.Polyline,options:{allowIntersection:!0,repeatMode:!1,drawError:{color:"#b00b00",timeout:2500},icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),guidelineDistance:20,maxGuideLineLength:4e3,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!1,clickable:!0},metric:!0,feet:!0,nautic:!1,showLength:!0,zIndexOffset:2e3,factor:1,maxPoints:0},initialize:function(t2,e2){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this.options.drawError.message=L.drawLocal.draw.handlers.polyline.error,e2&&e2.drawError&&(e2.drawError=L.Util.extend({},this.options.drawError,e2.drawError)),this.type=L.Draw.Polyline.TYPE,L.Draw.Feature.prototype.initialize.call(this,t2,e2)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._markers=[],this._markerGroup=new L.LayerGroup,this._map.addLayer(this._markerGroup),this._poly=new L.Polyline([],this.options.shapeOptions),this._tooltip.updateContent(this._getTooltipText()),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("mouseout",this._onMouseOut,this).on("mousemove",this._onMouseMove,this).on("mousedown",this._onMouseDown,this).on("mouseup",this._onMouseUp,this).addTo(this._map),this._map.on("mouseup",this._onMouseUp,this).on("mousemove",this._onMouseMove,this).on("zoomlevelschange",this._onZoomEnd,this).on("touchstart",this._onTouch,this).on("zoomend",this._onZoomEnd,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._clearHideErrorTimeout(),this._cleanUpShape(),this._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers,this._map.removeLayer(this._poly),delete this._poly,this._mouseMarker.off("mousedown",this._onMouseDown,this).off("mouseout",this._onMouseOut,this).off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._clearGuides(),this._map.off("mouseup",this._onMouseUp,this).off("mousemove",this._onMouseMove,this).off("zoomlevelschange",this._onZoomEnd,this).off("zoomend",this._onZoomEnd,this).off("touchstart",this._onTouch,this).off("click",this._onTouch,this)},deleteLastVertex:function(){if(!(this._markers.length<=1)){var t2=this._markers.pop(),e2=this._poly,i2=e2.getLatLngs(),o2=i2.splice(-1,1)[0];this._poly.setLatLngs(i2),this._markerGroup.removeLayer(t2),e2.getLatLngs().length<2&&this._map.removeLayer(e2),this._vertexChanged(o2,!1)}},addVertex:function(t2){if(this._markers.length>=2&&!this.options.allowIntersection&&this._poly.newLatLngIntersects(t2))return void this._showErrorTooltip();this._errorShown&&this._hideErrorTooltip(),this._markers.push(this._createMarker(t2)),this._poly.addLatLng(t2),this._poly.getLatLngs().length===2&&this._map.addLayer(this._poly),this._vertexChanged(t2,!0)},completeShape:function(){this._markers.length<=1||!this._shapeIsValid()||(this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable())},_finishShape:function(){var t2=this._poly._defaultShape?this._poly._defaultShape():this._poly.getLatLngs(),e2=this._poly.newLatLngIntersects(t2[t2.length-1]);if(!this.options.allowIntersection&&e2||!this._shapeIsValid())return void this._showErrorTooltip();this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_shapeIsValid:function(){return!0},_onZoomEnd:function(){this._markers!==null&&this._updateGuide()},_onMouseMove:function(t2){var e2=this._map.mouseEventToLayerPoint(t2.originalEvent),i2=this._map.layerPointToLatLng(e2);this._currentLatLng=i2,this._updateTooltip(i2),this._updateGuide(e2),this._mouseMarker.setLatLng(i2),L.DomEvent.preventDefault(t2.originalEvent)},_vertexChanged:function(t2,e2){this._map.fire(L.Draw.Event.DRAWVERTEX,{layers:this._markerGroup}),this._updateFinishHandler(),this._updateRunningMeasure(t2,e2),this._clearGuides(),this._updateTooltip()},_onMouseDown:function(t2){if(!this._clickHandled&&!this._touchHandled&&!this._disableMarkers){this._onMouseMove(t2),this._clickHandled=!0,this._disableNewMarkers();var e2=t2.originalEvent,i2=e2.clientX,o2=e2.clientY;this._startPoint.call(this,i2,o2)}},_startPoint:function(t2,e2){this._mouseDownOrigin=L.point(t2,e2)},_onMouseUp:function(t2){var e2=t2.originalEvent,i2=e2.clientX,o2=e2.clientY;this._endPoint.call(this,i2,o2,t2),this._clickHandled=null},_endPoint:function(e2,i2,o2){if(this._mouseDownOrigin){var a=L.point(e2,i2).distanceTo(this._mouseDownOrigin),n=this._calculateFinishDistance(o2.latlng);this.options.maxPoints>1&&this.options.maxPoints==this._markers.length+1?(this.addVertex(o2.latlng),this._finishShape()):n<10&&L.Browser.touch?this._finishShape():Math.abs(a)<9*(t.devicePixelRatio||1)&&this.addVertex(o2.latlng),this._enableNewMarkers()}this._mouseDownOrigin=null},_onTouch:function(t2){var e2,i2,o2=t2.originalEvent;!o2.touches||!o2.touches[0]||this._clickHandled||this._touchHandled||this._disableMarkers||(e2=o2.touches[0].clientX,i2=o2.touches[0].clientY,this._disableNewMarkers(),this._touchHandled=!0,this._startPoint.call(this,e2,i2),this._endPoint.call(this,e2,i2,t2),this._touchHandled=null),this._clickHandled=null},_onMouseOut:function(){this._tooltip&&this._tooltip._onMouseOut.call(this._tooltip)},_calculateFinishDistance:function(t2){var e2;if(this._markers.length>0){var i2;if(this.type===L.Draw.Polyline.TYPE)i2=this._markers[this._markers.length-1];else{if(this.type!==L.Draw.Polygon.TYPE)return 1/0;i2=this._markers[0]}var o2=this._map.latLngToContainerPoint(i2.getLatLng()),a=new L.Marker(t2,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset}),n=this._map.latLngToContainerPoint(a.getLatLng());e2=o2.distanceTo(n)}else e2=1/0;return e2},_updateFinishHandler:function(){var t2=this._markers.length;t2>1&&this._markers[t2-1].on("click",this._finishShape,this),t2>2&&this._markers[t2-2].off("click",this._finishShape,this)},_createMarker:function(t2){var e2=new L.Marker(t2,{icon:this.options.icon,zIndexOffset:2*this.options.zIndexOffset});return this._markerGroup.addLayer(e2),e2},_updateGuide:function(t2){var e2=this._markers?this._markers.length:0;e2>0&&(t2=t2||this._map.latLngToLayerPoint(this._currentLatLng),this._clearGuides(),this._drawGuide(this._map.latLngToLayerPoint(this._markers[e2-1].getLatLng()),t2))},_updateTooltip:function(t2){var e2=this._getTooltipText();t2&&this._tooltip.updatePosition(t2),this._errorShown||this._tooltip.updateContent(e2)},_drawGuide:function(t2,e2){var i2,o2,a,n=Math.floor(Math.sqrt(Math.pow(e2.x-t2.x,2)+Math.pow(e2.y-t2.y,2))),s=this.options.guidelineDistance,r=this.options.maxGuideLineLength,l=n>r?n-r:s;for(this._guidesContainer||(this._guidesContainer=L.DomUtil.create("div","leaflet-draw-guides",this._overlayPane));l<n;l+=this.options.guidelineDistance)i2=l/n,o2={x:Math.floor(t2.x*(1-i2)+i2*e2.x),y:Math.floor(t2.y*(1-i2)+i2*e2.y)},a=L.DomUtil.create("div","leaflet-draw-guide-dash",this._guidesContainer),a.style.backgroundColor=this._errorShown?this.options.drawError.color:this.options.shapeOptions.color,L.DomUtil.setPosition(a,o2)},_updateGuideColor:function(t2){if(this._guidesContainer)for(var e2=0,i2=this._guidesContainer.childNodes.length;e2<i2;e2++)this._guidesContainer.childNodes[e2].style.backgroundColor=t2},_clearGuides:function(){if(this._guidesContainer)for(;this._guidesContainer.firstChild;)this._guidesContainer.removeChild(this._guidesContainer.firstChild)},_getTooltipText:function(){var t2,e2,i2=this.options.showLength;return this._markers.length===0?t2={text:L.drawLocal.draw.handlers.polyline.tooltip.start}:(e2=i2?this._getMeasurementString():"",t2=this._markers.length===1?{text:L.drawLocal.draw.handlers.polyline.tooltip.cont,subtext:e2}:{text:L.drawLocal.draw.handlers.polyline.tooltip.end,subtext:e2}),t2},_updateRunningMeasure:function(t2,e2){var i2,o2,a=this._markers.length;this._markers.length===1?this._measurementRunningTotal=0:(i2=a-(e2?2:1),o2=L.GeometryUtil.isVersion07x()?t2.distanceTo(this._markers[i2].getLatLng())*(this.options.factor||1):this._map.distance(t2,this._markers[i2].getLatLng())*(this.options.factor||1),this._measurementRunningTotal+=o2*(e2?1:-1))},_getMeasurementString:function(){var t2,e2=this._currentLatLng,i2=this._markers[this._markers.length-1].getLatLng();return t2=L.GeometryUtil.isVersion07x()?i2&&e2&&e2.distanceTo?this._measurementRunningTotal+e2.distanceTo(i2)*(this.options.factor||1):this._measurementRunningTotal||0:i2&&e2?this._measurementRunningTotal+this._map.distance(e2,i2)*(this.options.factor||1):this._measurementRunningTotal||0,L.GeometryUtil.readableDistance(t2,this.options.metric,this.options.feet,this.options.nautic,this.options.precision)},_showErrorTooltip:function(){this._errorShown=!0,this._tooltip.showAsError().updateContent({text:this.options.drawError.message}),this._updateGuideColor(this.options.drawError.color),this._poly.setStyle({color:this.options.drawError.color}),this._clearHideErrorTimeout(),this._hideErrorTimeout=setTimeout(L.Util.bind(this._hideErrorTooltip,this),this.options.drawError.timeout)},_hideErrorTooltip:function(){this._errorShown=!1,this._clearHideErrorTimeout(),this._tooltip.removeError().updateContent(this._getTooltipText()),this._updateGuideColor(this.options.shapeOptions.color),this._poly.setStyle({color:this.options.shapeOptions.color})},_clearHideErrorTimeout:function(){this._hideErrorTimeout&&(clearTimeout(this._hideErrorTimeout),this._hideErrorTimeout=null)},_disableNewMarkers:function(){this._disableMarkers=!0},_enableNewMarkers:function(){setTimeout((function(){this._disableMarkers=!1}).bind(this),50)},_cleanUpShape:function(){this._markers.length>1&&this._markers[this._markers.length-1].off("click",this._finishShape,this)},_fireCreatedEvent:function(){var t2=new this.Poly(this._poly.getLatLngs(),this.options.shapeOptions);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t2)}}),L.Draw.Polygon=L.Draw.Polyline.extend({statics:{TYPE:"polygon"},Poly:L.Polygon,options:{showArea:!1,showLength:!1,shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},metric:!0,feet:!0,nautic:!1,precision:{}},initialize:function(t2,e2){L.Draw.Polyline.prototype.initialize.call(this,t2,e2),this.type=L.Draw.Polygon.TYPE},_updateFinishHandler:function(){var t2=this._markers.length;t2===1&&this._markers[0].on("click",this._finishShape,this),t2>2&&(this._markers[t2-1].on("dblclick",this._finishShape,this),t2>3&&this._markers[t2-2].off("dblclick",this._finishShape,this))},_getTooltipText:function(){var t2,e2;return this._markers.length===0?t2=L.drawLocal.draw.handlers.polygon.tooltip.start:this._markers.length<3?(t2=L.drawLocal.draw.handlers.polygon.tooltip.cont,e2=this._getMeasurementString()):(t2=L.drawLocal.draw.handlers.polygon.tooltip.end,e2=this._getMeasurementString()),{text:t2,subtext:e2}},_getMeasurementString:function(){var t2=this._area,e2="";return t2||this.options.showLength?(this.options.showLength&&(e2=L.Draw.Polyline.prototype._getMeasurementString.call(this)),t2&&(e2+="<br>"+L.GeometryUtil.readableArea(t2,this.options.metric,this.options.precision)),e2):null},_shapeIsValid:function(){return this._markers.length>=3},_vertexChanged:function(t2,e2){var i2;!this.options.allowIntersection&&this.options.showArea&&(i2=this._poly.getLatLngs(),this._area=L.GeometryUtil.geodesicArea(i2)),L.Draw.Polyline.prototype._vertexChanged.call(this,t2,e2)},_cleanUpShape:function(){var t2=this._markers.length;t2>0&&(this._markers[0].off("click",this._finishShape,this),t2>2&&this._markers[t2-1].off("dblclick",this._finishShape,this))}}),L.SimpleShape={},L.Draw.SimpleShape=L.Draw.Feature.extend({options:{repeatMode:!1},initialize:function(t2,e2){this._endLabelText=L.drawLocal.draw.handlers.simpleshape.tooltip.end,L.Draw.Feature.prototype.initialize.call(this,t2,e2)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._mapDraggable=this._map.dragging.enabled(),this._mapDraggable&&this._map.dragging.disable(),this._container.style.cursor="crosshair",this._tooltip.updateContent({text:this._initialLabelText}),this._map.on("mousedown",this._onMouseDown,this).on("mousemove",this._onMouseMove,this).on("touchstart",this._onMouseDown,this).on("touchmove",this._onMouseMove,this),e.addEventListener("touchstart",L.DomEvent.preventDefault,{passive:!1}))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._mapDraggable&&this._map.dragging.enable(),this._container.style.cursor="",this._map.off("mousedown",this._onMouseDown,this).off("mousemove",this._onMouseMove,this).off("touchstart",this._onMouseDown,this).off("touchmove",this._onMouseMove,this),L.DomEvent.off(e,"mouseup",this._onMouseUp,this),L.DomEvent.off(e,"touchend",this._onMouseUp,this),e.removeEventListener("touchstart",L.DomEvent.preventDefault),this._shape&&(this._map.removeLayer(this._shape),delete this._shape)),this._isDrawing=!1},_getTooltipText:function(){return{text:this._endLabelText}},_onMouseDown:function(t2){this._isDrawing=!0,this._startLatLng=t2.latlng,L.DomEvent.on(e,"mouseup",this._onMouseUp,this).on(e,"touchend",this._onMouseUp,this).preventDefault(t2.originalEvent)},_onMouseMove:function(t2){var e2=t2.latlng;this._tooltip.updatePosition(e2),this._isDrawing&&(this._tooltip.updateContent(this._getTooltipText()),this._drawShape(e2))},_onMouseUp:function(){this._shape&&this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()}}),L.Draw.Rectangle=L.Draw.SimpleShape.extend({statics:{TYPE:"rectangle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showArea:!0,metric:!0},initialize:function(t2,e2){this.type=L.Draw.Rectangle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.rectangle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t2,e2)},disable:function(){this._enabled&&(this._isCurrentlyTwoClickDrawing=!1,L.Draw.SimpleShape.prototype.disable.call(this))},_onMouseUp:function(t2){if(!this._shape&&!this._isCurrentlyTwoClickDrawing)return void(this._isCurrentlyTwoClickDrawing=!0);this._isCurrentlyTwoClickDrawing&&!o(t2.target,"leaflet-pane")||L.Draw.SimpleShape.prototype._onMouseUp.call(this)},_drawShape:function(t2){this._shape?this._shape.setBounds(new L.LatLngBounds(this._startLatLng,t2)):(this._shape=new L.Rectangle(new L.LatLngBounds(this._startLatLng,t2),this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t2=new L.Rectangle(this._shape.getBounds(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t2)},_getTooltipText:function(){var t2,e2,i2,o2=L.Draw.SimpleShape.prototype._getTooltipText.call(this),a=this._shape,n=this.options.showArea;return a&&(t2=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),e2=L.GeometryUtil.geodesicArea(t2),i2=n?L.GeometryUtil.readableArea(e2,this.options.metric):""),{text:o2.text,subtext:i2}}}),L.Draw.Marker=L.Draw.Feature.extend({statics:{TYPE:"marker"},options:{icon:new L.Icon.Default,repeatMode:!1,zIndexOffset:2e3},initialize:function(t2,e2){this.type=L.Draw.Marker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.marker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t2,e2)},addHooks:function(){L.Draw.Feature.prototype.addHooks.call(this),this._map&&(this._tooltip.updateContent({text:this._initialLabelText}),this._mouseMarker||(this._mouseMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"leaflet-mouse-marker",iconAnchor:[20,20],iconSize:[40,40]}),opacity:0,zIndexOffset:this.options.zIndexOffset})),this._mouseMarker.on("click",this._onClick,this).addTo(this._map),this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onTouch,this))},removeHooks:function(){L.Draw.Feature.prototype.removeHooks.call(this),this._map&&(this._map.off("click",this._onClick,this).off("click",this._onTouch,this),this._marker&&(this._marker.off("click",this._onClick,this),this._map.removeLayer(this._marker),delete this._marker),this._mouseMarker.off("click",this._onClick,this),this._map.removeLayer(this._mouseMarker),delete this._mouseMarker,this._map.off("mousemove",this._onMouseMove,this))},_onMouseMove:function(t2){var e2=t2.latlng;this._tooltip.updatePosition(e2),this._mouseMarker.setLatLng(e2),this._marker?(e2=this._mouseMarker.getLatLng(),this._marker.setLatLng(e2)):(this._marker=this._createMarker(e2),this._marker.on("click",this._onClick,this),this._map.on("click",this._onClick,this).addLayer(this._marker))},_createMarker:function(t2){return new L.Marker(t2,{icon:this.options.icon,zIndexOffset:this.options.zIndexOffset})},_onClick:function(){this._fireCreatedEvent(),this.disable(),this.options.repeatMode&&this.enable()},_onTouch:function(t2){this._onMouseMove(t2),this._onClick()},_fireCreatedEvent:function(){var t2=new L.Marker.Touch(this._marker.getLatLng(),{icon:this.options.icon});L.Draw.Feature.prototype._fireCreatedEvent.call(this,t2)}}),L.Draw.CircleMarker=L.Draw.Marker.extend({statics:{TYPE:"circlemarker"},options:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0,zIndexOffset:2e3},initialize:function(t2,e2){this.type=L.Draw.CircleMarker.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circlemarker.tooltip.start,L.Draw.Feature.prototype.initialize.call(this,t2,e2)},_fireCreatedEvent:function(){var t2=new L.CircleMarker(this._marker.getLatLng(),this.options);L.Draw.Feature.prototype._fireCreatedEvent.call(this,t2)},_createMarker:function(t2){return new L.CircleMarker(t2,this.options)}}),L.Draw.Circle=L.Draw.SimpleShape.extend({statics:{TYPE:"circle"},options:{shapeOptions:{stroke:!0,color:"#3388ff",weight:4,opacity:.5,fill:!0,fillColor:null,fillOpacity:.2,clickable:!0},showRadius:!0,metric:!0,feet:!0,nautic:!1},initialize:function(t2,e2){this.type=L.Draw.Circle.TYPE,this._initialLabelText=L.drawLocal.draw.handlers.circle.tooltip.start,L.Draw.SimpleShape.prototype.initialize.call(this,t2,e2)},_drawShape:function(t2){if(L.GeometryUtil.isVersion07x())var e2=this._startLatLng.distanceTo(t2);else var e2=this._map.distance(this._startLatLng,t2);this._shape?this._shape.setRadius(e2):(this._shape=new L.Circle(this._startLatLng,e2,this.options.shapeOptions),this._map.addLayer(this._shape))},_fireCreatedEvent:function(){var t2=new L.Circle(this._startLatLng,this._shape.getRadius(),this.options.shapeOptions);L.Draw.SimpleShape.prototype._fireCreatedEvent.call(this,t2)},_onMouseMove:function(t2){var e2,i2=t2.latlng,o2=this.options.showRadius,a=this.options.metric;if(this._tooltip.updatePosition(i2),this._isDrawing){this._drawShape(i2),e2=this._shape.getRadius().toFixed(1);var n="";o2&&(n=L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(e2,a,this.options.feet,this.options.nautic)),this._tooltip.updateContent({text:this._endLabelText,subtext:n})}}}),L.Edit=L.Edit||{},L.Edit.Marker=L.Handler.extend({initialize:function(t2,e2){this._marker=t2,L.setOptions(this,e2)},addHooks:function(){var t2=this._marker;t2.dragging.enable(),t2.on("dragend",this._onDragEnd,t2),this._toggleMarkerHighlight()},removeHooks:function(){var t2=this._marker;t2.dragging.disable(),t2.off("dragend",this._onDragEnd,t2),this._toggleMarkerHighlight()},_onDragEnd:function(t2){var e2=t2.target;e2.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e2})},_toggleMarkerHighlight:function(){var t2=this._marker._icon;t2&&(t2.style.display="none",L.DomUtil.hasClass(t2,"leaflet-edit-marker-selected")?(L.DomUtil.removeClass(t2,"leaflet-edit-marker-selected"),this._offsetMarker(t2,-4)):(L.DomUtil.addClass(t2,"leaflet-edit-marker-selected"),this._offsetMarker(t2,4)),t2.style.display="")},_offsetMarker:function(t2,e2){var i2=parseInt(t2.style.marginTop,10)-e2,o2=parseInt(t2.style.marginLeft,10)-e2;t2.style.marginTop=i2+"px",t2.style.marginLeft=o2+"px"}}),L.Marker.addInitHook(function(){L.Edit.Marker&&(this.editing=new L.Edit.Marker(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.Poly=L.Handler.extend({initialize:function(t2){this.latlngs=[t2._latlngs],t2._holes&&(this.latlngs=this.latlngs.concat(t2._holes)),this._poly=t2,this._poly.on("revert-edited",this._updateLatLngs,this)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._poly._latlngs)?this._poly._latlngs:this._poly._latlngs[0]:this._poly._latlngs},_eachVertexHandler:function(t2){for(var e2=0;e2<this._verticesHandlers.length;e2++)t2(this._verticesHandlers[e2])},addHooks:function(){this._initHandlers(),this._eachVertexHandler(function(t2){t2.addHooks()})},removeHooks:function(){this._eachVertexHandler(function(t2){t2.removeHooks()})},updateMarkers:function(){this._eachVertexHandler(function(t2){t2.updateMarkers()})},_initHandlers:function(){this._verticesHandlers=[];for(var t2=0;t2<this.latlngs.length;t2++)this._verticesHandlers.push(new L.Edit.PolyVerticesEdit(this._poly,this.latlngs[t2],this._poly.options.poly))},_updateLatLngs:function(t2){this.latlngs=[t2.layer._latlngs],t2.layer._holes&&(this.latlngs=this.latlngs.concat(t2.layer._holes))}}),L.Edit.PolyVerticesEdit=L.Handler.extend({options:{icon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon"}),touchIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-touch-icon"}),drawError:{color:"#b00b00",timeout:1e3}},initialize:function(t2,e2,i2){L.Browser.touch&&(this.options.icon=this.options.touchIcon),this._poly=t2,i2&&i2.drawError&&(i2.drawError=L.Util.extend({},this.options.drawError,i2.drawError)),this._latlngs=e2,L.setOptions(this,i2)},_defaultShape:function(){return L.Polyline._flat?L.Polyline._flat(this._latlngs)?this._latlngs:this._latlngs[0]:this._latlngs},addHooks:function(){var t2=this._poly,e2=t2._path;t2 instanceof L.Polygon||(t2.options.fill=!1,t2.options.editing&&(t2.options.editing.fill=!1)),e2&&t2.options.editing&&t2.options.editing.className&&(t2.options.original.className&&t2.options.original.className.split(" ").forEach(function(t3){L.DomUtil.removeClass(e2,t3)}),t2.options.editing.className.split(" ").forEach(function(t3){L.DomUtil.addClass(e2,t3)})),t2.setStyle(t2.options.editing),this._poly._map&&(this._map=this._poly._map,this._markerGroup||this._initMarkers(),this._poly._map.addLayer(this._markerGroup))},removeHooks:function(){var t2=this._poly,e2=t2._path;e2&&t2.options.editing&&t2.options.editing.className&&(t2.options.editing.className.split(" ").forEach(function(t3){L.DomUtil.removeClass(e2,t3)}),t2.options.original.className&&t2.options.original.className.split(" ").forEach(function(t3){L.DomUtil.addClass(e2,t3)})),t2.setStyle(t2.options.original),t2._map&&(t2._map.removeLayer(this._markerGroup),delete this._markerGroup,delete this._markers)},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._markers=[];var t2,e2,i2,o2,a=this._defaultShape();for(t2=0,i2=a.length;t2<i2;t2++)o2=this._createMarker(a[t2],t2),o2.on("click",this._onMarkerClick,this),o2.on("contextmenu",this._onContextMenu,this),this._markers.push(o2);var n,s;for(t2=0,e2=i2-1;t2<i2;e2=t2++)(t2!==0||L.Polygon&&this._poly instanceof L.Polygon)&&(n=this._markers[e2],s=this._markers[t2],this._createMiddleMarker(n,s),this._updatePrevNext(n,s))},_createMarker:function(t2,e2){var i2=new L.Marker.Touch(t2,{draggable:!0,icon:this.options.icon});return i2._origLatLng=t2,i2._index=e2,i2.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._fireEdit,this).on("touchmove",this._onTouchMove,this).on("touchend",this._fireEdit,this).on("MSPointerMove",this._onTouchMove,this).on("MSPointerUp",this._fireEdit,this),this._markerGroup.addLayer(i2),i2},_onMarkerDragStart:function(){this._poly.fire("editstart")},_spliceLatLngs:function(){var t2=this._defaultShape(),e2=[].splice.apply(t2,arguments);return this._poly._convertLatLngs(t2,!0),this._poly.redraw(),e2},_removeMarker:function(t2){var e2=t2._index;this._markerGroup.removeLayer(t2),this._markers.splice(e2,1),this._spliceLatLngs(e2,1),this._updateIndexes(e2,-1),t2.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._fireEdit,this).off("touchmove",this._onMarkerDrag,this).off("touchend",this._fireEdit,this).off("click",this._onMarkerClick,this).off("MSPointerMove",this._onTouchMove,this).off("MSPointerUp",this._fireEdit,this)},_fireEdit:function(){this._poly.edited=!0,this._poly.fire("edit"),this._poly._map.fire(L.Draw.Event.EDITVERTEX,{layers:this._markerGroup,poly:this._poly})},_onMarkerDrag:function(t2){var e2=t2.target,i2=this._poly,o2=L.LatLngUtil.cloneLatLng(e2._origLatLng);if(L.extend(e2._origLatLng,e2._latlng),i2.options.poly){var a=i2._map._editTooltip;if(!i2.options.poly.allowIntersection&&i2.intersects()){L.extend(e2._origLatLng,o2),e2.setLatLng(o2);var n=i2.options.color;i2.setStyle({color:this.options.drawError.color}),a&&a.updateContent({text:L.drawLocal.draw.handlers.polyline.error}),setTimeout(function(){i2.setStyle({color:n}),a&&a.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext})},1e3)}}e2._middleLeft&&e2._middleLeft.setLatLng(this._getMiddleLatLng(e2._prev,e2)),e2._middleRight&&e2._middleRight.setLatLng(this._getMiddleLatLng(e2,e2._next)),this._poly._bounds._southWest=L.latLng(1/0,1/0),this._poly._bounds._northEast=L.latLng(-1/0,-1/0);var s=this._poly.getLatLngs();this._poly._convertLatLngs(s,!0),this._poly.redraw(),this._poly.fire("editdrag")},_onMarkerClick:function(t2){var e2=L.Polygon&&this._poly instanceof L.Polygon?4:3,i2=t2.target;this._defaultShape().length<e2||(this._removeMarker(i2),this._updatePrevNext(i2._prev,i2._next),i2._middleLeft&&this._markerGroup.removeLayer(i2._middleLeft),i2._middleRight&&this._markerGroup.removeLayer(i2._middleRight),i2._prev&&i2._next?this._createMiddleMarker(i2._prev,i2._next):i2._prev?i2._next||(i2._prev._middleRight=null):i2._next._middleLeft=null,this._fireEdit())},_onContextMenu:function(t2){var e2=t2.target;this._poly,this._poly._map.fire(L.Draw.Event.MARKERCONTEXT,{marker:e2,layers:this._markerGroup,poly:this._poly}),L.DomEvent.stopPropagation},_onTouchMove:function(t2){var e2=this._map.mouseEventToLayerPoint(t2.originalEvent.touches[0]),i2=this._map.layerPointToLatLng(e2),o2=t2.target;L.extend(o2._origLatLng,i2),o2._middleLeft&&o2._middleLeft.setLatLng(this._getMiddleLatLng(o2._prev,o2)),o2._middleRight&&o2._middleRight.setLatLng(this._getMiddleLatLng(o2,o2._next)),this._poly.redraw(),this.updateMarkers()},_updateIndexes:function(t2,e2){this._markerGroup.eachLayer(function(i2){i2._index>t2&&(i2._index+=e2)})},_createMiddleMarker:function(t2,e2){var i2,o2,a,n=this._getMiddleLatLng(t2,e2),s=this._createMarker(n);s.setOpacity(.6),t2._middleRight=e2._middleLeft=s,o2=function(){s.off("touchmove",o2,this);var a2=e2._index;s._index=a2,s.off("click",i2,this).on("click",this._onMarkerClick,this),n.lat=s.getLatLng().lat,n.lng=s.getLatLng().lng,this._spliceLatLngs(a2,0,n),this._markers.splice(a2,0,s),s.setOpacity(1),this._updateIndexes(a2,1),e2._index++,this._updatePrevNext(t2,s),this._updatePrevNext(s,e2),this._poly.fire("editstart")},a=function(){s.off("dragstart",o2,this),s.off("dragend",a,this),s.off("touchmove",o2,this),this._createMiddleMarker(t2,s),this._createMiddleMarker(s,e2)},i2=function(){o2.call(this),a.call(this),this._fireEdit()},s.on("click",i2,this).on("dragstart",o2,this).on("dragend",a,this).on("touchmove",o2,this),this._markerGroup.addLayer(s)},_updatePrevNext:function(t2,e2){t2&&(t2._next=e2),e2&&(e2._prev=t2)},_getMiddleLatLng:function(t2,e2){var i2=this._poly._map,o2=i2.project(t2.getLatLng()),a=i2.project(e2.getLatLng());return i2.unproject(o2._add(a)._divideBy(2))}}),L.Polyline.addInitHook(function(){this.editing||(L.Edit.Poly&&(this.editing=new L.Edit.Poly(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()}))}),L.Edit=L.Edit||{},L.Edit.SimpleShape=L.Handler.extend({options:{moveIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move"}),resizeIcon:new L.DivIcon({iconSize:new L.Point(8,8),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize"}),touchMoveIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-move leaflet-touch-icon"}),touchResizeIcon:new L.DivIcon({iconSize:new L.Point(20,20),className:"leaflet-div-icon leaflet-editing-icon leaflet-edit-resize leaflet-touch-icon"})},initialize:function(t2,e2){L.Browser.touch&&(this.options.moveIcon=this.options.touchMoveIcon,this.options.resizeIcon=this.options.touchResizeIcon),this._shape=t2,L.Util.setOptions(this,e2)},addHooks:function(){var t2=this._shape;this._shape._map&&(this._map=this._shape._map,t2.setStyle(t2.options.editing),t2._map&&(this._map=t2._map,this._markerGroup||this._initMarkers(),this._map.addLayer(this._markerGroup)))},removeHooks:function(){var t2=this._shape;if(t2.setStyle(t2.options.original),t2._map){this._unbindMarker(this._moveMarker);for(var e2=0,i2=this._resizeMarkers.length;e2<i2;e2++)this._unbindMarker(this._resizeMarkers[e2]);this._resizeMarkers=null,this._map.removeLayer(this._markerGroup),delete this._markerGroup}this._map=null},updateMarkers:function(){this._markerGroup.clearLayers(),this._initMarkers()},_initMarkers:function(){this._markerGroup||(this._markerGroup=new L.LayerGroup),this._createMoveMarker(),this._createResizeMarker()},_createMoveMarker:function(){},_createResizeMarker:function(){},_createMarker:function(t2,e2){var i2=new L.Marker.Touch(t2,{draggable:!0,icon:e2,zIndexOffset:10});return this._bindMarker(i2),this._markerGroup.addLayer(i2),i2},_bindMarker:function(t2){t2.on("dragstart",this._onMarkerDragStart,this).on("drag",this._onMarkerDrag,this).on("dragend",this._onMarkerDragEnd,this).on("touchstart",this._onTouchStart,this).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onTouchEnd,this).on("MSPointerUp",this._onTouchEnd,this)},_unbindMarker:function(t2){t2.off("dragstart",this._onMarkerDragStart,this).off("drag",this._onMarkerDrag,this).off("dragend",this._onMarkerDragEnd,this).off("touchstart",this._onTouchStart,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onTouchEnd,this).off("MSPointerUp",this._onTouchEnd,this)},_onMarkerDragStart:function(t2){t2.target.setOpacity(0),this._shape.fire("editstart")},_fireEdit:function(){this._shape.edited=!0,this._shape.fire("edit")},_onMarkerDrag:function(t2){var e2=t2.target,i2=e2.getLatLng();e2===this._moveMarker?this._move(i2):this._resize(i2),this._shape.redraw(),this._shape.fire("editdrag")},_onMarkerDragEnd:function(t2){t2.target.setOpacity(1),this._fireEdit()},_onTouchStart:function(t2){if(L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t2),typeof this._getCorners=="function"){var e2=this._getCorners(),i2=t2.target,o2=i2._cornerIndex;i2.setOpacity(0),this._oppositeCorner=e2[(o2+2)%4],this._toggleCornerMarkers(0,o2)}this._shape.fire("editstart")},_onTouchMove:function(t2){var e2=this._map.mouseEventToLayerPoint(t2.originalEvent.touches[0]),i2=this._map.layerPointToLatLng(e2);return t2.target===this._moveMarker?this._move(i2):this._resize(i2),this._shape.redraw(),!1},_onTouchEnd:function(t2){t2.target.setOpacity(1),this.updateMarkers(),this._fireEdit()},_move:function(){},_resize:function(){}}),L.Edit=L.Edit||{},L.Edit.Rectangle=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t2=this._shape.getBounds(),e2=t2.getCenter();this._moveMarker=this._createMarker(e2,this.options.moveIcon)},_createResizeMarker:function(){var t2=this._getCorners();this._resizeMarkers=[];for(var e2=0,i2=t2.length;e2<i2;e2++)this._resizeMarkers.push(this._createMarker(t2[e2],this.options.resizeIcon)),this._resizeMarkers[e2]._cornerIndex=e2},_onMarkerDragStart:function(t2){L.Edit.SimpleShape.prototype._onMarkerDragStart.call(this,t2);var e2=this._getCorners(),i2=t2.target,o2=i2._cornerIndex;this._oppositeCorner=e2[(o2+2)%4],this._toggleCornerMarkers(0,o2)},_onMarkerDragEnd:function(t2){var e2,i2,o2=t2.target;o2===this._moveMarker&&(e2=this._shape.getBounds(),i2=e2.getCenter(),o2.setLatLng(i2)),this._toggleCornerMarkers(1),this._repositionCornerMarkers(),L.Edit.SimpleShape.prototype._onMarkerDragEnd.call(this,t2)},_move:function(t2){for(var e2,i2=this._shape._defaultShape?this._shape._defaultShape():this._shape.getLatLngs(),o2=this._shape.getBounds(),a=o2.getCenter(),n=[],s=0,r=i2.length;s<r;s++)e2=[i2[s].lat-a.lat,i2[s].lng-a.lng],n.push([t2.lat+e2[0],t2.lng+e2[1]]);this._shape.setLatLngs(n),this._repositionCornerMarkers(),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})},_resize:function(t2){var e2;this._shape.setBounds(L.latLngBounds(t2,this._oppositeCorner)),e2=this._shape.getBounds(),this._moveMarker.setLatLng(e2.getCenter()),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})},_getCorners:function(){var t2=this._shape.getBounds();return[t2.getNorthWest(),t2.getNorthEast(),t2.getSouthEast(),t2.getSouthWest()]},_toggleCornerMarkers:function(t2){for(var e2=0,i2=this._resizeMarkers.length;e2<i2;e2++)this._resizeMarkers[e2].setOpacity(t2)},_repositionCornerMarkers:function(){for(var t2=this._getCorners(),e2=0,i2=this._resizeMarkers.length;e2<i2;e2++)this._resizeMarkers[e2].setLatLng(t2[e2])}}),L.Rectangle.addInitHook(function(){L.Edit.Rectangle&&(this.editing=new L.Edit.Rectangle(this),this.options.editable&&this.editing.enable())}),L.Edit=L.Edit||{},L.Edit.CircleMarker=L.Edit.SimpleShape.extend({_createMoveMarker:function(){var t2=this._shape.getLatLng();this._moveMarker=this._createMarker(t2,this.options.moveIcon)},_createResizeMarker:function(){this._resizeMarkers=[]},_move:function(t2){if(this._resizeMarkers.length){var e2=this._getResizeMarkerPoint(t2);this._resizeMarkers[0].setLatLng(e2)}this._shape.setLatLng(t2),this._map.fire(L.Draw.Event.EDITMOVE,{layer:this._shape})}}),L.CircleMarker.addInitHook(function(){L.Edit.CircleMarker&&(this.editing=new L.Edit.CircleMarker(this),this.options.editable&&this.editing.enable()),this.on("add",function(){this.editing&&this.editing.enabled()&&this.editing.addHooks()}),this.on("remove",function(){this.editing&&this.editing.enabled()&&this.editing.removeHooks()})}),L.Edit=L.Edit||{},L.Edit.Circle=L.Edit.CircleMarker.extend({_createResizeMarker:function(){var t2=this._shape.getLatLng(),e2=this._getResizeMarkerPoint(t2);this._resizeMarkers=[],this._resizeMarkers.push(this._createMarker(e2,this.options.resizeIcon))},_getResizeMarkerPoint:function(t2){var e2=this._shape._radius*Math.cos(Math.PI/4),i2=this._map.project(t2);return this._map.unproject([i2.x+e2,i2.y-e2])},_resize:function(t2){var e2=this._moveMarker.getLatLng();L.GeometryUtil.isVersion07x()?radius=e2.distanceTo(t2):radius=this._map.distance(e2,t2),this._shape.setRadius(radius),this._map.editTooltip&&this._map._editTooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.subtext+"<br />"+L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.draw.handlers.circle.radius+": "+L.GeometryUtil.readableDistance(radius,!0,this.options.feet,this.options.nautic)}),this._shape.setRadius(radius),this._map.fire(L.Draw.Event.EDITRESIZE,{layer:this._shape})}}),L.Circle.addInitHook(function(){L.Edit.Circle&&(this.editing=new L.Edit.Circle(this),this.options.editable&&this.editing.enable())}),L.Map.mergeOptions({touchExtend:!0}),L.Map.TouchExtend=L.Handler.extend({initialize:function(t2){this._map=t2,this._container=t2._container,this._pane=t2._panes.overlayPane},addHooks:function(){L.DomEvent.on(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.on(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.on(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.on(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.on(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.on(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.on(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.on(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.on(this._container,"touchleave",this._onTouchLeave,this))},removeHooks:function(){L.DomEvent.off(this._container,"touchstart",this._onTouchStart,this),L.DomEvent.off(this._container,"touchend",this._onTouchEnd,this),L.DomEvent.off(this._container,"touchmove",this._onTouchMove,this),this._detectIE()?(L.DomEvent.off(this._container,"MSPointerDown",this._onTouchStart,this),L.DomEvent.off(this._container,"MSPointerUp",this._onTouchEnd,this),L.DomEvent.off(this._container,"MSPointerMove",this._onTouchMove,this),L.DomEvent.off(this._container,"MSPointerCancel",this._onTouchCancel,this)):(L.DomEvent.off(this._container,"touchcancel",this._onTouchCancel,this),L.DomEvent.off(this._container,"touchleave",this._onTouchLeave,this))},_touchEvent:function(t2,e2){var i2={};if(t2.touches!==void 0){if(!t2.touches.length)return;i2=t2.touches[0]}else if(t2.pointerType!=="touch"||(i2=t2,!this._filterClick(t2)))return;var o2=this._map.mouseEventToContainerPoint(i2),a=this._map.mouseEventToLayerPoint(i2),n=this._map.layerPointToLatLng(a);this._map.fire(e2,{latlng:n,layerPoint:a,containerPoint:o2,pageX:i2.pageX,pageY:i2.pageY,originalEvent:t2})},_filterClick:function(t2){var e2=t2.timeStamp||t2.originalEvent.timeStamp,i2=L.DomEvent._lastClick&&e2-L.DomEvent._lastClick;return i2&&i2>100&&i2<500||t2.target._simulatedClick&&!t2._simulated?(L.DomEvent.stop(t2),!1):(L.DomEvent._lastClick=e2,!0)},_onTouchStart:function(t2){this._map._loaded&&this._touchEvent(t2,"touchstart")},_onTouchEnd:function(t2){this._map._loaded&&this._touchEvent(t2,"touchend")},_onTouchCancel:function(t2){if(this._map._loaded){var e2="touchcancel";this._detectIE()&&(e2="pointercancel"),this._touchEvent(t2,e2)}},_onTouchLeave:function(t2){this._map._loaded&&this._touchEvent(t2,"touchleave")},_onTouchMove:function(t2){this._map._loaded&&this._touchEvent(t2,"touchmove")},_detectIE:function(){var e2=t.navigator.userAgent,i2=e2.indexOf("MSIE ");if(i2>0)return parseInt(e2.substring(i2+5,e2.indexOf(".",i2)),10);if(e2.indexOf("Trident/")>0){var o2=e2.indexOf("rv:");return parseInt(e2.substring(o2+3,e2.indexOf(".",o2)),10)}var a=e2.indexOf("Edge/");return a>0&&parseInt(e2.substring(a+5,e2.indexOf(".",a)),10)}}),L.Map.addInitHook("addHandler","touchExtend",L.Map.TouchExtend),L.Marker.Touch=L.Marker.extend({_initInteraction:function(){return this.addInteractiveTarget?L.Marker.prototype._initInteraction.apply(this):this._initInteractionLegacy()},_initInteractionLegacy:function(){if(this.options.clickable){var t2=this._icon,e2=["dblclick","mousedown","mouseover","mouseout","contextmenu","touchstart","touchend","touchmove"];this._detectIE?e2.concat(["MSPointerDown","MSPointerUp","MSPointerMove","MSPointerCancel"]):e2.concat(["touchcancel"]),L.DomUtil.addClass(t2,"leaflet-clickable"),L.DomEvent.on(t2,"click",this._onMouseClick,this),L.DomEvent.on(t2,"keypress",this._onKeyPress,this);for(var i2=0;i2<e2.length;i2++)L.DomEvent.on(t2,e2[i2],this._fireMouseEvent,this);L.Handler.MarkerDrag&&(this.dragging=new L.Handler.MarkerDrag(this),this.options.draggable&&this.dragging.enable())}},_detectIE:function(){var e2=t.navigator.userAgent,i2=e2.indexOf("MSIE ");if(i2>0)return parseInt(e2.substring(i2+5,e2.indexOf(".",i2)),10);if(e2.indexOf("Trident/")>0){var o2=e2.indexOf("rv:");return parseInt(e2.substring(o2+3,e2.indexOf(".",o2)),10)}var a=e2.indexOf("Edge/");return a>0&&parseInt(e2.substring(a+5,e2.indexOf(".",a)),10)}}),L.LatLngUtil={cloneLatLngs:function(t2){for(var e2=[],i2=0,o2=t2.length;i2<o2;i2++)Array.isArray(t2[i2])?e2.push(L.LatLngUtil.cloneLatLngs(t2[i2])):e2.push(this.cloneLatLng(t2[i2]));return e2},cloneLatLng:function(t2){return L.latLng(t2.lat,t2.lng)}},function(){var t2={km:2,ha:2,m:0,mi:2,ac:2,yd:0,ft:0,nm:2};L.GeometryUtil=L.extend(L.GeometryUtil||{},{geodesicArea:function(t3){var e2,i2,o2=t3.length,a=0,n=Math.PI/180;if(o2>2){for(var s=0;s<o2;s++)e2=t3[s],i2=t3[(s+1)%o2],a+=(i2.lng-e2.lng)*n*(2+Math.sin(e2.lat*n)+Math.sin(i2.lat*n));a=6378137*a*6378137/2}return Math.abs(a)},formattedNumber:function(t3,e2){var i2=parseFloat(t3).toFixed(e2),o2=L.drawLocal.format&&L.drawLocal.format.numeric,a=o2&&o2.delimiters,n=a&&a.thousands,s=a&&a.decimal;if(n||s){var r=i2.split(".");i2=n?r[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+n):r[0],s=s||".",r.length>1&&(i2=i2+s+r[1])}return i2},readableArea:function(e2,i2,o2){var a,n,o2=L.Util.extend({},t2,o2);return i2?(n=["ha","m"],type=typeof i2,type==="string"?n=[i2]:type!=="boolean"&&(n=i2),a=e2>=1e6&&n.indexOf("km")!==-1?L.GeometryUtil.formattedNumber(1e-6*e2,o2.km)+" km²":e2>=1e4&&n.indexOf("ha")!==-1?L.GeometryUtil.formattedNumber(1e-4*e2,o2.ha)+" ha":L.GeometryUtil.formattedNumber(e2,o2.m)+" m²"):(e2/=.836127,a=e2>=3097600?L.GeometryUtil.formattedNumber(e2/3097600,o2.mi)+" mi²":e2>=4840?L.GeometryUtil.formattedNumber(e2/4840,o2.ac)+" acres":L.GeometryUtil.formattedNumber(e2,o2.yd)+" yd²"),a},readableDistance:function(e2,i2,o2,a,n){var s,n=L.Util.extend({},t2,n);switch(i2?typeof i2=="string"?i2:"metric":o2?"feet":a?"nauticalMile":"yards"){case"metric":s=e2>1e3?L.GeometryUtil.formattedNumber(e2/1e3,n.km)+" km":L.GeometryUtil.formattedNumber(e2,n.m)+" m";break;case"feet":e2*=3.28083,s=L.GeometryUtil.formattedNumber(e2,n.ft)+" ft";break;case"nauticalMile":e2*=.53996,s=L.GeometryUtil.formattedNumber(e2/1e3,n.nm)+" nm";break;case"yards":default:e2*=1.09361,s=e2>1760?L.GeometryUtil.formattedNumber(e2/1760,n.mi)+" miles":L.GeometryUtil.formattedNumber(e2,n.yd)+" yd"}return s},isVersion07x:function(){var t3=L.version.split(".");return parseInt(t3[0],10)===0&&parseInt(t3[1],10)===7}})}(),L.Util.extend(L.LineUtil,{segmentsIntersect:function(t2,e2,i2,o2){return this._checkCounterclockwise(t2,i2,o2)!==this._checkCounterclockwise(e2,i2,o2)&&this._checkCounterclockwise(t2,e2,i2)!==this._checkCounterclockwise(t2,e2,o2)},_checkCounterclockwise:function(t2,e2,i2){return(i2.y-t2.y)*(e2.x-t2.x)>(e2.y-t2.y)*(i2.x-t2.x)}}),L.Polyline.include({intersects:function(){var t2,e2,i2,o2=this._getProjectedPoints(),a=o2?o2.length:0;if(this._tooFewPointsForIntersection())return!1;for(t2=a-1;t2>=3;t2--)if(e2=o2[t2-1],i2=o2[t2],this._lineSegmentsIntersectsRange(e2,i2,t2-2))return!0;return!1},newLatLngIntersects:function(t2,e2){return!!this._map&&this.newPointIntersects(this._map.latLngToLayerPoint(t2),e2)},newPointIntersects:function(t2,e2){var i2=this._getProjectedPoints(),o2=i2?i2.length:0,a=i2?i2[o2-1]:null,n=o2-2;return!this._tooFewPointsForIntersection(1)&&this._lineSegmentsIntersectsRange(a,t2,n,e2?1:0)},_tooFewPointsForIntersection:function(t2){var e2=this._getProjectedPoints(),i2=e2?e2.length:0;return i2+=t2||0,!e2||i2<=3},_lineSegmentsIntersectsRange:function(t2,e2,i2,o2){var a,n,s=this._getProjectedPoints();o2=o2||0;for(var r=i2;r>o2;r--)if(a=s[r-1],n=s[r],L.LineUtil.segmentsIntersect(t2,e2,a,n))return!0;return!1},_getProjectedPoints:function(){if(!this._defaultShape)return this._originalPoints;for(var t2=[],e2=this._defaultShape(),i2=0;i2<e2.length;i2++)t2.push(this._map.latLngToLayerPoint(e2[i2]));return t2}}),L.Polygon.include({intersects:function(){var t2,e2,i2,o2,a=this._getProjectedPoints();return!this._tooFewPointsForIntersection()&&(!!L.Polyline.prototype.intersects.call(this)||(t2=a.length,e2=a[0],i2=a[t2-1],o2=t2-2,this._lineSegmentsIntersectsRange(i2,e2,o2,1)))}}),L.Control.Draw=L.Control.extend({options:{position:"topleft",draw:{},edit:!1},initialize:function(t2){if(L.version<"0.7")throw new Error("Leaflet.draw 0.2.3+ requires Leaflet 0.7.0+. Download latest from https://github.com/Leaflet/Leaflet/");L.Control.prototype.initialize.call(this,t2);var e2;this._toolbars={},L.DrawToolbar&&this.options.draw&&(e2=new L.DrawToolbar(this.options.draw),this._toolbars[L.DrawToolbar.TYPE]=e2,this._toolbars[L.DrawToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.EditToolbar&&this.options.edit&&(e2=new L.EditToolbar(this.options.edit),this._toolbars[L.EditToolbar.TYPE]=e2,this._toolbars[L.EditToolbar.TYPE].on("enable",this._toolbarEnabled,this)),L.toolbar=this},onAdd:function(t2){var e2,i2=L.DomUtil.create("div","leaflet-draw"),o2=!1;for(var a in this._toolbars)this._toolbars.hasOwnProperty(a)&&(e2=this._toolbars[a].addToolbar(t2))&&(o2||(L.DomUtil.hasClass(e2,"leaflet-draw-toolbar-top")||L.DomUtil.addClass(e2.childNodes[0],"leaflet-draw-toolbar-top"),o2=!0),i2.appendChild(e2));return i2},onRemove:function(){for(var t2 in this._toolbars)this._toolbars.hasOwnProperty(t2)&&this._toolbars[t2].removeToolbar()},setDrawingOptions:function(t2){for(var e2 in this._toolbars)this._toolbars[e2]instanceof L.DrawToolbar&&this._toolbars[e2].setOptions(t2)},_toolbarEnabled:function(t2){var e2=t2.target;for(var i2 in this._toolbars)this._toolbars[i2]!==e2&&this._toolbars[i2].disable()}}),L.Map.mergeOptions({drawControlTooltips:!0,drawControl:!1}),L.Map.addInitHook(function(){this.options.drawControl&&(this.drawControl=new L.Control.Draw,this.addControl(this.drawControl))}),L.Toolbar=L.Class.extend({initialize:function(t2){L.setOptions(this,t2),this._modes={},this._actionButtons=[],this._activeMode=null;var e2=L.version.split(".");parseInt(e2[0],10)===1&&parseInt(e2[1],10)>=2?L.Toolbar.include(L.Evented.prototype):L.Toolbar.include(L.Mixin.Events)},enabled:function(){return this._activeMode!==null},disable:function(){this.enabled()&&this._activeMode.handler.disable()},addToolbar:function(t2){var e2,i2=L.DomUtil.create("div","leaflet-draw-section"),o2=0,a=this._toolbarClass||"",n=this.getModeHandlers(t2);for(this._toolbarContainer=L.DomUtil.create("div","leaflet-draw-toolbar leaflet-bar"),this._map=t2,e2=0;e2<n.length;e2++)n[e2].enabled&&this._initModeHandler(n[e2].handler,this._toolbarContainer,o2++,a,n[e2].title);if(o2)return this._lastButtonIndex=--o2,this._actionsContainer=L.DomUtil.create("ul","leaflet-draw-actions"),i2.appendChild(this._toolbarContainer),i2.appendChild(this._actionsContainer),i2},removeToolbar:function(){for(var t2 in this._modes)this._modes.hasOwnProperty(t2)&&(this._disposeButton(this._modes[t2].button,this._modes[t2].handler.enable,this._modes[t2].handler),this._modes[t2].handler.disable(),this._modes[t2].handler.off("enabled",this._handlerActivated,this).off("disabled",this._handlerDeactivated,this));this._modes={};for(var e2=0,i2=this._actionButtons.length;e2<i2;e2++)this._disposeButton(this._actionButtons[e2].button,this._actionButtons[e2].callback,this);this._actionButtons=[],this._actionsContainer=null},_initModeHandler:function(t2,e2,i2,o2,a){var n=t2.type;this._modes[n]={},this._modes[n].handler=t2,this._modes[n].button=this._createButton({type:n,title:a,className:o2+"-"+n,container:e2,callback:this._modes[n].handler.enable,context:this._modes[n].handler}),this._modes[n].buttonIndex=i2,this._modes[n].handler.on("enabled",this._handlerActivated,this).on("disabled",this._handlerDeactivated,this)},_detectIOS:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!t.MSStream},_createButton:function(t2){var e2=L.DomUtil.create("a",t2.className||"",t2.container),i2=L.DomUtil.create("span","sr-only",t2.container);e2.href="#",e2.appendChild(i2),t2.title&&(e2.title=t2.title,i2.innerHTML=t2.title),t2.text&&(e2.innerHTML=t2.text,i2.innerHTML=t2.text);var o2=this._detectIOS()?"touchstart":"click";return L.DomEvent.on(e2,"click",L.DomEvent.stopPropagation).on(e2,"mousedown",L.DomEvent.stopPropagation).on(e2,"dblclick",L.DomEvent.stopPropagation).on(e2,"touchstart",L.DomEvent.stopPropagation).on(e2,"click",L.DomEvent.preventDefault).on(e2,o2,t2.callback,t2.context),e2},_disposeButton:function(t2,e2){var i2=this._detectIOS()?"touchstart":"click";L.DomEvent.off(t2,"click",L.DomEvent.stopPropagation).off(t2,"mousedown",L.DomEvent.stopPropagation).off(t2,"dblclick",L.DomEvent.stopPropagation).off(t2,"touchstart",L.DomEvent.stopPropagation).off(t2,"click",L.DomEvent.preventDefault).off(t2,i2,e2)},_handlerActivated:function(t2){this.disable(),this._activeMode=this._modes[t2.handler],L.DomUtil.addClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._showActionsToolbar(),this.fire("enable")},_handlerDeactivated:function(){this._hideActionsToolbar(),L.DomUtil.removeClass(this._activeMode.button,"leaflet-draw-toolbar-button-enabled"),this._activeMode=null,this.fire("disable")},_createActions:function(t2){var e2,i2,o2,a,n=this._actionsContainer,s=this.getActions(t2),r=s.length;for(i2=0,o2=this._actionButtons.length;i2<o2;i2++)this._disposeButton(this._actionButtons[i2].button,this._actionButtons[i2].callback);for(this._actionButtons=[];n.firstChild;)n.removeChild(n.firstChild);for(var l=0;l<r;l++)"enabled"in s[l]&&!s[l].enabled||(e2=L.DomUtil.create("li","",n),a=this._createButton({title:s[l].title,text:s[l].text,container:e2,callback:s[l].callback,context:s[l].context}),this._actionButtons.push({button:a,callback:s[l].callback}))},_showActionsToolbar:function(){var t2=this._activeMode.buttonIndex,e2=this._lastButtonIndex,i2=this._activeMode.button.offsetTop-1;this._createActions(this._activeMode.handler),this._actionsContainer.style.top=i2+"px",t2===0&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-top")),t2===e2&&(L.DomUtil.addClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.addClass(this._actionsContainer,"leaflet-draw-actions-bottom")),this._actionsContainer.style.display="block",this._map.fire(L.Draw.Event.TOOLBAROPENED)},_hideActionsToolbar:function(){this._actionsContainer.style.display="none",L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-notop"),L.DomUtil.removeClass(this._toolbarContainer,"leaflet-draw-toolbar-nobottom"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-top"),L.DomUtil.removeClass(this._actionsContainer,"leaflet-draw-actions-bottom"),this._map.fire(L.Draw.Event.TOOLBARCLOSED)}}),L.Draw=L.Draw||{},L.Draw.Tooltip=L.Class.extend({initialize:function(t2){this._map=t2,this._popupPane=t2._panes.popupPane,this._visible=!1,this._container=t2.options.drawControlTooltips?L.DomUtil.create("div","leaflet-draw-tooltip",this._popupPane):null,this._singleLineLabel=!1,this._map.on("mouseout",this._onMouseOut,this)},dispose:function(){this._map.off("mouseout",this._onMouseOut,this),this._container&&(this._popupPane.removeChild(this._container),this._container=null)},updateContent:function(t2){return this._container?(t2.subtext=t2.subtext||"",t2.subtext.length!==0||this._singleLineLabel?t2.subtext.length>0&&this._singleLineLabel&&(L.DomUtil.removeClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!1):(L.DomUtil.addClass(this._container,"leaflet-draw-tooltip-single"),this._singleLineLabel=!0),this._container.innerHTML=(t2.subtext.length>0?'<span class="leaflet-draw-tooltip-subtext">'+t2.subtext+"</span><br />":"")+"<span>"+t2.text+"</span>",t2.text||t2.subtext?(this._visible=!0,this._container.style.visibility="inherit"):(this._visible=!1,this._container.style.visibility="hidden"),this):this},updatePosition:function(t2){var e2=this._map.latLngToLayerPoint(t2),i2=this._container;return this._container&&(this._visible&&(i2.style.visibility="inherit"),L.DomUtil.setPosition(i2,e2)),this},showAsError:function(){return this._container&&L.DomUtil.addClass(this._container,"leaflet-error-draw-tooltip"),this},removeError:function(){return this._container&&L.DomUtil.removeClass(this._container,"leaflet-error-draw-tooltip"),this},_onMouseOut:function(){this._container&&(this._container.style.visibility="hidden")}}),L.DrawToolbar=L.Toolbar.extend({statics:{TYPE:"draw"},options:{polyline:{},polygon:{},rectangle:{},circle:{},marker:{},circlemarker:{}},initialize:function(t2){for(var e2 in this.options)this.options.hasOwnProperty(e2)&&t2[e2]&&(t2[e2]=L.extend({},this.options[e2],t2[e2]));this._toolbarClass="leaflet-draw-draw",L.Toolbar.prototype.initialize.call(this,t2)},getModeHandlers:function(t2){return[{enabled:this.options.polyline,handler:new L.Draw.Polyline(t2,this.options.polyline),title:L.drawLocal.draw.toolbar.buttons.polyline},{enabled:this.options.polygon,handler:new L.Draw.Polygon(t2,this.options.polygon),title:L.drawLocal.draw.toolbar.buttons.polygon},{enabled:this.options.rectangle,handler:new L.Draw.Rectangle(t2,this.options.rectangle),title:L.drawLocal.draw.toolbar.buttons.rectangle},{enabled:this.options.circle,handler:new L.Draw.Circle(t2,this.options.circle),title:L.drawLocal.draw.toolbar.buttons.circle},{enabled:this.options.marker,handler:new L.Draw.Marker(t2,this.options.marker),title:L.drawLocal.draw.toolbar.buttons.marker},{enabled:this.options.circlemarker,handler:new L.Draw.CircleMarker(t2,this.options.circlemarker),title:L.drawLocal.draw.toolbar.buttons.circlemarker}]},getActions:function(t2){return[{enabled:t2.completeShape,title:L.drawLocal.draw.toolbar.finish.title,text:L.drawLocal.draw.toolbar.finish.text,callback:t2.completeShape,context:t2},{enabled:t2.deleteLastVertex,title:L.drawLocal.draw.toolbar.undo.title,text:L.drawLocal.draw.toolbar.undo.text,callback:t2.deleteLastVertex,context:t2},{title:L.drawLocal.draw.toolbar.actions.title,text:L.drawLocal.draw.toolbar.actions.text,callback:this.disable,context:this}]},setOptions:function(t2){L.setOptions(this,t2);for(var e2 in this._modes)this._modes.hasOwnProperty(e2)&&t2.hasOwnProperty(e2)&&this._modes[e2].handler.setOptions(t2[e2])}}),L.EditToolbar=L.Toolbar.extend({statics:{TYPE:"edit"},options:{edit:{selectedPathOptions:{dashArray:"10, 10",fill:!0,fillColor:"#fe57a1",fillOpacity:.1,maintainColor:!1}},remove:{},poly:null,featureGroup:null},initialize:function(t2){t2.edit&&(t2.edit.selectedPathOptions===void 0&&(t2.edit.selectedPathOptions=this.options.edit.selectedPathOptions),t2.edit.selectedPathOptions=L.extend({},this.options.edit.selectedPathOptions,t2.edit.selectedPathOptions)),t2.remove&&(t2.remove=L.extend({},this.options.remove,t2.remove)),t2.poly&&(t2.poly=L.extend({},this.options.poly,t2.poly)),this._toolbarClass="leaflet-draw-edit",L.Toolbar.prototype.initialize.call(this,t2),this._selectedFeatureCount=0},getModeHandlers:function(t2){var e2=this.options.featureGroup;return[{enabled:this.options.edit,handler:new L.EditToolbar.Edit(t2,{featureGroup:e2,selectedPathOptions:this.options.edit.selectedPathOptions,poly:this.options.poly}),title:L.drawLocal.edit.toolbar.buttons.edit},{enabled:this.options.remove,handler:new L.EditToolbar.Delete(t2,{featureGroup:e2}),title:L.drawLocal.edit.toolbar.buttons.remove}]},getActions:function(t2){var e2=[{title:L.drawLocal.edit.toolbar.actions.save.title,text:L.drawLocal.edit.toolbar.actions.save.text,callback:this._save,context:this},{title:L.drawLocal.edit.toolbar.actions.cancel.title,text:L.drawLocal.edit.toolbar.actions.cancel.text,callback:this.disable,context:this}];return t2.removeAllLayers&&e2.push({title:L.drawLocal.edit.toolbar.actions.clearAll.title,text:L.drawLocal.edit.toolbar.actions.clearAll.text,callback:this._clearAllLayers,context:this}),e2},addToolbar:function(t2){var e2=L.Toolbar.prototype.addToolbar.call(this,t2);return this._checkDisabled(),this.options.featureGroup.on("layeradd layerremove",this._checkDisabled,this),e2},removeToolbar:function(){this.options.featureGroup.off("layeradd layerremove",this._checkDisabled,this),L.Toolbar.prototype.removeToolbar.call(this)},disable:function(){this.enabled()&&(this._activeMode.handler.revertLayers(),L.Toolbar.prototype.disable.call(this))},_save:function(){this._activeMode.handler.save(),this._activeMode&&this._activeMode.handler.disable()},_clearAllLayers:function(){this._activeMode.handler.removeAllLayers(),this._activeMode&&this._activeMode.handler.disable()},_checkDisabled:function(){var t2,e2=this.options.featureGroup,i2=e2.getLayers().length!==0;this.options.edit&&(t2=this._modes[L.EditToolbar.Edit.TYPE].button,i2?L.DomUtil.removeClass(t2,"leaflet-disabled"):L.DomUtil.addClass(t2,"leaflet-disabled"),t2.setAttribute("title",i2?L.drawLocal.edit.toolbar.buttons.edit:L.drawLocal.edit.toolbar.buttons.editDisabled)),this.options.remove&&(t2=this._modes[L.EditToolbar.Delete.TYPE].button,i2?L.DomUtil.removeClass(t2,"leaflet-disabled"):L.DomUtil.addClass(t2,"leaflet-disabled"),t2.setAttribute("title",i2?L.drawLocal.edit.toolbar.buttons.remove:L.drawLocal.edit.toolbar.buttons.removeDisabled))}}),L.EditToolbar.Edit=L.Handler.extend({statics:{TYPE:"edit"},initialize:function(t2,e2){if(L.Handler.prototype.initialize.call(this,t2),L.setOptions(this,e2),this._featureGroup=e2.featureGroup,!(this._featureGroup instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this._uneditedLayerProps={},this.type=L.EditToolbar.Edit.TYPE;var i2=L.version.split(".");parseInt(i2[0],10)===1&&parseInt(i2[1],10)>=2?L.EditToolbar.Edit.include(L.Evented.prototype):L.EditToolbar.Edit.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.EDITSTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._featureGroup.on("layeradd",this._enableLayerEdit,this).on("layerremove",this._disableLayerEdit,this))},disable:function(){this._enabled&&(this._featureGroup.off("layeradd",this._enableLayerEdit,this).off("layerremove",this._disableLayerEdit,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.EDITSTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t2=this._map;t2&&(t2.getContainer().focus(),this._featureGroup.eachLayer(this._enableLayerEdit,this),this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}),t2._editTooltip=this._tooltip,this._updateTooltip(),this._map.on("mousemove",this._onMouseMove,this).on("touchmove",this._onMouseMove,this).on("MSPointerMove",this._onMouseMove,this).on(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},removeHooks:function(){this._map&&(this._featureGroup.eachLayer(this._disableLayerEdit,this),this._uneditedLayerProps={},this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this).off("touchmove",this._onMouseMove,this).off("MSPointerMove",this._onMouseMove,this).off(L.Draw.Event.EDITVERTEX,this._updateTooltip,this))},revertLayers:function(){this._featureGroup.eachLayer(function(t2){this._revertLayer(t2)},this)},save:function(){var t2=new L.LayerGroup;this._featureGroup.eachLayer(function(e2){e2.edited&&(t2.addLayer(e2),e2.edited=!1)}),this._map.fire(L.Draw.Event.EDITED,{layers:t2})},_backupLayer:function(t2){var e2=L.Util.stamp(t2);this._uneditedLayerProps[e2]||(t2 instanceof L.Polyline||t2 instanceof L.Polygon||t2 instanceof L.Rectangle?this._uneditedLayerProps[e2]={latlngs:L.LatLngUtil.cloneLatLngs(t2.getLatLngs())}:t2 instanceof L.Circle?this._uneditedLayerProps[e2]={latlng:L.LatLngUtil.cloneLatLng(t2.getLatLng()),radius:t2.getRadius()}:(t2 instanceof L.Marker||t2 instanceof L.CircleMarker)&&(this._uneditedLayerProps[e2]={latlng:L.LatLngUtil.cloneLatLng(t2.getLatLng())}))},_getTooltipText:function(){return{text:L.drawLocal.edit.handlers.edit.tooltip.text,subtext:L.drawLocal.edit.handlers.edit.tooltip.subtext}},_updateTooltip:function(){this._tooltip.updateContent(this._getTooltipText())},_revertLayer:function(t2){var e2=L.Util.stamp(t2);t2.edited=!1,this._uneditedLayerProps.hasOwnProperty(e2)&&(t2 instanceof L.Polyline||t2 instanceof L.Polygon||t2 instanceof L.Rectangle?t2.setLatLngs(this._uneditedLayerProps[e2].latlngs):t2 instanceof L.Circle?(t2.setLatLng(this._uneditedLayerProps[e2].latlng),t2.setRadius(this._uneditedLayerProps[e2].radius)):(t2 instanceof L.Marker||t2 instanceof L.CircleMarker)&&t2.setLatLng(this._uneditedLayerProps[e2].latlng),t2.fire("revert-edited",{layer:t2}))},_enableLayerEdit:function(t2){var e2,i2,o2=t2.layer||t2.target||t2;this._backupLayer(o2),this.options.poly&&(i2=L.Util.extend({},this.options.poly),o2.options.poly=i2),this.options.selectedPathOptions&&(e2=L.Util.extend({},this.options.selectedPathOptions),e2.maintainColor&&(e2.color=o2.options.color,e2.fillColor=o2.options.fillColor),o2.options.original=L.extend({},o2.options),o2.options.editing=e2),o2 instanceof L.Marker?(o2.editing&&o2.editing.enable(),o2.dragging.enable(),o2.on("dragend",this._onMarkerDragEnd).on("touchmove",this._onTouchMove,this).on("MSPointerMove",this._onTouchMove,this).on("touchend",this._onMarkerDragEnd,this).on("MSPointerUp",this._onMarkerDragEnd,this)):o2.editing.enable()},_disableLayerEdit:function(t2){var e2=t2.layer||t2.target||t2;e2.edited=!1,e2.editing&&e2.editing.disable(),delete e2.options.editing,delete e2.options.original,this._selectedPathOptions&&(e2 instanceof L.Marker?this._toggleMarkerHighlight(e2):(e2.setStyle(e2.options.previousOptions),delete e2.options.previousOptions)),e2 instanceof L.Marker?(e2.dragging.disable(),e2.off("dragend",this._onMarkerDragEnd,this).off("touchmove",this._onTouchMove,this).off("MSPointerMove",this._onTouchMove,this).off("touchend",this._onMarkerDragEnd,this).off("MSPointerUp",this._onMarkerDragEnd,this)):e2.editing.disable()},_onMouseMove:function(t2){this._tooltip.updatePosition(t2.latlng)},_onMarkerDragEnd:function(t2){var e2=t2.target;e2.edited=!0,this._map.fire(L.Draw.Event.EDITMOVE,{layer:e2})},_onTouchMove:function(t2){var e2=t2.originalEvent.changedTouches[0],i2=this._map.mouseEventToLayerPoint(e2),o2=this._map.layerPointToLatLng(i2);t2.target.setLatLng(o2)},_hasAvailableLayers:function(){return this._featureGroup.getLayers().length!==0}}),L.EditToolbar.Delete=L.Handler.extend({statics:{TYPE:"remove"},initialize:function(t2,e2){if(L.Handler.prototype.initialize.call(this,t2),L.Util.setOptions(this,e2),this._deletableLayers=this.options.featureGroup,!(this._deletableLayers instanceof L.FeatureGroup))throw new Error("options.featureGroup must be a L.FeatureGroup");this.type=L.EditToolbar.Delete.TYPE;var i2=L.version.split(".");parseInt(i2[0],10)===1&&parseInt(i2[1],10)>=2?L.EditToolbar.Delete.include(L.Evented.prototype):L.EditToolbar.Delete.include(L.Mixin.Events)},enable:function(){!this._enabled&&this._hasAvailableLayers()&&(this.fire("enabled",{handler:this.type}),this._map.fire(L.Draw.Event.DELETESTART,{handler:this.type}),L.Handler.prototype.enable.call(this),this._deletableLayers.on("layeradd",this._enableLayerDelete,this).on("layerremove",this._disableLayerDelete,this))},disable:function(){this._enabled&&(this._deletableLayers.off("layeradd",this._enableLayerDelete,this).off("layerremove",this._disableLayerDelete,this),L.Handler.prototype.disable.call(this),this._map.fire(L.Draw.Event.DELETESTOP,{handler:this.type}),this.fire("disabled",{handler:this.type}))},addHooks:function(){var t2=this._map;t2&&(t2.getContainer().focus(),this._deletableLayers.eachLayer(this._enableLayerDelete,this),this._deletedLayers=new L.LayerGroup,this._tooltip=new L.Draw.Tooltip(this._map),this._tooltip.updateContent({text:L.drawLocal.edit.handlers.remove.tooltip.text}),this._map.on("mousemove",this._onMouseMove,this))},removeHooks:function(){this._map&&(this._deletableLayers.eachLayer(this._disableLayerDelete,this),this._deletedLayers=null,this._tooltip.dispose(),this._tooltip=null,this._map.off("mousemove",this._onMouseMove,this))},revertLayers:function(){this._deletedLayers.eachLayer(function(t2){this._deletableLayers.addLayer(t2),t2.fire("revert-deleted",{layer:t2})},this)},save:function(){this._map.fire(L.Draw.Event.DELETED,{layers:this._deletedLayers})},removeAllLayers:function(){this._deletableLayers.eachLayer(function(t2){this._removeLayer({layer:t2})},this),this.save()},_enableLayerDelete:function(t2){(t2.layer||t2.target||t2).on("click",this._removeLayer,this)},_disableLayerDelete:function(t2){var e2=t2.layer||t2.target||t2;e2.off("click",this._removeLayer,this),this._deletedLayers.removeLayer(e2)},_removeLayer:function(t2){var e2=t2.layer||t2.target||t2;this._deletableLayers.removeLayer(e2),this._deletedLayers.addLayer(e2),e2.fire("deleted")},_onMouseMove:function(t2){this._tooltip.updatePosition(t2.latlng)},_hasAvailableLayers:function(){return this._deletableLayers.getLayers().length!==0}})})(window,document);var leaflet_markerclusterSrc$1={exports:{}},leaflet_markerclusterSrc=leaflet_markerclusterSrc$1.exports,hasRequiredLeaflet_markerclusterSrc;function requireLeaflet_markerclusterSrc(){return hasRequiredLeaflet_markerclusterSrc||(hasRequiredLeaflet_markerclusterSrc=1,function(module2,exports3){(function(global,factory){factory(exports3)})(leaflet_markerclusterSrc,function(exports4){var MarkerClusterGroup2=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(options){L.Util.setOptions(this,options),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 animate=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,animate?this._withAnimation:this._noAnimation),this._markerCluster=animate?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(layer){if(layer instanceof L.LayerGroup)return this.addLayers([layer]);if(!layer.getLatLng)return this._nonPointGroup.addLayer(layer),this.fire("layeradd",{layer}),this;if(!this._map)return this._needsClustering.push(layer),this.fire("layeradd",{layer}),this;if(this.hasLayer(layer))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(layer,this._maxZoom),this.fire("layeradd",{layer}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var visibleLayer=layer,currentZoom=this._zoom;if(layer.__parent)for(;visibleLayer.__parent._zoom>=currentZoom;)visibleLayer=visibleLayer.__parent;return this._currentShownBounds.contains(visibleLayer.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(layer,visibleLayer):this._animationAddLayerNonAnimated(layer,visibleLayer)),this},removeLayer:function(layer){return layer instanceof L.LayerGroup?this.removeLayers([layer]):layer.getLatLng?this._map?layer.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(layer)),this._removeLayer(layer,!0),this.fire("layerremove",{layer}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),layer.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(layer)&&(this._featureGroup.removeLayer(layer),layer.clusterShow&&layer.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,layer)&&this.hasLayer(layer)&&this._needsRemoving.push({layer,latlng:layer._latlng}),this.fire("layerremove",{layer}),this):(this._nonPointGroup.removeLayer(layer),this.fire("layerremove",{layer}),this)},addLayers:function(layersArray,skipLayerAddEvent){if(!L.Util.isArray(layersArray))return this.addLayer(layersArray);var fg=this._featureGroup,npg=this._nonPointGroup,chunked=this.options.chunkedLoading,chunkInterval=this.options.chunkInterval,chunkProgress=this.options.chunkProgress,l=layersArray.length,offset=0,originalArray=!0,m;if(this._map){var started=new Date().getTime(),process=L.bind(function(){var start=new Date().getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();offset<l;offset++){if(chunked&&offset%200===0){var elapsed=new Date().getTime()-start;if(elapsed>chunkInterval)break}if(m=layersArray[offset],m instanceof L.LayerGroup){originalArray&&(layersArray=layersArray.slice(),originalArray=!1),this._extractNonGroupLayers(m,layersArray),l=layersArray.length;continue}if(!m.getLatLng){npg.addLayer(m),skipLayerAddEvent||this.fire("layeradd",{layer:m});continue}if(!this.hasLayer(m)&&(this._addLayer(m,this._maxZoom),skipLayerAddEvent||this.fire("layeradd",{layer:m}),m.__parent&&m.__parent.getChildCount()===2)){var markers=m.__parent.getAllChildMarkers(),otherMarker=markers[0]===m?markers[1]:markers[0];fg.removeLayer(otherMarker)}}chunkProgress&&chunkProgress(offset,l,new Date().getTime()-started),offset===l?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(process,this.options.chunkDelay)},this);process()}else for(var needsClustering=this._needsClustering;offset<l;offset++){if(m=layersArray[offset],m instanceof L.LayerGroup){originalArray&&(layersArray=layersArray.slice(),originalArray=!1),this._extractNonGroupLayers(m,layersArray),l=layersArray.length;continue}if(!m.getLatLng){npg.addLayer(m);continue}this.hasLayer(m)||needsClustering.push(m)}return this},removeLayers:function(layersArray){var i,m,l=layersArray.length,fg=this._featureGroup,npg=this._nonPointGroup,originalArray=!0;if(!this._map){for(i=0;i<l;i++){if(m=layersArray[i],m instanceof L.LayerGroup){originalArray&&(layersArray=layersArray.slice(),originalArray=!1),this._extractNonGroupLayers(m,layersArray),l=layersArray.length;continue}this._arraySplice(this._needsClustering,m),npg.removeLayer(m),this.hasLayer(m)&&this._needsRemoving.push({layer:m,latlng:m._latlng}),this.fire("layerremove",{layer:m})}return this}if(this._unspiderfy){this._unspiderfy();var layersArray2=layersArray.slice(),l2=l;for(i=0;i<l2;i++){if(m=layersArray2[i],m instanceof L.LayerGroup){this._extractNonGroupLayers(m,layersArray2),l2=layersArray2.length;continue}this._unspiderfyLayer(m)}}for(i=0;i<l;i++){if(m=layersArray[i],m instanceof L.LayerGroup){originalArray&&(layersArray=layersArray.slice(),originalArray=!1),this._extractNonGroupLayers(m,layersArray),l=layersArray.length;continue}if(!m.__parent){npg.removeLayer(m),this.fire("layerremove",{layer:m});continue}this._removeLayer(m,!0,!0),this.fire("layerremove",{layer:m}),fg.hasLayer(m)&&(fg.removeLayer(m),m.clusterShow&&m.clusterShow())}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(marker){marker.off(this._childMarkerEventHandlers,this),delete marker.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var bounds2=new L.LatLngBounds;this._topClusterLevel&&bounds2.extend(this._topClusterLevel._bounds);for(var i=this._needsClustering.length-1;i>=0;i--)bounds2.extend(this._needsClustering[i].getLatLng());return bounds2.extend(this._nonPointGroup.getBounds()),bounds2},eachLayer:function(method,context){var markers=this._needsClustering.slice(),needsRemoving=this._needsRemoving,thisNeedsRemoving,i,j;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(markers),i=markers.length-1;i>=0;i--){for(thisNeedsRemoving=!0,j=needsRemoving.length-1;j>=0;j--)if(needsRemoving[j].layer===markers[i]){thisNeedsRemoving=!1;break}thisNeedsRemoving&&method.call(context,markers[i])}this._nonPointGroup.eachLayer(method,context)},getLayers:function(){var layers=[];return this.eachLayer(function(l){layers.push(l)}),layers},getLayer:function(id){var result=null;return id=parseInt(id,10),this.eachLayer(function(l){L.stamp(l)===id&&(result=l)}),result},hasLayer:function(layer){if(!layer)return!1;var i,anArray=this._needsClustering;for(i=anArray.length-1;i>=0;i--)if(anArray[i]===layer)return!0;for(anArray=this._needsRemoving,i=anArray.length-1;i>=0;i--)if(anArray[i].layer===layer)return!1;return!!(layer.__parent&&layer.__parent._group===this)||this._nonPointGroup.hasLayer(layer)},zoomToShowLayer:function(layer,callback){var map=this._map;typeof callback!="function"&&(callback=function(){});var showMarker=function(){(map.hasLayer(layer)||map.hasLayer(layer.__parent))&&!this._inZoomAnimation&&(this._map.off("moveend",showMarker,this),this.off("animationend",showMarker,this),map.hasLayer(layer)?callback():layer.__parent._icon&&(this.once("spiderfied",callback,this),layer.__parent.spiderfy()))};layer._icon&&this._map.getBounds().contains(layer.getLatLng())?callback():layer.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",showMarker,this),this._map.panTo(layer.getLatLng())):(this._map.on("moveend",showMarker,this),this.on("animationend",showMarker,this),layer.__parent.zoomToBounds())},onAdd:function(map){this._map=map;var i,l,layer;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(map),this._nonPointGroup.addTo(map),this._gridClusters||this._generateInitialClusters(),this._maxLat=map.options.crs.projection.MAX_LATITUDE,i=0,l=this._needsRemoving.length;i<l;i++)layer=this._needsRemoving[i],layer.newlatlng=layer.layer._latlng,layer.layer._latlng=layer.latlng;for(i=0,l=this._needsRemoving.length;i<l;i++)layer=this._needsRemoving[i],this._removeLayer(layer.layer,!0),layer.layer._latlng=layer.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(),l=this._needsClustering,this._needsClustering=[],this.addLayers(l,!0)},onRemove:function(map){map.off("zoomend",this._zoomEnd,this),map.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(marker){for(var vMarker=marker;vMarker&&!vMarker._icon;)vMarker=vMarker.__parent;return vMarker||null},_arraySplice:function(anArray,obj){for(var i=anArray.length-1;i>=0;i--)if(anArray[i]===obj)return anArray.splice(i,1),!0},_removeFromGridUnclustered:function(marker,z){for(var map=this._map,gridUnclustered=this._gridUnclustered,minZoom=Math.floor(this._map.getMinZoom());z>=minZoom&&gridUnclustered[z].removeObject(marker,map.project(marker.getLatLng(),z));z--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var isPopupOpen=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),isPopupOpen&&e.target.openPopup()}},_moveChild:function(layer,from,to){layer._latlng=from,this.removeLayer(layer),layer._latlng=to,this.addLayer(layer)},_childMarkerDragEnd:function(e){var dragStart=e.target.__dragStart;delete e.target.__dragStart,dragStart&&this._moveChild(e.target,dragStart,e.target._latlng)},_removeLayer:function(marker,removeFromDistanceGrid,dontUpdateMap){var gridClusters=this._gridClusters,gridUnclustered=this._gridUnclustered,fg=this._featureGroup,map=this._map,minZoom=Math.floor(this._map.getMinZoom());removeFromDistanceGrid&&this._removeFromGridUnclustered(marker,this._maxZoom);var cluster=marker.__parent,markers=cluster._markers,otherMarker;for(this._arraySplice(markers,marker);cluster&&(cluster._childCount--,cluster._boundsNeedUpdate=!0,!(cluster._zoom<minZoom));)removeFromDistanceGrid&&cluster._childCount<=1?(otherMarker=cluster._markers[0]===marker?cluster._markers[1]:cluster._markers[0],gridClusters[cluster._zoom].removeObject(cluster,map.project(cluster._cLatLng,cluster._zoom)),gridUnclustered[cluster._zoom].addObject(otherMarker,map.project(otherMarker.getLatLng(),cluster._zoom)),this._arraySplice(cluster.__parent._childClusters,cluster),cluster.__parent._markers.push(otherMarker),otherMarker.__parent=cluster.__parent,cluster._icon&&(fg.removeLayer(cluster),dontUpdateMap||fg.addLayer(otherMarker))):cluster._iconNeedsUpdate=!0,cluster=cluster.__parent;delete marker.__parent},_isOrIsParent:function(el,oel){for(;oel;){if(el===oel)return!0;oel=oel.parentNode}return!1},fire:function(type2,data,propagate){if(data&&data.layer instanceof L.MarkerCluster){if(data.originalEvent&&this._isOrIsParent(data.layer._icon,data.originalEvent.relatedTarget))return;type2="cluster"+type2}L.FeatureGroup.prototype.fire.call(this,type2,data,propagate)},listens:function(type2,propagate){return L.FeatureGroup.prototype.listens.call(this,type2,propagate)||L.FeatureGroup.prototype.listens.call(this,"cluster"+type2,propagate)},_defaultIconCreateFunction:function(cluster){var childCount=cluster.getChildCount(),c=" marker-cluster-";return childCount<10?c+="small":childCount<100?c+="medium":c+="large",new L.DivIcon({html:"<div><span>"+childCount+"</span></div>",className:"marker-cluster"+c,iconSize:new L.Point(40,40)})},_bindEvents:function(){var map=this._map,spiderfyOnMaxZoom=this.options.spiderfyOnMaxZoom,showCoverageOnHover=this.options.showCoverageOnHover,zoomToBoundsOnClick=this.options.zoomToBoundsOnClick,spiderfyOnEveryZoom=this.options.spiderfyOnEveryZoom;(spiderfyOnMaxZoom||zoomToBoundsOnClick||spiderfyOnEveryZoom)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),showCoverageOnHover&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),map.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var cluster=e.layer,bottomCluster=cluster;if(!(e.type==="clusterkeypress"&&e.originalEvent&&e.originalEvent.keyCode!==13)){for(;bottomCluster._childClusters.length===1;)bottomCluster=bottomCluster._childClusters[0];bottomCluster._zoom===this._maxZoom&&bottomCluster._childCount===cluster._childCount&&this.options.spiderfyOnMaxZoom?cluster.spiderfy():this.options.zoomToBoundsOnClick&&cluster.zoomToBounds(),this.options.spiderfyOnEveryZoom&&cluster.spiderfy(),e.originalEvent&&e.originalEvent.keyCode===13&&this._map._container.focus()}},_showCoverage:function(e){var map=this._map;this._inZoomAnimation||(this._shownPolygon&&map.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),map.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var spiderfyOnMaxZoom=this.options.spiderfyOnMaxZoom,showCoverageOnHover=this.options.showCoverageOnHover,zoomToBoundsOnClick=this.options.zoomToBoundsOnClick,spiderfyOnEveryZoom=this.options.spiderfyOnEveryZoom,map=this._map;(spiderfyOnMaxZoom||zoomToBoundsOnClick||spiderfyOnEveryZoom)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),showCoverageOnHover&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),map.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 newBounds=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,newBounds),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),newBounds),this._currentShownBounds=newBounds}},_generateInitialClusters:function(){var maxZoom=Math.ceil(this._map.getMaxZoom()),minZoom=Math.floor(this._map.getMinZoom()),radius2=this.options.maxClusterRadius,radiusFn=radius2;typeof radius2!="function"&&(radiusFn=function(){return radius2}),this.options.disableClusteringAtZoom!==null&&(maxZoom=this.options.disableClusteringAtZoom-1),this._maxZoom=maxZoom,this._gridClusters={},this._gridUnclustered={};for(var zoom=maxZoom;zoom>=minZoom;zoom--)this._gridClusters[zoom]=new L.DistanceGrid(radiusFn(zoom)),this._gridUnclustered[zoom]=new L.DistanceGrid(radiusFn(zoom));this._topClusterLevel=new this._markerCluster(this,minZoom-1)},_addLayer:function(layer,zoom){var gridClusters=this._gridClusters,gridUnclustered=this._gridUnclustered,minZoom=Math.floor(this._map.getMinZoom()),markerPoint,z;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(layer),layer.on(this._childMarkerEventHandlers,this);zoom>=minZoom;zoom--){markerPoint=this._map.project(layer.getLatLng(),zoom);var closest=gridClusters[zoom].getNearObject(markerPoint);if(closest){closest._addChild(layer),layer.__parent=closest;return}if(closest=gridUnclustered[zoom].getNearObject(markerPoint),closest){var parent=closest.__parent;parent&&this._removeLayer(closest,!1);var newCluster=new this._markerCluster(this,zoom,closest,layer);gridClusters[zoom].addObject(newCluster,this._map.project(newCluster._cLatLng,zoom)),closest.__parent=newCluster,layer.__parent=newCluster;var lastParent=newCluster;for(z=zoom-1;z>parent._zoom;z--)lastParent=new this._markerCluster(this,z,lastParent),gridClusters[z].addObject(lastParent,this._map.project(closest.getLatLng(),z));parent._addChild(lastParent),this._removeFromGridUnclustered(closest,zoom);return}gridUnclustered[zoom].addObject(layer,markerPoint)}this._topClusterLevel._addChild(layer),layer.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(c){c instanceof L.MarkerCluster&&c._iconNeedsUpdate&&c._updateIcon()})},_enqueue:function(fn){this._queue.push(fn),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var i=0;i<this._queue.length;i++)this._queue[i].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var mapZoom=Math.round(this._map._zoom);this._processQueue(),this._zoom<mapZoom&&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,mapZoom)):this._zoom>mapZoom?(this._animationStart(),this._animationZoomOut(this._zoom,mapZoom)):this._moveEnd()},_getExpandedVisibleBounds:function(){if(this.options.removeOutsideVisibleBounds){if(L.Browser.mobile)return this._checkBoundsMaxLat(this._map.getBounds())}else return this._mapBoundsInfinite;return this._checkBoundsMaxLat(this._map.getBounds().pad(1))},_checkBoundsMaxLat:function(bounds2){var maxLat=this._maxLat;return maxLat!==void 0&&(bounds2.getNorth()>=maxLat&&(bounds2._northEast.lat=1/0),bounds2.getSouth()<=-maxLat&&(bounds2._southWest.lat=-1/0)),bounds2},_animationAddLayerNonAnimated:function(layer,newCluster){if(newCluster===layer)this._featureGroup.addLayer(layer);else if(newCluster._childCount===2){newCluster._addToMap();var markers=newCluster.getAllChildMarkers();this._featureGroup.removeLayer(markers[0]),this._featureGroup.removeLayer(markers[1])}else newCluster._updateIcon()},_extractNonGroupLayers:function(group,output){var layers=group.getLayers(),i=0,layer;for(output=output||[];i<layers.length;i++){if(layer=layers[i],layer instanceof L.LayerGroup){this._extractNonGroupLayers(layer,output);continue}output.push(layer)}return output},_overrideMarkerIcon:function(layer){var icon=layer.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[layer]}});return icon}});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(previousZoomLevel,newZoomLevel){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),previousZoomLevel),this._topClusterLevel._recursivelyAddChildrenToMap(null,newZoomLevel,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(previousZoomLevel,newZoomLevel){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),previousZoomLevel),this._topClusterLevel._recursivelyAddChildrenToMap(null,newZoomLevel,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(layer,newCluster){this._animationAddLayerNonAnimated(layer,newCluster)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(previousZoomLevel,newZoomLevel){var bounds2=this._getExpandedVisibleBounds(),fg=this._featureGroup,minZoom=Math.floor(this._map.getMinZoom()),i;this._ignoreMove=!0,this._topClusterLevel._recursively(bounds2,previousZoomLevel,minZoom,function(c){var startPos=c._latlng,markers=c._markers,m;for(bounds2.contains(startPos)||(startPos=null),c._isSingleParent()&&previousZoomLevel+1===newZoomLevel?(fg.removeLayer(c),c._recursivelyAddChildrenToMap(null,newZoomLevel,bounds2)):(c.clusterHide(),c._recursivelyAddChildrenToMap(startPos,newZoomLevel,bounds2)),i=markers.length-1;i>=0;i--)m=markers[i],bounds2.contains(m._latlng)||fg.removeLayer(m)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(bounds2,newZoomLevel),fg.eachLayer(function(n){!(n instanceof L.MarkerCluster)&&n._icon&&n.clusterShow()}),this._topClusterLevel._recursively(bounds2,previousZoomLevel,newZoomLevel,function(c){c._recursivelyRestoreChildPositions(newZoomLevel)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(bounds2,previousZoomLevel,minZoom,function(c){fg.removeLayer(c),c.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(previousZoomLevel,newZoomLevel){this._animationZoomOutSingle(this._topClusterLevel,previousZoomLevel-1,newZoomLevel),this._topClusterLevel._recursivelyAddChildrenToMap(null,newZoomLevel,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),previousZoomLevel,this._getExpandedVisibleBounds())},_animationAddLayer:function(layer,newCluster){var me=this,fg=this._featureGroup;fg.addLayer(layer),newCluster!==layer&&(newCluster._childCount>2?(newCluster._updateIcon(),this._forceLayout(),this._animationStart(),layer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng())),layer.clusterHide(),this._enqueue(function(){fg.removeLayer(layer),layer.clusterShow(),me._animationEnd()})):(this._forceLayout(),me._animationStart(),me._animationZoomOutSingle(newCluster,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(cluster,previousZoomLevel,newZoomLevel){var bounds2=this._getExpandedVisibleBounds(),minZoom=Math.floor(this._map.getMinZoom());cluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds2,minZoom,previousZoomLevel+1,newZoomLevel);var me=this;this._forceLayout(),cluster._recursivelyBecomeVisible(bounds2,newZoomLevel),this._enqueue(function(){if(cluster._childCount===1){var m=cluster._markers[0];this._ignoreMove=!0,m.setLatLng(m.getLatLng()),this._ignoreMove=!1,m.clusterShow&&m.clusterShow()}else cluster._recursively(bounds2,newZoomLevel,minZoom,function(c){c._recursivelyRemoveChildrenFromMap(bounds2,minZoom,previousZoomLevel+1)});me._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(options){return new L.MarkerClusterGroup(options)};var MarkerCluster=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(group,zoom,a,b){L.Marker.prototype.initialize.call(this,a?a._cLatLng||a.getLatLng():new L.LatLng(0,0),{icon:this,pane:group.options.clusterPane}),this._group=group,this._zoom=zoom,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,a&&this._addChild(a),b&&this._addChild(b)},getAllChildMarkers:function(storageArray,ignoreDraggedMarker){storageArray=storageArray||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(storageArray,ignoreDraggedMarker);for(var j=this._markers.length-1;j>=0;j--)ignoreDraggedMarker&&this._markers[j].__dragStart||storageArray.push(this._markers[j]);return storageArray},getChildCount:function(){return this._childCount},zoomToBounds:function(fitBoundsOptions){for(var childClusters=this._childClusters.slice(),map=this._group._map,boundsZoom=map.getBoundsZoom(this._bounds),zoom=this._zoom+1,mapZoom=map.getZoom(),i;childClusters.length>0&&boundsZoom>zoom;){zoom++;var newClusters=[];for(i=0;i<childClusters.length;i++)newClusters=newClusters.concat(childClusters[i]._childClusters);childClusters=newClusters}boundsZoom>zoom?this._group._map.setView(this._latlng,zoom):boundsZoom<=mapZoom?this._group._map.setView(this._latlng,mapZoom+1):this._group._map.fitBounds(this._bounds,fitBoundsOptions)},getBounds:function(){var bounds2=new L.LatLngBounds;return bounds2.extend(this._bounds),bounds2},_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(new1,isNotificationFromChild){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(new1),new1 instanceof L.MarkerCluster?(isNotificationFromChild||(this._childClusters.push(new1),new1.__parent=this),this._childCount+=new1._childCount):(isNotificationFromChild||this._markers.push(new1),this._childCount++),this.__parent&&this.__parent._addChild(new1,!0)},_setClusterCenter:function(child){this._cLatLng||(this._cLatLng=child._cLatLng||child._latlng)},_resetBounds:function(){var bounds2=this._bounds;bounds2._southWest&&(bounds2._southWest.lat=1/0,bounds2._southWest.lng=1/0),bounds2._northEast&&(bounds2._northEast.lat=-1/0,bounds2._northEast.lng=-1/0)},_recalculateBounds:function(){var markers=this._markers,childClusters=this._childClusters,latSum=0,lngSum=0,totalCount=this._childCount,i,child,childLatLng,childCount;if(totalCount!==0){for(this._resetBounds(),i=0;i<markers.length;i++)childLatLng=markers[i]._latlng,this._bounds.extend(childLatLng),latSum+=childLatLng.lat,lngSum+=childLatLng.lng;for(i=0;i<childClusters.length;i++)child=childClusters[i],child._boundsNeedUpdate&&child._recalculateBounds(),this._bounds.extend(child._bounds),childLatLng=child._wLatLng,childCount=child._childCount,latSum+=childLatLng.lat*childCount,lngSum+=childLatLng.lng*childCount;this._latlng=this._wLatLng=new L.LatLng(latSum/totalCount,lngSum/totalCount),this._boundsNeedUpdate=!1}},_addToMap:function(startPos){startPos&&(this._backupLatlng=this._latlng,this.setLatLng(startPos)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(bounds2,center,maxZoom){this._recursively(bounds2,this._group._map.getMinZoom(),maxZoom-1,function(c){var markers=c._markers,i,m;for(i=markers.length-1;i>=0;i--)m=markers[i],m._icon&&(m._setPos(center),m.clusterHide())},function(c){var childClusters=c._childClusters,j,cm;for(j=childClusters.length-1;j>=0;j--)cm=childClusters[j],cm._icon&&(cm._setPos(center),cm.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(bounds2,mapMinZoom,previousZoomLevel,newZoomLevel){this._recursively(bounds2,newZoomLevel,mapMinZoom,function(c){c._recursivelyAnimateChildrenIn(bounds2,c._group._map.latLngToLayerPoint(c.getLatLng()).round(),previousZoomLevel),c._isSingleParent()&&previousZoomLevel-1===newZoomLevel?(c.clusterShow(),c._recursivelyRemoveChildrenFromMap(bounds2,mapMinZoom,previousZoomLevel)):c.clusterHide(),c._addToMap()})},_recursivelyBecomeVisible:function(bounds2,zoomLevel){this._recursively(bounds2,this._group._map.getMinZoom(),zoomLevel,null,function(c){c.clusterShow()})},_recursivelyAddChildrenToMap:function(startPos,zoomLevel,bounds2){this._recursively(bounds2,this._group._map.getMinZoom()-1,zoomLevel,function(c){if(zoomLevel!==c._zoom)for(var i=c._markers.length-1;i>=0;i--){var nm=c._markers[i];bounds2.contains(nm._latlng)&&(startPos&&(nm._backupLatlng=nm.getLatLng(),nm.setLatLng(startPos),nm.clusterHide&&nm.clusterHide()),c._group._featureGroup.addLayer(nm))}},function(c){c._addToMap(startPos)})},_recursivelyRestoreChildPositions:function(zoomLevel){for(var i=this._markers.length-1;i>=0;i--){var nm=this._markers[i];nm._backupLatlng&&(nm.setLatLng(nm._backupLatlng),delete nm._backupLatlng)}if(zoomLevel-1===this._zoom)for(var j=this._childClusters.length-1;j>=0;j--)this._childClusters[j]._restorePosition();else for(var k=this._childClusters.length-1;k>=0;k--)this._childClusters[k]._recursivelyRestoreChildPositions(zoomLevel)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(previousBounds,mapMinZoom,zoomLevel,exceptBounds){var m,i;this._recursively(previousBounds,mapMinZoom-1,zoomLevel-1,function(c){for(i=c._markers.length-1;i>=0;i--)m=c._markers[i],(!exceptBounds||!exceptBounds.contains(m._latlng))&&(c._group._featureGroup.removeLayer(m),m.clusterShow&&m.clusterShow())},function(c){for(i=c._childClusters.length-1;i>=0;i--)m=c._childClusters[i],(!exceptBounds||!exceptBounds.contains(m._latlng))&&(c._group._featureGroup.removeLayer(m),m.clusterShow&&m.clusterShow())})},_recursively:function(boundsToApplyTo,zoomLevelToStart,zoomLevelToStop,runAtEveryLevel,runAtBottomLevel){var childClusters=this._childClusters,zoom=this._zoom,i,c;if(zoomLevelToStart<=zoom&&(runAtEveryLevel&&runAtEveryLevel(this),runAtBottomLevel&&zoom===zoomLevelToStop&&runAtBottomLevel(this)),zoom<zoomLevelToStart||zoom<zoomLevelToStop)for(i=childClusters.length-1;i>=0;i--)c=childClusters[i],c._boundsNeedUpdate&&c._recalculateBounds(),boundsToApplyTo.intersects(c._bounds)&&c._recursively(boundsToApplyTo,zoomLevelToStart,zoomLevelToStop,runAtEveryLevel,runAtBottomLevel)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var backup=this.options.opacity;return this.setOpacity(0),this.options.opacity=backup,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(cellSize){this._cellSize=cellSize,this._sqCellSize=cellSize*cellSize,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(obj,point){var x=this._getCoord(point.x),y=this._getCoord(point.y),grid=this._grid,row=grid[y]=grid[y]||{},cell=row[x]=row[x]||[],stamp=L.Util.stamp(obj);this._objectPoint[stamp]=point,cell.push(obj)},updateObject:function(obj,point){this.removeObject(obj),this.addObject(obj,point)},removeObject:function(obj,point){var x=this._getCoord(point.x),y=this._getCoord(point.y),grid=this._grid,row=grid[y]=grid[y]||{},cell=row[x]=row[x]||[],i,len;for(delete this._objectPoint[L.Util.stamp(obj)],i=0,len=cell.length;i<len;i++)if(cell[i]===obj)return cell.splice(i,1),len===1&&delete row[x],!0},eachObject:function(fn,context){var i,j,k,len,row,cell,removed,grid=this._grid;for(i in grid){row=grid[i];for(j in row)for(cell=row[j],k=0,len=cell.length;k<len;k++)removed=fn.call(context,cell[k]),removed&&(k--,len--)}},getNearObject:function(point){var x=this._getCoord(point.x),y=this._getCoord(point.y),i,j,k,row,cell,len,obj,dist,objectPoint=this._objectPoint,closestDistSq=this._sqCellSize,closest=null;for(i=y-1;i<=y+1;i++)if(row=this._grid[i],row){for(j=x-1;j<=x+1;j++)if(cell=row[j],cell)for(k=0,len=cell.length;k<len;k++)obj=cell[k],dist=this._sqDist(objectPoint[L.Util.stamp(obj)],point),(dist<closestDistSq||dist<=closestDistSq&&closest===null)&&(closestDistSq=dist,closest=obj)}return closest},_getCoord:function(x){var coord=Math.floor(x/this._cellSize);return isFinite(coord)?coord:x},_sqDist:function(p,p2){var dx=p2.x-p.x,dy=p2.y-p.y;return dx*dx+dy*dy}},function(){L.QuickHull={getDistant:function(cpt,bl){var vY=bl[1].lat-bl[0].lat,vX=bl[0].lng-bl[1].lng;return vX*(cpt.lat-bl[0].lat)+vY*(cpt.lng-bl[0].lng)},findMostDistantPointFromBaseLine:function(baseLine,latLngs){var maxD=0,maxPt=null,newPoints=[],i,pt,d;for(i=latLngs.length-1;i>=0;i--){if(pt=latLngs[i],d=this.getDistant(pt,baseLine),d>0)newPoints.push(pt);else continue;d>maxD&&(maxD=d,maxPt=pt)}return{maxPoint:maxPt,newPoints}},buildConvexHull:function(baseLine,latLngs){var convexHullBaseLines=[],t=this.findMostDistantPointFromBaseLine(baseLine,latLngs);return t.maxPoint?(convexHullBaseLines=convexHullBaseLines.concat(this.buildConvexHull([baseLine[0],t.maxPoint],t.newPoints)),convexHullBaseLines=convexHullBaseLines.concat(this.buildConvexHull([t.maxPoint,baseLine[1]],t.newPoints)),convexHullBaseLines):[baseLine[0]]},getConvexHull:function(latLngs){var maxLat=!1,minLat=!1,maxLng=!1,minLng=!1,maxLatPt=null,minLatPt=null,maxLngPt=null,minLngPt=null,maxPt=null,minPt=null,i;for(i=latLngs.length-1;i>=0;i--){var pt=latLngs[i];(maxLat===!1||pt.lat>maxLat)&&(maxLatPt=pt,maxLat=pt.lat),(minLat===!1||pt.lat<minLat)&&(minLatPt=pt,minLat=pt.lat),(maxLng===!1||pt.lng>maxLng)&&(maxLngPt=pt,maxLng=pt.lng),(minLng===!1||pt.lng<minLng)&&(minLngPt=pt,minLng=pt.lng)}minLat!==maxLat?(minPt=minLatPt,maxPt=maxLatPt):(minPt=minLngPt,maxPt=maxLngPt);var ch=[].concat(this.buildConvexHull([minPt,maxPt],latLngs),this.buildConvexHull([maxPt,minPt],latLngs));return ch}}}(),L.MarkerCluster.include({getConvexHull:function(){var childMarkers=this.getAllChildMarkers(),points=[],p,i;for(i=childMarkers.length-1;i>=0;i--)p=childMarkers[i].getLatLng(),points.push(p);return L.QuickHull.getConvexHull(points)}}),L.MarkerCluster.include({_2PI:Math.PI*2,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(!(this._group._spiderfied===this||this._group._inZoomAnimation)){var childMarkers=this.getAllChildMarkers(null,!0),group=this._group,map=group._map,center=map.latLngToLayerPoint(this._latlng),positions;this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?positions=this._group.options.spiderfyShapePositions(childMarkers.length,center):childMarkers.length>=this._circleSpiralSwitchover?positions=this._generatePointsSpiral(childMarkers.length,center):(center.y+=10,positions=this._generatePointsCircle(childMarkers.length,center)),this._animationSpiderfy(childMarkers,positions)}},unspiderfy:function(zoomDetails){this._group._inZoomAnimation||(this._animationUnspiderfy(zoomDetails),this._group._spiderfied=null)},_generatePointsCircle:function(count,centerPt){var circumference=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+count),legLength=circumference/this._2PI,angleStep=this._2PI/count,res=[],i,angle2;for(legLength=Math.max(legLength,35),res.length=count,i=0;i<count;i++)angle2=this._circleStartAngle+i*angleStep,res[i]=new L.Point(centerPt.x+legLength*Math.cos(angle2),centerPt.y+legLength*Math.sin(angle2))._round();return res},_generatePointsSpiral:function(count,centerPt){var spiderfyDistanceMultiplier=this._group.options.spiderfyDistanceMultiplier,legLength=spiderfyDistanceMultiplier*this._spiralLengthStart,separation=spiderfyDistanceMultiplier*this._spiralFootSeparation,lengthFactor=spiderfyDistanceMultiplier*this._spiralLengthFactor*this._2PI,angle2=0,res=[],i;for(res.length=count,i=count;i>=0;i--)i<count&&(res[i]=new L.Point(centerPt.x+legLength*Math.cos(angle2),centerPt.y+legLength*Math.sin(angle2))._round()),angle2+=separation/legLength+i*5e-4,legLength+=lengthFactor/angle2;return res},_noanimationUnspiderfy:function(){var group=this._group,map=group._map,fg=group._featureGroup,childMarkers=this.getAllChildMarkers(null,!0),m,i;for(group._ignoreMove=!0,this.setOpacity(1),i=childMarkers.length-1;i>=0;i--)m=childMarkers[i],fg.removeLayer(m),m._preSpiderfyLatlng&&(m.setLatLng(m._preSpiderfyLatlng),delete m._preSpiderfyLatlng),m.setZIndexOffset&&m.setZIndexOffset(0),m._spiderLeg&&(map.removeLayer(m._spiderLeg),delete m._spiderLeg);group.fire("unspiderfied",{cluster:this,markers:childMarkers}),group._ignoreMove=!1,group._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(childMarkers,positions){var group=this._group,map=group._map,fg=group._featureGroup,legOptions=this._group.options.spiderLegPolylineOptions,i,m,leg,newPos;for(group._ignoreMove=!0,i=0;i<childMarkers.length;i++)newPos=map.layerPointToLatLng(positions[i]),m=childMarkers[i],leg=new L.Polyline([this._latlng,newPos],legOptions),map.addLayer(leg),m._spiderLeg=leg,m._preSpiderfyLatlng=m._latlng,m.setLatLng(newPos),m.setZIndexOffset&&m.setZIndexOffset(1e6),fg.addLayer(m);this.setOpacity(.3),group._ignoreMove=!1,group.fire("spiderfied",{cluster:this,markers:childMarkers})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(childMarkers,positions){var me=this,group=this._group,map=group._map,fg=group._featureGroup,thisLayerLatLng=this._latlng,thisLayerPos=map.latLngToLayerPoint(thisLayerLatLng),svg=L.Path.SVG,legOptions=L.extend({},this._group.options.spiderLegPolylineOptions),finalLegOpacity=legOptions.opacity,i,m,leg,legPath,legLength,newPos;for(finalLegOpacity===void 0&&(finalLegOpacity=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),svg?(legOptions.opacity=0,legOptions.className=(legOptions.className||"")+" leaflet-cluster-spider-leg"):legOptions.opacity=finalLegOpacity,group._ignoreMove=!0,i=0;i<childMarkers.length;i++)m=childMarkers[i],newPos=map.layerPointToLatLng(positions[i]),leg=new L.Polyline([thisLayerLatLng,newPos],legOptions),map.addLayer(leg),m._spiderLeg=leg,svg&&(legPath=leg._path,legLength=legPath.getTotalLength()+.1,legPath.style.strokeDasharray=legLength,legPath.style.strokeDashoffset=legLength),m.setZIndexOffset&&m.setZIndexOffset(1e6),m.clusterHide&&m.clusterHide(),fg.addLayer(m),m._setPos&&m._setPos(thisLayerPos);for(group._forceLayout(),group._animationStart(),i=childMarkers.length-1;i>=0;i--)newPos=map.layerPointToLatLng(positions[i]),m=childMarkers[i],m._preSpiderfyLatlng=m._latlng,m.setLatLng(newPos),m.clusterShow&&m.clusterShow(),svg&&(leg=m._spiderLeg,legPath=leg._path,legPath.style.strokeDashoffset=0,leg.setStyle({opacity:finalLegOpacity}));this.setOpacity(.3),group._ignoreMove=!1,setTimeout(function(){group._animationEnd(),group.fire("spiderfied",{cluster:me,markers:childMarkers})},200)},_animationUnspiderfy:function(zoomDetails){var me=this,group=this._group,map=group._map,fg=group._featureGroup,thisLayerPos=zoomDetails?map._latLngToNewLayerPoint(this._latlng,zoomDetails.zoom,zoomDetails.center):map.latLngToLayerPoint(this._latlng),childMarkers=this.getAllChildMarkers(null,!0),svg=L.Path.SVG,m,i,leg,legPath,legLength,nonAnimatable;for(group._ignoreMove=!0,group._animationStart(),this.setOpacity(1),i=childMarkers.length-1;i>=0;i--)m=childMarkers[i],m._preSpiderfyLatlng&&(m.closePopup(),m.setLatLng(m._preSpiderfyLatlng),delete m._preSpiderfyLatlng,nonAnimatable=!0,m._setPos&&(m._setPos(thisLayerPos),nonAnimatable=!1),m.clusterHide&&(m.clusterHide(),nonAnimatable=!1),nonAnimatable&&fg.removeLayer(m),svg&&(leg=m._spiderLeg,legPath=leg._path,legLength=legPath.getTotalLength()+.1,legPath.style.strokeDashoffset=legLength,leg.setStyle({opacity:0})));group._ignoreMove=!1,setTimeout(function(){var stillThereChildCount=0;for(i=childMarkers.length-1;i>=0;i--)m=childMarkers[i],m._spiderLeg&&stillThereChildCount++;for(i=childMarkers.length-1;i>=0;i--)m=childMarkers[i],m._spiderLeg&&(m.clusterShow&&m.clusterShow(),m.setZIndexOffset&&m.setZIndexOffset(0),stillThereChildCount>1&&fg.removeLayer(m),map.removeLayer(m._spiderLeg),delete m._spiderLeg);group._animationEnd(),group.fire("unspiderfied",{cluster:me,markers:childMarkers})},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(zoomDetails){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(zoomDetails))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(zoomDetails){this._spiderfied&&this._spiderfied.unspiderfy(zoomDetails)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(layer){layer._spiderLeg&&(this._featureGroup.removeLayer(layer),layer.clusterShow&&layer.clusterShow(),layer.setZIndexOffset&&layer.setZIndexOffset(0),this._map.removeLayer(layer._spiderLeg),delete layer._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(layers){return layers?layers instanceof L.MarkerClusterGroup?layers=layers._topClusterLevel.getAllChildMarkers():layers instanceof L.LayerGroup?layers=layers._layers:layers instanceof L.MarkerCluster?layers=layers.getAllChildMarkers():layers instanceof L.Marker&&(layers=[layers]):layers=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(layers),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(layers),this},_flagParentsIconsNeedUpdate:function(layers){var id,parent;for(id in layers)for(parent=layers[id].__parent;parent;)parent._iconNeedsUpdate=!0,parent=parent.__parent},_refreshSingleMarkerModeMarkers:function(layers){var id,layer;for(id in layers)layer=layers[id],this.hasLayer(layer)&&layer.setIcon(this._overrideMarkerIcon(layer))}}),L.Marker.include({refreshIconOptions:function(options,directlyRefreshClusters){var icon=this.options.icon;return L.setOptions(icon,options),this.setIcon(icon),directlyRefreshClusters&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),exports4.MarkerClusterGroup=MarkerClusterGroup2,exports4.MarkerCluster=MarkerCluster,Object.defineProperty(exports4,"__esModule",{value:!0})})}(leaflet_markerclusterSrc$1,leaflet_markerclusterSrc$1.exports)),leaflet_markerclusterSrc$1.exports}requireLeaflet_markerclusterSrc();const NEWER=Symbol("newer"),OLDER=Symbol("older");class Entry{constructor(key,value){__publicField(this,"key");__publicField(this,"value");this.key=key,this.value=value,this[NEWER]=void 0,this[OLDER]=void 0}}class LRUMap{constructor(limit,entries){__publicField(this,"size");__publicField(this,"limit");__publicField(this,"oldest");__publicField(this,"newest");__publicField(this,"_keymap");typeof limit!="number"&&(entries=limit,limit=0),this.size=0,this.limit=limit,this.oldest=this.newest=void 0,this._keymap=new Map,entries&&(this.assign(entries),limit<1&&(this.limit=this.size))}_markEntryAsUsed(entry){entry!==this.newest&&(entry[NEWER]&&(entry===this.oldest&&(this.oldest=entry[NEWER]),entry[NEWER][OLDER]=entry[OLDER]),entry[OLDER]&&(entry[OLDER][NEWER]=entry[NEWER]),entry[NEWER]=void 0,entry[OLDER]=this.newest,this.newest&&(this.newest[NEWER]=entry),this.newest=entry)}assign(entries){let entry,limit=this.limit||Number.MAX_VALUE;this._keymap.clear();const it=entries[Symbol.iterator]();for(let itv=it.next();!itv.done;itv=it.next()){const e=new Entry(itv.value[0],itv.value[1]);if(this._keymap.set(e.key,e),entry?(entry[NEWER]=e,e[OLDER]=entry):this.oldest=e,entry=e,limit--==0)throw new Error("overflow")}this.newest=entry,this.size=this._keymap.size}get(key){const entry=this._keymap.get(key);if(entry)return this._markEntryAsUsed(entry),entry.value}set(key,value){let entry=this._keymap.get(key);return entry?(entry.value=value,this._markEntryAsUsed(entry),this):(this._keymap.set(key,entry=new Entry(key,value)),this.newest?(this.newest[NEWER]=entry,entry[OLDER]=this.newest):this.oldest=entry,this.newest=entry,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const entry=this.oldest;if(entry)return this.oldest[NEWER]?(this.oldest=this.oldest[NEWER],this.oldest[OLDER]=void 0):(this.oldest=void 0,this.newest=void 0),entry[NEWER]=entry[OLDER]=void 0,this._keymap.delete(entry.key),--this.size,[entry.key,entry.value]}find(key){const e=this._keymap.get(key);return e?e.value:void 0}has(key){return this._keymap.has(key)}delete(key){const entry=this._keymap.get(key);if(entry)return this._keymap.delete(entry.key),entry[NEWER]&&entry[OLDER]?(entry[OLDER][NEWER]=entry[NEWER],entry[NEWER][OLDER]=entry[OLDER]):entry[NEWER]?(entry[NEWER][OLDER]=void 0,this.oldest=entry[NEWER]):entry[OLDER]?(entry[OLDER][NEWER]=void 0,this.newest=entry[OLDER]):this.oldest=this.newest=void 0,this.size--,entry.value}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new KeyIterator(this.oldest)}values(){return new ValueIterator(this.oldest)}entries(){return this}[Symbol.iterator](){return new EntryIterator(this.oldest)}forEach(fun,thisObj){typeof thisObj!="object"&&(thisObj=this);let entry=this.oldest;for(;entry;)fun.call(thisObj,entry.value,entry.key,this),entry=entry[NEWER]}toJSON(){const s=new Array(this.size);let i=0,entry=this.oldest;for(;entry;)s[i++]={key:entry.key,value:entry.value},entry=entry[NEWER];return s}toString(){let s="",entry=this.oldest;for(;entry;)s+=String(entry.key)+":"+entry.value,entry=entry[NEWER],entry&&(s+=" < ");return s}}function EntryIterator(oldestEntry){this.entry=oldestEntry}EntryIterator.prototype[Symbol.iterator]=function(){return this},EntryIterator.prototype.next=function(){const ent=this.entry;return ent?(this.entry=ent[NEWER],{done:!1,value:[ent.key,ent.value]}):{done:!0,value:void 0}};function KeyIterator(oldestEntry){this.entry=oldestEntry}KeyIterator.prototype[Symbol.iterator]=function(){return this},KeyIterator.prototype.next=function(){const ent=this.entry;return ent?(this.entry=ent[NEWER],{done:!1,value:ent.key}):{done:!0,value:void 0}};function ValueIterator(oldestEntry){this.entry=oldestEntry}ValueIterator.prototype[Symbol.iterator]=function(){return this},ValueIterator.prototype.next=function(){const ent=this.entry;return ent?(this.entry=ent[NEWER],{done:!1,value:ent.value}):{done:!0,value:void 0}};function waitForAPI(callback,context){let checkCounter=0,intervalId=null;intervalId=setInterval(function(){if(checkCounter>=20)throw clearInterval(intervalId),new Error("window.google not found after 10 seconds");window.google&&window.google.maps&&window.google.maps.Map&&(clearInterval(intervalId),callback.call(context)),++checkCounter},500)}L.GridLayer.GoogleMutant=L.GridLayer.extend({options:{maxZoom:21,type:"roadmap",maxNativeZoom:21},initialize:function(options){L.GridLayer.prototype.initialize.call(this,options),this._tileCallbacks={},this._lru=new LRUMap(100),this._imagesPerTile=this.options.type==="hybrid"?2:1,this._boundOnMutatedImage=this._onMutatedImage.bind(this)},onAdd:function(map){L.GridLayer.prototype.onAdd.call(this,map),this._initMutantContainer(),this._logoContainer&&map._controlCorners.bottomleft.appendChild(this._logoContainer),this._attributionContainer&&map._controlCorners.bottomright.appendChild(this._attributionContainer),waitForAPI(()=>{this._map&&(this._initMutant(),google.maps.event.addListenerOnce(this._mutant,"idle",()=>{this._map&&(this._checkZoomLevels(),this._mutantIsReady=!0)}))})},onRemove:function(map){L.GridLayer.prototype.onRemove.call(this,map),this._observer.disconnect(),map._container.removeChild(this._mutantContainer),this._logoContainer&&L.DomUtil.remove(this._logoContainer),this._attributionContainer&&L.DomUtil.remove(this._attributionContainer),this._mutant&&google.maps.event.clearListeners(this._mutant,"idle")},addGoogleLayer:function(googleLayerName,options){return this._subLayers||(this._subLayers={}),this.whenReady(()=>{var Constructor=google.maps[googleLayerName],googleLayer=new Constructor(options);googleLayer.setMap(this._mutant),this._subLayers[googleLayerName]=googleLayer}),this},removeGoogleLayer:function(googleLayerName){return this.whenReady(()=>{var googleLayer=this._subLayers&&this._subLayers[googleLayerName];googleLayer&&(googleLayer.setMap(null),delete this._subLayers[googleLayerName])}),this},_initMutantContainer:function(){this._mutantContainer||(this._mutantContainer=L.DomUtil.create("div","leaflet-google-mutant leaflet-top leaflet-left"),this._mutantContainer.id="_MutantContainer_"+L.Util.stamp(this._mutantContainer),this._mutantContainer.style.pointerEvents="none",this._mutantContainer.style.visibility="hidden",L.DomEvent.off(this._mutantContainer)),this._map.getContainer().appendChild(this._mutantContainer),this.setOpacity(this.options.opacity);const style=this._mutantContainer.style;this._map.options.zoomSnap<1?(style.width="180%",style.height="180%"):(style.width="100%",style.height="100%"),style.zIndex=-1,this._attachObserver(this._mutantContainer)},_initMutant:function(){if(!this._mutant){var options={center:{lat:0,lng:0},zoom:0,tilt:0,mapTypeId:this.options.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,styles:this.options.styles||[],backgroundColor:"transparent"};this.options.mapId!=null&&(options.mapId=this.options.mapId);var map=new google.maps.Map(this._mutantContainer,options);this._mutant=map,this._update(),this.fire("spawned",{mapObject:map}),this._waitControls(),this.once("controls_ready",this._setupAttribution)}},_attachObserver:function(node){this._observer||(this._observer=new MutationObserver(this._onMutations.bind(this))),this._observer.observe(node,{childList:!0,subtree:!0}),Array.prototype.forEach.call(node.querySelectorAll("img"),this._boundOnMutatedImage)},_waitControls:function(){const id=setInterval(()=>{const layoutManager=this._mutant.__gm.layoutManager;if(!layoutManager)return;clearInterval(id);let positions;Object.keys(layoutManager).forEach(function(key){const el=layoutManager[key];el.get&&el.get(1)instanceof Node&&(positions=el)}),this.fire("controls_ready",{positions})},50)},_setupAttribution:function(ev){if(!this._map)return;const pos=google.maps.ControlPosition,ctr=this._attributionContainer=ev.positions.get(pos.BOTTOM_RIGHT);L.DomUtil.addClass(ctr,"leaflet-control leaflet-control-attribution"),L.DomEvent.disableClickPropagation(ctr),ctr.style.height="14px",this._map._controlCorners.bottomright.appendChild(ctr),this._logoContainer=ev.positions.get(pos.BOTTOM_LEFT),this._logoContainer.style.pointerEvents="auto",this._map._controlCorners.bottomleft.appendChild(this._logoContainer)},_onMutations:function(mutations){for(var i=0;i<mutations.length;++i)for(var mutation=mutations[i],j=0;j<mutation.addedNodes.length;++j){var node=mutation.addedNodes[j];node instanceof HTMLImageElement?this._onMutatedImage(node):node instanceof HTMLElement&&Array.prototype.forEach.call(node.querySelectorAll("img"),this._boundOnMutatedImage)}},_roadRegexp:/!1i(\d+)!2i(\d+)!3i(\d+|VinaFnapurmBegrtn)!/,_satRegexp:/x=(\d+)&y=(\d+)&z=(\d+|VinaFnapurmBegrtn)/,_onMutatedImage:function(imgNode){let coords,match=imgNode.src.match(this._roadRegexp),sublayer=0;if(match?(coords={z:match[1],x:match[2],y:match[3]},this._imagesPerTile>1&&(imgNode.style.zIndex=1,sublayer=1)):(match=imgNode.src.match(this._satRegexp),match&&(coords={x:match[1],y:match[2],z:match[3]}),sublayer=0),coords){var tileKey=this._tileCoordsToKey(coords);imgNode.style.position="absolute";var key=tileKey+"/"+sublayer;this._lru.set(key,imgNode),key in this._tileCallbacks&&this._tileCallbacks[key]&&(this._tileCallbacks[key].forEach(callback=>callback(imgNode)),delete this._tileCallbacks[key])}},createTile:function(coords,done){const key=this._tileCoordsToKey(coords),tileContainer=L.DomUtil.create("div");tileContainer.style.textAlign="left",tileContainer.dataset.pending=this._imagesPerTile,done=done.bind(this,null,tileContainer);for(var i=0;i<this._imagesPerTile;++i){const key2=key+"/"+i,imgNode=this._lru.get(key2);imgNode?(tileContainer.appendChild(this._clone(imgNode)),--tileContainer.dataset.pending):(this._tileCallbacks[key2]=this._tileCallbacks[key2]||[],this._tileCallbacks[key2].push((function(c){return(function(imgNode2){c.appendChild(this._clone(imgNode2)),--c.dataset.pending,parseInt(c.dataset.pending)||done()}).bind(this)}).bind(this)(tileContainer)))}return parseInt(tileContainer.dataset.pending)||L.Util.requestAnimFrame(done),tileContainer},_clone:function(imgNode){const clonedImgNode=imgNode.cloneNode(!0);return clonedImgNode.style.visibility="visible",clonedImgNode},_checkZoomLevels:function(){const zoomLevel=this._map.getZoom(),gMapZoomLevel=this._mutant.getZoom();!zoomLevel||!gMapZoomLevel||(gMapZoomLevel!==zoomLevel||gMapZoomLevel>this.options.maxNativeZoom)&&this._setMaxNativeZoom(gMapZoomLevel)},_setMaxNativeZoom:function(zoomLevel){zoomLevel!==this.options.maxNativeZoom&&(this.options.maxNativeZoom=zoomLevel,this._resetView())},_update:function(center){if(this._mutant){center=center||this._map.getCenter();const _center=new google.maps.LatLng(center.lat,center.lng),zoom=Math.round(this._map.getZoom()),mutantZoom=this._mutant.getZoom();this._mutant.setCenter(_center),zoom!==mutantZoom&&(this._mutant.setZoom(zoom),this._mutantIsReady&&this._checkZoomLevels())}L.GridLayer.prototype._update.call(this,center)},whenReady:function(callback,context){return this._mutant?callback.call(context||this,{target:this}):this.on("spawned",callback,context),this}}),L.gridLayer.googleMutant=function(options){return new L.GridLayer.GoogleMutant(options)};const GoogleMutant=L.GridLayer.GoogleMutant,defaults={iconColor:"#1EB300",iconAnchor:{marker:[14,34],circle:[11,10],"circle-dot":[5,5],"rectangle-dot":[5,6],doughnut:[8,8]},popupAnchor:{marker:[0,-25],circle:[-3,-76],"circle-dot":[0,-2],"rectangle-dot":[0,-2],doughnut:[0,-2]},innerIconAnchor:{marker:[-2,5],circle:[0,2]},iconSize:{marker:[28,28],circle:[22,22],"circle-dot":[2,2],"rectangle-dot":[2,2],doughnut:[15,15]}},IconClass=leafletSrcExports.Icon.extend({options:{icon:"leaf",iconSize:defaults.iconSize.circle,iconAnchor:defaults.iconAnchor.marker,iconShape:"marker",iconStyle:"",innerIconAnchor:[0,3],innerIconStyle:"",isAlphaNumericIcon:!1,text:1,borderColor:defaults.iconColor,borderWidth:2,borderStyle:"solid",backgroundColor:"white",textColor:defaults.iconColor,customClasses:"",spin:!1,prefix:"fa",html:""},initialize(options){this.applyDefaults(options),this.options=!options||!options.html?leafletSrcExports.Util.setOptions(this,options):options},applyDefaults(options){options&&(!options.iconSize&&options.iconShape&&(options.iconSize=defaults.iconSize[options.iconShape]),!options.iconAnchor&&options.iconShape&&(options.iconAnchor=defaults.iconAnchor[options.iconShape]),!options.popupAnchor&&options.iconShape&&(options.popupAnchor=defaults.popupAnchor[options.iconShape]),options.innerIconAnchor||(options.iconShape==="circle"||options.iconShape==="marker")&&(options.iconShape==="circle"&&options.isAlphaNumericIcon?options.innerIconAnchor=[0,-1]:options.iconShape==="marker"&&!options.isAlphaNumericIcon&&(options.innerIconAnchor=defaults.innerIconAnchor[options.iconShape])))},createIcon(){const iconDiv=document.createElement("div"),options=this.options;if(iconDiv.innerHTML=options.html?options.html:this.createIconInnerHtml(),this._setIconStyles(iconDiv),this.options.iconShape==="marker"){const wrapperDiv=document.createElement("div");return wrapperDiv.className="beautify-marker"+(options.props.owner._currSelRow===options.props.row?" selected":""),wrapperDiv.appendChild(iconDiv),wrapperDiv}return iconDiv},createIconInnerHtml(){const options=this.options;if(options.iconShape==="circle-dot"||options.iconShape==="rectangle-dot"||options.iconShape==="doughnut")return"";const innerIconStyle=this.getInnerIconStyle(options);if(options.isAlphaNumericIcon)return'<div style="'+innerIconStyle+'">'+options.text+"</div>";let spinClass="";return options.spin&&(spinClass=" fa-spin"),'<i class="'+options.prefix+" "+options.icon+spinClass+'" style="'+innerIconStyle+'"></i>'},getInnerIconStyle(options){const innerAnchor=leafletSrcExports.point(options.innerIconAnchor);return"color:"+options.textColor+";margin-top:"+innerAnchor.y+"px; margin-left:"+innerAnchor.x+"px;"+options.innerIconStyle},_setIconStyles(iconDiv){const options=this.options,size=leafletSrcExports.point(options.iconSize),anchor=leafletSrcExports.point(options.iconAnchor);if(iconDiv.className="beautify-marker ",options.iconShape&&(iconDiv.className+=options.iconShape),options.customClasses&&(iconDiv.className+=" "+options.customClasses),iconDiv.style.backgroundColor=options.backgroundColor,iconDiv.style.color=options.textColor,iconDiv.style.borderColor=options.borderColor,iconDiv.style.borderWidth=options.borderWidth+"px",iconDiv.style.borderStyle=options.borderStyle,size&&(iconDiv.style.width=size.x+"px",iconDiv.style.height=size.y+"px"),anchor&&(iconDiv.style.marginLeft=-anchor.x+"px",iconDiv.style.marginTop=-anchor.y+"px"),options.iconStyle){let cStyle=iconDiv.getAttribute("style");cStyle+=options.iconStyle,iconDiv.setAttribute("style",cStyle)}}});function BeautifyIcon(options){return new IconClass(options)}class LeafletLayer extends leafletSrcExports.Layer{constructor(){super(...arguments);__publicField(this,"_rootGroup")}}class D3SvgOverlay extends LeafletLayer{constructor(options={}){super();__publicField(this,"_svg");__publicField(this,"map");__publicField(this,"selection");__publicField(this,"projection");__publicField(this,"_pixelOrigin");__publicField(this,"_zoomDiff");__publicField(this,"_zoom");__publicField(this,"_scale");__publicField(this,"_shift");__publicField(this,"_wgsOrigin");__publicField(this,"_wgsInitialShift");__publicField(this,"_drawCallback");this._options(options)}svg(){return this._rootGroup}drawCallback(_){return arguments.length?(this._drawCallback=_,this):this._drawCallback}getBounds(){if(!this.selection||!this.projection)return new leafletSrcExports.LatLngBounds([-90,-180],[90,180]);const bbox=this.selection.node().getBBox();let sw;try{sw=this.projection.layerPointToLatLng(new leafletSrcExports.Point(bbox.x,bbox.y+bbox.height))}catch{sw=[-90,-180]}let ne;try{ne=this.projection.layerPointToLatLng(new leafletSrcExports.Point(bbox.x+bbox.width,bbox.y))}catch{ne=[90,180]}return new leafletSrcExports.LatLngBounds(sw,ne)}_undef(a){return typeof a>"u"}_options(options){return this._undef(options)?this.options:(options.zoomHide=this._undef(options.zoomHide)?!1:options.zoomHide,options.zoomDraw=this._undef(options.zoomDraw)?!0:options.zoomDraw,this.options=options)}draw(){!this.map||!this._drawCallback||(this.projection.metresPerPixel=40075016686e-3*Math.abs(Math.cos(this.map.getCenter().lat*Math.PI/180))/Math.pow(2,this.map.getZoom()+8)*this.projection.scale,this._drawCallback(this.selection,this.projection,this.map.getZoom()))}_zoomChange(evt){const newZoom=this._undef(evt.zoom)?this.map._zoom:evt.zoom;this._zoomDiff=newZoom-this._zoom,this._scale=Math.pow(2,this._zoomDiff),this.projection.scale=this._scale,this._shift=this.map.latLngToLayerPoint(this._wgsOrigin)._subtract(this._wgsInitialShift.multiplyBy(this._scale));const shift=["translate(",this._shift.x,",",this._shift.y,") "],scale=["scale(",this._scale,",",this._scale,") "];this._rootGroup.attr("transform",shift.concat(scale).join("")),this.options.zoomDraw&&this.draw()}onAdd(map){this.map=map;const _layer=this;return this._svg=leafletSrcExports.svg(),map.addLayer(this._svg),this._rootGroup=common.select(this._svg._rootGroup).classed("d3-overlay",!0),this._rootGroup.classed("leaflet-zoom-hide",this.options.zoomDraw),this.selection=this._rootGroup,this._pixelOrigin=map.getPixelOrigin(),this._wgsOrigin=leafletSrcExports.latLng([0,0]),this._wgsInitialShift=this.map.latLngToLayerPoint(this._wgsOrigin),this._zoom=this.map.getZoom(),this._shift=leafletSrcExports.point(0,0),this._scale=1,this.projection={latLngToLayerPoint(latLng,zoom){return zoom=_layer._undef(zoom)?_layer._zoom:zoom,_layer.map.project(leafletSrcExports.latLng(latLng),zoom)._subtract(_layer._pixelOrigin)},layerPointToLatLng(point,zoom){zoom=_layer._undef(zoom)?_layer._zoom:zoom;const projectedPoint=leafletSrcExports.point(point).add(_layer._pixelOrigin);return _layer.map.unproject(projectedPoint,zoom)},unitsPerMeter:256*Math.pow(2,_layer._zoom)/40075017,metresPerPixel:40075016686e-3*Math.abs(Math.cos(map.getCenter().lat*Math.PI/180))/Math.pow(2,map.getZoom()+8),map:_layer.map,layer:_layer,scale:1},this.projection._projectPoint=function(x,y){const point=_layer.projection.latLngToLayerPoint(new leafletSrcExports.LatLng(y,x));this.stream.point(point.x,point.y)},this.projection.pathFromGeojson=d3GeoPath().projection(d3GeoTransform({point:this.projection._projectPoint})),this.projection.latLngToLayerFloatPoint=this.projection.latLngToLayerPoint,this.projection.getZoom=this.map.getZoom.bind(this.map),this.projection.getBounds=this.map.getBounds.bind(this.map),this.selection=this._rootGroup,this.draw(),this}getEvents(){return{zoomend:this._zoomChange,viewreset:this._zoomChange}}onRemove(map){return this._svg.remove(),this}addTo(map){return map.addLayer(this),this}}var simpleheat$2={exports:{}},hasRequiredSimpleheat;function requireSimpleheat(){return hasRequiredSimpleheat||(hasRequiredSimpleheat=1,function(module2){module2.exports=simpleheat2;function simpleheat2(canvas){if(!(this instanceof simpleheat2))return new simpleheat2(canvas);this._canvas=canvas=typeof canvas=="string"?document.getElementById(canvas):canvas,this._ctx=canvas.getContext("2d"),this._width=canvas.width,this._height=canvas.height,this._max=1,this._data=[]}simpleheat2.prototype={defaultRadius:25,defaultGradient:{.4:"blue",.6:"cyan",.7:"lime",.8:"yellow",1:"red"},data:function(data){return this._data=data,this},max:function(max){return this._max=max,this},add:function(point){return this._data.push(point),this},clear:function(){return this._data=[],this},radius:function(r,blur){blur=blur===void 0?15:blur;var circle2=this._circle=this._createCanvas(),ctx=circle2.getContext("2d"),r2=this._r=r+blur;return circle2.width=circle2.height=r2*2,ctx.shadowOffsetX=ctx.shadowOffsetY=r2*2,ctx.shadowBlur=blur,ctx.shadowColor="black",ctx.beginPath(),ctx.arc(-r2,-r2,r,0,Math.PI*2,!0),ctx.closePath(),ctx.fill(),this},resize:function(){this._width=this._canvas.width,this._height=this._canvas.height},gradient:function(grad){var canvas=this._createCanvas(),ctx=canvas.getContext("2d"),gradient=ctx.createLinearGradient(0,0,0,256);canvas.width=1,canvas.height=256;for(var i in grad)gradient.addColorStop(+i,grad[i]);return ctx.fillStyle=gradient,ctx.fillRect(0,0,1,256),this._grad=ctx.getImageData(0,0,1,256).data,this},draw:function(minOpacity){this._circle||this.radius(this.defaultRadius),this._grad||this.gradient(this.defaultGradient);var ctx=this._ctx;ctx.clearRect(0,0,this._width,this._height);for(var i=0,len=this._data.length,p;i<len;i++)p=this._data[i],ctx.globalAlpha=Math.max(p[2]/this._max,minOpacity===void 0?.05:minOpacity),ctx.drawImage(this._circle,p[0]-this._r,p[1]-this._r);var colored=ctx.getImageData(0,0,this._width,this._height);return this._colorize(colored.data,this._grad),ctx.putImageData(colored,0,0),this},_colorize:function(pixels,gradient){for(var i=0,len=pixels.length,j;i<len;i+=4)j=pixels[i+3]*4,j&&(pixels[i]=gradient[j],pixels[i+1]=gradient[j+1],pixels[i+2]=gradient[j+2])},_createCanvas:function(){return typeof document<"u"?document.createElement("canvas"):new this._canvas.constructor}}}(simpleheat$2)),simpleheat$2.exports}var simpleheatExports=requireSimpleheat();const simpleheat$1=getDefaultExportFromCjs(simpleheatExports),_simpleheat=_mergeNamespaces({__proto__:null,default:simpleheat$1},[simpleheatExports]),simpleheat=window.simpleheat||_simpleheat&&simpleheat$1||_simpleheat;class LeafletLayer2 extends leafletSrcExports.Layer{}let HeatLayer$1=class extends LeafletLayer2{constructor(latlngs,options={}){super(options);__publicField(this,"_latlngs");__publicField(this,"_heat");__publicField(this,"_frame");__publicField(this,"_canvas");this._latlngs=latlngs}initialize(options){this.setOptions(options)}setLatLngs(latlngs){return this._latlngs=latlngs,this.redraw()}addLatLng(latlng){return this._latlngs.push(latlng),this.redraw()}setOptions(options){return this.options=options,this._heat&&this._updateOptions(),this.redraw()}redraw(){return this._heat&&!this._frame&&!this._map._animating&&(this._frame=leafletSrcExports.Util.requestAnimFrame(this._redraw,this)),this}onAdd(map){return this._map=map,this._canvas||this._initCanvas(),map._panes.overlayPane.appendChild(this._canvas),map.on("moveend",this._reset,this),map.options.zoomAnimation&&leafletSrcExports.Browser.any3d&&map.on("zoomanim",this._animateZoom,this),this._reset(),this}onRemove(map){return map.getPanes().overlayPane.removeChild(this._canvas),map.off("moveend",this._reset,this),map.options.zoomAnimation&&map.off("zoomanim",this._animateZoom,this),this}addTo(map){return map.addLayer(this),this}_initCanvas(){const canvas=this._canvas=leafletSrcExports.DomUtil.create("canvas","leaflet-heatmap-layer leaflet-layer"),originProp=leafletSrcExports.DomUtil.testProp(["transformOrigin","WebkitTransformOrigin","msTransformOrigin"]);canvas.style[originProp]="50% 50%";const size=this._map.getSize();canvas.width=size.x,canvas.height=size.y;const animated=this._map.options.zoomAnimation&&leafletSrcExports.Browser.any3d;leafletSrcExports.DomUtil.addClass(canvas,"leaflet-zoom-"+(animated?"animated":"hide")),this._heat=simpleheat(canvas),this._updateOptions()}_updateOptions(){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(){const topLeft=this._map.containerPointToLayerPoint([0,0]);leafletSrcExports.DomUtil.setPosition(this._canvas,topLeft);const size=this._map.getSize();this._heat._width!==size.x&&(this._canvas.width=this._heat._width=size.x),this._heat._height!==size.y&&(this._canvas.height=this._heat._height=size.y),this._redraw()}_redraw(){const data=[],r=this._heat._r,size=this._map.getSize(),bounds2=new leafletSrcExports.Bounds(leafletSrcExports.point([-r,-r]),size.add([r,r])),max=this.options.max===void 0?1:this.options.max,maxZoom=this.options.maxZoom===void 0?this._map.getMaxZoom():this.options.maxZoom,v=1/Math.pow(2,Math.max(0,Math.min(maxZoom-this._map.getZoom(),12))),cellSize=r/2,grid=[],panePos=this._map._getMapPanePos(),offsetX=panePos.x%cellSize,offsetY=panePos.y%cellSize;let i,len,p,cell,x,y,j,len2,k;for(i=0,len=this._latlngs.length;i<len;i++)p=this._map.latLngToContainerPoint(this._latlngs[i]),bounds2.contains(p)&&(x=Math.floor((p.x-offsetX)/cellSize)+2,y=Math.floor((p.y-offsetY)/cellSize)+2,k=(this._latlngs[i].alt!==void 0?this._latlngs[i].alt:this._latlngs[i][2]!==void 0?+this._latlngs[i][2]:1)*v,grid[y]=grid[y]||[],cell=grid[y][x],cell?(cell[0]=(cell[0]*cell[2]+p.x*k)/(cell[2]+k),cell[1]=(cell[1]*cell[2]+p.y*k)/(cell[2]+k),cell[2]+=k):grid[y][x]=[p.x,p.y,k]);for(i=0,len=grid.length;i<len;i++)if(grid[i])for(j=0,len2=grid[i].length;j<len2;j++)cell=grid[i][j],cell&&data.push([Math.round(cell[0]),Math.round(cell[1]),Math.min(cell[2],max)]);this._heat.data(data).draw(this.options.minOpacity),this._frame=null}_animateZoom(e){const scale=this._map.getZoomScale(e.zoom),offset=this._map._getCenterOffset(e.center)._multiplyBy(-scale).subtract(this._map._getMapPanePos());leafletSrcExports.DomUtil.setTransform?leafletSrcExports.DomUtil.setTransform(this._canvas,offset,scale):this._canvas.style[leafletSrcExports.DomUtil.TRANSFORM]=leafletSrcExports.DomUtil.getTranslateString(offset)+" scale("+scale+")"}};const MarkerClusterGroup=L$1.MarkerClusterGroup;class TileLayer extends common.Widget{constructor(cluster=!1){super();__publicField(this,"_layer",new leafletSrcExports.FeatureGroup);__publicField(this,"_crs",leafletSrcExports.CRS.EPSG3857);__publicField(this,"_initPromise");this._layer.__hpcc_layer=this}crs(){return this._crs}attribution(){return""}clear(){this._layer.clearLayers()}add(layer){this._layer.addLayer(layer)}init(){return this._initPromise||(this._initPromise=Promise.resolve()),this._initPromise}hasBounds(){return!1}getBounds(){return this._layer.getBounds()}layerEnter(map){map.addLayer(this._layer)}layerUpdate(map){}layerExit(map){this._layer.clearLayers(),map.removeLayer(this._layer)}zoomEnd(e){}moveEnd(e){}viewReset(e){}}const projAlbers=resolve("Albers").scale(.5),projAlbersUsaPr=resolve("AlbersUsaPr").scale(.5),AlbersProjection={project(latLng){let point=projAlbersUsaPr([latLng.lng,latLng.lat]);return point||(point=projAlbers([latLng.lng,latLng.lat])),new leafletSrcExports.Point(point[0],point[1])},unproject(point){if(!isNaN(point.x)&&!isNaN(point.y)){const latLng=projAlbers.invert([point.x,point.y]);return new leafletSrcExports.LatLng(latLng[1],latLng[0])}else return new leafletSrcExports.LatLng(0,0)}},AlbersCRS=leafletSrcExports.Util.extend({},leafletSrcExports.CRS,{projection:AlbersProjection,transformation:new leafletSrcExports.Transformation(1,0,1,0),infinite:!0});class AlbersLayer extends TileLayer{constructor(){super();__publicField(this,"_crs",AlbersCRS)}hasBounds(){return!0}getBounds(){return new leafletSrcExports.LatLngBounds([20,-123],[49,-64])}}AlbersLayer.prototype._class+=" map_AlbersLayer";class BlankLayer extends TileLayer{constructor(){super()}}BlankLayer.prototype._class+=" map_BlankLayer";class GMapLayer extends TileLayer{constructor(){super()}init(){return this._initPromise||(this._initPromise=requireGoogleMap()),this._initPromise}attribution(){return window.__hpcc_gmap_apikey?"":"DEVELOPER USE ONLY (@hpcc-js)"}getMaxZoom(){return 23}layerEnter(map){super.layerEnter(map),this.add(new GoogleMutant({type:"roadmap",styles:this.googleMapStyles()}))}}GMapLayer.prototype._class+=" map_GMapLayer",GMapLayer.prototype.publish("googleMapStyles",{},"object","Styling for map colors etc",null,{tags:["Basic"]});class MapBoxLayer extends TileLayer{constructor(){super()}attribution(){return window.__hpcc_mapbox_apikey?"":"DEVELOPER USE ONLY (@hpcc-js)"}getMaxZoom(){return 18}layerEnter(map){super.layerEnter(map),window.__hpcc_mapbox_apikey||console.warn("__hpcc_mapbox_apikey does not contain a valid API key, reverting to developers key (expect limited performance)");const hpcc_mapbox_apikey=window.__hpcc_mapbox_apikey||"pk.eyJ1IjoibGVzY2htb28iLCJhIjoiY2psY2FqY3l3MDhqNDN3cDl1MzFmZnkwcCJ9.HRoFwmz1j80gyz18ruggqw";this.add(new leafletSrcExports.TileLayer(`https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token=${hpcc_mapbox_apikey}`,{attribution:'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',maxZoom:18,id:"streets-v11",accessToken:hpcc_mapbox_apikey}))}}MapBoxLayer.prototype._class+=" map_MapBoxLayer";class OpenStreetLayer extends TileLayer{constructor(){super()}attribution(){return""}getMaxZoom(){return 18}layerEnter(map){super.layerEnter(map),this.add(new leafletSrcExports.TileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',maxZoom:18,id:"open.streets"}))}}OpenStreetLayer.prototype._class+=" map_MapBoxLayer";class Leaflet extends common.HTMLWidget{constructor(){super();__publicField(this,"_leafletElement");__publicField(this,"_leafletMap");__publicField(this,"_iconBar",new common.IconBar().buttons([new common.Button().faChar("fa-plus").tooltip("Zoom in").on("click",()=>{this.zoomPlus()}),new common.Button().faChar("fa-minus").tooltip("Zoom out").on("click",()=>{this.zoomMinus()}),new common.Spacer,new common.Button().faChar("fa-arrows-alt").tooltip("Zoom to fit").on("click",()=>{this.zoomToFit()})]));__publicField(this,"_blankLayer",new BlankLayer);__publicField(this,"_albersLayer",new AlbersLayer);__publicField(this,"_mapBoxLayer",new MapBoxLayer);__publicField(this,"_openStreetLayer",new OpenStreetLayer);__publicField(this,"_gmapLayer",new GMapLayer);__publicField(this,"_owner");__publicField(this,"_prevCRS");this.baseLayer()}zoom(){return this._leafletMap.getZoom()}zoomPlus(){this._leafletMap.zoomIn()}zoomMinus(){this._leafletMap.zoomOut()}zoomToDefault(){this._leafletMap.flyTo({lat:this.defaultLat(),lng:this.defaultLong()},this.defaultZoom(),{animate:!1})}zoomToFit(){let bounds2;this.mapType()==="AlbersPR"?bounds2=this._albersLayer.getBounds():this.layers().filter(l=>l.hasBounds()).forEach(layer=>{bounds2?bounds2.extend(layer.getBounds()):bounds2=layer.getBounds()}),bounds2&&bounds2.isValid()?this._leafletMap.fitBounds(bounds2,{maxZoom:14}):this.zoomToDefault()}syncLayers(sLayers,domNode,element){const added=[...sLayers],updated=[],removed=[];this._leafletMap.eachLayer(layer=>{const idx=added.indexOf(layer.__hpcc_layer);idx>=0?(updated.push(layer.__hpcc_layer),added.splice(idx,1)):layer.__hpcc_layer&&removed.push(layer.__hpcc_layer)}),added.forEach(sl=>{sl.layerEnter(this._leafletMap),sl.layerUpdate(this._leafletMap)}),updated.forEach(sl=>{sl.layerUpdate(this._leafletMap)}),removed.forEach(sl=>{sl.layerExit(this._leafletMap)})}isLayer(){return this._owner!==void 0&&this._owner!==this}baseLayer(){switch(this.mapType()){case"AlbersPR":this.map(this._albersLayer);break;case"MapBox":this.map(this._mapBoxLayer);break;case"OpenStreet":this.map(this._openStreetLayer);break;case"Google":this.map(this._gmapLayer);break;case"None":default:this.map(this._blankLayer);break}return this.map()}enter(domNode,element){super.enter(domNode,element),element.style("position","relative"),this._leafletElement=element.append("div").style("position","absolute").style("width",`${this.width()}px`).style("height",`${this.height()}px`),this._iconBar.target(domNode)}update(domNode,element){super.update(domNode,element),this._leafletElement.style("width",`${this.width()}px`).style("height",`${this.height()}px`);const baseLayer=this.baseLayer();this._prevCRS!==baseLayer.crs()&&(this._prevCRS=baseLayer.crs(),this._leafletMap&&(this.syncLayers([],domNode,element),this._leafletMap.remove(),this._leafletElement.html("")),this._leafletMap=new leafletSrcExports.Map(this._leafletElement.node(),{trackResize:!1,zoomControl:!1,zoomSnap:this.mapType()==="AlbersPR"?.1:1,crs:baseLayer.crs(),maxZoom:baseLayer.getMaxZoom?baseLayer.getMaxZoom():18}),this._leafletMap.setView([this.defaultLat(),this.defaultLong()],this.defaultZoom()),this._leafletMap.attributionControl.setPrefix(baseLayer.attribution()),this._leafletMap.on("zoomend",e=>this.layers().forEach(layer=>layer.zoomEnd(e))),this._leafletMap.on("moveend",e=>this.layers().forEach(layer=>layer.moveEnd(e))),this._leafletMap.on("viewreset",e=>this.layers().forEach(layer=>layer.viewReset(e))),this._renderCount=0),this.syncLayers([baseLayer,...this.layers()],domNode,element),this._leafletMap.invalidateSize(),this.autoZoomToFit()&&this._leafletMap.whenReady(function(){this.zoomToFit()},this),this._iconBar.visible(this.showToolbar()).render(w=>{const bbox=w.getBBox();w.element().style("z-index",5e3).style("left",`${this.width()-bbox.width-4}px`)})}exit(domNode,element){this._iconBar.target(null),super.exit(domNode,element)}render(callback){const promises=[this.baseLayer().init(),...this.layers().map(l=>l.init())];return Promise.all(promises).then(()=>{super.render(callback)}),this}}Leaflet.prototype._class+=" map_Leaflet",Leaflet.prototype.publish("showToolbar",!0,"boolean","Show toolbar",void 0,{hidden:w=>w.isLayer()}),Leaflet.prototype.publish("mapType","Google","set","Base Layer Type",["None","AlbersPR","MapBox","OpenStreet","Google"],{hidden:w=>w.isLayer()}),Leaflet.prototype.publish("map",null,"widget","Base Layer",void 0,{internal:!0}),Leaflet.prototype.publish("layers",[],"propertyArray","Layers",void 0,{hidden:w=>w.isLayer()}),Leaflet.prototype.publish("defaultLat",42.877742,"number","Center Latitude",void 0,{hidden:w=>w.isLayer()}),Leaflet.prototype.publish("defaultLong",-97.380979,"number","Center Longitude",void 0,{hidden:w=>w.isLayer()}),Leaflet.prototype.publish("defaultZoom",4,"number","Zoom Level",void 0,{hidden:w=>w.isLayer()}),Leaflet.prototype.publish("autoZoomToFit",!0,"boolean","Auto zoom to fit Data",void 0,{hidden:w=>w.isLayer()});class FeatureLayer extends Leaflet{constructor(cluster=!1){super();__publicField(this,"_layer");__publicField(this,"_selection");__publicField(this,"_initPromise");this._layer=cluster?new MarkerClusterGroup:new leafletSrcExports.FeatureGroup,this._layer.__hpcc_layer=this,common.Utility.SimpleSelectionMixin.call(this),this.layers([this])}owner(_){this._owner=_}valid(){return!0}clear(){this._layer.clearLayers()}add(layer){this._layer.addLayer(layer)}maxZoom(){return this._owner._leafletMap.getMaxZoom()||24}zoom(){return this._owner._leafletMap.getZoom()}visibleBounds(){return this._owner._leafletMap.getBounds()}init(){return this._initPromise||(this._initPromise=Promise.resolve()),this._initPromise}hasBounds(){return!1}getBounds(){return this._layer.getBounds()}style(id,_){return _===void 0?common.select(this._layer.getPane()).style(id):(common.select(this._layer.getPane()).style(id,_),this)}propValue(colIdx,row,defaultValue){return(colIdx<0?defaultValue:row[colIdx])||defaultValue}layerEnter(map){map.addLayer(this._layer);const elem=common.select(map.getContainer()).select(".leaflet-pane.leaflet-marker-pane");this._selection.widgetElement(elem)}layerUpdate(map){}layerExit(map){this._layer.clearLayers(),map.removeLayer(this._layer)}zoomEnd(e){}moveEnd(e){}viewReset(e){}}FeatureLayer.prototype._class+=" map_FeatureLayer",FeatureLayer.prototype.mixin(common.Utility.SimpleSelectionMixin),FeatureLayer.prototype.publishReset(["layers"]);class ClusterLayer extends FeatureLayer{constructor(cluster=!0){super(cluster)}}ClusterLayer.prototype._class+=" map_ClusterLayer";class D3SurfaceLayer extends FeatureLayer{constructor(){super(...arguments);__publicField(this,"_lfd3",new D3SvgOverlay().drawCallback((selection,projection2)=>this.layerUpdate(void 0,projection2)))}hasBounds(){return!0}getBounds(){return this._lfd3.getBounds()}layerEnter(map){super.layerEnter(map),this.add(this._lfd3)}layerUpdate(map,projection2){super.layerUpdate(map)}clickHandler(e,row){}}class Circles extends ClusterLayer{hasBounds(){return!0}layerUpdate(map){super.layerUpdate(map);const columns=this.columns(),latIdx=columns.indexOf(this.latitudeColumn()),longIdx=columns.indexOf(this.longitudeColumn()),strokeColorIdx=columns.indexOf(this.strokeColorColumn()),fillColorIdx=columns.indexOf(this.fillColorColumn());this.clear(),this.data().filter(row=>!this.omitNullLatLong()||!!row[latIdx]&&!!row[longIdx]).forEach(row=>{this.add(new leafletSrcExports.Circle([row[latIdx],row[longIdx]],{color:this.propValue(strokeColorIdx,row,this.strokeColor()),fill:!0,fillColor:this.propValue(fillColorIdx,row,this.fillColor()),fillOpacity:this.fillOpacity(),radius:this.radius(),origRow:row}).on("click",e=>this.clickHandler(e,row)))})}clickHandler(e,row){}}Circles.prototype._class+=" map_Circles",Circles.prototype.publish("latitudeColumn",null,"set","Latitude column",function(){return this.columns()},{optional:!0}),Circles.prototype.publish("longitudeColumn",null,"set","Longitude column",function(){return this.columns()},{optional:!0}),Circles.prototype.publish("radius",50,"number","Radius (meters)"),Circles.prototype.publish("strokeColor","#376cea","html-color","Stroke Color",null,{optional:!0}),Circles.prototype.publish("strokeColorColumn",null,"set","Stroke color column",function(){return this.columns()},{optional:!0}),Circles.prototype.publish("fillColor","#376cea","html-color","Fill Color",null,{optional:!0}),Circles.prototype.publish("fillColorColumn",null,"set","Fill color column",function(){return this.columns()},{optional:!0}),Circles.prototype.publish("fillOpacity",.5,"number","Opacity",null,{tags:["Advanced"]}),Circles.prototype.publish("omitNullLatLong",!0,"boolean","Remove lat=0,lng=0 from pinsData",null,{tags:["Basic"]});class D3Circles extends D3SurfaceLayer{layerUpdate(map,projection2){super.layerUpdate(map,projection2);const element=this._lfd3._rootGroup;projection2=projection2||this._lfd3.projection;const columns=this.columns(),latIdx=columns.indexOf(this.latitudeColumn()),longIdx=columns.indexOf(this.longitudeColumn()),strokeColorIdx=columns.indexOf(this.strokeColorColumn()),fillColorIdx=columns.indexOf(this.fillColorColumn());function toLatLng(d){return{lat:+d[latIdx],lng:+d[longIdx]}}const updateSelection=element.selectAll("circle").data(this.data().filter(row=>!this.omitNullLatLong()||!!row[latIdx]&&!!row[longIdx]));updateSelection.enter().append("circle").merge(updateSelection).attr("cx",d=>projection2.latLngToLayerPoint(toLatLng(d)).x).attr("cy",d=>projection2.latLngToLayerPoint(toLatLng(d)).y).attr("r",Math.max(3/projection2.scale,this.radius()/projection2.metresPerPixel)).style("fill-opacity",this.fillOpacity()).style("stroke",row=>this.propValue(strokeColorIdx,row,this.strokeColor())).attr("stroke-width",Math.max(1/projection2.scale,1/projection2.metresPerPixel)).style("fill",row=>this.propValue(fillColorIdx,row,this.fillColor())),updateSelection.exit().remove()}clickHandler(e,row){}}D3Circles.prototype._class+=" map_D3Circles",D3Circles.prototype.publish("latitudeColumn",null,"set","Latitude column",function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish("longitudeColumn",null,"set","Longitude column",function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish("radius",50,"number","Radius (meters)"),D3Circles.prototype.publish("strokeColor","#376cea","html-color","Stroke Color",null,{optional:!0}),D3Circles.prototype.publish("strokeColorColumn",null,"set","Stroke color column",function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish("fillColor","#376cea","html-color","Fill Color",null,{optional:!0}),D3Circles.prototype.publish("fillColorColumn",null,"set","Fill color column",function(){return this.columns()},{optional:!0}),D3Circles.prototype.publish("fillOpacity",.5,"number","Opacity",null,{tags:["Advanced"]}),D3Circles.prototype.publish("omitNullLatLong",!0,"boolean","Remove lat=0,lng=0 from pinsData",null,{tags:["Basic"]});class ClusterCircles extends FeatureLayer{constructor(){super(...arguments);__publicField(this,"_palette")}createIcon(childCount,backColor,format){const borderColor=common.hsl(backColor);return borderColor.opacity=.5,new leafletSrcExports.DivIcon({className:"cluster-circle",iconSize:new leafletSrcExports.Point(40,40),html:`<div style='opacity:${this.opacity()};background-color:${borderColor.toString()}'><div style='background-color:${backColor}'><span style='color:${common.Palette.textColor(backColor)}'>${format(childCount)}</span></div></div>`})}layerUpdate(map){super.layerUpdate(map),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const latFunc=this.cellFunc(this.latitudeColumn(),0),longFunc=this.cellFunc(this.longitudeColumn(),0),latLongFunc=row=>[+latFunc(row),+longFunc(row)],weightFunc=this.cellFunc(this.weightColumn(),0),data=this.data(),extent2=common.extent(data,weightFunc),format=this.weightFormat()?common.format(this.weightFormat()):_=>_;this.clear(),data.forEach(row=>{const circle2=new leafletSrcExports.Marker(latLongFunc(row),{icon:this.createIcon(weightFunc(row),this._palette(weightFunc(row),extent2[0],extent2[1]),format),origRow:row}).on("click",e=>this.clickHandler(e,row));circle2.bindTooltip("Weight: "+weightFunc(row)),this.add(circle2)})}clickHandler(e,row){}}ClusterCircles.prototype._class+=" map_ClusterCircles",ClusterCircles.prototype._palette=common.Palette.rainbow("default"),ClusterCircles.prototype.publish("paletteID","YlOrRd","set","Color palette for this widget",ClusterCircles.prototype._palette.switch()),ClusterCircles.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette"),ClusterCircles.prototype.publish("latitudeColumn",null,"set","Latitude column",function(){return this.columns()},{optional:!0}),ClusterCircles.prototype.publish("longitudeColumn",null,"set","Longitude column",function(){return this.columns()},{optional:!0}),ClusterCircles.prototype.publish("weightColumn",null,"set","Weight column",function(){return this.columns()},{optional:!0}),ClusterCircles.prototype.publish("weightFormat",",","string","Number format for weight"),ClusterCircles.prototype.publish("opacity",.66,"number","Opacity",null,{tags:["Advanced"]});function fixDateLine(feature2,layer){const latlongs=layer.getLatLngs();latlongs.forEach(function(shape){shape.forEach(function(cord){if(Array.isArray(cord)){let lhs=0,rhs=0,vlhs=0,vrhs=0;cord.forEach(function(pnt){pnt.lat>-62&&(pnt.lng>165?++vrhs:pnt.lng<-165&&++vlhs,pnt.lng>0?++rhs:pnt.lng<0&&++lhs)}),vlhs>0&&vrhs>0&&cord.forEach(function(pnt){pnt.lng>165&&lhs>rhs?pnt.lng-=360:pnt.lng<-165&&rhs>lhs&&(pnt.lng+=360)})}})}),layer.setLatLngs(latlongs)}class TopoJSON extends leafletSrcExports.GeoJSON{constructor(data,options){super(data,{...options,onEachFeature:(feature2,layer)=>{options.onEachFeature&&options.onEachFeature(feature2,layer),fixDateLine(feature2,layer)}})}addData(data){let geojson,key;if(data.type==="Topology"){for(key in data.objects)data.objects.hasOwnProperty(key)&&(geojson=feature(data,data.objects[key]),super.addData.call(this,geojson));return this}return super.addData.call(this,data),this}}class World extends FeatureLayer{constructor(){super();__publicField(this,"_features");__publicField(this,"_palette");__publicField(this,"_dataMap",{});__publicField(this,"_dataMinWeight",null);__publicField(this,"_dataMaxWeight",null);__publicField(this,"_topoJson");__publicField(this,"_svgElement");__publicField(this,"_prevFeatures");common.Utility.SimpleSelectionMixin.call(this)}hasBounds(){return!0}getBounds(){const retVal=super.getBounds();return retVal.isValid()?new leafletSrcExports.LatLngBounds([retVal.getNorth(),retVal.getWest()],[retVal.getSouth(),retVal.getEast()]):new leafletSrcExports.LatLngBounds([90,-180],[-90,180])}updateDataMap(_){this._dataMap={},this._dataMinWeight=null,this._dataMaxWeight=null;const context=this;_.forEach(function(item){context._dataMap[item[0]]=item,(!context._dataMinWeight||item[1]<context._dataMinWeight)&&(context._dataMinWeight=item[1]),(!context._dataMaxWeight||item[1]>context._dataMaxWeight)&&(context._dataMaxWeight=item[1])})}data(_){const retVal=super.data.apply(this,arguments);return arguments.length&&this.updateDataMap(_),retVal}styleFeature(feature2){const d=this._dataMap[feature2.properties.hpccID],fillColor=d?this._palette(d[1],this._dataMinWeight,this._dataMaxWeight):"transparent";return{color:this.meshVisible()?this.meshColor():void 0,opacity:1,weight:this.meshStrokeWidth(),fillColor,fillOpacity:this.opacity()}}svgGlowID(){return this.id()+"_svgGlow"}layerEnter(map){if(super.layerEnter(map),!this._svgElement){this._svgElement=common.select(map.getContainer()).select(".leaflet-pane.leaflet-overlay-pane > svg");const svgDefs=this._svgElement.append("defs");new common.SVGGlowFilter(svgDefs,this.svgGlowID()),this._selection.widgetElement(this._svgElement)}}layerUpdate(map){this._prevFeatures!==this._features&&(this.clear(),this._topoJson=new TopoJSON(this._features,{onEachFeature:(f,l)=>{l.on("click",e=>this.clickHandler(e,l,l.feature.properties.hpccID))}}).bindTooltip(l=>this.tooltipHandler(l,l.feature.properties.hpccID),{direction:"top",sticky:!0}),this.add(this._topoJson)),super.layerUpdate(map),this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id())),this._topoJson.setStyle(feature2=>this.styleFeature(feature2))}clickHandler(e,l,featureID){const sel=this._selection.click(e.originalEvent.target);return this.click(this.rowToObj(this._dataMap[featureID]),this.columns()[0],sel),sel}tooltipText(row,tooltip){return tooltip}tooltipHandler(l,featureID){const row=this._dataMap[featureID],value=row&&row[1]||"";return this.tooltipText(this.rowToObj(row),`<b>${featureID}</b>: ${value}`)}click(row,col,sel){}}World.prototype._class+=" map_World",World.prototype._palette=common.Palette.rainbow("default"),World.prototype.mixin(common.Utility.SimpleSelectionMixin),World.prototype.publish("paletteID","YlOrRd","set","Color palette for this widget",World.prototype._palette.switch(),{tags:["Basic","Shared"]}),World.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),World.prototype.publish("opacity",.5,"number","Opacity",null,{tags:["Advanced"]}),World.prototype.publish("meshVisible",!0,"boolean","Mesh Visibility"),World.prototype.publish("meshColor","black","html-color","Stroke Color"),World.prototype.publish("meshStrokeWidth",.25,"number","Stroke Width"),World.prototype.publish("internalOnly",!1,"boolean","Internal mesh only");let countries=null;class Countries extends World{constructor(){super()}init(){return this._initPromise||(this._initPromise=new Promise((resolve2,reject)=>{countries&&resolve2(countries),d3Json(`${topoJsonFolder()}/countries.json`,function(_countries){countries=_countries,resolve2(countries)})}).then(countries2=>{var _a;this._features=feature(countries2.topology,countries2.topology.objects.countries).features;for(const key in this._features)if(this._features[key].id){const code=this._features[key].id,name=(_a=countries2.countryNames[code])==null?void 0:_a.name;this._features[key].properties.hpccID=name}})),this._initPromise}tooltipHandler(l,featureID){const row=this._dataMap[featureID],value=row&&row[1]||"";return this.tooltipText(this.rowToObj(row),`<b>${featureID}</b>: ${value}`)}}function del(arr,item){const idx=arr.indexOf(item);idx>=0&&arr.splice(idx,1)}class DrawLayer extends FeatureLayer{constructor(){super(...arguments);__publicField(this,"_polylines",[]);__publicField(this,"_polygons",[]);__publicField(this,"_rectangles",[]);__publicField(this,"_circles",[]);__publicField(this,"_drawControl");__publicField(this,"_drawOptionsHash")}hasBounds(){return!0}drawOptions(){const retVal={marker:!1,circlemarker:!1};return this.enableCircle()||(retVal.circle=!1),this.enablePolyline()||(retVal.polyline=!1),this.enableRectangle()||(retVal.rectangle=!1),this.enablePolygon()||(retVal.polygon=!1),retVal}save(){return{polylines:this._polylines.map(p=>p.getLatLngs()),polygons:this._polygons.map(p=>p.getLatLngs()),rectangles:this._rectangles.map(r=>r.getBounds()),circles:this._circles.map(c=>({center:c.getLatLng(),radius:c.getRadius()}))}}restore(_){this.clear(),this._polylines=(_.polylines||[]).map(p=>new leafletSrcExports.Polyline(p)),this._polygons=(_.polygons||[]).map(p=>new leafletSrcExports.Polygon(p)),this._rectangles=(_.rectangles||[]).map(r=>new leafletSrcExports.Rectangle(r)),this._circles=(_.circles||[]).map(c=>new leafletSrcExports.Circle(c.center,{radius:c.radius})),this._polylines.forEach(_2=>this.add(_2)),this._polygons.forEach(_2=>this.add(_2)),this._rectangles.forEach(_2=>this.add(_2)),this._circles.forEach(_2=>this.add(_2))}layerEnter(map){super.layerEnter(map),map.on(leafletSrcExports.Draw.Event.CREATED,e=>{const type2=e.layerType,layer=e.layer;switch(type2){case"polyline":this._polylines.push(layer);break;case"polygon":this._polygons.push(layer);break;case"rectangle":this._rectangles.push(layer);break;case"circle":this._circles.push(layer);break;default:alert(type2)}this.add(layer),this.changed("ADD",layer)}),map.on(leafletSrcExports.Draw.Event.EDITED,e=>{e.layers.eachLayer(layer=>{this.changed("UPDATE",layer)})}),map.on(leafletSrcExports.Draw.Event.DELETED,e=>{e.layers.eachLayer(layer=>{del(this._polylines,layer),del(this._polygons,layer),del(this._rectangles,layer),del(this._circles,layer),this.changed("DELETE",layer)})})}layerUpdate(map){super.layerUpdate(map),this.style("opacity",this.opacity());const drawOptions=this.drawOptions(),drawOptionsHash=util.hashSum(drawOptions);this._drawOptionsHash!==drawOptionsHash&&(this._drawOptionsHash=drawOptionsHash,this._drawControl&&map.removeControl(this._drawControl),this._drawControl=new leafletSrcExports.Control.Draw({position:"topleft",draw:drawOptions,edit:{featureGroup:this._layer}}),map.addControl(this._drawControl))}layerExit(map){super.layerExit(map)}changed(type2,items){}}DrawLayer.prototype._class+=" map_DrawLayer",DrawLayer.prototype.publish("opacity",1,"number","Layer Opacity"),DrawLayer.prototype.publish("enablePolyline",!0,"boolean","Enable Polyline Creation"),DrawLayer.prototype.publish("enablePolygon",!0,"boolean","Enable Polygon Creation"),DrawLayer.prototype.publish("enableRectangle",!0,"boolean","Enable Rectangle Creation"),DrawLayer.prototype.publish("enableCircle",!0,"boolean","Enable Circle Creation");class HeatLayer extends FeatureLayer{hasBounds(){return!0}layerUpdate(map){super.layerUpdate(map),this.style("opacity",this.opacity());const columns=this.columns(),latIdx=this.latitudeColumn_exists()?columns.indexOf(this.latitudeColumn()):0,longIdx=this.longitudeColumn_exists()?columns.indexOf(this.longitudeColumn()):1,weightIdx=columns.indexOf(this.weightColumn());this.clear();let bounds2;const data=this.data().filter(row=>!this.omitNullLatLong()||!!row[latIdx]&&!!row[longIdx]).map(row=>(bounds2?bounds2.extend([row[latIdx],row[longIdx]]):bounds2=new leafletSrcExports.LatLngBounds([row[latIdx],row[longIdx]]),[row[latIdx],row[longIdx],this.weightColumn_exists()?row[weightIdx]:.5])),heat=new HeatLayer$1(data,{minOpacity:this.minOpacity(),max:this.max(),radius:this.radius(),blur:this.blur(),gradient:this.gradient()});heat.getBounds=()=>bounds2,this.add(heat)}}HeatLayer.prototype._class+=" map_Heat",HeatLayer.prototype.publish("latitudeColumn",null,"set","Latitude column",function(){return this.columns()},{optional:!0}),HeatLayer.prototype.publish("longitudeColumn",null,"set","Longitude column",function(){return this.columns()},{optional:!0}),HeatLayer.prototype.publish("weightColumn",null,"set","Optional normalized intensity (0 -> 1) ",function(){return this.columns()},{optional:!0}),HeatLayer.prototype.publish("omitNullLatLong",!0,"boolean","Remove lat=0,lng=0 from IconsData",null,{tags:["Basic"]}),HeatLayer.prototype.publish("opacity",.5,"number","Layer Opacity"),HeatLayer.prototype.publish("minOpacity",.5,"number","The minimum opacity the heat will start at",null,{tags:["Basic"]}),HeatLayer.prototype.publish("max",1,"number","maximum point intensity, 1.0 by default",null,{tags:["Basic"]}),HeatLayer.prototype.publish("radius",25,"number","radius of each point of the heatmap, 25 by default",null,{tags:["Basic"]}),HeatLayer.prototype.publish("blur",15,"number","amount of blur, 15 by default",null,{tags:["Basic"]}),HeatLayer.prototype.publish("gradient",null,"object","color gradient config",null,{tags:["Basic"],optional:!0});class Markers extends ClusterLayer{constructor(cluster=!1){super(cluster);__publicField(this,"_hashSum");__publicField(this,"_currSelRow")}hasBounds(){return!0}tooltipText(row,tooltip){return""+tooltip}popupText(row,popup){return""+popup}layerUpdate(map,markerOptions){if(super.layerUpdate(map),!markerOptions)return;const columns=this.columns(),latIdx=columns.indexOf(this.latitudeColumn()),longIdx=columns.indexOf(this.longitudeColumn()),tooltipIdx=columns.indexOf(this.tooltipColumn()),popupIdx=columns.indexOf(this.popupColumn()),dbChecksum=this._db.checksum(),hashSum=this.hashSum([],{dbChecksum});this._hashSum!==hashSum&&(this._hashSum=hashSum,this.clear(),this.data().filter(row=>!this.omitNullLatLong()||!!row[latIdx]&&!!row[longIdx]).forEach(row=>{const marker=new leafletSrcExports.Marker([row[latIdx],row[longIdx]],markerOptions(row)).on("click",e=>this.clickHandler(e,marker,row)),tooltipText=this.tooltipText(this.rowToObj(row),this.propValue(tooltipIdx,row,""));tooltipText&&marker.bindTooltip(tooltipText,{direction:this.tooltipDirection(),offset:leafletSrcExports.point(this.tooltipOffsetX(),this.tooltipOffsetY())});const popupText=this.popupText(this.rowToObj(row),this.propValue(popupIdx,row,""));popupText&&marker.bindPopup(popupText,{offset:leafletSrcExports.point(this.popupOffsetX(),this.popupOffsetY())}),this.add(marker)}))}clickHandler(e,marker,row){const sel=this._selection.click(marker._icon);this._currSelRow=sel?row:void 0,this.click(this.rowToObj(row),"",sel)}click(row,col,sel){}}Markers.prototype._class+=" map_Markers",Markers.prototype.publish("latitudeColumn",null,"set","Latitude column",function(){return this.columns()},{optional:!0}),Markers.prototype.publish("longitudeColumn",null,"set","Longitude column",function(){return this.columns()},{optional:!0}),Markers.prototype.publish("omitNullLatLong",!0,"boolean","Remove lat=0,lng=0 from IconsData",null,{tags:["Basic"]}),Markers.prototype.publish("tooltipColumn",null,"set","Tooltip column",function(){return this.columns()},{optional:!0}),Markers.prototype.publish("tooltipDirection","auto","set","Tooltip direction",["auto","left","top","right","bottom","center"]),Markers.prototype.publish("tooltipOffsetX",0,"number","Tooltip offset X"),Markers.prototype.publish("tooltipOffsetY",0,"number","Tooltip offset Y"),Markers.prototype.publish("popupColumn",null,"set","Popup column",function(){return this.columns()},{optional:!0}),Markers.prototype.publish("popupOffsetX",0,"number","Tooltip offset X"),Markers.prototype.publish("popupOffsetY",0,"number","Tooltip offset Y");class Icons extends Markers{constructor(cluster=!1){super(cluster)}layerUpdate(map){const iconUrlIdx=this.columns().indexOf(this.iconUrlColumn());super.layerUpdate(map,row=>({icon:new leafletSrcExports.Icon({iconUrl:this.propValue(iconUrlIdx,row,this.iconUrl()),iconSize:[this.iconWidth(),this.iconHeight()],iconAnchor:[this.iconAnchorX(),this.iconAnchorY()],props:{owner:this,row}}),draggable:!1}))}}Icons.prototype._class+=" map_Icons",Icons.prototype.publish("iconUrl","","string","Icon URL",null),Icons.prototype.publish("iconUrlColumn",null,"set","Icon URL column",function(){return this.columns()},{optional:!0}),Icons.prototype.publish("iconWidth",32,"number","Icon width"),Icons.prototype.publish("iconHeight",32,"number","Icon height"),Icons.prototype.publish("iconAnchorX",16,"number","Icon Anchor X"),Icons.prototype.publish("iconAnchorY",32,"number","Icon Anchor Y");class ClusterIcons extends Icons{constructor(){super(!0)}}ClusterIcons.prototype._class+=" map_ClusterIcons";function lngLat2LatLng(d){return[d[1],d[0]]}const calcSpread=(prev,p)=>(p[0]<-90?prev[0]++:p[0]>90&&prev[1]++,prev),shiftLeft=lng=>lng>90?lng-360:lng,shiftRight=lng=>lng<-90?lng+360:lng,shiftPoint=left=>{const shiftFunc=left?shiftLeft:shiftRight;return p=>[shiftFunc(p[0]),p[1]]};class Polygons extends FeatureLayer{constructor(){super(...arguments);__publicField(this,"_palette")}fixDateLine(points){const[lhsCount,rhsCount]=points.reduce(calcSpread,[0,0]);return lhsCount&&rhsCount?points.map(shiftPoint(lhsCount>rhsCount)):points}hasBounds(){return!0}updateHexagons(){this._palette=this._palette.switch(this.paletteID()),this.useClonedPalette()&&(this._palette=this._palette.cloneNotExists(this.paletteID()+"_"+this.id()));const polyFunc=this.cellFunc(this.polygonColumn(),[]),weightFunc=this.cellFunc(this.weightColumn(),0),data=this.data(),extent2=common.extent(data,weightFunc);this.clear(),data.forEach(row=>{this.add(new leafletSrcExports.Polygon(this.fixDateLine(polyFunc(row)).map(lngLat2LatLng),{color:this._palette(extent2[1],extent2[0],extent2[1]),fillColor:this._palette(weightFunc(row),extent2[0],extent2[1]),fillOpacity:this.opacity(),weight:1,origRow:row}).on("click",e=>this.clickHandler(e,row)))})}layerUpdate(map){super.layerUpdate(map),this.updateHexagons()}zoomEnd(e){super.zoomEnd(e)}moveEnd(e){super.moveEnd(e),this.updateHexagons()}clickHandler(e,row){}}Polygons.prototype._class+=" map_Polygons",Polygons.prototype._palette=common.Palette.rainbow("default"),Polygons.prototype.publish("paletteID","YlOrRd","set","Color palette for this widget",Polygons.prototype._palette.switch(),{tags:["Basic","Shared"]}),Polygons.prototype.publish("useClonedPalette",!1,"boolean","Enable or disable using a cloned palette",null,{tags:["Intermediate","Shared"]}),Polygons.prototype.publish("polygonColumn",null,"set","Polygon column",function(){return this.columns()},{optional:!0}),Polygons.prototype.publish("weightColumn",null,"set","Weight column",function(){return this.columns()},{optional:!0}),Polygons.prototype.publish("opacity",.5,"number","Opacity",null,{tags:["Advanced"]});const projectionFactor=4096/2/Math.PI;class Path extends D3SurfaceLayer{lineData(){const columns=this.columns(),latIdx=columns.indexOf(this.latitudeColumn()),longIdx=columns.indexOf(this.longitudeColumn()),retVal=[];let prevLatLng;return this.data().forEach(row=>{const currLatLng=[row[longIdx],row[latIdx]];prevLatLng&&retVal.push({type:"LineString",coordinates:[currLatLng,prevLatLng]}),prevLatLng=currLatLng}),retVal}isNull(coord){return!coord[0]&&!coord[1]}isNull2(coords){return this.omitNullLatLong()?this.isNull(coords[0])||this.isNull(coords[1]):!1}layerUpdate(map,projection2){super.layerUpdate(map,projection2);const element=this._lfd3._rootGroup;projection2=projection2||this._lfd3.projection,this._lfd3.svg().selectAll("defs").data([void 0]).enter().append("defs").append("marker").attr("class","marker").attr("id",this._id+"_arrowHead").attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerWidth",12).attr("markerHeight",12).attr("markerUnits","strokeWidth").attr("orient","auto").append("polyline").attr("points","0,0 10,5 0,10 1,5"),this._lfd3.svg().select("defs > marker").style("fill",this.strokeColor()).style("stroke",null);const center=projection2.latLngToLayerPoint({lat:0,lng:0}),geoTransform=resolve("Mercator").scale(projectionFactor).translate([center.x,center.y]),geoPath=d3GeoPath().projection(geoTransform),updateSelection=element.selectAll(".dataEdge").data(this.lineData().filter(row=>!this.isNull2(row.coordinates)));updateSelection.enter().append("path").attr("class","dataEdge").attr("marker-end","url(#"+this._id+"_arrowHead)").merge(updateSelection).attr("d",geoPath).style("stroke",this.strokeColor()).style("fill","none").attr("stroke-width",1/projection2.scale),updateSelection.exit().remove()}clickHandler(e,row){}}Path.prototype._class+=" map_Path",Path.prototype.publish("latitudeColumn",null,"set","Latitude column",function(){return this.columns()},{optional:!0}),Path.prototype.publish("longitudeColumn",null,"set","Longitude column",function(){return this.columns()},{optional:!0}),Path.prototype.publish("strokeColor"," #666666","html-color","Stroke Color",null,{optional:!0}),Path.prototype.publish("omitNullLatLong",!0,"boolean","Remove lat=0,lng=0 from pinsData",null,{tags:["Basic"]});class Lines extends Path{lineData(){const columns=this.columns(),latIdx=columns.indexOf(this.latitudeColumn()),longIdx=columns.indexOf(this.longitudeColumn()),lat2Idx=columns.indexOf(this.latitude2Column()),long2Idx=columns.indexOf(this.longitude2Column()),retVal=[];return this.data().forEach(row=>{const currLatLng=[row[longIdx],row[latIdx]],currLatLng2=[row[long2Idx],row[lat2Idx]];retVal.push({type:"LineString",coordinates:[currLatLng,currLatLng2]})}),retVal}}Lines.prototype._class+=" map_Lines",Lines.prototype.publish("latitude2Column",null,"set","Latitude column",function(){return this.columns()},{optional:!0}),Lines.prototype.publish("longitude2Column",null,"set","Longitude column",function(){return this.columns()},{optional:!0});class Pins extends Markers{constructor(cluster=!1){super(cluster)}layerUpdate(map){const columns=this.columns(),faCharIdx=columns.indexOf(this.faCharColumn()),faCharColorIdx=columns.indexOf(this.faCharColorColumn()),strokeColorIdx=columns.indexOf(this.strokeColorColumn()),fillColorIdx=columns.indexOf(this.fillColorColumn());super.layerUpdate(map,row=>({icon:BeautifyIcon({iconShape:"marker",icon:this.propValue(faCharIdx,row,this.faChar()),textColor:this.propValue(faCharColorIdx,row,this.faCharColor()),borderColor:this.propValue(strokeColorIdx,row,this.strokeColor()),backgroundColor:this.propValue(fillColorIdx,row,this.fillColor()),props:{owner:this,row}}),draggable:!1}))}}Pins.prototype._class+=" map_Pins",Pins.prototype.publish("faChar","fa-circle","string","Default font awesome character"),Pins.prototype.publish("faCharColumn",null,"set","Font awesome column",function(){return this.columns()},{optional:!0}),Pins.prototype.publish("faCharColor","#ffffff","html-color","Default font awesome Color"),Pins.prototype.publish("faCharColorColumn",null,"set","Font awesome color column",function(){return this.columns()},{optional:!0}),Pins.prototype.publish("strokeColor","transparent","html-color","Default stroke Color",null,{optional:!0}),Pins.prototype.publish("strokeColorColumn",null,"set","Stroke color column",function(){return this.columns()},{optional:!0}),Pins.prototype.publish("fillColor","#376cea","html-color","Default fill Color",null,{optional:!0}),Pins.prototype.publish("fillColorColumn",null,"set","Fill color column",function(){return this.columns()},{optional:!0});class ClusterPins extends Pins{constructor(){super(!0)}}ClusterPins.prototype._class+=" map_ClusterPins";const topo_indexes={GB:["administrative_area_level_3","administrative_area_level_2","administrative_area_level_1"],IE:["administrative_area_level_2","administrative_area_level_1"],ND:["administrative_area_level_2","administrative_area_level_1"]},_cachedRegion={};function cachedRegion(id){return _cachedRegion[id]||(_cachedRegion[id]={topology:void 0,nameIdx:{},codeIdx:{}}),_cachedRegion[id]}class Region extends World{constructor(){super();__publicField(this,"_prevRegion")}fetchTopo(regionID){return cachedRegion(regionID).topology?Promise.resolve(cachedRegion(regionID).topology):new Promise((resolve2,reject)=>{d3Json(`${topoJsonFolder()}/${regionID}.json`,function(region){cachedRegion(regionID).topology=region,resolve2(region)})})}fetchTopoIdx(regionID){for(const _key in cachedRegion(regionID).nameIdx)return Promise.resolve(cachedRegion(regionID).nameIdx);return new Promise((resolve2,reject)=>{d3Json(`${topoJsonFolder()}/${regionID}_idx.json`,function(index2){var _a;const{nameIdx,codeIdx}=cachedRegion(regionID);(_a=topo_indexes[regionID])==null||_a.forEach(level=>{for(const name in index2[level]){const codes=index2[level][name];Array.isArray(codes)&&(nameIdx[name]||(nameIdx[name]={code:void 0,codes:[]}),nameIdx[name].codes=nameIdx[name].codes.concat(codes),codes.length===1&&(nameIdx[name].code=nameIdx[name].codes[0]),codes.forEach(code=>{codeIdx[code]||(codeIdx[code]={name:void 0,score:9999,names:[]}),codes.length<=codeIdx[code].score&&(codeIdx[code].name=name,codeIdx[code].score=codes.length),codeIdx[code].names.push(name)}))}}),resolve2(nameIdx)})})}updateDataMap(_){const expandedRetVal=[],nameIdx=cachedRegion(this.region()).nameIdx;return _.forEach(row=>{var _a;const codes=(_a=nameIdx[row[0]])==null?void 0:_a.codes;codes?codes==null||codes.forEach(code=>{expandedRetVal.push([code,row[1],row])}):expandedRetVal.push([row[0],row[1],row])}),super.updateDataMap(expandedRetVal)}init(){const regionID=this.region();return(!this._initPromise||this._prevRegion!==regionID)&&(this._prevRegion=regionID,this._initPromise=Promise.all([this.fetchTopo(regionID),this.fetchTopoIdx(regionID)]).then(([region,index2])=>{this._features=feature(region,region.objects.PolbndA).features;for(const key in this._features){const code=this._features[key].id||key;this._features[key].properties.hpccID=code}this.updateDataMap(this.data())})),this._initPromise}tooltipHandler(l,featureID){var _a;const row=this._dataMap[featureID],codeIdx=cachedRegion(this.region()).codeIdx,value=row&&row[1]||"",featureName=(_a=codeIdx[featureID])==null?void 0:_a.names.map(name=>{var _a2;return((_a2=codeIdx[featureID])==null?void 0:_a2.name)===name?`<u>${name}</u>`:name}).join(", ");return this.tooltipText(this.rowToObj(row),`<b>${row&&row[2][0]||featureName||featureID}</b>: ${value}`)}}Region.prototype._class+=" map_Region",Region.prototype.publish("region","GB","set","Region Data",["AT","BE","BG","BR","CHLI","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GE","GR","HR","HU","IE","IS","IT","KS","LT","LU","LV","MD","MK","MT","ND","NL","NO","PL","PT","RO","RS","SE","SI","SK","UA"]);class Text extends Markers{constructor(cluster=!1){super(cluster)}layerUpdate(map){const columns=this.columns(),textIdx=columns.indexOf(this.textColumn()),textColorIdx=columns.indexOf(this.textColorColumn()),strokeColorIdx=columns.indexOf(this.strokeColorColumn()),fillColorIdx=columns.indexOf(this.fillColorColumn());super.layerUpdate(map,row=>{let text=this.propValue(textIdx,row,this.text());const textSize=this.textSize(text,this.fontFamily(),this.fontSize());return this.textFormat_exists()&&(text=common.format(this.textFormat())(text)),{icon:BeautifyIcon({iconShape:"rectangle",iconAnchor:[textSize.width/2+this.textOffsetX(),textSize.height/2+this.textOffsetY()],html:`<span style="
6
+ ${this.fontFamily_exists()?`font-family:${this.fontFamily()};`:""}
7
+ font-size:${this.fontSize()}px;
8
+ pointer-events: none;
9
+ white-space:nowrap;
10
+ ">${text}</span>`,textColor:this.propValue(textColorIdx,row,this.textColor()),borderColor:this.propValue(strokeColorIdx,row,this.strokeColor()),backgroundColor:this.propValue(fillColorIdx,row,this.fillColor()),props:{owner:this,row}}),draggable:!1}})}}Text.prototype._class+=" map_Text",Text.prototype.publish("textOffsetX",0,"number","Horizontal offset of text"),Text.prototype.publish("textOffsetY",0,"number","Vertical offset of text"),Text.prototype.publish("text","","string","Default text"),Text.prototype.publish("textColumn",null,"set","Font awesome column",function(){return this.columns()},{optional:!0}),Text.prototype.publish("textColor","#ffffff","html-color","Default font awesome Color"),Text.prototype.publish("textColorColumn",null,"set","Text color column",function(){return this.columns()},{optional:!0}),Text.prototype.publish("textFontFamily",null,"set","Text color column",function(){return this.columns()},{optional:!0}),Text.prototype.publish("strokeColor","transparent","html-color","Default stroke Color",null,{optional:!0}),Text.prototype.publish("strokeColorColumn",null,"set","Stroke color column",function(){return this.columns()},{optional:!0}),Text.prototype.publish("fillColor","#376cea","html-color","Default fill Color",null,{optional:!0}),Text.prototype.publish("fillColorColumn",null,"set","Fill color column",function(){return this.columns()},{optional:!0}),Text.prototype.publish("fontFamily",null,"string","Font family",null,{optional:!0}),Text.prototype.publish("fontSize",16,"number","Font family",null,{optional:!0}),Text.prototype.publish("textFormat",null,"string","Format rules for text",null,{optional:!0});class US extends World{constructor(){super()}getBounds(){const retVal=super.getBounds();return new leafletSrcExports.LatLngBounds([retVal.getNorth(),retVal.getWest()],[17.755278,-64.565])}}let usCounties=null;const usCountyNames={};class USCounties extends US{init(){return this._initPromise||(this._initPromise=new Promise((resolve2,reject)=>{usCounties&&resolve2(usCounties),d3Json(`${topoJsonFolder()}/us-counties.json`,function(_usCounties){usCounties=_usCounties,resolve2(usCounties)})}).then(usCounties2=>{this._features=feature(usCounties2.topology,usCounties2.topology.objects.counties).features;for(const key in this._features)if(this._features[key].id){const code=this._features[key].id,name=usCounties2.countyNames[code];this._features[key].properties.hpccID=code,usCountyNames[code]=name}})),this._initPromise}tooltipHandler(l,featureID){const row=this._dataMap[featureID],value=row&&row[1]||"";return this.tooltipText(this.rowToObj(row),`<b>${usCountyNames[featureID]}</b>: ${value}`)}}USCounties.prototype._class+=" map_USCounties";let usStates=null;const usStateNames={};class USStates extends US{init(){return this._initPromise||(this._initPromise=new Promise((resolve2,reject)=>{usStates&&resolve2(usStates),d3Json(`${topoJsonFolder()}/us-states.json`,function(_usStates){usStates=_usStates,resolve2(usStates)})}).then(usStates2=>{this._features=feature(usStates2.topology,usStates2.topology.objects.states).features;for(const key in this._features)if(this._features[key].id){const{code,name}=usStates2.stateNames[this._features[key].id];this._features[key].properties.hpccID=code,usStateNames[code]=name}})),this._initPromise}tooltipHandler(l,featureID){const row=this._dataMap[featureID],value=row&&row[1]||"";return this.tooltipText(this.rowToObj(row),`<b>${usStateNames[featureID]}</b>: ${value}`)}}USStates.prototype._class+=" map_USStates";const index=Object.freeze(Object.defineProperty({__proto__:null,Circles,ClusterCircles,ClusterIcons,ClusterLayer,ClusterPins,Countries,D3Circles,D3SurfaceLayer,DrawLayer,FeatureLayer,HeatLayer,Icons,Leaflet,Lines,Markers,Path,Pins,Polygons,Region,Text,TileLayer,USCounties,USStates,World},Symbol.toStringTag,{value:"Module"}));exports2.BUILD_VERSION=BUILD_VERSION,exports2.CanvasPinLayer=CanvasPinLayer,exports2.CanvasPins=CanvasPins,exports2.Choropleth=Choropleth,exports2.ChoroplethContinents=ChoroplethContinents,exports2.ChoroplethCounties=ChoroplethCounties,exports2.ChoroplethCountries=ChoroplethCountries,exports2.ChoroplethStates=ChoroplethStates,exports2.ChoroplethStatesHeat=ChoroplethStatesHeat,exports2.GMap=GMap,exports2.GMapCounties=GMapCounties,exports2.GMapGraph=GMapGraph,exports2.GMapHeat=GMapHeat,exports2.GMapLayered=GMapLayered,exports2.GMapPin=GMapPin,exports2.GMapPinLine=GMapPinLine,exports2.GeoHash=GeoHash,exports2.Graph=Graph,exports2.Graticule=Graticule,exports2.Heat=Heat,exports2.IChoropleth=IChoropleth,exports2.Layer=Layer,exports2.Layered=Layered,exports2.Leaflet=index,exports2.Lines=Lines$1,exports2.OpenStreet=OpenStreet,exports2.PKG_NAME=PKG_NAME,exports2.PKG_VERSION=PKG_VERSION,exports2.Pins=Pins$1,exports2.TopoJSONChoropleth=TopoJSONChoropleth,exports2.projections=projections,exports2.requireGoogleMap=requireGoogleMap,exports2.requireGoogleMapTimeout=requireGoogleMapTimeout,exports2.resolve=resolve,exports2.topoJsonFolder=topoJsonFolder,exports2.types=types,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
11
+ //# sourceMappingURL=index.umd.cjs.map