@nextgis/ngw-leaflet 1.18.21 → 1.19.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.
@@ -1,8 +1,8 @@
1
- function t(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}t('.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{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{box-sizing:border-box;height:0;width:0;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{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1000}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.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-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1);will-change:transform}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.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:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{background:hsla(0,0%,100%,.5);border:2px dotted #38f}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{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:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width: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{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.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);height:36px;width: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{height:44px;width: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{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;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:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fff;background:hsla(0,0%,100%,.5);border:2px solid #777;border-top:none;box-sizing:border-box;font-size:11px;line-height:1.1;overflow:hidden;padding:2px 5px 1px;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:2px solid rgba(0,0,0,.2)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{line-height:1.4;margin:13px 19px}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#c3c3c3;font:16px/14px Tahoma,Verdana,sans-serif;font-weight:700;height:14px;padding:4px 4px 0 0;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:18px}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{border-bottom:1px solid #ddd;border-top:1px solid #ddd;overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.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{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:"";pointer-events:none;position:absolute}.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{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}');t(".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}");"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e={exports:{}};!function(t){var e="1.7.1";function i(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++)for(e in n=arguments[i])t[e]=n[e];return t}var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function n(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.concat(i.call(arguments)):arguments)}}var s=0;function r(t){return t._leaflet_id=t._leaflet_id||++s,t._leaflet_id}function a(t,e,i){var o,n,s,r;return r=function(){o=!1,n&&(s.apply(i,n),n=!1)},s=function(){o?n=arguments:(t.apply(i,arguments),setTimeout(r,e),o=!0)},s}function h(t,e,i){var o=e[1],n=e[0],s=o-n;return t===o&&i?t:((t-n)%s+s)%s+n}function l(){return!1}function c(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function d(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var o=[];for(var n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var m=/\{ *([\w_-]+) *\}/g;function _(t,e){return t.replace(m,(function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o}))}var g=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var v="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function x(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||b("RequestAnimationFrame")||x,M=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,i){if(!i||P!==x)return P.call(window,n(t,e));t.call(e)}function k(t){t&&M.call(window,t)}var A={extend:i,create:o,bind:n,lastId:s,stamp:r,throttle:a,wrapNum:h,falseFn:l,formatNum:c,trim:u,splitWords:p,setOptions:d,getParamString:f,template:_,isArray:g,indexOf:y,emptyImageUrl:v,requestFn:P,cancelFn:M,requestAnimFrame:C,cancelAnimFrame:k};function T(){}function E(t){if("undefined"!=typeof L&&L&&L.Mixin){t=g(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===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)}}T.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},n=e.__super__=this.prototype,s=o(n);for(var r in s.constructor=e,e.prototype=s,this)Object.prototype.hasOwnProperty.call(this,r)&&"prototype"!==r&&"__super__"!==r&&(e[r]=this[r]);return t.statics&&(i(e,t.statics),delete t.statics),t.includes&&(E(t.includes),i.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=i(o(s.options),t.options)),i(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},e},T.include=function(t){return i(this.prototype,t),this},T.mergeOptions=function(t){return i(this.prototype.options,t),this},T.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var O={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._on(t[n],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._off(t[n],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(this._events[t]=o=[]),i===this&&(i=void 0);for(var n={fn:e,ctx:i},s=o,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(n)},_off:function(t,e,i){var o,n,s;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(n=0,s=o.length;n<s;n++){var r=o[n];if(r.ctx===i&&r.fn===e)return r.fn=l,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(n,1)}}else{for(n=0,s=o.length;n<s;n++)o[n].fn=l;delete this._events[t]}},fire:function(t,e,o){if(!this.listens(t,o))return this;var n=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var h=s[r];h.fn.call(h.ctx||this,n)}this._firingCount--}}return o&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var s=n((function(){this.off(t,e,i).off(t,s,i)}),this);return this.on(t,e,i).on(t,s,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[r(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[r(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};O.addEventListener=O.on,O.removeEventListener=O.clearAllEventListeners=O.off,O.addOneTimeEventListener=O.once,O.fireEvent=O.fire,O.hasEventListeners=O.listens;var I=T.extend(O);function z(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var S=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function B(t,e,i){return t instanceof z?t:g(t)?new z(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new z(t.x,t.y):new z(t,e,i)}function Z(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function N(t,e){return!t||t instanceof Z?t:new Z(t,e)}function R(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function D(t,e){return t instanceof R?t:new R(t,e)}function j(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof j?t:g(t)&&"object"!=typeof t[0]?3===t.length?new j(t[0],t[1],t[2]):2===t.length?new j(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new j(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new j(t,e,i)}z.prototype={clone:function(){return new z(this.x,this.y)},add:function(t){return this.clone()._add(B(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(B(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new z(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new z(this.x/t.x,this.y/t.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=S(this.x),this.y=S(this.y),this},distanceTo:function(t){var e=(t=B(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=B(t)).x===this.x&&t.y===this.y},contains:function(t){return t=B(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+c(this.x)+", "+c(this.y)+")"}},Z.prototype={extend:function(t){return t=B(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new z((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new z(this.min.x,this.max.y)},getTopRight:function(){return new z(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(t){var e,i;return(t="number"==typeof t[0]||t instanceof z?B(t):N(t))instanceof Z?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=N(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>=e.x&&o.x<=i.x&&n.y>=e.y&&o.y<=i.y},overlaps:function(t){t=N(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>e.x&&o.x<i.x&&n.y>e.y&&o.y<i.y},isValid:function(){return!(!this.min||!this.max)}},R.prototype={extend:function(t){var e,i,o=this._southWest,n=this._northEast;if(t instanceof j)e=t,i=t;else{if(!(t instanceof R))return t?this.extend(F(t)||D(t)):this;if(i=t._northEast,!(e=t._southWest)||!i)return this}return o||n?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)):(this._southWest=new j(e.lat,e.lng),this._northEast=new j(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,n=Math.abs(e.lng-i.lng)*t;return new R(new j(e.lat-o,e.lng-n),new j(i.lat+o,i.lng+n))},getCenter:function(){return new j((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 j(this.getNorth(),this.getWest())},getSouthEast:function(){return new j(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(t){t="number"==typeof t[0]||t instanceof j||"lat"in t?F(t):D(t);var e,i,o=this._southWest,n=this._northEast;return t instanceof R?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=n.lat&&e.lng>=o.lng&&i.lng<=n.lng},intersects:function(t){t=D(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},overlaps:function(t){t=D(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>e.lat&&o.lat<i.lat&&n.lng>e.lng&&o.lng<i.lng},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=D(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},j.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+c(this.lat,t)+", "+c(this.lng,t)+")"},distanceTo:function(t){return H.distance(this,F(t))},wrap:function(){return H.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return D([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new j(this.lat,this.lng,this.alt)}};var U,W={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new Z(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?h(t.lng,this.wrapLng,!0):t.lng;return new j(this.wrapLat?h(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,n=e.lng-i.lng;if(0===o&&0===n)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new R(new j(s.lat-o,s.lng-n),new j(r.lat-o,r.lng-n))}},H=i({},W,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,n=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(o)*Math.cos(n)*r*r,h=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*h}}),V=6378137,q={R:V,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),n=Math.sin(o*e);return new z(this.R*t.lng*e,this.R*Math.log((1+n)/(1-n))/2)},unproject:function(t){var e=180/Math.PI;return new j((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(U=V*Math.PI,new Z([-U,-U],[U,U]))};function G(t,e,i,o){if(g(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=o}function J(t,e,i,o){return new G(t,e,i,o)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new z((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=i({},H,{code:"EPSG:3857",projection:q,transformation:function(){var t=.5/(Math.PI*q.R);return J(t,.5,-t,.5)}()}),Y=i({},K,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,o,n,s,r,a,h="";for(i=0,n=t.length;i<n;i++){for(o=0,s=(r=t[i]).length;o<s;o++)h+=(o?"L":"M")+(a=r[o]).x+" "+a.y;h+=e?Et?"z":"x":""}return h||"M0 0"}var $=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=It("webkit"),nt=It("android"),st=It("android 2")||It("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=nt&&It("Google")&&rt<537&&!("AudioNode"in window),ht=!!window.opera,lt=!it&&It("chrome"),ct=It("gecko")&&!ot&&!ht&&!tt,ut=!lt&&It("safari"),pt=It("phantom"),dt="OTransition"in $,ft=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in $,_t="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,gt="MozPerspective"in $,yt=!window.L_DISABLE_3D&&(mt||_t||gt)&&!dt&&!pt,vt="undefined"!=typeof orientation||It("mobile"),bt=vt&&ot,wt=vt&&_t,xt=!window.PointerEvent&&window.MSPointerEvent,Lt=!(!window.PointerEvent&&!xt),Pt=!window.L_NO_TOUCH&&(Lt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Mt=vt&&ht,Ct=vt&&ct,kt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,At=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",l,e),window.removeEventListener("testPassiveEventSupport",l,e)}catch(i){}return t}(),Tt=!!document.createElement("canvas").getContext,Et=!(!document.createElementNS||!Q("svg").createSVGRect),Ot=!Et&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}();function It(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var zt={ie:tt,ielt9:et,edge:it,webkit:ot,android:nt,android23:st,androidStock:at,opera:ht,chrome:lt,gecko:ct,safari:ut,phantom:pt,opera12:dt,win:ft,ie3d:mt,webkit3d:_t,gecko3d:gt,any3d:yt,mobile:vt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:xt,pointer:Lt,touch:Pt,mobileOpera:Mt,mobileGecko:Ct,retina:kt,passiveEvents:At,canvas:Tt,svg:Et,vml:Ot},St=xt?"MSPointerDown":"pointerdown",Bt=xt?"MSPointerMove":"pointermove",Zt=xt?"MSPointerUp":"pointerup",Nt=xt?"MSPointerCancel":"pointercancel",Rt={},Dt=!1;function jt(t,e,i,o){return"touchstart"===e?Ut(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Jt(t,i,o),this}function Ft(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(St,o,!1):"touchmove"===e?t.removeEventListener(Bt,o,!1):"touchend"===e&&(t.removeEventListener(Zt,o,!1),t.removeEventListener(Nt,o,!1)),this}function Ut(t,e,i){var o=n((function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&He(t),qt(t,e)}));t["_leaflet_touchstart"+i]=o,t.addEventListener(St,o,!1),Dt||(document.addEventListener(St,Wt,!0),document.addEventListener(Bt,Ht,!0),document.addEventListener(Zt,Vt,!0),document.addEventListener(Nt,Vt,!0),Dt=!0)}function Wt(t){Rt[t.pointerId]=t}function Ht(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Vt(t){delete Rt[t.pointerId]}function qt(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||qt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(Bt,o,!1)}function Jt(t,e,i){var o=function(t){qt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Zt,o,!1),t.addEventListener(Nt,o,!1)}var Kt=xt?"MSPointerDown":Lt?"pointerdown":"touchstart",Yt=xt?"MSPointerUp":Lt?"pointerup":"touchend",Qt="_leaflet_";function Xt(t,e,i){var o,n,s=!1,r=250;function a(t){if(Lt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),i=e-(o||e);n=t.touches?t.touches[0]:t,s=i>0&&i<=r,o=e}function h(t){if(s&&!n.cancelBubble){if(Lt){if("mouse"===t.pointerType)return;var i,r,a={};for(r in n)a[r]=(i=n[r])&&i.bind?i.bind(n):i;n=a}n.type="dblclick",n.button=0,e(n),o=null}}return t[Qt+Kt+i]=a,t[Qt+Yt+i]=h,t[Qt+"dblclick"+i]=e,t.addEventListener(Kt,a,!!At&&{passive:!1}),t.addEventListener(Yt,h,!!At&&{passive:!1}),t.addEventListener("dblclick",e,!1),this}function $t(t,e){var i=t[Qt+Yt+e],o=t[Qt+"dblclick"+e];return t.removeEventListener(Kt,t[Qt+Kt+e],!!At&&{passive:!1}),t.removeEventListener(Yt,i,!!At&&{passive:!1}),t.removeEventListener("dblclick",o,!1),this}var te,ee,ie,oe,ne,se=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),re=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ae="webkitTransition"===re||"OTransition"===re?re+"End":"transitionend";function he(t){return"string"==typeof t?document.getElementById(t):t}function le(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function ce(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function me(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=ve(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function _e(t,e){if(void 0!==t.classList)for(var i=p(e),o=0,n=i.length;o<n;o++)t.classList.add(i[o]);else if(!me(t,e)){var s=ve(t);ye(t,(s?s+" ":"")+e)}}function ge(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,u((" "+ve(t)+" ").replace(" "+e+" "," ")))}function ye(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function ve(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function be(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(n){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(opacity="+e+")"}function xe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Le(t,e,i){var o=e||new z(0,0);t.style[se]=(mt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Pe(t,e){t._leaflet_pos=e,yt?Le(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Me(t){return t._leaflet_pos||new z(0,0)}if("onselectstart"in document)te=function(){Se(window,"selectstart",He)},ee=function(){Ze(window,"selectstart",He)};else{var Ce=xe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);te=function(){if(Ce){var t=document.documentElement.style;ie=t[Ce],t[Ce]="none"}},ee=function(){Ce&&(document.documentElement.style[Ce]=ie,ie=void 0)}}function ke(){Se(window,"dragstart",He)}function Ae(){Ze(window,"dragstart",He)}function Te(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Ee(),oe=t,ne=t.style.outline,t.style.outline="none",Se(window,"keydown",Ee))}function Ee(){oe&&(oe.style.outline=ne,oe=void 0,ne=void 0,Ze(window,"keydown",Ee))}function Oe(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Ie(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var ze={TRANSFORM:se,TRANSITION:re,TRANSITION_END:ae,get:he,getStyle:le,create:ce,remove:ue,empty:pe,toFront:de,toBack:fe,hasClass:me,addClass:_e,removeClass:ge,setClass:ye,getClass:ve,setOpacity:be,testProp:xe,setTransform:Le,setPosition:Pe,getPosition:Me,disableTextSelection:te,enableTextSelection:ee,disableImageDrag:ke,enableImageDrag:Ae,preventOutline:Te,restoreOutline:Ee,getSizedParentNode:Oe,getScale:Ie};function Se(t,e,i,o){if("object"==typeof e)for(var n in e)De(t,n,e[n],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)De(t,e[s],i,o);return this}var Be="_leaflet_events";function Ze(t,e,i,o){if("object"==typeof e)for(var n in e)je(t,n,e[n],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)je(t,e[s],i,o);else{for(var a in t[Be])je(t,a,t[Be][a]);delete t[Be]}return this}function Ne(){if(Lt)return!(it||ut)}var Re={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function De(t,e,i,o){var n=e+r(i)+(o?"_"+r(o):"");if(t[Be]&&t[Be][n])return this;var s=function(e){return i.call(o||t,e||window.event)},a=s;Lt&&0===e.indexOf("touch")?jt(t,e,s,n):Pt&&"dblclick"===e&&!Ne()?Xt(t,s,n):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Re[e]||e,s,!!At&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?t.addEventListener(Re[e],s=function(e){e=e||window.event,Xe(t,e)&&a(e)},!1):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[Be]=t[Be]||{},t[Be][n]=s}function je(t,e,i,o){var n=e+r(i)+(o?"_"+r(o):""),s=t[Be]&&t[Be][n];if(!s)return this;Lt&&0===e.indexOf("touch")?Ft(t,e,n):Pt&&"dblclick"===e&&!Ne()?$t(t,n):"removeEventListener"in t?t.removeEventListener(Re[e]||e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s),t[Be][n]=null}function Fe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Qe(t),this}function Ue(t){return De(t,"wheel",Fe),this}function We(t){return Se(t,"mousedown touchstart dblclick",Fe),De(t,"click",Ye),this}function He(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ve(t){return He(t),Fe(t),this}function qe(t,e){if(!e)return new z(t.clientX,t.clientY);var i=Ie(e),o=i.boundingClientRect;return new z((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.top)/i.y-e.clientTop)}var Ge=ft&&lt?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function Je(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ge:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ke={};function Ye(t){Ke[t.type]=!0}function Qe(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(o){return!1}return i!==t}var $e={on:Se,off:Ze,stopPropagation:Fe,disableScrollPropagation:Ue,disableClickPropagation:We,preventDefault:He,stop:Ve,getMousePosition:qe,getWheelDelta:Je,fakeStop:Ye,skipped:Qe,isExternalTarget:Xe,addListener:Se,removeListener:Ze},ti=I.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=Me(t),this._offset=e.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=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Pe(this._el,i),this.fire("step")},_complete:function(){k(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ei=I.extend({options:{crs:K,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(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=n(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=re&&yt&&!Mt&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Se(this._proxy,ae,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,o){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),o=o||{},this._stop(),this._loaded&&!o.reset&&!0!==o&&(void 0!==o.animate&&(o.zoom=i({animate:o.animate},o.zoom),o.pan=i({animate:o.animate,duration:o.duration},o.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,o.zoom):this._tryAnimatedPan(t,o.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t=t||(yt?this.options.zoomDelta:1)),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t=t||(yt?this.options.zoomDelta:1)),e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),n=this.getSize().divideBy(2),s=(t instanceof z?t:this.latLngToContainerPoint(t)).subtract(n).multiplyBy(1-1/o),r=this.containerPointToLatLng(n.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():D(t);var i=B(e.paddingTopLeft||e.padding||[0,0]),o=B(e.paddingBottomRight||e.padding||[0,0]),n=this.getBoundsZoom(t,!1,i.add(o));if((n="number"==typeof e.maxZoom?Math.min(e.maxZoom,n):n)===1/0)return{center:t.getCenter(),zoom:n};var s=o.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),n),a=this.project(t.getNorthEast(),n);return{center:this.unproject(r.add(a).divideBy(2).add(s),n),zoom:n}},fitBounds:function(t,e){if(!(t=D(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=B(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ti,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){_e(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!yt)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),n=this.project(t),s=this.getSize(),r=this._zoom;t=F(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),h=a*this.getZoomScale(r,e),l=n.distanceTo(o)||1,c=1.42,u=c*c;function p(t){var e=(h*h-a*a+(t?-1:1)*u*u*l*l)/(2*(t?h:a)*u*l),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return d(t)/f(t)}var _=p(0);function g(t){return a*(f(_)/f(_+c*t))}function y(t){return a*(f(_)*m(_+c*t)-d(_))/u}function v(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),w=(p(1)-_)/c,x=i.duration?1e3*i.duration:1e3*w*.8;function L(){var i=(Date.now()-b)/x,s=v(i)*w;i<=1?(this._flyToFrame=C(L,this),this._move(this.unproject(o.add(n.subtract(o).multiplyBy(y(s)/l)),r),this.getScaleZoom(a/g(s),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),L.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=D(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),o=this._limitCenter(i,this._zoom,D(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=B((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=B(e.paddingBottomRight||e.padding||[0,0]),n=this.getCenter(),s=this.project(n),r=this.project(t),a=this.getPixelBounds(),h=a.getSize().divideBy(2),l=N([a.min.add(i),a.max.subtract(o)]);if(!l.contains(r)){this._enforcingBounds=!0;var c=s.subtract(r),u=B(r.x+c.x,r.y+c.y);(r.x<l.min.x||r.x>l.max.x)&&(u.x=s.x-c.x,c.x>0?u.x+=h.x-i.x:u.x-=h.x-o.x),(r.y<l.min.y||r.y>l.max.y)&&(u.y=s.y-c.y,c.y>0?u.y+=h.y-i.y:u.y-=h.y-o.y),this.panTo(this.unproject(u),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),s=e.divideBy(2).round(),r=o.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,o,t):navigator.geolocation.getCurrentPosition(e,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new j(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var n=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(n,o.maxZoom):n)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),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(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(k(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=ce("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new R(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=D(t),i=B(i||[0,0]);var o=this.getZoom()||0,n=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(i),l=N(this.project(a,o),this.project(r,o)).getSize(),c=yt?this.options.zoomSnap:1,u=h.x/l.x,p=h.y/l.y,d=e?Math.max(u,p):Math.min(u,p);return o=this.getScaleZoom(d,o),c&&(o=Math.round(o/(c/100))*(c/100),o=e?Math.ceil(o/c)*c:Math.floor(o/c)*c),Math.max(n,Math.min(s,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new Z(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,o=i.zoom(t*i.scale(e=void 0===e?this._zoom:e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(B(t),e)},layerPointToLatLng:function(t){var e=B(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(D(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return B(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return B(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(B(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return qe(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=he(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Se(e,"scroll",this._onScroll,this),this._containerId=r(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&yt,_e(t,"leaflet-container"+(Pt?" leaflet-touch":"")+(kt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ut?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=le(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Pe(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(_e(t.markerPane,"leaflet-zoom-hide"),_e(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Pe(this._mapPane,new z(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return k(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Pe(this._mapPane,this._getMapPanePos().subtract(t))},_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(t){this._targets={},this._targets[r(this._container)]=this;var e=t?Ze:Se;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),yt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){k(this._resizeRequest),this._resizeRequest=C((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,o=[],n="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,a=!1;s;){if((i=this._targets[r(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(n&&!Xe(s,t))break;if(o.push(i),n)break}if(s===this._container)break;s=s.parentNode}return o.length||a||n||!Xe(s,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Qe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Te(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,o){if("click"===t.type){var n=i({},t);n.type="preclick",this._fireDOMEvent(n,n.type,o)}if(!t._stopped&&(o=(o||[]).concat(this._findEventTargets(t,e))).length){var s=o[0];"contextmenu"===e&&s.listens(e,!0)&&He(t);var r={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var h=0;h<o.length;h++)if(o[h].fire(e,r,!0),r.originalEvent._stopped||!1===o[h].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Me(this._mapPane)||new z(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return N([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var o=this.project(t,e),n=this.getSize().divideBy(2),s=new Z(o.subtract(n),o.add(n)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(o.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new Z(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=N(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),n=o.min.subtract(t.min),s=o.max.subtract(t.max);return new z(this._rebound(n.x,-s.x),this._rebound(n.y,-s.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),o=yt?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ge(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=ce("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=se,i=this._proxy.style[e];Le(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Le(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var o=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/o);return!(!0!==i.animate&&!this.getSize().contains(n)||(C((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,_e(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ge(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C((function(){this._moveEnd(!0)}),this))}});function ii(t,e){return new ei(t,e)}var oi=T.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return _e(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ni=function(t){return new oi(t)};ei.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=ce("div",e+"control-container",this._container);function o(o,n){t[o+n]=ce("div",e+o+" "+e+n,i)}o("top","left"),o("top","right"),o("bottom","left"),o("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var si=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,o){return i<o?-1:o<i?1:0}},initialize:function(t,e,i){for(var o in d(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[o],o);for(o in e)this._addLayer(e[o],o,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(r(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){_e(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(_e(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ge(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ge(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=ce("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),We(e),Ue(e);var o=this._section=ce("section",t+"-list");i&&(this._map.on("click",this.collapse,this),nt||Se(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var n=this._layersLink=ce("a",t+"-toggle",e);n.href="#",n.title="Layers",Pt?(Se(n,"click",Ve),Se(n,"click",this.expand,this)):Se(n,"focus",this.expand,this),i||this.expand(),this._baseLayersList=ce("div",t+"-base",o),this._separator=ce("div",t+"-separator",o),this._overlaysList=ce("div",t+"-overlays",o),e.appendChild(o)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&r(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(n((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,o,n=0;for(i=0;i<this._layers.length;i++)this._addItem(o=this._layers[i]),e=e||o.overlay,t=t||!o.overlay,n+=o.overlay?0:1;return this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&n>1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(r(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",o=document.createElement("div");return o.innerHTML=i,o.firstChild},_addItem:function(t){var e,i=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+r(this),o),this._layerControlInputs.push(e),e.layerId=r(t.layer),Se(e,"click",this._onInputClick,this);var n=document.createElement("span");n.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,o=[],n=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)e=this._getLayer((t=i[s]).layerId).layer,t.checked?o.push(e):t.checked||n.push(e);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])&&this._map.removeLayer(n[s]);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])||this._map.addLayer(o[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,o=this._map.getZoom(),n=i.length-1;n>=0;n--)e=this._getLayer((t=i[n]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&o<e.options.minZoom||void 0!==e.options.maxZoom&&o>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ri=function(t,e,i){return new si(t,e,i)},ai=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=ce("div",e+" leaflet-bar"),o=this.options;return this._zoomInButton=this._createButton(o.zoomInText,o.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(o.zoomOutText,o.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,o,n){var s=ce("a",i,o);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),We(s),Se(s,"click",Ve),Se(s,"click",n,this),Se(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ge(this._zoomInButton,e),ge(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&_e(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&_e(this._zoomInButton,e)}});ei.mergeOptions({zoomControl:!0}),ei.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ai,this.addControl(this.zoomControl))}));var hi=function(t){return new ai(t)},li=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=ce("div",e),o=this.options;return this._addScales(o,e+"-line",i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=ce("div",e,i)),t.imperial&&(this._iScale=ce("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,o,n=3.2808399*t;n>5280?(i=this._getRoundNum(e=n/5280),this._updateScale(this._iScale,i+" mi",i/e)):(o=this._getRoundNum(n),this._updateScale(this._iScale,o+" ft",o/n))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),ci=function(t){return new li(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=ce("div","leaflet-control-attribution"),We(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ei.mergeOptions({attributionControl:!0}),ei.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};oi.Layers=si,oi.Zoom=ai,oi.Scale=li,oi.Attribution=ui,ni.layers=ri,ni.zoom=hi,ni.scale=ci,ni.attribution=pi;var di=T.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});di.addTo=function(t,e){return t.addHandler(e,this),this};var fi,mi={Events:O},_i=Pt?"touchstart mousedown":"mousedown",gi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},yi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},vi=I.extend({options:{clickTolerance:3},initialize:function(t,e,i,o){d(this,o),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Se(this._dragStartTarget,_i,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(vi._dragging===this&&this.finishDrag(),Ze(this._dragStartTarget,_i,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!me(this._element,"leaflet-zoom-anim")&&!(vi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(vi._dragging=this,this._preventOutline&&Te(this._element),ke(),te(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Oe(this._element);this._startPoint=new z(e.clientX,e.clientY),this._parentScale=Ie(i),Se(document,yi[t.type],this._onMove,this),Se(document,gi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new z(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,He(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Me(this._element).subtract(i),_e(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),_e(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,k(this._animRequest),this._lastEvent=t,this._animRequest=C(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Pe(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ge(document.body,"leaflet-dragging"),this._lastTarget&&(ge(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),yi)Ze(document,yi[t],this._onMove,this),Ze(document,gi[t],this._onUp,this);Ae(),ee(),this._moved&&this._moving&&(k(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,vi._dragging=!1}});function bi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Li(t=Mi(t,i),i)}function wi(t,e,i){return Math.sqrt(Ei(t,e,i,!0))}function xi(t,e,i){return Ei(t,e,i)}function Li(t,e){var i=t.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);o[0]=o[i-1]=1,Pi(t,o,e,0,i-1);var n,s=[];for(n=0;n<i;n++)o[n]&&s.push(t[n]);return s}function Pi(t,e,i,o,n){var s,r,a,h=0;for(r=o+1;r<=n-1;r++)(a=Ei(t[r],t[o],t[n],!0))>h&&(s=r,h=a);h>i&&(e[s]=1,Pi(t,e,i,o,s),Pi(t,e,i,s,n))}function Mi(t,e){for(var i=[t[0]],o=1,n=0,s=t.length;o<s;o++)Ti(t[o],t[n])>e&&(i.push(t[o]),n=o);return n<s-1&&i.push(t[s-1]),i}function Ci(t,e,i,o,n){var s,r,a,h=o?fi:Ai(t,i),l=Ai(e,i);for(fi=l;;){if(!(h|l))return[t,e];if(h&l)return!1;a=Ai(r=ki(t,e,s=h||l,i,n),i),s===h?(t=r,h=a):(e=r,l=a)}}function ki(t,e,i,o,n){var s,r,a=e.x-t.x,h=e.y-t.y,l=o.min,c=o.max;return 8&i?(s=t.x+a*(c.y-t.y)/h,r=c.y):4&i?(s=t.x+a*(l.y-t.y)/h,r=l.y):2&i?(s=c.x,r=t.y+h*(c.x-t.x)/a):1&i&&(s=l.x,r=t.y+h*(l.x-t.x)/a),new z(s,r,n)}function Ai(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Ti(t,e){var i=e.x-t.x,o=e.y-t.y;return i*i+o*o}function Ei(t,e,i,o){var n,s=e.x,r=e.y,a=i.x-s,h=i.y-r,l=a*a+h*h;return l>0&&((n=((t.x-s)*a+(t.y-r)*h)/l)>1?(s=i.x,r=i.y):n>0&&(s+=a*n,r+=h*n)),a=t.x-s,h=t.y-r,o?a*a+h*h:new z(s,r)}function Oi(t){return!g(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Ii(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Oi(t)}var zi={simplify:bi,pointToSegmentDistance:wi,closestPointOnSegment:xi,clipSegment:Ci,_getEdgeIntersection:ki,_getBitCode:Ai,_sqClosestPointOnSegment:Ei,isFlat:Oi,_flat:Ii};function Si(t,e,i){var o,n,s,r,a,h,l,c,u,p=[1,4,2,8];for(n=0,l=t.length;n<l;n++)t[n]._code=Ai(t[n],e);for(r=0;r<4;r++){for(c=p[r],o=[],n=0,s=(l=t.length)-1;n<l;s=n++)h=t[s],(a=t[n])._code&c?h._code&c||((u=ki(h,a,c,e,i))._code=Ai(u,e),o.push(u)):(h._code&c&&((u=ki(h,a,c,e,i))._code=Ai(u,e),o.push(u)),o.push(a));t=o}return t}var Bi={clipPolygon:Si},Zi={project:function(t){return new z(t.lng,t.lat)},unproject:function(t){return new j(t.y,t.x)},bounds:new Z([-180,-90],[180,90])},Ni={R:6378137,R_MINOR:6356752.314245179,bounds:new Z([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,o=t.lat*e,n=this.R_MINOR/i,s=Math.sqrt(1-n*n),r=s*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/Math.pow((1-r)/(1+r),s/2);return o=-i*Math.log(Math.max(a,1e-10)),new z(t.lng*e*i,o)},unproject:function(t){for(var e,i=180/Math.PI,o=this.R,n=this.R_MINOR/o,s=Math.sqrt(1-n*n),r=Math.exp(-t.y/o),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&Math.abs(l)>1e-7;h++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=l=Math.PI/2-2*Math.atan(r*e)-a;return new j(a*i,t.x*i/o)}},Ri={LonLat:Zi,Mercator:Ni,SphericalMercator:q},Di=i({},H,{code:"EPSG:3395",projection:Ni,transformation:function(){var t=.5/(Math.PI*Ni.R);return J(t,.5,-t,.5)}()}),ji=i({},H,{code:"EPSG:4326",projection:Zi,transformation:J(1/180,1,-1/180,.5)}),Fi=i({},W,{projection:Zi,transformation:J(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,o=e.lat-t.lat;return Math.sqrt(i*i+o*o)},infinite:!0});W.Earth=H,W.EPSG3395=Di,W.EPSG3857=K,W.EPSG900913=Y,W.EPSG4326=ji,W.Simple=Fi;var Ui=I.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[r(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[r(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ei.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=r(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=r(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&r(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?g(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[r(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=r(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var o in this._zoomBoundLayers){var n=this._zoomBoundLayers[o].options;t=void 0===n.minZoom?t:Math.min(t,n.minZoom),e=void 0===n.maxZoom?e:Math.max(e,n.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Wi=Ui.extend({initialize:function(t,e){var i,o;if(d(this,e),this._layers={},t)for(i=0,o=t.length;i<o;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,o=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,o);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return r(t)}}),Hi=function(t,e){return new Wi(t,e)},Vi=Wi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Wi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Wi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new R;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),qi=function(t,e){return new Vi(t,e)},Gi=T.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){d(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var o=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(o,t),o},_setIconStyles:function(t,e){var i=this.options,o=i[e+"Size"];"number"==typeof o&&(o=[o,o]);var n=B(o),s=B("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return kt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ji(t){return new Gi(t)}var Ki=Gi.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(t){return Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=ce("div","leaflet-default-icon-path",document.body),e=le(t,"background-image")||le(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Yi=di.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new vi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),_e(t,"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&&ge(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,o=this._marker.options.autoPanSpeed,n=this._marker.options.autoPanPadding,s=Me(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),h=N(r.min._subtract(a).add(n),r.max._subtract(a).subtract(n));if(!h.contains(s)){var l=B((Math.max(h.max.x,s.x)-h.max.x)/(r.max.x-h.max.x)-(Math.min(h.min.x,s.x)-h.min.x)/(r.min.x-h.min.x),(Math.max(h.max.y,s.y)-h.max.y)/(r.max.y-h.max.y)-(Math.min(h.min.y,s.y)-h.min.y)/(r.min.y-h.min.y)).multiplyBy(o);i.panBy(l,{animate:!1}),this._draggable._newPos._add(l),this._draggable._startPos._add(l),Pe(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(k(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,o=Me(e._icon),n=e._map.layerPointToLatLng(o);i&&Pe(i,o),e._latlng=n,t.latlng=n,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){k(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Qi=Ui.extend({options:{icon:new Ki,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.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(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,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 t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),o=!1;i!==this._icon&&(this._icon&&this._removeIcon(),o=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),_e(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var n=t.icon.createShadow(this._shadow),s=!1;n!==this._shadow&&(this._removeShadow(),s=!0),n&&(_e(n,e),n.alt=""),this._shadow=n,t.opacity<1&&this._updateOpacity(),o&&this.getPane().appendChild(this._icon),this._initInteraction(),n&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Pe(this._icon,t),this._shadow&&Pe(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(_e(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Yi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Yi(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&be(this._icon,t),this._shadow&&be(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Xi(t,e){return new Qi(t,e)}var $i=Ui.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(t){this._renderer=t.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(t){return d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"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}}),to=$i.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return $i.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),o=[t+i,e+i];this._pxBounds=new Z(this._point.subtract(o),this._point.add(o))},_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(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function eo(t,e){return new to(t,e)}var io=to.extend({initialize:function(t,e,o){if("number"==typeof e&&(e=i({},o,{radius:e})),d(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new R(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:$i.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,o=i.options.crs;if(o.distance===H.distance){var n=Math.PI/180,s=this._mRadius/H.R/n,r=i.project([e+s,t]),a=i.project([e-s,t]),h=r.add(a).divideBy(2),l=i.unproject(h).lat,c=Math.acos((Math.cos(s*n)-Math.sin(e*n)*Math.sin(l*n))/(Math.cos(e*n)*Math.cos(l*n)))/n;(isNaN(c)||0===c)&&(c=s/Math.cos(Math.PI/180*e)),this._point=h.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:h.x-i.project([l,t-c]).x,this._radiusY=h.y-r.y}else{var u=o.unproject(o.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(u).x}this._updateBounds()}});function oo(t,e,i){return new io(t,e,i)}var no=$i.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,o=1/0,n=null,s=Ei,r=0,a=this._parts.length;r<a;r++)for(var h=this._parts[r],l=1,c=h.length;l<c;l++){var u=s(t,e=h[l-1],i=h[l],!0);u<o&&(o=u,n=s(t,e,i))}return n&&(n.distance=Math.sqrt(o)),n},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,s,r,a=this._rings[0],h=a.length;if(!h)return null;for(t=0,e=0;t<h-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,o=0;t<h-1;t++)if((o+=i=(n=a[t]).distanceTo(s=a[t+1]))>e)return this._map.layerPointToLatLng([s.x-(r=(o-e)/i)*(s.x-n.x),s.y-r*(s.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new R,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Oi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Oi(t),o=0,n=t.length;o<n;o++)i?(e[o]=F(t[o]),this._bounds.extend(e[o])):e[o]=this._convertLatLngs(t[o]);return e},_project:function(){var t=new Z;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new z(t,t);this._pxBounds=new Z([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var o,n,s=t.length;if(t[0]instanceof j){for(n=[],o=0;o<s;o++)n[o]=this._map.latLngToLayerPoint(t[o]),i.extend(n[o]);e.push(n)}else for(o=0;o<s;o++)this._projectLatlngs(t[o],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,o,n,s,r,a,h=this._parts;for(e=0,o=0,n=this._rings.length;e<n;e++)for(i=0,s=(a=this._rings[e]).length;i<s-1;i++)(r=Ci(a[i],a[i+1],t,i,!0))&&(h[o]=h[o]||[],h[o].push(r[0]),r[1]===a[i+1]&&i!==s-2||(h[o].push(r[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,o=t.length;i<o;i++)t[i]=bi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,o,n,s,r,a,h=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(o=0,n=(r=(a=this._parts[i]).length)-1;o<r;n=o++)if((e||0!==o)&&wi(t,a[n],a[o])<=h)return!0;return!1}});function so(t,e){return new no(t,e)}no._flat=Ii;var ro=no.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()");var t,e,i,o,n,s,r,a,h=this._rings[0],l=h.length;if(!l)return null;for(s=r=a=0,t=0,e=l-1;t<l;e=t++)r+=((i=h[t]).x+(o=h[e]).x)*(n=i.y*o.x-o.y*i.x),a+=(i.y+o.y)*n,s+=3*n;return this._map.layerPointToLatLng(0===s?h[0]:[r/s,a/s])},_convertLatLngs:function(t){var e=no.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof j&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){no.prototype._setLatLngs.call(this,t),Oi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Oi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new z(e,e);if(t=new Z(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var o,n=0,s=this._rings.length;n<s;n++)(o=Si(this._rings[n],t,!0)).length&&this._parts.push(o)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,o,n,s,r,a,h,l=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,a=this._parts.length;n<a;n++)for(s=0,r=(h=(e=this._parts[n]).length)-1;s<h;r=s++)(i=e[s]).y>t.y!=(o=e[r]).y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(l=!l);return l||no.prototype._containsPoint.call(this,t,!0)}});function ao(t,e){return new ro(t,e)}var ho=Vi.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o,n=g(t)?t:t.features;if(n){for(e=0,i=n.length;e<i;e++)((o=n[e]).geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=lo(t,s);return r?(r.feature=go(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function lo(t,e){var i,o,n,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],l=e&&e.pointToLayer,c=e&&e.coordsToLatLng||uo;if(!a&&!r)return null;switch(r.type){case"Point":return co(l,t,i=c(a),e);case"MultiPoint":for(n=0,s=a.length;n<s;n++)i=c(a[n]),h.push(co(l,t,i,e));return new Vi(h);case"LineString":case"MultiLineString":return o=po(a,"LineString"===r.type?0:1,c),new no(o,e);case"Polygon":case"MultiPolygon":return o=po(a,"Polygon"===r.type?1:2,c),new ro(o,e);case"GeometryCollection":for(n=0,s=r.geometries.length;n<s;n++){var u=lo({geometry:r.geometries[n],type:"Feature",properties:t.properties},e);u&&h.push(u)}return new Vi(h);default:throw new Error("Invalid GeoJSON object.")}}function co(t,e,i,o){return t?t(e,i):new Qi(i,o&&o.markersInheritOptions&&o)}function uo(t){return new j(t[1],t[0],t[2])}function po(t,e,i){for(var o,n=[],s=0,r=t.length;s<r;s++)o=e?po(t[s],e-1,i):(i||uo)(t[s]),n.push(o);return n}function fo(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[c(t.lng,e),c(t.lat,e),c(t.alt,e)]:[c(t.lng,e),c(t.lat,e)]}function mo(t,e,i,o){for(var n=[],s=0,r=t.length;s<r;s++)n.push(e?mo(t[s],e-1,i,o):fo(t[s],o));return!e&&i&&n.push(n[0]),n}function _o(t,e){return t.feature?i({},t.feature,{geometry:e}):go(e)}function go(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var yo={toGeoJSON:function(t){return _o(this,{type:"Point",coordinates:fo(this.getLatLng(),t)})}};function vo(t,e){return new ho(t,e)}Qi.include(yo),io.include(yo),to.include(yo),no.include({toGeoJSON:function(t){var e=!Oi(this._latlngs);return _o(this,{type:(e?"Multi":"")+"LineString",coordinates:mo(this._latlngs,e?1:0,!1,t)})}}),ro.include({toGeoJSON:function(t){var e=!Oi(this._latlngs),i=e&&!Oi(this._latlngs[0]),o=mo(this._latlngs,i?2:e?1:0,!0,t);return e||(o=[o]),_o(this,{type:(i?"Multi":"")+"Polygon",coordinates:o})}}),Wi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),_o(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,o=[];return this.eachLayer((function(e){if(e.toGeoJSON){var n=e.toGeoJSON(t);if(i)o.push(n.geometry);else{var s=go(n);"FeatureCollection"===s.type?o.push.apply(o,s.features):o.push(s)}}})),i?_o(this,{geometries:o,type:"GeometryCollection"}):{type:"FeatureCollection",features:o}}});var bo=vo,wo=Ui.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=D(e),d(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(_e(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&de(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=D(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:ce("img");_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onload=n(this.fire,this,"load"),e.onerror=n(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Le(this._image,i,e)},_reset:function(){var t=this._image,e=new Z(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Pe(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){be(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&null!=this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),xo=function(t,e,i){return new wo(t,e,i)},Lo=wo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:ce("video");if(_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onloadeddata=n(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),o=[],s=0;s<i.length;s++)o.push(i[s].src);this._url=i.length>0?o:[e.src]}else{g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var r=0;r<this._url.length;r++){var a=ce("source");a.src=this._url[r],e.appendChild(a)}}}});function Po(t,e,i){return new Lo(t,e,i)}var Mo=wo.extend({_initImage:function(){var t=this._image=this._url;_e(t,"leaflet-image-layer"),this._zoomAnimated&&_e(t,"leaflet-zoom-animated"),this.options.className&&_e(t,this.options.className),t.onselectstart=l,t.onmousemove=l}});function Co(t,e,i){return new Mo(t,e,i)}var ko=Ui.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){d(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&be(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&be(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(be(this._container,0),this._removeTimeout=setTimeout(n(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,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 t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&de(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Ui||(i=e,e=t),e instanceof Vi)for(var o in t._layers){e=t._layers[o];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=B(this.options.offset),i=this._getAnchor();this._zoomAnimated?Pe(this._container,t.add(i)):e=e.add(t).add(i);var o=this._containerBottom=-e.y,n=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=o+"px",this._container.style.left=n+"px"}},_getAnchor:function(){return[0,0]}}),Ao=ko.extend({options:{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(t){return t.openPopup(this),this},onAdd:function(t){ko.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof $i||this._source.on("preclick",Fe))},onRemove:function(t){ko.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof $i||this._source.off("preclick",Fe))},getEvents:function(){var t=ko.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=ce("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=ce("div",t+"-content-wrapper",e);if(this._contentNode=ce("div",t+"-content",i),We(e),Ue(this._contentNode),Se(e,"contextmenu",Fe),this._tipContainer=ce("div",t+"-tip-container",e),this._tip=ce("div",t+"-tip",this._tipContainer),this.options.closeButton){var o=this._closeButton=ce("a",t+"-close-button",e);o.href="#close",o.innerHTML="&#215;",Se(o,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=this.options.maxHeight,n="leaflet-popup-scrolled";o&&t.offsetHeight>o?(e.height=o+"px",_e(t,n)):ge(t,n),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Pe(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(le(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,o=this._containerWidth,n=new z(this._containerLeft,-i-this._containerBottom);n._add(Me(this._container));var s=t.layerPointToContainerPoint(n),r=B(this.options.autoPanPadding),a=B(this.options.autoPanPaddingTopLeft||r),h=B(this.options.autoPanPaddingBottomRight||r),l=t.getSize(),c=0,u=0;s.x+o+h.x>l.x&&(c=s.x+o-l.x+h.x),s.x-c-a.x<0&&(c=s.x-a.x),s.y+i+h.y>l.y&&(u=s.y+i-l.y+h.y),s.y-u-a.y<0&&(u=s.y-a.y),(c||u)&&t.fire("autopanstart").panBy([c,u])}},_onCloseButtonClick:function(t){this._close(),Ve(t)},_getAnchor:function(){return B(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),To=function(t,e){return new Ao(t,e)};ei.mergeOptions({closePopupOnClick:!0}),ei.include({openPopup:function(t,e,i){return t instanceof Ao||(t=new Ao(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Ui.include({bindPopup:function(t,e){return t instanceof Ao?(d(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new Ao(e,this)),this._popup.setContent(t)),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(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(Ve(t),e instanceof $i?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Eo=ko.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){ko.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){ko.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=ko.prototype.getEvents.call(this);return Pt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){this._contentNode=this._container=ce("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,o=this._map,n=this._container,s=o.latLngToContainerPoint(o.getCenter()),r=o.layerPointToContainerPoint(t),a=this.options.direction,h=n.offsetWidth,l=n.offsetHeight,c=B(this.options.offset),u=this._getAnchor();"top"===a?(e=h/2,i=l):"bottom"===a?(e=h/2,i=0):"center"===a?(e=h/2,i=l/2):"right"===a?(e=0,i=l/2):"left"===a?(e=h,i=l/2):r.x<s.x?(a="right",e=0,i=l/2):(a="left",e=h+2*(c.x+u.x),i=l/2),t=t.subtract(B(e,i,!0)).add(c).add(u),ge(n,"leaflet-tooltip-right"),ge(n,"leaflet-tooltip-left"),ge(n,"leaflet-tooltip-top"),ge(n,"leaflet-tooltip-bottom"),_e(n,"leaflet-tooltip-"+a),Pe(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&be(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return B(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Oo=function(t,e){return new Eo(t,e)};ei.include({openTooltip:function(t,e,i){return t instanceof Eo||(t=new Eo(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Ui.include({bindTooltip:function(t,e){return t instanceof Eo?(d(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Eo(e,this)),this._tooltip.setContent(t)),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(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),Pt&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(_e(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ge(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){this._tooltip&&this._map&&this.openTooltip(t.layer||t.target,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,o=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),o=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(o)}});var Io=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var o=B(i.bgPos);e.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function zo(t){return new Io(t)}Gi.Default=Ki;var So=Ui.extend({options:{tileSize:256,opacity:1,updateWhenIdle:vt,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(t){d(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(de(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof z?t:new z(t,t)},_updateZIndex:function(){this._container&&null!=this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,o=-t(-1/0,1/0),n=0,s=i.length;n<s;n++)e=i[n].style.zIndex,i[n]!==this._container&&e&&(o=t(o,+e));isFinite(o)&&(this.options.zIndex=o+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){be(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var o in this._tiles){var n=this._tiles[o];if(n.current&&n.loaded){var s=Math.min(1,(t-n.loaded)/200);be(n.el,s),s<1?e=!0:(n.active?i=!0:this._onOpaqueTile(n),n.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(k(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:l,_initContainer:function(){this._container||(this._container=ce("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var o=this._levels[t],n=this._map;return o||((o=this._levels[t]={}).el=ce("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=n.project(n.unproject(n.getPixelOrigin()),t).round(),o.zoom=t,this._setZoomTransform(o,n.getCenter(),n.getZoom()),l(o.el.offsetWidth),this._onCreateLevel(o)),this._level=o,o}},_onUpdateLevel:l,_onRemoveLevel:l,_onCreateLevel:l,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var o=e.coords;this._retainParent(o.x,o.y,o.z,o.z-5)||this._retainChildren(o.x,o.y,o.z,o.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,o){var n=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new z(+n,+s);a.z=+r;var h=this._tileCoordsToKey(a),l=this._tiles[h];return l&&l.active?(l.retain=!0,!0):(l&&l.loaded&&(l.retain=!0),r>o&&this._retainParent(n,s,r,o))},_retainChildren:function(t,e,i,o){for(var n=2*t;n<2*t+2;n++)for(var s=2*e;s<2*e+2;s++){var r=new z(n,s);r.z=i+1;var a=this._tileCoordsToKey(r),h=this._tiles[a];h&&h.active?h.retain=!0:(h&&h.loaded&&(h.retain=!0),i+1<o&&this._retainChildren(n,s,i+1,o))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,o){var n=Math.round(e);n=void 0!==this.options.maxZoom&&n>this.options.maxZoom||void 0!==this.options.minZoom&&n<this.options.minZoom?void 0:this._clampZoom(n),o&&!(this.options.updateWhenZooming&&n!==this._tileZoom)||(this._tileZoom=n,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==n&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var o=this._map.getZoomScale(i,t.zoom),n=t.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(e,i)).round();yt?Le(t.el,n,o):Pe(t.el,n)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),o=this._tileZoom,n=this._map.getPixelWorldBounds(this._tileZoom);n&&(this._globalTileRange=this._pxBoundsToTileRange(n)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],o).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],o).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],o).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],o).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),o=e.getZoomScale(i,this._tileZoom),n=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*o);return new Z(n.subtract(s),n.add(s))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var o=this._getTiledPixelBounds(t),n=this._pxBoundsToTileRange(o),s=n.getCenter(),r=[],a=this.options.keepBuffer,h=new Z(n.getBottomLeft().subtract([a,-a]),n.getTopRight().add([a,-a]));if(!(isFinite(n.min.x)&&isFinite(n.min.y)&&isFinite(n.max.x)&&isFinite(n.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var l in this._tiles){var c=this._tiles[l].coords;c.z===this._tileZoom&&h.contains(new z(c.x,c.y))||(this._tiles[l].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var u=n.min.y;u<=n.max.y;u++)for(var p=n.min.x;p<=n.max.x;p++){var d=new z(p,u);if(d.z=this._tileZoom,this._isValidTile(d)){var f=this._tiles[this._tileCoordsToKey(d)];f?f.current=!0:r.push(d)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(p=0;p<r.length;p++)this._addTile(r[p],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var o=this._tileCoordsToBounds(t);return D(this.options.bounds).overlaps(o)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),o=t.scaleBy(i),n=o.add(i);return[e.unproject(o,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new R(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new z(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){_e(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=l,t.onmousemove=l,et&&this.options.opacity<1&&be(t,this.options.opacity),nt&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&C(n(this._tileReady,this,t,null,s)),Pe(s,i),this._tiles[o]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(be(i.el,0),k(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(_e(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new z(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new Z(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Bo(t){return new So(t)}var Zo=So.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&kt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),nt||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Se(i,"load",n(this._tileOnLoad,this,e,i)),Se(i,"error",n(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:kt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=o),e["-y"]=o}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(n(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var o=this.options.errorTileUrl;o&&e.getAttribute("src")!==o&&(e.src=o),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=l,e.onerror=l,e.complete||(e.src=v,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",v),So.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==v))return So.prototype._tileReady.call(this,t,e,i)}});function No(t,e){return new Zo(t,e)}var Ro=Zo.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var o=i({},this.defaultWmsParams);for(var n in e)n in this.options||(o[n]=e[n]);var s=(e=d(this,e)).detectRetina&&kt?2:1,r=this.getTileSize();o.width=r.x*s,o.height=r.y*s,this.wmsParams=o},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,Zo.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,o=N(i.project(e[0]),i.project(e[1])),n=o.min,s=o.max,r=(this._wmsVersion>=1.3&&this._crs===ji?[n.y,n.x,s.y,s.x]:[n.x,n.y,s.x,s.y]).join(","),a=Zo.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Do(t,e){return new Ro(t,e)}Zo.WMS=Ro,No.wms=Do;var jo=Ui.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),r(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&_e(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 t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),o=Me(this._container),n=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=n.multiplyBy(-i).add(o).add(n).subtract(r);yt?Le(this._container,a,i):Pe(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new Z(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fo=jo.extend({getEvents:function(){var t=jo.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){jo.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Se(t,"mousemove",this._onMouseMove,this),Se(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Se(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){k(this._redrawRequest),delete this._ctx,ue(this._container),Ze(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){jo.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),o=kt?2:1;Pe(e,t.min),e.width=o*i.x,e.height=o*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",kt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){jo.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[r(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,o=e.prev;i?i.prev=o:this._drawLast=o,o?o.next=i:this._drawFirst=i,delete t._order,delete this._layers[r(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,o=t.options.dashArray.split(/[, ]+/),n=[];for(i=0;i<o.length;i++){if(e=Number(o[i]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Z,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_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 t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.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 t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var o=this._drawFirst;o;o=o.next)t=o.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,o,n,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(h.beginPath(),i=0;i<a;i++){for(o=0,n=r[i].length;o<n;o++)h[o?"lineTo":"moveTo"]((s=r[i][o]).x,s.y);e&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,o=Math.max(Math.round(t._radius),1),n=(Math.max(Math.round(t._radiusY),1)||o)/o;1!==n&&(i.save(),i.scale(1,n)),i.beginPath(),i.arc(e.x,e.y/n,o,0,2*Math.PI,!1),1!==n&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,o=this._map.mouseEventToLayerPoint(t),n=this._drawFirst;n;n=n.next)(e=n.layer).options.interactive&&e._containsPoint(o)&&("click"!==t.type&&"preclick"===t.type||!this._map._draggableMoved(e))&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ge(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,o,s=this._drawFirst;s;s=s.next)(i=s.layer).options.interactive&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(_e(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(n((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;i&&(i.prev=o,o?o.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;o&&(o.next=i,i?i.prev=o:o&&(this._drawLast=o),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Uo(t){return Tt?new Fo(t):null}var Wo=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Ho={_initContainer:function(){this._container=ce("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(jo.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Wo("shape");_e(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Wo("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[r(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,o=t.options,n=t._container;n.stroked=!!o.stroke,n.filled=!!o.fill,o.stroke?(e||(e=t._stroke=Wo("stroke")),n.appendChild(e),e.weight=o.weight+"px",e.color=o.color,e.opacity=o.opacity,e.dashStyle=o.dashArray?g(o.dashArray)?o.dashArray.join(" "):o.dashArray.replace(/( *, *)/g," "):"",e.endcap=o.lineCap.replace("butt","flat"),e.joinstyle=o.lineJoin):e&&(n.removeChild(e),t._stroke=null),o.fill?(i||(i=t._fill=Wo("fill")),n.appendChild(i),i.color=o.fillColor||o.color,i.opacity=o.fillOpacity):i&&(n.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),o=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+o+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){de(t._container)},_bringToBack:function(t){fe(t._container)}},Vo=Ot?Wo:Q,qo=jo.extend({getEvents:function(){var t=jo.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Vo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Ze(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){jo.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Pe(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Vo("path");t.options.className&&_e(e,t.options.className),t.options.interactive&&_e(e,"leaflet-interactive"),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[r(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",n=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,n)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){de(t._path)},_bringToBack:function(t){fe(t._path)}});function Go(t){return Et||Ot?new qo(t):null}Ot&&qo.include(Ho),ei.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Uo(t)||Go(t)}});var Jo=ro.extend({initialize:function(t,e){ro.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=D(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Ko(t,e){return new Jo(t,e)}qo.create=Vo,qo.pointsToPath=X,ho.geometryToLayer=lo,ho.coordsToLatLng=uo,ho.coordsToLatLngs=po,ho.latLngToCoords=fo,ho.latLngsToCoords=mo,ho.getFeature=_o,ho.asFeature=go,ei.mergeOptions({boxZoom:!0});var Yo=di.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Se(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ze(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),te(),ke(),this._startPoint=this._map.mouseEventToContainerPoint(t),Se(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ce("div","leaflet-zoom-box",this._container),_e(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new Z(this._point,this._startPoint),i=e.getSize();Pe(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ge(this._container,"leaflet-crosshair")),ee(),Ae(),Ze(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var e=new R(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ei.addInitHook("addHandler","boxZoom",Yo),ei.mergeOptions({doubleClickZoom:!0});var Qo=di.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),o=e.options.zoomDelta,n=t.originalEvent.shiftKey?i-o:i+o;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});ei.addInitHook("addHandler","doubleClickZoom",Qo),ei.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xo=di.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new vi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}_e(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ge(this._map._container,"leaflet-grab"),ge(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 t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=D(this._map.options.maxBounds);this._offsetLimit=N(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,o=this._draggable._newPos.x,n=(o-e+i)%t+e-i,s=(o+e+i)%t-e-i,r=Math.abs(n+i)<Math.abs(s+i)?n:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,o=!i.inertia||this._times.length<2;if(e.fire("dragend",t),o)e.fire("moveend");else{this._prunePositions(+new Date);var n=this._lastPos.subtract(this._positions[0]),s=i.easeLinearity,r=n.multiplyBy(s/((this._lastTime-this._times[0])/1e3)),a=r.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,a),l=r.multiplyBy(h/a),c=h/(i.inertiaDeceleration*s),u=l.multiplyBy(-c/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),C((function(){e.panBy(u,{duration:c,easeLinearity:s,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ei.addInitHook("addHandler","dragging",Xo),ei.mergeOptions({keyboard:!0,keyboardPanDelta:80});var $o=di.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Se(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ze(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 t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,o=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(o,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,o=this._panKeys={},n=this.keyCodes;for(e=0,i=n.left.length;e<i;e++)o[n.left[e]]=[-1*t,0];for(e=0,i=n.right.length;e<i;e++)o[n.right[e]]=[t,0];for(e=0,i=n.down.length;e<i;e++)o[n.down[e]]=[0,t];for(e=0,i=n.up.length;e<i;e++)o[n.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,o=this._zoomKeys={},n=this.keyCodes;for(e=0,i=n.zoomIn.length;e<i;e++)o[n.zoomIn[e]]=t;for(e=0,i=n.zoomOut.length;e<i;e++)o[n.zoomOut[e]]=-t},_addHooks:function(){Se(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ze(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,o=this._map;if(i in this._panKeys)o._panAnim&&o._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=B(e).multiplyBy(3)),o.panBy(e),o.options.maxBounds&&o.panInsideBounds(o.options.maxBounds));else if(i in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}Ve(t)}}});ei.addInitHook("addHandler","keyboard",$o),ei.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var tn=di.extend({addHooks:function(){Se(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ze(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Je(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var o=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n(this._performZoom,this),o),Ve(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var o=4*Math.log(2/(1+Math.exp(-Math.abs(this._delta/(4*this._map.options.wheelPxPerZoomLevel)))))/Math.LN2,n=i?Math.ceil(o/i)*i:o,s=t._limitZoom(e+(this._delta>0?n:-n))-e;this._delta=0,this._startTime=null,s&&("center"===t.options.scrollWheelZoom?t.setZoom(e+s):t.setZoomAround(this._lastMousePos,e+s))}});ei.addInitHook("addHandler","scrollWheelZoom",tn),ei.mergeOptions({tap:!0,tapTolerance:15});var en=di.extend({addHooks:function(){Se(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ze(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(He(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new z(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&_e(i,"leaflet-active"),this._holdTimeout=setTimeout(n((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Se(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ze(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ge(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new z(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});!Pt||Lt&&!ut||ei.addInitHook("addHandler","tap",en),ei.mergeOptions({touchZoom:Pt&&!st,bounceAtZoomLimits:!0});var on=di.extend({addHooks:function(){_e(this._map._container,"leaflet-touch-zoom"),Se(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ge(this._map._container,"leaflet-touch-zoom"),Ze(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(o)._divideBy(2))),this._startDist=i.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Se(document,"touchmove",this._onTouchMove,this),Se(document,"touchend",this._onTouchEnd,this),He(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),s=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(s,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&s<1||this._zoom>e.getMaxZoom()&&s>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),k(this._animRequest);var a=n(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=C(a,this,!0),He(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,k(this._animRequest),Ze(document,"touchmove",this._onTouchMove,this),Ze(document,"touchend",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))):this._zooming=!1}});ei.addInitHook("addHandler","touchZoom",on),ei.BoxZoom=Yo,ei.DoubleClickZoom=Qo,ei.Drag=Xo,ei.Keyboard=$o,ei.ScrollWheelZoom=tn,ei.Tap=en,ei.TouchZoom=on,t.version=e,t.Control=oi,t.control=ni,t.Browser=zt,t.Evented=I,t.Mixin=mi,t.Util=A,t.Class=T,t.Handler=di,t.extend=i,t.bind=n,t.stamp=r,t.setOptions=d,t.DomEvent=$e,t.DomUtil=ze,t.PosAnimation=ti,t.Draggable=vi,t.LineUtil=zi,t.PolyUtil=Bi,t.Point=z,t.point=B,t.Bounds=Z,t.bounds=N,t.Transformation=G,t.transformation=J,t.Projection=Ri,t.LatLng=j,t.latLng=F,t.LatLngBounds=R,t.latLngBounds=D,t.CRS=W,t.GeoJSON=ho,t.geoJSON=vo,t.geoJson=bo,t.Layer=Ui,t.LayerGroup=Wi,t.layerGroup=Hi,t.FeatureGroup=Vi,t.featureGroup=qi,t.ImageOverlay=wo,t.imageOverlay=xo,t.VideoOverlay=Lo,t.videoOverlay=Po,t.SVGOverlay=Mo,t.svgOverlay=Co,t.DivOverlay=ko,t.Popup=Ao,t.popup=To,t.Tooltip=Eo,t.tooltip=Oo,t.Icon=Gi,t.icon=Ji,t.DivIcon=Io,t.divIcon=zo,t.Marker=Qi,t.marker=Xi,t.TileLayer=Zo,t.tileLayer=No,t.GridLayer=So,t.gridLayer=Bo,t.SVG=qo,t.svg=Go,t.Renderer=jo,t.Canvas=Fo,t.canvas=Uo,t.Path=$i,t.CircleMarker=to,t.circleMarker=eo,t.Circle=io,t.circle=oo,t.Polyline=no,t.polyline=so,t.Polygon=ro,t.polygon=ao,t.Rectangle=Jo,t.rectangle=Ko,t.Map=ei,t.map=ii;var nn=window.L;t.noConflict=function(){return window.L=nn,this},window.L=t}(e.exports);var i,o={exports:{}},n="object"==typeof Reflect?Reflect:null,s=n&&"function"==typeof n.apply?n.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};i=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var r=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}o.exports=a,o.exports.once=function(t,e){return new Promise((function(i,o){function n(i){t.removeListener(e,s),o(i)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),i([].slice.call(arguments))}g(t,e,s,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&g(t,"error",e,i)}(t,n,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var h=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function u(t,e,i,o){var n,s,r,a;if(l(i),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),s=t._events),r=s[e]),void 0===r)r=s[e]=i,++t._eventsCount;else if("function"==typeof r?r=s[e]=o?[i,r]:[r,i]:o?r.unshift(i):r.push(i),(n=c(t))>0&&r.length>n&&!r.warned){r.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=r.length,a=h,console&&console.warn&&console.warn(a)}return t}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,i){var o={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=p.bind(o);return n.listener=i,o.wrapFn=n,n}function f(t,e,i){var o=t._events;if(void 0===o)return[];var n=o[e];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(n):_(n,n.length)}function m(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function _(t,e){for(var i=new Array(e),o=0;o<e;++o)i[o]=t[o];return i}function g(t,e,i,o){if("function"==typeof t.on)o.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(s){o.once&&t.removeEventListener(e,n),i(s)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var o="error"===t,n=this._events;if(void 0!==n)o=o&&void 0===n.error;else if(!o)return!1;if(o){var r;if(e.length>0&&(r=e[0]),r instanceof Error)throw r;var a=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw a.context=r,a}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)s(h,this,e);else{var l=h.length,c=_(h,l);for(i=0;i<l;++i)s(c[i],this,e)}return!0},a.prototype.on=a.prototype.addListener=function(t,e){return u(this,t,e,!1)},a.prototype.prependListener=function(t,e){return u(this,t,e,!0)},a.prototype.once=function(t,e){return l(e),this.on(t,d(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return l(e),this.prependListener(t,d(this,t,e)),this},a.prototype.removeListener=function(t,e){var i,o,n,s,r;if(l(e),void 0===(o=this._events))return this;if(void 0===(i=o[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(n=-1,s=i.length-1;s>=0;s--)if(i[s]===e||i[s].listener===e){r=i[s].listener,n=s;break}if(n<0)return this;0===n?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,n),1===i.length&&(o[t]=i[0]),void 0!==o.removeListener&&this.emit("removeListener",t,r||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,i,o;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var n,s=Object.keys(i);for(o=0;o<s.length;++o)"removeListener"!==(n=s[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(o=e.length-1;o>=0;o--)this.removeListener(t,e[o]);return this},a.prototype.listeners=function(t){return f(this,t,!0)},a.prototype.rawListeners=function(t){return f(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};class y extends Error{constructor(){super(),this.name="CancelError",Object.setPrototypeOf(this,y.prototype)}}class v{constructor(t={}){this.options=t,this._promises=new Map}get isLoaded(){return this._promises.size>0}remove(t){this._promises.has(t)&&(this._promises.delete(t),this._onStop())}get(t){return this._promises.get(t)}add(t,e){const i=e||t,o=this._promises.get(i);return this.options.onStart&&!this.isLoaded&&this.options.onStart(),o||(this._promises.set(i,t),t.finally((()=>{this.remove(i)})),t)}abort(){this.isLoaded&&(this._promises.forEach((t=>{t.cancel&&t.cancel()})),this._promises.clear(),this._onStop())}waitFunc(t,e=""){const i=this.get(e=e||t.name);return i||this.add(t(),e)}WaitForMe(t=""){const e=this.get.bind(this),i=this.add.bind(this);return function(o,n,s){const r=s.value;return t=t||n,s.value=function(...o){const n=e(t);if(n)return n;return i(r.apply(this,o),t)},s}}GetOrCreateDecorator(t=""){return this.WaitForMe(t)}_onStop(){this.options.onStop&&!this.isLoaded&&this.options.onStop()}}class b extends Error{constructor(){super(),this.name="TimeoutError",Object.setPrototypeOf(this,b.prototype)}}const w=(t,e,i,o)=>{try{t(i(o))}catch(n){e(n)}};let x=0;class P{constructor(t,e){this.id=x++,this._isCanceled=!1,this._isPending=!0,this._cancelHandlers=[],this._children=[],this._cancelPromise=new Promise(((t,e)=>{this._setCanceledCallback=e=>t(e||new y)}));const i=[this._cancelPromise,new Promise(((e,i)=>t((t=>{t instanceof P?this.attach(t):this._isPending=!1,e(t)}),(t=>{this._isPending=!1,i(t)}),(t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)}))))];e&&i.push(new Promise(((t,i)=>{setTimeout((()=>{if(this._isPending)try{this.cancel()}finally{i(new b)}}),e)}))),this._promise=Promise.race(i)}static createControl(t){return new v(t)}static resolve(t){return new P((e=>e(t)))}static reject(t){return new P(((e,i)=>i(t)))}static all(t){return new P(((e,i)=>{Promise.all(t).then(e).catch(i)})).catch((e=>{if(e instanceof this.CancelError)for(const i of t){"cancel"in i&&i.cancel()}throw e}))}attach(t){this._isCanceled?t.cancel():this._children.push(t)}then(t,e){const i=new P(((i,o)=>{if(this._promise){const n=t=>{e?w(i,o,e,t):o(t)};this._promise.then((e=>{this._isCanceled?n(e):t?w(i,o,t,e):i(e)}),n)}}));return i._parentPromise=this,this._children.push(i),i}catch(t){return this._isCanceled&&t&&t(new y),this.then(void 0,t)}finally(t){return this._promise?this._promise.finally(t):Promise.reject(this._isCanceled?new y:t)}cancel(){if(this._isCanceled||!this._isPending)return this;this._isCanceled=!0;const t=this._getTopParent();if(t&&t.cancel(),this._children&&this._children.forEach((t=>t.cancel())),this._isPending){if(this._cancelHandlers.length)try{for(const t of this._cancelHandlers)t()}catch(e){}this._setCanceledCallback&&this._setCanceledCallback()}return this._destroy(),this}_getTopParent(){let t=this._parentPromise,e=!!t;for(;e;)t&&t._parentPromise?(t=t._parentPromise,e=!!t):e=!1;return t}_destroy(){this._setCanceledCallback=void 0,this._cancelPromise=void 0,this._promise=void 0}}function M(t,e,i={}){const o=function(t,e=[]){for(;null!==t;t=Object.getPrototypeOf(t)){const i=Object.getOwnPropertyNames(t);for(let t=0;t<i.length;t++)-1==e.indexOf(i[t])&&e.push(i[t])}return e}(t.prototype);const n=void 0===i.replace||i.replace;e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((i=>{const s=-1!==o.indexOf(i);if(!n&&!s||n){const o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&Object.defineProperty(t.prototype,i,o)}}))}))}function C(t){return null!=t}function k(t){return"string"==typeof t?!!t:C(t)}function A(t,e,i=!1){let o=t;const n=e,s=Array.isArray(n);let r=s&&[]||{};return s&&Array.isArray(n)?i?(o=o||[],r=r.concat(o),n.forEach(((t,e)=>{void 0===r[e]?r[e]=t:"object"==typeof t?r[e]=A(o[e],t,i):-1===o.indexOf(t)&&r.push(t)}))):r=n:(o&&"object"==typeof o&&Object.keys(o).forEach((function(t){r[t]=o[t]})),Object.keys(n).forEach((function(t){r[t]="object"==typeof n[t]&&n[t]&&"object"==typeof o[t]&&"object"==typeof n[t]?A(o[t],n[t],i):n[t]}))),r}function T(t){if(!t.lngLat&&t.latLng){t.lngLat=[t.latLng.lng,t.latLng.lat]}return t}function E(t,e=10){let i;function o(...n){o.clear(),i=setTimeout((()=>{i=null,t.apply(this,n)}),e)}return o.clear=function(){i&&(clearTimeout(i),i=null)},o}P.CancelError=y,P.TimeoutError=b,P.PromiseControl=v,Object.setPrototypeOf(P.prototype,Promise.prototype);const O=6371;function I(t){return{type:"Polygon",coordinates:[z(t)]}}function z(t){const e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}const S=Math.PI/180,B=180/Math.PI;function Z(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;const i=20037508.34*t/180;let o=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return o=20037508.34*o/180,[i,o]}function N(t,e,i,o){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===i?e===o:R(t,e));return t===e}function R(t,e){const i=Object.keys(t).sort(),o=Object.keys(e).sort();if(i.length!==o.length)return!1;if(i.join("")!==o.join(""))return!1;for(let n=0;n<i.length;n++){if(!N(t[i[n]],e[o[n]],t,e))return!1}return!0}function D(t){const e={};return Object.keys(t).forEach((i=>{t[i]instanceof Array||t[i]!==Object(t[i])?void 0!==t[i]&&(e[i]=t[i]):e[i]=D(t[i])})),e}function j(t){return"[object Object]"===Object.prototype.toString.call(t)}function F(t){return t.replace(/([^:]\/)\/+/g,"$1")}function U(t){return"[object Object]"===Object.prototype.toString.call(t)}function W(t){return"function"==typeof t}const H=(t,e,i)=>{try{const o=t(e,i);if(void 0!==o)return o}catch{}};function V(t){return(e,i)=>{for(const o of e){const e=H(t,o,i);if(void 0!==e)return e}throw new Error("Received a mismatched type")}}function q(t){return(e,i)=>{const o=e.map((t=>t()));return t(o,i)}}const G={array:q((t=>{const[e,i,o]=t;let n,s,r;if("string"==typeof e&&["string","number","boolean"].includes(e)?(n=e,"number"==typeof i?(s=i,r=o):r=i):Array.isArray(e)&&(r=e),!Array.isArray(r))throw new Error("Expected an array");if(n&&!r.every((t=>typeof t===n)))throw new Error(`Expected all items in array to be of type ${n}`);if(s&&r.length!==s)throw new Error(`Expected array of length ${s}`);return r})),boolean:q(V((t=>"boolean"==typeof t?t:void 0))),literal:q((([t])=>t)),number:q(V((t=>"number"==typeof t?t:void 0))),object:q(V((t=>null===t||"object"!=typeof t||Array.isArray(t)?void 0:t))),string:q(V((t=>"string"==typeof t?t:void 0))),"to-boolean":q(V(Boolean)),"to-number":q(V(Number)),"to-string":q(V(String)),typeof:q((([t])=>function(t){if(null===t)return"null";switch(typeof t){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":if(Array.isArray(t)){let e="value";return t.every((t=>"number"==typeof t))?e="number":t.every((t=>"string"==typeof t))?e="string":t.every((t=>"boolean"==typeof t))&&(e="boolean"),`array<${e}, ${t.length}>`}return"object";default:return"undefined"}}(t)))},J={"+":q((t=>t.reduce(((t,e)=>t+e),0))),"-":q((t=>t.reduce(((t,e)=>t-e)))),"*":q((t=>t.reduce(((t,e)=>t*e),1))),"/":q((t=>t.reduce(((t,e)=>t/e)))),"%":q((t=>t[0]%t[1])),"^":q((t=>Math.pow(t[0],t[1]))),abs:q((t=>Math.abs(t[0]))),acos:q((t=>Math.acos(t[0]))),asin:q((t=>Math.asin(t[0]))),atan:q((t=>Math.atan(t[0]))),ceil:q((t=>Math.ceil(t[0]))),cos:q((t=>Math.cos(t[0]))),e:()=>Math.E,floor:q((t=>Math.floor(t[0]))),ln:q((t=>Math.log(t[0]))),ln2:()=>Math.LN2,log10:q((t=>Math.log10(t[0]))),log2:q((t=>Math.log2(t[0]))),max:q((t=>Math.max(...t))),min:q((t=>Math.min(...t))),pi:()=>Math.PI,round:q((t=>Math.round(t[0]))),sin:q((t=>Math.sin(t[0]))),sqrt:q((t=>Math.sqrt(t[0]))),tan:q((t=>Math.tan(t[0])))};const K={get:q((function([t,e],i){const o=e||i;return o&&"object"==typeof o&&t in o?o[t]:null})),length:q((([t])=>{if("string"==typeof t||Array.isArray(t))return t.length})),at:q((function([t,e]){return e[t]})),has:q((function([t,e],i){const o=e||i;return!(!o||"object"!=typeof o||!(t in o))})),in:q((function([t,e]){if("string"==typeof e)return e.includes(String(t));if(Array.isArray(e))return e.includes(t);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof e}.`)})),"index-of":q((function([t,e,i]){if("string"==typeof e)return e.indexOf(String(t),i);if(Array.isArray(e))return e.indexOf(t,i);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof e}.`)})),slice:q((function(t){const[e,i,o]=t;if("string"==typeof e)return e.slice(i,o);if(Array.isArray(e))return e.slice(i,o);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof e}.`)}))},Y={concat:q((t=>t.reduce(((t,e)=>String(t)+String(e)),""))),downcase:q((t=>String(t[0]).toLowerCase())),upcase:q((t=>String(t[0]).toUpperCase()))};const Q={"!":q((function([t]){return!t})),"!=":q((function([t,e]){return t!==e})),"<":q((function([t,e]){return t<e})),"<=":q((function([t,e]){return t<=e})),"==":q((function([t,e]){return t===e})),">":q((function([t,e]){return t>e})),">=":q((function([t,e]){return t>=e})),coalesce:t=>{for(let e=0;e<t.length;e++){const i=t[e]();if(null!=i)return i}return null},all:t=>{for(let e=0;e<t.length;e++){if(!t[e]())return!1}return!0},any:t=>{for(let e=0;e<t.length;e++){if(t[e]())return!0}return!1},case:t=>{if(t.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');if(t.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let e=0;e<t.length-1;e+=2){const i=t[e](),o=t[e+1]();if(i)return o}return(0,t[t.length-1])()},match:t=>{const[e,...i]=t,o=e(),n=i.splice(-1,i.length%2)[0];for(let s=0;s<i.length-1;s+=2){if(i[s]()===o)return i[s+1]()}return n()}},X={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function $(t){if("string"==typeof(i=t)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(i))return tt(t);if("string"==typeof(e=t)&&e in X)return function(t){return tt(X[t])}(t);if(function(t){return"string"==typeof t&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(t)}(t))return function(t){const e=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let i;if(i=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)];if(i=t.match(e))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),parseFloat(i[4])];throw new Error(`The '${t}' Is not valid rgb`)}(t);if(function(t){if("object"==typeof t&&null!==t)return"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1);return!1}(t))return function({r:t,g:e,b:i,a:o}){return[t,e,i,...void 0!==o?[o]:[]]}(t);var e,i;throw new Error(`The '${t}' cannot be converted to color`)}function tt(t){let e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error(`The '${t}' Is not valid hex`)}function et(t,e,i,o,n){if("number"==typeof i&&"number"==typeof n)return i+(t-e)/(o-e)*(n-i);try{const s=$(i),r=$(n);return function(t){return`rgb(${t.join(",")})`}(s.map(((i,n)=>Math.ceil(et(t,e,i,o,r[n])))))}catch(s){console.log(s)}throw new Error("Unsupported output type for linear interpolation.")}function it(t){if(Array.isArray(t)){const[e,...i]=t;return"string"==typeof e&&"literal"!==e&&e in ot&&i.length>0}return!1}const ot={...J,...G,...Y,...K,...Q,...{step:t=>{const[e,i,...o]=t,n=e();if("number"!=typeof n)return i();for(let s=0;s<o.length-2;s+=2){const t=o[s](),e=o[s+1](),i=o[s+2]();if(n>=t&&n<i)return e}return n>=o[o.length-2]()?o[o.length-1]():i()},interpolate:([t,e,...i])=>{if(i.length<2)throw new Error("At least two stops are required");if(i.length<2||i.length%2!=0)throw new Error("Invalid stops provided.");const o=e();if("number"!=typeof o)throw new Error("Input must be a number.");const n=t();for(let s=0;s<i.length-2;s+=2){const t=i[s](),e=i[s+1](),r=i[s+2](),a=i[s+3]();if(o>=t&&o<=r&&"linear"===n[0])return et(o,t,e,r,a)}throw new Error("Invalid interpolation type.")}}};function nt(t,e={}){const[i,...o]=t,n=ot[i];if(n)return n(o.map((t=>()=>it(t)?nt(t,e):t)),e);throw new Error(`Expression "${i}" is not supported.`)}function st(t){return e=>{const i=e.properties;return!!i&&nt(t,i)}}const rt=["iconSize","iconAnchor"];function at(t,e,i){if((e=String(e))===(t=String(t)))return!0;if(i&&e.toUpperCase()===t.toUpperCase())return!0;const o=`^${n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var n;return null!==new RegExp(o,i?"i":"").exec(t)}const ht={gt:(t,e)=>t>e,lt:(t,e)=>t<e,ge:(t,e)=>t>=e,le:(t,e)=>t<=e,eq:(t,e)=>t===e,ne:(t,e)=>t!==e,in:(t,e)=>-1!==e.indexOf(t),notin:(t,e)=>-1===e.indexOf(t),like:(t,e)=>at(t,e),ilike:(t,e)=>at(t,e,!0)};function lt(t){return 3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]}function ct(t,e){const i="string"==typeof e[0]?e[0]:"all",o=e=>{if(lt(e)){const[i,o,n]=e,s=ht[o];if(s){if(("like"===o||"ilike"===o)&&"string"==typeof i){let e="";const o=i.replace(/^%?(\w+)%?$/,((o,s)=>(e=t[s],i.replace(s,n))));return s(e,o)}return s(t[i],n)}return!1}return ct(t,e)},n=e.filter((t=>Array.isArray(t)));return"any"===i?n.some(o):n.every(o)}function ut(t){let e={};const i=[];for(const o of t)o&&(Array.isArray(o)?i.push(o):e=o);return t=>{const o=i.find((e=>function(t,e){const i={...t.properties};return!!i&&(i.$id=t.id,ct(i,e))}(t,e[0])));return o?{...e,...o[1]}:e}}function pt({paint:t,defaultPaint:e}){const i=function(t){let e=!1;const i={};for(const o in t)if(-1===rt.indexOf(o)){const n=o,s=t[n];it(s)&&(e=!0,i[n]=st(s))}if(e)return e=>{const o={};for(const t in i)o[t]=i[t](e);return{...t,...o}}}(t);if(i){const o=t=>ft({paint:i(t),defaultPaint:e});return o.paint=dt({paint:t,defaultPaint:e}),o}return dt({paint:t,defaultPaint:e})}function dt({paint:t,defaultPaint:e}){var i;let o={...e};return o={...o,...t},o.fill=null===(i=o.fill)||void 0===i||i,o.stroke=void 0!==o.stroke?o.stroke:!o.fill||!(!o.strokeColor&&!o.strokeOpacity),o}function ft({paint:t,defaultPaint:e,getPaintFunctions:i}){if(!t)throw new Error("paint is empty");let o={...e};if(W(t)){const o=o=>{const n=ft({paint:t(o),defaultPaint:e,getPaintFunctions:i});return n.type=t.type,n};return o.type=t.type,o}if(function(t){return!!Array.isArray(t)}(t))return o=>ft({paint:ut(t)(o),defaultPaint:e,getPaintFunctions:i});if("get-paint"===t.type){const n=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){const i=e[t.from];if(i)return i(t.options)}}(t,i);n&&(o=ft({paint:n,defaultPaint:e,getPaintFunctions:i}))}else{if("icon"===t.type)return t;o=pt({paint:t,defaultPaint:e})}return W(o)||("color"in o&&(o.strokeColor||(o.strokeColor=o.color),o.fillColor||(o.fillColor=o.color)),"opacity"in o&&(void 0===o.strokeOpacity&&(o.strokeOpacity=o.opacity),void 0===o.fillOpacity&&(o.fillOpacity=o.opacity))),o}function mt(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i;for(const o in e){e[o]>((void 0!==i?e[i]:0)||0)&&(i=o)}return i}const _t={polygon:"path",line:"path",point:"circle"},gt={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function yt(t){if(t.data){const e=gt[function(t){let e;e="FeatureCollection"===t.type?mt(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?mt(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t.data)],i=t.paint;i&&U(i)&&(i.type=i.type?i.type:"polygon"===e||"line"===e?"path":"html"in i||"className"in i?"icon":_t[e]),t.type=t.type||e}return t}class vt{constructor(){this.backspace=8,this.tab=9,this.enter=13,this.shift=16,this.ctrl=17,this.alt=18,this["pause/break"]=19,this.caps_lock=20,this.escape=27,this.page_up=33,this.page_down=34,this.end=35,this.home=36,this.left_arrow=37,this.up_arrow=38,this.right_arrow=39,this.down_arrow=40,this.insert=45,this.delete=46,this.left_window_key=91,this.right_window_key=92,this.select_key=93,this.numpad_0=96,this.numpad_1=97,this.numpad_2=98,this.numpad_3=99,this.numpad_4=100,this.numpad_5=101,this.numpad_6=102,this.numpad_7=103,this.numpad_8=104,this.numpad_9=105,this.multiply=106,this.add=107,this.subtract=109,this.decimal_point=110,this.divide=111,this.f1=112,this.f2=113,this.f3=114,this.f4=115,this.f5=116,this.f6=117,this.f7=118,this.f8=119,this.f9=120,this.f10=121,this.f11=122,this.f12=123,this.num_lock=144,this.scroll_lock=145,this["semi-colon"]=186,this.equal_sign=187,this[","]=188,this["-"]=189,this["."]=190,this["/"]=191,this["`"]=192,this["["]=219,this["\\"]=220,this["]"]=221,this["'"]=222}}class bt{constructor(t,e){this.webMap=t,e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event=e.event))}getValue(){return this.value}setValue(t){this.value=t}}class wt extends bt{constructor(){super(...arguments),this.name="center",this.event="moveend"}getValue(){return this.webMap.getCenter()}setValue(t){this.webMap.setCenter(t)}toString(t){const e=t.map((t=>t.toFixed(5)));return e[0]+"_"+e[1]}parse(t){return t.split("_").map(Number)}}class xt extends bt{constructor(){super(...arguments),this.name="zoom",this.event="zoomend"}getValue(){const t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0}setValue(t){this.webMap.setZoom(t)}toString(t){return String(t)}parse(t){return Number(t)}}let Lt=0;const Pt={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0};class Mt{constructor(t){this.options=Pt,this.emitter=new o.exports.EventEmitter,this.keys=Mt.keys,this.runtimeParams=[],this.getPaintFunctions=Mt.getPaintFunctions,this.mapState=[wt,xt],this.id=Lt++,this._initMapState={},this._mapState=[],this._eventsStatus={},this._mapEvents={},this.mapAdapter=t.mapAdapter,this._starterKits=t.starterKits||[],t&&(this.options=A(Pt||{},t)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}getId(){return this.id}async create(){return this.getEventStatus("create")||(await this._setInitMapState(this.mapState),await this._setupMap(),this._emitStatusEvent("create",this)),this}setRuntimeParams(t){this.runtimeParams.push(t)}destroy(){this._removeEventListeners(),function(t){for(const e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()}getState(){const t={};return this._mapState.forEach((e=>{t[e.name]=e.getValue()})),t}getRuntimeParams(){const t={};return this._mapState.forEach((e=>{for(const i of this.runtimeParams){const o=i.get(e.name);if(void 0!==o){t[e.name]=e.parse(o);break}}})),t}getContainer(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){const t=document.getElementById(this.options.target);if(t)return t}}}setCursor(t){this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)}getCursor(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();const t=this.getContainer();return t?t.style.cursor:void 0}setCenter(t){return this.mapAdapter.setCenter(t),this}getCenter(){return this.mapAdapter.getCenter()}getBounds(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()}getBoundsPolygon(){const t=this.getBounds();if(t){return{type:"Feature",properties:{},geometry:I(t)}}}setZoom(t){return this.mapAdapter.setZoom(t),this}getZoom(){const t=this.mapAdapter.getZoom();if("number"==typeof t)return t}zoomIn(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t+1)}}}zoomOut(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t-1)}}}setView(t,e){if(Array.isArray(t)){const i=t;this.mapAdapter.setView&&i&&C(e)?this.mapAdapter.setView(i,e):(i&&this.mapAdapter.setCenter(i),C(e)&&this.mapAdapter.setZoom(e))}else{this.mapAdapter.setView&&this.mapAdapter.setView(t)}}fitBounds(t,e){return t.every((t=>C(t)))&&(t[1]<-85.06&&(t[1]=-85.06),t[3]>85.06&&(t[3]=85.06),this.mapAdapter.fitBounds(t,e)),this}getEventStatus(t){const e=this._eventsStatus[t];return null!=e&&e}onLoad(t="create"){return new Promise((e=>{this.getEventStatus(t)?e(this):this.emitter.once(t,(()=>{e(this)}))}))}onMapLoad(t){return new Promise((e=>{var i;const o=()=>{const i=this.mapAdapter;t&&t(i),i&&e(i)},n=null===(i=this.mapAdapter.isLoaded)||void 0===i||i;this.mapAdapter.map&&n?o():this.mapAdapter.emitter.once("create",(()=>{o()}))}))}getLayerAdapters(){return this.mapAdapter.layerAdapters}getLayerAdapter(t){return this.mapAdapter.layerAdapters[t]}locate(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:()=>({})}}stopGetCoordFromMapClick(){this._coordFromMapClickPromise&&this._coordFromMapClickPromise.cancel()}getCoordFromMapClick(){return this._coordFromMapClickPromise?this.getCoordFromMapClick():(this._coordFromMapClickPromise=new P(((t,e,i)=>{const o=this.getCursor()||"grab";this._removeEventListeners({include:["click"]}),this.setCursor("crosshair");const n=()=>{this.setCursor(o),this._addEventsListeners({include:["click"]}),this.mapAdapter.emitter.off("click",s),this._coordFromMapClickPromise=void 0},s=e=>{n(),T(e),t(e.lngLat)};this.mapAdapter.emitter.once("click",s),i(n)})),this._coordFromMapClickPromise)}_emitStatusEvent(t,e){const i=t;this._eventsStatus[i]=!0,this.emitter.emit(i,e)}async _addLayerProviders(){}async _onLoadSync(){}async _setupMap(){if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return await this.mapAdapter.create(this.options),this._zoomToInitialExtent(),await this._addLayerProviders(),await this._onLoadSync(),this._emitStatusEvent("build-map",this.mapAdapter),this}_setTileJsonOptions(t){t.center&&(this.options.center=t.center),t.bounds&&(this.options.bounds=t.bounds),C(t.maxzoom)&&(this.options.zoom=t.maxzoom),C(t.minzoom)&&(this.options.zoom=t.minzoom),C(t.maxzoom)&&C(t.minzoom)&&(this.options.zoom=(t.maxzoom+t.minzoom)/2)}_zoomToInitialExtent(){const{center:t,zoom:e,bounds:i}=this.options;this._extent?this.fitBounds(this._extent):t&&e?this.setView(t,e):i&&this.fitBounds(i)}_setInitMapState(t){for(const e of t){const t=new e(this);this._mapState.push(t);for(const e of this.runtimeParams){const i=e.get(t.name);if(void 0!==i){const e=t.parse(i);this._initMapState[t.name]=e,Object.defineProperty(this.options,t.name,{value:e,configurable:!0,enumerable:!0});break}}}}_addEventsListeners(t){let e=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(e=e.filter((e=>t.include.includes(e)))),e.forEach((t=>{this._mapEvents[t]=e=>{if(this.runtimeParams.length){const e=this._mapState.find((e=>e.event===t));if(e){const t=e.toString(e.getValue());this.runtimeParams.forEach((i=>{i.set(e.name,t)}))}}this._eventsStatus&&this.emitter.emit(t,e)};const e=this._mapEvents[t];e&&this.mapAdapter.emitter.on(t,e)}))}_removeEventListeners(t){let e=Object.entries(this._mapEvents);t&&t.include&&(e=e.filter((e=>t.include.includes(e[0])))),e.forEach((([t,e])=>{e&&this.mapAdapter.emitter.removeListener(t,e)}))}}Mt.keys=new class{constructor(){this.keyCodeAlias=new vt,this.keys={},this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}pressed(t){const e=this.keyCodeAlias[t];return!!e&&this.keys[e]}addKeyboardEventsListener(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))}removeKeyboardEventsListener(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))}keysPressed(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)}keysReleased(t){t.stopPropagation(),this.keys[t.keyCode]=!1}windowOnFocus(){this.keys={}}};class Ct extends Mt{constructor(t){super(t),this._layersIdCounter=1,this._layersOrderCounter=1,this._baselayers=[],this._layers={},this._selectedLayers=[];const e=this.options.tileJson;e&&this.emitter.once("build-map",(()=>this.addTileJsonLayer(e)))}async fitLayer(t,e){const i=this.getLayer(t),o=i&&(i.getBounds||i.getExtent);if(o){const t=await o.call(i);t&&this.fitBounds(t,e)}}isBaseLayer(t){const e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)}getBaseLayers(){const t=[];return this._baselayers.forEach((e=>{const i=this._layers[e];i&&t.push(i)})),t}getBaseLayersIds(){return this._baselayers}getLayer(t){return"string"==typeof t?this._layers[t]:t}getLayerId(t){const e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")}getLayers(){return Object.keys(this._layers)}allLayers(){return this._layers}orderedLayers(){return Object.values(this._layers).sort(((t,e)=>t.order&&e.order?t.order-e.order:0))}findLayer(t){for(const e in this._layers){const i=this._layers[e];if(t(i))return i}}isLayerVisible(t){const e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility}async addBaseLayer(t,e){return await this.addLayer(t,{...e,baselayer:!0},void 0)}async addLayer(t,e={},i){var o,n;const s=this._layersIdCounter++,r=C(i)?i:void 0!==e.order?e.order:this.reserveOrder();let a;"string"==typeof t?a=this.getLayerAdapter(t):"function"==typeof t?a=t:"then"in t&&(a=await t);const h=e;this._updateGeoJsonOptions(h);const l=null===(o=(e={id:String(s),order:r,...e}).visibility)||void 0===o||o;if(e.visibility=!1,e.baselayer&&(e.order=0),this.options.onBeforeAddLayer){const t=this.options.onBeforeAddLayer({options:e,adapter:a});t&&(t.options&&(e=t.options),t.adapter&&(a=t.adapter))}if(void 0!==a){const t=new a(this.mapAdapter.map,e);let i;t.options={...e,...t.options},t.options.baselayer&&(e.baselayer=!0,e.order=0,t.options.order=0),t.options.id&&(i=String(t.options.id),this._layers[i]=t),this._emitLayerEvent("layer:preadd",i||"",t),await this.onMapLoad(),t.map=this.mapAdapter.map;const o=await t.addLayer(t.options);if(t.layer=o,t.id=t.options.id||String(s),t.options.id=t.id,e.baselayer&&(t.options.order=0),t.order=null!==(n=t.options.order)&&void 0!==n?n:r,i&&delete this._layers[i],i=String(t.id),this._layers[i])throw Error(`layer with id '${i}' already exist`);i&&(this._layers[i]=t,h.filter&&this.filterLayer(t,h.filter),e.baselayer&&this._baselayers.push(i),l&&await this.showLayer(i));const c=e.opacity;void 0!==c&&c<=1&&this.setLayerOpacity(t,c);const u=o&&(t.getBounds||t.getExtent);if(e.fit&&u){const e=await u.call(t);e&&await this.fitBounds(e)}return e.onAdded&&e.onAdded(t),this._emitLayerEvent("layer:add",i,t),t}return Promise.reject("No adapter")}async addLayerFromAsyncAdapter(t,e,i){const o=i||void 0!==e.order?e.order:this.reserveOrder(),n=t(),s=await n;return s?this.addLayer(s,e,o):Promise.reject("No adapter")}removeLayers(t){for(const e in this._layers){let i=!0;t&&(i=t(e,this._layers[e])),i&&(this.removeLayer(e),delete this._layers[e])}}reserveOrder(){return this._layersOrderCounter++}removeOverlays(){this.removeLayers(((t,e)=>!(e&&e.options&&e.options.baselayer)))}removeLayer(t){const e=this.getLayer(t),i=e&&this.getLayerId(e);if(e&&i){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){const t=this._baselayers.indexOf(i);t&&this._baselayers.splice(t,1)}delete this._layers[i],this.emitter.emit("layer:remove",e)}}addGeoJsonLayer(t={},e){return(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=yt(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)}addFeatureLayer(t={}){return this.addGeoJsonLayer(t)}addTileLayer(t,e={}){return this.addLayer("TILE",{...e,url:t})}addImageLayer(t,e){let i;return"string"==typeof t?i=t:(i=t.url,e=t),this.addLayer("IMAGE",{...e,url:i})}showLayer(t,e={}){return this.toggleLayer(t,!0,e)}hideLayer(t,e={}){return this.toggleLayer(t,!1,e)}toggleLayer(t,e,i={}){const o=this.getLayer(t),n=void 0!==e?e:!(o&&o.options.visibility),s=void 0!==i.silent&&i.silent,r=async t=>{const e=String(t.id),i=n?"layer:show":"layer:hide";if(s||(this._emitLayerEvent(n?"layer:preshow":"layer:prehide",e,t),this._emitLayerEvent("layer:pretoggle",e,t)),n&&this.mapAdapter){const e=t.options.baselayer?0:t.options.order;if(t.options.baselayer&&this._baselayers.length){const e=this._baselayers.filter((e=>e!==t.id&&this.isLayerVisible(e)));for(const t of e)await this.hideLayer(t)}t.showLayer?await t.showLayer.call(t,t.layer):void 0!==t.layer&&await this.mapAdapter.showLayer(t.layer),void 0!==e&&this.mapAdapter.setLayerOrder(t.layer,e,this._layers)}else t.hideLayer?await t.hideLayer.call(t,t.layer):void 0!==t.layer&&await this.mapAdapter.hideLayer(t.layer);t.options.visibility=n,s||(this._emitLayerEvent(i,e,t),this._emitLayerEvent("layer:toggle",e,t))};return o?this.onMapLoad().then((()=>r(o))):Promise.resolve()}updateLayer(t){const e=this.getLayer(t);if(e){if(e.updateLayer)return Promise.resolve(e.updateLayer());if(this.isLayerVisible(e))return this.hideLayer(e,{silent:!0}).then((()=>this.showLayer(e,{silent:!0})))}return Promise.resolve()}setLayerOpacity(t,e){const i=this.getLayer(t);i&&(i.setOpacity?i.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(i.layer,e))}isLayerLabelVisible(t){var e;const i=this.getLayer(t);return i.isLabelVisible?i.isLabelVisible():null===(e=i.options.labelVisibility)||void 0===e||e}showLayerLabel(t){this.toggleLayerLabel(t,!0)}hideLayerLabel(t){this.toggleLayerLabel(t,!1)}toggleLayerLabel(t,e){const i=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),i&&(e?i.showLabel&&(i.options.labelVisibility=!0,i.showLabel()):i.hideLabel&&(i.options.labelVisibility=!1,i.hideLabel()),i.id&&this._emitLayerEvent("layer:label:toggle",i.id,i)),e}selectLayer(t,e){const i=this.getLayer(t);if(i){i&&i.select&&i.select(e);const t=this.getLayerId(i);t&&this._selectedLayers.push(t)}}unSelectLayer(t,e){const i=this.getLayer(t);if(i){const t=i&&i;t.unselect&&t.unselect(e);const o=this.getLayerId(i);if(o){const t=this._selectedLayers.indexOf(o);-1!==t&&this._selectedLayers.splice(t,1)}}}unSelectLayers(){const t=Object.values(this.allLayers());let e;for(e of t)e.unselect&&e.unselect()}filterLayer(t,e){const i=this.getLayer(t);return i.filter?i.filter(e):[]}propertiesFilter(t,e,i){const o=this.getLayer(t);if(o){const t=o;if(t.propertiesFilter)return t.propertiesFilter(e,i);t.filter&&this.filterLayer(t,(t=>!t.feature||!t.feature.properties||ct(t.feature.properties,e)))}return Promise.resolve()}removeLayerFilter(t){const e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter((()=>!0))}setLayerData(t,e){const i=this.getLayer(t);if(i){if(i.setData)return i.setData(e);if(i.clearLayer&&i.addData)return i.clearLayer(),i.addData(e)}return Promise.resolve()}addLayerData(t,e){const i=this.getLayer(t);i.addData&&i.addData(e)}clearLayerData(t,e){const i=this.getLayer(t);i&&i.clearLayer&&i.clearLayer(e)}setLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.setPaint&&i.setPaint(e)}setLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.setSelectedPaint&&i.setSelectedPaint(e)}updateLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.updatePaint&&i.updatePaint(e)}updateLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.updateSelectedPaint&&i.updateSelectedPaint(e)}getAttributions(t){const e=[];for(const i in this._layers){const o=this._layers[i];let n=!(void 0===t.onlyVisible||t.onlyVisible)||o.options.visibility;if(n&&t.onlyBaselayer&&(n=this._baselayers.includes(i)),n){const t=o.options&&o.options.attribution;t&&e.push(t)}}return e}getActiveBaseLayer(){const t=this.getBaseLayers().find((t=>this.isLayerVisible(t)));if(t)return this.getLayer(t)}addTileJsonLayer(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution})}_emitLayerEvent(t,e,i){const o=String(t);if(C(e)&&o.startsWith("layer:")){const t=o.replace("layer:","layer-"+e+":");this.emitter.emit(t,i)}this.emitter.emit(t,i)}async _onLayerClick(t){return this._emitLayerEvent("layer:click",t.layer.id||"",t),Promise.resolve(t)}async _onLayerSelect(t){return this._emitLayerEvent("layer:select",t.layer.id||"",t),Promise.resolve(t)}_updateGeoJsonOptions(t){const{onSelect:e,onLayerSelect:i,onClick:o,onLayerClick:n,onMouseOut:s,onMouseOver:r}=t,a=o||n;t.onClick=t=>(a&&a(t),this._onLayerClick(t)),t.onMouseOut=t=>{const e=t.layer.id;s&&s(t),C(e)&&this._emitLayerEvent("layer:mouseout",e,t)},t.onMouseOver=t=>{const e=t.layer.id;r&&r(t),C(e)&&this._emitLayerEvent("layer:mouseover",e,t)};const h=e||i;t.onSelect=t=>(h&&h(t),this._onLayerSelect(t)),t.nativePaint||(this.options.paint&&(t.paint=ft({paint:t.paint||{},defaultPaint:this.options.paint,getPaintFunctions:this.getPaintFunctions})),t.selectedPaint&&this.options.selectedPaint&&(t.selectedPaint=ft({paint:t.selectedPaint,defaultPaint:this.options.selectedPaint,getPaintFunctions:this.getPaintFunctions})))}}class kt extends Ct{constructor(){super(...arguments),this._loadControlQueue={"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[]},this._isControlLoading={"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1}}async addControl(t,e,i){let o;if(e=null!=e?e:"top-left",o="string"==typeof t?this.getControl(t,i):t,o)return new Promise((t=>{this._setControlQueue(e,(async()=>{const i=await o,n=this.mapAdapter.addControl(i,e);t(n)}))}))}async createControl(t,e){if(await this.onLoad("build-map"),this.mapAdapter.createControl)return this.mapAdapter.createControl(t,e)}async createButtonControl(t){if(await this.onLoad("build-map"),this.mapAdapter.createButtonControl)return this.mapAdapter.createButtonControl(t)}async createToggleControl(t){return await this.onLoad("build-map"),this.mapAdapter.createToggleControl?this.mapAdapter.createToggleControl(t):this.mapAdapter.createButtonControl?function(t,e){const i=document.createElement("div");let o=!1;e.getStatus?o=e.getStatus():e.status&&(o=e.status);const n=e.title||"",s=e.html;function r(){n&&(i.title="string"==typeof n?n:o?n.on:n.off,i.setAttribute("aria-label",i.title))}function a(t){t instanceof HTMLElement?(i.innerHTML="",i.appendChild(t)):"string"==typeof t&&(i.innerHTML=t)}function h(){s&&("string"==typeof s||s instanceof HTMLElement?a(s):a(o?s.on:s.off),i.setAttribute("aria-label",i.title))}function l(t,e){t.split(" ").forEach((t=>{e?i.classList.add(t):i.classList.remove(t)}))}function c(){e.addClassOn&&l(e.addClassOn,o),e.addClassOff&&l(e.addClassOff,!o)}r(),h(),e.addClass&&l(e.addClass,!0),c();const u=t=>{void 0!==t&&(o=t),h(),r(),c()},p=t=>{if(o=void 0!==t?t:!o,e.onClick){const t=e.onClick(o);Promise.resolve(t).then((()=>u())).catch((()=>o=!o))}else u()},d=t({html:i,onClick:p});return d.onClick=p,d.changeStatus=u,d}(this.mapAdapter.createButtonControl,t):void 0}removeControl(t){"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then((t=>{this.mapAdapter.removeControl(t)}))}getControl(t,e){const i=this.mapAdapter.controlAdapters[t];if(i)return new i(e);{const i=kt.controls[t];if(i)return i(this,e)}}getControlContainer(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()}_setControlQueue(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)}async _applyControls(t){if(this._loadControlQueue[t].length){this._isControlLoading[t]=!0;const e=this._loadControlQueue[t][0];await e(),this._loadControlQueue[t].splice(0,1),this._applyControls(t)}else this._isControlLoading[t]=!1}}kt.controls={CONTROL:(t,e)=>t.createControl(e.control,e.options),BUTTON:(t,e)=>t.createButtonControl(e),TOGGLE:(t,e)=>t.createToggleControl(e)};const At={};class Tt extends kt{constructor(t){super(t),this._addControls(),At[this.id]=this}static get(t){return function(t){return At[t]}(t)}async _addLayerProviders(){for await(const t of this._starterKits)if(t.getLayerAdapters){const e=await t.getLayerAdapters.call(t);if(e)for await(const t of e){const e=await t.createAdapter(this);e&&(this.mapAdapter.layerAdapters[t.name]=e)}}}async _onLoadSync(){for await(const e of this._starterKits)if(e.onLoadSync)try{await e.onLoadSync.call(e,this)}catch(t){console.error(t)}}_addControls(){this.options.controls&&this.options.controls.forEach((t=>{let e=t,i={};"string"==typeof t&&this.options.controlsOptions&&this.options.controlsOptions[t]&&(i=this.options.controlsOptions[t],void 0!==i.control&&(e=i.control));const{position:o,...n}=i;this.addControl(e,o||"top-left",n)})),this._emitStatusEvent("controls:create")}}class Et{constructor(t={}){var e;this.cache=[];const i=null!==(e=t.namespace)&&void 0!==e?e:"default";return Et.instance[i]?Et.instance[i]:(Et.instance[i]=this,this)}clean(){this.cache.length=0}all(){return this.cache}addFull(t,e,i){return this.add(t,e,i,!0)}add(t,e,i,o){const n=this._find(t,i);if(n)return n.value;{let n;n=e instanceof Function?e():e;const s=i&&JSON.parse(JSON.stringify(D(i))),r={key:t,value:n,props:s,options:s};return o&&!k(n)?n:(this.cache.push(r),n instanceof Promise?(n.catch((e=>{throw this.delete(t,i),e})),o&&n.then((e=>(k(e)||this.delete(t,i),e))),n):n)}}match(t,e){const i=this._find(t,e);if(i)return i.value}matchAll(t,e){return t?this.cache.filter((i=>this._filter(i,t,e))).map((t=>t.value)):this.cache.map((t=>t.value))}delete(t,e){let i=[];"string"==typeof t?i=this.cache.filter((i=>this._filter(i,t,e))):i.push(t);for(const o of i){const t=this.cache.indexOf(o);this.cache.splice(t,1)}}_find(t,e){return this.cache.find((i=>this._filter(i,t,e)))}_filter(t,e,i){if(t.key===e){if(i){return R(t.props||t.options||{},D(i))}return!0}return!1}}Et.instance={};class Ot extends Error{constructor(t){super(),this.name="NetworkError",Object.setPrototypeOf(this,Ot.prototype),this.message=`Unable to request ${t}.\n Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`}}class It extends Error{constructor(t){super(),this.name="NgwError",Object.assign(this,t),Object.setPrototypeOf(this,It.prototype)}}function zt(t){return"[object Object]"===Object.prototype.toString.call(t)}let St;St=(t,e,i={},o,n)=>{i.method=i.method||"GET";const s=new XMLHttpRequest;s.open(i.method||"GET",t,!0),"blob"===i.responseType&&(s.responseType=i.responseType);const r=()=>{try{return JSON.parse(s.responseText)}catch(t){return s.responseText}};s.onload=()=>{-1!==[401,403,404,422,500].indexOf(s.status)&&o(new It(r())),((t=!1)=>{const n=t?o:e;"blob"===i.responseType?n(s.response):s.responseText?n(r()):o({message:""})})()},s.onerror=e=>{o(0===s.status?new Ot(t):e)},s.upload.onprogress=function(t){if(t.lengthComputable){i.onProgress&&i.onProgress(t.loaded/t.total*100,t)}};const a=i.headers;if(a)for(const l in a){const t=a[l];"string"==typeof t&&s.setRequestHeader(l,t)}let h;if(void 0!==i.withCredentials&&(s.withCredentials=i.withCredentials),i.file){if(h=new FormData,h.append("file",i.file),i.data)for(const l in i.data)h.append(l,h[l])}else h=i.data?"string"==typeof i.data?i.data:JSON.stringify(i.data):null;n&&n((()=>{s.abort()})),s.send(h)};const Bt=/\{ *([\w_-]+) *\}/g;function Zt(t,e){return t.replace(Bt,((t,i)=>{let o=e[i];if(void 0===o)throw new Error("No value provided for letiable "+t);return"function"==typeof o&&(o=o(e)),o}))}class Nt extends It{constructor(t){super(t),this.name="ResourceNotFoundError",this.exception="nextgisweb.resource.exception.ResourceNotFound",Object.setPrototypeOf(this,Nt.prototype)}}class Rt extends It{constructor(t){super(t),this.name="InsufficientPermissionsError",this.exception="nextgisweb.core.exception.InsufficientPermissions",Object.setPrototypeOf(this,Rt.prototype)}}const Dt=[];function jt(t){Dt.push(t)}const Ft=["description"];function Ut(t,e=""){e=e?e+"__":"";const i={};for(const[o,n]of Object.entries(t))if(-1===Ft.indexOf(o))if(zt(n))if("owner_user"===o){const t=Ut(n,o);Object.assign(i,t)}else"parent"===o&&"id"in n&&(i.parent_id=n.id);else C(n)&&(i[e+o]=n);return i}class Wt{constructor(t){this.connector=t,this.cache=new Et}getOne(t,e){const i=new Et,o={},n={...e,cache:!1};"string"==typeof t?o.keyname=t:"number"==typeof t?o.id=t:zt(t)&&(void 0!==t.id?o.id=t.id:t.keyname&&(o.keyname=t.keyname));return i.addFull("resource",(()=>"string"==typeof t?this._fetchResourceBy({keyname:t},n):"number"==typeof t?this._fetchResourceById(t,n):zt(t)?this._fetchResourceBy(t,n):P.resolve(void 0)),o)}getOneOrFail(t,e){return this.getOne(t,e).then((t=>{if(t)return t;throw new Nt}))}getId(t,e){return"number"==typeof t?P.resolve(t):"string"==typeof t||zt(t)?this.getOne(t,e).then((t=>{if(t)return t.resource.id})):P.resolve(void 0)}getIdOrFail(t,e){return this.getId(t,e).then((t=>{if(void 0===t)throw new Error;return t}))}getMany(t,e){return this._resourceCacheFilter(t).then((i=>{if(!i.length){const i={};return t.keyname?i.keyname=t.keyname:Object.assign(i,Ut(t)),this.connector.get("resource.search",e,{serialization:"full",...i}).then((t=>{if(t)for(const e of t)this.cache.add("resource.item",P.resolve(e),{id:e.resource.id});return t}))}return i}))}getParent(t,e){return this.getOne(t,e).then((t=>t?this.getOne(t.resource.parent.id,e):P.resolve(void 0)))}getChildrenOf(t,e){return this.getIdOrFail(t).then((t=>this._getChildrenOf(t,e)))}update(t,e){return this.getId(t).then((t=>{if(void 0!==t)return this.connector.put("resource.item",{data:e},{id:t})}))}delete(t){return this.getId(t).then((t=>{if(void 0!==t)return this.connector.delete("resource.item",null,{id:t}).then((()=>{this._cleanResourceItemCache(t)}))}))}_getChildrenOf(t,e,i=[]){return this.connector.get("resource.collection",{cache:!0,...e},{parent:t}).then((t=>{const o=[];for(const n of t)this.cache.add("resource.item",P.resolve(n),{id:n.resource.id}),i.push(n),(null==e?void 0:e.recursive)&&n.resource.children&&o.push(this._getChildrenOf(n.resource.id,e,i));return o.length?P.all(o).then((()=>i)):i}))}async _cleanResourceItemCache(t){const e=this.cache.all(),i=[];for(const o of e){const e=o.options&&o.options.id;if(["resource.item","resource"].includes(o.key)&&void 0!==e)if("number"==typeof e)e===t&&i.push(o);else{await this.getId(e)===t&&i.push(o)}}for(const o of i)this.cache.delete(o)}_fetchResourceById(t,e){return this.cache.add("resource.item",(()=>this.connector.get("resource.item",e,{id:t})),{id:t}).catch((t=>{if(!(t instanceof Nt))throw t}))}_fetchResourceBy(t,e){return this.getMany(t,e).then((t=>t[0]))}_resourceCacheFilter(t){return P.all(this.cache.matchAll("resource.item")).then((e=>(e.filter((e=>{if(e)return t.keyname&&e.resource.keyname?t.keyname===e.resource.keyname:C(t.id)&&C(e.resource.id)?t.id===e.resource.id:R(t,e.resource)})),[])))}}let Ht=0;class Vt{constructor(t){this.options=t,this.id=Ht++,this.emitter=new o.exports.EventEmitter,this.routeStr="/api/component/pyramid/route",this.activeRequests=[];const e=function(t){return Dt.find((e=>{if(e.options.baseUrl===t.baseUrl){if(!t.auth)return!0;if(e.options.auth)return R(e.options.auth,t.auth)}}))}(t);if(e)return e;this.options.route&&(this.routeStr=this.options.route),this.options.requestTransform&&(this.requestTransform=this.options.requestTransform),this.resources=new Wt(this),jt(this)}static create(t){return new this(t)}setRequestTransform(t){this.requestTransform=t}setNgw(t){this.logout(),this.options.baseUrl=t,jt(this)}connect(){const t=new Et,e=this.options.auth;return t.add("route",(()=>new P(((t,i)=>{const o=()=>this.makeQuery(this.routeStr,{},{}).then((e=>{t(e)})).catch((t=>{i(t)}));if(e){const{login:t,password:n}=e;if(t&&n)return this._login({login:t,password:n}).then((()=>o())).catch((t=>i(t)))}return o()}))),{id:this.id,auth:e,baseUrl:this.options.baseUrl})}login(t,e){return this.logout(),jt(this),this._login(t,e)}logout(){this.abort(),function(t){const e=Dt.indexOf(t);-1!==e&&Dt.splice(e,1)}(this),this.options.auth=void 0,this.user=void 0,this.emitter.emit("logout"),this.resources.cache.clean()}getUserInfo(t,e){if(this.user&&this.user.id)return P.resolve(this.user);t&&(this.options.auth=t);const i={headers:this.getAuthorizationHeaders(t),...e};return this.makeQuery("/api/component/auth/current_user",{},i)}getAuthorizationHeaders(t){const e=this.makeClientId(t);if(e)return{Authorization:"Basic "+e}}makeClientId(t){if(t=t||this.options.auth){const{login:e,password:i}=t,o=unescape(encodeURIComponent(`${e}:${i}`));return window.btoa(o)}}abort(){for(const t of this.activeRequests)t.cancel();this.activeRequests=[]}getActiveApiRequests(){return[...this.activeRequests]}apiRequest(t,e={},i={}){var o,n;const{method:s,headers:r,withCredentials:a,responseType:h}=i,l=D(e=null!==(o=i.params)&&void 0!==o?o:e),c=()=>function(t){const e=t.params;return new P(((i,o)=>{t.connector.connect().then((n=>{let s=n&&n[t.name];if(s){s=[...s];let n=s.shift();if(s.length){const t={};for(let i=0;i<s.length;i++){const o=s[i];if(t[i]="{"+o+"}",void 0===e[o])throw new Error("`"+o+"` url api argument is not specified")}n&&(n=Zt(n,t))}if(e){const t=[],i=e.paramList;Array.isArray(i)&&(delete e.paramList,i.forEach((e=>{t.push(`${e[0]}=${e[1]}`)})));for(const o in e)-1===s.indexOf(o)&&t.push(`${o}=${e[o]}`);t.length&&(n=n+"?"+t.join("&"))}n?i(t.connector.makeQuery(n,e,t.requestOptions)):o(new Error("request url is not set"))}else i(void 0)})).catch((t=>{o(t)}))}))}({name:t,params:l,requestOptions:i,connector:this});if(i.cache&&"GET"===s){return(new Et).add(t,c,{params:l,...D({headers:r,withCredentials:a,responseType:h,baseUrl:this.options.baseUrl,userId:null===(n=this.user)||void 0===n?void 0:n.id})})}return c()}post(t,e,i){return(e=e||{}).method="POST",this.apiRequest(t,i,e)}get(t,e,i){return(e=e||{}).method="GET",this.apiRequest(t,i,e)}patch(t,e,i){return(e=e||{}).method="PATCH",this.apiRequest(t,i,e)}put(t,e,i){return(e=e||{}).method="PUT",this.apiRequest(t,i,e)}delete(t,e,i){return(e=e||{}).method="DELETE",this.apiRequest(t,i,e)}makeQuery(t,e,i={}){if(t=(this.options.baseUrl?this.options.baseUrl:"")+t)return e&&(t=Zt(t,e)),t=encodeURI(F(t)),this._loadData(t,i);throw new Error("Empty `url` not allowed")}getResource(t,e){return this.resources.getOne(t,e)}getResourceOrFail(t,e){return this.resources.getOneOrFail(t,e)}getResourceBy(t){return this.resources.getOne(t)}getResourceByKeyname(t){return this.resources.getOne(t)}getResourceById(t){return this.resources.getOne(t)}getResourceId(t,e){return this.resources.getId(t,e)}getResourceIdOrFail(t,e){return this.resources.getIdOrFail(t,e)}getResourcesBy(t,e){return this.resources.getMany(t,e)}getResourceParent(t,e){return this.resources.getParent(t,e)}getResourceChildren(t,e){return this.resources.getChildrenOf(t,e)}updateResource(t,e){return this.resources.update(t,e)}deleteResource(t){return this.resources.delete(t)}_loadData(t,e){e.responseType=e.responseType||"json";const i=new P(((i,o,n)=>{if(this.user&&((e=e||{}).headers={...this.getAuthorizationHeaders(),...e.headers}),this.requestTransform){const[i,o]=this.requestTransform(t,e);t=i,e=o}St(t,i,e,o,n)})).then((t=>(this._cleanActiveRequests(i),t))).catch((t=>{if(this._cleanActiveRequests(i),t instanceof P.CancelError);else{const e=this._handleHttpError(t);if(e)throw e}}));return e.signal&&"function"==typeof e.signal.addEventListener&&e.signal.addEventListener("abort",(()=>{i.cancel(),this._cleanActiveRequests(i)})),this.activeRequests.push(i),i}_login(t,e){return this.getUserInfo(t,e).then((t=>(this.user=t,this.emitter.emit("login",t),t))).catch((t=>{throw this.emitter.emit("login:error",t),t}))}_cleanActiveRequests(t){const e=this.activeRequests.indexOf(t);-1!==e&&this.activeRequests.splice(e,1)}_handleHttpError(t){if(t&&t instanceof It){if("nextgisweb.resource.exception.ResourceNotFound"===t.exception)throw new Nt(t);if("nextgisweb.core.exception.InsufficientPermissions"===t.exception)throw new Rt(t)}return t}}function qt(t){const e=t.extent_bottom,i=t.extent_left,o=t.extent_top,n=t.extent_right;if(e&&i&&o&&n){const t=[i,e,n,o];return t[3]>82&&(t[3]=82),t[1]<-82&&(t[1]=-82),t}}function Gt({resourceId:t,connector:e,cache:i=!0}){return e.get("layer.extent",{cache:i},{id:t}).then((t=>{if(t){const{maxLat:e,maxLon:i,minLat:o,minLon:n}=t.extent;return[n,o,i,e]}}))}function Jt(t){return t.connector.getResource(t.resourceId).then((e=>{if(e)return Kt(e,t.connector,t)}))}function Kt(t,e,i){if(t.webmap)return P.resolve(qt(t.webmap));{const o=t.resource;return o.cls&&-1!==o.cls.indexOf("style")?e.getResource(o.parent.id).then((t=>{if(t)return Gt({...i,resourceId:t.resource.id,connector:e})})):Gt({...i,resourceId:o.id,connector:e})}}Vt.errors={NgwError:It,ResourceNotFoundError:Nt};class Yt{async getExtent(){return this.getBounds()}async getBounds(t){return this._extent?this._extent:this.item?(this._extent=await Kt(this.item,this.connector,t),this._extent):void 0}}const Qt=["fields","intersects","limit","orderBy","strategy"];function Xt(t){const e={};return Qt.forEach((i=>{const o=t[i];void 0!==o&&(e[i]=o)})),e}async function $t(t,e){const i=t.resource,o=i;let{keyname:n,resourceId:s}=t;if(i&&("string"==typeof i?n=i:s="number"==typeof i?i:o.resource&&void 0!==o.resource&&"resource"in o?i.resource.id:await $t(i,e)),!s&&n){const t=await e.getResource(n);t&&(s=t.resource.id)}return s}const te={srs:4326,geom_format:"geojson"};function ee(t){return{geometry:t.geom,id:t.id,type:"Feature",properties:t.fields}}function ie(t,e){const{extensions:i,geom:o,fields:n,srs:s,ilike:r,like:a}=e;let h=i?i.join(","):"";"*"!==h&&(t.extensions=h),void 0!==n&&(t.fields=Array.isArray(n)?n.join(","):""),void 0!==o&&(t.geom=o?"yes":"no",o||(delete t.srs,delete t.geom_format)),C(r)?t.ilike=r:C(a)&&(t.like=a),C(s)&&(t.srs=s)}function oe(t){const e=se(t);return P.all(e).then((e=>{const i=[],o=[];for(const t of e)for(const e of t)i.includes(e.id)||(o.push(e),i.push(e.id));return t.offset||t.limit?o.splice(void 0!==t.offset?t.offset:0,void 0!==t.limit?t.limit:o.length):o}))}function ne(t){const[e,i,o]=t;let n="",s="";return[`${"id"!==e?"fld_":""}${String(e).trim().replace(/^(%?)(.+?)(%?)$/,((t,e,i,o)=>(n=e,s=o,i)))}__${i}`,n+o+s]}function se(t,e=[],i=[]){const{filters:o}=t,n="string"==typeof o[0]?o[0]:"all",s=o.filter((t=>Array.isArray(t)));if("any"===n)for(const r of s)lt(r)?e.push(ae({...t,paramList:[...i,ne(r)]})):se({...t,filters:r},e,[...i]);else if("all"===n){const o=[],n=[];for(const t of s)lt(t)?o.push(ne(t)):n.push(t);if(n.length)for(const s of n)se({...t,filters:s},e,[...i,...o]);else e.push(ae({...t,paramList:[...i,...o]}))}return e}function re(t){return`POLYGON((${t.map((([t,e])=>{const[i,o]=Z(t,e).map((t=>function(t,e){const i=e?Number("1e+"+e):1;return Math.round((t+Number.EPSILON)*i)/i}(t)));return i+" "+o})).join(", ")}))`}function ae(t){const e={...te},{limit:i,cache:o,signal:n,offset:s,orderBy:r,paramList:a,connector:h,geomFormat:l,intersects:c,resourceId:u}=t;if(i?i!==Number.POSITIVE_INFINITY&&(e.limit=i):e.limit=7e3,s&&(e.offset=s),l&&(e.geom_format=l),ie(e,t),r&&(e.order_by=r.join(",")),Array.isArray(c)){const t=function(t){return Array.isArray(t)&&4===t.length&&t.every((t=>"number"==typeof t))}(c)?z(c):c;e.intersects=re(t)}else"string"==typeof c&&(e.intersects=c);a&&(e.paramList=a);const p={id:u,...e};return h.get("feature_layer.feature.collection",{cache:o,signal:n},p)}function he(t){let e;for(e in t){const i=t[e];if(j(i)){const o=i;if(C(o.year)&&C(o.month)&&C(o.day)){const i=[o.year,o.month-1,o.day];"hour"in o&&[o.hour,o.minute,o.second].forEach((t=>{i.push(t)})),t[e]=new Date(...i).toISOString()}}else"id"===e&&"string"==typeof i&&(t[e]=i.split(",").map(Number))}return t}function le(t){const e=t.filters;return e?oe({...t,filters:e}).then((i=>{var o;return(null!==(o=t.clientFilterValidate)&&void 0!==o?o:ce(e))&&(i=i.filter((t=>ct(he({...t.fields,id:t.id}),e)))),i})):ae(t)}function ce(t){if("any"===t[0])return!0;for(let e=1;e<t.length;e++){const i=t[e];if("[object Array]"===Object.prototype.toString.call(i)){if(ce(i))return!0}}return!1}function ue(t){return function(t){return le(t).then((t=>{const e=[];return t.forEach((t=>{e.push(ee(t))})),e}))}(t).then((t=>({type:"FeatureCollection",features:t})))}async function pe(t){var e,i;const{item:n,webMap:s,Adapter:r,connector:a,layerOptions:h,addLayerOptionsPriority:l}=t,c=null==l||l,u=h,p=r||s.mapAdapter.layerAdapters.GEOJSON,d=[];let f,m,_=!1;const g=await $t(u,a);(null===(i=null===(e=u.adapterOptions)||void 0===e?void 0:e.popupOptions)||void 0===i?void 0:i.fromProperties)&&(u.adapterOptions.popupOptions.createPopupContent=({feature:t})=>t&&function(t,e){{const i=document.createElement("div");if(e&&e.feature_layer)e.feature_layer.fields.forEach((e=>{if(e.grid_visibility){const o=t.properties&&t.properties[e.keyname];if(o){const t=document.createElement("div");i.appendChild(t),t.innerHTML=`<span>${e.display_name}</span>: ${o}<span></span>`}}}));else if(t.properties)for(const e in t.properties){const o=document.createElement("div");i.appendChild(o),o.innerHTML=`<span>${e}</span>: ${t.properties[e]}<span></span>`}return i}}(t,n));const y=async(t,e)=>(b(),f={filters:t,options:e},m=ue({resourceId:g,filters:t,connector:a,cache:!0,...e}),await m);let v=!1;const b=()=>{m&&(m.cancel(),m=void 0)};return class extends p{constructor(){super(...arguments),this.emitter=new o.exports.EventEmitter}async addLayer(t){let e=!t.data;const i=void 0===t.waitFullLoad||t.waitFullLoad;void 0!==u.id&&(t.id=u.id),n&&n.vector_layer&&(t.type=Ue[n.vector_layer.geometry_type]),u.adapterOptions&&(t=c?{...u.adapterOptions,...t}:{...t,...u.adapterOptions}),t.data&&0===Object.keys(t.data).length&&(t.data=void 0,e=!1);const o=t.strategy||void 0;this.options.strategy=o;const s=super.addLayer(t);let r;return f={filters:t.propertiesFilter,options:Xt(t)},e&&(r=this.updateLayer()),i&&r&&await r,o&&o.startsWith("BBOX")&&!_&&this._addBboxEventListener(),s}getExtent(){return this.getBounds()}async getBounds(){const t=this.getLayers&&this.getLayers().length,e=this.options.strategy;return(null==e?void 0:e.startsWith("BBOX"))||t?Jt({connector:a,resourceId:n.resource.id}):super.getBounds?super.getBounds():void 0}beforeRemove(){v=!0,this._removeMoveEventListener(),this._removeBboxEventListener(),this.__disableMapMoveListener=void 0,this.__enableMapMoveListener=void 0,this.__onMapMove=void 0,this.__onMapMoveStart=void 0,b()}getCount(){return function({connector:t,resourceId:e,cache:i=!0}){return t.get("feature_layer.feature.count",{cache:i},{id:e}).then((t=>t.total_count))}({connector:a,resourceId:g,cache:!0})}async updateLayer(t){var e;if(t=t||f||{},null===(e=this.options.strategy)||void 0===e?void 0:e.startsWith("BBOX")){await s.onLoad("create"),t.options=t.options||{},t.options.intersects=s.getBounds();const{minZoom:e,maxZoom:i}=this.options,o=s.getZoom();if(void 0!==o){if(void 0!==e&&o<e)return;if(void 0!==i&&o>i)return;if(_)return}}if(!v){try{this.emitter.emit("preupdate",t),s._emitLayerEvent("layer:preupdate",u.id||"",t);const e=await y(t.filters,{...t.options,srs:this.options.srs});let i=e;const o=await this.getCount();if("BBOX+"===this.options.strategy){i={type:"FeatureCollection",features:[]};for(const t of e.features)-1===d.indexOf(String(t.id))&&(d.push(String(t.id)),i.features.push(t));_=void 0!==o&&d.length>=o,await s.addLayerData(this,i)}else _=void 0!==o&&e.features.length>=o,await s.setLayerData(this,e);this.emitter.emit("updated",e),s._emitLayerEvent("layer:updated",u.id||"",{data:e,newData:i,isFull:_})}catch(i){if(i instanceof Error&&"CancelError"!==i.name)throw i}super.updateLayer&&super.updateLayer()}}async propertiesFilter(t,e){if(b(),this.filter&&_)this.filter((e=>{const i=e.feature&&e.feature.properties&&he({...e.feature.properties});return!i||ct(i,t)}));else if(this.setData){this.clearLayer&&this.clearLayer();const i=await y(t,{...e,srs:this.options.srs});this.setData(i)}}removeFilter(){f=void 0,this.propertiesFilter([]),this.filter&&this.filter((()=>!0))}_addBboxEventListener(){this.__enableMapMoveListener=t=>{t===this&&(this._removeMoveEventListener(),this.updateLayer(),this._addMoveEventListener())},this.__disableMapMoveListener=t=>{t===this&&this._removeMoveEventListener()},s.emitter.on("layer:show",this.__enableMapMoveListener),s.emitter.on("layer:hide",this.__disableMapMoveListener),this.__enableMapMoveListener(this)}_removeBboxEventListener(){this.__enableMapMoveListener&&s.emitter.on("layer:show",this.__enableMapMoveListener),this.__disableMapMoveListener&&s.emitter.on("layer:hide",this.__disableMapMoveListener)}_addMoveEventListener(){this.__onMapMove=E((()=>this.updateLayer())),this.__onMapMoveStart=b,s.emitter.on("movestart",this.__onMapMoveStart),s.emitter.on("moveend",this.__onMapMove)}_removeMoveEventListener(){this.__onMapMove&&s.emitter.removeListener("moveend",this.__onMapMove),this.__onMapMoveStart&&s.emitter.removeListener("movestart",this.__onMapMoveStart)}}}function de({options:t,webMap:e,baseUrl:i}){var o;let n,s=t.adapter||"IMAGE";const r=e&&e.getLayerAdapters(),a=t.resource,h=t.tileNoData?t.tileNoData:200;if("number"==typeof a){if("IMAGE"===s){if(!r||r.IMAGE)return function({resourceId:t,baseUrl:e,nd:i,headers:o}){const n=e+"/api/component/render/image",s={resource:t};return i&&(s.nd=i),{url:n,resourceId:t,headers:o,params:s,updateWmsParams:e=>(i&&(e.nd=i),Fe(e,t))}}({resourceId:a,headers:t.headers,nd:h,baseUrl:i});s="TILE"}if("WMS"===s){n=`${i}/api/resource/${a}/wms`;const e=t.adapterOptions;return{url:n,format:"image/png",version:"1.1.1",layers:e&&e.layers,headers:t.headers}}if("MVT"===s)return n=i+"/api/component/feature_layer/mvt?x={x}&y={y}&z={z}&resource="+a+"&simplification="+(null!==(o=t.simplification)&&void 0!==o?o:6),{url:n,sourceLayer:"ngw:"+a,featureIdName:"$id"};if("TERRAIN"===s)return n=i+`/api/resource/${a}/terrain_provider`,{url:n,adapter:s};if("MODEL_3D"===s)return n=i+`/api/component/model_3d/${a}/data.glb`,{url:n};if("TILE"===s)return n=i+"/api/component/render/tile?z={z}&x={x}&y={y}&resource="+a+"&nd="+h,{url:n,adapter:s}}else{if(void 0!==a)throw new Error("Option `resource` must be number, not "+typeof a);console.log("Option `resource` not set")}}async function fe({layerOptions:t,webMap:e,connector:i,item:o}){const n=o.resource.cls;let s=t.adapter||n&&{wmsserver_service:"WMS",tmsclient_layer:"IMAGE"}[n]||"IMAGE";if(void 0!==s&&(t.adapter=s),"IMAGE"===s){const t=e.getLayerAdapters();!t||t.IMAGE||(s="TILE")}const r=e.mapAdapter.layerAdapters[s];if(r){const n=await $t(t,i);return class extends r{constructor(s,r){super(s,r),this.map=s,this.item=o,this.resourceId=n;const a=de({options:t,webMap:e,baseUrl:i.options.baseUrl||""});if(a){const e={...a,...t.adapterOptions,params:{resource:n},layers:a.layers||String(n),resourceId:n};t.adapterOptions&&C(t.adapterOptions.setViewDelay)&&(e.setViewDelay=t.adapterOptions.setViewDelay),this.options={...this.options,...e}}}addLayer(t){return super.addLayer({...this.options,...t})}async getIdentificationIds(){if(this.item){if("MVT"===s)return[this.item.resource.id];const t=this.item.resource.parent.id;if(C(t))return[t]}return[]}}}throw new Error(s+" not supported yet. Only TILE")}function me(t,e,i,o){return!!ye(t,e,i,ve,o)}function _e(t,e,i,o){return ye(t,e,i,be,o)}function ge(t,e="children"){let i=[];const o=("function"==typeof e?e:t=>t[e])(t);return o&&(Array.isArray(o)?i=o:i.push(o)),o?i:void 0}function ye(t,e=(t=>!!t),i="children",o,n){const s="function"==typeof e?e:t=>ct(t,e);return o(t,n?t=>s(n(t)):s,i)}function ve(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{if(e(t))return t;const o=ge(t,i);o&&(n=o)}for(let s=0;s<n.length;s++)if(n[s]){const t=ve(n[s],e,i,o);if(t)return t}}function be(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{e(t)&&o.push(t);const s=ge(t,i);s&&(n=s)}for(let s=0;s<n.length;s++)n[s]&&be(n[s],e,i,o);return o}function we(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{if(!e(t))return!1;const o=ge(t,i);o&&(n=o)}for(let s=0;s<n.length;s++)if(n[s]){if(!we(n[s],e,i,o))return!1}return!0}class xe{constructor(t){this._children=[],this.item=t}setParent(t){this._parent=t}addChild(t){this._children.push(t)}getParent(){return this._parent}getParents(t){const e=this.getParent();return e?_e(e,t,(t=>t.tree.getParent())):[]}getRoot(){let t=this.getParent(),e=t;for(;t;)t=t.tree.getParent(),t&&(e=t);return e}find(t){return ye(this._children,t,(t=>t.tree.getChildren()),ve,e);var e}every(t){return!!ye(this._children,t,(t=>t.tree.getChildren()),we,e);var e}some(t){return me(this._children,t,(t=>t.tree.getChildren()))}all(t){return this.getDescendants(t)}getDescendants(t){return _e(this._children,t,(t=>t.tree.getChildren()))}getChildren(){return[...this._children]}}class Le{constructor(t,e,i){this.emitter=new o.exports.EventEmitter,this._blocked=!1,this.item=e,this.options=Object.assign({},i),this.name=t,this._value=this.getProperty()}getProperty(){return"function"==typeof this.options.getProperty?this.options.getProperty.call(this,this.item):this.options.value}getParents(){return this.item.tree.getParents()||[]}getParent(){return this.item.tree.getParent()}getChildren(){return this.item.tree.getChildren()}isGroup(){return this.item.tree.getDescendants().length}isBlocked(){if(void 0!==this._blocked)return this._blocked;const t=this.item.tree.getParents();return this._blocked=this._calculateBlockedStatus(t),this._blocked}set(t,e){this._value=this._prepareValue(t),this.update(this._value,e),this._fireChangeEvent(this._value,e)}get(){return this.getValue()}update(t,e){this._callOnSet(t,e)}getContainer(){return this._container}destroy(){if(this._container){const t=this._container.parentNode;t&&t.removeChild(this._container)}this._removeEventsListener&&this._removeEventsListener()}getValue(){return void 0!==this._value?this._value:this.getProperty()}_prepareValue(t){return t}_callOnSet(t,e){this.options.onSet&&this.options.onSet.call(this,t,e,this.item)}_fireChangeEvent(t,e){if(this.emitter){t=void 0!==t?t:this.getValue(),this.emitter.emit("change",{value:t,options:e});this.item.tree.getParents().forEach((i=>{const o=i.properties&&i.properties.property(this.name);o&&o.emitter.emit("change-tree",{value:t,options:e,item:this.item})}))}}_calculateBlockedStatus(t){return t.some((t=>{var e;const i=null===(e=t.properties)||void 0===e?void 0:e.property(this.name);return!!i&&!i.get()}))}}class Pe extends Le{constructor(t,e,i){super(t,e,{...Pe.options,...i}),this.set(this.get())}update(t,e){if(t){if(e&&e.bubble||this.options.bubble){this.unBlock(e);const i=this.getParent(),o=i&&i.properties&&i.properties.property(this.name);o&&o.set(t,Object.assign({},e,{bubble:!0,propagation:!1}))}this.isBlocked()||this._turnOn(e)}else this._turnOff(e);(e&&e.propagation||this.options.propagation)&&this._propagation(t,e)}getHierarchyValue(){return this.get()&&this.getParents().every((t=>{const e=t.properties&&t.properties.get(this.name);return e&&e.get()}))}block(t){this._blocked=!0,this._block(t)}unBlock(t){this._blocked=!1,this.getValue()&&this._unBlock(t)}blockChild(t){this.item.tree.getDescendants().forEach((e=>this._blockChild(e,t)))}unblockChild(t){this.item.tree.getChildren().forEach((e=>this._unBlockChild(e,t)))}_prepareValue(t){return t}_turnOff(t){this.options.turnOff&&this.options.turnOff.call(this,t),this._callOnSet(!1,t),this.options.hierarchy&&this.isGroup()&&this.blockChild(t)}_turnOn(t){this.options.turnOn&&this.options.turnOn.call(this,t),this._callOnSet(!0,t),this.options.hierarchy&&this.isGroup()&&this.unblockChild(t)}_block(t){this._turnOff(t)}_unBlock(t){this._turnOn(t)}_blockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.block&&i.block(e)}_unBlockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.unBlock&&i.unBlock(e)}_propagation(t,e){if(this.isGroup()){const i=this.item.tree.getChildren();for(let o=0;o<i.length;o++){const n=i[o],s=n.properties&&n.properties.property(this.name);s&&s.set(t,{...e,propagation:!0,bubble:!1})}}}}Pe.options={hierarchy:!0,bubble:!1,propagation:!1,label:"Toggle"};class Me{constructor(t,e){this.item=t,this.options={},this._properties={},this._propertiesList=[],e&&e.forEach(this._setPropertyHandler.bind(this))}add(t){this._setPropertyHandler(t)}update(){this.list().forEach((t=>t.update()))}get(t){const e=this.property(t);return e?e.get():void 0}set(t,e,i){const o=this.property(t);o&&o.getValue()!==e&&o.set(e,i)}property(t){return this._properties[t]}list(){return this._propertiesList.map((t=>this._properties[t]))}destroy(){for(const t in this._properties){const e=this.property(t);e&&e.destroy&&e.destroy()}this._properties={},this._propertiesList=[]}_setPropertyHandler(t){const e=this._getHandler(t);if(e&&t.name){const i={...t};this._properties[t.name]=new e(t.name,this.item,i),this._propertiesList.push(t.name)}}_getHandler(t){const e=t.handler;return!e&&t.type?"boolean"===t.type?Me.handlers.CheckProperty:Me.handlers.BaseProperty:e}}Me.handlers={CheckProperty:Pe};let Ce=0;class ke{constructor(t){this.options={},this.id=Ce,Ce+=1,this.options={...t},this.tree=new xe(this)}initProperties(){this.properties=new Me(this,this.options.properties)}}class Ae extends ke{constructor(t,e,i,n,s,r){if(super({...Ae.options,...i}),this.webMap=t,this.emitter=new o.exports.EventEmitter,this._rootDescendantsCount=0,n&&(this.connector=n),s&&this.tree.setParent(s),this.item=e,"root"===this.item.item_type)this._rootDescendantsCount=this._sumUp(this.item.children);else{const t=this.tree.getRoot();t&&(this._rootDescendantsCount=t._rootDescendantsCount)}this.initProperties(),r||this._init(e)}static async create(t,e,i,o,n){const s=new Ae(t,e,i,o,n,!0);return await s._init(e),s}initItem(t){return"group"===t.item_type||"root"===t.item_type?this.initGroupItem(t):this.initLayerItem(t)}bringToFront(){}fit(){}getLayer(){return this.layer}getItemOptions(t){const e="layer"===t.item_type&&t.layer_transparency,i="number"==typeof e?(100-e)/100:void 0,o={visibility:!1,headers:this.options.headers,crossOrigin:this.options.crossOrigin,setViewDelay:this.options.setViewDelay,params:{resource:this.item.resourceId,item:this.item}};if(this.options.order){const e=String(this.options.drawOrderEnabled&&"draw_order_position"in t?this._rootDescendantsCount-t.draw_order_position:this.id).padStart(4,"0");o.order=Number((0|this.options.order)+"."+e)}if(this.options.popupOptions&&(o.popupOptions=this.options.popupOptions),"layer"===t.item_type){const{maxZoom:e,minZoom:i}=this._getZoomRange(t);Object.assign(o,{updateWmsParams:t.updateWmsParams,url:t.url,headers:this.options.headers,ratio:this.options.ratio,maxZoom:e,minZoom:i,minScale:t.layer_min_scale_denom,maxScale:t.layer_max_scale_denom,interactive:t.layer_identifiable})}return void 0!==i&&(o.opacity=i),o}getChildren(t){return[...t.children].reverse()}_mapScaleToZoomLevel(t){return function(t,e=0){const i=e,o=function(){if(void 0===We){const t=document.createElement("div");t.style.cssText="position: absolute; left: -100%; top: -100%; width: 100cm;",document.body.appendChild(t);const e=t.offsetWidth;document.body.removeChild(t),We=e}return We}()*function(t){return 12756274*Math.PI*Math.cos(t*Math.PI/180)}(i)/t;return function(t){return Math.log(t/256)/Math.LN2}(o)}(t)}initGroupItem(t){if(t.children&&t.children.length){const e=this.getChildren(t);for(const t of e){const e=new this.constructor(this.webMap,t,this.options,this.connector,this);this.tree.addChild(e)}}return Promise.resolve()}initLayerItem(t){const e=this.getItemOptions(t),i=i=>{t._layer=i,this.layer=i;this.properties.get("visibility")&&this.properties.set("visibility",!0),void 0!==e.opacity&&this.webMap.setLayerOpacity(i,e.opacity)};let o;if("layer"===t.item_type)o=t.adapter||t.layer_adapter.toUpperCase();else if(Ae.GetAdapterFromLayerType[t.item_type]){o=(0,Ae.GetAdapterFromLayerType[t.item_type])(t,e,this.webMap,this.connector)}return o?this.webMap.addLayer(o,e).then((t=>{i(t)})):t._layer?Promise.resolve(i(t._layer)):Promise.reject("No layer added")}_getZoomRange(t){const e=this.options.minZoom,i=this.options.maxZoom,o=t.layer_min_scale_denom?this._mapScaleToZoomLevel(t.layer_min_scale_denom):void 0,n=t.layer_max_scale_denom?this._mapScaleToZoomLevel(t.layer_max_scale_denom):void 0,s=[e,o].filter(Boolean),r=[i,n].filter(Boolean);return{minZoom:s.length?Math.max(...s):void 0,maxZoom:r.length?Math.min(...r):void 0}}_init(t){this.initItem(t).then((()=>{this.emitter.emit("init")}))}_sumUp(t,e=0){for(const i of t)"layer"===i.item_type?(e+=1,i.draw_order_position=i.draw_order_position||e):"group"===i.item_type&&(e=this._sumUp(i.children,e));return e}}async function Te({webMap:t,connector:e,item:i,adapterOptions:o={},idPrefix:n="first-show-adapter"}){const s=async function({webMap:t,adapterOptions:e={},onLayerAdded:i,createAdapter:o}){return class{constructor(){this.options={},this.layer=[],this._removed=!1,this._creatingInProgress=!1}addLayer(){return this.layer}removeLayer(){this._removed=!0;for(const e of this.layer)t.removeLayer(e)}destroyed(){return this._removed}async showLayer(){if(this.options.visibility=!0,this.layer.length)for(const e of this.layer)await t.showLayer(e);else await this.loadLayer()}async hideLayer(){if(this.options.visibility=!1,this.layer)for(const e of this.layer)await t.hideLayer(e)}async loadLayer(){if(!this.layer.length&&!this._creatingInProgress){this._creatingInProgress=!0;const n=await o(this);if(n){const o=new n(t.mapAdapter.map,{...e}),s=await o.addLayer({order:this.options.order,headers:this.options.headers,baselayer:this.options.baselayer});i&&i(o),Object.assign(o.options,e),o.layer=s,this._removed&&t.removeLayer(o),this.layer.push(o),this.options.visibility&&await t.showLayer(o),this._creatingInProgress=!1}}return this.layer}}}({webMap:t,adapterOptions:o,onLayerAdded:t=>{t.options.baselayer=!1,t.id=n+"-"+i.resource_id},createAdapter:()=>je({resource:i.resource_id,adapterOptions:{name:i.display_name,opacity:i.opacity}},t,e)});return s}Ae.GetAdapterFromLayerType={},Ae.options={properties:[{type:"boolean",name:"visibility",getProperty(t){if(t){if("group"===t.item.item_type||"root"===t.item.item_type)return me(t.item,(t=>"layer_enabled"in t&&t.layer_enabled),(t=>t.children));if("layer"===t.item.item_type)return t.item.layer_enabled}return!1},onSet(t,e,i){i&&"layer"===i.item.item_type&&(i.layer&&(t?i.webMap.showLayer(i.layer):i.webMap.hideLayer(i.layer)),i.item.layer_enabled=t)}},{name:"opacity",handler:class extends Le{getProperty(){const t=this.item.layer;return t&&t&&t.options&&void 0!==t.options.opacity?t.options.opacity:1}update(t,e){if(e=e||{},this.isGroup()){this._value=this._prepareValue(t,e);const i=this.getChildren();for(const o of i){const i=o.properties.property(this.name);i&&(e.propagation?i.set(t,e):i.update(i.get(),e))}}const i=this.item.layer;if(i){const e=this.getParents().reduce(((t,e)=>{const i=e.properties.property(this.name);return t*(i?i.getValue():1)}),1);this.item.webMap.setLayerOpacity(i,this._prepareValue(t*e))}}_prepareValue(t,e){return e&&e.propagation&&this.isGroup()?1:Number(t)}}}]};class Ee{constructor(t){this.options=t,this.resourceId=t.resourceId;const e=t.item;this.item=e,this.name=t.labelField&&e.fields?e.fields[t.labelField]:String(e.id)}extent(){return this._extent?P.resolve(this._extent):this.options.connector.get("feature_layer.feature.item_extent",null,{id:this.resourceId,fid:this.item.id}).then((t=>{const{minLat:e,minLon:i,maxLat:o,maxLon:n}=t.extent,s=[i,e,n,o];return this._extent=s,s}))}geoJson(){return this.item.geom?P.resolve(ee(this.item)):Ge({resourceId:this.resourceId,featureId:this.item.id,connector:this.options.connector,geom:!0,fields:null,extensions:null}).then((t=>(this.item.geom=t.geom,ee(this.item))))}}class Oe{constructor(t,e){this.map=t,this.options=e,this.NgwWebmapItem=Ae,this.pixelRadius=10,this.webmapClassName="webmap",this.emitter=new o.exports.EventEmitter,this._webmapBaselayersIds=[];const i=e.resourceId;if(Array.isArray(i)?(this.resourceId=i[0],this.options.id=i[1]):this.resourceId=i,!this.resourceId)throw new Error("NGW `resourceId` is not defined")}async addLayer(t){var e,i;this.options={...this.options,...t},this.layer=await this._getWebMapLayerItem();const o=null===(i=null===(e=this.response)||void 0===e?void 0:e.webmap)||void 0===i?void 0:i.extent_constrained;return this.options.useExtentConstrained&&this._extent&&o&&this.options.webMap.setView({maxBounds:this._extent}),this.layer}removeLayer(){const t=this.options.webMap.mapAdapter;if(this.getDependLayers().forEach((e=>{"layer"in e&&t.removeLayer(e.layer.layer)})),this._webmapBaselayersIds.length){for(const t of this._webmapBaselayersIds)this.options.webMap.removeLayer(t);this._lastActiveBaselayer&&this.options.webMap.showLayer(this._lastActiveBaselayer)}this.options.useExtentConstrained&&this._extent&&this.options.webMap.setView({maxBounds:null}),delete this.layer,delete this.response,delete this._webmapLayersIds}async showLayer(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!0)}async hideLayer(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!1)}async setOpacity(t){if(this.layer&&this.layer.properties)return this.layer.properties.property("opacity").set(t)}getExtent(){return this.getBounds()}getBounds(){const t=this.response&&this.response.webmap;if(t)return qt(t)}getDependLayers(){return this.layer&&this.layer.tree.getDescendants()||[]}getBookmarksResourceId(){const t=this.response&&this.response.webmap;if(t)return t.bookmark_resource.id}fetchBookmarks(){const t=this.getBookmarksResourceId(),e=this.options.connector;if(t)return e.getResourceOrFail(t).then((i=>{var o;const n=null===(o=i.feature_layer)||void 0===o?void 0:o.fields.find((t=>t.label_field)),s=n&&n.keyname;return le({connector:e,resourceId:t,geom:!1,fields:s?[s]:void 0}).then((i=>{const o=[];for(const n of i){const i=new Ee({item:n,resourceId:t,labelField:s,connector:e});o.push(i)}return o}))}));throw new Error("Webmap was not loaded correctly, it is impossible to extract bookmarks")}async getIdentificationIds(){const t=[];let e=this._webmapLayersIds;if(e||(e=await this._getWebMapIds(),this._webmapLayersIds=e),e&&e.length){let e=this.getDependLayers();e=e.sort(((t,e)=>e.id-t.id)),e.forEach((e=>{const i=e.item,o=i.parentId;if(void 0!==o&&"layer"===i.item_type&&i.layer_identifiable){const i=e.properties.property("visibility");i.get()&&!i.isBlocked()&&t.push(o)}}))}return t}async _getWebMapLayerItem(){if(this.resourceId){const t=await this.getWebMapConfig(this.resourceId);if(t&&t.root_item)return new Promise((e=>{const i={};if(this.options.connector&&this.options.connector.options.auth){const t=this.options.connector.getAuthorizationHeaders();t&&(i.headers=t)}i.setViewDelay=this.options.setViewDelay,i.order=this.options.order,i.ratio=this.options.ratio,i.crossOrigin=this.options.crossOrigin,i.minZoom=this.options.minZoom,i.maxZoom=this.options.maxZoom,i.drawOrderEnabled=t.draw_order_enabled,i.popupOptions=this.options.popupOptions;const o=new this.NgwWebmapItem(this.options.webMap,t.root_item,i,this.options.connector);o.emitter.on("init",(()=>e(o)))}))}}async getWebMapConfig(t){const e=await this.options.connector.getResource(t);if(e){this.response=e;const t=e[this.webmapClassName];if(this._setupBaselayers(e),t)return this._extent=[t.extent_left,t.extent_bottom,t.extent_right,t.extent_top],this._updateItemsParams(t.root_item,this.options.webMap,e),t}}_setupBaselayers(t){var e;const i=this.options.webMap;if(null===(e=this.options.useBasemap)||void 0===e||e)if(t.basemap_webmap&&t.basemap_webmap.basemaps.length){const e=i.getActiveBaseLayer();this._lastActiveBaselayer=e?e.id:void 0,this._setBasemaps(t.basemap_webmap)}else this.options.defaultBasemap&&i.addBaseLayer("OSM",{id:"webmap-default-baselayer",name:"OpenStreetMap"})}_setBasemaps(t){const e=this.options.webMap;let i=!1;for(const o of t.basemaps)Te({webMap:e,connector:this.options.connector,item:o,adapterOptions:{crossOrigin:this.options.crossOrigin}}).then((t=>{const n=!i&&o.enabled;return o.enabled&&(i=!0),e.addBaseLayer(t,{id:qe+o.resource_id,name:o.display_name,opacity:o.opacity,visibility:n}).then((t=>{t.id&&this._webmapBaselayersIds.push(t.id)}))}))}_updateItemsParams(t,e,i){if(t)if("group"===t.item_type||"root"===t.item_type)t.children&&(t.children=t.children.map((t=>this._updateItemsParams(t,e,i)))),"root"===t.item_type&&(t.display_name=i.resource.display_name);else if("layer"===t.item_type){const i=F(this.options.connector.options.baseUrl+"/api/component/render/image"),o=t.layer_style_id;t.url=i,t.resourceId=o,t.updateWmsParams=t=>Fe(t,o);const n=de({options:{adapter:t.layer_adapter.toUpperCase(),resource:o},webMap:e,baseUrl:this.options.connector.options.baseUrl||""});t={...t,...n}}return t}async _getWebMapIds(){const t=this.layer;if(t&&"root"===t.item.item_type){const e=t.tree.getDescendants(),i=[];for(const t of e){const e=t.item;if("layer"===e.item_type){const t=this.options.connector.getResource(e.layer_style_id).then((t=>{if(t){const i=Number(t.resource.parent.id);return e.parentId=i,i}}));i.push(t)}}return(await Promise.all(i)).filter((t=>void 0!==t))}}}const Ie={tms:"TILE"};function ze(t){const e=("https:"===location.protocol?"https":"http")+"://";let i=t.url.replace(/^(https?|ftp):\/\//,e);return t.y_origin_top||(i=i.replace("{y}","{-y}")),{url:i,name:t.name,attribution:t.copyright_text,maxZoom:t.z_max,minZoom:t.z_min}}const Se="https://qms.nextgis.com";function Be(t,e=Se,i={}){let o;if("webMap"in t){const{webMap:n,url:s,...r}=t;o=n,s&&(e=s),r&&(i=r)}else o=t;e||(e=Se);class n{constructor(t,e){this.map=t;const o={...i,...e};this.options=o,this.options.baselayer=!0,o.qms&&(this.qms=o.qms)}async addLayer(t){if(!this.qms&&t.qmsId)try{this.qms=await function(t){return new Promise(((e,i)=>{const o=new XMLHttpRequest;o.onreadystatechange=()=>{if(4===o.readyState&&200===o.status&&o.responseText)try{e(JSON.parse(o.responseText))}catch(t){i(t)}},o.open("GET",F(t),!0),o.send()}))}(e+"/api/v1/geoservices/"+t.qmsId)}catch(a){console.error(a)}const i=this.qms;if(i){const e=Ie[i.type||"tms"],a=o.mapAdapter.layerAdapters[e];if(a&&(s=n,r=a,["showLayer","hideLayer"].forEach((t=>{const e=Object.getOwnPropertyDescriptor(r.prototype,t);e&&Object.defineProperty(s.prototype,t,e)})),"TILE"===e)){if(t={order:0,maxZoom:o.options.maxZoom,minZoom:o.options.minZoom,...this.options,...ze(i)},i.origin_url){const[e,o]=function(t){const e=[];return[t=t.replace(/{switch:(.*?)}/,((t,i)=>("string"==typeof i&&i.split(",").forEach((t=>e.push(t))),"{s}"))),e]}(i.origin_url);o.length&&(t.subdomains=o,t.url=e)}this.options=t;return new a(this.map,t).addLayer(t)}}var s,r}}return n}class Ze{constructor(t){this.options={url:"https://qms.nextgis.com"},this.options={...this.options,...t},this.url=this.options.url}getLayerAdapters(){return Promise.resolve([{name:"QMS",createAdapter:t=>Promise.resolve(this._createAdapter(t))}])}_createAdapter(t){return Be({webMap:t,url:this.url})}}Ze.utils={createQmsAdapter:Be};const Ne={},Re=["mapserver_style","qgis_vector_style","qgis_raster_style","wmsserver_service","raster_style","basemap_layer","vector_layer","raster_layer","postgis_layer","webmap","tmsclient_layer"];async function De({layerOptions:t,webMap:e,connector:i,item:o}){const n=o.resource.id,s=await i.getResourceChildren(n),r=s&&s[0];if(r)return je({...t,resource:r.resource.id},e,i)}async function je(t,e,i){let o,n;const s=t.adapter,r=await $t(t,i);if(r){const a=t.resource;if(n=a&&a.resource&&void 0!==a.resource.id?a:await i.getResource(r),!n)throw"Resource item is not found";{const a=n.resource.cls,h={layerOptions:{...t,resource:r},webMap:e,connector:i,item:n};if(-1!==Re.indexOf(a))if("webmap"===a)o=async function({layerOptions:t,webMap:e,connector:i}){const o=await $t(t,i);return class extends Oe{constructor(t){super(t,{url:"",webMap:e,resourceId:o,connector:i})}}}(h);else if("vector_layer"===a||"postgis_layer"===a){const e=h.layerOptions.adapterOptions||{};if(e.type=e.type||n.vector_layer&&Ue[n.vector_layer.geometry_type],h.layerOptions.adapterOptions=e,t.adapterOptions=h,void 0!==s&&"GEOJSON"!==s){if("MVT"!==s)return De(h);o=fe(h)}else o=pe(h)}else{if("raster_layer"===a)return De(h);if("basemap_layer"===a)o=async function({webMap:t,item:e}){if(e.basemap_layer){const i=e.basemap_layer.qms,o=e.basemap_layer.url;if(i){const e=JSON.parse(i);return Promise.resolve(Ze.utils.createQmsAdapter(t,void 0,{qms:e,baselayer:!0}))}if(o){const e=t.mapAdapter.layerAdapters.TILE;if(e){class t extends e{async addLayer(t){return super.addLayer({...t,url:o})}}return t}}}}(h);else if("GEOJSON"===s){const e=await i.getResource(n.resource.parent.id);if(e){const i={...t,resource:n.resource.parent.id};o=pe({...h,item:e,layerOptions:i})}}else o=fe(h)}else{if(!Ne[a])throw`Resource class '${a}' not yet supported.`;{const t=Ne[a];let e;e=s&&"function"!=typeof e?t[s]:t,e&&(o=e(h))}}}}if(o)return o.then((t=>{if(t){const e=t;return n&&(e.prototype.item=n,e.prototype.resourceId=n.resource.id,e.prototype.connector=i),M(e,[Yt],{replace:!1}),e}}))}function Fe(t,e){const{bbox:i,width:o,height:n,nd:s}=t;return{resource:Array.isArray(e)?e.join(","):e,extent:i,size:o+","+n,timestamp:Date.now(),nd:null!=s?s:200}}const Ue={POINT:"point",LINESTRING:"line",POLYGON:"polygon",MULTIPOINT:"point",MULTILINESTRING:"line",MULTIPOLYGON:"polygon",POINTZ:"point",LINESTRINGZ:"line",POLYGONZ:"polygon",MULTIPOINTZ:"point",MULTILINESTRINGZ:"line",MULTIPOLYGONZ:"polygon"};let We;class He{constructor(t){if(this.options=t,this.options.connector)this.url=this.options.connector.options.baseUrl||"",this.connector=this.options.connector;else{if(!this.options.baseUrl)throw new Error("url is not defined");this.url=this.options.baseUrl,this.connector=new Vt({baseUrl:this.url,auth:this.options.auth})}}static addClassAdapters(t,e){Ne[t]=e}async onLoadSync(t){if(this.options.resourceId&&this.url){const e=[this.options.resourceId];if(e.length)for(const i of e){const e={resourceId:i,connector:this.connector,webMap:t};return await t.addLayer(Oe,{visibility:!0,fit:!0,pixelRadius:this.options.pixelRadius,...e})}}}getLayerAdapters(){return Promise.resolve([this._getLayerAdapter()])}_getLayerAdapter(){return{name:"WEBMAP",createAdapter:t=>Promise.resolve(this._createAdapter(t))}}_createAdapter(t){return e={webMap:t,connector:this.connector,baseUrl:this.url},class extends Oe{constructor(t,i){super(t,i={...e,...i})}};var e}}class Ve{constructor(t){const e=t.feature;this.id=e.id,this.geom=e.geom,this.label=e.label,this.parent=e.parent,this.fields=e.fields,this.layerId=e.layerId,this.connector=t.connector}identify(t={}){return this._item?P.resolve(this._item):Ge({connector:this.connector,featureId:this.id,resourceId:this.layerId,fields:null,extensions:["attachment","description"],...t}).then((t=>(this._item=t,this.geom=t.geom,this.extensions=t.extensions,t)))}resource(){return this._resource?P.resolve(this._resource.feature_layer):this.connector.getResource(this.layerId).then((t=>(this._resource=t,this._resource.feature_layer)))}getBounds(){return this._extent?P.resolve(this._extent):function({resourceId:t,featureId:e,connector:i,cache:o=!0}){return i.get("feature_layer.feature.item_extent",{cache:o},{id:t,fid:e}).then((t=>{if(t){const{maxLat:e,maxLon:i,minLat:o,minLon:n}=t.extent;return[n,o,i,e]}}))}({connector:this.connector,featureId:this.id,resourceId:this.layerId})}geojson(){return this._geojson?P.resolve(this._geojson):this.identify().then((t=>t.toGeojson().then((t=>(this._geojson=t,t)))))}}const qe="webmap-baselayer";function Ge(t){const e={...te};ie(e,t);const i={id:t.resourceId,fid:t.featureId,...e};return t.connector.get("feature_layer.feature.item",{cache:t.cache||!0},i).then((e=>({...e,toGeojson:()=>e.geom?P.resolve(ee(e)):Ge({...t,geom:!0,fields:null,extensions:null}).then((t=>{const i=t.geom;return ee({...e,geom:i})}))})))}function Je(t){return Ge(t).then((t=>ee(t)))}function Ke(t,e=!1){const i=[],o=[];for(const s in t){const t=Number(s);isNaN(t)||i.push(t)}const n=t.resources;n&&i.sort(((t,e)=>n.indexOf(t)-n.indexOf(e)));for(let s=0;s<i.length;s++){const n=i[s],r=t[n];if("features"in r){const t=Ye(r.features,Number(n),e);if(t.length&&(o.push(...t),!e))break}}return o}function Ye(t,e,i){const o=[];for(const n of t){if(o.push({featureId:n.id,resourceId:e,feature:n}),!i)break}return o}function Qe(t){const{geom:e,signal:i,cache:o,layers:n}=t,s="string"==typeof e?e:function(t){const e=function(t){var e;if(Array.isArray(t))return t;if("Feature"===t.type)return null===(e=t.geometry)||void 0===e?void 0:e.coordinates[0];if("Polygon"===t.type)return t.coordinates[0];return null}(t);if(!e)return null;return`POLYGON((${e.map((([t,e])=>{const[i,o]=Z(t,e);return`${i} ${o}`})).join(",")}))`}(e);if(!s)throw new Error("Not valid geometry format to make intersection");return t.connector.post("feature_layer.identify",{data:{geom:s,srs:3857,layers:n},signal:i,cache:o})}function Xe(t,e){T(t);const[i,o]=t.lngLat,{geom:n,radius:s,signal:r,cache:a}=e,h=null!=n?n:function(t,e,i=10,o=6){const n=i/O*B,s=n/Math.cos(e*S),r=[];for(let a=0;a<o+1;a++){const i=Math.PI*(a/(o/2)),h=t+s*Math.cos(i),l=e+n*Math.sin(i);r.push([h,l])}return r}(i,o,s);return Qe({...e,geom:h,signal:r,cache:a})}const $e={brill:'<path d="m6 0-5 6 5 6 5-6z"/>',circle:'<circle cx="6" cy="6" r="6"/>',rect:'<rect width="12" height="12"/>',marker:'<path d="m6 0c-1.85 0-4 1.19-4 4.22 0 2.05 3.08 6.59 4 7.78 0.821-1.19 4-5.62 4-7.78 0-3.03-2.15-4.22-4-4.22z"/>',cross:'<path d="M 2.4,12 6,8.4 9.6,12 12,9.6 8.4,6 12,2.4 9.6,0 6,3.6 2.4,0 0,2.4 3.6,6 0,9.6 Z"/>',star:'<path d="m6 0.25 1.71 4.18 4.29-1.04e-4 -3.43 3.14 0.857 4.18-3.43-3.14-3.43 3.14 0.857-4.18-3.43-3.14 4.29-0.209z"/>',triangle:'<path d="m12 11.7h-12l6-11.2z"/>',plus:'<path d="m7.5 12v-4.5h4.5v-3h-4.5v-4.5h-3v4.5h-4.5v3h4.5v4.5z"/>',minus:'<path d="m12 7.5v-3h-12v3z"/>',asterisk:'<path d="m7.59 12v-3.27l2.83 1.64 1.58-2.74-2.85-1.64 2.83-1.64-1.56-2.74-2.83 1.64v-3.24h-3.17v3.24l-2.85-1.64-1.57 2.74 2.84 1.64-2.84 1.64 1.57 2.74 2.85-1.64v3.27z"/>'},ti=12;function ei(t,e,i,o){if("number"==typeof e||"string"==typeof e)e=Number(e),t.push({...i,resource:e});else if(Array.isArray(e)){const[n,s]=e;t.push({...i,resource:n,id:s,...o})}else"object"==typeof e&&t.push({...i,...e,...o})}const ii={target:"map",baseUrl:"",whitlabel:!1,controls:["ZOOM","ATTRIBUTION"],controlsOptions:{ZOOM:{position:"top-left"},ATTRIBUTION:{position:"bottom-right",customAttribution:['<a href="https://nextgis.com" target="_blank">©NextGIS</a>']}},pixelRadius:10};class oi extends Tt{constructor(t){super(function(t){const e=[new Ze];return t.starterKits&&t.starterKits.forEach((t=>{e.push(t)})),t.connector?t.connector&&(t.baseUrl=t.connector.options.baseUrl):t.connector=new Vt({baseUrl:t.baseUrl||"",auth:t.auth}),(t=A(ii,t)).center||t.bounds||(t.bounds=[-179,-90,180,90]),t.connector&&e.push(new He({connector:t.connector,auth:t.auth})),{...t,starterKits:e,create:!1}}(t)),this.emitter=new o.exports.EventEmitter,this._ngwLayers={},this._promises={select:[],identify:[]},t.connector&&(this.connector=t.connector),this._createWebMap().then((()=>{const t=this.getContainer();t&&t.classList.add("ngw-map-container"),this.options.whitlabel&&this._whiteLabel()}))}async addControl(t,e,i){return await this.onLoad("controls:create"),super.addControl(t,e,i)}async addNgwLayer(t){await this.onMapLoad();const{keyname:e,resourceId:i}=t;(e||void 0!==i)&&console.warn(`DEPRECATED WARN: ${"set `resource` options instead of `keyname` or `resourceId`"}`);const o=t.resource;if(!e&&!i&&!o)throw new Error("resource, resourceId or keyname is required parameter to add NGW layer");if(C(this.options.baseUrl))try{C(this.options.setViewDelay)&&(t.adapterOptions=t.adapterOptions||{},C(t.adapterOptions.setViewDelay)||(t.adapterOptions.setViewDelay=this.options.setViewDelay));const e=function(t,e,i){const o=i.getAuthorizationHeaders();return o&&(t.headers=o),je(t,e,i)}(t,this,this.connector),i={visibility:!0,...t,...t.adapterOptions},o=await this.addLayer(e,i),n=o&&this.getLayerId(o);if(o&&n&&(this._ngwLayers[n]={layer:o,resourceId:o.resourceId},o.options.name=o.options.name||o.item&&o.item.resource.display_name,o.options.baselayer)){if(this.getActiveBaseLayer())return o}return o}catch(n){const t=j(o)&&"id"in o?o.id:e||i||o;console.error(`Can't add NGW layer ${t}.`,n)}}fit(){const{center:t,zoom:e,bounds:i}=this.options;t?(this.setCenter(t),e&&this.setZoom(e)):i&&this.fitBounds(i)}fetchNgwLayerItem(t){return Ge({connector:this.connector,...t})}fetchNgwLayerItems(t){return le({connector:this.connector,...t})}fetchNgwLayerFeature(t){return Je({connector:this.connector,...t})}fetchNgwLayerFeatures(t){return ue({connector:this.connector,...t})}fetchIdentifyItem(t,e){const i=function(t){const{connector:e,identify:i}=t,o=Ke(i);return o&&o.length?Ge({connector:e,...t.requestOptions,...o[0]}):P.resolve(void 0)}({identify:t,connector:this.connector,requestOptions:e});return this._addPromise("identify",i),i}fetchIdentifyGeoJson(t,e=!1){const i=function(t){const{connector:e,identify:i,requestOptions:o}=t;for(const s in i){const t=Number(s);if(!isNaN(t)){const t=i[s];if("features"in t){const e=t.features.find((t=>t.geom));if(e&&e.geom){const t=e.geom;return P.resolve(ee({...e,geom:t}))}}}}const n=Ke(i);return n&&n.length?Je({...o,connector:e,...n[0]}):P.resolve(void 0)}({identify:t,connector:this.connector,multiple:e});return i&&"then"in i?(this._addPromise("identify",i),i):P.resolve(i)}getIdentifyGeoJson(t,e=!1){return this.fetchIdentifyGeoJson(t,e)}async getNgwLayers(){return await this.onLoad(),this._ngwLayers}async getNgwLayerByResourceId(t){for(const e in this._ngwLayers){const i=this._ngwLayers[e];if(i.resourceId===t)return i&&i.layer;if(i.layer.getIdentificationIds){const e=await i.layer.getIdentificationIds();if(e&&e.some((e=>e===t)))return i.layer}if(i.layer.getDependLayers){const e=i.layer.getDependLayers().find((e=>e.item&&e.item.parentId===t));if(e)return e.layer}}}async fitLayer(t,e){let i;i="string"==typeof t||"number"==typeof t?String(i):t.id;const o=i&&this._ngwLayers[i];if(o)if(o.layer.getBounds){const t=await o.layer.getBounds();t&&this.fitBounds(t,e)}else{let t;if(o.layer.item)t=o.layer.item;else{const e=o.resourceId;t=await this.connector.getResource(e)}t&&Jt({resourceId:t.resource.id,connector:this.connector}).then((t=>{t&&this.fitBounds(t,e)}))}else super.fitLayer("number"==typeof t?String(t):t,e)}async zoomToLayer(t){return this.fitLayer(t)}onLoad(t="ngw-map:create"){return super.onLoad(t)}removeLayer(t){const e=this.getLayer(t);if(e){const t=this.getLayerId(e);t&&delete this._ngwLayers[t],super.removeLayer(e)}}enableSelection(){this.$$selectFromNgwRaster||(this.$$selectFromNgwRaster=t=>{this._getSelectListenersCount()&&this.selectFromNgwRaster(t)},this.$$selectFromNgwVector=t=>{this._getSelectListenersCount()&&this._selectFromNgwVector(t)},this.emitter.on("click",this.$$selectFromNgwRaster),this.emitter.on("layer:click",this.$$selectFromNgwVector))}disableSelection(){this.$$selectFromNgwRaster&&(this.emitter.removeListener("click",this.$$selectFromNgwRaster),this.$$selectFromNgwRaster=void 0),this.$$selectFromNgwVector&&(this.emitter.removeListener("layer:click",this.$$selectFromNgwVector),this.$$selectFromNgwVector=void 0)}getNgwLayerItem(t){return this.fetchNgwLayerItem(t)}getNgwLayerItems(t){return this.fetchNgwLayerItems(t)}getNgwLayerFeature(t){return this.fetchNgwLayerFeature(t)}getNgwLayerFeatures(t){return this.fetchNgwLayerFeatures(t)}cancelPromise(...t){this.cancelPromises(...t)}cancelPromises(...t){t.length||(t=Object.keys(this._promises)),t.forEach((t=>{const e=this._promises[t];e&&(e.forEach((t=>t.cancel())),this._promises[t]=[])}))}async selectFromNgwRaster(t){var e;this._emitStatusEvent("ngw:preselect");const i=[],o=Object.values(this._ngwLayers);o.sort(((t,e)=>t.layer.order&&e.layer.order?e.layer.order-t.layer.order:1));for(const p of o){const t=p.layer,o="function"==typeof t.getIdentificationIds&&t.getIdentificationIds,n=null===(e=t.options.interactive)||void 0===e||e;o&&t.options.selectable&&n&&this.isLayerVisible(t)&&i.push(o.call(t))}const n=Promise.all(i),s=await n,r=[];for(const p of s)p&&r.push(...p);if(!r.length)return void this._emitStatusEvent("ngw:select",null);const a=this.options.pixelRadius||10,h=this.getCenter();let l=this.getZoom();if(l=void 0!==l?l:20,!h||!l)return void this._emitStatusEvent("ngw:select",null);const c=function(t,e,i){return(i=null!=i?i:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4}(h,l,a),u=Xe(t,{layers:r,connector:this.connector,radius:c}).then((e=>{const i={...e,resources:r,sourceType:"raster",event:t},o=this._prepareToIdentify(i);return this._emitStatusEvent("ngw:select",o),o}));return this._addPromise("select",u),u}_addPromise(t,e){const i=this._promises[t];if(i&&-1===i.indexOf(e)){const t=()=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)};e.then(t),e.catch(t),i.push(e)}}_isFitFromResource(){const t=this._initMapState;return!t.zoom||!t.center}async _createWebMap(){await this.create(),this.options.qmsId&&this._addQmsBaseLayer(),this.options.osm&&this._addOsmBaseLayer();const t=[],e=this._isFitFromResource();if(this.options.webmapId&&ei(t,this.options.webmapId,{fit:e}),this.options.resources&&Array.isArray(this.options.resources))for(const o of this.options.resources){const i={};e||(i.fit=!1),ei(t,o,{},i)}for(const o of t)try{await this.addNgwLayer(o)}catch(i){console.warn(i)}this._emitStatusEvent("ngw-map:create",this),this.enableSelection()}_addOsmBaseLayer(){this.addBaseLayer("OSM")}_addQmsBaseLayer(){let t,e;Array.isArray(this.options.qmsId)?(t=this.options.qmsId[0],e=this.options.qmsId[1]):t=Number(this.options.qmsId);const i={qmsId:t};e&&(i.id=e),this.addBaseLayer("QMS",i)}_selectFromNgwVector(t){const e=t.layer;if(!(e.options.selectable&&this.isLayerVisible(e)))return;const i=e.item&&e.item.resource.id,o=t.feature;if(void 0!==i&&o){const t=o.id;if(t){const e={featureCount:1,[i]:{featureCount:1,features:[{id:Number(t),fields:o.properties||{},label:`#${i}`,layerId:Number(i),parent:"",geom:o.geometry}]}};return this._emitStatusEvent("ngw:select",this._prepareToIdentify({...e,resources:[i],sourceType:"vector"})),e}}}_prepareToIdentify(t){return{...t,getIdentifyItems:()=>Ke(t,!0).map((t=>new Ve({feature:t.feature,connector:this.connector})))}}_getSelectListenersCount(){return this.emitter.listenerCount("ngw:select")}async _whiteLabel(){const t=this.getContainer();if(t){const e=await async function(t,e){var i;const o=await t.get("pyramid.settings",null,{component:"pyramid"});if(o&&o.company_logo&&o.company_logo.enabled){const s=document.createElement("a");s.style.position="absolute",s.style.bottom="0",s.style.right="0",s.style.padding=null!==(i=null==e?void 0:e.padding)&&void 0!==i?i:"10px",s.className="ngw-map-logo",e&&e.cssClass&&(s.className+=" "+e.cssClass);const r=new Image;r.style.maxHeight="100px",r.style.maxWidth="100px",r.src="";try{const e=await t.get("pyramid.company_logo",{responseType:"blob"}),i=(window.URL||window.webkitURL).createObjectURL(e);r.src=i}catch(n){console.warn(n)}return null!==o.company_logo.link&&""!==o.company_logo.link.trim()&&(s.href=o.company_logo.link,s.target="_blank",-1!==o.company_logo.link.search(/:\/\/nextgis/)&&(r.alt="Get your own Web GIS at nextgis.com")),s.appendChild(r),s}}(this.connector,this.options.companyLogoOptions);e&&t.appendChild(e)}}}function ni(t){const e=t.containerPoint,i=t.latlng,{lat:o,lng:n}=i;return{latLng:i,lngLat:[n,o],pixel:{left:e.x,top:e.y},source:t}}function si(t,i={},o){return new(e.exports.Control.extend({onAdd(){const n=document.createElement("div"),s=t.onAdd(o);return n.classList.add("leaflet-control"),i.bar&&n.classList.add("leaflet-bar"),i.addClass&&n.classList.add(i.addClass),i.margin||i.bar||(n.style.marginBottom="0px",n.style.marginTop="0px",n.style.marginLeft="0px",n.style.marginRight="0px"),s&&n.appendChild(s),e.exports.DomEvent.disableClickPropagation(n),n},onRemove(){t.onRemove()}}))}oi.getIcon=function(t={}){var e,i,o,n,s,r;const a=null!==(e=t.shape)&&void 0!==e?e:"circle",h=null!==(i=t.color)&&void 0!==i?i:"blue",l=null!==(o=t.strokeColor)&&void 0!==o?o:"white",c=null!==(n=t.size)&&void 0!==n?n:ti,u=null!==(s=t.rotate)&&void 0!==s?s:0,p=null!==(r=t.anchor)&&void 0!==r?r:[c/2,c/2],d=void 0!==t.stroke?Number(t.stroke):.8,f=t.p||$e[a]||"circle",m="string"==typeof f?f:f(t),_=function(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}(t.svg||function({width:t,height:e,stroke:i=0,content:o}){const n=i/2;return`<svg\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n width="${t}"\n height="${e}"\n viewBox="-${n} -${n} ${ti+i} ${ti+i}"\n >${o}</svg>`}({width:c,height:c,stroke:d,content:m}));return _.setAttribute("width",String(c)),_.setAttribute("height",String(c)),_.setAttribute("fill",h),d&&(_.setAttribute("stroke",l),_.setAttribute("stroke-width",String(d))),{type:"icon",iconSize:[c,c],iconAnchor:p,html:(new XMLSerializer).serializeToString(_),rotate:u,svg:_}};function ri(t){const e=t.getNorthEast(),i=t.getSouthWest();return[i.lng,i.lat,e.lng,e.lat]}const ai={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon",GeometryCollection:"polygon"},hi={stroke:!1,opacity:1},li={};for(const L in ai){const t=ai[L],e=li[t]||[];e.push(L),li[t]=e}function ci(t,e){return-1!==(li[e]||[]).indexOf(t)}function ui(t){const i=new e.exports.GeoJSON;return(Array.isArray(t)?t:[t]).forEach((t=>i.addData(t))),i.getBounds()}function pi(t){return{getBounds:()=>function(t){return ri(ui(t))}(t),getCenter:()=>function(t){const{lat:e,lng:i}=ui(t).getCenter();return[i,e]}(t)}}function di(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i="";for(const o in e){e[o]>(i?e[i]:0)&&(i=o)}return i}class fi{constructor(t,e){if(this.map=t,this.options=e,this.pane="order-0",void 0!==e.order){const i="order-"+e.order;let o=t.getPane(i);o||(o=t.createPane(i)),o.style.zIndex=String(Math.round(100*e.order)),this.pane=i}}addLayer(t){Object.assign(this.options,t)}}class mi{constructor(t){this.layer=t}handleMouseEvents(t){const{onClick:e,onLayerClick:i,onMouseOut:o,onMouseOver:n}=this.layer.options,s=e||i;s&&(this._onclick=e=>{const i=!!this.layer._getSelected(t);s({selected:i,...this._createMouseEvent(e)})},t.on("click",this._onclick,this)),o&&(this._mouseout=t=>{o(this._createMouseEvent(t))},t.on("mouseout",this._mouseout,this)),n&&(this._mouseover=t=>{n(this._createMouseEvent(t))},t.on("mouseover",this._mouseover,this))}stopMouseEvents(t){this._mouseover&&t.off("mouseover",this._mouseover,this),this._mouseout&&t.off("mouseout",this._mouseout,this),this._onclick&&t.off("click",this._onclick,this)}_createMouseEvent(t){return function({layer:t,source:e}){const i=e.target.feature;return{layer:t,feature:i,event:ni(e),source:e,...pi(i)}}({layer:this.layer,source:t})}}class _i{constructor(t){this.layer=t}setPaintEachLayer(t){this.layer._layers.forEach((e=>{this.setPaint(e,t)}))}setPaint(t,e){let i;const{layer:o,feature:n}=t;if(o&&n&&(W(e)?i=e(n):U(e)&&(i=e),i))if("point"===this.layer.type&&"icon"===i.type){const t=o,e=this._createDivIcon(i);setTimeout((()=>{t.setIcon(e)}),10)}else"setStyle"in o&&o.setStyle(this.preparePaint(i))}preparePaint(t){if("get-paint"!==t.type){const e="line"===this.layer.type?[["color","strokeColor"],["opacity","strokeOpacity"],["weight","weight"]]:[["color","strokeColor"],["opacity","strokeOpacity"],["stroke","stroke"],["fillColor","fillColor"],["fillOpacity","fillOpacity"],["fill","fill"],["weight","weight"]],i={};"radius"in t&&"number"==typeof t.radius&&(i.radius=t.radius);for(const[o,n]of e){const e=this.layer.options.opacity;let s=t[n];C(e)&&-1!==n.toLowerCase().indexOf("opacity")&&(s=Number(s)*e),void 0!==s&&Object.defineProperty(i,o,{enumerable:!0,value:s})}return i}return hi}_createDivIcon(t){const{html:i,rotate:o,className:n,...s}=t,r=document.createElement("div");n&&(r.className=n),o&&(r.style.transform=`rotateZ(${o}deg)`),i&&(r.innerHTML=i);return new e.exports.DivIcon({className:"",...s,html:r})}createPaintToLayer(t){if(t&&t.type)if("icon"===t.type){if(t.className||t.html)return(i,o)=>{const n=this._createDivIcon(t);return new e.exports.Marker(o,{icon:n})}}else if("pin"===t.type)return(t,i)=>new e.exports.Marker(i);return(i,o)=>new e.exports.CircleMarker(o,this.preparePaint({...hi,...t}))}createPaintOptions(t){const e={},i=this.preparePaint(t);return t&&(e.style=()=>i),"point"===this.layer.type?e.pointToLayer=this.createPaintToLayer(t):"line"===this.layer.type&&(i.stroke=!0),e}}function gi(t,e,i){const o=new XMLHttpRequest;o.open("GET",t),o.responseType="arraybuffer";for(const n in i)o.setRequestHeader(n,i[n]);return o.onload=function(){const t=new Uint8Array(this.response),i=new Blob([t],{type:"image/png"}),o=(window.URL||window.webkitURL).createObjectURL(i);e(o)},o.send(),()=>{o.abort()}}class yi extends e.exports.ImageOverlay{constructor(t,e,i){super(t,e,i),this._abort=[]}cancelLoad(){this._abort&&(this._abort.forEach((t=>t())),this._abort=[])}_initImage(){super._initImage();const t=this.options.headers;if(t){const e=this._image,i=e.src;e.src="",this._abort.push(gi(i,(t=>{e.src=t}),t))}}}
1
+ function t(t,e){void 0===e&&(e={});var i=e.insertAt;if(t&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===i&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}}t('.leaflet-image-layer,.leaflet-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane,.leaflet-pane>canvas,.leaflet-pane>svg,.leaflet-tile,.leaflet-tile-container,.leaflet-zoom-box{left:0;position:absolute;top:0}.leaflet-container{overflow:hidden}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile{-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.leaflet-tile::-moz-selection{background:transparent}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{height:1600px;-webkit-transform-origin:0 0;width:1600px}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-overlay-pane svg,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer{max-height:none!important;max-width:none!important}.leaflet-container.leaflet-touch-zoom{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{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{box-sizing:border-box;height:0;width:0;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{height:1px;width:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{pointer-events:visiblePainted;pointer-events:auto;position:relative;z-index:800}.leaflet-bottom,.leaflet-top{pointer-events:none;position:absolute;z-index:1000}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{clear:both;float:left}.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-tile{will-change:opacity}.leaflet-fade-anim .leaflet-popup{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{transform-origin:0 0}.leaflet-zoom-anim .leaflet-zoom-animated{transition:transform .25s cubic-bezier(0,0,.25,1);will-change:transform}.leaflet-pan-anim .leaflet-tile,.leaflet-zoom-anim .leaflet-tile{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-control,.leaflet-popup-pane{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:grabbing}.leaflet-image-layer,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-image-layer.leaflet-interactive,.leaflet-marker-icon.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:0}.leaflet-container a{color:#0078a8}.leaflet-container a.leaflet-active{outline:2px solid orange}.leaflet-zoom-box{background:hsla(0,0%,100%,.5);border:2px dotted #38f}.leaflet-container{font:12px/1.5 Helvetica Neue,Arial,Helvetica,sans-serif}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px rgba(0,0,0,.65)}.leaflet-bar a,.leaflet-bar a:hover{background-color:#fff;border-bottom:1px solid #ccc;color:#000;display:block;height:26px;line-height:26px;text-align:center;text-decoration:none;width:26px}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover{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:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.leaflet-bar a.leaflet-disabled{background-color:#f4f4f4;color:#bbb;cursor:default}.leaflet-touch .leaflet-bar a{height:30px;line-height:30px;width: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{background:#fff;border-radius:5px;box-shadow:0 1px 5px rgba(0,0,0,.4)}.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);height:36px;width: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{height:44px;width: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{background:#fff;color:#333;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{overflow-x:hidden;overflow-y:scroll;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;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:hsla(0,0%,100%,.7);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover{text-decoration:underline}.leaflet-container .leaflet-control-attribution,.leaflet-container .leaflet-control-scale{font-size:11px}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{background:#fff;background:hsla(0,0%,100%,.5);border:2px solid #777;border-top:none;box-sizing:border-box;font-size:11px;line-height:1.1;overflow:hidden;padding:2px 5px 1px;white-space:nowrap}.leaflet-control-scale-line:not(:first-child){border-bottom:none;border-top:2px solid #777;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers{box-shadow:none}.leaflet-touch .leaflet-bar,.leaflet-touch .leaflet-control-layers{background-clip:padding-box;border:2px solid rgba(0,0,0,.2)}.leaflet-popup{margin-bottom:20px;position:absolute;text-align:center}.leaflet-popup-content-wrapper{border-radius:12px;padding:1px;text-align:left}.leaflet-popup-content{line-height:1.4;margin:13px 19px}.leaflet-popup-content p{margin:18px 0}.leaflet-popup-tip-container{height:20px;left:50%;margin-left:-20px;overflow:hidden;pointer-events:none;position:absolute;width:40px}.leaflet-popup-tip{height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg);width:17px}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;box-shadow:0 3px 14px rgba(0,0,0,.4);color:#333}.leaflet-container a.leaflet-popup-close-button{background:transparent;border:none;color:#c3c3c3;font:16px/14px Tahoma,Verdana,sans-serif;font-weight:700;height:14px;padding:4px 4px 0 0;position:absolute;right:0;text-align:center;text-decoration:none;top:0;width:18px}.leaflet-container a.leaflet-popup-close-button:hover{color:#999}.leaflet-popup-scrolled{border-bottom:1px solid #ddd;border-top:1px solid #ddd;overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678,M12=0.70710678,M21=-0.70710678,M22=0.70710678);margin:0 auto;width:24px}.leaflet-oldie .leaflet-popup-tip-container{margin-top:-1px}.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-control-zoom,.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{background-color:#fff;border:1px solid #fff;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.4);color:#222;padding:6px;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.leaflet-tooltip.leaflet-clickable{cursor:pointer;pointer-events:auto}.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before,.leaflet-tooltip-top:before{background:transparent;border:6px solid transparent;content:"";pointer-events:none;position:absolute}.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{border-top-color:#fff;bottom:0;margin-bottom:-12px}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-left:-6px;margin-top:-12px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;left:0;margin-left:-12px}');t(".ngw-map-container.leaflet-container{background:#fff}.leaflet-pane .leaflet-popup-pane{z-index:9999999999}");"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var e={exports:{}};!function(t){var e="1.7.1";function i(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++)for(e in n=arguments[i])t[e]=n[e];return t}var o=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function n(t,e){var i=Array.prototype.slice;if(t.bind)return t.bind.apply(t,i.call(arguments,1));var o=i.call(arguments,2);return function(){return t.apply(e,o.length?o.concat(i.call(arguments)):arguments)}}var s=0;function r(t){return t._leaflet_id=t._leaflet_id||++s,t._leaflet_id}function a(t,e,i){var o,n,s,r;return r=function(){o=!1,n&&(s.apply(i,n),n=!1)},s=function(){o?n=arguments:(t.apply(i,arguments),setTimeout(r,e),o=!0)},s}function h(t,e,i){var o=e[1],n=e[0],s=o-n;return t===o&&i?t:((t-n)%s+s)%s+n}function l(){return!1}function c(t,e){var i=Math.pow(10,void 0===e?6:e);return Math.round(t*i)/i}function u(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function p(t){return u(t).split(/\s+/)}function d(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?o(t.options):{}),e)t.options[i]=e[i];return t.options}function f(t,e,i){var o=[];for(var n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var m=/\{ *([\w_-]+) *\}/g;function _(t,e){return t.replace(m,(function(t,i){var o=e[i];if(void 0===o)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o}))}var g=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var v="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function b(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var w=0;function x(t){var e=+new Date,i=Math.max(0,16-(e-w));return w=e+i,window.setTimeout(t,i)}var P=window.requestAnimationFrame||b("RequestAnimationFrame")||x,M=window.cancelAnimationFrame||b("CancelAnimationFrame")||b("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,i){if(!i||P!==x)return P.call(window,n(t,e));t.call(e)}function k(t){t&&M.call(window,t)}var A={extend:i,create:o,bind:n,lastId:s,stamp:r,throttle:a,wrapNum:h,falseFn:l,formatNum:c,trim:u,splitWords:p,setOptions:d,getParamString:f,template:_,isArray:g,indexOf:y,emptyImageUrl:v,requestFn:P,cancelFn:M,requestAnimFrame:C,cancelAnimFrame:k};function T(){}function E(t){if("undefined"!=typeof L&&L&&L.Mixin){t=g(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===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)}}T.extend=function(t){var e=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},n=e.__super__=this.prototype,s=o(n);for(var r in s.constructor=e,e.prototype=s,this)Object.prototype.hasOwnProperty.call(this,r)&&"prototype"!==r&&"__super__"!==r&&(e[r]=this[r]);return t.statics&&(i(e,t.statics),delete t.statics),t.includes&&(E(t.includes),i.apply(null,[s].concat(t.includes)),delete t.includes),s.options&&(t.options=i(o(s.options),t.options)),i(s,t),s._initHooks=[],s.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=s._initHooks.length;t<e;t++)s._initHooks[t].call(this)}},e},T.include=function(t){return i(this.prototype,t),this},T.mergeOptions=function(t){return i(this.prototype.options,t),this},T.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var O={on:function(t,e,i){if("object"==typeof t)for(var o in t)this._on(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._on(t[n],e,i);return this},off:function(t,e,i){if(t)if("object"==typeof t)for(var o in t)this._off(o,t[o],e);else for(var n=0,s=(t=p(t)).length;n<s;n++)this._off(t[n],e,i);else delete this._events;return this},_on:function(t,e,i){this._events=this._events||{};var o=this._events[t];o||(this._events[t]=o=[]),i===this&&(i=void 0);for(var n={fn:e,ctx:i},s=o,r=0,a=s.length;r<a;r++)if(s[r].fn===e&&s[r].ctx===i)return;s.push(n)},_off:function(t,e,i){var o,n,s;if(this._events&&(o=this._events[t]))if(e){if(i===this&&(i=void 0),o)for(n=0,s=o.length;n<s;n++){var r=o[n];if(r.ctx===i&&r.fn===e)return r.fn=l,this._firingCount&&(this._events[t]=o=o.slice()),void o.splice(n,1)}}else{for(n=0,s=o.length;n<s;n++)o[n].fn=l;delete this._events[t]}},fire:function(t,e,o){if(!this.listens(t,o))return this;var n=i({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var s=this._events[t];if(s){this._firingCount=this._firingCount+1||1;for(var r=0,a=s.length;r<a;r++){var h=s[r];h.fn.call(h.ctx||this,n)}this._firingCount--}}return o&&this._propagateEvent(n),this},listens:function(t,e){var i=this._events&&this._events[t];if(i&&i.length)return!0;if(e)for(var o in this._eventParents)if(this._eventParents[o].listens(t,e))return!0;return!1},once:function(t,e,i){if("object"==typeof t){for(var o in t)this.once(o,t[o],e);return this}var s=n((function(){this.off(t,e,i).off(t,s,i)}),this);return this.on(t,e,i).on(t,s,i)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[r(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[r(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,i({layer:t.target,propagatedFrom:t.target},t),!0)}};O.addEventListener=O.on,O.removeEventListener=O.clearAllEventListeners=O.off,O.addOneTimeEventListener=O.once,O.fireEvent=O.fire,O.hasEventListeners=O.listens;var I=T.extend(O);function z(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var S=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function B(t,e,i){return t instanceof z?t:g(t)?new z(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new z(t.x,t.y):new z(t,e,i)}function Z(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function N(t,e){return!t||t instanceof Z?t:new Z(t,e)}function R(t,e){if(t)for(var i=e?[t,e]:t,o=0,n=i.length;o<n;o++)this.extend(i[o])}function D(t,e){return t instanceof R?t:new R(t,e)}function j(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function F(t,e,i){return t instanceof j?t:g(t)&&"object"!=typeof t[0]?3===t.length?new j(t[0],t[1],t[2]):2===t.length?new j(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new j(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new j(t,e,i)}z.prototype={clone:function(){return new z(this.x,this.y)},add:function(t){return this.clone()._add(B(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(B(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new z(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new z(this.x/t.x,this.y/t.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=S(this.x),this.y=S(this.y),this},distanceTo:function(t){var e=(t=B(t)).x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return(t=B(t)).x===this.x&&t.y===this.y},contains:function(t){return t=B(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+c(this.x)+", "+c(this.y)+")"}},Z.prototype={extend:function(t){return t=B(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new z((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new z(this.min.x,this.max.y)},getTopRight:function(){return new z(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(t){var e,i;return(t="number"==typeof t[0]||t instanceof z?B(t):N(t))instanceof Z?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=N(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>=e.x&&o.x<=i.x&&n.y>=e.y&&o.y<=i.y},overlaps:function(t){t=N(t);var e=this.min,i=this.max,o=t.min,n=t.max;return n.x>e.x&&o.x<i.x&&n.y>e.y&&o.y<i.y},isValid:function(){return!(!this.min||!this.max)}},R.prototype={extend:function(t){var e,i,o=this._southWest,n=this._northEast;if(t instanceof j)e=t,i=t;else{if(!(t instanceof R))return t?this.extend(F(t)||D(t)):this;if(i=t._northEast,!(e=t._southWest)||!i)return this}return o||n?(o.lat=Math.min(e.lat,o.lat),o.lng=Math.min(e.lng,o.lng),n.lat=Math.max(i.lat,n.lat),n.lng=Math.max(i.lng,n.lng)):(this._southWest=new j(e.lat,e.lng),this._northEast=new j(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,o=Math.abs(e.lat-i.lat)*t,n=Math.abs(e.lng-i.lng)*t;return new R(new j(e.lat-o,e.lng-n),new j(i.lat+o,i.lng+n))},getCenter:function(){return new j((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 j(this.getNorth(),this.getWest())},getSouthEast:function(){return new j(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(t){t="number"==typeof t[0]||t instanceof j||"lat"in t?F(t):D(t);var e,i,o=this._southWest,n=this._northEast;return t instanceof R?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=o.lat&&i.lat<=n.lat&&e.lng>=o.lng&&i.lng<=n.lng},intersects:function(t){t=D(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>=e.lat&&o.lat<=i.lat&&n.lng>=e.lng&&o.lng<=i.lng},overlaps:function(t){t=D(t);var e=this._southWest,i=this._northEast,o=t.getSouthWest(),n=t.getNorthEast();return n.lat>e.lat&&o.lat<i.lat&&n.lng>e.lng&&o.lng<i.lng},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=D(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},j.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+c(this.lat,t)+", "+c(this.lng,t)+")"},distanceTo:function(t){return H.distance(this,F(t))},wrap:function(){return H.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return D([this.lat-e,this.lng-i],[this.lat+e,this.lng+i])},clone:function(){return new j(this.lat,this.lng,this.alt)}};var U,W={latLngToPoint:function(t,e){var i=this.projection.project(t),o=this.scale(e);return this.transformation._transform(i,o)},pointToLatLng:function(t,e){var i=this.scale(e),o=this.transformation.untransform(t,i);return this.projection.unproject(o)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,i=this.scale(t);return new Z(this.transformation.transform(e.min,i),this.transformation.transform(e.max,i))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?h(t.lng,this.wrapLng,!0):t.lng;return new j(this.wrapLat?h(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),o=e.lat-i.lat,n=e.lng-i.lng;if(0===o&&0===n)return t;var s=t.getSouthWest(),r=t.getNorthEast();return new R(new j(s.lat-o,s.lng-n),new j(r.lat-o,r.lng-n))}},H=i({},W,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,o=t.lat*i,n=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),r=Math.sin((e.lng-t.lng)*i/2),a=s*s+Math.cos(o)*Math.cos(n)*r*r,h=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));return this.R*h}}),V=6378137,q={R:V,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,o=Math.max(Math.min(i,t.lat),-i),n=Math.sin(o*e);return new z(this.R*t.lng*e,this.R*Math.log((1+n)/(1-n))/2)},unproject:function(t){var e=180/Math.PI;return new j((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(U=V*Math.PI,new Z([-U,-U],[U,U]))};function G(t,e,i,o){if(g(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=i,this._d=o}function J(t,e,i,o){return new G(t,e,i,o)}G.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new z((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var K=i({},H,{code:"EPSG:3857",projection:q,transformation:function(){var t=.5/(Math.PI*q.R);return J(t,.5,-t,.5)}()}),Y=i({},K,{code:"EPSG:900913"});function Q(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t,e){var i,o,n,s,r,a,h="";for(i=0,n=t.length;i<n;i++){for(o=0,s=(r=t[i]).length;o<s;o++)h+=(o?"L":"M")+(a=r[o]).x+" "+a.y;h+=e?Et?"z":"x":""}return h||"M0 0"}var $=document.documentElement.style,tt="ActiveXObject"in window,et=tt&&!document.addEventListener,it="msLaunchUri"in navigator&&!("documentMode"in document),ot=It("webkit"),nt=It("android"),st=It("android 2")||It("android 3"),rt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=nt&&It("Google")&&rt<537&&!("AudioNode"in window),ht=!!window.opera,lt=!it&&It("chrome"),ct=It("gecko")&&!ot&&!ht&&!tt,ut=!lt&&It("safari"),pt=It("phantom"),dt="OTransition"in $,ft=0===navigator.platform.indexOf("Win"),mt=tt&&"transition"in $,_t="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,gt="MozPerspective"in $,yt=!window.L_DISABLE_3D&&(mt||_t||gt)&&!dt&&!pt,vt="undefined"!=typeof orientation||It("mobile"),bt=vt&&ot,wt=vt&&_t,xt=!window.PointerEvent&&window.MSPointerEvent,Lt=!(!window.PointerEvent&&!xt),Pt=!window.L_NO_TOUCH&&(Lt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),Mt=vt&&ht,Ct=vt&&ct,kt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,At=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",l,e),window.removeEventListener("testPassiveEventSupport",l,e)}catch(i){}return t}(),Tt=!!document.createElement("canvas").getContext,Et=!(!document.createElementNS||!Q("svg").createSVGRect),Ot=!Et&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(i){return!1}}();function It(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var zt={ie:tt,ielt9:et,edge:it,webkit:ot,android:nt,android23:st,androidStock:at,opera:ht,chrome:lt,gecko:ct,safari:ut,phantom:pt,opera12:dt,win:ft,ie3d:mt,webkit3d:_t,gecko3d:gt,any3d:yt,mobile:vt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:xt,pointer:Lt,touch:Pt,mobileOpera:Mt,mobileGecko:Ct,retina:kt,passiveEvents:At,canvas:Tt,svg:Et,vml:Ot},St=xt?"MSPointerDown":"pointerdown",Bt=xt?"MSPointerMove":"pointermove",Zt=xt?"MSPointerUp":"pointerup",Nt=xt?"MSPointerCancel":"pointercancel",Rt={},Dt=!1;function jt(t,e,i,o){return"touchstart"===e?Ut(t,i,o):"touchmove"===e?Gt(t,i,o):"touchend"===e&&Jt(t,i,o),this}function Ft(t,e,i){var o=t["_leaflet_"+e+i];return"touchstart"===e?t.removeEventListener(St,o,!1):"touchmove"===e?t.removeEventListener(Bt,o,!1):"touchend"===e&&(t.removeEventListener(Zt,o,!1),t.removeEventListener(Nt,o,!1)),this}function Ut(t,e,i){var o=n((function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&He(t),qt(t,e)}));t["_leaflet_touchstart"+i]=o,t.addEventListener(St,o,!1),Dt||(document.addEventListener(St,Wt,!0),document.addEventListener(Bt,Ht,!0),document.addEventListener(Zt,Vt,!0),document.addEventListener(Nt,Vt,!0),Dt=!0)}function Wt(t){Rt[t.pointerId]=t}function Ht(t){Rt[t.pointerId]&&(Rt[t.pointerId]=t)}function Vt(t){delete Rt[t.pointerId]}function qt(t,e){for(var i in t.touches=[],Rt)t.touches.push(Rt[i]);t.changedTouches=[t],e(t)}function Gt(t,e,i){var o=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||qt(t,e)};t["_leaflet_touchmove"+i]=o,t.addEventListener(Bt,o,!1)}function Jt(t,e,i){var o=function(t){qt(t,e)};t["_leaflet_touchend"+i]=o,t.addEventListener(Zt,o,!1),t.addEventListener(Nt,o,!1)}var Kt=xt?"MSPointerDown":Lt?"pointerdown":"touchstart",Yt=xt?"MSPointerUp":Lt?"pointerup":"touchend",Qt="_leaflet_";function Xt(t,e,i){var o,n,s=!1,r=250;function a(t){if(Lt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),i=e-(o||e);n=t.touches?t.touches[0]:t,s=i>0&&i<=r,o=e}function h(t){if(s&&!n.cancelBubble){if(Lt){if("mouse"===t.pointerType)return;var i,r,a={};for(r in n)a[r]=(i=n[r])&&i.bind?i.bind(n):i;n=a}n.type="dblclick",n.button=0,e(n),o=null}}return t[Qt+Kt+i]=a,t[Qt+Yt+i]=h,t[Qt+"dblclick"+i]=e,t.addEventListener(Kt,a,!!At&&{passive:!1}),t.addEventListener(Yt,h,!!At&&{passive:!1}),t.addEventListener("dblclick",e,!1),this}function $t(t,e){var i=t[Qt+Yt+e],o=t[Qt+"dblclick"+e];return t.removeEventListener(Kt,t[Qt+Kt+e],!!At&&{passive:!1}),t.removeEventListener(Yt,i,!!At&&{passive:!1}),t.removeEventListener("dblclick",o,!1),this}var te,ee,ie,oe,ne,se=xe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),re=xe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ae="webkitTransition"===re||"OTransition"===re?re+"End":"transitionend";function he(t){return"string"==typeof t?document.getElementById(t):t}function le(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!i||"auto"===i)&&document.defaultView){var o=document.defaultView.getComputedStyle(t,null);i=o?o[e]:null}return"auto"===i?null:i}function ce(t,e,i){var o=document.createElement(t);return o.className=e||"",i&&i.appendChild(o),o}function ue(t){var e=t.parentNode;e&&e.removeChild(t)}function pe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function de(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function fe(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function me(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=ve(t);return i.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(i)}function _e(t,e){if(void 0!==t.classList)for(var i=p(e),o=0,n=i.length;o<n;o++)t.classList.add(i[o]);else if(!me(t,e)){var s=ve(t);ye(t,(s?s+" ":"")+e)}}function ge(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,u((" "+ve(t)+" ").replace(" "+e+" "," ")))}function ye(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function ve(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function be(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&we(t,e)}function we(t,e){var i=!1,o="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(o)}catch(n){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+o+"(opacity="+e+")"}function xe(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function Le(t,e,i){var o=e||new z(0,0);t.style[se]=(mt?"translate("+o.x+"px,"+o.y+"px)":"translate3d("+o.x+"px,"+o.y+"px,0)")+(i?" scale("+i+")":"")}function Pe(t,e){t._leaflet_pos=e,yt?Le(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Me(t){return t._leaflet_pos||new z(0,0)}if("onselectstart"in document)te=function(){Se(window,"selectstart",He)},ee=function(){Ze(window,"selectstart",He)};else{var Ce=xe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);te=function(){if(Ce){var t=document.documentElement.style;ie=t[Ce],t[Ce]="none"}},ee=function(){Ce&&(document.documentElement.style[Ce]=ie,ie=void 0)}}function ke(){Se(window,"dragstart",He)}function Ae(){Ze(window,"dragstart",He)}function Te(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(Ee(),oe=t,ne=t.style.outline,t.style.outline="none",Se(window,"keydown",Ee))}function Ee(){oe&&(oe.style.outline=ne,oe=void 0,ne=void 0,Ze(window,"keydown",Ee))}function Oe(t){do{t=t.parentNode}while(!(t.offsetWidth&&t.offsetHeight||t===document.body));return t}function Ie(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var ze={TRANSFORM:se,TRANSITION:re,TRANSITION_END:ae,get:he,getStyle:le,create:ce,remove:ue,empty:pe,toFront:de,toBack:fe,hasClass:me,addClass:_e,removeClass:ge,setClass:ye,getClass:ve,setOpacity:be,testProp:xe,setTransform:Le,setPosition:Pe,getPosition:Me,disableTextSelection:te,enableTextSelection:ee,disableImageDrag:ke,enableImageDrag:Ae,preventOutline:Te,restoreOutline:Ee,getSizedParentNode:Oe,getScale:Ie};function Se(t,e,i,o){if("object"==typeof e)for(var n in e)De(t,n,e[n],i);else for(var s=0,r=(e=p(e)).length;s<r;s++)De(t,e[s],i,o);return this}var Be="_leaflet_events";function Ze(t,e,i,o){if("object"==typeof e)for(var n in e)je(t,n,e[n],i);else if(e)for(var s=0,r=(e=p(e)).length;s<r;s++)je(t,e[s],i,o);else{for(var a in t[Be])je(t,a,t[Be][a]);delete t[Be]}return this}function Ne(){if(Lt)return!(it||ut)}var Re={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function De(t,e,i,o){var n=e+r(i)+(o?"_"+r(o):"");if(t[Be]&&t[Be][n])return this;var s=function(e){return i.call(o||t,e||window.event)},a=s;Lt&&0===e.indexOf("touch")?jt(t,e,s,n):Pt&&"dblclick"===e&&!Ne()?Xt(t,s,n):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Re[e]||e,s,!!At&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?t.addEventListener(Re[e],s=function(e){e=e||window.event,Xe(t,e)&&a(e)},!1):t.addEventListener(e,a,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[Be]=t[Be]||{},t[Be][n]=s}function je(t,e,i,o){var n=e+r(i)+(o?"_"+r(o):""),s=t[Be]&&t[Be][n];if(!s)return this;Lt&&0===e.indexOf("touch")?Ft(t,e,n):Pt&&"dblclick"===e&&!Ne()?$t(t,n):"removeEventListener"in t?t.removeEventListener(Re[e]||e,s,!1):"detachEvent"in t&&t.detachEvent("on"+e,s),t[Be][n]=null}function Fe(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Qe(t),this}function Ue(t){return De(t,"wheel",Fe),this}function We(t){return Se(t,"mousedown touchstart dblclick",Fe),De(t,"click",Ye),this}function He(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ve(t){return He(t),Fe(t),this}function qe(t,e){if(!e)return new z(t.clientX,t.clientY);var i=Ie(e),o=i.boundingClientRect;return new z((t.clientX-o.left)/i.x-e.clientLeft,(t.clientY-o.top)/i.y-e.clientTop)}var Ge=ft&&lt?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function Je(t){return it?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/Ge:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var Ke={};function Ye(t){Ke[t.type]=!0}function Qe(t){var e=Ke[t.type];return Ke[t.type]=!1,e}function Xe(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(o){return!1}return i!==t}var $e={on:Se,off:Ze,stopPropagation:Fe,disableScrollPropagation:Ue,disableClickPropagation:We,preventDefault:He,stop:Ve,getMousePosition:qe,getWheelDelta:Je,fakeStop:Ye,skipped:Qe,isExternalTarget:Xe,addListener:Se,removeListener:Ze},ti=I.extend({run:function(t,e,i,o){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(o||.5,.2),this._startPos=Me(t),this._offset=e.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=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var i=this._startPos.add(this._offset.multiplyBy(t));e&&i._round(),Pe(this._el,i),this.fire("step")},_complete:function(){k(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),ei=I.extend({options:{crs:K,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(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=n(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=re&&yt&&!Mt&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Se(this._proxy,ae,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,o){return e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(F(t),e,this.options.maxBounds),o=o||{},this._stop(),this._loaded&&!o.reset&&!0!==o&&(void 0!==o.animate&&(o.zoom=i({animate:o.animate},o.zoom),o.pan=i({animate:o.animate,duration:o.duration},o.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,o.zoom):this._tryAnimatedPan(t,o.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,e),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t=t||(yt?this.options.zoomDelta:1)),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t=t||(yt?this.options.zoomDelta:1)),e)},setZoomAround:function(t,e,i){var o=this.getZoomScale(e),n=this.getSize().divideBy(2),s=(t instanceof z?t:this.latLngToContainerPoint(t)).subtract(n).multiplyBy(1-1/o),r=this.containerPointToLatLng(n.add(s));return this.setView(r,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():D(t);var i=B(e.paddingTopLeft||e.padding||[0,0]),o=B(e.paddingBottomRight||e.padding||[0,0]),n=this.getBoundsZoom(t,!1,i.add(o));if((n="number"==typeof e.maxZoom?Math.min(e.maxZoom,n):n)===1/0)return{center:t.getCenter(),zoom:n};var s=o.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),n),a=this.project(t.getNorthEast(),n);return{center:this.unproject(r.add(a).divideBy(2).add(s),n),zoom:n}},fitBounds:function(t,e){if(!(t=D(t)).isValid())throw new Error("Bounds are not valid.");var i=this._getBoundsCenterZoom(t,e);return this.setView(i.center,i.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=B(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new ti,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){_e(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,i){if(!1===(i=i||{}).animate||!yt)return this.setView(t,e,i);this._stop();var o=this.project(this.getCenter()),n=this.project(t),s=this.getSize(),r=this._zoom;t=F(t),e=void 0===e?r:e;var a=Math.max(s.x,s.y),h=a*this.getZoomScale(r,e),l=n.distanceTo(o)||1,c=1.42,u=c*c;function p(t){var e=(h*h-a*a+(t?-1:1)*u*u*l*l)/(2*(t?h:a)*u*l),i=Math.sqrt(e*e+1)-e;return i<1e-9?-18:Math.log(i)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function f(t){return(Math.exp(t)+Math.exp(-t))/2}function m(t){return d(t)/f(t)}var _=p(0);function g(t){return a*(f(_)/f(_+c*t))}function y(t){return a*(f(_)*m(_+c*t)-d(_))/u}function v(t){return 1-Math.pow(1-t,1.5)}var b=Date.now(),w=(p(1)-_)/c,x=i.duration?1e3*i.duration:1e3*w*.8;function L(){var i=(Date.now()-b)/x,s=v(i)*w;i<=1?(this._flyToFrame=C(L,this),this._move(this.unproject(o.add(n.subtract(o).multiplyBy(y(s)/l)),r),this.getScaleZoom(a/g(s),r),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}return this._moveStart(!0,i.noMoveStart),L.call(this),this},flyToBounds:function(t,e){var i=this._getBoundsCenterZoom(t,e);return this.flyTo(i.center,i.zoom,e)},setMaxBounds:function(t){return(t=D(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),o=this._limitCenter(i,this._zoom,D(t));return i.equals(o)||this.panTo(o,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=B((e=e||{}).paddingTopLeft||e.padding||[0,0]),o=B(e.paddingBottomRight||e.padding||[0,0]),n=this.getCenter(),s=this.project(n),r=this.project(t),a=this.getPixelBounds(),h=a.getSize().divideBy(2),l=N([a.min.add(i),a.max.subtract(o)]);if(!l.contains(r)){this._enforcingBounds=!0;var c=s.subtract(r),u=B(r.x+c.x,r.y+c.y);(r.x<l.min.x||r.x>l.max.x)&&(u.x=s.x-c.x,c.x>0?u.x+=h.x-i.x:u.x-=h.x-o.x),(r.y<l.min.y||r.y>l.max.y)&&(u.y=s.y-c.y,c.y>0?u.y+=h.y-i.y:u.y-=h.y-o.y),this.panTo(this.unproject(u),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=i({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),s=e.divideBy(2).round(),r=o.divideBy(2).round(),a=s.subtract(r);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(n(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:o})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=i({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=n(this._handleGeolocationResponse,this),o=n(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,o,t):navigator.geolocation.getCurrentPosition(e,o,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+i+"."})},_handleGeolocationResponse:function(t){var e=new j(t.coords.latitude,t.coords.longitude),i=e.toBounds(2*t.coords.accuracy),o=this._locateOptions;if(o.setView){var n=this.getBoundsZoom(i);this.setView(e,o.maxZoom?Math.min(n,o.maxZoom):n)}var s={latlng:e,bounds:i,timestamp:t.timestamp};for(var r in t.coords)"number"==typeof t.coords[r]&&(s[r]=t.coords[r]);this.fire("locationfound",s)},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){if(this._initEvents(!0),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(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ue(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(k(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ue(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var i=ce("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=i),i},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new R(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=D(t),i=B(i||[0,0]);var o=this.getZoom()||0,n=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),a=t.getSouthEast(),h=this.getSize().subtract(i),l=N(this.project(a,o),this.project(r,o)).getSize(),c=yt?this.options.zoomSnap:1,u=h.x/l.x,p=h.y/l.y,d=e?Math.max(u,p):Math.min(u,p);return o=this.getScaleZoom(d,o),c&&(o=Math.round(o/(c/100))*(c/100),o=e?Math.ceil(o/c)*c:Math.floor(o/c)*c),Math.max(n,Math.min(s,o))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var i=this._getTopLeftPoint(t,e);return new Z(i,i.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,o=i.zoom(t*i.scale(e=void 0===e?this._zoom:e));return isNaN(o)?1/0:o},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(B(t),e)},layerPointToLatLng:function(t){var e=B(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(D(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return B(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return B(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(B(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return qe(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=he(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Se(e,"scroll",this._onScroll,this),this._containerId=r(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&yt,_e(t,"leaflet-container"+(Pt?" leaflet-touch":"")+(kt?" leaflet-retina":"")+(et?" leaflet-oldie":"")+(ut?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=le(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Pe(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(_e(t.markerPane,"leaflet-zoom-hide"),_e(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){Pe(this._mapPane,new z(0,0));var i=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var o=this._zoom!==e;this._moveStart(o,!1)._move(t,e)._moveEnd(o),this.fire("viewreset"),i&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return k(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Pe(this._mapPane,this._getMapPanePos().subtract(t))},_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(t){this._targets={},this._targets[r(this._container)]=this;var e=t?Ze:Se;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),yt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){k(this._resizeRequest),this._resizeRequest=C((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,o=[],n="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,a=!1;s;){if((i=this._targets[r(s)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(i)){a=!0;break}if(i&&i.listens(e,!0)){if(n&&!Xe(s,t))break;if(o.push(i),n)break}if(s===this._container)break;s=s.parentNode}return o.length||a||n||!Xe(s,t)||(o=[this]),o},_handleDOMEvent:function(t){if(this._loaded&&!Qe(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||Te(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,o){if("click"===t.type){var n=i({},t);n.type="preclick",this._fireDOMEvent(n,n.type,o)}if(!t._stopped&&(o=(o||[]).concat(this._findEventTargets(t,e))).length){var s=o[0];"contextmenu"===e&&s.listens(e,!0)&&He(t);var r={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var a=s.getLatLng&&(!s._radius||s._radius<=10);r.containerPoint=a?this.latLngToContainerPoint(s.getLatLng()):this.mouseEventToContainerPoint(t),r.layerPoint=this.containerPointToLayerPoint(r.containerPoint),r.latlng=a?s.getLatLng():this.layerPointToLatLng(r.layerPoint)}for(var h=0;h<o.length;h++)if(o[h].fire(e,r,!0),r.originalEvent._stopped||!1===o[h].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Me(this._mapPane)||new z(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(o)},_latLngBoundsToNewLayerBounds:function(t,e,i){var o=this._getNewPixelOrigin(i,e);return N([this.project(t.getSouthWest(),e)._subtract(o),this.project(t.getNorthWest(),e)._subtract(o),this.project(t.getSouthEast(),e)._subtract(o),this.project(t.getNorthEast(),e)._subtract(o)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var o=this.project(t,e),n=this.getSize().divideBy(2),s=new Z(o.subtract(n),o.add(n)),r=this._getBoundsOffset(s,i,e);return r.round().equals([0,0])?t:this.unproject(o.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),o=new Z(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(o,e))},_getBoundsOffset:function(t,e,i){var o=N(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),n=o.min.subtract(t.min),s=o.max.subtract(t.max);return new z(this._rebound(n.x,-s.x),this._rebound(n.y,-s.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),o=yt?this.options.zoomSnap:1;return o&&(t=Math.round(t/o)*o),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){ge(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i)||(this.panBy(i,e),0))},_createAnimProxy:function(){var t=this._proxy=ce("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=se,i=this._proxy.style[e];Le(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ue(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();Le(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var o=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/o);return!(!0!==i.animate&&!this.getSize().contains(n)||(C((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),0))},_animateZoom:function(t,e,i,o){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,_e(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:o}),setTimeout(n(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&ge(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C((function(){this._moveEnd(!0)}),this))}});function ii(t,e){return new ei(t,e)}var oi=T.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),o=t._controlCorners[i];return _e(e,"leaflet-control"),-1!==i.indexOf("bottom")?o.insertBefore(e,o.firstChild):o.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ue(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),ni=function(t){return new oi(t)};ei.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",i=this._controlContainer=ce("div",e+"control-container",this._container);function o(o,n){t[o+n]=ce("div",e+o+" "+e+n,i)}o("top","left"),o("top","right"),o("bottom","left"),o("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ue(this._controlCorners[t]);ue(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var si=oi.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,o){return i<o?-1:o<i?1:0}},initialize:function(t,e,i){for(var o in d(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[o],o);for(o in e)this._addLayer(e[o],o,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return oi.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(r(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){_e(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(_e(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):ge(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return ge(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=ce("div",t),i=this.options.collapsed;e.setAttribute("aria-haspopup",!0),We(e),Ue(e);var o=this._section=ce("section",t+"-list");i&&(this._map.on("click",this.collapse,this),nt||Se(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var n=this._layersLink=ce("a",t+"-toggle",e);n.href="#",n.title="Layers",Pt?(Se(n,"click",Ve),Se(n,"click",this.expand,this)):Se(n,"focus",this.expand,this),i||this.expand(),this._baseLayersList=ce("div",t+"-base",o),this._separator=ce("div",t+"-separator",o),this._overlaysList=ce("div",t+"-overlays",o),e.appendChild(o)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&r(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(n((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;pe(this._baseLayersList),pe(this._overlaysList),this._layerControlInputs=[];var t,e,i,o,n=0;for(i=0;i<this._layers.length;i++)this._addItem(o=this._layers[i]),e=e||o.overlay,t=t||!o.overlay,n+=o.overlay?0:1;return this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&n>1)?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(r(t.target)),i=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)},_createRadioElement:function(t,e){var i='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",o=document.createElement("div");return o.innerHTML=i,o.firstChild},_addItem:function(t){var e,i=document.createElement("label"),o=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=o):e=this._createRadioElement("leaflet-base-layers_"+r(this),o),this._layerControlInputs.push(e),e.layerId=r(t.layer),Se(e,"click",this._onInputClick,this);var n=document.createElement("span");n.innerHTML=" "+t.name;var s=document.createElement("div");return i.appendChild(s),s.appendChild(e),s.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){var t,e,i=this._layerControlInputs,o=[],n=[];this._handlingClick=!0;for(var s=i.length-1;s>=0;s--)e=this._getLayer((t=i[s]).layerId).layer,t.checked?o.push(e):t.checked||n.push(e);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])&&this._map.removeLayer(n[s]);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])||this._map.addLayer(o[s]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,o=this._map.getZoom(),n=i.length-1;n>=0;n--)e=this._getLayer((t=i[n]).layerId).layer,t.disabled=void 0!==e.options.minZoom&&o<e.options.minZoom||void 0!==e.options.maxZoom&&o>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),ri=function(t,e,i){return new si(t,e,i)},ai=oi.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"&#x2212;",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=ce("div",e+" leaflet-bar"),o=this.options;return this._zoomInButton=this._createButton(o.zoomInText,o.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(o.zoomOutText,o.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,o,n){var s=ce("a",i,o);return s.innerHTML=t,s.href="#",s.title=e,s.setAttribute("role","button"),s.setAttribute("aria-label",e),We(s),Se(s,"click",Ve),Se(s,"click",n,this),Se(s,"click",this._refocusOnMap,this),s},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";ge(this._zoomInButton,e),ge(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&_e(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&_e(this._zoomInButton,e)}});ei.mergeOptions({zoomControl:!0}),ei.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new ai,this.addControl(this.zoomControl))}));var hi=function(t){return new ai(t)},li=oi.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=ce("div",e),o=this.options;return this._addScales(o,e+"-line",i),t.on(o.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=ce("div",e,i)),t.imperial&&(this._iScale=ce("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,i=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(i)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,o,n=3.2808399*t;n>5280?(i=this._getRoundNum(e=n/5280),this._updateScale(this._iScale,i+" mi",i/e)):(o=this._getRoundNum(n),this._updateScale(this._iScale,o+" ft",o/n))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1)}}),ci=function(t){return new li(t)},ui=oi.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=ce("div","leaflet-control-attribution"),We(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}}});ei.mergeOptions({attributionControl:!0}),ei.addInitHook((function(){this.options.attributionControl&&(new ui).addTo(this)}));var pi=function(t){return new ui(t)};oi.Layers=si,oi.Zoom=ai,oi.Scale=li,oi.Attribution=ui,ni.layers=ri,ni.zoom=hi,ni.scale=ci,ni.attribution=pi;var di=T.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});di.addTo=function(t,e){return t.addHandler(e,this),this};var fi,mi={Events:O},_i=Pt?"touchstart mousedown":"mousedown",gi={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},yi={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},vi=I.extend({options:{clickTolerance:3},initialize:function(t,e,i,o){d(this,o),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(Se(this._dragStartTarget,_i,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(vi._dragging===this&&this.finishDrag(),Ze(this._dragStartTarget,_i,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!me(this._element,"leaflet-zoom-anim")&&!(vi._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(vi._dragging=this,this._preventOutline&&Te(this._element),ke(),te(),this._moving)))){this.fire("down");var e=t.touches?t.touches[0]:t,i=Oe(this._element);this._startPoint=new z(e.clientX,e.clientY),this._parentScale=Ie(i),Se(document,yi[t.type],this._onMove,this),Se(document,gi[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,i=new z(e.clientX,e.clientY)._subtract(this._startPoint);(i.x||i.y)&&(Math.abs(i.x)+Math.abs(i.y)<this.options.clickTolerance||(i.x/=this._parentScale.x,i.y/=this._parentScale.y,He(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=Me(this._element).subtract(i),_e(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),_e(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(i),this._moving=!0,k(this._animRequest),this._lastEvent=t,this._animRequest=C(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Pe(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in ge(document.body,"leaflet-dragging"),this._lastTarget&&(ge(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),yi)Ze(document,yi[t],this._onMove,this),Ze(document,gi[t],this._onUp,this);Ae(),ee(),this._moved&&this._moving&&(k(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,vi._dragging=!1}});function bi(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=Li(t=Mi(t,i),i)}function wi(t,e,i){return Math.sqrt(Ei(t,e,i,!0))}function xi(t,e,i){return Ei(t,e,i)}function Li(t,e){var i=t.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(i);o[0]=o[i-1]=1,Pi(t,o,e,0,i-1);var n,s=[];for(n=0;n<i;n++)o[n]&&s.push(t[n]);return s}function Pi(t,e,i,o,n){var s,r,a,h=0;for(r=o+1;r<=n-1;r++)(a=Ei(t[r],t[o],t[n],!0))>h&&(s=r,h=a);h>i&&(e[s]=1,Pi(t,e,i,o,s),Pi(t,e,i,s,n))}function Mi(t,e){for(var i=[t[0]],o=1,n=0,s=t.length;o<s;o++)Ti(t[o],t[n])>e&&(i.push(t[o]),n=o);return n<s-1&&i.push(t[s-1]),i}function Ci(t,e,i,o,n){var s,r,a,h=o?fi:Ai(t,i),l=Ai(e,i);for(fi=l;;){if(!(h|l))return[t,e];if(h&l)return!1;a=Ai(r=ki(t,e,s=h||l,i,n),i),s===h?(t=r,h=a):(e=r,l=a)}}function ki(t,e,i,o,n){var s,r,a=e.x-t.x,h=e.y-t.y,l=o.min,c=o.max;return 8&i?(s=t.x+a*(c.y-t.y)/h,r=c.y):4&i?(s=t.x+a*(l.y-t.y)/h,r=l.y):2&i?(s=c.x,r=t.y+h*(c.x-t.x)/a):1&i&&(s=l.x,r=t.y+h*(l.x-t.x)/a),new z(s,r,n)}function Ai(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function Ti(t,e){var i=e.x-t.x,o=e.y-t.y;return i*i+o*o}function Ei(t,e,i,o){var n,s=e.x,r=e.y,a=i.x-s,h=i.y-r,l=a*a+h*h;return l>0&&((n=((t.x-s)*a+(t.y-r)*h)/l)>1?(s=i.x,r=i.y):n>0&&(s+=a*n,r+=h*n)),a=t.x-s,h=t.y-r,o?a*a+h*h:new z(s,r)}function Oi(t){return!g(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function Ii(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Oi(t)}var zi={simplify:bi,pointToSegmentDistance:wi,closestPointOnSegment:xi,clipSegment:Ci,_getEdgeIntersection:ki,_getBitCode:Ai,_sqClosestPointOnSegment:Ei,isFlat:Oi,_flat:Ii};function Si(t,e,i){var o,n,s,r,a,h,l,c,u,p=[1,4,2,8];for(n=0,l=t.length;n<l;n++)t[n]._code=Ai(t[n],e);for(r=0;r<4;r++){for(c=p[r],o=[],n=0,s=(l=t.length)-1;n<l;s=n++)h=t[s],(a=t[n])._code&c?h._code&c||((u=ki(h,a,c,e,i))._code=Ai(u,e),o.push(u)):(h._code&c&&((u=ki(h,a,c,e,i))._code=Ai(u,e),o.push(u)),o.push(a));t=o}return t}var Bi={clipPolygon:Si},Zi={project:function(t){return new z(t.lng,t.lat)},unproject:function(t){return new j(t.y,t.x)},bounds:new Z([-180,-90],[180,90])},Ni={R:6378137,R_MINOR:6356752.314245179,bounds:new Z([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,o=t.lat*e,n=this.R_MINOR/i,s=Math.sqrt(1-n*n),r=s*Math.sin(o),a=Math.tan(Math.PI/4-o/2)/Math.pow((1-r)/(1+r),s/2);return o=-i*Math.log(Math.max(a,1e-10)),new z(t.lng*e*i,o)},unproject:function(t){for(var e,i=180/Math.PI,o=this.R,n=this.R_MINOR/o,s=Math.sqrt(1-n*n),r=Math.exp(-t.y/o),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&Math.abs(l)>1e-7;h++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=l=Math.PI/2-2*Math.atan(r*e)-a;return new j(a*i,t.x*i/o)}},Ri={LonLat:Zi,Mercator:Ni,SphericalMercator:q},Di=i({},H,{code:"EPSG:3395",projection:Ni,transformation:function(){var t=.5/(Math.PI*Ni.R);return J(t,.5,-t,.5)}()}),ji=i({},H,{code:"EPSG:4326",projection:Zi,transformation:J(1/180,1,-1/180,.5)}),Fi=i({},W,{projection:Zi,transformation:J(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,o=e.lat-t.lat;return Math.sqrt(i*i+o*o)},infinite:!0});W.Earth=H,W.EPSG3395=Di,W.EPSG3857=K,W.EPSG900913=Y,W.EPSG4326=ji,W.Simple=Fi;var Ui=I.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[r(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[r(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var i=this.getEvents();e.on(i,this),this.once("remove",(function(){e.off(i,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});ei.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=r(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=r(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&r(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?g(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[r(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=r(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,i=this._getZoomSpan();for(var o in this._zoomBoundLayers){var n=this._zoomBoundLayers[o].options;t=void 0===n.minZoom?t:Math.min(t,n.minZoom),e=void 0===n.maxZoom?e:Math.max(e,n.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,i!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Wi=Ui.extend({initialize:function(t,e){var i,o;if(d(this,e),this._layers={},t)for(i=0,o=t.length;i<o;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,o=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,o);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return r(t)}}),Hi=function(t,e){return new Wi(t,e)},Vi=Wi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Wi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Wi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new R;for(var e in this._layers){var i=this._layers[e];t.extend(i.getBounds?i.getBounds():i.getLatLng())}return t}}),qi=function(t,e){return new Vi(t,e)},Gi=T.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){d(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(!i){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var o=this._createImg(i,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(o,t),o},_setIconStyles:function(t,e){var i=this.options,o=i[e+"Size"];"number"==typeof o&&(o=[o,o]);var n=B(o),s=B("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),s&&(t.style.marginLeft=-s.x+"px",t.style.marginTop=-s.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return kt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ji(t){return new Gi(t)}var Ki=Gi.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(t){return Ki.imagePath||(Ki.imagePath=this._detectIconPath()),(this.options.imagePath||Ki.imagePath)+Gi.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=ce("div","leaflet-default-icon-path",document.body),e=le(t,"background-image")||le(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Yi=di.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new vi(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),_e(t,"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&&ge(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,o=this._marker.options.autoPanSpeed,n=this._marker.options.autoPanPadding,s=Me(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),h=N(r.min._subtract(a).add(n),r.max._subtract(a).subtract(n));if(!h.contains(s)){var l=B((Math.max(h.max.x,s.x)-h.max.x)/(r.max.x-h.max.x)-(Math.min(h.min.x,s.x)-h.min.x)/(r.min.x-h.min.x),(Math.max(h.max.y,s.y)-h.max.y)/(r.max.y-h.max.y)-(Math.min(h.min.y,s.y)-h.min.y)/(r.min.y-h.min.y)).multiplyBy(o);i.panBy(l,{animate:!1}),this._draggable._newPos._add(l),this._draggable._startPos._add(l),Pe(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(k(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,o=Me(e._icon),n=e._map.layerPointToLatLng(o);i&&Pe(i,o),e._latlng=n,t.latlng=n,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){k(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Qi=Ui.extend({options:{icon:new Ki,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.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(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,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 t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),o=!1;i!==this._icon&&(this._icon&&this._removeIcon(),o=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),_e(i,e),t.keyboard&&(i.tabIndex="0"),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var n=t.icon.createShadow(this._shadow),s=!1;n!==this._shadow&&(this._removeShadow(),s=!0),n&&(_e(n,e),n.alt=""),this._shadow=n,t.opacity<1&&this._updateOpacity(),o&&this.getPane().appendChild(this._icon),this._initInteraction(),n&&s&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ue(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ue(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Pe(this._icon,t),this._shadow&&Pe(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(_e(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Yi)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Yi(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&be(this._icon,t),this._shadow&&be(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Xi(t,e){return new Qi(t,e)}var $i=Ui.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(t){this._renderer=t.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(t){return d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"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}}),to=$i.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return $i.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),o=[t+i,e+i];this._pxBounds=new Z(this._point.subtract(o),this._point.add(o))},_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(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function eo(t,e){return new to(t,e)}var io=to.extend({initialize:function(t,e,o){if("number"==typeof e&&(e=i({},o,{radius:e})),d(this,e),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new R(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:$i.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,i=this._map,o=i.options.crs;if(o.distance===H.distance){var n=Math.PI/180,s=this._mRadius/H.R/n,r=i.project([e+s,t]),a=i.project([e-s,t]),h=r.add(a).divideBy(2),l=i.unproject(h).lat,c=Math.acos((Math.cos(s*n)-Math.sin(e*n)*Math.sin(l*n))/(Math.cos(e*n)*Math.cos(l*n)))/n;(isNaN(c)||0===c)&&(c=s/Math.cos(Math.PI/180*e)),this._point=h.subtract(i.getPixelOrigin()),this._radius=isNaN(c)?0:h.x-i.project([l,t-c]).x,this._radiusY=h.y-r.y}else{var u=o.unproject(o.project(this._latlng).subtract([this._mRadius,0]));this._point=i.latLngToLayerPoint(this._latlng),this._radius=this._point.x-i.latLngToLayerPoint(u).x}this._updateBounds()}});function oo(t,e,i){return new io(t,e,i)}var no=$i.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,i,o=1/0,n=null,s=Ei,r=0,a=this._parts.length;r<a;r++)for(var h=this._parts[r],l=1,c=h.length;l<c;l++){var u=s(t,e=h[l-1],i=h[l],!0);u<o&&(o=u,n=s(t,e,i))}return n&&(n.distance=Math.sqrt(o)),n},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,i,o,n,s,r,a=this._rings[0],h=a.length;if(!h)return null;for(t=0,e=0;t<h-1;t++)e+=a[t].distanceTo(a[t+1])/2;if(0===e)return this._map.layerPointToLatLng(a[0]);for(t=0,o=0;t<h-1;t++)if((o+=i=(n=a[t]).distanceTo(s=a[t+1]))>e)return this._map.layerPointToLatLng([s.x-(r=(o-e)/i)*(s.x-n.x),s.y-r*(s.y-n.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new R,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Oi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=Oi(t),o=0,n=t.length;o<n;o++)i?(e[o]=F(t[o]),this._bounds.extend(e[o])):e[o]=this._convertLatLngs(t[o]);return e},_project:function(){var t=new Z;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new z(t,t);this._pxBounds=new Z([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,i){var o,n,s=t.length;if(t[0]instanceof j){for(n=[],o=0;o<s;o++)n[o]=this._map.latLngToLayerPoint(t[o]),i.extend(n[o]);e.push(n)}else for(o=0;o<s;o++)this._projectLatlngs(t[o],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,i,o,n,s,r,a,h=this._parts;for(e=0,o=0,n=this._rings.length;e<n;e++)for(i=0,s=(a=this._rings[e]).length;i<s-1;i++)(r=Ci(a[i],a[i+1],t,i,!0))&&(h[o]=h[o]||[],h[o].push(r[0]),r[1]===a[i+1]&&i!==s-2||(h[o].push(r[1]),o++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,o=t.length;i<o;i++)t[i]=bi(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,o,n,s,r,a,h=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(o=0,n=(r=(a=this._parts[i]).length)-1;o<r;n=o++)if((e||0!==o)&&wi(t,a[n],a[o])<=h)return!0;return!1}});function so(t,e){return new no(t,e)}no._flat=Ii;var ro=no.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()");var t,e,i,o,n,s,r,a,h=this._rings[0],l=h.length;if(!l)return null;for(s=r=a=0,t=0,e=l-1;t<l;e=t++)r+=((i=h[t]).x+(o=h[e]).x)*(n=i.y*o.x-o.y*i.x),a+=(i.y+o.y)*n,s+=3*n;return this._map.layerPointToLatLng(0===s?h[0]:[r/s,a/s])},_convertLatLngs:function(t){var e=no.prototype._convertLatLngs.call(this,t),i=e.length;return i>=2&&e[0]instanceof j&&e[0].equals(e[i-1])&&e.pop(),e},_setLatLngs:function(t){no.prototype._setLatLngs.call(this,t),Oi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Oi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,i=new z(e,e);if(t=new Z(t.min.subtract(i),t.max.add(i)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var o,n=0,s=this._rings.length;n<s;n++)(o=Si(this._rings[n],t,!0)).length&&this._parts.push(o)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,o,n,s,r,a,h,l=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,a=this._parts.length;n<a;n++)for(s=0,r=(h=(e=this._parts[n]).length)-1;s<h;r=s++)(i=e[s]).y>t.y!=(o=e[r]).y>t.y&&t.x<(o.x-i.x)*(t.y-i.y)/(o.y-i.y)+i.x&&(l=!l);return l||no.prototype._containsPoint.call(this,t,!0)}});function ao(t,e){return new ro(t,e)}var ho=Vi.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,o,n=g(t)?t:t.features;if(n){for(e=0,i=n.length;e<i;e++)((o=n[e]).geometries||o.geometry||o.features||o.coordinates)&&this.addData(o);return this}var s=this.options;if(s.filter&&!s.filter(t))return this;var r=lo(t,s);return r?(r.feature=go(t),r.defaultOptions=r.options,this.resetStyle(r),s.onEachFeature&&s.onEachFeature(t,r),this.addLayer(r)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=i({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function lo(t,e){var i,o,n,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],l=e&&e.pointToLayer,c=e&&e.coordsToLatLng||uo;if(!a&&!r)return null;switch(r.type){case"Point":return co(l,t,i=c(a),e);case"MultiPoint":for(n=0,s=a.length;n<s;n++)i=c(a[n]),h.push(co(l,t,i,e));return new Vi(h);case"LineString":case"MultiLineString":return o=po(a,"LineString"===r.type?0:1,c),new no(o,e);case"Polygon":case"MultiPolygon":return o=po(a,"Polygon"===r.type?1:2,c),new ro(o,e);case"GeometryCollection":for(n=0,s=r.geometries.length;n<s;n++){var u=lo({geometry:r.geometries[n],type:"Feature",properties:t.properties},e);u&&h.push(u)}return new Vi(h);default:throw new Error("Invalid GeoJSON object.")}}function co(t,e,i,o){return t?t(e,i):new Qi(i,o&&o.markersInheritOptions&&o)}function uo(t){return new j(t[1],t[0],t[2])}function po(t,e,i){for(var o,n=[],s=0,r=t.length;s<r;s++)o=e?po(t[s],e-1,i):(i||uo)(t[s]),n.push(o);return n}function fo(t,e){return e="number"==typeof e?e:6,void 0!==t.alt?[c(t.lng,e),c(t.lat,e),c(t.alt,e)]:[c(t.lng,e),c(t.lat,e)]}function mo(t,e,i,o){for(var n=[],s=0,r=t.length;s<r;s++)n.push(e?mo(t[s],e-1,i,o):fo(t[s],o));return!e&&i&&n.push(n[0]),n}function _o(t,e){return t.feature?i({},t.feature,{geometry:e}):go(e)}function go(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var yo={toGeoJSON:function(t){return _o(this,{type:"Point",coordinates:fo(this.getLatLng(),t)})}};function vo(t,e){return new ho(t,e)}Qi.include(yo),io.include(yo),to.include(yo),no.include({toGeoJSON:function(t){var e=!Oi(this._latlngs);return _o(this,{type:(e?"Multi":"")+"LineString",coordinates:mo(this._latlngs,e?1:0,!1,t)})}}),ro.include({toGeoJSON:function(t){var e=!Oi(this._latlngs),i=e&&!Oi(this._latlngs[0]),o=mo(this._latlngs,i?2:e?1:0,!0,t);return e||(o=[o]),_o(this,{type:(i?"Multi":"")+"Polygon",coordinates:o})}}),Wi.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(i){e.push(i.toGeoJSON(t).geometry.coordinates)})),_o(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var i="GeometryCollection"===e,o=[];return this.eachLayer((function(e){if(e.toGeoJSON){var n=e.toGeoJSON(t);if(i)o.push(n.geometry);else{var s=go(n);"FeatureCollection"===s.type?o.push.apply(o,s.features):o.push(s)}}})),i?_o(this,{geometries:o,type:"GeometryCollection"}):{type:"FeatureCollection",features:o}}});var bo=vo,wo=Ui.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=D(e),d(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(_e(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ue(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&de(this._image),this},bringToBack:function(){return this._map&&fe(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=D(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:ce("img");_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onload=n(this.fire,this,"load"),e.onerror=n(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),i=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Le(this._image,i,e)},_reset:function(){var t=this._image,e=new Z(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Pe(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){be(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&null!=this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),xo=function(t,e,i){return new wo(t,e,i)},Lo=wo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:ce("video");if(_e(e,"leaflet-image-layer"),this._zoomAnimated&&_e(e,"leaflet-zoom-animated"),this.options.className&&_e(e,this.options.className),e.onselectstart=l,e.onmousemove=l,e.onloadeddata=n(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),o=[],s=0;s<i.length;s++)o.push(i[s].src);this._url=i.length>0?o:[e.src]}else{g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var r=0;r<this._url.length;r++){var a=ce("source");a.src=this._url[r],e.appendChild(a)}}}});function Po(t,e,i){return new Lo(t,e,i)}var Mo=wo.extend({_initImage:function(){var t=this._image=this._url;_e(t,"leaflet-image-layer"),this._zoomAnimated&&_e(t,"leaflet-zoom-animated"),this.options.className&&_e(t,this.options.className),t.onselectstart=l,t.onmousemove=l}});function Co(t,e,i){return new Mo(t,e,i)}var ko=Ui.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){d(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&be(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&be(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(be(this._container,0),this._removeTimeout=setTimeout(n(ue,void 0,this._container),200)):ue(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,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 t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&de(this._container),this},bringToBack:function(){return this._map&&fe(this._container),this},_prepareOpen:function(t,e,i){if(e instanceof Ui||(i=e,e=t),e instanceof Vi)for(var o in t._layers){e=t._layers[o];break}if(!i)if(e.getCenter)i=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");i=e.getLatLng()}return this._source=e,this.update(),i},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=B(this.options.offset),i=this._getAnchor();this._zoomAnimated?Pe(this._container,t.add(i)):e=e.add(t).add(i);var o=this._containerBottom=-e.y,n=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=o+"px",this._container.style.left=n+"px"}},_getAnchor:function(){return[0,0]}}),Ao=ko.extend({options:{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(t){return t.openPopup(this),this},onAdd:function(t){ko.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof $i||this._source.on("preclick",Fe))},onRemove:function(t){ko.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof $i||this._source.off("preclick",Fe))},getEvents:function(){var t=ko.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=ce("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=ce("div",t+"-content-wrapper",e);if(this._contentNode=ce("div",t+"-content",i),We(e),Ue(this._contentNode),Se(e,"contextmenu",Fe),this._tipContainer=ce("div",t+"-tip-container",e),this._tip=ce("div",t+"-tip",this._tipContainer),this.options.closeButton){var o=this._closeButton=ce("a",t+"-close-button",e);o.href="#close",o.innerHTML="&#215;",Se(o,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var i=t.offsetWidth;i=Math.min(i,this.options.maxWidth),i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="";var o=this.options.maxHeight,n="leaflet-popup-scrolled";o&&t.offsetHeight>o?(e.height=o+"px",_e(t,n)):ge(t,n),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),i=this._getAnchor();Pe(this._container,e.add(i))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(le(this._container,"marginBottom"),10)||0,i=this._container.offsetHeight+e,o=this._containerWidth,n=new z(this._containerLeft,-i-this._containerBottom);n._add(Me(this._container));var s=t.layerPointToContainerPoint(n),r=B(this.options.autoPanPadding),a=B(this.options.autoPanPaddingTopLeft||r),h=B(this.options.autoPanPaddingBottomRight||r),l=t.getSize(),c=0,u=0;s.x+o+h.x>l.x&&(c=s.x+o-l.x+h.x),s.x-c-a.x<0&&(c=s.x-a.x),s.y+i+h.y>l.y&&(u=s.y+i-l.y+h.y),s.y-u-a.y<0&&(u=s.y-a.y),(c||u)&&t.fire("autopanstart").panBy([c,u])}},_onCloseButtonClick:function(t){this._close(),Ve(t)},_getAnchor:function(){return B(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),To=function(t,e){return new Ao(t,e)};ei.mergeOptions({closePopupOnClick:!0}),ei.include({openPopup:function(t,e,i){return t instanceof Ao||(t=new Ao(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),Ui.include({bindPopup:function(t,e){return t instanceof Ao?(d(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new Ao(e,this)),this._popup.setContent(t)),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(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(Ve(t),e instanceof $i?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var Eo=ko.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){ko.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){ko.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=ko.prototype.getEvents.call(this);return Pt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){this._contentNode=this._container=ce("div","leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i,o=this._map,n=this._container,s=o.latLngToContainerPoint(o.getCenter()),r=o.layerPointToContainerPoint(t),a=this.options.direction,h=n.offsetWidth,l=n.offsetHeight,c=B(this.options.offset),u=this._getAnchor();"top"===a?(e=h/2,i=l):"bottom"===a?(e=h/2,i=0):"center"===a?(e=h/2,i=l/2):"right"===a?(e=0,i=l/2):"left"===a?(e=h,i=l/2):r.x<s.x?(a="right",e=0,i=l/2):(a="left",e=h+2*(c.x+u.x),i=l/2),t=t.subtract(B(e,i,!0)).add(c).add(u),ge(n,"leaflet-tooltip-right"),ge(n,"leaflet-tooltip-left"),ge(n,"leaflet-tooltip-top"),ge(n,"leaflet-tooltip-bottom"),_e(n,"leaflet-tooltip-"+a),Pe(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&be(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return B(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Oo=function(t,e){return new Eo(t,e)};ei.include({openTooltip:function(t,e,i){return t instanceof Eo||(t=new Eo(i).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),Ui.include({bindTooltip:function(t,e){return t instanceof Eo?(d(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new Eo(e,this)),this._tooltip.setContent(t)),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(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),Pt&&(i.click=this._openTooltip)),this[e](i),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(_e(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(ge(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){this._tooltip&&this._map&&this.openTooltip(t.layer||t.target,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,i,o=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),i=this._map.containerPointToLayerPoint(e),o=this._map.layerPointToLatLng(i)),this._tooltip.setLatLng(o)}});var Io=Gi.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),i=this.options;if(i.html instanceof Element?(pe(e),e.appendChild(i.html)):e.innerHTML=!1!==i.html?i.html:"",i.bgPos){var o=B(i.bgPos);e.style.backgroundPosition=-o.x+"px "+-o.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});function zo(t){return new Io(t)}Gi.Default=Ki;var So=Ui.extend({options:{tileSize:256,opacity:1,updateWhenIdle:vt,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(t){d(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ue(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(de(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof z?t:new z(t,t)},_updateZIndex:function(){this._container&&null!=this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,o=-t(-1/0,1/0),n=0,s=i.length;n<s;n++)e=i[n].style.zIndex,i[n]!==this._container&&e&&(o=t(o,+e));isFinite(o)&&(this.options.zIndex=o+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!et){be(this._container,this.options.opacity);var t=+new Date,e=!1,i=!1;for(var o in this._tiles){var n=this._tiles[o];if(n.current&&n.loaded){var s=Math.min(1,(t-n.loaded)/200);be(n.el,s),s<1?e=!0:(n.active?i=!0:this._onOpaqueTile(n),n.active=!0)}}i&&!this._noPrune&&this._pruneTiles(),e&&(k(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:l,_initContainer:function(){this._container||(this._container=ce("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(ue(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var o=this._levels[t],n=this._map;return o||((o=this._levels[t]={}).el=ce("div","leaflet-tile-container leaflet-zoom-animated",this._container),o.el.style.zIndex=e,o.origin=n.project(n.unproject(n.getPixelOrigin()),t).round(),o.zoom=t,this._setZoomTransform(o,n.getCenter(),n.getZoom()),l(o.el.offsetWidth),this._onCreateLevel(o)),this._level=o,o}},_onUpdateLevel:l,_onRemoveLevel:l,_onCreateLevel:l,_pruneTiles:function(){if(this._map){var t,e,i=this._map.getZoom();if(i>this.options.maxZoom||i<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var o=e.coords;this._retainParent(o.x,o.y,o.z,o.z-5)||this._retainChildren(o.x,o.y,o.z,o.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ue(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,o){var n=Math.floor(t/2),s=Math.floor(e/2),r=i-1,a=new z(+n,+s);a.z=+r;var h=this._tileCoordsToKey(a),l=this._tiles[h];return l&&l.active?(l.retain=!0,!0):(l&&l.loaded&&(l.retain=!0),r>o&&this._retainParent(n,s,r,o))},_retainChildren:function(t,e,i,o){for(var n=2*t;n<2*t+2;n++)for(var s=2*e;s<2*e+2;s++){var r=new z(n,s);r.z=i+1;var a=this._tileCoordsToKey(r),h=this._tiles[a];h&&h.active?h.retain=!0:(h&&h.loaded&&(h.retain=!0),i+1<o&&this._retainChildren(n,s,i+1,o))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,o){var n=Math.round(e);n=void 0!==this.options.maxZoom&&n>this.options.maxZoom||void 0!==this.options.minZoom&&n<this.options.minZoom?void 0:this._clampZoom(n),o&&!(this.options.updateWhenZooming&&n!==this._tileZoom)||(this._tileZoom=n,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==n&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var o=this._map.getZoomScale(i,t.zoom),n=t.origin.multiplyBy(o).subtract(this._map._getNewPixelOrigin(e,i)).round();yt?Le(t.el,n,o):Pe(t.el,n)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),o=this._tileZoom,n=this._map.getPixelWorldBounds(this._tileZoom);n&&(this._globalTileRange=this._pxBoundsToTileRange(n)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],o).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],o).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],o).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],o).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),o=e.getZoomScale(i,this._tileZoom),n=e.project(t,this._tileZoom).floor(),s=e.getSize().divideBy(2*o);return new Z(n.subtract(s),n.add(s))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var o=this._getTiledPixelBounds(t),n=this._pxBoundsToTileRange(o),s=n.getCenter(),r=[],a=this.options.keepBuffer,h=new Z(n.getBottomLeft().subtract([a,-a]),n.getTopRight().add([a,-a]));if(!(isFinite(n.min.x)&&isFinite(n.min.y)&&isFinite(n.max.x)&&isFinite(n.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var l in this._tiles){var c=this._tiles[l].coords;c.z===this._tileZoom&&h.contains(new z(c.x,c.y))||(this._tiles[l].current=!1)}if(Math.abs(i-this._tileZoom)>1)this._setView(t,i);else{for(var u=n.min.y;u<=n.max.y;u++)for(var p=n.min.x;p<=n.max.x;p++){var d=new z(p,u);if(d.z=this._tileZoom,this._isValidTile(d)){var f=this._tiles[this._tileCoordsToKey(d)];f?f.current=!0:r.push(d)}}if(r.sort((function(t,e){return t.distanceTo(s)-e.distanceTo(s)})),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));var m=document.createDocumentFragment();for(p=0;p<r.length;p++)this._addTile(r[p],m);this._level.el.appendChild(m)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}if(!this.options.bounds)return!0;var o=this._tileCoordsToBounds(t);return D(this.options.bounds).overlaps(o)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),o=t.scaleBy(i),n=o.add(i);return[e.unproject(o,t.z),e.unproject(n,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),i=new R(e[0],e[1]);return this.options.noWrap||(i=this._map.wrapLatLngBounds(i)),i},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),i=new z(+e[0],+e[1]);return i.z=+e[2],i},_removeTile:function(t){var e=this._tiles[t];e&&(ue(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){_e(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=l,t.onmousemove=l,et&&this.options.opacity<1&&be(t,this.options.opacity),nt&&!st&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var i=this._getTilePos(t),o=this._tileCoordsToKey(t),s=this.createTile(this._wrapCoords(t),n(this._tileReady,this,t));this._initTile(s),this.createTile.length<2&&C(n(this._tileReady,this,t,null,s)),Pe(s,i),this._tiles[o]={el:s,coords:t,current:!0},e.appendChild(s),this.fire("tileloadstart",{tile:s,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var o=this._tileCoordsToKey(t);(i=this._tiles[o])&&(i.loaded=+new Date,this._map._fadeAnimated?(be(i.el,0),k(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(_e(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),et||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(n(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new z(this._wrapX?h(t.x,this._wrapX):t.x,this._wrapY?h(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new Z(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Bo(t){return new So(t)}var Zo=So.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&kt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),nt||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return Se(i,"load",n(this._tileOnLoad,this,e,i)),Se(i,"error",n(this._tileOnError,this,e,i)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i.alt="",i.setAttribute("role","presentation"),i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:kt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-t.y;this.options.tms&&(e.y=o),e["-y"]=o}return _(this._url,i(e,this.options))},_tileOnLoad:function(t,e){et?setTimeout(n(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var o=this.options.errorTileUrl;o&&e.getAttribute("src")!==o&&(e.src=o),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom;return this.options.zoomReverse&&(t=this.options.maxZoom-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=l,e.onerror=l,e.complete||(e.src=v,ue(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",v),So.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==v))return So.prototype._tileReady.call(this,t,e,i)}});function No(t,e){return new Zo(t,e)}var Ro=Zo.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var o=i({},this.defaultWmsParams);for(var n in e)n in this.options||(o[n]=e[n]);var s=(e=d(this,e)).detectRetina&&kt?2:1,r=this.getTileSize();o.width=r.x*s,o.height=r.y*s,this.wmsParams=o},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version),this.wmsParams[this._wmsVersion>=1.3?"crs":"srs"]=this._crs.code,Zo.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,o=N(i.project(e[0]),i.project(e[1])),n=o.min,s=o.max,r=(this._wmsVersion>=1.3&&this._crs===ji?[n.y,n.x,s.y,s.x]:[n.x,n.y,s.x,s.y]).join(","),a=Zo.prototype.getTileUrl.call(this,t);return a+f(this.wmsParams,a,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+r},setParams:function(t,e){return i(this.wmsParams,t),e||this.redraw(),this}});function Do(t,e){return new Ro(t,e)}Zo.WMS=Ro,No.wms=Do;var jo=Ui.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),r(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&_e(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 t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),o=Me(this._container),n=this._map.getSize().multiplyBy(.5+this.options.padding),s=this._map.project(this._center,e),r=this._map.project(t,e).subtract(s),a=n.multiplyBy(-i).add(o).add(n).subtract(r);yt?Le(this._container,a,i):Pe(this._container,a)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new Z(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fo=jo.extend({getEvents:function(){var t=jo.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){jo.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Se(t,"mousemove",this._onMouseMove,this),Se(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Se(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){k(this._redrawRequest),delete this._ctx,ue(this._container),Ze(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){jo.prototype._update.call(this);var t=this._bounds,e=this._container,i=t.getSize(),o=kt?2:1;Pe(e,t.min),e.width=o*i.x,e.height=o*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",kt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){jo.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[r(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,o=e.prev;i?i.prev=o:this._drawLast=o,o?o.next=i:this._drawFirst=i,delete t._order,delete this._layers[r(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){var e,i,o=t.options.dashArray.split(/[, ]+/),n=[];for(i=0;i<o.length;i++){if(e=Number(o[i]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Z,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_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 t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.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 t,e=this._redrawBounds;if(this._ctx.save(),e){var i=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,i.x,i.y),this._ctx.clip()}this._drawing=!0;for(var o=this._drawFirst;o;o=o.next)t=o.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,o,n,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(h.beginPath(),i=0;i<a;i++){for(o=0,n=r[i].length;o<n;o++)h[o?"lineTo":"moveTo"]((s=r[i][o]).x,s.y);e&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,i=this._ctx,o=Math.max(Math.round(t._radius),1),n=(Math.max(Math.round(t._radiusY),1)||o)/o;1!==n&&(i.save(),i.scale(1,n)),i.beginPath(),i.arc(e.x,e.y/n,o,0,2*Math.PI,!1),1!==n&&i.restore(),this._fillStroke(i,t)}},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,o=this._map.mouseEventToLayerPoint(t),n=this._drawFirst;n;n=n.next)(e=n.layer).options.interactive&&e._containsPoint(o)&&("click"!==t.type&&"preclick"===t.type||!this._map._draggableMoved(e))&&(i=e);i&&(Ye(t),this._fireEvent([i],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(ge(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,o,s=this._drawFirst;s;s=s.next)(i=s.layer).options.interactive&&i._containsPoint(e)&&(o=i);o!==this._hoveredLayer&&(this._handleMouseOut(t),o&&(_e(this._container,"leaflet-interactive"),this._fireEvent([o],t,"mouseover"),this._hoveredLayer=o)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(n((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;i&&(i.prev=o,o?o.next=i:i&&(this._drawFirst=i),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var i=e.next,o=e.prev;o&&(o.next=i,i?i.prev=o:o&&(this._drawLast=o),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function Uo(t){return Tt?new Fo(t):null}var Wo=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),Ho={_initContainer:function(){this._container=ce("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(jo.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Wo("shape");_e(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Wo("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ue(e),t.removeInteractiveTarget(e),delete this._layers[r(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,o=t.options,n=t._container;n.stroked=!!o.stroke,n.filled=!!o.fill,o.stroke?(e||(e=t._stroke=Wo("stroke")),n.appendChild(e),e.weight=o.weight+"px",e.color=o.color,e.opacity=o.opacity,e.dashStyle=o.dashArray?g(o.dashArray)?o.dashArray.join(" "):o.dashArray.replace(/( *, *)/g," "):"",e.endcap=o.lineCap.replace("butt","flat"),e.joinstyle=o.lineJoin):e&&(n.removeChild(e),t._stroke=null),o.fill?(i||(i=t._fill=Wo("fill")),n.appendChild(i),i.color=o.fillColor||o.color,i.opacity=o.fillOpacity):i&&(n.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),o=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+o+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){de(t._container)},_bringToBack:function(t){fe(t._container)}},Vo=Ot?Wo:Q,qo=jo.extend({getEvents:function(){var t=jo.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=Vo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ue(this._container),Ze(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){jo.prototype._update.call(this);var t=this._bounds,e=t.getSize(),i=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Pe(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=Vo("path");t.options.className&&_e(e,t.options.className),t.options.interactive&&_e(e,"leaflet-interactive"),this._updateStyle(t),this._layers[r(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ue(t._path),t.removeInteractiveTarget(t._path),delete this._layers[r(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,i=t.options;e&&(i.stroke?(e.setAttribute("stroke",i.color),e.setAttribute("stroke-opacity",i.opacity),e.setAttribute("stroke-width",i.weight),e.setAttribute("stroke-linecap",i.lineCap),e.setAttribute("stroke-linejoin",i.lineJoin),i.dashArray?e.setAttribute("stroke-dasharray",i.dashArray):e.removeAttribute("stroke-dasharray"),i.dashOffset?e.setAttribute("stroke-dashoffset",i.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),i.fill?(e.setAttribute("fill",i.fillColor||i.color),e.setAttribute("fill-opacity",i.fillOpacity),e.setAttribute("fill-rule",i.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,X(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),o="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",n=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+o+2*i+",0 "+o+2*-i+",0 ";this._setPath(t,n)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){de(t._path)},_bringToBack:function(t){fe(t._path)}});function Go(t){return Et||Ot?new qo(t):null}Ot&&qo.include(Ho),ei.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&Uo(t)||Go(t)}});var Jo=ro.extend({initialize:function(t,e){ro.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=D(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Ko(t,e){return new Jo(t,e)}qo.create=Vo,qo.pointsToPath=X,ho.geometryToLayer=lo,ho.coordsToLatLng=uo,ho.coordsToLatLngs=po,ho.latLngToCoords=fo,ho.latLngsToCoords=mo,ho.getFeature=_o,ho.asFeature=go,ei.mergeOptions({boxZoom:!0});var Yo=di.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Se(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ze(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ue(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),te(),ke(),this._startPoint=this._map.mouseEventToContainerPoint(t),Se(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=ce("div","leaflet-zoom-box",this._container),_e(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new Z(this._point,this._startPoint),i=e.getSize();Pe(this._box,e.min),this._box.style.width=i.x+"px",this._box.style.height=i.y+"px"},_finish:function(){this._moved&&(ue(this._box),ge(this._container,"leaflet-crosshair")),ee(),Ae(),Ze(document,{contextmenu:Ve,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(n(this._resetState,this),0);var e=new R(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});ei.addInitHook("addHandler","boxZoom",Yo),ei.mergeOptions({doubleClickZoom:!0});var Qo=di.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),o=e.options.zoomDelta,n=t.originalEvent.shiftKey?i-o:i+o;"center"===e.options.doubleClickZoom?e.setZoom(n):e.setZoomAround(t.containerPoint,n)}});ei.addInitHook("addHandler","doubleClickZoom",Qo),ei.mergeOptions({dragging:!0,inertia:!st,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Xo=di.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new vi(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}_e(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){ge(this._map._container,"leaflet-grab"),ge(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 t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=D(this._map.options.maxBounds);this._offsetLimit=N(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(i),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,o=this._draggable._newPos.x,n=(o-e+i)%t+e-i,s=(o+e+i)%t-e-i,r=Math.abs(n+i)<Math.abs(s+i)?n:s;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=r},_onDragEnd:function(t){var e=this._map,i=e.options,o=!i.inertia||this._times.length<2;if(e.fire("dragend",t),o)e.fire("moveend");else{this._prunePositions(+new Date);var n=this._lastPos.subtract(this._positions[0]),s=i.easeLinearity,r=n.multiplyBy(s/((this._lastTime-this._times[0])/1e3)),a=r.distanceTo([0,0]),h=Math.min(i.inertiaMaxSpeed,a),l=r.multiplyBy(h/a),c=h/(i.inertiaDeceleration*s),u=l.multiplyBy(-c/2).round();u.x||u.y?(u=e._limitOffset(u,e.options.maxBounds),C((function(){e.panBy(u,{duration:c,easeLinearity:s,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});ei.addInitHook("addHandler","dragging",Xo),ei.mergeOptions({keyboard:!0,keyboardPanDelta:80});var $o=di.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Se(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Ze(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 t=document.body,e=document.documentElement,i=t.scrollTop||e.scrollTop,o=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(o,i)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,i,o=this._panKeys={},n=this.keyCodes;for(e=0,i=n.left.length;e<i;e++)o[n.left[e]]=[-1*t,0];for(e=0,i=n.right.length;e<i;e++)o[n.right[e]]=[t,0];for(e=0,i=n.down.length;e<i;e++)o[n.down[e]]=[0,t];for(e=0,i=n.up.length;e<i;e++)o[n.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,i,o=this._zoomKeys={},n=this.keyCodes;for(e=0,i=n.zoomIn.length;e<i;e++)o[n.zoomIn[e]]=t;for(e=0,i=n.zoomOut.length;e<i;e++)o[n.zoomOut[e]]=-t},_addHooks:function(){Se(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Ze(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i=t.keyCode,o=this._map;if(i in this._panKeys)o._panAnim&&o._panAnim._inProgress||(e=this._panKeys[i],t.shiftKey&&(e=B(e).multiplyBy(3)),o.panBy(e),o.options.maxBounds&&o.panInsideBounds(o.options.maxBounds));else if(i in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[i]);else{if(27!==i||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}Ve(t)}}});ei.addInitHook("addHandler","keyboard",$o),ei.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var tn=di.extend({addHooks:function(){Se(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Ze(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Je(t),i=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var o=Math.max(i-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(n(this._performZoom,this),o),Ve(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0;t._stop();var o=4*Math.log(2/(1+Math.exp(-Math.abs(this._delta/(4*this._map.options.wheelPxPerZoomLevel)))))/Math.LN2,n=i?Math.ceil(o/i)*i:o,s=t._limitZoom(e+(this._delta>0?n:-n))-e;this._delta=0,this._startTime=null,s&&("center"===t.options.scrollWheelZoom?t.setZoom(e+s):t.setZoomAround(this._lastMousePos,e+s))}});ei.addInitHook("addHandler","scrollWheelZoom",tn),ei.mergeOptions({tap:!0,tapTolerance:15});var en=di.extend({addHooks:function(){Se(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ze(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(He(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],i=e.target;this._startPos=this._newPos=new z(e.clientX,e.clientY),i.tagName&&"a"===i.tagName.toLowerCase()&&_e(i,"leaflet-active"),this._holdTimeout=setTimeout(n((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Se(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Ze(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],i=e.target;i&&i.tagName&&"a"===i.tagName.toLowerCase()&&ge(i,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new z(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var i=document.createEvent("MouseEvents");i._simulated=!0,e.target._simulatedClick=!0,i.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}});!Pt||Lt&&!ut||ei.addInitHook("addHandler","tap",en),ei.mergeOptions({touchZoom:Pt&&!st,bounceAtZoomLimits:!0});var on=di.extend({addHooks:function(){_e(this._map._container,"leaflet-touch-zoom"),Se(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){ge(this._map._container,"leaflet-touch-zoom"),Ze(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(i.add(o)._divideBy(2))),this._startDist=i.distanceTo(o),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Se(document,"touchmove",this._onTouchMove,this),Se(document,"touchend",this._onTouchEnd,this),He(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),o=e.mouseEventToContainerPoint(t.touches[1]),s=i.distanceTo(o)/this._startDist;if(this._zoom=e.getScaleZoom(s,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&s<1||this._zoom>e.getMaxZoom()&&s>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===s)return}else{var r=i._add(o)._divideBy(2)._subtract(this._centerPoint);if(1===s&&0===r.x&&0===r.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(r),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),k(this._animRequest);var a=n(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=C(a,this,!0),He(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,k(this._animRequest),Ze(document,"touchmove",this._onTouchMove,this),Ze(document,"touchend",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))):this._zooming=!1}});ei.addInitHook("addHandler","touchZoom",on),ei.BoxZoom=Yo,ei.DoubleClickZoom=Qo,ei.Drag=Xo,ei.Keyboard=$o,ei.ScrollWheelZoom=tn,ei.Tap=en,ei.TouchZoom=on,t.version=e,t.Control=oi,t.control=ni,t.Browser=zt,t.Evented=I,t.Mixin=mi,t.Util=A,t.Class=T,t.Handler=di,t.extend=i,t.bind=n,t.stamp=r,t.setOptions=d,t.DomEvent=$e,t.DomUtil=ze,t.PosAnimation=ti,t.Draggable=vi,t.LineUtil=zi,t.PolyUtil=Bi,t.Point=z,t.point=B,t.Bounds=Z,t.bounds=N,t.Transformation=G,t.transformation=J,t.Projection=Ri,t.LatLng=j,t.latLng=F,t.LatLngBounds=R,t.latLngBounds=D,t.CRS=W,t.GeoJSON=ho,t.geoJSON=vo,t.geoJson=bo,t.Layer=Ui,t.LayerGroup=Wi,t.layerGroup=Hi,t.FeatureGroup=Vi,t.featureGroup=qi,t.ImageOverlay=wo,t.imageOverlay=xo,t.VideoOverlay=Lo,t.videoOverlay=Po,t.SVGOverlay=Mo,t.svgOverlay=Co,t.DivOverlay=ko,t.Popup=Ao,t.popup=To,t.Tooltip=Eo,t.tooltip=Oo,t.Icon=Gi,t.icon=Ji,t.DivIcon=Io,t.divIcon=zo,t.Marker=Qi,t.marker=Xi,t.TileLayer=Zo,t.tileLayer=No,t.GridLayer=So,t.gridLayer=Bo,t.SVG=qo,t.svg=Go,t.Renderer=jo,t.Canvas=Fo,t.canvas=Uo,t.Path=$i,t.CircleMarker=to,t.circleMarker=eo,t.Circle=io,t.circle=oo,t.Polyline=no,t.polyline=so,t.Polygon=ro,t.polygon=ao,t.Rectangle=Jo,t.rectangle=Ko,t.Map=ei,t.map=ii;var nn=window.L;t.noConflict=function(){return window.L=nn,this},window.L=t}(e.exports);var i,o={exports:{}},n="object"==typeof Reflect?Reflect:null,s=n&&"function"==typeof n.apply?n.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};i=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var r=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}o.exports=a,o.exports.once=function(t,e){return new Promise((function(i,o){function n(i){t.removeListener(e,s),o(i)}function s(){"function"==typeof t.removeListener&&t.removeListener("error",n),i([].slice.call(arguments))}g(t,e,s,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&g(t,"error",e,i)}(t,n,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var h=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function u(t,e,i,o){var n,s,r,a;if(l(i),void 0===(s=t._events)?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),s=t._events),r=s[e]),void 0===r)r=s[e]=i,++t._eventsCount;else if("function"==typeof r?r=s[e]=o?[i,r]:[r,i]:o?r.unshift(i):r.push(i),(n=c(t))>0&&r.length>n&&!r.warned){r.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=r.length,a=h,console&&console.warn&&console.warn(a)}return t}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,i){var o={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=p.bind(o);return n.listener=i,o.wrapFn=n,n}function f(t,e,i){var o=t._events;if(void 0===o)return[];var n=o[e];return void 0===n?[]:"function"==typeof n?i?[n.listener||n]:[n]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(n):_(n,n.length)}function m(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function _(t,e){for(var i=new Array(e),o=0;o<e;++o)i[o]=t[o];return i}function g(t,e,i,o){if("function"==typeof t.on)o.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function n(s){o.once&&t.removeEventListener(e,n),i(s)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h=t}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||r(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return c(this)},a.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var o="error"===t,n=this._events;if(void 0!==n)o=o&&void 0===n.error;else if(!o)return!1;if(o){var r;if(e.length>0&&(r=e[0]),r instanceof Error)throw r;var a=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw a.context=r,a}var h=n[t];if(void 0===h)return!1;if("function"==typeof h)s(h,this,e);else{var l=h.length,c=_(h,l);for(i=0;i<l;++i)s(c[i],this,e)}return!0},a.prototype.on=a.prototype.addListener=function(t,e){return u(this,t,e,!1)},a.prototype.prependListener=function(t,e){return u(this,t,e,!0)},a.prototype.once=function(t,e){return l(e),this.on(t,d(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return l(e),this.prependListener(t,d(this,t,e)),this},a.prototype.removeListener=function(t,e){var i,o,n,s,r;if(l(e),void 0===(o=this._events))return this;if(void 0===(i=o[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(n=-1,s=i.length-1;s>=0;s--)if(i[s]===e||i[s].listener===e){r=i[s].listener,n=s;break}if(n<0)return this;0===n?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,n),1===i.length&&(o[t]=i[0]),void 0!==o.removeListener&&this.emit("removeListener",t,r||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,i,o;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var n,s=Object.keys(i);for(o=0;o<s.length;++o)"removeListener"!==(n=s[o])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(o=e.length-1;o>=0;o--)this.removeListener(t,e[o]);return this},a.prototype.listeners=function(t){return f(this,t,!0)},a.prototype.rawListeners=function(t){return f(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};class y extends Error{constructor(){super(),this.name="CancelError",Object.setPrototypeOf(this,y.prototype)}}class v{constructor(t={}){this.options=t,this._promises=new Map}get isLoaded(){return this._promises.size>0}remove(t){this._promises.has(t)&&(this._promises.delete(t),this._onStop())}get(t){return this._promises.get(t)}add(t,e){const i=e||t,o=this._promises.get(i);return this.options.onStart&&!this.isLoaded&&this.options.onStart(),o||(this._promises.set(i,t),t.finally((()=>{this.remove(i)})),t)}abort(){this.isLoaded&&(this._promises.forEach((t=>{t.cancel&&t.cancel()})),this._promises.clear(),this._onStop())}waitFunc(t,e=""){const i=this.get(e=e||t.name);return i||this.add(t(),e)}WaitForMe(t=""){const e=this.get.bind(this),i=this.add.bind(this);return function(o,n,s){const r=s.value;return t=t||n,s.value=function(...o){const n=e(t);if(n)return n;return i(r.apply(this,o),t)},s}}GetOrCreateDecorator(t=""){return this.WaitForMe(t)}_onStop(){this.options.onStop&&!this.isLoaded&&this.options.onStop()}}class b extends Error{constructor(){super(),this.name="TimeoutError",Object.setPrototypeOf(this,b.prototype)}}const w=(t,e,i,o)=>{try{t(i(o))}catch(n){e(n)}};let x=0;class P{constructor(t,e){this.id=x++,this._isCanceled=!1,this._isPending=!0,this._cancelHandlers=[],this._children=[],this._cancelPromise=new Promise(((t,e)=>{this._setCanceledCallback=e=>t(e||new y)}));const i=[this._cancelPromise,new Promise(((e,i)=>t((t=>{t instanceof P?this.attach(t):this._isPending=!1,e(t)}),(t=>{this._isPending=!1,i(t)}),(t=>{if(!this._isPending)throw new Error("The `onCancel` handler was attached after the promise settled.");this._cancelHandlers.push(t)}))))];e&&i.push(new Promise(((t,i)=>{setTimeout((()=>{if(this._isPending)try{this.cancel()}finally{i(new b)}}),e)}))),this._promise=Promise.race(i)}static createControl(t){return new v(t)}static resolve(t){return new P((e=>e(t)))}static reject(t){return new P(((e,i)=>i(t)))}static all(t){return new P(((e,i)=>{Promise.all(t).then(e).catch(i)})).catch((e=>{if(e instanceof this.CancelError)for(const i of t){"cancel"in i&&i.cancel()}throw e}))}attach(t){this._isCanceled?t.cancel():this._children.push(t)}then(t,e){const i=new P(((i,o)=>{if(this._promise){const n=t=>{e?w(i,o,e,t):o(t)};this._promise.then((e=>{this._isCanceled?n(e):t?w(i,o,t,e):i(e)}),n)}}));return i._parentPromise=this,this._children.push(i),i}catch(t){return this._isCanceled&&t&&t(new y),this.then(void 0,t)}finally(t){return this._promise?this._promise.finally(t):Promise.reject(this._isCanceled?new y:t)}cancel(){if(this._isCanceled||!this._isPending)return this;this._isCanceled=!0;const t=this._getTopParent();if(t&&t.cancel(),this._children&&this._children.forEach((t=>t.cancel())),this._isPending){if(this._cancelHandlers.length)try{for(const t of this._cancelHandlers)t()}catch(e){}this._setCanceledCallback&&this._setCanceledCallback()}return this._destroy(),this}_getTopParent(){let t=this._parentPromise,e=!!t;for(;e;)t&&t._parentPromise?(t=t._parentPromise,e=!!t):e=!1;return t}_destroy(){this._setCanceledCallback=void 0,this._cancelPromise=void 0,this._promise=void 0}}function M(t,e,i={}){const o=function(t,e=[]){for(;null!==t;t=Object.getPrototypeOf(t)){const i=Object.getOwnPropertyNames(t);for(let t=0;t<i.length;t++)-1==e.indexOf(i[t])&&e.push(i[t])}return e}(t.prototype);const n=void 0===i.replace||i.replace;e.forEach((e=>{Object.getOwnPropertyNames(e.prototype).forEach((i=>{const s=-1!==o.indexOf(i);if(!n&&!s||n){const o=Object.getOwnPropertyDescriptor(e.prototype,i);o&&Object.defineProperty(t.prototype,i,o)}}))}))}function C(t){return null!=t}function k(t){return"string"==typeof t?!!t:C(t)}function A(t,e,i=!1){let o=t;const n=e,s=Array.isArray(n);let r=s&&[]||{};return s&&Array.isArray(n)?i?(o=o||[],r=r.concat(o),n.forEach(((t,e)=>{void 0===r[e]?r[e]=t:"object"==typeof t?r[e]=A(o[e],t,i):-1===o.indexOf(t)&&r.push(t)}))):r=n:(o&&"object"==typeof o&&Object.keys(o).forEach((function(t){r[t]=o[t]})),Object.keys(n).forEach((function(t){r[t]="object"==typeof n[t]&&n[t]&&"object"==typeof o[t]&&"object"==typeof n[t]?A(o[t],n[t],i):n[t]}))),r}function T(t){if(!t.lngLat&&t.latLng){t.lngLat=[t.latLng.lng,t.latLng.lat]}return t}function E(t,e=10){let i;function o(...n){o.clear(),i=setTimeout((()=>{i=null,t.apply(this,n)}),e)}return o.clear=function(){i&&(clearTimeout(i),i=null)},o}P.CancelError=y,P.TimeoutError=b,P.PromiseControl=v,Object.setPrototypeOf(P.prototype,Promise.prototype);const O=6371;function I(t){return{type:"Polygon",coordinates:[z(t)]}}function z(t){const e=[t[0],t[1]];return[e,[t[2],t[1]],[t[2],t[3]],[t[0],t[3]],e]}const S=Math.PI/180,B=180/Math.PI;function Z(t,e){e=e>85.06?85.06:e<-85.06?-85.06:e;const i=20037508.34*t/180;let o=Math.log(Math.tan((90+e)*Math.PI/360))/(Math.PI/180);return o=20037508.34*o/180,[i,o]}function N(t,e,i,o){if(t instanceof Array)return e instanceof Array&&e.sort().join("")===t.sort().join("");if(t instanceof Date)return e instanceof Date&&""+t==""+e;if(t instanceof Function){if(!(e instanceof Function))return!1}else if(t instanceof Object)return e instanceof Object&&(t===i?e===o:R(t,e));return t===e}function R(t,e){const i=Object.keys(t).sort(),o=Object.keys(e).sort();if(i.length!==o.length)return!1;if(i.join("")!==o.join(""))return!1;for(let n=0;n<i.length;n++){if(!N(t[i[n]],e[o[n]],t,e))return!1}return!0}function D(t){const e={};return Object.keys(t).forEach((i=>{t[i]instanceof Array||t[i]!==Object(t[i])?void 0!==t[i]&&(e[i]=t[i]):e[i]=D(t[i])})),e}function j(t){return"[object Object]"===Object.prototype.toString.call(t)}function F(t){return t.replace(/([^:]\/)\/+/g,"$1")}function U(t){return"[object Object]"===Object.prototype.toString.call(t)}function W(t){return"function"==typeof t}function H(t){return(e,i)=>{const o=e.map((t=>t()));return t(o,i)}}const V={"!":H((function([t]){return!t})),"!=":H((function([t,e]){return t!==e})),"<":H((function([t,e]){return t<e})),"<=":H((function([t,e]){return t<=e})),"==":H((function([t,e]){return t===e})),">":H((function([t,e]){return t>e})),">=":H((function([t,e]){return t>=e})),coalesce:t=>{for(let e=0;e<t.length;e++){const i=t[e]();if(null!=i)return i}return null},all:t=>{for(let e=0;e<t.length;e++){if(!t[e]())return!1}return!0},any:t=>{for(let e=0;e<t.length;e++){if(t[e]())return!0}return!1},case:t=>{if(t.length<2)throw new Error('The "case" function requires at least a condition and a corresponding output.');if(t.length%2==0)throw new Error("Missing a fallback value or unmatched condition-output pair.");for(let e=0;e<t.length-1;e+=2){const i=t[e](),o=t[e+1]();if(i)return o}return(0,t[t.length-1])()},match:t=>{const[e,...i]=t,o=e(),n=i.splice(-1,i.length%2)[0];for(let s=0;s<i.length-1;s+=2){if(i[s]()===o)return i[s+1]()}return n()}},q={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function G(t){if("string"==typeof(i=t)&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(i))return J(t);if("string"==typeof(e=t)&&e in q)return function(t){return J(q[t])}(t);if(function(t){return"string"==typeof t&&/^rgb(a?)\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)(?:\s*,\s*([01](?:\.\d+)?))?\s*\)$/.test(t)}(t))return function(t){const e=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/;let i;if(i=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)];if(i=t.match(e))return[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10),parseFloat(i[4])];throw new Error(`The '${t}' Is not valid rgb`)}(t);if(function(t){if("object"==typeof t&&null!==t)return"r"in t&&"g"in t&&"b"in t&&(!("a"in t)||"number"==typeof t.a&&t.a>=0&&t.a<=1);return!1}(t))return function({r:t,g:e,b:i,a:o}){return[t,e,i,...void 0!==o?[o]:[]]}(t);var e,i;throw new Error(`The '${t}' cannot be converted to color`)}function J(t){let e;if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)];if(e=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/.exec(t))return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)/255];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)];if(e=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/.exec(t))return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)/255];throw new Error(`The '${t}' Is not valid hex`)}function K(t,e,i,o,n){if("number"==typeof i&&"number"==typeof n)return i+(t-e)/(o-e)*(n-i);try{const s=G(i),r=G(n);return function(t){return`rgb(${t.join(",")})`}(s.map(((i,n)=>Math.ceil(K(t,e,i,o,r[n])))))}catch(s){console.log(s)}throw new Error("Unsupported output type for linear interpolation.")}const Y={step:t=>{const[e,i,...o]=t,n=e();if("number"!=typeof n)return i();for(let s=0;s<o.length-2;s+=2){const t=o[s](),e=o[s+1](),i=o[s+2]();if(n>=t&&n<i)return e}return n>=o[o.length-2]()?o[o.length-1]():i()},interpolate:([t,e,...i])=>{if(i.length<2)throw new Error("At least two stops are required");if(i.length<2||i.length%2!=0)throw new Error("Invalid stops provided.");const o=e();if("number"!=typeof o)throw new Error("Input must be a number.");const n=t();for(let s=0;s<i.length-2;s+=2){const t=i[s](),e=i[s+1](),r=i[s+2](),a=i[s+3]();if(o>=t&&o<=r&&"linear"===n[0])return K(o,t,e,r,a)}throw new Error("Invalid interpolation type.")}};const Q={get:H((function([t,e],i){const o=e||i;return o&&"object"==typeof o&&t in o?o[t]:null})),length:H((([t])=>{if("string"==typeof t||Array.isArray(t))return t.length})),at:H((function([t,e]){return e[t]})),has:H((function([t,e],i){const o=e||i;return!(!o||"object"!=typeof o||!(t in o))})),in:H((function([t,e]){if("string"==typeof e)return e.includes(String(t));if(Array.isArray(e))return e.includes(t);throw new Error(`Invalid input type for 'in'. Expected string or array, got ${typeof e}.`)})),"index-of":H((function([t,e,i]){if("string"==typeof e)return e.indexOf(String(t),i);if(Array.isArray(e))return e.indexOf(t,i);throw new Error(`Invalid input type for 'index-of'. Expected string or array, got ${typeof e}.`)})),slice:H((function(t){const[e,i,o]=t;if("string"==typeof e)return e.slice(i,o);if(Array.isArray(e))return e.slice(i,o);throw new Error(`Invalid input type for 'slice'. Expected string or array, got ${typeof e}.`)}))},X={"+":H((t=>t.reduce(((t,e)=>t+e),0))),"-":H((t=>t.reduce(((t,e)=>t-e)))),"*":H((t=>t.reduce(((t,e)=>t*e),1))),"/":H((t=>t.reduce(((t,e)=>t/e)))),"%":H((t=>t[0]%t[1])),"^":H((t=>Math.pow(t[0],t[1]))),abs:H((t=>Math.abs(t[0]))),acos:H((t=>Math.acos(t[0]))),asin:H((t=>Math.asin(t[0]))),atan:H((t=>Math.atan(t[0]))),ceil:H((t=>Math.ceil(t[0]))),cos:H((t=>Math.cos(t[0]))),e:()=>Math.E,floor:H((t=>Math.floor(t[0]))),ln:H((t=>Math.log(t[0]))),ln2:()=>Math.LN2,log10:H((t=>Math.log10(t[0]))),log2:H((t=>Math.log2(t[0]))),max:H((t=>Math.max(...t))),min:H((t=>Math.min(...t))),pi:()=>Math.PI,round:H((t=>Math.round(t[0]))),sin:H((t=>Math.sin(t[0]))),sqrt:H((t=>Math.sqrt(t[0]))),tan:H((t=>Math.tan(t[0])))},$={concat:H((t=>t.reduce(((t,e)=>String(t)+String(e)),""))),downcase:H((t=>String(t[0]).toLowerCase())),upcase:H((t=>String(t[0]).toUpperCase()))},tt=(t,e,i)=>{try{const o=t(e,i);if(void 0!==o)return o}catch{}};function et(t){return(e,i)=>{for(const o of e){const e=tt(t,o,i);if(void 0!==e)return e}throw new Error("Received a mismatched type")}}function it(t){if(Array.isArray(t)){const[e,...i]=t;return"string"==typeof e&&"literal"!==e&&e in ot&&i.length>0}return!1}const ot={...X,...{array:H((t=>{const[e,i,o]=t;let n,s,r;if("string"==typeof e&&["string","number","boolean"].includes(e)?(n=e,"number"==typeof i?(s=i,r=o):r=i):Array.isArray(e)&&(r=e),!Array.isArray(r))throw new Error("Expected an array");if(n&&!r.every((t=>typeof t===n)))throw new Error(`Expected all items in array to be of type ${n}`);if(s&&r.length!==s)throw new Error(`Expected array of length ${s}`);return r})),boolean:H(et((t=>"boolean"==typeof t?t:void 0))),literal:H((([t])=>t)),number:H(et((t=>"number"==typeof t?t:void 0))),object:H(et((t=>null===t||"object"!=typeof t||Array.isArray(t)?void 0:t))),string:H(et((t=>"string"==typeof t?t:void 0))),"to-boolean":H(et(Boolean)),"to-number":H(et(Number)),"to-string":H(et(String)),typeof:H((([t])=>function(t){if(null===t)return"null";switch(typeof t){case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"object":if(Array.isArray(t)){let e="value";return t.every((t=>"number"==typeof t))?e="number":t.every((t=>"string"==typeof t))?e="string":t.every((t=>"boolean"==typeof t))&&(e="boolean"),`array<${e}, ${t.length}>`}return"object";default:return"undefined"}}(t)))},...$,...Q,...V,...Y};function nt(t,e={}){const[i,...o]=t,n=ot[i];if(n)return n(o.map((t=>()=>it(t)?nt(t,e):t)),e);throw new Error(`Expression "${i}" is not supported.`)}function st(t){return e=>{const i=e.properties;return!!i&&nt(t,i)}}const rt=["iconSize","iconAnchor"];function at(t,e,i){if((e=String(e))===(t=String(t)))return!0;if(i&&e.toUpperCase()===t.toUpperCase())return!0;const o=`^${n=e,n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}$`.replace(/%/g,".*").replace("_",".");var n;return null!==new RegExp(o,i?"i":"").exec(t)}const ht={gt:(t,e)=>t>e,lt:(t,e)=>t<e,ge:(t,e)=>t>=e,le:(t,e)=>t<=e,eq:(t,e)=>t===e,ne:(t,e)=>t!==e,in:(t,e)=>-1!==e.indexOf(t),notin:(t,e)=>-1===e.indexOf(t),like:(t,e)=>at(t,e),ilike:(t,e)=>at(t,e,!0)};function lt(t){return 3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]}function ct(t,e){const i="string"==typeof e[0]?e[0]:"all",o=e=>{if(lt(e)){const[i,o,n]=e,s=ht[o];if(s){if(("like"===o||"ilike"===o)&&"string"==typeof i){let e="";const o=i.replace(/^%?(\w+)%?$/,((o,s)=>(e=t[s],i.replace(s,n))));return s(e,o)}return s(t[i],n)}return!1}return ct(t,e)},n=e.filter((t=>Array.isArray(t)));return"any"===i?n.some(o):n.every(o)}function ut(t){let e={};const i=[];for(const o of t)o&&(Array.isArray(o)?i.push(o):e=o);return t=>{const o=i.find((e=>function(t,e){const i={...t.properties};return!!i&&(i.$id=t.id,ct(i,e))}(t,e[0])));return o?{...e,...o[1]}:e}}function pt({paint:t,defaultPaint:e}){const i=function(t){let e=!1;const i={};for(const o in t)if(-1===rt.indexOf(o)){const n=o,s=t[n];it(s)&&(e=!0,i[n]=st(s))}if(e)return e=>{const o={};for(const t in i)o[t]=i[t](e);return{...t,...o}}}(t);if(i){const o=t=>ft({paint:i(t),defaultPaint:e});return o.paint=dt({paint:t,defaultPaint:e}),o}return dt({paint:t,defaultPaint:e})}function dt({paint:t,defaultPaint:e}){var i;let o={...e};return o={...o,...t},o.fill=null===(i=o.fill)||void 0===i||i,o.stroke=void 0!==o.stroke?o.stroke:!o.fill||!(!o.strokeColor&&!o.strokeOpacity),o}function ft({paint:t,defaultPaint:e,getPaintFunctions:i}){if(!t)throw new Error("paint is empty");let o={...e};if(W(t)){const o=o=>{const n=ft({paint:t(o),defaultPaint:e,getPaintFunctions:i});return n.type=t.type,n};return o.type=t.type,o}if(function(t){return!!Array.isArray(t)}(t))return o=>ft({paint:ut(t)(o),defaultPaint:e,getPaintFunctions:i});if("get-paint"===t.type){const n=function(t,e){if("function"==typeof t.from)return t.from(t.options);if("string"==typeof t.from&&e){const i=e[t.from];if(i)return i(t.options)}}(t,i);n&&(o=ft({paint:n,defaultPaint:e,getPaintFunctions:i}))}else{if("icon"===t.type)return t;o=pt({paint:t,defaultPaint:e})}return W(o)||("color"in o&&(o.strokeColor||(o.strokeColor=o.color),o.fillColor||(o.fillColor=o.color)),"opacity"in o&&(void 0===o.strokeOpacity&&(o.strokeOpacity=o.opacity),void 0===o.fillOpacity&&(o.fillOpacity=o.opacity))),o}class mt{constructor(){this.backspace=8,this.tab=9,this.enter=13,this.shift=16,this.ctrl=17,this.alt=18,this["pause/break"]=19,this.caps_lock=20,this.escape=27,this.page_up=33,this.page_down=34,this.end=35,this.home=36,this.left_arrow=37,this.up_arrow=38,this.right_arrow=39,this.down_arrow=40,this.insert=45,this.delete=46,this.left_window_key=91,this.right_window_key=92,this.select_key=93,this.numpad_0=96,this.numpad_1=97,this.numpad_2=98,this.numpad_3=99,this.numpad_4=100,this.numpad_5=101,this.numpad_6=102,this.numpad_7=103,this.numpad_8=104,this.numpad_9=105,this.multiply=106,this.add=107,this.subtract=109,this.decimal_point=110,this.divide=111,this.f1=112,this.f2=113,this.f3=114,this.f4=115,this.f5=116,this.f6=117,this.f7=118,this.f8=119,this.f9=120,this.f10=121,this.f11=122,this.f12=123,this.num_lock=144,this.scroll_lock=145,this["semi-colon"]=186,this.equal_sign=187,this[","]=188,this["-"]=189,this["."]=190,this["/"]=191,this["`"]=192,this["["]=219,this["\\"]=220,this["]"]=221,this["'"]=222}}class _t{constructor(t,e){this.webMap=t,e&&(e.value&&this.setValue(e.value),e.name&&(this.name=e.name),e.event&&(this.event=e.event))}getValue(){return this.value}setValue(t){this.value=t}}class gt extends _t{constructor(){super(...arguments),this.name="center",this.event="moveend"}getValue(){return this.webMap.getCenter()}setValue(t){this.webMap.setCenter(t)}toString(t){const e=t.map((t=>t.toFixed(5)));return e[0]+"_"+e[1]}parse(t){return t.split("_").map(Number)}}class yt extends _t{constructor(){super(...arguments),this.name="zoom",this.event="zoomend"}getValue(){const t=this.webMap.getZoom();return void 0!==t?Math.round(t):void 0}setValue(t){this.webMap.setZoom(t)}toString(t){return String(t)}parse(t){return Number(t)}}let vt=0;const bt={minZoom:0,maxZoom:22,paint:{color:"#0000ff",opacity:.4,strokeOpacity:1,stroke:!0,radius:8,weight:1},selectedPaint:{color:"#00008b",opacity:.4,strokeOpacity:1,stroke:!0,radius:12,weight:1},create:!0};class wt{constructor(t){this.options=bt,this.emitter=new o.exports.EventEmitter,this.keys=wt.keys,this.runtimeParams=[],this.getPaintFunctions=wt.getPaintFunctions,this.mapState=[gt,yt],this.id=vt++,this._initMapState={},this._mapState=[],this._eventsStatus={},this._mapEvents={},this.mapAdapter=t.mapAdapter,this._starterKits=t.starterKits||[],t&&(this.options=A(bt||{},t)),this.options.runtimeParams&&(this.runtimeParams=this.options.runtimeParams),this._addEventsListeners(),this.options.tileJson&&this._setTileJsonOptions(this.options.tileJson),this.options.create&&this.create()}getId(){return this.id}async create(){return this.getEventStatus("create")||(await this._setInitMapState(this.mapState),await this._setupMap(),this._emitStatusEvent("create",this)),this}setRuntimeParams(t){this.runtimeParams.push(t)}destroy(){this._removeEventListeners(),function(t){for(const e in t)delete t[e]}(this._emitStatusEvent),this.mapAdapter.destroy&&this.mapAdapter.destroy()}getState(){const t={};return this._mapState.forEach((e=>{t[e.name]=e.getValue()})),t}getRuntimeParams(){const t={};return this._mapState.forEach((e=>{for(const i of this.runtimeParams){const o=i.get(e.name);if(void 0!==o){t[e.name]=e.parse(o);break}}})),t}getContainer(){if(this.mapAdapter.getContainer)return this.mapAdapter.getContainer();if(this.options.target){if(this.options.target instanceof HTMLElement)return this.options.target;if("string"==typeof this.options.target){const t=document.getElementById(this.options.target);if(t)return t}}}setCursor(t){this.mapAdapter.setCursor&&this.mapAdapter.setCursor(t)}getCursor(){if(this.mapAdapter.getCursor)return this.mapAdapter.getCursor();const t=this.getContainer();return t?t.style.cursor:void 0}setCenter(t){return this.mapAdapter.setCenter(t),this}getCenter(){return this.mapAdapter.getCenter()}getBounds(){if(this.mapAdapter.getBounds)return this.mapAdapter.getBounds()}getBoundsPolygon(){const t=this.getBounds();if(t){return{type:"Feature",properties:{},geometry:I(t)}}}setZoom(t){return this.mapAdapter.setZoom(t),this}getZoom(){const t=this.mapAdapter.getZoom();if("number"==typeof t)return t}zoomIn(){if(this.mapAdapter.zoomIn)this.mapAdapter.zoomIn();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t+1)}}}zoomOut(){if(this.mapAdapter.zoomOut)this.mapAdapter.zoomOut();else{const t=this.getZoom();if(void 0!==t){this.setZoom(t-1)}}}setView(t,e){if(Array.isArray(t)){const i=t;this.mapAdapter.setView&&i&&C(e)?this.mapAdapter.setView(i,e):(i&&this.mapAdapter.setCenter(i),C(e)&&this.mapAdapter.setZoom(e))}else{this.mapAdapter.setView&&this.mapAdapter.setView(t)}}fitBounds(t,e){return t.every((t=>C(t)))&&(t[1]<-85.06&&(t[1]=-85.06),t[3]>85.06&&(t[3]=85.06),this.mapAdapter.fitBounds(t,e)),this}getEventStatus(t){const e=this._eventsStatus[t];return null!=e&&e}onLoad(t="create"){return new Promise((e=>{this.getEventStatus(t)?e(this):this.emitter.once(t,(()=>{e(this)}))}))}onMapLoad(t){return new Promise((e=>{var i;const o=()=>{const i=this.mapAdapter;t&&t(i),i&&e(i)},n=null===(i=this.mapAdapter.isLoaded)||void 0===i||i;this.mapAdapter.map&&n?o():this.mapAdapter.emitter.once("create",(()=>{o()}))}))}getLayerAdapters(){return this.mapAdapter.layerAdapters}getLayerAdapter(t){return this.mapAdapter.layerAdapters[t]}locate(t,e){if(this.mapAdapter&&this.mapAdapter.locate)return this.mapAdapter.locate(t,e);return{stop:()=>({})}}stopGetCoordFromMapClick(){this._coordFromMapClickPromise&&this._coordFromMapClickPromise.cancel()}getCoordFromMapClick(){return this._coordFromMapClickPromise?this.getCoordFromMapClick():(this._coordFromMapClickPromise=new P(((t,e,i)=>{const o=this.getCursor()||"grab";this._removeEventListeners({include:["click"]}),this.setCursor("crosshair");const n=()=>{this.setCursor(o),this._addEventsListeners({include:["click"]}),this.mapAdapter.emitter.off("click",s),this._coordFromMapClickPromise=void 0},s=e=>{n(),T(e),t(e.lngLat)};this.mapAdapter.emitter.once("click",s),i(n)})),this._coordFromMapClickPromise)}_emitStatusEvent(t,e){const i=t;this._eventsStatus[i]=!0,this.emitter.emit(i,e)}async _addLayerProviders(){}async _onLoadSync(){}async _setupMap(){if(!this.mapAdapter)throw new Error("WebMap `mapAdapter` option is not set");return await this.mapAdapter.create(this.options),this._zoomToInitialExtent(),await this._addLayerProviders(),await this._onLoadSync(),this._emitStatusEvent("build-map",this.mapAdapter),this}_setTileJsonOptions(t){t.center&&(this.options.center=t.center),t.bounds&&(this.options.bounds=t.bounds),C(t.maxzoom)&&(this.options.zoom=t.maxzoom),C(t.minzoom)&&(this.options.zoom=t.minzoom),C(t.maxzoom)&&C(t.minzoom)&&(this.options.zoom=(t.maxzoom+t.minzoom)/2)}_zoomToInitialExtent(){const{center:t,zoom:e,bounds:i}=this.options;this._extent?this.fitBounds(this._extent):t&&e?this.setView(t,e):i&&this.fitBounds(i)}_setInitMapState(t){for(const e of t){const t=new e(this);this._mapState.push(t);for(const e of this.runtimeParams){const i=e.get(t.name);if(void 0!==i){const e=t.parse(i);this._initMapState[t.name]=e,Object.defineProperty(this.options,t.name,{value:e,configurable:!0,enumerable:!0});break}}}}_addEventsListeners(t){let e=["preclick","click","zoomstart","zoom","zoomend","movestart","move","moveend","mousemove","mouseout","mouseover"];t&&t.include&&(e=e.filter((e=>t.include.includes(e)))),e.forEach((t=>{this._mapEvents[t]=e=>{if(this.runtimeParams.length){const e=this._mapState.find((e=>e.event===t));if(e){const t=e.toString(e.getValue());this.runtimeParams.forEach((i=>{i.set(e.name,t)}))}}this._eventsStatus&&this.emitter.emit(t,e)};const e=this._mapEvents[t];e&&this.mapAdapter.emitter.on(t,e)}))}_removeEventListeners(t){let e=Object.entries(this._mapEvents);t&&t.include&&(e=e.filter((e=>t.include.includes(e[0])))),e.forEach((([t,e])=>{e&&this.mapAdapter.emitter.removeListener(t,e)}))}}function xt(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i;for(const o in e){e[o]>((void 0!==i?e[i]:0)||0)&&(i=o)}return i}wt.keys=new class{constructor(){this.keyCodeAlias=new mt,this.keys={},this._windowOnFocus=this.windowOnFocus.bind(this),this._keysPressed=this.keysPressed.bind(this),this._keysReleased=this.keysReleased.bind(this),this.addKeyboardEventsListener()}pressed(t){const e=this.keyCodeAlias[t];return!!e&&this.keys[e]}addKeyboardEventsListener(){"undefined"!=typeof window&&(window.addEventListener("focus",this._windowOnFocus,!1),window.addEventListener("keydown",this._keysPressed,!1),window.addEventListener("keyup",this._keysReleased,!1))}removeKeyboardEventsListener(){"undefined"!=typeof window&&(window.removeEventListener("focus",this._windowOnFocus,!1),window.removeEventListener("keydown",this._keysPressed,!1),window.removeEventListener("keyup",this._keysReleased,!1))}keysPressed(t){t.stopPropagation(),this.keys[t.keyCode]||(this.keys[t.keyCode]=!0)}keysReleased(t){t.stopPropagation(),this.keys[t.keyCode]=!1}windowOnFocus(){this.keys={}}};const Lt={polygon:"path",line:"path",point:"circle"},Pt={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon"};function Mt(t){if(t.data){const e=Pt[function(t){let e;e="FeatureCollection"===t.type?xt(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?xt(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t.data)],i=t.paint;i&&U(i)&&(i.type=i.type?i.type:"polygon"===e||"line"===e?"path":"html"in i||"className"in i?"icon":Lt[e]),t.type=t.type||e}return t}class Ct extends wt{constructor(t){super(t),this._layersIdCounter=1,this._layersOrderCounter=1,this._baselayers=[],this._layers={},this._selectedLayers=[];const e=this.options.tileJson;e&&this.emitter.once("build-map",(()=>this.addTileJsonLayer(e)))}async fitLayer(t,e){const i=this.getLayer(t),o=i&&(i.getBounds||i.getExtent);if(o){const t=await o.call(i);t&&this.fitBounds(t,e)}}isBaseLayer(t){const e=this.getLayer(t);if(e&&e.id)return-1!==this._baselayers.indexOf(e.id)}getBaseLayers(){const t=[];return this._baselayers.forEach((e=>{const i=this._layers[e];i&&t.push(i)})),t}getBaseLayersIds(){return this._baselayers}getLayer(t){return"string"==typeof t?this._layers[t]:t}getLayerId(t){const e=this.getLayer(t);if(e){if(e.id)return null==e?void 0:e.id;if(e&&e.options)return e.options.id}throw new Error("No id for layer")}getLayers(){return Object.keys(this._layers)}allLayers(){return this._layers}orderedLayers(){return Object.values(this._layers).sort(((t,e)=>t.order&&e.order?t.order-e.order:0))}findLayer(t){for(const e in this._layers){const i=this._layers[e];if(t(i))return i}}isLayerVisible(t){const e=this.getLayer(t);return!(!e||void 0===e.options.visibility)&&e.options.visibility}async addBaseLayer(t,e){return await this.addLayer(t,{...e,baselayer:!0},void 0)}async addLayer(t,e={},i){var o,n;const s=this._layersIdCounter++,r=C(i)?i:void 0!==e.order?e.order:this.reserveOrder();let a;"string"==typeof t?a=this.getLayerAdapter(t):"function"==typeof t?a=t:"then"in t&&(a=await t);const h=e;this._updateGeoJsonOptions(h);const l=null===(o=(e={id:String(s),order:r,...e}).visibility)||void 0===o||o;if(e.visibility=!1,e.baselayer&&(e.order=0),this.options.onBeforeAddLayer){const t=this.options.onBeforeAddLayer({options:e,adapter:a});t&&(t.options&&(e=t.options),t.adapter&&(a=t.adapter))}if(void 0!==a){const t=new a(this.mapAdapter.map,e);let i;t.options={...e,...t.options},t.options.baselayer&&(e.baselayer=!0,e.order=0,t.options.order=0),t.options.id&&(i=String(t.options.id),this._layers[i]=t),this._emitLayerEvent("layer:preadd",i||"",t),await this.onMapLoad(),t.map=this.mapAdapter.map;const o=await t.addLayer(t.options);if(t.layer=o,t.id=t.options.id||String(s),t.options.id=t.id,e.baselayer&&(t.options.order=0),t.order=null!==(n=t.options.order)&&void 0!==n?n:r,i&&delete this._layers[i],i=String(t.id),this._layers[i])throw Error(`layer with id '${i}' already exist`);i&&(this._layers[i]=t,h.filter&&this.filterLayer(t,h.filter),e.baselayer&&this._baselayers.push(i),l&&await this.showLayer(i));const c=e.opacity;void 0!==c&&c<=1&&this.setLayerOpacity(t,c);const u=o&&(t.getBounds||t.getExtent);if(e.fit&&u){const e=await u.call(t);e&&await this.fitBounds(e)}return e.onAdded&&e.onAdded(t),this._emitLayerEvent("layer:add",i,t),t}return Promise.reject("No adapter")}async addLayerFromAsyncAdapter(t,e,i){const o=i||void 0!==e.order?e.order:this.reserveOrder(),n=t(),s=await n;return s?this.addLayer(s,e,o):Promise.reject("No adapter")}removeLayers(t){for(const e in this._layers){let i=!0;t&&(i=t(e,this._layers[e])),i&&(this.removeLayer(e),delete this._layers[e])}}async getLegend(t){const e=[];for(const i of this.orderedLayers())i.getLegend&&e.push(i.getLegend(t));return(await Promise.all(e)).flat()}reserveOrder(){return this._layersOrderCounter++}removeOverlays(){this.removeLayers(((t,e)=>!(e&&e.options&&e.options.baselayer)))}removeLayer(t){const e=this.getLayer(t),i=e&&this.getLayerId(e);if(e&&i){if(this.emitter.emit("layer:preremove",e),e.beforeRemove&&e.beforeRemove(),e.removeLayer?e.removeLayer():this.mapAdapter.removeLayer(e.layer),e.options&&e.options.baselayer){const t=this._baselayers.indexOf(i);t&&this._baselayers.splice(t,1)}delete this._layers[i],this.emitter.emit("layer:remove",e)}}addGeoJsonLayer(t={},e){return(t=t||{}).multiselect=void 0!==t.multiselect&&t.multiselect,t.unselectOnSecondClick=void 0===t.unselectOnSecondClick||t.unselectOnSecondClick,e||(t=Mt(t)),t.paint=t.paint||{},this.addLayer(e||"GEOJSON",t)}addFeatureLayer(t={}){return this.addGeoJsonLayer(t)}addTileLayer(t,e={}){return this.addLayer("TILE",{...e,url:t})}addImageLayer(t,e){let i;return"string"==typeof t?i=t:(i=t.url,e=t),this.addLayer("IMAGE",{...e,url:i})}showLayer(t,e={}){return this.toggleLayer(t,!0,e)}hideLayer(t,e={}){return this.toggleLayer(t,!1,e)}toggleLayer(t,e,i={}){const o=this.getLayer(t),n=void 0!==e?e:!(o&&o.options.visibility),s=void 0!==i.silent&&i.silent,r=async t=>{const e=String(t.id),i=n?"layer:show":"layer:hide";if(s||(this._emitLayerEvent(n?"layer:preshow":"layer:prehide",e,t),this._emitLayerEvent("layer:pretoggle",e,t)),n&&this.mapAdapter){const e=t.options.baselayer?0:t.options.order;if(t.options.baselayer&&this._baselayers.length){const e=this._baselayers.filter((e=>e!==t.id&&this.isLayerVisible(e)));for(const t of e)await this.hideLayer(t)}t.showLayer?await t.showLayer.call(t,t.layer):void 0!==t.layer&&await this.mapAdapter.showLayer(t.layer),void 0!==e&&this.mapAdapter.setLayerOrder(t.layer,e,this._layers)}else t.hideLayer?await t.hideLayer.call(t,t.layer):void 0!==t.layer&&await this.mapAdapter.hideLayer(t.layer);t.options.visibility=n,s||(this._emitLayerEvent(i,e,t),this._emitLayerEvent("layer:toggle",e,t))};return o?this.onMapLoad().then((()=>r(o))):Promise.resolve()}updateLayer(t){const e=this.getLayer(t);if(e){if(e.updateLayer)return Promise.resolve(e.updateLayer());if(this.isLayerVisible(e))return this.hideLayer(e,{silent:!0}).then((()=>this.showLayer(e,{silent:!0})))}return Promise.resolve()}setLayerOpacity(t,e){const i=this.getLayer(t);i&&(i.setOpacity?i.setOpacity(e):this.mapAdapter.setLayerOpacity&&this.mapAdapter.setLayerOpacity(i.layer,e))}isLayerLabelVisible(t){var e;const i=this.getLayer(t);return i.isLabelVisible?i.isLabelVisible():null===(e=i.options.labelVisibility)||void 0===e||e}showLayerLabel(t){this.toggleLayerLabel(t,!0)}hideLayerLabel(t){this.toggleLayerLabel(t,!1)}toggleLayerLabel(t,e){const i=this.getLayer(t);return e=null!=e?e:!this.isLayerLabelVisible(t),i&&(e?i.showLabel&&(i.options.labelVisibility=!0,i.showLabel()):i.hideLabel&&(i.options.labelVisibility=!1,i.hideLabel()),i.id&&this._emitLayerEvent("layer:label:toggle",i.id,i)),e}selectLayer(t,e){const i=this.getLayer(t);if(i){i&&i.select&&i.select(e);const t=this.getLayerId(i);t&&this._selectedLayers.push(t)}}unSelectLayer(t,e){const i=this.getLayer(t);if(i){const t=i&&i;t.unselect&&t.unselect(e);const o=this.getLayerId(i);if(o){const t=this._selectedLayers.indexOf(o);-1!==t&&this._selectedLayers.splice(t,1)}}}unSelectLayers(){const t=Object.values(this.allLayers());let e;for(e of t)e.unselect&&e.unselect()}filterLayer(t,e){const i=this.getLayer(t);return i.filter?i.filter(e):[]}propertiesFilter(t,e,i){const o=this.getLayer(t);if(o){const t=o;if(t.propertiesFilter)return t.propertiesFilter(e,i);t.filter&&this.filterLayer(t,(t=>!t.feature||!t.feature.properties||ct(t.feature.properties,e)))}return Promise.resolve()}removeLayerFilter(t){const e=this.getLayer(t);e.removeFilter?e.removeFilter():e.filter&&e.filter((()=>!0))}setLayerData(t,e){const i=this.getLayer(t);if(i){if(i.setData)return i.setData(e);if(i.clearLayer&&i.addData)return i.clearLayer(),i.addData(e)}return Promise.resolve()}addLayerData(t,e){const i=this.getLayer(t);i.addData&&i.addData(e)}clearLayerData(t,e){const i=this.getLayer(t);i&&i.clearLayer&&i.clearLayer(e)}setLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.setPaint&&i.setPaint(e)}setLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.setSelectedPaint&&i.setSelectedPaint(e)}updateLayerPaint(t,e){const i=this.getLayer(t);e&&i&&i.updatePaint&&i.updatePaint(e)}updateLayerSelectedPaint(t,e){const i=this.getLayer(t);e&&i&&i.updateSelectedPaint&&i.updateSelectedPaint(e)}getAttributions(t){const e=[];for(const i in this._layers){const o=this._layers[i];let n=!(void 0===t.onlyVisible||t.onlyVisible)||o.options.visibility;if(n&&t.onlyBaselayer&&(n=this._baselayers.includes(i)),n){const t=o.options&&o.options.attribution;t&&e.push(t)}}return e}getActiveBaseLayer(){const t=this.getBaseLayers().find((t=>this.isLayerVisible(t)));if(t)return this.getLayer(t)}addTileJsonLayer(t){return this.addLayer("TILE",{url:t.tiles[0],maxZoom:t.maxzoom,minZoom:t.minzoom,subdomains:t.scheme,attribution:t.attribution})}_emitLayerEvent(t,e,i){const o=String(t);if(C(e)&&o.startsWith("layer:")){const t=o.replace("layer:","layer-"+e+":");this.emitter.emit(t,i)}this.emitter.emit(t,i)}async _onLayerClick(t){return this._emitLayerEvent("layer:click",t.layer.id||"",t),Promise.resolve(t)}async _onLayerSelect(t){return this._emitLayerEvent("layer:select",t.layer.id||"",t),Promise.resolve(t)}_updateGeoJsonOptions(t){const{onSelect:e,onLayerSelect:i,onClick:o,onLayerClick:n,onMouseOut:s,onMouseOver:r}=t,a=o||n;t.onClick=t=>(a&&a(t),this._onLayerClick(t)),t.onMouseOut=t=>{const e=t.layer.id;s&&s(t),C(e)&&this._emitLayerEvent("layer:mouseout",e,t)},t.onMouseOver=t=>{const e=t.layer.id;r&&r(t),C(e)&&this._emitLayerEvent("layer:mouseover",e,t)};const h=e||i;t.onSelect=t=>(h&&h(t),this._onLayerSelect(t)),t.nativePaint||(this.options.paint&&(t.paint=ft({paint:t.paint||{},defaultPaint:this.options.paint,getPaintFunctions:this.getPaintFunctions})),t.selectedPaint&&this.options.selectedPaint&&(t.selectedPaint=ft({paint:t.selectedPaint,defaultPaint:this.options.selectedPaint,getPaintFunctions:this.getPaintFunctions})))}}class kt extends Ct{constructor(){super(...arguments),this._loadControlQueue={"top-right":[],"bottom-right":[],"top-left":[],"bottom-left":[]},this._isControlLoading={"top-right":!1,"bottom-right":!1,"top-left":!1,"bottom-left":!1}}async addControl(t,e,i){let o;if(e=null!=e?e:"top-left",o="string"==typeof t?this.getControl(t,i):t,o)return new Promise((t=>{this._setControlQueue(e,(async()=>{const i=await o,n=this.mapAdapter.addControl(i,e);t(n)}))}))}async createControl(t,e){if(await this.onLoad("build-map"),this.mapAdapter.createControl)return this.mapAdapter.createControl(t,e)}async createButtonControl(t){if(await this.onLoad("build-map"),this.mapAdapter.createButtonControl)return this.mapAdapter.createButtonControl(t)}async createToggleControl(t){return await this.onLoad("build-map"),this.mapAdapter.createToggleControl?this.mapAdapter.createToggleControl(t):this.mapAdapter.createButtonControl?function(t,e){const i=document.createElement("div");let o=!1;e.getStatus?o=e.getStatus():e.status&&(o=e.status);const n=e.title||"",s=e.html;function r(){n&&(i.title="string"==typeof n?n:o?n.on:n.off,i.setAttribute("aria-label",i.title))}function a(t){t instanceof HTMLElement?(i.innerHTML="",i.appendChild(t)):"string"==typeof t&&(i.innerHTML=t)}function h(){s&&("string"==typeof s||s instanceof HTMLElement?a(s):a(o?s.on:s.off),i.setAttribute("aria-label",i.title))}function l(t,e){t.split(" ").forEach((t=>{e?i.classList.add(t):i.classList.remove(t)}))}function c(){e.addClassOn&&l(e.addClassOn,o),e.addClassOff&&l(e.addClassOff,!o)}r(),h(),e.addClass&&l(e.addClass,!0),c();const u=t=>{void 0!==t&&(o=t),h(),r(),c()},p=t=>{if(o=void 0!==t?t:!o,e.onClick){const t=e.onClick(o);Promise.resolve(t).then((()=>u())).catch((()=>o=!o))}else u()},d=t({html:i,onClick:p});return d.onClick=p,d.changeStatus=u,d}(this.mapAdapter.createButtonControl,t):void 0}removeControl(t){"remove"in t?t.remove():this.mapAdapter.removeControl&&Promise.resolve(t).then((t=>{this.mapAdapter.removeControl(t)}))}getControl(t,e){const i=this.mapAdapter.controlAdapters[t];if(i)return new i(e);{const i=kt.controls[t];if(i)return i(this,e)}}getControlContainer(){if(this.mapAdapter.getControlContainer)return this.mapAdapter.getControlContainer()}_setControlQueue(t,e){this._loadControlQueue[t].push(e),this._isControlLoading[t]||this._applyControls(t)}async _applyControls(t){if(this._loadControlQueue[t].length){this._isControlLoading[t]=!0;const e=this._loadControlQueue[t][0];await e(),this._loadControlQueue[t].splice(0,1),this._applyControls(t)}else this._isControlLoading[t]=!1}}kt.controls={CONTROL:(t,e)=>t.createControl(e.control,e.options),BUTTON:(t,e)=>t.createButtonControl(e),TOGGLE:(t,e)=>t.createToggleControl(e)};const At={};class Tt extends kt{constructor(t){super(t),this._addControls(),At[this.id]=this}static get(t){return function(t){return At[t]}(t)}async _addLayerProviders(){for await(const t of this._starterKits)if(t.getLayerAdapters){const e=await t.getLayerAdapters.call(t);if(e)for await(const t of e){const e=await t.createAdapter(this);e&&(this.mapAdapter.layerAdapters[t.name]=e)}}}async _onLoadSync(){for await(const e of this._starterKits)if(e.onLoadSync)try{await e.onLoadSync.call(e,this)}catch(t){console.error(t)}}_addControls(){this.options.controls&&this.options.controls.forEach((t=>{let e=t,i={};"string"==typeof t&&this.options.controlsOptions&&this.options.controlsOptions[t]&&(i=this.options.controlsOptions[t],void 0!==i.control&&(e=i.control));const{position:o,...n}=i;this.addControl(e,o||"top-left",n)})),this._emitStatusEvent("controls:create")}}class Et{constructor(t={}){var e;this.cache=[];const i=null!==(e=t.namespace)&&void 0!==e?e:"default";return Et.instance[i]?Et.instance[i]:(Et.instance[i]=this,this)}clean(){this.cache.length=0}all(){return this.cache}addFull(t,e,i){return this.add(t,e,i,!0)}add(t,e,i,o){const n=this._find(t,i);if(n)return n.value;{let n;n=e instanceof Function?e():e;const s=i&&JSON.parse(JSON.stringify(D(i))),r={key:t,value:n,props:s,options:s};return o&&!k(n)?n:(this.cache.push(r),n instanceof Promise?(n.catch((e=>{throw this.delete(t,i),e})),o&&n.then((e=>(k(e)||this.delete(t,i),e))),n):n)}}match(t,e){const i=this._find(t,e);if(i)return i.value}matchAll(t,e){return t?this.cache.filter((i=>this._filter(i,t,e))).map((t=>t.value)):this.cache.map((t=>t.value))}delete(t,e){let i=[];"string"==typeof t?i=this.cache.filter((i=>this._filter(i,t,e))):i.push(t);for(const o of i){const t=this.cache.indexOf(o);this.cache.splice(t,1)}}_find(t,e){return this.cache.find((i=>this._filter(i,t,e)))}_filter(t,e,i){if(t.key===e){if(i){return R(t.props||t.options||{},D(i))}return!0}return!1}}Et.instance={};class Ot extends Error{constructor(t){super(),this.name="NgwError",Object.assign(this,t),Object.setPrototypeOf(this,Ot.prototype)}}class It extends Ot{constructor(t){super(t),this.name="ResourceNotFoundError",this.exception="nextgisweb.resource.exception.ResourceNotFound",Object.setPrototypeOf(this,It.prototype)}}function zt(t){return"[object Object]"===Object.prototype.toString.call(t)}const St=["description"];function Bt(t,e=""){e=e?e+"__":"";const i={};for(const[o,n]of Object.entries(t))if(-1===St.indexOf(o))if(zt(n))if("owner_user"===o){const t=Bt(n,o);Object.assign(i,t)}else"parent"===o&&"id"in n&&(i.parent_id=n.id);else C(n)&&(i[e+o]=n);return i}class Zt{constructor(t){this.connector=t,this.cache=new Et}getOne(t,e){const i=new Et,o={},n={...e,cache:!1};"string"==typeof t?o.keyname=t:"number"==typeof t?o.id=t:zt(t)&&(void 0!==t.id?o.id=t.id:t.keyname&&(o.keyname=t.keyname));return i.addFull("resource",(()=>"string"==typeof t?this._fetchResourceBy({keyname:t},n):"number"==typeof t?this._fetchResourceById(t,n):zt(t)?this._fetchResourceBy(t,n):P.resolve(void 0)),o)}getOneOrFail(t,e){return this.getOne(t,e).then((t=>{if(t)return t;throw new It}))}getId(t,e){return"number"==typeof t?P.resolve(t):"string"==typeof t||zt(t)?this.getOne(t,e).then((t=>{if(t)return t.resource.id})):P.resolve(void 0)}getIdOrFail(t,e){return this.getId(t,e).then((t=>{if(void 0===t)throw new Error;return t}))}getMany(t,e){return this._resourceCacheFilter(t).then((i=>{if(!i.length){const i={};return t.keyname?i.keyname=t.keyname:Object.assign(i,Bt(t)),this.connector.get("resource.search",e,{serialization:"full",...i}).then((t=>{if(t)for(const e of t)this.cache.add("resource.item",P.resolve(e),{id:e.resource.id});return t}))}return i}))}getParent(t,e){return this.getOne(t,e).then((t=>t?this.getOne(t.resource.parent.id,e):P.resolve(void 0)))}getChildrenOf(t,e){return this.getIdOrFail(t).then((t=>this._getChildrenOf(t,e)))}update(t,e){return this.getId(t).then((t=>{if(void 0!==t)return this.connector.put("resource.item",{data:e},{id:t})}))}delete(t){return this.getId(t).then((t=>{if(void 0!==t)return this.connector.delete("resource.item",null,{id:t}).then((()=>{this._cleanResourceItemCache(t)}))}))}_getChildrenOf(t,e,i=[]){return this.connector.get("resource.collection",{cache:!0,...e},{parent:t}).then((t=>{const o=[];for(const n of t)this.cache.add("resource.item",P.resolve(n),{id:n.resource.id}),i.push(n),(null==e?void 0:e.recursive)&&n.resource.children&&o.push(this._getChildrenOf(n.resource.id,e,i));return o.length?P.all(o).then((()=>i)):i}))}async _cleanResourceItemCache(t){const e=this.cache.all(),i=[];for(const o of e){const e=o.options&&o.options.id;if(["resource.item","resource"].includes(o.key)&&void 0!==e)if("number"==typeof e)e===t&&i.push(o);else{await this.getId(e)===t&&i.push(o)}}for(const o of i)this.cache.delete(o)}_fetchResourceById(t,e){return this.cache.add("resource.item",(()=>this.connector.get("resource.item",e,{id:t})),{id:t}).catch((t=>{if(!(t instanceof It))throw t}))}_fetchResourceBy(t,e){return this.getMany(t,e).then((t=>t[0]))}_resourceCacheFilter(t){return P.all(this.cache.matchAll("resource.item")).then((e=>(e.filter((e=>{if(e)return t.keyname&&e.resource.keyname?t.keyname===e.resource.keyname:C(t.id)&&C(e.resource.id)?t.id===e.resource.id:R(t,e.resource)})),[])))}}const Nt=[];function Rt(t){Nt.push(t)}class Dt extends Ot{constructor(t){super(t),this.name="InsufficientPermissionsError",this.exception="nextgisweb.core.exception.InsufficientPermissions",Object.setPrototypeOf(this,Dt.prototype)}}const jt=/\{ *([\w_-]+) *\}/g;function Ft(t,e){return t.replace(jt,((t,i)=>{let o=e[i];if(void 0===o)throw new Error("No value provided for letiable "+t);return"function"==typeof o&&(o=o(e)),o}))}class Ut extends Error{constructor(t){super(),this.name="NetworkError",Object.setPrototypeOf(this,Ut.prototype),this.message=`Unable to request ${t}.\n Possibly invalid NGW URL entered or CORS not configured to get request from ${location.origin}`}}let Wt;Wt=(t,e,i={},o,n)=>{i.method=i.method||"GET";const s=new XMLHttpRequest;s.open(i.method||"GET",t,!0),"blob"===i.responseType&&(s.responseType=i.responseType);const r=()=>{try{return JSON.parse(s.responseText)}catch(t){return s.responseText}};s.onload=()=>{-1!==[401,403,404,422,500].indexOf(s.status)&&o(new Ot(r())),((t=!1)=>{const n=t?o:e;"blob"===i.responseType?n(s.response):s.responseText?n(r()):o({message:""})})()},s.onerror=e=>{o(0===s.status?new Ut(t):e)},s.upload.onprogress=function(t){if(t.lengthComputable){i.onProgress&&i.onProgress(t.loaded/t.total*100,t)}};const a=i.headers;if(a)for(const l in a){const t=a[l];"string"==typeof t&&s.setRequestHeader(l,t)}let h;if(void 0!==i.withCredentials&&(s.withCredentials=i.withCredentials),i.file){if(h=new FormData,h.append("file",i.file),i.data)for(const l in i.data)h.append(l,h[l])}else h=i.data?"string"==typeof i.data?i.data:JSON.stringify(i.data):null;n&&n((()=>{s.abort()})),s.send(h)};let Ht=0;class Vt{constructor(t){this.options=t,this.id=Ht++,this.emitter=new o.exports.EventEmitter,this.routeStr="/api/component/pyramid/route",this.activeRequests=[];const e=function(t){return Nt.find((e=>{if(e.options.baseUrl===t.baseUrl){if(!t.auth)return!0;if(e.options.auth)return R(e.options.auth,t.auth)}}))}(t);if(e)return e;this.options.route&&(this.routeStr=this.options.route),this.options.requestTransform&&(this.requestTransform=this.options.requestTransform),this.resources=new Zt(this),Rt(this)}static create(t){return new this(t)}setRequestTransform(t){this.requestTransform=t}setNgw(t){this.logout(),this.options.baseUrl=t,Rt(this)}connect(){const t=new Et,e=this.options.auth;return t.add("route",(()=>new P(((t,i)=>{const o=()=>this.makeQuery(this.routeStr,{},{}).then((e=>{t(e)})).catch((t=>{i(t)}));if(e){const{login:t,password:n}=e;if(t&&n)return this._login({login:t,password:n}).then((()=>o())).catch((t=>i(t)))}return o()}))),{id:this.id,auth:e,baseUrl:this.options.baseUrl})}login(t,e){return this.logout(),Rt(this),this._login(t,e)}logout(){this.abort(),function(t){const e=Nt.indexOf(t);-1!==e&&Nt.splice(e,1)}(this),this.options.auth=void 0,this.user=void 0,this.emitter.emit("logout"),this.resources.cache.clean()}getUserInfo(t,e){if(this.user&&this.user.id)return P.resolve(this.user);t&&(this.options.auth=t);const i={headers:this.getAuthorizationHeaders(t),...e};return this.makeQuery("/api/component/auth/current_user",{},i)}getAuthorizationHeaders(t){const e=this.makeClientId(t);if(e)return{Authorization:"Basic "+e}}makeClientId(t){if(t=t||this.options.auth){const{login:e,password:i}=t,o=unescape(encodeURIComponent(`${e}:${i}`));return window.btoa(o)}}abort(){for(const t of this.activeRequests)t.cancel();this.activeRequests=[]}getActiveApiRequests(){return[...this.activeRequests]}apiRequest(t,e={},i={}){var o,n;const{method:s,headers:r,withCredentials:a,responseType:h}=i,l=D(e=null!==(o=i.params)&&void 0!==o?o:e),c=()=>function(t){const e=t.params;return new P(((i,o)=>{t.connector.connect().then((n=>{let s=n&&n[t.name];if(s){s=[...s];let n=s.shift();if(s.length){const t={};for(let i=0;i<s.length;i++){const o=s[i];if(t[i]="{"+o+"}",void 0===e[o])throw new Error("`"+o+"` url api argument is not specified")}n&&(n=Ft(n,t))}if(e){const t=[],i=e.paramList;Array.isArray(i)&&(delete e.paramList,i.forEach((e=>{t.push(`${e[0]}=${e[1]}`)})));for(const o in e)-1===s.indexOf(o)&&t.push(`${o}=${e[o]}`);t.length&&(n=n+"?"+t.join("&"))}n?i(t.connector.makeQuery(n,e,t.requestOptions)):o(new Error("request url is not set"))}else i(void 0)})).catch((t=>{o(t)}))}))}({name:t,params:l,requestOptions:i,connector:this});if(i.cache&&"GET"===s){return(new Et).add(t,c,{params:l,...D({headers:r,withCredentials:a,responseType:h,baseUrl:this.options.baseUrl,userId:null===(n=this.user)||void 0===n?void 0:n.id})})}return c()}post(t,e,i){return(e=e||{}).method="POST",this.apiRequest(t,i,e)}get(t,e,i){return(e=e||{}).method="GET",this.apiRequest(t,i,e)}patch(t,e,i){return(e=e||{}).method="PATCH",this.apiRequest(t,i,e)}put(t,e,i){return(e=e||{}).method="PUT",this.apiRequest(t,i,e)}delete(t,e,i){return(e=e||{}).method="DELETE",this.apiRequest(t,i,e)}makeQuery(t,e,i={}){if(t=(this.options.baseUrl?this.options.baseUrl:"")+t)return e&&(t=Ft(t,e)),t=encodeURI(F(t)),this._loadData(t,i);throw new Error("Empty `url` not allowed")}getResource(t,e){return this.resources.getOne(t,e)}getResourceOrFail(t,e){return this.resources.getOneOrFail(t,e)}getResourceBy(t){return this.resources.getOne(t)}getResourceByKeyname(t){return this.resources.getOne(t)}getResourceById(t){return this.resources.getOne(t)}getResourceId(t,e){return this.resources.getId(t,e)}getResourceIdOrFail(t,e){return this.resources.getIdOrFail(t,e)}getResourcesBy(t,e){return this.resources.getMany(t,e)}getResourceParent(t,e){return this.resources.getParent(t,e)}getResourceChildren(t,e){return this.resources.getChildrenOf(t,e)}updateResource(t,e){return this.resources.update(t,e)}deleteResource(t){return this.resources.delete(t)}_loadData(t,e){e.responseType=e.responseType||"json";const i=new P(((i,o,n)=>{if(this.user&&((e=e||{}).headers={...this.getAuthorizationHeaders(),...e.headers}),this.requestTransform){const[i,o]=this.requestTransform(t,e);t=i,e=o}Wt(t,i,e,o,n)})).then((t=>(this._cleanActiveRequests(i),t))).catch((t=>{if(this._cleanActiveRequests(i),t instanceof P.CancelError);else{const e=this._handleHttpError(t);if(e)throw e}}));return e.signal&&"function"==typeof e.signal.addEventListener&&e.signal.addEventListener("abort",(()=>{i.cancel(),this._cleanActiveRequests(i)})),this.activeRequests.push(i),i}_login(t,e){return this.getUserInfo(t,e).then((t=>(this.user=t,this.emitter.emit("login",t),t))).catch((t=>{throw this.emitter.emit("login:error",t),t}))}_cleanActiveRequests(t){const e=this.activeRequests.indexOf(t);-1!==e&&this.activeRequests.splice(e,1)}_handleHttpError(t){if(t&&t instanceof Ot){if("nextgisweb.resource.exception.ResourceNotFound"===t.exception)throw new It(t);if("nextgisweb.core.exception.InsufficientPermissions"===t.exception)throw new Dt(t)}return t}}Vt.errors={NgwError:Ot,ResourceNotFoundError:It};class qt{constructor(t){this.options=t,this.resourceId=t.resourceId;const e=t.item;this.item=e,this.name=t.labelField&&e.fields?e.fields[t.labelField]:String(e.id)}extent(){return this._extent?P.resolve(this._extent):this.options.connector.get("feature_layer.feature.item_extent",null,{id:this.resourceId,fid:this.item.id}).then((t=>{const{minLat:e,minLon:i,maxLat:o,maxLon:n}=t.extent,s=[i,e,n,o];return this._extent=s,s}))}geoJson(){return this.item.geom?P.resolve(ye(this.item)):Je({resourceId:this.resourceId,featureId:this.item.id,connector:this.options.connector,geom:!0,fields:null,extensions:null}).then((t=>(this.item.geom=t.geom,ye(this.item))))}}function Gt(t,e,i,o){return!!Yt(t,e,i,Qt,o)}function Jt(t,e,i,o){return Yt(t,e,i,Xt,o)}function Kt(t,e="children"){let i=[];const o=("function"==typeof e?e:t=>t[e])(t);return o&&(Array.isArray(o)?i=o:i.push(o)),o?i:void 0}function Yt(t,e=(t=>!!t),i="children",o,n){const s="function"==typeof e?e:t=>ct(t,e);return o(t,n?t=>s(n(t)):s,i)}function Qt(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{if(e(t))return t;const o=Kt(t,i);o&&(n=o)}for(let s=0;s<n.length;s++)if(n[s]){const t=Qt(n[s],e,i,o);if(t)return t}}function Xt(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{e(t)&&o.push(t);const s=Kt(t,i);s&&(n=s)}for(let s=0;s<n.length;s++)n[s]&&Xt(n[s],e,i,o);return o}function $t(t,e=(t=>!!t),i,o=[]){let n=[];if(Array.isArray(t))n=t;else{if(!e(t))return!1;const o=Kt(t,i);o&&(n=o)}for(let s=0;s<n.length;s++)if(n[s]){if(!$t(n[s],e,i,o))return!1}return!0}class te{constructor(t){this._children=[],this.item=t}setParent(t){this._parent=t}addChild(t){this._children.push(t)}getParent(){return this._parent}getParents(t){const e=this.getParent();return e?Jt(e,t,(t=>t.tree.getParent())):[]}getRoot(){let t=this.getParent(),e=t;for(;t;)t=t.tree.getParent(),t&&(e=t);return e}find(t){return Yt(this._children,t,(t=>t.tree.getChildren()),Qt,e);var e}every(t){return!!Yt(this._children,t,(t=>t.tree.getChildren()),$t,e);var e}some(t){return Gt(this._children,t,(t=>t.tree.getChildren()))}all(t){return this.getDescendants(t)}getDescendants(t){return Jt(this._children,t,(t=>t.tree.getChildren()))}getChildren(){return[...this._children]}}class ee{constructor(t,e,i){this.emitter=new o.exports.EventEmitter,this._blocked=!1,this.item=e,this.options=Object.assign({},i),this.name=t,this._value=this.getProperty()}getProperty(){return"function"==typeof this.options.getProperty?this.options.getProperty.call(this,this.item):this.options.value}getParents(){return this.item.tree.getParents()||[]}getParent(){return this.item.tree.getParent()}getChildren(){return this.item.tree.getChildren()}isGroup(){return this.item.tree.getDescendants().length}isBlocked(){if(void 0!==this._blocked)return this._blocked;const t=this.item.tree.getParents();return this._blocked=this._calculateBlockedStatus(t),this._blocked}set(t,e){this._value=this._prepareValue(t),this.update(this._value,e),this._fireChangeEvent(this._value,e)}get(){return this.getValue()}update(t,e){this._callOnSet(t,e)}getContainer(){return this._container}destroy(){if(this._container){const t=this._container.parentNode;t&&t.removeChild(this._container)}this._removeEventsListener&&this._removeEventsListener()}getValue(){return void 0!==this._value?this._value:this.getProperty()}_prepareValue(t){return t}_callOnSet(t,e){this.options.onSet&&this.options.onSet.call(this,t,e,this.item)}_fireChangeEvent(t,e){if(this.emitter){t=void 0!==t?t:this.getValue(),this.emitter.emit("change",{value:t,options:e});this.item.tree.getParents().forEach((i=>{const o=i.properties&&i.properties.property(this.name);o&&o.emitter.emit("change-tree",{value:t,options:e,item:this.item})}))}}_calculateBlockedStatus(t){return t.some((t=>{var e;const i=null===(e=t.properties)||void 0===e?void 0:e.property(this.name);return!!i&&!i.get()}))}}class ie extends ee{constructor(t,e,i){super(t,e,{...ie.options,...i}),this.set(this.get())}update(t,e){if(t){if(e&&e.bubble||this.options.bubble){this.unBlock(e);const i=this.getParent(),o=i&&i.properties&&i.properties.property(this.name);o&&o.set(t,Object.assign({},e,{bubble:!0,propagation:!1}))}this.isBlocked()||this._turnOn(e)}else this._turnOff(e);(e&&e.propagation||this.options.propagation)&&this._propagation(t,e)}getHierarchyValue(){return this.get()&&this.getParents().every((t=>{const e=t.properties&&t.properties.get(this.name);return e&&e.get()}))}block(t){this._blocked=!0,this._block(t)}unBlock(t){this._blocked=!1,this.getValue()&&this._unBlock(t)}blockChild(t){this.item.tree.getDescendants().forEach((e=>this._blockChild(e,t)))}unblockChild(t){this.item.tree.getChildren().forEach((e=>this._unBlockChild(e,t)))}_prepareValue(t){return t}_turnOff(t){this.options.turnOff&&this.options.turnOff.call(this,t),this._callOnSet(!1,t),this.options.hierarchy&&this.isGroup()&&this.blockChild(t)}_turnOn(t){this.options.turnOn&&this.options.turnOn.call(this,t),this._callOnSet(!0,t),this.options.hierarchy&&this.isGroup()&&this.unblockChild(t)}_block(t){this._turnOff(t)}_unBlock(t){this._turnOn(t)}_blockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.block&&i.block(e)}_unBlockChild(t,e){const i=t.properties&&t.properties.property(this.name);i&&i.unBlock&&i.unBlock(e)}_propagation(t,e){if(this.isGroup()){const i=this.item.tree.getChildren();for(let o=0;o<i.length;o++){const n=i[o],s=n.properties&&n.properties.property(this.name);s&&s.set(t,{...e,propagation:!0,bubble:!1})}}}}ie.options={hierarchy:!0,bubble:!1,propagation:!1,label:"Toggle"};class oe{constructor(t,e){this.item=t,this.options={},this._properties={},this._propertiesList=[],e&&e.forEach(this._setPropertyHandler.bind(this))}add(t){this._setPropertyHandler(t)}update(){this.list().forEach((t=>t.update()))}get(t){const e=this.property(t);return e?e.get():void 0}set(t,e,i){const o=this.property(t);o&&o.getValue()!==e&&o.set(e,i)}property(t){return this._properties[t]}list(){return this._propertiesList.map((t=>this._properties[t]))}destroy(){for(const t in this._properties){const e=this.property(t);e&&e.destroy&&e.destroy()}this._properties={},this._propertiesList=[]}_setPropertyHandler(t){const e=this._getHandler(t);if(e&&t.name){const i={...t};this._properties[t.name]=new e(t.name,this.item,i),this._propertiesList.push(t.name)}}_getHandler(t){const e=t.handler;return!e&&t.type?"boolean"===t.type?oe.handlers.CheckProperty:oe.handlers.BaseProperty:e}}oe.handlers={CheckProperty:ie};let ne=0;class se{constructor(t){this.options={},this.id=ne,ne+=1,this.options={...t},this.tree=new te(this)}initProperties(){this.properties=new oe(this,this.options.properties)}}function re(t){const e=t.extent_bottom,i=t.extent_left,o=t.extent_top,n=t.extent_right;if(e&&i&&o&&n){const t=[i,e,n,o];return t[3]>82&&(t[3]=82),t[1]<-82&&(t[1]=-82),t}}function ae({resourceId:t,connector:e,cache:i=!0}){return e.get("layer.extent",{cache:i},{id:t}).then((t=>{if(t){const{maxLat:e,maxLon:i,minLat:o,minLon:n}=t.extent;return[n,o,i,e]}}))}function he(t){return t.connector.getResource(t.resourceId).then((e=>{if(e)return le(e,t.connector,t)}))}function le(t,e,i){if(t.webmap)return P.resolve(re(t.webmap));{const o=t.resource;return o.cls&&-1!==o.cls.indexOf("style")?e.getResource(o.parent.id).then((t=>{if(t)return ae({...i,resourceId:t.resource.id,connector:e})})):ae({...i,resourceId:o.id,connector:e})}}class ce{async getExtent(){return this.getBounds()}async getBounds(t){return this._extent?this._extent:this.item?(this._extent=await le(this.item,this.connector,t),this._extent):void 0}}async function ue(t,e){const i=t.resource,o=i;let{keyname:n,resourceId:s}=t;if(i&&("string"==typeof i?n=i:s="number"==typeof i?i:o.resource&&void 0!==o.resource&&"resource"in o?i.resource.id:await ue(i,e)),!s&&n){const t=await e.getResource(n);t&&(s=t.resource.id)}return s}const pe={tms:"TILE"};function de(t){const e=("https:"===location.protocol?"https":"http")+"://";let i=t.url.replace(/^(https?|ftp):\/\//,e);return t.y_origin_top||(i=i.replace("{y}","{-y}")),{url:i,name:t.name,attribution:t.copyright_text,maxZoom:t.z_max,minZoom:t.z_min}}const fe="https://qms.nextgis.com";function me(t,e=fe,i={}){let o;if("webMap"in t){const{webMap:n,url:s,...r}=t;o=n,s&&(e=s),r&&(i=r)}else o=t;e||(e=fe);class n{constructor(t,e){this.map=t;const o={...i,...e};this.options=o,this.options.baselayer=!0,o.qms&&(this.qms=o.qms)}async addLayer(t){if(!this.qms&&t.qmsId)try{this.qms=await function(t){return new Promise(((e,i)=>{const o=new XMLHttpRequest;o.onreadystatechange=()=>{if(4===o.readyState&&200===o.status&&o.responseText)try{e(JSON.parse(o.responseText))}catch(t){i(t)}},o.open("GET",F(t),!0),o.send()}))}(e+"/api/v1/geoservices/"+t.qmsId)}catch(a){console.error(a)}const i=this.qms;if(i){const e=pe[i.type||"tms"],a=o.mapAdapter.layerAdapters[e];if(a&&(s=n,r=a,["showLayer","hideLayer"].forEach((t=>{const e=Object.getOwnPropertyDescriptor(r.prototype,t);e&&Object.defineProperty(s.prototype,t,e)})),"TILE"===e)){if(t={order:0,maxZoom:o.options.maxZoom,minZoom:o.options.minZoom,...this.options,...de(i)},i.origin_url){const[e,o]=function(t){const e=[];return[t=t.replace(/{switch:(.*?)}/,((t,i)=>("string"==typeof i&&i.split(",").forEach((t=>e.push(t))),"{s}"))),e]}(i.origin_url);o.length&&(t.subdomains=o,t.url=e)}this.options=t;return new a(this.map,t).addLayer(t)}}var s,r}}return n}class _e{constructor(t){this.options={url:"https://qms.nextgis.com"},this.options={...this.options,...t},this.url=this.options.url}getLayerAdapters(){return Promise.resolve([{name:"QMS",createAdapter:t=>Promise.resolve(this._createAdapter(t))}])}_createAdapter(t){return me({webMap:t,url:this.url})}}_e.utils={createQmsAdapter:me};const ge={srs:4326,geom_format:"geojson"};function ye(t){return{geometry:t.geom,id:t.id,type:"Feature",properties:t.fields}}function ve(t,e){const{extensions:i,geom:o,fields:n,srs:s,ilike:r,like:a}=e,h=i?i.join(","):"";"*"!==h&&(t.extensions=h),void 0!==n&&(t.fields=Array.isArray(n)?n.join(","):""),void 0!==o&&(t.geom=o?"yes":"no",o||(delete t.srs,delete t.geom_format)),C(r)?t.ilike=r:C(a)&&(t.like=a),C(s)&&(t.srs=s)}function be(t){const e=xe(t);return P.all(e).then((e=>{const i=[],o=[];for(const t of e)for(const e of t)i.includes(e.id)||(o.push(e),i.push(e.id));return t.offset||t.limit?o.splice(void 0!==t.offset?t.offset:0,void 0!==t.limit?t.limit:o.length):o}))}function we(t){const[e,i,o]=t;let n="",s="";return[`${"id"!==e?"fld_":""}${String(e).trim().replace(/^(%?)(.+?)(%?)$/,((t,e,i,o)=>(n=e,s=o,i)))}__${i}`,n+o+s]}function xe(t,e=[],i=[]){const{filters:o}=t,n="string"==typeof o[0]?o[0]:"all",s=o.filter((t=>Array.isArray(t)));if("any"===n)for(const r of s)lt(r)?e.push(Pe({...t,paramList:[...i,we(r)]})):xe({...t,filters:r},e,[...i]);else if("all"===n){const o=[],n=[];for(const t of s)lt(t)?o.push(we(t)):n.push(t);if(n.length)for(const s of n)xe({...t,filters:s},e,[...i,...o]);else e.push(Pe({...t,paramList:[...i,...o]}))}return e}function Le(t){return`POLYGON((${t.map((([t,e])=>{const[i,o]=Z(t,e).map((t=>function(t,e){const i=e?Number("1e+"+e):1;return Math.round((t+Number.EPSILON)*i)/i}(t)));return i+" "+o})).join(", ")}))`}function Pe(t){const e={...ge},{limit:i,cache:o,signal:n,offset:s,orderBy:r,paramList:a,connector:h,geomFormat:l,intersects:c,resourceId:u}=t;if(i?i!==Number.POSITIVE_INFINITY&&(e.limit=i):e.limit=7e3,s&&(e.offset=s),l&&(e.geom_format=l),ve(e,t),r&&(e.order_by=r.join(",")),Array.isArray(c)){const t=function(t){return Array.isArray(t)&&4===t.length&&t.every((t=>"number"==typeof t))}(c)?z(c):c;e.intersects=Le(t)}else"string"==typeof c&&(e.intersects=c);a&&(e.paramList=a);const p={id:u,...e};return h.get("feature_layer.feature.collection",{cache:o,signal:n},p)}function Me(t){let e;for(e in t){const i=t[e];if(j(i)){const o=i;if(C(o.year)&&C(o.month)&&C(o.day)){const i=[o.year,o.month-1,o.day];"hour"in o&&[o.hour,o.minute,o.second].forEach((t=>{i.push(t)})),t[e]=new Date(...i).toISOString()}}else"id"===e&&"string"==typeof i&&(t[e]=i.split(",").map(Number))}return t}function Ce(t){const e=t.filters;return e?be({...t,filters:e}).then((i=>{var o;return(null!==(o=t.clientFilterValidate)&&void 0!==o?o:ke(e))&&(i=i.filter((t=>ct(Me({...t.fields,id:t.id}),e)))),i})):Pe(t)}function ke(t){if("any"===t[0])return!0;for(let e=1;e<t.length;e++){const i=t[e];if("[object Array]"===Object.prototype.toString.call(i)){if(ke(i))return!0}}return!1}function Ae(t){return function(t){return Ce(t).then((t=>{const e=[];return t.forEach((t=>{e.push(ye(t))})),e}))}(t).then((t=>({type:"FeatureCollection",features:t})))}const Te=["fields","intersects","limit","orderBy","strategy"];function Ee(t){const e={};return Te.forEach((i=>{const o=t[i];void 0!==o&&(e[i]=o)})),e}async function Oe(t){var e,i;const{item:n,webMap:s,Adapter:r,connector:a,layerOptions:h,addLayerOptionsPriority:l}=t,c=null==l||l,u=h,p=r||s.mapAdapter.layerAdapters.GEOJSON,d=[];let f,m,_=!1;const g=await ue(u,a);(null===(i=null===(e=u.adapterOptions)||void 0===e?void 0:e.popupOptions)||void 0===i?void 0:i.fromProperties)&&(u.adapterOptions.popupOptions.createPopupContent=({feature:t})=>t&&function(t,e){{const i=document.createElement("div");if(e&&e.feature_layer)e.feature_layer.fields.forEach((e=>{if(e.grid_visibility){const o=t.properties&&t.properties[e.keyname];if(o){const t=document.createElement("div");i.appendChild(t),t.innerHTML=`<span>${e.display_name}</span>: ${o}<span></span>`}}}));else if(t.properties)for(const e in t.properties){const o=document.createElement("div");i.appendChild(o),o.innerHTML=`<span>${e}</span>: ${t.properties[e]}<span></span>`}return i}}(t,n));const y=async(t,e)=>(b(),f={filters:t,options:e},m=Ae({resourceId:g,filters:t,connector:a,cache:!0,...e}),await m);let v=!1;const b=()=>{m&&(m.cancel(),m=void 0)};return class extends p{constructor(){super(...arguments),this.emitter=new o.exports.EventEmitter}async addLayer(t){let e=!t.data;const i=void 0===t.waitFullLoad||t.waitFullLoad;void 0!==u.id&&(t.id=u.id),n&&n.vector_layer&&(t.type=De[n.vector_layer.geometry_type]),u.adapterOptions&&(t=c?{...u.adapterOptions,...t}:{...t,...u.adapterOptions}),t.data&&0===Object.keys(t.data).length&&(t.data=void 0,e=!1);const o=t.strategy||void 0;this.options.strategy=o;const s=super.addLayer(t);let r;return f={filters:t.propertiesFilter,options:Ee(t)},e&&(r=this.updateLayer()),i&&r&&await r,o&&o.startsWith("BBOX")&&!_&&this._addBboxEventListener(),s}getExtent(){return this.getBounds()}async getBounds(){const t=this.getLayers&&this.getLayers().length,e=this.options.strategy;return(null==e?void 0:e.startsWith("BBOX"))||t?he({connector:a,resourceId:n.resource.id}):super.getBounds?super.getBounds():void 0}beforeRemove(){v=!0,this._removeMoveEventListener(),this._removeBboxEventListener(),this.__disableMapMoveListener=void 0,this.__enableMapMoveListener=void 0,this.__onMapMove=void 0,this.__onMapMoveStart=void 0,b()}getCount(){return function({connector:t,resourceId:e,cache:i=!0}){return t.get("feature_layer.feature.count",{cache:i},{id:e}).then((t=>t.total_count))}({connector:a,resourceId:g,cache:!0})}async updateLayer(t){var e;if(t=t||f||{},null===(e=this.options.strategy)||void 0===e?void 0:e.startsWith("BBOX")){await s.onLoad("create"),t.options=t.options||{},t.options.intersects=s.getBounds();const{minZoom:e,maxZoom:i}=this.options,o=s.getZoom();if(void 0!==o){if(void 0!==e&&o<e)return;if(void 0!==i&&o>i)return;if(_)return}}if(!v){try{this.emitter.emit("preupdate",t),s._emitLayerEvent("layer:preupdate",u.id||"",t);const e=await y(t.filters,{...t.options,srs:this.options.srs});let i=e;const o=await this.getCount();if("BBOX+"===this.options.strategy){i={type:"FeatureCollection",features:[]};for(const t of e.features)-1===d.indexOf(String(t.id))&&(d.push(String(t.id)),i.features.push(t));_=void 0!==o&&d.length>=o,await s.addLayerData(this,i)}else _=void 0!==o&&e.features.length>=o,await s.setLayerData(this,e);this.emitter.emit("updated",e),s._emitLayerEvent("layer:updated",u.id||"",{data:e,newData:i,isFull:_})}catch(i){if(i instanceof Error&&"CancelError"!==i.name)throw i}super.updateLayer&&super.updateLayer()}}async propertiesFilter(t,e){if(b(),this.filter&&_)this.filter((e=>{const i=e.feature&&e.feature.properties&&Me({...e.feature.properties});return!i||ct(i,t)}));else if(this.setData){this.clearLayer&&this.clearLayer();const i=await y(t,{...e,srs:this.options.srs});this.setData(i)}}removeFilter(){f=void 0,this.propertiesFilter([]),this.filter&&this.filter((()=>!0))}_addBboxEventListener(){this.__enableMapMoveListener=t=>{t===this&&(this._removeMoveEventListener(),this.updateLayer(),this._addMoveEventListener())},this.__disableMapMoveListener=t=>{t===this&&this._removeMoveEventListener()},s.emitter.on("layer:show",this.__enableMapMoveListener),s.emitter.on("layer:hide",this.__disableMapMoveListener),this.__enableMapMoveListener(this)}_removeBboxEventListener(){this.__enableMapMoveListener&&s.emitter.on("layer:show",this.__enableMapMoveListener),this.__disableMapMoveListener&&s.emitter.on("layer:hide",this.__disableMapMoveListener)}_addMoveEventListener(){this.__onMapMove=E((()=>this.updateLayer())),this.__onMapMoveStart=b,s.emitter.on("movestart",this.__onMapMoveStart),s.emitter.on("moveend",this.__onMapMove)}_removeMoveEventListener(){this.__onMapMove&&s.emitter.removeListener("moveend",this.__onMapMove),this.__onMapMoveStart&&s.emitter.removeListener("movestart",this.__onMapMoveStart)}}}function Ie({options:t,webMap:e,baseUrl:i}){var o;let n,s=t.adapter||"IMAGE";const r=e&&e.getLayerAdapters(),a=t.resource,h=t.tileNoData?t.tileNoData:200;if("number"==typeof a){if("IMAGE"===s){if(!r||r.IMAGE)return function({resourceId:t,baseUrl:e,nd:i,headers:o}){const n=e+"/api/component/render/image",s={resource:t};return i&&(s.nd=i),{url:n,resourceId:t,headers:o,params:s,updateWmsParams:e=>(i&&(e.nd=i),Re(e,t))}}({resourceId:a,headers:t.headers,nd:h,baseUrl:i});s="TILE"}if("WMS"===s){n=`${i}/api/resource/${a}/wms`;const e=t.adapterOptions;return{url:n,format:"image/png",version:"1.1.1",layers:e&&e.layers,headers:t.headers}}if("MVT"===s)return n=i+"/api/component/feature_layer/mvt?x={x}&y={y}&z={z}&resource="+a+"&simplification="+(null!==(o=t.simplification)&&void 0!==o?o:6),{url:n,sourceLayer:"ngw:"+a,featureIdName:"$id"};if("TERRAIN"===s)return n=i+`/api/resource/${a}/terrain_provider`,{url:n,adapter:s};if("MODEL_3D"===s)return n=i+`/api/component/model_3d/${a}/data.glb`,{url:n};if("TILE"===s)return n=i+"/api/component/render/tile?z={z}&x={x}&y={y}&resource="+a+"&nd="+h,{url:n,adapter:s}}else{if(void 0!==a)throw new Error("Option `resource` must be number, not "+typeof a);console.log("Option `resource` not set")}}async function ze({layerOptions:t,webMap:e,connector:i,item:o}){const n=o.resource.cls;let s=t.adapter||n&&{wmsserver_service:"WMS",tmsclient_layer:"IMAGE"}[n]||"IMAGE";if(void 0!==s&&(t.adapter=s),"IMAGE"===s){const t=e.getLayerAdapters();!t||t.IMAGE||(s="TILE")}const r=e.mapAdapter.layerAdapters[s];if(r){const n=await ue(t,i);return class extends r{constructor(s,r){super(s,r),this.map=s,this.item=o,this.resourceId=n;const a=Ie({options:t,webMap:e,baseUrl:i.options.baseUrl||""});if(a){const e={...a,...t.adapterOptions,params:{resource:n},layers:a.layers||String(n),resourceId:n};t.adapterOptions&&C(t.adapterOptions.setViewDelay)&&(e.setViewDelay=t.adapterOptions.setViewDelay),this.options={...this.options,...e}}}addLayer(t){return super.addLayer({...this.options,...t})}async getLegend(t){const e=await i.get("render.legend_symbols",{params:{id:n},cache:!0,...t}),o=this.options.id;if(void 0!==o){return[{layerId:o,legend:e.map((({display_name:t,icon:e})=>({name:t,symbol:e})))}]}return[]}async getIdentificationIds(){if(this.item){if("MVT"===s)return[this.item.resource.id];const t=this.item.resource.parent.id;if(C(t))return[t]}return[]}}}throw new Error(s+" not supported yet. Only TILE")}const Se={},Be=["mapserver_style","qgis_vector_style","qgis_raster_style","wmsserver_service","raster_style","basemap_layer","vector_layer","raster_layer","postgis_layer","webmap","tmsclient_layer"];async function Ze({layerOptions:t,webMap:e,connector:i,item:o}){const n=o.resource.id,s=await i.getResourceChildren(n),r=s&&s[0];if(r)return Ne({...t,resource:r.resource.id},e,i)}async function Ne(t,e,i){let o,n;const s=t.adapter,r=await ue(t,i);if(r){const a=t.resource;if(n=a&&a.resource&&void 0!==a.resource.id?a:await i.getResource(r),!n)throw"Resource item is not found";{const a=n.resource.cls,h={layerOptions:{...t,resource:r},webMap:e,connector:i,item:n};if(-1!==Be.indexOf(a))if("webmap"===a)o=async function({layerOptions:t,webMap:e,connector:i}){const o=await ue(t,i);return class extends He{constructor(t){super(t,{url:"",webMap:e,resourceId:o,connector:i})}}}(h);else if("vector_layer"===a||"postgis_layer"===a){const e=h.layerOptions.adapterOptions||{};if(e.type=e.type||n.vector_layer&&De[n.vector_layer.geometry_type],h.layerOptions.adapterOptions=e,t.adapterOptions=h,void 0!==s&&"GEOJSON"!==s){if("MVT"!==s)return Ze(h);o=ze(h)}else o=Oe(h)}else{if("raster_layer"===a)return Ze(h);if("basemap_layer"===a)o=async function({webMap:t,item:e}){if(e.basemap_layer){const i=e.basemap_layer.qms,o=e.basemap_layer.url;if(i){const e=JSON.parse(i);return Promise.resolve(_e.utils.createQmsAdapter(t,void 0,{qms:e,baselayer:!0}))}if(o){const e=t.mapAdapter.layerAdapters.TILE;if(e){class t extends e{async addLayer(t){return super.addLayer({...t,url:o})}}return t}}}}(h);else if("GEOJSON"===s){const e=await i.getResource(n.resource.parent.id);if(e){const i={...t,resource:n.resource.parent.id};o=Oe({...h,item:e,layerOptions:i})}}else o=ze(h)}else{if(!Se[a])throw`Resource class '${a}' not yet supported.`;{const t=Se[a];let e;e=s&&"function"!=typeof e?t[s]:t,e&&(o=e(h))}}}}if(o)return o.then((t=>{if(t){const e=t;return n&&(e.prototype.item=n,e.prototype.resourceId=n.resource.id,e.prototype.connector=i),M(e,[ce],{replace:!1}),e}}))}function Re(t,e){const{bbox:i,width:o,height:n,nd:s}=t;return{resource:Array.isArray(e)?e.join(","):e,extent:i,size:o+","+n,timestamp:Date.now(),nd:null!=s?s:200}}const De={POINT:"point",LINESTRING:"line",POLYGON:"polygon",MULTIPOINT:"point",MULTILINESTRING:"line",MULTIPOLYGON:"polygon",POINTZ:"point",LINESTRINGZ:"line",POLYGONZ:"polygon",MULTIPOINTZ:"point",MULTILINESTRINGZ:"line",MULTIPOLYGONZ:"polygon"};let je;function Fe(t,e=0){const i=e,o=function(){if(void 0===je){const t=document.createElement("div");t.style.cssText="position: absolute; left: -100%; top: -100%; width: 100cm;",document.body.appendChild(t);const e=t.offsetWidth;document.body.removeChild(t),je=e}return je}()*function(t){return 12756274*Math.PI*Math.cos(t*Math.PI/180)}(i)/t,n=function(t){return Math.log(t/256)/Math.LN2}(o);return n}class Ue extends se{constructor(t,e,i,n,s,r){if(super({...Ue.options,...i}),this.webMap=t,this.emitter=new o.exports.EventEmitter,this._rootDescendantsCount=0,n&&(this.connector=n),s&&this.tree.setParent(s),this.item=e,"root"===this.item.item_type)this._rootDescendantsCount=this._sumUp(this.item.children);else{const t=this.tree.getRoot();t&&(this._rootDescendantsCount=t._rootDescendantsCount)}this.initProperties(),r||this._init(e)}static async create(t,e,i,o,n){const s=new Ue(t,e,i,o,n,!0);return await s._init(e),s}initItem(t){return"group"===t.item_type||"root"===t.item_type?this.initGroupItem(t):this.initLayerItem(t)}bringToFront(){}fit(){}getLayer(){return this.layer}async getLegend(t){var e;const i=null===(e=this.layer)||void 0===e?void 0:e.id;if(void 0!==i){const e=this.connector;if(e){return[{layerId:i,legend:(await e.get("render.legend_symbols",{params:{id:this.item.resourceId},cache:!0,...t})).map((({display_name:t,icon:e})=>({name:t,symbol:e})))}]}}return[]}getItemOptions(t){const e="layer"===t.item_type&&t.layer_transparency,i="number"==typeof e?(100-e)/100:void 0,o={visibility:!1,name:t.display_name,headers:this.options.headers,crossOrigin:this.options.crossOrigin,setViewDelay:this.options.setViewDelay,params:{resource:this.item.resourceId,item:this.item}};if(this.options.order){const e=String(this.options.drawOrderEnabled&&"draw_order_position"in t?this._rootDescendantsCount-t.draw_order_position:this.id).padStart(4,"0");o.order=Number((0|this.options.order)+"."+e)}if(this.options.popupOptions&&(o.popupOptions=this.options.popupOptions),"layer"===t.item_type){const{maxZoom:e,minZoom:i}=this._getZoomRange(t);Object.assign(o,{updateWmsParams:t.updateWmsParams,url:t.url,headers:this.options.headers,ratio:this.options.ratio,maxZoom:e,minZoom:i,minScale:t.layer_min_scale_denom,maxScale:t.layer_max_scale_denom,interactive:t.layer_identifiable})}return void 0!==i&&(o.opacity=i),o}getChildren(t){return[...t.children].reverse()}_mapScaleToZoomLevel(t){return Fe(t)}initGroupItem(t){if(t.children&&t.children.length){const e=this.getChildren(t);for(const t of e){const e=new this.constructor(this.webMap,t,this.options,this.connector,this);this.tree.addChild(e)}}return Promise.resolve()}initLayerItem(t){const e=this.getItemOptions(t),i=i=>{t._layer=i,this.layer=i;this.properties.get("visibility")&&this.properties.set("visibility",!0),void 0!==e.opacity&&this.webMap.setLayerOpacity(i,e.opacity)};let o;if("layer"===t.item_type)o=t.adapter||t.layer_adapter.toUpperCase();else if(Ue.GetAdapterFromLayerType[t.item_type]){o=(0,Ue.GetAdapterFromLayerType[t.item_type])(t,e,this.webMap,this.connector)}return o?this.webMap.addLayer(o,e).then((t=>{i(t)})):t._layer?Promise.resolve(i(t._layer)):Promise.reject("No layer added")}_getZoomRange(t){const e=this.options.minZoom,i=this.options.maxZoom,o=t.layer_min_scale_denom?this._mapScaleToZoomLevel(t.layer_min_scale_denom):void 0,n=t.layer_max_scale_denom?this._mapScaleToZoomLevel(t.layer_max_scale_denom):void 0,s=[e,o].filter(Boolean),r=[i,n].filter(Boolean);return{minZoom:s.length?Math.max(...s):void 0,maxZoom:r.length?Math.min(...r):void 0}}_init(t){this.initItem(t).then((()=>{this.emitter.emit("init")}))}_sumUp(t,e=0){for(const i of t)"layer"===i.item_type?(e+=1,i.draw_order_position=i.draw_order_position||e):"group"===i.item_type&&(e=this._sumUp(i.children,e));return e}}async function We({webMap:t,connector:e,item:i,adapterOptions:o={},idPrefix:n="first-show-adapter"}){const s=async function({webMap:t,adapterOptions:e={},onLayerAdded:i,createAdapter:o}){return class{constructor(){this.options={},this.layer=[],this._removed=!1,this._creatingInProgress=!1}addLayer(){return this.layer}removeLayer(){this._removed=!0;for(const e of this.layer)t.removeLayer(e)}destroyed(){return this._removed}async showLayer(){if(this.options.visibility=!0,this.layer.length)for(const e of this.layer)await t.showLayer(e);else await this.loadLayer()}async hideLayer(){if(this.options.visibility=!1,this.layer)for(const e of this.layer)await t.hideLayer(e)}async loadLayer(){if(!this.layer.length&&!this._creatingInProgress){this._creatingInProgress=!0;const n=await o(this);if(n){const o=new n(t.mapAdapter.map,{...e}),s=await o.addLayer({order:this.options.order,headers:this.options.headers,baselayer:this.options.baselayer});i&&i(o),Object.assign(o.options,e),o.layer=s,this._removed&&t.removeLayer(o),this.layer.push(o),this.options.visibility&&await t.showLayer(o),this._creatingInProgress=!1}}return this.layer}}}({webMap:t,adapterOptions:o,onLayerAdded:t=>{t.options.baselayer=!1,t.id=n+"-"+i.resource_id},createAdapter:()=>Ne({resource:i.resource_id,adapterOptions:{name:i.display_name,opacity:i.opacity}},t,e)});return s}Ue.GetAdapterFromLayerType={},Ue.options={properties:[{type:"boolean",name:"visibility",getProperty(t){if(t){if("group"===t.item.item_type||"root"===t.item.item_type)return Gt(t.item,(t=>"layer_enabled"in t&&t.layer_enabled),(t=>t.children));if("layer"===t.item.item_type)return t.item.layer_enabled}return!1},onSet(t,e,i){i&&"layer"===i.item.item_type&&(i.layer&&(t?i.webMap.showLayer(i.layer):i.webMap.hideLayer(i.layer)),i.item.layer_enabled=t)}},{name:"opacity",handler:class extends ee{getProperty(){const t=this.item.layer;return t&&t&&t.options&&void 0!==t.options.opacity?t.options.opacity:1}update(t,e){if(e=e||{},this.isGroup()){this._value=this._prepareValue(t,e);const i=this.getChildren();for(const o of i){const i=o.properties.property(this.name);i&&(e.propagation?i.set(t,e):i.update(i.get(),e))}}const i=this.item.layer;if(i){const e=this.getParents().reduce(((t,e)=>{const i=e.properties.property(this.name);return t*(i?i.getValue():1)}),1);this.item.webMap.setLayerOpacity(i,this._prepareValue(t*e))}}_prepareValue(t,e){return e&&e.propagation&&this.isGroup()?1:Number(t)}}}]};class He{constructor(t,e){this.map=t,this.options=e,this.NgwWebmapItem=Ue,this.pixelRadius=10,this.webmapClassName="webmap",this.emitter=new o.exports.EventEmitter,this._webmapBaselayersIds=[];const i=e.resourceId;if(Array.isArray(i)?(this.resourceId=i[0],this.options.id=i[1]):this.resourceId=i,!this.resourceId)throw new Error("NGW `resourceId` is not defined")}async addLayer(t){var e,i;this.options={...this.options,...t},this.layer=await this._getWebMapLayerItem();const o=null===(i=null===(e=this.response)||void 0===e?void 0:e.webmap)||void 0===i?void 0:i.extent_constrained;return this.options.useExtentConstrained&&this._extent&&o&&this.options.webMap.setView({maxBounds:this._extent}),this.layer}removeLayer(){const t=this.options.webMap.mapAdapter;if(this.getDependLayers().forEach((e=>{"layer"in e&&t.removeLayer(e.layer.layer)})),this._webmapBaselayersIds.length){for(const t of this._webmapBaselayersIds)this.options.webMap.removeLayer(t);this._lastActiveBaselayer&&this.options.webMap.showLayer(this._lastActiveBaselayer)}this.options.useExtentConstrained&&this._extent&&this.options.webMap.setView({maxBounds:null}),delete this.layer,delete this.response,delete this._webmapLayersIds}async showLayer(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!0)}async hideLayer(){if(this.layer&&this.layer.properties)return this.layer.properties.property("visibility").set(!1)}async setOpacity(t){if(this.layer&&this.layer.properties)return this.layer.properties.property("opacity").set(t)}getExtent(){return this.getBounds()}getBounds(){const t=this.response&&this.response.webmap;if(t)return re(t)}getDependLayers(){return this.layer&&this.layer.tree.getDescendants()||[]}getBookmarksResourceId(){const t=this.response&&this.response.webmap;if(t)return t.bookmark_resource.id}fetchBookmarks(){const t=this.getBookmarksResourceId(),e=this.options.connector;if(t)return e.getResourceOrFail(t).then((i=>{var o;const n=null===(o=i.feature_layer)||void 0===o?void 0:o.fields.find((t=>t.label_field)),s=n&&n.keyname;return Ce({connector:e,resourceId:t,geom:!1,fields:s?[s]:void 0}).then((i=>{const o=[];for(const n of i){const i=new qt({item:n,resourceId:t,labelField:s,connector:e});o.push(i)}return o}))}));throw new Error("Webmap was not loaded correctly, it is impossible to extract bookmarks")}async getLegend(){const t=[];let e=this.getDependLayers();e=e.sort(((t,e)=>e.id-t.id));for(const i of e){const e=await i.getLegend();t.push(...e)}return t}async getIdentificationIds(){const t=[];let e=this._webmapLayersIds;if(e||(e=await this._getWebMapIds(),this._webmapLayersIds=e),e&&e.length){let e=this.getDependLayers();e=e.sort(((t,e)=>e.id-t.id)),e.forEach((e=>{const i=e.item,o=i.parentId;if(void 0!==o&&"layer"===i.item_type&&i.layer_identifiable){const i=e.properties.property("visibility");i.get()&&!i.isBlocked()&&t.push(o)}}))}return t}async _getWebMapLayerItem(){if(this.resourceId){const t=await this.getWebMapConfig(this.resourceId);if(t&&t.root_item)return new Promise((e=>{const i={};if(this.options.connector&&this.options.connector.options.auth){const t=this.options.connector.getAuthorizationHeaders();t&&(i.headers=t)}i.setViewDelay=this.options.setViewDelay,i.order=this.options.order,i.ratio=this.options.ratio,i.crossOrigin=this.options.crossOrigin,i.minZoom=this.options.minZoom,i.maxZoom=this.options.maxZoom,i.drawOrderEnabled=t.draw_order_enabled,i.popupOptions=this.options.popupOptions;const o=new this.NgwWebmapItem(this.options.webMap,t.root_item,i,this.options.connector);o.emitter.on("init",(()=>e(o)))}))}}async getWebMapConfig(t){const e=await this.options.connector.getResource(t);if(e){this.response=e;const t=e[this.webmapClassName];if(this._setupBaselayers(e),t)return this._extent=[t.extent_left,t.extent_bottom,t.extent_right,t.extent_top],this._updateItemsParams(t.root_item,this.options.webMap,e),t}}_setupBaselayers(t){var e;const i=this.options.webMap;if(null===(e=this.options.useBasemap)||void 0===e||e)if(t.basemap_webmap&&t.basemap_webmap.basemaps.length){const e=i.getActiveBaseLayer();this._lastActiveBaselayer=e?e.id:void 0,this._setBasemaps(t.basemap_webmap)}else this.options.defaultBasemap&&i.addBaseLayer("OSM",{id:"webmap-default-baselayer",name:"OpenStreetMap"})}_setBasemaps(t){const e=this.options.webMap;let i=!1;for(const o of t.basemaps)We({webMap:e,connector:this.options.connector,item:o,adapterOptions:{crossOrigin:this.options.crossOrigin}}).then((t=>{const n=!i&&o.enabled;return o.enabled&&(i=!0),e.addBaseLayer(t,{id:Ge+o.resource_id,name:o.display_name,opacity:o.opacity,visibility:n}).then((t=>{t.id&&this._webmapBaselayersIds.push(t.id)}))}))}_updateItemsParams(t,e,i){if(t)if("group"===t.item_type||"root"===t.item_type)t.children&&(t.children=t.children.map((t=>this._updateItemsParams(t,e,i)))),"root"===t.item_type&&(t.display_name=i.resource.display_name);else if("layer"===t.item_type){const i=F(this.options.connector.options.baseUrl+"/api/component/render/image"),o=t.layer_style_id;t.url=i,t.resourceId=o,t.updateWmsParams=t=>Re(t,o);const n=Ie({options:{adapter:t.layer_adapter.toUpperCase(),resource:o},webMap:e,baseUrl:this.options.connector.options.baseUrl||""});t={...t,...n}}return t}async _getWebMapIds(){const t=this.layer;if(t&&"root"===t.item.item_type){const e=t.tree.getDescendants(),i=[];for(const t of e){const e=t.item;if("layer"===e.item_type){const t=this.options.connector.getResource(e.layer_style_id).then((t=>{if(t){const i=Number(t.resource.parent.id);return e.parentId=i,i}}));i.push(t)}}return(await Promise.all(i)).filter((t=>void 0!==t))}}}class Ve{constructor(t){if(this.options=t,this.options.connector)this.url=this.options.connector.options.baseUrl||"",this.connector=this.options.connector;else{if(!this.options.baseUrl)throw new Error("url is not defined");this.url=this.options.baseUrl,this.connector=new Vt({baseUrl:this.url,auth:this.options.auth})}}static addClassAdapters(t,e){Se[t]=e}async onLoadSync(t){if(this.options.resourceId&&this.url){const e=[this.options.resourceId];if(e.length)for(const i of e){const e={resourceId:i,connector:this.connector,webMap:t};return await t.addLayer(He,{visibility:!0,fit:!0,pixelRadius:this.options.pixelRadius,...e})}}}getLayerAdapters(){return Promise.resolve([this._getLayerAdapter()])}_getLayerAdapter(){return{name:"WEBMAP",createAdapter:t=>Promise.resolve(this._createAdapter(t))}}_createAdapter(t){return e={webMap:t,connector:this.connector,baseUrl:this.url},class extends He{constructor(t,i){super(t,i={...e,...i})}};var e}}class qe{constructor(t){const e=t.feature;this.id=e.id,this.geom=e.geom,this.label=e.label,this.parent=e.parent,this.fields=e.fields,this.layerId=e.layerId,this.connector=t.connector}identify(t={}){return this._item?P.resolve(this._item):Je({connector:this.connector,featureId:this.id,resourceId:this.layerId,fields:null,extensions:["attachment","description"],...t}).then((t=>(this._item=t,this.geom=t.geom,this.extensions=t.extensions,t)))}resource(){return this._resource?P.resolve(this._resource.feature_layer):this.connector.getResource(this.layerId).then((t=>(this._resource=t,this._resource.feature_layer)))}getBounds(){return this._extent?P.resolve(this._extent):function({resourceId:t,featureId:e,connector:i,cache:o=!0}){return i.get("feature_layer.feature.item_extent",{cache:o},{id:t,fid:e}).then((t=>{if(t){const{maxLat:e,maxLon:i,minLat:o,minLon:n}=t.extent;return[n,o,i,e]}}))}({connector:this.connector,featureId:this.id,resourceId:this.layerId})}geojson(){return this._geojson?P.resolve(this._geojson):this.identify().then((t=>t.toGeojson().then((t=>(this._geojson=t,t)))))}}const Ge="webmap-baselayer";function Je(t){const e={...ge};ve(e,t);const i={id:t.resourceId,fid:t.featureId,...e};return t.connector.get("feature_layer.feature.item",{cache:t.cache||!0},i).then((e=>({...e,toGeojson:()=>e.geom?P.resolve(ye(e)):Je({...t,geom:!0,fields:null,extensions:null}).then((t=>{const i=t.geom;return ye({...e,geom:i})}))})))}function Ke(t){return Je(t).then((t=>ye(t)))}function Ye(t,e=!1){const i=[],o=[];for(const s in t){const t=Number(s);isNaN(t)||i.push(t)}const n=t.resources;n&&i.sort(((t,e)=>n.indexOf(t)-n.indexOf(e)));for(let s=0;s<i.length;s++){const n=i[s],r=t[n];if("features"in r){const t=Qe(r.features,Number(n),e);if(t.length&&(o.push(...t),!e))break}}return o}function Qe(t,e,i){const o=[];for(const n of t){if(o.push({featureId:n.id,resourceId:e,feature:n}),!i)break}return o}function Xe(t){const{geom:e,signal:i,cache:o,layers:n}=t,s="string"==typeof e?e:function(t){const e=function(t){var e;if(Array.isArray(t))return t;if("Feature"===t.type)return null===(e=t.geometry)||void 0===e?void 0:e.coordinates[0];if("Polygon"===t.type)return t.coordinates[0];return null}(t);if(!e)return null;return`POLYGON((${e.map((([t,e])=>{const[i,o]=Z(t,e);return`${i} ${o}`})).join(",")}))`}(e);if(!s)throw new Error("Not valid geometry format to make intersection");return t.connector.post("feature_layer.identify",{data:{geom:s,srs:3857,layers:n},signal:i,cache:o})}function $e(t,e){T(t);const[i,o]=t.lngLat,{geom:n,radius:s,signal:r,cache:a}=e,h=null!=n?n:function(t,e,i=10,o=6){const n=i/O*B,s=n/Math.cos(e*S),r=[];for(let a=0;a<o+1;a++){const i=Math.PI*(a/(o/2)),h=t+s*Math.cos(i),l=e+n*Math.sin(i);r.push([h,l])}return r}(i,o,s);return Xe({...e,geom:h,signal:r,cache:a})}const ti={brill:'<path d="m6 0-5 6 5 6 5-6z"/>',circle:'<circle cx="6" cy="6" r="6"/>',rect:'<rect width="12" height="12"/>',marker:'<path d="m6 0c-1.85 0-4 1.19-4 4.22 0 2.05 3.08 6.59 4 7.78 0.821-1.19 4-5.62 4-7.78 0-3.03-2.15-4.22-4-4.22z"/>',cross:'<path d="M 2.4,12 6,8.4 9.6,12 12,9.6 8.4,6 12,2.4 9.6,0 6,3.6 2.4,0 0,2.4 3.6,6 0,9.6 Z"/>',star:'<path d="m6 0.25 1.71 4.18 4.29-1.04e-4 -3.43 3.14 0.857 4.18-3.43-3.14-3.43 3.14 0.857-4.18-3.43-3.14 4.29-0.209z"/>',triangle:'<path d="m12 11.7h-12l6-11.2z"/>',plus:'<path d="m7.5 12v-4.5h4.5v-3h-4.5v-4.5h-3v4.5h-4.5v3h4.5v4.5z"/>',minus:'<path d="m12 7.5v-3h-12v3z"/>',asterisk:'<path d="m7.59 12v-3.27l2.83 1.64 1.58-2.74-2.85-1.64 2.83-1.64-1.56-2.74-2.83 1.64v-3.24h-3.17v3.24l-2.85-1.64-1.57 2.74 2.84 1.64-2.84 1.64 1.57 2.74 2.85-1.64v3.27z"/>'},ei=12;function ii(t,e,i,o){if("number"==typeof e||"string"==typeof e)e=Number(e),t.push({...i,resource:e});else if(Array.isArray(e)){const[n,s]=e;t.push({...i,resource:n,id:s,...o})}else"object"==typeof e&&t.push({...i,...e,...o})}const oi={target:"map",baseUrl:"",whitlabel:!1,controls:["ZOOM","ATTRIBUTION"],controlsOptions:{ZOOM:{position:"top-left"},ATTRIBUTION:{position:"bottom-right",customAttribution:['<a href="https://nextgis.com" target="_blank">©NextGIS</a>']}},pixelRadius:10};class ni extends Tt{constructor(t){super(function(t){const e=[new _e];return t.starterKits&&t.starterKits.forEach((t=>{e.push(t)})),t.connector?t.connector&&(t.baseUrl=t.connector.options.baseUrl):t.connector=new Vt({baseUrl:t.baseUrl||"",auth:t.auth}),(t=A(oi,t)).center||t.bounds||(t.bounds=[-179,-90,180,90]),t.connector&&e.push(new Ve({connector:t.connector,auth:t.auth})),{...t,starterKits:e,create:!1}}(t)),this.emitter=new o.exports.EventEmitter,this._ngwLayers={},this._promises={select:[],identify:[]},t.connector&&(this.connector=t.connector),this._createWebMap().then((()=>{const t=this.getContainer();t&&t.classList.add("ngw-map-container"),this.options.whitlabel&&this._whiteLabel()}))}async addControl(t,e,i){return await this.onLoad("controls:create"),super.addControl(t,e,i)}async addNgwLayer(t){await this.onMapLoad();const{keyname:e,resourceId:i}=t;(e||void 0!==i)&&console.warn(`DEPRECATED WARN: ${"set `resource` options instead of `keyname` or `resourceId`"}`);const o=t.resource;if(!e&&!i&&!o)throw new Error("resource, resourceId or keyname is required parameter to add NGW layer");if(C(this.options.baseUrl))try{C(this.options.setViewDelay)&&(t.adapterOptions=t.adapterOptions||{},C(t.adapterOptions.setViewDelay)||(t.adapterOptions.setViewDelay=this.options.setViewDelay));const e=function(t,e,i){const o=i.getAuthorizationHeaders();return o&&(t.headers=o),Ne(t,e,i)}(t,this,this.connector),i={visibility:!0,...t,...t.adapterOptions},o=await this.addLayer(e,i),n=o&&this.getLayerId(o);if(o&&n&&(this._ngwLayers[n]={layer:o,resourceId:o.resourceId},o.options.name=o.options.name||o.item&&o.item.resource.display_name,o.options.baselayer)){if(this.getActiveBaseLayer())return o}return o}catch(n){const t=j(o)&&"id"in o?o.id:e||i||o;console.error(`Can't add NGW layer ${t}.`,n)}}fit(){const{center:t,zoom:e,bounds:i}=this.options;t?(this.setCenter(t),e&&this.setZoom(e)):i&&this.fitBounds(i)}fetchNgwLayerItem(t){return Je({connector:this.connector,...t})}fetchNgwLayerItems(t){return Ce({connector:this.connector,...t})}fetchNgwLayerFeature(t){return Ke({connector:this.connector,...t})}fetchNgwLayerFeatures(t){return Ae({connector:this.connector,...t})}fetchIdentifyItem(t,e){const i=function(t){const{connector:e,identify:i}=t,o=Ye(i);return o&&o.length?Je({connector:e,...t.requestOptions,...o[0]}):P.resolve(void 0)}({identify:t,connector:this.connector,requestOptions:e});return this._addPromise("identify",i),i}fetchIdentifyGeoJson(t,e=!1){const i=function(t){const{connector:e,identify:i,requestOptions:o}=t;for(const s in i){const t=Number(s);if(!isNaN(t)){const t=i[s];if("features"in t){const e=t.features.find((t=>t.geom));if(e&&e.geom){const t=e.geom;return P.resolve(ye({...e,geom:t}))}}}}const n=Ye(i);return n&&n.length?Ke({...o,connector:e,...n[0]}):P.resolve(void 0)}({identify:t,connector:this.connector,multiple:e});return i&&"then"in i?(this._addPromise("identify",i),i):P.resolve(i)}getIdentifyGeoJson(t,e=!1){return this.fetchIdentifyGeoJson(t,e)}async getNgwLayers(){return await this.onLoad(),this._ngwLayers}async getNgwLayerByResourceId(t){for(const e in this._ngwLayers){const i=this._ngwLayers[e];if(i.resourceId===t)return i&&i.layer;if(i.layer.getIdentificationIds){const e=await i.layer.getIdentificationIds();if(e&&e.some((e=>e===t)))return i.layer}if(i.layer.getDependLayers){const e=i.layer.getDependLayers().find((e=>e.item&&e.item.parentId===t));if(e)return e.layer}}}async fitLayer(t,e){let i;i="string"==typeof t||"number"==typeof t?String(i):t.id;const o=i&&this._ngwLayers[i];if(o)if(o.layer.getBounds){const t=await o.layer.getBounds();t&&this.fitBounds(t,e)}else{let t;if(o.layer.item)t=o.layer.item;else{const e=o.resourceId;t=await this.connector.getResource(e)}t&&he({resourceId:t.resource.id,connector:this.connector}).then((t=>{t&&this.fitBounds(t,e)}))}else super.fitLayer("number"==typeof t?String(t):t,e)}async zoomToLayer(t){return this.fitLayer(t)}onLoad(t="ngw-map:create"){return super.onLoad(t)}removeLayer(t){const e=this.getLayer(t);if(e){const t=this.getLayerId(e);t&&delete this._ngwLayers[t],super.removeLayer(e)}}enableSelection(){this.$$selectFromNgwRaster||(this.$$selectFromNgwRaster=t=>{this._getSelectListenersCount()&&this.selectFromNgwRaster(t)},this.$$selectFromNgwVector=t=>{this._getSelectListenersCount()&&this._selectFromNgwVector(t)},this.emitter.on("click",this.$$selectFromNgwRaster),this.emitter.on("layer:click",this.$$selectFromNgwVector))}disableSelection(){this.$$selectFromNgwRaster&&(this.emitter.removeListener("click",this.$$selectFromNgwRaster),this.$$selectFromNgwRaster=void 0),this.$$selectFromNgwVector&&(this.emitter.removeListener("layer:click",this.$$selectFromNgwVector),this.$$selectFromNgwVector=void 0)}getNgwLayerItem(t){return this.fetchNgwLayerItem(t)}getNgwLayerItems(t){return this.fetchNgwLayerItems(t)}getNgwLayerFeature(t){return this.fetchNgwLayerFeature(t)}getNgwLayerFeatures(t){return this.fetchNgwLayerFeatures(t)}cancelPromise(...t){this.cancelPromises(...t)}cancelPromises(...t){t.length||(t=Object.keys(this._promises)),t.forEach((t=>{const e=this._promises[t];e&&(e.forEach((t=>t.cancel())),this._promises[t]=[])}))}async selectFromNgwRaster(t){var e;this._emitStatusEvent("ngw:preselect");const i=[],o=Object.values(this._ngwLayers);o.sort(((t,e)=>t.layer.order&&e.layer.order?e.layer.order-t.layer.order:1));for(const p of o){const t=p.layer,o="function"==typeof t.getIdentificationIds&&t.getIdentificationIds,n=null===(e=t.options.interactive)||void 0===e||e;o&&t.options.selectable&&n&&this.isLayerVisible(t)&&i.push(o.call(t))}const n=Promise.all(i),s=await n,r=[];for(const p of s)p&&r.push(...p);if(!r.length)return void this._emitStatusEvent("ngw:select",null);const a=this.options.pixelRadius||10,h=this.getCenter();let l=this.getZoom();if(l=void 0!==l?l:20,!h||!l)return void this._emitStatusEvent("ngw:select",null);const c=function(t,e,i){return(i=null!=i?i:10)*(40075016.686*Math.abs(Math.cos(180*t[1]/Math.PI))/Math.pow(2,e+8))*5e-4}(h,l,a),u=$e(t,{layers:r,connector:this.connector,radius:c}).then((e=>{const i={...e,resources:r,sourceType:"raster",event:t},o=this._prepareToIdentify(i);return this._emitStatusEvent("ngw:select",o),o}));return this._addPromise("select",u),u}_addPromise(t,e){const i=this._promises[t];if(i&&-1===i.indexOf(e)){const t=()=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)};e.then(t),e.catch(t),i.push(e)}}_isFitFromResource(){const t=this._initMapState;return!t.zoom||!t.center}async _createWebMap(){await this.create(),this.options.qmsId&&this._addQmsBaseLayer(),this.options.osm&&this._addOsmBaseLayer();const t=[],e=this._isFitFromResource();if(this.options.webmapId&&ii(t,this.options.webmapId,{fit:e}),this.options.resources&&Array.isArray(this.options.resources))for(const o of this.options.resources){const i={};e||(i.fit=!1),ii(t,o,{},i)}for(const o of t)try{await this.addNgwLayer(o)}catch(i){console.warn(i)}this._emitStatusEvent("ngw-map:create",this),this.enableSelection()}_addOsmBaseLayer(){this.addBaseLayer("OSM")}_addQmsBaseLayer(){let t,e;Array.isArray(this.options.qmsId)?(t=this.options.qmsId[0],e=this.options.qmsId[1]):t=Number(this.options.qmsId);const i={qmsId:t};e&&(i.id=e),this.addBaseLayer("QMS",i)}_selectFromNgwVector(t){const e=t.layer;if(!(e.options.selectable&&this.isLayerVisible(e)))return;const i=e.item&&e.item.resource.id,o=t.feature;if(void 0!==i&&o){const t=o.id;if(t){const e={featureCount:1,[i]:{featureCount:1,features:[{id:Number(t),fields:o.properties||{},label:`#${i}`,layerId:Number(i),parent:"",geom:o.geometry}]}};return this._emitStatusEvent("ngw:select",this._prepareToIdentify({...e,resources:[i],sourceType:"vector"})),e}}}_prepareToIdentify(t){return{...t,getIdentifyItems:()=>Ye(t,!0).map((t=>new qe({feature:t.feature,connector:this.connector})))}}_getSelectListenersCount(){return this.emitter.listenerCount("ngw:select")}async _whiteLabel(){const t=this.getContainer();if(t){const e=await async function(t,e){var i;const o=await t.get("pyramid.settings",null,{component:"pyramid"});if(o&&o.company_logo&&o.company_logo.enabled){const s=document.createElement("a");s.style.position="absolute",s.style.bottom="0",s.style.right="0",s.style.padding=null!==(i=null==e?void 0:e.padding)&&void 0!==i?i:"10px",s.className="ngw-map-logo",e&&e.cssClass&&(s.className+=" "+e.cssClass);const r=new Image;r.style.maxHeight="100px",r.style.maxWidth="100px",r.src="";try{const e=await t.get("pyramid.company_logo",{responseType:"blob"}),i=(window.URL||window.webkitURL).createObjectURL(e);r.src=i}catch(n){console.warn(n)}return null!==o.company_logo.link&&""!==o.company_logo.link.trim()&&(s.href=o.company_logo.link,s.target="_blank",-1!==o.company_logo.link.search(/:\/\/nextgis/)&&(r.alt="Get your own Web GIS at nextgis.com")),s.appendChild(r),s}}(this.connector,this.options.companyLogoOptions);e&&t.appendChild(e)}}}ni.getIcon=function(t={}){var e,i,o,n,s,r;const a=null!==(e=t.shape)&&void 0!==e?e:"circle",h=null!==(i=t.color)&&void 0!==i?i:"blue",l=null!==(o=t.strokeColor)&&void 0!==o?o:"white",c=null!==(n=t.size)&&void 0!==n?n:ei,u=null!==(s=t.rotate)&&void 0!==s?s:0,p=null!==(r=t.anchor)&&void 0!==r?r:[c/2,c/2],d=void 0!==t.stroke?Number(t.stroke):.8,f=t.p||ti[a]||"circle",m="string"==typeof f?f:f(t),_=function(t){return(new DOMParser).parseFromString(t,"image/svg+xml").documentElement}(t.svg||function({width:t,height:e,stroke:i=0,content:o}){const n=i/2;return`<svg\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n width="${t}"\n height="${e}"\n viewBox="-${n} -${n} ${ei+i} ${ei+i}"\n >${o}</svg>`}({width:c,height:c,stroke:d,content:m}));return _.setAttribute("width",String(c)),_.setAttribute("height",String(c)),_.setAttribute("fill",h),d&&(_.setAttribute("stroke",l),_.setAttribute("stroke-width",String(d))),{type:"icon",iconSize:[c,c],iconAnchor:p,html:(new XMLSerializer).serializeToString(_),rotate:u,svg:_}};function si(t,i={},o){return new(e.exports.Control.extend({onAdd(){const n=document.createElement("div"),s=t.onAdd(o);return n.classList.add("leaflet-control"),i.bar&&n.classList.add("leaflet-bar"),i.addClass&&n.classList.add(i.addClass),i.margin||i.bar||(n.style.marginBottom="0px",n.style.marginTop="0px",n.style.marginLeft="0px",n.style.marginRight="0px"),s&&n.appendChild(s),e.exports.DomEvent.disableClickPropagation(n),n},onRemove(){t.onRemove()}}))}function ri(t){const e=t.getNorthEast(),i=t.getSouthWest();return[i.lng,i.lat,e.lng,e.lat]}function ai(t){const e={};for(let o=0;o<t.length;o++)e[t[o]]=1+(e[t[o]]||0);let i="";for(const o in e){e[o]>(i?e[i]:0)&&(i=o)}return i}const hi={Point:"point",LineString:"line",MultiPoint:"point",Polygon:"polygon",MultiLineString:"line",MultiPolygon:"polygon",GeometryCollection:"polygon"},li={stroke:!1,opacity:1},ci={};for(const L in hi){const t=hi[L],e=ci[t]||[];e.push(L),ci[t]=e}function ui(t,e){return-1!==(ci[e]||[]).indexOf(t)}function pi(t){const i=new e.exports.GeoJSON;return(Array.isArray(t)?t:[t]).forEach((t=>i.addData(t))),i.getBounds()}function di(t){return{getBounds:()=>function(t){return ri(pi(t))}(t),getCenter:()=>function(t){const{lat:e,lng:i}=pi(t).getCenter();return[i,e]}(t)}}class fi{constructor(t,e){if(this.map=t,this.options=e,this.pane="order-0",void 0!==e.order){const i="order-"+e.order;let o=t.getPane(i);o||(o=t.createPane(i)),o.style.zIndex=String(Math.round(100*e.order)),this.pane=i}}addLayer(t){Object.assign(this.options,t)}}function mi(t){const e=t.containerPoint,i=t.latlng,{lat:o,lng:n}=i;return{latLng:i,lngLat:[n,o],pixel:{left:e.x,top:e.y},source:t}}class _i{constructor(t){this.layer=t}handleMouseEvents(t){const{onClick:e,onLayerClick:i,onMouseOut:o,onMouseOver:n}=this.layer.options,s=e||i;s&&(this._onclick=e=>{const i=!!this.layer._getSelected(t);s({selected:i,...this._createMouseEvent(e)})},t.on("click",this._onclick,this)),o&&(this._mouseout=t=>{o(this._createMouseEvent(t))},t.on("mouseout",this._mouseout,this)),n&&(this._mouseover=t=>{n(this._createMouseEvent(t))},t.on("mouseover",this._mouseover,this))}stopMouseEvents(t){this._mouseover&&t.off("mouseover",this._mouseover,this),this._mouseout&&t.off("mouseout",this._mouseout,this),this._onclick&&t.off("click",this._onclick,this)}_createMouseEvent(t){return function({layer:t,source:e}){const i=e.target.feature;return{layer:t,feature:i,event:mi(e),source:e,...di(i)}}({layer:this.layer,source:t})}}class gi{constructor(t){this.layer=t}setPaintEachLayer(t){this.layer._layers.forEach((e=>{this.setPaint(e,t)}))}setPaint(t,e){let i;const{layer:o,feature:n}=t;if(o&&n&&(W(e)?i=e(n):U(e)&&(i=e),i))if("point"===this.layer.type&&"icon"===i.type){const t=o,e=this._createDivIcon(i);setTimeout((()=>{t.setIcon(e)}),10)}else"setStyle"in o&&o.setStyle(this.preparePaint(i))}preparePaint(t){if("get-paint"!==t.type){const e="line"===this.layer.type?[["color","strokeColor"],["opacity","strokeOpacity"],["weight","weight"]]:[["color","strokeColor"],["opacity","strokeOpacity"],["stroke","stroke"],["fillColor","fillColor"],["fillOpacity","fillOpacity"],["fill","fill"],["weight","weight"]],i={};"radius"in t&&"number"==typeof t.radius&&(i.radius=t.radius);for(const[o,n]of e){const e=this.layer.options.opacity;let s=t[n];C(e)&&-1!==n.toLowerCase().indexOf("opacity")&&(s=Number(s)*e),void 0!==s&&Object.defineProperty(i,o,{enumerable:!0,value:s})}return i}return li}_createDivIcon(t){const{html:i,rotate:o,className:n,...s}=t,r=document.createElement("div");n&&(r.className=n),o&&(r.style.transform=`rotateZ(${o}deg)`),i&&(r.innerHTML=i);return new e.exports.DivIcon({className:"",...s,html:r})}createPaintToLayer(t){if(t&&t.type)if("icon"===t.type){if(t.className||t.html)return(i,o)=>{const n=this._createDivIcon(t);return new e.exports.Marker(o,{icon:n})}}else if("pin"===t.type)return(t,i)=>new e.exports.Marker(i);return(i,o)=>new e.exports.CircleMarker(o,this.preparePaint({...li,...t}))}createPaintOptions(t){const e={},i=this.preparePaint(t);return t&&(e.style=()=>i),"point"===this.layer.type?e.pointToLayer=this.createPaintToLayer(t):"line"===this.layer.type&&(i.stroke=!0),e}}function yi(t,e,i){const o=new XMLHttpRequest;o.open("GET",t),o.responseType="arraybuffer";for(const n in i)o.setRequestHeader(n,i[n]);return o.onload=function(){const t=new Uint8Array(this.response),i=new Blob([t],{type:"image/png"}),o=(window.URL||window.webkitURL).createObjectURL(i);e(o)},o.send(),()=>{o.abort()}}class vi extends e.exports.ImageOverlay{constructor(t,e,i){super(t,e,i),this._abort=[]}cancelLoad(){this._abort&&(this._abort.forEach((t=>t())),this._abort=[])}_initImage(){super._initImage();const t=this.options.headers;if(t){const e=this._image,i=e.src;e.src="",this._abort.push(yi(i,(t=>{e.src=t}),t))}}}
2
2
  /*!
3
3
  * leaflet.wms.js
4
4
  * A collection of Leaflet utilities for working with Web Mapping services.
5
5
  * (c) 2014-2016, Houston Engineering, Inc.
6
6
  * MIT License
7
- */class vi extends e.exports.Layer{constructor(t,i){super(i),this.defaultWmsParams={service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},this.options={crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,pane:"tilePane",headers:null,viewPortBuffer:0,setViewDelay:100},this._url=t;const o={},n={};let s;for(s in i)s in this.options?n[s]=i[s]:o[s]=i[s];e.exports.Util.setOptions(this,n),this.wmsParams=e.exports.Util.extend({},this.defaultWmsParams,o)}setParams(t){e.exports.Util.extend(this.wmsParams,t),this.update()}getAttribution(){return this.options.attribution||""}onAdd(){return this.update(),this}onRemove(t){return this._currentOverlay&&(this._currentOverlay.cancelLoad(),t.removeLayer(this._currentOverlay),delete this._currentOverlay),this._currentUrl&&delete this._currentUrl,this}getEvents(){return{moveend:E(this.update,this.options.setViewDelay)}}update(){if(!this._map)return;this.updateWmsParams();const t=this.getImageUrl();if(this._currentUrl===t)return;this._currentUrl=t;const e=this.options.viewPortBuffer||0,i=this._map.getBounds().pad(e),o=new yi(t,i,{opacity:0,pane:this.options.pane,headers:this.options.headers});o.addTo(this._map),this._currentOverlay&&this._currentOverlay.cancelLoad(),o.once("load",(()=>{this._map&&(o._url===this._currentUrl?(this._currentOverlay&&this._map.removeLayer(this._currentOverlay),this._currentOverlay=o,o.setOpacity(void 0!==this.options.opacity?this.options.opacity:1),!0===this.options.isBack&&o.bringToBack(),!1===this.options.isBack&&o.bringToFront(),void 0!==this.options.zIndex&&o.setZIndex(this.options.zIndex)):this._map.removeLayer(o))}),this);const{minZoom:n,maxZoom:s}=this.options;(n&&this._map.getZoom()<n||s&&this._map.getZoom()>s)&&this._map.removeLayer(o)}setOpacity(t){this.options.opacity=t,this._currentOverlay&&this._currentOverlay.setOpacity(t)}bringToBack(){this.options.isBack=!0,this._currentOverlay&&this._currentOverlay.bringToBack()}bringToFront(){this.options.isBack=!1,this._currentOverlay&&this._currentOverlay.bringToFront()}setZIndex(t){this.options.zIndex=t,this._currentOverlay&&this._currentOverlay.setZIndex(t)}updateWmsParams(t){t||(t=this._map);const i=this.options.viewPortBuffer||0,o=t.getBounds().pad(i),n=t.getSize();if(0!==this.options.viewPortBuffer){const t=i+1;n.x=Math.ceil(n.x*t),n.y=Math.ceil(n.y*t)}const s=parseFloat(this.wmsParams.version),r=this.options.crs||t.options.crs,a=s>=1.3?"crs":"srs";if(r){const t=r.project(o.getNorthWest()),i=r.project(o.getSouthEast()),h={width:n.x,height:n.y};h[a]=r.code,h.bbox=(s>=1.3&&r===e.exports.CRS.EPSG4326?[i.y,t.x,t.y,i.x]:[t.x,i.y,i.x,t.y]).join(","),e.exports.Util.extend(this.wmsParams,h)}}getImageUrl(){const t=e.exports.Util.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t}}function bi(t){return class extends t{constructor(...t){super(...t),this.options.setViewDelay&&(this._update=E(((...t)=>{e.exports.GridLayer.prototype._update.call(this,...t)}),this.options.setViewDelay))}createTile(t,e){const i=this.getTileUrl(t),o=document.createElement("img");return o.abort=gi(i,(t=>{o.src=t,e(null,o)}),this.options.headers),(this.options.crossOrigin||""===this.options.crossOrigin)&&(o.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),o.alt="",o.setAttribute("role","presentation"),o}_abortLoading(){const t=this._tiles,i=this._tileZoom;for(const o in t)if(t[o].coords.z!==i){const i=t[o].el;i.onload=e.exports.Util.falseFn,i.onerror=e.exports.Util.falseFn,i.complete||(i.abort&&i.abort(),i.src=e.exports.Util.emptyImageUrl,e.exports.DomUtil.remove(i),delete t[o])}}}}const wi=bi(class extends e.exports.TileLayer{constructor(t,e){super(t,e),Object.assign(this.options,e)}});class xi extends fi{addLayer(t){if(this.options=Object.assign(this.options,t),t){const{url:i,...o}=t;if(i){const t={pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,...o.nativeOptions};let n;return o.subdomains&&(t.subdomains=o.subdomains),n=o.headers?new wi(i,{...t,headers:o.headers,setViewDelay:o.setViewDelay}):new e.exports.TileLayer(i,t),n}}}}const Li=bi(class extends e.exports.TileLayer.WMS{constructor(t,e){super(t,e)}});function Pi(t){return[[t[3],t[0]],[t[1],t[2]]]}class Mi{constructor(){this.options={target:"map"},this.layerAdapters=Mi.layerAdapters,this.controlAdapters=Mi.controlAdapters,this.emitter=new o.exports.EventEmitter,this._unselectCb=[],this._universalEvents=["move","zoom","zoomend","zoomstart","moveend","movestart"],this._positionEvents=["mousemove","mouseout","mouseover"]}create(t){if(this.options={...t},this.options.target){const{zoom:t,center:i,maxZoom:o,minZoom:n,maxBounds:s,mapAdapterOptions:r}=this.options;this.map=this.options.map||new e.exports.Map(this.options.target,{attributionControl:!1,zoomControl:!1,maxBounds:s?Pi(s):void 0,maxZoom:o,minZoom:n,center:i&&[i[1],i[0]],zoom:t,...r});const a=this.map.createPane("order-0");this.map._addUnselectCb=t=>{this._addUnselectCb(t)},a.style.zIndex=String(0),this.emitter.emit("create",this),this._addMapListeners()}}destroy(){this.map&&this.map.remove(),this._stopWatchSizeChangeToUpdateMinZoom()}getContainer(){return this.map&&this.map.getContainer()}getControlContainer(){const t=this.map&&this.map._controlContainer;if(t)return t;throw new Error("Leaflet Map is not initialized yet")}setCursor(t){this.map&&(this.map.getContainer().style.cursor=t)}setView(t,e){const i=this.map;if(i)if(Array.isArray(t)){const i=t,[o,n]=i;this.map&&("number"==typeof e?this.map.setView([n,o],e,{animate:!1}):this.setCenter([o,n]))}else{const{zoom:e,center:o,maxBounds:n,bounds:s,minZoom:r,maxZoom:a}=t;if(o&&void 0!==e?this.setView(o,e):(void 0!==e&&this.setZoom(e),o&&this.setCenter(o)),s&&this.fitBounds(s),void 0!==n)if(n){const t=Pi(n);i.setMaxBounds(t),i.setMinZoom(i.getBoundsZoom(t)),this._watchSizeChangeToUpdateMinZoom(t)}else i.setMaxBounds(null),this._stopWatchSizeChangeToUpdateMinZoom();void 0!==a&&i.setMaxZoom(a),void 0!==r&&(this._stopWatchSizeChangeToUpdateMinZoom(),i.setMinZoom(r))}}setCenter(t){const[e,i]=t;this.map&&this.map.panTo([i,e])}getCenter(){const t=this.map;if(t){const e=t.getBounds().getCenter();return[e.lng,e.lat]}}setZoom(t){this.map&&this.map.setZoom(t)}getZoom(){var t;return null!==(t=this.map&&this.map.getZoom())&&void 0!==t?t:void 0}getBounds(){if(!this.map)return;const t=this.map.getBounds(),e=t.getSouthWest(),i=t.getNorthEast();return[e.lng,e.lat,i.lng,i.lat]}fitBounds(t,e={}){if(this.map){const{maxZoom:i,offset:o,padding:n}=e,s={};i&&(s.maxZoom=i),n&&(s.padding=[n,n]),o&&(s.padding=o),this.map.fitBounds(Pi(t),s)}}getLayerAdapter(t){return Mi.layerAdapters[t]}createControl(t,e){return si(t,e,this)}createButtonControl(t){return function(t,i){const o=document.createElement("a"),n=t.title||"";o.href="#",o.title=n,o.setAttribute("role","button"),o.setAttribute("aria-label",n),t.addClass&&o.classList.add(t.addClass),e.exports.DomEvent.disableClickPropagation(o),e.exports.DomEvent.on(o,"click",e.exports.DomEvent.stop),t.html instanceof HTMLElement?o.appendChild(t.html):"string"==typeof t.html&&(o.innerHTML=t.html);const s=e=>{e.stopPropagation(),t.onClick()};return si({onAdd:()=>(void 0!==t.onClick&&o.addEventListener("click",s),o),onRemove(){const e=o.parentNode;e&&e.removeChild(o),void 0!==t.onClick&&o.removeEventListener("click",s)}},{bar:!0},i)}(t,this)}addControl(t,e){if(t.options.position=e.replace("-",""),this.map)return this.map.addControl(t),t}removeControl(t){this.map&&this.map.removeControl(t)}removeLayer(t){t&&t.remove&&t.remove()}showLayer(t){this.map&&t.addTo(this.map)}hideLayer(t){t.remove()}setLayerOpacity(t,e){"setOpacity"in t&&t.setOpacity(e)}setLayerOrder(t,e,i){}onMapClick(t){const e=ni(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)}locate(t,e){const i=this.map;if(i&&(i.locate(t),e)){const{locationfound:t,locationerror:o}=e,n=e=>{t({lngLat:[e.latlng.lng,e.latlng.lat]})};void 0!==t&&i.on("locationfound",n,this),o&&i.on("locationerror",o,this);return{stop:()=>{void 0!==t&&i.off("locationfound",n),o&&i.off("locationerror",o)}}}return{stop:()=>{}}}_addUnselectCb(t){for(const e of this._unselectCb)e();this._unselectCb.length=0,this._unselectCb.push(t)}_watchSizeChangeToUpdateMinZoom(t){this._stopWatchSizeChangeToUpdateMinZoom();const e=this.getContainer(),i=this.map;e&&i&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver((()=>{i.setMinZoom(i.getBoundsZoom(t))})),this._resizeObserver.observe(e))}_stopWatchSizeChangeToUpdateMinZoom(){const t=this.map;t&&t.setMinZoom(0),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0)}_addMapListeners(){const t=this.map;if(t){t.on("click",(t=>{this.onMapClick(t)}));for(const e of this._universalEvents)t.on(e,(()=>this.emitter.emit(e,this)),t);for(const e of this._positionEvents)t.on(e,(t=>this.emitter.emit(e,ni(t))),t)}}}Mi.layerAdapters={GEOJSON:class extends fi{constructor(t,e){super(t,e),this.selected=!1,this._layers=[],this._selectedLayers=[],this._filteredLayers=[],this._openedPopup=[],this.$updateTooltip=E((()=>{this.updateTooltip()}),300),this.$unselect=()=>{this.unselect()},this._events=new mi(this),this._paint=new _i(this)}addLayer(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new e.exports.FeatureGroup([],{...t.nativeOptions,pane:this.pane}),this.selectedPaint=t.selectedPaint,t.paint=this.paint,t.data&&this.addData(t.data),this._addMapListener(),this.layer}beforeRemove(){this._removeMapListener()}select(t){if(this.unselect(),t){const e=this._layers.filter(t);for(const t of e)this._selectLayer(t,"api")}else this.selected||(this.selected=!0,this.selectedPaint&&this._paint.setPaintEachLayer(this.selectedPaint))}unselect(t){if(t){this._layers.filter(t).forEach((t=>{this._unSelectLayer(t)}))}else if(this.selected){for(const t of this._openedPopup)this._removePopup(t[0]);this.paint&&this._paint.setPaintEachLayer(this.paint),this._selectedLayers.length=0,this.selected=!1}}getSelected(){return this._selectedLayers.map((t=>({target:this,feature:t.feature,layer:t,...pi(t.feature)})))}getFiltered(){return this._filteredLayers}filter(t){this._filterFun=t;const e=this.layer,i=e&&e._map;if(e&&i){e.remove();const o=[];this._layers.forEach((({feature:i,layer:n})=>{if(n){!t||t({target:this,feature:i,layer:n,...pi(i)})?(e.addLayer(n),o.push({target:this,feature:i,layer:n,...pi(i)})):e.removeLayer(n)}})),this._filteredLayers=o,e.addTo(i)}return this._filteredLayers}cleanFilter(){this.filter()}getLayers(){return this._layers.map((({layer:t,feature:e})=>({feature:e,layer:t,visible:t&&!!t._map,target:this,...pi(e)})))}clearLayer(t){this.unselect();const e=this.layer;if(e)if(t)for(let i=this._layers.length;i--;){const o=this._layers[i];if(o){const{feature:n,layer:s}=o;if(n&&s){t(n)&&(e.removeLayer(s),this._layers.splice(i,1))}}}else e.clearLayers(),this._layers=[]}setData(t){this.clearLayer(),this.addData(t)}addData(t){const i=this.options;let o;if(i){if(t){let e;if(i.type)e=i.type;else{const i=function(t){let e;e="FeatureCollection"===t.type?di(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?di(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t);e=ai[i]}if(this.type&&this.type!==e)return void console.warn("no other data type than layer can be added");this.type=e,t=function(t,e){if("FeatureCollection"===t.type)t.features=t.features.filter((t=>ci(t.geometry.type,e)));else if("Feature"===t.type){if(!ci(t.geometry.type,e))return!1}else"GeometryCollection"===t.type&&(t.geometries=t.geometries.filter((t=>ci(t.type,e))));return t}(t,e),t&&(o=this._getGeoJsonOptions(i,e))}new e.exports.GeoJSON(t||void 0,o)}}openPopup(t,e){if(t){this._layers.filter(t).forEach((t=>{this._openPopup(t,e,"api")}))}}closePopup(t){(t?this._openedPopup.filter((e=>t(e[2]))):this._openedPopup).forEach((t=>{this._removePopup(t[0])}))}updateTooltip(t){t?this._updateTooltip(t):this.getLayers().forEach((t=>this._updateTooltip({feature:t.feature,layer:t.layer})))}getExtent(){return this.getBounds()}getBounds(){if(this.layer){const t=this.layer.getBounds();if(t.isValid())return ri(t)}}setOpacity(t){this.options.opacity=t,this.setPaint(this.paint),this.setSelectedPaint(this.selectedPaint)}setPaint(t){if(t){this.paint=t;for(const e of this._layers)this._paint.setPaint(e,t)}}setSelectedPaint(t){if(t){this.selectedPaint=t;for(const e of this._selectedLayers)this._paint.setPaint(e,t)}}updatePaint(t){this.paint={...this.paint,...t};for(const e of this._layers)this._paint.setPaint(e,this.paint)}updateSelectedPaint(t){this.selectedPaint={...this.selectedPaint,...t};for(const e of this._selectedLayers)this._paint.setPaint(e,this.selectedPaint)}_getSelected(t){return this._selectedLayers.find((e=>e.layer===t))}_updateTooltip(t){const{feature:e,layer:i}=t;if(e&&i&&e.properties&&this.options.labelField){i.unbindTooltip();const t=e.properties[this.options.labelField];if(void 0!==t){const e=!this.options.labelOnHover;i.bindTooltip(String(t),{permanent:e,sticky:!1})}}}async _openPopup(t,e={},i,o){var n,s;const{feature:r,layer:a}=t,{minWidth:h,autoPan:l,maxWidth:c,closeButton:u}={minWidth:300,...e},p=null!=u?u:!this.options.selectOnHover;let d;const f=[],m=t=>{f.push(t)},_=()=>{d&&this._removePopup(d)};let g;if(g=e.createPopupContent?await e.createPopupContent({layer:a,feature:r,target:this,type:i,close:_,onClose:m,...pi(r)}):e.popupContent,g&&a){const e={minWidth:h,autoPan:l,closeButton:p,closeOnClick:!1,autoClose:!1};C(c)&&(e.maxWidth=c),d=a.bindPopup(g,e);if(null===(s=null===(n=this.options.popupOptions)||void 0===n?void 0:n.unselectOnClose)||void 0===s||s){const t=a.getPopup();t&&t.once("remove",(()=>{_()}),this)}this._openedPopup.push([d,f,t]),d.openPopup(o)}}_removePopup(t){var e,i;if(this.map){t.closePopup().unbindPopup();const o=this._openedPopup.findIndex((e=>e[0]===t));if(-1!==o){const t=null===(i=null===(e=this.options.popupOptions)||void 0===e?void 0:e.unselectOnClose)||void 0===i||i,[,n,s]=this._openedPopup[o];for(const e of n)e(s);n.length=0,t&&this._unSelectLayer(s),this._openedPopup.splice(o,1)}}}_getGeoJsonOptions(t,e){const i=t.paint;let o={};return"function"==typeof i?"point"===e?o.pointToLayer=(t,e)=>{const o=i(t);return this._paint.createPaintToLayer(o)(t,e)}:o={style:t=>this._paint.preparePaint(t?{...hi,...i(t)}:{...hi,type:"path"})}:o=this._paint.createPaintOptions(i),o.onEachFeature=(t,e)=>{this._onEachFeature(t,e)},o}_onEachFeature(t,e){const i=this.layer;if(i){const o={target:this,feature:t,layer:e,...pi(t)};e.options.pane=this.pane,this._layers.push(o);let n=!0;if(this._filterFun&&(n=this._filterFun(o)),n){const{popup:n,popupOptions:s,selectable:r,interactive:a,selectOnHover:h}=this.options;e.options.interactive=!C(a)||a,i.addLayer(e),r&&(h?(e.on("mouseover",(()=>{this._selectLayer(o,"hover")})),e.on("mouseout",(()=>{this._unSelectLayer(o)}))):e.on("click",(t=>this._selectOnLayerClick(t)),this)),this._events.handleMouseEvents(e),setTimeout((()=>{n&&this._openPopup({target:this,layer:e,feature:t,...pi(t)},s,"api"),this._updateTooltip({layer:e,feature:t})}))}}}_selectOnLayerClick(t){e.exports.DomEvent.stopPropagation(t);const i=t.target,o=i.feature,n={target:this,layer:i,feature:o,...pi(o)},s=this._getSelected(i);s?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(s):this._selectLayer(n,"click",t.latlng)}_selectLayer(t,e,i){const{multiselect:o}=this.options;o||(this.map._addUnselectCb((()=>{this._unSelectLayer(t)})),this._selectedLayers.forEach((t=>this._unSelectLayer(t)))),this._selectedLayers.push(t),this.selected=!0;const{selectedPaint:n,popupOnSelect:s,popupOptions:r}=this.options;if(n&&t.layer&&this._paint.setPaint(t,n),s&&this._openPopup(t,r,e,i),this.options.onSelect){const i=t.feature?[t.feature]:[];this.options.onSelect({type:e,layer:this,features:i,...pi(i)})}}_unSelectLayer(t){const e=this._selectedLayers.indexOf(t);-1!==e&&(this._selectedLayers.splice(e,1),this.options&&(this.options.paint&&this._paint.setPaint(t,this.options.paint),this.options.popupOnSelect&&t.layer&&this._removePopup(t.layer))),this.selected=this._selectedLayers.length>0}_addMapClickListener(){const t=this.map;if(t){const{unselectOnClick:e}=this.options;(null==e||e)&&t.on("click",this.$unselect)}}_removeMapClickListener(){this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip),this.map.off("click",this.$unselect)}_addMapListener(){const t=this.map;if(t){const{labelField:e,labelOnHover:i}=this.options;this._addMapClickListener(),e&&!i&&(t.on("zoomend",this.$updateTooltip),t.on("moveend",this.$updateTooltip))}}_removeMapListener(){this._removeMapClickListener(),this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip)}},IMAGE:class extends fi{addLayer(t){const e=t&&t.url;if(e){const i=(t={transparent:!0,...t}).updateWmsParams;if(this.layer=new vi(e,{pane:this.pane,headers:t.headers,setViewDelay:t.setViewDelay,...t,...t.params,...t.nativeOptions}),i){const t=this.layer.updateWmsParams;this.layer.updateWmsParams=function(e){t.call(this,e),this.wmsParams=i(this.wmsParams)}}return this.layer}}},TILE:xi,WMS:class extends fi{addLayer(t){Object.assign(this.options,t);const{url:i,...o}=t;if(i){const n={pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,layers:t.layers,format:t.format,...t.nativeOptions};let s;return s=o.headers?new Li(i,{...n,headers:o.headers}):new e.exports.TileLayer.WMS(i,n),s}}},OSM:class extends xi{addLayer(t){return super.addLayer({name:"OpenStreetMap",attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',...t,url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"})}}},Mi.controlAdapters={ZOOM:e.exports.Control.Zoom,ATTRIBUTION:class extends e.exports.Control.Attribution{constructor(t){super(t);const e=t&&t.customAttribution;if(e){let t=[];Array.isArray(e)?t=e:e&&(t=[e]),t.forEach((t=>this.addAttribution(t)))}}}},Mi.Map=e.exports.Map;delete e.exports.Icon.Default.prototype._getIconUrl,e.exports.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",iconUrl:"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=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class Ci extends oi{constructor(t){super(t={...t,mapAdapter:new Mi})}static async create(t){return new Ci(t).onLoad()}}window&&!window.NgwMap&&(window.NgwMap=Ci);export{Ci as default};
7
+ */class bi extends e.exports.Layer{constructor(t,i){super(i),this.defaultWmsParams={service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},this.options={crs:null,uppercase:!1,attribution:"",opacity:1,isBack:!1,minZoom:0,pane:"tilePane",headers:null,viewPortBuffer:0,setViewDelay:100},this._url=t;const o={},n={};let s;for(s in i)s in this.options?n[s]=i[s]:o[s]=i[s];e.exports.Util.setOptions(this,n),this.wmsParams=e.exports.Util.extend({},this.defaultWmsParams,o)}setParams(t){e.exports.Util.extend(this.wmsParams,t),this.update()}getAttribution(){return this.options.attribution||""}onAdd(){return this.update(),this}onRemove(t){return this._currentOverlay&&(this._currentOverlay.cancelLoad(),t.removeLayer(this._currentOverlay),delete this._currentOverlay),this._currentUrl&&delete this._currentUrl,this}getEvents(){return{moveend:E(this.update,this.options.setViewDelay)}}update(){if(!this._map)return;this.updateWmsParams();const t=this.getImageUrl();if(this._currentUrl===t)return;this._currentUrl=t;const e=this.options.viewPortBuffer||0,i=this._map.getBounds().pad(e),o=new vi(t,i,{opacity:0,pane:this.options.pane,headers:this.options.headers});o.addTo(this._map),this._currentOverlay&&this._currentOverlay.cancelLoad(),o.once("load",(()=>{this._map&&(o._url===this._currentUrl?(this._currentOverlay&&this._map.removeLayer(this._currentOverlay),this._currentOverlay=o,o.setOpacity(void 0!==this.options.opacity?this.options.opacity:1),!0===this.options.isBack&&o.bringToBack(),!1===this.options.isBack&&o.bringToFront(),void 0!==this.options.zIndex&&o.setZIndex(this.options.zIndex)):this._map.removeLayer(o))}),this);const{minZoom:n,maxZoom:s}=this.options;(n&&this._map.getZoom()<n||s&&this._map.getZoom()>s)&&this._map.removeLayer(o)}setOpacity(t){this.options.opacity=t,this._currentOverlay&&this._currentOverlay.setOpacity(t)}bringToBack(){this.options.isBack=!0,this._currentOverlay&&this._currentOverlay.bringToBack()}bringToFront(){this.options.isBack=!1,this._currentOverlay&&this._currentOverlay.bringToFront()}setZIndex(t){this.options.zIndex=t,this._currentOverlay&&this._currentOverlay.setZIndex(t)}updateWmsParams(t){t||(t=this._map);const i=this.options.viewPortBuffer||0,o=t.getBounds().pad(i),n=t.getSize();if(0!==this.options.viewPortBuffer){const t=i+1;n.x=Math.ceil(n.x*t),n.y=Math.ceil(n.y*t)}const s=parseFloat(this.wmsParams.version),r=this.options.crs||t.options.crs,a=s>=1.3?"crs":"srs";if(r){const t=r.project(o.getNorthWest()),i=r.project(o.getSouthEast()),h={width:n.x,height:n.y};h[a]=r.code,h.bbox=(s>=1.3&&r===e.exports.CRS.EPSG4326?[i.y,t.x,t.y,i.x]:[t.x,i.y,i.x,t.y]).join(","),e.exports.Util.extend(this.wmsParams,h)}}getImageUrl(){const t=e.exports.Util.getParamString(this.wmsParams,this._url,this.options.uppercase||!1);return this._url+t}}function wi(t){return class extends t{constructor(...t){super(...t),this.options.setViewDelay&&(this._update=E(((...t)=>{e.exports.GridLayer.prototype._update.call(this,...t)}),this.options.setViewDelay))}createTile(t,e){const i=this.getTileUrl(t),o=document.createElement("img");return o.abort=yi(i,(t=>{o.src=t,e(null,o)}),this.options.headers),(this.options.crossOrigin||""===this.options.crossOrigin)&&(o.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),o.alt="",o.setAttribute("role","presentation"),o}_abortLoading(){const t=this._tiles,i=this._tileZoom;for(const o in t)if(t[o].coords.z!==i){const i=t[o].el;i.onload=e.exports.Util.falseFn,i.onerror=e.exports.Util.falseFn,i.complete||(i.abort&&i.abort(),i.src=e.exports.Util.emptyImageUrl,e.exports.DomUtil.remove(i),delete t[o])}}}}const xi=wi(class extends e.exports.TileLayer{constructor(t,e){super(t,e),Object.assign(this.options,e)}});class Li extends fi{addLayer(t){if(this.options=Object.assign(this.options,t),t){const{url:i,...o}=t;if(i){const t={pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,...o.nativeOptions};let n;return o.subdomains&&(t.subdomains=o.subdomains),n=o.headers?new xi(i,{...t,headers:o.headers,setViewDelay:o.setViewDelay}):new e.exports.TileLayer(i,t),n}}}}const Pi=wi(class extends e.exports.TileLayer.WMS{constructor(t,e){super(t,e)}});function Mi(t){return[[t[3],t[0]],[t[1],t[2]]]}class Ci{constructor(){this.options={target:"map"},this.layerAdapters=Ci.layerAdapters,this.controlAdapters=Ci.controlAdapters,this.emitter=new o.exports.EventEmitter,this._unselectCb=[],this._universalEvents=["move","zoom","zoomend","zoomstart","moveend","movestart"],this._positionEvents=["mousemove","mouseout","mouseover"]}create(t){if(this.options={...t},this.options.target){const{zoom:t,center:i,maxZoom:o,minZoom:n,maxBounds:s,mapAdapterOptions:r}=this.options;this.map=this.options.map||new e.exports.Map(this.options.target,{attributionControl:!1,zoomControl:!1,maxBounds:s?Mi(s):void 0,maxZoom:o,minZoom:n,center:i&&[i[1],i[0]],zoom:t,...r});const a=this.map.createPane("order-0");this.map._addUnselectCb=t=>{this._addUnselectCb(t)},a.style.zIndex=String(0),this.emitter.emit("create",this),this._addMapListeners()}}destroy(){this.map&&this.map.remove(),this._stopWatchSizeChangeToUpdateMinZoom()}getContainer(){return this.map&&this.map.getContainer()}getControlContainer(){const t=this.map&&this.map._controlContainer;if(t)return t;throw new Error("Leaflet Map is not initialized yet")}setCursor(t){this.map&&(this.map.getContainer().style.cursor=t)}setView(t,e){const i=this.map;if(i)if(Array.isArray(t)){const i=t,[o,n]=i;this.map&&("number"==typeof e?this.map.setView([n,o],e,{animate:!1}):this.setCenter([o,n]))}else{const{zoom:e,center:o,maxBounds:n,bounds:s,minZoom:r,maxZoom:a}=t;if(o&&void 0!==e?this.setView(o,e):(void 0!==e&&this.setZoom(e),o&&this.setCenter(o)),s&&this.fitBounds(s),void 0!==n)if(n){const t=Mi(n);i.setMaxBounds(t),i.setMinZoom(i.getBoundsZoom(t)),this._watchSizeChangeToUpdateMinZoom(t)}else i.setMaxBounds(null),this._stopWatchSizeChangeToUpdateMinZoom();void 0!==a&&i.setMaxZoom(a),void 0!==r&&(this._stopWatchSizeChangeToUpdateMinZoom(),i.setMinZoom(r))}}setCenter(t){const[e,i]=t;this.map&&this.map.panTo([i,e])}getCenter(){const t=this.map;if(t){const e=t.getBounds().getCenter();return[e.lng,e.lat]}}setZoom(t){this.map&&this.map.setZoom(t)}getZoom(){var t;return null!==(t=this.map&&this.map.getZoom())&&void 0!==t?t:void 0}getBounds(){if(!this.map)return;const t=this.map.getBounds(),e=t.getSouthWest(),i=t.getNorthEast();return[e.lng,e.lat,i.lng,i.lat]}fitBounds(t,e={}){if(this.map){const{maxZoom:i,offset:o,padding:n}=e,s={};i&&(s.maxZoom=i),n&&(s.padding=[n,n]),o&&(s.padding=o),this.map.fitBounds(Mi(t),s)}}getLayerAdapter(t){return Ci.layerAdapters[t]}createControl(t,e){return si(t,e,this)}createButtonControl(t){return function(t,i){const o=document.createElement("a"),n=t.title||"";o.href="#",o.title=n,o.setAttribute("role","button"),o.setAttribute("aria-label",n),t.addClass&&o.classList.add(t.addClass),e.exports.DomEvent.disableClickPropagation(o),e.exports.DomEvent.on(o,"click",e.exports.DomEvent.stop),t.html instanceof HTMLElement?o.appendChild(t.html):"string"==typeof t.html&&(o.innerHTML=t.html);const s=e=>{e.stopPropagation(),t.onClick()};return si({onAdd:()=>(void 0!==t.onClick&&o.addEventListener("click",s),o),onRemove(){const e=o.parentNode;e&&e.removeChild(o),void 0!==t.onClick&&o.removeEventListener("click",s)}},{bar:!0},i)}(t,this)}addControl(t,e){if(t.options.position=e.replace("-",""),this.map)return this.map.addControl(t),t}removeControl(t){this.map&&this.map.removeControl(t)}removeLayer(t){t&&t.remove&&t.remove()}showLayer(t){this.map&&t.addTo(this.map)}hideLayer(t){t.remove()}setLayerOpacity(t,e){"setOpacity"in t&&t.setOpacity(e)}setLayerOrder(t,e,i){}onMapClick(t){const e=mi(t);this.emitter.emit("preclick",e),this.emitter.emit("click",e)}locate(t,e){const i=this.map;if(i&&(i.locate(t),e)){const{locationfound:t,locationerror:o}=e,n=e=>{t({lngLat:[e.latlng.lng,e.latlng.lat]})};void 0!==t&&i.on("locationfound",n,this),o&&i.on("locationerror",o,this);return{stop:()=>{void 0!==t&&i.off("locationfound",n),o&&i.off("locationerror",o)}}}return{stop:()=>{}}}_addUnselectCb(t){for(const e of this._unselectCb)e();this._unselectCb.length=0,this._unselectCb.push(t)}_watchSizeChangeToUpdateMinZoom(t){this._stopWatchSizeChangeToUpdateMinZoom();const e=this.getContainer(),i=this.map;e&&i&&window.ResizeObserver&&(this._resizeObserver=new ResizeObserver((()=>{i.setMinZoom(i.getBoundsZoom(t))})),this._resizeObserver.observe(e))}_stopWatchSizeChangeToUpdateMinZoom(){const t=this.map;t&&t.setMinZoom(0),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0)}_addMapListeners(){const t=this.map;if(t){t.on("click",(t=>{this.onMapClick(t)}));for(const e of this._universalEvents)t.on(e,(()=>this.emitter.emit(e,this)),t);for(const e of this._positionEvents)t.on(e,(t=>this.emitter.emit(e,mi(t))),t)}}}Ci.layerAdapters={GEOJSON:class extends fi{constructor(t,e){super(t,e),this.selected=!1,this._layers=[],this._selectedLayers=[],this._filteredLayers=[],this._openedPopup=[],this.$updateTooltip=E((()=>{this.updateTooltip()}),300),this.$unselect=()=>{this.unselect()},this._events=new _i(this),this._paint=new gi(this)}addLayer(t){return Object.assign(this.options,t),this.paint=t.paint,this.layer=new e.exports.FeatureGroup([],{...t.nativeOptions,pane:this.pane}),this.selectedPaint=t.selectedPaint,t.paint=this.paint,t.data&&this.addData(t.data),this._addMapListener(),this.layer}beforeRemove(){this._removeMapListener()}select(t){if(this.unselect(),t){const e=this._layers.filter(t);for(const t of e)this._selectLayer(t,"api")}else this.selected||(this.selected=!0,this.selectedPaint&&this._paint.setPaintEachLayer(this.selectedPaint))}unselect(t){if(t){this._layers.filter(t).forEach((t=>{this._unSelectLayer(t)}))}else if(this.selected){for(const t of this._openedPopup)this._removePopup(t[0]);this.paint&&this._paint.setPaintEachLayer(this.paint),this._selectedLayers.length=0,this.selected=!1}}getSelected(){return this._selectedLayers.map((t=>({target:this,feature:t.feature,layer:t,...di(t.feature)})))}getFiltered(){return this._filteredLayers}filter(t){this._filterFun=t;const e=this.layer,i=e&&e._map;if(e&&i){e.remove();const o=[];this._layers.forEach((({feature:i,layer:n})=>{if(n){!t||t({target:this,feature:i,layer:n,...di(i)})?(e.addLayer(n),o.push({target:this,feature:i,layer:n,...di(i)})):e.removeLayer(n)}})),this._filteredLayers=o,e.addTo(i)}return this._filteredLayers}cleanFilter(){this.filter()}getLayers(){return this._layers.map((({layer:t,feature:e})=>({feature:e,layer:t,visible:t&&!!t._map,target:this,...di(e)})))}clearLayer(t){this.unselect();const e=this.layer;if(e)if(t)for(let i=this._layers.length;i--;){const o=this._layers[i];if(o){const{feature:n,layer:s}=o;if(n&&s){t(n)&&(e.removeLayer(s),this._layers.splice(i,1))}}}else e.clearLayers(),this._layers=[]}setData(t){this.clearLayer(),this.addData(t)}addData(t){const i=this.options;let o;if(i){if(t){let e;if(i.type)e=i.type;else{const i=function(t){let e;e="FeatureCollection"===t.type?ai(t.features.map((t=>t.geometry.type))):"GeometryCollection"===t.type?ai(t.geometries.map((t=>t.type))):"Feature"===t.type?t.geometry.type:t.type;return e}(t);e=hi[i]}if(this.type&&this.type!==e)return void console.warn("no other data type than layer can be added");this.type=e,t=function(t,e){if("FeatureCollection"===t.type)t.features=t.features.filter((t=>ui(t.geometry.type,e)));else if("Feature"===t.type){if(!ui(t.geometry.type,e))return!1}else"GeometryCollection"===t.type&&(t.geometries=t.geometries.filter((t=>ui(t.type,e))));return t}(t,e),t&&(o=this._getGeoJsonOptions(i,e))}new e.exports.GeoJSON(t||void 0,o)}}openPopup(t,e){if(t){this._layers.filter(t).forEach((t=>{this._openPopup(t,e,"api")}))}}closePopup(t){(t?this._openedPopup.filter((e=>t(e[2]))):this._openedPopup).forEach((t=>{this._removePopup(t[0])}))}updateTooltip(t){t?this._updateTooltip(t):this.getLayers().forEach((t=>this._updateTooltip({feature:t.feature,layer:t.layer})))}getExtent(){return this.getBounds()}getBounds(){if(this.layer){const t=this.layer.getBounds();if(t.isValid())return ri(t)}}setOpacity(t){this.options.opacity=t,this.setPaint(this.paint),this.setSelectedPaint(this.selectedPaint)}setPaint(t){if(t){this.paint=t;for(const e of this._layers)this._paint.setPaint(e,t)}}setSelectedPaint(t){if(t){this.selectedPaint=t;for(const e of this._selectedLayers)this._paint.setPaint(e,t)}}updatePaint(t){this.paint={...this.paint,...t};for(const e of this._layers)this._paint.setPaint(e,this.paint)}updateSelectedPaint(t){this.selectedPaint={...this.selectedPaint,...t};for(const e of this._selectedLayers)this._paint.setPaint(e,this.selectedPaint)}_getSelected(t){return this._selectedLayers.find((e=>e.layer===t))}_updateTooltip(t){const{feature:e,layer:i}=t;if(e&&i&&e.properties&&this.options.labelField){i.unbindTooltip();const t=e.properties[this.options.labelField];if(void 0!==t){const e=!this.options.labelOnHover;i.bindTooltip(String(t),{permanent:e,sticky:!1})}}}async _openPopup(t,e={},i,o){var n,s;const{feature:r,layer:a}=t,{minWidth:h,autoPan:l,maxWidth:c,closeButton:u}={minWidth:300,...e},p=null!=u?u:!this.options.selectOnHover;let d;const f=[],m=t=>{f.push(t)},_=()=>{d&&this._removePopup(d)};let g;if(g=e.createPopupContent?await e.createPopupContent({layer:a,feature:r,target:this,type:i,close:_,onClose:m,...di(r)}):e.popupContent,g&&a){const e={minWidth:h,autoPan:l,closeButton:p,closeOnClick:!1,autoClose:!1};C(c)&&(e.maxWidth=c),d=a.bindPopup(g,e);if(null===(s=null===(n=this.options.popupOptions)||void 0===n?void 0:n.unselectOnClose)||void 0===s||s){const t=a.getPopup();t&&t.once("remove",(()=>{_()}),this)}this._openedPopup.push([d,f,t]),d.openPopup(o)}}_removePopup(t){var e,i;if(this.map){t.closePopup().unbindPopup();const o=this._openedPopup.findIndex((e=>e[0]===t));if(-1!==o){const t=null===(i=null===(e=this.options.popupOptions)||void 0===e?void 0:e.unselectOnClose)||void 0===i||i,[,n,s]=this._openedPopup[o];for(const e of n)e(s);n.length=0,t&&this._unSelectLayer(s),this._openedPopup.splice(o,1)}}}_getGeoJsonOptions(t,e){const i=t.paint;let o={};return"function"==typeof i?"point"===e?o.pointToLayer=(t,e)=>{const o=i(t);return this._paint.createPaintToLayer(o)(t,e)}:o={style:t=>this._paint.preparePaint(t?{...li,...i(t)}:{...li,type:"path"})}:o=this._paint.createPaintOptions(i),o.onEachFeature=(t,e)=>{this._onEachFeature(t,e)},o}_onEachFeature(t,e){const i=this.layer;if(i){const o={target:this,feature:t,layer:e,...di(t)};e.options.pane=this.pane,this._layers.push(o);let n=!0;if(this._filterFun&&(n=this._filterFun(o)),n){const{popup:n,popupOptions:s,selectable:r,interactive:a,selectOnHover:h}=this.options;e.options.interactive=!C(a)||a,i.addLayer(e),r&&(h?(e.on("mouseover",(()=>{this._selectLayer(o,"hover")})),e.on("mouseout",(()=>{this._unSelectLayer(o)}))):e.on("click",(t=>this._selectOnLayerClick(t)),this)),this._events.handleMouseEvents(e),setTimeout((()=>{n&&this._openPopup({target:this,layer:e,feature:t,...di(t)},s,"api"),this._updateTooltip({layer:e,feature:t})}))}}}_selectOnLayerClick(t){e.exports.DomEvent.stopPropagation(t);const i=t.target,o=i.feature,n={target:this,layer:i,feature:o,...di(o)},s=this._getSelected(i);s?this.options&&this.options.unselectOnSecondClick&&this._unSelectLayer(s):this._selectLayer(n,"click",t.latlng)}_selectLayer(t,e,i){const{multiselect:o}=this.options;o||(this.map._addUnselectCb((()=>{this._unSelectLayer(t)})),this._selectedLayers.forEach((t=>this._unSelectLayer(t)))),this._selectedLayers.push(t),this.selected=!0;const{selectedPaint:n,popupOnSelect:s,popupOptions:r}=this.options;if(n&&t.layer&&this._paint.setPaint(t,n),s&&this._openPopup(t,r,e,i),this.options.onSelect){const i=t.feature?[t.feature]:[];this.options.onSelect({type:e,layer:this,features:i,...di(i)})}}_unSelectLayer(t){const e=this._selectedLayers.indexOf(t);-1!==e&&(this._selectedLayers.splice(e,1),this.options&&(this.options.paint&&this._paint.setPaint(t,this.options.paint),this.options.popupOnSelect&&t.layer&&this._removePopup(t.layer))),this.selected=this._selectedLayers.length>0}_addMapClickListener(){const t=this.map;if(t){const{unselectOnClick:e}=this.options;(null==e||e)&&t.on("click",this.$unselect)}}_removeMapClickListener(){this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip),this.map.off("click",this.$unselect)}_addMapListener(){const t=this.map;if(t){const{labelField:e,labelOnHover:i}=this.options;this._addMapClickListener(),e&&!i&&(t.on("zoomend",this.$updateTooltip),t.on("moveend",this.$updateTooltip))}}_removeMapListener(){this._removeMapClickListener(),this.map.off("zoomend",this.$updateTooltip),this.map.off("moveend",this.$updateTooltip)}},IMAGE:class extends fi{addLayer(t){const e=t&&t.url;if(e){const i=(t={transparent:!0,...t}).updateWmsParams;if(this.layer=new bi(e,{pane:this.pane,headers:t.headers,setViewDelay:t.setViewDelay,...t,...t.params,...t.nativeOptions}),i){const t=this.layer.updateWmsParams;this.layer.updateWmsParams=function(e){t.call(this,e),this.wmsParams=i(this.wmsParams)}}return this.layer}}},TILE:Li,WMS:class extends fi{addLayer(t){Object.assign(this.options,t);const{url:i,...o}=t;if(i){const n={pane:this.pane,attribution:o.attribution,minZoom:o.minZoom,maxZoom:o.maxZoom,layers:t.layers,format:t.format,...t.nativeOptions};let s;return s=o.headers?new Pi(i,{...n,headers:o.headers}):new e.exports.TileLayer.WMS(i,n),s}}},OSM:class extends Li{addLayer(t){return super.addLayer({name:"OpenStreetMap",attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',...t,url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"})}}},Ci.controlAdapters={ZOOM:e.exports.Control.Zoom,ATTRIBUTION:class extends e.exports.Control.Attribution{constructor(t){super(t);const e=t&&t.customAttribution;if(e){let t=[];Array.isArray(e)?t=e:e&&(t=[e]),t.forEach((t=>this.addAttribution(t)))}}}},Ci.Map=e.exports.Map;delete e.exports.Icon.Default.prototype._getIconUrl,e.exports.Icon.Default.mergeOptions({iconRetinaUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",iconUrl:"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=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC"});class ki extends ni{constructor(t){super(t={...t,mapAdapter:new Ci})}static async create(t){return new ki(t).onLoad()}}window&&!window.NgwMap&&(window.NgwMap=ki);export{ki as default};
8
8
  //# sourceMappingURL=ngw-leaflet.esm-browser.prod.js.map