PageSourceSearch

https://www.visitmorningtonpeninsula.org/Portals/_default/Skins/_global/dist/bundle.js?cdv=365

js visitmorningtonpeninsula.org collected 2026-10-02 07:06:44 UTC 1,365,991 bytes, 2 lines download raw bytes

1/*! For license information please see bundle.js.LICENSE.txt */
2(()=>{var e={179:()=>{window.addEventListener("load",(function(){document.querySelectorAll("button.accordion__title").forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),this.nextElementSibling.classList.toggle("open"),this.classList.toggle("open")}))})),document.querySelectorAll(".search__btn").forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),this.classList.toggle("on"),document.getElementById("search").classList.toggle("on")}))}))}))},507:()=>{window.addEventListener("load",(function(){document.querySelector(".stickybox-content")&&function(e){"use strict";var t=e.createElement("div");t.classList.add("scrollspybox");var n,i,r=e.querySelector(".stickybox");if(r){n=t,(i=r).parentNode.insertBefore(n,i);var o=document.querySelector(".mapbox").offsetHeight;new IntersectionObserver((function(t){0===t[0].intersectionRatio?o>1e3&&e.querySelector(".stickybox").classList.add("sticky"):1===t[0].intersectionRatio&&o>1e3&&e.querySelector(".stickybox").classList.remove("sticky")}),{threshold:[0,1],rootMargin:"70px"}).observe(e.querySelector(".scrollspybox"))}}(document)}))},493:()=>{window.addEventListener("load",(function(){document.querySelectorAll(".operator--toggle--btn").forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),this.parentElement.classList.toggle("active")}))})),document.querySelectorAll(".town--toggle--btn").forEach((function(e){e.addEventListener("click",(function(e){e.preventDefault(),this.parentElement.parentElement.classList.toggle("active")}))}))}))},926:()=>{window.addEventListener("load",(function(e){if(null!=document.querySelector("button[type='share']")){var t=document.title.split(" — ")[0],n=window.location.href;document.querySelectorAll("button[type='share']").forEach((function(e){e.addEventListener("click",(function(e){if(e.preventDefault(),navigator.share)navigator.share({url:n,title:t});else{var i=document.getElementsByClassName("divsharethis");if(i)for(var r=0;r<i.length;r++)i[r].classList.toggle("active")}}))}))}}))},949:()=>{window.addEventListener("load",(function(){var e=function(e){document.querySelector("[data-menu-id='"+e+"']").classList.add("open"),document.querySelector(".megamenu").classList.add("open")},t=function(e){document.querySelector("[data-menu-id='"+e+"']").classList.remove("open"),document.querySelector(".megamenu").classList.remove("open")};null!=document.querySelector("[data-megamenu]")&&document.querySelectorAll("[data-megamenu]").forEach((function(n){n.addEventListener("mouseover",(function(){e(n.getAttribute("data-megamenu"))})),n.addEventListener("mouseout",(function(){t(n.getAttribute("data-megamenu"))}))})),null!=document.querySelector("[data-menu-id]")&&document.querySelectorAll("[data-menu-id]").forEach((function(n){n.addEventListener("mouseover",(function(){var t=n.getAttribute("data-menu-id");document.querySelector("[data-megamenu='"+t+"']").classList.add("open"),e(t)})),n.addEventListener("mouseout",(function(){var e=n.getAttribute("data-menu-id");document.querySelector("[data-megamenu='"+e+"']").classList.remove("open"),t(e)}))}))}))},514:()=>{window.addEventListener("load",(function(){document.querySelectorAll(".mobile__more").forEach((function(e){e.addEventListener("click",(function(){this.classList.toggle("active"),this.nextElementSibling.classList.toggle("active")}))})),document.querySelector(".hamburger").addEventListener("click",(function(){this.classList.toggle("active"),document.querySelector("section.mobile").classList.toggle("active")}))}))},248:()=>{window.addEventListener("scroll",(function(e){document.querySelector("body").scrollTop>80?(document.querySelector("header").classList.add("sticky"),document.querySelector("nav").classList.add("sticky"),document.querySelector("section.mobile").classList.add("sticky")):(document.querySelector("header").classList.remove("sticky"),document.querySelector("nav").classList.remove("sticky"),document.querySelector("section.mobile").classList.remove("sticky"))}))},787:(e,t,n)=>{var i,r;!function(o,a){"use strict";void 0===(r="function"==typeof(i=a)?i.call(t,n,t,e):i)||(e.exports=r)}(window,(function(){"use strict";var e=function(){var e=window.Element.prototype;if(e.matches)return"matches";if(e.matchesSelector)return"matchesSelector";for(var t=["webkit","moz","ms","o"],n=0;n<t.length;n++){var i=t[n]+"MatchesSelector";if(e[i])return i}}();return function(t,n){return t[e](n)}}))},508:function(e,t,n){var i,r;"undefined"!=typeof window&&window,void 0===(r="function"==typeof(i=function(){"use strict";function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var n=this._events=this._events||{},i=n[e]=n[e]||[];return-1==i.indexOf(t)&&i.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var n=this._onceEvents=this._onceEvents||{};return(n[e]=n[e]||{})[t]=!0,this}},t.off=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){var i=n.indexOf(t);return-1!=i&&n.splice(i,1),this}},t.emitEvent=function(e,t){var n=this._events&&this._events[e];if(n&&n.length){n=n.slice(0),t=t||[];for(var i=this._onceEvents&&this._onceEvents[e],r=0;r<n.length;r++){var o=n[r];i&&i[o]&&(this.off(e,o),delete i[o]),o.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e})?i.call(t,n,t,e):i)||(e.exports=r)}
2,398:(e,t,n)=>{var i,r;!function(o,a){i=[n(787)],r=function(e){return function(e,t){"use strict";var n={extend:function(e,t){for(var n in t)e[n]=t[n];return e},modulo:function(e,t){return(e%t+t)%t}},i=Array.prototype.slice;n.makeArray=function(e){return Array.isArray(e)?e:null==e?[]:"object"==typeof e&&"number"==typeof e.length?i.call(e):[e]},n.removeFrom=function(e,t){var n=e.indexOf(t);-1!=n&&e.splice(n,1)},n.getParent=function(e,n){for(;e.parentNode&&e!=document.body;)if(e=e.parentNode,t(e,n))return e},n.getQueryElement=function(e){return"string"==typeof e?document.querySelector(e):e},n.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},n.filterFindElements=function(e,i){e=n.makeArray(e);var r=[];return e.forEach((function(e){if(e instanceof HTMLElement)if(i){t(e,i)&&r.push(e);for(var n=e.querySelectorAll(i),o=0;o<n.length;o++)r.push(n[o])}else r.push(e)})),r},n.debounceMethod=function(e,t,n){n=n||100;var i=e.prototype[t],r=t+"Timeout";e.prototype[t]=function(){var e=this[r];clearTimeout(e);var t=arguments,o=this;this[r]=setTimeout((function(){i.apply(o,t),delete o[r]}),n)}},n.docReady=function(e){var t=document.readyState;"complete"==t||"interactive"==t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},n.toDashed=function(e){return e.replace(/(.)([A-Z])/g,(function(e,t,n){return t+"-"+n})).toLowerCase()};var r=e.console;return n.htmlInit=function(t,i){n.docReady((function(){var o=n.toDashed(i),a="data-"+o,s=document.querySelectorAll("["+a+"]"),l=document.querySelectorAll(".js-"+o),c=n.makeArray(s).concat(n.makeArray(l)),u=a+"-options",h=e.jQuery;c.forEach((function(e){var n,o=e.getAttribute(a)||e.getAttribute(u);try{n=o&&JSON.parse(o)}catch(t){return void(r&&r.error("Error parsing "+a+" on "+e.className+": "+t))}var s=new t(e,n);h&&h.data(e,i,s)}))}))},n}(o,e)}.apply(t,i),void 0===r||(e.exports=r)}(window)},154:(e,t,n)=>{var i,r;window,i=[n(983),n(398)],void 0===(r=function(e,t){return function(e,t,n){"use strict";var i=t.prototype;return i.insert=function(e,t){var n=this._makeCells(e);if(n&&n.length){var i=this.cells.length;t=void 0===t?i:t;var r=function(e){var t=document.createDocumentFragment();return e.forEach((function(e){t.appendChild(e.element)})),t}(n),o=t==i;if(o)this.slider.appendChild(r);else{var a=this.cells[t].element;this.slider.insertBefore(r,a)}if(0===t)this.cells=n.concat(this.cells);else if(o)this.cells=this.cells.concat(n);else{var s=this.cells.splice(t,i-t);this.cells=this.cells.concat(n).concat(s)}this._sizeCells(n),this.cellChange(t,!0)}},i.append=function(e){this.insert(e,this.cells.length)},i.prepend=function(e){this.insert(e,0)},i.remove=function(e){var t=this.getCells(e);if(t&&t.length){var i=this.cells.length-1;t.forEach((function(e){e.remove();var t=this.cells.indexOf(e);i=Math.min(t,i),n.removeFrom(this.cells,e)}),this),this.cellChange(i,!0)}},i.cellSizeChange=function(e){var t=this.getCell(e);if(t){t.getSize();var n=this.cells.indexOf(t);this.cellChange(n)}},i.cellChange=function(e,t){var n=this.selectedElement;this._positionCells(e),this._getWrapShiftCells(),this.setGallerySize();var i=this.getCell(n);i&&(this.selectedIndex=this.getCellSlideIndex(i)),this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex),this.emitEvent("cellChange",[e]),this.select(this.selectedIndex),t&&this.positionSliderAtSelected()},t}(0,e,t)}.apply(t,i))||(e.exports=r)},640:(e,t,n)=>{var i,r;window,i=[n(398)],void 0===(r=function(e){return function(e,t){"use strict";return{startAnimation:function(){this.isAnimating||(this.isAnimating=!0,this.restingFrames=0,this.animate())},animate:function(){this.applyDragForce(),this.applySelectedAttraction();var e=this.x;if(this.integratePhysics(),this.positionSlider(),this.settle(e),this.isAnimating){var t=this;requestAnimationFrame((function(){t.animate()}))}},positionSlider:function(){var e=this.x;this.options.wrapAround&&this.cells.length>1&&(e=t.modulo(e,this.slideableWidth),e-=this.slideableWidth,this.shiftWrapCells(e)),this.setTranslateX(e,this.isAnimating),this.dispatchScrollEvent()},setTranslateX:function(e,t){e+=this.cursorPosition,e=this.options.rightToLeft?-e:e;var n=this.getPositionValue(e);this.slider.style.transform=t?"translate3d("+n+",0,0)":"translateX("+n+")"},dispatchScrollEvent:function(){var e=this.slides[0];if(e){var t=-this.x-e.target,n=t/this.slidesWidth;this.dispatchEvent("scroll",null,[n,t])}},positionSliderAtSelected:function(){this.cells.length&&(this.x=-this.selectedSlide.target,this.velocity=0,this.positionSlider())},getPositionValue:function(e){return this.options.percentPosition?.01*Math.round(e/this.size.innerWidth*1e4)+"%":Math.round(e)+"px"},settle:function(e){!this.isPointerDown&&Math.round(100*this.x)==Math.round(100*e)&&this.restingFrames++,this.restingFrames>2&&(this.isAnimating=!1,delete this.isFreeScrolling,this.positionSlider(),this.dispatchEvent("settle",null,[this.selectedIndex]))},shiftWrapCells:function(e){var t=this.cursorPosition+e;this._shiftCells(this.beforeShiftCells,t,-1);var n=this.size.innerWidth-(e+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,n,1)},_shiftCells:function(e,t,n){for(var i=0;i<e.length;i++){var r=e[i],o=t>0?n:0;r.wrapShift(o),t-=r.size.outerWidth}},_unshiftCells:function(e){if(e&&e.length)for(var t=0;t<e.length;t++)e[t].wrapShift(0)},integratePhysics:function(){this.x+=this.velocity,this.velocity
vendor: 24,740 bytes, line 2
2*=this.getFrictionFactor()},applyForce:function(e){this.velocity+=e},getFrictionFactor:function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]},getRestingPosition:function(){return this.x+this.velocity/(1-this.getFrictionFactor())},applyDragForce:function(){if(this.isDraggable&&this.isPointerDown){var e=this.dragX-this.x-this.velocity;this.applyForce(e)}},applySelectedAttraction:function(){if((!this.isDraggable||!this.isPointerDown)&&!this.isFreeScrolling&&this.slides.length){var e=(-1*this.selectedSlide.target-this.x)*this.options.selectedAttraction;this.applyForce(e)}}}}(0,e)}.apply(t,i))||(e.exports=r)},582:(e,t,n)=>{var i,r;window,i=[n(308)],void 0===(r=function(e){return function(e,t){"use strict";function n(e,t){this.element=e,this.parent=t,this.create()}var i=n.prototype;return i.create=function(){this.element.style.position="absolute",this.element.setAttribute("aria-hidden","true"),this.x=0,this.shift=0,this.element.style[this.parent.originSide]=0},i.destroy=function(){this.unselect(),this.element.style.position="";var e=this.parent.originSide;this.element.style[e]="",this.element.style.transform="",this.element.removeAttribute("aria-hidden")},i.getSize=function(){this.size=t(this.element)},i.setPosition=function(e){this.x=e,this.updateTarget(),this.renderPosition(e)},i.updateTarget=i.setDefaultTarget=function(){var e="left"==this.parent.originSide?"marginLeft":"marginRight";this.target=this.x+this.size[e]+this.size.width*this.parent.cellAlign},i.renderPosition=function(e){var t="left"===this.parent.originSide?1:-1,n=this.parent.options.percentPosition?e*t*(this.parent.size.innerWidth/this.size.width):e*t;this.element.style.transform="translateX("+this.parent.getPositionValue(n)+")"},i.select=function(){this.element.classList.add("is-selected"),this.element.removeAttribute("aria-hidden")},i.unselect=function(){this.element.classList.remove("is-selected"),this.element.setAttribute("aria-hidden","true")},i.wrapShift=function(e){this.shift=e,this.renderPosition(this.x+this.parent.slideableWidth*e)},i.remove=function(){this.element.parentNode.removeChild(this.element)},n}(0,e)}.apply(t,i))||(e.exports=r)},882:(e,t,n)=>{var i,r;!function(o,a){i=[n(983),n(558),n(398)],r=function(e,t,n){return function(e,t,n,i){"use strict";i.extend(t.defaults,{draggable:">1",dragThreshold:3}),t.createMethods.push("_createDrag");var r=t.prototype;i.extend(r,n.prototype),r._touchActionValue="pan-y",r._createDrag=function(){this.on("activate",this.onActivateDrag),this.on("uiChange",this._uiChangeDrag),this.on("deactivate",this.onDeactivateDrag),this.on("cellChange",this.updateDraggable)},r.onActivateDrag=function(){this.handles=[this.viewport],this.bindHandles(),this.updateDraggable()},r.onDeactivateDrag=function(){this.unbindHandles(),this.element.classList.remove("is-draggable")},r.updateDraggable=function(){">1"==this.options.draggable?this.isDraggable=this.slides.length>1:this.isDraggable=this.options.draggable,this.isDraggable?this.element.classList.add("is-draggable"):this.element.classList.remove("is-draggable")},r.bindDrag=function(){this.options.draggable=!0,this.updateDraggable()},r.unbindDrag=function(){this.options.draggable=!1,this.updateDraggable()},r._uiChangeDrag=function(){delete this.isFreeScrolling},r.pointerDown=function(t,n){this.isDraggable?this.okayPointerDown(t)&&(this._pointerDownPreventDefault(t),this.pointerDownFocus(t),document.activeElement!=this.element&&this.pointerDownBlur(),this.dragX=this.x,this.viewport.classList.add("is-pointer-down"),this.pointerDownScroll=a(),e.addEventListener("scroll",this),this._pointerDownDefault(t,n)):this._pointerDownDefault(t,n)},r._pointerDownDefault=function(e,t){this.pointerDownPointer={pageX:t.pageX,pageY:t.pageY},this._bindPostStartEvents(e),this.dispatchEvent("pointerDown",e,[t])};var o={INPUT:!0,TEXTAREA:!0,SELECT:!0};function a(){return{x:e.pageXOffset,y:e.pageYOffset}}return r.pointerDownFocus=function(e){o[e.target.nodeName]||this.focus()},r._pointerDownPreventDefault=function(e){var t="touchstart"==e.type,n="touch"==e.pointerType,i=o[e.target.nodeName];t||n||i||e.preventDefault()},r.hasDragStarted=function(e){return Math.abs(e.x)>this.options.dragThreshold},r.pointerUp=function(e,t){delete this.isTouchScrolling,this.viewport.classList.remove("is-pointer-down"),this.dispatchEvent("pointerUp",e,[t]),this._dragPointerUp(e,t)},r.pointerDone=function(){e.removeEventListener("scroll",this),delete this.pointerDownScroll},r.dragStart=function(t,n){this.isDraggable&&(this.dragStartPosition=this.x,this.startAnimation(),e.removeEventListener("scroll",this),this.dispatchEvent("dragStart",t,[n]))},r.pointerMove=function(e,t){var n=this._dragPointerMove(e,t);this.dispatchEvent("pointerMove",e,[t,n]),this._dragMove(e,t,n)},r.dragMove=function(e,t,n){if(this.isDraggable){e.preventDefault(),this.previousDragX=this.dragX;var i=this.options.rightToLeft?-1:1;this.options.wrapAround&&(n.x%=this.slideableWidth);var r=this.dragStartPosition+n.x*i;if(!this.options.wrapAround&&this.slides.length){var o=Math.max(-this.slides[0].target,this.dragStartPosition);r=r>o?.5*(r+o):r;var a=Math.min(-this.getLastSlide().target,this.dragStartPosition);r=r<a?.5*(r+a):r}this.dragX=r,this.dragMoveTime=new Date,this.dispatchEvent("dragMove",e,[t,n])}},r.dragEnd=function(e,t){if(this.isDraggable){this.options.freeScroll&&(this.isFreeScrolling=!0);var n=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var i=this.getRestingPosition();this.isFreeScrolling=-i>this.slides[0].target&&-i<this.getLastSlide().target}else this.options.freeScroll||n!=this.selectedIndex||(n+=this.dragEndBoostSelect());delete this.previousDragX,this.isDragSelect=this.options.wrapAround,this.select(n),delete this.isDragSelect,this.dispatchEvent("dragEnd",e,[t])}},r.dragEndRestingSelect=function(){var e=this.getRestingPosition(),t=Math.abs(this.getSlideDistance(-e,this.selectedIndex)),n=this._getClosestResting(e,t,1),i=this._getClosestResting(e,t,-1);return n.distance<i.distance?n.index:i.index},r._getClosestResting=function(e,t,n){for(var i=this.selectedIndex,r=1/0,o=this.options.contain&&!this.options.wrapAround?function(e,t){return e<=t}:function(e,t){return e<t};o(t,r)&&(i+=n,r=t,null!==(t=this.getSlideDistance(-e,i)));)t=Math.abs(t);return{distance:r,index:i-n}},r.getSlideDistance=function(e,t){var n=this.slides.length,r=this.options.wrapAround&&n>1,o=r?i.modulo(t,n):t,a=this.slides[o];if(!a)return null;var s=r?this.slideableWidth*Math.floor(t/n):0;return e-(a.target+s)},r.dragEndBoostSelect=function(){if(void 0===this.previousDragX||!this.dragMoveTime||new Date-this.dragMoveTime>100)return 0;var e=this.getSlideDistance(-this.dragX,this.selectedIndex),t=this.previousDragX-this.dragX;return e>0&&t>0?1:e<0&&t<0?-1:0},r.staticClick=function(e,t){var n=this.getParentCell(e.target),i=n&&n.element,r=n&&this.cells.indexOf(n);this.dispatchEvent("staticClick",e,[t,i,r])},r.onscroll=function(){var e=a(),t=this.pointerDownScroll.x-e.x,n=this.pointerDownScroll.y-e.y;(Math.abs(t)>3||Math.abs(n)>3)&&this._pointerDone()},t}(o,e,t,n)}.apply(t,i),void 0===r||(e.exports=r)}(window)},983:(e,t,n)=>{var i,r;!function(o,a){i=[n(508),n(308),n(398),n(582),n(736),n(640)],r=function(e,t,n,i,r,a){return function(e,t,n,i,r,o,a){"use strict";var s=e.jQuery,l=e.getComputedStyle,c=e.console;function u(e,t){for(e=i.makeArray(e);e.length;)t.appendChild(e.shift())}var h=0,d={};function f(e,t){var n=i.getQueryElement(e);if(n){if(this.element=n,this.element.flickityGUID){var r=d[this.element.flickityGUID];return r&&r.option(t),r}s&&(this.$element=s(this.element)),this.options=i.extend({},this.constructor.defaults),this.option(t),this._create()}else c&&c.error("Bad element for Flickity: "+(n||e))}f.defaults={accessibility:!0,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:!0,percentPosition:!0,resize:!0,selectedAttraction:.025,setGallerySize:!0},f.createMethods=[];var p=f.prototype;i.extend(p,t.prototype),p._create=function(){var t=this.guid=++h;for(var n in this.element.flickityGUID=t,d[t]=this,this.selectedIndex=0,this.restingFrames=0,this.x=0,this.velocity=0,this.originSide=this.options.rightToLeft?"right":"left",this.viewport=document.createElement("div"),this.viewport.className="flickity-viewport",this._createSlider(),(this.options.resize||this.options.watchCSS)&&e.addEventListener("resize",this),this.options.on){var i=this.options.on[n];this.on(n,i)}f.createMethods.forEach((function(e){this[e]()}),this),this.options.watchCSS?this.watchCSS():this.activate()},p.option=function(e){i.extend(this.options,e)},p.activate=function(){this.isActive||(this.isActive=!0,this.element.classList.add("flickity-enabled"),this.options.rightToLeft&&this.element.classList.add("flickity-rtl"),this.getSize(),u(this._filterFindCellElements(this.element.children),this.slider),this.viewport.appendChild(this.slider),this.element.appendChild(this.viewport),this.reloadCells(),this.options.accessibility&&(this.element.tabIndex=0,this.element.addEventListener("keydown",this)),this.emitEvent("activate"),this.selectInitialIndex(),this.isInitActivated=!0,this.dispatchEvent("ready"))},p._createSlider=function(){var e=document.createElement("div");e.className="flickity-slider",e.style[this.originSide]=0,this.slider=e},p._filterFindCellElements=function(e){return i.filterFindElements(e,this.options.cellSelector)},p.reloadCells=function(){this.cells=this._makeCells(this.slider.children),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize()},p._makeCells=function(e){return this._filterFindCellElements(e).map((function(e){return new r(e,this)}),this)},p.getLastCell=function(){return this.cells[this.cells.length-1]},p.getLastSlide=function(){return this.slides[this.slides.length-1]},p.positionCells=function(){this._sizeCells(this.cells),this._positionCells(0)},p._positionCells=function(e){e=e||0,this.maxCellHeight=e&&this.maxCellHeight||0;var t=0;if(e>0){var n=this.cells[e-1];t=n.x+n.size.outerWidth}for(var i=this.cells.length,r=e;r<i;r++){var o=this.cells[r];o.setPosition(t),t+=o.size.outerWidth,this.maxCellHeight=Math.max(o.size.outerHeight,this.maxCellHeight)}this.slideableWidth=t,this.updateSlides(),this._containSlides(),this.slidesWidth=i?this.getLastSlide().target-this.slides[0].target:0},p._sizeCells=function(e){e.forEach((function(e){e.getSize()}))},p.updateSlides=function(){if(this.slides=[],this.cells.length){var e=new o(this);this.slides.push(e);var t="left"==this.originSide?"marginRight":"marginLeft",n=this._getCanCellFit();this.cells.forEach((function(i,r){if(e.cells.length){var a=e.outerWidth-e.firstMargin+(i.size.outerWidth-i.size[t]);n.call(this,r,a)||(e.updateTarget(),e=new o(this),this.slides.push(e)),e.addCell(i)}else e.addCell(i)}),this),e.updateTarget(),this.updateSelectedSlide()}},p._getCanCellFit=function(){var e=this.options.groupCells;if(!e)return function(){return!1};if("number"==typeof e){var t=parseInt(e,10);return function(e){return e%t!=0}}var n="string"==typeof e&&e.match(/^(\d+)%$/),i=n?parseInt(n[1],10)/100:1;return function(e,t){return t<=(this.size.innerWidth+1)*i}},p._init=p.reposition=function(){this.positionCells(),this.positionSliderAtSelected()},p.getSize=function(){this.size=n(this.element),this.setCellAlign(),this.cursorPosition=this.size.innerWidth*this.cellAlign};var m={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};return p.setCellAlign=function(){var e=m[this.options.cellAlign];this.cellAlign=e?e[this.originSide]:this.options.cellAlign},p.setGallerySize=function(){if(this.options.setGallerySize){var e=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=e+"px"}},p._getWrapShiftCells=function(){if(this.options.wrapAround){this._unshiftCells(this.beforeShiftCells),this._unshiftCells(this.afterShiftCells);var e=this.cursorPosition,t=this.cells.length-1;this.beforeShiftCells=this._getGapCells(e,t,-1),e=this.size.innerWidth-this.cursorPosition,this.afterShiftCells=this._getGapCells(e,0,1)}},p._getGapCells=function(e,t,n){for(var i=[];e>0;){var r=this.cells[t];if(!r)break;i.push(r),t+=n,e-=r.size.outerWidth}return i},p._containSlides=function(){if(this.options.contain&&!this.options.wrapAround&&this.cells.length){var e=this.options.rightToLeft,t=e?"marginRight":"marginLeft",n=e?"marginLeft":"marginRight",i=this.slideableWidth-this.getLastCell().size[n],r=i<this.size.innerWidth,o=this.cursorPosition+this.cells[0].size[t],a=i-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach((function(e){r?e.target=i*this.cellAlign:(e.target=Math.max(e.target,o),e.target=Math.min(e.target,a))}),this)}},p.dispatchEvent=function(e,t,n){var i=t?[t].concat(n):n;if(this.emitEvent(e,i),s&&this.$element){var r=e+=this.options.namespaceJQueryEvents?".flickity":"";if(t){var o=new s.Event(t);o.type=e,r=o}this.$element.trigger(r,n)}},p.select=function(e,t,n){if(this.isActive&&(e=parseInt(e,10),this._wrapSelect(e),(this.options.wrapAround||t)&&(e=i.modulo(e,this.slides.length)),this.slides[e])){var r=this.selectedIndex;this.selectedIndex=e,this.updateSelectedSlide(),n?this.positionSliderAtSelected():this.startAnimation(),this.options.adaptiveHeight&&this.setGallerySize(),this.dispatchEvent("select",null,[e]),e!=r&&this.dispatchEvent("change",null,[e]),this.dispatchEvent("cellSelect")}},p._wrapSelect=function(e){var t=this.slides.length;if(!(this.options.wrapAround&&t>1))return e;var n=i.modulo(e,t),r=Math.abs(n-this.selectedIndex),o=Math.abs(n+t-this.selectedIndex),a=Math.abs(n-t-this.selectedIndex);!this.isDragSelect&&o<r?e+=t:!this.isDragSelect&&a<r&&(e-=t),e<0?this.x-=this.slideableWidth:e>=t&&(this.x+=this.slideableWidth)},p.previous=function(e,t){this.select(this.selectedIndex-1,e,t)},p.next=function(e,t){this.select(this.selectedIndex+1,e,t)},p.updateSelectedSlide=function(){var e=this.slides[this.selectedIndex];e&&(this.unselectSelectedSlide(),this.selectedSlide=e,e.select(),this.selectedCells=e.cells,this.selectedElements=e.getCellElements(),this.selectedCell=e.cells[0],this.selectedElement=this.selectedElements[0])},p.unselectSelectedSlide=function(){this.selectedSlide&&this.selectedSlide.unselect()},p.selectInitialIndex=function(){var e=this.options.initialIndex;if(this.isInitActivated)this.select(this.selectedIndex,!1,!0);else{if(e&&"string"==typeof e&&this.queryCell(e))return void this.selectCell(e,!1,!0);var t=0;e&&this.slides[e]&&(t=e),this.select(t,!1,!0)}},p.selectCell=function(e,t,n){var i=this.queryCell(e);if(i){var r=this.getCellSlideIndex(i);this.select(r,t,n)}},p.getCellSlideIndex=function(e){for(var t=0;t<this.slides.length;t++)if(-1!=this.slides[t].cells.indexOf(e))return t},p.getCell=function(e){for(var t=0;t<this.cells.length;t++){var n=this.cells[t];if(n.element==e)return n}},p.getCells=function(e){e=i.makeArray(e);var t=[];return e.forEach((function(e){var n=this.getCell(e);n&&t.push(n)}),this),t},p.getCellElements=function(){return this.cells.map((function(e){return e.element}))},p.getParentCell=function(e){return this.getCell(e)||(e=i.getParent(e,".flickity-slider > *"),this.getCell(e))},p.getAdjacentCellElements=function(e,t){if(!e)return this.selectedSlide.getCellElements();t=void 0===t?this.selectedIndex:t;var n=this.slides.length;if(1+2*e>=n)return this.getCellElements();for(var r=[],o=t-e;o<=t+e;o++){var a=this.options.wrapAround?i.modulo(o,n):o,s=this.slides[a];s&&(r=r.concat(s.getCellElements()))}return r},p.queryCell=function(e){if("number"==typeof e)return this.cells[e];if("string"==typeof e){if(e.match(/^[#.]?[\d/]/))return;e=this.element.querySelector(e)}return this.getCell(e)},p.uiChange=function(){this.emitEvent("uiChange")},p.childUIPointerDown=function(e){"touchstart"!=e.type&&e.preventDefault(),this.focus()},p.onresize=function(){this.watchCSS(),this.resize()},i.debounceMethod(f,"onresize",150),p.resize=function(){if(this.isActive&&!this.isAnimating&&!this.isDragging){this.getSize(),this.options.wrapAround&&(this.x=i.modulo(this.x,this.slideableWidth)),this.positionCells(),this._getWrapShiftCells(),this.setGallerySize(),this.emitEvent("resize");var e=this.selectedElements&&this.selectedElements[0];this.selectCell(e,!1,!0)}},p.watchCSS=function(){this.options.watchCSS&&(-1!=l(this.element,":after").content.indexOf("flickity")?this.activate():this.deactivate())},p.onkeydown=function(e){var t=document.activeElement&&document.activeElement!=this.element;if(this.options.accessibility&&!t){var n=f.keyboardHandlers[e.keyCode];n&&n.call(this)}},f.keyboardHandlers={37:function(){var e=this.options.rightToLeft?"next":"previous";this.uiChange(),this[e]()},39:function(){var e=this.options.rightToLeft?"previous":"next";this.uiChange(),this[e]()}},p.focus=function(){var t=e.pageYOffset;this.element.focus({preventScroll:!0}),e.pageYOffset!=t&&e.scrollTo(e.pageXOffset,t)},p.deactivate=function(){this.isActive&&(this.element.classList.remove("flickity-enabled"),this.element.classList.remove("flickity-rtl"),this.unselectSelectedSlide(),this.cells.forEach((function(e){e.destroy()})),this.element.removeChild(this.viewport),u(this.slider.children,this.element),this.options.accessibility&&(this.element.removeAttribute("tabIndex"),this.element.removeEventListener("keydown",this)),this.isActive=!1,this.emitEvent("deactivate"))},p.destroy=function(){this.deactivate(),e.removeEventListener("resize",this),this.allOff(),this.emitEvent("destroy"),s&&this.$element&&s.removeData(this.element,"flickity"),delete this.element.flickityGUID,delete d[this.guid]},i.extend(p,a),f.data=function(e){var t=(e=i.getQueryElement(e))&&e.flickityGUID;return t&&d[t]},i.htmlInit(f,"flickity"),s&&s.bridget&&s.bridget("flickity",f),f.setJQuery=function(e){s=e},f.Cell=r,f.Slide=o,f}(o,e,t,n,i,r,a)}.apply(t,i),void 0===r||(e.exports=r)}(window)},811:(e,t,n)=>{var i,r,o;window,r=[n(983),n(882),n(680),n(984),n(937),n(154),n(439)],void 0===(o="function"==typeof(i=function(e){return e})?i.apply(t,r):i)||(e.exports=o)},439:(e,t,n)=>{var i,r;window,i=[n(983),n(398)],void 0===(r=function(e,t){return function(e,t,n){"use strict";t.createMethods.push("_createLazyload");var i=t.prototype;function r(e,t){this.img=e,this.flickity=t,this.load()}return i._createLazyload=function(){this.on("select",this.lazyLoad)},i.lazyLoad=function(){var e=this.options.lazyLoad;if(e){var t="number"==typeof e?e:0,i=this.getAdjacentCellElements(t),o=[];i.forEach((function(e){var t=function(e){if("IMG"==e.nodeName){var t=e.getAttribute("data-flickity-lazyload"),i=e.getAttribute("data-flickity-lazyload-src"),r=e.getAttribute("data-flickity-lazyload-srcset");if(t||i||r)return[e]}var o=e.querySelectorAll("img[data-flickity-lazyload], img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]");return n.makeArray(o)}(e);o=o.concat(t)})),o.forEach((function(e){new r(e,this)}),this)}},r.prototype.handleEvent=n.handleEvent,r.prototype.load=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this);var e=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src"),t=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=e,t&&this.img.setAttribute("srcset",t),this.img.removeAttribute("data-flickity-lazyload"),this.img.removeAttribute("data-flickity-lazyload-src"),this.img.removeAttribute("data-flickity-lazyload-srcset")},r.prototype.onload=function(e){this.complete(e,"flickity-lazyloaded")},r.prototype.onerror=function(e){this.complete(e,"flickity-lazyerror")},r.prototype.complete=function(e,t){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this);var n=this.flickity.getParentCell(this.img),i=n&&n.element;this.flickity.cellSizeChange(i),this.img.classList.add(t),this.flickity.dispatchEvent("lazyLoad",e,i)},t.LazyLoader=r,t}(0,e,t)}.apply(t,i))||(e.exports=r)},984:(e,t,n)=>{var i,r;window,i=[n(983),n(360),n(398)],void 0===(r=function(e,t,n){return function(e,t,n,i){"use strict";function r(e){this.parent=e,this._create()}r.prototype=Object.create(n.prototype),r.prototype._create=function(){this.holder=document.createElement("ol"),this.holder.className="flickity-page-dots",this.dots=[],this.handleClick=this.onClick.bind(this),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},r.prototype.activate=function(){this.setDots(),this.holder.addEventListener("click",this.handleClick),this.bindStartEvent(this.holder),this.parent.element.appendChild(this.holder)},r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick),this.unbindStartEvent(this.holder),this.parent.element.removeChild(this.holder)},r.prototype.setDots=function(){var e=this.parent.slides.length-this.dots.length;e>0?this.addDots(e):e<0&&this.removeDots(-e)},r.prototype.addDots=function(e){for(var t=document.createDocumentFragment(),n=[],i=this.dots.length,r=i+e,o=i;o<r;o++){var a=document.createElement("li");a.className="dot",a.setAttribute("aria-label","Page dot "+(o+1)),t.appendChild(a),n.push(a)}this.holder.appendChild(t),this.dots=this.dots.concat(n)},r.prototype.removeDots=function(e){this.dots.splice(this.dots.length-e,e).forEach((function(e){this.holder.removeChild(e)}),this)},r.prototype.updateSelected=function(){this.selectedDot&&(this.selectedDot.className="dot",this.selectedDot.removeAttribute("aria-current")),this.dots.length&&(this.selectedDot=this.dots[this.parent.selectedIndex],this.selectedDot.className="dot is-selected",this.selectedDot.setAttribute("aria-current","step"))},r.prototype.onTap=r.prototype.onClick=function(e){var t=e.target;if("LI"==t.nodeName){this.parent.uiChange();var n=this.dots.indexOf(t);this.parent.select(n)}},r.prototype.destroy=function(){this.deactivate(),this.allOff()},t.PageDots=r,i.extend(t.defaults,{pageDots:!0}),t.createMethods.push("_createPageDots");var o=t.prototype;return o._createPageDots=function(){this.options.pageDots&&(this.pageDots=new r(this),this.on("activate",this.activatePageDots),this.on("select",this.updateSelectedPageDots),this.on("cellChange",this.updatePageDots),this.on("resize",this.updatePageDots),this.on("deactivate",this.deactivatePageDots))},o.activatePageDots=function(){this.pageDots.activate()},o.updateSelectedPageDots=function(){this.pageDots.updateSelected()},o.updatePageDots=function(){this.pageDots.setDots()},o.deactivatePageDots=function(){this.pageDots.deactivate()},t.PageDots=r,t}(0,e,t,n)}.apply(t,i))||(e.exports=r)},937:(e,t,n)=>{var i,r;window,i=[n(508),n(398),n(983)],void 0===(r=function(e,t,n){return function(e,t,n){"use strict";function i(e){this.parent=e,this.state="stopped",this.onVisibilityChange=this.visibilityChange.bind(this),this.onVisibilityPlay=this.visibilityPlay.bind(this)}i.prototype=Object.create(e.prototype),i.prototype.play=function(){"playing"!=this.state&&(document.hidden?document.addEventListener("visibilitychange",this.onVisibilityPlay):(this.state="playing",document.addEventListener("visibilitychange",this.onVisibilityChange),this.tick()))},i.prototype.tick=function(){if("playing"==this.state){var e=this.parent.options.autoPlay;e="number"==typeof e?e:3e3;var t=this;this.clear(),this.timeout=setTimeout((function(){t.parent.next(!0),t.tick()}),e)}},i.prototype.stop=function(){this.state="stopped",this.clear(),document.removeEventListener("visibilitychange",this.onVisibilityChange)},i.prototype.clear=function(){clearTimeout(this.timeout)},i.prototype.pause=function(){"playing"==this.state&&(this.state="paused",this.clear())},i.prototype.unpause=function(){"paused"==this.state&&this.play()},i.prototype.visibilityChange=function(){this[document.hidden?"pause":"unpause"]()},i.prototype.visibilityPlay=function(){this.play(),document.removeEventListener("visibilitychange",this.onVisibilityPlay)},t.extend(n.defaults,{pauseAutoPlayOnHover:!0}),n.createMethods.push("_createPlayer");var r=n.prototype;return r._createPlayer=function(){this.player=new i(this),this.on("activate",this.activatePlayer),this.on("uiChange",this.stopPlayer),this.on("pointerDown",this.stopPlayer),this.on("deactivate",this.deactivatePlayer)},r.activatePlayer=function(){this.options.autoPlay&&(this.player.play(),this.element.addEventListener("mouseenter",this))},r.playPlayer=function(){this.player.play()},r.stopPlayer=function(){this.player.stop()},r.pausePlayer=function(){this.player.pause()},r.unpausePlayer=function(){this.player.unpause()},r.deactivatePlayer=function(){this.player.stop(),this.element.removeEventListener("mouseenter",this)},r.onmouseenter=function(){this.options.pauseAutoPlayOnHover&&(this.player.pause(),this.element.addEventListener("mouseleave",this))},r.onmouseleave=function(){this.player.unpause(),this.element.removeEventListener("mouseleave",this)},n.Player=i,n}
2(e,t,n)}.apply(t,i))||(e.exports=r)},680:(e,t,n)=>{var i,r;window,i=[n(983),n(360),n(398)],void 0===(r=function(e,t,n){return function(e,t,n,i){"use strict";var r="http://www.w3.org/2000/svg";function o(e,t){this.direction=e,this.parent=t,this._create()}o.prototype=Object.create(n.prototype),o.prototype._create=function(){this.isEnabled=!0,this.isPrevious=-1==this.direction;var e=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==e;var t=this.element=document.createElement("button");t.className="flickity-button flickity-prev-next-button",t.className+=this.isPrevious?" previous":" next",t.setAttribute("type","button"),this.disable(),t.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var n=this.createSVG();t.appendChild(n),this.parent.on("select",this.update.bind(this)),this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))},o.prototype.activate=function(){this.bindStartEvent(this.element),this.element.addEventListener("click",this),this.parent.element.appendChild(this.element)},o.prototype.deactivate=function(){this.parent.element.removeChild(this.element),this.unbindStartEvent(this.element),this.element.removeEventListener("click",this)},o.prototype.createSVG=function(){var e=document.createElementNS(r,"svg");e.setAttribute("class","flickity-button-icon"),e.setAttribute("viewBox","0 0 100 100");var t,n=document.createElementNS(r,"path"),i="string"==typeof(t=this.parent.options.arrowShape)?t:"M "+t.x0+",50 L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50  L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z";return n.setAttribute("d",i),n.setAttribute("class","arrow"),this.isLeft||n.setAttribute("transform","translate(100, 100) rotate(180) "),e.appendChild(n),e},o.prototype.handleEvent=i.handleEvent,o.prototype.onclick=function(){if(this.isEnabled){this.parent.uiChange();var e=this.isPrevious?"previous":"next";this.parent[e]()}},o.prototype.enable=function(){this.isEnabled||(this.element.disabled=!1,this.isEnabled=!0)},o.prototype.disable=function(){this.isEnabled&&(this.element.disabled=!0,this.isEnabled=!1)},o.prototype.update=function(){var e=this.parent.slides;if(this.parent.options.wrapAround&&e.length>1)this.enable();else{var t=e.length?e.length-1:0,n=this.isPrevious?0:t;this[this.parent.selectedIndex==n?"disable":"enable"]()}},o.prototype.destroy=function(){this.deactivate(),this.allOff()},i.extend(t.defaults,{prevNextButtons:!0,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}}),t.createMethods.push("_createPrevNextButtons");var a=t.prototype;return a._createPrevNextButtons=function(){this.options.prevNextButtons&&(this.prevButton=new o(-1,this),this.nextButton=new o(1,this),this.on("activate",this.activatePrevNextButtons))},a.activatePrevNextButtons=function(){this.prevButton.activate(),this.nextButton.activate(),this.on("deactivate",this.deactivatePrevNextButtons)},a.deactivatePrevNextButtons=function(){this.prevButton.deactivate(),this.nextButton.deactivate(),this.off("deactivate",this.deactivatePrevNextButtons)},t.PrevNextButton=o,t}(0,e,t,n)}.apply(t,i))||(e.exports=r)},736:(e,t,n)=>{var i,r;window,void 0===(r="function"==typeof(i=function(){"use strict";function e(e){this.parent=e,this.isOriginLeft="left"==e.originSide,this.cells=[],this.outerWidth=0,this.height=0}var t=e.prototype;return t.addCell=function(e){if(this.cells.push(e),this.outerWidth+=e.size.outerWidth,this.height=Math.max(e.size.outerHeight,this.height),1==this.cells.length){this.x=e.x;var t=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=e.size[t]}},t.updateTarget=function(){var e=this.isOriginLeft?"marginRight":"marginLeft",t=this.getLastCell(),n=t?t.size[e]:0,i=this.outerWidth-(this.firstMargin+n);this.target=this.x+this.firstMargin+i*this.parent.cellAlign},t.getLastCell=function(){return this.cells[this.cells.length-1]},t.select=function(){this.cells.forEach((function(e){e.select()}))},t.unselect=function(){this.cells.forEach((function(e){e.unselect()}))},t.getCellElements=function(){return this.cells.map((function(e){return e.element}))},e})?i.call(t,n,t,e):i)||(e.exports=r)},308:(e,t,n)=>{var i,r;window,void 0===(r="function"==typeof(i=function(){"use strict";function e(e){var t=parseFloat(e);return-1==e.indexOf("%")&&!isNaN(t)&&t}var t="undefined"==typeof console?function(){}:function(e){console.error(e)},n=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],i=n.length;function r(e){var n=getComputedStyle(e);return n||t("Style returned "+n+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),n}var o,a=!1;function s(t){if(function(){if(!a){a=!0;var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";var n=document.body||document.documentElement;n.appendChild(t);var i=r(t);o=200==Math.round(e(i.width)),s.isBoxSizeOuter=o,n.removeChild(t)}}(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var l=r(t);if("none"==l.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<i;t++)e[n[t]]=0;return e}();var c={};c.width=t.offsetWidth,c.height=t.offsetHeight;for(var u=c.isBorderBox="border-box"==l.boxSizing,h=0;h<i;h++){var d=n[h],f=l[d],p=parseFloat(f);c[d]=isNaN(p)?0:p}var m=c.paddingLeft+c.paddingRight,g=c.paddingTop+c.paddingBottom,_=c.marginLeft+c.marginRight,y=c.marginTop+c.marginBottom,v=c.borderLeftWidth+c.borderRightWidth,x=c.borderTopWidth+c.borderBottomWidth,b=u&&o,w=e(l.width);!1!==w&&(c.width=w+(b?0:m+v));var E=e(l.height);return!1!==E&&(c.height=E+(b?0:g+x)),c.innerWidth=c.width-(m+v),c.innerHeight=c.height-(g+x),c.outerWidth=c.width+_,c.outerHeight=c.height+y,c}}return s})?i.call(t,n,t,e):i)||(e.exports=r)},905:function(e,t,n){var i,r,o;r=[],i=function(e){var t,n={},i=!!document.querySelector&&!!e.addEventListener,r={initClass:"js-inlinesvg",svgSelector:"img.svg"},o=function(){var e={},t=!1,n=0,i=arguments.length;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(t=arguments[0],n++);for(var r=function(n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t&&"[object Object]"===Object.prototype.toString.call(n[i])?e[i]=o(!0,e[i],n[i]):e[i]=n[i])};i>n;n++)r(arguments[n]);return e},a=function(e){var n=document.querySelectorAll(t.svgSelector),i=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}}(n.length,e);Array.prototype.forEach.call(n,(function(e,n){var r=e.src||e.getAttribute("data-src"),o=e.attributes,a=new XMLHttpRequest;a.open("GET",r,!0),a.onload=function(){if(a.status>=200&&a.status<400){var n=(new DOMParser).parseFromString(a.responseText,"text/xml").getElementsByTagName("svg")[0];if(n.removeAttribute("xmlns:a"),n.removeAttribute("width"),n.removeAttribute("height"),n.removeAttribute("x"),n.removeAttribute("y"),n.removeAttribute("enable-background"),n.removeAttribute("xmlns:xlink"),n.removeAttribute("xml:space"),n.removeAttribute("version"),Array.prototype.slice.call(o).forEac
2h((function(e){"src"!==e.name&&"alt"!==e.name&&n.setAttribute(e.name,e.value)})),n.classList?n.classList.add("inlined-svg"):n.className+=" inlined-svg",n.setAttribute("role","img"),o.longdesc){var r=document.createElementNS("http://www.w3.org/2000/svg","desc"),s=document.createTextNode(o.longdesc.value);r.appendChild(s),n.insertBefore(r,n.firstChild)}if(o.alt){n.setAttribute("aria-labelledby","title");var l=document.createElementNS("http://www.w3.org/2000/svg","title"),c=document.createTextNode(o.alt.value);l.appendChild(c),n.insertBefore(l,n.firstChild)}e.parentNode.replaceChild(n,e),i(t.svgSelector)}else console.error("There was an error retrieving the source of the SVG.")},a.onerror=function(){console.error("There was an error connecting to the origin server.")},a.send()}))};return n.init=function(e,n){i&&(t=o(r,e||{}),a(n||function(){}),document.documentElement.className+=" "+t.initClass)},n}(void 0!==n.g?n.g:this.window||this.global),void 0===(o="function"==typeof i?i.apply(t,r):i)||(e.exports=o)},59:function(e,t,n){var i;e=n.nmd(e),function(){var r,o="Expected a function",a="__lodash_hash_undefined__",s="__lodash_placeholder__",l=32,c=128,u=1/0,h=9007199254740991,d=NaN,f=4294967295,p=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",l],["partialRight",64],["rearg",256]],m="[object Arguments]",g="[object Array]",_="[object Boolean]",y="[object Date]",v="[object Error]",x="[object Function]",b="[object GeneratorFunction]",w="[object Map]",E="[object Number]",T="[object Object]",S="[object Promise]",A="[object RegExp]",C="[object Set]",k="[object String]",M="[object Symbol]",I="[object WeakMap]",P="[object ArrayBuffer]",D="[object DataView]",z="[object Float32Array]",L="[object Float64Array]",O="[object Int8Array]",R="[object Int16Array]",B="[object Int32Array]",F="[object Uint8Array]",N="[object Uint8ClampedArray]",j="[object Uint16Array]",U="[object Uint32Array]",V=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,Z=RegExp($.source),X=RegExp(W.source),H=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,J=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,ne=RegExp(te.source),ie=/^\s+/,re=/\s/,oe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ae=/\{\n\/\* \[wrapped with (.+)\] \*/,se=/,? & /,le=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,he=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,de=/\w*$/,fe=/^[-+]0x[0-9a-f]+$/i,pe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,_e=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 3,193 bytes, line 2
27f]/g,ve=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,be="\\ud800-\\udfff",we="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Te="a-z\\xdf-\\xf6\\xf8-\\xff",Se="A-Z\\xc0-\\xd6\\xd8-\\xde",Ae="\\ufe0e\\ufe0f",Ce="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="["+be+"]",Me="["+Ce+"]",Ie="["+we+"]",Pe="\\d+",De="["+Ee+"]",ze="["+Te+"]",Le="[^"+be+Ce+Pe+Ee+Te+Se+"]",Oe="\\ud83c[\\udffb-\\udfff]",Re="[^"+be+"]",Be="(?:\\ud83c[\\udde6-\\uddff]){2}",Fe="[\\ud800-\\udbff][\\udc00-\\udfff]",Ne="["+Se+"]",je="\\u200d",Ue="(?:"+ze+"|"+Le+")",Ve="(?:"+Ne+"|"+Le+")",Ge="(?:['’](?:d|ll|m|re|s|t|ve))?",qe="(?:['’](?:D|LL|M|RE|S|T|VE))?",$e="(?:"+Ie+"|"+Oe+")?",We="["+Ae+"]?",Ze=We+$e+"(?:"+je+"(?:"+[Re,Be,Fe].join("|")+")"+We+$e+")*",Xe="(?:"+[De,Be,Fe].join("|")+")"+Ze,He="(?:"+[Re+Ie+"?",Ie,Be,Fe,ke].join("|")+")",Ye=RegExp("['’]","g"),Ke=RegExp(Ie,"g"),Je=RegExp(Oe+"(?="+Oe+")|"+He+Ze,"g"),Qe=RegExp([Ne+"?"+ze+"+"+Ge+"(?="+[Me,Ne,"$"].join("|")+")",Ve+"+"+qe+"(?="+[Me,Ne+Ue,"$"].join("|")+")",Ne+"?"+Ue+"+"+Ge,Ne+"+"+qe,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pe,Xe].join("|"),"g"),et=RegExp("["+je+be+we+Ae+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],it=-1,rt={};rt[z]=rt[L]=rt[O]=rt[R]=rt[B]=rt[F]=rt[N]=rt[j]=rt[U]=!0,rt[m]=rt[g]=rt[P]=rt[_]=rt[D]=rt[y]=rt[v]=rt[x]=rt[w]=rt[E]=rt[T]=rt[A]=rt[C]=rt[k]=rt[I]=!1;var ot={};ot[m]=ot[g]=ot[P]=ot[D]=ot[_]=ot[y]=ot[z]=ot[L]=ot[O]=ot[R]=ot[B]=ot[w]=ot[E]=ot[T]=ot[A]=ot[C]=ot[k]=ot[M]=ot[F]=ot[N]=ot[j]=ot[U]=!0,ot[v]=ot[x]=ot[I]=!1;var at={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},st=parseFloat,lt=parseInt,ct="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,ut="object"==typeof self&&self&&self.Object===Object&&self,ht=ct||ut||Function("return this")(),dt=t&&!t.nodeType&&t,ft=dt&&e&&!e.nodeType&&e,pt=ft&&ft.exports===dt,mt=pt&&ct.process,gt=function(){try{return ft&&ft.require&&ft.require("util").types||mt&&mt.binding&&mt.binding("util")}catch(e){}}(),_t=gt&&gt.isArrayBuffer,yt=gt&&gt.isDate,vt=gt&&gt.isMap,xt=gt&&gt.isRegExp,bt=gt&&gt.isSet,wt=gt&&gt.isTypedArray;function Et(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Tt(e,t,n,i){for(var r=-1,o=null==e?0:e.length;++r<o;){var a=e[r];t(i,a,n(a),e)}return i}function St(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}function At(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function Ct(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;
vendor: 4,396 bytes, line 2
2)if(!t(e[n],n,e))return!1;return!0}function kt(e,t){for(var n=-1,i=null==e?0:e.length,r=0,o=[];++n<i;){var a=e[n];t(a,n,e)&&(o[r++]=a)}return o}function Mt(e,t){return!(null==e||!e.length)&&Nt(e,t,0)>-1}function It(e,t,n){for(var i=-1,r=null==e?0:e.length;++i<r;)if(n(t,e[i]))return!0;return!1}function Pt(e,t){for(var n=-1,i=null==e?0:e.length,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}function Dt(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}function zt(e,t,n,i){var r=-1,o=null==e?0:e.length;for(i&&o&&(n=e[++r]);++r<o;)n=t(n,e[r],r,e);return n}function Lt(e,t,n,i){var r=null==e?0:e.length;for(i&&r&&(n=e[--r]);r--;)n=t(n,e[r],r,e);return n}function Ot(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}var Rt=Gt("length");function Bt(e,t,n){var i;return n(e,(function(e,n,r){if(t(e,n,r))return i=n,!1})),i}function Ft(e,t,n,i){for(var r=e.length,o=n+(i?1:-1);i?o--:++o<r;)if(t(e[o],o,e))return o;return-1}function Nt(e,t,n){return t==t?function(e,t,n){for(var i=n-1,r=e.length;++i<r;)if(e[i]===t)return i;return-1}(e,t,n):Ft(e,Ut,n)}function jt(e,t,n,i){for(var r=n-1,o=e.length;++r<o;)if(i(e[r],t))return r;return-1}function Ut(e){return e!=e}function Vt(e,t){var n=null==e?0:e.length;return n?Wt(e,t)/n:d}function Gt(e){return function(t){return null==t?r:t[e]}}function qt(e){return function(t){return null==e?r:e[t]}}function $t(e,t,n,i,r){return r(e,(function(e,r,o){n=i?(i=!1,e):t(n,e,r,o)})),n}function Wt(e,t){for(var n,i=-1,o=e.length;++i<o;){var a=t(e[i]);a!==r&&(n=n===r?a:n+a)}return n}function Zt(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function Xt(e){return e?e.slice(0,fn(e)+1).replace(ie,""):e}function Ht(e){return function(t){return e(t)}}function Yt(e,t){return Pt(t,(function(t){return e[t]}))}function Kt(e,t){return e.has(t)}function Jt(e,t){for(var n=-1,i=e.length;++n<i&&Nt(t,e[n],0)>-1;);return n}function Qt(e,t){for(var n=e.length;n--&&Nt(t,e[n],0)>-1;);return n}function en(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i}var tn=qt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),nn=qt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rn(e){return"\\"+at[e]}function on(e){return et.test(e)}function an(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function sn(e,t){return function(n){return e(t(n))}}function ln(e,t){for(var n=-1,i=e.length,r=0,o=[];++n<i;){var a=e[n];a!==t&&a!==s||(e[n]=s,o[r++]=n)}return o}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function un(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function hn(e){return on(e)?function(e){for(var t=Je.lastIndex=0;Je.test(e);)++t;return t}(e):Rt(e)}function dn(e){return on(e)?function(e){return e.match(Je)||[]}(e):function(e){return e.split("")}(e)}function fn(e){for(var t=e.length;t--&&re.test(e.charAt(t)););return t}var pn=qt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),mn=function e(t){var n,i=(t=null==t?ht:mn.defaults(ht.Object(),t,mn.pick(ht,nt))).Array,re=t.Date,be=t.Error,
vendor: 10,066 bytes, line 2
2we=t.Function,Ee=t.Math,Te=t.Object,Se=t.RegExp,Ae=t.String,Ce=t.TypeError,ke=i.prototype,Me=we.prototype,Ie=Te.prototype,Pe=t["__core-js_shared__"],De=Me.toString,ze=Ie.hasOwnProperty,Le=0,Oe=(n=/[^.]+$/.exec(Pe&&Pe.keys&&Pe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Re=Ie.toString,Be=De.call(Te),Fe=ht._,Ne=Se("^"+De.call(ze).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),je=pt?t.Buffer:r,Ue=t.Symbol,Ve=t.Uint8Array,Ge=je?je.allocUnsafe:r,qe=sn(Te.getPrototypeOf,Te),$e=Te.create,We=Ie.propertyIsEnumerable,Ze=ke.splice,Xe=Ue?Ue.isConcatSpreadable:r,He=Ue?Ue.iterator:r,Je=Ue?Ue.toStringTag:r,et=function(){try{var e=co(Te,"defineProperty");return e({},"",{}),e}catch(e){}}(),at=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,ct=re&&re.now!==ht.Date.now&&re.now,ut=t.setTimeout!==ht.setTimeout&&t.setTimeout,dt=Ee.ceil,ft=Ee.floor,mt=Te.getOwnPropertySymbols,gt=je?je.isBuffer:r,Rt=t.isFinite,qt=ke.join,gn=sn(Te.keys,Te),_n=Ee.max,yn=Ee.min,vn=re.now,xn=t.parseInt,bn=Ee.random,wn=ke.reverse,En=co(t,"DataView"),Tn=co(t,"Map"),Sn=co(t,"Promise"),An=co(t,"Set"),Cn=co(t,"WeakMap"),kn=co(Te,"create"),Mn=Cn&&new Cn,In={},Pn=No(En),Dn=No(Tn),zn=No(Sn),Ln=No(An),On=No(Cn),Rn=Ue?Ue.prototype:r,Bn=Rn?Rn.valueOf:r,Fn=Rn?Rn.toString:r;function Nn(e){if(ns(e)&&!$a(e)&&!(e instanceof Gn)){if(e instanceof Vn)return e;if(ze.call(e,"__wrapped__"))return jo(e)}return new Vn(e)}var jn=function(){function e(){}return function(t){if(!ts(t))return{};if($e)return $e(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function Un(){}function Vn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Gn(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function qn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function $n(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Wn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Zn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Wn;++t<n;)this.add(e[t])}function Xn(e){var t=this.__data__=new $n(e);this.size=t.size}function Hn(e,t){var n=$a(e),i=!n&&qa(e),r=!n&&!i&&Ha(e),o=!n&&!i&&!r&&us(e),a=n||i||r||o,s=a?Zt(e.length,Ae):[],l=s.length;for(var c in e)!t&&!ze.call(e,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||_o(c,l))||s.push(c);return s}function Yn(e){var t=e.length;return t?e[Wi(0,t-1)]:r}function Kn(e,t){return Lo(Cr(e),ai(t,0,e.length))}function Jn(e){return Lo(Cr(e))}function Qn(e,t,n){(n!==r&&!Ua(e[t],n)||n===r&&!(t in e))&&ri(e,t,n)}function ei(e,t,n){var i=e[t];ze.call(e,t)&&Ua(i,n)&&(n!==r||t in e)||ri(e,t,n)}function ti(e,t){for(var n=e.length;n--;)if(Ua(e[n][0],t))return n;return-1}function ni(e,t,n,i){return hi(e,(function(e,r,o){t(i,e,n(e),o)})),i}function ii(e,t){return e&&kr(t,Ds(t),e)}function ri(e,t,n){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function oi(e,t){for(var n=-1,o=t.length,a=i(o),s=null==e;++n<o;)a[n]=s?r:Cs(e,t[n]);return a}function ai(e,t,n){return e==e&&(n!==r&&(e=e<=n?e:n),t!==r&&(e=e>=t?e:t)),e}function si(e,t,n,i,o,a){var s,l=1&t,c=2&t,u=4&t;if(n&&(s=o?n(e,i,o,a):n(e)),s!==r)return s;if(!ts(e))return e;var h=$a(e);if(h){if(s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ze.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!l)return Cr(e,s)}else{var d=fo(e),f=d==x||d==b;if(Ha(e))return br(e,l);if(d==T||d==m||f&&!o){if(s=c||f?{}:mo(e),!l)return c?function(e,t){return kr(e,ho(e),t)}(e,function(e,t){return e&&kr(t,zs(t),e)}(s,e)):function(e,t){return kr(e,uo(e),t)}(e,ii(s,e))}else{if(!ot[d])return o?e:{};s=function(e,t,n){var i,r=e.constructor;switch(t){case P:return wr(e);case _:case y:return new r(+e);case D:return function(e,t){var n=t?wr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case z:case L:case O:case R:case B:case F:case N:case j:case U:return Er(e,n);case w:return new r;case E:case k:return new r(e);case A:return function(e){var t=new e.constructor(e.source,de.exec(e));return t.lastIndex=e.lastIndex,t}(e);case C:return new r;case M:return i=e,Bn?Te(Bn.call(i)):{}}}(e,d,l)}}a||(a=new Xn);var p=a.get(e);if(p)return p;a.set(e,s),ss(e)?e.forEach((function(i){s.add(si(i,t,n,i,e,a))})):is(e)&&e.forEach((function(i,r){s.set(r,si(i,t,n,r,e,a))}));var g=h?r:(u?c?no:to:c?zs:Ds)(e);return St(g||e,(function(i,r){g&&(i=e[r=i]),ei(s,r,si(i,t,n,r,e,a))})),s}function li(e,t,n){var i=n.length;if(null==e)return!i;for(e=Te(e);i--;){var o=n[i],a=t[o],s=e[o];if(s===r&&!(o in e)||!a(s))return!1}return!0}function ci(e,t,n){if("function"!=typeof e)throw new Ce(o);return Io((function(){e.apply(r,n)}),t)}function ui(e,t,n,i){var r=-1,o=Mt,a=!0,s=e.length,l=[],c=t.length;if(!s)return l;n&&(t=Pt(t,Ht(n))),i?(o=It,a=!1):t.length>=200&&(o=Kt,a=!1,t=new Zn(t));e:for(;++r<s;){var u=e[r],h=null==n?u:n(u);if(u=i||0!==u?u:0,a&&h==h){for(var d=c;d--;)if(t[d]===h)continue e;l.push(u)}else o(t,h,i)||l.push(u)}return l}Nn.templateSettings={escape:H,evaluate:Y,interpolate:K,variable:"",imports:{_:Nn}},Nn.prototype=Un.prototype,Nn.prototype.constructor=Nn,Vn.prototype=jn(Un.prototype),Vn.prototype.constructor=Vn,Gn.prototype=jn(Un.prototype),Gn.prototype.constructor=Gn,qn.prototype.clear=function(){this.__data__=kn?kn(null):{},this.size=0},qn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},qn.prototype.get=function(e){var t=this.__data__;if(kn){var n=t[e];return n===a?r:n}return ze.call(t,e)?t[e]:r},qn.prototype.has=function(e){var t=this.__data__;return kn?t[e]!==r:ze.call(t,e)},qn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=kn&&t===r?a:t,this},$n.prototype.clear=function(){this.__data__=[],this.size=0},$n.prototype.delete=function(e){var t=this.__data__,n=ti(t,e);return!(n<0||(n==t.length-1?t.pop():Ze.call(t,n,1),--this.size,0))},$n.prototype.get=function(e){var t=this.__data__,n=ti(t,e);return n<0?r:t[n][1]},$n.prototype.has=function(e){return ti(this.__data__,e)>-1},$n.prototype.set=function(e,t){var n=this.__data__,i=ti(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},Wn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(Tn||$n),string:new qn}},Wn.prototype.delete=function(e){var t=so(this,e).delete(e);return this.size-=t?1:0,t},Wn.prototype.get=function(e){return so(this,e).get(e)},Wn.prototype.has=function(e){return so(this,e).has(e)},Wn.prototype.set=function(e,t){var n=so(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},Zn.prototype.add=Zn.prototype.push=function(e){return this.__data__.set(e,a),this},Zn.prototype.has=function(e){return this.__data__.has(e)},Xn.prototype.clear=function(){this.__data__=new $n,this.size=0},Xn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Xn.prototype.get=function(e){return this.__data__.get(e)},Xn.prototype.has=function(e){return this.__data__.has(e)},Xn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof $n){var i=n.__data__;if(!Tn||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(i)}return n.set(e,t),this.size=n.size,this};var hi=Pr(vi),di=Pr(xi,!0);function fi(e,t){var n=!0;return hi(e,(function(e,i,r){return n=!!t(e,i,r)})),n}function pi(e,t,n){for(var i=-1,o=e.length;++i<o;){var a=e[i],s=t(a);if(null!=s&&(l===r?s==s&&!cs(s):n(s,l)))var l=s,c=a}return c}function mi(e,t){var n=[];return hi(e,(function(e,i,r){t(e,i,r)&&n.push(e)})),n}function gi(e,t,n,i,r){var o=-1,a=e.length;for(n||(n=go),r||(r=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?gi(s,t-1,n,i,r):Dt(r,s):i||(r[r.length]=s)}return r}var _i=Dr(),yi=Dr(!0);function vi(e,t){return e&&_i(e,t,Ds)}function xi(e,t){return e&&yi(e,t,Ds)}function bi(e,t){return kt(t,(function(t){return Ja(e[t])}))}function wi(e,t){for(var n=0,i=(t=_r(t,e)).length;null!=e&&n<i;)e=e[Fo(t[n++])];return n&&n==i?e:r}function Ei(e,t,n){var i=t(e);return $a(e)?i:Dt(i,n(e))}function Ti(e){return null==e?e===r?"[object Undefined]":"[object Null]":Je&&Je in Te(e)?function(e){var t=ze.call(e,Je),n=e[Je];try{e[Je]=r;var i=!0}catch(e){}var o=Re.call(e);return i&&(t?e[Je]=n:delete e[Je]),o}(e):function(e){return Re.call(e)}(e)}function Si(e,t){return e>t}function Ai(e,t){return null!=e&&ze.call(e,t)}function Ci(e,t){return null!=e&&t in Te(e)}function ki(e,t,n){for(var o=n?It:Mt,a=e[0].length,s=e.length,l=s,c=i(s),u=1/0,h=[];l--;){var d=e[l];l&&t&&(d=Pt(d,Ht(t))),u=yn(d.length,u),c[l]=!n&&(t||a>=120&&d.length>=120)?new Zn(l&&d):r}d=e[0];var f=-1,p=c[0];e:for(;++f<a&&h.length<u;){var m=d[f],g=t?t(m):m;if(m=n||0!==m?m:0,!(p?Kt(p,g):o(h,g,n))){for(l=s;--l;){var _=c[l];if(!(_?Kt(_,g):o(e[l],g,n)))continue e}p&&p.push(g),h.push(m)}}return h}function Mi(e,t,n){var i=null==(e=Ao(e,t=_r(t,e)))?e:e[Fo(Ko(t))];return null==i?r:Et(i,e,n)}function Ii(e){return ns(e)&&Ti(e)==m}function Pi(e,t,n,i,o){return e===t||(null==e||null==t||!ns(e)&&!ns(t)?e!=e&&t!=t:function(e,t,n,i,o,a){var s=$a(e),l=$a(t),c=s?g:fo(e),u=l?g:fo(t),h=(c=c==m?T:c)==T,d=(u=u==m?T:u)==T,f=c==u;if(f&&Ha(e)){if(!Ha(t))return!1;s=!0,h=!1}if(f&&!h)return a||(a=new Xn),s||us(e)?Qr(e,t,n,i,o,a):function(e,t,n,i,r,o,a){switch(n){case D:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case P:return!(e.byteLength!=t.byteLength||!o(new Ve(e),new Ve(t)));case _:case y:case E:return Ua(+e,+t);case v:return e.name==t.name&&e.message==t.message;case A:case k:return e==t+"";case w:var s=an;case C:var l=1&i;if(s||(s=cn),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;i|=2,a.set(e,t);var u=Qr(s(e),s(t),i,r,o,a);return a.delete(e),u;case M:if(Bn)return Bn.call(e)==Bn.call(t)}return!1}(e,t,c,n,i,o,a);if(!(1&n)){var p=h&&ze.call(e,"__wrapped__"),x=d&&ze.call(t,"__wrapped__");
vendor: 6,165 bytes, line 2
2if(p||x){var b=p?e.value():e,S=x?t.value():t;return a||(a=new Xn),o(b,S,n,i,a)}}return!!f&&(a||(a=new Xn),function(e,t,n,i,o,a){var s=1&n,l=to(e),c=l.length;if(c!=to(t).length&&!s)return!1;for(var u=c;u--;){var h=l[u];if(!(s?h in t:ze.call(t,h)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=s;++u<c;){var g=e[h=l[u]],_=t[h];if(i)var y=s?i(_,g,h,t,e,a):i(g,_,h,e,t,a);if(!(y===r?g===_||o(g,_,n,i,a):y)){p=!1;break}m||(m="constructor"==h)}if(p&&!m){var v=e.constructor,x=t.constructor;v==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof x&&x instanceof x||(p=!1)}return a.delete(e),a.delete(t),p}(e,t,n,i,o,a))}(e,t,n,i,Pi,o))}function Di(e,t,n,i){var o=n.length,a=o,s=!i;if(null==e)return!a;for(e=Te(e);o--;){var l=n[o];if(s&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++o<a;){var c=(l=n[o])[0],u=e[c],h=l[1];if(s&&l[2]){if(u===r&&!(c in e))return!1}else{var d=new Xn;if(i)var f=i(u,h,c,e,t,d);if(!(f===r?Pi(h,u,3,i,d):f))return!1}}return!0}function zi(e){return!(!ts(e)||(t=e,Oe&&Oe in t))&&(Ja(e)?Ne:me).test(No(e));var t}function Li(e){return"function"==typeof e?e:null==e?rl:"object"==typeof e?$a(e)?Ni(e[0],e[1]):Fi(e):fl(e)}function Oi(e){if(!wo(e))return gn(e);var t=[];for(var n in Te(e))ze.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Ri(e,t){return e<t}function Bi(e,t){var n=-1,r=Za(e)?i(e.length):[];return hi(e,(function(e,i,o){r[++n]=t(e,i,o)})),r}function Fi(e){var t=lo(e);return 1==t.length&&t[0][2]?To(t[0][0],t[0][1]):function(n){return n===e||Di(n,e,t)}}function Ni(e,t){return vo(e)&&Eo(t)?To(Fo(e),t):function(n){var i=Cs(n,e);return i===r&&i===t?ks(n,e):Pi(t,i,3)}}function ji(e,t,n,i,o){e!==t&&_i(t,(function(a,s){if(o||(o=new Xn),ts(a))!function(e,t,n,i,o,a,s){var l=ko(e,n),c=ko(t,n),u=s.get(c);if(u)Qn(e,n,u);else{var h=a?a(l,c,n+"",e,t,s):r,d=h===r;if(d){var f=$a(c),p=!f&&Ha(c),m=!f&&!p&&us(c);h=c,f||p||m?$a(l)?h=l:Xa(l)?h=Cr(l):p?(d=!1,h=br(c,!0)):m?(d=!1,h=Er(c,!0)):h=[]:os(c)||qa(c)?(h=l,qa(l)?h=ys(l):ts(l)&&!Ja(l)||(h=mo(c))):d=!1}d&&(s.set(c,h),o(h,c,i,a,s),s.delete(c)),Qn(e,n,h)}}(e,t,s,n,ji,i,o);else{var l=i?i(ko(e,s),a,s+"",e,t,o):r;l===r&&(l=a),Qn(e,s,l)}}),zs)}function Ui(e,t){var n=e.length;if(n)return _o(t+=t<0?n:0,n)?e[t]:r}function Vi(e,t,n){t=t.length?Pt(t,(function(e){return $a(e)?function(t){return wi(t,1===e.length?e[0]:e)}:e})):[rl];var i=-1;t=Pt(t,Ht(ao()));var r=Bi(e,(function(e,n,r){var o=Pt(t,(function(t){return t(e)}));return{criteria:o,index:++i,value:e}}));return function(e,t){var i=e.length;for(e.sort((function(e,t){return function(e,t,n){for(var i=-1,r=e.criteria,o=t.criteria,a=r.length,s=n.length;++i<a;){var l=Tr(r[i],o[i]);if(l)return i>=s?l:l*("desc"==n[i]?-1:1)}return e.index-t.index}(e,t,n)}));i--;)e[i]=e[i].value;return e}(r)}function Gi(e,t,n){for(var i=-1,r=t.length,o={};++i<r;){var a=t[i],s=wi(e,a);n(s,a)&&Ki(o,_r(a,e),s)}return o}function qi(e,t,n,i){var r=i?jt:Nt,o=-1,a=t.length,s=e;for(e===t&&(t=Cr(t)),n&&(s=Pt(e,Ht(n)));++o<a;)for(var l=0,c=t[o],u=n?n(c):c;(l=r(s,u,l,i))>-1;)s!==e&&Ze.call(s,l,1),Ze.call(e,l,1);return e}function $i(e,t){for(var n=e?t.length:0,i=n-1;n--;){var r=t[n];if(n==i||r!==o){var o=r;_o(r)?Ze.call(e,r,1):cr(e,r)}}return e}function Wi(e,t){return e+ft(bn()*(t-e+1))}function Zi(e,t){var n="";if(!e||t<1||t>h)return n;do{t%2&&(n+=e),(t=ft(t/2))&&(e+=e)}while(t);return n}function Xi(e,t){return Po(So(e,t,rl),e+"")}function Hi(e){return Yn(Us(e))}function Yi(e,t){var n=Us(e);return Lo(n,ai(t,0,n.length))}function Ki(e,t,n,i){if(!ts(e))return e;for(var o=-1,a=(t=_r(t,e)).length,s=a-1,l=e;null!=l&&++o<a;){var c=Fo(t[o]),u=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(o!=s){var h=l[c];(u=i?i(h,c,l):r)===r&&(u=ts(h)?h:_o(t[o+1])?[]:{})}ei(l,c,u),l=l[c]}return e}var Ji=Mn?function(e,t){return Mn.set(e,t),e}:rl,Qi=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:tl(t),writable:!0})}:rl;function er(e){return Lo(Us(e))}function tr(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=i(o);++r<o;)a[r]=e[r+t];return a}function nr(e,t){var n;return hi(e,(function(e,i,r){return!(n=t(e,i,r))})),!!n}function ir(e,t,n){var i=0,r=null==e?i:e.length;if("number"==typeof t&&t==t&&r<=2147483647){for(;i<r;){var o=i+r>>>1,a=e[o];null!==a&&!cs(a)&&(n?a<=t:a<t)?i=o+1:r=o}return r}return rr(e,t,rl,n)}function rr(e,t,n,i){var o=0,a=null==e?0:e.length;if(0===a)return 0;for(var s=(t=n(t))!=t,l=null===t,c=cs(t),u=t===r;o<a;){var h=ft((o+a)/2),d=n(e[h]),f=d!==r,p=null===d,m=d==d,g=cs(d);if(s)var _=i||m;else _=u?m&&(i||f):l?m&&f&&(i||!p):c?m&&f&&!p&&(i||!g):!p&&!g&&(i?d<=t:d<t);_?o=h+1:a=h}return yn(a,4294967294)}function or(e,t){for(var n=-1,i=e.length,r=0,o=[];++n<i;){var a=e[n],s=t?t(a):a;if(!n||!Ua(s,l)){var l=s;o[r++]=0===a?0:a}}return o}function ar(e){return"number"==typeof e?e:cs(e)?d:+e}function sr(e){if("string"==typeof e)return e;if($a(e))return Pt(e,sr)+"";if(cs(e))return Fn?Fn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function lr(e,t,n){var i=-1,r=Mt,o=e.length,a=!0,s=[],l=s;if(n)a=!1,r=It;else if(o>=200){var c=t?null:Zr(e);if(c)return cn(c);a=!1,r=Kt,l=new Zn}else l=t?[]:s;e:for(;++i<o;){var u=e[i],h=t?t(u):u;if(u=n||0!==u?u:0,a&&h==h){for(var d=l.length;d--;)if(l[d]===h)continue e;t&&l.push(h),s.push(u)}else r(l,h,n)||(l!==s&&l.push(h),s.push(u))}return s}function cr(e,t){return null==(e=Ao(e,t=_r(t,e)))||delete e[Fo(Ko(t))]}function ur(e,t,n,i){return Ki(e,t,n(wi(e,t)),i)}function hr(e,t,n,i){for(var r=e.length,o=i?r:-1;(i?o--:++o<r)&&t(e[o],o,e););return n?tr(e,i?0:o,i?o+1:r):tr(e,i?o+1:0,i?r:o)}function dr(e,t){var n=e;return n instanceof Gn&&(n=n.value()),zt(t,(function(e,t){return t.func.apply(t.thisArg,Dt([e],t.args))}),n)}function fr(e,t,n){var r=e.length;if(r<2)return r?lr(e[0]):[];for(var o=-1,a=i(r);++o<r;)for(var s=e[o],l=-1;++l<r;)l!=o&&(a[o]=ui(a[o]||s,e[l],t,n));return lr(gi(a,1),t,n)}function pr(e,t,n){for(var i=-1,o=e.length,a=t.length,s={};++i<o;){var l=i<a?t[i]:r;n(s,e[i],l)}return s}function mr(e){return Xa(e)?e:[]}function gr(e){return"function"==typeof e?e:rl}
vendor: 10,397 bytes, line 2
2function _r(e,t){return $a(e)?e:vo(e,t)?[e]:Bo(vs(e))}var yr=Xi;function vr(e,t,n){var i=e.length;return n=n===r?i:n,!t&&n>=i?e:tr(e,t,n)}var xr=at||function(e){return ht.clearTimeout(e)};function br(e,t){if(t)return e.slice();var n=e.length,i=Ge?Ge(n):new e.constructor(n);return e.copy(i),i}function wr(e){var t=new e.constructor(e.byteLength);return new Ve(t).set(new Ve(e)),t}function Er(e,t){var n=t?wr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Tr(e,t){if(e!==t){var n=e!==r,i=null===e,o=e==e,a=cs(e),s=t!==r,l=null===t,c=t==t,u=cs(t);if(!l&&!u&&!a&&e>t||a&&s&&c&&!l&&!u||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!u&&e<t||u&&n&&o&&!i&&!a||l&&n&&o||!s&&o||!c)return-1}return 0}function Sr(e,t,n,r){for(var o=-1,a=e.length,s=n.length,l=-1,c=t.length,u=_n(a-s,0),h=i(c+u),d=!r;++l<c;)h[l]=t[l];for(;++o<s;)(d||o<a)&&(h[n[o]]=e[o]);for(;u--;)h[l++]=e[o++];return h}function Ar(e,t,n,r){for(var o=-1,a=e.length,s=-1,l=n.length,c=-1,u=t.length,h=_n(a-l,0),d=i(h+u),f=!r;++o<h;)d[o]=e[o];for(var p=o;++c<u;)d[p+c]=t[c];for(;++s<l;)(f||o<a)&&(d[p+n[s]]=e[o++]);return d}function Cr(e,t){var n=-1,r=e.length;for(t||(t=i(r));++n<r;)t[n]=e[n];return t}function kr(e,t,n,i){var o=!n;n||(n={});for(var a=-1,s=t.length;++a<s;){var l=t[a],c=i?i(n[l],e[l],l,n,e):r;c===r&&(c=e[l]),o?ri(n,l,c):ei(n,l,c)}return n}function Mr(e,t){return function(n,i){var r=$a(n)?Tt:ni,o=t?t():{};return r(n,e,ao(i,2),o)}}function Ir(e){return Xi((function(t,n){var i=-1,o=n.length,a=o>1?n[o-1]:r,s=o>2?n[2]:r;for(a=e.length>3&&"function"==typeof a?(o--,a):r,s&&yo(n[0],n[1],s)&&(a=o<3?r:a,o=1),t=Te(t);++i<o;){var l=n[i];l&&e(t,l,i,a)}return t}))}function Pr(e,t){return function(n,i){if(null==n)return n;if(!Za(n))return e(n,i);for(var r=n.length,o=t?r:-1,a=Te(n);(t?o--:++o<r)&&!1!==i(a[o],o,a););return n}}function Dr(e){return function(t,n,i){for(var r=-1,o=Te(t),a=i(t),s=a.length;s--;){var l=a[e?s:++r];if(!1===n(o[l],l,o))break}return t}}function zr(e){return function(t){var n=on(t=vs(t))?dn(t):r,i=n?n[0]:t.charAt(0),o=n?vr(n,1).join(""):t.slice(1);return i[e]()+o}}function Lr(e){return function(t){return zt(Js(qs(t).replace(Ye,"")),e,"")}}function Or(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=jn(e.prototype),i=e.apply(n,t);return ts(i)?i:n}}function Rr(e){return function(t,n,i){var o=Te(t);if(!Za(t)){var a=ao(n,3);t=Ds(t),n=function(e){return a(o[e],e,o)}}var s=e(t,n,i);return s>-1?o[a?t[s]:s]:r}}function Br(e){return eo((function(t){var n=t.length,i=n,a=Vn.prototype.thru;for(e&&t.reverse();i--;){var s=t[i];if("function"!=typeof s)throw new Ce(o);if(a&&!l&&"wrapper"==ro(s))var l=new Vn([],!0)}for(i=l?i:n;++i<n;){var c=ro(s=t[i]),u="wrapper"==c?io(s):r;l=u&&xo(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?l[ro(u[0])].apply(l,u[3]):1==s.length&&xo(s)?l[c]():l.thru(s)}return function(){var e=arguments,i=e[0];if(l&&1==e.length&&$a(i))return l.plant(i).value();for(var r=0,o=n?t[r].apply(this,e):i;++r<n;)o=t[r].call(this,o);return o}}))}function Fr(e,t,n,o,a,s,l,u,h,d){var f=t&c,p=1&t,m=2&t,g=24&t,_=512&t,y=m?r:Or(e);return function r(){for(var c=arguments.length,v=i(c),x=c;x--;)v[x]=arguments[x];if(g)var b=oo(r),w=en(v,b);if(o&&(v=Sr(v,o,a,g)),s&&(v=Ar(v,s,l,g)),c-=w,g&&c<d){var E=ln(v,b);return $r(e,t,Fr,r.placeholder,n,v,E,u,h,d-c)}var T=p?n:this,S=m?T[e]:e;return c=v.length,u?v=Co(v,u):_&&c>1&&v.reverse(),f&&h<c&&(v.length=h),this&&this!==ht&&this instanceof r&&(S=y||Or(S)),S.apply(T,v)}}function Nr(e,t){return function(n,i){return function(e,t,n,i){return vi(e,(function(e,r,o){t(i,n(e),r,o)})),i}(n,e,t(i),{})}}function jr(e,t){return function(n,i){var o;if(n===r&&i===r)return t;if(n!==r&&(o=n),i!==r){if(o===r)return i;"string"==typeof n||"string"==typeof i?(n=sr(n),i=sr(i)):(n=ar(n),i=ar(i)),o=e(n,i)}return o}}function Ur(e){return eo((function(t){return t=Pt(t,Ht(ao())),Xi((function(n){var i=this;return e(t,(function(e){return Et(e,i,n)}))}))}))}function Vr(e,t){var n=(t=t===r?" ":sr(t)).length;if(n<2)return n?Zi(t,e):t;var i=Zi(t,dt(e/hn(t)));return on(t)?vr(dn(i),0,e).join(""):i.slice(0,e)}function Gr(e){return function(t,n,o){return o&&"number"!=typeof o&&yo(t,n,o)&&(n=o=r),t=ps(t),n===r?(n=t,t=0):n=ps(n),function(e,t,n,r){for(var o=-1,a=_n(dt((t-e)/(n||1)),0),s=i(a);a--;)s[r?a:++o]=e,e+=n;return s}(t,n,o=o===r?t<n?1:-1:ps(o),e)}}function qr(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=_s(t),n=_s(n)),e(t,n)}}function $r(e,t,n,i,o,a,s,c,u,h){var d=8&t;t|=d?l:64,4&(t&=~(d?64:l))||(t&=-4);var f=[e,t,o,d?a:r,d?s:r,d?r:a,d?r:s,c,u,h],p=n.apply(r,f);return xo(e)&&Mo(p,f),p.placeholder=i,Do(p,e,t)}function Wr(e){var t=Ee[e];return function(e,n){if(e=_s(e),(n=null==n?0:yn(ms(n),292))&&Rt(e)){var i=(vs(e)+"e").split("e");return+((i=(vs(t(i[0]+"e"+(+i[1]+n)))+"e").split("e"))[0]+"e"+(+i[1]-n))}return t(e)}}var Zr=An&&1/cn(new An([,-0]))[1]==u?function(e){return new An(e)}:cl;function Xr(e){return function(t){var n=fo(t);return n==w?an(t):n==C?un(t):function(e,t){return Pt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Hr(e,t,n,a,u,h,d,f){var p=2&t;if(!p&&"function"!=typeof e)throw new Ce(o);var m=a?a.length:0;if(m||(t&=-97,a=u=r),d=d===r?d:_n(ms(d),0),f=f===r?f:ms(f),m-=u?u.length:0,64&t){var g=a,_=u;a=u=r}var y=p?r:io(e),v=[e,t,n,a,u,g,_,h,d,f];if(y&&function(e,t){var n=e[1],i=t[1],r=n|i,o=r<131,a=i==c&&8==n||i==c&&256==n&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==n;if(!o&&!a)return e;1&i&&(e[2]=t[2],r|=1&n?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?Sr(u,l,t[4]):l,e[4]=u?ln(e[3],s):t[4]}(l=t[5])&&(u=e[5],e[5]=u?Ar(u,l,t[6]):l,e[6]=u?ln(e[5],s):t[6]),(l=t[7])&&(e[7]=l),i&c&&(e[8]=null==e[8]?t[8]:yn(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=r}(v,y),e=v[0],t=v[1],n=v[2],a=v[3],u=v[4],!(f=v[9]=v[9]===r?p?0:e.length:_n(v[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)x=8==t||16==t?function(e,t,n){var o=Or(e);return function a(){for(var s=arguments.length,l=i(s),c=s,u=oo(a);c--;)l[c]=arguments[c];var h=s<3&&l[0]!==u&&l[s-1]!==u?[]:ln(l,u);return(s-=h.length)<n?$r(e,t,Fr,a.placeholder,r,l,h,r,r,n-s):Et(this&&this!==ht&&this instanceof a?o:e,this,l)}}(e,t,f):t!=l&&33!=t||u.length?Fr.apply(r,v):function(e,t,n,r){var o=1&t,a=Or(e);return function t(){for(var s=-1,l=arguments.length,c=-1,u=r.length,h=i(u+l),d=this&&this!==ht&&this instanceof t?a:e;++c<u;)h[c]=r[c];for(;l--;)h[c++]=arguments[++s];return Et(d,o?n:this,h)}}(e,t,n,a);else var x=function(e,t,n){var i=1&t,r=Or(e);return function t(){return(this&&this!==ht&&this instanceof t?r:e).apply(i?n:this,arguments)}}(e,t,n);return Do((y?Ji:Mo)(x,v),e,t)}function Yr(e,t,n,i){return e===r||Ua(e,Ie[n])&&!ze.call(i,n)?t:e}function Kr(e,t,n,i,o,a){return ts(e)&&ts(t)&&(a.set(t,e),ji(e,t,r,Kr,a),a.delete(t)),e}function Jr(e){return os(e)?r:e}function Qr(e,t,n,i,o,a){var s=1&n,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var u=a.get(e),h=a.get(t);if(u&&h)return u==t&&h==e;var d=-1,f=!0,p=2&n?new Zn:r;for(a.set(e,t),a.set(t,e);++d<l;){var m=e[d],g=t[d];if(i)var _=s?i(g,m,d,t,e,a):i(m,g,d,e,t,a);if(_!==r){if(_)continue;f=!1;break}if(p){if(!Ot(t,(function(e,t){if(!Kt(p,t)&&(m===e||o(m,e,n,i,a)))return p.push(t)}))){f=!1;break}}else if(m!==g&&!o(m,g,n,i,a)){f=!1;break}}return a.delete(e),a.delete(t),f}function eo(e){return Po(So(e,r,Wo),e+"")}function to(e){return Ei(e,Ds,uo)}function no(e){return Ei(e,zs,ho)}var io=Mn?function(e){return Mn.get(e)}:cl;function ro(e){for(var t=e.name+"",n=In[t],i=ze.call(In,t)?n.length:0;i--;){var r=n[i],o=r.func;if(null==o||o==e)return r.name}return t}function oo(e){return(ze.call(Nn,"placeholder")?Nn:e).placeholder}function ao(){var e=Nn.iteratee||ol;return e=e===ol?Li:e,arguments.length?e(arguments[0],arguments[1]):e}function so(e,t){var n,i,r=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof t?"string":"hash"]:r.map}function lo(e){for(var t=Ds(e),n=t.length;n--;){var i=t[n],r=e[i];t[n]=[i,r,Eo(r)]}return t}function co(e,t){var n=function(e,t){return null==e?r:e[t]}(e,t);return zi(n)?n:r}var uo=mt?function(e){return null==e?[]:(e=Te(e),kt(mt(e),(function(t){return We.call(e,t)})))}:gl,ho=mt?function(e){for(var t=[];e;)Dt(t,uo(e)),e=qe(e);return t}:gl,fo=Ti;function po(e,t,n){for(var i=-1,r=(t=_r(t,e)).length,o=!1;++i<r;){var a=Fo(t[i]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++i!=r?o:!!(r=null==e?0:e.length)&&es(r)&&_o(a,r)&&($a(e)||qa(e))}function mo(e){return"function"!=typeof e.constructor||wo(e)?{}:jn(qe(e))}function go(e){return $a(e)||qa(e)||!!(Xe&&e&&e[Xe])}function _o(e,t){var n=typeof e;return!!(t=null==t?h:t)&&("number"==n||"symbol"!=n&&_e.test(e))&&e>-1&&e%1==0&&e<t}function yo(e,t,n){if(!ts(n))return!1;var i=typeof t;return!!("number"==i?Za(n)&&_o(t,n.length):"string"==i&&t in n)&&Ua(n[t],e)}function vo(e,t){if($a(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!cs(e))||Q.test(e)||!J.test(e)||null!=t&&e in Te(t)}function xo(e){var t=ro(e),n=Nn[t];if("function"!=typeof n||!(t in Gn.prototype))return!1;if(e===n)return!0;var i=io(n);return!!i&&e===i[0]}(En&&fo(new En(new ArrayBuffer(1)))!=D||Tn&&fo(new Tn)!=w||Sn&&fo(Sn.resolve())!=S||An&&fo(new An)!=C||Cn&&fo(new Cn)!=I)&&(fo=function(e){var t=Ti(e),n=t==T?e.constructor:r,i=n?No(n):"";if(i)switch(i){case Pn:return D;case Dn:return w;case zn:return S;case Ln:return C;case On:return I}return t});var bo=Pe?Ja:_l;function wo(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ie)}function Eo(e){return e==e&&!ts(e)}function To(e,t){return function(n){return null!=n&&n[e]===t&&(t!==r||e in Te(n))}}function So(e,t,n){return t=_n(t===r?e.length-1:t,0),function(){for(var r=arguments,o=-1,a=_n(r.length-t,0),s=i(a);++o<a;)s[o]=r[t+o];o=-1;for(var l=i(t+1);++o<t;)l[o]=r[o];return l[t]=n(s),Et(e,this,l)}}function Ao(e,t){return t.length<2?e:wi(e,tr(t,0,-1))}function Co(e,t){for(var n=e.length,i=yn(t.length,n),o=Cr(e);i--;){var a=t[i];e[i]=_o(a,n)?o[a]:r}return e}function ko(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Mo=zo(Ji),Io=ut||function(e,t){return ht.setTimeout(e,t)},Po=zo(Qi);
vendor: 4,845 bytes, line 2
2function Do(e,t,n){var i=t+"";return Po(e,function(e,t){var n=t.length;if(!n)return e;var i=n-1;return t[i]=(n>1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(oe,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return St(p,(function(n){var i="_."+n[0];t&n[1]&&!Mt(e,i)&&e.push(i)})),e.sort()}(function(e){var t=e.match(ae);return t?t[1].split(se):[]}(i),n)))}function zo(e){var t=0,n=0;return function(){var i=vn(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Lo(e,t){var n=-1,i=e.length,o=i-1;for(t=t===r?i:t;++n<t;){var a=Wi(n,o),s=e[a];e[a]=e[n],e[n]=s}return e.length=t,e}var Oo,Ro,Bo=(Oo=Oa((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,n,i,r){t.push(i?r.replace(ue,"$1"):n||e)})),t}),(function(e){return 500===Ro.size&&Ro.clear(),e})),Ro=Oo.cache,Oo);function Fo(e){if("string"==typeof e||cs(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function No(e){if(null!=e){try{return De.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function jo(e){if(e instanceof Gn)return e.clone();var t=new Vn(e.__wrapped__,e.__chain__);return t.__actions__=Cr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Uo=Xi((function(e,t){return Xa(e)?ui(e,gi(t,1,Xa,!0)):[]})),Vo=Xi((function(e,t){var n=Ko(t);return Xa(n)&&(n=r),Xa(e)?ui(e,gi(t,1,Xa,!0),ao(n,2)):[]})),Go=Xi((function(e,t){var n=Ko(t);return Xa(n)&&(n=r),Xa(e)?ui(e,gi(t,1,Xa,!0),r,n):[]}));function qo(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:ms(n);return r<0&&(r=_n(i+r,0)),Ft(e,ao(t,3),r)}function $o(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return n!==r&&(o=ms(n),o=n<0?_n(i+o,0):yn(o,i-1)),Ft(e,ao(t,3),o,!0)}function Wo(e){return null!=e&&e.length?gi(e,1):[]}function Zo(e){return e&&e.length?e[0]:r}var Xo=Xi((function(e){var t=Pt(e,mr);return t.length&&t[0]===e[0]?ki(t):[]})),Ho=Xi((function(e){var t=Ko(e),n=Pt(e,mr);return t===Ko(n)?t=r:n.pop(),n.length&&n[0]===e[0]?ki(n,ao(t,2)):[]})),Yo=Xi((function(e){var t=Ko(e),n=Pt(e,mr);return(t="function"==typeof t?t:r)&&n.pop(),n.length&&n[0]===e[0]?ki(n,r,t):[]}));function Ko(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Jo=Xi(Qo);function Qo(e,t){return e&&e.length&&t&&t.length?qi(e,t):e}var ea=eo((function(e,t){var n=null==e?0:e.length,i=oi(e,t);return $i(e,Pt(t,(function(e){return _o(e,n)?+e:e})).sort(Tr)),i}));function ta(e){return null==e?e:wn.call(e)}var na=Xi((function(e){return lr(gi(e,1,Xa,!0))})),ia=Xi((function(e){var t=Ko(e);return Xa(t)&&(t=r),lr(gi(e,1,Xa,!0),ao(t,2))})),ra=Xi((function(e){var t=Ko(e);return t="function"==typeof t?t:r,lr(gi(e,1,Xa,!0),r,t)}));function oa(e){if(!e||!e.length)return[];var t=0;return e=kt(e,(function(e){if(Xa(e))return t=_n(e.length,t),!0})),Zt(t,(function(t){return Pt(e,Gt(t))}))}function aa(e,t){if(!e||!e.length)return[];var n=oa(e);return null==t?n:Pt(n,(function(e){return Et(t,r,e)}))}var sa=Xi((function(e,t){return Xa(e)?ui(e,t):[]})),la=Xi((function(e){return fr(kt(e,Xa))})),ca=Xi((function(e){var t=Ko(e);return Xa(t)&&(t=r),fr(kt(e,Xa),ao(t,2))})),ua=Xi((function(e){var t=Ko(e);return t="function"==typeof t?t:r,fr(kt(e,Xa),r,t)})),ha=Xi(oa),da=Xi((function(e){var t=e.length,n=t>1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,aa(e,n)}));function fa(e){var t=Nn(e);return t.__chain__=!0,t}function pa(e,t){return t(e)}var ma=eo((function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,o=function(t){return oi(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Gn&&_o(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:pa,args:[o],thisArg:r}),new Vn(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(o)})),ga=Mr((function(e,t,n){ze.call(e,n)?++e[n]:ri(e,n,1)})),_a=Rr(qo),ya=Rr($o);function va(e,t){return($a(e)?St:hi)(e,ao(t,3))}function xa(e,t){return($a(e)?At:di)(e,ao(t,3))}var ba=Mr((function(e,t,n){ze.call(e,n)?e[n].push(t):ri(e,n,[t])})),wa=Xi((function(e,t,n){var r=-1,o="function"==typeof t,a=Za(e)?i(e.length):[];return hi(e,(function(e){a[++r]=o?Et(t,e,n):Mi(e,t,n)})),a})),Ea=Mr((function(e,t,n){ri(e,n,t)}));function Ta(e,t){return($a(e)?Pt:Bi)(e,ao(t,3))}var Sa=Mr((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]})),Aa=Xi((function(e,t){if(null==e)return[];var n=t.length;return n>1&&yo(e,t[0],t[1])?t=[]:n>2&&yo(t[0],t[1],t[2])&&(t=[t[0]]),Vi(e,gi(t,1),[])})),Ca=ct||function(){return ht.Date.now()};function ka(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,Hr(e,c,r,r,r,r,t)}function Ma(e,t){var n;if("function"!=typeof t)throw new Ce(o);return e=ms(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var Ia=Xi((function(e,t,n){var i=1;if(n.length){var r=ln(n,oo(Ia));i|=l}return Hr(e,i,t,n,r)})),Pa=Xi((function(e,t,n){var i=3;if(n.length){var r=ln(n,oo(Pa));i|=l}return Hr(t,i,e,n,r)}));
vendor: 26,914 bytes, line 2
2function Da(e,t,n){var i,a,s,l,c,u,h=0,d=!1,f=!1,p=!0;if("function"!=typeof e)throw new Ce(o);function m(t){var n=i,o=a;return i=a=r,h=t,l=e.apply(o,n)}function g(e){return h=e,c=Io(y,t),d?m(e):l}function _(e){var n=e-u;return u===r||n>=t||n<0||f&&e-h>=s}function y(){var e=Ca();if(_(e))return v(e);c=Io(y,function(e){var n=t-(e-u);return f?yn(n,s-(e-h)):n}(e))}function v(e){return c=r,p&&i?m(e):(i=a=r,l)}function x(){var e=Ca(),n=_(e);if(i=arguments,a=this,u=e,n){if(c===r)return g(u);if(f)return xr(c),c=Io(y,t),m(u)}return c===r&&(c=Io(y,t)),l}return t=_s(t)||0,ts(n)&&(d=!!n.leading,s=(f="maxWait"in n)?_n(_s(n.maxWait)||0,t):s,p="trailing"in n?!!n.trailing:p),x.cancel=function(){c!==r&&xr(c),h=0,i=u=a=c=r},x.flush=function(){return c===r?l:v(Ca())},x}var za=Xi((function(e,t){return ci(e,1,t)})),La=Xi((function(e,t,n){return ci(e,_s(t)||0,n)}));function Oa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Ce(o);var n=function(){var i=arguments,r=t?t.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var a=e.apply(this,i);return n.cache=o.set(r,a)||o,a};return n.cache=new(Oa.Cache||Wn),n}function Ra(e){if("function"!=typeof e)throw new Ce(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Oa.Cache=Wn;var Ba=yr((function(e,t){var n=(t=1==t.length&&$a(t[0])?Pt(t[0],Ht(ao())):Pt(gi(t,1),Ht(ao()))).length;return Xi((function(i){for(var r=-1,o=yn(i.length,n);++r<o;)i[r]=t[r].call(this,i[r]);return Et(e,this,i)}))})),Fa=Xi((function(e,t){var n=ln(t,oo(Fa));return Hr(e,l,r,t,n)})),Na=Xi((function(e,t){var n=ln(t,oo(Na));return Hr(e,64,r,t,n)})),ja=eo((function(e,t){return Hr(e,256,r,r,r,t)}));function Ua(e,t){return e===t||e!=e&&t!=t}var Va=qr(Si),Ga=qr((function(e,t){return e>=t})),qa=Ii(function(){return arguments}())?Ii:function(e){return ns(e)&&ze.call(e,"callee")&&!We.call(e,"callee")},$a=i.isArray,Wa=_t?Ht(_t):function(e){return ns(e)&&Ti(e)==P};function Za(e){return null!=e&&es(e.length)&&!Ja(e)}function Xa(e){return ns(e)&&Za(e)}var Ha=gt||_l,Ya=yt?Ht(yt):function(e){return ns(e)&&Ti(e)==y};function Ka(e){if(!ns(e))return!1;var t=Ti(e);return t==v||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!os(e)}function Ja(e){if(!ts(e))return!1;var t=Ti(e);return t==x||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qa(e){return"number"==typeof e&&e==ms(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=h}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ns(e){return null!=e&&"object"==typeof e}var is=vt?Ht(vt):function(e){return ns(e)&&fo(e)==w};function rs(e){return"number"==typeof e||ns(e)&&Ti(e)==E}function os(e){if(!ns(e)||Ti(e)!=T)return!1;var t=qe(e);if(null===t)return!0;var n=ze.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&De.call(n)==Be}var as=xt?Ht(xt):function(e){return ns(e)&&Ti(e)==A},ss=bt?Ht(bt):function(e){return ns(e)&&fo(e)==C};function ls(e){return"string"==typeof e||!$a(e)&&ns(e)&&Ti(e)==k}function cs(e){return"symbol"==typeof e||ns(e)&&Ti(e)==M}var us=wt?Ht(wt):function(e){return ns(e)&&es(e.length)&&!!rt[Ti(e)]},hs=qr(Ri),ds=qr((function(e,t){return e<=t}));function fs(e){if(!e)return[];if(Za(e))return ls(e)?dn(e):Cr(e);if(He&&e[He])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[He]());var t=fo(e);return(t==w?an:t==C?cn:Us)(e)}function ps(e){return e?(e=_s(e))===u||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ms(e){var t=ps(e),n=t%1;return t==t?n?t-n:t:0}function gs(e){return e?ai(ms(e),0,f):0}function _s(e){if("number"==typeof e)return e;if(cs(e))return d;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var n=pe.test(e);return n||ge.test(e)?lt(e.slice(2),n?2:8):fe.test(e)?d:+e}function ys(e){return kr(e,zs(e))}function vs(e){return null==e?"":sr(e)}var xs=Ir((function(e,t){if(wo(t)||Za(t))kr(t,Ds(t),e);else for(var n in t)ze.call(t,n)&&ei(e,n,t[n])})),bs=Ir((function(e,t){kr(t,zs(t),e)})),ws=Ir((function(e,t,n,i){kr(t,zs(t),e,i)})),Es=Ir((function(e,t,n,i){kr(t,Ds(t),e,i)})),Ts=eo(oi),Ss=Xi((function(e,t){e=Te(e);var n=-1,i=t.length,o=i>2?t[2]:r;for(o&&yo(t[0],t[1],o)&&(i=1);++n<i;)for(var a=t[n],s=zs(a),l=-1,c=s.length;++l<c;){var u=s[l],h=e[u];(h===r||Ua(h,Ie[u])&&!ze.call(e,u))&&(e[u]=a[u])}return e})),As=Xi((function(e){return e.push(r,Kr),Et(Os,r,e)}));function Cs(e,t,n){var i=null==e?r:wi(e,t);return i===r?n:i}function ks(e,t){return null!=e&&po(e,t,Ci)}var Ms=Nr((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Re.call(t)),e[t]=n}),tl(rl)),Is=Nr((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Re.call(t)),ze.call(e,t)?e[t].push(n):e[t]=[n]}),ao),Ps=Xi(Mi);function Ds(e){return Za(e)?Hn(e):Oi(e)}function zs(e){return Za(e)?Hn(e,!0):function(e){if(!ts(e))return function(e){var t=[];if(null!=e)for(var n in Te(e))t.push(n);return t}(e);var t=wo(e),n=[];for(var i in e)("constructor"!=i||!t&&ze.call(e,i))&&n.push(i);return n}(e)}var Ls=Ir((function(e,t,n){ji(e,t,n)})),Os=Ir((function(e,t,n,i){ji(e,t,n,i)})),Rs=eo((function(e,t){var n={};if(null==e)return n;var i=!1;t=Pt(t,(function(t){return t=_r(t,e),i||(i=t.length>1),t})),kr(e,no(e),n),i&&(n=si(n,7,Jr));for(var r=t.length;r--;)cr(n,t[r]);return n})),Bs=eo((function(e,t){return null==e?{}:function(e,t){return Gi(e,t,(function(t,n){return ks(e,n)}))}(e,t)}));function Fs(e,t){if(null==e)return{};var n=Pt(no(e),(function(e){return[e]}));return t=ao(t),Gi(e,n,(function(e,n){return t(e,n[0])}))}var Ns=Xr(Ds),js=Xr(zs);function Us(e){return null==e?[]:Yt(e,Ds(e))}var Vs=Lr((function(e,t,n){return t=t.toLowerCase(),e+(n?Gs(t):t)}));function Gs(e){return Ks(vs(e).toLowerCase())}function qs(e){return(e=vs(e))&&e.replace(ye,tn).replace(Ke,"")}var $s=Lr((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),Ws=Lr((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),Zs=zr("toLowerCase"),Xs=Lr((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()})),Hs=Lr((function(e,t,n){return e+(n?" ":"")+Ks(t)})),Ys=Lr((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Ks=zr("toUpperCase");function Js(e,t,n){return e=vs(e),(t=n?r:t)===r?function(e){return tt.test(e)}(e)?function(e){return e.match(Qe)||[]}(e):function(e){return e.match(le)||[]}(e):e.match(t)||[]}var Qs=Xi((function(e,t){try{return Et(e,r,t)}catch(e){return Ka(e)?e:new be(e)}})),el=eo((function(e,t){return St(t,(function(t){t=Fo(t),ri(e,t,Ia(e[t],e))})),e}));function tl(e){return function(){return e}}var nl=Br(),il=Br(!0);function rl(e){return e}function ol(e){return Li("function"==typeof e?e:si(e,1))}var al=Xi((function(e,t){return function(n){return Mi(n,e,t)}})),sl=Xi((function(e,t){return function(n){return Mi(e,n,t)}}));function ll(e,t,n){var i=Ds(t),r=bi(t,i);null!=n||ts(t)&&(r.length||!i.length)||(n=t,t=e,e=this,r=bi(t,Ds(t)));var o=!(ts(n)&&"chain"in n&&!n.chain),a=Ja(e);return St(r,(function(n){var i=t[n];e[n]=i,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),r=n.__actions__=Cr(this.__actions__);return r.push({func:i,args:arguments,thisArg:e}),n.__chain__=t,n}return i.apply(e,Dt([this.value()],arguments))})})),e}function cl(){}var ul=Ur(Pt),hl=Ur(Ct),dl=Ur(Ot);function fl(e){return vo(e)?Gt(Fo(e)):function(e){return function(t){return wi(t,e)}}(e)}var pl=Gr(),ml=Gr(!0);function gl(){return[]}function _l(){return!1}var yl,vl=jr((function(e,t){return e+t}),0),xl=Wr("ceil"),bl=jr((function(e,t){return e/t}),1),wl=Wr("floor"),El=jr((function(e,t){return e*t}),1),Tl=Wr("round"),Sl=jr((function(e,t){return e-t}),0);return Nn.after=function(e,t){if("function"!=typeof t)throw new Ce(o);return e=ms(e),function(){if(--e<1)return t.apply(this,arguments)}},Nn.ary=ka,Nn.assign=xs,Nn.assignIn=bs,Nn.assignInWith=ws,Nn.assignWith=Es,Nn.at=Ts,Nn.before=Ma,Nn.bind=Ia,Nn.bindAll=el,Nn.bindKey=Pa,Nn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return $a(e)?e:[e]},Nn.chain=fa,Nn.chunk=function(e,t,n){t=(n?yo(e,t,n):t===r)?1:_n(ms(t),0);var o=null==e?0:e.length;if(!o||t<1)return[];for(var a=0,s=0,l=i(dt(o/t));a<o;)l[s++]=tr(e,a,a+=t);return l},Nn.compact=function(e){for(var t=-1,n=null==e?0:e.length,i=0,r=[];++t<n;){var o=e[t];o&&(r[i++]=o)}return r},Nn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=i(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Dt($a(n)?Cr(n):[n],gi(t,1))},Nn.cond=function(e){var t=null==e?0:e.length,n=ao();return e=t?Pt(e,(function(e){if("function"!=typeof e[1])throw new Ce(o);return[n(e[0]),e[1]]})):[],Xi((function(n){for(var i=-1;++i<t;){var r=e[i];if(Et(r[0],this,n))return Et(r[1],this,n)}}))},Nn.conforms=function(e){return function(e){var t=Ds(e);return function(n){return li(n,e,t)}}(si(e,1))},Nn.constant=tl,Nn.countBy=ga,Nn.create=function(e,t){var n=jn(e);return null==t?n:ii(n,t)},Nn.curry=function e(t,n,i){var o=Hr(t,8,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Nn.curryRight=function e(t,n,i){var o=Hr(t,16,r,r,r,r,r,n=i?r:n);return o.placeholder=e.placeholder,o},Nn.debounce=Da,Nn.defaults=Ss,Nn.defaultsDeep=As,Nn.defer=za,Nn.delay=La,Nn.difference=Uo,Nn.differenceBy=Vo,Nn.differenceWith=Go,Nn.drop=function(e,t,n){var i=null==e?0:e.length;return i?tr(e,(t=n||t===r?1:ms(t))<0?0:t,i):[]},Nn.dropRight=function(e,t,n){var i=null==e?0:e.length;return i?tr(e,0,(t=i-(t=n||t===r?1:ms(t)))<0?0:t):[]},Nn.dropRightWhile=function(e,t){return e&&e.length?hr(e,ao(t,3),!0,!0):[]},Nn.dropWhile=function(e,t){return e&&e.length?hr(e,ao(t,3),!0):[]},Nn.fill=function(e,t,n,i){var o=null==e?0:e.length;return o?(n&&"number"!=typeof n&&yo(e,t,n)&&(n=0,i=o),function(e,t,n,i){var o=e.length;for((n=ms(n))<0&&(n=-n>o?0:o+n),(i=i===r||i>o?o:ms(i))<0&&(i+=o),i=n>i?0:gs(i);n<i;)e[n++]=t;return e}(e,t,n,i)):[]},Nn.filter=function(e,t){return($a(e)?kt:mi)(e,ao(t,3))},Nn.flatMap=function(e,t){return gi(Ta(e,t),1)},Nn.flatMapDeep=function(e,t){return gi(Ta(e,t),u)},Nn.flatMapDepth=function(e,t,n){return n=n===r?1:ms(n),gi(Ta(e,t),n)},Nn.flatten=Wo,Nn.flattenDeep=function(e){return null!=e&&e.length?gi(e,u):[]},Nn.flattenDepth=function(e,t){return null!=e&&e.length?gi(e,t=t===r?1:ms(t)):[]},Nn.flip=function(e){return Hr(e,512)},Nn.flow=nl,Nn.flowRight=il,Nn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,i={};++t<n;){var r=e[t];i[r[0]]=r[1]}return i},Nn.functions=function(e){return null==e?[]:bi(e,Ds(e))},Nn.functionsIn=function(e){return null==e?[]:bi(e,zs(e))},Nn.groupBy=ba,Nn.initial=function(e){return null!=e&&e.length?tr(e,0,-1):[]},Nn.intersection=Xo,Nn.intersectionBy=Ho,Nn.intersectionWith=Yo,Nn.invert=Ms,Nn.invertBy=Is,Nn.invokeMap=wa,Nn.iteratee=ol,Nn.keyBy=Ea,Nn.keys=Ds,Nn.keysIn=zs,Nn.map=Ta,Nn.mapKeys=function(e,t){var n={};return t=ao(t,3),vi(e,(function(e,i,r){ri(n,t(e,i,r),e)})),n},Nn.mapValues=function(e,t){var n={};return t=ao(t,3),vi(e,(function(e,i,r){ri(n,i,t(e,i,r))})),n},Nn.matches=function(e){return Fi(si(e,1))},Nn.matchesProperty=function(e,t){return Ni(e,si(t,1))},Nn.memoize=Oa,Nn.merge=Ls,Nn.mergeWith=Os,Nn.method=al,Nn.methodOf=sl,Nn.mixin=ll,Nn.negate=Ra,Nn.nthArg=function(e){return e=ms(e),Xi((function(t){return Ui(t,e)}))},Nn.omit=Rs,Nn.omitBy=function(e,t){return Fs(e,Ra(ao(t)))},Nn.once=function(e){return Ma(2,e)},Nn.orderBy=function(e,t,n,i){return null==e?[]:($a(t)||(t=null==t?[]:[t]),$a(n=i?r:n)||(n=null==n?[]:[n]),Vi(e,t,n))},Nn.over=ul,Nn.overArgs=Ba,Nn.overEvery=hl,Nn.overSome=dl,Nn.partial=Fa,Nn.partialRight=Na,Nn.partition=Sa,Nn.pick=Bs,Nn.pickBy=Fs,Nn.property=fl,Nn.propertyOf=function(e){return function(t){return null==e?r:wi(e,t)}},Nn.pull=Jo,Nn.pullAll=Qo,Nn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?qi(e,t,ao(n,2)):e},Nn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?qi(e,t,r,n):e},Nn.pullAt=ea,Nn.range=pl,Nn.rangeRight=ml,Nn.rearg=ja,Nn.reject=function(e,t){return($a(e)?kt:mi)(e,Ra(ao(t,3)))},Nn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var i=-1,r=[],o=e.length;for(t=ao(t,3);++i<o;){var a=e[i];t(a,i,e)&&(n.push(a),r.push(i))}return $i(e,r),n},Nn.rest=function(e,t){if("function"!=typeof e)throw new Ce(o);return Xi(e,t=t===r?t:ms(t))},Nn.reverse=ta,Nn.sampleSize=function(e,t,n){return t=(n?yo(e,t,n):t===r)?1:ms(t),($a(e)?Kn:Yi)(e,t)},Nn.set=function(e,t,n){return null==e?e:Ki(e,t,n)},Nn.setWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:Ki(e,t,n,i)},Nn.shuffle=function(e){return($a(e)?Jn:er)(e)},Nn.slice=function(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&yo(e,t,n)?(t=0,n=i):(t=null==t?0:ms(t),n=n===r?i:ms(n)),tr(e,t,n)):[]},Nn.sortBy=Aa,Nn.sortedUniq=function(e){return e&&e.length?or(e):[]},Nn.sortedUniqBy=function(e,t){return e&&e.length?or(e,ao(t,2)):[]},Nn.split=function(e,t,n){return n&&"number"!=typeof n&&yo(e,t,n)&&(t=n=r),(n=n===r?f:n>>>0)?(e=vs(e))&&("string"==typeof t||null!=t&&!as(t))&&!(t=sr(t))&&on(e)?vr(dn(e),0,n):e.split(t,n):[]},Nn.spread=function(e,t){if("function"!=typeof e)throw new Ce(o);return t=null==t?0:_n(ms(t),0),Xi((function(n){var i=n[t],r=vr(n,0,t);return i&&Dt(r,i),Et(e,this,r)}))},Nn.tail=function(e){var t=null==e?0:e.length;return t?tr(e,1,t):[]},Nn.take=function(e,t,n){return e&&e.length?tr(e,0,(t=n||t===r?1:ms(t))<0?0:t):[]},Nn.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?tr(e,(t=i-(t=n||t===r?1:ms(t)))<0?0:t,i):[]},Nn.takeRightWhile=function(e,t){return e&&e.length?hr(e,ao(t,3),!1,!0):[]},Nn.takeWhile=function(e,t){return e&&e.length?hr(e,ao(t,3)):[]},Nn.tap=function(e,t){return t(e),e},Nn.throttle=function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new Ce(o);return ts(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Da(e,t,{leading:i,maxWait:t,trailing:r})},Nn.thru=pa,Nn.toArray=fs,Nn.toPairs=Ns,Nn.toPairsIn=js,Nn.toPath=function(e){return $a(e)?Pt(e,Fo):cs(e)?[e]:Cr(Bo(vs(e)))},Nn.toPlainObject=ys,Nn.transform=function(e,t,n){var i=$a(e),r=i||Ha(e)||us(e);if(t=ao(t,4),null==n){var o=e&&e.constructor;n=r?i?new o:[]:ts(e)&&Ja(o)?jn(qe(e)):{}}return(r?St:vi)(e,(function(e,i,r){return t(n,e,i,r)})),n},Nn.unary=function(e){return ka(e,1)},Nn.union=na,Nn.unionBy=ia,Nn.unionWith=ra,Nn.uniq=function(e){return e&&e.length?lr(e):[]},Nn.uniqBy=function(e,t){return e&&e.length?lr(e,ao(t,2)):[]},Nn.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?lr(e,r,t):[]},Nn.unset=function(e,t){return null==e||cr(e,t)},Nn.unzip=oa,Nn.unzipWith=aa,Nn.update=function(e,t,n){return null==e?e:ur(e,t,gr(n))},Nn.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:ur(e,t,gr(n),i)},Nn.values=Us,Nn.valuesIn=function(e){return null==e?[]:Yt(e,zs(e))},Nn.without=sa,Nn.words=Js,Nn.wrap=function(e,t){return Fa(gr(t),e)},Nn.xor=la,Nn.xorBy=ca,Nn.xorWith=ua,Nn.zip=ha,Nn.zipObject=function(e,t){return pr(e||[],t||[],ei)},Nn.zipObjectDeep=function(e,t){return pr(e||[],t||[],Ki)},Nn.zipWith=da,Nn.entries=Ns,Nn.entriesIn=js,Nn.extend=bs,Nn.extendWith=ws,ll(Nn,Nn),Nn.add=vl,Nn.attempt=Qs,Nn.camelCase=Vs,Nn.capitalize=Gs,Nn.ceil=xl,Nn.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=_s(n))==n?n:0),t!==r&&(t=(t=_s(t))==t?t:0),ai(_s(e),t,n)},Nn.clone=function(e){return si(e,4)},Nn.cloneDeep=function(e){return si(e,5)},Nn.cloneDeepWith=function(e,t){return si(e,5,t="function"==typeof t?t:r)},Nn.cloneWith=function(e,t){return si(e,4,t="function"==typeof t?t:r)},Nn.conformsTo=function(e,t){return null==t||li(e,t,Ds(t))},Nn.deburr=qs,Nn.defaultTo=function(e,t){return null==e||e!=e?t:e},Nn.divide=bl,Nn.endsWith=function(e,t,n){e=vs(e),t=sr(t);var i=e.length,o=n=n===r?i:ai(ms(n),0,i);return(n-=t.length)>=0&&e.slice(n,o)==t},Nn.eq=Ua,Nn.escape=function(e){return(e=vs(e))&&X.test(e)?e.replace(W,nn):e},Nn.escapeRegExp=function(e){return(e=vs(e))&&ne.test(e)?e.replace(te,"\\$&"):e},Nn.every=function(e,t,n){var i=$a(e)?Ct:fi;return n&&yo(e,t,n)&&(t=r),i(e,ao(t,3))},Nn.find=_a,Nn.findIndex=qo,Nn.findKey=function(e,t){return Bt(e,ao(t,3),vi)},Nn.findLast=ya,Nn.findLastIndex=$o,Nn.findLastKey=function(e,t){return Bt(e,ao(t,3),xi)},Nn.floor=wl,Nn.forEach=va,Nn.forEachRight=xa,Nn.forIn=function(e,t){return null==e?e:_i(e,ao(t,3),zs)},Nn.forInRight=function(e,t){return null==e?e:yi(e,ao(t,3),zs)},Nn.forOwn=function(e,t){return e&&vi(e,ao(t,3))},Nn.forOwnRight=function(e,t){return e&&xi(e,ao(t,3))},Nn.get=Cs,Nn.gt=Va,Nn.gte=Ga,Nn.has=function(e,t){return null!=e&&po(e,t,Ai)},Nn.hasIn=ks,Nn.head=Zo,Nn.identity=rl,Nn.includes=function(e,t,n,i){e=Za(e)?e:Us(e),n=n&&!i?ms(n):0;var r=e.length;return n<0&&(n=_n(r+n,0)),ls(e)?n<=r&&e.indexOf(t,n)>-1:!!r&&Nt(e,t,n)>-1},Nn.indexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var r=null==n?0:ms(n);return r<0&&(r=_n(i+r,0)),Nt(e,t,r)},Nn.inRange=function(e,t,n){return t=ps(t),n===r?(n=t,t=0):n=ps(n),function(e,t,n){return e>=yn(t,n)&&e<_n(t,n)}(e=_s(e),t,n)},Nn.invoke=Ps,Nn.isArguments=qa,Nn.isArray=$a,Nn.isArrayBuffer=Wa,Nn.isArrayLike=Za,Nn.isArrayLikeObject=Xa,Nn.isBoolean=function(e){return!0===e||!1===e||ns(e)&&Ti(e)==_},Nn.isBuffer=Ha,Nn.isDate=Ya,Nn.isElement=function(e){return ns(e)&&1===e.nodeType&&!os(e)},Nn.isEmpty=function(e){if(null==e)return!0;if(Za(e)&&($a(e)||"string"==typeof e||"function"==typeof e.splice||Ha(e)||us(e)||qa(e)))return!e.length;var t=fo(e);if(t==w||t==C)return!e.size;if(wo(e))return!Oi(e).length;for(var n in e)if(ze.call(e,n))return!1;return!0},Nn.isEqual=function(e,t){return Pi(e,t)},Nn.isEqualWith=function(e,t,n){var i=(n="function"==typeof n?n:r)?n(e,t):r;return i===r?Pi(e,t,r,n):!!i},Nn.isError=Ka,Nn.isFinite=function(e){return"number"==typeof e&&Rt(e)},Nn.isFunction=Ja,Nn.isInteger=Qa,Nn.isLength=es,Nn.isMap=is,Nn.isMatch=function(e,t){return e===t||Di(e,t,lo(t))},Nn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:r,Di(e,t,lo(t),n)},Nn.isNaN=function(e){return rs(e)&&e!=+e},Nn.isNative=function(e){if(bo(e))throw new be("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return zi(e)},Nn.isNil=function(e){return null==e},Nn.isNull=function(e){return null===e},Nn.isNumber=rs,Nn.isObject=ts,Nn.isObjectLike=ns,Nn.isPlainObject=os,Nn.isRegExp=as,Nn.isSafeInteger=function(e){return Qa(e)&&e>=-9007199254740991&&e<=h},Nn.isSet=ss,Nn.isString=ls,Nn.isSymbol=cs,Nn.isTypedArray=us,Nn.isUndefined=function(e){return e===r},Nn.isWeakMap=function(e){return ns(e)&&fo(e)==I},Nn.isWeakSet=function(e){return ns(e)&&"[object WeakSet]"==Ti(e)},Nn.join=function(e,t){return null==e?"":qt.call(e,t)},Nn.kebabCase=$s,Nn.last=Ko,Nn.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ms(n))<0?_n(i+o,0):yn(o,i-1)),t==t?function(e,t,n){for(var i=n+1;i--;)if(e[i]===t)return i;return i}(e,t,o):Ft(e,Ut,o,!0)},Nn.lowerCase=Ws,Nn.lowerFirst=Zs,Nn.lt=hs,Nn.lte=ds,Nn.max=function(e){return e&&e.length?pi(e,rl,Si):r},Nn.maxBy=function(e,t){return e&&e.length?pi(e,ao(t,2),Si):r},Nn.mean=function(e){return Vt(e,rl)},Nn.meanBy=function(e,t){return Vt(e,ao(t,2))},Nn.min=function(e){return e&&e.length?pi(e,rl,Ri):r},Nn.minBy=function(e,t){return e&&e.length?pi(e,ao(t,2),Ri):r},Nn.stubArray=gl,Nn.stubFalse=_l,Nn.stubObject=function(){return{}},Nn.stubString=function(){return""},Nn.stubTrue=function(){return!0},Nn.multiply=El,Nn.nth=function(e,t){return e&&e.length?Ui(e,ms(t)):r},Nn.noConflict=function(){return ht._===this&&(ht._=Fe),this},Nn.noop=cl,Nn.now=Ca,Nn.pad=function(e,t,n){e=vs(e);var i=(t=ms(t))?hn(e):0;if(!t||i>=t)return e;var r=(t-i)/2;return Vr(ft(r),n)+e+Vr(dt(r),n)},Nn.padEnd=function(e,t,n){e=vs(e);var i=(t=ms(t))?hn(e):0;return t&&i<t?e+Vr(t-i,n):e},Nn.padStart=function(e,t,n){e=vs(e);var i=(t=ms(t))?hn(e):0;return t&&i<t?Vr(t-i,n)+e:e},Nn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),xn(vs(e).replace(ie,""),t||0)},Nn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&yo(e,t,n)&&(t=n=r),n===r&&("boolean"==typeof t?(n=t,t=r):"boolean"==typeof e&&(n=e,e=r)),e===r&&t===r?(e=0,t=1):(e=ps(e),t===r?(t=e,e=0):t=ps(t)),e>t){var i=e;e=t,t=i}if(n||e%1||t%1){var o=bn();return yn(e+o*(t-e+st("1e-"+((o+"").length-1))),t)}return Wi(e,t)},Nn.reduce=function(e,t,n){var i=$a(e)?zt:$t,r=arguments.length<3;return i(e,ao(t,4),n,r,hi)},Nn.reduceRight=function(e,t,n){var i=$a(e)?Lt:$t,r=arguments.length<3;return i(e,ao(t,4),n,r,di)},Nn.repeat=function(e,t,n){return t=(n?yo(e,t,n):t===r)?1:ms(t),Zi(vs(e),t)},Nn.replace=function(){var e=arguments,t=vs(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Nn.result=function(e,t,n){var i=-1,o=(t=_r(t,e)).length;for(o||(o=1,e=r);++i<o;){var a=null==e?r:e[Fo(t[i])];a===r&&(i=o,a=n),e=Ja(a)?a.call(e):a}return e},Nn.round=Tl,Nn.runInContext=e,Nn.sample=function(e){return($a(e)?Yn:Hi)(e)},Nn.size=function(e){if(null==e)return 0;if(Za(e))return ls(e)?hn(e):e.length;var t=fo(e);return t==w||t==C?e.size:Oi(e).length},Nn.snakeCase=Xs,Nn.some=function(e,t,n){var i=$a(e)?Ot:nr;return n&&yo(e,t,n)&&(t=r),i(e,ao(t,3))},Nn.sortedIndex=function(e,t){return ir(e,t)},Nn.sortedIndexBy=function(e,t,n){return rr(e,t,ao(n,2))},Nn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var i=ir(e,t);if(i<n&&Ua(e[i],t))return i}return-1},Nn.sortedLastIndex=function(e,t){return ir(e,t,!0)},Nn.sortedLastIndexBy=function(e,t,n){return rr(e,t,ao(n,2),!0)},Nn.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var n=ir(e,t,!0)-1;if(Ua(e[n],t))return n}return-1},Nn.startCase=Hs,Nn.startsWith=function(e,t,n){return e=vs(e),n=null==n?0:ai(ms(n),0,e.length),t=sr(t),e.slice(n,n+t.length)==t},Nn.subtract=Sl,Nn.sum=function(e){return e&&e.length?Wt(e,rl):0},Nn.sumBy=function(e,t){return e&&e.length?Wt(e,ao(t,2)):0},Nn.template=function(e,t,n){var i=Nn.templateSettings;n&&yo(e,t,n)&&(t=r),e=vs(e),t=ws({},t,i,Yr);var o,a,s=ws({},t.imports,i.imports,Yr),l=Ds(s),c=Yt(s,l),u=0,h=t.interpolate||ve,d="__p += '",f=Se((t.escape||ve).source+"|"+h.source+"|"+(h===K?he:ve).source+"|"+(t.evaluate||ve).source+"|$","g"),p="//# sourceURL="+(ze.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++it+"]")+"\n";e.replace(f,(function(t,n,i,r,s,l){return i||(i=r),d+=e.slice(u,l).replace(xe,rn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),i&&(d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),u=l+t.length,t})),d+="';\n";var m=ze.call(t,"variable")&&t.variable;if(m){if(ce.test(m))throw new be("Invalid `variable` option passed into `_.template`")}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(V,""):d).replace(G,"$1").replace(q,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=Qs((function(){return we(l,p+"return "+d).apply(r,c)}));if(g.source=d,Ka(g))throw g;return g},Nn.times=function(e,t){if((e=ms(e))<1||e>h)return[];var n=f,i=yn(e,f);t=ao(t),e-=f;for(var r=Zt(i,t);++n<e;)t(n);return r},Nn.toFinite=ps,Nn.toInteger=ms,Nn.toLength=gs,Nn.toLower=function(e){return vs(e).toLowerCase()},Nn.toNumber=_s,Nn.toSafeInteger=function(e){return e?ai(ms(e),-9007199254740991,h):0===e?e:0},Nn.toString=vs,Nn.toUpper=function(e){return vs(e).toUpperCase()},Nn.trim=function(e,t,n){if((e=vs(e))&&(n||t===r))return Xt(e);if(!e||!(t=sr(t)))return e;var i=dn(e),o=dn(t);return vr(i,Jt(i,o),Qt(i,o)+1).join("")},Nn.trimEnd=function(e,t,n){if((e=vs(e))&&(n||t===r))return e.slice(0,fn(e)+1);if(!e||!(t=sr(t)))return e;var i=dn(e);return vr(i,0,Qt(i,dn(t))+1).join("")},Nn.trimStart=function(e,t,n){if((e=vs(e))&&(n||t===r))return e.replace(ie,"");if(!e||!(t=sr(t)))return e;var i=dn(e);return vr(i,Jt(i,dn(t))).join("")},Nn.truncate=function(e,t){var n=30,i="...";if(ts(t)){var o="separator"in t?t.separator:o;n="length"in t?ms(t.length):n,i="omission"in t?sr(t.omission):i}var a=(e=vs(e)).length;if(on(e)){var s=dn(e);a=s.length}if(n>=a)return e;var l=n-hn(i);if(l<1)return i;var c=s?vr(s,0,l).join(""):e.slice(0,l);if(o===r)return c+i;if(s&&(l+=c.length-l),as(o)){if(e.slice(l).search(o)){var u,h=c;for(o.global||(o=Se(o.source,vs(de.exec(o))+"g")),o.lastIndex=0;u=o.exec(h);)var d=u.index;c=c.slice(0,d===r?l:d)}}else if(e.indexOf(sr(o),l)!=l){var f=c.lastIndexOf(o);f>-1&&(c=c.slice(0,f))}return c+i},Nn.unescape=function(e){return(e=vs(e))&&Z.test(e)?e.replace($,pn):e},Nn.uniqueId=function(e){var t=++Le;return vs(e)+t},Nn.upperCase=Ys,Nn.upperFirst=Ks,Nn.each=va,Nn.eachRight=xa,Nn.first=Zo,ll(Nn,(yl={},vi(Nn,(function(e,t){ze.call(Nn.prototype,t)||(yl[t]=e)})),yl),{chain:!1}),Nn.VERSION="4.17.21",St(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Nn[e].placeholder=Nn})),St(["drop","take"],(function(e,t){Gn.prototype[e]=function(n){n=n===r?1:_n(ms(n),0);var i=this.__filtered__&&!t?new Gn(this):this.clone();return i.__filtered__?i.__takeCount__=yn(n,i.__takeCount__):i.__views__.push({size:yn(n,f),type:e+(i.__dir__<0?"Right":"")}),i},Gn.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),St(["filter","map","takeWhile"],(function(e,t){var n=t+1,i=1==n||3==n;Gn.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ao(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}})),St(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Gn.prototype[e]=function(){return this[n](1).value()[0]}})),St(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Gn.prototype[e]=function(){return this.__filtered__?new Gn(this):this[n](1)}})),Gn.prototype.compact=function(){return this.filter(rl)},Gn.prototype.find=function(e){return this.filter(e).head()},Gn.prototype.findLast=function(e){return this.reverse().find(e)},Gn.prototype.invokeMap=Xi((function(e,t){return"function"==typeof e?new Gn(this):this.map((function(n){return Mi(n,e,t)}))})),Gn.prototype.reject=function(e){return this.filter(Ra(ao(e)))},Gn.prototype.slice=function(e,t){e=ms(e);var n=this;return n.__filtered__&&(e>0||t<0)?new Gn(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=ms(t))<0?n.dropRight(-t):n.take(t-e)),n)},Gn.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gn.prototype.toArray=function(){return this.take(f)},vi(Gn.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=Nn[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(Nn.prototype[t]=function(){var t=this.__wrapped__,s=i?[1]:arguments,l=t instanceof Gn,c=s[0],u=l||$a(t),h=function(e){var t=o.apply(Nn,Dt([e],s));return i&&d?t[0]:t};u&&n&&"function"==typeof c&&1!=c.length&&(l=u=!1);var d=this.__chain__,f=!!this.__actions__.length,p=a&&!d,m=l&&!f;if(!a&&u){t=m?t:new Gn(this);var g=e.apply(t,s);return g.__actions__.push({func:pa,args:[h],thisArg:r}),new Vn(g,d)}return p&&m?e.apply(this,s):(g=this.thru(h),p?i?g.value()[0]:g.value():g)})}
2)),St(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ke[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);Nn.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var r=this.value();return t.apply($a(r)?r:[],e)}return this[n]((function(n){return t.apply($a(n)?n:[],e)}))}})),vi(Gn.prototype,(function(e,t){var n=Nn[t];if(n){var i=n.name+"";ze.call(In,i)||(In[i]=[]),In[i].push({name:t,func:n})}})),In[Fr(r,2).name]=[{name:"wrapper",func:r}],Gn.prototype.clone=function(){var e=new Gn(this.__wrapped__);return e.__actions__=Cr(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Cr(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Cr(this.__views__),e},Gn.prototype.reverse=function(){if(this.__filtered__){var e=new Gn(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gn.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=$a(e),i=t<0,r=n?e.length:0,o=function(e,t,n){for(var i=-1,r=n.length;++i<r;){var o=n[i],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=yn(t,e+a);break;case"takeRight":e=_n(e,t-a)}}return{start:e,end:t}}(0,r,this.__views__),a=o.start,s=o.end,l=s-a,c=i?s:a-1,u=this.__iteratees__,h=u.length,d=0,f=yn(l,this.__takeCount__);if(!n||!i&&r==l&&f==l)return dr(e,this.__actions__);var p=[];e:for(;l--&&d<f;){for(var m=-1,g=e[c+=t];++m<h;){var _=u[m],y=_.iteratee,v=_.type,x=y(g);if(2==v)g=x;else if(!x){if(1==v)continue e;break e}}p[d++]=g}return p},Nn.prototype.at=ma,Nn.prototype.chain=function(){return fa(this)},Nn.prototype.commit=function(){return new Vn(this.value(),this.__chain__)},Nn.prototype.next=function(){this.__values__===r&&(this.__values__=fs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},Nn.prototype.plant=function(e){for(var t,n=this;n instanceof Un;){var i=jo(n);i.__index__=0,i.__values__=r,t?o.__wrapped__=i:t=i;var o=i;n=n.__wrapped__}return o.__wrapped__=e,t},Nn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gn){var t=e;return this.__actions__.length&&(t=new Gn(this)),(t=t.reverse()).__actions__.push({func:pa,args:[ta],thisArg:r}),new Vn(t,this.__chain__)}return this.thru(ta)},Nn.prototype.toJSON=Nn.prototype.valueOf=Nn.prototype.value=function(){return dr(this.__wrapped__,this.__actions__)},Nn.prototype.first=Nn.prototype.head,He&&(Nn.prototype[He]=function(){return this}),Nn}();ht._=mn,(i=function(){return mn}.call(t,n,t,e))===r||(e.exports=i)}.call(this)},373:function(e){e.exports=function(){"use strict";var e,t,n;function i(i,r){if(e)if(t){var o="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",a={};e(a),n=r(a),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(n.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=r;else e=r}return i(0,(function(e){var t="undefined"!=typeof self?self:{},n="2.12.0";let i;const r={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==i){const e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{i=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):e}catch(t){i=e}}return i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},o={supported:!1,testSupport:function(e){!l&&s&&(c?u(e):a=e)}};
vendor: 8,969 bytes, line 2
2let a,s,l=!1,c=!1;function u(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,s),e.isContextLost())return;o.supported=!0}catch(e){}e.deleteTexture(t),l=!0}t.document&&(s=t.document.createElement("img"),s.onload=function(){a&&u(a),a=null,c=!0},s.onerror=function(){l=!0,a=null},s.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const h="01";var d=f;function f(e,t,n,i){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=n,this.p2y=i}f.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,i=0;i<8;i++){var r=this.sampleCurveX(n)-e;if(Math.abs(r)<t)return n;var o=this.sampleCurveDerivativeX(n);if(Math.abs(o)<1e-6)break;n-=r/o}var a=0,s=1;for(n=e,i=0;i<20&&(r=this.sampleCurveX(n),!(Math.abs(r-e)<t));i++)e>r?a=n:s=n,n=.5*(s-a)+a;return n},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var p=m;function m(e,t){this.x=e,this.y=t}m.prototype={clone:function(){return new m(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),n=Math.sin(e),i=n*this.x+t*this.y;return this.x=t*this.x-n*this.y,this.y=i,this},_rotateAround:function(e,t){var n=Math.cos(e),i=Math.sin(e),r=t.y+i*(this.x-t.x)+n*(this.y-t.y);return this.x=t.x+n*(this.x-t.x)-i*(this.y-t.y),this.y=r,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},m.convert=function(e){return e instanceof m?e:Array.isArray(e)?new m(e[0],e[1]):e};const g=Math.PI/180,_=180/Math.PI;function y(e){return e*g}function v(e){return e*_}const x=[[0,0],[1,0],[1,1],[0,1]];function b(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function w(e,t,n,i){const r=new d(e,t,n,i);return function(e){return r.solve(e)}}const E=w(.25,.1,.25,1);function T(e,t,n){return Math.min(n,Math.max(t,e))}function S(e,t,n){return(n=T((n-e)/(t-e),0,1))*n*(3-2*n)}function A(e,t,n){const i=n-t,r=((e-t)%i+i)%i+t;return r===t?n:r}function C(e,t,n){if(!e.length)return n(null,[]);let i=e.length;const r=new Array(e.length);let o=null;e.forEach(((e,a)=>{t(e,((e,t)=>{e&&(o=e),r[a]=t,0==--i&&n(o,r)}))}))}function k(e){const t=[];for(const n in e)t.push(e[n]);return t}function M(e,...t){for(const n of t)for(const t in n)e[t]=n[t];return e}let I=1;function P(){return I++}function D(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function z(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function L(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function O(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function R(e,t){return-1!==e.indexOf(t,e.length-t.length)}function B(e,t,n){const i={};for(const r in e)i[r]=t.call(n||this,e[r],r,e);return i}function F(e,t,n){const i={};for(const r in e)t.call(n||this,e[r],r,e)&&(i[r]=e[r]);return i}function N(e){return Array.isArray(e)?e.map(N):"object"==typeof e&&e?B(e,N):e}const j={};function U(e){j[e]||("undefined"!=typeof console&&console.warn(e),j[e]=!0)}function V(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}function G(e){let t=0;for(let n,i,r=0,o=e.length,a=o-1;r<o;a=r++)n=e[r],i=e[a],t+=(i.x-n.x)*(n.y+i.y);return t}function q(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function $(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,n,i,r)=>{const o=i||r;return t[n]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let W=null;function Z(e){if(null==W){const t=e.navigator?e.navigator.userAgent:null;W=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return W}function X(e){try{const n=t[e];return n.setItem("_mapbox_test_",1),n.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function H(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}const Y="mapbox-tiles";let K,J,Q=500,ee=50;function te(){try{return t.caches}catch(e){}}function ne(){te()&&!K&&(K=t.caches.open(Y))}function ie(e){const t=e.indexOf("?");if(t<0)return e;const n=function(e){const t=e.indexOf("?");return t>0?e.slice(t+1).split("&"):[]}(e),i=n.filter((e=>{const t=e.split("=");return"language"===t[0]||"worldview"===t[0]}));return i.length?`${e.slice(0,t)}?${i.join("&")}`:e.slice(0,t)}let re=1/0;const oe={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(oe);class ae extends Error{constructor(e,t,n){401===t&&_e(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=n}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const se=q()?()=>self.worker&&self.worker.referrer:()=>("blob:"===t.location.protocol?t.parent:t).location.href,le=function(e,n){if(!(/^file:/.test(i=e.url)||/^file:/.test(se())&&!/^\w+:/.test(i))){if(t.fetch&&t.Request&&t.AbortController&&t.Request.prototype.hasOwnProperty("signal"))return function(e,n){const i=new t.AbortController,r=new t.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:se(),signal:i.signal});let o=!1,a=!1;const s=(l=r.url).indexOf("sku=")>0&&_e(l);var l;"json"===e.type&&r.headers.set("Accept","application/json");const c=(i,o,l)=>{if(a)return;if(i&&"SecurityError"!==i.message&&U(i),o&&l)return u(o);const c=Date.now();t.fetch(r).then((t=>{if(t.ok){const e=s?t.clone():null;return u(t,e,c)}return n(new ae(t.statusText,t.status,e.url))})).catch((e=>{20!==e.code&&n(new Error(e.message))}))},u=(i,s,l)=>{("arrayBuffer"===e.type?i.arrayBuffer():"json"===e.type?i.json():i.text()).then((e=>{a||(s&&l&&function(e,n,i){if(ne(),!K)return;const r={status:n.status,statusText:n.statusText,headers:new t.Headers};n.headers.forEach(((e,t)=>r.headers.set(t,e)));const o=$(n.headers.get("Cache-Control")||"");if(o["no-store"])return;o["max-age"]&&r.headers.set("Expires",new Date(i+1e3*o["max-age"]).toUTCString());const a=r.headers.get("Expires");a&&(new Date(a).getTime()-i<42e4||function(e,t){if(void 0===J)try{new Response(new ReadableStream),J=!0}catch(e){J=!1}J?t(e.body):e.blob().then(t)}(n,(n=>{const i=new t.Response(n,r);ne(),K&&K.then((t=>t.put(ie(e.url),i))).catch((e=>U(e.message)))})))}(r,s,l),o=!0,n(null,e,i.headers.get("Cache-Control"),i.headers.get("Expires")))})).catch((e=>{a||n(new Error(e.message))}))};return s?function(e,t){if(ne(),!K)return t(null);const n=ie(e.url);K.then((e=>{e.match(n).then((i=>{const r=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),n=$(e.headers.get("Cache-Control")||"");return t>
2Date.now()&&!n["no-cache"]}(i);e.delete(n),r&&e.put(n,i.clone()),t(null,i,r)})).catch(t)})).catch(t)}(r,c):c(null,null),{cancel:()=>{a=!0,o||i.abort()}}}(e,n);if(q()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,n,void 0,!0)}var i;return function(e,n){const i=new t.XMLHttpRequest;i.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(i.responseType="arraybuffer");for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===e.credentials,i.onerror=()=>{n(new Error(i.statusText))},i.onload=()=>{if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let t=i.response;if("json"===e.type)try{t=JSON.parse(i.response)}catch(e){return n(e)}n(null,t,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else n(new ae(i.statusText,i.status,e.url))},i.send(e.body),{cancel:()=>i.abort()}}(e,n)},ce=function(e,t){return le(M(e,{type:"arrayBuffer"}),t)};function ue(e){const n=t.document.createElement("a");return n.href=e,n.protocol===t.document.location.protocol&&n.host===t.document.location.host}const he="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let de,fe;de=[],fe=0;const pe=function(e,n){if(o.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),fe>=r.MAX_PARALLEL_IMAGE_REQUESTS){const t={requestParameters:e,callback:n,cancelled:!1,cancel(){this.cancelled=!0}};return de.push(t),t}fe++;let i=!1;const a=()=>{if(!i)for(i=!0,fe--;de.length&&fe<r.MAX_PARALLEL_IMAGE_REQUESTS;){const e=de.shift(),{requestParameters:t,callback:n,cancelled:i}=e;i||(e.cancel=pe(t,n).cancel)}},s=ce(e,((e,i,r,o)=>{a(),e?n(e):i&&(t.createImageBitmap?function(e,n){const i=new t.Blob([new Uint8Array(e)],{type:"image/png"});t.createImageBitmap(i).then((e=>{n(null,e)})).catch((e=>{n(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(i,((e,t)=>n(e,t,r,o))):function(e,n){const i=new t.Image,r=t.URL;i.onload=()=>{n(null,i),r.revokeObjectURL(i.src),i.onload=null,t.requestAnimationFrame((()=>{i.src=he}))},i.onerror=()=>n(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const o=new t.Blob([new Uint8Array(e)],{type:"image/png"});i.src=e.byteLength?r.createObjectURL(o):he}(i,((e,t)=>n(e,t,r,o))))}));return{cancel:()=>{s.cancel(),a()}}},me="NO_ACCESS_TOKEN";function ge(e){return 0===e.indexOf("mapbox:")}function _e(e){return r.API_URL_REGEX.test(e)}function ye(e){return r.API_CDN_URL_REGEX.test(e)}function ve(e){return r.API_STYLE_REGEX.test(e)&&!xe(e)}function xe(e){return r.API_SPRITE_REGEX.test(e)}const be=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function we(e){const t=e.match(be);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Ee(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}function Te(e){if(!e)return null;const n=e.split(".");if(!n||3!==n.length)return null;try{return JSON.parse(decodeURIComponent(t.atob(n[1]).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(e){return null}}class Se{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const n=Te(r.ACCESS_TOKEN);let i="";return i=n&&n.u?t.btoa(encodeURIComponent(n.u).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t))))):r.ACCESS_TOKEN||"",e?`mapbox.eventData.${e}:${i}`:`mapbox.eventData:${i}`}fetchEventData(){const e=X("localStorage"),n=this.getStorageKey(),i=this.getStorageKey("uuid");if(e)try{const e=t.localStorage.getItem(n);e&&(this.eventData=JSON.parse(e));const r=t.localStorage.getItem(i);r&&(this.anonId=r)}catch(e){U("Unable to read from LocalStorage")}}saveEventData(){const e=X("localStorage"),n=this.getStorageKey(),i=this.getStorageKey("uuid");if(e)try{t.localStorage.setItem(i,this.anonId),Object.keys(this.eventData).length>=1&&t.localStorage.setItem(n,JSON.stringify(this.eventData))}catch(e){U("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,t,n,i){if(!r.EVENTS_URL)return;const o=we(r.EVENTS_URL);o.params.push(`access_token=${i||r.ACCESS_TOKEN||""}`);const a={event:this.type,created:new Date(e).toISOString()},s=t?M(a,t):a,l={url:Ee(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=function(e,t){return le(M(e,{method:"POST"}),t)}(l,(e=>{this.pendingRequest=null,n(e),this.saveEventData(),this.processRequests(i)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const Ae=new class extends Se{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,t){r.EVENTS_URL&&r.ACCESS_TOKEN&&Array.isArray(e)&&e.some((e=>ge(e)||_e(e)))&&this.queueRequest(Date.now(),t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=Te(r.ACCESS_TOKEN),i=t?t.u:r.ACCESS_TOKEN;let o=i!==this.eventData.tokenU;L(this.anonId)||(this.anonId=D(),o=!0);const a=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(a),n=(a-this.eventData.lastSuccess)/864e5;o=o||n>=1||n<-1||e.getDate()!==t.getDate()}else o=!0;o?this.postEvent(a,{sdkIdentifier:"mapbox-gl-js",sdkVersion:n,skuId:h,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=a,this.eventData.tokenU=i)}),e):this.processRequests()}},Ce=Ae.postTurnstileEvent.bind(Ae),ke=new class extends Se{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(e,t,n,i){this.skuToken=t,this.errorCb=i,r.EVENTS_URL&&(n||r.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},n):this.errorCb(new Error(me)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),L(this.anonId)||(this.anonId=D()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:n,skuId:h,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e))}},Me=ke.postMapLoadEvent.bind(ke),Ie=new class extends Se{constructor(){super("gljs.performance")}postPerformanceEvent(e,t){r.EVENTS_URL&&(e||r.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:i,performanceData:r}=this.queue.shift(),o=function(e){const i=t.performance.getEntriesByType("resource"),r=t.performance.getEntriesByType("mark"),o=function(e){const t={};if(e)for(const n in e)if("other"!==n)for(const i of e[n]){const e=`${n}ResolveRangeMin`,r=`${n}ResolveRangeMax`,o=`${n}RequestCount`,a=`${n}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,i.startTime),t[r]=Math.max(t[r]||-1/0,i.responseEnd);const s=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==i.transferSize&&0===i.transferSize&&s(a),s(o)}return t}(function(e,t){const n={};if(e)for(const i of e){const e=t(i);void 0===n[e]&&(n[e]=[]),n[e].push(i)}return n}(i,Be)),a=t.devicePixelRatio,s=t.navigator.connection||t.navigator.mozConnection||t.navigator.webkitConnection,l={counters:[],metadata:[],attributes:[]},c=(e,t,n)=>{null!=n&&e.push({name:t,value:n.toString()})};for(const e in o)c(l.counters,e,o[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(c(l.counters,"interactionRangeMin",e.interactionRange[0]),c(l.counters,"interactionRangeMax",e.interactionRange[1])),r)for(const e of Object.keys(Oe)){const t=Oe[e],n=r.find((e=>e.name===t));n&&c(l.counters,t,n.startTime)}return c(l.counters,"visibilityHidden",e.visibilityHidden),c(l.attributes,"style",function(e){if(e)for(const t of e){const e=t.name.split("?")[0];if(ve(e)){const t=e.split("/").slice(-2);if(2===t.length)return`mapbox://styles/${t[0]}/${t[1]}`}}}(i)),c(l.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),c(l.attributes,"fogEnabled",e.fogEnabled?"true":"false"),c(l.attributes,"projection",e.projection),c(l.attributes,"zoom",e.zoom),c(l.metadata,"devicePixelRatio",a),c(l.metadata,"connectionEffectiveType",s?s.effectiveType:void 0),c(l.metadata,"navigatorUserAgent",t.navigator.userAgent),c(l.metadata,"screenWidth",t.screen.width),c(l.metadata,"screenHeight",t.screen.height),c(l.metadata,"windowWidth",t.innerWidth),c(l.metadata,"windowHeight",t.innerHe
2ight),c(l.metadata,"mapWidth",e.width/a),c(l.metadata,"mapHeight",e.height/a),c(l.metadata,"webglRenderer",e.renderer),c(l.metadata,"webglVendor",e.vendor),c(l.metadata,"sdkVersion",n),c(l.metadata,"sdkIdentifier","mapbox-gl-js"),l}(r);for(const e of o.metadata);for(const e of o.counters);for(const e of o.attributes);this.postEvent(i,o,(()=>{}),e)}},Pe=Ie.postPerformanceEvent.bind(Ie),De=new class extends Se{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,t,n,i){if(!r.API_URL||!r.SESSION_PATH)return;const o=we(r.API_URL+r.SESSION_PATH);o.params.push(`sku=${t||""}`),o.params.push(`access_token=${i||r.ACCESS_TOKEN||""}`);const a={url:Ee(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(e,t){return le(M(e,{method:"GET"}),t)}(a,(e=>{this.pendingRequest=null,n(e),this.saveEventData(),this.processRequests(i)}))}getSessionAPI(e,t,n,i){this.skuToken=t,this.errorCb=i,r.SESSION_PATH&&r.API_URL&&(n||r.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},n):this.errorCb(new Error(me)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:n}=this.queue.shift();t&&this.success[t]||this.getSession(n,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}},ze=De.getSessionAPI.bind(De),Le=new Set,Oe={create:"create",load:"load",fullLoad:"fullLoad"},Re={mark(e){t.performance.mark(e)},measure(e,n,i){t.performance.measure(e,n,i)}};function Be(e){const t=e.name.split("?")[0];return ye(t)&&t.includes("mapbox-gl.js")?"javascript":ye(t)&&t.includes("mapbox-gl.css")?"css":function(e){return r.API_FONTS_REGEX.test(e)}(t)?"fontRange":xe(t)?"sprite":ve(t)?"style":function(e){return r.API_TILEJSON_REGEX.test(e)}(t)?"tilejson":"other"}const Fe=t.performance;function Ne(e){const t=e?e.url.toString():void 0;return Fe.getEntriesByName(t)}let je,Ue,Ve,Ge;const qe={now:()=>void 0!==Ve?Ve:t.performance.now(),setNow(e){Ve=e},restoreNow(){Ve=void 0},frame(e){const n=t.requestAnimationFrame(e);return{cancel:()=>t.cancelAnimationFrame(n)}},getImageData(e,n=0){const{width:i,height:r}=e;Ge||(Ge=t.document.createElement("canvas"));const o=Ge.getContext("2d",{willReadFrequently:!0});if(!o)throw new Error("failed to create canvas 2d context");return(i>Ge.width||r>Ge.height)&&(Ge.width=i,Ge.height=r),o.clearRect(-n,-n,i+2*n,r+2*n),o.drawImage(e,0,0,i,r),o.getImageData(-n,-n,i+2*n,r+2*n)},resolveURL:e=>(je||(je=t.document.createElement("a")),je.href=e,je.href),get devicePixelRatio(){return t.devicePixelRatio},get prefersReducedMotion(){return!!t.matchMedia&&(null==Ue&&(Ue=t.matchMedia("(prefers-reduced-motion: reduce)")),Ue.matches)}};function $e(e,t,n){n[e]&&-1!==n[e].indexOf(t)||(n[e]=n[e]||[],n[e].push(t))}function We(e,t,n){if(n&&n[e]){const i=n[e].indexOf(t);-1!==i&&n[e].splice(i,1)}}class Ze{constructor(e,t={}){M(this,t),this.type=e}}class Xe extends Ze{constructor(e,t={}){super("error",M({error:e},t))}}class He{on(e,t){return this._listeners=this._listeners||{},$e(e,t,this._listeners),this}off(e,t){return We(e,t,this._listeners),We(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},$e(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new Ze(e,t||{}));const n=e.type;if(this.listens(n)){e.target=this;const t=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const n of t)n.call(this,e);const i=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const t of i)We(n,t,this._oneTimeListeners),t.call(this,e);const r=this._eventedParent;r&&(M(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),r.fire(e))}else e instanceof Xe&&console.error(e.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var Ye=JSON.parse('{"$version":8,"$root":{"version":{"required":true,"type":"enum","values":[8]},"name":{"type":"string"},"metadata":{"type":"*"},"center":{"type":"array","value":"number"},"zoom":{"type":"number"},"bearing":{"type":"number","default":0,"period":360,"units":"degrees"},"pitch":{"type":"number","default":0,"units":"degrees"},"light":{"type":"light"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"layers":{"required":true,"type":"array","value":"layer"}},"sources":{"*":{"type":"source"}},"source":["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],"source_vector":{"type":{"required":true,"type":"enum","values":{"vector":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"attribution":{"type":"string"},"promoteId":{"type":"promoteId"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster":{"type":{"required":true,"type":"enum","values":{"raster":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"scheme":{"type":"enum","values":{"xyz":{},"tms":{}},"default":"xyz"},"attribution":{"type":"string"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_raster_dem":{"type":{"required":true,"type":"enum","values":{"raster-dem":{}}},"url":{"type":"string"},"tiles":{"type":"array","value":"string"},"bounds":{"type":"array","value":"number","length":4,"default":[-180,-85.051129,180,85.051129]},"minzoom":{"type":"number","default":0},"maxzoom":{"type":"number","default":22},"tileSize":{"type":"number","default":512,"units":"pixels"},"attribution":{"type":"string"},"encoding":{"type":"enum","values":{"terrarium":{},"mapbox":{}},"default":"mapbox"},"volatile":{"type":"boolean","default":false},"*":{"type":"*"}},"source_geojson":{"type":{"required":true,"type":"enum","values":{"geojson":{}}},"data":{"type":"*"},"maxzoom":{"type":"number","default":18},"attribution":{"type":"string"},"buffer":{"type":"number","default":128,"maximum":512,"minimum":0},"filter":{"type":"*"},"tolerance":{"type":"number","default":0.375},"cluster":{"type":"boolean","default":false},"clusterRadius":{"type":"number","default":50,"minimum":0}
2,"clusterMaxZoom":{"type":"number"},"clusterMinPoints":{"type":"number"},"clusterProperties":{"type":"*"},"lineMetrics":{"type":"boolean","default":false},"generateId":{"type":"boolean","default":false},"promoteId":{"type":"promoteId"}},"source_video":{"type":{"required":true,"type":"enum","values":{"video":{}}},"urls":{"required":true,"type":"array","value":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"source_image":{"type":{"required":true,"type":"enum","values":{"image":{}}},"url":{"required":true,"type":"string"},"coordinates":{"required":true,"type":"array","length":4,"value":{"type":"array","length":2,"value":"number"}}},"layer":{"id":{"type":"string","required":true},"type":{"type":"enum","values":{"fill":{},"line":{},"symbol":{},"circle":{},"heatmap":{},"fill-extrusion":{},"raster":{},"hillshade":{},"background":{},"sky":{}},"required":true},"metadata":{"type":"*"},"source":{"type":"string"},"source-layer":{"type":"string"},"minzoom":{"type":"number","minimum":0,"maximum":24},"maxzoom":{"type":"number","minimum":0,"maximum":24},"filter":{"type":"filter"},"layout":{"type":"layout"},"paint":{"type":"paint"}},"layout":["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill":{"fill-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_circle":{"circle-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_heatmap":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_fill-extrusion":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"},"fill-extrusion-edge-radius":{"type":"number","private":true,"default":0,"minimum":0,"maximum":1
vendor: 16,128 bytes, line 2
2,"property-type":"constant"}},"layout_line":{"line-cap":{"type":"enum","values":{"butt":{},"round":{},"square":{}},"default":"butt","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-join":{"type":"enum","values":{"bevel":{},"round":{},"miter":{}},"default":"miter","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{"type":"number","default":2,"requires":[{"line-join":"miter"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-round-limit":{"type":"number","default":1.05,"requires":[{"line-join":"round"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_symbol":{"symbol-placement":{"type":"enum","values":{"point":{},"line":{},"line-center":{}},"default":"point","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-spacing":{"type":"number","default":250,"minimum":1,"units":"pixels","requires":[{"symbol-placement":"line"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{"type":"boolean","default":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{"type":"number","expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{"type":"enum","values":{"auto":{},"viewport-y":{},"source":{}},"default":"auto","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{"type":"boolean","default":false,"requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-optional":{"type":"boolean","default":false,"requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-size":{"type":"number","default":1,"minimum":0,"units":"factor of the original icon size","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{"type":"enum","values":{"none":{},"width":{},"height":{},"both":{}},"default":"none","requires":["icon-image","text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{"type":"array","value":"number","length":4,"default":[0,0,0,0],"units":"pixels","requires":["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-image":{"type":"resolvedImage","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{"type":"boolean","default":false,"requires":["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"icon-offset":{"type":"array","value":"number","length":2,"default":[0,0],"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{"type":"enum","values":{"map":{},"viewport":{},"auto":{}},"default":"auto","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-field":{"type":"formatted","default":"","tokens":true,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-font":{"type":"array","value":"string","default":["Open Sans Regular","Arial Unicode MS Regular"],"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-size":{"type":"number","default":16,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{"type":"number","default":10,"minimum":0,"units":"ems","requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{"type":"number","default":1.2,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{"type":"number","default":0,"units":"ems","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-justify":{"type":"enum","values":{"auto":{},"left":{},"center":{},"right":{}},"default":"center","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{"type":"number","units":"ems","default":0,"requires":["text-field"],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["zoom","feature"]}},"text-variable-anchor":{"type":"array","value":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"requires":["text-field",{"symbol-placement":["point"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-anchor":{"type":"enum","values":{"center":{},"left":{},"right":{},"top":{},"bottom":{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center","requires":["text-field",{"!":"text-variable-anchor"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{"type":"number","default":45,"units":"degrees","requires":["text-field",{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-writing-mode":{"type":"array","value":"enum","values":{"horizontal":{},"vertical":{}},"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-rotate":{"type":"number","default":0,"period":360,"units":"degrees","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-padding":{"type":"number","default":2,"minimum":0,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-keep-upright":{"type":"boolean","default":true,"requires":["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-transform":{"type":"enum","values":{"none":{},"uppercase":{},"lowercase":{}},"default":"none","requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-offset":{"type":"array","value":"number","units":"ems","length":2,"default":[0,0],"requires":["text-field",{"!":"text-radial-offset"}],"expression":{"interpolated":true,"parameters":["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{"type":"boolean","default":false,"requires":["text-field"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-optional":{"type":"boolean","default":false,"requires":["text-field","icon-image"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_raster":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_hillshade":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"filter":{"type":"array","value":"*"},"filter_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_operator":{"type":"enum","values":{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},"all":{},"any":{},"none":{},"has":{},"!has":{},"within":{}}},"geometry_type":{"type":"enum","values":{"Point":{},"LineString":{},"Polygon":{}}},"function":{"expression":{"type":"expression"},"stops":{"type":"array","value":"function_stop"},"base":{"type":"number","default":1,"minimum":0},"property":{"type":"string","default":"$zoom"},"type":{"type":"enum","values":{"identity":{},"exponential":{},"interval":{},"categorical":{}},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":{},"lab":{},"hcl":{}},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":{},"viewport":{}},"property-type":"data-constant","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{},"globe":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90],"transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["source"]}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"requires":[{"!":"fill-pattern"},{"fill-antialias":true}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","transition":
vendor: 16,988 bytes, line 2
2false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"fill-extrusion-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["fill-extrusion-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"units":"meters","transition":true,"requires":["fill-extrusion-height"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"requires":["fill-extrusion-edge-radius"]}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"line-pattern"}],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["line-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"transition":false,"units":"line widths","requires":[{"!":"line-pattern"}],"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","transition":false,"requires":[{"!":"line-pattern"},{"source":"geojson","has":{"lineMetrics":true}}],"expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"transition":false,"requires":[{"source":"geojson","has":{"lineMetrics":true}}],"property-type":"constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["circle-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"units":"pixels","expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"transition":false,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"transition":false,"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["icon-image"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["icon-image","icon-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"units":"pixels","requires":["text-field"],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"map","requires":["text-field","text-translate"],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"units":"degrees","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":{},"nearest":{}},"default":"linear","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"transition":false,"units":"milliseconds","expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"transition":false,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":{},"viewport":{}},"default":"viewport","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"requires":[{"!":"background-pattern"}],"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"transition":{"duration":{"type":"number","default":300,"minimum":0,"units":"milliseconds"},"delay":{"type":"number","default":0,"minimum":0,"units":"milliseconds"}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function Ke(e,...t){for(const n of t)for(const t in n)e[t]=n[t];return e}function Je(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Qe(e){if(Array.isArray(e))return e.map(Qe);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const n in e)t[n]=Qe(e[n]);return t}return Je(e)}
vendor: 28,035 bytes, line 2
2class et extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}var tt=et;class nt{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,n]of t)this.bindings[e]=n}concat(e){return new nt(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}var it=nt;const rt={kind:"null"},ot={kind:"number"},at={kind:"string"},st={kind:"boolean"},lt={kind:"color"},ct={kind:"object"},ut={kind:"value"},ht={kind:"collator"},dt={kind:"formatted"},ft={kind:"resolvedImage"};function pt(e,t){return{kind:"array",itemType:e,N:t}}function mt(e){if("array"===e.kind){const t=mt(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const gt=[rt,ot,at,st,lt,dt,ct,pt(ut),ft];function _t(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!_t(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of gt)if(!_t(e,t))return null}return`Expected ${mt(e)} but found ${mt(t)} instead.`}function yt(e,t){return t.some((t=>t.kind===e.kind))}function vt(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}var xt,bt={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function wt(e){return(e=Math.round(e))<0?0:e>255?255:e}function Et(e){return wt("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function Tt(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function St(e,t,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}try{xt={}.parseCSSColor=function(e){var t,n=e.replace(/ /g,"").toLowerCase();if(n in bt)return bt[n].slice();if("#"===n[0])return 4===n.length?(t=parseInt(n.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===n.length&&(t=parseInt(n.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var i=n.indexOf("("),r=n.indexOf(")");if(-1!==i&&r+1===n.length){var o=n.substr(0,i),a=n.substr(i+1,r-(i+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=Tt(a.pop());case"rgb":return 3!==a.length?null:[Et(a[0]),Et(a[1]),Et(a[2]),s];case"hsla":if(4!==a.length)return null;s=Tt(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,c=Tt(a[1]),u=Tt(a[2]),h=u<=.5?u*(c+1):u+c-u*c,d=2*u-h;return[wt(255*St(d,h,l+1/3)),wt(255*St(d,h,l)),wt(255*St(d,h,l-1/3)),s];default:return null}}return null}}catch(e){}class At{constructor(e,t,n,i=1){this.r=e,this.g=t,this.b=n,this.a=i}static parse(e){if(!e)return;if(e instanceof At)return e;if("string"!=typeof e)return;const t=xt(e);return t?new At(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]):void 0}toString(){const[e,t,n,i]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(n)},${i})`}toArray(){const{r:e,g:t,b:n,a:i}=this;return 0===i?[0,0,0,0]:[255*e/i,255*t/i,255*n/i,i]}toArray01(){const{r:e,g:t,b:n,a:i}=this;return 0===i?[0,0,0,0]:[e/i,t/i,n/i,i]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:n,a:i}=this;return[e,t,n,i]}}At.black=new At(0,0,0,1),At.white=new At(1,1,1,1),At.transparent=new At(0,0,0,0),At.red=new At(1,0,0,1),At.blue=new At(0,0,1,1);var Ct=At;class kt{constructor(e,t,n){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Mt{constructor(e,t,n,i,r){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=n,this.fontStack=i,this.textColor=r}}class It{constructor(e){this.sections=e}static fromString(e){return new It([new Mt(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof It?e:It.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.name]);continue}e.push(t.text);const n={};t.fontStack&&(n["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(n["font-scale"]=t.scale),t.textColor&&(n["text-color"]=["rgba"].concat(t.textColor.toArray())),e.push(n)}return e}}class Pt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Pt({name:e,available:!1}):null}serialize(){return["image",this.name]}}function Dt(e,t,n,i){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,n,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[e,t,n,i]:[e,t,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function zt(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof Ct)return!0;if(e instanceof kt)return!0;if(e instanceof It)return!0;if(e instanceof Pt)return!0;if(Array.isArray(e)){for(const t of e)if(!zt(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!zt(e[t]))return!1;return!0}return!1}function Lt(e){if(null===e)return rt;if("string"==typeof e)return at;if("boolean"==typeof e)return st;if("number"==typeof e)return ot;if(e instanceof Ct)return lt;if(e instanceof kt)return ht;if(e instanceof It)return dt;if(e instanceof Pt)return ft;if(Array.isArray(e)){const t=e.length;let n;for(const t of e){const e=Lt(t);if(n){if(n===e)continue;n=ut;break}n=e}return pt(n||ut,t)}return ct}function Ot(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ct||e instanceof It||e instanceof Pt?e.toString():JSON.stringify(e)}class Rt{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!zt(e[1]))return t.error("invalid value");const n=e[1];let i=Lt(n);const r=t.expectedType;return"array"!==i.kind||0!==i.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(i=r),new Rt(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Ct?["rgba"].concat(this.value.toArray()):this.value instanceof It?this.value.serialize():this.value}}var Bt=Rt,Ft=class{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}};const Nt={string:at,number:ot,boolean:st,object:ct};class jt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let n,i=1;const r=e[0];if("array"===r){let r,o;if(e.length>2){const n=e[1];if("string"!=typeof n||!(n in Nt)||"object"===n)return t.error('The item type argument of "array" must be one of string, number, boolean',1);r=Nt[n],i++}else r=ut;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],i++}n=pt(r,o)}else n=Nt[r];const o=[];for(;i<e.length;i++){const n=t.parse(e[i],i,ut);if(!n)return null;o.push(n)}return new jt(n,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const n=this.args[t].evaluate(e);if(!_t(this.type,Lt(n)))return n;if(t===this.args.length-1)throw new Ft(`Expected value to be of type ${mt(this.type)}, but found ${mt(Lt(n))} instead.`)}return null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const n=e.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){t.push(n.kind);const i=e.N;("number"==typeof i||this.args.length>1)&&t.push(i)}}return t.concat(this.args.map((e=>e.serialize())))}}var Ut=jt;class Vt{constructor(e){this.type=dt,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const n=e[1];if(!Array.isArray(n)&&"object"==typeof n)return t.error("First argument must be an image or text section.");const i=[];let r=!1;for(let n=1;n<=e.length-1;++n){const o=e[n];if(r&&"object"==typeof o&&!Array.isArray(o)){r=!1;let e=null;if(o["font-scale"]&&(e=t.parse(o["font-scale"],1,ot),!e))return null;let n=null;if(o["text-font"]&&(n=t.parse(o["text-font"],1,pt(at)),!n))return null;let a=null;if(o["text-color"]&&(a=t.parse(o["text-color"],1,lt),!a))return null;const s=i[i.length-1];s.scale=e,s.font=n,s.textColor=a}else{const o=t.parse(e[n],1,ut);if(!o)return null;const a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,i.push({content:o,scale:null,font:null,textColor:null})}}return new Vt(i)}evaluate(e){return new It(this.sections.map((t=>{const n=t.content.evaluate(e);return Lt(n)===ft?new Mt("",n,null,null,null):new Mt(Ot(n),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const n={};t.scale&&(n["font-scale"]=t.scale.serialize()),t.font&&(n["text-font"]=t.font.serialize()),t.textColor&&(n["text-color"]=t.textColor.serialize()),e.push(n)}return e}}class Gt{constructor(e){this.type=ft,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const n=t.parse(e[1],1,at);return n?new Gt(n):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),n=Pt.fromString(t);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(t)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const qt={"to-boolean":st,"to-color":lt,"to-number":ot,"to-string":at};class $t{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const n=e[0];if(("to-boolean"===n||"to-string"===n)&&2!==e.length)return t.error("Expected one argument.");const i=qt[n],r=[];for(let n=1;n<e.length;n++){const i=t.parse(e[n],n,ut);if(!i)return null;r.push(i)}return new $t(i,r)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,n;for(const i of this.args){if(t=i.evaluate(e),n=null,t instanceof Ct)return t;if("string"==typeof t){const n=e.parseColor(t);if(n)return n}else if(Array.isArray(t)&&(n=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Dt(t[0],t[1],t[2],t[3]),!n))return new Ct(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ft(n||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const n of this.args){if(t=n.evaluate(e),null===t)return 0;const i=Number(t);if(!isNaN(i))return i}throw new Ft(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?It.fromString(Ot(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Pt.fromString(Ot(this.args[0].evaluate(e))):Ot(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new Vt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Gt(this.args[0]).serialize();const e=[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}var Wt=$t;const Zt=["Unknown","Point","LineString","Polygon"];var Xt=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Zt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:n,y:i}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(n*t-e[0])+this.featureDistanceData.bearing[1]*(i*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Ct.parse(e)),t}};class Ht{constructor(e,t,n,i){this.name=e,this.type=t,this._evaluate=n,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const n=e[0],i=Ht.definitions[n];if(!i)return t.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,a=o.filter((([t])=>!Array.isArray(t)||t.length===e.length-1));let s=null;for(const[i,o]of a){s=new En(t.registry,t.path,null,t.scope);const a=[];let l=!1;for(let t=1;t<e.length;t++){const n=e[t],r=Array.isArray(i)?i[t-1]:i.type,o=s.parse(n,1+a.length,r);if(!o){l=!0;break}a.push(o)}if(!l)if(Array.isArray(i)&&i.length!==a.length)s.error(`Expected ${i.length} arguments, but found ${a.length} instead.`);else{for(let e=0;e<a.length;e++){const t=Array.isArray(i)?i[e]:i.type,n=a[e];s.concat(e+1).checkSubtype(t,n.type)}if(0===s.errors.length)return new Ht(n,r,o,a)}}if(1===a.length)t.errors.push(...s.errors);else{const n=(a.length?a:o).map((([e])=>{return t=e,Array.isArray(t)?`(${t.map(mt).join(", ")})`:`(${mt(t.type)}...)`;var t})).join(" | "),i=[];for(let n=1;n<e.length;n++){const r=t.parse(e[n],1+i.length);if(!r)return null;i.push(mt(r.type))}t.error(`Expected arguments of type ${n}, but found (${i.join(", ")}) instead.`)}return null}static register(e,t){Ht.definitions=t;for(const n in t)e[n]=Ht}}var Yt=Ht;class Kt{constructor(e,t,n){this.type=ht,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const n=e[1];if("object"!=typeof n||Array.isArray(n))return t.error("Collator options argument must be an object.");const i=t.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,st);if(!i)return null;const r=t.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,st);if(!r)return null;let o=null;return n.locale&&(o=t.parse(n.locale,1,at),!o)?null:new Kt(i,r,o)}evaluate(e){return new kt(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}serialize(){const e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]}}const Jt=8192;function Qt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function en(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function tn(e,t){const n=(180+e[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,r=Math.pow(2,t.z);return[Math.round(n*r*Jt),Math.round(i*r*Jt)]}function nn(e,t,n){const i=e[0]-t[0],r=e[1]-t[1],o=e[0]-n[0],a=e[1]-n[1];return i*a-o*r==0&&i*o<=0&&r*a<=0}function rn(e,t){let n=!1;for(let a=0,s=t.length;a<s;a++){const s=t[a];for(let t=0,a=s.length;t<a-1;t++){if(nn(e,s[t],s[t+1]))return!1;(r=s[t])[1]>(i=e)[1]!=(o=s[t+1])[1]>i[1]&&i[0]<(o[0]-r[0])*(i[1]-r[1])/(o[1]-r[1])+r[0]&&(n=!n)}}var i,r,o;return n}function on(e,t){for(let n=0;n<t.length;n++)if(rn(e,t[n]))return!0;return!1}function an(e,t,n,i){const r=i[0]-n[0],o=i[1]-n[1],a=(e[0]-n[0])*o-r*(e[1]-n[1]),s=(t[0]-n[0])*o-r*(t[1]-n[1]);return a>0&&s<0||a<0&&s>0}function sn(e,t,n){for(const c of n)for(let n=0;n<c.length-1;++n)if(0!=(s=[(a=c[n+1])[0]-(o=c[n])[0],a[1]-o[1]])[0]*(l=[(r=t)[0]-(i=e)[0],r[1]-i[1]])[1]-s[1]*l[0]&&an(i,r,o,a)&&an(o,a,i,r))return!0;var i,r,o,a,s,l;return!1}function ln(e,t){for(let n=0;n<e.length;++n)if(!rn(e[n],t))return!1;for(let n=0;n<e.length-1;++n)if(sn(e[n],e[n+1],t))return!1;return!0}function cn(e,t){for(let n=0;n<t.length;n++)if(ln(e,t[n]))return!0;return!1}function un(e,t,n){const i=[];for(let r=0;r<e.length;r++){const o=[];for(let i=0;i<e[r].length;i++){const a=tn(e[r][i],n);Qt(t,a),o.push(a)}i.push(o)}return i}function hn(e,t,n){const i=[];for(let r=0;r<e.length;r++){const o=un(e[r],t,n);i.push(o)}return i}function dn(e,t,n,i){if(e[0]<n[0]||e[0]>n[2]){const t=.5*i;let r=e[0]-n[0]>t?-i:n[0]-e[0]>t?i:0;0===r&&(r=e[0]-n[2]>t?-i:n[2]-e[0]>t?i:0),e[0]+=r}Qt(t,e)}function fn(e,t,n,i){const r=Math.pow(2,i.z)*Jt,o=[i.x*Jt,i.y*Jt],a=[];if(!e)return a;for(const i of e)for(const e of i){const i=[e.x+o[0],e.y+o[1]];dn(i,t,n,r),a.push(i)}return a}function pn(e,t,n,i){const r=Math.pow(2,i.z)*Jt,o=[i.x*Jt,i.y*Jt],a=[];if(!e)return a;for(const n of e){const e=[];for(const i of n){const n=[i.x+o[0],i.y+o[1]];Qt(t,n),e.push(n)}a.push(e)}if(t[2]-t[0]<=r/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of a)for(const i of e)dn(i,t,n,r)}var s;return a}class mn{constructor(e,t){this.type=st,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(zt(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const n=t.features[e].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new mn(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new mn(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new mn(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=e.canonicalID();if(!r)return!1;if("Polygon"===t.type){const o=un(t.coordinates,i,r),a=fn(e.geometry(),n,i,r);if(!en(n,i))return!1;for(const e of a)if(!rn(e,o))return!1}if("MultiPolygon"===t.type){const o=hn(t.coordinates,i,r),a=fn(e.geometry(),n,i,r);if(!en(n,i))return!1;for(const e of a)if(!on(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=e.canonicalID();if(!r)return!1;if("Polygon"===t.type){const o=un(t.coordinates,i,r),a=pn(e.geometry(),n,i,r);if(!en(n,i))return!1;for(const e of a)if(!ln(e,o))return!1}if("MultiPolygon"===t.type){const o=hn(t.coordinates,i,r),a=pn(e.geometry(),n,i,r);if(!en(n,i))return!1;for(const e of a)if(!cn(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var gn=mn;function _n(e){if(e instanceof Yt){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof gn)return!1;let t=!0;return e.eachChild((e=>{t&&!_n(e)&&(t=!1)})),t}function yn(e){if(e instanceof Yt&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!yn(e)&&(t=!1)})),t}function vn(e,t){if(e instanceof Yt&&t.indexOf(e.name)>=0)return!1;let n=!0;return e.eachChild((e=>{n&&!vn(e,t)&&(n=!1)})),n}class xn{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const n=e[1];return t.scope.has(n)?new xn(n,t.scope.get(n)):t.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}var bn=xn;class wn{constructor(e,t=[],n,i=new it,r=[]){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=i,this.errors=r,this.expectedType=n}parse(e,t,n,i,r={}){return t?this.concat(t,n,i)._parse(e,r):this._parse(e,r)}_parse(e,t){function n(e,t,n){return"assert"===n?new Ut(t,[e]):"coerce"===n?new Wt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=e[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const r=this.registry[i];if(r){let i=r.parse(e,this);if(!i)return null;if(this.expectedType){const e=this.expectedType,r=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==r.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==r.kind&&"string"!==r.kind){if(this.checkSubtype(e,r))return null}else i=n(i,e,t.typeAnnotation||"coerce");else i=n(i,e,t.typeAnnotation||"assert")}if(!(i instanceof Bt)&&"resolvedImage"!==i.type.kind&&Tn(i)){const t=new Xt;try{i=new Bt(i.type,i.evaluate(t))}catch(e){return this.error(e.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,n){const i="number"==typeof e?this.path.concat(e):this.path,r=n?this.scope.concat(n):this.scope;return new wn(this.registry,i,t||null,r,this.errors)}error(e,...t){const n=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new tt(n,e))}checkSubtype(e,t){const n=_t(e,t);return n&&this.error(n),n}}var En=wn;function Tn(e){if(e instanceof bn)return Tn(e.boundExpression);if(e instanceof Yt&&"error"===e.name)return!1;if(e instanceof Kt)return!1;if(e instanceof gn)return!1;const t=e instanceof Wt||e instanceof Ut;let n=!0;return e.eachChild((e=>{n=t?n&&Tn(e):n&&e instanceof Bt})),!!n&&_n(e)&&vn(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}function Sn(e,t){const n=e.length-1;let i,r,o=0,a=n,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),i=e[s],r=e[s+1],i<=t){if(s===n||t<r)return s;o=s+1}else{if(!(i>t))throw new Ft("Input is not a number.");a=s-1}return 0}class An{constructor(e,t,n){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of n)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const n=t.parse(e[1],1,ot);if(!n)return null;const i=[];let r=null;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(let n=1;n<e.length;n+=2){const o=1===n?-1/0:e[n],a=e[n+1],s=n,l=n+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
2omputed expressions) for the input values.',s);if(i.length&&i[i.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=t.parse(a,l,r);if(!c)return null;r=r||c.type,i.push([o,c])}return new An(r,n,i)}evaluate(e){const t=this.labels,n=this.outputs;if(1===t.length)return n[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return n[0].evaluate(e);const r=t.length;return i>=t[r-1]?n[r-1].evaluate(e):n[Sn(t,i)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}var Cn=An;function kn(e,t,n){return e*(1-n)+t*n}var Mn=Object.freeze({__proto__:null,number:kn,color:function(e,t,n){return new Ct(kn(e.r,t.r,n),kn(e.g,t.g,n),kn(e.b,t.b,n),kn(e.a,t.a,n))},array:function(e,t,n){return e.map(((e,i)=>kn(e,t[i],n)))}});const In=.95047,Pn=1.08883,Dn=4/29,zn=6/29,Ln=3*zn*zn,On=Math.PI/180,Rn=180/Math.PI;function Bn(e){return e>.008856451679035631?Math.pow(e,1/3):e/Ln+Dn}function Fn(e){return e>zn?e*e*e:Ln*(e-Dn)}function Nn(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function jn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Un(e){const t=jn(e.r),n=jn(e.g),i=jn(e.b),r=Bn((.4124564*t+.3575761*n+.1804375*i)/In),o=Bn((.2126729*t+.7151522*n+.072175*i)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Bn((.0193339*t+.119192*n+.9503041*i)/Pn)),alpha:e.a}}function Vn(e){let t=(e.l+16)/116,n=isNaN(e.a)?t:t+e.a/500,i=isNaN(e.b)?t:t-e.b/200;return t=1*Fn(t),n=In*Fn(n),i=Pn*Fn(i),new Ct(Nn(3.2404542*n-1.5371385*t-.4985314*i),Nn(-.969266*n+1.8760108*t+.041556*i),Nn(.0556434*n-.2040259*t+1.0572252*i),e.alpha)}function Gn(e,t,n){const i=t-e;return e+n*(i>180||i<-180?i-360*Math.round(i/360):i)}const qn={forward:Un,reverse:Vn,interpolate:function(e,t,n){return{l:kn(e.l,t.l,n),a:kn(e.a,t.a,n),b:kn(e.b,t.b,n),alpha:kn(e.alpha,t.alpha,n)}}},$n={forward:function(e){const{l:t,a:n,b:i}=Un(e),r=Math.atan2(i,n)*Rn;return{h:r<0?r+360:r,c:Math.sqrt(n*n+i*i),l:t,alpha:e.a}},reverse:function(e){const t=e.h*On,n=e.c;return Vn({l:e.l,a:Math.cos(t)*n,b:Math.sin(t)*n,alpha:e.alpha})},interpolate:function(e,t,n){return{h:Gn(e.h,t.h,n),c:kn(e.c,t.c,n),l:kn(e.l,t.l,n),alpha:kn(e.alpha,t.alpha,n)}}};var Wn=Object.freeze({__proto__:null,lab:qn,hcl:$n});class Zn{constructor(e,t,n,i,r){this.type=e,this.operator=t,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,n,i){let r=0;if("exponential"===e.name)r=Xn(t,e.base,n,i);else if("linear"===e.name)r=Xn(t,1,n,i);else if("cubic-bezier"===e.name){const o=e.controlPoints;r=new d(o[0],o[1],o[2],o[3]).solve(Xn(t,1,n,i))}return r}static parse(e,t){let[n,i,r,...o]=e;if(!Array.isArray(i)||0===i.length)return t.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const e=i[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:e}}else{if("cubic-bezier"!==i[0])return t.error(`Unknown interpolation type ${String(i[0])}`,1,0);{const e=i.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(r=t.parse(r,2,ot),!r)return null;const a=[];let s=null;"interpolate-hcl"===n||"interpolate-lab"===n?s=lt:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let e=0;e<o.length;e+=2){const n=o[e],i=o[e+1],r=e+3,l=e+4;if("number"!=typeof n)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not c
2omputed expressions) for the input values.',r);if(a.length&&a[a.length-1][0]>=n)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',r);const c=t.parse(i,l,s);if(!c)return null;s=s||c.type,a.push([n,c])}return"number"===s.kind||"color"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new Zn(s,n,i,r,a):t.error(`Type ${mt(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,n=this.outputs;if(1===t.length)return n[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return n[0].evaluate(e);const r=t.length;if(i>=t[r-1])return n[r-1].evaluate(e);const o=Sn(t,i),a=Zn.interpolationFactor(this.interpolation,i,t[o],t[o+1]),s=n[o].evaluate(e),l=n[o+1].evaluate(e);return"interpolate"===this.operator?Mn[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?$n.reverse($n.interpolate($n.forward(s),$n.forward(l),a)):qn.reverse(qn.interpolate(qn.forward(s),qn.forward(l),a))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let e=0;e<this.labels.length;e++)t.push(this.labels[e],this.outputs[e].serialize());return t}}function Xn(e,t,n,i){const r=i-n,o=e-n;return 0===r?0:1===t?o/r:(Math.pow(t,o)-1)/(Math.pow(t,r)-1)}var Hn=Zn;class Yn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let n=null;const i=t.expectedType;i&&"value"!==i.kind&&(n=i);const r=[];for(const i of e.slice(1)){const e=t.parse(i,1+r.length,n,void 0,{typeAnnotation:"omit"});if(!e)return null;n=n||e.type,r.push(e)}const o=i&&r.some((e=>_t(i,e.type)));return new Yn(o?ut:n,r)}evaluate(e){let t,n=null,i=0;for(const r of this.args){if(i++,n=r.evaluate(e),n&&n instanceof Pt&&!n.available&&(t||(t=n),n=null,i===this.args.length))return t;if(null!==n)break}return n}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}var Kn=Yn;class Jn{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const n=[];for(let i=1;i<e.length-1;i+=2){const r=e[i];if("string"!=typeof r)return t.error(`Expected string, but found ${typeof r} instead.`,i);if(/[^a-zA-Z0-9_]/.test(r))return t.error("Variable names must contain only alphanumeric characters or '_'.",i);const o=t.parse(e[i+1],i+1);if(!o)return null;n.push([r,o])}const i=t.parse(e[e.length-1],e.length-1,t.expectedType,n);return i?new Jn(n,i):null}outputDefined(){return this.result.outputDefined()}serialize(){const e=["let"];for(const[t,n]of this.bindings)e.push(t,n.serialize());return e.push(this.result.serialize()),e}}var Qn=Jn;class ei{constructor(e,t,n){this.type=e,this.index=t,this.input=n}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,ot),i=t.parse(e[2],2,pt(t.expectedType||ut));return n&&i?new ei(i.type.itemType,n,i):null}evaluate(e){const t=this.index.evaluate(e),n=this.input.evaluate(e);if(t<0)throw new Ft(`Array index out of bounds: ${t} < 0.`);if(t>=n.length)throw new Ft(`Array index out of bounds: ${t} > ${n.length-1}.`);if(t!==Math.floor(t))throw new Ft(`Array index must be an integer, but found ${t} instead.`);return n[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var ti=ei;class ni{constructor(e,t){this.type=st,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,ut),i=t.parse(e[2],2,ut);return n&&i?yt(n.type,[st,at,ot,rt,ut])?new ni(n,i):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(n.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(null==n)return!1;if(!vt(t,["boolean","string","number","null"]))throw new Ft(`Expected first argument to be of type boolean, string, number or null, but found ${mt(Lt(t))} instead.`);if(!vt(n,["string","array"]))throw new Ft(`Expected second argument to be of type array or string, but found ${mt(Lt(n))} instead.`);return n.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var ii=ni;class ri{constructor(e,t,n){this.type=ot,this.needle=e,this.haystack=t,this.fromIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,ut),i=t.parse(e[2],2,ut);if(!n||!i)return null;if(!yt(n.type,[st,at,ot,rt,ut]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${mt(n.type)} instead`);if(4===e.length){const r=t.parse(e[3],3,ot);return r?new ri(n,i,r):null}return new ri(n,i)}evaluate(e){const t=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!vt(t,["boolean","string","number","null"]))throw new Ft(`Expected first argument to be of type boolean, string, number or null, but found ${mt(Lt(t))} instead.`);if(!vt(n,["string","array"]))throw new Ft(`Expected second argument to be of type array or string, but found ${mt(Lt(n))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(e);return n.indexOf(t,i)}return n.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}var oi=ri;class ai{constructor(e,t,n,i,r,o){this.inputType=e,this.type=t,this.input=n,this.cases=i,this.outputs=r,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let n,i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);const r={},o=[];for(let a=2;a<e.length-1;a+=2){let s=e[a];const l=e[a+1];Array.isArray(s)||(s=[s]);const c=t.concat(a);if(0===s.length)return c.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,Lt(e)))return null}else n=Lt(e);if(void 0!==r[String(e)])return c.error("Branch labels must be unique.");r[String(e)]=o.length}const u=t.parse(l,a,i);if(!u)return null;i=i||u.type,o.push(u)}const a=t.parse(e[1],1,ut);if(!a)return null;const s=t.parse(e[e.length-1],e.length-1,i);return s?"value"!==a.type.kind&&t.concat(1).checkSubtype(n,a.type)?null:new ai(n,i,a,r,o,s):null}evaluate(e){const t=this.input.evaluate(e);return(Lt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}
vendor: 25,278 bytes, line 2
2eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),n=[],i={};for(const e of t){const t=i[this.cases[e]];void 0===t?(i[this.cases[e]]=n.length,n.push([this.cases[e],[e]])):n[t][1].push(e)}const r=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,i]of n)e.push(1===i.length?r(i[0]):i.map(r)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}var si=ai;class li{constructor(e,t,n){this.type=e,this.branches=t,this.otherwise=n}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const i=[];for(let r=1;r<e.length-1;r+=2){const o=t.parse(e[r],r,st);if(!o)return null;const a=t.parse(e[r+1],r+1,n);if(!a)return null;i.push([o,a]),n=n||a.type}const r=t.parse(e[e.length-1],e.length-1,n);return r?new li(n,i,r):null}evaluate(e){for(const[t,n]of this.branches)if(t.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,n]of this.branches)e(t),e(n);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}var ci=li;class ui{constructor(e,t,n,i){this.type=e,this.input=t,this.beginIndex=n,this.endIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const n=t.parse(e[1],1,ut),i=t.parse(e[2],2,ot);if(!n||!i)return null;if(!yt(n.type,[pt(ut),at,ut]))return t.error(`Expected first argument to be of type array or string, but found ${mt(n.type)} instead`);if(4===e.length){const r=t.parse(e[3],3,ot);return r?new ui(n.type,n,i,r):null}return new ui(n.type,n,i)}evaluate(e){const t=this.input.evaluate(e),n=this.beginIndex.evaluate(e);if(!vt(t,["string","array"]))throw new Ft(`Expected first argument to be of type array or string, but found ${mt(Lt(t))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(e);return t.slice(n,i)}return t.slice(n)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}var hi=ui;function di(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function fi(e,t,n,i){return 0===i.compare(t,n)}function pi(e,t,n){const i="=="!==e&&"!="!==e;return class r{constructor(e,t,n){this.type=st,this.lhs=e,this.rhs=t,this.collator=n,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const n=e[0];let o=t.parse(e[1],1,ut);if(!o)return null;if(!di(n,o.type))return t.concat(1).error(`"${n}" comparisons are not supported for type '${mt(o.type)}'.`);let a=t.parse(e[2],2,ut);if(!a)return null;if(!di(n,a.type))return t.concat(2).error(`"${n}" comparisons are not supported for type '${mt(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error(`Cannot compare types '${mt(o.type)}' and '${mt(a.type)}'.`);i&&("value"===o.type.kind&&"value"!==a.type.kind?o=new Ut(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new Ut(o.type,[a])));let s=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,ht),!s)return null}return new r(o,a,s)}evaluate(r){const o=this.lhs.evaluate(r),a=this.rhs.evaluate(r);if(i&&this.hasUntypedArgument){const t=Lt(o),n=Lt(a);if(t.kind!==n.kind||"string"!==t.kind&&"number"!==t.kind)throw new Ft(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${n.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const e=Lt(o),n=Lt(a);if("string"!==e.kind||"string"!==n.kind)return t(r,o,a)}return this.collator?n(r,o,a,this.collator.evaluate(r)):t(r,o,a)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const mi=pi("==",(function(e,t,n){return t===n}),fi),gi=pi("!=",(function(e,t,n){return t!==n}),(function(e,t,n,i){return!fi(0,t,n,i)})),_i=pi("<",(function(e,t,n){return t<n}),(function(e,t,n,i){return i.compare(t,n)<0})),yi=pi(">",(function(e,t,n){return t>n}),(function(e,t,n,i){return i.compare(t,n)>0})),vi=pi("<=",(function(e,t,n){return t<=n}),(function(e,t,n,i){return i.compare(t,n)<=0})),xi=pi(">=",(function(e,t,n){return t>=n}),(function(e,t,n,i){return i.compare(t,n)>=0}));class bi{constructor(e,t,n,i,r,o){this.type=at,this.number=e,this.locale=t,this.currency=n,this.unit=i,this.minFractionDigits=r,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const n=t.parse(e[1],1,ot);if(!n)return null;const i=e[2];if("object"!=typeof i||Array.isArray(i))return t.error("NumberFormat options argument must be an object.");let r=null;if(i.locale&&(r=t.parse(i.locale,1,at),!r))return null;let o=null;if(i.currency&&(o=t.parse(i.currency,1,at),!o))return null;let a=null;if(i.unit&&(a=t.parse(i.unit,1,at),!a))return null;let s=null;if(i["min-fraction-digits"]&&(s=t.parse(i["min-fraction-digits"],1,ot),!s))return null;let l=null;return i["max-fraction-digits"]&&(l=t.parse(i["max-fraction-digits"],1,ot),!l)?null:new bi(n,r,o,a,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class wi{constructor(e){this.type=ot,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const n=t.parse(e[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?t.error(`Expected argument of type string or array, but found ${mt(n.type)} instead.`):new wi(n):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Ft(`Expected value to be of type string or array, but found ${mt(Lt(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}const Ei={"==":mi,"!=":gi,">":yi,"<":_i,">=":xi,"<=":vi,array:Ut,at:ti,boolean:Ut,case:ci,coalesce:Kn,collator:Kt,format:Vt,image:Gt,in:ii,"index-of":oi,interpolate:Hn,"interpolate-hcl":Hn,"interpolate-lab":Hn,length:wi,let:Qn,literal:Bt,match:si,number:Ut,"number-format":bi,object:Ut,slice:hi,step:Cn,string:Ut,"to-boolean":Wt,"to-color":Wt,"to-number":Wt,"to-string":Wt,var:bn,within:gn};function Ti(e,[t,n,i,r]){t=t.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);const o=r?r.evaluate(e):1,a=Dt(t,n,i,o);if(a)throw new Ft(a);return new Ct(t/255*o,n/255*o,i/255*o,o)}function Si(e,t){return e in t}function Ai(e,t){const n=t[e];return void 0===n?null:n}function Ci(e){return{type:e}}Yt.register(Ei,{error:[{kind:"error"},[at],(e,[t])=>{throw new Ft(t.evaluate(e))}],typeof:[at,[ut],(e,[t])=>mt(Lt(t.evaluate(e)))],"to-rgba":[pt(ot,4),[lt],(e,[t])=>t.evaluate(e).toArray()],rgb:[lt,[ot,ot,ot],Ti],rgba:[lt,[ot,ot,ot,ot],Ti],has:{type:st,overloads:[[[at],(e,[t])=>Si(t.evaluate(e),e.properties())],[[at,ct],(e,[t,n])=>Si(t.evaluate(e),n.evaluate(e))]]},get:{type:ut,overloads:[[[at],(e,[t])=>Ai(t.evaluate(e),e.properties())],[[at,ct],(e,[t,n])=>Ai(t.evaluate(e),n.evaluate(e))]]},"feature-state":[ut,[at],(e,[t])=>Ai(t.evaluate(e),e.featureState||{})],properties:[ct,[],e=>e.properties()],"geometry-type":[at,[],e=>e.geometryType()],id:[ut,[],e=>e.id()],zoom:[ot,[],e=>e.globals.zoom],pitch:[ot,[],e=>e.globals.pitch||0],"distance-from-center":[ot,[],e=>e.distanceFromCenter()],"heatmap-density":[ot,[],e=>e.globals.heatmapDensity||0],"line-progress":[ot,[],e=>e.globals.lineProgress||0],"sky-radial-progress":[ot,[],e=>e.globals.skyRadialProgress||0],accumulated:[ut,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[ot,Ci(ot),(e,t)=>{let n=0;for(const i of t)n+=i.evaluate(e);return n}],"*":[ot,Ci(ot),(e,t)=>{let n=1;for(const i of t)n*=i.evaluate(e);return n}],"-":{type:ot,overloads:[[[ot,ot],(e,[t,n])=>t.evaluate(e)-n.evaluate(e)],[[ot],(e,[t])=>-t.evaluate(e)]]},"/":[ot,[ot,ot],(e,[t,n])=>t.evaluate(e)/n.evaluate(e)],"%":[ot,[ot,ot],(e,[t,n])=>t.evaluate(e)%n.evaluate(e)],ln2:[ot,[],()=>Math.LN2],pi:[ot,[],()=>Math.PI],e:[ot,[],()=>Math.E],"^":[ot,[ot,ot],(e,[t,n])=>Math.pow(t.evaluate(e),n.evaluate(e))],sqrt:[ot,[ot],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[ot,[ot],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[ot,[ot],(e,[t])=>Math.log(t.evaluate(e))],log2:[ot,[ot],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[ot,[ot],(e,[t])=>Math.sin(t.evaluate(e))],cos:[ot,[ot],(e,[t])=>Math.cos(t.evaluate(e))],tan:[ot,[ot],(e,[t])=>Math.tan(t.evaluate(e))],asin:[ot,[ot],(e,[t])=>Math.asin(t.evaluate(e))],acos:[ot,[ot],(e,[t])=>Math.acos(t.evaluate(e))],atan:[ot,[ot],(e,[t])=>Math.atan(t.evaluate(e))],min:[ot,Ci(ot),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[ot,Ci(ot),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[ot,[ot],(e,[t])=>Math.abs(t.evaluate(e))],round:[ot,[ot],(e,[t])=>{const n=t.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[ot,[ot],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[ot,[ot],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[st,[at,ut],(e,[t,n])=>e.properties()[t.value]===n.value],"filter-id-==":[st,[ut],(e,[t])=>e.id()===t.value],"filter-type-==":[st,[at],(e,[t])=>e.geometryType()===t.value],"filter-<":[st,[at,ut],(e,[t,n])=>{const i=e.properties()[t.value],r=n.value;return typeof i==typeof r&&i<r}],"filter-id-<":[st,[ut],(e,[t])=>{const n=e.id(),i=t.value;return typeof n==typeof i&&n<i}],"filter->":[st,[at,ut],(e,[t,n])=>{const i=e.properties()[t.value],r=n.value;return typeof i==typeof r&&i>r}],"filter-id->":[st,[ut],(e,[t])=>{const n=e.id(),i=t.value;return typeof n==typeof i&&n>i}],"filter-<=":[st,[at,ut],(e,[t,n])=>{const i=e.properties()[t.value],r=n.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[st,[ut],(e,[t])=>{const n=e.id(),i=t.value;return typeof n==typeof i&&n<=i}],"filter->=":[st,[at,ut],(e,[t,n])=>{const i=e.properties()[t.value],r=n.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[st,[ut],(e,[t])=>{const n=e.id(),i=t.value;return typeof n==typeof i&&n>=i}],"filter-has":[st,[ut],(e,[t])=>t.value in e.properties()],"filter-has-id":[st,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[st,[pt(at)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[st,[pt(ut)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[st,[at,pt(ut)],(e,[t,n])=>n.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[st,[at,pt(ut)],(e,[t,n])=>function(e,t,n,i){for(;n<=i;){const r=n+i>>1;if(t[r]===e)return!0;t[r]>e?i=r-1:n=r+1}return!1}(e.properties()[t.value],n.value,0,n.value.length-1)],all:{type:st,overloads:[[[st,st],(e,[t,n])=>t.evaluate(e)&&n.evaluate(e)],[Ci(st),(e,t)=>{for(const n of t)if(!n.evaluate(e))return!1;return!0}]]},any:{type:st,overloads:[[[st,st],(e,[t,n])=>t.evaluate(e)||n.evaluate(e)],[Ci(st),(e,t)=>{for(const n of t)if(n.evaluate(e))return!0;return!1}]]},"!":[st,[st],(e,[t])=>!t.evaluate(e)],"is-supported-script":[st,[at],(e,[t])=>{const n=e.globals&&e.globals.isSupportedScript;return!n||n(t.evaluate(e))}],upcase:[at,[at],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[at,[at],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[at,Ci(ut),(e,t)=>t.map((t=>Ot(t.evaluate(e)))).join("")],"resolved-locale":[at,[ht],(e,[t])=>t.evaluate(e).resolvedLocale()]});var ki=Ei;function Mi(e){return{result:"success",value:e}}function Ii(e){return{result:"error",value:e}}function Pi(e){return"data-driven"===e["property-type"]}function Di(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function zi(e){return!!e.expression&&e.expression.interpolated}function Li(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Oi(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Ri(e){return e}function Bi(e,t){const n="color"===t.type,i=e.stops&&"object"==typeof e.stops[0][0],r=i||!(i||void 0!==e.property),o=e.type||(zi(t)?"exponential":"interval");if(n&&((e=Ke({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],Ct.parse(e[1])]))),e.default=Ct.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Wn[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let a,s,l;if("exponential"===o)a=Ui;else if("interval"===o)a=ji;else if("categorical"===o){a=Ni,s=Object.create(null);for(const t of e.stops)s[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=Vi}if(i){const n={},i=[];for(let t=0;t<e.stops.length;t++){const r=e.stops[t],o=r[0].zoom;void 0===n[o]&&(n[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},i.push(o)),n[o].stops.push([r[0].value,r[1]])}const r=[];for(const e of i)r.push([n[e].zoom,Bi(n[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:Hn.interpolationFactor.bind(void 0,o),zoomStops:r.map((e=>e[0])),evaluate:({zoom:n},i)=>Ui({stops:r,base:e.base},t,n).evaluate(n,i)}}if(r){const n="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:n,interpolationFactor:Hn.interpolationFactor.bind(void 0,n),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:n})=>a(e,t,n,s,l)}}return{kind:"source",evaluate(n,i){const r=i&&i.properties?i.properties[e.property]:void 0;return void 0===r?Fi(e.default,t.default):a(e,t,r,s,l)}}}function Fi(e,t,n){return void 0!==e?e:void 0!==t?t:void 0!==n?n:void 0}function Ni(e,t,n,i,r){return Fi(typeof n===r?i[n]:void 0,e.default,t.default)}function ji(e,t,n){if("number"!==Li(n))return Fi(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[i-1][0])return e.stops[i-1][1];const r=Sn(e.stops.map((e=>e[0])),n);return e.stops[r][1]}function Ui(e,t,n){const i=void 0!==e.base?e.base:1;if("number"!==Li(n))return Fi(e.default,t.default);const r=e.stops.length;if(1===r)return e.stops[0][1];if(n<=e.stops[0][0])return e.stops[0][1];if(n>=e.stops[r-1][0])return e.stops[r-1][1];const o=Sn(e.stops.map((e=>e[0])),n),a=function(e,t,n,i){const r=i-n,o=e-n;return 0===r?0:1===t?o/r:(Math.pow(t,o)-1)/(Math.pow(t,r)-1)}(n,i,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1];let c=Mn[t.type]||Ri;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=Wn[e.colorSpace];c=(e,n)=>t.reverse(t.interpolate(t.forward(e),t.forward(n),a))}return"function"==typeof s.evaluate?{evaluate(...e){const t=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==n)return c(t,n,a)}}:c(s,l,a)}function Vi(e,t,n){return"color"===t.type?n=Ct.parse(n):"formatted"===t.type?n=It.fromString(n.toString()):"resolvedImage"===t.type?n=Pt.fromString(n.toString()):Li(n)===t.type||"enum"===t.type&&t.values[n]||(n=void 0),Fi(n,e.default,t.default)}class Gi{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Xt,this._defaultValue=t?function(e){return"color"===e.type&&(Oi(e.default)||Array.isArray(e.default))?new Ct(0,0,0,0):"color"===e.type?Ct.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,n,i,r,o,a,s){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=n,this._evaluator.canonical=i||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null,this.expression.evaluate(this._evaluator)}evaluate(e,t,n,i,r,o,a,s){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i||null,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null,this._evaluator.featureTileCoord=a||null,this._evaluator.featureDistanceData=s||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Ft(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function qi(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in ki}function $i(e,t){const n=new En(ki,[],t?function(e){const t={color:lt,string:at,number:ot,enum:at,boolean:st,formatted:dt,resolvedImage:ft};return"array"===e.type?pt(t[e.value]||ut,e.length):t[e.type]}(t):void 0),i=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return i?Mi(new Gi(i,t)):Ii(n.errors)}class Wi{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!yn(t.expression)}evaluateWithoutErrorHandling(e,t,n,i,r,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,i,r,o)}evaluate(e,t,n,i,r,o){return this._styleExpression.evaluate(e,t,n,i,r,o)}}class Zi{constructor(e,t,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=t,this.isStateDependent="camera"!==e&&!yn(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,n,i,r,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,n,i,r,o)}evaluate(e,t,n,i,r,o){return this._styleExpression.evaluate(e,t,n,i,r,o)}interpolationFactor(e,t,n){return this.interpolationType?Hn.interpolationFactor(this.interpolationType,e,t,n):0}}function Xi(e,t){if("error"===(e=$i(e,t)).result)return e;const n=e.value.expression,i=_n(n);if(!i&&!Pi(t))return Ii([new tt("","data expressions not supported")]);const r=vn(n,["zoom","pitch","distance-from-center"]);if(!r&&!Di(t))return Ii([new tt("","zoom expressions not supported")]);const o=Yi(n);return o||r?o instanceof tt?Ii([o]):o instanceof Hn&&!zi(t)?Ii([new tt("",'"interpolate" expressions cannot be used with this property')]):Mi(o?new Zi(i?"camera":"composite",e.value,o.labels,o instanceof Hn?o.interpolation:void 0):new Wi(i?"constant":"source",e.value)):Ii([new tt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Hi{constructor(e,t){this._parameters=e,this._specification=t,Ke(this,Bi(this._parameters,this._specification))}static deserialize(e){return new Hi(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Yi(e){let t=null;if(e instanceof Qn)t=Yi(e.result);else if(e instanceof Kn){for(const n of e.args)if(t=Yi(n),t)break}else(e instanceof Cn||e instanceof Hn)&&e.input instanceof Yt&&"zoom"===e.input.name&&(t=e);return t instanceof tt||e.eachChild((e=>{const n=Yi(e);n instanceof tt?t=n:!t&&n?t=new tt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&n&&t!==n&&(t=new tt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}class Ki{constructor(e,t,n,i){this.message=(e?`${e}: `:"")+n,i&&(this.identifier=i),null!=t&&t.__line__&&(this.line=t.__line__)}}function Ji(e){const t=e.key,n=e.value,i=e.valueSpec||{},r=e.objectElementValidators||{},o=e.style,a=e.styleSpec;let s=[];const l=Li(n);if("object"!==l)return[new Ki(t,n,`object expected, ${l} found`)];for(const e in n){const l=e.split(".")[0],c=i[l]||i["*"];let u;r[l]?u=r[l]:i[l]?u=Dr:r["*"]?u=r["*"]:i["*"]&&(u=Dr),u?s=s.concat(u({key:(t?`${t}.`:t)+e,value:n[e],valueSpec:c,style:o,styleSpec:a,object:n,objectKey:e},n)):s.push(new Ki(t,n[e],`unknown property "${e}"`))}for(const e in i)r[e]||i[e].required&&void 0===i[e].default&&void 0===n[e]&&s.push(new Ki(t,n,`missing required property "${e}"`));return s}function Qi(e){const t=e.value,n=e.valueSpec,i=e.style,r=e.styleSpec,o=e.key,a=e.arrayElementValidator||Dr;if("array"!==Li(t))return[new Ki(o,t,`array expected, ${Li(t)} found`)];if(n.length&&t.length!==n.length)return[new Ki(o,t,`array length ${n.length} expected, length ${t.length} found`)];if(n["min-length"]&&t.length<n["min-length"])return[new Ki(o,t,`array length at least ${n["min-length"]} expected, length ${t.length} found`)];let s={type:n.value,values:n.values,minimum:n.minimum,maximum:n.maximum,function:void 0};r.$version<7&&(s.function=n.function),"object"===Li(n.value)&&(s=n.value);let l=[];for(let e=0;e<t.length;e++)l=l.concat(a({array:t,arrayIndex:e,value:t[e],valueSpec:s,style:i,styleSpec:r,key:`${o}[${e}]`}));return l}function er(e){const t=e.key,n=e.value,i=e.valueSpec;let r=Li(n);if("number"===r&&n!=n&&(r="NaN"),"number"!==r)return[new Ki(t,n,`number expected, ${r} found`)];if("minimum"in i){let r=i.minimum;if("array"===Li(i.minimum)&&(r=i.minimum[e.arrayIndex]),n<r)return[new Ki(t,n,`${n} is less than the minimum value ${r}`)]}if("maximum"in i){let r=i.maximum;if("array"===Li(i.maximum)&&(r=i.maximum[e.arrayIndex]),n>r)return[new Ki(t,n,`${n} is greater than the maximum value ${r}`)]}return[]}function tr(e){const t=e.valueSpec,n=Je(e.value.type);let i,r,o,a={};const s="categorical"!==n&&void 0===e.value.property,l=!s,c="array"===Li(e.value.stops)&&"array"===Li(e.value.stops[0])&&"object"===Li(e.value.stops[0][0]),u=Ji({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===n)return[new Ki(e.key,e.value,'identity function may not have a "stops" property')];let t=[];const i=e.value;return t=t.concat(Qi({key:e.key,value:i,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===Li(i)&&0===i.length&&t.push(new Ki(e.key,i,"array must have at least one stop")),t},default:function(e){return Dr({key:e.key,value:e.value,valueSpec:t,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===n&&s&&u.push(new Ki(e.key,e.value,'missing required property "property"')),"identity"===n||e.value.stops||u.push(new Ki(e.key,e.value,'missing required property "stops"')),"exponential"===n&&e.valueSpec.expression&&!zi(e.valueSpec)&&u.push(new Ki(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Pi(e.valueSpec)?u.push(new Ki(e.key,e.value,"property functions not supported")):s&&!Di(e.valueSpec)&&u.push(new Ki(e.key,e.value,"zoom functions not supported"))),"categorical"!==n&&!c||void 0!==e.value.property||u.push(new Ki(e.key,e.value,'"property" property is required')),u;function h(e){let n=[];const i=e.value,s=e.key;if("array"!==Li(i))return[new Ki(s,i,`array expected, ${Li(i)} found`)];if(2!==i.length)return[new Ki(s,i,`array length 2 expected, length ${i.length} found`)];if(c){if("object"!==Li(i[0]))return[new Ki(s,i,`object expected, ${Li(i[0])} found`)];if(void 0===i[0].zoom)return[new Ki(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new Ki(s,i,"object stop key must have value")];const t=Je(i[0].zoom);if("number"!=typeof t)return[new Ki(s,i[0].zoom,"stop zoom values must be numbers")];if(o&&o>t)return[new Ki(s,i[0].zoom,"stop zoom values must appear in ascending order")];t!==o&&(o=t,r=void 0,a={}),n=n.concat(Ji({key:`${s}[0]`,value:i[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:er,value:d}}))}else n=n.concat(d({key:`${s}[0]`,value:i[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},i));return qi(Qe(i[1]))?n.concat([new Ki(`${s}
2[1]`,i[1],"expressions are not allowed in function stops.")]):n.concat(Dr({key:`${s}[1]`,value:i[1],valueSpec:t,style:e.style,styleSpec:e.styleSpec}))}function d(e,o){const s=Li(e.value),l=Je(e.value),c=null!==e.value?e.value:o;if(i){if(s!==i)return[new Ki(e.key,c,`${s} stop domain type must match previous stop domain type ${i}`)]}else i=s;if("number"!==s&&"string"!==s&&"boolean"!==s&&"number"!=typeof l&&"string"!=typeof l&&"boolean"!=typeof l)return[new Ki(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==n){let i=`number expected, ${s} found`;return Pi(t)&&void 0===n&&(i+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ki(e.key,c,i)]}return"categorical"!==n||"number"!==s||"number"==typeof l&&isFinite(l)&&Math.floor(l)===l?"categorical"!==n&&"number"===s&&"number"==typeof l&&"number"==typeof r&&void 0!==r&&l<r?[new Ki(e.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===n&&l in a?[new Ki(e.key,c,"stop domain values must be unique")]:(a[l]=!0,[])):[new Ki(e.key,c,`integer expected, found ${String(l)}`)]}}function nr(e){const t=("property"===e.expressionContext?Xi:$i)(Qe(e.value),e.valueSpec);if("error"===t.result)return t.value.map((t=>new Ki(`${e.key}${t.key}`,e.value,t.message)));const n=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!n.outputDefined())return[new Ki(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!yn(n))return[new Ki(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext)return ir(n,e);if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!vn(n,["zoom","feature-state"]))return[new Ki(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!_n(n))return[new Ki(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ir(e,t){const n=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(t.valueSpec&&t.valueSpec.expression)for(const e of t.valueSpec.expression.parameters)n.delete(e);if(0===n.size)return[];const i=[];return e instanceof Yt&&n.has(e.name)?[new Ki(t.key,t.value,`["${e.name}"] expression is not supported in a filter for a ${t.object.type} layer with id: ${t.object.id}`)]:(e.eachChild((e=>{i.push(...ir(e,t))})),i)}function rr(e){const t=e.key,n=e.value,i=e.valueSpec,r=[];return Array.isArray(i.values)?-1===i.values.indexOf(Je(n))&&r.push(new Ki(t,n,`expected one of [${i.values.join(", ")}], ${JSON.stringify(n)} found`)):-1===Object.keys(i.values).indexOf(Je(n))&&r.push(new Ki(t,n,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(n)} found`)),r}function or(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!or(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function ar(e,t="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};or(e)||(e=fr(e));const n=e;let i=!0;try{i=function(e){if(!cr(e))return e;let t=Qe(e);return lr(t),t=sr(t),t}(n)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(n,null,2)}\n        `)}const r=Ye[`filter_${t}`],o=$i(i,r);let a=null;if("error"===o.result)throw new Error(o.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a=(e,t,n)=>o.value.evaluate(e,t,{},n);let s=null,l=null;if(i!==n){const e=$i(n,r);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s=(t,n,i,r,o)=>e.value.evaluate(t,n,{},i,void 0,void 0,r,o),l=!_n(e.value.expression)}return{filter:a,dynamicFilter:s||void 0,needGeometry:dr(i),needFeature:!!l}}function sr(e){if(!Array.isArray(e))return e;const t=function(e){if(ur.has(e[0]))for(let t=1;t<e.length;t++)if(cr(e[t]))return!0;return e}(e);return!0===t?t:t.map((e=>sr(e)))}function lr(e){let t=!1;const n=[];if("case"===e[0]){for(let i=1;i<e.length-1;i+=2)t=t||cr(e[i]),n.push(e[i+1]);n.push(e[e.length-1])}else if("match"===e[0]){t=t||cr(e[1]);for(let t=2;t<e.length-1;t+=2)n.push(e[t+1]);n.push(e[e.length-1])}else if("step"===e[0]){t=t||cr(e[1]);for(let t=1;t<e.length-1;t+=2)n.push(e[t+1])}t&&(e.length=0,e.push("any",...n));for(let t=1;t<e.length;t++)lr(e[t])}function cr(e){if(!Array.isArray(e))return!1;if("pitch"===(t=e[0])||"distance-from-center"===t)return!0;var t;for(let t=1;t<e.length;t++)if(cr(e[t]))return!0;return!1}const ur=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function hr(e,t){return e<t?-1:e>t?1:0}function dr(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let t=1;t<e.length;t++)if(dr(e[t]))return!0;return!1}function fr(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?pr(e[1],e[2],"=="):"!="===t?_r(pr(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?pr(e[1],e[2],t):"any"===t?(n=e.slice(1),["any"].concat(n.map(fr))):"all"===t?["all"].concat(e.slice(1).map(fr)):"none"===t?["all"].concat(e.slice(1).map(fr).map(_r)):"in"===t?mr(e[1],e.slice(2)):"!in"===t?_r(mr(e[1],e.slice(2))):"has"===t?gr(e[1]):"!has"===t?_r(gr(e[1])):"within"!==t||e;var n}function pr(e,t,n){switch(e){case"$type":return[`filter-type-${n}`,t];case"$id":return[`filter-id-${n}`,t];default:return[`filter-${n}`,e,t]}}function mr(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(hr)]]:["filter-in-small",e,["literal",t]]}}function gr(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function _r(e){return["!",e]}function yr(e){return or(Qe(e.value))?nr(Ke({},e,{expressionContext:"filter",valueSpec:e.styleSpec[`filter_${e.layerType||"fill"}`]})):vr(e)}function vr(e){const t=e.value,n=e.key;
vendor: 55,923 bytes, line 2
2if("array"!==Li(t))return[new Ki(n,t,`array expected, ${Li(t)} found`)];const i=e.styleSpec;let r,o=[];if(t.length<1)return[new Ki(n,t,"filter array must have at least 1 element")];switch(o=o.concat(rr({key:`${n}[0]`,value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Je(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Je(t[1])&&o.push(new Ki(n,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&o.push(new Ki(n,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(r=Li(t[1]),"string"!==r&&o.push(new Ki(`${n}[1]`,t[1],`string expected, ${r} found`)));for(let a=2;a<t.length;a++)r=Li(t[a]),"$type"===Je(t[1])?o=o.concat(rr({key:`${n}[${a}]`,value:t[a],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&o.push(new Ki(`${n}[${a}]`,t[a],`string, number, or boolean expected, ${r} found`));break;case"any":case"all":case"none":for(let i=1;i<t.length;i++)o=o.concat(vr({key:`${n}[${i}]`,value:t[i],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":r=Li(t[1]),2!==t.length?o.push(new Ki(n,t,`filter array for "${t[0]}" operator must have 2 elements`)):"string"!==r&&o.push(new Ki(`${n}[1]`,t[1],`string expected, ${r} found`));break;case"within":r=Li(t[1]),2!==t.length?o.push(new Ki(n,t,`filter array for "${t[0]}" operator must have 2 elements`)):"object"!==r&&o.push(new Ki(`${n}[1]`,t[1],`object expected, ${r} found`))}return o}function xr(e,t){const n=e.key,i=e.style,r=e.styleSpec,o=e.value,a=e.objectKey,s=r[`${t}_${e.layerType}`];if(!s)return[];const l=a.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return Dr({key:n,value:o,valueSpec:r.transition,style:i,styleSpec:r});const c=e.valueSpec||s[a];if(!c)return[new Ki(n,o,`unknown property "${a}"`)];let u;if("string"===Li(o)&&Pi(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new Ki(n,o,`"${a}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(u[1])} }\`.`)];const h=[];return"symbol"===e.layerType&&("text-field"===a&&i&&!i.glyphs&&h.push(new Ki(n,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Oi(Qe(o))&&"identity"===Je(o.type)&&h.push(new Ki(n,o,'"text-font" does not support identity functions'))),h.concat(Dr({key:e.key,value:o,valueSpec:c,style:i,styleSpec:r,expressionContext:"property",propertyType:t,propertyKey:a}))}function br(e){return xr(e,"paint")}function wr(e){return xr(e,"layout")}function Er(e){let t=[];const n=e.value,i=e.key,r=e.style,o=e.styleSpec;n.type||n.ref||t.push(new Ki(i,n,'either "type" or "ref" is required'));let a=Je(n.type);const s=Je(n.ref);if(n.id){const o=Je(n.id);for(let a=0;a<e.arrayIndex;a++){const e=r.layers[a];Je(e.id)===o&&t.push(new Ki(i,n.id,`duplicate layer id "${n.id}", previously used at line ${e.id.__line__}`))}}if("ref"in n){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in n&&t.push(new Ki(i,n[e],`"${e}" is prohibited for ref layers`))})),r.layers.forEach((t=>{Je(t.id)===s&&(e=t)})),e?e.ref?t.push(new Ki(i,n.ref,"ref cannot reference another ref layer")):a=Je(e.type):"string"==typeof s&&t.push(new Ki(i,n.ref,`ref layer "${s}" not found`))}else if("background"!==a&&"sky"!==a)if(n.source){const e=r.sources&&r.sources[n.source],o=e&&Je(e.type);e?"vector"===o&&"raster"===a?t.push(new Ki(i,n.source,`layer "${n.id}" requires a raster source`)):"raster"===o&&"raster"!==a?t.push(new Ki(i,n.source,`layer "${n.id}" requires a vector source`)):"vector"!==o||n["source-layer"]?"raster-dem"===o&&"hillshade"!==a?t.push(new Ki(i,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!n.paint||!n.paint["line-gradient"]&&!n.paint["line-trim-offset"]||"geojson"===o&&e.lineMetrics||t.push(new Ki(i,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new Ki(i,n,`layer "${n.id}" must specify a "source-layer"`)):t.push(new Ki(i,n.source,`source "${n.source}" not found`))}else t.push(new Ki(i,n,'missing required property "source"'));return t=t.concat(Ji({key:i,value:n,valueSpec:o.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Dr({key:`${i}.type`,value:n.type,valueSpec:o.layer.type,style:e.style,styleSpec:e.styleSpec,object:n,objectKey:"type"}),filter:e=>yr(Ke({layerType:a},e)),layout:e=>Ji({layer:n,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>wr(Ke({layerType:a},e))}}),paint:e=>Ji({layer:n,key:e.key,value:e.value,valueSpec:{},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>br(Ke({layerType:a},e))}})}})),t}function Tr(e){const t=e.value,n=e.key,i=Li(t);return"string"!==i?[new Ki(n,t,`string expected, ${i} found`)]:[]}const Sr={promoteId:function({key:e,value:t}){if("string"===Li(t))return Tr({key:e,value:t});{const n=[];for(const i in t)n.push(...Tr({key:`${e}.${i}`,value:t[i]}));return n}}};function Ar(e){const t=e.value,n=e.key,i=e.styleSpec,r=e.style;if(!t.type)return[new Ki(n,t,'"type" is required')];const o=Je(t.type);let a;switch(o){case"vector":case"raster":case"raster-dem":return a=Ji({key:n,value:t,valueSpec:i[`source_${o.replace("-","_")}`],style:e.style,styleSpec:i,objectElementValidators:Sr}),a;case"geojson":if(a=Ji({key:n,value:t,valueSpec:i.source_geojson,style:r,styleSpec:i,objectElementValidators:Sr}),t.cluster)for(const e in t.clusterProperties){const[i,r]=t.clusterProperties[e],o="string"==typeof i?[i,["accumulated"],["get",e]]:i;a.push(...nr({key:`${n}.${e}.map`,value:r,expressionContext:"cluster-map"})),a.push(...nr({key:`${n}.${e}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return a;case"video":return Ji({key:n,value:t,valueSpec:i.source_video,style:r,styleSpec:i});case"image":return Ji({key:n,value:t,valueSpec:i.source_image,style:r,styleSpec:i});case"canvas":return[new Ki(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return rr({key:`${n}.type`,value:t.type,valueSpec:{values:Cr(i)},style:r,styleSpec:i})}}function Cr(e){return e.source.reduce(((t,n)=>{const i=e[n];return"enum"===i.type.type&&(t=t.concat(Object.keys(i.type.values))),t}),[])}function kr(e){const t=e.value,n=e.styleSpec,i=n.light,r=e.style;let o=[];const a=Li(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new Ki("light",t,`object expected, ${a} found`)]),o;for(const e in t){const a=e.match(/^(.*)-transition$/);o=o.concat(a&&i[a[1]]&&i[a[1]].transition?Dr({key:e,value:t[e],valueSpec:n.transition,style:r,styleSpec:n}):i[e]?Dr({key:e,value:t[e],valueSpec:i[e],style:r,styleSpec:n}):[new Ki(e,t[e],`unknown property "${e}"`)])}return o}function Mr(e){const t=e.value,n=e.key,i=e.style,r=e.styleSpec,o=r.terrain;let a=[];const s=Li(t);if(void 0===t)return a;if("object"!==s)return a=a.concat([new Ki("terrain",t,`object expected, ${s} found`)]),a;for(const e in t){const n=e.match(/^(.*)-transition$/);a=a.concat(n&&o[n[1]]&&o[n[1]].transition?Dr({key:e,value:t[e],valueSpec:r.transition,style:i,styleSpec:r}):o[e]?Dr({key:e,value:t[e],valueSpec:o[e],style:i,styleSpec:r}):[new Ki(e,t[e],`unknown property "${e}"`)])}if(t.source){const e=i.sources&&i.sources[t.source],r=e&&Je(e.type);e?"raster-dem"!==r&&a.push(new Ki(n,t.source,`terrain cannot be used with a source of type ${String(r)}, it only be used with a "raster-dem" source type`)):a.push(new Ki(n,t.source,`source "${t.source}" not found`))}else a.push(new Ki(n,t,'terrain is missing required property "source"'));return a}function Ir(e){const t=e.value,n=e.style,i=e.styleSpec,r=i.fog;let o=[];const a=Li(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new Ki("fog",t,`object expected, ${a} found`)]),o;for(const e in t){const a=e.match(/^(.*)-transition$/);o=o.concat(a&&r[a[1]]&&r[a[1]].transition?Dr({key:e,value:t[e],valueSpec:i.transition,style:n,styleSpec:i}):r[e]?Dr({key:e,value:t[e],valueSpec:r[e],style:n,styleSpec:i}):[new Ki(e,t[e],`unknown property "${e}"`)])}return o}const Pr={"*":()=>[],array:Qi,boolean:function(e){const t=e.value,n=e.key,i=Li(t);return"boolean"!==i?[new Ki(n,t,`boolean expected, ${i} found`)]:[]},number:er,color:function(e){const t=e.key,n=e.value,i=Li(n);return"string"!==i?[new Ki(t,n,`color expected, ${i} found`)]:null===xt(n)?[new Ki(t,n,`color expected, "${n}" found`)]:[]},enum:rr,filter:yr,function:tr,layer:Er,object:Ji,source:Ar,light:kr,terrain:Mr,fog:Ir,string:Tr,formatted:function(e){return 0===Tr(e).length?[]:nr(e)},resolvedImage:function(e){return 0===Tr(e).length?[]:nr(e)},projection:function(e){const t=e.value,n=e.styleSpec,i=n.projection,r=e.style;let o=[];const a=Li(t);if("object"===a)for(const e in t)o=o.concat(Dr({key:e,value:t[e],valueSpec:i[e],style:r,styleSpec:n}));else"string"!==a&&(o=o.concat([new Ki("projection",t,`object or string expected, ${a} found`)]));return o}};function Dr(e){const t=e.value,n=e.valueSpec,i=e.styleSpec;return n.expression&&Oi(Je(t))?tr(e):n.expression&&qi(Qe(t))?nr(e):n.type&&Pr[n.type]?Pr[n.type](e):Ji(Ke({},e,{valueSpec:n.type?i[n.type]:n}))}function zr(e){const t=e.value,n=e.key,i=Tr(e);return i.length||(-1===t.indexOf("{fontstack}")&&i.push(new Ki(n,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&i.push(new Ki(n,t,'"glyphs" url must include a "{range}" token'))),i}function Lr(e,t=Ye){return Br(Dr({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:zr,"*":()=>[]}}))}const Or=e=>Br(br(e)),Rr=e=>Br(wr(e));function Br(e){return e.slice().sort(((e,t)=>e.line&&t.line?e.line-t.line:0))}function Fr(e,t){let n=!1;if(t&&t.length)for(const i of t)e.fire(new Xe(new Error(i.message))),n=!0;return n}var Nr=jr;function jr(e,t,n){var i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var r=new Int32Array(this.arrayBuffer);e=r[0],this.d=(t=r[1])+2*(n=r[2]);for(var o=0;o<this.d*this.d;o++){var a=r[3+o],s=r[3+o+1];i.push(a===s?null:r.subarray(a,s))}var l=r[3+i.length+1];this.keys=r.subarray(r[3+i.length],l),this.bboxes=r.subarray(l),this.insert=this._insertReadonly}else{this.d=t+2*n;for(var c=0;c<this.d*this.d;c++)i.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=n,this.scale=t/e,this.uid=0;var u=n/t*e;this.min=-u,this.max=e+u}jr.prototype.insert=function(e,t,n,i,r){this._forEachCell(t,n,i,r,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(r)},jr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},jr.prototype._insertCell=function(e,t,n,i,r,o){this.cells[r].push(o)},jr.prototype.query=function(e,t,n,i,r){var o=this.min,a=this.max;if(e<=o&&t<=o&&a<=n&&a<=i&&!r)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,n,i,this._queryCell,s,{},r),s},jr.prototype._queryCell=function(e,t,n,i,r,o,a,s){var l=this.cells[r];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===a[d]){var f=4*d;(s?s(u[f+0],u[f+1],u[f+2],u[f+3]):e<=u[f+2]&&t<=u[f+3]&&n>=u[f+0]&&i>=u[f+1])?(a[d]=!0,o.push(c[d])):a[d]=!1}}},jr.prototype._forEachCell=function(e,t,n,i,r,o,a,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(n),h=this._convertToCellCoord(i),d=l;d<=u;d++)for(var f=c;f<=h;f++){var p=this.d*f+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(f),this._convertFromCellCoord(d+1),this._convertFromCellCoord(f+1)))&&r.call(this,e,t,n,i,p,o,a,s))return}},jr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},jr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},jr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,n=0,i=0;i<this.cells.length;i++)n+=this.cells[i].length;var r=new Int32Array(t+n+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;for(var o=t,a=0;a<e.length;a++){var s=e[a];r[3+a]=o,r.set(s,o),o+=s.length}return r[3+e.length]=o,r.set(this.keys,o),r[3+e.length+1]=o+=this.keys.length,r.set(this.bboxes,o),o+=this.bboxes.length,r.buffer};const Ur={};function Vr(e,t,n={}){Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Ur[t]={klass:e,omit:n.omit||[]}}Vr(Object,"Object"),Nr.serialize=function(e,t){const n=e.toArrayBuffer();return t&&t.push(n),{buffer:n}},Nr.deserialize=function(e){return new Nr(e.buffer)},Object.defineProperty(Nr,"name",{value:"Grid"}),Vr(Nr,"Grid"),Vr(Ct,"Color"),Vr(Error,"Error"),Vr(ae,"AJAXError"),Vr(Pt,"ResolvedImage"),Vr(Hi,"StylePropertyFunction"),Vr(Gi,"StyleExpression",{omit:["_evaluator"]}),Vr(Zi,"ZoomDependentExpression"),Vr(Wi,"ZoomConstantExpression"),Vr(Yt,"CompoundExpression",{omit:["_evaluate"]});for(const e in ki)Ur[ki[e]._classRegistryKey]||Vr(ki[e],`Expression${e}`);function Gr(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function qr(e){return t.ImageBitmap&&e instanceof t.ImageBitmap}function $r(e,n){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(Gr(e)||qr(e))return n&&n.push(e),e;if(ArrayBuffer.isView(e)){const t=e;return n&&n.push(t.buffer),t}if(e instanceof t.ImageData)return n&&n.push(e.data.buffer),e;if(Array.isArray(e)){const t=[];for(const i of e)t.push($r(i,n));return t}if("object"==typeof e){const t=e.constructor,i=t._classRegistryKey;if(!i)throw new Error(`can't serialize object of unregistered class ${i}`);const r=t.serialize?t.serialize(e,n):{};if(!t.serialize){for(const t in e)e.hasOwnProperty(t)&&(Ur[i].omit.indexOf(t)>=0||(r[t]=$r(e[t],n)));e instanceof Error&&(r.message=e.message)}if(r.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(r.$name=i),r}throw new Error("can't serialize object of type "+typeof e)}function Wr(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||Gr(e)||qr(e)||ArrayBuffer.isView(e)||e instanceof t.ImageData)return e;if(Array.isArray(e))return e.map(Wr);if("object"==typeof e){const t=e.$name||"Object",{klass:n}=Ur[t];if(!n)throw new Error(`can't deserialize unregistered class ${t}`);if(n.deserialize)return n.deserialize(e);const i=Object.create(n.prototype);for(const t of Object.keys(e))"$name"!==t&&(i[t]=Wr(e[t]));return i}throw new Error("can't deserialize object of type "+typeof e)}const Zr=e=>e>=1536&&e<=1791,Xr=e=>e>=1872&&e<=1919,Hr=e=>e>=2208&&e<=2303,Yr=e=>e>=11904&&e<=12031,Kr=e=>e>=12032&&e<=12255,Jr=e=>e>=12272&&e<=12287,Qr=e=>e>=12288&&e<=12351,eo=e=>e>=12352&&e<=12447,to=e=>e>=12448&&e<=12543,no=e=>e>=12544&&e<=12591,io=e=>e>=12704&&e<=12735,ro=e=>e>=12736&&e<=12783,oo=e=>e>=12784&&e<=12799,ao=e=>e>=12800&&e<=13055,so=e=>e>=13056&&e<=13311,lo=e=>e>=13312&&e<=19903,co=e=>e>=19968&&e<=40959,uo=e=>e>=40960&&e<=42127,ho=e=>e>=42128&&e<=42191,fo=e=>e>=44032&&e<=55215,po=e=>e>=63744&&e<=64255,mo=e=>e>=64336&&e<=65023,go=e=>e>=65040&&e<=65055,_o=e=>e>=65072&&e<=65103,yo=e=>e>=65104&&e<=65135,vo=e=>e>=65136&&e<=65279,xo=e=>e>=65280&&e<=65519;function bo(e){for(const t of e)if(To(t.charCodeAt(0)))return!0;return!1}function wo(e){for(const t of e)if(!Eo(t.charCodeAt(0)))return!1;return!0}function Eo(e){return!(Zr(e)||Xr(e)||Hr(e)||mo(e)||vo(e))}function To(e){return!(746!==e&&747!==e&&(e<4352||!(io(e)||no(e)||_o(e)&&!(e>=65097&&e<=65103)||po(e)||so(e)||Yr(e)||ro(e)||!(!Qr(e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||lo(e)||co(e)||ao(e)||(e=>e>=12592&&e<=12687)(e)||(e=>e>=43360&&e<=43391)(e)||(e=>e>=55216&&e<=55295)(e)||(e=>e>=4352&&e<=4607)(e)||fo(e)||eo(e)||Jr(e)||(e=>e>=12688&&e<=12703)(e)||Kr(e)||oo(e)||to(e)&&12540!==e||!(!xo(e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!yo(e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||(e=>e>=5120&&e<=5759)(e)||(e=>e>=6320&&e<=6399)(e)||go(e)||(e=>e>=19904&&e<=19967)(e)||uo(e)||ho(e))))}function So(e){return!(To(e)||function(e){return!!((e=>e>=128&&e<=255)(e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||(e=>e>=8192&&e<=8303)(e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||(e=>e>=8448&&e<=8527)(e)||(e=>e>=8528&&e<=8591)(e)||(e=>e>=8960&&e<=9215)(e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||(e=>e>=9216&&e<=9279)(e)&&9251!==e||(e=>e>=9280&&e<=9311)(e)||(e=>e>=9312&&e<=9471)(e)||(e=>e>=9632&&e<=9727)(e)||(e=>e>=9728&&e<=9983)(e)&&!(e>=9754&&e<=9759)||(e=>e>=11008&&e<=11263)(e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Qr(e)||to(e)||(e=>e>=57344&&e<=63743)(e)||_o(e)||yo(e)||xo(e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function Ao(e){return e>=1424&&e<=2303||mo(e)||vo(e)}function Co(e,t){return!(!t&&Ao(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||(e=>e>=6016&&e<=6143)(e))}function ko(e){for(const t of e)if(Ao(t.charCodeAt(0)))return!0;return!1}const Mo="deferred",Io="loading",Po="loaded";let Do=null,zo="unavailable",Lo=null;const Oo=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(zo="error"),Do&&Do(e)};function Ro(){Bo.fire(new Ze("pluginStateChange",{pluginStatus:zo,pluginURL:Lo}))}const Bo=new He,Fo=function(){return zo},No=function(){if(zo!==Mo||!Lo)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");zo=Io,Ro(),Lo&&ce({url:Lo},(e=>{e?Oo(e):(zo=Po,Ro())}))},jo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>zo===Po||null!=jo.applyArabicShaping,isLoading:()=>zo===Io,setState(e){zo=e.pluginStatus,Lo=e.pluginURL},isParsed:()=>null!=jo.applyArabicShaping&&null!=jo.processBidirectionalText&&null!=jo.processStyledBidirectionalText,getPluginURL:()=>Lo};class Uo{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0)}isSupportedScript(e){return function(e,t){for(const n of e)if(!Co(n.charCodeAt(0),t))return!1;return!0}(e,jo.isLoaded())}}class Vo{constructor(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(Oi(e))return new Hi(e,t);if(qi(e)){const n=Xi(e,t);if("error"===n.result)throw new Error(n.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return n.value}{let n=e;return"string"==typeof e&&"color"===t.type&&(n=Ct.parse(e)),{kind:"constant",evaluate:()=>n}}}(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,n){return this.property.possiblyEvaluate(this,e,t,n)}}class Go{constructor(e){this.property=e,this.value=new Vo(e,void 0)}transitioned(e,t){return new $o(this.property,this.value,t,M({},e.transition,this.transition),e.now)}untransitioned(){return new $o(this.property,this.value,null,{},0)}}class qo{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return N(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Go(this._values[e].property)),this._values[e].value=new Vo(this._values[e].property,null===t?void 0:N(t))}getTransition(e){return N(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Go(this._values[e].property)),this._values[e].transition=N(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const n=this.getValue(t);void 0!==n&&(e[t]=n);const i=this.getTransition(t);void 0!==i&&(e[`${t}-transition`]=i)}return e}transitioned(e,t){const n=new Wo(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].transitioned(e,t._values[i]);return n}untransitioned(){const e=new Wo(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class $o{constructor(e,t,n,i,r){const o=i.delay||0,a=i.duration||0;r=r||0,this.property=e,this.value=t,this.begin=r+o,this.end=this.begin+a,e.specification.transition&&(i.delay||i.duration)&&(this.prior=n)}possiblyEvaluate(e,t,n){const i=e.now||0,r=this.value.possiblyEvaluate(e,t,n),o=this.prior;if(o){if(i>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(i<this.begin)return o.possiblyEvaluate(e,t,n);{const a=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,n),r,b(a))}}return r}}class Wo{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,n){const i=new Ho(this._properties);for(const r of Object.keys(this._values))i._values[r]=this._values[r].possiblyEvaluate(e,t,n);return i}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Zo{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return N(this._values[e].value)}setValue(e,t){this._values[e]=new Vo(this._values[e].property,null===t?void 0:N(t))}serialize(){const e={};for(const t of Object.keys(this._values)){const n=this.getValue(t);void 0!==n&&(e[t]=n)}return e}possiblyEvaluate(e,t,n){const i=new Ho(this._properties);for(const r of Object.keys(this._values))i._values[r]=this._values[r].possiblyEvaluate(e,t,n);return i}}class Xo{constructor(e,t,n){this.property=e,this.value=t,this.parameters=n}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,n,i){return this.property.evaluate(this.value,this.parameters,e,t,n,i)}}class Ho{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Yo{constructor(e){this.specification=e}possiblyEvaluate(e,t){return e.expression.evaluate(t)}interpolate(e,t,n){const i=Mn[this.specification.type];return i?i(e,t,n):e}}class Ko{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,n,i){return new Xo(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},n,i)}:e.expression,t)}interpolate(e,t,n){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Xo(this,{kind:"constant",value:void 0},e.parameters);const i=Mn[this.specification.type];return i?new Xo(this,{kind:"constant",value:i(e.value.value,t.value.value,n)},e.parameters):e}evaluate(e,t,n,i,r,o){return"constant"===e.kind?e.value:e.evaluate(t,n,i,r,o)}}class Jo{constructor(e){this.specification=e}possiblyEvaluate(e,t,n,i){return!!e.expression.evaluate(t,null,{},n,i)}interpolate(){return!1}}class Qo{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];const t=new Uo(0,{});for(const n in e){const i=e[n];i.specification.overridable&&this.overridableProperties.push(n);const r=this.defaultPropertyValues[n]=new Vo(i,void 0),o=this.defaultTransitionablePropertyValues[n]=new Go(i);this.defaultTransitioningPropertyValues[n]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=r.possiblyEvaluate(t)}}}function ea(e,t){return 256*(e=T(Math.floor(e),0,255))+T(Math.floor(t),0,255)}Vr(Ko,"DataDrivenProperty"),Vr(Yo,"DataConstantProperty"),Vr(Jo,"ColorRampProperty");const ta={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class na{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ia{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function ra(e,t=1){let n=0,i=0;return{members:e.map((e=>{const r=ta[e.type].BYTES_PER_ELEMENT,o=n=oa(n,Math.max(t,r)),a=e.components||1;return i=Math.max(i,r),n+=r*a,{name:e.name,type:e.type,components:a,offset:o}})),size:oa(n,Math.max(i,t)),alignment:t}}function oa(e,t){return Math.ceil(e/t)*t}class aa extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){const i=2*e;return this.int16[i+0]=t,this.int16[i+1]=n,e}}aa.prototype.bytesPerElement=4,Vr(aa,"StructArrayLayout2i4");class sa extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n)}emplace(e,t,n,i){const r=3*e;return this.int16[r+0]=t,this.int16[r+1]=n,this.int16[r+2]=i,e}}sa.prototype.bytesPerElement=6,Vr(sa,"StructArrayLayout3i6");class la extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n,i)}emplace(e,t,n,i,r){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=n,this.int16[o+2]=i,this.int16[o+3]=r,e}}la.prototype.bytesPerElement=8,Vr(la,"StructArrayLayout4i8");class ca extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,i,r,o,a)}emplace(e,t,n,i,r,o,a,s){const l=6*e,c=12*e,u=3*e;return this.int16[l+0]=t,this.int16[l+1]=n,this.uint8[c+4]=i,this.uint8[c+5]=r,this.uint8[c+6]=o,this.uint8[c+7]=a,this.float32[u+2]=s,e}}ca.prototype.bytesPerElement=12,Vr(ca,"StructArrayLayout2i4ub1f12");class ua extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n,i)}emplace(e,t,n,i,r){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=n,this.float32[o+2]=i,this.float32[o+3]=r,e}}ua.prototype.bytesPerElement=16,Vr(ua,"StructArrayLayout4f16");class ha extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,i,r)}emplace(e,t,n,i,r,o){const a=6*e,s=3*e;return this.uint16[a+0]=t,this.uint16[a+1]=n,this.uint16[a+2]=i,this.uint16[a+3]=r,this.float32[s+2]=o,e}}ha.prototype.bytesPerElement=12,Vr(ha,"StructArrayLayout4ui1f12");class da extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n,i)}emplace(e,t,n,i,r){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=n,this.uint16[o+2]=i,this.uint16[o+3]=r,e}}da.prototype.bytesPerElement=8,Vr(da,"StructArrayLayout4ui8");class fa extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,i,r,o)}emplace(e,t,n,i,r,o,a){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=i,this.int16[s+3]=r,this.int16[s+4]=o,this.int16[s+5]=a,e}}fa.prototype.bytesPerElement=12,Vr(fa,"StructArrayLayout6i12");class pa extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r,o,a,s,l,c,u,h){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,n,i,r,o,a,s,l,c,u,h)}emplace(e,t,n,i,r,o,a,s,l,c,u,h,d){const f=12*e;return this.int16[f+0]=t,this.int16[f+1]=n,this.int16[f+2]=i,this.int16[f+3]=r,this.uint16[f+4]=o,this.uint16[f+5]=a,this.uint16[f+6]=s,this.uint16[f+7]=l,this.int16[f+8]=c,this.int16[f+9]=u,this.int16[f+10]=h,this.int16[f+11]=d,e}}pa.prototype.bytesPerElement=24,Vr(pa,"StructArrayLayout4i4ui4i24");class ma extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,n,i,r,o)}emplace(e,t,n,i,r,o,a){const s=10*e,l=5*e;return this.int16[s+0]=t,this.int16[s+1]=n,this.int16[s+2]=i,this.float32[l+2]=r,this.float32[l+3]=o,this.float32[l+4]=a,e}}ma.prototype.bytesPerElement=20,Vr(ma,"StructArrayLayout3i3f20");class ga extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}ga.prototype.bytesPerElement=4,Vr(ga,"StructArrayLayout1ul4");class _a extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r,o,a,s,l,c,u,h,d){const f=this.length;return this.resize(f+1),this.emplace(f,e,t,n,i,r,o,a,s,l,c,u,h,d)}emplace(e,t,n,i,r,o,a,s,l,c,u,h,d,f){const p=20*e,m=10*e;return this.int16[p+0]=t,this.int16[p+1]=n,this.int16[p+2]=i,this.int16[p+3]=r,this.int16[p+4]=o,this.float32[m+3]=a,this.float32[m+4]=s,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[p+14]=u,this.uint32[m+8]=h,this.uint16[p+18]=d,this.uint16[p+19]=f,e}}_a.prototype.bytesPerElement=40,Vr(_a,"StructArrayLayout5i4f1i1ul2ui40");class ya extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r,o,a){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,n,i,r,o,a)}emplace(e,t,n,i,r,o,a,s){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=n,this.int16[l+2]=i,this.int16[l+4]=r,this.int16[l+5]=o,this.int16[l+6]=a,this.int16[l+7]=s,e}}ya.prototype.bytesPerElement=16,Vr(ya,"StructArrayLayout3i2i2i16");class va extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,i,r)}emplace(e,t,n,i,r,o){const a=4*e,s=8*e;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=i,this.int16[s+6]=r,this.int16[s+7]=o,e}}va.prototype.bytesPerElement=16,Vr(va,"StructArrayLayout2f1f2i16");class xa extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n,i)}emplace(e,t,n,i,r){const o=12*e,a=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=n,this.float32[a+1]=i,this.float32[a+2]=r,e}}xa.prototype.bytesPerElement=12,Vr(xa,"StructArrayLayout2ub2f12");class ba extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n)}emplace(e,t,n,i){const r=3*e;return this.float32[r+0]=t,this.float32[r+1]=n,this.float32[r+2]=i,e}}ba.prototype.bytesPerElement=12,Vr(ba,"StructArrayLayout3f12");class wa extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,n)}emplace(e,t,n,i){const r=3*e;return this.uint16[r+0]=t,this.uint16[r+1]=n,this.uint16[r+2]=i,e}}wa.prototype.bytesPerElement=6,Vr(wa,"StructArrayLayout3ui6");class Ea extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x){const b=this.length;return this.resize(b+1),this.emplace(b,e,t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x)}emplace(e,t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b){const w=30*e,E=15*e,T=60*e;return this.int16[w+0]=t,this.int16[w+1]=n,this.int16[w+2]=i,this.float32[E+2]=r,this.float32[E+3]=o,this.uint16[w+8]=a,this.uint16[w+9]=s,this.uint32[E+5]=l,this.uint32[E+6]=c,this.uint32[E+7]=u,this.uint16[w+16]=h,this.uint16[w+17]=d,this.uint16[w+18]=f,this.float32[E+10]=p,this.float32[E+11]=m,this.uint8[T+48]=g,this.uint8[T+49]=_,this.uint8[T+50]=y,this.uint32[E+13]=v,this.int16[w+28]=x,this.uint8[T+58]=b,e}}Ea.prototype.bytesPerElement=60,Vr(Ea,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Ta extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b,w,E,T,S,A,C,k,M){const I=this.length;return this.resize(I+1),this.emplace(I,e,t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b,w,E,T,S,A,C,k,M)}emplace(e,t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b,w,E,T,S,A,C,k,M,I){const P=38*e,D=19*e;return this.int16[P+0]=t,this.int16[P+1]=n,this.int16[P+2]=i,this.float32[D+2]=r,this.float32[D+3]=o,this.int16[P+8]=a,this.int16[P+9]=s,this.int16[P+10]=l,this.int16[P+11]=c,this.int16[P+12]=u,this.int16[P+13]=h,this.uint16[P+14]=d,this.uint16[P+15]=f,this.uint16[P+16]=p,this.uint16[P+17]=m,this.uint16[P+18]=g,this.uint16[P+19]=_,this.uint16[P+20]=y,this.uint16[P+21]=v,this.uint16[P+22]=x,this.uint16[P+23]=b,this.uint16[P+24]=w,this.uint16[P+25]=E,this.uint16[P+26]=T,this.uint16[P+27]=S,this.uint16[P+28]=A,this.uint32[D+15]=C,this.float32[D+16]=k,this.float32[D+17]=M,this.float32[D+18]=I,e}}Ta.prototype.bytesPerElement=76,Vr(Ta,"StructArrayLayout3i2f6i15ui1ul3f76");class Sa extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}Sa.prototype.bytesPerElement=4,Vr(Sa,"StructArrayLayout1f4");class Aa extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,n,i,r){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,n,i,r)}emplace(e,t,n,i,r,o){const a=5*e;return this.float32[a+0]=t,this.float32[a+1]=n,this.float32[a+2]=i,this.float32[a+3]=r,this.float32[a+4]=o,e}}Aa.prototype.bytesPerElement=20,Vr(Aa,"StructArrayLayout5f20");class Ca extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,n,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,n,i)}emplace(e,t,n,i,r){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=n,this.uint16[o+3]=i,this.uint16[o+4]=r,e}}Ca.prototype.bytesPerElement=12,Vr(Ca,"StructArrayLayout1ul3ui12");class ka extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){const i=2*e;return this.uint16[i+0]=t,this.uint16[i+1]=n,e}}ka.prototype.bytesPerElement=4,Vr(ka,"StructArrayLayout2ui4");class Ma extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}Ma.prototype.bytesPerElement=2,Vr(Ma,"StructArrayLayout1ui2");class Ia extends ia{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const n=this.length;return this.resize(n+1),this.emplace(n,e,t)}emplace(e,t,n){const i=2*e;return this.float32[i+0]=t,this.float32[i+1]=n,e}}Ia.prototype.bytesPerElement=8,Vr(Ia,"StructArrayLayout2f8");class Pa extends na{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}Pa.prototype.size=40;class Da extends _a{get(e){return new Pa(this,e)}}Vr(Da,"CollisionBoxArray");class za extends na{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}za.prototype.size=60;class La extends Ea{get(e){return new za(this,e)}}Vr(La,"PlacedSymbolArray");class Oa extends na{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+11]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+13]}get key(){return this._structArray.uint16[this._pos2+14]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+17]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+19]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+21]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+22]}get featureIndex(){return this._structArray.uint16[this._pos2+23]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+25]}get numIconVertices(){return this._structArray.uint16[this._pos2+26]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+27]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+28]}get crossTileID(){return this._structArray.uint32[this._pos4+15]}set crossTileID(e){this._structArray.uint32[this._pos4+15]=e}get textOffset0(){return this._structArray.float32[this._pos4+16]}get textOffset1(){return this._structArray.float32[this._pos4+17]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+18]}}Oa.prototype.size=76;class Ra extends Ta{get(e){return new Oa(this,e)}}Vr(Ra,"SymbolInstanceArray");class Ba extends Sa{getoffsetX(e){return this.float32[1*e+0]}}Vr(Ba,"GlyphOffsetArray");class Fa extends aa{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}Vr(Fa,"SymbolLineVertexArray");class Na extends na{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}Na.prototype.size=12;class ja extends Ca{get(e){return new Na(this,e)}}Vr(ja,"FeatureIndexArray");class Ua extends ka{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}Vr(Ua,"FillExtrusionCentroidArray");const Va=ra([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Ga=ra([{name:"a_dash",components:4,type:"Uint16"}]);var qa={exports:{}},$a=function(e,t){var n,i,r,o,a,s,l,c;for(i=e.length-(n=3&e.length),r=t,a=3432918353,s=461845907,c=0;c<i;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,n){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return r^=e.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0},Wa=function(e,t){for(var n,i=e.length,r=t^i,o=0;i>=4;)n=1540483477*(65535&(n=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(n>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0};qa.exports=$a,qa.exports.murmur3=$a,qa.exports.murmur2=Wa;class Za{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,n,i){this.ids.push(Xa(e)),this.positions.push(t,n,i)}getPositions(e){const t=Xa(e);let n=0,i=this.ids.length-1;for(;n<i;){const e=n+i>>1;this.ids[e]>=t?i=e:n=e+1}const r=[];for(;this.ids[n]===t;)r.push({index:this.positions[3*n],start:this.positions[3*n+1],end:this.positions[3*n+2]}),n++;return r}static serialize(e,t){const n=new Float64Array(e.ids),i=new Uint32Array(e.positions);return Ha(n,i,0,n.length-1),t&&t.push(n.buffer,i.buffer),{ids:n,positions:i}}static deserialize(e){const t=new Za;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function Xa(e){const t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:qa.exports(String(e))}function Ha(e,t,n,i){for(;n<i;){const r=e[n+i>>1];let o=n-1,a=i+1;for(;;){do{o++}while(e[o]<r);do{a--}while(e[a]>r);if(o>=a)break;Ya(e,o,a),Ya(t,3*o,3*a),Ya(t,3*o+1,3*a+1),Ya(t,3*o+2,3*a+2)}a-n<i-a?(Ha(e,t,n,a),n=a+1):(Ha(e,t,a+1,i),i=a)}}function Ya(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}Vr(Za,"FeaturePositionMap");class Ka{constructor(e){this.gl=e.gl,this.initialized=!1}fetchUniformLocation(e,t){return this.location||this.initialized||(this.location=this.gl.getUniformLocation(e,t),this.initialized=!0),!!this.location}}class Ja extends Ka{constructor(e){super(e),this.current=0}set(e,t,n){this.fetchUniformLocation(e,t)&&this.current!==n&&(this.current=n,this.gl.uniform1f(this.location,n))}}class Qa extends Ka{constructor(e){super(e),this.current=[0,0,0,0]}set(e,t,n){this.fetchUniformLocation(e,t)&&(n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]&&n[3]===this.current[3]||(this.current=n,this.gl.uniform4f(this.location,n[0],n[1],n[2],n[3])))}}class es extends Ka{constructor(e){super(e),this.current=Ct.transparent}set(e,t,n){this.fetchUniformLocation(e,t)&&(n.r===this.current.r&&n.g===this.current.g&&n.b===this.current.b&&n.a===this.current.a||(this.current=n,this.gl.uniform4f(this.location,n.r,n.g,n.b,n.a)))}}const ts=new Float32Array(16),ns=new Float32Array(9),is=new Float32Array(4);function rs(e){return[ea(255*e.r,255*e.g),ea(255*e.b,255*e.a)]}class os{constructor(e,t,n){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=n}setUniform(e,t,n,i,r){t.set(e,r,i.constantOr(this.value))}getBinding(e,t){return"color"===this.type?new es(e):new Ja(e)}}class as{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,t,n,i,r){const o="u_pattern"===r||"u_dash"===r?this.pattern:"u_pixel_ratio"===r?this.pixelRatio:null;o&&t.set(e,r,o)}getBinding(e,t){return"u_pattern"===t||"u_dash"===t?new Qa(e):new Ja(e)}}class ss{constructor(e,t,n,i){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===n?2:1,offset:0}))),this.paintVertexArray=new i}populatePaintArray(e,t,n,i,r,o){const a=this.paintVertexArray.length,s=this.expression.evaluate(new Uo(0),t,{},r,i,o);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,t,n,i,r){const o=this.expression.evaluate({zoom:0},n,i,void 0,r);this._setPaintValue(e,t,o)}_setPaintValue(e,t,n){if("color"===this.type){const i=rs(n);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ls{constructor(e,t,n,i,r,o){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=n,this.useIntegerZoom=i,this.zoom=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===n?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,n,i,r,o){const a=this.expression.evaluate(new Uo(this.zoom),t,{},r,i,o),s=this.expression.evaluate(new Uo(this.zoom+1),t,{},r,i,o),l=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(l,e,a,s)}updatePaintArray(e,t,n,i,r){const o=this.expression.evaluate({zoom:this.zoom},n,i,void 0,r),a=this.expression.evaluate({zoom:this.zoom+1},n,i,void 0,r);this._setPaintValue(e,t,o,a)}_setPaintValue(e,t,n,i){if("color"===this.type){const r=rs(n),o=rs(i);for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r[0],r[1],o[0],o[1])}else{for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n,i);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t,n,i,r){const o=this.useIntegerZoom?Math.floor(n.zoom):n.zoom,a=T(this.expression.interpolationFactor(o,this.zoom,this.zoom+1),0,1);t.set(e,r,a)}getBinding(e,t){return new Ja(e)}}class cs{constructor(e,t,n,i,r){this.expression=e,this.layerId=r,this.paintVertexAttributes=("array"===n?Ga:Va).members;for(let e=0;e<t.length;++e);this.paintVertexArray=new i}populatePaintArray(e,t,n){const i=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValues(i,e,t.patterns&&t.patterns[this.layerId],n)}updatePaintArray(e,t,n,i,r,o){this._setPaintValues(e,t,n.patterns&&n.patterns[this.layerId],o)}_setPaintValues(e,t,n,i){if(!i||!n)return;const r=i[n];if(!r)return;const{tl:o,br:a,pixelRatio:s}=r;for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,o[0],o[1],a[0],a[1],s)}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class us{constructor(e,t,n=(()=>!0)){this.binders={},this._buffers=[];const i=[];for(const r in e.paint._values){if(!n(r))continue;const o=e.paint.get(r);if(!(o instanceof Xo&&Pi(o.property.specification)))continue;const a=fs(r,e.type),s=o.value,l=o.property.specification.type,c=o.property.useIntegerZoom,u="line-dasharray"===r||r.endsWith("pattern"),h="line-dasharray"===r&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==s.kind||h)if("source"===s.kind||h||u){const t=gs(r,l,"source");this.binders[r]=u?new cs(s,a,l,t,e.id):new ss(s,a,l,t),i.push(`/a_${r}`)}else{const e=gs(r,l,"composite");this.binders[r]=new ls(s,a,l,c,t,e),i.push(`/z_${r}`)}else this.binders[r]=u?new as(s.value,a):new os(s.value,a,l),i.push(`/u_${r}`)}this.cacheKey=i.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof ss||t instanceof ls?t.maxValue:0}populatePaintArrays(e,t,n,i,r,o){for(const a in this.binders){const s=this.binders[a];(s instanceof ss||s instanceof ls||s instanceof cs)&&s.populatePaintArray(e,t,n,i,r,o)}}setConstantPatternPositions(e){for(const t in this.binders){const n=this.binders[t];n instanceof as&&n.setConstantPatternPositions(e)}}updatePaintArrays(e,t,n,i,r,o){let a=!1;for(const s in e){const l=t.getPositions(s);for(const t of l){const l=n.feature(t.index);for(const n in this.binders){const c=this.binders[n];if((c instanceof ss||c instanceof ls||c instanceof cs)&&!0===c.expression.isStateDependent){const u=i.paint.get(n);c.expression=u.value,c.updatePaintArray(t.start,t.end,l,e[s],r,o),a=!0}}}}return a}defines(){const e=[];for(const t in this.binders){const n=this.binders[t];(n instanceof os||n instanceof as)&&e.push(...n.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const n=this.binders[t];if(n instanceof ss||n instanceof ls||n instanceof cs)for(let t=0;t<n.paintVertexAttributes.length;t++)e.push(n.paintVertexAttributes[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const n=this.binders[t];if(n instanceof os||n instanceof as||n instanceof ls)for(const t of n.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e){const t=[];for(const n in this.binders){const i=this.binders[n];if(i instanceof os||i instanceof as||i instanceof ls)for(const r of i.uniformNames)t.push({name:r,property:n,binding:i.getBinding(e,r)})}return t}setUniforms(e,t,n,i,r){for(const{name:t,property:o,binding:a}of n)this.binders[o].setUniform(e,a,r,i.get(o),t)}updatePaintBuffers(){this._buffers=[];for(const e in this.binders){const t=this.binders[e];(t instanceof ss||t instanceof ls||t instanceof cs)&&t.paintVertexBuffer&&this._buffers.push(t.paintVertexBuffer)}}upload(e){for(const t in this.binders){const n=this.binders[t];(n instanceof ss||n instanceof ls||n instanceof cs)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof ss||t instanceof ls||t instanceof cs)&&t.destroy()}}}class hs{constructor(e,t,n=(()=>!0)){this.programConfigurations={};for(const i of e)this.programConfigurations[i.id]=new us(i,t,n);this.needsUpload=!1,this._featureMap=new Za,this._bufferOffset=0}populatePaintArrays(e,t,n,i,r,o,a){for(const n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(e,t,i,r,o,a);void 0!==t.id&&this._featureMap.add(t.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,n,i,r){for(const o of n)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,t,o,i,r)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const ds={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["ga
2pwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function fs(e,t){return ds[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const ps={"line-pattern":{source:ha,composite:ha},"fill-pattern":{source:ha,composite:ha},"fill-extrusion-pattern":{source:ha,composite:ha},"line-dasharray":{source:da,composite:da}},ms={color:{source:Ia,composite:ua},number:{source:Sa,composite:Ia}};function gs(e,t,n){const i=ps[e];return i&&i[n]||ms[t][n]}Vr(os,"ConstantBinder"),Vr(as,"PatternConstantBinder"),Vr(ss,"SourceExpressionBinder"),Vr(cs,"PatternCompositeBinder"),Vr(ls,"CompositeExpressionBinder"),Vr(us,"ProgramConfiguration",{omit:["_buffers"]}),Vr(hs,"ProgramConfigurationSet");const _s="-transition";class ys extends He{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new Zo(t.layout)),t.paint)){this._transitionablePaint=new qo(t.paint);for(const t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(const t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ho(t.paint)}}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t,n={}){null!=t&&this._validate(Rr,`layers.${this.id}.layout.${e}`,e,t,n)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}getPaintProperty(e){return R(e,_s)?this._transitionablePaint.getTransition(e.slice(0,-_s.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t,n={}){if(null!=t&&this._validate(Or,`layers.${this.id}.paint.${e}`,e,t,n))return!1;if(R(e,_s))return this._transitionablePaint.setTransition(e.slice(0,-_s.length),t||void 0),!1;{const n=this._transitionablePaint._values[e],i=n.value.isDataDriven(),r=n.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);const o=this._transitionablePaint._values[e].value,a=o.isDataDriven(),s=R(e,"pattern")||"line-dasharray"===e;return a||i||s||this._handleOverridablePaintPropertyUpdate(e,r,o)}}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getProgramConfiguration(e){return null}_handleOverridablePaintPropertyUpdate(e,t,n){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}
vendor: 28,048 bytes, line 2
2serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),F(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,n,i,r={}){return(!r||!1!==r.validate)&&Fr(this,e.call(Lr,{key:t,layerType:this.type,objectKey:n,value:i,styleSpec:Ye,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Xo&&Pi(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=ar(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}}const vs=ra([{name:"a_pos",components:2,type:"Int16"}],4),xs=ra([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class bs{constructor(e=[]){this.segments=e}prepareSegment(e,t,n,i){let r=this.segments[this.segments.length-1];return e>bs.MAX_VERTEX_ARRAY_LENGTH&&U(`Max vertices per segment is ${bs.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!r||r.vertexLength+e>bs.MAX_VERTEX_ARRAY_LENGTH||r.sortKey!==i)&&(r={vertexOffset:t.length,primitiveOffset:n.length,vertexLength:0,primitiveLength:0},void 0!==i&&(r.sortKey=i),this.segments.push(r)),r}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,n,i){return new bs([{vertexOffset:e,primitiveOffset:t,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])}}bs.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Vr(bs,"SegmentVector");var ws=8192;class Es{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof Ss?new Ss(e.lng,e.lat):Ss.convert(e),this}setSouthWest(e){return this._sw=e instanceof Ss?new Ss(e.lng,e.lat):Ss.convert(e),this}extend(e){const t=this._sw,n=this._ne;let i,r;if(e instanceof Ss)i=e,r=e;else{if(!(e instanceof Es))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(Es.convert(e)):this.extend(Ss.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&e.hasOwnProperty("lon")?this.extend(Ss.convert(e)):this;if(i=e._sw,r=e._ne,!i||!r)return this}return t||n?(t.lng=Math.min(i.lng,t.lng),t.lat=Math.min(i.lat,t.lat),n.lng=Math.max(r.lng,n.lng),n.lat=Math.max(r.lat,n.lat)):(this._sw=new Ss(i.lng,i.lat),this._ne=new Ss(r.lng,r.lat)),this}getCenter(){return new Ss((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Ss(this.getWest(),this.getNorth())}getSouthEast(){return new Ss(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:n}=Ss.convert(e);let i=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i}static convert(e){return!e||e instanceof Es?e:new Es(e)}}const Ts=6371008.8;class Ss{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ss(A(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,n=this.lat*t,i=e.lat*t,r=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((e.lng-this.lng)*t);return Ts*Math.acos(Math.min(r,1))}toBounds(e=0){const t=360*e/40075017,n=t/Math.cos(Math.PI/180*this.lat);return new Es(new Ss(this.lng-n,this.lat-t),new Ss(this.lng+n,this.lat+t))}static convert(e){if(e instanceof Ss)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Ss(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Ss(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const As=2*Math.PI*Ts;function Cs(e){return As*Math.cos(e*Math.PI/180)}function ks(e){return(180+e)/360}function Ms(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Is(e,t){return e/Cs(t)}function Ps(e){return 360*e-180}function Ds(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function zs(e,t){return e*Cs(Ds(t))}const Ls=85.051129;function Os(e){return 1/Math.cos(e*Math.PI/180)}class Rs{constructor(e,t,n=0){this.x=+e,this.y=+t,this.z=+n}static fromLngLat(e,t=0){const n=Ss.convert(e);return new Rs(ks(n.lng),Ms(n.lat),Is(t,n.lat))}toLngLat(){return new Ss(Ps(this.x),Ds(this.y))}toAltitude(){return zs(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/As*Os(Ds(this.y))}}function Bs(e,t,n,i,r,o,a,s,l){const c=(t+i)/2,u=(n+r)/2,h=new p(c,u);s(h),function(e,t,n,i,r,o){const a=n-r,s=i-o;return Math.abs((i-t)*a-(n-e)*s)/Math.hypot(a,s)}(h.x,h.y,o.x,o.y,a.x,a.y)>=l?(Bs(e,t,n,c,u,o,h,s,l),Bs(e,c,u,i,r,h,a,s,l)):e.push(a)}function Fs(e,t,n){let i=e[0],r=i.x,o=i.y;t(i);const a=[i];for(let s=1;s<e.length;s++){const l=e[s],{x:c,y:u}=l;t(l),Bs(a,r,o,c,u,i,l,t,n),r=c,o=u,i=l}return a}function Ns(e,t,n,i){if(i(t,n)){const r=t.add(n)._mult(.5);Ns(e,t,r,i),Ns(e,r,n,i)}else e.push(n)}function js(e,t){let n=e[0];const i=[n];for(let r=1;r<e.length;r++){const o=e[r];Ns(i,n,o,t),n=o}return i}const Us=Math.pow(2,14)-1,Vs=-Us-1;function Gs(e,t){const n=Math.round(e.x*t),i=Math.round(e.y*t);return e.x=T(n,Vs,Us),e.y=T(i,Vs,Us),(n<e.x||n>e.x+1||i<e.y||i>e.y+1)&&U("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function qs(e,t,n){const i=e.loadGeometry(),r=e.extent,o=ws/r;if(t&&n&&n.projection.isReprojectedInTileSpace){const o=1<<t.z,{scale:a,x:s,y:l,projection:c}=n,u=e=>{const n=Ps((t.x+e.x/r)/o),i=Ds((t.y+e.y/r)/o),u=c.project(n,i);e.x=(u.x*a-s)*r,e.y=(u.y*a-l)*r};for(let t=0;t<i.length;t++)if(1!==e.type)i[t]=Fs(i[t],u,1);else{const e=[];for(const n of i[t])n.x<0||n.x>=r||n.y<0||n.y>=r||(u(n),e.push(n));i[t]=e}}for(const e of i)for(const t of e)Gs(t,o);return i}function $s(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?qs(e):[]}}function Ws(e,t,n,i,r){e.emplaceBack(2*t+(i+1)/2,2*n+(r+1)/2)}function Zs(e,t,n){const i=16384;e.emplaceBack(t.x,t.y,t.z,n[0]*i,n[1]*i,n[2]*i)}class Xs{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new aa,this.indexArray=new wa,this.segments=new bs,this.programConfigurations=new hs(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n,i){const r=this.layers[0],o=[];let a=null;"circle"===r.type&&(a=r.layout.get("circle-sort-key"));for(const{feature:t,id:r,index:s,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=$s(t,e);if(!this.layers[0]._featureFilter.filter(new Uo(this.zoom),c,n))continue;const u=a?a.evaluate(c,{},n):void 0,h={id:r,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:qs(t,n,i),patterns:{},sortKey:u};o.push(h)}a&&o.sort(((e,t)=>e.sortKey-t.sortKey));let s=null;"globe"===i.projection.name&&(this.globeExtVertexArray=new fa,s=i.projection);for(const i of o){const{geometry:r,index:o,sourceLayerIndex:a}=i,l=e[o].feature;this.addFeature(i,r,o,t.availableImages,n,s),t.featureIndex.insert(l,r,o,a,this.index)}}update(e,t,n,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,vs.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,xs.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,t,n,i,r,o){for(const n of t)for(const t of n){const n=t.x,i=t.y;if(n<0||n>=ws||i<0||i>=ws)continue;if(o){const e=o.projectTilePoint(n,i,r),t=o.upVector(r,n,i),a=this.globeExtVertexArray;Zs(a,e,t),Zs(a,e,t),Zs(a,e,t),Zs(a,e,t)}const a=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),s=a.vertexLength;Ws(this.layoutVertexArray,n,i,-1,-1),Ws(this.layoutVertexArray,n,i,1,-1),Ws(this.layoutVertexArray,n,i,1,1),Ws(this.layoutVertexArray,n,i,-1,1),this.indexArray.emplaceBack(s,s+1,s+2),this.indexArray.emplaceBack(s,s+2,s+3),a.vertexLength+=4,a.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},i,r)}}function Hs(e,t){for(let n=0;n<e.length;n++)if(rl(t,e[n]))return!0;for(let n=0;n<t.length;n++)if(rl(e,t[n]))return!0;return!!Qs(e,t)}function Ys(e,t,n){return!!rl(e,t)||!!tl(t,e,n)}function Ks(e,t){if(1===e.length)return il(t,e[0]);for(let n=0;n<t.length;n++){const i=t[n];for(let t=0;t<i.length;t++)if(rl(e,i[t]))return!0}for(let n=0;n<e.length;n++)if(il(t,e[n]))return!0;for(let n=0;n<t.length;n++)if(Qs(e,t[n]))return!0;return!1}function Js(e,t,n){if(e.length>1){if(Qs(e,t))return!0;for(let i=0;i<t.length;i++)if(tl(t[i],e,n))return!0}for(let i=0;i<e.length;i++)if(tl(e[i],t,n))return!0;return!1}function Qs(e,t){if(0===e.length||0===t.length)return!1;for(let n=0;n<e.length-1;n++){const i=e[n],r=e[n+1];for(let e=0;e<t.length-1;e++)if(el(i,r,t[e],t[e+1]))return!0}return!1}function el(e,t,n,i){return V(e,n,i)!==V(t,n,i)&&V(e,t,n)!==V(e,t,i)}function tl(e,t,n){const i=n*n;if(1===t.length)return e.distSqr(t[0])<i;for(let n=1;n<t.length;n++)if(nl(e,t[n-1],t[n])<i)return!0;return!1}function nl(e,t,n){const i=t.distSqr(n);if(0===i)return e.distSqr(t);const r=((e.x-t.x)*(n.x-t.x)+(e.y-t.y)*(n.y-t.y))/i;return e.distSqr(r<0?t:r>1?n:n.sub(t)._mult(r)._add(t))}function il(e,t){let n,i,r,o=!1;for(let a=0;a<e.length;a++){n=e[a];for(let e=0,a=n.length-1;e<n.length;a=e++)i=n[e],r=n[a],i.y>t.y!=r.y>t.y&&t.x<(r.x-i.x)*(t.y-i.y)/(r.y-i.y)+i.x&&(o=!o)}return o}function rl(e,t){let n=!1;for(let i=0,r=e.length-1;i<e.length;r=i++){const o=e[i],a=e[r];o.y>t.y!=a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(n=!n)}return n}function ol(e,t,n,i,r){for(const o of e)if(t<=o.x&&n<=o.y&&i>=o.x&&r>=o.y)return!0;const o=[new p(t,n),new p(t,r),new p(i,r),new p(i,n)];if(e.length>2)for(const t of o)if(rl(e,t))return!0;for(let t=0;t<e.length-1;t++)if(al(e[t],e[t+1],o))return!0;return!1}function al(e,t,n){const i=n[0],r=n[2];if(e.x<i.x&&t.x<i.x||e.x>r.x&&t.x>r.x||e.y<i.y&&t.y<i.y||e.y>r.y&&t.y>r.y)return!1;const o=V(e,t,n[0]);return o!==V(e,t,n[1])||o!==V(e,t,n[2])||o!==V(e,t,n[3])}function sl(e,t,n){const i=t.paint.get(e).value;return"constant"===i.kind?i.value:n.programConfigurations.get(t.id).getMaxValue(e)}function ll(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function cl(e,t,n,i,r){if(!t[0]&&!t[1])return e;const o=p.convert(t)._mult(r);"viewport"===n&&o._rotate(-i);const a=[];for(let t=0;t<e.length;t++)a.push(e[t].sub(o));return a}function ul(e,t,n,i){const r=p.convert(e)._mult(i);return"viewport"===t&&r._rotate(-n),r}Vr(Xs,"CircleBucket",{omit:["layers"]});const hl=new Qo({"circle-sort-key":new Ko(Ye.layout_circle["circle-sort-key"])});var dl={paint:new Qo({"circle-radius":new Ko(Ye.paint_circle["circle-radius"]),"circle-color":new Ko(Ye.paint_circle["circle-color"]),"circle-blur":new Ko(Ye.paint_circle["circle-blur"]),"circle-opacity":new Ko(Ye.paint_circle["circle-opacity"]),"circle-translate":new Yo(Ye.paint_circle["circle-translate"]),"circle-translate-anchor":new Yo(Ye.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Yo(Ye.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Yo(Ye.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ko(Ye.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ko(Ye.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ko(Ye.paint_circle["circle-stroke-opacity"])}),layout:hl},fl=1e-6,pl="undefined"!=typeof Float32Array?Float32Array:Array;function ml(){var e=new pl(9);return pl!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function gl(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=n[0],f=n[1],p=n[2],m=n[3],g=n[4],_=n[5],y=n[6],v=n[7],x=n[8];return e[0]=d*i+f*a+p*c,e[1]=d*r+f*s+p*u,e[2]=d*o+f*l+p*h,e[3]=m*i+g*a+_*c,e[4]=m*r+g*s+_*u,e[5]=m*o+g*l+_*h,e[6]=y*i+v*a+x*c,e[7]=y*r+v*s+x*u,e[8]=y*o+v*l+x*h,e}function _l(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function yl(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],d=t[10],f=t[11],p=t[12],m=t[13],g=t[14],_=t[15],y=n*s-i*a,v=n*l-r*a,x=n*c-o*a,b=i*l-r*s,w=i*c-o*s,E=r*c-o*l,T=u*m-h*p,S=u*g-d*p,A=u*_-f*p,C=h*g-d*m,k=h*_-f*m,M=d*_-f*g,I=y*M-v*k+x*C+b*A-w*S+E*T;return I?(e[0]=(s*M-l*k+c*C)*(I=1/I),e[1]=(r*k-i*M-o*C)*I,e[2]=(m*E-g*w+_*b)*I,e[3]=(d*w-h*E-f*b)*I,e[4]=(l*A-a*M-c*S)*I,e[5]=(n*M-r*A+o*S)*I,e[6]=(g*x-p*E-_*v)*I,e[7]=(u*E-d*x+f*v)*I,e[8]=(a*k-s*A+c*T)*I,e[9]=(i*A-n*k-o*T)*I,e[10]=(p*w-m*x+_*y)*I,e[11]=(h*x-u*w-f*y)*I,e[12]=(s*S-a*C-l*T)*I,e[13]=(n*C-i*S+r*T)*I,e[14]=(m*v-p*b-g*y)*I,e[15]=(u*b-h*v+d*y)*I,e):null}function vl(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],m=t[12],g=t[13],_=t[14],y=t[15],v=n[0],x=n[1],b=n[2],w=n[3];return e[0]=v*i+x*s+b*h+w*m,e[1]=v*r+x*l+b*d+w*g,e[2]=v*o+x*c+b*f+w*_,e[3]=v*a+x*u+b*p+w*y,e[4]=(v=n[4])*i+(x=n[5])*s+(b=n[6])*h+(w=n[7])*m,e[5]=v*r+x*l+b*d+w*g,e[6]=v*o+x*c+b*f+w*_,e[7]=v*a+x*u+b*p+w*y,e[8]=(v=n[8])*i+(x=n[9])*s+(b=n[10])*h+(w=n[11])*m,e[9]=v*r+x*l+b*d+w*g,e[10]=v*o+x*c+b*f+w*_,e[11]=v*a+x*u+b*p+w*y,e[12]=(v=n[12])*i+(x=n[13])*s+(b=n[14])*h+(w=n[15])*m,e[13]=v*r+x*l+b*d+w*g,e[14]=v*o+x*c+b*f+w*_,e[15]=v*a+x*u+b*p+w*y,e}function xl(e,t,n){var i,r,o,a,s,l,c,u,h,d,f,p,m=n[0],g=n[1],_=n[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*_+t[12],e[13]=t[1]*m+t[5]*g+t[9]*_+t[13],e[14]=t[2]*m+t[6]*g+t[10]*_+t[14],e[15]=t[3]*m+t[7]*g+t[11]*_+t[15]):(r=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],f=t[10],p=t[11],e[0]=i=t[0],e[1]=r,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=d,e[10]=f,e[11]=p,e[12]=i*m+s*g+h*_+t[12],e[13]=r*m+l*g+d*_+t[13],e[14]=o*m+c*g+f*_+t[14],e[15]=a*m+u*g+p*_+t[15]),e}function bl(e,t,n){var i=n[0],r=n[1],o=n[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function wl(e,t,n){var i=Math.sin(n),r=Math.cos(n),o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*r+c*i,e[5]=a*r+u*i,e[6]=s*r+h*i,e[7]=l*r+d*i,e[8]=c*r-o*i,e[9]=u*r-a*i,e[10]=h*r-s*i,e[11]=d*r-l*i,e}function El(e,t,n){var i=Math.sin(n),r=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],c=t[8],u=t[9],h=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*r-c*i,e[1]=a*r-u*i,e[2]=s*r-h*i,e[3]=l*r-d*i,e[8]=o*i+c*r,e[9]=a*i+u*r,e[10]=s*i+h*r,e[11]=l*i+d*r,e}function Tl(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Sl(e,t,n){var i,r,o,a=n[0],s=n[1],l=n[2],c=Math.hypot(a,s,l);return c<fl?null:(a*=c=1/c,s*=c,l*=c,i=Math.sin(t),r=Math.cos(t),e[0]=a*a*(o=1-r)+r,e[1]=s*a*o+l*i,e[2]=l*a*o-s*i,e[3]=0,e[4]=a*s*o-l*i,e[5]=s*s*o+r,e[6]=l*s*o+a*i,e[7]=0,e[8]=a*l*o+s*i,e[9]=s*l*o-a*i,e[10]=l*l*o+r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Al=vl;function Cl(){var e=new pl(3);return pl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function kl(e){var t=new pl(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ml(e){return Math.hypot(e[0],e[1],e[2])}function Il(e,t,n){var i=new pl(3);return i[0]=e,i[1]=t,i[2]=n,i}function Pl(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function Dl(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function zl(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function Ll(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function Ol(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function Rl(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function Bl(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e[2]=t[2]+n[2]*i,e}function Fl(e,t){var n=t[0],i=t[1],r=t[2],o=n*n+i*i+r*r;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Nl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function jl(e,t,n){var i=t[0],r=t[1],o=t[2],a=n[0],s=n[1],l=n[2];return e[0]=r*l-o*s,e[1]=o*a-i*l,e[2]=i*s-r*a,e}function Ul(e,t,n){var i=t[0],r=t[1],o=t[2],a=n[3]*i+n[7]*r+n[11]*o+n[15];return e[0]=(n[0]*i+n[4]*r+n[8]*o+n[12])/(a=a||1),e[1]=(n[1]*i+n[5]*r+n[9]*o+n[13])/a,e[2]=(n[2]*i+n[6]*r+n[10]*o+n[14])/a,e}function Vl(e,t,n){var i=n[0],r=n[1],o=n[2],a=t[0],s=t[1],l=t[2],c=r*l-o*s,u=o*a-i*l,h=i*s-r*a,d=r*h-o*u,f=o*c-i*h,p=i*u-r*c,m=2*n[3];return u*=m,h*=m,f*=2,p*=2,e[0]=a+(c*=m)+(d*=2),e[1]=s+u+f,e[2]=l+h+p,e}var Gl,ql=Dl,$l=zl,Wl=Ml;function Zl(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e}function Xl(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=n*n+i*i+r*r+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=i*a,e[2]=r*a,e[3]=o*a,e}function Hl(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3];return e[0]=n[0]*i+n[4]*r+n[8]*o+n[12]*a,e[1]=n[1]*i+n[5]*r+n[9]*o+n[13]*a,e[2]=n[2]*i+n[6]*r+n[10]*o+n[14]*a,e[3]=n[3]*i+n[7]*r+n[11]*o+n[15]*a,e}function Yl(){var e=new pl(4);return pl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Kl(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Jl(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=i*l+a*s,e[1]=r*l+o*s,e[2]=o*l-r*s,e[3]=a*l-i*s,e}function Ql(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=i*l-o*s,e[1]=r*l+a*s,e[2]=o*l+i*s,e[3]=a*l-r*s,e}Cl(),Gl=new pl(4),pl!=Float32Array&&(Gl[0]=0,Gl[1]=0,Gl[2]=0,Gl[3]=0);var ec=Xl;Cl(),Il(1,0,0),Il(0,1,0),Yl(),Yl(),ml();class tc{constructor(e,t){this.pos=e,this.dir=t}intersectsPlane(e,t,n){const i=Nl(t,this.dir);if(Math.abs(i)<1e-6)return!1;const r=((e[0]-this.pos[0])*t[0]+(e[1]-this.pos[1])*t[1]+(e[2]-this.pos[2])*t[2])/i;return n[0]=this.pos[0]+this.dir[0]*r,n[1]=this.pos[1]+this.dir[1]*r,n[2]=this.pos[2]+this.dir[2]*r,!0}closestPointOnSphere(e,t,n){if(function(e,t){var n=e[0],i=e[1],r=e[2],o=t[0],a=t[1],s=t[2];return Math.abs(n-o)<=fl*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-a)<=fl*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(r-s)<=fl*Math.max(1,Math.abs(r),Math.abs(s))}(this.pos,e)||0===t)return n[0]=n[1]=n[2]=0,!1;const[i,r,o]=this.dir,a=this.pos[0]-e[0],s=this.pos[1]-e[1],l=this.pos[2]-e[2],c=i*i+r*r+o*o,u=2*(a*i+s*r+l*o),h=u*u-4*c*(a*a+s*s+l*l-t*t);if(h<0){const e=Math.max(-u/2,0),c=a+i*e,h=s+r*e,d=l+o*e,f=Math.hypot(c,h,d);return n[0]=c*t/f,n[1]=h*t/f,n[2]=d*t/f,!1}{const e=(-u-Math.sqrt(h))/(2*c);if(e<0){const e=Math.hypot(a,s,l);return n[0]=a*t/e,n[1]=s*t/e,n[2]=l*t/e,!1}return n[0]=a+i*e,n[1]=s+r*e,n[2]=l+o*e,!0}}}class nc{constructor(e,t,n,i,r){this.TL=e,this.TR=t,this.BR=n,this.BL=i,this.horizon=r}static fromInvProjectionMatrix(e,t,n){const i=[-1,1,1],r=[1,1,1],o=[1,-1,1],a=[-1,-1,1],s=Ul(i,i,e),l=Ul(r,r,e),c=Ul(o,o,e),u=Ul(a,a,e);return new nc(s,l,c,u,t/n)}}class ic{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(e,t,n,i){const r=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((n=>{const o=Hl([],n,e),a=1/o[3]/t*r;return function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e}(o,o,[a,a,i?1/o[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((e=>{const t=Fl([],jl([],ql([],o[e[0]],o[e[1]]),ql([],o[e[2]],o[e[1]]))),n=-Nl(t,o[e[1]]);return t.concat(n)}));return new ic(o,a)}}class rc{static fromPoints(e){const t=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];for(const i of e)Ll(t,t,i),Ol(n,n,i);return new rc(t,n)}static applyTransform(e,t){const n=e.getCorners();for(let e=0;e<n.length;++e)Ul(n[e],n[e],t);return rc.fromPoints(n)}constructor(e,t){this.min=e,this.max=t,this.center=Rl([],Pl([],this.min,this.max),.5)}quadrant(e){const t=[e%2==0,e<2],n=kl(this.min),i=kl(this.max);for(let e=0;e<t.length;e++)n[e]=t[e]?this.min[e]:this.center[e],i[e]=t[e]?this.center[e]:this.max[e];return i[2]=this.max[2],new rc(n,i)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}distanceZ(e){return Math.max(Math.min(this.max[2],e[2]),this.min[2])-e[2]}getCorners(){const e=this.min,t=this.max;return[[e[0],e[1],e[2]],[t[0],e[1],e[2]],[t[0],t[1],e[2]],[e[0],t[1],e[2]],[e[0],e[1],t[2]],[t[0],e[1],t[2]],[t[0],t[1],t[2]],[e[0],t[1],t[2]]]}intersects(e){const t=this.getCorners();let n=!0;for(let i=0;i<e.planes.length;i++){const r=e.planes[i];let o=0;for(let e=0;e<t.length;e++)o+=Nl(r,t[e])+r[3]>=0;if(0===o)return 0;o!==t.length&&(n=!1)}if(n)return 2;for(let t=0;t<3;t++){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let r=0;r<e.points.length;r++){const o=e.points[r][t]-this.min[t];n=Math.min(n,o),i=Math.max(i,o)}if(i<0||n>this.max[t]-this.min[t])return 0}return 1}}function oc(e,t,n,i,r,o,a,s,l){if(o&&e.queryGeometry.isAboveHorizon)return!1;o&&(l*=e.pixelToTileUnitsFactor);const c=e.tileID.canonical,u=n.projection.upVectorScale(c,n.center.lat,n.worldSize).metersToTile;for(const h of t)for(const t of h){const h=t.add(s),d=r&&n.elevation?n.elevation.exaggeration()*r.getElevationAt(h.x,h.y,!0):0,f=n.projection.projectTilePoint(h.x,h.y,c);if(d>0){const e=n.projection.upVector(c,h.x,h.y);f.x+=e[0]*u*d,f.y+=e[1]*u*d,f.z+=e[2]*u*d}const p=o?h:ac(f.x,f.y,f.z,i),m=o?e.tilespaceRays.map((e=>cc(e,d))):e.queryGeometry.screenGeometry,g=Hl([],[f.x,f.y,f.z,1],i);if(!a&&o?l*=g[3]/n.cameraToCenterDistance:a&&!o&&(l*=n.cameraToCenterDistance/g[3]),o){const e=Ds((t.y/ws+c.y)/(1<<c.z));l/=n.projection.pixelsPerMeter(e,1)/Is(1,e)}if(Ys(m,p,l))return!0}return!1}function ac(e,t,n,i){const r=Hl([],[e,t,n,1],i);return new p(r[0]/r[3],r[1]/r[3])}const sc=Il(0,0,0),lc=Il(0,0,1);function cc(e,t){const n=Cl();return sc[2]=t,e.intersectsPlane(sc,lc,n),new p(n[0],n[1])}class uc extends Xs{}function hc(e,{width:t,height:n},i,r){if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==t*n*i)throw new RangeError("mismatched image size")}else r=new Uint8Array(t*n*i);return e.width=t,e.height=n,e.data=r,e}function dc(e,t,n){const{width:i,height:r}=t;i===e.width&&r===e.height||(fc(e,t,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,i),height:Math.min(e.height,r)},n),e.width=i,e.height=r,e.data=t.data)}function fc(e,t,n,i,r,o){if(0===r.width||0===r.height)return t;if(r.width>e.width||r.height>e.height||n.x>e.width-r.width||n.y>e.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range destination coordinates for image copy");const a=e.data,s=t.data;for(let l=0;l<r.height;l++){const c=((n.y+l)*e.width+n.x)*o,u=((i.y+l)*t.width+i.x)*o;for(let e=0;e<r.width*o;e++)s[u+e]=a[c+e]}return t}Vr(uc,"HeatmapBucket",{omit:["layers"]});class pc{constructor(e,t){hc(this,e,1,t)}resize(e){dc(this,new pc(e),1)}clone(){return new pc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,i,r){fc(e,t,n,i,r,1)}}class mc{constructor(e,t){hc(this,e,4,t)}resize(e){dc(this,new mc(e),4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new mc({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,n,i,r){fc(e,t,n,i,r,4)}}Vr(pc,"AlphaImage"),Vr(mc,"RGBAImage");var gc={paint:new Qo({"heatmap-radius":new Ko(Ye.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ko(Ye.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Yo(Ye.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Jo(Ye.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Yo(Ye.paint_heatmap["heatmap-opacity"])})};function _c(e){const t={},n=e.resolution||256,i=e.clips?e.clips.length:1,r=e.image||new mc({width:n,height:i}),o=(n,i,o)=>{t[e.evaluationKey]=o;const a=e.expression.evaluate(t);r.data[n+i+0]=Math.floor(255*a.r/a.a),r.data[n+i+1]=Math.floor(255*a.g/a.a),r.data[n+i+2]=Math.floor(255*a.b/a.a),r.data[n+i+3]=Math.floor(255*a.a)};if(e.clips)for(let t=0,r=0;t<i;++t,r+=4*n)for(let i=0,a=0;i<n;i++,a+=4){const s=i/(n-1),{start:l,end:c}=e.clips[t];o(r,a,l*(1-s)+c*s)}else for(let e=0,t=0;e<n;e++,t+=4)o(0,t,e/(n-1));return r}var yc={paint:new Qo({"hillshade-illumination-direction":new Yo(Ye.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Yo(Ye.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Yo(Ye.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Yo(Ye.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Yo(Ye.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Yo(Ye.paint_hillshade["hillshade-accent-color"])})};const vc=ra([{name:"a_pos",components:2,type:"Int16"}],4),{members:xc}=vc;var bc={exports:{}};function wc(e,t,n){n=n||2;var i,r,o,a,s,l,c,u=t&&t.length,h=u?t[0]*n:e.length,d=Ec(e,0,h,n,!0),f=[];if(!d||d.next===d.prev)return f;if(u&&(d=function(e,t,n,i){var r,o,a,s=[];for(r=0,o=t.length;r<o;r++)(a=Ec(e,t[r]*i,r<o-1?t[r+1]*i:e.length,i,!1))===a.next&&(a.steiner=!0),s.push(Lc(a));for(s.sort(Ic),r=0;r<s.length;r++)n=Pc(s[r],n);return n}(e,t,d,n)),e.length>80*n){i=o=e[0],r=a=e[1];for(var p=n;p<h;p+=n)(s=e[p])<i&&(i=s),(l=e[p+1])<r&&(r=l),s>o&&(o=s),l>a&&(a=l);c=0!==(c=Math.max(o-i,a-r))?32767/c:0}return Sc(d,f,n,i,r,c,0),f}function Ec(e,t,n,i,r){var o,a;if(r===Zc(e,t,n,i)>0)for(o=t;o<n;o+=i)a=qc(o,e[o],e[o+1],a);else for(o=n-i;o>=t;o-=i)a=qc(o,e[o],e[o+1],a);return a&&Fc(a,a.next)&&($c(a),a=a.next),a}function Tc(e,t){if(!e)return e;t||(t=e);var n,i=e;do{if(n=!1,i.steiner||!Fc(i,i.next)&&0!==Bc(i.prev,i,i.next))i=i.next;else{if($c(i),(i=t=i.prev)===i.next)break;n=!0}}while(n||i!==t);return t}function Sc(e,t,n,i,r,o,a){if(e){!a&&o&&function(e,t,n,i){var r=e;do{0===r.z&&(r.z=zc(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}
vendor: 4,453 bytes, line 2
2while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,function(e){var t,n,i,r,o,a,s,l,c=1;do{for(n=e,e=null,o=null,a=0;n;){for(a++,i=n,s=0,t=0;t<c&&(s++,i=i.nextZ);t++);for(l=c;s>0||l>0&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;n=i}o.nextZ=null,c*=2}while(a>1)}(r)}(e,i,r,o);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?Cc(e,i,r,o):Ac(e))t.push(s.i/n|0),t.push(e.i/n|0),t.push(l.i/n|0),$c(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Sc(e=kc(Tc(e),t,n),t,n,i,r,o,2):2===a&&Mc(e,t,n,i,r,o):Sc(Tc(e),t,n,i,r,o,1);break}}}function Ac(e){var t=e.prev,n=e,i=e.next;if(Bc(t,n,i)>=0)return!1;for(var r=t.x,o=n.x,a=i.x,s=t.y,l=n.y,c=i.y,u=r<o?r<a?r:a:o<a?o:a,h=s<l?s<c?s:c:l<c?l:c,d=r>o?r>a?r:a:o>a?o:a,f=s>l?s>c?s:c:l>c?l:c,p=i.next;p!==t;){if(p.x>=u&&p.x<=d&&p.y>=h&&p.y<=f&&Oc(r,s,o,l,a,c,p.x,p.y)&&Bc(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Cc(e,t,n,i){var r=e.prev,o=e,a=e.next;if(Bc(r,o,a)>=0)return!1;for(var s=r.x,l=o.x,c=a.x,u=r.y,h=o.y,d=a.y,f=s<l?s<c?s:c:l<c?l:c,p=u<h?u<d?u:d:h<d?h:d,m=s>l?s>c?s:c:l>c?l:c,g=u>h?u>d?u:d:h>d?h:d,_=zc(f,p,t,n,i),y=zc(m,g,t,n,i),v=e.prevZ,x=e.nextZ;v&&v.z>=_&&x&&x.z<=y;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==r&&v!==a&&Oc(s,u,l,h,c,d,v.x,v.y)&&Bc(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==r&&x!==a&&Oc(s,u,l,h,c,d,x.x,x.y)&&Bc(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=_;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==r&&v!==a&&Oc(s,u,l,h,c,d,v.x,v.y)&&Bc(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==r&&x!==a&&Oc(s,u,l,h,c,d,x.x,x.y)&&Bc(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function kc(e,t,n){var i=e;do{var r=i.prev,o=i.next.next;!Fc(r,o)&&Nc(r,i,i.next,o)&&Vc(r,o)&&Vc(o,r)&&(t.push(r.i/n|0),t.push(i.i/n|0),t.push(o.i/n|0),$c(i),$c(i.next),i=e=o),i=i.next}while(i!==e);return Tc(i)}function Mc(e,t,n,i,r,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Rc(a,s)){var l=Gc(a,s);return a=Tc(a,a.next),l=Tc(l,l.next),Sc(a,t,n,i,r,o,0),void Sc(l,t,n,i,r,o,0)}s=s.next}a=a.next}while(a!==e)}function Ic(e,t){return e.x-t.x}function Pc(e,t){var n=function(e,t){var n,i=t,r=e.x,o=e.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>a&&(a=s,n=i.x<i.next.x?i:i.next,s===r))return n}i=i.next}while(i!==t);if(!n)return null;var l,c=n,u=n.x,h=n.y,d=1/0;i=n;do{r>=i.x&&i.x>=u&&r!==i.x&&Oc(o<h?r:a,o,u,h,o<h?a:r,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(r-i.x),Vc(i,e)&&(l<d||l===d&&(i.x>n.x||i.x===n.x&&Dc(n,i)))&&(n=i,d=l)),i=i.next}while(i!==c);return n}(e,t);if(!n)return t;var i=Gc(n,e);return Tc(i,i.next),Tc(n,n.next)}function Dc(e,t){return Bc(e.prev,e,t.prev)<0&&Bc(t.next,e,e.next)<0}function zc(e,t,n,i,r){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Lc(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function Oc(e,t,n,i,r,o,a,s){return(r-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(i-s)>=(n-a)*(t-s)&&(n-a)*(o-s)>=(r-a)*(i-s)}function Rc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Nc(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(Vc(e,t)&&Vc(t,e)&&function(e,t){var n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==e);return i}(e,t)&&(Bc(e.prev,e,t.prev)||Bc(e,t.prev,t))||Fc(e,t)&&Bc(e.prev,e,e.next)>0&&Bc(t.prev,t,t.next)>0)}function Bc(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Fc(e,t){return e.x===t.x&&e.y===t.y}function Nc(e,t,n,i){var r=Uc(Bc(e,t,n)),o=Uc(Bc(e,t,i)),a=Uc(Bc(n,i,e)),s=Uc(Bc(n,i,t));return r!==o&&a!==s||!(0!==r||!jc(e,n,t))||!(0!==o||!jc(e,i,t))||!(0!==a||!jc(n,e,i))||!(0!==s||!jc(n,t,i))}function jc(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Uc(e){return e>0?1:e<0?-1:0}function Vc(e,t){return Bc(e.prev,e,e.next)<0?Bc(e,t,e.next)>=0&&Bc(e,e.prev,t)>=0:Bc(e,t,e.prev)<0||Bc(e,e.next,t)<0}function Gc(e,t){var n=new Wc(e.i,e.x,e.y),i=new Wc(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}
vendor: 14,870 bytes, line 2
2function qc(e,t,n,i){var r=new Wc(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function $c(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Wc(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Zc(e,t,n,i){for(var r=0,o=t,a=n-i;o<n;o+=i)r+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return r}function Xc(e,t,n,i,r){Hc(e,t,n||0,i||e.length-1,r||Kc)}function Hc(e,t,n,i,r){for(;i>n;){if(i-n>600){var o=i-n+1,a=t-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);Hc(e,t,Math.max(n,Math.floor(t-a*l/o+c)),Math.min(i,Math.floor(t+(o-a)*l/o+c)),r)}var u=e[t],h=n,d=i;for(Yc(e,n,t),r(e[i],u)>0&&Yc(e,n,i);h<d;){for(Yc(e,h,d),h++,d--;r(e[h],u)<0;)h++;for(;r(e[d],u)>0;)d--}0===r(e[n],u)?Yc(e,n,d):Yc(e,++d,i),d<=t&&(n=d+1),t<=d&&(i=d-1)}}function Yc(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function Kc(e,t){return e<t?-1:e>t?1:0}function Jc(e,t){const n=e.length;if(n<=1)return[e];const i=[];let r,o;for(let t=0;t<n;t++){const n=G(e[t]);0!==n&&(e[t].area=Math.abs(n),void 0===o&&(o=n<0),o===n<0?(r&&i.push(r),r=[e[t]]):r.push(e[t]))}if(r&&i.push(r),t>1)for(let e=0;e<i.length;e++)i[e].length<=t||(Xc(i[e],t,1,i[e].length-1,Qc),i[e]=i[e].slice(0,t));return i}function Qc(e,t){return t.area-e.area}function eu(e,t,n){const i=n.patternDependencies;let r=!1;for(const n of t){const t=n.paint.get(`${e}-pattern`);t.isConstant()||(r=!0);const o=t.constantOr(null);o&&(r=!0,i[o]=!0)}return r}function tu(e,t,n,i,r){const o=r.patternDependencies;for(const a of t){const t=a.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:i},n,{},r.availableImages);e=e&&e.name?e.name:e,o[e]=!0,n.patterns[a.id]=e}}return n}bc.exports=wc,bc.exports.default=wc,wc.deviation=function(e,t,n,i){var r=t&&t.length,o=Math.abs(Zc(e,0,r?t[0]*n:e.length,n));if(r)for(var a=0,s=t.length;a<s;a++)o-=Math.abs(Zc(e,t[a]*n,a<s-1?t[a+1]*n:e.length,n));var l=0;for(a=0;a<i.length;a+=3){var c=i[a]*n,u=i[a+1]*n,h=i[a+2]*n;l+=Math.abs((e[c]-e[h])*(e[u+1]-e[c+1])-(e[c]-e[u])*(e[h+1]-e[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},wc.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},i=0,r=0;r<e.length;r++){for(var o=0;o<e[r].length;o++)for(var a=0;a<t;a++)n.vertices.push(e[r][o][a]);r>0&&n.holes.push(i+=e[r-1].length)}return n};class nu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new aa,this.indexArray=new wa,this.indexArray2=new ka,this.programConfigurations=new hs(e.layers,e.zoom),this.segments=new bs,this.segments2=new bs,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection}populate(e,t,n,i){this.hasPattern=eu("fill",this.layers,t);const r=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=$s(a,e);if(!this.layers[0]._featureFilter.filter(new Uo(this.zoom),u,n))continue;const h=r?r.evaluate(u,{},n,t.availableImages):void 0,d={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:qs(a,n,i),patterns:{},sortKey:h};o.push(d)}r&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const i of o){const{geometry:r,index:o,sourceLayerIndex:a}=i;if(this.hasPattern){const e=tu("fill",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,r,o,n,{},t.availableImages);t.featureIndex.insert(e[o].feature,r,o,a,this.index)}}update(e,t,n,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n,i)}addFeatures(e,t,n,i,r){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,n,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,xc),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,n,i,r,o=[]){for(const e of Jc(t,500)){let t=0;for(const n of e)t+=n.length;const n=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),i=n.vertexLength,r=[],o=[];for(const t of e){if(0===t.length)continue;t!==e[0]&&o.push(r.length/2);const n=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),i=n.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(i+t.length-1,i),r.push(t[0].x),r.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(i+e-1,i+e),r.push(t[e].x),r.push(t[e].y);n.vertexLength+=t.length,n.primitiveLength+=t.length}const a=bc.exports(r,o);for(let e=0;e<a.length;e+=3)this.indexArray.emplaceBack(i+a[e],i+a[e+1],i+a[e+2]);n.vertexLength+=t,n.primitiveLength+=a.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,r,o,i)}}Vr(nu,"FillBucket",{omit:["layers","patternFeatures"]});const iu=new Qo({"fill-sort-key":new Ko(Ye.layout_fill["fill-sort-key"])});var ru={paint:new Qo({"fill-antialias":new Yo(Ye.paint_fill["fill-antialias"]),"fill-opacity":new Ko(Ye.paint_fill["fill-opacity"]),"fill-color":new Ko(Ye.paint_fill["fill-color"]),"fill-outline-color":new Ko(Ye.paint_fill["fill-outline-color"]),"fill-translate":new Yo(Ye.paint_fill["fill-translate"]),"fill-translate-anchor":new Yo(Ye.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ko(Ye.paint_fill["fill-pattern"])}),layout:iu};const ou=ra([{name:"a_pos_normal_ed",components:4,type:"Int16"}]),au=ra([{name:"a_centroid_pos",components:2,type:"Uint16"}]),su=ra([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]),{members:lu}=ou;var cu={},uu=p,hu=du;function du(e,t,n,i,r){this.properties={},this.extent=n,this.type=0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=r,e.readFields(fu,this,t)}function fu(e,t,n){1==e?t.id=n.readVarint():2==e?function(e,t){for(var n=e.readVarint()+e.pos;e.pos<n;){var i=t._keys[e.readVarint()],r=t._values[e.readVarint()];t.properties[i]=r}}(n,t):3==e?t.type=n.readVarint():4==e&&(t._geometry=n.pos)}function pu(e){for(var t,n,i=0,r=0,o=e.length,a=o-1;r<o;a=r++)i+=((n=e[a]).x-(t=e[r]).x)*(t.y+n.y);return i}du.types=["Unknown","Point","LineString","Polygon"],du.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,n=e.readVarint()+e.pos,i=1,r=0,o=0,a=0,s=[];e.pos<n;){if(r<=0){var l=e.readVarint();i=7&l,r=l>>3}if(r--,1===i||2===i)o+=e.readSVarint(),a+=e.readSVarint(),1===i&&(t&&s.push(t),t=[]),t.push(new uu(o,a));else{if(7!==i)throw new Error("unknown command "+i);t&&t.push(t[0].clone())}}return t&&s.push(t),s},du.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,n=1,i=0,r=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;e.pos<t;){if(i<=0){var u=e.readVarint();n=7&u,i=u>>3}if(i--,1===n||2===n)(r+=e.readSVarint())<a&&(a=r),r>s&&(s=r),(o+=e.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==n)throw new Error("unknown command "+n)}return[a,l,s,c]},du.prototype.toGeoJSON=function(e,t,n){var i,r,o=this.extent*Math.pow(2,n),a=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=du.types[this.type];function u(e){for(var t=0;t<e.length;t++){var n=e[t];e[t]=[360*(n.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(n.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];u(l=h);break;case 2:for(i=0;i<l.length;i++)u(l[i]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var n,i,r=[],o=0;o<t;o++){var a=pu(e[o]);0!==a&&(void 0===i&&(i=a<0),i===a<0?(n&&r.push(n),n=[e[o]]):n.push(e[o]))}return n&&r.push(n),r}(l),i=0;i<l.length;i++)for(r=0;r<l[i].length;r++)u(l[i][r])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var mu=hu,gu=_u;function _u(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(yu,this,t),this.length=this._features.length}function yu(e,t,n){15===e?t.version=n.readVarint():1===e?t.name=n.readString():5===e?t.extent=n.readVarint():2===e?t._features.push(n.pos):3===e?t._keys.push(n.readString()):4===e&&t._values.push(function(e){for(var t=null,n=e.readVarint()+e.pos;e.pos<n;){var i=e.readVarint()>>3;t=1===i?e.readString():2===i?e.readFloat():3===i?e.readDouble():4===i?e.readVarint64():5===i?e.readVarint():6===i?e.readSVarint():7===i?e.readBoolean():null}return t}(n))}_u.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new mu(this._pbf,t,this.extent,this._keys,this._values)};var vu=gu;function xu(e,t,n){if(3===e){var i=new vu(n,n.readVarint()+n.pos);i.length&&(t[i.name]=i)}}var bu=cu.VectorTile=function(e,t){this.layers=e.readFields(xu,{},t)},wu=cu.VectorTileFeature=hu;function Eu(e,t,n,i){const r=[],o=0===i?(e,t,n,i,r,o)=>{e.push(new p(o,n+(o-t)/(i-t)*(r-n)))}:(e,t,n,i,r,o)=>{e.push(new p(t+(o-n)/(r-n)*(i-t),o))};for(const a of e){const e=[];for(const r of a){if(r.length<=2)continue;const a=[];for(let e=0;e<r.length-1;e++){const s=r[e].x,l=r[e].y,c=r[e+1].x,u=r[e+1].y,h=0===i?s:l,d=0===i?c:u;h<t?d>t&&o(a,s,l,c,u,t):h>n?d<n&&o(a,s,l,c,u,n):a.push(r[e]),d<t&&h>=t&&o(a,s,l,c,u,t),d>n&&h<=n&&o(a,s,l,c,u,n)}let s=r[r.length-1];const l=0===i?s.x:s.y;l>=t&&l<=n&&a.push(s),a.length&&(s=a[a.length-1],a[0].x===s.x&&a[0].y===s.y||a.push(a[0]),e.push(a))}e.length&&r.push(e)}return r}cu.VectorTileLayer=gu;const Tu=wu.types,Su=Math.pow(2,13);function Au(e,t,n,i,r,o,a,s){e.emplaceBack((t<<1)+a,(n<<1)+o,(Math.floor(i*Su)<<1)+r,Math.round(s))}function Cu(e,t,n){const i=16384;e.emplaceBack(t.x,t.y,t.z,n[0]*i,n[1]*i,n[2]*i)}class ku{constructor(){this.acc=new p(0,0),this.polyCount=[]}startRing(e){this.currentPolyCount={edges:0,top:0},this.polyCount.push(this.currentPolyCount),this.min||(this.min=new p(e.x,e.y),this.max=new p(e.x,e.y))}append(e,t){this.currentPolyCount.edges++,this.acc._add(e);const n=this.min,i=this.max;e.x<n.x?n.x=e.x:e.x>i.x&&(i.x=e.x),e.y<n.y?n.y=e.y:e.y>i.y&&(i.y=e.y),((0===e.x||e.x===ws)&&e.x===t.x)!=((0===e.y||e.y===ws)&&e.y===t.y)&&this.processBorderOverlap(e,t),t.x<0!=e.x<0&&this.addBorderIntersection(0,kn(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>ws!=e.x>ws&&this.addBorderIntersection(1,kn(t.y,e.y,(ws-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,kn(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>ws!=e.y>ws&&this.addBorderIntersection(3,kn(t.x,e.x,(ws-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const n=this.borders[e];t<n[0]&&(n[0]=t),t>n[1]&&(n[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const n=0===e.x?0:1;this.addBorderIntersection(n,t.y),this.addBorderIntersection(n,e.y)}else{const n=0===e.y?2:3;this.addBorderIntersection(n,t.x),this.addBorderIntersection(n,e.x)}}centroid(){const e=this.polyCount.reduce(((e,t)=>e+t.edges),0);return 0!==e?this.acc.div(e)._round():new p(0,0)}span(){return new p(this.max.x-this.min.x,this.max.y-this.min.y)}intersectsCount(){return this.borders.reduce(((e,t)=>e+ +(t[0]!==Number.MAX_VALUE)),0)}}class Mu{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.layoutVertexArray=new la,this.centroidVertexArray=new Ua,this.indexArray=new wa,this.programConfigurations=new hs(e.layers,e.zoom),this.segments=new bs,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.enableTerrain=e.enableTerrain}populate(e,t,n,i){this.features=[],this.hasPattern=eu("fill-extrusion",this.layers,t),this.featuresOnBorder=[],this.borders=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=function(e){const t=Math.exp(Math.PI*(1-e.y/(1<<e.z)*2));return 80150034*t/(t*t+1)/ws/(1<<e.z)}(n),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter;for(const{feature:r,id:o,index:a,sourceLayerIndex:s}of e){const e=this.layers[0]._featureFilter.needGeometry,l=$s(r,e);if(!this.layers[0]._featureFilter.filter(new Uo(this.zoom),l,n))continue;const c={id:o,sourceLayerIndex:s,index:a,geometry:e?l.geometry:qs(r,n,i),properties:r.properties,type:r.type,patterns:{}},u=this.layoutVertexArray.length;this.hasPattern?this.features.push(tu("fill-extrusion",this.layers,c,this.zoom,t)):this.addFeature(c,c.geometry,a,n,{},t.availableImages,i),t.featureIndex.insert(r,c.geometry,a,s,this.index,u)}this.sortBorders()}addFeatures(e,t,n,i,r){for(const e of this.features){const{geometry:o}=e;this.addFeature(e,o,e.index,t,n,i,r)}this.sortBorders()}update(e,t,n,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,lu),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,su.members,!0))),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){0!==this.centroidVertexArray.length&&(this.centroidVertexBuffer?this.needsCentroidUpdate&&this.centroidVertexBuffer.updateData(this.centroidVertexArray):this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,au.members,!0),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,n,i,r,o,a){const s=[new p(0,0),new p(ws,ws)],l=a.projection,c="globe"===l.name,u=this.enableTerrain&&!c?
2new ku:null,h="Polygon"===Tu[e.type];c&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new fa);const d=Jc(t,500);for(let e=d.length-1;e>=0;e--){const t=d[e];(0===t.length||(f=t[0]).every((e=>e.x<=0))||f.every((e=>e.x>=ws))||f.every((e=>e.y<=0))||f.every((e=>e.y>=ws)))&&d.splice(e,1)}var f;let m;if(c)m=Bu(d,s,i);else{m=[];for(const e of d)m.push({polygon:e,bounds:s})}const g=h?this.edgeRadius:0;for(const{polygon:e,bounds:t}of m){let n=0,r=0;for(const t of e)h&&!t[0].equals(t[t.length-1])&&t.push(t[0]),r+=h?t.length-1:t.length;const o=this.segments.prepareSegment((h?5:4)*r,this.layoutVertexArray,this.indexArray);if(h){const t=[],r=[];n=o.vertexLength;for(const n of e){let a,s;n.length&&n!==e[0]&&r.push(t.length/2),a=n[1].sub(n[0])._perp()._unit();for(let e=1;e<n.length;e++){const r=n[e],u=n[e===n.length-1?1:e+1];let{x:h,y:d}=r;if(g){s=u.sub(r)._perp()._unit();const e=a.add(s)._unit(),t=g*Math.min(4,1/(a.x*e.x+a.y*e.y));h+=t*e.x,d+=t*e.y,a=s}Au(this.layoutVertexArray,h,d,0,0,1,1,0),o.vertexLength++,t.push(r.x,r.y),c&&Cu(this.layoutVertexExtArray,l.projectTilePoint(h,d,i),l.upVector(i,h,d))}}const a=bc.exports(t,r);for(let e=0;e<a.length;e+=3)this.indexArray.emplaceBack(n+a[e],n+a[e+2],n+a[e+1]),o.primitiveLength++}for(const r of e){u&&r.length&&u.startRing(r[0]);let e,a,s,d=r.length>4&&Lu(r[r.length-2],r[0],r[1]),f=g?Pu(r[r.length-2],r[0],r[1],g):0;a=r[1].sub(r[0])._perp()._unit();let p=!0;for(let m=1,_=0;m<r.length;m++){let y=r[m-1],v=r[m];
2const x=r[m===r.length-1?1:m+1];if(u&&h&&u.currentPolyCount.top++,zu(v,y,t)){g&&(a=x.sub(v)._perp()._unit(),p=!p);continue}u&&u.append(v,y);const b=v.sub(y)._perp(),w=b.x/(Math.abs(b.x)+Math.abs(b.y)),E=b.y>0?1:0,T=y.dist(v);if(_+T>32768&&(_=0),g){s=x.sub(v)._perp()._unit();let e=Du(y,v,x,Iu(a,s),g);isNaN(e)&&(e=0);const t=v.sub(y)._unit();y=y.add(t.mult(f))._round(),v=v.add(t.mult(-e))._round(),f=e,a=s}const S=o.vertexLength,A=r.length>4&&Lu(y,v,x);let C=Ou(_,d,p);if(Au(this.layoutVertexArray,y.x,y.y,w,E,0,0,C),Au(this.layoutVertexArray,y.x,y.y,w,E,0,1,C),_+=T,C=Ou(_,A,!p),d=A,Au(this.layoutVertexArray,v.x,v.y,w,E,0,0,C),Au(this.layoutVertexArray,v.x,v.y,w,E,0,1,C),o.vertexLength+=4,this.indexArray.emplaceBack(S+0,S+1,S+2),this.indexArray.emplaceBack(S+1,S+3,S+2),o.primitiveLength+=2,g){const i=n+(1===m?r.length-2:m-2),a=1===m?n:i+1;if(this.indexArray.emplaceBack(S+1,i,S+3),this.indexArray.emplaceBack(i,a,S+3),o.primitiveLength+=2,void 0===e&&(e=S),!zu(x,r[m],t)){const t=m===r.length-1?e:o.vertexLength;this.indexArray.emplaceBack(S+2,S+3,t),this.indexArray.emplaceBack(S+3,t+1,t),this.indexArray.emplaceBack(S+3,a,t+1),o.primitiveLength+=3}p=!p}if(c){const e=this.layoutVertexExtArray,t=l.projectTilePoint(y.x,y.y,i),n=l.projectTilePoint(v.x,v.y,i),r=l.upVector(i,y.x,y.y),o=l.upVector(i,v.x,v.y);Cu(e,t,r),Cu(e,t,r),Cu(e,n,o),Cu(e,n,o)}}h&&(n+=r.length-1)}}if(u&&u.polyCount.length>0){if(u.borders){u.vertexArrayOffset=this.centroidVertexArray.length;const e=u.borders,t=this.featuresOnBorder.push(u)-1;for(let n=0;n<4;n++)e[n][0]!==Number.MAX_VALUE&&this.borders[n].push(t)}this.encodeCentroid(u.borders?void 0:u.centroid(),u)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,r,o,i)}sortBorders(){for(let e=0;e<4;e++)this.borders[e].sort(((t,n)=>this.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[n].borders[e][0]))}encodeCentroid(e,t,n=!0){let i,r;if(e)if(0!==e.y){const n=t.span()._mult(this.tileToMeter);i=(Math.max(e.x,1)<<3)+Math.min(7,Math.round(n.x/10)),r=(Math.max(e.y,1)<<3)+Math.min(7,Math.round(n.y/10))}else i=Math.ceil(7*(e.x+450)),r=0;else i=0,r=+n;let o=n?this.centroidVertexArray.length:t.vertexArrayOffset;for(const e of t.polyCount){n&&this.centroidVertexArray.resize(this.centroidVertexArray.length+4*e.edges+e.top);for(let t=0;t<e.top;t++)this.centroidVertexArray.emplace(o++,i,r);for(let t=0;t<2*e.edges;t++)this.centroidVertexArray.emplace(o++,0,r),this.centroidVertexArray.emplace(o++,i,r)}}}function Iu(e,t){const n=e.add(t)._unit();return e.x*n.x+e.y*n.y}function Pu(e,t,n,i){const r=t.sub(e)._perp()._unit(),o=n.sub(t)._perp()._unit();return Du(e,t,n,Iu(r,o),i)}function Du(e,t,n,i,r){const o=Math.sqrt(1-i*i);return Math.min(e.dist(t)/3,t.dist(n)/3,r*o/i)}function zu(e,t,n){return e.x<n[0].x&&t.x<n[0].x||e.x>n[1].x&&t.x>n[1].x||e.y<n[0].y&&t.y<n[0].y||e.y>n[1].y&&t.y>n[1].y}function Lu(e,t,n){if(e.x<0||e.x>=ws||t.x<0||t.x>=ws||n.x<0||n.x>=ws)return!1;const i=n.sub(t),r=i.perp(),o=e.sub(t);return(i.x*o.x+i.y*o.y)/Math.sqrt((i.x*i.x+i.y*i.y)*(o.x*o.x+o.y*o.y))>-.866&&r.x*o.x+r.y*o.y<0}function Ou(e,t,n){const i=t?2|e:-3&e;return n?1|i:-2&i}function Ru(){const e=Math.PI/32,t=Math.tan(e),n=Ts;return n*Math.sqrt(1+2*t*t)-n}function Bu(e,t,n){const i=1<<n.z,r=Ps(n.x/i),o=Ps((n.x+1)/i),a=Ds(n.y/i),s=Ds((n.y+1)/i);return function(e,t,n,i,r=0,o){const a=[];if(!e.length||!n||!i)return a;const s=(e,t)=>{for(const n of e)a.push({polygon:n,bounds:t})},l=Math.ceil(Math.log2(n)),c=Math.ceil(Math.log2(i)),u=l-c,h=[];for(let e=0;e<Math.abs(u);e++)h.push(u>0?0:1);for(let e=0;e<Math.min(l,c);e++)h.push(0),h.push(1);let d=e;if(d=Eu(d,t[0].y-r,t[1].y+r,1),d=Eu(d,t[0].x-r,t[1].x+r,0),!d.length)return a;const f=[];for(h.length?f.push({polygons:d,bounds:t,depth:0}):s(d,t);f.length;){const e=f.pop(),t=e.depth,n=h[t],i=e.bounds[0],a=e.bounds[1],l=0===n?i.x:i.y,c=0===n?a.x:a.y,u=o?o(n,l,c):.5*(l+c),d=Eu(e.polygons,l-r,u+r,n),m=Eu(e.polygons,u-r,c+r,n);if(d.length){const e=[i,new p(0===n?u:a.x,1===n?u:a.y)];h.length>t+1?f.push({polygons:d,bounds:e,depth:t+1}):s(d,e)}if(m.length){const e=[new p(0===n?u:i.x,1===n?u:i.y),a];h.length>t+1?f.push({polygons:m,bounds:e,depth:t+1}):s(m,e)}}return a}(e,t,Math.ceil((o-r)/11.25),Math.ceil((a-s)/11.25),1,((e,t,r)=>{if(0===e)return.5*(t+r);{const e=Ds((n.y+t/ws)/i);return(Ms(.5*(Ds((n.y+r/ws)/i)+e))*i-n.y)*ws}}))}Vr(Mu,"FillExtrusionBucket",{omit:["layers","features"]}),Vr(ku,"PartMetadata");const Fu=new Qo({"fill-extrusion-edge-radius":new Yo(Ye["layout_fill-extrusion"]["fill-extrusion-edge-radius"])});var Nu={paint:new Qo({"fill-extrusion-opacity":new Yo(Ye["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ko(Ye["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Yo(Ye["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Yo(Ye["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ko(Ye["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ko(Ye["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ko(Ye["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Yo(Ye["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]),"fill-extrusion-ambient-occlusion-intensity":new Yo(Ye["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-intensity"]),"fill-extrusion-ambient-occlusion-radius":new Yo(Ye["paint_fill-extrusion"]["fill-extrusion-ambient-occlusion-radius"])}),layout:Fu};function ju(e,t,n){var i=2*Math.PI*6378137/256/Math.pow(2,n);return[e*i-2*Math.PI*6378137/2,t*i-2*Math.PI*6378137/2]}class Uu{constructor(e,t,n){this.z=e,this.x=t,this.y=n,this.key=qu(0,e,e,t,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t){const n=function(e,t,n){var i=ju(256*e,256*(t=Math.pow(2,n)-t-1),n),r=ju(256*(e+1),256*(t+1),n);return i[0]+","+i[1]+","+r[0]+","+r[1]}(this.x,this.y,this.z),i=function(e,t,n){let i,r="";for(let o=e;o>0;o--)i=1<<o-1,r+=(t&i?1:0)+(n&i?2:0);return r}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",i).replace("{bbox-epsg-3857}",n)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Vu{constructor(e,t){this.wrap=e,this.canonical=t,this.key=qu(e,t.z,t.z,t.x,t.y)}}class Gu{constructor(e,t,n,i,r){this.overscaledZ=e,this.wrap=t,this.canonical=new Uu(n,+i,+r),this.key=0===t&&e===n?this.canonical.key:qu(t,e,n,i,r)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){const t=this.canonical.z-e;return e>this.canonical.z?new Gu(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Gu(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return qu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const n=this.canonical.z-e;return qu(this.wrap*+t,e,e,this.canonical.x>>n,this.canonical.y>>n)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new Gu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,n=2*this.canonical.x,i=2*this.canonical.y;return[new Gu(t,this.wrap,t,n,i),new Gu(t,this.wrap,t,n+1,i),new Gu(t,this.wrap,t,n,i+1),new Gu(t,this.wrap,t,n+1,i+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>
vendor: 60,718 bytes, line 2
2e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new Gu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Gu(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Vu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}}function qu(e,t,n,i,r){const o=1<<Math.min(n,22);let a=o*(r%o)+i%o;return e&&n<22&&(a+=o*o*((e<0?-2*e-1:2*e)%(1<<2*(22-n)))),16*(32*a+n)+(t-n)}Vr(Uu,"CanonicalTileID"),Vr(Gu,"OverscaledTileID",{omit:["projMatrix"]});class $u extends p{constructor(e,t,n){super(e,t),this.z=n}}function Wu(e,t){return e.x*t.x+e.y*t.y}function Zu(e,t){if(1===e.length){let n=0;const i=t[n++];let r;for(;!r||i.equals(r);)if(r=t[n++],!r)return 1/0;for(;n<t.length;n++){const o=t[n],a=e[0],s=r.sub(i),l=o.sub(i),c=a.sub(i),u=Wu(s,s),h=Wu(s,l),d=Wu(l,l),f=Wu(c,s),p=Wu(c,l),m=u*d-h*h,g=(d*f-h*p)/m,_=(u*p-h*f)/m,y=i.z*(1-g-_)+r.z*g+o.z*_;if(isFinite(y))return y}return 1/0}{let e=1/0;for(const n of t)e=Math.min(e,n.z);return e}}function Xu(e,t,n,i,r,o,a,s){const l=a*r.getElevationAt(e,t,!0,!0),c=0!==o[0],u=c?0===o[1]?a*(o[0]/7-450):a*function(e,t,n){const i=Math.floor(t[0]/8),r=Math.floor(t[1]/8),o=10*(t[0]-8*i),a=10*(t[1]-8*r),s=e.getElevationAt(i,r,!0,!0),l=e.getMeterToDEM(n),c=Math.floor(.5*(o*l-1)),u=Math.floor(.5*(a*l-1)),h=e.tileCoordToPixel(i,r),d=2*c+1,f=2*u+1,p=function(e,t,n,i,r){return[e.getElevationAtPixel(t,n,!0),e.getElevationAtPixel(t+r,n,!0),e.getElevationAtPixel(t,n+r,!0),e.getElevationAtPixel(t+i,n+r,!0)]}(e,h.x-c,h.y-u,d,f),m=Math.abs(p[0]-p[1]),g=Math.abs(p[2]-p[3]),_=Math.abs(p[0]-p[2])+Math.abs(p[1]-p[3]),y=Math.min(.25,.5*l*(m+g)/d),v=Math.min(.25,.5*l*_/f);return s+Math.max(y*o,v*a)}(r,o,s):l;return{base:l+(0===n)?-1:n,top:c?Math.max(u+i,l+n+2):l+i}}const Hu=ra([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"},{name:"a_linesofar",components:1,type:"Float32"}],4),{members:Yu}=Hu,Ku=ra([{name:"a_packed",components:4,type:"Float32"}]),{members:Ju}=Ku,Qu=wu.types,eh=Math.cos(Math.PI/180*37.5);class th{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new ca,this.layoutVertexArray2=new ua,this.indexArray=new wa,this.programConfigurations=new hs(e.layers,e.zoom),this.segments=new bs,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,n,i){this.hasPattern=eu("line",this.layers,t);const r=this.layers[0].layout.get("line-sort-key"),o=[];for(const{feature:t,id:a,index:s,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=$s(t,e);if(!this.layers[0]._featureFilter.filter(new Uo(this.zoom),c,n))continue;const u=r?r.evaluate(c,{},n):void 0,h={id:a,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:qs(t,n,i),patterns:{},sortKey:u};o.push(h)}r&&o.sort(((e,t)=>e.sortKey-t.sortKey));const{lineAtlas:a,featureIndex:s}=t,l=this.addConstantDashes(a);for(const i of o){const{geometry:r,index:o,sourceLayerIndex:c}=i;if(l&&this.addFeatureDashes(i,a),this.hasPattern){const e=tu("line",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,r,o,n,a.positions,t.availableImages);s.insert(e[o].feature,r,o,c,this.index)}}addConstantDashes(e){let t=!1;for(const n of this.layers){const i=n.paint.get("line-dasharray").value,r=n.layout.get("line-cap").value;if("constant"!==i.kind||"constant"!==r.kind)t=!0;else{const t=r.value,n=i.value;if(!n)continue;e.addDash(n,t)}}return t}addFeatureDashes(e,t){const n=this.zoom;for(const i of this.layers){const r=i.paint.get("line-dasharray").value,o=i.layout.get("line-cap").value;if("constant"===r.kind&&"constant"===o.kind)continue;let a,s;if("constant"===r.kind){if(a=r.value,!a)continue}else a=r.evaluate({zoom:n},e);s="constant"===o.kind?o.value:o.evaluate({zoom:n},e),t.addDash(a,s),e.patterns[i.id]=t.getKey(a,s)}}update(e,t,n,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,n,i)}addFeatures(e,t,n,i,r){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,n,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Ju)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Yu),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,n,i,r,o){const a=this.layers[0].layout,s=a.get("line-join").evaluate(e,{}),l=a.get("line-cap").evaluate(e,{}),c=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const n of t)this.addLine(n,e,s,l,c,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,r,o,i)}addLine(e,t,n,i,r,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===Qu[t.type];let s=e.length;for(;s>=2&&e[s-1].equals(e[s-2]);)s--;let l=0;for(;l<s-1&&e[l].equals(e[l+1]);)l++;if(s<(a?3:2))return;"bevel"===n&&(r=1.05);const c=this.overscaling<=16?122880/(512*this.overscaling):0,u=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);let h,d,f,p,m;this.e1=this.e2=-1,a&&(h=e[s-2],m=e[l].sub(h)._unit()._perp());for(let t=l;t<s;t++){if(f=t===s-1?a?e[l+1]:void 0:e[t+1],f&&e[t].equals(f))continue;m&&(p=m),h&&(d=h),h=e[t],m=f?f.sub(h)._unit()._perp():p,p=p||m;let g=p.add(m);0===g.x&&0===g.y||g._unit();const _=p.x*m.x+p.y*m.y,y=g.x*m.x+g.y*m.y,v=0!==y?1/y:1/0,x=2*Math.sqrt(2-2*y),b=y<eh&&d&&f,w=p.x*m.y-p.y*m.x>0;if(b&&t>l){const e=h.dist(d);if(e>2*c){const t=h.sub(h.sub(d)._mult(c/e)._round());this.updateDistance(d,t),this.addCurrentVertex(t,p,0,0,u),d=t}}const E=d&&f;let T=E?n:a?"butt":i;if(E&&"round"===T&&(v<o?T="miter":v<=2&&(T="fakeround")),"miter"===T&&v>r&&(T="bevel"),"bevel"===T&&(v>2&&(T="flipbevel"),v<r&&(T="miter")),d&&this.updateDistance(d,h),"miter"===T)g._mult(v),this.addCurrentVertex(h,g,0,0,u);else if("flipbevel"===T){if(v>100)g=m.mult(-1);else{const e=v*p.add(m).mag()/p.sub(m).mag();g._perp()._mult(e*(w?-1:1))}this.addCurrentVertex(h,g,0,0,u),this.addCurrentVertex(h,g.mult(-1),0,0,u)}else if("bevel"===T||"fakeround"===T){const e=-Math.sqrt(v*v-1),t=w?e:0,n=w?0:e;if(d&&this.addCurrentVertex(h,p,t,n,u),"fakeround"===T){const e=Math.round(180*x/Math.PI/20);for(let t=1;t<e;t++){let n=t/e;if(.5!==n){const e=n-.5;n+=n*e*(n-1)*((1.0904+_*(_*(3.55645-1.43519*_)-3.2452))*e*e+(.848013+_*(.215638*_-1.06021)))}const i=m.sub(p)._mult(n)._add(p)._unit()._mult(w?-1:1);this.addHalfVertex(h,i.x,i.y,!1,w,0,u)}}f&&this.addCurrentVertex(h,m,-t,-n,u)}else if("butt"===T)this.addCurrentVertex(h,g,0,0,u);else if("square"===T){const e=d?1:-1;d||this.addCurrentVertex(h,g,e,e,u),this.addCurrentVertex(h,g,0,0,u),d&&this.addCurrentVertex(h,g,e,e,u)}else"round"===T&&(d&&(this.addCurrentVertex(h,p,0,0,u),this.addCurrentVertex(h,p,1,1,u,!0)),f&&(this.addCurrentVertex(h,m,-1,-1,u,!0),this.addCurrentVertex(h,m,0,0,u)));if(b&&t<s-1){const e=h.dist(f);if(e>2*c){const t=h.add(f.sub(h)._mult(c/e)._round());this.updateDistance(h,t),this.addCurrentVertex(t,m,0,0,u),h=t}}}}addCurrentVertex(e,t,n,i,r,o=!1){const a=t.y*i-t.x,s=-t.y-t.x*i;this.addHalfVertex(e,t.x+t.y*n,t.y-t.x*n,o,!1,n,r),this.addHalfVertex(e,a,s,o,!0,-i,r)}addHalfVertex({x:e,y:t},n,i,r,o,a,s){this.layoutVertexArray.emplaceBack((e<<1)+(r?1:0),(t<<1)+(o?1:0),Math.round(63*n)+128,Math.round(63*i)+128,1+(0===a?0:a<0?-1:1),0,this.lineSoFar),this.lineClips&&this.layoutVertexArray2.emplaceBack(this.scaledDistance,this.lineClipsArray.length,this.lineClips.start,this.lineClips.end);const l=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),s.primitiveLength++),o?this.e2=l:this.e1=l}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}Vr(th,"LineBucket",{omit:["layers","patternFeatures"]});const nh=new Qo({"line-cap":new Ko(Ye.layout_line["line-cap"]),"line-join":new Ko(Ye.layout_line["line-join"]),"line-miter-limit":new Yo(Ye.layout_line["line-miter-limit"]),"line-round-limit":new Yo(Ye.layout_line["line-round-limit"]),"line-sort-key":new Ko(Ye.layout_line["line-sort-key"])});var ih={paint:new Qo({"line-opacity":new Ko(Ye.paint_line["line-opacity"]),"line-color":new Ko(Ye.paint_line["line-color"]),"line-translate":new Yo(Ye.paint_line["line-translate"]),"line-translate-anchor":new Yo(Ye.paint_line["line-translate-anchor"]),"line-width":new Ko(Ye.paint_line["line-width"]),"line-gap-width":new Ko(Ye.paint_line["line-gap-width"]),"line-offset":new Ko(Ye.paint_line["line-offset"]),"line-blur":new Ko(Ye.paint_line["line-blur"]),"line-dasharray":new Ko(Ye.paint_line["line-dasharray"]),"line-pattern":new Ko(Ye.paint_line["line-pattern"]),"line-gradient":new Jo(Ye.paint_line["line-gradient"]),"line-trim-offset":new Yo(Ye.paint_line["line-trim-offset"])}),layout:nh};const rh=new class extends Ko{possiblyEvaluate(e,t){return t=new Uo(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,n,i){return t=M({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,n,i)}}(ih.paint.properties["line-width"].specification);function oh(e,t){return t>0?t+2*e:e}rh.useIntegerZoom=!0;const ah=ra([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_tex_size",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),sh=ra([{name:"a_globe_anchor",components:3,type:"Int16"},{name:"a_globe_normal",components:3,type:"Float32"}],4),lh=ra([{name:"a_projected_pos",components:4,type:"Float32"}],4);ra([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const ch=ra([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]),uh=ra([{name:"a_size_scale",components:1,type:"Float32"},{name:"a_padding",components:2,type:"Float32"}]);ra([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Int16",name:"tileAnchorX"},{type:"Int16",name:"tileAnchorY"},{type:"Float32",name:"x1"},{type:"Float32",name:"y1"},{type:"Float32",name:"x2"},{type:"Float32",name:"y2"},{type:"Int16",name:"padding"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const hh=ra([{name:"a_pos",components:3,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),dh=ra([{name:"a_pos_2f",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);ra([{name:"triangle",components:3,type:"Uint16"}]),ra([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"},{type:"Uint8",name:"flipState"}]),ra([{type:"Int16",name:"projectedAnchorX"},{type:"Int16",name:"projectedAnchorY"},{type:"Int16",name:"projectedAnchorZ"},{type:"Float32",name:"tileAnchorX"},{type:"Float32",name:"tileAnchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),ra([{type:"Float32",name:"offsetX"}]),ra([{type:"Int16",name:"x"},{type:"Int16",name:"y"}]);var fh=24;const ph=128;function mh(e,t){const{expression:n}=t;if("constant"===n.kind)return{kind:"constant",layoutSize:n.evaluate(new Uo(e+1))};if("source"===n.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:i}=n;let r=0;for(;r<t.length&&t[r]<=e;)r++;r=Math.max(0,r-1);let o=r;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const a=t[r],s=t[o];return"composite"===n.kind?{kind:"composite",minZoom:a,maxZoom:s,interpolationType:i}:{kind:"camera",minZoom:a,maxZoom:s,minSize:n.evaluate(new Uo(a)),maxSize:n.evaluate(new Uo(s)),interpolationType:i}}}function gh(e,{uSize:t,uSizeT:n},{lowerSize:i,upperSize:r}){return"source"===e.kind?i/ph:"composite"===e.kind?kn(i/ph,r/ph,n):t}function _h(e,t){let n=0,i=0;if("constant"===e.kind)i=e.layoutSize;else if("source"!==e.kind){const{interpolationType:r,minZoom:o,maxZoom:a}=e,s=r?T(Hn.interpolationFactor(r,t,o,a),0,1):0;"camera"===e.kind?i=kn(e.minSize,e.maxSize,s):n=s}return{uSizeT:n,uSize:i}}var yh=Object.freeze({__proto__:null,getSizeData:mh,evaluateSizeForFeature:gh,evaluateSizeForZoom:_h,SIZE_PACK_FACTOR:ph});function vh(e,t,n){return e.sections.forEach((e=>{e.text=function(e,t,n){const i=t.layout.get("text-transform").evaluate(n,{});return"uppercase"===i?e=e.toLocaleUpperCase():"lowercase"===i&&(e=e.toLocaleLowerCase()),jo.applyArabicShaping&&(e=jo.applyArabicShaping(e)),e}(e.text,t,n)})),e}const xh={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function bh(e){return"︶"===e||"﹈"===e||"︸"===e||"﹄"===e||"﹂"===e||"︾"===e||"︼"===e||"︺"===e||"︘"===e||"﹀"===e||"︐"===e||"︓"===e||"︔"===e||"`"===e||" ̄"===e||"︑"===e||"︒"===e}function wh(e){return"︵"===e||"﹇"===e||"︷"===e||"﹃"===e||"﹁"===e||"︽"===e||"︻"===e||"︹"===e||"︗"===e||"︿"===e}var Eh=Ah,Th=function(e,t,n,i,r){var o,a,s=8*r-i-1,l=(1<<s)-1,c=l>>1,u=-7,h=n?r-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+h],h+=d,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=i;u>0;a=256*a+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,i),o-=c}return(f?-1:1)*a*Math.pow(2,o-i)},Sh=function(e,t,n,i,r,o){var a,s,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,p=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*l-1)*Math.pow(2,r),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;e[n+f]=255&s,f+=p,s/=256,r-=8);for(a=a<<r|s,c+=r;c>0;e[n+f]=255&a,f+=p,a/=256,c-=8);e[n+f-p]|=128*m};function Ah(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Ah.Varint=0,Ah.Fixed64=1,Ah.Bytes=2,Ah.Fixed32=5;var Ch=4294967296,kh=1/Ch,Mh="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Ih(e){return e.type===Ah.Bytes?e.readVarint()+e.pos:e.pos+1}function Ph(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Dh(e,t,n){var i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(i);for(var r=n.pos-1;r>=e;r--)n.buf[r+i]=n.buf[r]}function zh(e,t){for(var n=0;n<e.length;n++)t.writeVarint(e[n])}function Lh(e,t){for(var n=0;n<e.length;n++)t.writeSVarint(e[n])}function Oh(e,t){for(var n=0;n<e.length;n++)t.writeFloat(e[n])}function Rh(e,t){for(var n=0;n<e.length;n++)t.writeDouble(e[n])}function Bh(e,t){for(var n=0;n<e.length;n++)t.writeBoolean(e[n])}function Fh(e,t){for(var n=0;n<e.length;n++)t.writeFixed32(e[n])}function Nh(e,t){for(var n=0;n<e.length;n++)t.writeSFixed32(e[n])}function jh(e,t){for(var n=0;n<e.length;n++)t.writeFixed64(e[n])}function Uh(e,t){for(var n=0;n<e.length;n++)t.writeSFixed64(e[n])}function Vh(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Gh(e,t,n){e[n]=t,e[n+1]=t>>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function qh(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function $h(e,t,n){t.glyphs=[],1===e&&n.readMessage(Wh,t)}function Wh(e,t,n){if(3===e){const{id:e,bitmap:i,width:r,height:o,left:a,top:s,advance:l}=n.readMessage(Zh,{});t.glyphs.push({id:e,bitmap:new pc({width:r+6,height:o+6},i),metrics:{width:r,height:o,left:a,top:s,advance:l}})}else 4===e?t.ascender=n.readSVarint():5===e&&(t.descender=n.readSVarint())}function Zh(e,t,n){1===e?t.id=n.readVarint():2===e?t.bitmap=n.readBytes():3===e?t.width=n.readVarint():4===e?t.height=n.readVarint():5===e?t.left=n.readSVarint():6===e?t.top=n.readSVarint():7===e&&(t.advance=n.readVarint())}function Xh(e){let t=0,n=0;for(const i of e)t+=i.w*i.h,n=Math.max(n,i.w);e.sort(((e,t)=>t.h-e.h));const i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),n),h:1/0}];let r=0,o=0;for(const t of e)for(let e=i.length-1;e>=0;e--){const n=i[e];if(!(t.w>n.w||t.h>n.h)){if(t.x=n.x,t.y=n.y,o=Math.max(o,t.y+t.h),r=Math.max(r,t.x+t.w),t.w===n.w&&t.h===n.h){const t=i.pop();e<i.length&&(i[e]=t)}else t.h===n.h?(n.x+=t.w,n.w-=t.w):t.w===n.w?(n.y+=t.h,n.h-=t.h):(i.push({x:n.x+t.w,y:n.y,w:n.w-t.w,h:t.h}),n.y+=t.h,n.h-=t.h);break}}return{w:r,h:o,fill:t/(r*o)||0}}Ah.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos<n;){var i=this.readVarint(),r=i>>3,o=this.pos;this.type=7&i,e(r,t,this),this.pos===o&&this.skip(i)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Vh(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=qh(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Vh(this.buf,this.pos)+Vh(this.buf,this.pos+4)*Ch;return this.pos+=8,e},readSFixed64:function(){var e=Vh(this.buf,this.pos)+qh(this.buf,this.pos+4)*Ch;return this.pos+=8,e},readFloat:function(){var e=Th(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Th(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,n,i=this.buf;return t=127&(n=i[this.pos++]),n<128?t:(t|=(127&(n=i[this.pos++]))<<7,n<128?t:(t|=(127&(n=i[this.pos++]))<<14,n<128?t:(t|=(127&(n=i[this.pos++]))<<21,n<128?t:function(e,t,n){var i,r,o=n.buf;if(i=(112&(r=o[n.pos++]))>>4,r<128)return Ph(e,i,t);if(i|=(127&(r=o[n.pos++]))<<3,r<128)return Ph(e,i,t);if(i|=(127&(r=o[n.pos++]))<<10,r<128)return Ph(e,i,t);if(i|=(127&(r=o[n.pos++]))<<17,r<128)return Ph(e,i,t);if(i|=(127&(r=o[n.pos++]))<<24,r<128)return Ph(e,i,t);if(i|=(1&(r=o[n.pos++]))<<31,r<128)return Ph(e,i,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(n=i[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Mh?function(e,t,n){return Mh.decode(e.subarray(t,n))}(this.buf,t,e):function(e,t,n){for(var i="",r=t;r<n;){var o,a,s,l=e[r],c=null,u=l>239?4:l>223?3:l>191?2:1;if(r+u>n)break;1===u?l<128&&(c=l):2===u?128==(192&(o=e[r+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(a=e[r+2],128==(192&(o=e[r+1]))&&128==(192&a)&&((c=(15&l)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=e[r+2],s=e[r+3],128==(192&(o=e[r+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),r+=u}return i}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Ah.Bytes)return e.push(this.readVarint(t));var n=Ih(this);for(e=e||[];this.pos<n;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Ah.Bytes)return e.push(this.readSVarint());var t=Ih(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Ah.Bytes)return e.push(this.readBoolean());var t=Ih(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Ah.Bytes)return e.push(this.readFloat());var t=Ih(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Ah.Bytes)return e.push(this.readDouble());var t=Ih(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Ah.Bytes)return e.push(this.readFixed32());var t=Ih(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Ah.Bytes)return e.push(this.readSFixed32());var t=Ih(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Ah.Bytes)return e.push(this.readFixed64());var t=Ih(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Ah.Bytes)return e.push(this.readSFixed64());var t=Ih(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Ah.Varint)for(;this.buf[this.pos++]>127;);else if(t===Ah.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Ah.Fixed32)this.pos+=4;else{if(t!==Ah.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var n=new Uint8Array(t);n.set(this.buf),this.buf=n,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Gh(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Gh(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Gh(this.buf,-1&e,this.pos),Gh(this.buf,Math.floor(e*kh),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Gh(this.buf,-1&e,this.pos),Gh(this.buf,Math.floor(e*kh),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var n,i;if(e>=0?(n=e%4294967296|0,i=e/4294967296|0):(i=~(-e/4294967296),4294967295^(n=~(-e%4294967296))?n=n+1|0:(n=0,i=i+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,n){n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,n.buf[n.pos]=127&(e>>>=7)}(n,0,t),function(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(i,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,n){for(var i,r,o=0;o<t.length;o++){if((i=t.charCodeAt(o))>55295&&i<57344){if(!r){i>56319||o+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):r=i;continue}if(i<56320){e[n++]=239,e[n++]=191,e[n++]=189,r=i;continue}i=r-55296<<10|i-56320|65536,r=null}else r&&(e[n++]=239,e[n++]=191,e[n++]=189,r=null);i<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:(i<65536?e[n++]=i>>12|224:(e[n++]=i>>18|240,e[n++]=i>>12&63|128),e[n++]=i>>6&63|128),e[n++]=63&i|128)}return n}(this.buf,e,this.pos);var n=this.pos-t;n>=128&&Dh(t,n,this),this.pos=t-1,this.writeVarint(n),this.pos+=n},writeFloat:function(e){this.realloc(4),Sh(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Sh(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n<t;n++)this.buf[this.pos++]=e[n]},writeRawMessage:function(e,t){this.pos++;var n=this.pos;e(t,this);var i=this.pos-n;i>=128&&Dh(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeMessage:function(e,t,n){this.writeTag(e,Ah.Bytes),this.writeRawMessage(t,n)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,zh,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Lh,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Bh,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Oh,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Rh,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Fh,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Nh,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,jh,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Uh,t)},writeBytesField:function(e,t){this.writeTag(e,Ah.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Ah.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Ah.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Ah.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Ah.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Ah.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Ah.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Ah.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Ah.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Ah.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};class Hh{constructor(e,{pixelRatio:t,version:n,stretchX:i,stretchY:r,content:o}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=i,this.stretchY=r,this.content=o,this.version=n}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Yh{constructor(e,t){const n={},i={};this.haveRenderCallbacks=[];const r=[];this.addImages(e,n,r),this.addImages(t,i,r);const{w:o,h:a}=Xh(r),s=new mc({width:o||1,height:a||1});for(const t in e){const i=e[t],r=n[t].paddedRect;mc.copy(i.data,s,{x:0,y:0},{x:r.x+1,y:r.y+1},i.data)}for(const e in t){const n=t[e],r=i[e].paddedRect,o=r.x+1,a=r.y+1,l=n.data.width,c=n.data.height;mc.copy(n.data,s,{x:0,y:0},{x:o,y:a},n.data),mc.copy(n.data,s,{x:0,y:c-1},{x:o,y:a-1},{width:l,height:1}),mc.copy(n.data,s,{x:0,y:0},{x:o,y:a+c},{width:l,height:1}),mc.copy(n.data,s,{x:l-1,y:0},{x:o-1,y:a},{width:1,height:c}),mc.copy(n.data,s,{x:0,y:0},{x:o+l,y:a},{width:1,height:c})}this.image=s,this.iconPositions=n,this.patternPositions=i}addImages(e,t,n){for(const i in e){const r=e[i],o={x:0,y:0,w:r.data.width+2,h:r.data.height+2};n.push(o),t[i]=new Hh(o,r),r.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t){this.haveRenderCallbacks=this.haveRenderCallbacks.filter((t=>e.hasImage(t))),e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),t),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),t)}patchUpdatedImage(e,t,n){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[i,r]=e.tl;n.update(t.data,void 0,{x:i,y:r})}}Vr(Hh,"ImagePosition"),Vr(Yh,"ImageAtlas");const Kh={horizontal:1,vertical:2,horizontalOnly:3};class Jh{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const n=new Jh;return n.scale=e||1,n.fontStack=t,n}static forImage(e){const t=new Jh;return t.imageName=e,t}}class Qh{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const n=new Qh;for(let i=0;i<e.sections.length;i++){const r=e.sections[i];r.image?n.addImageSection(r):n.addTextSection(r,t)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSections(){return this.sections}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(e){this.text=function(e,t){let n="";for(let i=0;i<e.length;i++){const r=e.charCodeAt(i+1)||null,o=e.charCodeAt(i-1)||null;n+=!t&&(r&&So(r)&&!xh[e[i+1]]||o&&So(o)&&!xh[e[i-1]])||!xh[e[i]]?e[i]:xh[e[i]]}return n}(this.text,e)}trim(){let e=0;for(let t=0;t<this.text.length&&td[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&td[this.text.charCodeAt(n)];n--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const n=new Qh;return n.text=this.text.substring(e,t),n.sectionIndex=this.sectionIndex.slice(e,t),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(Jh.forText(e.scale,e.fontStack||t));const n=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(n)}addImageSection(e){const t=e.image?e.image.name:"";if(0===t.length)return void U("Can't add FormattedSection with an empty image.");const n=this.getNextImageSectionCharCode();n?(this.text+=String.fromCharCode(n),this.sections.push(Jh.forImage(t)),this.sectionIndex.push(this.sections.length-1)):U("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function ed(e,t,n,i,r,o,a,s,l,c,u,h,d,f,p){const m=Qh.fromFeature(e,r);h===Kh.vertical&&m.verticalizePunctuation(d);let g=[];const _=function(e,t,n,i,r,o){if(!e)return[];const a=[],s=function(e,t,n,i,r,o){let a=0;for(let n=0;n<e.length();n++){const s=e.getSection(n);a+=id(e.getCharCode(n),s,i,r,t,o)}return a/Math.max(1,Math.ceil(a/n))}(e,t,n,i,r,o),l=e.text.indexOf("​")>=0;let c=0;for(let n=0;n<e.length();n++){const h=e.getSection(n),d=e.getCharCode(n);if(td[d]||(c+=id(d,h,i,r,t,o)),n<e.length()-1){const t=!((u=d)<11904||!(io(u)||no(u)||_o(u)||po(u)||so(u)||Yr(u)||ro(u)||Qr(u)||lo(u)||co(u)||ao(u)||xo(u)||eo(u)||Jr(u)||Kr(u)||oo(u)||to(u)||go(u)||ho(u)||uo(u)));(nd[d]||t||h.imageName)&&a.push(ad(n+1,c,s,a,od(d,e.getCharCode(n+1),t&&l),!1))}}var u;return sd(ad(e.length(),c,s,a,0,!0))}(m,c,o,t,i,f),{processBidirectionalText:y,processStyledBidirectionalText:v}=jo;if(y&&1===m.sections.length){const e=y(m.toString(),_);for(const t of e){const e=new Qh;e.text=t,e.sections=m.sections;for(let n=0;n<t.length;n++)e.sectionIndex.push(0);g.push(e)}}else if(v){const e=v(m.text,m.sectionIndex,_);for(const t of e){const e=new Qh;e.text=t[0],e.sectionIndex=t[1],e.sections=m.sections,g.push(e)}}else g=function(e,t){const n=[],i=e.text;let r=0;for(const i of t)n.push(e.substring(r,i)),r=i;return r<i.length&&n.push(e.substring(r,i.length)),n}(m,_);const x=[],b={positionedLines:x,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1,hasBaseline:!1};return function(e,t,n,i,r,o,a,s,l,c,u,h){let d=0,f=0,p=0;const m="right"===s?1:"left"===s?0:.5;let g=!1;for(const e of r){const n=e.getSections();for(const e of n){if(e.imageName)continue;const n=t[e.fontStack];if(n&&(g=void 0!==n.ascender&&void 0!==n.descender,!g))break}if(!g)break}let _=0;for(const a of r){a.trim();const r=a.getMaxScale(),s=(r-1)*fh,v={positionedGlyphs:[],lineOffset:0};e.positionedLines[_]=v;const x=v.positionedGlyphs;let b=0;if(!a.length()){f+=o,++_;continue}let w=0,E=0;for(let o=0;o<a.length();o++){const s=a.getSection(o),p=a.getSectionIndex(o),m=a.getCharCode(o);let _=s.scale,v=null,T=null,S=null,A=fh,C=0;const k=!(l===Kh.horizontal||!u&&!To(m)||u&&(td[m]||(y=m,Zr(y)||Xr(y)||Hr(y)||mo(y)||vo(y))));if(s.imageName){const t=i[s.imageName];if(!t)continue;S=s.imageName,e.iconsInText=e.iconsInText||!0,T=t.paddedRect;const n=t.displaySize;_=_*fh/h,v={width:n[0],height:n[1],left:1,top:-3,advance:k?n[1]:n[0],localGlyph:!1},C=g?-v.height*_:r*fh-17-n[1]*_,A=v.advance;const o=(k?n[0]:n[1])*_-fh*r;o>0&&o>b&&(b=o)}else{const e=n[s.fontStack];if(!e)continue;e[m]&&(T=e[m]);const i=t[s.fontStack];if(!i)continue;const o=i.glyphs[m];if(!o)continue;if(v=o.metrics,A=8203!==m?fh:0,g){const e=void 0!==i.ascender?Math.abs(i.ascender):0,t=void 0!==i.descender?Math.abs(i.descender):0,n=(e+t)*_;w<n&&(w=n,E=(e-t)/2*_),C=-e*_}else C=(r-_)*fh-17}k?(e.verticalizable=!0,x.push({glyph:m,imageName:S,x:d,y:f+C,vertical:k,scale:_,localGlyph:v.localGlyph,fontStack:s.fontStack,sectionIndex:p,metrics:v,rect:T}),d+=A*_+c):(x.push({glyph:m,imageName:S,x:d,y:f+C,vertical:k,scale:_,localGlyph:v.localGlyph,fontStack:s.fontStack,sectionIndex:p,metrics:v,rect:T}),d+=v.advance*_+c)}0!==x.length&&(p=Math.max(d-c,p),g?cd(x,m,b,E,o*r/2):cd(x,m,b,0,o/2)),d=0;const T=o*r+b;v.lineOffset=Math.max(b,s),f+=T,++_}var y;const v=f,{horizontalAlign:x,verticalAlign:b}=ld(a);(function(e,t,n,i,r,o){const a=(t-n)*r,s=-o*i;for(const t of e)for(const e of t.positionedGlyphs)e.x+=a,e.y+=s})(e.positionedLines,m,x,b,p,v),e.top+=-b*v,e.bottom=e.top+v,e.left+=-x*p,e.right=e.left+p,e.hasBaseline=g}(b,t,n,i,g,a,s,l,h,c,d,p),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(x)&&b}const td={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},nd={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function id(e,t,n,i,r,o){if(t.imageName){const e=i[t.imageName];return e?e.displaySize[0]*t.scale*fh/o+r:0}{const i=n[t.fontStack],o=i&&i.glyphs[e];return o?o.metrics.advance*t.scale+r:0}}function rd(e,t,n,i){const r=Math.pow(e-t,2);return i?e<t?r/2:2*r:r+Math.abs(n)*n}function od(e,t,n){let i=0;return 10===e&&(i-=1e4),n&&(i+=150),40!==e&&65288!==e||(i+=50),41!==t&&65289!==t||(i+=50),i}function ad(e,t,n,i,r,o){let a=null,s=rd(t,n,r,o);for(const e of i){const i=rd(t-e.x,n,r,o)+e.badness;i<=s&&(a=e,s=i)}return{index:e,x:t,priorBreak:a,badness:s}}function sd(e){return e?sd(e.priorBreak).concat(e.index):[]}function ld(e){let t=.5,n=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:t,verticalAlign:n}}function cd(e,t,n,i,r){if(!(t||n||i||r))return;const o=e.length-1,a=e[o],s=(a.x+a.metrics.advance*a.scale)*t;for(let t=0;t<=o;t++)e[t].x-=s,e[t].y+=n+i+r}function ud(e,t,n){const{horizontalAlign:i,verticalAlign:r}=ld(n),o=t[0]-e.displaySize[0]*i,a=t[1]-e.displaySize[1]*r;return{image:e,top:a,bottom:a+e.displaySize[1],left:o,right:o+e.displaySize[0]}}function hd(e,t,n,i,r,o){const a=e.image;let s;if(a.content){const e=a.content,t=a.pixelRatio||1;s=[e[0]/t,e[1]/t,a.displaySize[0]-e[2]/t,a.displaySize[1]-e[3]/t]}const l=t.left*o,c=t.right*o;let u,h,d,f;"width"===n||"both"===n?(f=r[0]+l-i[3],h=r[0]+c+i[1]):(f=r[0]+(l+c-a.displaySize[0])/2,h=f+a.displaySize[0]);const p=t.top*o,m=t.bottom*o;return"height"===n||"both"===n?(u=r[1]+p-i[0],d=r[1]+m+i[2]):(u=r[1]+(p+m-a.displaySize[1])/2,d=u+a.displaySize[1]),{image:a,top:u,right:h,bottom:d,left:f,collisionPadding:s}}class dd extends p{constructor(e,t,n,i,r){super(e,t),this.angle=i,this.z=n,void 0!==r&&(this.segment=r)}clone(){return new dd(this.x,this.y,this.z,this.angle,this.segment)}}function fd(e,t,n,i,r){if(void 0===t.segment)return!0;let o=t,a=t.segment+1,s=0;for(;s>-n/2;){if(a--,a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;const l=[];let c=0;for(;s<n/2;){const t=e[a],n=e[a+1];if(!n)return!1;let o=e[a-1].angleTo(t)-t.angleTo(n);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:o}),c+=o;s-l[0].distance>i;)c-=l.shift().angleDelta;if(c>r)return!1;a++,s+=t.dist(n)}return!0}function pd(e){let t=0;for(let n=0;n<e.length-1;n++)t+=e[n].dist(e[n+1]);return t}function md(e,t,n){return e?.6*t*n:0}function gd(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function _d(e,t,n,i,r,o){const a=md(n,r,o),s=gd(n,i)*o;let l=0;const c=pd(e)/2;for(let n=0;n<e.length-1;n++){const i=e[n],r=e[n+1],o=i.dist(r);if(l+o>c){const u=(c-l)/o,h=kn(i.x,r.x,u),d=kn(i.y,r.y,u),f=new dd(h,d,0,r.angleTo(i),n);return!a||fd(e,f,s,a,t)?f:void 0}l+=o}}function yd(e,t,n,i,r,o,a,s,l){const c=md(i,o,a),u=gd(i,r),h=u*a,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),vd(e,d?t/2*s%t:(u/2+2*o)*a*s%t,t,c,n,h,d,!1,l)}function vd(e,t,n,i,r,o,a,s,l){const c=o/2,u=pd(e);let h=0,d=t-n,f=[];for(let t=0;t<e.length-1;t++){const a=e[t],s=e[t+1],p=a.dist(s),m=s.angleTo(a);for(;d+n<h+p;){d+=n;const g=(d-h)/p,_=kn(a.x,s.x,g),y=kn(a.y,s.y,g);if(_>=0&&_<l&&y>=0&&y<l&&d-c>=0&&d+c<=u){const n=new dd(_,y,0,m,t);n._round(),i&&!fd(e,n,o,i,r)||f.push(n)}}h+=p}return s||f.length||a||(f=vd(e,h/2,n,i,r,o,a,!0,l)),f}function xd(e,t,n,i,r){const o=[];for(let a=0;a<e.length;a++){const s=e[a];let l;for(let e=0;e<s.length-1;e++){let a=s[e],c=s[e+1];a.x<t&&c.x<t||(a.x<t?a=new p(t,a.y+(t-a.x)/(c.x-a.x)*(c.y-a.y))._round():c.x<t&&(c=new p(t,a.y+(t-a.x)/(c.x-a.x)*(c.y-a.y))._round()),a.y<n&&c.y<n||(a.y<n?a=new p(a.x+(n-a.y)/(c.y-a.y)*(c.x-a.x),n)._round():c.y<n&&(c=new p(a.x+(n-a.y)/(c.y-a.y)*(c.x-a.x),n)._round()),a.x>=i&&c.x>=i||(a.x>=i?a=new p(i,a.y+(i-a.x)/(c.x-a.x)*(c.y-a.y))._round():c.x>=i&&(c=new p(i,a.y+(i-a.x)/(c.x-a.x)*(c.y-a.y))._round()),a.y>=r&&c.y>=r||(a.y>=r?a=new p(a.x+(r-a.y)/(c.y-a.y)*(c.x-a.x),r)._round():c.y>=r&&(c=new p(a.x+(r-a.y)/(c.y-a.y)*(c.x-a.x),r)._round()),l&&a.equals(l[l.length-1])||(l=[a],o.push(l)),l.push(c)))))}}return o}Vr(dd,"Anchor");const bd=1e20;function wd(e,t,n,i,r,o,a,s,l){for(let c=t;c<t+i;c++)Ed(e,n*o+c,o,r,a,s,l);for(let c=n;c<n+r;c++)Ed(e,c*o+t,1,i,a,s,l)}function Ed(e,t,n,i,r,o,a){o[0]=0,a[0]=-bd,a[1]=bd,r[0]=e[t];for(let s=1,l=0,c=0;s<i;s++){r[s]=e[t+s*n];const i=s*s;do{const e=o[l];c=(r[s]-r[e]+i-e*e)/(s-e)/2}while(c<=a[l]&&--l>-1);l++,o[l]=s,a[l]=c,a[l+1]=bd}for(let s=0,l=0;s<i;s++){for(;a[l+1]<s;)l++;const i=o[l],c=s-i;e[t+s*n]=r[i]+c*c}}const Td={none:0,ideographs:1,all:2};class Sd{constructor(e,t,n){this.requestManager=e,this.localGlyphMode=t,this.localFontFamily=n,this.entries={},this.localGlyphs={200:{},400:{},500:{},900:{}}}setURL(e){this.url=e}getGlyphs(e,t){const n=[];for(const t in e)for(const i of e[t])n.push({stack:t,id:i});C(n,(({stack:e,id:t},n)=>{let i=this.entries[e];i||(i=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let r=i.glyphs[t];if(void 0!==r)return void n(null,{stack:e,id:t,glyph:r});if(r=this._tinySDF(i,e,t),r)return i.glyphs[t]=r,void n(null,{stack:e,id:t,glyph:r});const o=Math.floor(t/256);if(256*o>65535)return void n(new Error("glyphs > 65535 not supported"));if(i.ranges[o])return void n(null,{stack:e,id:t,glyph:r});let a=i.requests[o];a||(a=i.requests[o]=[],Sd.loadGlyphRange(e,o,this.url,this.requestManager,((e,t)=>{if(t){i.ascender=t.ascender,i.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(i.glyphs[+e]=t.glyphs[+e]);i.ranges[o]=!0}for(const n of a)n(e,t);delete i.requests[o]}))),a.push(((i,r)=>{i?n(i):r&&n(null,{stack:e,id:t,glyph:r.glyphs[t]||null})}))}),((e,n)=>{if(e)t(e);else if(n){const e={};for(const{stack:t,id:i,glyph:r}of n)void 0===e[t]&&(e[t]={}),void 0===e[t].glyphs&&(e[t].glyphs={}),e[t].glyphs[i]=r&&{id:r.id,bitmap:r.bitmap.clone(),metrics:r.metrics},e[t].ascender=this.entries[t].ascender,e[t].descender=this.entries[t].descender;t(null,e)}}))}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==Td.none&&(this.localGlyphMode===Td.all?!!this.localFontFamily:!!this.localFontFamily&&(co(e)||fo(e)||eo(e)||to(e)||Qr(e)))}_tinySDF(e,t,n){const i=this.localFontFamily;if(!i||!this._doesCharSupportLocalGlyph(n))return;let r=e.tinySDF;if(!r){let n="400";/bold/i.test(t)?n="900":/medium/i.test(t)?n="500":/light/i.test(t)&&(n="200"),r=e.tinySDF=new Sd.TinySDF({fontFamily:i,fontWeight:n,fontSize:48,buffer:6,radius:16}),r.fontWeight=n}if(this.localGlyphs[r.fontWeight][n])return this.localGlyphs[r.fontWeight][n];const o=String.fromCharCode(n),{data:a,width:s,height:l,glyphWidth:c,glyphHeight:u,glyphLeft:h,glyphTop:d,glyphAdvance:f}=r.draw(o);return this.localGlyphs[r.fontWeight][n]={id:n,bitmap:new pc({width:s,height:l},a),metrics:{width:c/2,height:u/2,left:h/2,top:d/2-27,advance:f/2,localGlyph:!0}}}}function Ad(e,t,n,i){const r=[],o=e.image,a=o.pixelRatio,s=o.paddedRect.w-2,l=o.paddedRect.h-2,c=e.right-e.left,u=e.bottom-e.top,h=o.stretchX||[[0,s]],d=o.stretchY||[[0,l]],f=(e,t)=>e+t[1]-t[0],m=h.reduce(f,0),g=d.reduce(f,0),_=s-m,y=l-g;let v=0,x=m,b=0,w=g,E=0,T=_,S=0,A=y;if(o.content&&i){const e=o.content;v=Cd(h,0,e[0]),b=Cd(d,0,e[1]),x=Cd(h,e[0],e[2]),w=Cd(d,e[1],e[3]),E=e[0]-v,S=e[1]-b,T=e[2]-e[0]-x,A=e[3]-e[1]-w}const C=(i,r,s,l)=>{const h=Md(i.stretch-v,x,c,e.left),d=Id(i.fixed-E,T,i.stretch,m),f=Md(r.stretch-b,w,u,e.top),_=Id(r.fixed-S,A,r.stretch,g),y=Md(s.stretch-v,x,c,e.left),C=Id(s.fixed-E,T,s.stretch,m),k=Md(l.stretch-b,w,u,e.top),M=Id(l.fixed-S,A,l.stretch,g),I=new p(h,f),P=new p(y,f),D=new p(y,k),z=new p(h,k),L=new p(d/a,_/a),O=new p(C/a,M/a),R=t*Math.PI/180;if(R){const e=Math.sin(R),t=Math.cos(R),n=[t,-e,e,t];I._matMult(n),P._matMult(n),z._matMult(n),D._matMult(n)}const B=i.stretch+i.fixed,F=r.stretch+r.fixed;return{tl:I,tr:P,bl:z,br:D,tex:{x:o.paddedRect.x+1+B,y:o.paddedRect.y+1+F,w:s.stretch+s.fixed-B,h:l.stretch+l.fixed-F},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:L,pixelOffsetBR:O,minFontScaleX:T/a/c,minFontScaleY:A/a/u,isSDF:n}};if(i&&(o.stretchX||o.stretchY)){const e=kd(h,_,m),t=kd(d,y,g);for(let n=0;n<e.length-1;n++){const i=e[n],o=e[n+1];for(let e=0;e<t.length-1;e++)r.push(C(i,t[e],o,t[e+1]))}}else r.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));return r}function Cd(e,t,n){let i=0;for(const r of e)i+=Math.max(t,Math.min(n,r[1]))-Math.max(t,Math.min(n,r[0]));return i}function kd(e,t,n){const i=[{fixed:-1,stretch:0}];for(const[t,n]of e){const e=i[i.length-1];i.push({fixed:t-e.stretch,stretch:e.stretch}),i.push({fixed:t-e.stretch,stretch:e.stretch+(n-t)})}return i.push({fixed:t+1,stretch:n}),i}function Md(e,t,n,i){return e/t*n+i}function Id(e,t,n,i){return e-t*n/i}function Pd(e,t,n,i){const r=t+e.positionedLines[i].lineOffset;return 0===i?n+r/2:n+(r+(t+e.positionedLines[i-1].lineOffset))/2}Sd.loadGlyphRange=function(e,t,n,i,r){const o=256*t,a=o+255,s=i.transformRequest(i.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",`${o}-${a}`),oe.Glyphs);ce(s,((e,t)=>{if(e)r(e);else if(t){const e={},n=function(e){return new Eh(e).readFields($h,{})}(t);for(const t of n.glyphs)e[t.id]=t;r(null,{glyphs:e,ascender:n.ascender,descender:n.descender})}}))},Sd.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:n=8,cutoff:i=.25,fontFamily:r="sans-serif",fontWeight:o="normal",fontStyle:a="normal"}={}){this.buffer=t,this.cutoff=i,this.radius=n;const s=this.size=e+4*t,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${a} ${o} ${e}px ${r}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:n,actualBoundingBoxDescent:i,actualBoundingBoxLeft:r,actualBoundingBoxRight:o}=this.ctx.measureText(e),a=Math.ceil(n),s=Math.min(this.size-this.buffer,Math.ceil(o-r)),l=Math.min(this.size-this.buffer,a+Math.ceil(i)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),d=new Uint8ClampedArray(h),f={data:d,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:t};if(0===s||0===l)return f;const{ctx:p,buffer:m,gridInner:g,gridOuter:_}=this;p.clearRect(m,m,s,l),p.fillText(e,m,m+a);const y=p.getImageData(m,m,s,l);_.fill(bd,0,h),g.fill(0,0,h);for(let e=0;e<l;e++)for(let t=0;t<s;t++){const n=y.data[4*(e*s+t)+3]/255;if(0===n)continue;const i=(e+m)*c+t+m;if(1===n)_[i]=0,g[i]=bd;else{const e=.5-n;_[i]=e>0?e*e:0,g[i]=e<0?e*e:0}}wd(_,0,0,c,u,c,this.f,this.v,this.z),wd(g,m,m,s,l,c,this.f,this.v,this.z);for(let e=0;e<h;e++){const t=Math.sqrt(_[e])-Math.sqrt(g[e]);d[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return f}};class Dd{constructor(e=[],t=zd){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:n}=this,i=t[e];for(;e>0;){const r=e-1>>1,o=t[r];if(n(i,o)>=0)break;t[e]=o,e=r}t[e]=i}_down(e){const{data:t,compare:n}=this,i=this.length>>1,r=t[e];for(;e<i;){let i=1+(e<<1),o=t[i];const a=i+1;if(a<this.length&&n(t[a],o)<0&&(i=a,o=t[a]),n(o,r)>=0)break;t[e]=o,e=i}t[e]=r}}function zd(e,t){return e<t?-1:e>t?1:0}function Ld(e,t=1,n=!1){let i=1/0,r=1/0,o=-1/0,a=-1/0;const s=e[0];for(let e=0;e<s.length;e++){const t=s[e];(!e||t.x<i)&&(i=t.x),(!e||t.y<r)&&(r=t.y),(!e||t.x>o)&&(o=t.x),(!e||t.y>a)&&(a=t.y)}const l=Math.min(o-i,a-r);let c=l/2;const u=new Dd([],Od);if(0===l)return new p(i,r);for(let t=i;t<o;t+=l)for(let n=r;n<a;n+=l)u.push(new Rd(t+c,n+c,c,e));let h=function(e){let t=0,n=0,i=0;const r=e[0];for(let e=0,o=r.length,a=o-1;e<o;a=e++){const o=r[e],s=r[a],l=o.x*s.y-s.x*o.y;n+=(o.x+s.x)*l,i+=(o.y+s.y)*l,t+=3*l}return new Rd(n/t,i/t,0,e)}(e),d=u.length;for(;u.length;){const i=u.pop();(i.d>h.d||!h.d)&&(h=i,n&&console.log("found best %d after %d probes",Math.round(1e4*i.d)/1e4,d)),i.max-h.d<=t||(c=i.h/2,u.push(new Rd(i.p.x-c,i.p.y-c,c,e)),u.push(new Rd(i.p.x+c,i.p.y-c,c,e)),u.push(new Rd(i.p.x-c,i.p.y+c,c,e)),u.push(new Rd(i.p.x+c,i.p.y+c,c,e)),d+=4)}return n&&(console.log(`num probes: ${d}`),console.log(`best distance: ${h.d}`)),h.p}function Od(e,t){return t.max-e.max}function Rd(e,t,n,i){this.p=new p(e,t),this.h=n,this.d=function(e,t){let n=!1,i=1/0;for(let r=0;r<t.length;r++){const o=t[r];for(let t=0,r=o.length,a=r-1;t<r;a=t++){const r=o[t],s=o[a];r.y>e.y!=s.y>e.y&&e.x<(s.x-r.x)*(e.y-r.y)/(s.y-r.y)+r.x&&(n=!n),i=Math.min(i,nl(e,r,s))}}return(n?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}const Bd=Number.POSITIVE_INFINITY,Fd=Math.sqrt(2);function Nd(e,[t,n]){let i=0,r=0;if(n===Bd){t<0&&(t=0);const n=t/Fd;switch(e){case"top-right":case"top-left":r=n-7;break;case"bottom-right":case"bottom-left":r=7-n;break;case"bottom":r=7-t;break;case"top":r=t-7}switch(e){case"top-right":case"bottom-right":i=-n;break;case"top-left":case"bottom-left":i=n;break;case"left":i=t;break;case"right":i=-t}}else{switch(t=Math.abs(t),n=Math.abs(n),e){case"top-right":case"top-left":case"top":r=n-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-n}switch(e){case"top-right":case"bottom-right":case"right":i=-t;break;case"top-left":case"bottom-left":case"left":i=t}}return[i,r]}function jd(e,t,n,i,r,o,a,s,l,c){e.createArrays(),e.tilePixelRatio=ws/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;const u=e.layers[0].layout,h=e.layers[0]._unevaluatedLayout._values,d={};if("composite"===e.textSizeData.kind){const{minZoom:t,maxZoom:n}=e.textSizeData;d.compositeTextSizes=[h["text-size"].possiblyEvaluate(new Uo(t),s),h["text-size"].possiblyEvaluate(new Uo(n),s)]}if("composite"===e.iconSizeData.kind){const{minZoom:t,maxZoom:n}=e.iconSizeData;d.compositeIconSizes=[h["icon-size"].possiblyEvaluate(new Uo(t),s),h["icon-size"].possiblyEvaluate(new Uo(n),s)]}d.layoutTextSize=h["text-size"].possiblyEvaluate(new Uo(l+1),s),d.layoutIconSize=h["icon-size"].possiblyEvaluate(new Uo(l+1),s),d.textMaxSize=h["text-size"].possiblyEvaluate(new Uo(18),s);const f="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),p=u.get("text-size");for(const o of e.features){const l=u.get("text-font").evaluate(o,{},s).join(","),h=p.evaluate(o,{},s),m=d.layoutTextSize.evaluate(o,{},s),g=(d.layoutIconSize.evaluate(o,{},s),{horizontal:{},vertical:void 0}),_=o.text;let y,v=[0,0];if(_){const i=_.toString(),a=u.get("text-letter-spacing").evaluate(o,{},s)*fh,c=u.get("text-line-height").evaluate(o,{},s)*fh,d=wo(i)?a:0,p=u.get("text-anchor").evaluate(o,{},s),y=u.get("text-variable-anchor");if(!y){const e=u.get("text-radial-offset").evaluate(o,{},s);v=e?Nd(p,[e*fh,Bd]):u.get("text-offset").evaluate(o,{},s).map((e=>e*fh))}let x=f?"center":u.get("text-justify").evaluate(o,{},s);const b="point"===u.get("symbol-placement"),w=b?u.get("text-max-width").evaluate(o,{},s)*fh:1/0,E=o=>{e.allowVerticalPlacement&&bo(i)&&(g.vertical=ed(_,t,n,r,l,w,c,p,o,d,v,Kh.vertical,!0,m,h))};if(!f&&y){const e="auto"===x?y.map((e=>Ud(e))):[x];let i=!1;for(let o=0;o<e.length;o++){const a=e[o];if(!g.horizontal[a])if(i)g.horizontal[a]=g.horizontal[0];else{const e=ed(_,t,n,r,l,w,c,"center",a,d,v,Kh.horizontal,!1,m,h);e&&(g.horizontal[a]=e,i=1===e.positionedLines.length)}}E("left")}else{if("auto"===x&&(x=Ud(p)),b||u.get("text-writing-mode").indexOf("horizontal")>=0||!bo(i)){const e=ed(_,t,n,r,l,w,c,p,x,d,v,Kh.horizontal,!1,m,h);e&&(g.horizontal[x]=e)}E(b?"left":x)}}let x=!1;if(o.icon&&o.icon.name){const t=i[o.icon.name];t&&(y=ud(r[o.icon.name],u.get("icon-offset").evaluate(o,{},s),u.get("icon-anchor").evaluate(o,{},s)),x=t.sdf,void 0===e.sdfIcons?e.sdfIcons=t.sdf:e.sdfIcons!==t.sdf&&U("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}const b=$d(g.horizontal)||g.vertical;e.iconsInText||(e.iconsInText=!!b&&b.iconsInText),(b||y)&&Vd(e,o,g,y,i,d,m,0,v,x,a,s,c)}o&&e.generateCollisionDebugBuffers(l,e.collisionBoxArray)}function Ud(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Vd(e,t,n,i,r,o,a,s,l,c,u,h,d){let f=o.textMaxSize.evaluate(t,{},h);void 0===f&&(f=a);const p=e.layers[0].layout,m=p.get("icon-offset").evaluate(t,{},h),g=$d(n.horizontal)||n.vertical,_="globe"===d.name,v=a/24,x=e.tilePixelRatio*f/24,b=(M=e.overscaling,e.zoom>18&&M>2&&(M>>=1),Math.max(ws/(512*M),1)*p.get("symbol-spacing")),w=p.get("text-padding")*e.tilePixelRatio,E=p.get("icon-padding")*e.tilePixelRatio,T=y(p.get("text-max-angle")),S="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),A="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),C=p.get("symbol-placement"),k=b/2;var M;const I=p.get("icon-text-fit");let P;i&&"none"!==I&&(e.allowVerticalPlacement&&n.vertical&&(P=hd(i,n.vertical,I,p.get("icon-text-fit-padding"),m,v)),g&&(i=hd(i,g,I,p.get("icon-text-fit-padding"),m,v)));const D=(a,s,f)=>{if(s.x<0||s.x>=ws||s.y<0||s.y>=ws)return;let p=null;if(_){const{x:e,y:t,z:n}=d.projectTilePoint(s.x,s.y,f);p={anchor:new dd(e,t,n,0,void 0),up:d.upVector(f,s.x,s.y)}}!function(e,t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b,w,E,T){const S=e.addToLineVertexArray(t,i);let A,C,k,M,I,P,D,z=0,L=0,O=0,R=0,B=-1,F=-1;const N={};let j=qa.exports("");const V=n?n.anchor:t;let G=0,q=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[G,q]=l.layout.get("text-offset").evaluate(x,{},T).map((e=>e*fh)):(G=l.layout.get("text-radial-offset").evaluate(x,{},T)*fh,q=Bd),e.allowVerticalPlacement&&r.vertical){const e=r.vertical;if(p)P=Zd(e),s&&(D=Zd(s));else{const n=l.layout.get("text-rotate").evaluate(x,{},T)+90;k=Wd(c,V,t,u,h,d,e,f,n,m),s&&(M=Wd(c,V,t,u,h,d,s,_,n))}}if(o){const i=l.layout.get("icon-rotate").evaluate(x,{},T),r="none"!==l.layout.get("icon-text-fit"),a=Ad(o,i,w,r),f=s?Ad(s,i,w,r):void 0;C=Wd(c,V,t,u,h,d,o,_,i),z=4*a.length;const p=e.iconSizeData;let m=null;"source"===p.kind?(m=[ph*l.layout.get("icon-size").evaluate(x,{},T)],m[0]>Gd&&U(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===p.kind&&(m=[ph*b.compositeIconSizes[0].evaluate(x,{},T),ph*b.compositeIconSizes[1].evaluate(x,{},T)],(m[0]>Gd||m[1]>Gd)&&U(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,a,m,v,y,x,!1,n,t,S.lineStartIndex,S.lineLength,-1,E,T),B=e.icon.placedSymbolArray.length-1,f&&(L=4*f.length,e.addSymbols(e.icon,f,m,v,y,x,Kh.vertical,n,t,S.lineStartIndex,S.lineLength,-1,E,T),F=e.icon.placedSymbolArray.length-1)}for(const i in r.horizontal){const o=r.horizontal[i];A||(j=qa.exports(o.text),p?I=Zd(o):A=Wd(c,V,t,u,h,d,o,f,l.layout.get("text-rotate").evaluate(x,{},T),m));const s=1===o.positionedLines.length;if(O+=qd(e,n,t,o,a,l,p,x,m,S,r.vertical?Kh.horizontal:Kh.horizontalOnly,s?Object.keys(r.horizontal):[i],N,B,b,E,T),s)break}r.vertical&&(R+=qd(e,n,t,r.vertical,a,l,p,x,m,S,Kh.vertical,["vertical"],N,F,b,E,T));let $=-1;const W=(e,t)=>e?Math.max(e,t):t;$=W(I,$),$=W(P,$),$=W(D,$);const Z=$>-1?1:0;e.glyphOffsetArray.length>=sp.MAX_GLYPHS&&U("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,x.sortKey),e.symbolInstances.emplaceBack(V.x,V.y,V.z,t.x,t.y,N.right>=0?N.right:-1,N.center>=0?N.center:-1,N.left>=0?N.left:-1,N.vertical>=0?N.vertical:-1,B,F,j,void 0!==A?A:e.collisionBoxArray.length,void 0!==A?A+1:e.collisionBoxArray.length,void 0!==k?k:e.collisionBoxArray.length,void 0!==k?k+1:e.collisionBoxArray.length,void 0!==C?C:e.collisionBoxArray.length,void 0!==C?C+1:e.collisionBoxArray.length,M||e.collisionBoxArray.length,M?M+1:e.collisionBoxArray.length,u,O,R,z,L,Z,0,G,q,$)}(e,s,p,a,n,i,r,P,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,w,S,l,0,E,A,m,t,o,c,u,h)};if("line"===C)for(const r of xd(t.geometry,0,0,ws,ws)){const t=yd(r,b,T,n.vertical||g,i,24,x,e.overscaling,ws);for(const n of t)g&&Xd(e,g.text,k,n)||D(r,n,h)}else if("line-center"===C){for(const e of t.geometry)if(e.length>1){const t=_d(e,T,n.vertical||g,i,24,x);t&&D(e,t,h)}}else if("Polygon"===t.type)for(const e of Jc(t.geometry,0)){const t=Ld(e,16);D(e[0],new dd(t.x,t.y,0,0,void 0),h)}else if("LineString"===t.type)for(const e of t.geometry)D(e,new dd(e[0].x,e[0].y,0,0,void 0),h);else if("Point"===t.type)for(const e of t.geometry)for(const t of e)D([t],new dd(t.x,t.y,0,0,void 0),h)}const Gd=32640;function qd(e,t,n,i,r,o,a,s,l,c,u,h,d,f,m,g,_){const y=function(e,t,n,i,r,o,a,s){const l=[];if(0===t.positionedLines.length)return l;const c=i.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=function(e){const t=e[0],n=e[1],i=t*n;return i>0?[t,-n]:i<0?[-t,n]:0===t?[n,t]:[n,-t]}(n);let h=Math.abs(t.top-t.bottom);for(const e of t.positionedLines)h-=e.lineOffset;const d=t.positionedLines.length,f=h/d;let m=t.top-n[1];for(let e=0;e<d;++e){const i=t.positionedLines[e];m=Pd(t,f,m,e);for(const e of i.positionedGlyphs){if(!e.rect)continue;const i=e.rect||{};let o=4,h=!0,d=1,f=0;if(e.imageName){const t=a[e.imageName];if(!t)continue;if(t.sdf){U("SDF images are not supported in formatted text and will be ignored.");continue}h=!1,d=t.pixelRatio,o=1/d}const g=(r||s)&&e.vertical,_=e.metrics.advance*e.scale/2,y=e.metrics,v=e.rect;if(null===v)continue;s&&t.verticalizable&&(f=e.imageName?_-e.metrics.width*e.scale/2:0);const x=r?[e.x+_,e.y]:[0,0];let b=[0,0],w=[0,0],E=!1;r||(g?(w=[e.x+_+u[0],e.y+u[1]-f],E=!0):b=[e.x+_+n[0],e.y+n[1]-f]);const T=v.w*e.scale/(d*(e.localGlyph?2:1)),S=v.h*e.scale/(d*(e.localGlyph?2:1));let A,C,k,M;if(g){const t=e.y-m,n=new p(-_,_-t),i=-Math.PI/2,r=new p(...w);A=new p(-_+b[0],b[1]),A._rotateAround(i,n)._add(r),A.x+=-t+_,A.y-=(y.left-o)*e.scale;const a=e.imageName?y.advance*e.scale:fh*e.scale,s=String.fromCharCode(e.glyph);bh(s)?A.x+=(1-o)*e.scale:wh(s)?A.x+=a-y.height*e.scale+(-o-1)*e.scale:A.x+=e.imageName||y.width+2*o===v.w&&y.height+2*o===v.h?(a-S)/2:(a-(y.height+2*o)*e.scale)/2,C=new p(A.x,A.y-T),k=new p(A.x+S,A.y),M=new p(A.x+S,A.y-T)}else{const t=(y.left-o)*e.scale-_+b[0],n=(-y.top-o)*e.scale+b[1],i=t+T,r=n+S;A=new p(t,n),C=new p(i,n),k=new p(t,r),M=new p(i,r)}if(c){let e;e=r?new p(0,0):E?new p(u[0],u[1]):new p(n[0],n[1]),A._rotateAround(c,e),C._rotateAround(c,e),k._rotateAround(c,e),M._rotateAround(c,e)}const I=new p(0,0),P=new p(0,0);l.push({tl:A,tr:C,bl:k,br:M,tex:i,writingMode:t.writingMode,glyphOffset:x,sectionIndex:e.sectionIndex,isSDF:h,pixelOffsetTL:I,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}}return l}(0,i,l,o,a,s,r,e.allowVerticalPlacement),v=e.textSizeData;let x=null;"source"===v.kind?(x=[ph*o.layout.get("text-size").evaluate(s,{},_)],x[0]>Gd&&U(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===v.kind&&(x=[ph*m.compositeTextSizes[0].evaluate(s,{},_),ph*m.compositeTextSizes[1].evaluate(s,{},_)],(x[0]>Gd||x[1]>Gd)&&U(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,y,x,l,a,s,u,t,n,c.lineStartIndex,c.lineLength,f,g,_);for(const t of h)d[t]=e.text.placedSymbolArray.length-1;return 4*y.length}function $d(e){for(const t in e)return e[t];return null}function Wd(e,t,n,i,r,o,a,s,l,c){let u=a.top,h=a.bottom,d=a.left,f=a.right;const m=a.collisionPadding;if(m&&(d-=m[0],u-=m[1],f+=m[2],h+=m[3]),l){const e=new p(d,u),t=new p(f,u),n=new p(d,h),i=new p(f,h),r=y(l);let o=new p(0,0);
2c&&(o=new p(c[0],c[1])),e._rotateAround(r,o),t._rotateAround(r,o),n._rotateAround(r,o),i._rotateAround(r,o),d=Math.min(e.x,t.x,n.x,i.x),f=Math.max(e.x,t.x,n.x,i.x),u=Math.min(e.y,t.y,n.y,i.y),h=Math.max(e.y,t.y,n.y,i.y)}return e.emplaceBack(t.x,t.y,t.z,n.x,n.y,d,u,f,h,s,i,r,o),e.length-1}function Zd(e){e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function Xd(e,t,n,i){const r=e.compareText;if(t in r){const e=r[t];for(let t=e.length-1;t>=0;t--)if(i.dist(e[t])<n)return!0}else r[t]=[];return r[t].push(i),!1}const Hd=ra([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Yd}=Hd,Kd=ra([{name:"a_pos_3",components:3,type:"Int16"}]);var Jd=ra([{name:"a_pos",type:"Int16",components:2}]);const Qd=ws/Math.PI/2,ef=2*Is(1,0)*Qd*Math.PI,tf=64,nf=[tf,32,16],rf=-Qd,of=Qd,af=[new rc([rf,rf,rf],[of,of,of]),new rc([rf,rf,rf],[0,0,of]),new rc([0,rf,rf],[of,0,of]),new rc([rf,0,rf],[0,of,of]),new rc([0,0,rf],[of,of,of])];function sf(e,t,n,i=!0){const r=Rl([],e._camera.position,e.worldSize),o=[t,n,1,1];Hl(o,o,e.pixelMatrixInverse),Zl(o,o,1/o[3]);const a=Fl([],ql([],o,r)),s=e.globeMatrix,l=[s[12],s[13],s[14]],c=ql([],l,r),u=Ml(c),h=Fl([],c),d=e.worldSize/(2*Math.PI),f=Nl(h,a),p=Math.asin(d/u);if(p<Math.acos(f)){if(!i)return null;const e=[],t=[];Rl(e,a,u/f),Fl(t,ql(t,e,c)),Fl(a,Pl(a,c,Rl(a,t,Math.tan(p)*u)))}const m=[];new tc(r,a).closestPointOnSphere(l,d,m);const g=Fl([],H(s,0)),_=Fl([],H(s,1)),y=Fl([],H(s,2)),x=Nl(g,m),b=Nl(_,m),w=Nl(y,m),E=v(Math.asin(-b/d));let S=v(Math.atan2(x,w));S=e.center.lng+function(e,t){const n=(t-e+180)%360-180;return n<-180?n+360:n}(e.center.lng,S);const A=ks(S),C=T(Ms(E),0,1);return new Rs(A,C)}class lf{constructor(e,t,n){this.a=ql([],e,n),this.b=ql([],t,n),this.center=n;const i=Fl([],this.a),r=Fl([],this.b);this.angle=Math.acos(Nl(i,r))}}function cf(e,t){if(0===e.angle)return null;let n;return n=0===e.a[t]?1/e.angle*.5*Math.PI:1/e.angle*Math.atan(e.b[t]/e.a[t]/Math.sin(e.angle)-1/Math.tan(e.angle)),n<0||n>1?null:function(e,t,n,i){const r=Math.sin(n);return e*(Math.sin((1-i)*n)/r)+t*(Math.sin(i*n)/r)}(e.a[t],e.b[t],e.angle,T(n,0,1))+e.center[t]}function uf(e){if(e.z<=1)return af[e.z+2*e.y+e.x];const t=mf(pf(e));return rc.fromPoints(t)}function hf(e,t,n){return Rl(e,e,1-n),Bl(e,e,t,n)}function df(e,t){const n=Tf(t.zoom);if(0===n)return uf(e);const i=pf(e),r=mf(i),o=ks(i.getWest())*t.worldSize,a=ks(i.getEast())*t.worldSize,s=Ms(i.getNorth())*t.worldSize,l=Ms(i.getSouth())*t.worldSize,c=[o,s,0],u=[a,s,0],h=[o,l,0],d=[a,l,0],f=yl([],t.globeMatrix);return Ul(c,c,f),Ul(u,u,f),Ul(h,h,f),Ul(d,d,f),r[0]=hf(r[0],h,n),r[1]=hf(r[1],d,n),r[2]=hf(r[2],u,n),r[3]=hf(r[3],c,n),rc.fromPoints(r)}function ff(e,t,n){for(const i of e)Ul(i,i,t),Rl(i,i,n)}function pf({x:e,y:t,z:n}){const i=1/(1<<n),r=new Ss(Ps(e*i),Ds((t+1)*i)),o=new Ss(Ps((e+1)*i),Ds(t*i));return new Es(r,o)}function mf(e){const t=y(e.getNorth()),n=y(e.getSouth()),i=Math.cos(t),r=Math.cos(n),o=Math.sin(t),a=Math.sin(n),s=e.getWest(),l=e.getEast();return[gf(r,a,s),gf(r,a,l),gf(i,o,l),gf(i,o,s)]}function gf(e,t,n,i=Qd){return n=y(n),[e*Math.sin(n)*i,-t*i,e*Math.cos(n)*i]}function _f(e,t,n){return gf(Math.cos(y(e)),Math.sin(y(e)),t,n)}function yf(e,t,n,i){const r=1<<n.z,o=(e/ws+n.x)/r;return _f(Ds((t/ws+n.y)/r),Ps(o),i)}function vf({min:e,max:t}){return 16383/Math.max(t[0]-e[0],t[1]-e[1],t[2]-e[2])}const xf=new Float64Array(16);function bf(e){const t=vf(e),n=Tl(xf,[t,t,t]);return xl(n,n,((i=[])[0]=-(r=e.min)[0],i[1]=-r[1],i[2]=-r[2],i));var i,r}function wf(e){const t=(i=e.min,(n=xf)[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=1,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=1,n[11]=0,n[12]=i[0],n[13]=i[1],n[14]=i[2],n[15]=1,n);var n,i;const r=1/vf(e);return bl(t,t,[r,r,r])}function Ef(e,t,n,i,r){const o=function(e){const t=ws/(2*Math.PI);return e/(2*Math.PI)/t}(n),a=[e,t,-n/(2*Math.PI)],s=_l(new Float64Array(16));return xl(s,s,a),bl(s,s,[o,o,o]),wl(s,s,y(-r)),El(s,s,y(-i)),s}function Tf(e){return S(5,6,e)}function Sf(e,t){const n=_f(t.lat,t.lng),i=function(e){const t=_f(e._center.lat,e._center.lng);let n=jl([],Il(0,1,0),t);const i=Sl([],-e.angle,t);n=Ul(n,n,i),Sl(i,-e._pitch,n);const r=Fl([],t);return Rl(r,r,e.cameraToCenterDistance/e.pixelsPerMeter*ef),Ul(r,r,i),Pl([],t,r)}(e);return a=(r=Dl([],i,n))[0],s=r[1],l=r[2],c=(o=n)[0],u=o[1],h=o[2],f=(d=Math.sqrt(a*a+s*s+l*l)*Math.sqrt(c*c+u*u+h*h))&&Nl(r,o)/d,Math.acos(Math.min(Math.max(f,-1),1));var r,o,a,s,l,c,u,h,d,f}function Af(e,t){return Sf(e,t)>Math.PI/2*1.01}const Cf=y(85),kf=Math.cos(Cf),Mf=Math.sin(Cf);function If(e,t){const n=e.fovAboveCenter,i=e.elevation?e.elevation.getMinElevationBelowMSL()*t:0,r=(e._camera.position[2]*e.worldSize-i)/Math.cos(e._pitch),o=Math.sin(n)*r/Math.sin(Math.max(Math.PI/2-e._pitch-n,.01)),a=Math.sin(e._pitch)*o+r;return Math.min(1.01*a,r*(1/e._horizonShift))}function Pf(e,t){if(!t.isReprojectedInTileSpace)return{scale:1<<e.z,x:e.x,y:e.y,x2:e.x+1,y2:e.y+1,projection:t};const n=Math.pow(2,-e.z),i=e.x*n,r=(e.x+1)*n,o=e.y*n,a=(e.y+1)*n,s=Ps(i),l=Ps(r),c=Ds(o),u=Ds(a),h=t.project(s,c),d=t.project(l,c),f=t.project(l,u),p=t.project(s,u);let m=Math.min(h.x,d.x,f.x,p.x),g=Math.min(h.y,d.y,f.y,p.y),_=Math.max(h.x,d.x,f.x,p.x),y=Math.max(h.y,d.y,f.y,p.y);const v=n/16;function x(e,n,i,r,o,a){const s=(i+o)/2,l=(r+a)/2,c=t.project(Ps(s),Ds(l)),u=Math.max(0,m-c.x,g
vendor: 5,055 bytes, line 2
2-c.y,c.x-_,c.y-y);m=Math.min(m,c.x),_=Math.max(_,c.x),g=Math.min(g,c.y),y=Math.max(y,c.y),u>v&&(x(e,c,i,r,s,l),x(c,n,s,l,o,a))}x(h,d,i,o,r,o),x(d,f,r,o,r,a),x(f,p,r,a,i,a),x(p,h,i,a,i,o),m-=v,g-=v,_+=v,y+=v;const b=1/Math.max(_-m,y-g);return{scale:b,x:m*b,y:g*b,x2:_*b,y2:y*b,projection:t}}const Df=_l(new Float32Array(16));class zf{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new Ss(0,0)}projectTilePoint(e,t,n){return{x:e,y:t,z:0}}locationPoint(e,t,n=!0){return e._coordinatePoint(e.locationCoordinate(t),n)}pixelsPerMeter(e,t){return Is(1,e)*t}pixelSpaceConversion(e,t,n){return 1}farthestPixelDistance(e){return If(e,e.pixelsPerMeter)}pointCoordinate(e,t,n,i){const r=e.horizonLineFromTop(!1),o=new p(t,Math.max(r,n));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,i))}pointCoordinate3D(e,t,n){const i=new p(t,n);if(e.elevation)return e.elevation.pointCoordinate(i);{const t=this.pointCoordinate(e,i.x,i.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation)return!this.pointCoordinate3D(e,t.x,t.y);const n=e.horizonLineFromTop();return t.y<n}createInversionMatrix(e,t){return Df}createTileMatrix(e,t,n){let i,r,o;const a=n.canonical,s=_l(new Float64Array(16));if(this.isReprojectedInTileSpace){const l=Pf(a,this);i=1,r=l.x+n.wrap*l.scale,o=l.y,bl(s,s,[i/l.scale,i/l.scale,e.pixelsPerMeter/t])}else i=t/e.zoomScale(a.z),r=(a.x+Math.pow(2,a.z)*n.wrap)*i,o=a.y*i;return xl(s,s,[r,o,0]),bl(s,s,[i/ws,i/ws,1]),s}upVector(e,t,n){return[0,0,1]}upVectorScale(e,t,n){return{metersToTile:1}}}class Lf extends zf{constructor(e){super(e),this.range=[4,7],this.center=e.center||[-96,37.5];const[t,n]=this.parallels=e.parallels||[29.5,45.5],i=Math.sin(y(t));this.n=(i+Math.sin(y(n)))/2,this.c=1+i*(2*this.n-i),this.r0=Math.sqrt(this.c)/this.n}project(e,t){const{n,c:i,r0:r}=this,o=y(e-this.center[0]),a=y(t),s=Math.sqrt(i-2*n*Math.sin(a))/n;return{x:s*Math.sin(o*n),y:s*Math.cos(o*n)-r,z:0}}unproject(e,t){const{n,c:i,r0:r}=this,o=r+t;let a=Math.atan2(e,Math.abs(o))*Math.sign(o);o*n<0&&(a-=Math.PI*Math.sign(e)*Math.sign(o));const s=y(this.center[0])*n;a=A(a,-Math.PI-s,Math.PI-s);const l=T(v(a/n)+this.center[0],-180,180),c=Math.asin(T((i-(e*e+o*o)*n*n)/(2*n),-1,1)),u=T(v(c),-85.051129,Ls);return new Ss(l,u)}}const Of=1.340264,Rf=-.081106,Bf=893e-6,Ff=.003796,Nf=Math.sqrt(3)/2;class jf extends zf{project(e,t){t=t/180*Math.PI,e=e/180*Math.PI;const n=Math.asin(Nf*Math.sin(t)),i=n*n,r=i*i*i;return{x:.5*(e*Math.cos(n)/(Nf*(Of+3*Rf*i+r*(7*Bf+9*Ff*i)))/Math.PI+.5),y:1-.5*(n*(Of+Rf*i+r*(Bf+Ff*i))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let n=t=(2*(1-t)-1)*Math.PI,i=n*n,r=i*i*i;for(let e,o,a,s=0;s<12&&(o=n*(Of+Rf*i+r*(Bf+Ff*i))-t,a=Of+3*Rf*i+r*(7*Bf+9*Ff*i),e=o/a,n=T(n-e,-Math.PI/3,Math.PI/3),i=n*n,r=i*i*i,!(Math.abs(e)<1e-12));++s);const o=Nf*e*(Of+3*Rf*i+r*(7*Bf+9*Ff*i))/Math.cos(n),a=Math.asin(Math.sin(n)/Nf),s=T(180*o/Math.PI,-180,180),l=T(180*a/Math.PI,-85.051129,Ls);return new Ss(s,l)}}class Uf extends zf{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){return{x:.5+e/360,y:.5-t/360,z:0}}unproject(e,t){const n=360*(e-.5),i=T(360*(.5-t),-85.051129,Ls);return new Ss(n,i)}}const Vf=Math.PI/2;function Gf(e){return Math.tan((Vf+e)/2)}class qf extends zf{constructor(e){super(e),this.center=e.center||[0,30];const[t,n]=this.parallels=e.parallels||[30,30];let i=y(t),r=y(n);this.southernCenter=i+r<0,this.southernCenter&&(i=-i,r=-r);const o=Math.cos(i),a=Gf(i);this.n=i===r?Math.sin(i):Math.log(o/Math.cos(r))/Math.log(Gf(r)/a),this.f=o*Math.pow(Gf(i),this.n)/this.n}project(e,t){t=y(t),this.southernCenter&&(t=-t),e=y(e-this.center[0]);const n=1e-6,{n:i,f:r}=this;r>0?t<-Vf+n&&(t=-Vf+n):t>Vf-n&&(t=Vf-n);const o=r/Math.pow(Gf(t),i);let a=o*Math.sin(i*e),s=r-o*Math.cos(i*e);return a=.5*(a/Math.PI+.5),s=.5*(s/Math.PI+.5),{x:a,y:this.southernCenter?s:1-s,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n,f:i}=this,r=i-t,o=Math.sign(r),a=Math.sign(n)*Math.sqrt(e*e+r*r);let s=Math.atan2(e,Math.abs(r))*o;r*n<0&&(s-=Math.PI*Math.sign(e)*o);const l=T(v(s/n)+this.center[0],-180,180),c=T(v(2*Math.atan(Math.pow(i/a,1/n))-Vf),-85.051129,Ls);return new Ss(l,this.southernCenter?-c:c)}}class $f extends zf{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:ks(e),y:Ms(t),z:0}}unproject(e,t){const n=Ps(e),i=Ds(t);return new Ss(n,i)}}const Wf=y(Ls);class Zf extends zf{project(e,t){const n=(t=y(t))*t,i=n*n;return{x:.5*((e=y(e))*(.8707-.131979*n+i*(i*(.003971*n-.001529*i)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+n*(.015085+i*(.028874*n-.04447
vendor: 27,604 bytes, line 2
25-.005916*i)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let n=t=(2*(1-t)-1)*Math.PI,i=25,r=0,o=n*n;do{o=n*n;const e=o*o;r=(n*(1.007226+o*(.015085+e*(.028874*o-.044475-.005916*e)))-t)/(1.007226+o*(.045255+e*(.259866*o-.311325-.005916*11*e))),n=T(n-r,-Wf,Wf)}while(Math.abs(r)>1e-6&&--i>0);o=n*n;const a=T(v(e/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),s=v(n);return new Ss(a,s)}}const Xf=y(Ls);class Hf extends zf{project(e,t){t=y(t),e=y(e);const n=Math.cos(t),i=2/Math.PI,r=Math.acos(n*Math.cos(e/2)),o=Math.sin(r)/r,a=.5*(e*i+2*n*Math.sin(e/2)/o)||0,s=.5*(t+Math.sin(t)/o)||0;return{x:.5*(a/Math.PI+.5),y:1-.5*(s/Math.PI+1),z:0}}unproject(e,t){let n=e=(2*e-.5)*Math.PI,i=t=(2*(1-t)-1)*Math.PI,r=25;const o=1e-6;let a=0,s=0;do{const r=Math.cos(i),o=Math.sin(i),l=2*o*r,c=o*o,u=r*r,h=Math.cos(n/2),d=Math.sin(n/2),f=2*h*d,p=d*d,m=1-u*h*h,g=m?1/m:0,_=m?Math.acos(r*h)*Math.sqrt(1/m):0,y=.5*(2*_*r*d+2*n/Math.PI)-e,v=.5*(_*o+i)-t,x=.5*g*(u*p+_*r*h*c)+1/Math.PI,b=g*(f*l/4-_*o*d),w=.125*g*(l*d-_*o*u*f),E=.5*g*(c*h+_*p*r)+.5,S=b*w-E*x;a=(v*b-y*E)/S,s=(y*w-v*x)/S,n=T(n-a,-Math.PI,Math.PI),i=T(i-s,-Xf,Xf)}while((Math.abs(a)>o||Math.abs(s)>o)&&--r>0);return new Ss(v(n),v(i))}}class Yf extends zf{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(y(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:n,cosPhi:i}=this;return{x:y(e)*i*n+.5,y:-Math.sin(y(t))/i*n+.5,z:0}}unproject(e,t){const{scale:n,cosPhi:i}=this,r=-(t-.5)/n,o=T(v((e-.5)/n)/i,-180,180),a=Math.asin(T(r*i,-1,1)),s=T(v(a),-85.051129,Ls);return new Ss(o,s)}}class Kf extends $f{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug","custom"],this.range=[3,5]}projectTilePoint(e,t,n){const i=yf(e,t,n);return Ul(i,i,bf(uf(n))),{x:i[0],y:i[1],z:i[2]}}locationPoint(e,t){const n=_f(t.lat,t.lng),i=Fl([],n),r=e.elevation?e.elevation.getAtPointOrZero(e.locationCoordinate(t),e._centerAltitude):e._centerAltitude;Bl(n,n,i,Is(1,0)*ws*r);const o=_l(new Float64Array(16));return vl(o,e.pixelMatrix,e.globeMatrix),Ul(n,n,o),new p(n[0],n[1])}pixelsPerMeter(e,t){return Is(1,0)*t}pixelSpaceConversion(e,t,n){const i=Is(1,e)*t,r=kn(Is(1,45)*t,i,n);return this.pixelsPerMeter(e,t)/r}createTileMatrix(e,t,n){const i=wf(uf(n.canonical));return vl(new Float64Array(16),e.globeMatrix,i)}createInversionMatrix(e,t){const{center:n}=e,i=bf(uf(t));return El(i,i,y(n.lng)),wl(i,i,y(n.lat)),bl(i,i,[e._pixelsPerMercatorPixel,e._pixelsPerMercatorPixel,1]),Float32Array.from(i)}pointCoordinate(e,t,n,i){return sf(e,t,n,!0)||new Rs(0,0)}pointCoordinate3D(e,t,n){const i=this.pointCoordinate(e,t,n,0);return[i.x,i.y,i.z]}isPointAboveHorizon(e,t){return!sf(e,t.x,t.y,!1)}farthestPixelDistance(e){const t=function(e,t){const n=e.cameraToCenterDistance,i=e._centerAltitude*t,r=e._camera,o=e._camera.forward(),a=Pl([],Rl([],o,-n),[0,0,i]),s=e.worldSize/(2*Math.PI),l=[0,0,-s],c=e.width/e.height,u=Math.tan(e.fovAboveCenter),h=Rl([],r.up(),u),d=Rl([],r.right(),u*c),f=Fl([],Pl([],Pl([],o,h),d)),p=[];let m;if(new tc(a,f).closestPointOnSphere(l,s,p)){const t=Pl([],p,l),n=ql([],t,a);m=Math.cos(e.fovAboveCenter)*Ml(n)}else{const e=ql([],a,l),t=ql([],l,a);Fl(t,t);const n=Ml(e)-s;m=Math.sqrt(n*(n+2*s));const i=Math.acos(m/(s+n))-Math.acos(Nl(o,t));m*=Math.cos(i)}return 1.01*m}(e,this.pixelsPerMeter(e.center.lat,e.worldSize)),n=Tf(e.zoom);if(n>0){const i=If(e,Is(1,e.center.lat)*e.worldSize),r=e.worldSize/(2*Math.PI),o=Math.max(e.width,e.height)/e.worldSize*Math.PI;return kn(t,i+r*(1-Math.cos(o)),Math.pow(n,10))}return t}upVector(e,t,n){return yf(t,n,e,1)}upVectorScale(e){return{metersToTile:ef*vf(uf(e))}}}function Jf(e){const t=e.parallels,n=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new $f(e);case"equirectangular":return new Uf(e);case"naturalEarth":return new Zf(e);case"equalEarth":return new jf(e);case"winkelTripel":return new Hf(e);case"albers":return n?new Yf(e):new Lf(e);case"lambertConformalConic":return n?new Yf(e):new qf(e);case"globe":return new Kf(e)}throw new Error(`Invalid projection name: ${e.name}`)}const Qf=wu.types,ep=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function tp(e,t,n,i,r,o,a,s,l,c,u,h,d){const f=s?Math.min(Gd,Math.round(s[0])):0,p=s?Math.min(Gd,Math.round(s[1])):0;e.emplaceBack(t,n,Math.round(32*i),Math.round(32*r),o,a,(f<<1)+(l?1:0),p,16*c,16*u,256*h,256*d)}function np(e,t,n,i,r,o,a){e.emplaceBack(t,n,i,r,o,a)}function ip(e,t,n,i,r){e.emplaceBack(t,n,i,r),e.emplaceBack(t,n,i,r),e.emplaceBack(t,n,i,r),e.emplaceBack(t,n,i,r)}function rp(e){for(const t of e.sections)if(ko(t.text))return!0;return!1}class op{constructor(e){this.layoutVertexArray=new pa,this.indexArray=new wa,this.programConfigurations=e,this.segments=new bs,this.dynamicLayoutVertexArray=new ua,this.opacityVertexArray=new ga,this.placedSymbolArray=new La,this.globeExtVertexArray=new ma}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,n,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ah.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,lh.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,ep,!0),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,sh.members,!0)),this.opacityVertexBuffer.itemSize=1),(n||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}}Vr(op,"SymbolBuffers");class ap{constructor(e,t,n){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new n,this.segments=new bs,this.collisionVertexArray=new xa,this.collisionVertexArrayExt=new ba}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,ch.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,uh.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}Vr(ap,"CollisionBuffers");class sp{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=_l([]),this.placementViewportMatrix=_l([]);const t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=mh(this.zoom,t["text-size"]),this.iconSizeData=mh(this.zoom,t["icon-size"]);const n=this.layers[0].layout,i=n.get("symbol-sort-key"),r=n.get("symbol-z-order");this.canOverlap=n.get("text-allow-overlap")||n.get("icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==i.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=n.get("text-writing-mode").map((e=>Kh[e])),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=e.sourceID,this.projection=e.projection}createArrays(){this.text=new op(new hs(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new op(new hs(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new Ba,this.lineVertexArray=new Fa,this.symbolInstances=new Ra}calculateGlyphDependencies(e,t,n,i,r){for(let n=0;n<e.length;n++)if(t[e.charCodeAt(n)]=!0,i&&r){const i=xh[e.charAt(n)];i&&(t[i.charCodeAt(0)]=!0)}}populate(e,t,n,i){const r=this.layers[0],o=r.layout,a="globe"===this.projection.name,s=o.get("text-font"),l=o.get("text-field"),c=o.get("icon-image"),u=("constant"!==l.value.kind||l.value.value instanceof It&&!l.value.value.isEmpty()||l.value.value.toString().length>0)&&("constant"!==s.value.kind||s.value.value.length>0),h="constant"!==c.value.kind||!!c.value.value||Object.keys(c.parameters).length>0,d=o.get("symbol-sort-key");if(this.features=[],!u&&!h)return;const f=t.iconDependencies,p=t.glyphDependencies,m=t.availableImages,g=new Uo(this.zoom);for(const{feature:t,id:l,index:c,sourceLayerIndex:_}of e){const e=r._featureFilter.needGeometry,y=$s(t,e);if(!r._featureFilter.filter(g,y,n))continue;if(e||(y.geometry=qs(t,n,i)),a&&1!==t.type&&n.z<=5){const e=y.geometry,t=.98078528056,i=(e,i)=>Nl(yf(e.x,e.y,n,1),yf(i.x,i.y,n,1))<t;for(let t=0;t<e.length;t++)e[t]=js(e[t],i)}let v,x;if(u){const e=r.getValueAndResolveTokens("text-field",y,n,m),t=It.factory(e);rp(t)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Fo()||this.hasRTLText&&jo.isParsed())&&(v=vh(t,r,y))}if(h){const e=r.getValueAndResolveTokens("icon-image",y,n,m);x=e instanceof Pt?e:Pt.fromString(e)}if(!v&&!x)continue;const b=this.sortFeaturesByKey?d.evaluate(y,{},n):void 0;if(this.features.push({id:l,text:v,icon:x,index:c,sourceLayerIndex:_,geometry:y.geometry,properties:t.properties,type:Qf[t.type],sortKey:b}),x&&(f[x.name]=!0),v){const e=s.evaluate(y,{},n).join(","),t="map"===o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Kh.vertical)>=0;for(const n of v.sections)if(n.image)f[n.image.name]=!0;else{const i=bo(v.toString()),r=n.fontStack||e,o=p[r]=p[r]||{};this.calculateGlyphDependencies(n.text,o,t,this.allowVerticalPlacement,i)}}}"line"===o.get("symbol-placement")&&(this.features=function(e){const t={},n={},i=[];let r=0;function o(t){i.push(e[t]),r++}function a(e,t,r){const o=n[e];return delete n[e],n[t]=o,i[o].geometry[0].pop(),i[o].geometry[0]=i[o].geometry[0].concat(r[0]),o}function s(e,n,r){const o=t[n];return delete t[n],t[e]=o,i[o].geometry[0].shift(),i[o].geometry[0]=r[0].concat(i[o].geometry[0]),o}function l(e,t,n){const i=n?t[0][t[0].length-1]:t[0][0];return`${e}:${i.x}:${i.y}`}for(let c=0;c<e.length;c++){const u=e[c],h=u.geometry,d=u.text?u.text.toString():null;if(!d){o(c);continue}const f=l(d,h),p=l(d,h,!0);if(f in n&&p in t&&n[f]!==t[p]){const e=s(f,p,h),r=a(f,p,i[e].geometry);delete t[f],delete n[p],n[l(d,i[r].geometry,!0)]=r,i[e].geometry=null}else f in n?a(f,p,h):p in t?s(f,p,h):(o(c),t[f]=r-1,n[p]=r-1)}return i.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,n,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,n,i),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,n,i))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Jf(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const n=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:e,y:n}of t)this.lineVertexArray.emplaceBack(e,n);return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,t,n,i,r,o,a,s,l,c,u,h,d,f){const p=e.indexArray,m=e.layoutVertexArray,g=e.globeExtVertexArray,_=e.segments.prepareSegment(4*t.length,m,p,this.canOverlap?o.sortKey:void 0),y=this.glyphOffsetArray.length,v=_.vertexLength,x=this.allowVerticalPlacement&&a===Kh.vertical?Math.PI/2:0,b=o.text&&o.text.sections;for(let i=0;i<t.length;i++){const{tl:r,tr:a,bl:c,br:u,tex:h,pixelOffsetTL:y,pixelOffsetBR:v,minFontScaleX:w,minFontScaleY:E,glyphOffset:T,isSDF:S,sectionIndex:A}=t[i],C=_.vertexLength,k=T[1];if(tp(m,l.x,l.y,r.x,k+r.y,h.x,h.y,n,S,y.x,y.y,w,E),tp(m,l.x,l.y,a.x,k+a.y,h.x+h.w,h.y,n,S,v.x,y.y,w,E),tp(m,l.x,l.y,c.x,k+c.y,h.x,h.y+h.h,n,S,y.x,v.y,w,E),tp(m,l.x,l.y,u.x,k+u.y,h.x+h.w,h.y+h.h,n,S,v.x,v.y,w,E),s){const{x:t,y:n,z:i}=s.anchor,[r,o,a]=s.up;np(g,t,n,i,r,o,a),np(g,t,n,i,r,o,a),np(g,t,n,i,r,o,a),np(g,t,n,i,r,o,a),ip(e.dynamicLayoutVertexArray,t,n,i,x)}else ip(e.dynamicLayoutVertexArray,l.x,l.y,l.z,x);p.emplaceBack(C,C+1,C+2),p.emplaceBack(C+1,C+2,C+3),_.vertexLength+=4,_.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(T[0]),i!==t.length-1&&A===t[i+1].sectionIndex||e.programConfigurations.populatePaintArrays(m.length,o,o.index,{},d,f,b&&b[A])}const w=s?s.anchor:l;e.placedSymbolArray.emplaceBack(w.x,w.y,w.z,l.x,l.y,y,this.glyphOffsetArray.length-y,v,c,u,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],a,0,!1,0,h,0)}_commitLayoutVertex(e,t,n,i,r,o,a){e.emplaceBack(t,n,i,r,o,Math.round(a.x),Math.round(a.y))}_addCollisionDebugVertices(e,t,n,i,r,o,a){const s=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=s.vertexLength,c=a.tileAnchorX,u=a.tileAnchorY;for(let e=0;e<4;e++)n.collisionVertexArray.emplaceBack(0,0,0,0);n.collisionVertexArrayExt.emplaceBack(t,-e.padding,-e.padding),n.collisionVertexArrayExt.emplaceBack(t,e.padding,-e.padding),n.collisionVertexArrayExt.emplaceBack(t,e.padding,e.padding),n.collisionVertexArrayExt.emplaceBack(t,-e.padding,e.padding),this._commitLayoutVertex(n.layoutVertexArray,i,r,o,c,u,new p(e.x1,e.y1)),this._commitLayoutVertex(n.layoutVertexArray,i,r,o,c,u,new p(e.x2,e.y1)),this._commitLayoutVertex(n.layoutVertexArray,i,r,o,c,u,new p(e.x2,e.y2)),this._commitLayoutVertex(n.layoutVertexArray,i,r,o,c,u,new p(e.x1,e.y2)),s.vertexLength+=4;const h=n.indexArray;h.emplaceBack(l,l+1),h.emplaceBack(l+1,l+2),h.emplaceBack(l+2,l+3),h.emplaceBack(l+3,l),s.primitiveLength+=4}_addTextDebugCollisionBoxes(e,t,n,i,r,o){for(let a=i;a<r;a++){const i=n.get(a),r=this.getSymbolInstanceTextSize(e,o,t,a);this._addCollisionDebugVertices(i,r,this.textCollisionBox,i.projectedAnchorX,i.projectedAnchorY,i.projectedAnchorZ,o)}}_addIconDebugCollisionBoxes(e,t,n,i,r,o){for(let a=i;a<r;a++){const i=n.get(a),r=this.getSymbolInstanceIconSize(e,t,o.placedIconSymbolIndex);this._addCollisionDebugVertices(i,r,this.iconCollisionBox,i.projectedAnchorX,i.projectedAnchorY,i.projectedAnchorZ,o)}}generateCollisionDebugBuffers(e,t){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new ap(ya,hh.members,ka),this.iconCollisionBox=new ap(ya,hh.members,ka);const n=_h(this.iconSizeData,e),i=_h(this.textSizeData,e);for(let r=0;r<this.symbolInstances.length;r++){const o=this.symbolInstances.get(r);this._addTextDebugCollisionBoxes(i,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._addTextDebugCollisionBoxes(i,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o),this._addIconDebugCollisionBoxes(n,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o)}}getSymbolInstanceTextSize(e,t,n,i){const r=this.text.placedSymbolArray.get(t.rightJustifiedTextSymbolIndex>=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:i),o=gh(this.textSizeData,e,r)/fh;return this.tilePixelRatio*o}getSymbolInstanceIconSize(e,t,n){const i=this.icon.placedSymbolArray.get(n),r=gh(this.iconSizeData,e,i);return this.tilePixelRatio*r}_commitDebugCollisionVertexUpdate(e,t,n){e.emplaceBack(t,-n,-n),e.emplaceBack(t,n,-n),e.emplaceBack(t,n,n),e.emplaceBack(t,-n,n)}_updateTextDebugCollisionBoxes(e,t,n,i,r,o){for(let a=i;a<r;a++){const i=n.get(a),r=this.getSymbolInstanceTextSize(e,o,t,a);this._commitDebugCollisionVertexUpdate(this.textCollisionBox.collisionVertexArrayExt,r,i.padding)}}_updateIconDebugCollisionBoxes(e,t,n,i,r,o){for(let a=i;a<r;a++){const i=n.get(a),r=this.getSymbolInstanceIconSize(e,t,o);this._commitDebugCollisionVertexUpdate(this.iconCollisionBox.collisionVertexArrayExt,r,i.padding)}}updateCollisionDebugBuffers(e,t){if(!this.hasDebugData())return;this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexArrayExt.clear(),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexArrayExt.clear();const n=_h(this.iconSizeData,e),i=_h(this.textSizeData,e);for(let r=0;r<this.symbolInstances.length;r++){const o=this.symbolInstances.get(r);this._updateTextDebugCollisionBoxes(i,e,t,o.textBoxStartIndex,o.textBoxEndIndex,o),this._updateTextDebugCollisionBoxes(i,e,t,o.verticalTextBoxStartIndex,o.verticalTextBoxEndIndex,o),this._updateIconDebugCollisionBoxes(n,e,t,o.iconBoxStartIndex,o.iconBoxEndIndex,o.placedIconSymbolIndex),this._updateIconDebugCollisionBoxes(n,e,t,o.verticalIconBoxStartIndex,o.verticalIconBoxEndIndex,o.placedIconSymbolIndex)}this.hasTextCollisionBoxData()&&this.textCollisionBox.collisionVertexBufferExt&&this.textCollisionBox.collisionVertexBufferExt.updateData(this.textCollisionBox.collisionVertexArrayExt),this.hasIconCollisionBoxData()&&this.iconCollisionBox.collisionVertexBufferExt&&this.iconCollisionBox.collisionVertexBufferExt.updateData(this.iconCollisionBox.collisionVertexArrayExt)}_deserializeCollisionBoxesForSymbol(e,t,n,i,r,o,a,s,l){const c={};if(t<n){const{x1:n,y1:i,x2:r,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(t);c.textBox={x1:n,y1:i,x2:r,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.textFeatureIndex=f}if(i<r){const{x1:t,y1:n,x2:r,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(i);c.verticalTextBox={x1:t,y1:n,x2:r,y2:o,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalTextFeatureIndex=f}if(o<a){const{x1:t,y1:n,x2:i,y2:r,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(o);c.iconBox={x1:t,y1:n,x2:i,y2:r,padding:a,projectedAnchorX:s,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.iconFeatureIndex=f}if(s<l){const{x1:t,y1:n,x2:i,y2:r,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d,featureIndex:f}=e.get(s);c.verticalIconBox={x1:t,y1:n,x2:i,y2:r,padding:o,projectedAnchorX:a,projectedAnchorY:l,projectedAnchorZ:u,tileAnchorX:h,tileAnchorY:d},c.verticalIconFeatureIndex=f}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const n=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){const n=e.placedSymbolArray.get(t),i=n.vertexStartIndex+4*n.numGlyphs;for(let t=n.vertexStartIndex;t<i;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),n=Math.cos(e),i=[],r=[],o=[];for(let e=0;e<this.symbolInstances.length;++e){o.push(e);const a=this.symbolInstances.get(e);i.push(0|Math.round(t*a.tileAnchorX+n*a.tileAnchorY)),r.push(a.featureIndex)}return o.sort(((e,t)=>i[e]-i[t]||r[t]-r[e])),o}addToSortKeyRanges(e,t){const n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===t?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:n,centerJustifiedTextSymbolIndex:i,leftJustifiedTextSymbolIndex:r,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:a,verticalPlacedIconSymbolIndex:s}=t;n>=0&&this.addIndicesForPlacedSymbol(this.text,n),i>=0&&i!==n&&this.addIndicesForPlacedSymbol(this.text,i),r>=0&&r!==i&&r!==n&&this.addIndicesForPlacedSymbol(this.text,r),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}Vr(sp,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),sp.MAX_GLYPHS=65535,sp.addDynamicAttributes=ip;const lp=new Qo({"symbol-placement":new Yo(Ye.layout_symbol["symbol-placement"]),"symbol-spacing":new Yo(Ye.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Yo(Ye.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ko(Ye.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Yo(Ye.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Yo(Ye.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Yo(Ye.layout_symbol["icon-ignore-placement"]),"icon-optional":new Yo(Ye.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Yo(Ye.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ko(Ye.layout_symbol["icon-size"]),"icon-text-fit":new Yo(Ye.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Yo(Ye.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ko(Ye.layout_symbol["icon-image"]),"icon-rotate":new Ko(Ye.layout_symbol["icon-rotate"]),"icon-padding":new Yo(Ye.layout_symbol["icon-padding"]),"icon-keep-upright":new Yo(Ye.layout_symbol["icon-keep-upright"]),"icon-offset":new Ko(Ye.layout_symbol["icon-offset"]),"icon-anchor":new Ko(Ye.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Yo(Ye.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Yo(Ye.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Yo(Ye.layout_symbol["text-rotation-alignment"]),"text-field":new Ko(Ye.layout_symbol["text-field"]),"text-font":new Ko(Ye.layout_symbol["text-font"]),"text-size":new Ko(Ye.layout_symbol["text-size"]),"text-max-width":new Ko(Ye.layout_symbol["text-max-width"]),"text-line-height":new Ko(Ye.layout_symbol["text-line-height"]),"text-letter-spacing":new Ko(Ye.layout_symbol["text-letter-spacing"]),"text-justify":new Ko(Ye.layout_symbol["text-justify"]),"text-radial-offset":new Ko(Ye.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Yo(Ye.layout_symbol["text-variable-anchor"]),"text-anchor":new Ko(Ye.layout_symbol["text-anchor"]),"text-max-angle":new Yo(Ye.layout_symbol["text-max-angle"]),"text-writing-mode":new Yo(Ye.layout_symbol["text-writing-mode"]),"text-rotate":new Ko(Ye.layout_symbol["text-rotate"]),"text-padding":new Yo(Ye.layout_symbol["text-padding"]),"text-keep-upright":new Yo(Ye.layout_symbol["text-keep-upright"]),"text-transform":new Ko(Ye.layout_symbol["text-transform"]),"text-offset":new Ko(Ye.layout_symbol["text-offset"]),"text-allow-overlap":new Yo(Ye.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Yo(Ye.layout_symbol["text-ignore-placement"]),"text-optional":new Yo(Ye.layout_symbol["text-optional"])});var cp={paint:new Qo({"icon-opacity":new Ko(Ye.paint_symbol["icon-opacity"]),"icon-color":new Ko(Ye.paint_symbol["icon-color"]),"icon-halo-color":new Ko(Ye.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ko(Ye.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ko(Ye.paint_symbol["icon-halo-blur"]),"icon-translate":new Yo(Ye.paint_symbol["icon-translate"]),"icon-translate-anchor":new Yo(Ye.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ko(Ye.paint_symbol["text-opacity"]),"text-color":new Ko(Ye.paint_symbol["text-color"],{runtimeType:lt,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Ko(Ye.paint_symbol["text-halo-color"]),"text-halo-width":new Ko(Ye.paint_symbol["text-halo-width"]),"text-halo-blur":new Ko(Ye.paint_symbol["text-halo-blur"]),"text-translate":new Yo(Ye.paint_symbol["text-translate"]),"text-translate-anchor":new Yo(Ye.paint_symbol["text-translate-anchor"])}),layout:lp};class up{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:rt,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Vr(up,"FormatSectionOverride",{omit:["defaultValue"]});class hp extends ys{constructor(e){super(e,cp)}recalculate(e,t){super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const n=this.layout.get("text-writing-mode");if(n){const e=[];for(const t of n)e.indexOf(t)<0&&e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getValueAndResolveTokens(e,t,n,i){const r=this.layout.get(e).evaluate(t,{},n,i),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||qi(o.value)||!r?r:function(e,t){return t.replace(/{([^{}]+)}
vendor: 8,445 bytes, line 2
2/g,((t,n)=>n in e?String(e[n]):""))}(t.properties,r)}createBucket(e){return new sp(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of cp.paint.overridableProperties){if(!hp.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),n=new up(t),i=new Gi(n,t.property.specification);let r=null;r="constant"===t.value.kind||"source"===t.value.kind?new Wi("source",i):new Zi("composite",i,t.value.zoomStops,t.value._interpolationType),this.paint._values[e]=new Xo(t.property,r,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,n){return!(!this.layout||t.isDataDriven()||n.isDataDriven())&&hp.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const n=e.get("text-field"),i=cp.paint.properties[t];let r=!1;const o=e=>{for(const t of e)if(i.overrides&&i.overrides.hasOverride(t))return void(r=!0)};if("constant"===n.value.kind&&n.value.value instanceof It)o(n.value.value.sections);else if("source"===n.value.kind){const e=t=>{r||(t instanceof Bt&&Lt(t.value)===dt?o(t.value.sections):t instanceof Vt?o(t.sections):t.eachChild(e))},t=n.value;t._styleExpression&&e(t._styleExpression.expression)}return r}getProgramConfiguration(e){return new us(this,e)}}var dp={paint:new Qo({"background-color":new Yo(Ye.paint_background["background-color"]),"background-pattern":new Yo(Ye.paint_background["background-pattern"]),"background-opacity":new Yo(Ye.paint_background["background-opacity"])})},fp={paint:new Qo({"raster-opacity":new Yo(Ye.paint_raster["raster-opacity"]),"raster-hue-rotate":new Yo(Ye.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Yo(Ye.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Yo(Ye.paint_raster["raster-brightness-max"]),"raster-saturation":new Yo(Ye.paint_raster["raster-saturation"]),"raster-contrast":new Yo(Ye.paint_raster["raster-contrast"]),"raster-resampling":new Yo(Ye.paint_raster["raster-resampling"]),"raster-fade-duration":new Yo(Ye.paint_raster["raster-fade-duration"])})};class pp extends ys{constructor(e){super(e,{}),this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){}onAdd(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}onRemove(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}}var mp={paint:new Qo({"sky-type":new Yo(Ye.paint_sky["sky-type"]),"sky-atmosphere-sun":new Yo(Ye.paint_sky["sky-atmosphere-sun"]),"sky-atmosphere-sun-intensity":new Yo(Ye.paint_sky["sky-atmosphere-sun-intensity"]),"sky-gradient-center":new Yo(Ye.paint_sky["sky-gradient-center"]),"sky-gradient-radius":new Yo(Ye.paint_sky["sky-gradient-radius"]),"sky-gradient":new Jo(Ye.paint_sky["sky-gradient"]),"sky-atmosphere-halo-color":new Yo(Ye.paint_sky["sky-atmosphere-halo-color"]),"sky-atmosphere-color":new Yo(Ye.paint_sky["sky-atmosphere-color"]),"sky-opacity":new Yo(Ye.paint_sky["sky-opacity"])})};function gp(e,t,n){const i=[0,0,1],r=Kl([]);return Ql(r,r,n?-y(e)+Math.PI:y(e)),Jl(r,r,-y(t)),Vl(i,i,r),Fl(i,i)}const _p={circle:class extends ys{constructor(e){super(e,dl)}createBucket(e){return new Xs(e)}queryRadius(e){const t=e;return sl("circle-radius",this,t)+sl("circle-stroke-width",this,t)+ll(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,n,i,r,o,a,s){const l=ul(this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),c=this.paint.get("circle-radius").evaluate(t,n)+this.paint.get("circle-stroke-width").evaluate(t,n);return oc(e,i,o,a,s,"map"===this.paint.get("circle-pitch-alignment"),"map"===this.paint.get("circle-pitch-scale"),l,c)}getProgramIds(){return["circle"]}getProgramConfiguration(e){return new us(this,e)}},heatmap:class extends ys{createBucket(e){return new uc(e)}constructor(e){super(e,gc),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=_c({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(e){return sl("heatmap-radius",this,e)}queryIntersectsFeature(e,t,n,i,r,o,a,s){const l=this.paint.get("heatmap-radius").evaluate(t,n);return oc(e,i,o,a,s,!0,!0,new p(0,0),l)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}getProgramIds(){return["heatmap","heatmapTexture"]}getProgramConfiguration(e){return new us(this,e)}},hillshade:class extends ys{constructor(e){super(e,yc)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}getProgramIds(){return["hillshade","hillshadePrepare"]}},fill:class extends ys{constructor(e){super(e,ru)}getProgramIds(){const e=this.paint.get("fill-pattern"),t=e&&e.constantOr(1),n=[t?"fillPattern":"fill"];return this.paint.get("fill-antialias")&&n.push(t&&!this.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline"),n}getProgramConfiguration(e){return new us(this,e)}recalculate(e,t){super.recalculate(e,t);const n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new nu(e)}queryRadius(){return ll(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,n,i,r,o){return!e.queryGeometry.isAboveHorizon&&Ks(cl(e.tilespaceGeometry,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),i)}isTileClipped(){return!0}},"fill-extrusion":class extends ys{constructor(e){super(e,Nu)}createBucket(e){return new Mu(e)}queryRadius(){return ll(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}getProgramIds(){return[this.paint.get("fill-extrusion-pattern").constantOr(1)?"fillExtrusionPattern":"fillExtrusion"]}getProgramConfiguration(e){return new us(this,e)}queryIntersectsFeature(e,t,n,i,r,o,a,s,l){const c=ul(this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),u=this.paint.get("fill-extrusion-height").evaluate(t,n),h=this.paint.get("fill-extrusion-base").evaluate(t,n),d=[0,0],f=s&&o.elevation,m=o.elevation?o.elevation.exaggeration():1,g=e.tile.getBucket(this);if(f&&g instanceof Mu){const e=g.centroidVertexArray,t=l+1;t<e.length&&(d[0]=e.geta_centroid_pos0(t),d[1]=e.geta_centroid_pos1(t))}if(0===d[0]&&1===d[1])return!1;"globe"===o.projection.name&&(i=Bu([i],[new p(0,0),new p(ws,ws)],e.tileID.canonical).map((e=>e.polygon)).flat());const _=f?s:null,[y,v]=function(e,t,n,i,r,o,a,s,l,c,u){return"globe"===e.projection.name?function(e,t,n,i,r,o,a,s,l,c,u){const h=[],d=[],f=e.projection.upVectorScale(u,e.center.lat,e.worldSize).metersToTile,p=[0,0,0,1],m=[0,0,0,1],g=(e,t,n,i)=>{e[0]=t,e[1]=n,e[2]=i,e[3]=1},_=Ru();n>0&&(n+=_),i+=_;for(const _ of t){const t=[],y=[];for(const h of _){const d=h.x+r.x,_=h.y+r.y,v=e.projection.projectTilePoint(d,_,u),x=e.projection.upVector(u,h.x,h.y);let b=n,w=i;if(a){const e=Xu(d,_,n,i,a,s,l,c);b+=e.base,w+=e.top}0!==n?g(p,v.x+x[0]*f*b,v.y+x[1]*f*b,v.z+x[2]*f*b):g(p,v.x,v.y,v.z),g(m,v.x+x[0]*f*w,v.y+x[1]*f*w,v.z+x[2]*f*w),Ul(p,p,o),Ul(m,m,o),t.push(new $u(p[0],p[1],p[2])),y.push(new $u(m[0],m[1],m[2]))}h.push(t),d.push(y)}return[h,d]}(e,t,n,i,r,o,a,s,l,c,u):a?function(e,t,n,i,r,o,a,s,l){const c=[],u=[],h=[0,0,0,1];for(const d of e){const e=[],f=[];for(const c of d){const u=c.x+i.x,d=c.y+i.y,p=Xu(u,d,t,n,o,a,s,l);h[0]=u,h[1]=d,h[2]=p.base,h[3]=1,Hl(h,h,r),h[3]=Math.max(h[3],1e-5);const m=new $u(h[0]/h[3],h[1]/h[3],h[2]/h[3]);h[0]=u,h[1]=d,h[2]=p.top,h[3]=1,Hl(h,h,r),h[3]=Math.max(h[3],1e-5);const g=new $u(h[0]/h[3],h[1]/h[3],h[2]/h[3]);e.push(m),f.push(g)}c.push(e),u.push(f)}return[c,u]}(t,n,i,r,o,a,s,l,c):function(e,t,n,i,r){const o=[],a=[],s=r[8]*t,l=r[9]*t,c=r[10]*t,u=r[11]*t,h=r[8]*n,d=r[9]*n,f=r[10]*n,p=r[11]*n;for(const t of e){const e=[],n=[];for(const o of t){const t=o.x+i.x,a=o.y+i.y,m=r[0]*t+r[4]*a+r[12],g=r[1]*t+r[5]*a+r[13],_=r[2]*t+r[6]*a+r[14],y=r[3]*t+r[7]*a+r[15],v=m+s,x=g+l,b=_+c,w=Math.max(y+u,1e-5),E=m+h,T=g+d,S=_+f,A=Math.max(y+p,1e-5);e.push(new $u(v/w,x/w,b/w)),n.push(new $u(E/A,T/A,S/A))}o.push(e),a.push(n)}return[o,a]}
vendor: 66,750 bytes, line 2
2(t,n,i,r,o)}(o,i,h,u,c,a,_,d,m,o.center.lat,e.tileID.canonical),x=e.queryGeometry;return function(e,t,n){let i=1/0;Ks(n,t)&&(i=Zu(n,t[0]));for(let r=0;r<t.length;r++){const o=t[r],a=e[r];for(let e=0;e<o.length-1;e++){const t=o[e],r=[t,o[e+1],a[e+1],a[e],t];Hs(n,r)&&(i=Math.min(i,Zu(n,r)))}}return i!==1/0&&i}(y,v,x.isPointQuery()?x.screenBounds:x.screenGeometry)}},line:class extends ys{constructor(e){super(e,ih),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression&&e._styleExpression.expression instanceof Cn,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=rh.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new th(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getProgramConfiguration(e){return new us(this,e)}queryRadius(e){const t=e,n=oh(sl("line-width",this,t),sl("line-gap-width",this,t)),i=sl("line-offset",this,t);return n/2+Math.abs(i)+ll(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,n,i,r,o){if(e.queryGeometry.isAboveHorizon)return!1;const a=cl(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),s=e.pixelToTileUnitsFactor/2*oh(this.paint.get("line-width").evaluate(t,n),this.paint.get("line-gap-width").evaluate(t,n)),l=this.paint.get("line-offset").evaluate(t,n);return l&&(i=function(e,t){const n=[],i=new p(0,0);for(let r=0;r<e.length;r++){const o=e[r],a=[];for(let e=0;e<o.length;e++){const n=o[e-1],r=o[e],s=o[e+1],l=0===e?i:r.sub(n)._unit()._perp(),c=e===o.length-1?i:s.sub(r)._unit()._perp(),u=l._add(c)._unit();u._mult(1/(u.x*c.x+u.y*c.y)),a.push(u._mult(t)._add(r))}n.push(a)}return n}(i,l*e.pixelToTileUnitsFactor)),function(e,t,n){for(let i=0;i<t.length;i++){const r=t[i];if(e.length>=3)for(let t=0;t<r.length;t++)if(rl(e,r[t]))return!0;if(Js(e,r,n))return!0}return!1}(a,i,s)}isTileClipped(){return!0}},symbol:hp,background:class extends ys{constructor(e){super(e,dp)}getProgramIds(){return[this.paint.get("background-pattern")?"backgroundPattern":"background"]}},raster:class extends ys{constructor(e){super(e,fp)}getProgramIds(){return["raster"]}},sky:class extends ys{constructor(e){super(e,mp),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"sky-gradient"===e?this._updateColorRamp():"sky-atmosphere-sun"!==e&&"sky-atmosphere-halo-color"!==e&&"sky-atmosphere-color"!==e&&"sky-atmosphere-sun-intensity"!==e||(this._skyboxInvalidated=!0)}_updateColorRamp(){this.colorRamp=_c({expression:this._transitionablePaint._values["sky-gradient"].value.expression,evaluationKey:"skyRadialProgress"}),this.colorRampTexture&&(this.colorRampTexture.destroy(),this.colorRampTexture=null)}needsSkyboxCapture(e){if(this._skyboxInvalidated||!this.skyboxTexture||!this.skyboxGeometry)return!0;if(!this.paint.get("sky-atmosphere-sun")){const t=e.style.light.properties.get("position");return this._lightPosition.azimuthal!==t.azimuthal||this._lightPosition.polar!==t.polar}return!1}getCenter(e,t){if("atmosphere"===this.paint.get("sky-type")){const n=this.paint.get("sky-atmosphere-sun"),i=!n,r=e.style.light,o=r.properties.get("position");return i&&"viewport"===r.properties.get("anchor")&&U("The sun direction is attached to a light with viewport anchor, lighting may behave unexpectedly."),i?gp(o.azimuthal,90-o.polar,t):gp(n[0],90-n[1],t)}const n=this.paint.get("sky-gradient-center");return gp(n[0],90-n[1],t)}is3D(){return!1}isSky(){return!0}markSkyboxValid(e){this._skyboxInvalidated=!1,this._lightPosition=e.style.light.properties.get("position")}hasOffscreenPass(){return!0}getProgramIds(){const e=this.paint.get("sky-type");return"atmosphere"===e?["skyboxCapture","skybox"]:"gradient"===e?["skyboxGradient"]:null}}};class yp{constructor(e,t,n,i){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(t,i)}update(e,n,i){const{width:r,height:o}=e,{context:a}=this,{gl:s}=a,{HTMLImageElement:l,HTMLCanvasElement:c,HTMLVideoElement:u,ImageData:h,ImageBitmap:d}=t;if(s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!n||!1!==n.premultiply)),i||this.size&&this.size[0]===r&&this.size[1]===o){const{x:t,y:n}=i||{x:0,y:0};e instanceof l||e instanceof c||e instanceof u||e instanceof h||d&&e instanceof d?s.texSubImage2D(s.TEXTURE_2D,0,t,n,s.RGBA,s.UNSIGNED_BYTE,e):s.texSubImage2D(s.TEXTURE_2D,0,t,n,r,o,s.RGBA,s.UNSIGNED_BYTE,e.data)}else this.size=[r,o],e instanceof l||e instanceof c||e instanceof u||e instanceof h||d&&e instanceof d?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,e):s.texImage2D(s.TEXTURE_2D,0,this.format,r,o,0,this.format,s.UNSIGNED_BYTE,e.data);this.useMipmap=Boolean(n&&n.useMipmap&&this.isSizePowerOfTwo()),this.useMipmap&&s.generateMipmap(s.TEXTURE_2D)}bind(e,t){const{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),e!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,this.useMipmap?e===i.NEAREST?i.NEAREST_MIPMAP_NEAREST:i.LINEAR_MIPMAP_NEAREST:e),this.filter=e),t!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class vp{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){this._channel=void 0,this._callback=()=>{}}}class xp{constructor(){this.tasks={},this.taskQueue=[],O(["process"],this),this.invoker=new vp(this.process),this.nextId=0}add(e,t){const n=this.nextId++,i=function({type:e,isSymbolTile:t,zoom:n}){return n=n||0,"message"===e?0:"maybePrepare"!==e||t?"parseTile"!==e||t?"parseTile"===e&&t?300-n:"maybePrepare"===e&&t?400-n:500:200-n:100-n}(t);if(0===i){q();try{e()}finally{}return{cancel:()=>{}}}return this.tasks[n]={fn:e,metadata:t,priority:i,id:n},this.taskQueue.push(n),this.invoker.trigger(),{cancel:()=>{delete this.tasks[n]}}}process(){q();try{if(this.taskQueue=this.taskQueue.filter((e=>!!this.tasks[e])),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!t)return;t.fn()}finally{}}pick(){let e=null,t=1/0;for(let n=0;n<this.taskQueue.length;n++){const i=this.tasks[this.taskQueue[n]];i.priority<t&&(t=i.priority,e=n)}if(null===e)return null;const n=this.taskQueue[e];return this.taskQueue.splice(e,1),n}remove(){this.invoker.remove()}}class bp{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const n=e[t];this._stringToNumber[n]=t,this._numberToString[t]=n}}encode(e){return this._stringToNumber[e]}decode(e){return this._numberToString[e]}}const wp=["tile","layer","source","sourceLayer","state"];class Ep{constructor(e,t,n,i,r){this.type="Feature",this._vectorTileFeature=e,this._z=t,this._x=n,this._y=i,this.properties=e.properties,this.id=r}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",geometry:this.geometry,properties:this.properties};void 0!==this.id&&(e.id=this.id);for(const t of wp)void 0!==this[t]&&(e[t]=this[t]);return e}}const Tp=32,Sp=33,Ap=new Uint16Array(8184);for(let e=0;e<2046;e++){let t=e+2,n=0,i=0,r=0,o=0,a=0,s=0;for(1&t?r=o=a=Tp:n=i=s=Tp;(t>>=1)>1;){const e=n+r>>1,l=i+o>>1;1&t?(r=n,o=i,n=a,i=s):(n=r,i=o,r=a,o=s),a=e,s=l}const l=4*e;Ap[l+0]=n,Ap[l+1]=i,Ap[l+2]=r,Ap[l+3]=o}const Cp=new Uint16Array(2178),kp=new Uint8Array(1089),Mp=new Uint16Array(1089);function Ip(e){return 0===e?-.03125:32===e?.03125:0}var Pp=ra([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);const Dp={type:2,extent:ws,loadGeometry:()=>[[new p(0,0),new p(8193,0),new p(8193,8193),new p(0,8193),new p(0,0)]]};class zp{constructor(e,t,n,i,r){this.tileID=e,this.uid=P(),this.uses=0,this.tileSize=t,this.tileZoom=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=r,this.expiredRequestCount=0,this.state="loading",i&&i.transform&&(this.projection=i.transform.projection)}registerFadeDuration(e){const t=e+this.timeAdded;t<qe.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}get tileTransform(){return this._tileTransform||(this._tileTransform=Pf(this.tileID.canonical,this.projection)),this._tileTransform}loadVectorData(e,t,n){if(this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(e,t){const n={};if(!t)return n;for(const i of e){const e=i.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(0!==e.length){i.layers=e,i.stateDependentLayerIds&&(i.stateDependentLayers=i.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)n[t.id]=i}}return n}(e.buckets,t.style),this.hasSymbolBuckets=!1;for(const e in this.buckets){const t=this.buckets[e];if(t instanceof sp){if(this.hasSymbolBuckets=!0,!n)break;t.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const e in this.buckets){const t=this.buckets[e];if(t instanceof sp&&t.hasRTLText){this.hasRTLText=!0,jo.isLoading()||jo.isLoaded()||"deferred"!==Fo()||No();break}}this.queryPadding=0;for(const e in this.buckets){const n=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(e).queryRadius(n))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas)}else this.collisionBoxArray=new Da}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.id]}upload(e){for(const t in this.buckets){const n=this.buckets[t];n.uploadPending()&&n.upload(e)}const t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new yp(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new yp(e,this.glyphAtlasImage,t.ALPHA),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new yp(e,this.lineAtlas.image,t.ALPHA),this.lineAtlas.uploaded=!0)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,n,i,r,o,a,s){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({tileResult:i,pixelPosMatrix:a,transform:o,params:r,tileTransform:this.tileTransform},e,t,n):{}}querySourceFeatures(e,t){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const i=n.loadVTLayers(),r=t?t.sourceLayer:"",o=i._geojsonTileLayer||i[r];if(!o)return;const a=ar(t&&t.filter),{z:s,x:l,y:c}=this.tileID.canonical,u={z:s,x:l,y:c};for(let t=0;t<o.length;t++){const i=o.feature(t);if(a.needGeometry){const e=$s(i,!0);if(!a.filter(new Uo(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!a.filter(new Uo(this.tileID.overscaledZ),i))continue;const h=n.getId(i,r),d=new Ep(i,s,l,c,h);d.tile=u,e.push(d)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return!!this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const t=this.expirationTime;if(e.cacheControl){const t=$(e.cacheControl);t["max-age"]&&(this.expirationTime=Date.now()+1e3*t["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const e=Date.now();let n=!1;if(this.expirationTime>e)n=!1;else if(t)if(this.expirationTime<t)n=!0;else{const i=this.expirationTime-t;i?this.expirationTime=e+Math.max(i,3e4):n=!0}else n=!0;n?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(e).length||!t)return;const n=this.latestFeatureIndex.loadVTLayers(),i=t.style.listImages();for(const r in this.buckets){if(!t.style.hasLayer(r))continue;const o=this.buckets[r],a=o.layers[0].sourceLayer||"_geojsonTileLayer",s=n[a],l=e[a];if(!s||!l||0===Object.keys(l).length)continue;if(o.update(l,s,i,this.imageAtlas&&this.imageAtlas.patternPositions||{}),o instanceof th||o instanceof nu){const e=t.style._getSourceCache(o.layers[0].source);t._terrain&&t._terrain.enabled&&e&&o.programConfigurations.needsUpload&&t._terrain._clearRenderCacheForTile(e.id,this.tileID)}const c=t&&t.style&&t.style.getLayer(r);c&&(this.queryPadding=Math.max(this.queryPadding,c.queryRadius(o)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<qe.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=qe.now()+e}setTexture(e,t){const n=t.context,i=n.gl;this.texture=this.texture||t.getTileTexture(e.width),this.texture?this.texture.update(e,{useMipmap:!0}):(this.texture=new yp(n,e,i.RGBA,{useMipmap:!0}),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),n.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,n.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,n.extTextureFilterAnisotropicMax))}setDependencies(e,t){const n={};for(const e of t)n[e]=!0;this.dependencies[e]=n}hasDependency(e,t){for(const n of e){const e=this.dependencies[n];if(e)for(const n of t)if(e[n])return!0}return!1}clearQueryDebugViz(){}_makeDebugTileBoundsBuffers(e,t){if(!t||"mercator"===t.name||this._tileDebugBuffer)return;const n=qs(Dp,this.tileID.canonical,this.tileTransform)[0],i=new aa,r=new Ma;for(let e=0;e<n.length;e++){const{x:t,y:o}=n[e];i.emplaceBack(t,o),r.emplaceBack(e)}r.emplaceBack(0),this._tileDebugIndexBuffer=e.createIndexBuffer(r),this._tileDebugBuffer=e.createVertexBuffer(i,Jd.members),this._tileDebugSegments=bs.simpleSegment(0,0,i.length,r.length)}_makeTileBoundsBuffers(e,t){if(this._tileBoundsBuffer||!t||"mercator"===t.name)return;const n=qs(Dp,this.tileID.canonical,this.tileTransform)[0];let i,r;if(this.isRaster){const e=function(e,t){const n=Pf(e,t),i=Math.pow(2,e.z);for(let r=0;r<Sp;r++)for(let o=0;o<Sp;o++){const a=Ps((e.x+(o+Ip(o))/Tp)/i),s=Ds((e.y+(r+Ip(r))/Tp)/i),l=t.project(a,s),c=r*Sp+o;Cp[2*c+0]=Math.round((l.x*n.scale-n.x)*ws),Cp[2*c+1]=Math.round((l.y*n.scale-n.y)*ws)}kp.fill(0),Mp.fill(0);for(let e=2045;e>=0;e--){const t=4*e,n=Ap[t+0],i=Ap[t+1],r=Ap[t+2],o=Ap[t+3],a=n+r>>1,s=i+o>>1,l=a+s-i,c=s+n-a,u=i*Sp+n,h=o*Sp+r,d=s*Sp+a,f=Math.hypot((Cp[2*u+0]+Cp[2*h+0])/2-Cp[2*d+0],(Cp[2*u+1]+Cp[2*h+1])/2-Cp[2*d+1])>=16;if(kp[d]=kp[d]||(f?1:0),e<1022){const e=(i+c>>1)*Sp+(n+l>>1),t=(o+c>>1)*Sp+(r+l>>1);kp[d]=kp[d]||kp[e]||kp[t]}}const r=new la,o=new wa;let a=0;function s(e,t){const n=t*Sp+e;return 0===Mp[n]&&(r.emplaceBack(Cp[2*n+0],Cp[2*n+1],e*ws/Tp,t*ws/Tp),Mp[n]=++a),Mp[n]-1}function l(e,t,n,i,r,a){const c=e+n>>1,u=t+i>>1;if(Math.abs(e-r)+Math.abs(t-a)>1&&kp[u*Sp+c])l(r,a,e,t,c,u),l(n,i,r,a,c,u);else{const l=s(e,t),c=s(n,i),u=s(r,a);o.emplaceBack(l,c,u)}}return l(0,0,Tp,Tp,Tp,0),l(Tp,Tp,0,0,0,Tp),{vertices:r,indices:o}}(this.tileID.canonical,t);i=e.vertices,r=e.indices}else{i=new la,r=new wa;for(const{x:e,y:t}of n)i.emplaceBack(e,t,0,0);const e=bc.exports(i.int16,void 0,4);for(let t=0;t<e.length;t+=3)r.emplaceBack(e[t],e[t+1],e[t+2])}this._tileBoundsBuffer=e.createVertexBuffer(i,Pp.members),this._tileBoundsIndexBuffer=e.createIndexBuffer(r),this._tileBoundsSegments=bs.simpleSegment(0,0,i.length,r.length)}_makeGlobeTileDebugBuffers(e,t){const n=t.projection;if(!n||"globe"!==n.name||t.freezeTileCoverage)return;const i=this.tileID.canonical,r=bf(df(i,t)),o=Tf(t.zoom);let a;o>0&&(a=yl(new Float64Array(16),t.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(e,i,t,r,a,o),this._makeGlobeTileDebugTextBuffer(e,i,t,r,a,o)}_globePoint(e,t,n,i,r,o,a){let s=yf(e,t,n);if(o){const r=1<<n.z,l=ks(i.center.lng),c=Ms(i.center.lat),u=(n.x+.5)/r-l;let h=0;u>.5?h=-1:u<-.5&&(h=1);let d=(e/ws+n.x)/r+h,f=(t/ws+n.y)/r;d=(d-l)*i._pixelsPerMercatorPixel+l,f=(f-c)*i._pixelsPerMercatorPixel+c;const p=[d*i.worldSize,f*i.worldSize,0];Ul(p,p,o),s=hf(s,p,a)}return Ul(s,s,r)}_makeGlobeTileDebugBorderBuffer(e,t,n,i,r,o){const a=new aa,s=new Ma,l=new sa,c=(e,c,u,h,d)=>{const f=(u-e)/(d-1),p=(h-c)/(d-1),m=a.length;for(let u=0;u<d;u++){const h=e+u*f,d=c+u*p;a.emplaceBack(h,d);const g=this._globePoint(h,d,t,n,i,r,o);l.emplaceBack(g[0],g[1],g[2]),s.emplaceBack(m+u)}},u=ws;c(0,0,u,0,16),c(u,0,u,u,16),c(u,u,0,u,16),c(0,u,0,0,16),this._tileDebugIndexBuffer=e.createIndexBuffer(s),this._tileDebugBuffer=e.createVertexBuffer(a,Jd.members),this._globeTileDebugBorderBuffer=e.createVertexBuffer(l,Kd.members),this._tileDebugSegments=bs.simpleSegment(0,0,a.length,s.length)}_makeGlobeTileDebugTextBuffer(e,t,n,i,r,o){const a=new aa,s=new wa,l=new sa,c=25;s.reserve(32),a.reserve(c),l.reserve(c);const u=(e,t)=>c*e+t;for(let e=0;e<c;e++){const s=2048*e;for(let e=0;e<c;e++){const c=2048*e;a.emplaceBack(c,s);const u=this._globePoint(c,s,t,n,i,r,o);l.emplaceBack(u[0],u[1],u[2])}}for(let e=0;e<4;e++)for(let t=0;t<4;t++){const n=u(e,t),i=u(e,t+1),r=u(e+1,t),o=u(e+1,t+1);s.emplaceBack(n,i,r),s.emplaceBack(r,i,o)}this._tileDebugTextIndexBuffer=e.createIndexBuffer(s),this._tileDebugTextBuffer=e.createVertexBuffer(a,Jd.members),this._globeTileDebugTextBuffer=e.createVertexBuffer(l,Kd.members),this._tileDebugTextSegments=bs.simpleSegment(0,0,c,32)}}class Lp{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,t,n){const i=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][i]=this.stateChanges[e][i]||{},M(this.stateChanges[e][i],n),null===this.deletedStates[e]){this.deletedStates[e]={};for(const t in this.state[e])t!==i&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][i]){this.deletedStates[e][i]={};for(const t in this.state[e][i])n[t]||(this.deletedStates[e][i][t]=null)}else for(const t in n)this.deletedStates[e]&&this.deletedStates[e][i]&&null===this.deletedStates[e][i][t]&&delete this.deletedStates[e][i][t]}removeFeatureState(e,t,n){if(null===this.deletedStates[e])return;const i=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},n&&void 0!==t)null!==this.deletedStates[e][i]&&(this.deletedStates[e][i]=this.deletedStates[e][i]||{},this.deletedStates[e][i][n]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][i])for(n in this.deletedStates[e][i]={},this.stateChanges[e][i])this.deletedStates[e][i][n]=null;else this.deletedStates[e][i]=null;else this.deletedStates[e]=null}getState(e,t){const n=String(t),i=M({},(this.state[e]||{})[n],(this.stateChanges[e]||{})[n]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){const n=this.deletedStates[e][t];if(null===n)return{};for(const e in n)delete i[e]}return i}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,t){const n={};for(const e in this.stateChanges){this.state[e]=this.state[e]||{};const t={};for(const n in this.stateChanges[e])this.state[e][n]||(this.state[e][n]={}),M(this.state[e][n],this.stateChanges[e][n]),t[n]=this.state[e][n];n[e]=t}for(const e in this.deletedStates){this.state[e]=this.state[e]||{};const t={};if(null===this.deletedStates[e])for(const n in this.state[e])t[n]={},this.state[e][n]={};else for(const n in this.deletedStates[e]){if(null===this.deletedStates[e][n])this.state[e][n]={};else for(const t of Object.keys(this.deletedStates[e][n]))delete this.state[e][n][t];t[n]=this.state[e][n]}n[e]=n[e]||{},M(n[e],t)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(const i in e)e[i].setFeatureState(n,t)}}class Op{constructor(e){this.size=e,this.minimums=[],this.maximums=[],this.leaves=[]}getElevation(e,t){const n=this.toIdx(e,t);return{min:this.minimums[n],max:this.maximums[n]}}isLeaf(e,t){return this.leaves[this.toIdx(e,t)]}toIdx(e,t){return t*this.size+e}}function Rp(e,t,n,i){let r=0,o=Number.MAX_VALUE;for(let a=0;a<3;a++)if(Math.abs(i[a])<1e-15){if(n[a]<e[a]||n[a]>t[a])return null}else{const s=1/i[a];let l=(e[a]-n[a])*s,c=(t[a]-n[a])*s;if(l>c){const e=l;l=c,c=e}if(l>r&&(r=l),c<o&&(o=c),r>o)return null}return r}function Bp(e,t,n,i,r,o,a,s,l,c,u){const h=i-e,d=r-t,f=o-n,p=a-e,m=s-t,g=l-n,_=u[1]*g-u[2]*m,y=u[2]*p-u[0]*g,v=u[0]*m-u[1]*p,x=h*_+d*y+f*v;if(Math.abs(x)<1e-15)return null;const b=1/x,w=c[0]-e,E=c[1]-t,T=c[2]-n,S=(w*_+E*y+T*v)*b;if(S<0||S>1)return null;const A=E*f-T*d,C=T*h-w*f,k=w*d-E*h,M=(u[0]*A+u[1]*C+u[2]*k)*b;return M<0||S+M>1?null:(p*A+m*C+g*k)*b}function Fp(e,t,n){return(e-t)/(n-t)}function Np(e,t,n,i,r,o,a,s,l){const c=1<<n,u=o-i,h=a-r,d=(e+1)/c*u+i,f=(t+0)/c*h+r,p=(t+1)/c*h+r;s[0]=(e+0)/c*u+i,s[1]=f,l[0]=d,l[1]=p}class jp{constructor(e){if(this.maximums=[],this.minimums=[],this.leaves=[],this.childOffsets=[],this.nodeCount=0,this.dem=e,this._siblingOffset=[[0,0],[1,0],[0,1],[1,1]],!this.dem)return;const t=function(e){const t=Math.ceil(Math.log2(e.dim/8)),n=[];let i=Math.ceil(Math.pow(2,t));const r=1/i,o=(e,t,n,i,r)=>{const o=i?1:0,a=(e+1)*n-o,s=t*n,l=(t+1)*n-o;r[0]=e*n,r[1]=s,r[2]=a,r[3]=l};let a=new Op(i);const s=[];for(let t=0;t<i*i;t++){o(t%i,Math.floor(t/i),r,!1,s);const n=Vp(s[0],s[1],e),l=Vp(s[2],s[1],e),c=Vp(s[2],s[3],e),u=Vp(s[0],s[3],e);a.minimums.push(Math.min(n,l,c,u)),a.maximums.push(Math.max(n,l,c,u)),a.leaves.push(1)}for(n.push(a),i/=2;i>=1;i/=2){const e=n[n.length-1];a=new Op(i);for(let t=0;t<i*i;t++){o(t%i,Math.floor(t/i),2,!0,s);const n=e.getElevation(s[0],s[1]),r=e.getElevation(s[2],s[1]),l=e.getElevation(s[2],s[3]),c=e.getElevation(s[0],s[3]),u=e.isLeaf(s[0],s[1]),h=e.isLeaf(s[2],s[1]),d=e.isLeaf(s[2],s[3]),f=e.isLeaf(s[0],s[3]),p=Math.min(n.min,r.min,l.min,c.min),m=Math.max(n.max,r.max,l.max,c.max),g=u&&h&&d&&f;a.maximums.push(m),a.minimums.push(p),a.leaves.push(m-p<=5&&g?1:0)}n.push(a)}return n}(this.dem),n=t.length-1,i=t[n];this._addNode(i.minimums[0],i.maximums[0],i.leaves[0]),this._construct(t,0,0,n,0)}raycastRoot(e,t,n,i,r,o,a=1){return Rp([e,t,-100],[n,i,this.maximums[0]*a],r,o)}raycast(e,t,n,i,r,o,a=1){if(!this.nodeCount)return null;const s=this.raycastRoot(e,t,n,i,r,o,a);if(null==s)return null;const l=[],c=[],u=[],h=[],d=[{idx:0,t:s,nodex:0,nodey:0,depth:0}];for(;d.length>0;){const{idx:s,t:f,nodex:p,nodey:m,depth:g}=d.pop();if(this.leaves[s]){Np(p,m,g,e,t,n,i,u,h);const s=1<<g,l=(p+0)/s,c=(p+1)/s,d=(m+0)/s,_=(m+1)/s,y=Vp(l,d,this.dem)*a,v=Vp(c,d,this.dem)*a,x=Vp(c,_,this.dem)*a,b=Vp(l,_,this.dem)*a,w=Bp(u[0],u[1],y,h[0],u[1],v,h[0],h[1],x,r,o),E=Bp(h[0],h[1],x,u[0],h[1],b,u[0],u[1],y,r,o),T=Math.min(null!==w?w:Number.MAX_VALUE,null!==E?E:Number.MAX_VALUE);if(T!==Number.MAX_VALUE)return T;{const e=Bl([],r,o,f);if(Up(y,v,b,x,Fp(e[0],u[0],h[0]),Fp(e[1],u[1],h[1]))>=e[2])return f}continue}let _=0;for(let d=0;d<this._siblingOffset.length;d++){Np((p<<1)+this._siblingOffset[d][0],(m<<1)+this._siblingOffset[d][1],g+1,e,t,n,i,u,h),u[2]=-100,h[2]=this.maximums[this.childOffsets[s]+d]*a;const f=Rp(u,h,r,o);if(null!=f){const e=f;l[d]=e;let t=!1;for(let n=0;n<_&&!t;n++)e>=l[c[n]]&&(c.splice(n,0,d),t=!0);t||(c[_]=d),_++}}for(let e=0;e<_;e++){const t=c[e];d.push({idx:this.childOffsets[s]+t,t:l[t],nodex:(p<<1)+this._siblingOffset[t][0],nodey:(m<<1)+this._siblingOffset[t][1],depth:g+1})}}return null}_addNode(e,t,n){return this.minimums.push(e),this.maximums.push(t),this.leaves.push(n),this.childOffsets.push(0),this.nodeCount++}_construct(e,t,n,i,r){if(1===e[i].isLeaf(t,n))return;this.childOffsets[r]||(this.childOffsets[r]=this.nodeCount);const o=i-1,a=e[o];let s=0,l=0;for(let e=0;e<this._siblingOffset.length;e++){const i=2*t+this._siblingOffset[e][0],r=2*n+this._siblingOffset[e][1],o=a.getElevation(i,r),c=a.isLeaf(i,r),u=this._addNode(o.min,o.max,c);c&&(s|=1<<e),l||(l=u)}for(let i=0;i<this._siblingOffset.length;i++)s&1<<i||this._construct(e,2*t+this._siblingOffset[i][0],2*n+this._siblingOffset[i][1],o,l+i)}}function Up(e,t,n,i,r,o){return kn(kn(e,n,o),kn(t,i,o),r)}function Vp(e,t,n){const i=n.dim,r=T(e*i-.5,0,i-1),o=T(t*i-.5,0,i-1),a=Math.floor(r),s=Math.floor(o),l=Math.min(a+1,i-1),c=Math.min(s+1,i-1);return Up(n.get(a,s),n.get(l,s),n.get(a,c),n.get(l,c),r-a,o-s)}const Gp={mapbox:[6553.6,25.6,.1,1e4],terrarium:[256,1,1/256,32768]};class qp{get tree(){return this._tree||this._buildQuadTree(),this._tree}constructor(e,t,n,i=!1,r=!1){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(n&&"mapbox"!==n&&"terrarium"!==n)return U(`"${n}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const o=this.dim=t.height-2,a=new Uint32Array(t.data.buffer);if(this.pixels=new Uint8Array(t.data.buffer),this.encoding=n||"mapbox",this.borderReady=i,!i){for(let e=0;e<o;e++)a[this._idx(-1,e)]=a[this._idx(0,e)],a[this._idx(o,e)]=a[this._idx(o-1,e)],a[this._idx(e,-1)]=a[this._idx(e,0)],a[this._idx(e,o)]=a[this._idx(e,o-1)];a[this._idx(-1,-1)]=a[this._idx(0,0)],a[this._idx(o,-1)]=a[this._idx(o-1,0)],a[this._idx(-1,o)]=a[this._idx(0,o-1)],a[this._idx(o,o)]=a[this._idx(o-1,o-1)],r&&this._buildQuadTree()}}_buildQuadTree(){this._tree=new jp(this)}get(e,t,n=!1){n&&(e=T(e,-1,this.dim),t=T(t,-1,this.dim));const i=4*this._idx(e,t);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(this.pixels[i],this.pixels[i+1],this.pixels[i+2])}static getUnpackVector(e){return Gp[e]}get unpackVector(){return Gp[this.encoding]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}_unpackMapbox(e,t,n){return(256*e*256+256*t+n)/10-1e4}_unpackTerrarium(e,t,n){return 256*e+t+n/256-32768}static pack(e,t){const n=[0,0,0,0],i=qp.getUnpackVector(t);let r=Math.floor((e+i[3])/i[2]);return n[2]=r%256,r=Math.floor(r/256),n[1]=r%256,r=Math.floor(r/256),n[0]=r,n}getPixels(){return new mc({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=t*this.dim,r=t*this.dim+this.dim,o=n*this.dim,a=n*this.dim+this.dim;switch(t){case-1:i=r-1;break;case 1:r=i+1}switch(n){case-1:o=a-1;break;case 1:a=o+1}const s=-t*this.dim,l=-n*this.dim;for(let t=o;t<a;t++)for(let n=i;n<r;n++){const i=4*this._idx(n,t),r=4*this._idx(n+s,t+l);this.pixels[i+0]=e.pixels[r+0],this.pixels[i+1]=e.pixels[r+1],this.pixels[i+2]=e.pixels[r+2],this.pixels[i+3]=e.pixels[r+3]}}onDeserialize(){this._tree&&(this._tree.dem=this)}}Vr(qp,"DEMData"),Vr(jp,"DemMinMaxQuadTree",{omit:["dem"]});class $p{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,n){const i=e.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);const r={value:t,timeout:void 0};if(void 0!==n&&(r.timeout=setTimeout((()=>{this.remove(e,r)}),n)),this.data[i].push(r),this.order.push(i),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const n=e.wrapped().key,i=void 0===t?0:this.data[n].indexOf(t),r=this.data[n][i];return this.data[n].splice(i,1),r.timeout&&clearTimeout(r.timeout),0===this.data[n].length&&delete this.data[n],this.onRemove(r.value),this.order.splice(this.order.indexOf(n),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const n in this.data)for(const i of this.data[n])e(i.value)||t.push(i);for(const e of t)this.remove(e.value.tileID,e)}}class Wp{constructor(e,t,n){this.func=e,this.mask=t,this.range=n}}Wp.ReadOnly=!1,Wp.ReadWrite=!0,Wp.disabled=new Wp(519,Wp.ReadOnly,[0,1]);const Zp=7680;class Xp{constructor(e,t,n,i,r,o){this.test=e,this.ref=t,this.mask=n,this.fail=i,this.depthFail=r,this.pass=o}}Xp.disabled=new Xp({func:519,mask:0},0,0,Zp,Zp,Zp);class Hp{constructor(e,t,n){this.blendFunction=e,this.blendColor=t,this.mask=n}}Hp.Replace=[1,0],Hp.disabled=new Hp(Hp.Replace,Ct.transparent,[!1,!1,!1,!1]),Hp.unblended=new Hp(Hp.Replace,Ct.transparent,[!0,!0,!0,!0]),Hp.alphaBlended=new Hp([1,771],Ct.transparent,[!0,!0,!0,!0]);const Yp=1029,Kp=2305;class Jp{constructor(e,t,n){this.enable=e,this.mode=t,this.frontFace=n}}Jp.disabled=new Jp(!1,Yp,Kp),Jp.backCCW=new Jp(!0,Yp,Kp),Jp.backCW=new Jp(!0,Yp,2304),Jp.frontCW=new Jp(!0,1028,2304),Jp.frontCCW=new Jp(!0,1028,Kp);class Qp extends He{constructor(e,t,n){super(),this.id=e,this._onlySymbols=n,t.on("data",(e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))})),t.on("error",(()=>{this._sourceErrored=!0})),this._source=t,this._tiles={},this._cache=new $p(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._loadedParentTiles={},this._coveredTiles={},this._state=new Lp,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const e in this._tiles){const t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,t){return e.isSymbolTile=this._onlySymbols,this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,(()=>{}))}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e,(()=>{}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const n=this._tiles[t];n.upload(e),n.prepare(this.map.style.imageManager)}}getIds(){return k(this._tiles).map((e=>e.tileID)).sort(em).map((e=>e.key))}getRenderableIds(e){const t=[];for(const n in this._tiles)this._isIdRenderable(+n,e)&&t.push(this._tiles[n]);return e?t.sort(((e,t)=>{const n=e.tileID,i=t.tileID,r=new p(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new p(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||o.y-r.y||o.x-r.x})).map((e=>e.tileID.key)):t.map((e=>e.tileID)).sort(em).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,t){const n=this._tiles[e];n&&("loading"!==n.state&&(n.state=t),this._loadTile(n,this._tileLoaded.bind(this,n,e,t)))}_tileLoaded(e,t,n,i){if(i)if(e.state="errored",404!==i.status)this._source.fire(new Xe(i,{tile:e}));else if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const e=this.map.painter.terrain;this.update(this.transform,e.getScaledDemTileSize(),!0),e.resetTileLookupCache(this.id)}else this.update(this.transform);else e.timeAdded=qe.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(t,e),"raster-dem"===this._source.type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new Ze("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const t=this.getRenderableIds();for(let i=0;i<t.length;i++){const r=t[i];if(e.neighboringTiles&&e.neighboringTiles[r]){const t=this.getTileByID(r);n(e,t),n(t,e)}}function n(e,t){if(!e.dem||e.dem.borderReady)return;e.needsHillshadePrepare=!0,e.needsDEMTextureUpload=!0;let n=t.tileID.canonical.x-e.tileID.canonical.x;const i=t.tileID.canonical.y-e.tileID.canonical.y,r=Math.pow(2,e.tileID.canonical.z),o=t.tileID.key;0===n&&0===i||Math.abs(i)>1||(Math.abs(n)>1&&(1===Math.abs(n+r)?n+=r:1===Math.abs(n-r)&&(n-=r)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,n,i),e.neighboringTiles&&e.neighboringTiles[o]&&(e.neighboringTiles[o].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,n,i){for(const r in this._tiles){let o=this._tiles[r];if(i[r]||!o.hasData()||o.tileID.overscaledZ<=t||o.tileID.overscaledZ>n)continue;let a=o.tileID;for(;o&&o.tileID.overscaledZ>t+1;){const e=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[e.key],o&&o.hasData()&&(a=e)}let s=a;for(;s.overscaledZ>t;)if(s=s.scaledTo(s.overscaledZ-1),e[s.key]){i[a.key]=a;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const n=this._loadedParentTiles[e.key];return n&&n.tileID.overscaledZ>=t?n:null}for(let n=e.overscaledZ-1;n>=t;n--){const t=e.scaledTo(n),i=this._getLoadedTile(t);if(i)return i}}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,t){t=t||this._source.tileSize;const n=Math.ceil(e.width/t)+1,i=Math.ceil(e.height/t)+1,r=Math.floor(n*i*5),o="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,r):r,a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(a)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const n in this._tiles){const i=this._tiles[n];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),e[i.tileID.key]=i}this._tiles=e;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(+e,this._tiles[e])}}update(e,t,n){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!n)return;let i;this.updateCacheSize(e,t),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new Gu(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(i=e.coveringTiles({tileSize:t||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!n,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain}),this._source.hasTile&&(i=i.filter((e=>this._source.hasTile(e))))):i=[];const r=this._updateRetainedTiles(i);if(tm(this._source.type)&&0!==i.length){const e={},t={},n=Object.keys(r);for(const i of n){const n=r[i],o=this._tiles[i];if(!o||o.fadeEndTime&&o.fadeEndTime<=qe.now())continue;const a=this.findLoadedParent(n,Math.max(n.overscaledZ-Qp.maxOverzooming,this._source.minzoom));a&&(this._addTile(a.tileID),e[a.tileID.key]=a.tileID),t[i]=n}const o=i[i.length-1].overscaledZ;for(const e in this._tiles){const n=this._tiles[e];if(r[e]||!n.hasData())continue;let i=n.tileID;for(;i.overscaledZ>o;){i=i.scaledTo(i.overscaledZ-1);const o=this._tiles[i.key];if(o&&o.hasData()&&t[i.key]){r[e]=n.tileID;break}}}for(const t in e)r[t]||(this._coveredTiles[t]=!0,r[t]=e[t])}for(const e in r)this._tiles[e].clearFadeHold();const o=function(e,t){const n=[];for(const i in e)i in t||n.push(i);return n}(this._tiles,r);for(const e of o){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(+e)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const t={};if(0===e.length)return t;const n={},i=e.reduce(((e,t)=>Math.min(e,t.overscaledZ)),1/0),r=e[0].overscaledZ,o=Math.max(r-Qp.maxOverzooming,this._source.minzoom),a=Math.max(r+Qp.maxUnderzooming,this._source.minzoom),s={};for(const n of e){const e=this._addTile(n);t[n.key]=n,e.hasData()||i<this._source.maxzoom&&(s[n.key]=n)}this._retainLoadedChildren(s,i,a,t);for(const i of e){let e=this._tiles[i.key];if(e.hasData())continue;if(i.canonical.z>=this._source.maxzoom){const e=i.children(this._source.maxzoom)[0],n=this.getTile(e);if(n&&n.hasData()){t[e.key]=e;continue}}else{const e=i.children(this._source.maxzoom);if(t[e[0].key]&&t[e[1].key]&&t[e[2].key]&&t[e[3].key])continue}let r=e.wasRequested();for(let a=i.overscaledZ-1;a>=o;--a){const o=i.scaledTo(a);if(n[o.key])break;if(n[o.key]=!0,e=this.getTile(o),!e&&r&&(e=this._addTile(o)),e&&(t[o.key]=o,r=e.wasRequested(),e.hasData()))break}}return t}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let n,i=this._tiles[e].tileID;for(;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){n=this._loadedParentTiles[i.key];break}t.push(i.key);const e=i.scaledTo(i.overscaledZ-1);if(n=this._getLoadedTile(e),n)break;i=e}for(const e of t)this._loadedParentTiles[e]=n}}_addTile(e){let t=this._tiles[e.key];if(t)return t;t=this._cache.getAndRemove(e),t&&(this._setTileReloadTimer(e.key,t),t.tileID=e,this._state.initializeTileState(t,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,t)));const n=Boolean(t);if(!n){const n=this.map?this.map.painter:null;t=new zp(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,n,this._isRaster),this._loadTile(t,this._tileLoaded.bind(this,t,e.key,t.state))}return t?(t.uses++,this._tiles[e.key]=t,n||this._source.fire(new Ze("dataloading",{tile:t,coord:t.tileID,dataType:"source"})),t):null}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const n=t.getExpiryTimeout();n&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),n))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,t,n){const i=[],r=this.transform;if(!r)return i;const o="globe"===r.projection.name,a=ks(r.center.lng);for(const s in this._tiles){const l=this._tiles[s];if(n&&l.clearQueryDebugViz(),l.holdingForFade())continue;let c;if(o){const e=l.tileID.canonical;if(0===e.z){const t=[Math.abs(T(a,...nm(e,-1))-a),Math.abs(T(a,...nm(e,1))-a)];c=[0,2*t.indexOf(Math.min(...t))-1]}else{const t=[Math.abs(T(a,...nm(e,-1))-a),Math.abs(T(a,...nm(e,0))-a),Math.abs(T(a,...nm(e,1))-a)];c=[t.indexOf(Math.min(...t))-1]}}else c=[0];for(const n of c){const o=e.containsTile(l,r,t,n);o&&i.push(o)}}return i}getVisibleCoordinates(e){const t=this.getRenderableIds(e).map((e=>this._tiles[e].tileID));for(const e of t)e.projMatrix=this.transform.calculateProjMatrix(e.toUnwrapped());return t}hasTransition(){if(this._source.hasTransition())return!0;if(tm(this._source.type))for(const e in this._tiles){const t=this._tiles[e];if(void 0!==t.fadeEndTime&&t.fadeEndTime>=qe.now())return!0}return!1}setFeatureState(e,t,n){this._state.updateState(e=e||"_geojsonTileLayer",t,n)}removeFeatureState(e,t,n){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,n)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,n){const i=this._tiles[e];i&&i.setDependencies(t,n)}reloadTilesForDependencies(e,t){for(const n in this._tiles)this._tiles[n].hasDependency(e,t)&&this._reloadTile(+n,"reloading");this._cache.filter((n=>!n.hasDependency(e,t)))}_preloadTiles(e,t){const n=new Map,i=Array.isArray(e)?e:[e],r=this.map.painter.terrain,o=this.usedForTerrain&&r?r.getScaledDemTileSize():this._source.tileSize;for(const e of i){const t=e.coveringTiles({tileSize:o,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const e of t)n.set(e.key,e);this.usedForTerrain&&e.updateElevation(!1)}C(Array.from(n.values()),((e,t)=>{const n=new zp(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(n,(e=>{"raster-dem"===this._source.type&&n.dem&&this._backfillDEM(n),t(e,n)}))}),t)}}function em(e,t){const n=Math.abs(2*e.wrap)-+(e.wrap<0),i=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||i-n||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function tm(e){return"raster"===e||"image"===e||"video"===e||"custom"===e}function nm(e,t){const n=1<<e.z;return[e.x/n+t,(e.x+1)/n+t]}Qp.maxOverzooming=10,Qp.maxUnderzooming=3;class im{constructor(e,t,n){this._demTile=e,this._dem=this._demTile.dem,this._scale=t,this._offset=n}static create(e,t,n){const i=n||e.findDEMTileFor(t);if(!i||!i.dem)return;const r=i.dem,o=i.tileID,a=1<<t.canonical.z-o.canonical.z;return new im(i,i.tileSize/ws/a,[(t.canonical.x/a-o.canonical.x)*r.dim,(t.canonical.y/a-o.canonical.y)*r.dim])}tileCoordToPixel(e,t){const n=t*this._scale+this._offset[1],i=Math.floor(e*this._scale+this._offset[0]),r=Math.floor(n);return new p(i,r)}getElevationAt(e,t,n,i){const r=e*this._scale+this._offset[0],o=t*this._scale+this._offset[1],a=Math.floor(r),s=Math.floor(o),l=this._dem;return i=!!i,n?kn(kn(l.get(a,s,i),l.get(a,s+1,i),o-s),kn(l.get(a+1,s,i),l.get(a+1,s+1,i),o-s),r-a):l.get(a,s,i)}getElevationAtPixel(e,t,n){return this._dem.get(e,t,!!n)}getMeterToDEM(e){return(1<<this._demTile.tileID.canonical.z)*Is(1,e)*this._dem.stride}}class rm{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Nr(ws,16,0),this.featureIndexArray=new ja,this.promoteId=t}insert(e,t,n,i,r,o=0){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,r,o);const s=this.grid;for(let e=0;e<t.length;e++){const n=t[e],i=[1/0,1/0,-1/0,-1/0];for(let e=0;e<n.length;e++){const t=n[e];i[0]=Math.min(i[0],t.x),i[1]=Math.min(i[1],t.y),i[2]=Math.max(i[2],t.x),i[3]=Math.max(i[3],t.y)}i[0]<ws&&i[1]<ws&&i[2]>=0&&i[3]>=0&&s.insert(a,i[0],i[1],i[2],i[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new bu(new Eh(this.rawTileData)).layers,this.sourceLayerCoder=new bp(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t,n,i){this.loadVTLayers();const r=e.params||{},o=ar(r.filter),a=e.tileResult,s=e.transform,l=a.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,((e,t,n,i)=>ol(a.bufferedTilespaceGeometry,e,t,n,i)));c.sort(am);let u=null;s.elevation&&c.length>0&&(u=im.create(s.elevation,this.tileID));const h={};let d;for(let s=0;s<c.length;s++){const l=c[s];if(l===d)continue;d=l;const f=this.featureIndexArray.get(l);let p=null;this.loadMatchingFeature(h,f,o,r.layers,r.availableImages,t,n,i,((t,n,i,r=0)=>(p||(p=qs(t,this.tileID.canonical,e.tileTransform)),n.queryIntersectsFeature(a,t,i,p,this.z,e.transform,e.pixelPosMatrix,u,r))))}return h}loadMatchingFeature(e,t,n,i,r,o,a,s,l){const{featureIndex:c,bucketIndex:u,sourceLayerIndex:h,layoutVertexArrayOffset:d}=t,f=this.bucketLayerIDs[u];if(i&&!function(e,t){for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>=0)return!0;return!1}(i,f))return;const p=this.sourceLayerCoder.decode(h),m=this.vtLayers[p].feature(c);if(n.needGeometry){const e=$s(m,!0);if(!n.filter(new Uo(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!n.filter(new Uo(this.tileID.overscaledZ),m))return;const g=this.getId(m,p);for(let t=0;t<f.length;t++){const n=f[t];if(i&&i.indexOf(n)<0)continue;const u=o[n];if(!u)continue;let h={};void 0!==g&&s&&(h=s.getState(u.sourceLayer||"_geojsonTileLayer",g));const p=M({},a[n]);p.paint=om(p.paint,u.paint,m,h,r),p.layout=om(p.layout,u.layout,m,h,r);const _=!l||l(m,u,h,d);if(!_)continue;const y=new Ep(m,this.z,this.x,this.y,g);y.layer=p;let v=e[n];void 0===v&&(v=e[n]=[]),v.push({featureIndex:c,feature:y,intersectionZ:_})}}lookupSymbolFeatures(e,t,n,i,r,o,a,s){const l={};this.loadVTLayers();const c=ar(r);for(const r of e)this.loadMatchingFeature(l,{bucketIndex:n,sourceLayerIndex:i,featureIndex:r,layoutVertexArrayOffset:0},c,o,a,s,t);return l}loadFeature(e){const{featureIndex:t,sourceLayerIndex:n}=e;this.loadVTLayers();const i=this.sourceLayerCoder.decode(n),r=this.vtFeatures[i];if(r[t])return r[t];const o=this.vtLayers[i].feature(t);return r[t]=o,o}hasLayer(e){for(const t of this.bucketLayerIDs)for(const n of t)if(e===n)return!0;return!1}getId(e,t){let n=e.id;if(this.promoteId){const i="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];null!=i&&(n=e.properties[i]),"boolean"==typeof n&&(n=Number(n))}return n}}function om(e,t,n,i,r){return B(e,((e,o)=>{const a=t instanceof Ho?t.get(o):null;return a&&a.evaluate?a.evaluate(n,i,r):a}))}function am(e,t){return t-e}Vr(rm,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});class sm{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.image=new pc({width:e,height:t}),this.positions={},this.uploaded=!1}getDash(e,t){const n=this.getKey(e,t);return this.positions[n]}trim(){const e=this.width,t=this.height=z(this.nextRow);this.image.resize({width:e,height:t})}getKey(e,t){return e.join(",")+t}getDashRanges(e,t,n){const i=[];let r=e.length%2==1?-e[e.length-1]*n:0,o=e[0]*n,a=!0;i.push({left:r,right:o,isDash:a,zeroLength:0===e[0]});let s=e[0];for(let t=1;t<e.length;t++){a=!a;const l=e[t];r=s*n,s+=l,o=s*n,i.push({left:r,right:o,isDash:a,zeroLength:0===l})}return i}addRoundDash(e,t,n){const i=t/2;for(let t=-n;t<=n;t++){const r=this.width*(this.nextRow+n+t);let o=0,a=e[o];for(let s=0;s<this.width;s++){s/a.right>1&&(a=e[++o]);const l=Math.abs(s-a.left),c=Math.abs(s-a.right),u=Math.min(l,c);let h;const d=t/n*(i+1);if(a.isDash){const e=i-Math.abs(d);h=Math.sqrt(u*u+e*e)}else h=i-Math.sqrt(u*u+d*d);this.image.data[r+s]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const n=e[t],i=e[t+1];n.zeroLength?e.splice(t,1):i&&i.isDash===n.isDash&&(i.left=n.left,e.splice(t,1))}const n=e[0],i=e[e.length-1];n.isDash===i.isDash&&(n.left=i.left-this.width,i.right=n.right+this.width);const r=this.width*this.nextRow;let o=0,a=e[o];for(let n=0;n<this.width;n++){n/a.right>1&&(a=e[++o]);const i=Math.abs(n-a.left),s=Math.abs(n-a.right),l=Math.min(i,s);this.image.data[r+n]=Math.max(0,Math.min(255,(a.isDash?l:-l)+t+128))}}addDash(e,t){const n=this.getKey(e,t);if(this.positions[n])return this.positions[n];const i="round"===t,r=i?7:0,o=2*r+1;if(this.nextRow+o>this.height)return U("LineAtlas out of space"),null;0===e.length&&e.push(1);let a=0;for(let t=0;t<e.length;t++)e[t]<0&&(U("Negative value is found in line dasharray, replacing values with 0"),e[t]=0),a+=e[t];if(0!==a){const n=this.width/a,o=this.getDashRanges(e,this.width,n);i?this.addRoundDash(o,n,r):this.addRegularDash(o,"square"===t?.5*n:0)}const s=this.nextRow+r;this.nextRow+=o;const l={tl:[s,r],br:[a,0]};return this.positions[n]=l,l}}Vr(sm,"LineAtlas");class lm{constructor(e){const t={},n=[];for(const i in e){const r=e[i],o=t[i]={};for(const e in r.glyphs){const t=r.glyphs[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const i=t.metrics.localGlyph?2:1,a={x:0,y:0,w:t.bitmap.width+2*i,h:t.bitmap.height+2*i};n.push(a),o[e]=a}}const{w:i,h:r}=Xh(n),o=new pc({width:i||1,height:r||1});for(const n in e){const i=e[n];for(const e in i.glyphs){const r=i.glyphs[+e];if(!r||0===r.bitmap.width||0===r.bitmap.height)continue;const a=t[n][e],s=r.metrics.localGlyph?2:1;pc.copy(r.bitmap,o,{x:0,y:0},{x:a.x+s,y:a.y+s},r.bitmap)}}this.image=o,this.positions=t}}Vr(lm,"GlyphAtlas");class cm{constructor(e){this.tileID=new Gu(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.tileZoom=e.tileZoom,this.uid=e.uid,this.zoom=e.zoom,this.canonical=e.tileID.canonical,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.enableTerrain=!!e.enableTerrain,this.isSymbolTile=e.isSymbolTile,this.tileTransform=Pf(e.tileID.canonical,e.projection),this.projection=e.projection}parse(e,t,n,i,r){this.status="parsing",this.data=e,this.collisionBoxArray=new Da;const o=new bp(Object.keys(e.layers).sort()),a=new rm(this.tileID,this.promoteId);a.bucketLayerIDs=[];const s={},l=new sm(256,256),c={featureIndex:a,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:l,availableImages:n},u=t.familiesBySource[this.source];for(const t in u){const i=e.layers[t];if(!i)continue;let r=!1,l=!1;for(const e of u[t])"symbol"===e[0].type?r=!0:l=!0;if(!0===this.isSymbolTile&&!r)continue;if(!1===this.isSymbolTile&&!l)continue;1===i.version&&U(`Vector tile source "${this.source}" layer "${t}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const h=o.encode(t),d=[];for(let e=0;e<i.length;e++){const n=i.feature(e),r=a.getId(n,t);d.push({feature:n,id:r,index:e,sourceLayerIndex:h})}for(const e of u[t]){const t=e[0];void 0!==this.isSymbolTile&&"symbol"===t.type!==this.isSymbolTile||t.minzoom&&this.zoom<Math.floor(t.minzoom)||t.maxzoom&&this.zoom>=t.maxzoom||"none"!==t.visibility&&(um(e,this.zoom,n),(s[t.id]=t.createBucket({index:a.bucketLayerIDs.length,layers:e,zoom:this.zoom,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:h,sourceID:this.source,enableTerrain:this.enableTerrain,projection:this.projection.spec,availableImages:n})).populate(d,c,this.tileID.canonical,this.tileTransform),a.bucketLayerIDs.push(e.map((e=>e.id))))}}let h,d,f,p;l.trim();const m={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},g=B(c.glyphDependencies,(e=>Object.keys(e).map(Number)));Object.keys(g).length?i.send("getGlyphs",{uid:this.uid,stacks:g},((e,t)=>{h||(h=e,d=t,v.call(this))}),void 0,!1,m):d={};const _=Object.keys(c.iconDependencies);_.length?i.send("getImages",{icons:_,source:this.source,tileID:this.tileID,type:"icons"},((e,t)=>{h||(h=e,f=t,v.call(this))}),void 0,!1,m):f={};const y=Object.keys(c.patternDependencies);function v(){if(h)return r(h);if(d&&f&&p){const e=new lm(d),t=new Yh(f,p);for(const i in s){const r=s[i];r instanceof sp?(um(r.layers,this.zoom,n),jd(r,d,e.positions,f,t.iconPositions,this.showCollisionBoxes,n,this.tileID.canonical,this.tileZoom,this.projection)):r.hasPattern&&(r instanceof th||r instanceof nu||r instanceof Mu)&&(um(r.layers,this.zoom,n),r.addFeatures(c,this.tileID.canonical,t.patternPositions,n,this.tileTransform))}this.status="done",r(null,{buckets:k(s).filter((e=>!e.isEmpty())),featureIndex:a,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,lineAtlas:l,imageAtlas:t,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?e.positions:null})}}y.length?i.send("getImages",{icons:y,source:this.source,tileID:this.tileID,type:"patterns"},((e,t)=>{h||(h=e,p=t,v.call(this))}),void 0,!1,m):p={},v.call(this)}}function um(e,t,n){const i=new Uo(t);for(const t of e)t.recalculate(i,n)}class hm{constructor(e){this.entries={},this.scheduler=e}request(e,t,n,i){const r=this.entries[e]=this.entries[e]||{callbacks:[]};if(r.result){const[e,n]=r.result;return this.scheduler?this.scheduler.add((()=>{i(e,n)}),t):i(e,n),()=>{}}return r.callbacks.push(i),r.cancel||(r.cancel=n(((n,i)=>{r.result=[n,i];for(const e of r.callbacks)this.scheduler?this.scheduler.add((()=>{e(n,i)}),t):e(n,i);setTimeout((()=>delete this.entries[e]),3e3)}))),()=>{r.result||(r.callbacks=r.callbacks.filter((e=>e!==i)),r.callbacks.length||(r.cancel(),delete this.entries[e]))}}}function dm(e,t,n){const i=JSON.stringify(e.request);return e.data&&(this.deduped.entries[i]={result:[null,e.data]}),this.deduped.request(i,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom},(t=>{const i=ce(e.request,((e,i,r,o)=>{e?t(e):i&&t(null,{vectorTile:n?void 0:new bu(new Eh(i)),rawData:i,cacheControl:r,expires:o})}));return()=>{i.cancel(),t()}}),t)}e.ARRAY_TYPE=pl,e.AUTH_ERR_MSG=me,e.Aabb=rc,e.Actor=class{constructor(e,n,i){this.target=e,this.parent=n,this.mapId=i,this.callbacks={},this.cancelCallbacks={},O(["receive"],this),this.target.addEventListener("message",this.receive,!1),this.globalScope=q()?e:t,this.scheduler=new xp}send(e,t,n,i,r=!1,o){const a=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(n.metadata=o,this.callbacks[a]=n);const s=Z(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:e,hasCallback:!!n,targetMapId:i,mustQueue:r,sourceMapId:this.mapId,data:$r(t,s)},s),{cancel:()=>{n&&delete this.callbacks[a],this.target.postMessage({id:a,type:"<cancel>",targetMapId:i,sourceMapId:this.mapId})}}}receive(e){const t=e.data,n=t.id;if(n&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){const e=this.cancelCallbacks[n];delete this.cancelCallbacks[n],e&&e.cancel()}else if(t.mustQueue||q()){const e=this.callbacks[n];this.cancelCallbacks[n]=this.scheduler.add((()=>this.processTask(n,t)),e&&e.metadata||{type:"message"})}else this.processTask(n,t)}processTask(e,t){if("<response>"===t.type){const n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(Wr(t.error)):n(null,Wr(t.data)))}else{const n=Z(this.globalScope)?void 0:[],i=t.hasCallback?(t,i)=>{delete this.cancelCallbacks[e],this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?$r(t):null,data:$r(i,n)},n)}:e=>{},r=Wr(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,r,i);else if(this.parent.getWorkerSource){const e=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,e[0],r.source)[e[1]](r,i)}else i(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}},e.CanonicalTileID=Uu,e.Color=Ct,e.ColorMode=Hp,e.CullFaceMode=Jp,e.DEMData=qp,e.DataConstantProperty=Yo,e.DedupedRequest=hm,e.DepthMode=Wp,e.EXTENT=ws,e.Elevation=class{isDataAvailableAtPoint(e){const t=this._source();if(this.isUsingMockSource()||!t||e.y<0||e.y>1)return!1;const n=t.getSource().maxzoom,i=1<<n,r=Math.floor(e.x),o=Math.floor((e.x-r)*i),a=Math.floor(e.y*i),s=this.findDEMTileFor(new Gu(n,r,n,o,a));return!(!s||!s.dem)}getAtPointOrZero(e,t=0){return this.getAtPoint(e,t)||0}getAtPoint(e,t,n=!0){if(this.isUsingMockSource())return null;null==t&&(t=null);const i=this._source();if(!i)return t;if(e.y<0||e.y>1)return t;const r=i.getSource().maxzoom,o=1<<r,a=Math.floor(e.x),s=e.x-a,l=new Gu(r,a,r,Math.floor(s*o),Math.floor(e.y*o)),c=this.findDEMTileFor(l);if(!c||!c.dem)return t;const u=c.dem,h=1<<c.tileID.canonical.z,d=(s*h-c.tileID.canonical.x)*u.dim,f=(e.y*h-c.tileID.canonical.y)*u.dim,p=Math.floor(d),m=Math.floor(f);return(n?this.exaggeration():1)*kn(kn(u.get(p,m),u.get(p,m+1),f-m),kn(u.get(p+1,m),u.get(p+1,m+1),f-m),d-p)}getAtTileOffset(e,t,n){const i=1<<e.canonical.z;return this.getAtPointOrZero(new Rs(e.wrap+(e.canonical.x+t/ws)/i,(e.canonical.y+n/ws)/i))}getAtTileOffsetFunc(e,t,n,i){return r=>{const o=this.getAtTileOffset(e,r.x,r.y),a=i.upVector(e.canonical,r.x,r.y);return Rl(a,a,o*i.upVectorScale(e.canonical,t,n).metersToTile),a}}getForTilePoints(e,t,n,i){if(this.isUsingMockSource())return!1;const r=im.create(this,e,i);return!!r&&(t.forEach((e=>{e[2]=this.exaggeration()*r.getElevationAt(e[0],e[1],n)})),!0)}getMinMaxForTile(e){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(e);if(!t||!t.dem)return null;const n=t.dem.tree,i=t.tileID,r=1<<e.canonical.z-i.canonical.z;let o=e.canonical.x/r-i.canonical.x,a=e.canonical.y/r-i.canonical.y,s=0;for(let t=0;t<e.canonical.z-i.canonical.z&&!n.leaves[s];t++){o*=2,a*=2;const e=2*Math.floor(a)+Math.floor(o);s=n.childOffsets[s]+e,o%=1,a%=1}return{min:this.exaggeration()*n.minimums[s],max:this.exaggeration()*n.maximums[s]}}getMinElevationBelowMSL(){throw new Error("Pure virtual method called.")}raycast(e,t,n){throw new Error("Pure virtual method called.")}pointCoordinate(e){throw new Error("Pure virtual method called.")}_source(){throw new Error("Pure virtual method called.")}isUsingMockSource(){throw new Error("Pure virtual method called.")}exaggeration(){throw new Error("Pure virtual method called.")}findDEMTileFor(e){throw new Error("Pure virtual method called.")}get visibleDemTiles(){throw new Error("Getter must be implemented in subclass.")}},e.ErrorEvent=Xe,e.EvaluationParameters=Uo,e.Event=Ze,e.Evented=He,e.FillExtrusionBucket=Mu,e.Frustum=ic,e.FrustumCorners=nc,e.GLOBE_METERS_TO_ECEF=ef,e.GLOBE_RADIUS=Qd,e.GLOBE_SCALE_MATCH_LATITUDE=45,e.GLOBE_ZOOM_THRESHOLD_MAX=6,e.GLOBE_ZOOM_THRESHOLD_MIN=5,e.GlobeSharedBuffers=class{constructor(e){this._createGrid(e),this._createPoles(e)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const e of this._poleSegments)e.destroy();for(const e of this._gridSegments)e.destroy();if(this._wireframeIndexBuffer){this._wireframeIndexBuffer.destroy();for(const e of this._wireframeSegments)e.destroy()}}_createGrid(e){const t=new aa,n=new wa,i=65;for(let e=0;e<i;e++)for(let n=0;n<i;n++)t.emplaceBack(n,e);this._gridSegments=[];for(let e=0,t=0;e<nf.length;e++){const r=nf[e];for(let e=0;e<r;e++)for(let t=0;t<64;t++){const r=e*i+t;n.emplaceBack(r+1,r,r+i),n.emplaceBack(r+i,r+i+1,r+1)}const o=64*r*2;this._gridSegments.push(bs.simpleSegment(0,t,(r+1)*i,o)),t+=o}this._gridBuffer=e.createVertexBuffer(t,Jd.members),this._gridIndexBuffer=e.createIndexBuffer(n,!0)}_createPoles(e){const t=new wa;for(let e=0;e<=tf;e++)t.emplaceBack(0,e+1,e+2);this._poleIndexBuffer=e.createIndexBuffer(t,!0);const n=new Aa,i=new Aa;this._poleSegments=[];for(let e=0,t=0;e<5;e++){const r=360/(1<<e);n.emplaceBack(0,-Qd,0,.5,0),i.emplaceBack(0,-Qd,0,.5,1);for(let e=0;e<=tf;e++){const t=e/tf,o=kn(0,r,t),[a,s,l]=gf(kf,Mf,o,Qd);n.emplaceBack(a,s,l,t,0),i.emplaceBack(a,s,l,t,1)}this._poleSegments.push(bs.simpleSegment(t,0,66,64)),t+=66}this._poleNorthVertexBuffer=e.createVertexBuffer(n,Yd,!1),this._poleSouthVertexBuffer=e.createVertexBuffer(i,Yd,!1)}getGridBuffers(e){return[this._gridBuffer,this._gridIndexBuffer,this._gridSegments[e]]}getPoleBuffers(e){return[this._poleNorthVertexBuffer,this._poleSouthVertexBuffer,this._poleIndexBuffer,this._poleSegments[e]]}getWirefameBuffers(e,t){if(!this._wireframeSegments){const t=new ka,n=tf,i=n+1;this._wireframeSegments=[];for(let e=0,r=0;e<nf.length;e++){const o=nf[e];for(let e=0;e<o;e++)for(let r=0;r<n;r++){const n=e*i+r;t.emplaceBack(n,n+1),t.emplaceBack(n,n+i),t.emplaceBack(n,n+i+1)}const a=o*n*3;this._wireframeSegments.push(bs.simpleSegment(0,r,(o+1)*i,a)),r+=a}this._wireframeIndexBuffer=e.createIndexBuffer(t)}return[this._gridBuffer,this._wireframeIndexBuffer,this._wireframeSegments[t]]}},e.GlyphManager=Sd,e.ImagePosition=Hh,e.LivePerformanceUtils=Re,e.LngLat=Ss,e.LngLatBounds=Es,e.LocalGlyphMode=Td,e.MAX_MERCATOR_LATITUDE=Ls,e.MercatorCoordinate=Rs,e.ONE_EM=fh,e.OverscaledTileID=Gu,e.PerformanceMarkers=Oe,e.Properties=Qo,e.RGBAImage=mc,e.Ray=tc,e.RequestManager=class{constructor(e,t,n){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!n,this._createSkuToken()}_createSkuToken(){const e=function(){let e="";for(let t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",h,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeStyleURL(e,t){if(!ge(e))return e;const n=we(e);return n.path=`/styles/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||t)}normalizeGlyphsURL(e,t){if(!ge(e))return e;const n=we(e);return n.path=`/fonts/v1${n.path}`,this._makeAPIURL(n,this._customAccessToken||t)}normalizeSourceURL(e,t,n,i){if(!ge(e))return e;const r=we(e);return r.path=`/v4/${r.authority}.json`,r.params.push("secure"),n&&r.params.push(`language=${n}`),i&&r.params.push(`worldview=${i}`),this._makeAPIURL(r,this._customAccessToken||t)}normalizeSpriteURL(e,t,n,i){const r=we(e);return ge(e)?(r.path=`/styles/v1${r.path}/sprite${t}${n}`,this._makeAPIURL(r,this._customAccessToken||i)):(r.path+=`${t}${n}`,Ee(r))}normalizeTileURL(e,t,n){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!ge(e))return e;const i=we(e);i.path=i.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${t||n&&"raster"!==i.authority&&512===n?"@2x":""}${o.supported?".webp":"$1"}`),"raster"===i.authority?i.path=`/${r.RASTER_URL_PREFIX}${i.path}`:(i.path=i.path.replace(/^.+\/v4\//,"/"),i.path=`/${r.TILE_URL_VERSION}${i.path}`);const a=this._customAccessToken||function(e){for(const t of e){const e=t.match(/^access_token=(.*)$/);if(e)return e[1]}return null}(i.params)||r.ACCESS_TOKEN;return r.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&i.params.push(`sku=${this._skuToken}`),this._makeAPIURL(i,a)}canonicalizeTileURL(e,t){const n=we(e);if(!n.path.match(/^(\/v4\/|\/raster\/v1\/)/)||!n.path.match(/\.[\w]+$/))return e;let i="mapbox://";n.path.match(/^\/raster\/v1\//)?i+=`raster/${n.path.replace(`/${r.RASTER_URL_PREFIX}/`,"")}`:i+=`tiles/${n.path.replace(`/${r.TILE_URL_VERSION}/`,"")}`;let o=n.params;return t&&(o=o.filter((e=>!e.match(/^access_token=/)))),o.length&&(i+=`?${o.join("&")}`),i}canonicalizeTileset(e,t){const n=!!t&&ge(t),i=[];for(const t of e.tiles||[])_e(t)?i.push(this.canonicalizeTileURL(t,n)):i.push(t);return i}_makeAPIURL(e,t){const n="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",i=we(r.API_URL);if(e.protocol=i.protocol,e.authority=i.authority,"http"===e.protocol){const t=e.params.indexOf("secure");t>=0&&e.params.splice(t,1)}if("/"!==i.path&&(e.path=`${i.path}${e.path}`),!r.REQUIRE_ACCESS_TOKEN)return Ee(e);if(t=t||r.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${n}`);if("s"===t[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${n}`)}return e.params=e.params.filter((e=>-1===e.indexOf("access_token"))),e.params.push(`access_token=${t||""}`),Ee(e)}},e.ResourceType=oe,e.SegmentVector=bs,e.SourceCache=Qp,e.StencilMode=Xp,e.StructArrayLayout1ui2=Ma,e.StructArrayLayout2f1f2i16=va,e.StructArrayLayout2i4=aa,e.StructArrayLayout2ui4=ka,e.StructArrayLayout3f12=ba,e.StructArrayLayout3ui6=wa,e.StructArrayLayout4i8=la,e.StructArrayLayout5f20=Aa,e.Texture=yp,e.Tile=zp,e.Transitionable=qo,e.Uniform1f=Ja,e.Uniform1i=class extends K
2a{constructor(e){super(e),this.current=0}set(e,t,n){this.fetchUniformLocation(e,t)&&this.current!==n&&(this.current=n,this.gl.uniform1i(this.location,n))}},e.Uniform2f=class extends Ka{constructor(e){super(e),this.current=[0,0]}set(e,t,n){this.fetchUniformLocation(e,t)&&(n[0]===this.current[0]&&n[1]===this.current[1]||(this.current=n,this.gl.uniform2f(this.location,n[0],n[1])))}},e.Uniform3f=class extends Ka{constructor(e){super(e),this.current=[0,0,0]}set(e,t,n){this.fetchUniformLocation(e,t)&&(n[0]===this.current[0]&&n[1]===this.current[1]&&n[2]===this.current[2]||(this.current=n,this.gl.uniform3f(this.location,n[0],n[1],n[2])))}},e.Uniform4f=Qa,e.UniformColor=es,e.UniformMatrix2f=class extends Ka{constructor(e){super(e),this.current=is}set(e,t,n){if(this.fetchUniformLocation(e,t))for(let e=0;e<4;e++)if(n[e]!==this.current[e]){this.current=n,this.gl.uniformMatrix2fv(this.location,!1,n);break}}},e.UniformMatrix3f=class extends Ka{constructor(e){super(e),this.current=ns}set(e,t,n){if(this.fetchUniformLocation(e,t))for(let e=0;e<9;e++)if(n[e]!==this.current[e]){this.current=n,this.gl.uniformMatrix3fv(this.location,!1,n);break}}}
vendor: 6,103 bytes, line 2
2,e.UniformMatrix4f=class extends Ka{constructor(e){super(e),this.current=ts}set(e,t,n){if(this.fetchUniformLocation(e,t)){if(n[12]!==this.current[12]||n[0]!==this.current[0])return this.current=n,void this.gl.uniformMatrix4fv(this.location,!1,n);for(let e=1;e<16;e++)if(n[e]!==this.current[e]){this.current=n,this.gl.uniformMatrix4fv(this.location,!1,n);break}}}},e.UnwrappedTileID=Vu,e.ValidationError=Ki,e.VectorTileFeature=wu,e.VectorTileWorkerSource=class extends He{constructor(e,t,n,i,r){super(),this.actor=e,this.layerIndex=t,this.availableImages=n,this.loadVectorData=r||dm,this.loading={},this.loaded={},this.deduped=new hm(e.scheduler),this.isSpriteLoaded=i,this.scheduler=e.scheduler}loadTile(e,t){const n=e.uid,i=e&&e.request,r=i&&i.collectResourceTiming,o=this.loading[n]=new cm(e);o.abort=this.loadVectorData(e,((a,s)=>{const l=!this.loading[n];if(delete this.loading[n],l||a||!s)return o.status="done",l||(this.loaded[n]=o),t(a);const c=s.rawData,u={};s.expires&&(u.expires=s.expires),s.cacheControl&&(u.cacheControl=s.cacheControl),o.vectorTile=s.vectorTile||new bu(new Eh(c));const h=()=>{o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,((e,n)=>{if(e||!n)return t(e);const o={};if(r){const e=Ne(i);e.length>0&&(o.resourceTiming=JSON.parse(JSON.stringify(e)))}t(null,M({rawTileData:c.slice(0)},n,u,o))}))};this.isSpriteLoaded?h():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(h,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom}):h()})),this.loaded=this.loaded||{},this.loaded[n]=o}))}reloadTile(e,t){const n=this.loaded,i=e.uid,r=this;if(n&&n[i]){const o=n[i];o.showCollisionBoxes=e.showCollisionBoxes,o.enableTerrain=!!e.enableTerrain,o.projection=e.projection,o.tileTransform=Pf(e.tileID.canonical,e.projection);const a=(e,n)=>{const i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,r.layerIndex,this.availableImages,r.actor,i)),t(e,n)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}}abortTile(e,t){const n=e.uid,i=this.loading[n];i&&(i.abort&&i.abort(),delete this.loading[n]),t()}removeTile(e,t){const n=this.loaded,i=e.uid;n&&n[i]&&delete n[i],t()}},e.WritingMode=Kh,e.add=Pl,e.addDynamicAttributes=ip,e.adjoint=function(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8];return e[0]=a*u-s*c,e[1]=r*c-i*u,e[2]=i*s-r*a,e[3]=s*l-o*u,e[4]=n*u-r*l,e[5]=r*o-n*s,e[6]=o*c-a*l,e[7]=i*l-n*c,e[8]=n*a-i*o,e},e.asyncAll=C,e.bezier=w,e.bindAll=O,e.boundsAttributes=Pp,e.bufferConvexPolygon=function(e,t){const n=[];for(let i=0;i<e.length;i++){const r=A(i-1,-1,e.length-1),o=A(i+1,-1,e.length-1),a=e[i],s=e[o],l=e[r].sub(a).unit(),c=s.sub(a).unit(),u=c.angleWithSep(l.x,l.y),h=l.add(c).unit().mult(-1*t/Math.sin(u/2));n.push(a.add(h))}return n},e.cacheEntryPossiblyAdded=function(e){re++,re>ee&&(e.getActor().send("enforceCacheSizeLimit",Q),re=0)},e.calculateGlobeLabelMatrix=function(e,t){const{x:n,y:i}=e.point,r=Ef(n,i,e.worldSize/e._pixelsPerMercatorPixel,0,0);return vl(r,r,wf(uf(t)))},e.calculateGlobeMatrix=function(e){const{x:t,y:n}=e.point,{lng:i,lat:r}=e._center;return Ef(t,n,e.worldSize,i,r)},e.calculateGlobeMercatorMatrix=function(e){const t=e.pixelsPerMeter,n=t/Is(1,e.center.lat),i=_l(new Float64Array(16));return xl(i,i,[e.point.x,e.point.y,0]),bl(i,i,[n,n,t]),Float32Array.from(i)},e.circumferenceAtLatitude=Cs,e.clamp=T,e.clearTileCache=function(e){if(!te())return;const n=t.caches.delete(Y);e&&n.catch(e).then((()=>e()))},e.clipLine=xd,e.clone=function(e){var t=new pl(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.clone$1=N,e.collisionCircleLayout=dh,e.config=r,e.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},e.create=function(){var e=new pl(16);return pl!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=ml,e.createExpression=$i,e.createLayout=ra,e.createStyleLayer=function(e){return"custom"===e.type?new pp(e):new _p[e.type](e)},e.cross=jl,e.degToRad=y,e.distance=function(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])},e.div=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e},e.dot=Nl,e.earthRadius=Ts,e.ease=E,e.easeCubicInOut=b,e.ecefToLatLng=function([e,t,n]){const i=Math.hypot(e,t,n),r=Math.atan2(e,n),o=.5*Math.PI-Math.acos(-t/i);return new Ss(v(r),v(o))},e.emitValidationErrors=Fr,e.endsWith=R,e.enforceCacheSizeLimit=function(e){ne(),K&&K.then((t=>{t.keys().then((n=>{for(let i=0;i<n.length-e;i++)t.delete(n[i])}))}))},e.evaluateSizeForFeature=gh,e.evaluateSizeForZoom=_h,e.evaluateVariableOffset=Nd,e.evented=Bo,e.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},e.exactEquals$1=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},e.exported=qe,e.exported$1=o,e.extend=M,e.extend$1=Ke,e.fillExtrusionHeightLift=Ru,e.filterObject=F,e.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},e.fromQuat=function(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=n+n,s=i+i,l=r+r,c=n*a,u=i*a,h=i*s,d=r*a,f=r*s,p=r*l,m=o*a,g=o*s,_=o*l;return e[0]=1-h-p,e[1]=u+_,e[2]=d-g,e[3]=0,e[4]=u-_,e[5]=1-c-p,e[6]=f+m,e[7]=0,e[8]=d+g,e[9]=f-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.fromRotation=function(e,t){var n=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=n,e[2]=0,e[3]=-n,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.fromScaling=Tl,e.furthestTileCorner=function(e){const t=Math.round((e+45+360)%360/90)%4;return x[t]},e.getAABBPointSquareDist=function(e,t,n){let i=0;for(let r=0;r<2;++r){const o=n?n[r]:0;e[r]>o&&(i+=(e[r]-o)*(e[r]-o)),t[r]<o&&(i+=(o-t[r])*(o-t[r]))}return i},e.getAnchorAlignment=ld,e.getAnchorJustification=Ud,e.getBounds=function(e){let t=1/0,n=1/0,i=-1/0,r=-1/0;for(const o of e)t=Math.min(t,o.x),n=Math.min(n,o.y),i=Math.max(i,o.x),r=M
2ath.max(r,o.y);return{min:new p(t,n),max:new p(i,r)}},e.getColumn=H,e.getGridMatrix=function(e,t,n,i){const r=t.getNorth(),o=t.getSouth(),a=t.getWest(),s=t.getEast(),l=1<<e.z,c=s-a,u=r-o,h=c/tf,d=-u/nf[n],f=[0,h,0,d,0,0,r,a,0];if(e.z>0){const e=180/i;gl(f,f,[e/c+1,0,0,0,e/u+1,0,-.5*e/h,.5*e/d,1])}return f[2]=l,f[5]=e.x,f[8]=e.y,f},e.getImage=pe,e.getJSON=function(e,t){return le(M(e,{type:"json"}),t)},e.getLatitudinalLod=function(e){const t=80.051129;e=T(e,-80.051129,t)/t*90;const n=Math.pow(Math.abs(Math.sin(y(e))),3);return Math.round(n*(nf.length-1))},e.getMapSessionAPI=ze,e.getPerformanceMeasurement=Ne,e.getProjection=Jf,e.getRTLTextPluginStatus=Fo,e.getReferrer=se,e.getTilePoint=function(e,{x:t,y:n},i=0){return new p(((t-i)*e.scale-e.x)*ws,(n*e.scale-e.y)*ws)},e.getTileVec3=function(e,t,n=0){return Il(((t.x-n)*e.scale-e.x)*ws,(t.y*e.scale-e.y)*ws,zs(t.z,t.y))},e.getVideo=function(e,n){const i=t.document.createElement("video");i.muted=!0,i.onloadstart=function(){n(null,i)};for(let n=0;n<e.length;n++){const r=t.document.createElement("source");ue(e[n])||(i.crossOrigin="Anonymous"),r.src=e[n],i.appendChild(r)}return{cancel:()=>{}}},e.globeCenterToScreenPoint=function(e){const t=[0,0,0],n=_l(new Float64Array(16));return vl(n,e.pixelMatrix,e.globeMatrix),Ul(t,t,n),new p(t[0],t[1])},e.globeDenormalizeECEF=wf,e.globeECEFOrigin=function(e,t){const n=[0,0,0];return Ul(n,n,bf(uf(t.canonical))),Ul(n,n,e),n},e.globeNormalizeECEF=bf,e.globePixelsToTileUnits=function(e,t){return ws/(512*Math.pow(2,e))*vf(uf(t))},e.globePoleMatrixForTile=function(e,t,n){const i=_l(new Float64Array(16)),r=(t/(1<<e)-.5)*Math.PI*2;return El(i,n.globeMatrix,r),Float32Array.from(i)},e.globeTileBounds=uf,e.globeTiltAtLngLat=Sf,e.globeToMercatorTransition=Tf,e.globeUseCustomAntiAliasing=function(e,t,n){const i=Tf(n.zoom),r=e.style.map._antialias,o=!!t.extStandardDerivatives,a=t.extStandardDerivativesForceOff||e.terrain&&e.terrain.exaggeration()>0;return 0===i&&!r&&!a&&o},e.identity=_l,e.identity$1=Kl,e.invert=yl,e.isFullscreen=function(){return!!t.document.fullscreenElement||!!t.document.webkitFullscreenElement},e.isLngLatBehindGlobe=Af,e.isMapAuthenticated=function(e){return Le.has(e)},e.isMapboxURL=ge,e.isSafariWithAntialiasingBug=function(e){const t=e.navigator?e.navigator.userAgent:null;return!!Z(e)&&t&&(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},e.latFromMercatorY=Ds,e.latLngToECEF=_f,e.len=Wl,e.length=Ml,e.length$1=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},e.lngFromMercatorX=Ps,e.loadVectorTile=dm,e.makeRequest=le,e.mapValue=function(e,t,n,i,r){return T((e-t)/(n-t)*(r-i)+i,i,r)},e.mercatorScale=Os,e.mercatorXfromLng=ks,e.mercatorYfromLat=Ms,e.mercatorZfromAltitude=Is,e.mul=Al,e.mul$1=$l,e.multiply=vl,e.multiply$1=gl,e.multiply$2=zl,e.nextPowerOfTwo=z,e.normalize=Fl,e.normalize$1=ec,e.normalize$2=Xl,e.number=kn,e.ortho=function(e,t,n,i,r,o,a){var s=1/(t-n),l=1/(i-r),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*s,e[13]=(r+i)*l,e[14]=(a+o)*c,e[15]=1,e},e.pbf=Eh,e.perspective=function(e,t,n,i,r){var o,a=1/Math.tan(t/2);return e[0]=a/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=r&&r!==1/0?(e[10]=(r+i)*(o=1/(i-r)),e[14]=2*r*i*o):(e[10]=-1,e[14]=-2*i),e},e.pick=function(e,t){const n={};for(let i=0;i<t.length;i++){const r=t[i];r in e&&(n[r]=e[r])}return n},e.plugin=jo,e.pointGeometry=p,e.polesInViewport=function(e){const t=_l(new Float64Array(16));vl(t,e.pixelMatrix,e.globeMatrix);const n=[0,rf,0],i=[0,of,0];return Ul(n,n,t),Ul(i,i,t),[n[0]>0&&n[0]<=e.width&&n[1]>0&&n[1]<=e.height&&!Af(e,new Ss(e.center.lat,90)),i[0]>0&&i[0]<=e.width&&i[1]>0&&i[1]<=e.height&&!Af(e,new Ss(e.center.lat,-90))]},e.polygonContainsPoint=rl,e.polygonIntersectsBox=ol,e.polygonIntersectsPolygon=Hs,e.polygonizeBounds=function(e,t,n=0,i=!0){const r=new p(n,n),o=e.sub(r),a=t.add(r),s=[o,new p(a.x,o.y),a,new p(o.x,a.y)];return i&&s.push(o.clone()),s},e.posAttributes=Jd,e.postMapLoadEvent=Me,e.postPerformanceEvent=Pe,e.postTurnstileEvent=Ce,e.potpack=Xh,e.prevPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},e.radToDeg=v,e.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.registerForPluginStateChange=function(e){return e({pluginStatus:zo,pluginURL:Lo}),Bo.on("pluginStateChange",e),e},e.removeAuthState=function(e){Le.delete(e)},e.renderColorRamp=_c,e.resample=Fs,e.rotateX=wl,e.rotateX$1=Jl,e.rotateY=El,e.rotateY$1=Ql,e.rotateZ=function(e,t,n){var i=Math.sin(n),r=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*r+c*i,e[1]=a*r+u*i,e[2]=s*r+h*i,e[3]=l*r+d*i,e[4]=c*r-o*i,e[5]=u*r-a*i,e[6]=h*r-s*i,e[7]=d*r-l*i,e},e.rotateZ$1=function(e,t,n){n*=.5;var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);return e[0]=i*l+r*s,e[1]=r*l-i*s,e[2]=o*l+a*s,e[3]=a*l-o*s,e},e.scale=bl,e.scale$1=Zl,e.scale$2=Rl,e.scaleAndAdd=Bl,e.set=function(e,t,n,i){return e[0]=t,e[1]=n,e[2]=i,e}
2,e.setCacheLimits=function(e,t){Q=e,ee=t},e.setColumn=function(e,t,n){e[4*t+0]=n[0],e[4*t+1]=n[1],e[4*t+2]=n[2],e[4*t+3]=n[3]},e.setRTLTextPlugin=function(e,t,n=!1){if(zo===Mo||zo===Io||zo===Po)throw new Error("setRTLTextPlugin cannot be called multiple times.");Lo=qe.resolveURL(e),zo=Mo,Do=t,Ro(),n||No()},e.smoothstep=S,e.spec=Ye,e.squaredLength=function(e){var t=e[0],n=e[1],i=e[2];return t*t+n*n+i*i},e.storeAuthState=function(e,t){t?Le.add(e):Le.delete(e)},e.sub=ql,e.subtract=Dl,e.symbolSize=yh,e.tileAABB=function(e,t,n,i,r,o,a,s,l){if("globe"===l.name)return function(e,t,n){const i=t/e.worldSize,r=e.globeMatrix;if(n.z<=1){const e=uf(n).getCorners();return ff(e,r,i),rc.fromPoints(e)}const o=pf(n),a=mf(o);ff(a,r,i);const s=Number.MAX_VALUE,l=[-s,-s,-s],c=[s,s,s];if(o.contains(e.center)){for(const e of a)Ll(c,c,e),Ol(l,l,e);l[2]=0;const t=e.point,n=[t.x*i,t.y*i,0];return Ll(c,c,n),Ol(l,l,n),new rc(c,l)}const u=[r[12]*i,r[13]*i,r[14]*i],h=o.getCenter(),d=T(e.center.lat,-85.051129,Ls),f=T(h.lat,-85.051129,Ls),p=ks(e.center.lng),m=Ms(d);let g=p-ks(h.lng);const _=m-Ms(f);g>.5?g-=1:g<-.5&&(g+=1);let v=0;Math.abs(g)>Math.abs(_)?v=g>=0?1:3:(v=_>=0?0:2,Bl(u,u,[r[4]*i,r[5]*i,r[6]*i],-Math.sin(y(_>=0?o.getSouth():o.getNorth()))*Qd));const x=a[v],b=a[(v+1)%4],w=new lf(x,b,u),E=[cf(w,0)||x[0],cf(w,1)||x[1],cf(w,2)||x[2]],S=Tf(e.zoom);if(S>0){const i=function({x:e,y:t,z:n},i,r,o,a){const s=1/(1<<n);let l=e*s,c=l+s,u=t*s,h=u+s,d=0;const f=(l+c)/2-o;return f>.5?d=-1:f<-.5&&(d=1),l=((l+d)*i-(o*=i))*r+o,c=((c+d)*i-o)*r+o,u=(u*i-(a*=i))*r+a,h=(h*i-a)*r+a,[[l,h,0],[c,h,0],[c,u,0],[l,u,0]]}(n,t,e._pixelsPerMercatorPixel,p,m);for(let e=0;e<a.length;e++)hf(a[e],i[e],S);const r=Pl([],i[v],i[(v+1)%4]);Rl(r,r,.5),hf(E,r,S)}for(const e of a)Ll(c,c,e),Ol(l,l,e);return c[2]=Math.min(x[2],b[2]),Ll(c,c,E),Ol(l,l,E),new rc(c,l)}(e,t,new Uu(n,i,r));const c=Pf({z:n,x:i,y:r},l);return new rc([(o+c.x/c.scale)*t,t*(c.y/c.scale),a],[(o+c.x2/c.scale)*t,t*(c.y2/c.scale),s])},e.tileCornersToBounds=pf,e.tileTransform=Pf,e.transformMat3=function(e,t,n){var i=t[0],r=t[1],o=t[2];return e[0]=i*n[0]+r*n[3]+o*n[6],e[1]=i*n[1]+r*n[4]+o*n[7],e[2]=i*n[2]+r*n[5]+o*n[8],e},e.transformMat4=Ul,e.transformMat4$1=Hl,e.transformQuat=Vl,e.transitionTileAABBinECEF=df,e.translate=xl,e.transpose=function(e,t){if(e===t){var n=t[1],i=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=i,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},e.triggerPluginCompletionEvent=Oo,e.uniqueId=P,e.updateGlobeVertexNormal=function(e,t,n,i,r){const o=5*t+2;e.float32[o+0]=n,e.float32[o+1]=i,e.float32[o+2]=r},e.validateCustomStyleLayer=function(e){const t=[],n=e.id;return void 0===n&&t.push({message:`layers.${n}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${n}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${n}: property "renderingMode" must be either "2d" or "3d"`}),t},e.validateFilter=e=>Br(yr(e)),e.validateFog=e=>Br(Ir(e)),e.validateLayer=e=>Br(Er(e)),e.validateLight=e=>Br(kr(e)),e.validateSource=e=>Br(Ar(e)),e.validateStyle=Lr,e.validateTerrain=e=>Br(Mr(e)),e.values=k,e.vectorTile=cu,e.version=n,e.warnOnce=U,e.window=t,e.wrap=A})),i(0,(function(e){function t(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){let n="[";for(const i of e)n+=`${t(i)},`;return`${n}]`}let n="{";for(const i of Object.keys(e).sort())n+=`${i}:${t(e[i])},`;return`${n}}`}function n(n){let i="";for(const r of e.refProperties)i+=`/${t(n[r])}`;return i}class i{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,i){for(const n of t)this._layerConfigs[n.id]=n,(this._layers[n.id]=e.createStyleLayer(n)).compileFilter(),this.keyCache[n.id]&&delete this.keyCache[n.id];for(const e of i)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const r=function(e,t){const i={};for(let r=0;r<e.length;r++){const o=t&&t[e[r].id]||n(e[r]);t&&(t[e[r].id]=o);let a=i[o];a||(a=i[o]=[]),a.push(e[r])}const r=[];for(const e in i)r.push(i[e]);return r}(e.values(this._layerConfigs),this.keyCache);for(const e of r){const t=e.map((e=>this._layers[e.id])),n=t[0];if("none"===n.visibility)continue;const i=n.source||"";let r=this.familiesBySource[i];r||(r=this.familiesBySource[i]={});const o=n.sourceLayer||"_geojsonTileLayer";let a=r[o];a||(a=r[o]=[]),a.push(t)}}}class r{loadTile(t,n){const{uid:i,encoding:r,rawImageData:o,padding:a,buildQuadTree:s}
vendor: 30,434 bytes, line 2
2=t,l=e.window.ImageBitmap&&o instanceof e.window.ImageBitmap?this.getImageData(o,a):o;n(null,new e.DEMData(i,l,r,a<1,s))}getImageData(e,t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const n=this.offscreenCanvasContext.getImageData(-t,-t,e.width+2*t,e.height+2*t);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),n}}var o=function e(t,n){var i,r=t&&t.type;if("FeatureCollection"===r)for(i=0;i<t.features.length;i++)e(t.features[i],n);else if("GeometryCollection"===r)for(i=0;i<t.geometries.length;i++)e(t.geometries[i],n);else if("Feature"===r)e(t.geometry,n);else if("Polygon"===r)a(t.coordinates,n);else if("MultiPolygon"===r)for(i=0;i<t.coordinates.length;i++)a(t.coordinates[i],n);return t};function a(e,t){if(0!==e.length){s(e[0],t);for(var n=1;n<e.length;n++)s(e[n],!t)}}function s(e,t){for(var n=0,i=0,r=0,o=e.length,a=o-1;r<o;a=r++){var s=(e[r][0]-e[a][0])*(e[a][1]+e[r][1]),l=n+s;i+=Math.abs(n)>=Math.abs(s)?n-l+s:s-l+n,n=l}n+i>=0!=!!t&&e.reverse()}const l=e.VectorTileFeature.prototype.toGeoJSON;class c{constructor(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const n of this._feature.geometry)t.push([new e.pointGeometry(n[0],n[1])]);return t}{const t=[];for(const n of this._feature.geometry){const i=[];for(const t of n)i.push(new e.pointGeometry(t[0],t[1]));t.push(i)}return t}}toGeoJSON(e,t,n){return l.call(this,e,t,n)}}class u{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t}feature(e){return new c(this._features[e])}}var h={exports:{}},d=e.pointGeometry,f=e.vectorTile.VectorTileFeature,p=m;function m(e,t){this.options=t||{},this.features=e,this.length=e.length}function g(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}m.prototype.feature=function(e){return new g(this.features[e],this.options.extent)},g.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var n=e[t],i=[],r=0;r<n.length;r++)i.push(new d(n[r][0],n[r][1]));this.geometry.push(i)}return this.geometry},g.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,n=-1/0,i=1/0,r=-1/0,o=0;o<e.length;o++)for(var a=e[o],s=0;s<a.length;s++){var l=a[s];t=Math.min(t,l.x),n=Math.max(n,l.x),i=Math.min(i,l.y),r=Math.max(r,l.y)}return[t,i,n,r]},g.prototype.toGeoJSON=f.prototype.toGeoJSON;var _=e.pbf,y=p;function v(e){var t=new _;return function(e,t){for(var n in e.layers)t.writeMessage(3,x,e.layers[n])}(e,t),t.finish()}function x(e,t){var n;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(n=0;n<e.length;n++)i.feature=e.feature(n),t.writeMessage(2,b,i);var r=i.keys;for(n=0;n<r.length;n++)t.writeStringField(3,r[n]);var o=i.values;for(n=0;n<o.length;n++)t.writeMessage(4,A,o[n])}function b(e,t){var n=e.feature;void 0!==n.id&&t.writeVarintField(1,n.id),t.writeMessage(2,w,e),t.writeVarintField(3,n.type),t.writeMessage(4,S,n)}function w(e,t){var n=e.feature,i=e.keys,r=e.values,o=e.keycache,a=e.valuecache;for(var s in n.properties){var l=n.properties[s],c=o[s];if(null!==l){void 0===c&&(i.push(s),o[s]=c=i.length-1),t.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var h=u+":"+l,d=a[h];void 0===d&&(r.push(l),a[h]=d=r.length-1),t.writeVarint(d)}}}function E(e,t){return(t<<3)+(7&e)}function T(e){return e<<1^e>>31}function S(e,t){for(var n=e.loadGeometry(),i=e.type,r=0,o=0,a=n.length,s=0;s<a;s++){var l=n[s],c=1;1===i&&(c=l.length),t.writeVarint(E(1,c));for(var u=3===i?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==i&&t.writeVarint(E(2,u-1));var d=l[h].x-r,f=l[h].y-o;t.writeVarint(T(d)),t.writeVarint(T(f)),r+=d,o+=f}3===i&&t.writeVarint(E(7,1))}}function A(e,t){var n=typeof e;"string"===n?t.writeStringField(1,e):"boolean"===n?t.writeBooleanField(7,e):"number"===n&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}function C(e,t,n,i,r,o){if(r-i<=n)return;const a=i+r>>1;k(e,t,a,i,r,o%2),C(e,t,n,i,a-1,o+1),C(e,t,n,a+1,r,o+1)}function k(e,t,n,i,r,o){for(;r>i;){if(r-i>600){const a=r-i+1,s=n-i+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);k(e,t,n,Math.max(i,Math.floor(n-s*c/a+u)),Math.min(r,Math.floor(n+(a-s)*c/a+u)),o)}const a=t[2*n+o];let s=i,l=r;for(M(e,t,i,n),t[2*r+o]>a&&M(e,t,i,r);s<l;){for(M(e,t,s,l),s++,l--;t[2*s+o]<a;)s++;for(;t[2*l+o]>a;)l--}t[2*i+o]===a?M(e,t,i,l):(l++,M(e,t,l,r)),l<=n&&(i=l+1),n<=l&&(r=l-1)}}function M(e,t,n,i){I(e,n,i),I(t,2*n,2*i),I(t,2*n+1,2*i+1)}function I(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function P(e,t,n,i){const r=e-n,o=t-i;return r*r+o*o}h.exports=v,h.exports.fromVectorTileJs=v,h.exports.fromGeojsonVt=function(e,t){t=t||{};var n={};for(var i in e)n[i]=new y(e[i].features,t),n[i].name=i,n[i].version=t.version,n[i].extent=t.extent;return v({layers:n})},h.exports.GeoJSONWrapper=y;const D=e=>e[0],z=e=>e[1];class L{constructor(e,t=D,n=z,i=64,r=Float64Array){this.nodeSize=i,this.points=e;const o=e.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(e.length),s=this.coords=new r(2*e.length);for(let i=0;i<e.length;i++)a[i]=i,s[2*i]=t(e[i]),s[2*i+1]=n(e[i]);C(a,s,i,0,a.length-1,0)}range(e,t,n,i){return function(e,t,n,i,r,o,a){const s=[0,e.length-1,0],l=[];let c,u;for(;s.length;){const h=s.pop(),d=s.pop(),f=s.pop();if(d-f<=a){for(let a=f;a<=d;a++)c=t[2*a],u=t[2*a+1],c>=n&&c<=r&&u>=i&&u<=o&&l.push(e[a]);continue}const p=Math.floor((f+d)/2);c=t[2*p],u=t[2*p+1],c>=n&&c<=r&&u>=i&&u<=o&&l.push(e[p]);const m=(h+1)%2;(0===h?n<=c:i<=u)&&(s.push(f),s.push(p-1),s.push(m)),(0===h?r>=c:o>=u)&&(s.push(p+1),s.push(d),s.push(m))}return l}(this.ids,this.coords,e,t,n,i,this.nodeSize)}within(e,t,n){return function(e,t,n,i,r,o){const a=[0,e.length-1,0],s=[],l=r*r;for(;a.length;){const c=a.pop(),u=a.pop(),h=a.pop();if(u-h<=o){for(let r=h;r<=u;r++)P(t[2*r],t[2*r+1],n,i)<=l&&s.push(e[r]);continue}const d=Math.floor((h+u)/2),f=t[2*d],p=t[2*d+1];P(f,p,n,i)<=l&&s.push(e[d]);const m=(c+1)%2;(0===c?n-r<=f:i-r<=p)&&(a.push(h),a.push(d-1),a.push(m)),(0===c?n+r>=f:i+r>=p)&&(a.push(d+1),a.push(u),a.push(m))}return s}(this.ids,this.coords,e,t,n,this.nodeSize)}}const O={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},R=Math.fround||(B=new Float32Array(1),e=>(B[0]=+e,B[0]));var B;class F{constructor(e){this.options=W(Object.create(O),e),this.trees=new Array(this.options.maxZoom+1)}load(e){const{log:t,minZoom:n,maxZoom:i,nodeSize:r}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;let a=[];for(let t=0;t<e.length;t++)e[t].geometry&&a.push(j(e[t],t));this.trees[i+1]=new L(a,Z,X,r,Float32Array),t&&console.timeEnd(o);for(let e=i;e>=n;e--){const n=+Date.now();a=this._cluster(a,e),this.trees[e]=new L(a,Z,X,r,Float32Array),t&&console.log("z%d: %d clusters in %dms",e,a.length,+Date.now()-n)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[1]));let r=180===e[2]?180:((e[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,r=180;else if(n>r){const e=this.getClusters([n,i,180,o],t),a=this.getClusters([-180,i,r,o],t);return e.concat(a)}const a=this.trees[this._limitZoom(t)],s=a.range(G(n),q(o),G(r),q(i)),l=[];for(const e of s){const t=a.points[e];l.push(t.numPoints?U(t):this.points[t.index])}return l}getChildren(e){const t=this._getOriginId(e),n=this._getOriginZoom(e),i="No cluster with the specified id.",r=this.trees[n];if(!r)throw new Error(i);const o=r.points[t];if(!o)throw new Error(i);const a=this.options.radius/(this.options.extent*Math.pow(2,n-1)),s=r.within(o.x,o.y,a),l=[];for(const t of s){const n=r.points[t];n.parentId===e&&l.push(n.numPoints?U(n):this.points[n.index])}if(0===l.length)throw new Error(i);return l}getLeaves(e,t,n){const i=[];return this._appendLeaves(i,e,t=t||10,n=n||0,0),i}getTile(e,t,n){const i=this.trees[this._limitZoom(e)],r=Math.pow(2,e),{extent:o,radius:a}=this.options,s=a/o,l=(n-s)/r,c=(n+1+s)/r,u={features:[]};return this._addTileFeatures(i.range((t-s)/r,l,(t+1+s)/r,c),i.points,t,n,r,u),0===t&&this._addTileFeatures(i.range(1-s/r,l,1,c),i.points,r,n,r,u),t===r-1&&this._addTileFeatures(i.range(0,l,s/r,c),i.points,-1,n,r,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const n=this.getChildren(e);if(t++,1!==n.length)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,i,r){const o=this.getChildren(t);for(const t of o){const o=t.properties;if(o&&o.cluster?r+o.point_count<=i?r+=o.point_count:r=this._appendLeaves(e,o.cluster_id,n,i,r):r<i?r++:e.push(t),e.length===n)break}return r}_addTileFeatures(e,t,n,i,r,o){for(const a of e){const e=t[a],s=e.numPoints;let l,c,u;if(s)l=V(e),c=e.x,u=e.y;else{const t=this.points[e.index];l=t.properties,c=G(t.geometry.coordinates[0]),u=q(t.geometry.coordinates[1])}const h={type:1,geometry:[[Math.round(this.options.extent*(c*r-n)),Math.round(this.options.extent*(u*r-i))]],tags:l};let d;s?d=e.id:this.options.generateId?d=e.index:this.points[e.index].id&&(d=this.points[e.index].id),void 0!==d&&(h.id=d),o.features.push(h)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const n=[],{radius:i,extent:r,reduce:o,minPoints:a}=this.options,s=i/(r*Math.pow(2,t));for(let i=0;i<e.length;i++){const r=e[i];if(r.zoom<=t)continue;r.zoom=t;const l=this.trees[t+1],c=l.within(r.x,r.y,s),u=r.numPoints||1;let h=u;for(const e of c){const n=l.points[e];n.zoom>t&&(h+=n.numPoints||1)}if(h>u&&h>=a){let e=r.x*u,a=r.y*u,s=o&&u>1?this._map(r,!0):null;const d=(i<<5)+(t+1)+this.points.length;for(const n of c){const i=l.points[n];if(i.zoom<=t)continue;i.zoom=t;const c=i.numPoints||1;e+=i.x*c,a+=i.y*c,i.parentId=d,o&&(s||(s=this._map(r,!0)),o(s,this._map(i)))}r.parentId=d,n.push(N(e/h,a/h,d,h,s))}else if(n.push(r),h>1)for(const e of c){const i=l.points[e];i.zoom<=t||(i.zoom=t,n.push(i))}}return n}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t){if(e.numPoints)return t?W({},e.properties):e.properties;const n=this.points[e.index].properties,i=this.options.map(n);return t&&i===n?W({},i):i}}function N(e,t,n,i,r){return{x:R(e),y:R(t),zoom:1/0,id:n,parentId:-1,numPoints:i,properties:r}}function j(e,t){const[n,i]=e.geometry.coordinates;return{x:R(G(n)),y:R(q(i)),zoom:1/0,index:t,parentId:-1}}function U(e){return{type:"Feature",id:e.id,properties:V(e),geometry:{type:"Point",coordinates:[(t=e.x,360*(t-.5)),$(e.y)]}};var t}function V(e){const t=e.numPoints,n=t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?Math.round(t/100)/10+"k":t;return W(W({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:n})}function G(e){return e/360+.5}function q(e){const t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function $(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function W(e,t){for(const n in t)e[n]=t[n];return e}function Z(e){return e.x}function X(e){return e.y}function H(e,t,n,i){for(var r,o=i,a=n-t>>1,s=n-t,l=e[t],c=e[t+1],u=e[n],h=e[n+1],d=t+3;d<n;d+=3){var f=Y(e[d],e[d+1],l,c,u,h);if(f>o)r=d,o=f;else if(f===o){var p=Math.abs(d-a);p<s&&(r=d,s=p)}}o>i&&(r-t>3&&H(e,t,r,i),e[r+2]=o,n-r>3&&H(e,r,n,i))}function Y(e,t,n,i,r,o){var a=r-n,s=o-i;if(0!==a||0!==s){var l=((e-n)*a+(t-i)*s)/(a*a+s*s);l>1?(n=r,i=o):l>0&&(n+=a*l,i+=s*l)}return(a=e-n)*a+(s=t-i)*s}function K(e,t,n,i){var r={id:void 0===e?null:e,type:t,geometry:n,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,n=e.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)J(e,t);else if("Polygon"===n||"MultiLineString"===n)for(var i=0;i<t.length;i++)J(e,t[i]);else if("MultiPolygon"===n)for(i=0;i<t.length;i++)for(var r=0;r<t[i].length;r++)J(e,t[i][r])}(r),r}function J(e,t){for(var n=0;n<t.length;n+=3)e.minX=Math.min(e.minX,t[n]),e.minY=Math.min(e.minY,t[n+1]),e.maxX=Math.max(e.maxX,t[n]),e.maxY=Math.max(e.maxY,t[n+1])}function Q(e,t,n,i){if(t.geometry){var r=t.geometry.coordinates,o=t.geometry.type,a=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2),s=[],l=t.id;if(n.promoteId?l=t.properties[n.promoteId]:n.generateId&&(l=i||0),"Point"===o)ee(r,s);else if("MultiPoint"===o)for(var c=0;c<r.length;c++)ee(r[c],s);else if("LineString"===o)te(r,s,a,!1);else if("MultiLineString"===o){if(n.lineMetrics){for(c=0;c<r.length;c++)te(r[c],s=[],a,!1),e.push(K(l,"LineString",s,t.properties));return}ne(r,s,a,!1)}else if("Polygon"===o)ne(r,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<t.geometry.geometries.length;c++)Q(e,{id:l,geometry:t.geometry.geometries[c],properties:t.properties},n,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<r.length;c++){var u=[];ne(r[c],u,a,!0),s.push(u)}}e.push(K(l,o,s,t.properties))}}function ee(e,t){t.push(ie(e[0])),t.push(re(e[1])),t.push(0)}function te(e,t,n,i){for(var r,o,a=0,s=0;s<e.length;s++){var l=ie(e[s][0]),c=re(e[s][1]);t.push(l),t.push(c),t.push(0),s>0&&(a+=i?(r*c-l*o)/2:Math.sqrt(Math.pow(l-r,2)+Math.pow(c-o,2))),r=l,o=c}var u=t.length-3;t[2]=1,H(t,0,u,n),t[u+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function ne(e,t,n,i){for(var r=0;r<e.length;r++){var o=[];te(e[r],o,n,i),t.push(o)}}function ie(e){return e/360+.5}function re(e){var t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function oe(e,t,n,i,r,o,a,s){if(i/=t,o>=(n/=t)&&a<i)return e;if(a<n||o>=i)return null;for(var l=[],c=0;c<e.length;c++){var u=e[c],h=u.geometry,d=u.type,f=0===r?u.minX:u.minY,p=0===r?u.maxX:u.maxY;if(f>=n&&p<i)l.push(u);else if(!(p<n||f>=i)){var m=[];if("Point"===d||"MultiPoint"===d)ae(h,m,n,i,r);else if("LineString"===d)se(h,m,n,i,r,!1,s.lineMetrics);else if("MultiLineString"===d)ce(h,m,n,i,r,!1);else if("Polygon"===d)ce(h,m,n,i,r,!0);else if("MultiPolygon"===d)for(var g=0;g<h.length;g++){var _=[];ce(h[g],_,n,i,r,!0),_.length&&m.push(_)}if(m.length){if(s.lineMetrics&&"LineString"===d){for(g=0;g<m.length;g++)l.push(K(u.id,d,m[g],u.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===m.length?(d="LineString",m=m[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===m.length?"Point":"MultiPoint"),l.push(K(u.id,d,m,u.tags))}}}return l.length?l:null}function ae(e,t,n,i,r){for(var o=0;o<e.length;o+=3){var a=e[o+r];a>=n&&a<=i&&(t.push(e[o]),t.push(e[o+1]),t.push(e[o+2]))}}function se(e,t,n,i,r,o,a){for(var s,l,c=le(e),u=0===r?he:de,h=e.start,d=0;d<e.length-3;d+=3){var f=e[d],p=e[d+1],m=e[d+2],g=e[d+3],_=e[d+4],y=0===r?f:p,v=0===r?g:_,x=!1;a&&(s=Math.sqrt(Math.pow(f-g,2)+Math.pow(p-_,2))),y<n?v>n&&(l=u(c,f,p,g,_,n),a&&(c.start=h+s*l)):y>i?v<i&&(l=u(c,f,p,g,_,i),a&&(c.start=h+s*l)):ue(c,f,p,m),v<n&&y>=n&&(l=u(c,f,p,g,_,n),x=!0),v>i&&y<=i&&(l=u(c,f,p,g,_,i),x=!0),!o&&x&&(a&&(c.end=h+s*l),t.push(c),c=le(e)),a&&(h+=s)}var b=e.length-3;f=e[b],p=e[b+1],m=e[b+2],(y=0===r?f:p)>=n&&y<=i&&ue(c,f,p,m),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&ue(c,c[0],c[1],c[2]),c.length&&t.push(c)}function le(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function ce(e,t,n,i,r,o){for(var a=0;a<e.length;a++)se(e[a],t,n,i,r,o,!1)}function ue(e,t,n,i){e.push(t),e.push(n),e.push(i)}function he(e,t,n,i,r,o){var a=(o-t)/(i-t);return e.push(o),e.push(n+(r-n)*a),e.push(1),a}function de(e,t,n,i,r,o){var a=(o-n)/(r-n);return e.push(t+(i-t)*a),e.push(o),e.push(1),a}function fe(e,t){for(var n=[],i=0;i<e.length;i++){var r,o=e[i],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)r=pe(o.geometry,t);else if("MultiLineString"===a||"Polygon"===a){r=[];for(var s=0;s<o.geometry.length;s++)r.push(pe(o.geometry[s],t))}else if("MultiPolygon"===a)for(r=[],s=0;s<o.geometry.length;s++){for(var l=[],c=0;c<o.geometry[s].length;c++)l.push(pe(o.geometry[s][c],t));r.push(l)}n.push(K(o.id,a,r,o.tags))}return n}function pe(e,t){var n=[];n.size=e.size,void 0!==e.start&&(n.start=e.start,n.end=e.end);for(var i=0;i<e.length;i+=3)n.push(e[i]+t,e[i+1],e[i+2]);return n}function me(e,t){if(e.transformed)return e;var n,i,r,o=1<<e.z,a=e.x,s=e.y;for(n=0;n<e.features.length;n++){var l=e.features[n],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(i=0;i<c.length;i+=2)l.geometry.push(ge(c[i],c[i+1],t,o,a,s));else for(i=0;i<c.length;i++){var h=[];for(r=0;r<c[i].length;r+=2)h.push(ge(c[i][r],c[i][r+1],t,o,a,s));l.geometry.push(h)}}return e.transformed=!0,e}function ge(e,t,n,i,r,o){return[Math.round(n*(e*i-r)),Math.round(n*(t*i-o))]}function _e(e,t,n,i,r){for(var o=t===r.maxZoom?0:r.tolerance/((1<<t)*r.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:n,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){a.numFeatures++,ye(a,e[s],o,r);var l=e[s].minX,c=e[s].minY,u=e[s].maxX,h=e[s].maxY;l<a.minX&&(a.minX=l),c<a.minY&&(a.minY=c),u>a.maxX&&(a.maxX=u),h>a.maxY&&(a.maxY=h)}return a}function ye(e,t,n,i){var r=t.geometry,o=t.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<r.length;s+=3)a.push(r[s]),a.push(r[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===o)ve(a,r,e,n,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<r.length;s++)ve(a,r[s],e,n,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var l=0;l<r.length;l++){var c=r[l];for(s=0;s<c.length;s++)ve(a,c[s],e,n,!0,0===s)}if(a.length){var u=t.tags||null;if("LineString"===o&&i.lineMetrics){for(var h in u={},t.tags)u[h]=t.tags[h];u.mapbox_clip_start=r.start/r.size,u.mapbox_clip_end=r.end/r.size}var d={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==t.id&&(d.id=t.id),e.features.push(d)}}function ve(e,t,n,i,r,o){var a=i*i;if(i>0&&t.size<(r?a:i))n.numPoints+=t.length/3;else{for(var s=[],l=0;l<t.length;l+=3)(0===i||t[l+2]>a)&&(n.numSimplified++,s.push(t[l]),s.push(t[l+1])),n.numPoints++;r&&function(e,t){for(var n=0,i=0,r=e.length,o=r-2;i<r;o=i,i+=2)n+=(e[i]-e[o])*(e[i+1]+e[o+1]);if(n>0===t)for(i=0,r=e.length;i<r/2;i+=2){var a=e[i],s=e[i+1];e[i]=e[r-2-i],e[i+1]=e[r-1-i],e[r-2-i]=a,e[r-1-i]=s}}(s,o),e.push(s)}}function xe(e,t){var n=(t=this.options=function(e,t){for(var n in t)e[n]=t[n];return e}(Object.create(this.options),t)).debug;if(n&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(e,t){var n=[];if("FeatureCollection"===e.type)for(var i=0;i<e.features.length;i++)Q(n,e.features[i],t,i);else Q(n,"Feature"===e.type?e:{geometry:e},t);return n}(e,t);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=function(e,t){var n=t.buffer/t.extent,i=e,r=oe(e,1,-1-n,n,0,-1,2,t),o=oe(e,1,1-n,2+n,0,-1,2,t);return(r||o)&&(i=oe(e,1,-n,1+n,0,-1,2,t)||[],r&&(i=fe(r,1).concat(i)),o&&(i=i.concat(fe(o,-1)))),i}(i,t),i.length&&this.splitTile(i,0,0,0),n&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function be(e,t,n){return 32*((1<<e)*n+t)+e}function we(e,t){const n=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);const i=this._geoJSONIndex.getTile(n.z,n.x,n.y);if(!i)return t(null,null);const r=new u(i.features);let o=h.exports(r);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),t(null,{vectorTile:r,rawData:o.buffer})}xe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},xe.prototype.splitTile=function(e,t,n,i,r,o,a){for(var s=[e,t,n,i],l=this.options,c=l.debug;s.length;){i=s.pop(),n=s.pop(),t=s.pop(),e=s.pop();var u=1<<t,h=be(t,n,i),d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=_e(e,t,n,i,l),this.tileCoords.push({z:t,x:n,y:i}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,n,i,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var f="z"+t;this.stats[f]=(this.stats[f]||0)+1,this.total++}if(d.source=e,r){if(t===l.maxZoom||t===r)continue;var p=1<<r-t;if(n!==Math.floor(o/p)||i!==Math.floor(a/p))continue}else if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue;if(d.source=null,0!==e.length){c>1&&console.time("clipping");var m,g,_,y,v,x,b=.5*l.buffer/l.extent,w=.5-b,E=.5+b,T=1+b;m=g=_=y=null,v=oe(e,u,n-b,n+E,0,d.minX,d.maxX,l),x=oe(e,u,n+w,n+T,0,d.minX,d.maxX,l),e=null,v&&(m=oe(v,u,i-b,i+E,1,d.minY,d.maxY,l),g=oe(v,u,i+w,i+T,1,d.minY,d.maxY,l),v=null),x&&(_=oe(x,u,i-b,i+E,1,d.minY,d.maxY,l),y=oe(x,u,i+w,i+T,1,d.minY,d.maxY,l),x=null),c>1&&console.timeEnd("clipping"),s.push(m||[],t+1,2*n,2*i),s.push(g||[],t+1,2*n,2*i+1),s.push(_||[],t+1,2*n+1,2*i),s.push(y||[],t+1,2*n+1,2*i+1)}}},xe.prototype.getTile=function(e,t,n){var i=this.options,r=i.extent,o=i.debug;if(e<0||e>24)return null;var a=1<<e,s=be(e,t=(t%a+a)%a,n);if(this.tiles[s])return me(this.tiles[s],r);o>1&&console.log("drilling down to z%d-%d-%d",e,t,n);for(var l,c=e,u=t,h=n;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[be(c,u,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,h),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,e,t,n),o>1&&console.timeEnd("drilling down"),this.tiles[s]?me(this.tiles[s],r):null):null};class Ee extends e.VectorTileWorkerSource{constructor(e,t,n,i,r){super(e,t,n,i,we),r&&(this.loadGeoJSON=r)}loadData(t,n){const i=t&&t.request,r=i&&i.collectResourceTiming;this.loadGeoJSON(t,((a,s)=>{if(a||!s)return n(a);if("object"!=typeof s)return n(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));{o(s,!0);try{if(t.filter){const n=e.createExpression(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===n.result)throw new Error(n.value.map((e=>`${e.key}: ${e.message}`)).join(", "));const i=s.features.filter((e=>n.value.evaluate({zoom:0},e)));s={type:"FeatureCollection",features:i}}this._geoJSONIndex=t.cluster?new F(function({superclusterOptions:t,clusterProperties:n}){if(!n||!t)return t;const i={},r={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(n);for(const t of s){const[o,a]=n[t],s=e.createExpression(a),l=e.createExpression("string"==typeof o?[o,["accumulated"],["get",t]]:o);i[t]=s.value,r[t]=l.value}return t.map=e=>{a.properties=e;const t={};for(const e of s)t[e]=i[e].evaluate(o,a);return t},t.reduce=(e,t)=>{a.properties=t;for(const t of s)o.accumulated=e[t],e[t]=r[t].evaluate(o,a)},t}(t)).load(s.features):function(e,t){return new xe(e,t)}(s,t.geojsonVtOptions)}catch(a){return n(a)}this.loaded={};const l={};if(r){const n=e.getPerformanceMeasurement(i);n&&(l.resourceTiming={},l.resourceTiming[t.source]=JSON.parse(JSON.stringify(n)))}n(null,l)}}))}reloadTile(e,t){const n=this.loaded;return n&&n[e.uid]?super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,n){if(t.request)e.getJSON(t.request,n);else{if("string"!=typeof t.data)return n(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));try{return n(null,JSON.parse(t.data))}catch(e){return n(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}class Te{constructor(t){this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=e.getProjection({name:"mercator"}),this.workerSourceTypes={vector:e.VectorTileWorkerSource,geojson:Ee},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=t=>{if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}}clearCaches(e,t,n){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],n()}checkIfReady(e,t,n){n()}setReferrer(e,t){this.referrer=t}spriteLoaded(t,n){this.isSpriteLoaded[t]=n;for(const i in this.workerSources[t]){const r=this.workerSources[t][i];for(const t in r)r[t]instanceof e.VectorTileWorkerSource&&(r[t].isSpriteLoaded=n,r[t].fire(new e.Event("isSpriteLoaded")))}}setImages(e,t,n){this.availableImages[e]=t;for(const n in this.workerSources[e]){const i=this.workerSources[e][n];for(const e in i)i[e].availableImages=t}n()}enableTerrain(e,t,n){this.terrain=t,n()}setProjection(t,n){this.projections[t]=e.getProjection(n)}setLayers(e,t,n){this.getLayerIndex(e).replace(t),n()}updateLayers(e,t,n){this.getLayerIndex(e).update(t.layers,t.removedIds),n()}loadTile(t,n,i){const r=this.enableTerrain?e.extend({enableTerrain:this.terrain},n):n;r.projection=this.projections[t]||this.defaultProjection,this.getWorkerSource(t,n.type,n.source).loadTile(r,i)}loadDEMTile(t,n,i){const r=this.enableTerrain?e.extend({buildQuadTree:this.terrain},n):n;this.getDEMWorkerSource(t,n.source).loadTile(r,i)}reloadTile(t,n,i){const r=this.enableTerrain?e.extend({enableTerrain:this.terrain},n):n;r.projection=this.projections[t]||this.defaultProjection,this.getWorkerSource(t,n.type,n.source).reloadTile(r,i)}abortTile(e,t,n){this.getWorkerSource(e,t.type,t.source).abortTile(t,n)}removeTile(e,t,n){this.getWorkerSource(e,t.type,t.source).removeTile(t,n)}removeSource(e,t,n){if(!this.workerSources[e]||!this.workerSources[e][t.type]||!this.workerSources[e][t.type][t.source])return;const i=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==i.removeSource?i.removeSource(t,n):n()}loadWorkerSource(e,t,n){try{this.self.importScripts(t.url),n()}catch(e){n(e.toString())}}syncRTLPluginState(t,n,i){try{e.plugin.setState(n);const t=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=t){this.self.importScripts(t);const n=e.plugin.isParsed();i(n?void 0:new Error(`RTL Text Plugin failed to import scripts from ${t}`),n)}}catch(e){i(e.toString())}}getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}getLayerIndex(e){let t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new i),t}getWorkerSource(e,t,n){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][n]){const i={send:(t,n,i,r,o,a)=>{this.actor.send(t,n,i,e,o,a)},scheduler:this.actor.scheduler};this.workerSources[e][t][n]=new this.workerSourceTypes[t](i,this.getLayerIndex(e),this.getAvailableImages(e),this.isSpriteLoaded[e])}return this.workerSources[e][t][n]}getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new r),this.demWorkerSources[e][t]}enforceCacheSizeLimit(t,n){e.enforceCacheSizeLimit(n)}getWorkerPerformanceMetrics(e,t,n){n(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new Te(self)),Te})),i(0,(function(e){function t(e,n){if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let i=0;i<e.length;i++)if(!t(e[i],n[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==n){if("object"!=typeof n)return!1;if(Object.keys(e).length!==Object.keys(n).length)return!1;for(const i in e)if(!t(e[i],n[i]))return!1;return!0}return e===n}var n=i;function i(e){return!function(e){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,n=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(n);try{t=new Worker(i),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(i),e}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var n=t.getImageData(0,0,1,1);return n&&n.width===e.width}()?(void 0===r[t=e&&e.failIfMajorPerformanceCaveat]&&(r[t]=function(e){var t,n=function(e){var t=document.createElement("canvas"),n=Object.create(i.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=e,t.getContext("webgl",n)||t.getContext("experimental-webgl",n)}(e);if(!n)return!1;try{t=n.createShader(n.VERTEX_SHADER)}catch(e){return!1}return!(!t||n.isContextLost())&&(n.shaderSource(t,"void main() {}
2"),n.compileShader(t),!0===n.getShaderParameter(t,n.COMPILE_STATUS))}(t)),r[t]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var t}(e)}var r={};function o(t,n,i){const r=e.window.document.createElement(t);return void 0!==n&&(r.className=n),i&&i.appendChild(r),r}function a(t,n,i){const r=e.window.document.createElementNS("http://www.w3.org/2000/svg",t);for(const e of Object.keys(n))r.setAttributeNS(null,e,n[e]);return i&&i.appendChild(r),r}i.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const s=e.window.document&&e.window.document.documentElement.style,l=s&&void 0!==s.userSelect?"userSelect":"WebkitUserSelect";let c;function u(){s&&l&&(c=s[l],s[l]="none")}function h(){s&&l&&(s[l]=c)}function d(t){t.preventDefault(),t.stopPropagation(),e.window.removeEventListener("click",d,!0)}function f(){e.window.addEventListener("click",d,!0),e.window.setTimeout((()=>{e.window.removeEventListener("click",d,!0)}),0)}function p(e,t){const n=e.getBoundingClientRect();return _(e,n,t)}function m(e,t){const n=e.getBoundingClientRect(),i=[];for(let r=0;r<t.length;r++)i.push(_(e,n,t[r]));return i}function g(t){return void 0!==e.window.InstallTrigger&&2===t.button&&t.ctrlKey&&e.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button}function _(t,n,i){const r=t.offsetWidth===n.width?1:t.offsetWidth/n.width;return new e.pointGeometry((i.clientX-n.left)*r,(i.clientY-n.top)*r)}function y(e,t){var n=t[0],i=t[1],r=t[2],o=t[3],a=n*o-r*i;return a?(e[0]=o*(a=1/a),e[1]=-i*a,e[2]=-r*a,e[3]=n*a,e):null}function v(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class x extends e.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:e,callback:t}of this.requestors)this._notify(e,t);this.requestors=[]}}hasImage(e){return!!this.getImage(e)}getImage(e){return this.images[e]}addImage(e,t){this._validate(e,t)&&(this.images[e]=t)}_validate(t,n){let i=!0;return this._validateStretch(n.stretchX,n.data&&n.data.width)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),i=!1),this._validateStretch(n.stretchY,n.data&&n.data.height)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),i=!1),this._validateContent(n.content,n)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "content" value`))),i=!1),i}_validateStretch(e,t){if(!e)return!0;let n=0;for(const i of e){if(i[0]<n||i[1]<i[0]||t<i[1])return!1;n=i[1]}return!0}_validateContent(e,t){return!(e&&(4!==e.length||e[0]<0||t.data.width<e[0]||e[1]<0||t.data.height<e[1]||e[2]<0||t.data.width<e[2]||e[3]<0||t.data.height<e[3]||e[2]<e[0]||e[3]<e[1]))}updateImage(e,t){t.version=this.images[e].version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){const t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e,t){let n=!0;if(!this.isLoaded())for(const t of e)this.images[t]||(n=!1);this.isLoaded()||n?this._notify(e,t):this.requestors.push({ids:e,callback:t})}_notify(t,n){const i={};for(const n of t){this.images[n]||this.fire(new e.Event("styleimagemissing",{id:n}));const t=this.images[n];t?i[n]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.warnOnce(`Image "${n}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}n(null,i)}getPixelSize(){const{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(t){const n=this.patterns[t],i=this.getImage(t);if(!i)return null;if(n&&n.position.version===i.version)return n.position;if(n)n.position.version=i.version;else{const n={w:i.data.width+2,h:i.data.height+2,x:0,y:0},r=new e.ImagePosition(n,i);
vendor: 55,553 bytes, line 2
2this.patterns[t]={bin:n,position:r}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const n=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.Texture(t,this.atlasImage,n.RGBA),this.atlasTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:n,h:i}=e.potpack(t),r=this.atlasImage;r.resize({width:n||1,height:i||1});for(const t in this.patterns){const{bin:n}=this.patterns[t],i=n.x+1,o=n.y+1,a=this.images[t].data,s=a.width,l=a.height;e.RGBAImage.copy(a,r,{x:0,y:0},{x:i,y:o},{width:s,height:l}),e.RGBAImage.copy(a,r,{x:0,y:l-1},{x:i,y:o-1},{width:s,height:1}),e.RGBAImage.copy(a,r,{x:0,y:0},{x:i,y:o+l},{width:s,height:1}),e.RGBAImage.copy(a,r,{x:s-1,y:0},{x:i-1,y:o},{width:1,height:l}),e.RGBAImage.copy(a,r,{x:0,y:0},{x:i+s,y:o},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const t of e){if(this.callbackDispatchedThisFrame[t])continue;this.callbackDispatchedThisFrame[t]=!0;const e=this.images[t];v(e)&&this.updateImage(t,e)}}}const b=new e.Properties({anchor:new e.DataConstantProperty(e.spec.light.anchor),position:new class{constructor(){this.specification=e.spec.light.position}possiblyEvaluate(t,n){return function([t,n,i]){const r=e.degToRad(n+90),o=e.degToRad(i);return{x:t*Math.cos(r)*Math.sin(o),y:t*Math.sin(r)*Math.sin(o),z:t*Math.cos(o),azimuthal:n,polar:i}}(t.expression.evaluate(n))}interpolate(t,n,i){return{x:e.number(t.x,n.x,i),y:e.number(t.y,n.y,i),z:e.number(t.z,n.z,i),azimuthal:e.number(t.azimuthal,n.azimuthal,i),polar:e.number(t.polar,n.polar,i)}}},color:new e.DataConstantProperty(e.spec.light.color),intensity:new e.DataConstantProperty(e.spec.light.intensity)}),w="-transition";class E extends e.Evented{constructor(t){super(),this._transitionable=new e.Transitionable(b),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,n={}){if(!this._validate(e.validateLight,t,n))for(const n in t){const i=t[n];e.endsWith(n,w)?this._transitionable.setTransition(n.slice(0,-w.length),i):this._transitionable.setValue(n,i)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,n,i){return(!i||!1!==i.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:e.spec})))}}const T=new e.Properties({source:new e.DataConstantProperty(e.spec.terrain.source),exaggeration:new e.DataConstantProperty(e.spec.terrain.exaggeration)}),S="-transition";class A extends e.Evented{constructor(t,n){super(),this._transitionable=new e.Transitionable(T),this.set(t),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=n}get(){return this._transitionable.serialize()}set(t){for(const n in t){const i=t[n];e.endsWith(n,S)?this._transitionable.setTransition(n.slice(0,-S.length),i):this._transitionable.setValue(n,i)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}}function C(t,n,i,r){const o=e.smoothstep(45,65,i),[a,s]=k(t,r),l=e.length(n);let c=1-Math.min(1,Math.exp((l-a)/(s-a)*-6));return c*=c*c,c=Math.min(1,1.00747*c),c*o*t.alpha}function k(e,t){const n=.5/Math.tan(.5*t);return[e.range[0]+n,e.range[1]+n]}const M=new e.Properties({range:new e.DataConstantProperty(e.spec.fog.range),color:new e.DataConstantProperty(e.spec.fog.color),"high-color":new e.DataConstantProperty(e.spec.fog["high-color"]),"space-color":new e.DataConstantProperty(e.spec.fog["space-color"]),"horizon-blend":new e.DataConstantProperty(e.spec.fog["horizon-blend"]),"star-intensity":new e.DataConstantProperty(e.spec.fog["star-intensity"])}),I="-transition";class P extends e.Evented{constructor(t,n){super(),this._transitionable=new e.Transitionable(M),this.set(t),this._transitioning=this._transitionable.untransitioned(),this._transform=n}get state(){const t=this._transform,n="globe"===t.projection.name,i=e.globeToMercatorTransition(t.zoom),r=this.properties.get("range"),o=[.5,3];return{range:n?[e.number(o[0],r[0],i),e.number(o[1],r[1],i)]:r,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(t,n={}){if(!this._validate(e.validateFog,t,n)){for(const n of Object.keys(e.spec.fog))t&&void 0===t[n]&&(t[n]=e.spec.fog[n].default);for(const n in t){const i=t[n];e.endsWith(n,I)?this._transitionable.setTransition(n.slice(0,-I.length),i):this._transitionable.setValue(n,i)}}}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const n=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:e.smoothstep(45,65,t))*n.a}getOpacityAtLatLng(t,n){return this._transform.projection.supportsFog?function(t,n,i){const r=e.MercatorCoordinate.fromLngLat(n),o=i.elevation?i.elevation.getAtPointOrZero(r):0,a=[r.x,r.y,o];return e.transformMat4(a,a,i.mercatorFogMatrix),C(t,a,i.pitch,i._fov)}(this.state,t,n):0}getFovAdjustedRange(e){return this._transform.projection.supportsFog?k(this.state,e):[0,1]}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,n,i){return(!i||!1!==i.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:n,style:{glyphs:!0,sprite:!0},styleSpec:e.spec})))}}class D{constructor(t,n){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=e.uniqueId();const i=this.workerPool.acquire(this.id);for(let e=0;e<i.length;e++){const t=new D.Actor(i[e],n,this.id);t.name=`Worker ${e}`,this.actors.push(t)}this.ready=!1,this.broadcast("checkIfReady",null,(()=>{this.ready=!0}))}broadcast(t,n,i){e.asyncAll(this.actors,((e,i)=>{e.send(t,n,i)}),i=i||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((e=>{e.remove()})),this.actors=[],this.workerPool.release(this.id)}}function z(t,n,i){return n*(e.EXTENT/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}D.Actor=e.Actor;class L{constructor(e,t,n,i){this.screenBounds=e,this.cameraPoint=t,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=n,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,i)}static createFromScreenPoints(t,n){let i,r;if(t instanceof e.pointGeometry||"number"==typeof t[0]){const o=e.pointGeometry.convert(t);i=[o],r=n.isPointAboveHorizon(o)}else{const o=e.pointGeometry.convert(t[0]),a=e.pointGeometry.convert(t[1]);i=[o,a],r=e.polygonizeBounds(o,a).every((e=>n.isPointAboveHorizon(e)))}return new L(i,n.getCameraPoint(),r,n)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return e.polygonizeBounds(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const n=this.screenBounds[0],i=1===this.screenBounds.length?this.screenBounds[0].add(new e.pointGeometry(1,1)):this.screenBounds[1],r=e.polygonizeBounds(n,i,0,!1);return this.cameraPoint.y>i.y&&(this.cameraPoint.x>n.x&&this.cameraPoint.x<i.x?r.splice(3,0,this.cameraPoint):this.cameraPoint.x>=i.x?r[2]=this.cameraPoint:this.cameraPoint.x<=n.x&&(r[3]=this.cameraPoint)),e.bufferConvexPolygon(r,t)}bufferedCameraGeometryGlobe(t){const n=this.screenBounds[0],i=1===this.screenBounds.length?this.screenBounds[0].add(new e.pointGeometry(1,1)):this.screenBounds[1],r=e.polygonizeBounds(n,i,t),o=this.cameraPoint.clone();switch(3*((o.y>n.y)+(o.y>i.y))+((o.x>n.x)+(o.x>i.x))){case 0:r[0]=o,r[4]=o.clone();break;case 1:r.splice(1,0,o);break;case 2:r[1]=o;break;case 3:r.splice(4,0,o);break;case 5:r.splice(2,0,o);break;case 6:r[3]=o;break;case 7:r.splice(3,0,o);break;case 8:r[2]=o}return r}containsTile(t,n,i,r=0){const o=t.queryPadding/n._pixelsPerMercatorPixel+1,a=i?this._bufferedCameraMercator(o,n):this._bufferedScreenMercator(o,n);let s=t.tileID.wrap+(a.unwrapped?r:0);const l=a.polygon.map((n=>e.getTilePoint(t.tileTransform,n,s)));if(!e.polygonIntersectsBox(l,0,0,e.EXTENT,e.EXTENT))return;s=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?r:0);const c=this.screenGeometryMercator.polygon.map((n=>e.getTileVec3(t.tileTransform,n,s))),u=c.map((t=>new e.pointGeometry(t[0],t[1]))),h=n.getFreeCameraOptions().position||new e.MercatorCoordinate(0,0,0),d=e.getTileVec3(t.tileTransform,h,s),f=c.map((t=>{const n=e.sub(t,t,d);return e.normalize(n,n),new e.Ray(d,n)})),p=z(t,1,n.zoom)*n._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:u,tilespaceRays:f,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(m=e.getBounds(l),m.min.x=e.clamp(m.min.x,0,e.EXTENT),m.min.y=e.clamp(m.min.y,0,e.EXTENT),m.max.x=e.clamp(m.max.x,0,e.EXTENT),m.max.y=e.clamp(m.max.y,0,e.EXTENT),m),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:p};var m}_bufferedScreenMercator(e,t){const n=B(e);if(this._screenRaycastCache[n])return this._screenRaycastCache[n];{let i;return i="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._screenRaycastCache[n]=i,i}}_bufferedCameraMercator(e,t){const n=B(e);if(this._cameraRaycastCache[n])return this._cameraRaycastCache[n];{let i;return i="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._cameraRaycastCache[n]=i,i}}_projectAndResample(t,n){const i=function(t,n){const i=e.multiply([],n.pixelMatrix,n.globeMatrix),r=[0,-e.GLOBE_RADIUS,0,1],o=[0,e.GLOBE_RADIUS,0,1],a=[0,0,0,1];e.transformMat4$1(r,r,i),e.transformMat4$1(o,o,i),e.transformMat4$1(a,a,i);const s=new e.pointGeometry(r[0]/r[3],r[1]/r[3]),l=new e.pointGeometry(o[0]/o[3],o[1]/o[3]),c=e.polygonContainsPoint(t,s)&&r[3]<a[3],u=e.polygonContainsPoint(t,l)&&o[3]<a[3];if(!c&&!u)return null;const h=function(e,t,n){for(let i=1;i<e.length;i++){const r=R(t.pointCoordinate3D(e[i-1]).x),o=R(t.pointCoordinate3D(e[i]).x);if(n<0){if(r<o)return{idx:i,t:-r/(o-1-r)}}else if(o<r)return{idx:i,t:(1-r)/(o+1-r)}}return null}(t,n,c?-1:1);if(!h)return null;const{idx:d,t:f}=h;let p=d>1?O(t.slice(0,d),n):[],m=d<t.length?O(t.slice(d),n):[];p=p.map((t=>new e.pointGeometry(R(t.x),t.y))),m=m.map((t=>new e.pointGeometry(R(t.x),t.y)));const g=[...p];0===g.length&&g.push(m[m.length-1]);const _=e.number(g[g.length-1].y,(0===m.length?p[0]:m[0]).y,f);let y;return y=c?[new e.pointGeometry(0,_),new e.pointGeometry(0,0),new e.pointGeometry(1,0),new e.pointGeometry(1,_)]:[new e.pointGeometry(1,_),new e.pointGeometry(1,1),new e.pointGeometry(0,1),new e.pointGeometry(0,_)],g.push(...y),0===m.length?g.push(p[0]):g.push(...m),{polygon:g.map((t=>new e.MercatorCoordinate(t.x,t.y))),unwrapped:!1}}(t,n);if(i)return i;const r=function(t,n){let i=!1,r=-1/0,o=0;for(let e=0;e<t.length-1;e++)t[e].x>r&&(r=t[e].x,o=e);for(let e=0;e<t.length-1;e++){const n=(o+e)%(t.length-1),r=t[n],a=t[n+1];Math.abs(r.x-a.x)>.5&&(r.x<a.x?(r.x+=1,0===n&&(t[t.length-1].x+=1)):(a.x+=1,n+1===t.length-1&&(t[0].x+=1)),i=!0)}const a=e.mercatorXfromLng(n.center.lng);return i&&a<Math.abs(a-1)&&t.forEach((e=>{e.x-=1})),{polygon:t,unwrapped:i}}(O(t,n).map((t=>new e.pointGeometry(R(t.x),t.y))),n);return{polygon:r.polygon.map((t=>new e.MercatorCoordinate(t.x,t.y))),unwrapped:r.unwrapped}}}function O(t,n){return e.resample(t,(e=>{const t=n.pointCoordinate3D(e);e.x=t.x,e.y=t.y}),1/256)}function R(e){return e<0?1+e%1:e%1}function B(e){return 100*e|0}function F(t,n,i,r,o){const a=function(i,r){if(i)return o(i);if(r){t.url&&r.tiles&&t.tiles&&delete t.tiles;const i=e.pick(e.extend(r,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);r.vector_layers&&(i.vectorLayers=r.vector_layers,i.vectorLayerIds=i.vectorLayers.map((e=>e.id))),i.tiles=n.canonicalizeTileset(i,t.url),o(null,i)}};return t.url?e.getJSON(n.transformRequest(n.normalizeSourceURL(t.url,null,i,r),e.ResourceType.Source),a):e.exported.frame((()=>a(null,t)))}class N{constructor(t,n,i){this.bounds=e.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=n||0,this.maxzoom=i||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(t){const n=Math.pow(2,t.z),i=Math.floor(e.mercatorXfromLng(this.bounds.getWest())*n),r=Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*n),o=Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*n),a=Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*n);return t.x>=i&&t.x<o&&t.y>=r&&t.y<a}}class j{constructor(e,t,n){this.context=e;const i=e.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(n),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||t.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const U={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class V{constructor(e,t,n,i){this.length=t.length,this.attributes=n,this.itemSize=t.bytesPerElement,this.dynamicDraw=i,this.context=e;const r=e.gl;this.buffer=r.createBuffer(),e.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||t.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let n=0;n<this.attributes.length;n++){const i=t.attributes[this.attributes[n].name];void 0!==i&&e.enableVertexAttribArray(i)}}setVertexAttribPointers(e,t,n){for(let i=0;i<this.attributes.length;i++){const r=this.attributes[i],o=t.attributes[r.name];void 0!==o&&e.vertexAttribPointer(o,r.components,e[U[r.type]],!1,this.itemSize,r.offset+this.itemSize*(n||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class G{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class q extends G{getDefault(){return e.Color.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class $ extends G{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class W extends G{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class Z extends G{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class X extends G{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class H extends G{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class Y extends G{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class K extends G{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class J extends G{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class Q extends G{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class ee extends G{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class te extends G{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class ne extends G{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class ie extends G{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class re extends G{getDefault(){return e.Color.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class oe extends G{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class ae extends G{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class se extends G{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class le extends G{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class ce extends G{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class ue extends G{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class he extends G{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class de extends G{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class fe extends G{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class pe extends G{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class me extends G{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class ge extends G{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class _e extends G{constructor(e){super(e),this.vao=e.extVertexArrayObject}getDefault(){return null}set(e){this.vao&&(e!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(e),this.current=e,this.dirty=!1)}}class ye extends G{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class ve extends G{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class xe extends G{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class be extends G{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class we extends be{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Ee extends be{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,this.attachment(),t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Te extends Ee{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class Se{constructor(e,t,n,i){this.context=e,this.width=t,this.height=n;const r=this.framebuffer=e.gl.createFramebuffer();this.colorAttachment=new we(e,r),i&&(this.depthAttachment=new Ee(e,r))}destroy(){const e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class Ae{constructor(e){this.gl=e,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new q(this),this.clearDepth=new $(this),this.clearStencil=new W(this),this.colorMask=new Z(this),this.depthMask=new X(this),this.stencilMask=new H(this),this.stencilFunc=new Y(this),this.stencilOp=new K(this),this.stencilTest=new J(this),this.depthRange=new Q(this),this.depthTest=new ee(this),this.depthFunc=new te(this),this.blend=new ne(this),this.blendFunc=new ie(this),this.blendColor=new re(this),this.blendEquation=new oe(this),this.cullFace=new ae(this),this.cullFaceSide=new se(this),this.frontFace=new le(this),this.program=new ce(this),this.activeTexture=new ue(this),this.viewport=new he(this),this.bindFramebuffer=new de(this),this.bindRenderbuffer=new fe(this),this.bindTexture=new pe(this),this.bindVertexBuffer=new me(this),this.bindElementBuffer=new ge(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new _e(this),this.pixelStoreUnpack=new ye(this),this.pixelStoreUnpackPremultiplyAlpha=new ve(this),this.pixelStoreUnpackFlipY=new xe(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureFilterAnisotropicForceOff=!1,this.extStandardDerivativesForceOff=!1,this.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.extTextureHalfFloat=e.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(e.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float")),this.extStandardDerivatives=e.getExtension("OES_standard_derivatives"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t){return new j(this,e,t)}createVertexBuffer(e,t,n){return new V(this,e,t,n)}createRenderbuffer(e,t,n){const i=this.gl,r=i.createRenderbuffer();return this.bindRenderbuffer.set(r),i.renderbufferStorage(i.RENDERBUFFER,e,t,n),this.bindRenderbuffer.set(null),r}createFramebuffer(e,t,n){return new Se(this,e,t,n)}clear({color:e,depth:t,stencil:n}){const i=this.gl;let r=0;e&&(r|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==t&&(r|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==n&&(r|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),i.clear(r)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(n){t(n.blendFunction,e.ColorMode.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(n.blendFunction),this.blendColor.set(n.blendColor)),this.colorMask.set(n.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class Ce extends e.Evented{constructor(t,n,i,r){super(),this.id=t,this.dispatcher=i,this.setEventedParent(r),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.extend({type:"raster"},n),e.extend(this,e.pick(n,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=F(this._options,this.map._requestManager,null,null,((t,n)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new e.ErrorEvent(t)):n&&(e.extend(this,n),n.bounds&&(this.tileBounds=new N(n.bounds,this.minzoom,this.maxzoom)),e.postTurnstileEvent(n.tiles),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return e.extend({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,n){const i=e.exported.devicePixelRatio>=2,r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),i,this.tileSize);t.request=e.getImage(this.map._requestManager.transformRequest(r,e.ResourceType.Tile),((i,r,o,a)=>(delete t.request,t.aborted?(t.state="unloaded",n(null)):i?(t.state="errored",n(i)):r?(this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:o,expires:a}),t.setTexture(r,this.map.painter),t.state="loaded",e.cacheEntryPossiblyAdded(this.dispatcher),void n(null)):n(null))))}static loadTileData(e,t,n){e.setTexture(t,n)}static unloadTileData(e,t){e.texture&&t.saveTileTexture(e.texture)}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t()}unloadTile(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()}hasTransition(){return!1}}let ke;function Me(t,n,i,r,o,a,s,l){const c=[t,i,o,n,r,a,1,1,1],u=[s,l,1],h=e.adjoint([],c),[d,f,p]=e.transformMat3(u,u,e.transpose(h,h));return e.multiply$1(c,[d,0,0,0,f,0,0,0,p],c)}class Ie extends e.Evented{constructor(e,t,n,i){super(),this.id=e,this.dispatcher=n,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=t,this._dirty=!1}load(t,n){this._loaded=n||!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,this._imageRequest=e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),((n,i)=>{if(this._imageRequest=null,this._loaded=!0,n)this.fire(new e.ErrorEvent(n));else if(i){const{HTMLImageElement:n}=e.window;this.image=i instanceof n?e.exported.getImageData(i):i,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,t&&(this.coordinates=t),this._finishLoading()}}))}loaded(){return this._loaded}updateImage(e){return this.image&&e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),this.texture&&this.texture.destroy()}setCoordinates(t){this.coordinates=t,this._boundsArray=void 0;const n=t.map(e.MercatorCoordinate.fromLngLat);return this.tileID=function(t){let n=1/0,i=1/0,r=-1/0,o=-1/0;for(const e of t)n=Math.min(n,e.x),i=Math.min(i,e.y),r=Math.max(r,e.x),o=Math.max(o,e.y);const a=Math.max(r-n,o-i),s=Math.max(0,Math.floor(-Math.log(a)/Math.LN2)),l=Math.pow(2,s);return new e.CanonicalTileID(s,Math.floor((n+r)/2*l),Math.floor((i+o)/2*l))}(n),this.minzoom=this.maxzoom=this.tileID.z,this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0}_prepareData(t){for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}if(this._boundsArray)return;const n=e.tileTransform(this.tileID,this.map.transform.projection),[i,r,o,a]=this.coordinates.map((t=>{const i=n.projection.project(t[0],t[1]);return e.getTilePoint(n,i)._round()}));this.perspectiveTransform=function(t,n,i,r,o,a,s,l,c,u){const h=Me(0,0,t,0,0,n,t,n),d=Me(i,r,o,a,s,l,c,u);return e.multiply$1(d,e.adjoint(h,h),d),[d[6]/d[8]*t/e.EXTENT,d[7]/d[8]*n/e.EXTENT]}(this.width,this.height,i.x,i.y,r.x,r.y,a.x,a.y,o.x,o.y);const s=this._boundsArray=new e.StructArrayLayout4i8;s.emplaceBack(i.x,i.y,0,0),s.emplaceBack(r.x,r.y,e.EXTENT,0),s.emplaceBack(a.x,a.y,0,e.EXTENT),s.emplaceBack(o.x,o.y,e.EXTENT,e.EXTENT),this.boundsBuffer&&this.boundsBuffer.destroy(),this.boundsBuffer=t.createVertexBuffer(s,e.boundsAttributes.members),this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,n=t.gl;this._dirty&&(this.texture?this.texture.update(this.image):(this.texture=new e.Texture(t,this.image,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE)),this._dirty=!1),this._prepareData(t)}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}const Pe={vector:class extends e.Evented{constructor(t,n,i,r){if(super(),this.id=t,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.extend(this,e.pick(n,["url","scheme","tileSize","promoteId"])),this._options=e.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(r),this._tileWorkers={},this._deduped=new e.DedupedRequest}load(t){this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"}));const n=Array.isArray(this.map._language)?this.map._language.join():this.map._language,i=this.map._worldview;this._tileJSONRequest=F(this._options,this.map._requestManager,n,i,((r,o)=>{this._tileJSONRequest=null,this._loaded=!0,r?(n&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${n}`),i&&2!==i.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${i}`),this.fire(new e.ErrorEvent(r))):o&&(e.extend(this,o),o.bounds&&(this.tileBounds=new N(o.bounds,this.minzoom,this.maxzoom)),e.postTurnstileEvent(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))),t&&t(r)}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest(),this.load((()=>{const e=this.map.style._getSourceCaches(this.id);for(const t of e)t.clearTiles()}))}setSourceProperty(e){e(),this.reload()}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(){this.cancelTileJSONRequest()}serialize(){return e.extend({},this._options)}loadTile(t,n){const i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),r={request:this.map._requestManager.transformRequest(i,e.ResourceType.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:e.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile};if(r.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=n:t.request=t.actor.send("reloadTile",r,o.bind(this));else if(t.actor=this._tileWorkers[i]=this._tileWorkers[i]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",r,o.bind(this),void 0,!0);else{const n=e.loadVectorTile.call({deduped:this._deduped},r,((e,n)=>{e||!n?o.call(this,e):(r.data={cacheControl:n.cacheControl,expires:n.expires,rawData:n.rawData.slice(0)},t.actor&&t.actor.send("loadTile",r,o.bind(this),void 0,!0))}),!0);t.request={cancel:n}}function o(i,r){return delete t.request,t.aborted?n(null):i&&404!==i.status?n(i):(r&&r.resourceTiming&&(t.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&t.setExpiryData(r),t.loadVectorData(r,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),n(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id})}unloadTile(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}},raster:Ce,"raster-dem":class extends Ce{constructor(t,n,i,r){super(t,n,i,r),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}loadTile(t,n){const i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function r(e,i){e&&(t.state="errored",n(e)),i&&(t.dem=i,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",n(null))}t.request=e.getImage(this.map._requestManager.transformRequest(i,e.ResourceType.Tile),function(i,o,a,s){if(delete t.request,t.aborted)t.state="unloaded",n(null);else if(i)t.state="errored",n(i);else if(o){this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:a,expires:s});const n=e.window.ImageBitmap&&o instanceof e.window.ImageBitmap&&(null==ke&&(ke=e.window.OffscreenCanvas&&new e.window.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof e.window.createImageBitmap),ke),i=1-(o.width-e.prevPowerOfTwo(o.width))/2;i<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));const l=n?o:e.exported.getImageData(o,i),c={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:l,encoding:this.encoding,padding:i};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",c,r.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(t){const n=t.canonical,i=Math.pow(2,n.z),r=(n.x-1+i)%i,o=0===n.x?t.wrap-1:t.wrap,a=(n.x+1+i)%i,s=n.x+1===i?t.wrap+1:t.wrap,l={};return l[new e.OverscaledTileID(t.overscaledZ,o,n.z,r,n.y).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,n.z,a,n.y).key]={backfilled:!1},n.y>0&&(l[new e.OverscaledTileID(t.overscaledZ,o,n.z,r,n.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,n.z,a,n.y-1).key]={backfilled:!1}),n.y+1<i&&(l[new e.OverscaledTileID(t.overscaledZ,o,n.z,r,n.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,n.z,n.x,n.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,n.z,a,n.y+1).key]={backfilled:!1}),l}unloadTile(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded"}},geojson:class extends e.Evented{constructor(t,n,i,r){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._loaded=!1,this.actor=i.getActor(),this.setEventedParent(r),this._data=n.data,this._options=e.extend({},n),this._collectResourceTiming=n.collectResourceTiming,void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;const o=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*o,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*o,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?n.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:e.EXTENT,radius:(void 0!==n.clusterRadius?n.clusterRadius:50)*o,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}onAdd(e){this.map=e,this.setData(this._data)}setData(e){return this._data=e,this._updateWorkerData(),this}getClusterExpansionZoom(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this}getClusterChildren(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this}getClusterLeaves(e,t,n,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:n},i),this}_updateWorkerData(){if(this._pendingLoad)return void(this._coalesce=!0);this.fire(new e.Event("dataloading",{dataType:"source"})),this._loaded=!1;const t=e.extend({},this.workerOptions),n=this._data;"string"==typeof n?(t.request=this.map._requestManager.transformRequest(e.exported.resolveURL(n),e.ResourceType.Source),t.request.collectResourceTiming=this._collectResourceTiming):t.data=JSON.stringify(n),this._pendingLoad=this.actor.send(`${this.type}.loadData`,t,((t,n)=>{if(this._loaded=!0,this._pendingLoad=null,t)this.fire(new e.ErrorEvent(t));else{const t={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&n&&n.resourceTiming&&n.resourceTiming[this.id]&&(t.resourceTiming=n.resourceTiming[this.id]),this.fire(new e.Event("data",t)),this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(),this._coalesce=!1)}))}loaded(){return this._loaded}loadTile(t,n){const i=t.actor?"reloadTile":"loadTile";t.actor=this.actor,t.request=this.actor.send(i,{type:this.type,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.exported.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},((e,r)=>(delete t.request,t.unloadVectorData(),t.aborted?n(null):e?n(e):(t.loadVectorData(r,this.map.painter,"reloadTile"===i),n(null)))),void 0,"loadTile"===i)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}onRemove(){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return e.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends Ie{constructor(e,t,n,i){super(e,t,n,i),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const n of t.urls)this.urls.push(this.map._requestManager.transformRequest(n,e.ResourceType.Source).url);e.getVideo(this.urls,((t,n)=>{this._loaded=!0,t?this.fire(new e.ErrorEvent(t)):n&&(this.video=n,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading())}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const n=this.video.seekable;t<n.start(0)||t>n.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${n.start(0)} and ${n.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,n=t.gl;this.texture?this.video.paused||(this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),n.texSubImage2D(n.TEXTURE_2D,0,0,0,n.RGBA,n.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,n.RGBA),this.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:Ie,canvas:class extends Ie{constructor(t,n,i,r){super(t,n,i,r),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const n=this.map.painter.context;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(n,this.canvas,n.gl.RGBA,{premultiply:!0}),this._prepareData(n)}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}},custom:class extends e.Evented{constructor(t,n,i,r){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=i,this._implementation=n,this.setEventedParent(r),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.ErrorEvent(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.ErrorEvent(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new N(this._implementation.bounds,this.minzoom,this.maxzoom)),n.update=this._update.bind(this),n.clearTiles=this._clearTiles.bind(this),n.coveringTiles=this._coveringTiles.bind(this),e.extend(this,e.pick(n,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return e.pick(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(t){this._map=t,this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(t),this.load()}onRemove(e){this._implementation.onRemove&&this._implementation.onRemove(e)}hasTile(e){if(this._implementation.hasTile){const{x:t,y:n,z:i}=e.canonical;return this._implementation.hasTile({x:t,y:n,z:i})}return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,n){const{x:i,y:r,z:o}=t.tileID.canonical,a=new e.window.AbortController;t.request=Promise.resolve(this._implementation.loadTile({x:i,y:r,z:o},{signal:a.signal})).then(function(i){return delete t.request,t.aborted?(t.state="unloaded",n(null)):void 0===i?(t.state="errored",n(null)):null===i?(this.loadTileData(t,{width:this.tileSize,height:this.tileSize,data:null}),t.state="loaded",n(null)):function(t){return t instanceof e.window.ImageData||t instanceof e.window.HTMLCanvasElement||t instanceof e.window.ImageBitmap||t instanceof e.window.HTMLImageElement}(i)?(this.loadTileData(t,i),t.state="loaded",void n(null)):(t.state="errored",n(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch((e=>{20!==e.code&&(t.state="errored",n(e))})),t.request.cancel=()=>a.abort()}loadTileData(e,t){Ce.loadTileData(e,t,this._map.painter)}unloadTileData(e){Ce.unloadTileData(e,this._map.painter)}unloadTile(e,t){if(this.unloadTileData(e),this._implementation.unloadTile){const{x:t,y:n,z:i}=e.tileID.canonical;this._implementation.unloadTile({x:t,y:n,z:i})}t()}abortTile(e,t){e.request&&e.request.cancel&&(e.request.cancel(),delete e.request),t()}hasTransition(){return!1}_coveringTiles(){return this._map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map((e=>({x:e.canonical.x,y:e.canonical.y,z:e.canonical.z})))}_clearTiles(){this._map.style._clearSource(this.id)}_update(){this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"}))}}},De=function(t,n,i,r){const o=new Pe[n.type](t,n,i,r);if(o.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${o.id}`);return e.bindAll(["load","abort","unload","serialize","prepare"],o),o};function ze(t,n){const i=e.identity([]);return e.scale(i,i,[.5*t.width,.5*-t.height,1]),e.translate(i,i,[1,-1,0]),e.multiply(i,i,t.calculateProjMatrix(n.toUnwrapped())),Float32Array.from(i)}function Le(e,t,n,i,r,o,a,s=!1){const l=e.tilesIn(i,a,s);l.sort(Re);const c=[];for(const i of l)c.push({wrappedTileID:i.tile.tileID.wrapped().key,queryResults:i.tile.queryRenderedFeatures(t,n,e._state,i,r,o,ze(e.transform,i.tile.tileID),s)});const u=function(e){const t={},n={};for(const i of e){const e=i.queryResults,r=i.wrappedTileID,o=n[r]=n[r]||{};for(const n in e){const i=e[n],r=o[n]=o[n]||{},a=t[n]=t[n]||[];for(const e of i)r[e.featureIndex]||(r[e.featureIndex]=!0,a.push(e))}}return t}(c);for(const t in u)u[t].forEach((t=>{const n=t.feature,i=n.layer;i&&"background"!==i.type&&"sky"!==i.type&&(n.source=i.source,i["source-layer"]&&(n.sourceLayer=i["source-layer"]),n.state=void 0!==n.id?e.getFeatureState(i["source-layer"],n.id):{})}));return u}function Oe(e,t){const n=e.getRenderableIds().map((t=>e.getTileByID(t))),i=[],r={};for(let e=0;e<n.length;e++){const o=n[e],a=o.tileID.canonical.key;r[a]||(r[a]=!0,o.querySourceFeatures(i,t))}return i}function Re(e,t){const n=e.tileID,i=t.tileID;return n.overscaledZ-i.overscaledZ||n.canonical.y-i.canonical.y||n.wrap-i.wrap||n.canonical.x-i.canonical.x}function Be(){return null!=po.workerClass?new po.workerClass:new e.window.Worker(po.workerUrl)}const Fe="mapboxgl_preloaded_worker_pool";class Ne{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<Ne.workerCount;)this.workers.push(new Be);return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[Fe]}numActive(){return Object.keys(this.active).length}}let je;function Ue(){return je||(je=new Ne),je}function Ve(t,n){const i={};for(const e in t)"ref"!==e&&(i[e]=t[e]);return e.refProperties.forEach((e=>{e in n&&(i[e]=n[e])})),i}function Ge(e){e=e.slice();const t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].id]=e[n];for(let n=0;n<e.length;n++)"ref"in e[n]&&(e[n]=Ve(e[n],t[e[n].ref]));return e}Ne.workerCount=2;const qe={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight",setTerrain:"setTerrain",setFog:"setFog",setProjection:"setProjection"};function $e(e,t,n){n.push({command:qe.addSource,args:[e,t[e]]})}function We(e,t,n){t.push({command:qe.removeSource,args:[e]}),n[e]=!0}function Ze(e,t,n,i){We(e,n,i),$e(e,t,n)}function Xe(e,n,i){let r;for(r in e[i])if(e[i].hasOwnProperty(r)&&"data"!==r&&!t(e[i][r],n[i][r]))return!1;for(r in n[i])if(n[i].hasOwnProperty(r)&&"data"!==r&&!t(e[i][r],n[i][r]))return!1;return!0}function He(e,n,i,r,o,a){let s;for(s in n=n||{},e=e||{})e.hasOwnProperty(s)&&(t(e[s],n[s])||i.push({command:a,args:[r,s,n[s],o]}));for(s in n)n.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t(e[s],n[s])||i.push({command:a,args:[r,s,n[s],o]}))}function Ye(e){return e.id}function Ke(e,t){return e[t.id]=t,e}class Je{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.clamp(t,0,1);let n=1,i=this._distances[n];const r=t*this.paddedLength+this.padding;for(;i<r&&n<this._distances.length;)i=this._distances[++n];const o=n-1,a=this._distances[o],s=i-a,l=s>0?(r-a)/s:0;return this.points[o].mult(1-l).add(this.points[n].mult(l))}}class Qe{constructor(e,t,n){const i=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(e/n),this.yCellCount=Math.ceil(t/n);for(let e=0;e<this.xCellCount*this.yCellCount;e++)i.push([]),r.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,n,i,r){this._forEachCell(t,n,i,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(r)}insertCircle(e,t,n,i){this._forEachCell(t-i,n-i,t+i,n+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(n),this.circles.push(i)}_insertBoxCell(e,t,n,i,r,o){this.boxCells[r].push(o)}_insertCircleCell(e,t,n,i,r,o){this.circleCells[r].push(o)}_query(e,t,n,i,r,o){if(n<0||e>this.width||i<0||t>this.height)return!r&&[];const a=[];if(e<=0&&t<=0&&this.width<=n&&this.height<=i){if(r)return!0;for(let e=0;e<this.boxKeys.length;e++)a.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){const t=this.circles[3*e],n=this.circles[3*e+1],i=this.circles[3*e+2];a.push({key:this.circleKeys[e],x1:t-i,y1:n-i,x2:t+i,y2:n+i})}return o?a.filter(o):a}return this._forEachCell(e,t,n,i,this._queryCell,a,{hitTest:r,seenUids:{box:{},circle:{}}},o),r?a.length>0:a}_queryCircle(e,t,n,i,r){const o=e-n,a=e+n,s=t-n,l=t+n;if(a<0||o>this.width||l<0||s>this.height)return!i&&[];const c=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,c,{hitTest:i,circle:{x:e,y:t,radius:n},seenUids:{box:{},circle:{}}},r),i?c.length>0:c}query(e,t,n,i,r){return this._query(e,t,n,i,!1,r)}
2hitTest(e,t,n,i,r){return this._query(e,t,n,i,!0,r)}hitTestCircle(e,t,n,i){return this._queryCircle(e,t,n,!0,i)}_queryCell(e,t,n,i,r,o,a,s){const l=a.seenUids,c=this.boxCells[r];if(null!==c){const r=this.bboxes;for(const u of c)if(!l.box[u]){l.box[u]=!0;const c=4*u;if(e<=r[c+2]&&t<=r[c+3]&&n>=r[c+0]&&i>=r[c+1]&&(!s||s(this.boxKeys[u]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[u],x1:r[c],y1:r[c+1],x2:r[c+2],y2:r[c+3]})}}}const u=this.circleCells[r];if(null!==u){const r=this.circles;for(const c of u)if(!l.circle[c]){l.circle[c]=!0;const u=3*c;if(this._circleAndRectCollide(r[u],r[u+1],r[u+2],e,t,n,i)&&(!s||s(this.circleKeys[c]))){if(a.hitTest)return o.push(!0),!0;{const e=r[u],t=r[u+1],n=r[u+2];o.push({key:this.circleKeys[c],x1:e-n,y1:t-n,x2:e+n,y2:t+n})}}}}}_queryCellCircle(e,t,n,i,r,o,a,s){const l=a.circle,c=a.seenUids,u=this.boxCells[r];if(null!==u){const e=this.bboxes;for(const t of u)if(!c.box[t]){c.box[t]=!0;const n=4*t;if(this._circleAndRectCollide(l.x,l.y,l.radius,e[n+0],e[n+1],e[n+2],e[n+3])&&(!s||s(this.boxKeys[t])))return o.push(!0),!0}}const h=this.circleCells[r];if(null!==h){const e=this.circles;for(const t of h)if(!c.circle[t]){c.circle[t]=!0;const n=3*t;if(this._circlesCollide(e[n],e[n+1],e[n+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[t])))return o.push(!0),!0}}}_forEachCell(e,t,n,i,r,o,a,s){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(n),h=this._convertToYCellCoord(i);for(let d=l;d<=u;d++)for(let l=c;l<=h;l++)if(r.call(this,e,t,n,i,this.xCellCount*l+d,o,a,s))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,n,i,r,o){const a=i-e,s=r-t,l=n+o;return l*l>a*a+s*s}_circleAndRectCollide(e,t,n,i,r,o,a){const s=(o-i)/2,l=Math.abs(e-(i+s));if(l>s+n)return!1;const c=(a-r)/2,u=Math.abs(t-(r+c));if(u>c+n)return!1;if(l<=s||u<=c)return!0;const h=l-s,d=u-c;return h*h+d*d<=n*n}}const et=Math.tan(85*Math.PI/180);function tt(t,n,i,r,o,a,s){const l=e.create();if(i)if("globe"===a.name){const t=e.calculateGlobeLabelMatrix(o,n);e.multiply(l,l,t)}else{const t=y([],s);l[0]=t[0],l[1]=t[1],l[4]=t[2],l[5]=t[3],r||e.rotateZ(l,l,o.angle)}else e.multiply(l,o.labelPlaneMatrix,t);return l}function nt(e,t,n,i,r,o,a){const s=tt(e,t,n,i,r,o,a);return"globe"===o.name&&n||(s[2]=s[6]=s[10]=s[14]=0),s}function it(t,n,i,r,o,a,s){if(i){if("globe"===a.name){const l=tt(t,n,i,r,o,a,s);return e.invert(l,l),e.multiply(l,t,l),l}{const n=e.clone(t),i=e.identity([]);return i[0]=s[0],i[1]=s[1],i[4]=s[2],i[5]=s[3],e.multiply(n,n,i),r||e.rotateZ(n,n,-o.angle),n}}return o.glCoordMatrix}function rt(t,n,i,r){const o=[t,n,i,1];i?e.transformMat4$1(o,o,r):mt(o,o,r);const a=o[3];return o[0]/=a,o[1]/=a,o[2]/=a,o}function ot(e,t){return Math.min(.5+e/t*.5,1.5)}function at(e,t){const n=e[0]/e[3],i=e[1]/e[3];return n>=-t[0]&&n<=t[0]&&i>=-t[1]&&i<=t[1]}function st(t,n,i,r,o,a,s,l,c,u){const h=i.transform,d=r?t.textSizeData:t.iconSizeData,f=e.evaluateSizeForZoom(d,i.transform.zoom),p="globe"===h.projection.name,m=[256/i.width*2+1,256/i.height*2+1],g=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();let _=null;p&&(_=r?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);const y=t.lineVertexArray,v=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,x=i.transform.width/i.transform.height;let b,w=!1;for(let r=0;r<v.length;r++){const p=v.get(r),{numGlyphs:E,writingMode:T}=p;if(T!==e.WritingMode.vertical||w||b===e.WritingMode.horizontal||(w=!0),b=T,(p.hidden||T===e.WritingMode.vertical)&&!w){pt(E,g);continue}w=!1;const S=new e.pointGeometry(p.tileAnchorX,p.tileAnchorY);let{x:A,y:C,z:k}=h.projection.projectTilePoint(S.x,S.y,u.canonical);if(c){const[e,t,n]=c(S);A+=e,C+=t,k+=n}const M=[A,C,k,1];if(e.transformMat4$1(M,M,n),!at(M,m)){pt(E,g);continue}const I=ot(i.transform.cameraToCenterDistance,M[3]),P=e.evaluateSizeForFeature(d,f,p),D=s?P/I:P*I,z=rt(A,C,k,o);if(z[3]<=0){pt(E,g);continue}let L={};const O=s?null:c,R=ut(p,D,!1,l,n,o,a,t.glyphOffsetArray,y,g,_,z,S,L,x,O,h.projection,u,s);w=R.useVertical,O&&R.needsFlipping&&(L={}),(R.notEnoughRoom||w||R.needsFlipping&&ut(p,D,!0,l,n,o,a,t.glyphOffsetArray,y,g,_,z,S,L,x,O,h.projection,u,s).notEnoughRoom)&&pt(E,g)}r?(t.text.dynamicLayoutVertexBuffer.updateData(g),_&&t.text.globeExtVertexBuffer.updateData(_)):(t.icon.dynamicLayoutVertexBuffer.updateData(g),_&&t.icon.globeExtVertexBuffer.updateData(_))}function lt(e,t,n,i,r,o,a,s,l,c,u,h,d,f,p,m){const{lineStartIndex:g,glyphStartIndex:_,segment:y}=s,v=_+s.numGlyphs,x=g+s.lineLength,b=t.getoffsetX(_),w=t.getoffsetX(v-1),E=ft(e*b,n,i,r,o,a,y,g,x,l,c,u,h,d,!0,f,p,m);if(!E)return null;const T=ft(e*w,n,i,r,o,a,y,g,x,l,c,u,h,d,!0,f,p,m);return T?{first:E,last:T}:null}function ct(t,n,i,r){return t===e.WritingMode.horizontal&&Math.abs(r)>Math.abs(i)?{useVertical:!0}:t===e.WritingMode.vertical?r>0?{needsFlipping:!0}:null:0!==n&&function(e,t){return 0===e||Math.abs(t/e)>et}(i,r)?1===n?{needsFlipping:!0}:null:i<0?{needsFlipping:!0}:null}function ut(t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v){const x=n/24,b=t.lineOffsetX*x,w=t.lineOffsetY*x,{lineStartIndex:E,glyphStartIndex:T,numGlyphs:S,segment:A,writingMode:C,flipState:k}=t,M=E+t.lineLength,I=t=>{if(h){const[n,i,r]=t.up,o=u.length;e.updateGlobeVertexNormal(h,o+0,n,i,r),e.updateGlobeVertexNormal(h,o+1,n,i,r),e.updateGlobeVertexNormal(h,o+2,n,i,r),e.updateGlobeVertexNormal(h,o+3,n,i,r)}const[n,i,r]=t.point;e.addDynamicAttributes(u,n,i,r,t.angle)};if(S>1){const e=lt(x,l,b,w,i,d,f,t,c,a,p,g,!1,_,y,v);if(!e)return{notEnoughRoom:!0};if(r&&!i){let[n,i,r]=e.first.point,[o,a,l]=e.last.point;[n,i]=rt(n,i,r,s),[o,a]=rt(o,a,l,s);const c=ct(C,k,(o-n)*m,a-i);if(t.flipState=c&&c.needsFlipping?1:2,c)return c}I(e.first);for(let e=T+1;e<T+S-1;e++){const t=ft(x*l.getoffsetX(e),b,w,i,d,f,A,E,M,c,a,p,g,!1,!1,_,y,v);if(!t)return u.length-=4*(e-T),{notEnoughRoom:!0};I(t)}I(e.last)}else{if(r&&!i){const n=rt(f.x,f.y,0,o),i=E+A+1,r=new e.pointGeometry(c.getx(i),c.gety(i)),a=rt(r.x,r.y,0,o),s=a[3]>0?a:dt(f,r,n,1,o,void 0,_,y.canonical),l=ct(C,k,(s[0]-n[0])*m,s[1]-n[1]);if(t.flipState=l&&l.needsFlipping?1:2,l)return l}const n=ft(x*l.getoffsetX(T),b,w,i,d,f,A,E,M,c,a,p,g,!1,!1,_,y,v);if(!n)return{notEnoughRoom:!0};I(n)}return{}}function ht(e,t,n,i,r){const{x:o,y:a,z:s}=i.projectTilePoint(e.x,e.y,t);if(!r)return rt(o,a,s,n);const[l,c,u]=r(e);return rt(o+l,a+c,s+u,n)}function dt(t,n,i,r,o,a,s,l){const c=ht(t.sub(n)._unit()._add(t),l,o,s,a);
2return e.sub(c,i,c),e.normalize(c,c),e.scaleAndAdd(c,i,c,r)}function ft(t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_,y){const v=r?t-n:t+n;let x=v>0?1:-1,b=0;r&&(x*=-1,b=Math.PI),x<0&&(b+=Math.PI);let w=l+s+(x>0?0:1)|0,E=o,T=o,S=0,A=0;const C=Math.abs(v),k=[],M=[];let I=a,P=I;const D=()=>dt(P,I,T,C-S+1,h,f,g,_.canonical);for(;S+A<=C;){if(w+=x,w<l||w>=c)return null;if(T=E,P=I,k.push(T),p&&M.push(P),I=new e.pointGeometry(u.getx(w),u.gety(w)),E=d[w],!E){const e=ht(I,_.canonical,h,g,f);E=e[3]>0?d[w]=e:D()}S+=A,A=e.distance(T,E)}m&&f&&(d[w]&&(E=D(),A=e.distance(T,E)),d[w]=E);const z=(C-S)/A,L=I.sub(P)._mult(z)._add(P),O=e.sub([],E,T),R=e.scaleAndAdd([],T,O,z);let B=[0,0,1],F=O[0],N=O[1];if(y&&(B=g.upVector(_.canonical,L.x,L.y),0!==B[0]||0!==B[1]||1!==B[2])){const t=[B[2],0,-B[0]],n=e.cross([],B,t);e.normalize(t,t),e.normalize(n,n),F=e.dot(O,t),N=e.dot(O,n)}if(i){const t=e.cross([],B,O);e.normalize(t,t),e.scaleAndAdd(R,R,t,i*x)}const j=b+Math.atan2(N,F);return k.push(R),p&&M.push(L),{point:R,angle:j,path:k,tilePath:M,up:B}}function pt(e,t){const n=t.length,i=n+4*e;t.resize(i),t.float32.fill(-1/0,4*n,4*i)}function mt(e,t,n){const i=t[0],r=t[1];return e[0]=n[0]*i+n[4]*r+n[12],e[1]=n[1]*i+n[5]*r+n[13],e[3]=n[3]*i+n[7]*r+n[15],e}const gt=100;class _t{constructor(e,t,n=new Qe(e.width+200,e.height+200,25),i=new Qe(e.width+200,e.height+200,25)){this.transform=e,this.grid=n,this.ignoredGrid=i,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+gt,this.screenBottomBoundary=e.height+gt,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=t}placeCollisionBox(e,t,n,i,r,o,a,s){let l=n.projectedAnchorX,c=n.projectedAnchorY,u=n.projectedAnchorZ;const h=n.elevation,d=n.tileID,f=e.getProjection();if(h&&d){const[e,t,i]=f.upVector(d.canonical,n.tileAnchorX,n.tileAnchorY),r=f.upVectorScale(d.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;l+=e*h*r,c+=t*h*r,u+=i*h*r}const p=this.projectAndGetPerspectiveRatio(a,l,c,u,n.tileID,"globe"===f.name||!!h||this.transform.pitch>0,f),m=o*p.perspectiveRatio,g=(n.x1*t+i.x-n.padding)*m+p.point.x,_=(n.y1*t+i.y-n.padding)*m+p.point.y,y=(n.x2*t+i.x+n.padding)*m+p.point.x,v=(n.y2*t+i.y+n.padding)*m+p.point.y,x=p.perspectiveRatio<=.55||p.occluded;return!this.isInsideGrid(g,_,y,v)||!r&&this.grid.hitTest(g,_,y,v,s)||x?{box:[],offscreen:!1,occluded:p.occluded}:{box:[g,_,y,v],offscreen:this.isOffscreen(g,_,y,v),occluded:!1}}placeCollisionCircles(t,n,i,r,o,a,s,l,c,u,h,d,f,p,m){const g=[],_=this.transform.elevation,y=t.getProjection(),v=_?_.getAtTileOffsetFunc(m,this.transform.center.lat,this.transform.worldSize,y):null,x=new e.pointGeometry(i.tileAnchorX,i.tileAnchorY);let{x:b,y:w,z:E}=y.projectTilePoint(x.x,x.y,m.canonical);if(v){const[e,t,n]=v(x);b+=e,w+=t,E+=n}const T="globe"===y.name,S=this.projectAndGetPerspectiveRatio(s,b,w,E,m,T||!!_||this.transform.pitch>0,y),{perspectiveRatio:A}=S,C=(h?a/A:a*A)/e.ONE_EM,k=rt(b,w,E,l),M=S.signedDistanceFromCamera>0?lt(C,o,i.lineOffsetX*C,i.lineOffsetY*C,!1,k,x,i,r,l,{},_&&!h?v:null,h&&!!_,y,m,h):null;let I=!1,P=!1,D=!0;if(M&&!S.occluded){const t=.5*f*A+p,i=new e.pointGeometry(-100,-100),r=new e.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),o=new Je,{first:a,last:s}=M,l=a.path.length;let h=[];for(let e=l-1;e>=1;e--)h.push(a.path[e]);for(let e=1;e<s.path.length;e++)h.push(s.path[e]);const m=2.5*t;c&&(h=h.map((([e,t,n],i)=>(v&&!T&&(n=v(i<l-1?a.tilePath[l-1-i]:s.tilePath[i-l+2])[2]),rt(e,t,n,c)))),h.some((e=>e[3]<=0))&&(h=[]));let _=[];if(h.length>0){let t=1/0,n=-1/0,o=1/0,a=-1/0;for(const e of h)t=Math.min(t,e[0]),o=Math.min(o,e[1]),n=Math.max(n,e[0]),a=Math.max(a,e[1]);n>=i.x&&t<=r.x&&a>=i.y&&o<=r.y&&(_=[h.map((t=>new e.pointGeometry(t[0],t[1])))],(t<i.x||n>r.x||o<i.y||a>r.y)&&(_=e.clipLine(_,i.x,i.y,r.x,r.y)))}for(const e of _){o.reset(e,.25*t);let i=0;i=o.length<=.5*t?1:Math.ceil(o.paddedLength/m)+1;for(let e=0;e<i;e++){const r=e/Math.max(i-1,1),a=o.lerp(r),s=a.x+gt,l=a.y+gt;g.push(s,l,t,0);const c=s-t,h=l-t,f=s+t,p=l+t;if(D=D&&this.isOffscreen(c,h,f,p),P=P||this.isInsideGrid(c,h,f,p),!n&&this.grid.hitTestCircle(s,l,t,d)&&(I=!0,!u))return{circles:[],offscreen:!1,collisionDetected:I,occluded:!1}}}}return{circles:!u&&I||!P?[]:g,offscreen:D,collisionDetected:I,occluded:S.occluded}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const n=[];let i=1/0,r=1/0,o=-1/0,a=-1/0;for(const s of t){const t=new e.pointGeometry(s.x+gt,s.y+gt);i=Math.min(i,t.x),r=Math.min(r,t.y),o=Math.max(o,t.x),a=Math.max(a,t.y),n.push(t)}const s=this.grid.query(i,r,o,a).concat(this.ignoredGrid.query(i,r,o,a)),l={},c={};for(const t of s){const i=t.key;if(void 0===l[i.bucketInstanceId]&&(l[i.bucketInstanceId]={}),l[i.bucketInstanceId][i.featureIndex])continue;const r=[new e.pointGeometry(t.x1,t.y1),new e.pointGeometry(t.x2,t.y1),new e.pointGeometry(t.x2,t.y2),new e.pointGeometry(t.x1,t.y2)];e.polygonIntersectsPolygon(n,r)&&(l[i.bucketInstanceId][i.featureIndex]=!0,void 0===c[i.bucketInstanceId]&&(c[i.bucketInstanceId]=[]),c[i.bucketInstanceId].push(i.featureIndex))}return c}insertCollisionBox(e,t,n,i,r){(t?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:r},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,n,i,r){const o=t?this.ignoredGrid:this.grid,a={bucketInstanceId:n,featureIndex:i,collisionGroupID:r};for(let t=0;t<e.length;
vendor: 4,121 bytes, line 2
2t+=4)o.insertCircle(a,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(t,n,i,r,o,a,s){const l=[n,i,r,1];let c=!1;if(r||this.transform.pitch>0){e.transformMat4$1(l,l,t);const a="globe"===s.name;if(this.fogState&&o&&!a){const t=function(t,n,i,r,o,a){const s=a.calculateFogTileMatrix(o),l=[n,i,r];return e.transformMat4(l,l,s),C(t,l,a.pitch,a._fov)}(this.fogState,n,i,r,o.toUnwrapped(),this.transform);c=t>.9}}else mt(l,l,t);const u=l[3];return{point:new e.pointGeometry((l[0]/u+1)/2*this.transform.width+gt,(-l[1]/u+1)/2*this.transform.height+gt),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(s)/u*.5,1.5),signedDistanceFromCamera:u,occluded:a&&l[2]>u||c}}isOffscreen(e,t,n,i){return n<gt||e>=this.screenRightBoundary||i<gt||t>this.screenBottomBoundary}isInsideGrid(e,t,n,i){return n>=0&&e<this.gridRightBoundary&&i>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const t=e.identity([]);return e.translate(t,t,[-100,-100,0]),t}}function yt(t,n,i){const r=n.createTileMatrix(t,t.worldSize,i.toUnwrapped());return e.multiply(new Float32Array(16),t.projMatrix,r)}function vt(e,t,n){if(t.projection.name===n.projection.name)return e.projMatrix;const i=n.clone();return i.setProjection(t.projection),yt(i,t.getProjection(),e)}function xt(e,t,n){return t.name===n.projection.name?e.projMatrix:yt(n,t,e)}class bt{constructor(e,t,n,i){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):i&&n?1:0,this.placed=n}isHidden(){return 0===this.opacity&&!this.placed}}class wt{constructor(e,t,n,i,r,o=!1){this.text=new bt(e?e.text:null,t,n,r),this.icon=new bt(e?e.icon:null,t,i,r),this.clipped=o}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Et{constructor(e,t,n,i=!1){this.text=e,this.icon=t,this.skipFade=n,this.clipped=i}}class Tt{constructor(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]}}class St{constructor(e,t,n,i,r){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=n,this.bucketIndex=i,this.tileID=r}}class At{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function Ct(t,n,i,r,o){const{horizontalAlign:a,verticalAlign:s}=e.getAnchorAlignment(t),l=-(a-.5)*n,c=-(s-.5)*i,u=e.evaluateVariableOffset(t,r);return new e.pointGeometry(l+u[0]*o,c+u[1]*o)}function kt(t,n,i,r,o){const a=new e.pointGeometry(t,n);return i&&a._rotate(r?o:-o),a}class Mt{constructor(e,t,n,i,r){this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new _t(this.transform,r),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new At(n),this.collisionCircleArrays={},this.prevPlacement=i,i&&(i.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,n,i,r){const o=i.getBucket(n),a=i.latestFeatureIndex;if(!o||!a||n.id!==o.layerIds[0])return;const s=o.layers[0].layout,l=i.collisionBoxArray,c=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),u=i.tileSize/e.EXTENT,h=i.tileID.toUnwrapped();this.transform.setProjection(o.projection);const d=(f=i.tileID,p=o.getProjection(),m=this.transform,p.name===this.projection?m.calculateProjMatrix(f.toUnwrapped()):yt(m,p,f));var f,p,m;const g="map"===s.get("text-pitch-alignment"),_="map"===s.get("text-rotation-alignment");n.compileFilter();const y=n.dynamicFilter(),v=n.dynamicFilterNeedsFeature(),x=this.transform.calculatePixelsToTileUnitsMatrix(i),b=nt(d,i.tileID.canonical,g,_,this.transform,o.getProjection(),x);let w=null;if(g){const t=it(d,i.tileID.canonical,g,_,this.transform,o.getProjection(),x);w=e.multiply([],this.transform.labelPlaneMatrix,t)}let E=null;y&&i.latestFeatureIndex&&(E={unwrappedTileID:h,dynamicFilter:y,dynamicFilterNeedsFeature:v,featureIndex:i.latestFeatureIndex}),this.retainedQueryData[o.bucketInstanceId]=new St(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,i.tileID);
2const T={bucket:o,layout:s,posMatrix:d,textLabelPlaneMatrix:b,labelToScreenMatrix:w,clippingData:E,scale:c,textPixelRatio:u,holdingForFade:i.holdingForFade(),collisionBoxArray:l,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:e.evaluateSizeForZoom(o.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(r)for(const e of o.sortKeyRanges){const{sortKey:n,symbolInstanceStart:i,symbolInstanceEnd:r}=e;t.push({sortKey:n,symbolInstanceStart:i,symbolInstanceEnd:r,parameters:T})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:T})}attemptAnchorPlacement(e,t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_){const{textOffset0:y,textOffset1:v,crossTileID:x}=h,b=[y,v],w=Ct(e,n,i,b,r),E=this.collisionIndex.placeCollisionBox(f,r,t,kt(w.x,w.y,o,a,this.transform.angle),u,s,l,c.predicate);if(m){const e=f.getSymbolInstanceIconSize(_,this.transform.zoom,h.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(f,e,m,kt(w.x,w.y,o,a,this.transform.angle),u,s,l,c.predicate).box.length)return}if(E.box.length>0){let t;return this.prevPlacement&&this.prevPlacement.variableOffsets[x]&&this.prevPlacement.placements[x]&&this.prevPlacement.placements[x].text&&(t=this.prevPlacement.variableOffsets[x].anchor),this.variableOffsets[x]={textOffset:b,width:n,height:i,anchor:e,textScale:r,prevAnchor:t},this.markUsedJustification(f,e,h,p),f.allowVerticalPlacement&&(this.markUsedOrientation(f,p,h),this.placedOrientations[x]=p),{shift:w,placedGlyphBoxes:E}}}placeLayerBucketPart(t,n,i,r){const{bucket:o,layout:a,posMatrix:s,textLabelPlaneMatrix:l,labelToScreenMatrix:c,clippingData:u,textPixelRatio:h,holdingForFade:d,collisionBoxArray:f,partiallyEvaluatedTextSize:p,partiallyEvaluatedIconSize:m,collisionGroup:g}=t.parameters,_=a.get("text-optional"),y=a.get("icon-optional"),v=a.get("text-allow-overlap"),x=a.get("icon-allow-overlap"),b="map"===a.get("text-rotation-alignment"),w="map"===a.get("text-pitch-alignment"),E="none"!==a.get("icon-text-fit"),T="viewport-y"===a.get("symbol-z-order");this.transform.setProjection(o.projection);let S=v&&(x||!o.hasIconData()||y),A=x&&(v||!o.hasTextData()||_);!o.collisionArrays&&f&&o.deserializeCollisionBoxes(f),i&&r&&o.updateCollisionDebugBuffers(this.transform.zoom,f);const C=(t,r,f)=>{const{crossTileID:T,numVerticalGlyphVertices:C}=t;if(u){const i={zoom:this.transform.zoom,pitch:this.transform.pitch};let r=null;if(u.dynamicFilterNeedsFeature){const e=this.retainedQueryData[o.bucketInstanceId];r=u.featureIndex.loadFeature({featureIndex:t.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.s
vendor: 17,785 bytes, line 2
2ourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,u.dynamicFilter)(i,r,this.retainedQueryData[o.bucketInstanceId].tileID.canonical,new e.pointGeometry(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(u.unwrappedTileID)))return this.placements[T]=new Et(!1,!1,!1,!0),void(n[T]=!0)}if(n[T])return;if(d)return void(this.placements[T]=new Et(!1,!1,!1));let k=!1,M=!1,I=!0,P=!1,D=!1,z=null,L={box:null,offscreen:null,occluded:null},O={box:null,offscreen:null,occluded:null},R=null,B=null,F=null,N=0,j=0,U=0;f.textFeatureIndex?N=f.textFeatureIndex:t.useRuntimeCollisionCircles&&(N=t.featureIndex),f.verticalTextFeatureIndex&&(j=f.verticalTextFeatureIndex);const V=e=>{e.tileID=this.retainedQueryData[o.bucketInstanceId].tileID;const t=this.transform.elevation;(t||e.elevation)&&(e.elevation=t?t.getAtTileOffset(e.tileID,e.tileAnchorX,e.tileAnchorY):0)},G=f.textBox;if(G){V(G);const n=n=>{let i=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!n&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[T];e&&(this.placedOrientations[T]=e,i=e,this.markUsedOrientation(o,i,t))}return i},i=(t,n)=>{if(o.allowVerticalPlacement&&C>0&&f.verticalTextBox){for(const i of o.writingModes)if(i===e.WritingMode.vertical?(L=n(),O=L):L=t(),L&&L.box&&L.box.length)break}else L=t()};if(a.get("text-variable-anchor")){let l=a.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[T]){const e=this.prevPlacement.variableOffsets[T];l.indexOf(e.anchor)>0&&(l=l.filter((t=>t!==e.anchor)),l.unshift(e.anchor))}const c=(e,n,i)=>{const a=o.getSymbolInstanceTextSize(p,t,this.transform.zoom,r),c=(e.x2-e.x1)*a+2*e.padding,u=(e.y2-e.y1)*a+2*e.padding,d=E&&!x?n:null;d&&V(d);let f={box:[],offscreen:!1,occluded:!1};const _=v?2*l.length:l.length;for(let n=0;n<_;++n){const _=this.attemptAnchorPlacement(l[n%l.length],e,c,u,a,b,w,h,s,g,n>=l.length,t,r,o,i,d,p,m);if(_&&(f=_.placedGlyphBoxes,f&&f.box&&f.box.length)){k=!0,z=_.shift;break}}return f};i((()=>c(G,f.iconBox,e.WritingMode.horizontal)),(()=>{const t=f.verticalTextBox;return t&&V(t),o.allowVerticalPlacement&&!(L&&L.box&&L.box.length)&&C>0&&t?c(t,f.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null,occluded:null}})),L&&(k=L.box,I=L.offscreen,P=L.occluded);const u=n(L&&L.box);if(!k&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[T];e&&(this.variableOffsets[T]=e,this.markUsedJustification(o,e.anchor,t,u))}}else{const a=(n,i)=>{const a=o.getSymbolInstanceTextSize(p,t,this.transform.zoom,r),l=this.collisionIndex.placeCollisionBox(o,a,n,new e.pointGeometry(0,0),v,h,s,g.predicate);return l&&l.box&&l.box.length&&(this.markUsedOrientation(o,i,t),this.placedOrientations[T]=i),l};i((()=>a(G,e.WritingMode.horizontal)),(()=>{const t=f.verticalTextBox;return o.allowVerticalPlacement&&C>0&&t?(V(t),a(t,e.WritingMode.vertical)):{box:null,offscreen:null,occluded:null}})),n(L&&L.box&&L.box.length)}}if(R=L,k=R&&R.box&&R.box.length>0,I=R&&R.offscreen,P=R&&R.occluded,t.useRuntimeCollisionCircles){const n=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex),r=e.evaluateSizeForFeature(o.textSizeData,p,n),u=a.get("text-padding");B=this.collisionIndex.placeCollisionCircles(o,v,n,o.lineVertexArray,o.glyphOffsetArray,r,s,l,c,i,w,g.predicate,t.collisionCircleDiameter*r/e.ONE_EM,u,this.retainedQueryData[o.bucketInstanceId].tileID),k=v||B.circles.length>0&&!B.collisionDetected,I=I&&B.offscreen,P=B.occluded}if(f.iconFeatureIndex&&(U=f.iconFeatureIndex),f.iconBox){const n=n=>{V(n);const i=E&&z?kt(z.x,z.y,b,w,this.transform.angle):new e.pointGeometry(0,0),r=o.getSymbolInstanceIconSize(m,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(o,r,n,i,x,h,s,g.predicate)};O&&O.box&&O.box.length&&f.verticalIconBox?(F=n(f.verticalIconBox),M=F.box.length>0):(F=n(f.iconBox),M=F.box.length>0),I=I&&F.offscreen,D=F.occluded}const q=_||0===t.numHorizontalGlyphVertices&&0===C,$=y||0===t.numIconVertices;if(q||$?$?q||(M=M&&k):k=M&&k:M=k=M&&k,k&&R&&R.box&&this.collisionIndex.insertCollisionBox(R.box,a.get("text-ignore-placement"),o.bucketInstanceId,O&&O.box&&j?j:N,g.ID),M&&F&&this.collisionIndex.insertCollisionBox(F.box,a.get("icon-ignore-placement"),o.bucketInstanceId,U,g.ID),B&&(k&&this.collisionIndex.insertCollisionCircles(B.circles,a.get("text-ignore-placement"),o.bucketInstanceId,N,g.ID),i)){const e=o.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new Tt);for(let e=0;e<B.circles.length;e+=4)t.circles.push(B.circles[e+0]),t.circles.push(B.circles[e+1]),t.circles.push(B.circles[e+2]),t.circles.push(B.collisionDetected?1:0)}const W="globe"!==o.projection.name;S=S&&(W||!P),A=A&&(W||!D),this.placements[T]=new Et(k||S,M||A,I||o.justReloaded),n[T]=!0};if(T){const e=o.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){const n=e[t];C(o.symbolInstances.get(n),n,o.collisionArrays[n])}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)C(o.symbolInstances.get(e),e,o.collisionArrays[e]);if(i&&o.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[o.bucketInstanceId];e.invert(t.invProjMatrix,s),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1}markUsedJustification(t,n,i,r){const{leftJustifiedTextSymbolIndex:o,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:s,verticalPlacedTextSymbolIndex:l,crossTileID:c}=i,u=e.getAnchorJustification(n),h=r===e.WritingMode.vertical?l:"left"===u?o:"center"===u?a:"right"===u?s:-1;o>=0&&(t.text.placedSymbolArray.get(o).crossTileID=h>=0&&o!==h?0:c),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=h>=0&&a!==h?0:c),s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=h>=0&&s!==h?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=h>=0&&l!==h?0:c)}markUsedOrientation(t,n,i){const r=n===e.WritingMode.horizontal||n===e.WritingMode.horizontalOnly?n:0,o=n===e.WritingMode.vertical?n:0,{leftJustifiedTextSymbolIndex:a,centerJustifiedTextSymbolIndex:s,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=i,u=t.text.placedSymbolArray;a>=0&&(u.get(a).placedOrientation=r),s>=0&&(u.get(s).placedOrientation=r),l>=0&&(u.get(l).placedOrientation=r),c>=0&&(u.get(c).placedOrientation=o)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let n=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const i=t?t.symbolFadeChange(e):1,r=t?t.opacities:{},o=t?t.variableOffsets:{},a=t?t.placedOrientations:{};for(const e in this.placements){const t=this.placements[e],o=r[e];o?(this.opacities[e]=new wt(o,i,t.text,t.icon,null,t.clipped),n=n||t.text!==o.text.placed||t.icon!==o.icon.placed):(this.opacities[e]=new wt(null,i,t.text,t.icon,t.skipFade,t.clipped),n=n||t.text||t.icon)}for(const e in r){const t=r[e];if(!this.opacities[e]){const r=new wt(t,i,!1,!1);r.isHidden()||(this.opacities[e]=r,n=n||t.text.placed||t.icon.placed)}}for(const e in o)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=o[e]);for(const e in a)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=a[e]);n?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){const n={};for(const i of t){const t=i.getBucket(e);t&&i.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,n,i.collisionBoxArray)}}updateBucketOpacities(t,n,i){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const r=t.layers[0].layout,o=!!t.layers[0].dynamicFilter(),a=new wt(null,0,!1,!1,!0),s=r.get("text-allow-overlap"),l=r.get("icon-allow-overlap"),c=r.get("text-variable-anchor"),u="map"===r.get("text-rotation-alignment"),h="map"===r.get("text-pitch-alignment"),d="none"!==r.get("icon-text-fit"),f=new wt(null,0,s&&(l||!t.hasIconData()||r.get("icon-optional")),l&&(s||!t.hasTextData()||r.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);const p=(e,t,n)=>{for(let i=0;i<t/4;i++)e.opacityVertexArray.emplaceBack(n)};let m=0;for(let i=0;i<t.symbolInstances.length;i++){const r=t.symbolInstances.get(i),{numHorizontalGlyphVertices:s,numVerticalGlyphVertices:l,crossTileID:g,numIconVertices:_}=r;let y=this.opacities[g];n[g]?y=a:y||(y=f,this.opacities[g]=y),n[g]=!0;const v=s>0||l>0,x=_>0,b=this.placedOrientations[g],w=b===e.WritingMode.vertical,E=b===e.WritingMode.horizontal||b===e.WritingMode.horizontalOnly;if(!v&&!x||y.isHidden()||m++,v){const e=Ft(y.text);p(t.text,s,w?Nt:e),p(t.text,l,E?Nt:e);const n=y.text.isHidden(),{leftJustifiedTextSymbolIndex:i,centerJustifiedTextSymbolIndex:o,rightJustifiedTextSymbolIndex:a,verticalPlacedTextSymbolIndex:c}=r,u=t.text.placedSymbolArray,h=n||w?1:0;i>=0&&(u.get(i).hidden=h),o>=0&&(u.get(o).hidden=h),a>=0&&(u.get(a).hidden=h),c>=0&&(u.get(c).hidden=n||E?1:0);const d=this.variableOffsets[g];d&&this.markUsedJustification(t,d.anchor,r,b);const f=this.placedOrientations[g];f&&(this.markUsedJustification(t,"left",r,f),this.markUsedOrientation(t,f,r))}if(x){const e=Ft(y.icon),{placedIconSymbolIndex:n,verticalPlacedIconSymbolIndex:i}=r,o=t.icon.placedSymbolArray,a=y.icon.isHidden()?1:0;n>=0&&(p(t.icon,_,w?Nt:e),o.get(n).hidden=a),i>=0&&(p(t.icon,r.numVerticalIconVertices,E?Nt:e),o.get(i).hidden=a)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const n=t.collisionArrays[i];if(n){let i=new e.pointGeometry(0,0),r=!0;if(n.textBox||n.verticalTextBox){if(c){const e=this.variableOffsets[g];e?(i=Ct(e.anchor,e.width,e.height,e.textOffset,e.textScale),u&&i._rotate(h?this.transform.angle:-this.transform.angle)):r=!1}o&&(r=!y.clipped),n.textBox&&It(t.textCollisionBox.collisionVertexArray,y.text.placed,!r||w,i.x,i.y),n.verticalTextBox&&It(t.textCollisionBox.collisionVertexArray,y.text.placed,!r||E,i.x,i.y)}const a=r&&Boolean(!E&&n.verticalIconBox);n.iconBox&&It(t.iconCollisionBox.collisionVertexArray,y.icon.placed,a,d?i.x:0,d?i.y:0),n.verticalIconBox&&It(t.iconCollisionBox.collisionVertexArray,y.icon.placed,!a,d?i.x:0,d?i.y:0)}}}if(t.fullyClipped=0===m,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){const n=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*n>e}setStale(){this.stale=!0}}function It(e,t,n,i,r){e.emplaceBack(t?1:0,n?1:0,i||0,r||0),e.emplaceBack(t?1:0,n?1:0,i||0,r||0),e.emplaceBack(t?1:0,n?1:0,i||0,r||0),e.emplaceBack(t?1:0,n?1:0,i||0,r||0)}const Pt=Math.pow(2,25),Dt=Math.pow(2,24),zt=Math.pow(2,17),Lt=Math.pow(2,16),Ot=Math.pow(2,9),Rt=Math.pow(2,8),Bt=Math.pow(2,1);function Ft(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,n=Math.floor(127*e.opacity);return n*Pt+t*Dt+n*zt+t*Lt+n*Ot+t*Rt+n*Bt+t}const Nt=0;class jt{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,n,i,r){const o=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(o,i,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,r())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort(((e,t)=>e.sortKey-t.sortKey)));this._currentPartIndex<o.length;){const e=o[this._currentPartIndex];if(t.placeLayerBucketPart(e,this._seenCrossTileIDs,n,0===e.symbolInstanceStart),this._currentPartIndex++,r())return!0}return!1}}class Ut{constructor(e,t,n,i,r,o,a,s){this.placement=new Mt(e,r,o,a,s),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=i,this._done=!1}isDone(){return this._done}continuePlacement(t,n,i){const r=e.exported.now(),o=()=>{const t=e.exported.now()-r;return!this._forceFullPlacement&&t>2};for(;this._currentPlacementIndex>=0;){const e=n[t[this._currentPlacementIndex]],r=this.placement.collisionIndex.transform.zoom;if("symbol"===e.type&&(!e.minzoom||e.minzoom<=r)&&(!e.maxzoom||e.maxzoom>r)){if(this._inProgressLayer||(this._inProgressLayer=new jt(e)),this._inProgressLayer.continuePlacement(i[e.source],this.placement,this._showCollisionBoxes,e,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const Vt=512/e.EXTENT/2;class Gt{constructor(e,t,n){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(let n=0;n<t.length;n++){const i=t.get(n),r=i.key;this.indexedSymbolInstances[r]||(this.indexedSymbolInstances[r]=[]),this.indexedSymbolInstances[r].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,e)})}}getScaledCoordinates(t,n){const i=Vt/Math.pow(2,n.canonical.z-this.tileID.canonical.z);return{x:Math.floor((n.canonical.x*e.EXTENT+t.tileAnchorX)*i),y:Math.floor((n.canonical.y*e.EXTENT+t.tileAnchorY)*i)}}findMatches(e,t,n){const i=this.tileID.canonical.z<t.canonical.z?1:Math.pow(2,this.tileID.canonical.z-t.canonical.z);for(let r=0;r<e.length;r++){const o=e.get(r);if(o.crossTileID)continue;const a=this.indexedSymbolInstances[o.key];if(!a)continue;const s=this.getScaledCoordinates(o,t);for(const e of a)if(Math.abs(e.coord.x-s.x)<=i&&Math.abs(e.coord.y-s.y)<=i&&!n[e.crossTileID]){n[e.crossTileID]=!0,o.crossTileID=e.crossTileID;break}}}}class qt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class $t{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const e in this.indexes){const n=this.indexes[e],i={};for(const e in n){const r=n[e];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),i[r.tileID.key]=r}this.indexes[e]=i}this.lng=e}addBucket(e,t,n){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const i=this.usedCrossTileIDs[e.overscaledZ];for(const n in this.indexes){const r=this.indexes[n];if(Number(n)>e.overscaledZ)for(const n in r){const o=r[n];o.tileID.isChildOf(e)&&o.findMatches(t.symbolInstances,e,i)}else{const o=r[e.scaledTo(Number(n)).key];o&&o.findMatches(t.symbolInstances,e,i)}}for(let e=0;e<t.symbolInstances.length;e++){const r=t.symbolInstances.get(e);r.crossTileID||(r.crossTileID=n.generate(),i[r.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Gt(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const n in t.indexedSymbolInstances)for(const i of t.indexedSymbolInstances[n])delete this.usedCrossTileIDs[e][i.crossTileID]}removeStaleBuckets(e){let t=!1;for(const n in this.indexes){const i=this.indexes[n];for(const r in i)e[i[r].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,i[r]),delete i[r],t=!0)}return t}}class Wt{constructor(){this.layerIndexes={},this.crossTileIDs=new qt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,n,i){let r=this.layerIndexes[e.id];void 0===r&&(r=this.layerIndexes[e.id]=new $t);let o=!1;const a={};"globe"!==i.name&&r.handleWrapJump(n);for(const n of t){const t=n.getBucket(e);t&&e.id===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(n.tileID,t,this.crossTileIDs)&&(o=!0),a[t.bucketInstanceId]=!0)}return r.removeStaleBuckets(a)&&(o=!0),o}pruneUnusedLayers(e){const t={};e.forEach((e=>{t[e]=!0}));for(const e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}const Zt=(t,n)=>e.emitValidationErrors(t,n&&n.filter((e=>"source.canvas"!==e.identifier))),Xt=e.pick(qe,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection"]),Ht=e.pick(qe,["setCenter","setZoom","setBearing","setP
2itch"]),Yt={version:8,layers:[],sources:{}},Kt={fill:!0,line:!0,background:!0,hillshade:!0,raster:!0};class Jt extends e.Evented{constructor(t,n={}){super(),this.map=t,this.dispatcher=new D(Ue(),this),this.imageManager=new x,this.imageManager.setEventedParent(this),this.glyphManager=new e.GlyphManager(t._requestManager,n.localFontFamily?e.LocalGlyphMode.all:n.localIdeographFontFamily?e.LocalGlyphMode.ideographs:e.LocalGlyphMode.none,n.localFontFamily||n.localIdeographFontFamily),this.crossTileSymbolIndex=new Wt,this._layers={},this._num3DLayers=0,this._numSymbolLayers=0,this._numCircleLayers=0,this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._availableImages=[],this._order=[],this._drapedFirstOrder=[],this._markersNeedUpdate=!1,this._resetUpdates(),this.dispatcher.broadcast("setReferrer",e.getReferrer());const i=this;this._rtlTextPluginCallback=Jt.registerForPluginStateChange((t=>{i.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},((t,n)=>{if(e.triggerPluginCompletionEvent(t),n&&n.every((e=>e)))for(const e in i._sourceCaches){const t=i._sourceCaches[e],n=t.getSource().type;"vector"!==n&&"geojson"!==n||t.reload()}}))})),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.getSource(e.sourceId);if(t&&t.vectorLayerIds)for(const e in this._layers){const n=this._layers[e];n.source===t.id&&this._validateLayer(n)}}))}loadURL(t,n={}){this.fire(new e.Event("dataloading",{dataType:"style"}));const i="boolean"==typeof n.validate?n.validate:!e.isMapboxURL(t);t=this.map._requestManager.normalizeStyleURL(t,n.accessToken);const r=this.map._requestManager.transformRequest(t,e.ResourceType.Style);
vendor: 32,619 bytes, line 2
2this._request=e.getJSON(r,((t,n)=>{this._request=null,t?this.fire(new e.ErrorEvent(t)):n&&this._load(n,i)}))}loadJSON(t,n={}){this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.exported.frame((()=>{this._request=null,this._load(t,!1!==n.validate)}))}loadEmpty(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(Yt,!1)}_updateLayerCount(e,t){const n=t?1:-1;e.is3D()&&(this._num3DLayers+=n),"circle"===e.type&&(this._numCircleLayers+=n),"symbol"===e.type&&(this._numSymbolLayers+=n)}_load(t,n){if(n&&Zt(this,e.validateStyle(t)))return;this._loaded=!0,this.stylesheet=e.clone$1(t),this._updateMapProjection();for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1});this._changed=!1,t.sprite?this._loadSprite(t.sprite):(this.imageManager.setLoaded(!0),this.dispatcher.broadcast("spriteLoaded",!0)),this.glyphManager.setURL(t.glyphs);const i=Ge(this.stylesheet.layers);this._order=i.map((e=>e.id)),this._layers={},this._serializedLayers={};for(let t of i)t=e.createStyleLayer(t),t.setEventedParent(this,{layer:{id:t.id}}),this._layers[t.id]=t,this._serializedLayers[t.id]=t.serialize(),this._updateLayerCount(t,!0);this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new E(this.stylesheet.light),this.stylesheet.terrain&&!this.terrainSetForDrapingOnly()&&this._createTerrain(this.stylesheet.terrain,1),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this._updateDrapeFirstLayers(),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?this.getTerrain()||this.stylesheet.terrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null))}_updateMapProjection(){this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.stylesheet.projection)}_loadSprite(t){this._spriteRequest=function(t,n,i){let r,o,a;const s=e.exported.devicePixelRatio>1?"@2x":"";let l=e.getJSON(n.transformRequest(n.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),((e,t)=>{l=null,a||(a=e,r=t,u())})),c=e.getImage(n.transformRequest(n.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),((e,t)=>{c=null,a||(a=e,o=t,u())}));function u(){if(a)i(a);else if(r&&o){const t=e.exported.getImageData(o),n={};for(const i in r){const{width:o,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:d,content:f}=r[i],p=new e.RGBAImage({width:o,height:a});e.RGBAImage.copy(t,p,{x:s,y:l},{x:0,y:0},{width:o,height:a}),n[i]={data:p,pixelRatio:u,sdf:c,stretchX:h,stretchY:d,content:f}}i(null,n)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,((t,n)=>{if(this._spriteRequest=null,t)this.fire(new e.ErrorEvent(t));else if(n)for(const e in n)this.imageManager.addImage(e,n[e]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.dispatcher.broadcast("spriteLoaded",!0),this.fire(new e.Event("data",{dataType:"style"}))}))}_validateLayer(t){const n=this.getSource(t.source);if(!n)return;const i=t.sourceLayer;i&&("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(i))&&this.fire(new e.ErrorEvent(new Error(`Source layer "${i}" does not exist on source "${n.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(e){const t=[];for(const n of e){const e=this._layers[n];"custom"!==e.type&&t.push(e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.fog&&this.fog.hasTransition())return!0;for(const e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}get order(){return this.map._optimizeForTerrain&&this.terrain?this._drapedFirstOrder:this._order}isLayerDraped(e){return!!this.terrain&&Kt[e.type]}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}update(t){if(!this._loaded)return;const n=this._changed;if(this._changed){const e=Object.keys(this._updatedLayers),n=Object.keys(this._removedLayers);(e.length||n.length)&&this._updateWorkerLayers(e,n);for(const e in this._updatedSources){const t=this._updatedSources[e];"reload"===t?this._reloadSource(e):"clear"===t&&this._clearSource(e)}this._updateTilesForChangedImages();for(const e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this._resetUpdates()}const i={};for(const e in this._sourceCaches){const t=this._sourceCaches[e];i[e]=t.used,t.used=!1}for(const e of this._order){const n=this._layers[e];if(n.recalculate(t,this._availableImages),!n.isHidden(t.zoom)){const e=this._getLayerSourceCache(n);e&&(e.used=!0)}const i=this.map.painter;if(i){const e=n.getProgramIds();if(!e)continue;const r=n.getProgramConfiguration(t.zoom);for(const t of e)i.useProgram(t,r)}}for(const t in i){const n=this._sourceCaches[t];i[t]!==n.used&&n.getSource().fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:n.getSource().id}))}this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),n&&this.fire(new e.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const t in this._sourceCaches)this._sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setState(n){if(this._checkLoaded(),Zt(this,e.validateStyle(n)))return!1;(n=e.clone$1(n)).layers=Ge(n.layers);const i=function(e,n){if(!e)return[{command:qe.setStyle,args:[n]}];let i=[];try{if(!t(e.version,n.version))return[{command:qe.setStyle,args:[n]}];t(e.center,n.center)||i.push({command:qe.setCenter,args:[n.center]}),t(e.zoom,n.zoom)||i.push({command:qe.setZoom,args:[n.zoom]}),t(e.bearing,n.bearing)||i.push({command:qe.setBearing,args:[n.bearing]}),t(e.pitch,n.pitch)||i.push({command:qe.setPitch,args:[n.pitch]}),t(e.sprite,n.sprite)||i.push({command:qe.setSprite,args:[n.sprite]}),t(e.glyphs,n.glyphs)||i.push({command:qe.setGlyphs,args:[n.glyphs]}),t(e.transition,n.transition)||i.push({command:qe.setTransition,args:[n.transition]}),t(e.light,n.light)||i.push({command:qe.setLight,args:[n.light]}),t(e.fog,n.fog)||i.push({command:qe.setFog,args:[n.fog]}),t(e.projection,n.projection)||i.push({command:qe.setProjection,args:[n.projection]});const r={},o=[];!function(e,n,i,r){let o;for(o in n=n||{},e=e||{})e.hasOwnProperty(o)&&(n.hasOwnProperty(o)||We(o,i,r));for(o in n)n.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t(e[o],n[o])||("geojson"===e[o].type&&"geojson"===n[o].type&&Xe(e,n,o)?i.push({command:qe.setGeoJSONSourceData,args:[o,n[o].data]}):Ze(o,n,i,r)):$e(o,n,i))}(e.sources,n.sources,o,r);const a=[];e.layers&&e.layers.forEach((e=>{e.source&&r[e.source]?i.push({command:qe.removeLayer,args:[e.id]}):a.push(e)}));let s=e.terrain;s&&r[s.source]&&(i.push({command:qe.setTerrain,args:[void 0]}),s=void 0),i=i.concat(o),t(s,n.terrain)||i.push({command:qe.setTerrain,args:[n.terrain]}),function(e,n,i){n=n||[];const r=(e=e||[]).map(Ye),o=n.map(Ye),a=e.reduce(Ke,{}),s=n.reduce(Ke,{}),l=r.slice(),c=Object.create(null);let u,h,d,f,p,m,g;for(u=0,h=0;u<r.length;u++)d=r[u],s.hasOwnProperty(d)?h++:(i.push({command:qe.removeLayer,args:[d]}),l.splice(l.indexOf(d,h),1));for(u=0,h=0;u<o.length;u++)d=o[o.length-1-u],l[l.length-1-u]!==d&&(a.hasOwnProperty(d)?(i.push({command:qe.removeLayer,args:[d]}),l.splice(l.lastIndexOf(d,l.length-h),1)):h++,m=l[l.length-u],i.push({command:qe.addLayer,args:[s[d],m]}),l.splice(l.length-u,0,d),c[d]=!0);for(u=0;u<o.length;u++)if(d=o[u],f=a[d],p=s[d],!c[d]&&!t(f,p))if(t(f.source,p.source)&&t(f["source-layer"],p["source-layer"])&&t(f.type,p.type)){for(g in He(f.layout,p.layout,i,d,null,qe.setLayoutProperty),He(f.paint,p.paint,i,d,null,qe.setPaintProperty),t(f.filter,p.filter)||i.push({command:qe.setFilter,args:[d,p.filter]}),t(f.minzoom,p.minzoom)&&t(f.maxzoom,p.maxzoom)||i.push({command:qe.setLayerZoomRange,args:[d,p.minzoom,p.maxzoom]}),f)f.hasOwnProperty(g)&&"layout"!==g&&"paint"!==g&&"filter"!==g&&"metadata"!==g&&"minzoom"!==g&&"maxzoom"!==g&&(0===g.indexOf("paint.")?He(f[g],p[g],i,d,g.slice(6),qe.setPaintProperty):t(f[g],p[g])||i.push({command:qe.setLayerProperty,args:[d,g,p[g]]}));for(g in p)p.hasOwnProperty(g)&&!f.hasOwnProperty(g)&&"layout"!==g&&"paint"!==g&&"filter"!==g&&"metadata"!==g&&"minzoom"!==g&&"maxzoom"!==g&&(0===g.indexOf("paint.")?He(f[g],p[g],i,d,g.slice(6),qe.setPaintProperty):t(f[g],p[g])||i.push({command:qe.setLayerProperty,args:[d,g,p[g]]}))}else i.push({command:qe.removeLayer,args:[d]}),m=l[l.lastIndexOf(d)+1],i.push({command:qe.addLayer,args:[p,m]})}(a,n.layers,i)}catch(e){console.warn("Unable to compute style diff:",e),i=[{command:qe.setStyle,args:[n]}]}return i}(this.serialize(),n).filter((e=>!(e.command in Ht)));if(0===i.length)return!1;const r=i.filter((e=>!(e.command in Xt)));if(r.length>0)throw new Error(`Unimplemented: ${r.map((e=>e.command)).join(", ")}.`);return i.forEach((e=>{"setTransition"!==e.command&&"setProjection"!==e.command&&this[e.command].apply(this,e.args)})),this.stylesheet=n,this._updateMapProjection(),!0}addImage(t,n){return this.getImage(t)?this.fire(new e.ErrorEvent(new Error("An image with this name already exists."))):(this.imageManager.addImage(t,n),this._afterImageUpdated(t),this)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t),this._afterImageUpdated(t),this):this.fire(new e.ErrorEvent(new Error("No image with this name exists.")))}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addSource(t,n,i={}){if(this._checkLoaded(),void 0!==this.getSource(t))throw new Error("There is already a source with this ID");if(!n.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(n).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(n.type)>=0&&this._validate(e.validateSource,`sources.${t}`,n,null,i))return;this.map&&this.map._collectResourceTiming&&(n.collectResourceTiming=!0);const r=De(t,n,this.dispatcher,this);r.setEventedParent(this,(()=>({isSourceLoaded:this._isSourceCacheLoaded(t),source:r.serialize(),sourceId:t})));const o=n=>{const i=(n?"symbol:":"other:")+t,o=this._sourceCaches[i]=new e.SourceCache(i,r,n);(n?this._symbolSourceCaches:this._otherSourceCaches)[t]=o,o.style=this,o.onAdd(this.map)};o(!1),"vector"!==n.type&&"geojson"!==n.type||o(!0),r.onAdd&&r.onAdd(this.map),this._changed=!0}removeSource(t){this._checkLoaded();const n=this.getSource(t);if(!n)throw new Error("There is no source with this ID");for(const n in this._layers)if(this._layers[n].source===t)return this.fire(new e.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${n}" is using it.`)));if(this.terrain&&this.terrain.get().source===t)return this.fire(new e.ErrorEvent(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));const i=this._getSourceCaches(t);for(const t of i)delete this._sourceCaches[t.id],delete this._updatedSources[t.id],t.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t.getSource().id})),t.setEventedParent(null),t.clearTiles();return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],n.setEventedParent(null),n.onRemove&&n.onRemove(this.map),this._changed=!0,this}setGeoJSONSourceData(e,t){this._checkLoaded(),this.getSource(e).setData(t),this._changed=!0}getSource(e){const t=this._getSourceCache(e);return t&&t.getSource()}_getSources(){const e=[];for(const t in this._otherSourceCaches){const n=this._getSourceCache(t);n&&e.push(n.getSource())}return e}addLayer(t,n,i={}){this._checkLoaded();const r=t.id;if(this.getLayer(r))return void this.fire(new e.ErrorEvent(new Error(`Layer with id "${r}" already exists on this map`)));let o;if("custom"===t.type){if(Zt(this,e.validateCustomStyleLayer(t)))return;o=e.createStyleLayer(t)}else{if("object"==typeof t.source&&(this.addSource(r,t.source),t=e.clone$1(t),t=e.extend(t,{source:r})),this._validate(e.validateLayer,`layers.${r}`,t,{arrayIndex:-1},i))return;o=e.createStyleLayer(t),this._validateLayer(o),o.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[o.id]=o.serialize(),this._updateLayerCount(o,!0)}const a=n?this._order.indexOf(n):this._order.length;if(n&&-1===a)return void this.fire(new e.ErrorEvent(new Error(`Layer with id "${n}" does not exist on this map.`)));this._order.splice(a,0,r),this._layerOrderChanged=!0,this._layers[r]=o;const s=this._getLayerSourceCache(o);if(this._removedLayers[r]&&o.source&&s&&"custom"!==o.type){const e=this._removedLayers[r];delete this._removedLayers[r],e.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",s.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),this._updateDrapeFirstLayers()}moveLayer(t,n){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===n)return;const i=this._order.indexOf(t);this._order.splice(i,1);const r=n?this._order.indexOf(n):this._order.length;n&&-1===r?this.fire(new e.ErrorEvent(new Error(`Layer with id "${n}" does not exist on this map.`))):(this._order.splice(r,0,t),this._layerOrderChanged=!0,this._updateDrapeFirstLayers())}removeLayer(t){this._checkLoaded();const n=this._layers[t];if(!n)return void this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be removed.`)));n.setEventedParent(null),this._updateLayerCount(n,!1);const i=this._order.indexOf(t);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=n,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],n.onRemove&&n.onRemove(this.map),this._updateDrapeFirstLayers()}getLayer(e){return this._layers[e]}hasLayer(e){return e in this._layers}hasLayerType(e){for(const t in this._layers)if(this._layers[t].type===e)return!0;return!1}setLayerZoomRange(t,n,i){this._checkLoaded();const r=this.getLayer(t);r?r.minzoom===n&&r.maxzoom===i||(null!=n&&(r.minzoom=n),null!=i&&(r.maxzoom=i),this._updateLayer(r)):this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot have zoom extent.`)))}setFilter(n,i,r={}){this._checkLoaded();const o=this.getLayer(n);if(o){if(!t(o.filter,i))return null==i?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(e.validateFilter,`layers.${o.id}.filter`,i,{layerType:o.type},r)||(o.filter=e.clone$1(i),this._updateLayer(o)))}else this.fire(new e.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be filtered.`)))}getFilter(t){const n=this.getLayer(t);return n&&e.clone$1(n.filter)}setLayoutProperty(n,i,r,o={}){this._checkLoaded();const a=this.getLayer(n);a?t(a.getLayoutProperty(i),r)||(a.setLayoutProperty(i,r,o),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be styled.`)))}getLayoutProperty(t,n){const i=this.getLayer(t);if(i)return i.getLayoutProperty(n);this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style.`)))}setPaintProperty(n,i,r,o={}){this._checkLoaded();const a=this.getLayer(n);a?t(a.getPaintProperty(i),r)||(a.setPaintProperty(i,r,o)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new e.ErrorEvent(new Error(`The layer '${n}' does not exist in the map's style and cannot be styled.`)))}getPaintProperty(e,t){const n=this.getLayer(e);return n&&n.getPaintProperty(t)}setFeatureState(t,n){this._checkLoaded();const i=t.source,r=t.sourceLayer,o=this.getSource(i);if(!o)return void this.fire(new e.ErrorEvent(new Error(`The source '${i}' does not exist in the map's style.`)));const a=o.type;if("geojson"===a&&r)return void this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===a&&!r)return void this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided.")));const s=this._getSourceCaches(i);for(const e of s)e.setFeatureState(r,t.id,n)}removeFeatureState(t,n){this._checkLoaded();const i=t.source,r=this.getSource(i);if(!r)return void this.fire(new e.ErrorEvent(new Error(`The source '${i}' does not exist in the map's style.`)));const o=r.type,a="vector"===o?t.sourceLayer:void 0;if("vector"===o&&!a)return void this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));if(n&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property.")));const s=this._getSourceCaches(i);for(const e of s)e.removeFeatureState(a,t.id,n)}getFeatureState(t){this._checkLoaded();const n=t.source,i=t.sourceLayer,r=this.getSource(n);if(r){if("vector"!==r.type||i)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),this._getSourceCaches(n)[0].getFeatureState(i,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error(`The source '${n}' does not exist in the map's style.`)))}getTransition(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){const t={};for(const e in this._sourceCaches){const n=this._sourceCaches[e].getSource();t[n.id]||(t[n.id]=n.serialize())}return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,terrain:this.getTerrain()||void 0,fog:this.stylesheet.fog,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:t,layers:this._serializeLayers(this._order)},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0;const t=this._getLayerSourceCache(e);e.source&&!this._updatedSources[e.source]&&t&&"raster"!==t.getSource().type&&(this._updatedSources[e.source]="reload",t.pause()),this._changed=!0,e.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(e){const t=e=>"fill-extrusion"===this._layers[e].type,n={},i=[];for(let r=this._order.length-1;r>=0;r--){const o=this._order[r];if(t(o)){n[o]=r;for(const t of e){const e=t[o];if(e)for(const t of e)i.push(t)}}}i.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const r=[];for(let o=this._order.length-1;o>=0;o--){const a=this._order[o];if(t(a))for(let e=i.length-1;e>=0;e--){const t=i[e].feature;if(n[t.layer.id]<o)break;r.push(t),i.pop()}else for(const t of e){const e=t[a];if(e)for(const t of e)r.push(t.feature)}}return r}queryRenderedFeatures(t,n,i){n&&n.filter&&this._validate(e.validateFilter,"queryRenderedFeatures.filter",n.filter,null,n);const r={};if(n&&n.layers){if(!Array.isArray(n.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const t of n.layers){const n=this._layers[t];if(!n)return this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];r[n.source]=!0}}const o=[];n.availableImages=this._availableImages;const a=n&&n.layers?n.layers.some((e=>{const t=this.getLayer(e);return t&&t.is3D()})):this.has3DLayers(),s=L.createFromScreenPoints(t,i);for(const e in this._sourceCaches){const t=this._sourceCaches[e].getSource().id;n.layers&&!r[t]||o.push(Le(this._sourceCaches[e],this._layers,this._serializedLayers,s,n,i,a,!!this.map._showQueryGeometry))}return this.placement&&o.push(function(e,t,n,i,r,o,a){const s={},l=o.queryRenderedSymbols(i),c=[];for(const e of Object.keys(l).map(Number))c.push(a[e]);c.sort(Re);for(const n of c){const i=n.featureIndex.lookupSymbolFeatures(l[n.bucketInstanceId],t,n.bucketIndex,n.sourceLayerIndex,r.filter,r.layers,r.availableImages,e);for(const e in i){const t=s[e]=s[e]||[],r=i[e];r.sort(((e,t)=>{const i=n.featureSortOrder;if(i){const n=i.indexOf(e.featureIndex);return i.indexOf(t.featureIndex)-n}return t.featureIndex-e.featureIndex}));for(const e of r)t.push(e)}}for(const t in s)s[t].forEach((i=>{const r=i.feature,o=n(e[t]).getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=o}));return s}(this._layers,this._serializedLayers,this._getLayerSourceCache.bind(this),s.screenGeometry,n,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(t,n){n&&n.filter&&this._validate(e.validateFilter,"querySourceFeatures.filter",n.filter,null,n);const i=this._getSourceCaches(t);let r=[];for(const e of i)r=r.concat(Oe(e,n));return r}addSourceType(e,t,n){return Jt.getSourceType(e)?n(new Error(`A source type called "${e}" already exists.`)):(Jt.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},n):n(null,null))}getLight(){return this.light.getLight()}setLight(e,n={}){this._checkLoaded();const i=this.light.getLight();let r=!1;for(const n in e)if(!t(e[n],i[n])){r=!0;break}if(!r)return;const o=this._setTransitionParameters({duration:300,delay:0});this.light.setLight(e,n),this.light.updateTransitions(o)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}setTerrain(n,i=1){if(this._checkLoaded(),!n)return delete this.terrain,delete this.stylesheet.terrain,this.dispatcher.broadcast("enableTerrain",!1),this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);if(1===i){if("object"==typeof n.source){const t="terrain-dem-src";this.addSource(t,n.source),n=e.clone$1(n),n=e.extend(n,{source:t})}if(this._validate(e.validateTerrain,"terrain",n))return}if(!this.terrain||this.terrain&&i!==this.terrain.drapeRenderMode)this._createTerrain(n,i);else{const i=this.terrain,r=i.get();for(const t of Object.keys(e.spec.terrain))!n.hasOwnProperty(t)&&e.spec.terrain[t].default&&(n[t]=e.spec.terrain[t].default);for(const e in n)if(!t(n[e],r[e])){i.set(n),this.stylesheet.terrain=n;const e=this._setTransitionParameters({duration:0});i.updateTransitions(e);break}}this._updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){const t=this.fog=new P(e,this.map.transform);this.stylesheet.fog=e;const n=this._setTransitionParameters({duration:0});t.updateTransitions(n)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask((()=>{for(const e of this.map._markers)e._evaluateOpacity()}))}getFog(){return this.fog?this.fog.get():null}setFog(e){if(this._checkLoaded(),!e)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const n=this.fog,i=n.get();0===Object.keys(e).length&&n.set(e);for(const r in e)if(!t(e[r],i[r])){n.set(e),this.stylesheet.fog=e;const t=this._setTransitionParameters({duration:0});n.updateTransitions(t);break}}else this._createFog(e);this._markersNeedUpdate=!0}_setTransitionParameters(t){return{now:e.exported.now(),transition:e.extend(t,this.stylesheet.transition)}}_updateDrapeFirstLayers(){if(!this.map._optimizeForTerrain||!this.terrain)return;const e=this._order.filter((e=>this.isLayerDraped(this._layers[e]))),t=this._order.filter((e=>!this.isLayerDraped(this._layers[e])));this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...t)}_createTerrain(e,t){const n=this.terrain=new A(e,t);this.stylesheet.terrain=e,this.dispatcher.broadcast("enableTerrain",!this.terrainSetForDrapingOnly()),this._force3DLayerUpdate();const i=this._setTransitionParameters({duration:0});n.updateTransitions(i)}_force3DLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"fill-extrusion"===t.type&&this._updateLayer(t)}}_forceSymbolLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"symbol"===t.type&&this._updateLayer(t)}}_validate(t,n,i,r,o={}){return(!o||!1!==o.validate)&&Zt(this,t.call(e.validateStyle,e.extend({key:n,style:this.serialize(),value:i,styleSpec:e.spec},r)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._layers)this._layers[e].setEventedParent(null);for(const e in this._sourceCaches)this._sourceCaches[e].clearTiles(),this._sourceCaches[e].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(e){const t=this._getSourceCaches(e);for(const e of t)e.clearTiles()}_reloadSource(e){const t=this._getSourceCaches(e);for(const e of t)e.resume(),e.reload()}_reloadSources(){for(const e of this._getSources())e.reload&&e.reload()}_updateSources(e){for(const t in this._sourceCaches)this._sourceCaches[t].update(e)}_generateCollisionBoxes(){for(const e in this._sourceCaches){const t=this._sourceCaches[e];t.resume(),t.reload()}}_updatePlacement(t,n,i,r,o=!1){let a=!1,s=!1;const l={};for(const e of this._order){const n=this._layers[e];if("symbol"!==n.type)continue;if(!l[n.source]){const e=this._getLayerSourceCache(n);if(!e)continue;l[n.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}const i=this.crossTileSymbolIndex.addLayer(n,l[n.source],t.center.lng,t.projection);a=a||i}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),o=o||this._layerOrderChanged||0===i,this._layerOrderChanged&&this.fire(new e.Event("neworder")),(o||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.exported.now(),t.zoom))&&(this.pauseablePlacement=new Ut(t,this._order,o,n,i,r,this.placement,this.fog&&t.projection.supportsFog?this.fog.state:null),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.exported.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(const e of this._order){const t=this._layers[e];"symbol"===t.type&&this.placement.updateLayerOpacities(t,l[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.exported.now())}_releaseSymbolFadeTiles(){for(const e in this._sourceCaches)this._sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,t,n){this.imageManager.getImages(t.icons,n),this._updateTilesForChangedImages();const i=e=>{e&&e.setDependencies(t.tileID.key,t.type,t.icons)};i(this._otherSourceCaches[t.source]),i(this._symbolSourceCaches[t.source])}getGlyphs(e,t,n){this.glyphManager.getGlyphs(t.stacks,n)}getResource(t,n,i){return e.makeRequest(n,i)}_getSourceCache(e){return this._otherSourceCaches[e]}_getLayerSourceCache(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}_getSourceCaches(e){const t=[];return this._otherSourceCaches[e]&&t.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&t.push(this._symbolSourceCaches[e]),t}_isSourceCacheLoaded(t){const n=this._getSourceCaches(t);return 0===n.length?(this.fire(new e.ErrorEvent(new Error(`There is no source with ID '${t}'`))),!1):n.every((e=>e.loaded()))}has3DLayers(){return this._num3DLayers>0}hasSymbolLayers(){return this._numSymbolLayers>0}hasCircleLayers(){return this._numCircleLayers>0}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}Jt.getSourceType=function(e){return Pe[e]},Jt.setSourceType=function(e,t){Pe[e]=t},Jt.registerForPluginStateChange=e.registerForPluginStateChange;var Qt="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#define EXTENT 8192.0\n#define HALF_PI PI/2.0\n#define QUARTER_PI PI/4.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0",en="attribute highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;varying highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",tn="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;\n#else\nuniform sampler2D u_dem;uniform sampler2D u_dem_prev;\n#endif\nuniform vec4 u_dem_unpack;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;uniform sampler2D u_depth;uniform vec2 u_depth_size_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float decodeElevation(vec4 v) {return dot(vec4(v.xyz*255.0,-1.0),u_dem_unpack);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem,pos));\n#ifdef TERRAIN_DEM_NEAREST_FILTER\nreturn u_exaggeration*tl;\n#endif\nfloat tr=decodeElevation(texture2D(u_dem,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture2D(u_dem_prev,pos).a;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=decodeElevation(texture2D(u_dem_prev,pos));float tr=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,0.0)));float bl=decodeElevation(texture2D(u_dem_prev,pos+vec2(0.0,dd)));float br=decodeElevation(texture2D(u_dem_prev,pos+vec2(dd,dd)));return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}
2\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nhighp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}bool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;float depth=unpack_depth(texture2D(u_depth,(coord.xy+1.0)*0.5));return coord.z > depth+0.0005;}float occlusionFade(vec4 frag) {vec3 coord=frag.xyz/frag.w;vec3 df=vec3(5.0*u_depth_size_inv,0.0);vec2 uv=0.5*coord.xy+0.5;vec4 depth=vec4(\nunpack_depth(texture2D(u_depth,uv-df.xz)),unpack_depth(texture2D(u_depth,uv+df.xz)),unpack_depth(texture2D(u_depth,uv-df.zy)),unpack_depth(texture2D(u_depth,uv+df.zy))\n);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z-0.001)-depth),0.0,1.0));}vec4 fourSample(vec2 pos,vec2 off) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nfloat tl=texture2D(u_dem,pos).a;float tr=texture2D(u_dem,pos+vec2(off.x,0.0)).a;float bl=texture2D(u_dem,pos+vec2(0.0,off.y)).a;float br=texture2D(u_dem,pos+off).a;\n#else\nvec4 demtl=vec4(texture2D(u_dem,pos).xyz*255.0,-1.0);float tl=dot(demtl,u_dem_unpack);vec4 demtr=vec4(texture2D(u_dem,pos+vec2(off.x,0.0)).xyz*255.0,-1.0);float tr=dot(demtr,u_dem_unpack);vec4 dembl=vec4(texture2D(u_dem,pos+vec2(0.0,off.y)).xyz*255.0,-1.0);float bl=dot(dembl,u_dem_unpack);vec4 dembr=vec4(texture2D(u_dem,pos+off).xyz*255.0,-1.0);float br=dot(dembr,u_dem_unpack);\n#endif\nreturn vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }bool isOccluded(vec4 frag) { return false; }float occlusionFade(vec4 frag) { return 1.0; }\n#endif",nn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;varying vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",rn="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump float u_fog_temporal_offset;varying vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;
2highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,opacity);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec3 fog_dither(vec3 color) {vec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif";let on={},an={};const sn=[];dn(Qt,sn),dn(tn,sn),dn(nn,sn),dn(rn,sn),on=fn("",tn),an=fn(rn,nn);const ln=fn("\nhighp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}","\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);
2return (tile_units_to_pixels*pos+offset)/pattern_size;}const vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);//Normalized device coordinate that is not rendered."),cn=Qt,un="\n#ifdef GL_ES\nprecision mediump float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif";var hn={background:fn("uniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nvarying vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform vec4 u_color;varying vec4 v_color;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(u_color);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),backgroundPattern:fn("uniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),circle:fn("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\ngl_FragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*v
2iew_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}"),clippingMask:fn("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:fn("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {gl_FragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nvarying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),heatmapTexture:fn("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:fn("varying float v_placed;varying float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);gl_FragColor =mix(red,blue,step(0.5,v_placed))*0.5;gl_FragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}","attribute vec3 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;attribute float a_size_scale;attribute vec2 a_padding;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*elevation(a_anchor_pos),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:fn("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos_2f;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:fn("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;\n#endif\nvarying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1
2);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}"),fill:fn("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutline:fn("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillOutlinePattern:fn("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;varying vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillPattern:fn("uniform vec2 u_texsize;uniform sampler2D u_image;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),fillExtrusion:fn("varying vec4 v_color;\n#ifdef RENDER_SHADOWS\nvarying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\nvoid main() {\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvec3 normal=v_normal;\n#endif\nfloat z;vec4 color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);color=mix(v_color,v_roof_color,z);\n#else\ncolor=v_color;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0
2),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);color.rgb=color.rgb*shade;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef ZERO_ROOF_RADIUS\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#endif\ncolor.xyz=shadowed_color_normal(color.xyz,normalize(normal),v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec4 v_color;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying highp vec4 v_pos_light_view_0;varying highp vec4 v_pos_light_view_1;varying float v_depth;\n#endif\n#ifdef ZERO_ROOF_RADIUS\nvarying vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nvarying highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS)\nv_normal=normal;\n#endif\nbase=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);\n#ifdef RENDER_SHADOWS\nv_pos_light_view_0=u_light_matrix_0*vec4(pos,1);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1);v_depth=gl_Position.w;\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);
2\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}v_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting(color,NdotL);\n#else\nv_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_color*=u_opacity;\n#ifdef ZERO_ROOF_RADIUS\nv_roof_color=vec4(0.0,0.0,0.0,1.0);\n#ifdef LIGHTING_3D_MODE\nv_roof_color=apply_lighting(color,calculate_NdotL(vec3(0.0,0.0,1.0)));\n#else\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));\n#endif\nv_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),fillExtrusionPattern:fn("uniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec4 out_color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,v_NdotL)*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\ngl_FragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec4 a_pos_normal_ed;attribute vec2 a_centroid_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_pos_3;attribute vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nvarying vec2 v_pos;varying vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;varying vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nvarying float v_NdotL;\n#endif\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;
2base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(ce
2ntroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_NdotL=NdotL;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}"),hillshadePrepare:fn("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nreturn texture2D(u_image,coord).a/4.0;\n#else\nvec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;\n#endif\n}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:fn("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\ngl_FragColor=apply_lighting(gl_FragColor);\n#endif\n#ifdef FOG\ngl_FragColor=fog_dither(fog_apply_premultiplied(gl_FragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),line:fn("uniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nuniform float u_border_width;uniform vec4 u_border_color;float luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nfloat linearstep(float edge0,float edge1,float x) {return  
2clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture2D(u_dash_image,v_tex).a;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture2D(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {out_color=vec4(0,0,0,0);}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef RENDER_LINE_ALPHA_DISCARD\nif (alpha < u_alpha_discard_threshold) {discard;}\n#endif\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(u_border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);\n#ifdef RENDER_LINE_BORDER_AUTO\nfloat Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}\n#else\nout_color.rgb=mix(u_border_color.rgb,out_color.rgb,smoothAlpha);\n#endif\n}\n#endif\ngl_FragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define EXTRUDE_SCALE 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nattribute highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nattribute float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;varying vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),linePattern:fn("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_tile_units_to_pixels;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;vec2 pattern_size=vec2(display_size.x/u_tile_units_to_pixels,display_size.y);float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x=mod(v_linesofar/pattern_size.x*aspect,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec4 color=texture2D(u_image,pos);\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_linesofar;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}"),raster:fn("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply(out_color,v_fog_pos));\n#endif\ngl_FragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {float w=1.0+dot(a_texture_pos,u_perspective_transform);gl_Position=u_matrix*vec4(a_pos*w,0,w);v_pos0=a_texture_pos/8192.0;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}"),symbolIcon:fn("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;}"),symbolSDF:fn("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_
2text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_pixeloffset;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);\n#endif\nvec2 a=projected_point.xy/projected_point.w;vec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade);}"),symbolTextAndIcon:fn("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
2gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_tex_size;attribute vec4 a_projected_pos;attribute float a_fade_opacity;\n#ifdef PROJECTION_GLOBE_VIEW\nattribute vec3 a_globe_anchor;attribute vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nvarying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;vec3 h=elevationVector(tile_anchor)*elevation(tile_anchor);float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=occlusionFade(projected_point)*globe_occlusion_fade;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,float(projected_point.w <=0.0 || occlusion_fade==0.0));\n#endif\nfloat gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nv_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity*projection_transition_fade,is_s
2df);}"),terrainRaster:fn("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nvarying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nvoid main() {vec4 color=texture2D(u_image0,v_pos0);\n#ifdef RENDER_SHADOWS\ncolor.xyz=shadowed_color(color.xyz,v_pos_light_view_0,v_pos_light_view_1,v_depth);\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_skirt_height;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;\n#ifdef FOG\nvarying float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;varying vec4 v_pos_light_view_0;varying vec4 v_pos_light_view_1;varying float v_depth;\n#endif\nconst float skirtOffset=24575.0;const float wireframeOffset=0.00015;void main() {v_pos0=a_texture_pos/8192.0;float skirt=float(a_pos.x >=skirtOffset);float elevation=elevation(a_texture_pos)-skirt*u_skirt_height;\n#ifdef TERRAIN_WIREFRAME\nelevation+=u_skirt_height*u_skirt_height*wireframeOffset;\n#endif\nvec2 decodedPos=a_pos-vec2(skirt*skirtOffset,0.0);gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);v_depth=gl_Position.w;\n#endif\n}"),terrainDepth:fn("#ifdef GL_ES\nprecision highp float;\n#endif\nvarying float v_depth;void main() {gl_FragColor=pack_depth(v_depth);}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying float v_depth;void main() {float elevation=elevation(a_texture_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}"),skybox:fn("\nvarying lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(e
2nd-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=textureCube(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);gl_FragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",en),skyboxGradient:fn("varying highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture2D(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}",en),skyboxCapture:fn
vendor: 3,851 bytes, line 2
2("\nvarying highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;\n#ifdef GL_ES\nprecision highp float;\n#endif\n#define BETA_R                  vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M                  vec3(21e-6,21e-6,21e-6)\n#define MIE_G                   0.76\n#define DENSITY_HEIGHT_SCALE_R  8000.0\n#define DENSITY_HEIGHT_SCALE_M  1200.0\n#define PLANET_RADIUS           6360e3\n#define ATMOSPHERE_RADIUS       6420e3\n#define SAMPLE_STEPS            10\n#define DENSITY_STEPS           4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;gl_FragColor=vec4(color,1.0);}","attribute highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;varying highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:
2fn("uniform sampler2D u_image0;varying vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture2D(u_image0,v_pos0);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#else\ncolor=texture2D(u_image0,v_pos0);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ngl_FragColor=color;\n#ifdef TERRAIN_WIREFRAME\ngl_FragColor=vec4(1.0,0.0,0.0,0.8);\n#endif\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;\n#ifdef GLOBE_POLES\nattribute vec3 a_globe_pos;attribute vec2 a_uv;\n#else\nattribute vec2 a_pos;\n#endif\nvarying vec2 v_pos0;const float wireframeOffset=1e3;float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(QUARTER_PI+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 latLng=u_grid_matrix*vec3(a_pos,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;\n#ifdef GLOBE_POLES\nvec3 up_vector=normalize(globe_pos)*u_tile_up_scale;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);\n#ifdef TERRAIN_WIREFRAME\nheight+=wireframeOffset;\n#endif\nglobe_pos+=up_vector*height;\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}"),globeAtmosphere:fn("uniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec3 u_start_color;uniform vec4 u_color;uniform vec4 u_space_color;uniform vec4 u_high_color;uniform float u_star_intensity;uniform float u_star_size;uniform float u_star_density;uniform float u_horizon_angle;uniform mat4 u_rotation_matrix;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;highp float random(highp vec3 p) {p=fract(p*vec3(23.2342,97.1231,91.2342));p+=dot(p.zxy,p.yxz+123.1234);return fract(p.x*p.y);}float stars(vec3 p,float scale,vec2 offset) {vec2 uv_scale=(u_viewport/u_star_size)*scale;vec3 position=vec3(p.xy*uv_scale+offset*u_viewport,p.z);vec3 q=fract(position)-0.5;vec3 id=floor(position);float random_visibility=step(random(id),u_star_density);float circle=smoothstep(0.5+u_star_intensity,0.5,length(q));
2return circle*random_visibility;}void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {discard;return;}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(dot(dir,horizon_dir)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;float closest_point_to_center=length(closest_point-u_globe_pos);float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;vec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c =mix(color_stop_2,c2,t);float a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);vec2 uv=gl_FragCoord.xy/u_viewport-0.5;float aspect_ratio=u_viewport.x/u_viewport.y;vec4 uv_dir=vec4(normalize(vec3(uv.x*aspect_ratio,uv.y,1.0)),1.0);uv_dir=u_rotation_matrix*uv_dir;vec3 n=abs(uv_dir.xyz);vec2 uv_remap=(n.x > n.y && n.x > n.z) ? uv_dir.yz/uv_dir.x:\n(n.y > n.x && n.y > n.z) ? uv_dir.zx/uv_dir.y:\nuv_dir.xy/uv_dir.z;uv_remap.x/=aspect_ratio;vec3 D=vec3(uv_remap,1.0);highp float star_field=0.0;if (u_star_intensity > 0.0) {star_field+=stars(D,1.2,vec2(0.0,0.0));star_field+=stars(D,1.0,vec2(1.0,0.0));star_field+=stars(D,0.8,vec2(0.0,1.0));star_field+=stars(D,0.6,vec2(1.0,1.0));star_field*=(1.0-pow(t,0.25+(1.0-u_high_color.a)*0.75));c+=star_field*alpha_2;}c=dither(c,gl_FragCoord.xy+u_temporal_offset);gl_FragColor=vec4(c,a);}","attribute vec3 a_pos;attribute vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;varying highp vec3 v_ray_dir;varying highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}")};function dn(e,t){const n=e.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let e of n)if(e=e.trim(),"#"===e[0]&&e.includes("if")&&!e.includes("endif")){e=e.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const n=e.split(" ");for(const e of n)t.includes(e)||t.push(e)}}function fn(e,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=t.match(/attribute (highp |mediump |lowp )?([\w]+) ([\w]+)/g),r={},o=[...sn];return dn(e,o),dn(t,o),{fragmentSource:e=e.replace(n,((e,t,n,i,o)=>(r[o]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nvarying ${n} ${i} ${o};\n#else\nuniform ${n} ${i} u_${o};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${o}\n    ${n} ${i} ${o} = u_${o};\n#endif\n`))),vertexSource:t=t.replace(n,((e,t,n,i,o)=>{const a="float"===i?"vec2":"vec4",s=o.match(/color/)?"color":a;return r[o]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\nattribute ${n} ${a} a_${o};\nvarying ${n} ${i} ${o};\n#else\nuniform ${n} ${i} u_${o};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${o}\n    ${o} = a_${o};\n#else\n    ${n} ${i} ${o} = u_${o};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${o}\n    ${o} = unpack_mix_${s}(a_${o}, u_${o}_t);\n#else\n    ${n} ${i} ${o} = u_${o};\n#endif\n`:"define"===t?`\n#ifndef HAS_UNIFORM_u_${o}\nuniform lowp float u_${o}_t;\nattribute ${n} ${a} a_${o};\n#else\nuniform ${n} ${i} u_${o};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${o}\n    ${n} ${i} ${o} = a_${o};\n#else\n    ${n} ${i} ${o} = u_${o};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${o}\n    ${n} ${i} ${o} = unpack_mix_${s}(a_${o}, u_${o}_t);\n#else\n    ${n} ${i} ${o} = u_${o};\n#endif\n`})),staticAttributes:i,usedDefines:o}}class pn{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(e,t,n,i,r,o,a){this.context=e;let s=this.boundPaintVertexBuffers.length!==i.length;for(let e=0;!s&&e<i.length;e++)this.boundPaintVertexBuffers[e]!==i[e]&&(s=!0);let l=this.boundDynamicVertexBuffers.length!==a.length;for(let e=0;!l&&e<a.length;e++)this.boundDynamicVertexBuffers[e]!==a[e]&&(l=!0);if(!e.extVertexArrayObject||!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==n||s||l||this.boundIndexBuffer!==r||this.boundVertexOffset!==o)this.freshBind(t,
vendor: 47,853 bytes, line 2
2n,i,r,o,a);else{e.bindVertexArrayOES.set(this.vao);for(const e of a)e&&e.bind();r&&r.dynamicDraw&&r.bind()}}freshBind(e,t,n,i,r,o){let a;const s=e.numAttributes,l=this.context,c=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),a=0,this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=i,this.boundVertexOffset=r,this.boundDynamicVertexBuffers=o;else{a=l.currentNumAttributes||0;for(let e=s;e<a;e++)c.disableVertexAttribArray(e)}t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,r);for(const t of n)t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,r);for(const t of o)t&&(t.enableAttributes(c,e),t.bind(),t.setVertexAttribPointers(c,e,r));i&&i.bind(),l.currentNumAttributes=s}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function mn(t,n){const i=Math.pow(2,n.canonical.z),r=n.canonical.y;return[new e.MercatorCoordinate(0,r/i).toLngLat().lat,new e.MercatorCoordinate(0,(r+1)/i).toLngLat().lat]}function gn(t,n,i,r,o,a,s){const l=t.context,c=l.gl,u=i.fbo;if(!u)return;t.prepareDrawTile();const h=t.useProgram("hillshade");l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,u.colorAttachment.get());const d=((e,t,n,i)=>{const r=n.paint.get("hillshade-shadow-color"),o=n.paint.get("hillshade-highlight-color"),a=n.paint.get("hillshade-accent-color");let s=n.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===n.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);const l=!e.options.moving;return{u_matrix:i||e.transform.calculateProjMatrix(t.tileID.toUnwrapped(),l),u_image:0,u_latrange:mn(0,t.tileID),u_light:[n.paint.get("hillshade-exaggeration"),s],u_shadow:r,u_highlight:o,u_accent:a}})(t,i,r,t.terrain?n.projMatrix:null);t.prepareDrawProgram(l,h,n.toUnwrapped());const{tileBoundsBuffer:f,tileBoundsIndexBuffer:p,tileBoundsSegments:m}=t.getTileBoundsBuffers(i);h.draw(l,c.TRIANGLES,o,a,s,e.CullFaceMode.disabled,d,r.id,f,p,m)}function _n(t,n,i){if(!n.needsDEMTextureUpload)return;const r=t.context,o=r.gl;r.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||t.getTileTexture(i.stride);const a=i.getPixels();n.demTexture?n.demTexture.update(a,{premultiply:!1}):n.demTexture=new e.Texture(r,a,o.RGBA,{premultiply:!1}),n.needsDEMTextureUpload=!1}function yn(t,n,i,r,o,a){const s=t.context,l=s.gl;if(!n.dem)return;const c=n.dem;if(s.activeTexture.set(l.TEXTURE1),_n(t,n,c),!n.demTexture)return;n.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);const u=c.dim;s.activeTexture.set(l.TEXTURE0);let h=n.fbo;if(!h){const t=new e.Texture(s,{width:u,height:u,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),h=n.fbo=s.createFramebuffer(u,u,!0),h.colorAttachment.set(t.texture)}s.bindFramebuffer.set(h.framebuffer),s.viewport.set([0,0,u,u]);const{tileBoundsBuffer:d,tileBoundsIndexBuffer:f,tileBoundsSegments:p}=t.getMercatorTileBoundsBuffers();t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,r,o,a,e.CullFaceMode.disabled,((t,n)=>{const i=n.stride,r=e.create();return e.ortho(r,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(r,r,[0,-e.EXTENT,0]),{u_matrix:r,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_unpack:n.unpackVector}})(n.tileID,c),i.id,d,f,p),n.needsHillshadePrepare=!1}const vn=t=>({u_matrix:new e.UniformMatrix4f(t),u_image0:new e.Uniform1i(t),u_skirt_height:new e.Uniform1f(t)}),xn=(e,t)=>({u_matrix:e,u_image0:0,u_skirt_height:t}),bn=(e,t,n,i,r,o,a,s,l,c,u,h,d,f)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(i),u_merc_matrix:n,u_zoom_transition:r,u_merc_center:o,u_image0:0,u_frustum_tl:a,u_frustum_tr:s,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:u,u_globe_radius:h,u_viewport:d,u_grid_matrix:f?Float32Array.from(f):new Float32Array(9)});function wn(e,t){return null!=e&&null!=t&&!(!e.hasData()||!t.hasData())&&null!=e.demTexture&&null!=t.demTexture&&e.tileID.key!==t.tileID.key}const En=new class{constructor(){this.operations={}}newMorphing(e,t,n,i,r){if(e in this.operations){const t=this.operations[e];t.to.tileID.key!==n.tileID.key&&(t.queued=n)}else this.operations[e]={startTime:i,phase:0,duration:r,from:t,to:n,queued:null}}getMorphValuesForProxy(e){if(!(e in this.operations))return null;const t=this.operations[e];return{from:t.from,to:t.to,phase:t.phase}}update(e){for(const t in this.operations){const n=this.operations[t];for(n.phase=(e-n.startTime)/n.duration;n.phase>=1||!this._validOp(n);)if(!this._nextOp(n,e)){delete this.operations[t];break}}}_nextOp(e,t){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=t,!0)}_validOp(e){return e.from.hasData()&&e.to.hasData()}},Tn={0:null,1:"TERRAIN_VERTEX_MORPHING",2:"TERRAIN_WIREFRAME"};function Sn(e,t){const n=1<<e.z;return!t&&(0===e.x||e.x===n-1)||0===e.y||e.y===n-1}const An=e=>({u_matrix:e});function Cn(t,n,i,r,o){if(o>0){const a=e.exported.now(),s=(a-t.timeAdded)/o,l=n?(a-n.timeAdded)/o:-1,c=i.getSource(),u=r.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!n||Math.abs(n.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),d=h&&t.refreshedUponExpiration?1:e.clamp(h?s:1-l,0,1);return t.refreshedUponExpiration&&s>=1&&(t.refreshedUponExpiration=!1),n?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}class kn extends e.SourceCache{constructor(e){const t={type:"raster-dem",maxzoom:e.transform.maxZoom},n=new D(Ue(),null),i=De("mock-dem",t,n,e.style);super("mock-dem",i,!1),i.setEventedParent(this),this._sourceLoaded=!0}_loadTile(e,t){e.state="loaded",t(null)}}class Mn extends e.SourceCache{constructor(e){const t=De("proxy",{type:"geojson",maxzoom:e.transform.maxZoom},new D(Ue(),null),e.style);super("proxy",t,!1),t.setEventedParent(this),this.map=this.getSource().map=e,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(t,n,i){if(t.freezeTileCoverage)return;this.transform=t;const r=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce(((n,i)=>{if(n[i.key]="",!this._tiles[i.key]){const n=new e.Tile(i,this._source.tileSize*i.overscaleFactor(),t.tileZoom);n.state="loaded",this._tiles[i.key]=n}return n}),{});for(const e in this._tiles)e in r||(this.freeFBO(e),this._tiles[e].unloadVectorData(),delete this._tiles[e])}freeFBO(e){const t=this.proxyCachedFBO[e];if(void 0!==t){const n=Object.values(t);this.renderCachePool.push(...n),delete this.proxyCachedFBO[e]}}deallocRenderCache(){this.renderCache.forEach((e=>e.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class In extends e.OverscaledTileID{constructor(e,t,n){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=t,this.projMatrix=n}}class Pn extends e.Elevation{constructor(t,n){super(),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[i,r,o]=function(t){const n=new e.StructArrayLayout4i8,i=new e.StructArrayLayout3ui6,r=131;n.reserve(17161),i.reserve(33800);const o=e.EXTENT/128,a=e.EXTENT+o/2,s=a+o;for(let t=-o;t<s;t+=o)for(let i=-o;i<s;i+=o){const r=i<0||i>a||t<0||t>a?24575:0,o=e.clamp(Math.round(i),0,e.EXTENT),s=e.clamp(Math.round(t),0,e.EXTENT);n.emplaceBack(o+r,s,o,s)}const l=(e,t)=>{const n=t*r+e;i.emplaceBack(n+1,n,n+r),i.emplaceBack(n+r,n+r+1,n+1)};for(let e=1;e<129;e++)for(let t=1;t<129;t++)l(t,e);return[0,129].forEach((e=>{for(let t=0;t<130;t++)l(t,e),l(e,t)})),[n,i,32768]}(),a=t.context;this.gridBuffer=a.createVertexBuffer(i,e.boundsAttributes.members),this.gridIndexBuffer=a.createIndexBuffer(r),this.gridSegments=e.SegmentVector.simpleSegment(0,0,i.length,r.length),this.gridNoSkirtSegments=e.SegmentVector.simpleSegment(0,0,i.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new Mn(n.map),this.orthoMatrix=e.create(),e.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,e.EXTENT,0,e.EXTENT,0,1);const s=a.gl;this._overlapStencilMode=new e.StencilMode({func:s.GEQUAL,mask:255},0,255,s.KEEP,s.KEEP,s.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=n,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new kn(n.map)}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),e.on("neworder",this._checkRenderCacheEfficiency.bind(this)),this._style=e,this._checkRenderCacheEfficiency()}update(t,n,i){if(t&&t.terrain){this._style!==t&&(this.style=t),this.enabled=!0;const r=t.terrain.properties;this.sourceCache=0===t.terrain.drapeRenderMode?this._mockSourceCache:t._getSourceCache(r.get("source")),this._exaggeration=r.get("exaggeration");const o=()=>{this.sourceCache.used&&e.warnOnce(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const t=this.getScaledDemTileSize();this.sourceCache.update(n,t,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,o(),this._initializing=!0),o(),n.updateElevation(!0,i),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(n),this._emptyDEMTextureDirty=!0}else this._disable()}resetTileLookupCache(e){this._findCoveringTileCache[e]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_checkRenderCacheEfficiency(){const t=this.renderCacheEfficiency(this._style);this._style.map._optimizeForTerrain||100!==t.efficiency&&e.warnOnce(`Terrain render cache efficiency is not optimal (${t.efficiency}%) and performance\n                may be affected negatively, consider placing all background, fill and line layers before layer\n                with id '${t.firstUndrapedLayer}' or create a map using optimizeForTerrain: true option.`)}_onStyleDataEvent(e){e.coord&&"source"===e.dataType?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this._invalidateRenderCache=!0)}_disable(){if(this.enabled&&(this.enabled=!1,this._sharedDepthStencil=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const e in this._style._sourceCaches)this._style._sourceCaches[e].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this._emptyDepthBufferTexture&&this._emptyDepthBufferTexture.destroy(),this.pool.forEach((e=>e.fb.destroy())),this.pool=[],this._depthFBO&&(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0)}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this._exaggeration}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}set useVertexMorphing(e){this._useVertexMorphing=e}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const n=this.proxySourceCache,i=this.painter.transform;this._initializing&&(this._initializing=0===i._centerAltitude&&-1===this.getAtPointOrZero(e.MercatorCoordinate.fromLngLat(i.center),-1),this._emptyDEMTextureDirty=!this._initializing);const r=this.proxyCoords=n.getIds().map((e=>{const t=n.getTileByID(e).tileID;return t.projMatrix=i.calculateProjMatrix(t.toUnwrapped()),t}));!function(t,n){const i=n.transform.pointCoordinate(n.transform.getCameraPoint()),r=new e.pointGeometry(i.x,i.y);t.sort(((t,n)=>{if(n.overscaledZ-t.overscaledZ)return n.overscaledZ-t.overscaledZ;const i=new e.pointGeometry(t.canonical.x+(1<<t.canonical.z)*t.wrap,t.canonical.y),o=new e.pointGeometry(n.canonical.x+(1<<n.canonical.z)*n.wrap,n.canonical.y),a=r.mult(1<<t.canonical.z);return a.x-=.5,a.y-=.5,a.distSqr(i)-a.distSqr(o)}))}(r,this.painter),this._previousZoom=i.zoom;const o=this.proxyToSource||{};this.proxyToSource={},r.forEach((e=>{this.proxyToSource[e.key]={}})),this.terrainTileForTile={};const a=this._style._sourceCaches;for(const e in a){const n=a[e];if(!n.used)continue;if(n!==this.sourceCache&&this.resetTileLookupCache(n.id),this._setupProxiedCoordsForOrtho(n,t[e],o),n.usedForTerrain)continue;const i=t[e];n.getSource().reparseOverscaled&&this._assignTerrainTiles(i)}this.proxiedCoords[n.id]=r.map((e=>new In(e,e.key,this.orthoMatrix))),this._assignTerrainTiles(r),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(o),this.renderingToTexture=!1,this._updateTimestamp=e.exported.now();const s={};this._visibleDemTiles=[];for(const e of this.proxyCoords){const t=this.terrainTileForTile[e.key];if(!t)continue;const n=t.tileID.key;n in s||(this._visibleDemTiles.push(t),s[n]=n)}}_assignTerrainTiles(e){this._initializing||e.forEach((e=>{if(this.terrainTileForTile[e.key])return;const t=this._findTileCoveringTileID(e,this.sourceCache);t&&(this.terrainTileForTile[e.key]=t)}))}_prepareDEMTextures(){const e=this.painter.context,t=e.gl;for(const n in this.terrainTileForTile){const i=this.terrainTileForTile[n],r=i.dem;!r||i.demTexture&&!i.needsDEMTextureUpload||(e.activeTexture.set(t.TEXTURE1),_n(this.painter,i,r))}}_prepareDemTileUniforms(e,t,n,i){if(!t||null==t.demTexture)return!1;const r=e.tileID.canonical,o=Math.pow(2,t.tileID.canonical.z-r.z),a=i||"";return n[`u_dem_tl${a}`]=[r.x*o%1,r.y*o%1],n[`u_dem_scale${a}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}get emptyDepthBufferTexture(){const t=this.painter.context,n=t.gl;if(!this._emptyDepthBufferTexture){const i=new e.RGBAImage({width:1,height:1},Uint8Array.of(255,255,255,255));this._emptyDepthBufferTexture=new e.Texture(t,i,n.RGBA,{premultiply:!1})}return this._emptyDepthBufferTexture}_getLoadedAreaMinimum(){let e=0;const t=this._visibleDemTiles.reduce(((t,n)=>{if(!n.dem)return t;const i=n.dem.tree.minimums[0];return i>0&&e++,t+i}),0);return e?t/e:0}_updateEmptyDEMTexture(){const t=this.painter.context,n=t.gl;t.activeTexture.set(n.TEXTURE2);const i=this._getLoadedAreaMinimum(),r=new e.RGBAImage({width:1,height:1},new Uint8Array(e.DEMData.pack(i,this.sourceCache.getSource().encoding)));this._emptyDEMTextureDirty=!1;let o=this._emptyDEMTexture;return o?o.update(r,{premultiply:!1}):o=this._emptyDEMTexture=new e.Texture(t,r,n.RGBA,{premultiply:!1}),o}setupElevationDraw(t,n,i){const r=this.painter.context,o=r.gl,a=(s=this.sourceCache.getSource().encoding,{u_dem:2,u_dem_prev:4,u_dem_unpack:e.DEMData.getUnpackVector(s),u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_exaggeration:0});var s;a.u_dem_size=this.sourceCache.getSource().tileSize,a.u_exaggeration=this.exaggeration();let l=null,c=null,u=1;if(i&&i.morphing&&this._useVertexMorphing){const e=i.morphing.srcDemTile,n=i.morphing.dstDemTile;u=i.morphing.phase,e&&n&&(this._prepareDemTileUniforms(t,e,a,"_prev")&&(c=e),this._prepareDemTileUniforms(t,n,a)&&(l=n))}if(c&&l?(r.activeTexture.set(o.TEXTURE2),l.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),r.activeTexture.set(o.TEXTURE4),c.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE,o.NEAREST),a.u_dem_lerp=u):(l=this.terrainTileForTile[t.tileID.key],r.activeTexture.set(o.TEXTURE2),(this._prepareDemTileUniforms(t,l,a)?l.demTexture:this.emptyDEMTexture).bind(o.NEAREST,o.CLAMP_TO_EDGE)),r.activeTexture.set(o.TEXTURE3),i&&i.useDepthForOcclusion?(this._depthTexture&&this._depthTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),this._depthFBO&&(a.u_depth_size_inv=[1/this._depthFBO.width,1/this._depthFBO.height])):(this.emptyDepthBufferTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE),a.u_depth_size_inv=[1,1]),i&&i.useMeterToDem&&l){const t=(1<<l.tileID.canonical.z)*e.mercatorZfromAltitude(1,this.painter.transform.center.lat)*this.sourceCache.getSource().tileSize;a.u_meter_to_dem=t}if(i&&i.labelPlaneMatrixInv&&(a.u_label_plane_matrix_inv=i.labelPlaneMatrixInv),n.setTerrainUniformValues(r,a),"globe"===this.painter.transform.projection.name){const e=this.globeUniformValues(this.painter.transform,t.tileID.canonical,i&&i.useDenormalizedUpVectorScale);n.setGlobeUniformValues(r,e)}}globeUniformValues(t,n,i){const r=t.projection;return{u_tile_tl_up:r.upVector(n,0,0),u_tile_tr_up:r.upVector(n,e.EXTENT,0),u_tile_br_up:r.upVector(n,e.EXTENT,e.EXTENT),u_tile_bl_up:r.upVector(n,0,e.EXTENT),u_tile_up_scale:i?e.GLOBE_METERS_TO_ECEF:r.upVectorScale(n,t.center.lat,t.worldSize).metersToTile}}renderToBackBuffer(t){const n=this.painter,i=this.painter.context;0!==t.length&&(i.bindFramebuffer.set(null),i.viewport.set([0,0,n.width,n.height]),n.gpuTimingDeferredRenderStart(),this.renderingToTexture=!1,function(t,n,i,r,o){if("globe"===t.transform.projection.name)!function(t,n,i,r,o){const a=t.context,s=a.gl;let l,c;const u=t.options.showTerrainWireframe?2:0,h=t.transform,d=e.globeUseCustomAntiAliasing(t,a,h),f=(e,n)=>{if(c===e)return;const i=[Tn[e],"PROJECTION_GLOBE_VIEW"];d&&i.push("CUSTOM_ANTIALIASING"),n&&i.push(Tn[u]),l=t.useProgram("globeRaster",null,i),c=e},p=t.colorModeForRenderPass(),m=new e.DepthMode(s.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D);En.update(o);const g=e.calculateGlobeMercatorMatrix(h),_=[e.mercatorXfromLng(h.center.lng),e.mercatorYfromLat(h.center.lat)],y=u?[!1,!0]:[!1],v=t.globeSharedBuffers,x=[h.width*e.exported.devicePixelRatio,h.height*e.exported.devicePixelRatio],b=Float32Array.from(h.globeMatrix),w={useDenormalizedUpVectorScale:!0};if(y.forEach((u=>{c=-1;const d=u?s.LINES:s.TRIANGLES;for(const c of r){const r=i.getTile(c),y=e.StencilMode.disabled,E=n.prevTerrainTileForTile[c.key],T=n.terrainTileForTile[c.key];wn(E,T)&&En.newMorphing(c.key,E,T,o,250),a.activeTexture.set(s.TEXTURE0),r.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);const S=En.getMorphValuesForProxy(c.key),A=S?1:0;S&&e.extend$1(w,{morphing:{srcDemTile:S.from,dstDemTile:S.to,phase:e.easeCubicInOut(S.phase)}});const C=e.tileCornersToBounds(c.canonical),k=e.getLatitudinalLod(C.getCenter().lat),M=e.getGridMatrix(c.canonical,C,k,h.worldSize/h._pixelsPerMercatorPixel),I=e.globeNormalizeECEF(e.globeTileBounds(c.canonical)),P=bn(h.projMatrix,b,g,I,e.globeToMercatorTransition(h.zoom),_,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,x,M);if(f(A,u),n.setupElevationDraw(r,l,w),t.prepareDrawProgram(a,l,c.toUnwrapped()),v){const[n,i,r]=u?v.getWirefameBuffers(t.context,k):v.getGridBuffers(k);l.draw(a,d,m,y,p,e.CullFaceMode.backCCW,P,"globe_raster",n,i,r)}}})),v){const o=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];d&&o.push("CUSTOM_ANTIALIASING"),l=t.useProgram("globeRaster",null,o);for(const o of r){const{x:r,y:c,z:u}=o.canonical,d=0===c,f=c===(1<<u)-1,[g,y,b,E]=v.getPoleBuffers(u);if(E&&(d||f)){const c=i.getTile(o);a.activeTexture.set(s.TEXTURE0),c.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE);let v=e.globePoleMatrixForTile(u,r,h);const T=e.globeNormalizeECEF(e.globeTileBounds(o.canonical)),S=(t,n)=>t.draw(a,s.TRIANGLES,m,e.StencilMode.disabled,p,e.CullFaceMode.disabled,bn(h.projMatrix,v,v,T,0,_,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,x),"globe_pole_raster",n,b,E);n.setupElevationDraw(c,l,w),t.prepareDrawProgram(a,l,o.toUnwrapped()),d&&S(l,g),f&&(v=e.scale(e.create(),v,[1,-1,1]),S(l,y))}}}}(t,n,i,r,o);else{const a=t.context,s=a.gl;let l,c;const u=t.options.showTerrainWireframe?2:0,h=(e,n)=>{if(c===e)return;const i=[Tn[e]];n&&i.push(Tn[u]),l=t.useProgram("terrainRaster",null,i),c=e},d=t.colorModeForRenderPass(),f=new e.DepthMode(s.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D);En.update(o);const p=t.transform,m=6*Math.pow(1.5,22-p.zoom)*n.exaggeration();(u?[!1,!0]:[!1]).forEach((u=>{c=-1;const g=u?s.LINES:s.TRIANGLES,[_,y]=u?n.getWirefameBuffer():[n.gridIndexBuffer,n.gridSegments];for(const c of r){const r=i.getTile(c),v=e.StencilMode.disabled,x=n.prevTerrainTileForTile[c.key],b=n.terrainTileForTile[c.key];wn(x,b)&&En.newMorphing(c.key,x,b,o,250),a.activeTexture.set(s.TEXTURE0),r.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST);const w=En.getMorphValuesForProxy(c.key),E=w?1:0;let T;w&&(T={morphing:{srcDemTile:w.from,dstDemTile:w.to,phase:e.easeCubicInOut(w.phase)}});const S=xn(c.projMatrix,Sn(c.canonical,p.renderWorldCopies)?m/10:m);h(E,u),n.setupElevationDraw(r,l,T),t.prepareDrawProgram(a,l,c.toUnwrapped()),l.draw(a,g,f,v,d,e.CullFaceMode.backCCW,S,"terrain_raster",n.gridBuffer,_,y)}}))}}(n,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,n.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const n=this.painter,i=this.painter.context,r=this.proxySourceCache,o=this.proxiedCoords[r.id],a=this._drapedRenderBatches.shift(),s=[],l=n.style.order;let c=0;for(const u of o){const o=r.getTileByID(u.proxyTileKey),h=r.proxyCachedFBO[u.key]?r.proxyCachedFBO[u.key][t]:void 0,d=void 0!==h?r.renderCache[h]:this.pool[c++],f=void 0!==h;if(o.texture=d.tex,f&&!d.dirty){s.push(o.tileID);continue}let p;i.bindFramebuffer.set(d.fb.framebuffer),this.renderedToTile=!1,d.dirty&&(i.clear({color:e.Color.transparent,stencil:0}),d.dirty=!1);for(let e=a.start;e<=a.end;++e){const t=n.style._layers[l[e]];if(t.isHidden(n.transform.zoom))continue;const r=n.style._getLayerSourceCache(t),o=r?this.proxyToSource[u.key][r.id]:[u];if(!o)continue;const a=o;i.viewport.set([0,0,d.fb.width,d.fb.height]),p!==(r?r.id:null)&&(this._setupStencil(d,o,t,r),p=r?r.id:null),n.renderLayer(n,r,t,a)}this.renderedToTile?(d.dirty=!0,s.push(o.tileID)):f||--c,5===c&&(c=0,this.renderToBackBuffer(s))}return this.renderToBackBuffer(s),this.renderingToTexture=!1,i.bindFramebuffer.set(null),i.viewport.set([0,0,n.width,n.height]),a.end+1}postRender(){}renderCacheEfficiency(e){const t=e.order.length;if(0===t)return{efficiency:100};let n,i=0,r=0,o=!1;for(let a=0;a<t;++a){const t=e._layers[e.order[a]];this._style.isLayerDraped(t)?(o&&++i,++r):o||(o=!0,n=t.id)}return 0===r?{efficiency:100}:{efficiency:100*(1-i/r),firstUndrapedLayer:n}}getMinElevationBelowMSL(){let e=0;return this._visibleDemTiles.filter((e=>e.dem)).forEach((t=>{e=Math.min(e,t.dem.tree.minimums[0])})),0===e?e:(e-30)*this._exaggeration}raycast(e,t,n){if(!this._visibleDemTiles)return null;const i=this._visibleDemTiles.filter((e=>e.dem)).map((i=>{const r=i.tileID,o=1<<r.overscaledZ,{x:a,y:s}=r.canonical,l=a/o,c=(a+1)/o,u=s/o,h=(s+1)/o;return{minx:l,miny:u,maxx:c,maxy:h,t:i.dem.tree.raycastRoot(l,u,c,h,e,t,n),tile:i}}));i.sort(((e,t)=>(null!==e.t?e.t:Number.MAX_VALUE)-(null!==t.t?t.t:Number.MAX_VALUE)));for(const r of i){if(null==r.t)return null;const i=r.tile.dem.tree.raycast(r.minx,r.miny,r.maxx,r.maxy,e,t,n);if(null!=i)return i}return null}_createFBO(){const t=this.painter.context,n=t.gl,i=this.drapeBufferSize;t.activeTexture.set(n.TEXTURE0);const r=new e.Texture(t,{width:i[0],height:i[1],data:null},n.RGBA);r.bind(n.LINEAR,n.CLAMP_TO_EDGE);const o=t.createFramebuffer(i[0],i[1],!1);return o.colorAttachment.set(r.texture),o.depthAttachment=new Te(t,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,i[0],i[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&!t.extTextureFilterAnisotropicForceOff&&n.texParameterf(n.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:o,tex:r,dirty:!1}}_initFBOPool(){for(;this.pool.length<Math.min(5,this.proxyCoords.length);)this.pool.push(this._createFBO())}_shouldDisableRenderCache(){if(this._style.light&&this._style.light.hasTransition())return!0;for(const e in this._style._sourceCaches)if(this._style._sourceCaches[e].hasTransition())return!0;return this._style.order.some((e=>{const t=this._style._layers[e],n=t.isHidden(this.painter.transform.zoom);return"custom"!==t.type&&!n&&t.hasTransition()}))}_clearRasterFadeFromRenderCache(){let e=!1;for(const t in this._style._sourceCaches)if(this._style._sourceCaches[t]._source instanceof Ce){e=!0;break}if(e)for(let e=0;e<this._style.order.length;++e){const t=this._style._layers[this._style.order[e]],n=t.isHidden(this.painter.transform.zoom),i=this._style._getLayerSourceCache(t);if("raster"!==t.type||n||!i)continue;const r=t.paint.get("raster-fade-duration");for(const e of this.proxyCoords){const t=this.proxyToSource[e.key][i.id];if(t)for(const e of t){const t=Cn(i.getTile(e),i.findLoadedParent(e,0),i,this.painter.transform,r);(1!==t.opacity||0!==t.mix)&&this._clearRenderCacheForTile(i.id,e)}}}}_setupDrapedRenderBatches(){const e=this._style.order,t=e.length;if(0===t)return;const n=[];let i,r=0,o=this._style._layers[e[r]];for(;!this._style.isLayerDraped(o)&&o.isHidden(this.painter.transform.zoom)&&++r<t;)o=this._style._layers[e[r]];for(;r<t;++r){const t=this._style._layers[e[r]];t.isHidden(this.painter.transform.zoom)||(this._style.isLayerDraped(t)?void 0===i&&(i=r):void 0!==i&&(n.push({start:i,end:r-1}),i=void 0))}void 0!==i&&n.push({start:i,end:r-1}),this._drapedRenderBatches=n}_setupRenderCache(e){const t=this.proxySourceCache;if(this._shouldDisableRenderCache()||this._invalidateRenderCache){if(this._invalidateRenderCache=!1,t.renderCache.length>t.renderCachePool.length){const e=Object.values(t.proxyCachedFBO);t.proxyCachedFBO={};for(let n=0;n<e.length;++n){const i=Object.values(e[n]);t.renderCachePool.push(...i)}}return}this._clearRasterFadeFromRenderCache();const n=this.proxyCoords,i=this._tilesDirty;for(let r=n.length-1;r>=0;r--){const o=n[r];if(t.getTileByID(o.key),void 0!==t.proxyCachedFBO[o.key]){const n=e[o.key],r=this.proxyToSource[o.key];let a=0;for(const e in r){const t=r[e],o=n[e];if(!o||o.length!==t.length||t.some(((t,n)=>t!==o[n]||i[e]&&i[e].hasOwnProperty(t.key)))){a=-1;break}++a}for(const e in t.proxyCachedFBO[o.key])t.renderCache[t.proxyCachedFBO[o.key][e]].dirty=a<0||a!==Object.values(n).length}}const r=[...this._drapedRenderBatches];r.sort(((e,t)=>t.end-t.start-(e.end-e.start)));for(const e of r)for(const i of n){if(t.proxyCachedFBO[i.key])continue;let n=t.renderCachePool.pop();void 0===n&&t.renderCache.length<50&&(n=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==n&&(t.proxyCachedFBO[i.key]={},t.proxyCachedFBO[i.key][e.start]=n,t.renderCache[n].dirty=!0)}this._tilesDirty={}}_setupStencil(e,t,n,i){if(!i||!this._sourceTilesOverlap[i.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const r=this.painter.context,o=r.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let a;if(n.isTileClipped())a=t.length,this._overlapStencilMode.test={func:o.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);a=1,this._overlapStencilMode.test={func:o.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+a>255&&(r.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=a,this._overlapStencilMode.ref=this._stencilRef,n.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(t){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[t.key]),this._overlapStencilMode):e.StencilMode.disabled}_renderTileClippingMasks(t,n){const i=this.painter,r=this.painter.context,o=r.gl;i._tileClippingMaskIDs={},r.setColorMode(e.ColorMode.disabled),r.setDepthMode(e.DepthMode.disabled);const a=i.useProgram("clippingMask");for(const s of t){const t=i._tileClippingMaskIDs[s.key]=--n;a.draw(r,o.TRIANGLES,e.DepthMode.disabled,new e.StencilMode({func:o.ALWAYS,mask:0},t,255,o.KEEP,o.KEEP,o.REPLACE),e.ColorMode.disabled,e.CullFaceMode.disabled,An(s.projMatrix),"$clipping",i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}pointCoordinate(t){const n=this.painter.transform;if(t.x<0||t.x>n.width||t.y<0||t.y>n.height)return null;const i=[t.x,t.y,1,1];e.transformMat4$1(i,i,n.pixelMatrixInverse),e.scale$1(i,i,1/i[3]),i[0]/=n.worldSize,i[1]/=n.worldSize;const r=n._camera.position,o=e.mercatorZfromAltitude(1,n.center.lat),a=[r[0],r[1],r[2]/o,0],s=e.subtract([],i.slice(0,3),a);e.normalize(s,s);const l=this.raycast(a,s,this._exaggeration);return null!==l&&l?(e.scaleAndAdd(a,a,s,l),a[3]=a[2],a[2]*=o,a):null}drawDepth(){const t=this.painter,n=t.context,i=this.proxySourceCache,r=Math.ceil(t.width),o=Math.ceil(t.height);if(!this._depthFBO||this._depthFBO.width===r&&this._depthFBO.height===o||(this._depthFBO.destroy(),this._depthFBO=void 0,this._depthTexture=void 0),!this._depthFBO){const t=n.gl,i=n.createFramebuffer(r,o,!0);n.activeTexture.set(t.TEXTURE0);const a=new e.Texture(n,{width:r,height:o,data:null},t.RGBA);a.bind(t.NEAREST,t.CLAMP_TO_EDGE),i.colorAttachment.set(a.texture);const s=n.createRenderbuffer(n.gl.DEPTH_COMPONENT16,r,o);i.depthAttachment.set(s),this._depthFBO=i,this._depthTexture=a}n.bindFramebuffer.set(this._depthFBO.framebuffer),n.viewport.set([0,0,r,o]),function(t,n,i,r){if("globe"===t.transform.projection.name)return;const o=t.context,a=o.gl;o.clear({depth:1});const s=t.useProgram("terrainDepth"),l=new e.DepthMode(a.LESS,e.DepthMode.ReadWrite,t.depthRangeFor3D);for(const t of r){const r=i.getTile(t),c=xn(t.projMatrix,0);n.setupElevationDraw(r,s),s.draw(o,a.TRIANGLES,l,e.StencilMode.disabled,e.ColorMode.unblended,e.CullFaceMode.backCCW,c,"terrain_depth",n.gridBuffer,n.gridIndexBuffer,n.gridNoSkirtSegments)}}(t,this,i,this.proxyCoords)}_setupProxiedCoordsForOrtho(e,t,n){if(e.getSource()instanceof Ie)return this._setupProxiedCoordsForImageSource(e,t,n);this._findCoveringTileCache[e.id]=this._findCoveringTileCache[e.id]||{};const i=this.proxiedCoords[e.id]=[],r=this.proxyCoords;for(let t=0;t<r.length;t++){const o=r[t],a=this._findTileCoveringTileID(o,e);if(a){const t=this._createProxiedId(o,a,n[o.key]&&n[o.key][e.id]);i.push(t),this.proxyToSource[o.key][e.id]=[t]}}let o=!1;for(let r=0;r<t.length;r++){const a=e.getTile(t[r]);if(!a||!a.hasData())continue;const s=this._findTileCoveringTileID(a.tileID,this.proxySourceCache);if(s&&s.tileID.canonical.z!==a.tileID.canonical.z){const t=this.proxyToSource[s.tileID.key][e.id],r=this._createProxiedId(s.tileID,a,n[s.tileID.key]&&n[s.tileID.key][e.id]);t?t.splice(t.length-1,0,r):this.proxyToSource[s.tileID.key][e.id]=[r],i.push(r),o=!0}}this._sourceTilesOverlap[e.id]=o}_setupProxiedCoordsForImageSource(t,n,i){if(!t.getSource().loaded())return;const r=this.proxiedCoords[t.id]=[],o=this.proxyCoords,a=t.getSource(),s=new e.pointGeometry(a.tileID.x,a.tileID.y)._div(1<<a.tileID.z),l=a.coordinates.map(e.MercatorCoordinate.fromLngLat).reduce(((e,t)=>(e.min.x=Math.min(e.min.x,t.x-s.x),e.min.y=Math.min(e.min.y,t.y-s.y),e.max.x=Math.max(e.max.x,t.x-s.x),e.max.y=Math.max(e.max.y,t.y-s.y),e)),{min:new e.pointGeometry(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.pointGeometry(-Number.MAX_VALUE,-Number.MAX_VALUE)}),c=(t,n)=>{const i=t.wrap+t.canonical.x/(1<<t.canonical.z),r=t.canonical.y/(1<<t.canonical.z),o=e.EXTENT/(1<<t.canonical.z),a=n.wrap+n.canonical.x/(1<<n.canonical.z),s=n.canonical.y/(1<<n.canonical.z);return i+o<a+l.min.x||i>a+l.max.x||r+o<s+l.min.y||r>s+l.max.y};for(let e=0;e<o.length;e++){const a=o[e];for(let e=0;e<n.length;e++){const o=t.getTile(n[e]);if(!o||!o.hasData())continue;if(c(a,o.tileID))continue;const s=this._createProxiedId(a,o,i[a.key]&&i[a.key][t.id]),l=this.proxyToSource[a.key][t.id];l?l.push(s):this.proxyToSource[a.key][t.id]=[s],r.push(s)}}}_createProxiedId(t,n,i){let r=this.orthoMatrix;if(i){const e=i.find((e=>e.key===n.tileID.key));if(e)return e}if(n.tileID.key!==t.key){const i=t.canonical.z-n.tileID.canonical.z;let o,a,s;r=e.create();const l=n.tileID.wrap-t.wrap<<t.overscaledZ;i>0?(o=e.EXTENT>>i,a=o*((n.tileID.canonical.x<<i)-t.canonical.x+l),s=o*((n.tileID.canonical.y<<i)-t.canonical.y)):(o=e.EXTENT<<-i,a=e.EXTENT*(n.tileID.canonical.x-(t.canonical.x+l<<-i)),s=e.EXTENT*(n.tileID.canonical.y-(t.canonical.y<<-i))),e.ortho(r,0,o,0,o,0,1),e.translate(r,r,[a,s,0])}return new In(n.tileID,t.key,r)}_findTileCoveringTileID(t,n){let i=n.getTile(t);if(i&&i.hasData())return i;const r=this._findCoveringTileCache[n.id],o=r[t.key];if(i=o?n.getTileByID(o):null,i&&i.hasData()||null===o)return i;let a=i?i.tileID:t,s=a.overscaledZ;const l=n.getSource().minzoom,c=[];if(!o){const r=n.getSource().maxzoom;if(t.canonical.z>=r){const i=t.canonical.z-r;n.getSource().reparseOverscaled?(s=Math.max(t.canonical.z+2,n.transform.tileZoom),a=new e.OverscaledTileID(s,t.wrap,r,t.canonical.x>>i,t.canonical.y>>i)):0!==i&&(s=r,a=new e.OverscaledTileID(s,t.wrap,r,t.canonical.x>>i,t.canonical.y>>i))}a.key!==t.key&&(c.push(a.key),i=n.getTile(a))}const u=e=>{c.forEach((t=>{r[t]=e})),c.length=0};for(s-=1;s>=l&&(!i||!i.hasData());s--){i&&u(i.tileID.key);const e=a.calculateScaledKey(s);if(i=n.getTileByID(e),i&&i.hasData())break;const t=r[e];if(null===t)break;void 0===t?c.push(e):i=n.getTileByID(t)}return u(i?i.tileID.key:null),i&&i.hasData()?i:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(e,t){let n=this._tilesDirty[e];n||(n=this._tilesDirty[e]={}),n[t.key]=!0}getWirefameBuffer(){if(!this.wireframeSegments){const t=function(t){let n=0;const i=new e.StructArrayLayout2ui4,r=131;for(let e=1;e<129;e++){for(let t=1;t<129;t++)n=e*r+t,i.emplaceBack(n,n+1),i.emplaceBack(n,n+r),i.emplaceBack(n+1,n+r),128===e&&i.emplaceBack(n+r,n+r+1);i.emplaceBack(n+1,n+1+r)}return i}();this.wireframeIndexBuffer=this.painter.context.createIndexBuffer(t),this.wireframeSegments=e.SegmentVector.simpleSegment(0,0,this.gridBuffer.length,t.length)}return[this.wireframeIndexBuffer,this.wireframeSegments]}}class Dn{static cacheKey(e,t,n,i){let r=`${t}${i?i.cacheKey:""}`;for(const t of n)e.usedDefines.includes(t)&&(r+=`/${t}`);return r}constructor(t,n,i,r,o,a){const s=t.gl;this.program=s.createProgram();const l=function(e){const t=[];for(let n=0;n<e.length;n++){if(null===e[n])continue;const i=e[n].split(" ");t.push(i.pop())}return t}(i.staticAttributes),c=r?r.getBinderAttributes():[],u=l.concat(c);let h=r?r.defines():[];h=h.concat(a.map((e=>`#define ${e}`)));const d=h.concat(t.extStandardDerivatives?"#extension GL_OES_standard_derivatives : enable\n".concat(un):un,un,cn,ln.fragmentSource,an.fragmentSource,i.fragmentSource).join("\n"),f=h.concat("\n#ifdef GL_ES\nprecision highp float;\n#else\n\n#if !defined(lowp)\n#define lowp\n#endif\n\n#if !defined(mediump)\n#define mediump\n#endif\n\n#if !defined(highp)\n#define highp\n#endif\n\n#endif",cn,ln.vertexSource,an.vertexSource,on.vertexSource,i.vertexSource).join("\n"),p=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);s.shaderSource(p,d),s.compileShader(p),s.attachShader(this.program,p);const m=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())this.failedToCreate=!0;else{s.shaderSource(m,f),s.compileShader(m),s.attachShader(this.program,m),this.attributes={},this.numAttributes=u.length;for(let e=0;e<this.numAttributes;e++)u[e]&&(s.bindAttribLocation(this.program,e,u[e]),this.attributes[u[e]]=e);s.linkProgram(this.program),s.deleteShader(m),s.deleteShader(p),this.fixedUniforms=o(t),this.binderUniforms=r?r.getUniforms(t):[],a.includes("TERRAIN")&&(this.terrainUniforms=(t=>({u_dem:new e.Uniform1i(t),u_dem_prev:new e.Uniform1i(t),u_dem_unpack:new e.Uniform4f(t),u_dem_tl:new e.Uniform2f(t),u_dem_scale:new e.Uniform1f(t),u_dem_tl_prev:new e.Uniform2f(t),u_dem_scale_prev:new e.Uniform1f(t),u_dem_size:new e.Uniform1f(t),u_dem_lerp:new e.Uniform1f(t),u_exaggeration:new e.Uniform1f(t),u_depth:new e.Uniform1i(t),u_depth_size_inv:new e.Uniform2f(t),u_meter_to_dem:new e.Uniform1f(t),u_label_plane_matrix_inv:new e.UniformMatrix4f(t)}))(t)),a.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new e.Uniform3f(t),u_tile_tr_up:new e.Uniform3f(t),u_tile_br_up:new e.Uniform3f(t),u_tile_bl_up:new e.Uniform3f(t),u_tile_up_scale:new e.Uniform1f(t)}))(t)),a.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new e.UniformMatrix4f(t),u_fog_range:new e.Uniform2f(t),u_fog_color:new e.Uniform4f(t),u_fog_horizon_blend:new e.Uniform1f(t),u_fog_temporal_offset:new e.Uniform1f(t),u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_globe_pos:new e.Uniform3f(t),u_globe_radius:new e.Uniform1f(t),u_globe_transition:new e.Uniform1f(t),u_is_globe:new e.Uniform1i(t),u_viewport:new e.Uniform2f(t)}))(t))}}setTerrainUniformValues(e,t){if(!this.terrainUniforms)return;const n=this.terrainUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e]&&n[e].set(this.program,e,t[e])}}setGlobeUniformValues(e,t){if(!this.globeUniforms)return;const n=this.globeUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e]&&n[e].set(this.program,e,t[e])}}setFogUniformValues(e,t){if(!this.fogUniforms)return;const n=this.fogUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)n[e].set(this.program,e,t[e])}}draw(e,t,n,i,r,o,a,s,l,c,u,h,d,f,p){const m=e.gl;if(this.failedToCreate)return;e.program.set(this.program),e.setDepthMode(n),e.setStencilMode(i),e.setColorMode(r),e.setCullFace(o);for(const e of Object.keys(this.fixedUniforms))this.fixedUniforms[e].set(this.program,e,a[e]);f&&f.setUniforms(this.program,e,this.binderUniforms,h,{zoom:d});const g={[m.LINES]:2,[m.TRIANGLES]:3,[m.LINE_STRIP]:1}[t];for(const n of u.get()){const i=n.vaos||(n.vaos={});(i[s]||(i[s]=new pn)).bind(e,this,l,f?f.getPaintVertexBuffers():[],c,n.vertexOffset,p||[]),m.drawElements(t,n.primitiveLength*g,m.UNSIGNED_SHORT,n.primitiveOffset*g*2)}}}function zn(e,t){const n=Math.pow(2,t.tileID.overscaledZ),i=t.tileSize*Math.pow(2,e.transform.tileZoom)/n,r=i*(t.tileID.canonical.x+t.tileID.wrap*n),o=i*t.tileID.canonical.y;return{u_image:0,u_texsize:t.imageAtlasTexture.size,u_tile_units_to_pixels:1/z(t,1,e.transform.tileZoom),u_pixel_coord_upper:[r>>16,o>>16],u_pixel_coord_lower:[65535&r,65535&o]}}const Ln=e.create(),On=(t,n,i,r,o,a,s,l,c,u,h)=>{const d=n.style.light,f=d.properties.get("position"),p=[f.x,f.y,f.z],m=e.create$1();"viewport"===d.properties.get("anchor")&&(e.fromRotation(m,-n.transform.angle),e.transformMat3(p,p,m));const g=d.properties.get("color"),_=n.transform,y={u_matrix:t,u_lightpos:p,u_lightintensity:d.properties.get("intensity"),u_lightcolor:[g.r,g.g,g.b],u_vertical_gradient:+i,u_opacity:r,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:Ln,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:o,u_edge_radius:a};return"globe"===_.projection.name&&(y.u_tile_id=[s.canonical.x,s.canonical.y,1<<s.canonical.z],y.u_zoom_transition=c,y.u_inv_rot_matrix=h,y.u_merc_center=u,y.u_up_dir=_.projection.upVector(new e.CanonicalTileID(0,0,0),u[0]*e.EXTENT,u[1]*e.EXTENT),y.u_height_lift=l),y},Rn=(t,n,i,r,o,a,s,l,c,u,h,d)=>{const f=On(t,n,i,r,o,a,s,c,u,h,d),p={u_height_factor:-Math.pow(2,s.overscaledZ)/l.tileSize/8};return e.extend(f,zn(n,l),p)},Bn=e=>({u_matrix:e}),Fn=(t,n,i)=>e.extend(Bn(t),zn(n,i)),Nn=(e,t)=>({u_matrix:e,u_world:t}),jn=(t,n,i,r)=>e.extend(Fn(t,n,i),{u_world:r}),Un=e.create(),Vn=(t,n,i,r,o,a)=>{const s=t.transform,l="globe"===s.projection.name;let c;if("map"===a.paint.get("circle-pitch-alignment"))if(l){const t=e.globePixelsToTileUnits(s.zoom,n.canonical)*s._pixelsPerMercatorPixel;c=Float32Array.from([t,0,0,t])}else c=s.calculatePixelsToTileUnitsMatrix(i);else c=new Float32Array([s.pixelsToGLUnits[0],0,0,s.pixelsToGLUnits[1]]);const u={u_camera_to_center_distance:s.cameraToCenterDistance,u_matrix:t.translatePosMatrix(n.projMatrix,i,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_device_pixel_ratio:e.exported.devicePixelRatio,u_extrude_scale:c,u_inv_rot_matrix:Un,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(l){u.u_inv_rot_matrix=r,u.u_merc_center=o,u.u_tile_id=[n.canonical.x,n.canonical.y,1<<n.canonical.z],u.u_zoom_transition=e.globeToMercatorTransition(s.zoom);const t=o[0]*e.EXTENT,i=o[1]*e.EXTENT;u.u_up_dir=s.projection.upVector(new e.CanonicalTileID(0,0,0),t,i)}return u},Gn=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t},qn=(t,n,i,r)=>{const o=e.EXTENT/i.tileSize;return{u_matrix:t,u_camera_to_center_distance:n.getCameraToCenterDistance(r),u_extrude_scale:[n.pixelsToGLUnits[0]/o,n.pixelsToGLUnits[1]/o]}},$n=(e,t,n=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:n}),Wn=e.create(),Zn=(t,n,i,r,o,a,s)=>{const l=t.transform,c="globe"===l.projection.name,u=c?e.globePixelsToTileUnits(l.zoom,n.canonical)*l._pixelsPerMercatorPixel:z(i,1,a),h={u_matrix:n.projMatrix,u_extrude_scale:u,u_intensity:s,u_inv_rot_matrix:Wn,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){h.u_inv_rot_matrix=r,h.u_merc_center=o,h.u_tile_id=[n.canonical.x,n.canonical.y,1<<n.canonical.z],h.u_zoom_transition=e.globeToMercatorTransition(l.zoom);const t=o[0]*e.EXTENT,i=o[1]*e.EXTENT;h.u_up_dir=l.projection.upVector(new e.CanonicalTileID(0,0,0),t,i)}return h},Xn=(e,t,n,i,r,o,a)=>{const s=e.transform,l=s.calculatePixelsToTileUnitsMatrix(t);return{u_matrix:Kn(e,t,n,i),u_pixels_to_tile_units:l,u_device_pixel_ratio:o,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:r,u_texsize:Jn(n)?t.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:Yn(t,e.transform),u_alpha_discard_threshold:0,u_trim_offset:a}},Hn=(e,t,n,i,r)=>{const o=e.transform;return{u_matrix:Kn(e,t,n,i),u_texsize:t.imageAtlasTexture.size,u_pixels_to_tile_units:o.calculatePixelsToTileUnitsMatrix(t),u_device_pixel_ratio:r,u_image:0,u_tile_units_to_pixels:Yn(t,o),u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]],u_alpha_discard_threshold:0}};function Yn(e,t){return 1/z(e,1,t.tileZoom)}function Kn(e,t,n,i){return e.translatePosMatrix(i||t.tileID.projMatrix,t,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}function Jn(e){const t=e.paint.get("line-dasharray").value;return t.value||"constant"!==t.kind}const Qn=(e,t,n,i,r,o)=>{return{u_matrix:e,u_tl_parent:t,u_scale_parent:n,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(s=r.paint.get("raster-saturation"),s>0?1-1/(1.001-s):-s),u_contrast_factor:(a=r.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:ei(r.paint.get("raster-hue-rotate")),u_perspective_transform:o};var a,s};function ei(e){e*=Math.PI/180;const t=Math.sin(e),n=Math.cos(e);return[(2*n+1)/3,(-Math.sqrt(3)*t-n+1)/3,(Math.sqrt(3)*t-n+1)/3]}const ti=e.create(),ni=(t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g)=>{const _=o.transform,y={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_camera_to_center_distance:_.cameraToCenterDistance,u_rotate_symbol:+i,u_aspect_ratio:_.width/_.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:s,u_coord_matrix:l,u_is_text:+c,u_pitch_with_map:+r,u_texsize:u,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:ti,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:ti,u_up_vector:[0,-1,0]};return"globe"===g.name&&(y.u_tile_id=[h.canonical.x,h.canonical.y,1<<h.canonical.z],y.u_zoom_transition=d,y.u_inv_rot_matrix=p,y.u_merc_center=f,y.u_camera_forward=_._camera.forward(),y.u_ecef_origin=e.globeECEFOrigin(_.globeMatrix,h.toUnwrapped()),y.u_tile_matrix=Float32Array.from(_.globeMatrix),y.u_up_vector=m),y},ii=(t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_)=>e.extend(ni(t,n,i,r,o,a,s,l,c,u,d,f,p,m,g,_),{u_gamma_scale:r?o.transform.cameraToCenterDistance*Math.cos(o.terrain?0:o.transform._pitch):1,u_device_pixel_ratio:e.exported.devicePixelRatio,u_is_halo:+h}),ri=(t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g)=>e.extend(ii(t,n,i,r,o,a,s,l,!0,c,!0,h,d,f,p,m,g),{u_texsize_icon:u,u_texture_icon:1}),oi=(e,t,n)=>({u_matrix:e,u_opacity:t,u_color:n}),ai=(t,n,i,r,o)=>e.extend(function(e,t,n){const i=t.imageManager.getPattern(e.toString()),{width:r,height:o}=t.imageManager.getPixelSize(),a=Math.pow(2,n.tileID.overscaledZ),s=n.tileSize*Math.pow(2,t.transform.tileZoom)/a,l=s*(n.tileID.canonical.x+n.tileID.wrap*a),c=s*n.tileID.canonical.y;return{u_image:0,u_pattern_tl:i.tl,u_pattern_br:i.br,u_texsize:[r,o],u_pattern_size:i.displaySize,u_tile_units_to_pixels:1/z(n,1,t.transform.tileZoom),u_pixel_coord_upper:[l>>16,c>>16],u_pixel_coord_lower:[65535&l,65535&c]}}(r,i,o),{u_matrix:t,u_opacity:n}),si={fillExtrusion:t=>({u_matrix:new e.UniformMatrix4f(t),u_lightpos:new e.Uniform3f(t),u_lightintensity:new e.Uniform1f(t),u_lightcolor:new e.Uniform3f(t),u_vertical_gradient:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_edge_radius:new e.Uniform1f(t),u_ao:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_up_dir:new e.Uniform3f(t),u_height_lift:new e.Uniform1f(t)}),fillExtrusionPattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_lightpos:new e.Uniform3f(t),u_lightintensity:new e.Uniform1f(t),u_lightcolor:new e.Uniform3f(t),u_vertical_gradient:new e.Uniform1f(t),u_height_factor:new e.Uniform1f(t),u_edge_radius:new e.Uniform1f(t),u_ao:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_up_dir:new e.Uniform3f(t),u_height_lift:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t)}),fill:t=>({u_matrix:new e.UniformMatrix4f(t)}),fillPattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}),fillOutline:t=>({u_matrix:new e.UniformMatrix4f(t),u_world:new e.Uniform2f(t)}),fillOutlinePattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_world:new e.Uniform2f(t),u_image:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}),circle:t=>({u_camera_to_center_distance:new e.Uniform1f(t),u_extrude_scale:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_up_dir:new e.Uniform3f(t)}),collisionBox:t=>({u_matrix:new e.UniformMatrix4f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_extrude_scale:new e.Uniform2f(t)}),collisionCircle:t=>({u_matrix:new e.UniformMatrix4f(t),u_inv_matrix:new e.UniformMatrix4f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_viewport_size:new e.Uniform2f(t)}),debug:t=>
2({u_color:new e.UniformColor(t),u_matrix:new e.UniformMatrix4f(t),u_overlay:new e.Uniform1i(t),u_overlay_scale:new e.Uniform1f(t)}),clippingMask:t=>({u_matrix:new e.UniformMatrix4f(t)}),heatmap:t=>({u_extrude_scale:new e.Uniform1f(t),u_intensity:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_up_dir:new e.Uniform3f(t)}),heatmapTexture:t=>({u_image:new e.Uniform1i(t),u_color_ramp:new e.Uniform1i(t),u_opacity:new e.Uniform1f(t)}),hillshade:t=>({u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_latrange:new e.Uniform2f(t),u_light:new e.Uniform2f(t),u_shadow:new e.UniformColor(t),u_highlight:new e.UniformColor(t),u_accent:new e.UniformColor(t)}),hillshadePrepare:t=>({u_matrix:new e.UniformMatrix4f(t),u_image:new e.Uniform1i(t),u_dimension:new e.Uniform2f(t),u_zoom:new e.Uniform1f(t),u_unpack:new e.Uniform4f(t)}),line:t=>({u_matrix:new e.UniformMatrix4f(t),u_pixels_to_tile_units:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_units_to_pixels:new e.Uniform2f(t),u_dash_image:new e.Uniform1i(t),u_gradient_image:new e.Uniform1i(t),u_image_height:new e.Uniform1f(t),u_texsize:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_alpha_discard_threshold:new e.Uniform1f(t),u_trim_offset:new e.Uniform2f(t)}),linePattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_texsize:new e.Uniform2f(t),u_pixels_to_tile_units:new e.UniformMatrix2f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_units_to_pixels:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t),u_alpha_discard_threshold:new e.Uniform1f(t)}),raster:t=>({u_matrix:new e.UniformMatrix4f(t),u_tl_parent:new e.Uniform2f(t),u_scale_parent:new e.Uniform1f(t),u_fade_t:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_image0:new e.Uniform1i(t),u_image1:new e.Uniform1i(t),u_brightness_low:new e.Uniform1f(t),u_brightness_high:new e.Uniform1f(t),u_saturation_factor:new e.Uniform1f(t),u_contrast_factor:new e.Uniform1f(t),u_spin_weights:new e.Uniform3f(t),u_perspective_transform:new e.Uniform2f(t)}),symbolIcon:t=>({u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_camera_forward:new e.Uniform3f(t),u_tile_matrix:new e.UniformMatrix4f(t),u_up_vector:new e.Uniform3f(t),u_ecef_origin:new e.Uniform3f(t),u_texture:new e.Uniform1i(t)}),symbolSDF:t=>({u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_texture:new e.Uniform1i(t),u_gamma_scale:new e.Uniform1f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_tile_id:new e.Uniform3f(t),u_zoom_transition:new e.Uniform1f(t),u_inv_rot_matrix:new e.UniformMatrix4f(t),u_merc_center:new e.Uniform2f(t),u_camera_forward:new e.Uniform3f(t),u_tile_matrix:new e.UniformMatrix4f(t),u_up_vector:new e.Uniform3f(t),u_ecef_origin:new e.Uniform3f(t),u_is_halo:new e.Uniform1i(t)}),symbolTextAndIcon:t=>({u_is_size_zoom_constant:new e.Uniform1i(t),u_is_size_feature_constant:new e.Uniform1i(t),u_size_t:new e.Uniform1f(t),u_size:new e.Uniform1f(t),u_camera_to_center_distance:new e.Uniform1f(t),u_rotate_symbol:new e.Uniform1i(t),u_aspect_ratio:new e.Uniform1f(t),u_fade_change:new e.Uniform1f(t),u_matrix:new e.UniformMatrix4f(t),u_label_plane_matrix:new e.UniformMatrix4f(t),u_coord_matrix:new e.UniformMatrix4f(t),u_is_text:new e.Uniform1i(t),u_pitch_with_map:new e.Uniform1i(t),u_texsize:new e.Uniform2f(t),u_texsize_icon:new e.Uniform2f(t),u_texture:new e.Uniform1i(t),u_texture_icon:new e.Uniform1i(t),u_gamma_scale:new e.Uniform1f(t),u_device_pixel_ratio:new e.Uniform1f(t),u_is_halo:new e.Uniform1i(t)}),background:t=>({u_matrix:new e.UniformMatrix4f(t),u_opacity:new e.Uniform1f(t),u_color:new e.UniformColor(t)}),backgroundPattern:t=>({u_matrix:new e.UniformMatrix4f(t),u_opacity:new e.Uniform1f(t),u_image:new e.Uniform1i(t),u_pattern_tl:new e.Uniform2f(t),u_pattern_br:new e.Uniform2f(t),u_texsize:new e.Uniform2f(t),u_pattern_size:new e.Uniform2f(t),u_pixel_coord_upper:new e.Uniform2f(t),u_pixel_coord_lower:new e.Uniform2f(t),u_tile_units_to_pixels:new e.Uniform1f(t)}),terrainRaster:vn,terrainDepth:vn,skybox:t=>({u_matrix:new e.UniformMatrix4f(t),u_sun_direction:new e.Uniform3f(t),u_cubemap:new e.Uniform1i(t),u_opacity:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t)}),skyboxGradient:t=>({u_matrix:new e.UniformMatrix4f(t),u_color_ramp:new e.Uniform1i(t),u_center_direction:new e.Uniform3f(t),u_radius:new e.Uniform1f(t),u_opacity:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t)}),skyboxCapture:t=>({u_matrix_3f:new e.UniformMatrix3f(t),u_sun_direction:new e.Uniform3f(t),u_sun_intensity:new e.Uniform1f(t),u_color_tint_r:new e.Uniform4f(t),u_color_tint_m:new e.Uniform4f(t),u_luminance:new e.Uniform1f(t)}),globeRaster:t=>({u_proj_matrix:new e.UniformMatrix4f(t),u_globe_matrix:new e.UniformMatrix4f(t),u_normalize_matrix:new e.UniformMatrix4f(t),u_merc_matrix:new e.UniformMatrix4f(t),u_zoom_transition:new e.Uniform1f(t),u_merc_center:new e.Uniform2f(t),u_image0:new e.Uniform1i(t),u_grid_matrix:new e.UniformMatrix3f(t),u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_globe_pos:new e.Uniform3f(t),u_globe_radius:new e.Uniform1f(t),u_viewport:new e.Uniform2f(t)}),globeAtmosphere:t=>({u_frustum_tl:new e.Uniform3f(t),u_frustum_tr:new e.Uniform3f(t),u_frustum_br:new e.Uniform3f(t),u_frustum_bl:new e.Uniform3f(t),u_horizon:new e.Uniform1f(t),u_transition:new e.Uniform1f(t),u_fadeout_range:new e.Uniform1f(t),u_color:new e.Uniform4f(t),u_high_color:new e.Uniform4f(t),u_space_color:new e.Uniform4f(t),u_star_intensity:new e.Uniform1f(t),u_star_density:new e.Uniform1f(t),u_star_size:new e.Uniform1f(t),u_temporal_offset:new e.Uniform1f(t),u_horizon_angle:new e.Uniform1f(t),u_rotation_matrix:new e.UniformMatrix4f(t)})};let li;function ci(t,n,i,r,o,a,s){const l=t.context,c=l.gl,u=t.transform,h=t.useProgram("collisionBox"),d=[];let f=0,p=0;for(let m=0;m<r.length;m++){const g=r[m],_=n.getTile(g),y=_.getBucket(i);if(!y)continue;const v=vt(g,y,u);let x=v;0===o[0]&&0===o[1]||(x=t.translatePosMatrix(v,_,o,a));const b=s?y.textCollisionBox:y.iconCollisionBox,w=y.collisionCircleArray;
2if(w.length>0){const t=e.create(),n=x;e.mul(t,y.placementInvProjMatrix,u.glCoordMatrix),e.mul(t,t,y.placementViewportMatrix),d.push({circleArray:w,circleOffset:p,transform:n,invTransform:t,projection:y.getProjection()}),f+=w.length/4,p=f}b&&(t.terrain&&t.terrain.setupElevationDraw(_,h),h.draw(l,c.LINES,e.DepthMode.disabled,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.disabled,qn(x,u,_,y.getProjection()),i.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,null,u.zoom,null,[b.collisionVertexBuffer,b.collisionVertexBufferExt]))}if(!s||!d.length)return;const m=t.useProgram("collisionCircle"),g=new e.StructArrayLayout2f1f2i16;g.resize(4*f),g._trim();let _=0;for(const e of d)for(let t=0;t<e.circleArray.length/4;t++){const n=4*t,i=e.circleArray[n+0],r=e.circleArray[n+1],o=e.circleArray[n+2],a=e.circleArray[n+3];g.emplace(_++,i,r,o,a,0),g.emplace(_++,i,r,o,a,1),g.emplace(_++,i,r,o,a,2),g.emplace(_++,i,r,o,a,3)}(!li||li.length<2*f)&&(li=function(t){const n=2*t,i=new e.StructArrayLayout3ui6;i.resize(n),i._trim();for(let e=0;e<n;e++){const t=6*e;i.uint16[t+0]=4*e+0,i.uint16[t+1]=4*e+1,i.uint16[t+2]=4*e+2,i.uint16[t+3]=4*e+2,i.uint16[t+4]=4*e+3,i.uint16[t+5]=4*e+0}return i}(f));const y=l.createIndexBuffer(li,!0),v=l.createVertexBuffer(g,e.collisionCircleLayout.members,!0);for(const n of d){const r={u_matrix:n.transform,u_inv_matrix:n.invTransform,u_camera_to_center_distance:(x=u).getCameraToCenterDistance(n.projection),u_viewport_size:[x.width,x.height]};m.draw(l,c.TRIANGLES,e.DepthMode.disabled,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.disabled,r,i.id,v,y,e.SegmentVector.simpleSegment(0,2*n.circleOffset,n.circleArray.length,n.circleArray.length/2),null,u.zoom)}var x;v.destroy(),y.destroy()}const ui=e.create();function hi({width:t,height:n,anchor:i,textOffset:r,textScale:o},a){const{horizontalAlign:s,verticalAlign:l}=e.getAnchorAlignment(i),c=-(s-.5)*t,u=-(l-.5)*n,h=e.evaluateVariableOffset(i,r);return new e.pointGeometry((c/o+h[0])*a,(u/o+h[1])*a)}function di(t,n,i,r,o,a,s,l,c,u,h){const d=t.text.placedSymbolArray,f=t.text.dynamicLayoutVertexArray,p=t.icon.dynamicLayoutVertexArray,m={},g=t.getProjection(),_=xt(l,g,a),y=a.elevation,v=g.upVectorScale(l.canonical,a.center.lat,a.worldSize).metersToTile;f.clear();for(let p=0;p<d.length;p++){const x=d.get(p),{tileAnchorX:b,tileAnchorY:w,numGlyphs:E}=x,T=t.allowVerticalPlacement&&!x.placedOrientation,S=x.hidden||!x.crossTileID||T?null:r[x.crossTileID];if(S){let r=0,d=0,p=0;if(y){const e=y?y.getAtTileOffset(l,b,w):0,[t,n,i]=g.upVector(l.canonical,b,w);r=e*t*v,d=e*n*v,p=e*i*v}let[T,A,C,k]=rt(x.projectedAnchorX+r,x.projectedAnchorY+d,x.projectedAnchorZ+p,i?_:s);const M=ot(a.getCameraToCenterDistance(g),k);let I=o.evaluateSizeForFeature(t.textSizeData,u,x)*M/e.ONE_EM;i&&(I*=t.tilePixelRatio/c);const P=hi(S,I);i?(({x:T,y:A,z:C}=g.projectTilePoint(b+P.x,w+P.y,l.canonical)),[T,A,C]=rt(T+r,A+d,
vendor: 57,456 bytes, line 2
2C+p,s)):(n&&P._rotate(-a.angle),T+=P.x,A+=P.y,C=0);const D=t.allowVerticalPlacement&&x.placedOrientation===e.WritingMode.vertical?Math.PI/2:0;for(let t=0;t<E;t++)e.addDynamicAttributes(f,T,A,C,D);h&&x.associatedIconIndex>=0&&(m[x.associatedIconIndex]={x:T,y:A,z:C,angle:D})}else pt(E,f)}if(h){p.clear();const n=t.icon.placedSymbolArray;for(let t=0;t<n.length;t++){const i=n.get(t),{numGlyphs:r}=i,o=m[t];if(i.hidden||!o)pt(r,p);else{const{x:t,y:n,z:i,angle:a}=o;for(let o=0;o<r;o++)e.addDynamicAttributes(p,t,n,i,a)}}t.icon.dynamicLayoutVertexBuffer.updateData(p)}t.text.dynamicLayoutVertexBuffer.updateData(f)}function fi(e,t,n){return n.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function pi(t,n,i,r,o,a,s,l,c,u,h,d){const f=t.context,p=f.gl,m=t.transform,g="map"===l,_="map"===c,y=g&&"point"!==i.layout.get("symbol-placement"),v=g&&!_&&!y,x=void 0!==i.layout.get("symbol-sort-key").constantOr(1);let b=!1;const w=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),E=[e.mercatorXfromLng(m.center.lng),e.mercatorYfromLat(m.center.lat)],T=i.layout.get("text-variable-anchor"),S="globe"===m.projection.name,A=[],C=[0,-1,0];let k=C;!S&&!m.mercatorFromTransition||g||(k=function(t){const n=t._camera.getWorldToCamera(t.worldSize,1),i=e.multiply([],n,t.globeMatrix);e.invert(i,i);const r=[0,0,0],o=[0,1,0,0];return e.transformMat4$1(o,o,i),r[0]=o[0],r[1]=o[1],r[2]=o[2],e.normalize(r,r),r}(m));for(const l of r){const r=n.getTile(l),c=r.getBucket(i);if(!c)continue;if("mercator"===c.projection.name&&S)continue;const h=o?c.text:c.icon;if(!h||c.fullyClipped||!h.segments.get().length)continue;const d=h.programConfigurations.get(i.id),f=o||c.sdfIcons,w=o?c.textSizeData:c.iconSizeData,M=_||0!==m.pitch,I=e.evaluateSizeForZoom(w,m.zoom);let P,D,z,L,O=[0,0],R=null;if(o){if(D=r.glyphAtlasTexture,z=p.LINEAR,P=r.glyphAtlasTexture.size,c.iconsInText){O=r.imageAtlasTexture.size,R=r.imageAtlasTexture;const e="composite"===w.kind||"camera"===w.kind;L=M||t.options.rotating||t.options.zooming||e?p.LINEAR:p.NEAREST}}else{const e=1!==i.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;D=r.imageAtlasTexture,z=f||t.options.rotating||t.options.zooming||e||M?p.LINEAR:p.NEAREST,P=r.imageAtlasTexture.size}const B="globe"===c.projection.name,F=B?k:C,N=B?e.globeToMercatorTransition(m.zoom):0,j=xt(l,c.getProjection(),m),U=m.calculatePixelsToTileUnitsMatrix(r),V=tt(j,r.tileID.canonical,_,g,m,c.getProjection(),U),G=t.terrain&&_&&y?e.invert(e.create(),V):ui,q=it(j,r.tileID.canonical,_,g,m,c.getProjection(),U),$=T&&c.hasTextData(),W="none"!==i.layout.get("icon-text-fit")&&$&&c.hasIconData();if(y){const e=m.elevation,n=e?e.getAtTileOffsetFunc(l,m.center.lat,m.worldSize,c.getProjection()):null,i=nt(j,r.tileID.canonical,_,g,m,c.getProjection(),U);st(c,j,t,o,i,q,_,u,n,l)}const Z=y||o&&T||W,X=t.translatePosMatrix(j,r,a,s),H=Z?ui:V,Y=t.translatePosMatrix(q,r,a,s,!0),K=c.getProjection().createInversionMatrix(m,l.canonical),J=[];t.terrainRenderModeElevated()&&_&&J.push("PITCH_WITH_MAP_TERRAIN"),B&&J.push("PROJECTION_GLOBE_VIEW"),Z&&J.push("PROJECTED_POS_ON_VIEWPORT");const Q=f&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let ee;ee=f?c.iconsInText?ri(w.kind,I,v,_,t,X,H,Y,P,O,l,N,E,K,F,c.getProjection()):ii(w.kind,I,v,_,t,X,H,Y,o,P,!0,l,N,E,K,F,c.getProjection()):ni(w.kind,I,v,_,t,X,H,Y,o,P,l,N,E,K,F,c.getProjection());const te={program:t.useProgram(fi(f,o,c),d,J),buffers:h,uniformValues:ee,atlasTexture:D,atlasTextureIcon:R,atlasInterpolation:z,atlasInterpolationIcon:L,isSDF:f,hasHalo:Q,tile:r,labelPlaneMatrixInv:G};if(x&&c.canOverlap){b=!0;const t=h.segments.get();for(const n of t)A.push({segments:new e.SegmentVector([n]),sortKey:n.sortKey,state:te})}else A.push({segments:h.segments,sortKey:0,state:te})}b&&A.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of A){const n=e.state;if(t.terrain&&t.terrain.setupElevationDraw(n.tile,n.program,{useDepthForOcclusion:!S,labelPlaneMatrixInv:n.labelPlaneMatrixInv}),f.activeTexture.set(p.TEXTURE0),n.atlasTexture.bind(n.atlasInterpolation,p.CLAMP_TO_EDGE),n.atlasTextureIcon&&(f.activeTexture.set(p.TEXTURE1),n.atlasTextureIcon&&n.atlasTextureIcon.bind(n.atlasInterpolationIcon,p.CLAMP_TO_EDGE)),n.isSDF){const r=n.uniformValues;n.hasHalo&&(r.u_is_halo=1,mi(n.buffers,e.segments,i,t,n.program,w,h,d,r)),r.u_is_halo=0}mi(n.buffers,e.segments,i,t,n.program,w,h,d,n.uniformValues)}}function mi(t,n,i,r,o,a,s,l,c){const u=r.context,h=[t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer,t.globeExtVertexBuffer];o.draw(u,u.gl.TRIANGLES,a,s,l,e.CullFaceMode.disabled,c,i.id,t.layoutVertexBuffer,t.indexBuffer,n,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),h)}function gi(t,n,i,r,o,a,s){const l=t.context.gl,c=i.paint.get("fill-pattern"),u=c&&c.constantOr(1);let h,d,f,p,m;s?(d=u&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h=l.LINES):(d=u?"fillPattern":"fill",h=l.TRIANGLES);for(const g of r){const r=n.getTile(g);if(u&&!r.patternsLoaded())continue;const _=r.getBucket(i);if(!_)continue;t.prepareDrawTile();const y=_.programConfigurations.get(i.id),v=t.useProgram(d,y);u&&(t.context.activeTexture.set(l.TEXTURE0),r.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers());const x=c.constantOr(null);if(x&&r.imageAtlas){const e=r.imageAtlas.patternPositions[x.toString()];e&&y.setConstantPatternPositions(e)}const b=t.translatePosMatrix(g.projMatrix,r,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(s){p=_.indexBuffer2,m=_.segments2;const e=t.terrain&&t.terrain.renderingToTexture?t.terrain.drapeBufferSize:[l.drawingBufferWidth,l.drawingBufferHeight];f="fillOutlinePattern"===d&&u?jn(b,t,r,e):Nn(b,e)}else p=_.indexBuffer,m=_.segments,f=u?Fn(b,t,r):Bn(b);t.prepareDrawProgram(t.context,v,g.toUnwrapped()),v.draw(t.context,h,o,t.stencilModeForClipping(g),a,e.CullFaceMode.disabled,f,i.id,_.layoutVertexBuffer,p,m,i.paint,t.transform.zoom,y)}}function _i(t,n,i,r,o,a,s){const l=t.context,c=l.gl,u=t.transform,h=i.paint.get("fill-extrusion-pattern"),d=h.constantOr(1),f=i.paint.get("fill-extrusion-opacity"),p=[i.paint.get("fill-extrusion-ambient-occlusion-intensity"),i.paint.get("fill-extrusion-ambient-occlusion-radius")],m=i.layout.get("fill-extrusion-edge-radius"),g="globe"===u.projection.name?e.fillExtrusionHeightLift():0,_="globe"===u.projection.name,y=_?e.globeToMercatorTransition(u.zoom):0,v=[e.mercatorXfromLng(u.center.lng),e.mercatorYfromLat(u.center.lat)],x=[];_&&(x.push("PROJECTION_GLOBE_VIEW"),t.style.terrainSetForDrapingOnly()&&x.push("TERRAIN")),p[0]>0&&x.push("FAUX_AO");for(const b of r){const r=n.getTile(b),w=r.getBucket(i);if(!w||w.projection.name!==u.projection.name)continue;const E=w.programConfigurations.get(i.id),T=t.useProgram(d?"fillExtrusionPattern":"fillExtrusion",E,x);if(t.terrain){const e=t.terrain;if(t.style.terrainSetForDrapingOnly())e.setupElevationDraw(r,T,{useMeterToDem:!0});else{if(!w.enableTerrain)continue;if(e.setupElevationDraw(r,T,{useMeterToDem:!0}),yi(l,n,b,w,i,e),!w.centroidVertexBuffer){const e=T.attributes.a_centroid_pos;void 0!==e&&c.vertexAttrib2f(e,0,0)}}}d&&(t.context.activeTexture.set(c.TEXTURE0),r.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),E.updatePaintBuffers());const S=h.constantOr(null);if(S&&r.imageAtlas){const e=r.imageAtlas.patternPositions[S.toString()];e&&E.setConstantPatternPositions(e)}const A=t.translatePosMatrix(b.projMatrix,r,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),C=u.projection.createInversionMatrix(u,b.canonical),k=i.paint.get("fill-extrusion-vertical-gradient"),M=d?Rn(A,t,k,f,p,m,b,r,g,y,v,C):On(A,t,k,f,p,m,b,g,y,v,C);t.prepareDrawProgram(l,T,b.toUnwrapped());const I=[];t.terrain&&I.push(w.centroidVertexBuffer),_&&I.push(w.layoutVertexExtBuffer),T.draw(l,l.gl.TRIANGLES,o,a,s,e.CullFaceMode.backCCW,M,i.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,i.paint,t.transform.zoom,E,I)}}function yi(t,n,i,r,o,a){const s=[t=>{let n=t.canonical.x-1,i=t.wrap;return n<0&&(n=(1<<t.canonical.z)-1,i--),new e.OverscaledTileID(t.overscaledZ,i,t.canonical.z,n,t.canonical.y)},t=>{let n=t.canonical.x+1,i=t.wrap;return n===1<<t.canonical.z&&(n=0,i++),new e.OverscaledTileID(t.overscaledZ,i,t.canonical.z,n,t.canonical.y)},t=>new e.OverscaledTileID(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,(0===t.canonical.y?1<<t.canonical.z:t.canonical.y)-1),t=>new e.OverscaledTileID(t.overscaledZ,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y===(1<<t.canonical.z)-1?0:t.canonical.y+1)],l=e=>{const t=n.getSource().minzoom,i=e=>{const t=n.getTileByID(e);if(t&&t.hasData())return t.getBucket(o)},r=[0,-1,1];for(const n of r){if(e.overscaledZ+n<t)continue;const r=i(e.calculateScaledKey(e.overscaledZ+n));if(r)return r}},c=[0,0,0],u=(t,n)=>(c[0]=Math.min(t.min.y,n.min.y),c[1]=Math.max(t.max.y,n.max.y),c[2]=e.EXTENT-n.min.x>t.max.x?n.min.x-e.EXTENT:t.max.x,c),h=(t,n)=>(c[0]=Math.min(t.min.x,n.min.x),c[1]=Math.max(t.max.x,n.max.x),c[2]=e.EXTENT-n.min.y>t.max.y?n.min.y-e.EXTENT:t.max.y,c),d=[(e,t)=>u(e,t),(e,t)=>u(t,e),(e,t)=>h(e,t),(e,t)=>h(t,e)],f=new e.pointGeometry(0,0);let p,m,g;const _=(t,n,r,o,s)=>{const l=[[o?r:t,o?t:r,0],[o?r:n,o?n:r,0]],c=s<0?e.EXTENT+s:s,u=[o?c:(t+n)/2,o?(t+n)/2:c,0];return 0===r&&s<0||0!==r&&s>0?a.getForTilePoints(g,[u],!0,m):l.push(u),a.getForTilePoints(i,l,!0,p),Math.max(l[0][2],l[1][2],u[2])/a.exaggeration()};for(let t=0;t<4;t++){const n=(t<2?1:5)-t,o=r.borders[t];if(0===o.length)continue;const c=g=s[t](i),u=l(c);if(!(u&&u instanceof e.FillExtrusionBucket&&u.enableTerrain))continue;if(r.borderDoneWithNeighborZ[t]===u.canonical.z&&u.borderDoneWithNeighborZ[n]===r.canonical.z)continue;if(m=a.findDEMTileFor(c),!m||!m.dem)continue;if(!p){const e=a.findDEMTileFor(i);if(!e||!e.dem)return;p=e}const h=u.borders[n];let y=0;const v=u.borderDoneWithNeighborZ[n]!==r.canonical.z;if(r.canonical.z===u.canonical.z){for(let i=0;i<o.length;i++){const a=r.featuresOnBorder[o[i]],s=a.borders[t];let l;for(;y<h.length&&(l=u.featuresOnBorder[h[y]],!(l.borders[n][1]>s[0]+3));)v&&u.encodeCentroid(void 0,l,!1),y++;if(l&&y<h.length){const i=y;let o=0;for(;!(l.borders[n][0]>s[1]-3)&&(o++,++y!==h.length);)l=u.featuresOnBorder[h[y]];if(l=u.featuresOnBorder[h[i]],a.intersectsCount()>1||l.intersectsCount()>1||1!==o){1!==o&&(y=i),r.encodeCentroid(void 0,a,!1),v&&u.encodeCentroid(void 0,l,!1);continue}const c=d[t](a,l),p=t%2?e.EXTENT-1:0;f.x=_(c[0],Math.min(e.EXTENT-1,c[1]),p,t<2,c[2]),f.y=0,r.encodeCentroid(f,a,!1),v&&u.encodeCentroid(f,l,!1)}else r.encodeCentroid(void 0,a,!1)}r.borderDoneWithNeighborZ[t]=u.canonical.z,r.needsCentroidUpdate=!0,v&&(u.borderDoneWithNeighborZ[n]=r.canonical.z,u.needsCentroidUpdate=!0)}else{for(const e of o)r.encodeCentroid(void 0,r.featuresOnBorder[e],!1);if(v){for(const e of h)u.encodeCentroid(void 0,u.featuresOnBorder[e],!1);u.borderDoneWithNeighborZ[n]=r.canonical.z,u.needsCentroidUpdate=!0}r.borderDoneWithNeighborZ[t]=u.canonical.z,r.needsCentroidUpdate=!0}}(r.needsCentroidUpdate||!r.centroidVertexBuffer&&0!==r.centroidVertexArray.length)&&r.uploadCentroid(t)}const vi=new e.Color(1,0,0,1),xi=new e.Color(0,1,0,1),bi=new e.Color(0,0,1,1),wi=new e.Color(1,0,1,1),Ei=new e.Color(0,1,1,1);function Ti(t,n,i){const r=t.context,o=t.transform,a=r.gl,s="globe"===o.projection.name,l=s?["PROJECTION_GLOBE_VIEW"]:null;let c=i.projMatrix;if(s&&e.globeToMercatorTransition(o.zoom)>0){const t=e.transitionTileAABBinECEF(i.canonical,o),n=e.globeDenormalizeECEF(t);c=e.multiply(new Float32Array(16),o.globeMatrix,n),e.multiply(c,o.projMatrix,c)}const u=t.useProgram("debug",null,l),h=n.getTileByID(i.key);t.terrain&&t.terrain.setupElevationDraw(h,u);const d=e.DepthMode.disabled,f=e.StencilMode.disabled,p=t.colorModeForRenderPass(),m="$debug";r.activeTexture.set(a.TEXTURE0),t.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s?h._makeGlobeTileDebugBuffers(t.context,o):h._makeDebugTileBoundsBuffers(t.context,o.projection);const g=h._tileDebugBuffer||t.debugBuffer,_=h._tileDebugIndexBuffer||t.debugIndexBuffer,y=h._tileDebugSegments||t.debugSegments;u.draw(r,a.LINE_STRIP,d,f,p,e.CullFaceMode.disabled,$n(c,e.Color.red),m,g,_,y,null,null,null,[h._globeTileDebugBorderBuffer]);const v=h.latestRawTileData,x=Math.floor((v&&v.byteLength||0)/1024),b=n.getTile(i).tileSize,w=512/Math.min(b,512)*(i.overscaledZ/o.zoom)*.5;let E=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(E+=` => ${i.overscaledZ}`),E+=` ${x}kb`,function(e,t){e.initDebugOverlayCanvas();const n=e.debugOverlayCanvas,i=e.context.gl,r=e.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,n.width,n.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(t,5,5),r.strokeText(t,5,5),e.debugOverlayTexture.update(n),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(t,E);const T=h._tileDebugTextBuffer||t.debugBuffer,S=h._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,A=h._tileDebugTextSegments||t.debugSegments;u.draw(r,a.TRIANGLES,d,f,e.ColorMode.alphaBlended,e.CullFaceMode.disabled,$n(c,e.Color.transparent,w),m,T,S,A,null,null,null,[h._globeTileDebugTextBuffer])}function Si(e,t,n,i){Ci(e,0,t+n/2,e.transform.width,n,i)}function Ai(e,t,n,i){Ci(e,t-n/2,0,n,e.transform.height,i)}function Ci(t,n,i,r,o,a){const s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(n*e.exported.devicePixelRatio,i*e.exported.devicePixelRatio,r*e.exported.devicePixelRatio,o*e.exported.devicePixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}const ki=e.createLayout([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:Mi}=ki;function Ii(e,t,n,i){e.emplaceBack(t,n,i)}class Pi{constructor(t){this.vertexArray=new e.StructArrayLayout3f12,this.indices=new e.StructArrayLayout3ui6,Ii(this.vertexArray,-1,-1,1),Ii(this.vertexArray,1,-1,1),Ii(this.vertexArray,-1,1,1),Ii(this.vertexArray,1,1,1),Ii(this.vertexArray,-1,-1,-1),Ii(this.vertexArray,1,-1,-1),Ii(this.vertexArray,-1,1,-1),Ii(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=t.createVertexBuffer(this.vertexArray,Mi),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=e.SegmentVector.simpleSegment(0,0,36,12)}}function Di(t,n,i,r,o,a){const s=t.gl,l=n.paint.get("sky-atmosphere-color"),c=n.paint.get("sky-atmosphere-halo-color"),u=n.paint.get("sky-atmosphere-sun-intensity"),h=((e,t,n,i,r)=>({u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:n,u_color_tint_r:[i.r,i.g,i.b,i.a],u_color_tint_m:[r.r,r.g,r.b,r.a],u_luminance:5e-5}))(e.fromMat4(e.create$1(),r),o,u,l,c);s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_CUBE_MAP_POSITIVE_X+a,n.skyboxTexture,0),i.draw(t,s.TRIANGLES,e.DepthMode.disabled,e.StencilMode.disabled,e.ColorMode.unblended,e.CullFaceMode.frontCW,h,"skyboxCapture",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}const zi=e.createLayout([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class Li{constructor(t){const n=new e.StructArrayLayout5f20;n.emplaceBack(-1,1,1,0,0),n.emplaceBack(1,1,1,1,0),n.emplaceBack(1,-1,1,1,1),n.emplaceBack(-1,-1,1,0,1);const i=new e.StructArrayLayout3ui6;i.emplaceBack(0,1,2),i.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(n,zi.members),this.indexBuffer=t.createIndexBuffer(i),this.segments=e.SegmentVector.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const Oi={symbol:function(t,n,i,r,o){if("translucent"!==t.renderPass)return;const a=e.StencilMode.disabled,s=t.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(t,n,i,r,o,a,s){const l=n.transform,c="map"===o,u="map"===a;for(const n of t){const t=r.getTile(n),o=t.getBucket(i);if(!o||!o.text||!o.text.segments.get().length)continue;const a=e.evaluateSizeForZoom(o.textSizeData,l.zoom),h=xt(n,o.getProjection(),l),d=l.calculatePixelsToTileUnitsMatrix(t),f=tt(h,t.tileID.canonical,u,c,l,o.getProjection(),d),p="none"!==i.layout.get("icon-text-fit")&&o.hasIconData();if(a){const i=Math.pow(2,l.zoom-t.tileID.overscaledZ);di(o,c,u,s,e.symbolSize,l,f,n,i,a,p)}}}(r,t,i,n,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),o),0!==i.paint.get("icon-opacity").constantOr(1)&&pi(t,n,i,r,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),a,s),0!==i.paint.get("text-opacity").constantOr(1)&&pi(t,n,i,r,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),a,s),n.map.showCollisionBoxes&&(ci(t,n,i,r,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),ci(t,n,i,r,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))},circle:function(t,n,i,r){if("translucent"!==t.renderPass)return;const o=i.paint.get("circle-opacity"),a=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity"),l=void 0!==i.layout.get("circle-sort-key").constantOr(1);if(0===o.constantOr(1)&&(0===a.constantOr(1)||0===s.constantOr(1)))return;const c=t.context,u=c.gl,h=t.transform,d=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),f=e.StencilMode.disabled,p=t.colorModeForRenderPass(),m="globe"===h.projection.name,g=[e.mercatorXfromLng(h.center.lng),e.mercatorYfromLat(h.center.lat)],_=[];for(let o=0;o<r.length;o++){const a=r[o],s=n.getTile(a),c=s.getBucket(i);if(!c||c.projection.name!==h.projection.name)continue;const u=c.programConfigurations.get(i.id),d=Gn(i);m&&d.push("PROJECTION_GLOBE_VIEW");const f=t.useProgram("circle",u,d),p=c.layoutVertexBuffer,y=c.globeExtVertexBuffer,v=c.indexBuffer,x=h.projection.createInversionMatrix(h,a.canonical),b={programConfiguration:u,program:f,layoutVertexBuffer:p,globeExtVertexBuffer:y,indexBuffer:v,uniformValues:Vn(t,a,s,x,g,i),tile:s};if(l){const t=c.segments.get();for(const n of t)_.push({segments:new e.SegmentVector([n]),sortKey:n.sortKey,state:b})}else _.push({segments:c.segments,sortKey:0,state:b})}l&&_.sort(((e,t)=>e.sortKey-t.sortKey));const y={useDepthForOcclusion:!m};for(const n of _){const{programConfiguration:r,program:o,layoutVertexBuffer:a,globeExtVertexBuffer:s,indexBuffer:l,uniformValues:m,tile:g}=n.state,_=n.segments;t.terrain&&t.terrain.setupElevationDraw(g,o,y),t.prepareDrawProgram(c,o,g.tileID.toUnwrapped()),o.draw(c,u.TRIANGLES,d,f,p,e.CullFaceMode.disabled,m,i.id,a,l,_,i.paint,h.zoom,r,[s])}},heatmap:function(t,n,i,r){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const o=t.context,a=o.gl,s=e.StencilMode.disabled,l=new e.ColorMode([a.ONE,a.ONE],e.Color.transparent,[!0,!0,!0,!0]);!function(e,t,n,i){const r=e.gl,o=t.width*i,a=t.height*i;e.activeTexture.set(r.TEXTURE1),e.viewport.set([0,0,o,a]);let s=n.heatmapFbo;if(!s||s&&(s.width!==o||s.height!==a)){s&&s.destroy();const t=r.createTexture();r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),s=n.heatmapFbo=e.createFramebuffer(o,a,!1),function(e,t,n,i,r,o){const a=e.gl;a.texImage2D(a.TEXTURE_2D,0,a.RGBA,r,o,0,a.RGBA,e.extRenderToTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:a.UNSIGNED_BYTE,null),i.colorAttachment.set(n)}(e,0,t,s,o,a)}else r.bindTexture(r.TEXTURE_2D,s.colorAttachment.get()),e.bindFramebuffer.set(s.framebuffer)}(o,t,i,"globe"===t.transform.projection.name?.5:.25),o.clear({color:e.Color.transparent});const c=t.transform,u="globe"===c.projection.name,h=u?["PROJECTION_GLOBE_VIEW"]:null,d=u?e.CullFaceMode.frontCCW:e.CullFaceMode.disabled,f=[e.mercatorXfromLng(c.center.lng),e.mercatorYfromLat(c.center.lat)];for(let p=0;p<r.length;p++){const m=r[p];if(n.hasRenderableParent(m))continue;const g=n.getTile(m),_=g.getBucket(i);if(!_||_.projection.name!==c.projection.name)continue;const y=_.programConfigurations.get(i.id),v=t.useProgram("heatmap",y,h),{zoom:x}=t.transform;t.terrain&&t.terrain.setupElevationDraw(g,v),t.prepareDrawProgram(o,v,m.toUnwrapped());const b=c.projection.createInversionMatrix(c,m.canonical);v.draw(o,a.TRIANGLES,e.DepthMode.disabled,s,l,d,Zn(t,m,g,b,f,x,i.paint.get("heatmap-intensity")),i.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,i.paint,t.transform.zoom,y,u?[_.globeExtVertexBuffer]:null)}o.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,n){const i=t.context,r=i.gl,o=n.heatmapFbo;if(!o)return;i.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),i.activeTexture.set(r.TEXTURE1);let a=n.colorRampTexture;a||(a=n.colorRampTexture=new e.Texture(i,n.colorRamp,r.RGBA)),a.bind(r.LINEAR,r.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(i,r.TRIANGLES,e.DepthMode.disabled,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.disabled,((e,t,n,i)=>({u_image:0,u_color_ramp:1,u_opacity:t.paint.get("heatmap-opacity")}))(0,n),n.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,n.paint,t.transform.zoom)}(t,i))},line:function(t,n,i,r){if("translucent"!==t.renderPass)return;const o=i.paint.get("line-opacity"),a=i.paint.get("line-width");if(0===o.constantOr(1)||0===a.constantOr(1))return;const s=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),l=t.colorModeForRenderPass(),c=t.terrain&&t.terrain.renderingToTexture?1:e.exported.devicePixelRatio,u=i.paint.get("line-dasharray"),h=u.constantOr(1),d=i.layout.get("line-cap"),f=i.paint.get("line-pattern"),p=f.constantOr(1),m=i.paint.get("line-gradient"),g=p?"linePattern":"line",_=t.context,y=_.gl,v=(e=>{const t=[];Jn(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const n=e.paint.get("line-trim-offset");0===n[0]&&0===n[1]||t.push("RENDER_LINE_TRIM_OFFSET");const i=e.paint.get("line-pattern").constantOr(1),r=1!==e.paint.get("line-opacity").constantOr(1);return!i&&r&&t.push("RENDER_LINE_ALPHA_DISCARD"),t})(i);let x=v.includes("RENDER_LINE_ALPHA_DISCARD");t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(x=!1);for(const o of r){const r=n.getTile(o);if(p&&!r.patternsLoaded())continue;const a=r.getBucket(i);if(!a)continue;t.prepareDrawTile();const b=a.programConfigurations.get(i.id),w=t.useProgram(g,b,v),E=f.constantOr(null);if(E&&r.imageAtlas){const e=r.imageAtlas.patternPositions[E.toString()];e&&b.setConstantPatternPositions(e)}const T=u.constantOr(null),S=d.constantOr(null);if(!p&&T&&S&&r.lineAtlas){const e=r.lineAtlas.getDash(T,S);e&&b.setConstantPatternPositions(e)}let[A,C]=i.paint.get("line-trim-offset");if("round"===S||"square"===S){const e=1;A!==C&&(0===A&&(A-=e),1===C&&(C+=e))}const k=t.terrain?o.projMatrix:null,M=p?Hn(t,r,i,k,c):Xn(t,r,i,k,a.lineClipsArray.length,c,[A,C]);if(m){const r=a.gradients[i.id];let s=r.texture;if(i.gradientVersion!==r.version){let l=256;if(i.stepInterpolant){const i=n.getSource().maxzoom,r=o.canonical.z===i?Math.ceil(1<<t.transform.maxZoom-o.canonical.z):1;l=e.clamp(e.nextPowerOfTwo(a.maxLineLength/e.EXTENT*1024*r),256,_.maxTextureSize)}r.gradient=e.renderColorRamp({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:r.gradient||void 0,clips:a.lineClipsArray}),r.texture?r.texture.update(r.gradient):r.texture=new e.Texture(_,r.gradient,y.RGBA),r.version=i.gradientVersion,s=r.texture}_.activeTexture.set(y.TEXTURE1),s.bind(i.stepInterpolant?y.NEAREST:y.LINEAR,y.CLAMP_TO_EDGE)}h&&(_.activeTexture.set(y.TEXTURE0),r.lineAtlasTexture.bind(y.LINEAR,y.REPEAT),b.updatePaintBuffers()),p&&(_.activeTexture.set(y.TEXTURE0),r.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),b.updatePaintBuffers()),t.prepareDrawProgram(_,w,o.toUnwrapped());const I=n=>{w.draw(_,y.TRIANGLES,s,n,l,e.CullFaceMode.disabled,M,i.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,i.paint,t.transform.zoom,b,[a.layoutVertexBuffer2])};if(x){const n=t.stencilModeForClipping(o).ref;0===n&&t.terrain&&_.clear({stencil:0});const i={func:y.EQUAL,mask:255};M.u_alpha_discard_threshold=.8,I(new e.StencilMode(i,n,255,y.KEEP,y.KEEP,y.INVERT)),M.u_alpha_discard_threshold=0,I(new e.StencilMode(i,n,255,y.KEEP,y.KEEP,y.KEEP))}else I(t.stencilModeForClipping(o))}x&&(t.resetStencilClippingMasks(),t.terrain&&_.clear({stencil:0}))},fill:function(t,n,i,r){const o=i.paint.get("fill-color"),a=i.paint.get("fill-opacity");if(0===a.constantOr(1))return;const s=t.colorModeForRenderPass(),l=i.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(e.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){const o=t.depthModeForSublayer(1,"opaque"===t.renderPass?e.DepthMode.ReadWrite:e.DepthMode.ReadOnly);gi(t,n,i,r,o,s,!1)}if("translucent"===t.renderPass&&i.paint.get("fill-antialias")){const o=t.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,e.DepthMode.ReadOnly);gi(t,n,i,r,o,s,!0)}},"fill-extrusion":function(t,n,i,r){const o=i.paint.get("fill-extrusion-opacity");if(0!==o&&"translucent"===t.renderPass){const a=new e.DepthMode(t.context.gl.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D);if(1!==o||i.paint.get("fill-extrusion-pattern").constantOr(1))_i(t,n,i,r,a,e.StencilMode.disabled,e.ColorMode.disabled),_i(t,n,i,r,a,t.stencilModeFor3D(),t.colorModeForRenderPass()),t.resetStencilClippingMasks();else{const o=t.colorModeForRenderPass();_i(t,n,i,r,a,e.StencilMode.disabled,o)}}},hillshade:function(t,n,i,r){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;const o=t.context,a=t.depthModeForSublayer(0,e.DepthMode.ReadOnly),s=t.colorModeForRenderPass(),l=t.terrain&&t.terrain.renderingToTexture,[c,u]="translucent"!==t.renderPass||l?[{},r]:t.stencilConfigForOverlap(r);for(const r of u){const o=n.getTile(r);if(o.needsHillshadePrepare&&"offscreen"===t.renderPass)yn(t,o,i,a,e.StencilMode.disabled,s);else if("translucent"===t.renderPass){const e=l&&t.terrain?t.terrain.stencilModeForRTTOverlap(r):c[r.overscaledZ];gn(t,r,o,i,a,e,s)}}o.viewport.set([0,0,t.width,t.height]),t.resetStencilClippingMasks()},raster:function(t,n,i,r,o,a){if("translucent"!==t.renderPass)return;if(0===i.paint.get("raster-opacity"))return;if(!r.length)return;const s=t.context,l=s.gl,c=n.getSource(),u=t.useProgram("raster"),h=t.colorModeForRenderPass(),d=t.terrain&&t.terrain.renderingToTexture,[f,p]=c instanceof Ie||d?[{},r]:t.stencilConfigForOverlap(r),m=p[p.length-1].overscaledZ,g=!t.options.moving;for(const r of p){const o=d?e.DepthMode.disabled:t.depthModeForSublayer(r.overscaledZ-m,1===i.paint.get("raster-opacity")?e.DepthMode.ReadWrite:e.DepthMode.ReadOnly,l.LESS),p=r.toUnwrapped(),_=n.getTile(r);if(d&&(!_||!_.hasData()))continue;const y=d?r.projMatrix:t.transform.calculateProjMatrix(p,g),v=t.terrain&&d?t.terrain.stencilModeForRTTOverlap(r):f[r.overscaledZ],x=a?0:i.paint.get("raster-fade-duration");_.registerFadeDuration(x);const b=n.findLoadedParent(r,0),w=Cn(_,b,n,t.transform,x);let E,T;t.terrain&&t.terrain.prepareDrawTile();const S="nearest"===i.paint.get("raster-resampling")?l.NEAREST:l.LINEAR;s.activeTexture.set(l.TEXTURE0),_.texture.bind(S,l.CLAMP_TO_EDGE),s.activeTexture.set(l.TEXTURE1),b?(b.texture.bind(S,l.CLAMP_TO_EDGE),E=Math.pow(2,b.tileID.overscaledZ-_.tileID.overscaledZ),T=[_.tileID.canonical.x*E%1,_.tileID.canonical.y*E%1]):_.texture.bind(S,l.CLAMP_TO_EDGE);const A=Qn(y,T||[0,0],E||1,w,i,c instanceof Ie?c.perspectiveTransform:[0,0]);if(t.prepareDrawProgram(s,u,p),c instanceof Ie)c.boundsBuffer&&c.boundsSegments&&u.draw(s,l.TRIANGLES,o,e.StencilMode.disabled,h,e.CullFaceMode.disabled,A,i.id,c.boundsBuffer,t.quadTriangleIndexBuffer,c.boundsSegments);else{const{tileBoundsBuffer:n,tileBoundsIndexBuffer:r,tileBoundsSegments:a}=t.getTileBoundsBuffers(_);u.draw(s,l.TRIANGLES,o,v,h,e.CullFaceMode.disabled,A,i.id,n,r,a)}}t.resetStencilClippingMasks()},background:function(t,n,i,r){const o=i.paint.get("background-color"),a=i.paint.get("background-opacity");if(0===a)return;const s=t.context,l=s.gl,c=t.transform,u=c.tileSize,h=i.paint.get("background-pattern");if(t.isPatternMissing(h))return;const d=!h&&1===o.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==d)return;const f=e.StencilMode.disabled,p=t.depthModeForSublayer(0,"opaque"===d?e.DepthMode.ReadWrite:e.DepthMode.ReadOnly),m=t.colorModeForRenderPass(),g=t.useProgram(h?"backgroundPattern":"background");let _,y=r;y||(_=t.getBackgroundTiles(),y=Object.values(_).map((e=>e.tileID))),h&&(s.activeTexture.set(l.TEXTURE0),t.imageManager.bind(t.context));for(const d of y){const y=d.toUnwrapped(),v=r?d.projMatrix:t.transform.calculateProjMatrix(y);t.prepareDrawTile();const x=n?n.getTile(d):_?_[d.key]:new e.Tile(d,u,c.zoom,t),b=h?ai(v,a,t,h,{tileID:d,tileSize:u}):oi(v,a,o);t.prepareDrawProgram(s,g,y);const{tileBoundsBuffer:w,tileBoundsIndexBuffer:E,tileBoundsSegments:T}=t.getTileBoundsBuffers(x);g.draw(s,l.TRIANGLES,p,f,m,e.CullFaceMode.disabled,b,i.id,w,E,T)}},sky:function(t,n,i){const r=t.transform,o="mercator"===r.projection.name||"globe"===r.projection.name?1:e.smoothstep(7,8,r.zoom),a=i.paint.get("sky-opacity")*o;if(0===a)return;const s=t.context,l=i.paint.get("sky-type"),c=new e.DepthMode(s.gl.LEQUAL,e.DepthMode.ReadOnly,[0,1]),u=t.frameCounter/1e3%1;"atmosphere"===l?"offscreen"===t.renderPass?i.needsSkyboxCapture(t)&&(function(t,n,i,r){const o=t.context,a=o.gl;let s=n.skyboxFbo;if(!s){s=n.skyboxFbo=o.createFramebuffer(32,32,!1),n.skyboxGeometry=new Pi(o),n.skyboxTexture=o.gl.createTexture(),a.bindTexture(a.TEXTURE_CUBE_MAP,n.skyboxTexture),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_CUBE_MAP,a.TEXTURE_MAG_FILTER,a.LINEAR);for(let e=0;e<6;++e)a.texImage2D(a.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,a.RGBA,32,32,0,a.RGBA,a.UNSIGNED_BYTE,null)}o.bindFramebuffer.set(s.framebuffer),o.viewport.set([0,0,32,32]);const l=n.getCenter(t,!0),c=t.useProgram("skyboxCapture"),u=new Float64Array(16);e.identity(u),e.rotateY(u,u,.5*-Math.PI),Di(o,n,c,u,l,0),e.identity(u),e.rotateY(u,u,.5*Math.PI),Di(o,n,c,u,l,1),e.identity(u),e.rotateX(u,u,.5*-Math.PI),Di(o,n,c,u,l,2),e.identity(u),e.rotateX(u,u,.5*Math.PI),Di(o,n,c,u,l,3),e.identity(u),Di(o,n,c,u,l,4),e.identity(u),e.rotateY(u,u,Math.PI),Di(o,n,c,u,l,5),o.viewport.set([0,0,t.width,t.height])}(t,i),i.markSkyboxValid(t)):"sky"===t.renderPass&&function(t,n,i,r,o){const a=t.context,s=a.gl,l=t.transform,c=t.useProgram("skybox");a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_CUBE_MAP,n.skyboxTexture);const u=((e,t,n,i,r)=>({u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:i,u_temporal_offset:r}))(l.skyboxMatrix,n.getCenter(t,!1),0,r,o);t.prepareDrawProgram(a,c),c.draw(a,s.TRIANGLES,i,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.backCW,u,"skybox",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}(t,i,c,a,u):"gradient"===l&&"sky"===t.renderPass&&function(t,n,i,r,o){const a=t.context,s=a.gl,l=t.transform,c=t.useProgram("skyboxGradient");n.skyboxGeometry||(n.skyboxGeometry=new Pi(a)),a.activeTexture.set(s.TEXTURE0);let u=n.colorRampTexture;u||(u=n.colorRampTexture=new e.Texture(a,n.colorRamp,s.RGBA)),u.bind(s.LINEAR,s.CLAMP_TO_EDGE);const h=((t,n,i,r,o)=>({u_matrix:t,u_color_ramp:0,u_center_direction:n,u_radius:e.degToRad(i),u_opacity:r,u_temporal_offset:o}))(l.skyboxMatrix,n.getCenter(t,!1),n.paint.get("sky-gradient-radius"),r,o);t.prepareDrawProgram(a,c),c.draw(a,s.TRIANGLES,i,e.StencilMode.disabled,t.colorModeForRenderPass(),e.CullFaceMode.backCW,h,"skyboxGradient",n.skyboxGeometry.vertexBuffer,n.skyboxGeometry.indexBuffer,n.skyboxGeometry.segment)}(t,i,c,a,u)},debug:function(e,t,n){for(let i=0;i<n.length;i++)Ti(e,t,n[i])},custom:function(t,n,i){const r=t.context,o=i.implementation;if(t.transform.projection.unsupportedLayers&&t.transform.projection.unsupportedLayers.includes("custom"))e.warnOnce("Custom layers are not yet supported with non-mercator projections. Use mercator to enable custom layers.");else if("offscreen"===t.renderPass){const e=o.prerender;e&&(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),e.call(o,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(e.StencilMode.disabled);const n="3d"===o.renderingMode?new e.DepthMode(t.context.gl.LEQUAL,e.DepthMode.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,e.DepthMode.ReadOnly);r.setDepthMode(n),o.render(r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null)}}};class Ri{constructor(t,n){this.context=new Ae(t),this.transform=n,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.setup(),this.numSublayers=e.SourceCache.maxUnderzooming+e.SourceCache.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Wt,this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={}}updateTerrain(e,t){const n=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(!(n||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new Pn(this,e));const i=this._terrain;this.transform.elevation=n?i:null,i.update(e,this.transform,t)}_updateFog(e){const t=e.fog;if(!t||"globe"===this.transform.projection.name||t.getOpacity(this.transform.pitch)<1||t.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[n,i]=t.getFovAdjustedRange(this.transform._fov);if(n>i)return void(this.transform.fogCullDistSq=null);const r=n+.78*(i-n);this.transform.fogCullDistSq=r*r}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled?this._terrain:null}resize(t,n){if(this.width=t*e.exported.devicePixelRatio,this.height=n*e.exported.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style.order)this.style._layers[e].resize()}setup(){const t=this.context,n=new e.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(e.EXTENT,0),n.emplaceBack(0,e.EXTENT),n.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(n,e.posAttributes.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);const i=new e.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(e.EXTENT,0),i.emplaceBack(0,e.EXTENT),i.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=t.createVertexBuffer(i,e.posAttributes.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);const r=new e.StructArrayLayout2i4;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(-1,1),r.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(r,e.posAttributes.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);const o=new e.StructArrayLayout4i8;o.emplaceBack(0,0,0,0),o.emplaceBack(e.EXTENT,0,e.EXTENT,0),o.emplaceBack(0,e.EXTENT,0,e.EXTENT),o.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.mercatorBoundsBuffer=t.createVertexBuffer(o,e.boundsAttributes.members),this.mercatorBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);const a=new e.StructArrayLayout3ui6;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(a);const s=new e.StructArrayLayout1ui2;for(const e of[0,1,3,2,0])s.emplaceBack(e);this.debugIndexBuffer=t.createIndexBuffer(s),this.emptyTexture=new e.Texture(t,new e.RGBAImage({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA),this.identityMat=e.create();const l=this.context.gl;this.stencilClearMode=new e.StencilMode({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(e.window.performance.now()),this.atmosphereBuffer=new Li(this.context)}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(e){return e._makeTileBoundsBuffers(this.context,this.transform.projection),e._tileBoundsBuffer?{tileBoundsBuffer:e._tileBoundsBuffer,tileBoundsIndexBuffer:e._tileBoundsIndexBuffer,tileBoundsSegments:e._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.useProgram("clippingMask").draw(t,n.TRIANGLES,e.DepthMode.disabled,this.stencilClearMode,e.ColorMode.disabled,e.CullFaceMode.disabled,An(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(t,n,i){if(!n||this.currentStencilSource===n.id||!t.isTileClipped()||!i||0===i.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(const t of i)if(void 0===this._tileClippingMaskIDs[t.key]){e=!0;break}if(!e)return}this.currentStencilSource=n.id;const r=this.context,o=r.gl;this.nextStencilID+i.length>256&&this.clearStencil(),r.setColorMode(e.ColorMode.disabled),r.setDepthMode(e.DepthMode.disabled);const a=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const t of i){const i=n.getTile(t),s=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,{tileBoundsBuffer:l,tileBoundsIndexBuffer:c,tileBoundsSegments:u}=this.getTileBoundsBuffers(i);a.draw(r,o.TRIANGLES,e.DepthMode.disabled,new e.StencilMode({func:o.ALWAYS,mask:0},s,255,o.KEEP,o.KEEP,o.REPLACE),e.ColorMode.disabled,e.CullFaceMode.disabled,An(t.projMatrix),"$clipping",l,c,u)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,n=this.context.gl;return new e.StencilMode({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(t);const n=this.context.gl;return new e.StencilMode({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}stencilConfigForOverlap(t){const n=this.context.gl,i=t.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),r=i[i.length-1].overscaledZ,o=i[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();const t={};for(let i=0;i<o;i++)t[i+r]=new e.StencilMode({func:n.GEQUAL,mask:255},i+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=o,[t,i]}return[{[r]:e.StencilMode.disabled},i]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const n=1/8;return new e.ColorMode([t.CONSTANT_COLOR,t.ONE],new e.Color(n,n,n,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?e.ColorMode.unblended:e.ColorMode.alphaBlended}depthModeForSublayer(t,n,i){if(!this.opaquePassEnabledForLayer())return e.DepthMode.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new e.DepthMode(i||this.context.gl.LEQUAL,n,[r,r])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,n){this.style=t,this.options=n,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.exported.now()),this.imageManager.beginFrame();const i=this.style.order,r=this.style._sourceCaches;for(const e in r){const t=r[e];t.used&&t.prepare(this.context)}const o={},a={},s={};for(const e in r){const t=r[e];o[e]=t.getVisibleCoordinates(),a[e]=o[e].slice().reverse(),s[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<i.length;e++)if(this.style._layers[i[e]].is3D()){this.opaquePassCutoff=e;break}if(this.terrain&&(this.terrain.updateTileBinding(s),this.opaquePassCutoff=0),"globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.GlobeSharedBuffers(this.context)),e.isMapAuthenticated(this.context.gl)){this.renderPass="offscreen";for(const e of i){const n=this.style._layers[e],i=t._getLayerSourceCache(n);if(!n.hasOffscreenPass()||n.isHidden(this.transform.zoom))continue;const r=i?a[i.id]:void 0;("custom"===n.type||n.isSky()||r&&r.length)&&this.renderLayer(this,i,n,r)}if(this.depthRangeFor3D=[0,1-(t.order.length+2)*this.numSublayers*this.depthEpsilon],this.terrain&&(this.style.hasSymbolLayers()||this.style.hasCircleLayers())&&this.terrain.drawDepth(),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]),this.context.clear({color:n.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=n.showOverdrawInspector,this.renderPass="opaque",!this.terrain)for(this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){const e=this.style._layers[i[this.currentLayer]],n=t._getLayerSourceCache(e);if(e.isSky())continue;const r=n?a[n.id]:void 0;this._renderTileClippingMasks(e,n,r),this.renderLayer(this,n,e,r)}if(this.style.fog&&this.transform.projection.supportsFog&&function(t,n){const i=t.context,r=i.gl,o=t.transform,a=new e.DepthMode(r.LEQUAL,e.DepthMode.ReadOnly,[0,1]),s=t.useProgram("globeAtmosphere",null,"globe"===o.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"]),l=e.globeToMercatorTransition(o.zoom),c=n.properties.get("color").toArray01(),u=n.properties.get("high-color").toArray01(),h=n.properties.get("space-color").toArray01PremultipliedAlpha(),d=e.identity$1([]);e.rotateY$1(d,d,-e.degToRad(o._center.lng)),e.rotateX$1(d,d,e.degToRad(o._center.lat)),e.rotateZ$1(d,d,o.angle),e.rotateX$1(d,d,-o._pitch);const f=e.fromQuat(new Float32Array(16),d),p=e.mapValue(n.properties.get("star-intensity"),0,1,0,.25),m=5e-4,g=e.mapValue(n.properties.get("horizon-blend"),0,1,m,.25),_=e.globeUseCustomAntiAliasing(t,i,o)&&g===m?o.worldSize/(2*Math.PI*1.025)-1:o.globeRadius,y=t.frameCounter/1e3%1,v=e.length(o.globeCenterInViewSpace),x=Math.sqrt(Math.pow(v,2)-Math.pow(_,2)),b=Math.acos(x/v),w=((t,n,i,r,o,a,s,l,c,u,h,d,f,p)=>({u_frustum_tl:t,u_frustum_tr:n,u_frustum_br:i,u_frustum_bl:r,u_horizon:o,u_transition:a,u_fadeout_range:s,u_color:l,u_high_color:c,u_space_color:u,u_star_intensity:h,u_star_size:5*e.exported.devicePixelRatio,u_star_density:0,u_temporal_offset:d,u_horizon_angle:f,u_rotation_matrix:p}))(o.frustumCorners.TL,o.frustumCorners.TR,o.frustumCorners.BR,o.frustumCorners.BL,o.frustumCorners.horizon,l,g,c,u,h,p,y,b,f);t.prepareDrawProgram(i,s);const E=t.atmosphereBuffer;E&&s.draw(i,r.TRIANGLES,a,e.StencilMode.disabled,e.ColorMode.alphaBlended,e.CullFaceMode.backCW,w,"skybox",E.vertexBuffer,E.indexBuffer,E.segments)}(this,this.style.fog),this.renderPass="sky",(e.globeToMercatorTransition(this.transform.zoom)>0||"globe"!==this.transform.projection.name)&&this.transform.isHorizonVisible())for(this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){const e=this.style._layers[i[this.currentLayer]],n=t._getLayerSourceCache(e);e.isSky()&&this.renderLayer(this,n,e,n?a[n.id]:void 0)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;){const e=this.style._layers[i[this.currentLayer]],n=t._getLayerSourceCache(e);if(e.isSky()){++this.currentLayer;continue}if(this.terrain&&this.style.isLayerDraped(e)){if(e.isHidden(this.transform.zoom)){++this.currentLayer;continue}this.currentLayer=this.terrain.renderBatch(this.currentLayer);continue}const r=n?("symbol"===e.type?s:a)[n.id]:void 0;this._renderTileClippingMasks(e,n,n?o[n.id]:void 0),this.renderLayer(this,n,e,r),++this.currentLayer}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let n=null;e.values(this.style._layers).forEach((e=>{const i=t._getLayerSourceCache(e);i&&!e.isHidden(this.transform.zoom)&&(!n||n.getSource().maxzoom<i.getSource().maxzoom)&&(n=i)})),n&&this.options.showTileBoundaries&&Oi.debug(this,n,n.getVisibleCoordinates())}this.options.showPadding&&function(e){const t=e.transform.padding;Si(e,e.transform.height-(t.top||0),3,vi),Si(e,t.bottom||0,3,xi),Ai(e,t.left||0,3,bi),Ai(e,e.transform.width-(t.right||0),3,wi);const n=e.transform.centerPoint;!function(e,t,n,i){Ci(e,t-1,n-10,2,20,i),Ci(e,t-10,n-1,20,2,i)}(e,n.x,e.transform.height-n.y,Ei)}(this),this.context.setDefault(),this.frameCounter=(this.frameCounter+1)%Number.MAX_SAFE_INTEGER,this.tileLoaded&&this.options.speedIndexTiming&&(this.loadTimeStamps.push(e.window.performance.now()),this.saveCanvasCopy())}}renderLayer(e,t,n,i){n.isHidden(this.transform.zoom)||("background"===n.type||"sky"===n.type||"custom"===n.type||i&&i.length)&&(this.id=n.id,this.gpuTimingStart(n),e.transform.projection.unsupportedLayers&&e.transform.projection.unsupportedLayers.includes(n.type)||Oi[n.type](e,t,n,i,this.style.placement.variableOffsets,this.options.isInitialLoad),this.gpuTimingEnd())}gpuTimingStart(e){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery;let n=this.gpuTimers[e.id];n||(n=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:t.createQueryEXT()}),n.calls++,t.beginQueryEXT(t.TIME_ELAPSED_EXT,n.query)}gpuTimingDeferredRenderStart(){if(this.options.gpuTimingDeferredRender){const e=this.context.extTimerQuery,t=e.createQueryEXT();this.deferredRenderGpuTimeQueries.push(t),e.beginQueryEXT(e.TIME_ELAPSED_EXT,t)}}gpuTimingDeferredRenderEnd(){if(!this.options.gpuTimingDeferredRender)return;const e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}collectGpuTimers(){const e=this.gpuTimers;return this.gpuTimers={},e}collectDeferredRenderGpuQueries(){const e=this.deferredRenderGpuTimeQueries;return this.deferredRenderGpuTimeQueries=[],e}queryGpuTimers(e){const t={};for(const n in e){const i=e[n],r=this.context.extTimerQuery,o=r.getQueryObjectEXT(i.query,r.QUERY_RESULT_EXT)/1e6;r.deleteQueryEXT(i.query),t[n]=o}return t}queryGpuTimeDeferredRender(e){if(!this.options.gpuTimingDeferredRender)return 0;const t=this.context.extTimerQuery;let n=0;for(const i of e)n+=t.getQueryObjectEXT(i,t.QUERY_RESULT_EXT)/1e6,t.deleteQueryEXT(i);return n}translatePosMatrix(t,n,i,r,o){if(!i[0]&&!i[1])return t;const a=o?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(a){const e=Math.sin(a),t=Math.cos(a);i=[i[0]*t-i[1]*e,i[0]*e+i[1]*t]}const s=[o?i[0]:z(n,i[0],this.transform.zoom),o?i[1]:z(n,i[1],this.transform.zoom),0],l=new Float32Array(16);return e.translate(l,t,s),l}saveTileTexture(e){const t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){return null===e||void 0!==e&&!this.imageManager.getPattern(e.toString())}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture}currentGlobalDefines(){const e=this.terrain&&this.terrain.renderingToTexture,t=this.terrain&&0===this.terrain.exaggeration(),n=this.style&&this.style.fog,i=[];return this.terrainRenderModeElevated()&&i.push("TERRAIN"),"globe"===this.transform.projection.name&&i.push("GLOBE"),t&&i.push("ZERO_EXAGGERATION"),n&&!e&&0!==n.getOpacity(this.transform.pitch)&&i.push("FOG"),e&&i.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&i.push("OVERDRAW_INSPECTOR"),i}useProgram(e,t,n){this.cache=this.cache||{};const i=n||[],r=this.currentGlobalDefines().concat(i),o=Dn.cacheKey(hn[e],e,r,t);return this.cache[o]||(this.cache[o]=new Dn(this.context,e,hn[e],t,si[e],r)),this.cache[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.atmosphereBuffer&&this.atmosphereBuffer.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}prepareDrawProgram(t,n,i){if(this.terrain&&this.terrain.renderingToTexture)return;const r=this.style.fog;if(r){const o=r.getOpacity(this.transform.pitch),a=((t,n,i,r,o,a,s,l,c,u,h)=>{const d=t.transform,f=n.properties.get("color").toArray01();f[3]=r;const p=t.frameCounter/1e3%1;return{u_fog_matrix:i?d.calculateFogTileMatrix(i):t.identityMat,u_fog_range:n.getFovAdjustedRange(d._fov),u_fog_color:f,u_fog_horizon_blend:n.properties.get("horizon-blend"),u_fog_temporal_offset:p,u_frustum_tl:o,u_frustum_tr:a,u_frustum_br:s,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:u,u_viewport:h,u_globe_transition:e.globeToMercatorTransition(d.zoom),u_is_globe:+("globe"===d.projection.name)}})(this,r,i,o,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*e.exported.devicePixelRatio,this.transform.height*e.exported.devicePixelRatio]);n.setFogUniformValues(t,a)}}setTileLoadedFlag(e){this.tileLoaded=e}saveCanvasCopy(){this.frameCopies.push(this.canvasCopy()),this.tileLoaded=!1}canvasCopy(){const e=this.context.gl,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),t}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}getBackgroundTiles(){const t=this._backgroundTiles,n=this._backgroundTiles={},i=this.transform.coveringTiles({tileSize:512});for(const r of i)n[r.key]=t[r.key]||new e.Tile(r,512,this.transform.tileZoom,this);return n}clearBackgroundTiles(){this._backgroundTiles={}}}class Bi{constructor(e=0,t=0,n=0,i=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(n)||n<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=n,this.right=i}interpolate(t,n,i){return null!=n.top&&null!=t.top&&(this.top=e.number(t.top,n.top,i)),null!=n.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,n.bottom,i)),null!=n.left&&null!=t.left&&(this.left=e.number(t.left,n.left,i)),null!=n.right&&null!=t.right&&(this.right=e.number(t.right,n.right,i)),this}getCenter(t,n){const i=e.clamp((this.left+t-this.right)/2,0,t),r=e.clamp((this.top+n-this.bottom)/2,0,n);return new e.pointGeometry(i,r)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Bi(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function Fi(t,n){const i=e.getColumn(t,3);e.fromQuat(t,n),e.setColumn(t,3,i)}function Ni(t,n){const i=e.identity$1([]);return e.rotateZ$1(i,i,-n),e.rotateX$1(i,i,-t),i}function ji(t,n){const i=[t[0],t[1],0],r=[n[0],n[1],0];if(e.length(i)>=1e-15){const t=e.normalize([],i);e.scale$2(r,t,e.dot(r,t)),n[0]=r[0],n[1]=r[1]}const o=e.cross([],n,t);if(e.len(o)<1e-15)return null;const a=Math.atan2(-o[1],o[0]);return Ni(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),a)}class Ui{constructor(e,t){this.position=e,this.orientation=t}get position(){return this._position}set position(t){if(t){const n=t instanceof e.MercatorCoordinate?t:new e.MercatorCoordinate(t[0],t[1],t[2]);this._renderWorldCopies&&(n.x=e.wrap(n.x,0,1)),this._position=n}else this._position=null}lookAtPoint(t,n){if(this.orientation=null,!this.position)return;const i=this._elevation?this._elevation.getAtPointOrZero(e.MercatorCoordinate.fromLngLat(t)):0,r=this.position,o=e.MercatorCoordinate.fromLngLat(t,i),a=[o.x-r.x,o.y-r.y,o.z-r.z];n||(n=[0,0,1]),n[2]=Math.abs(n[2]),this.orientation=ji(a,n)}setPitchBearing(t,n){this.orientation=Ni(e.degToRad(t),e.degToRad(-n))}}class Vi{constructor(t,n){this._transform=e.identity([]),this.orientation=n,this.position=t}get mercatorPosition(){const t=this.position;return new e.MercatorCoordinate(t[0],t[1],t[2])}get position(){const t=e.getColumn(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var n;t&&e.setColumn(this._transform,3,[(n=t)[0],n[1],n[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||e.identity$1([]),t&&Fi(this._transform,this._orientation)}getPitchBearing(){const e=this.forward(),t=this.right();return{bearing:Math.atan2(-t[1],t[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}setPitchBearing(e,t){this._orientation=Ni(e,t),Fi(this._transform,this._orientation)}forward(){const t=e.getColumn(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=e.getColumn(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=e.getColumn(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,n){const i=new Float64Array(16);return e.invert(i,this.getWorldToCamera(t,n)),i}getWorldToCameraPosition(t,n,i){const r=this.position;e.scale$2(r,r,-t);const o=new Float64Array(16);return e.fromScaling(o,[i,i,i]),e.translate(o,o,r),o[10]*=n,o}getWorldToCamera(t,n){const i=new Float64Array(16),r=new Float64Array(4),o=this.position;return e.conjugate(r,this._orientation),e.scale$2(o,o,-t),e.fromQuat(i,r),e.translate(i,i,o),i[1]*=-1,i[5]*=-1,i[9]*=-1,i[13]*=-1,i[8]*=n,i[9]*=n,i[10]*=n,i[11]*=n,i}getCameraToClipPerspective(t,n,i,r){const o=new Float64Array(16);return e.perspective(o,t,n,i,r),o}getDistanceToElevation(t,n=!1){const i=0===t?0:e.mercatorZfromAltitude(t,n?e.latFromMercatorY(this.position[1]):this.position[1]),r=this.forward();return(i-this.position[2])/r[2]}clone(){return new Vi([...this.position],[...this.orientation])}}function Gi(t,n){const i=$i(t.projection,t.zoom,t.width,t.height),r=function(t,n,i,r,o){const a=new e.LngLat(i.lng-180*Wi,i.lat),s=new e.LngLat(i.lng+180*Wi,i.lat),l=t.project(a.lng,a.lat),c=t.project(s.lng,s.lat),u=-Math.atan2(c.y-l.y,c.x-l.x),h=e.MercatorCoordinate.fromLngLat(i);h.y=e.clamp(h.y,-.999975,.999975);const d=h.toLngLat(),f=t.project(d.lng,d.lat),p=e.MercatorCoordinate.fromLngLat(d);p.x+=Wi;const m=p.toLngLat(),g=t.project(m.lng,m.lat),_=Xi(g.x-f.x,g.y-f.y,u),y=e.MercatorCoordinate.fromLngLat(d);y.y+=Wi;const v=y.toLngLat(),x=t.project(v.lng,v.lat),b=Xi(x.x-f.x,x.y-f.y,u),w=Math.abs(_.x)/Math.abs(b.y),E=e.identity([]);e.rotateZ(E,E,-u*(1-(o?0:r)));const T=e.identity([]);return e.scale(T,T,[1,1-(1-w)*r,1]),T[4]=-b.x/b.y*r,e.rotateZ(T,T,u),e.multiply(T,E,T),T}(t.projection,0,t.center,i,n),o=qi(t);return e.scale(r,r,[o,o,1]),r}function qi(t){const n=t.projection,i=$i(t.projection,t.zoom,t.width,t.height),r=Zi(n,t.center),o=Zi(n,e.LngLat.convert(n.center));return Math.pow(2,r*i+(1-i)*o)}function $i(t,n,i,r,o=1/0){const a=t.range;if(!a)return 0;const s=Math.min(o,Math.max(i,r)),l=Math.log(s/1024)/Math.LN2;return e.smoothstep(a[0]+l,a[1]+l,n)}const Wi=1/4e4;function Zi(t,n){const i=e.clamp(n.lat,-e.MAX_MERCATOR_LATITUDE,e.MAX_MERCATOR_LATITUDE),r=new e.LngLat(n.lng-180*Wi,i),o=new e.LngLat(n.lng+180*Wi,i),a=t.project(r.lng,i),s=t.project(o.lng,i),l=e.MercatorCoordinate.fromLngLat(r),c=e.MercatorCoordinate.fromLngLat(o),u=s.x-a.x,h=s.y-a.y,d=c.x-l.x,f=c.y-l.y,p=Math.sqrt((d*d+f*f)/(u*u+h*h));return Math.log(p)/Math.LN2}function Xi(e,t,n){const i=Math.cos(n),r=Math.sin(n);return{x:e*i-t*r,y:e*r+t*i}}class Hi{constructor(t,n,i,r,o,a,s){this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=t||0,this._maxZoom=n||22,this._minPitch=null==i?0:i,this._maxPitch=null==r?60:r,this.setProjection(a),this.setMaxBounds(s),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new Bi,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._distanceTileDataCache={},this._camera=new Vi,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._horizonShift=.1}clone(){const e=new Hi(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForE
2xaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._averageElevation=this._averageElevation,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}updateElevation(e,t=!1){const n=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||n)&&this._updateCameraOnTerrain(),(e||n)&&this._constrainCamera(t),this._calcMatrices()}getProjection(){return e.pick(this.projection,["name","center","parallels"])}setProjection(n){this.projectionOptions=n||{name:"mercator"};const i=this.projection?this.getProjection():void 0;this.projection=e.getProjection(this.projectionOptions);const r=!t(i,this.getProjection());return r&&this._calcMatrices(),this.mercatorFromTransition=!1,r}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.getProjection({name:"mercator"});const n=t!==this.projection.name;return n&&this._calcMatrices(),n}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get cameraWorldSize(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return e.mercatorZfromAltitude(this.center.lat,this.cameraWorldSizeForFog)}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.pointGeometry(this.width,this.height)}get bearing(){return e.wrap(this.rotation,-180,180)}set bearing(e){this.rotation=e}get rotation(){return-this.angle/Math.PI*180}set rotation(t){const n=-t*Math.PI/180;var i;this.angle!==n&&(this._unmodified=!1,this.angle=n,this._calcMatrices(),this.rotationMatrix=(i=new e.ARRAY_TYPE(4),e.ARRAY_TYPE!=Float32Array&&(i[1]=0,i[2]=0),i[0]=1,i[3]=1,i),function(e,t,n){var i=t[0],r=t[1],o=t[2],a=t[3],s=Math.sin(n),l=Math.cos(n);e[0]=i*l+o*s,e[1]=r*l+a*s,e[2]=i*-s+o*l,e[3]=r*-s+a*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const n=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==n&&(this._unmodified=!1,this._pitch=n,this._calcMatrices())}get aspect(){return this.width/this.height}get fovX(){return this._fov}get fovY(){const e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=e.degToRad(t),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._setZoom(t),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}_updateCameraOnTerrain(){if(!this._elevation||!this._elevation.isDataAvailableAtPoint(this.locationCoordinate(this.center)))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForE
vendor: 39,464 bytes, line 2
2xaggeration=void 0);const e=this._elevation;this._centerAltitude=e.getAtPointOrZero(this.locationCoordinate(this.center)),this._centerAltitudeValidForExaggeration=e.exaggeration(),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,n=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],i=this.horizonLineFromTop();let r=0,o=0;for(let a=0;a<n.length;a++){const s=new e.pointGeometry(n[a][0]*this.width,i+n[a][1]*(this.height-i)),l=t.pointCoordinate(s);if(!l)continue;const c=1/Math.hypot(l[0]-this._camera.position[0],l[1]-this._camera.position[1]);r+=l[3]*c,o+=c}return 0===o?NaN:r/o}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._terrainEnabled()&&("ground"===this.cameraElevationReference?this._updateCameraOnTerrain():this._updateZoomFromElevation()),this._constrain(),this._calcMatrices())}_updateZoomFromElevation(){if(null==this._seaLevelZoom||!this._elevation)return;const e=this._seaLevelZoom,t=this._elevation.getAtPointOrZero(this.locationCoordinate(this.center)),n=this.pixelsPerMeter/this.worldSize*t,i=this._mercatorZfromZoom(e),r=this._mercatorZfromZoom(this._maxZoom),o=Math.max(i-n,r);this._setZoom(this._zoomFromMercatorZ(o))}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}computeZoomRelativeTo(t){const n=this.rayIntersectionCoordinate(this.pointRayIntersection(this.centerPoint,t.toAltitude()));let i;i=t.z<this._camera.position[2]?[n.x,n.y,n.z]:[t.x,t.y,t.z];const r=e.length(e.sub([],this._camera.position,i));return e.clamp(this._zoomFromMercatorZ(r),this._minZoom,this._maxZoom)}setFreeCameraOptions(t){if(!this.height)return;if(!t.position&&!t.orientation)return;this._updateCameraState();let n=!1;if(t.orientation&&!e.exactEquals(t.orientation,this._camera.orientation)&&(n=this._setCameraOrientation(t.orientation)),t.position){const i=[t.position.x,t.position.y,t.position.z];e.exactEquals$1(i,this._camera.position)||(this._setCameraPosition(i),n=!0)}n&&(this._updateStateFromCamera(),this.recenterOnTerrain())}getFreeCameraOptions(){this._updateCameraState();const t=this._camera.position,n=new Ui;return n.position=new e.MercatorCoordinate(t[0],t[1],t[2]),n.orientation=this._camera.orientation,n._elevation=this.elevation,n._renderWorldCopies=this.renderWorldCopies,n}_setCameraOrientation(t){if(!e.length$1(t))return!1;e.normalize$1(t,t);const n=e.transformQuat([],[0,0,-1],t),i=e.transformQuat([],[0,-1,0],t);if(i[2]<0)return!1;const r=ji(n,i);return!!r&&(this._camera.orientation=r,!0)}_setCameraPosition(t){const n=this.zoomScale(this.minZoom)*this.tileSize,i=this.zoomScale(this.maxZoom)*this.tileSize,r=this.cameraToCenterDistance;t[2]=e.clamp(t[2],r/i,r/n),this._camera.position=t}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}get fovAboveCenter(){return this._fov*(.5+this.centerOffset.y/this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,n){this._unmodified=!1,this._edgeInsets.interpolate(e,t,n),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(t){const n=[new e.UnwrappedTileID(0,t)];if(this.renderWorldCopies){const i=this.pointCoordinate(new e.pointGeometry(0,0)),r=this.pointCoordinate(new e.pointGeometry(this.width,0)),o=this.pointCoordinate(new e.pointGeometry(this.width,this.height)),a=this.pointCoordinate(new e.pointGeometry(0,this.height)),s=Math.floor(Math.min(i.x,r.x,o.x,a.x)),l=Math.floor(Math.max(i.x,r.x,o.x,a.x)),c=1;for(let i=s-c;i<=l+c;i++)0!==i&&n.push(new e.UnwrappedTileID(i,t))}return n}coveringTiles(t){let n=this.coveringZoomLevel(t);const i=n,r=this.elevation&&!t.isTerrainDEM,o="mercator"===this.projection.name;if(void 0!==t.minzoom&&n<t.minzoom)return[];void 0!==t.maxzoom&&n>t.maxzoom&&(n=t.maxzoom);const a=this.locationCoordinate(this.center),s=this.center.lat,l=1<<n,c=[l*a.x,l*a.y,0],u="globe"===this.projection.name,h=!u,d=e.Frustum.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n,h),f=u?this._camera.mercatorPosition:this.pointCoordinate(this.getCameraPoint()),p=l*e.mercatorZfromAltitude(1,this.center.lat),m=this._camera.position[2]/e.mercatorZfromAltitude(1,this.center.lat),g=[l*f.x,l*f.y,m*(h?1:p)],_=this.cameraToCenterDistance/t.tileSize*(t.roundZoom?1:.502),y=this.pitch<=60&&this._edgeInsets.top<=this._edgeInsets.bottom&&!this._elevation&&!this.projection.isReprojectedInTileSpace?n:0,v=t.isTerrainDEM&&this._elevation?1e4*this._elevation.exaggeration():this._centerAltitude,x=t.isTerrainDEM?-v:this._elevation?this._elevation.getMinElevationBelowMSL():0,b=this.projection.isReprojectedInTileSpace?qi(this):1,w=t=>{const n=1/4e4,i=new e.MercatorCoordinate(t.x+n,t.y,t.z),r=new e.MercatorCoordinate(t.x,t.y+n,t.z),o=t.toLngLat(),a=i.toLngLat(),s=r.toLngLat(),l=this.locationCoordinate(o),c=this.locationCoordinate(a),u=this.locationCoordinate(s),h=Math.hypot(c.x-l.x,c.y-l.y),d=Math.hypot(u.x-l.x,u.y-l.y);return Math.sqrt(h*d)*b/n},E=t=>{const n=v,i=x;return{aabb:e.tileAABB(this,l,0,0,0,t,i,n,this.projection),zoom:0,x:0,y:0,minZ:i,maxZ:n,wrap:t,fullyVisible:!1}},T=[];let S=[];const A=n,C=t.reparseOverscaled?i:n,k=e=>e*e,M=k((m-this._centerAltitude)*p),I=e=>{if(!this._elevation||!e.tileID||!o)return;const t=this._elevation.getMinMaxForTile(e.tileID),n=e.aabb;t?(n.min[2]=t.min,n.max[2]=t.max,n.center[2]=(n.min[2]+n.max[2])/2):(e.shouldSplit=P(e),e.shouldSplit||(n.min[2]=n.max[2]=n.center[2]=this._centerAltitude))},P=t=>{if(t.zoom<y)return!0;if(t.zoom===A)return!1;if(null!=t.shouldSplit)return t.shouldSplit;const n=t.aabb.distanceX(g),o=t.aabb.distanceY(g);let a=M,l=1;if(u){a=k(t.aabb.distanceZ(g));const n=Math.pow(2,t.zoom),i=e.latFromMercatorY((t.y+1)/n),r=e.latFromMercatorY(t.y/n),o=Math.min(Math.max(s,i),r),c=e.circumferenceAtLatitude(o)/e.circumferenceAtLatitude(s);if(l=o===s?1/Math.max(1,this._mercatorScaleRatio-.3):Math.min(1,c/this._mercatorScaleRatio),this.zoom<=e.GLOBE_ZOOM_THRESHOLD_MIN&&t.zoom===A-1&&c>=.9)return!0}else if(r&&(a=k(t.aabb.distanceZ(g)*p)),this.projection.isReprojectedInTileSpace&&i<=5){const n=Math.pow(2,t.zoom),i=w(new e.MercatorCoordinate((t.x+.5)/n,(t.y+.5)/n));l=i>.85?1:i}const c=n*n+o*o+a,h=k((1<<A-t.zoom)*_*l*((e,t)=>{if(t*k(.707)<e)return 1;const n=Math.sqrt(t/e);return n/(1.4144271570014144+(Math.pow(1.1,n-1.4144271570014144+1)-1)/(1.1-1)-1)})(Math.max(a,M),c));return c<h};if(this.renderWorldCopies)for(let e=1;e<=3;e++)T.push(E(-e)),T.push(E(e));for(T.push(E(0));T.length>0;){const i=T.pop(),a=i.x,s=i.y;let h=i.fullyVisible;if(!h){const e=i.aabb.intersects(d);if(0===e)continue;h=2===e}if(i.zoom!==A&&P(i))for(let t=0;t<4;t++){const n=(a<<1)+t%2,c=(s<<1)+(t>>1),d={aabb:o?i.aabb.quadrant(t):e.tileAABB(this,l,i.zoom+1,n,c,i.wrap,i.minZ,i.maxZ,this.projection),zoom:i.zoom+1,x:n,y:c,wrap:i.wrap,fullyVisible:h,tileID:void 0,shouldSplit:void 0,minZ:i.minZ,maxZ:i.maxZ};r&&!u&&(d.tileID=new e.OverscaledTileID(i.zoom+1===A?C:i.zoom+1,i.wrap,i.zoom+1,n,c),I(d)),T.push(d)}else{const r=i.zoom===A?C:i.zoom;if(t.minzoom&&t.minzoom>r)continue;const o=c[0]-(.5+a+(i.wrap<<i.zoom))*(1<<n-i.zoom),l=c[1]-.5-s,u=i.tileID?i.tileID:new e.OverscaledTileID(r,i.wrap,i.zoom,a,s);S.push({tileID:u,distanceSq:o*o+l*l})}}if(this.fogCullDistSq){const n=this.fogCullDistSq,i=this.horizonLineFromTop();S=S.filter((r=>{const o=[0,0,0,1],a=[e.EXTENT,e.EXTENT,0,1],s=this.calculateFogTileMatrix(r.tileID.toUnwrapped());e.transformMat4$1(o,o,s),e.transformMat4$1(a,a,s);const l=e.getAABBPointSquareDist(o,a);if(0===l)return!0;let c=!1;const u=this._elevation;if(u&&l>n&&0!==i){const n=this.calculateProjMatrix(r.tileID.toUnwrapped());let o;t.isTerrainDEM||(o=u.getMinMaxForTile(r.tileID)),o||(o={min:x,max:v});const a=e.furthestTileCorner(this.rotation),s=[a[0]*e.EXTENT,a[1]*e.EXTENT,o.max];e.transformMat4(s,s,n),c=(1-s[1])*this.height*.5<i}return l<n||c}))}return S.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(t){const n=e.clamp(t.lat,-e.MAX_MERCATOR_LATITUDE,e.MAX_MERCATOR_LATITUDE),i=this.projection.project(t.lng,n);return new e.pointGeometry(i.x*this.worldSize,i.y*this.worldSize)}unproject(e){return this.projection.unproject(e.x/this.worldSize,e.y/this.worldSize)}get point(){return this.project(this.center)}setLocationAtPoint(t,n){let i,r;const o=this.centerPoint;if("globe"===this.projection.name){const e=this.worldSize;i=(n.x-o.x)/e,r=(n.y-o.y)/e}else{const e=this.pointCoordinate(n),t=this.pointCoordinate(o);i=e.x-t.x,r=e.y-t.y}const a=this.locationCoordinate(t);this.setLocation(new e.MercatorCoordinate(a.x-i,a.y-r))}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(e){return this.projection.locationPoint(this,e)}locationPoint3D(e){return this.projection.locationPoint(this,e,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e){return this.coordinateLocation(this.pointCoordinate3D(e))}locationCoordinate(t,n){const i=n?e.mercatorZfromAltitude(n,t.lat):void 0,r=this.projection.project(t.lng,t.lat);return new e.MercatorCoordinate(r.x,r.y,i)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(t,n){const i=null!=n?n:this._centerAltitude,r=[t.x,t.y,0,1],o=[t.x,t.y,1,1];e.transformMat4$1(r,r,this.pixelMatrixInverse),e.transformMat4$1(o,o,this.pixelMatrixInverse);const a=o[3];e.scale$1(r,r,1/r[3]),e.scale$1(o,o,1/a);const s=r[2],l=o[2];return{p0:r,p1:o,t:s===l?0:(i-s)/(l-s)}}screenPointToMercatorRay(t){const n=[t.x,t.y,0,1],i=[t.x,t.y,1,1];return e.transformMat4$1(n,n,this.pixelMatrixInverse),e.transformMat4$1(i,i,this.pixelMatrixInverse),e.scale$1(n,n,1/n[3]),e.scale$1(i,i,1/i[3]),n[2]=e.mercatorZfromAltitude(n[2],this._center.lat)*this.worldSize,i[2]=e.mercatorZfromAltitude(i[2],this._center.lat)*this.worldSize,e.scale$1(n,n,1/this.worldSize),e.scale$1(i,i,1/this.worldSize),new e.Ray([n[0],n[1],n[2]],e.normalize([],e.sub([],i,n)))}rayIntersectionCoordinate(t){const{p0:n,p1:i,t:r}=t,o=e.mercatorZfromAltitude(n[2],this._center.lat),a=e.mercatorZfromAltitude(i[2],this._center.lat);return new e.MercatorCoordinate(e.number(n[0],i[0],r)/this.worldSize,e.number(n[1],i[1],r)/this.worldSize,e.number(o,a,r))}pointCoordinate(e,t=this._centerAltitude){return this.projection.pointCoordinate(this,e.x,e.y,t)}pointCoordinate3D(t){if(!this.elevation)return this.pointCoordinate(t);let n=this.projection.pointCoordinate3D(this,t.x,t.y);if(n)return new e.MercatorCoordinate(n[0],n[1],n[2]);let i=0,r=this.horizonLineFromTop();if(t.y>r)return this.pointCoordinate(t);const o=.02*r,a=t.clone();for(let t=0;t<10&&r-i>o;t++){a.y=e.number(i,r,.66);const t=this.projection.pointCoordinate3D(this,a.x,a.y);t?(r=a.y,n=t):i=a.y}return n?new e.MercatorCoordinate(n[0],n[1],n[2]):this.pointCoordinate(t)}isPointAboveHorizon(e){return this.projection.isPointAboveHorizon(this,e)}_coordinatePoint(t,n){const i=n&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,r=[t.x*this.worldSize,t.y*this.worldSize,i+t.toAltitude(),1];return e.transformMat4$1(r,r,this.pixelMatrix),r[3]>0?new e.pointGeometry(r[0]/r[3],r[1]/r[3]):new e.pointGeometry(Number.MAX_VALUE,Number.MAX_VALUE)}_getGlobeBounds(){const{top:t,left:n}=this._edgeInsets,i=this.height-this._edgeInsets.bottom,r=this.width-this._edgeInsets.right,o=this.pointCoordinate3D(new e.pointGeometry(n,t)),a=this.pointCoordinate3D(new e.pointGeometry(r,t)),s=this.pointCoordinate3D(new e.pointGeometry(r,i)),l=this.pointCoordinate3D(new e.pointGeometry(n,i));let c=Math.min(o.x,l.x),u=Math.max(a.x,s.x),h=Math.min(o.y,a.y),d=Math.max(l.y,s.y);const f=Math.pow(2,-this.zoom)/16,p=(t,n,i,r)=>{const o=(t+i)/2,a=(n+r)/2,s=new e.pointGeometry(o,a),l=this.pointCoordinate3D(s),m=Math.max(0,c-l.x,h-l.y,l.x-u,l.y-d);c=Math.min(c,l.x),u=Math.max(u,l.x),h=Math.min(h,l.y),d=Math.max(d,l.y),m>f&&(p(t,n,o,a),p(o,a,i,r))};p(n,t,r,t),p(r,t,r,i),p(r,i,n,i),p(n,i,n,t);const[m,g]=e.polesInViewport(this),_=m||g,y=m?90:e.latFromMercatorY(h),v=_?180:e.lngFromMercatorX(u),x=g?-90:e.latFromMercatorY(d),b=_?-180:e.lngFromMercatorX(c);return new e.LngLatBounds(new e.LngLat(b,x),new e.LngLat(v,y))}_getBounds(t,n){if("globe"===this.projection.name)return this._getGlobeBounds();const i=new e.pointGeometry(this._edgeInsets.left,this._edgeInsets.top),r=new e.pointGeometry(this.width-this._edgeInsets.right,this._edgeInsets.top),o=new e.pointGeometry(this.width-this._edgeInsets.right,this.height-this._edgeInsets.bottom),a=new e.pointGeometry(this._edgeInsets.left,this.height-this._edgeInsets.bottom);let s=this.pointCoordinate(i,t),l=this.pointCoordinate(r,t);const c=this.pointCoordinate(o,n),u=this.pointCoordinate(a,n),h=(e,t)=>(t.y-e.y)/(t.x-e.x);return s.y>1&&l.y>=0?s=new e.MercatorCoordinate((1-u.y)/h(u,s)+u.x,1):s.y<0&&l.y<=1&&(s=new e.MercatorCoordinate(-u.y/h(u,s)+u.x,0)),l.y>1&&s.y>=0?l=new e.MercatorCoordinate((1-c.y)/h(c,l)+c.x,1):l.y<0&&s.y<=1&&(l=new e.MercatorCoordinate(-c.y/h(c,l)+c.x,0)),(new e.LngLatBounds).extend(this.coordinateLocation(s)).extend(this.coordinateLocation(l)).extend(this.coordinateLocation(u)).extend(this.coordinateLocation(c))}_getBounds3D(){const e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBounds(0,0);const t=e.visibleDemTiles.reduce(((e,t)=>{if(t.dem){const n=t.dem.tree;e.min=Math.min(e.min,n.minimums[0]),e.max=Math.max(e.max,n.maximums[0])}return e}),{min:Number.MAX_VALUE,max:0});return this._getBounds(t.min*e.exaggeration(),t.max*e.exaggeration())}getBounds(){return this._terrainEnabled()?this._getBounds3D():this._getBounds(0,0)}horizonLineFromTop(e=!0){const t=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))+this.centerOffset.y,n=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,n):n}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-e.MAX_MERCATOR_LATITUDE,this.maxLat=e.MAX_MERCATOR_LATITUDE,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLng<this.minLng&&(this.maxLng+=360)),this.worldMinX=e.mercatorXfromLng(this.minLng)*this.tileSize,this.worldMaxX=e.mercatorXfromLng(this.maxLng)*this.tileSize,this.worldMinY=e.mercatorYfromLat(this.maxLat)*this.tileSize,this.worldMaxY=e.mercatorYfromLat(this.minLat)*this.tileSize,this._constrain()}calculatePosMatrix(e,t){return this.projection.createTileMatrix(this,t,e)}calculateDistanceTileData(t){const n=t.key,i=this._distanceTileDataCache;if(i[n])return i[n];const r=t.canonical,o=1/this.height,a=this.cameraWorldSize,s=a/this.zoomScale(r.z),l=(r.x+Math.pow(2,r.z)*t.wrap)*s,c=r.y*s,u=this.point;u.x*=a/this.worldSize,u.y*=a/this.worldSize;const h=this.angle,d=Math.sin(-h),f=-Math.cos(-h);return i[n]={bearing:[d,f],center:[(u.x-l)*o,(u.y-c)*o],scale:s/e.EXTENT*o},i[n]}calculateFogTileMatrix(t){const n=t.key,i=this._fogTileMatrixCache;if(i[n])return i[n];const r=this.projection.createTileMatrix(this,this.cameraWorldSizeForFog,t);return e.multiply(r,this.worldToFogMatrix,r),i[n]=new Float32Array(r),i[n]}calculateProjMatrix(t,n=!1){const i=t.key,r=n?this._alignedProjMatrixCache:this._projMatrixCache;if(r[i])return r[i];const o=this.calculatePosMatrix(t,this.worldSize);return e.multiply(o,this.projection.isReprojectedInTileSpace?this.mercatorMatrix:n?this.alignedProjMatrix:this.projMatrix,o),r[i]=new Float32Array(o),r[i]}calculatePixelsToTileUnitsMatrix(t){const n=t.tileID.key,i=this._pixelsToTileUnitsCache;if(i[n])return i[n];const r=function(t,n){const{scale:i}=t.tileTransform,r=i*e.EXTENT/(t.tileSize*Math.pow(2,n.zoom-t.tileID.overscaledZ+t.tileID.canonical.z));return o=new Float32Array(4),l=(a=n.inverseAdjustmentMatrix)[1],c=a[2],u=a[3],d=(s=[r,r])[1],o[0]=a[0]*(h=s[0]),o[1]=l*h,o[2]=c*d,o[3]=u*d,o;var o,a,s,l,c,u,h,d}(t,this);return i[n]=r,i[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}recenterOnTerrain(){if(!this._elevation||"globe"===this.projection.name)return;const t=this._elevation;this._updateCameraState();const n=e.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,i=this._computeCameraPosition(n),r=this._camera.forward(),o=e.mercatorZfromAltitude(1,this._center.lat);i[2]/=o,r[2]/=o,e.normalize(r,r);const a=t.raycast(i,r,t.exaggeration());if(a){const t=e.scaleAndAdd([],i,r,a),n=new e.MercatorCoordinate(t[0],t[1],e.mercatorZfromAltitude(t[2],e.latFromMercatorY(t[1]))),s=(n.z+e.length([n.x-i[0],n.y-i[1],n.z-i[2]*o]))*this._pixelsPerMercatorPixel;this._seaLevelZoom=this._zoomFromMercatorZ(s),this._centerAltitude=n.toAltitude(),this._center=this.coordinateLocation(n),this._updateZoomFromElevation(),this._constrain(),this._calcMatrices()}}_constrainCamera(t=!1){if(!this._elevation)return;const n=this._elevation,i=e.mercatorZfromAltitude(1,this._center.lat)*this.worldSize,r=this._computeCameraPosition(i),o=n.getAtPointOrZero(new e.MercatorCoordinate(...r)),a=this.pixelsPerMeter/this.worldSize*o,s=this._minimumHeightOverTerrain(),l=r[2]-a;if(l<=s)if(l<0||t){const t=this.locationCoordinate(this._center,this._centerAltitude),n=[r[0],r[1],t.z-r[2]],i=e.length(n);n[2]-=(s-l)/this._pixelsPerMercatorPixel;const o=e.length(n);if(0===o)return;e.scale$2(n,n,i/o*this._pixelsPerMercatorPixel),this._camera.position=[r[0],r[1],t.z*this._pixelsPerMercatorPixel-n[2]],this._updateStateFromCamera()}else this._isCameraConstrained=!0}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t="globe"===this.projection.name||this.mercatorFromTransition;if(this.projection.isReprojectedInTileSpace||t){const n=this.center;return n.lat=e.clamp(n.lat,this.minLat,this.maxLat),(this.maxBounds||!this.renderWorldCopies&&!t)&&(n.lng=e.clamp(n.lng,this.minLng,this.maxLng)),this.center=n,void(this._constraining=!1)}const n=this._unmodified,{x:i,y:r}=this.point;let o=0,a=i,s=r;const l=this.width/2,c=this.height/2,u=this.worldMinY*this.scale,h=this.worldMaxY*this.scale;if(r-c<u&&(s=u+c),r+c>h&&(s=h-c),h-u<this.height&&(o=Math.max(o,this.height/(h-u)),s=(h+u)/2),this.maxBounds||!this._renderWorldCopies||!this.projection.wrap){const e=this.worldMinX*this.scale,t=this.worldMaxX*this.scale,n=this.worldSize/2-(e+t)/2;a=(i+n+this.worldSize)%this.worldSize-n,a-l<e&&(a=e+l),a+l>t&&(a=t-l),t-e<this.width&&(o=Math.max(o,this.width/(t-e)),a=(t+e)/2)}a===i&&s===r||(this.center=this.unproject(new e.pointGeometry(a,s))),o&&(this.zoom+=this.scaleZoom(o)),this._constrainCamera(),this._unmodified=n,this._constraining=!1}_minZoomForBounds(){let e=Math.max(0,this.scaleZoom(this.height/(this.worldMaxY-this.worldMinY)));return this.maxBounds&&(e=Math.max(e,this.scaleZoom(this.width/(this.worldMaxX-this.worldMinX)))),e}_maxCameraBoundsDistance(){return this._mercatorZfromZoom(this._minZoomForBounds())}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,n=this.pixelsPerMeter;"globe"===this.projection.name&&(this._mercatorScaleRatio=e.mercatorZfromAltitude(1,this.center.lat)/e.mercatorZfromAltitude(1,e.GLOBE_SCALE_MATCH_LATITUDE));const i=$i(this.projection,this.zoom,this.width,this.height,1024);this._pixelsPerMercatorPixel=this.projection.pixelSpaceConversion(this.center.lat,this.worldSize,i),this.cameraToCenterDistance=.5/Math.tan(.5*this._fov)*this.height*this._pixelsPerMercatorPixel,this._updateCameraState(),this._farZ=this.projection.farthestPixelDistance(this),this._nearZ=this.height/50;const r=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?n:1),o=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,this._farZ);o[8]=2*-t.x/this.width,o[9]=2*t.y/this.height;let a=e.mul([],o,r);if(this.projection.isReprojectedInTileSpace){const t=this.locationCoordinate(this.center),n=e.identity([]);e.translate(n,n,[t.x*this.worldSize,t.y*this.worldSize,0]),e.multiply(n,n,Gi(this)),e.translate(n,n,[-t.x*this.worldSize,-t.y*this.worldSize,0]),e.multiply(a,a,n),this.inverseAdjustmentMatrix=function(e){const t=Gi(e,!0);return y([],[t[0],t[1],t[4],t[5]])}(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];this.mercatorMatrix=e.scale([],a,[this.worldSize,this.worldSize,this.worldSize/n,1]),this.projMatrix=a,this.invProjMatrix=e.invert(new Float64Array(16),this.projMatrix);const s=e.invert([],o);this.frustumCorners=e.FrustumCorners.fromInvProjectionMatrix(s,this.horizonLineFromTop(),this.height);const l=new Float32Array(16);e.identity(l),e.scale(l,l,[1,-1,1]),e.rotateX(l,l,this._pitch),e.rotateZ(l,l,this.angle);const c=e.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ),u=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;c[8]=2*-t.x/this.width,c[9]=2*(t.y+u)/this.height,this.skyboxMatrix=e.multiply(l,c,l);const h=this.point,d=h.x,f=h.y,p=this.width%2/2,m=this.height%2/2,g=Math.cos(this.angle),_=Math.sin(this.angle),v=d-Math.round(d)+g*p+_*m,x=f-Math.round(f)+g*m+_*p,b=new Float64Array(a);if(e.translate(b,b,[v>.5?v-1:v,x>.5?x-1:x,0]),this.alignedProjMatrix=b,a=e.create(),e.scale(a,a,[this.width/2,-this.height/2,1]),e.translate(a,a,[1,-1,0]),this.labelPlaneMatrix=a,a=e.create(),e.scale(a,a,[1,-1,1]),e.translate(a,a,[-1,-1,0]),e.scale(a,a,[2/this.width,2/this.height,1]),this.glCoordMatrix=a,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),this._calcFogMatrices(),this._distanceTileDataCache={},a=e.invert(new Float64Array(16),this.pixelMatrix),!a)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=a,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.calculateGlobeMatrix(this);const t=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.transformMat4(t,t,r),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=a;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,n=this.cameraPixelsPerMeter,i=this._camera.position,r=1/this.height/this._pixelsPerMercatorPixel,o=[t,t,n];e.scale$2(o,o,r),e.scale$2(i,i,-1),e.multiply$2(i,i,o);const a=e.create();e.translate(a,a,i),e.scale(a,a,o),this.mercatorFogMatrix=a,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,n,r)}_computeCameraPosition(e){const t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,n=this._camera.forward(),i=this.point,r=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return[i.x/this.worldSize-n[0]*r,i.y/this.worldSize-n[1]*r,e/this.worldSize*this._centerAltitude-n[2]*r]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const n=this._maxCameraBoundsDistance()*Math.cos(this._pitch),i=this._camera.position[2],r=t[2];let o=1;this.projection.wrap&&(this.center=this.center.wrap()),r>0&&(o=Math.min((n-i)/r,1)),this._camera.position=e.scaleAndAdd([],this._camera.position,t,o),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,n=this._camera.forward(),{pitch:i,bearing:r}=this._camera.getPitchBearing(),o=e.mercatorZfromAltitude(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,a=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.degToRad(this._maxPitch)),s=Math.max((t[2]-o)/Math.cos(i),a),l=this._zoomFromMercatorZ(s);e.scaleAndAdd(t,t,n,s),this._pitch=e.clamp(i,e.degToRad(this.minPitch),e.degToRad(this.maxPitch)),this.angle=e.wrap(r,-Math.PI,Math.PI),this._setZoom(e.clamp(l,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e.MercatorCoordinate(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(e){return Math.pow(2,e)*this.tileSize}_mercatorZfromZoom(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}_minimumHeightOverTerrain(){const e=Math.min((null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom)+4,this._maxZoom);return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(e*this.tileSize))}zoomFromMercatorZAdjusted(e){const t=t=>{const n=this.getCameraToCenterDistance(this.projection,t);return this.scaleZoom(n/(e*this.tileSize))};let n,i=t(this.zoom),r=Math.abs(i-t(i));for(;n!==r;)i=t(i),n=r,r=Math.abs(i-t(i));return i}_terrainEnabled(){return!(!this._elevation||!this.projection.supportsTerrain&&(e.warnOnce("Terrain is not yet supported with alternate projections. Use mercator or globe to enable terrain."),1))}anyCornerOffEdge(t,n){const i=Math.min(t.x,n.x),r=Math.max(t.x,n.x),o=Math.min(t.y,n.y),a=Math.max(t.y,n.y);if(o<this.horizonLineFromTop(!1))return!0;if("mercator"!==this.projection.name)return!1;const s=[new e.pointGeometry(i,o),new e.pointGeometry(r,a),new e.pointGeometry(i,a),new e.pointGeometry(r,o)],l=this.renderWorldCopies?-3:0,c=this.renderWorldCopies?4:1;for(const e of s){const t=this.pointRayIntersection(e);if(t.t<0)return!0;const n=this.rayIntersectionCoordinate(t);if(n.x<l||n.y<0||n.x>c||n.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+e.radToDeg(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.pointGeometry(0,0),new e.pointGeometry(this.width,this.height))}zoomDeltaToMovement(t,n){const i=e.length(e.sub([],this._camera.position,t)),r=this._zoomFromMercatorZ(i)+n;return i-this._mercatorZfromZoom(r)}getCameraPoint(){if("globe"===this.projection.name){const t=function([t,n,i],r){const o=[t,n,i,1];e.transformMat4$1(o,o,r);const a=o[3]=Math.max(o[3],1e-6);return o[0]/=a,o[1]/=a,o[2]/=a,o}([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.pointGeometry(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.pointGeometry(0,t))}}getCameraToCenterDistance(e,t=this.zoom){const n=$i(e,t,this.width,this.height,1024),i=e.pixelSpaceConversion(this.center.lat,this.worldSize,n);return.5/Math.tan(.5*this._fov)*this.height*i}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&e.multiply(t,t,this.globeMatrix),t}}function Yi(e,t){let n=!1,i=null;const r=()=>{i=null,n&&(e(),i=setTimeout(r,t),n=!1)};return()=>(n=!0,i||r(),i)}class Ki{constructor(t){this._hashName=t&&encodeURIComponent(t),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Yi(this._updateHashUnthrottled.bind(this),300)}addTo(t){return this._map=t,e.window.addEventListener("hashchange",this._onHashChange,!1),t.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),e.window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const t=this._map;if(!t)return"";const n=Ji(t);if(this._hashName){const t=this._hashName;let i=!1;const r=e.window.location.hash.slice(1).split("&").map((e=>{const r=e.split("=")[0];return r===t?(i=!0,`${r}=${n}`):e})).filter((e=>e));return i||r.push(`${t}=${n}`),`#${r.join("&")}`}return`#${n}`}_getCurrentHash(){const t=e.window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((e=>e.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")}_onHashChange(){const e=this._map;if(!e)return!1;const t=this._getCurrentHash();if(t.length>=3&&!t.some((e=>isNaN(e)))){const n=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:n,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){const t=e.window.location.href.replace(/(#.+)?$/,this.getHashString());e.window.history.replaceState(e.window.history.state,null,t)}}function Ji(e,t){const n=e.getCenter(),i=Math.round(100*e.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),a=Math.round(n.lng*o)/o,s=Math.round(n.lat*o)/o,l=e.getBearing(),c=e.getPitch();let u=t?`/${a}/${s}/${i}`:`${i}/${s}/${a}`;return(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+=`/${Math.round(c)}`),u}const Qi={linearity:.3,easing:e.bezier(0,0,.3,1)},er=e.extend({deceleration:2500,maxSpeed:1400},Qi),tr=e.extend({deceleration:20,maxSpeed:1400},Qi),nr=e.extend({deceleration:1e3,maxSpeed:360},Qi),ir=e.extend({deceleration:1e3,maxSpeed:90},Qi);class rr{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.exported.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,n=e.exported.now();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const n={zoom:0,bearing:0,pitch:0,pan:new e.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)n.zoom+=e.zoomDelta||0,n.bearing+=e.bearingDelta||0,n.pitch+=e.pitchDelta||0,e.panDelta&&n.pan._add(e.panDelta),e.around&&(n.around=e.around),e.pinchAround&&(n.pinchAround=e.pinchAround);const i=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(n.pan.mag()){const o=ar(n.pan.mag(),i,e.extend({},er,t||{}));r.offset=n.pan.mult(o.amount/n.pan.mag()),r.center=this._map.transform.center,or(r,o)}if(n.zoom){const e=ar(n.zoom,i,tr);r.zoom=this._map.transform.zoom+e.amount,or(r,e)}if(n.bearing){const t=ar(n.bearing,i,nr);r.bearing=this._map.transform.bearing+e.clamp(t.amount,-179,179),or(r,t)}if(n.pitch){const e=ar(n.pitch,i,ir);r.pitch=this._map.transform.pitch+e.amount,or(r,e)}if(r.zoom||r.bearing){const e=void 0===n.pinchAround?n.around:n.pinchAround;r.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),r.noMoveStart=!0,r}}function or(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function ar(t,n,i){const{maxSpeed:r,linearity:o,deceleration:a}=i,s=e.clamp(t*o/(n/1e3),-r,r),l=Math.abs(s)/(a*o);return{easing:i.easing,duration:1e3*l,amount:s*(l/2)}}class sr extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,i,r={}){const o=p(n.getCanvasContainer(),i),a=n.unproject(o);super(t,e.extend({point:o,lngLat:a,originalEvent:i},r)),this._defaultPrevented=!1,this.target=n}}class lr extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,i){const r="touchend"===t?i.changedTouches:i.touches,o=m(n.getCanvasContainer(),r),a=o.map((e=>n.unproject(e))),s=o.reduce(((e,t,n,i)=>e.add(t.div(i.length))),new e.pointGeometry(0,0));super(t,{points:o,point:s,lngLats:a,lngLat:n.unproject(s),originalEvent:i}),this._defaultPrevented=!1}}class cr extends e.Event{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,n){super(e,{originalEvent:n}),this._defaultPrevented=!1}}class ur{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._mousedownPos=void 0}wheel(e){return this._firePreventable(new cr(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new sr(e.type,this._map,e))}mouseup(e){this._map.fire(new sr(e.type,this._map,e))}preclick(t){const n=e.extend({},t);n.type="preclick",this._map.fire(new sr(n.type,this._map,n))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new sr(e.type,this._map,e)))}dblclick(e){return this._firePreventable(new sr(e.type,this._map,e))}mouseover(e){this._map.fire(new sr(e.type,this._map,e))}mouseout(e){this._map.fire(new sr(e.type,this._map,e))}touchstart(e){return this._firePreventable(new lr(e.type,this._map,e))}touchmove(e){this._map.fire(new lr(e.type,this._map,e))}touchend(e){this._map.fire(new lr(e.type,this._map,e))}touchcancel(e){this._map.fire(new lr(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class hr{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(e){this._map.fire(new sr(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new sr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new sr(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class dr{constructor(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(u(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const n=t,i=this._startPos,r=this._lastPos;if(!i||!r||r.equals(n)||!this._box&&n.dist(i)<this._clickTolerance)return;this._lastPos=n,this._box||(this._box=o("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));const a=Math.min(i.x,n.x),s=Math.max(i.x,n.x),l=Math.min(i.y,n.y),c=Math.max(i.y,n.y);this._map._requestDomTask((()=>{this._box&&(this._box.style.transform=`translate(${a}px,${l}px)`,this._box.style.width=s-a+"px",this._box.style.height=c-l+"px")}))}mouseupWindow(t,n){if(!this._active)return;const i=this._startPos,r=n;if(i&&0===t.button){if(this.reset(),f(),i.x!==r.x||i.y!==r.y)return this._map.fire(new e.Event("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(i,r,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),h(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new e.Event(t,{originalEvent:n}))}}function fr(e,t){const n={};for(let i=0;i<e.length;i++)n[e[i].identifier]=t[i];return n}class pr{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){this.centroid=void 0,this.startTime=0,this.touches={},this.aborted=!1}touchstart(t,n,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),i.length===this.numTouches&&(this.centroid=function(t){const n=new e.pointGeometry(0,0);for(const e of t)n._add(e);return n.div(t.length)}(n),this.touches=fr(i,n)))}touchmove(e,t,n){if(this.aborted||!this.centroid)return;const i=fr(n,t);for(const e in this.touches){const t=this.touches[e],n=i[e];(!n||n.dist(t)>30)&&(this.aborted=!0)}}touchend(e,t,n){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===n.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class mr{constructor(e){this.singleTap=new pr(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(e,t,n){this.singleTap.touchstart(e,t,n)}touchmove(e,t,n){this.singleTap.touchmove(e,t,n)}touchend(e,t,n){const i=this.singleTap.touchend(e,t,n);if(i){const t=e.timeStamp-this.lastTime<500,n=!this.lastTap||this.lastTap.dist(i)<30;if(t&&n||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}}class gr{constructor(){this._zoomIn=new mr({numTouches:1,numTaps:2}),this._zoomOut=new mr({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,n){this._zoomIn.touchstart(e,t,n),this._zoomOut.touchstart(e,t,n)}touchmove(e,t,n){this._zoomIn.touchmove(e,t,n),this._zoomOut.touchmove(e,t,n)}touchend(e,t,n){const i=this._zoomIn.touchend(e,t,n),r=this._zoomOut.touchend(e,t,n);return i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(i)},{originalEvent:e})}):r?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(r)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const _r={0:1,2:2};class yr{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(e,t){return!1}_move(e,t){return{}}mousedown(e,t){if(this._lastPoint)return;const n=g(e);this._correctButton(e,n)&&(this._lastPoint=t,this._eventButton=n)}mousemoveWindow(e,t){const n=this._lastPoint;if(n)if(e.preventDefault(),null!=this._eventButton&&function(e,t){const n=_r[t];return void 0===e.buttons||(e.buttons&n)!==n}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(n,t)}mouseupWindow(e){this._lastPoint&&g(e)===this._eventButton&&(this._moved&&f(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class vr extends yr{mousedown(e,t){super.mousedown(e,t),this._lastPoint&&(this._active=!0)}_correctButton(e,t){return 0===t&&!e.ctrlKey}_move(e,t){return{around:t,panDelta:t.sub(e)}}}class xr extends yr{_correctButton(e,t){return 0===t&&e.ctrlKey||2===t}_move(e,t){const n=.8*(t.x-e.x);if(n)return this._active=!0,{bearingDelta:n}}contextmenu(e){e.preventDefault()}}class br extends yr{_correctButton(e,t){return 0===t&&e.ctrlKey||2===t}_move(e,t){const n=-.5*(t.y-e.y);if(n)return this._active=!0,{pitchDelta:n}}contextmenu(e){e.preventDefault()}}class wr{constructor(t,n){this._map=t,this._el=t.getCanvasContainer(),this._minTouches=1,this._clickTolerance=n.clickTolerance||1,this.reset(),e.bindAll(["_addTouchPanBlocker","_showTouchPanBlockerAlert"],this)}reset(){this._active=!1,this._touches={},this._sum=new e.pointGeometry(0,0)}touchstart(e,t,n){return this._calculateTransform(e,t,n)}touchmove(t,n,i){if(this._active&&!(i.length<this._minTouches)){if(this._map._cooperativeGestures&&!this._map.isMoving()){if(1===i.length&&!e.isFullscreen())return void this._showTouchPanBlockerAlert();
vendor: 4,279 bytes, line 2
2"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}return t.cancelable&&t.preventDefault(),this._calculateTransform(t,n,i)}}touchend(e,t,n){this._calculateTransform(e,t,n),this._active&&n.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,n,i){i.length>0&&(this._active=!0);const r=fr(i,n),o=new e.pointGeometry(0,0),a=new e.pointGeometry(0,0);let s=0;for(const e in r){const t=r[e],n=this._touches[e];n&&(o._add(t),a._add(t.sub(n)),s++,r[e]=t)}if(this._touches=r,s<this._minTouches||!a.mag())return;const l=a.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(s),panDelta:l}}enable(){this._enabled=!0,this._map._cooperativeGestures&&(this._addTouchPanBlocker(),this._el.classList.add("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page"))}disable(){this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove(),this._el.classList.remove("mapboxgl-touch-pan-blocker-override","mapboxgl-scrollable-page")),this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}_addTouchPanBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=o("div","mapboxgl-touch-pan-blocker",this._map._container),this._alertContainer.textContent=this._map._getUIString("TouchPanBlocker.Message"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showTouchPanBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.setAttribute("role","null")}),500)}}class Er{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(e){}_move(e,t,n){return{}}touchstart(e,t,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,n){const i=this._firstTwoTouches;if(!i)return;e.preventDefault();const[r,o]=i,a=Tr(n,t,r),s=Tr(n,t,o);if(!a||!s)return;const l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,e)}touchend(e,t,n){if(!this._firstTwoTouches)return;const[i,r]=this._firstTwoTouches,o=Tr(n,t,i),a=Tr(n,t,r);o&&a||(this._active&&f(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Tr(e,t,n){for(let i=0;i<e.length;i++)if(e[i].identifier===n)return t[i]}function Sr(e,t){return Math.log(e/t)/Math.LN2}class Ar extends Er{reset(){super.reset(),this._distance=0,this._startDistance=0}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){const n=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Sr(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Sr(this._distance,n),pinchAround:t}}}function Cr(e,t){return 180*e.angleWith(t)/Math.PI}class kr extends Er{reset(){super.reset(),this._minDiameter=0,this._startVector=void 0,this._vector=void 0}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t){const n=this._vector;if(this._vector=e[0].sub(e[1]),n&&(this._active||!this._isBelowThreshold(this._vector)))return this._active=!0,{bearingDelta:Cr(this._vector,n),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,n=this._startVector;if(!n)return!1;const i=Cr(e,n);return Math.abs(i)<t}}function Mr(e){return Math.abs(e.y)>Math.abs(e.x)}class Ir extends Er{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(e){this._lastPoints=e,Mr(e[0].sub(e[1]))&&(this._valid=!1)}_move(t,n,i){const r=this._lastPoints;if(!r)return;const o=t[0].sub(r[0]),a=t[1].sub(r[1]);return this._map._cooperativeGestures&&!e.isFullscreen()&&i.touches.length<3||(this._val
vendor: 14,619 bytes, line 2
2id=this.gestureBeginsVertically(o,a,i.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+a.y)/2*-.5})}gestureBeginsVertically(e,t,n){if(void 0!==this._valid)return this._valid;const i=e.mag()>=2,r=t.mag()>=2;if(!i&&!r)return;if(!i||!r)return null==this._firstMove&&(this._firstMove=n),n-this._firstMove<100&&void 0;const o=e.y>0==t.y>0;return Mr(e)&&Mr(t)&&o}}const Pr={panStep:100,bearingStep:15,pitchStep:10};class Dr{constructor(){const e=Pr;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,n=0,i=0,r=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),r=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),r=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:a=>{const s=a.getZoom();a.easeTo({duration:300,easeId:"keyboardHandler",easing:zr,zoom:t?Math.round(s)+t*(e.shiftKey?2:1):s,bearing:a.getBearing()+n*this._bearingStep,pitch:a.getPitch()+i*this._pitchStep,offset:[-r*this._panStep,-o*this._panStep],center:a.getCenter()},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function zr(e){return e*(2-e)}const Lr=4.000244140625;class Or{constructor(t,n){this._map=t,this._el=t.getCanvasContainer(),this._handler=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,e.bindAll(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||e.isFullscreen()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let n=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const i=e.exported.now(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==n&&n%Lr==0?this._type="wheel":0!==n&&Math.abs(n)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*n)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const t=p(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:t,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;"wheel"===this._type&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const n=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>Lr?this._wheelZoomRate:this._defaultZoomRate;let i=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==i&&(i=1/i);const r=n(),o=Math.pow(2,r),a="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r,this._easing=this._smoothOutEasing(200)),this._delta=0}const i="number"==typeof this._targetZoom?this._targetZoom:n(),r=this._startZoom,o=this._easing;let a,s=!1;if("wheel"===this._type&&r&&o){const t=Math.min((e.exported.now()-this._lastWheelEventTime)/200,1),n=o(t);a=e.number(r,i,n),t<1?this._frameId||(this._frameId=!0):s=!0}else a=i,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:a-n(),around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=e.ease;if(this._prevEase){const t=this._prevEase,i=(e.exported.now()-t.start)/t.duration,r=t.easing(i+.01)-t.easing(i),o=.27/Math.sqrt(r*r+1e-4)*.01,a=Math.sqrt(.0729-o*o);n=e.bezier(o,a,.25,1)}return this._prevEase={start:e.exported.now(),duration:t,easing:n},n}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=o("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(e.window.navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","null")}),200)}}class Rr{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Br{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(e,t){return e.preventDefault(),{cameraAnimation:n=>{n.easeTo({duration:300,zoom:n.getZoom()+(e.shiftKey?-1:1),around:n.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Fr{constructor(){this._tap=new mr({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(e,t,n){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=t[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(e,t,n))}touchmove(e,t,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;const i=t[0],r=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(e,t,n)}touchend(e,t,n){this._tapTime?this._swipePoint&&0===n.length&&this.reset():this._tap.touchend(e,t,n)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Nr{constructor(e,t,n){this._el=e,this._mousePan=t,this._touchPan=n}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class jr{constructor(e,t,n){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=n}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ur{constructor(e,t,n,i){this._el=e,this._touchZoom=t,this._touchRotate=n,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Vr=e=>e.zoom||e.drag||e.pitch||e.rotate;class Gr extends e.Event{}class qr{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,n){const i=e.sub([],n,t);this.radius=e.length(i[2]<0?e.div([],i,this.constants):[i[0],i[1],0])}projectRay(t){e.div(t,t,this.constants),e.normalize(t,t),e.mul$1(t,t,this.constants);const n=e.scale$2([],t,this.radius);if(n[2]>0){const t=e.scale$2([],[0,0,1],e.dot(n,[0,0,1])),i=e.scale$2([],e.normalize([],[n[0],n[1],0]),this.radius),r=e.add([],n,e.scale$2([],e.sub([],e.add([],i,t),n),2));n[0]=r[0],n[1]=r[1]}return n}}function $r(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Wr{constructor(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new rr(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new qr,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(n),e.bindAll(["handleEvent","handleWindowEvent"],this);const i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[e.window,"blur",void 0]];for(const[t,n,i]of this._listeners)t.addEventListener(n,t===e.window.document?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(const[t,n,i]of this._listeners)t.removeEventListener(n,t===e.window.document?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(e){const t=this._map,n=t.getCanvasContainer();this._add("mapEvent",new ur(t,e));const i=t.boxZoom=new dr(t,e);this._add("boxZoom",i);const r=new gr,o=new Br;t.doubleClickZoom=new Rr(o,r),this._add("tapZoom",r),this._add("clickZoom",o);const a=new Fr;this._add("tapDragZoom",a);const s=t.touchPitch=new Ir(t);this._add("touchPitch",s);const l=new xr(e),c=new br(e);t.dragRotate=new jr(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new vr(e),h=new wr(t,e);t.dragPan=new Nr(n,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);const d=new kr,f=new Ar;t.touchZoomRotate=new Ur(n,f,d,a),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),this._add("blockableMapEvent",new hr(t));const p=t.scrollZoom=new Or(t,this);this._add("scrollZoom",p,["mousePan"]);const m=t.keyboard=new Dr;this._add("keyboard",m);for(const n of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[n]&&t[n].enable(e[n])}_add(e,t,n){this._handlers.push({handlerName:e,handler:t,allowed:n}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Vr(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(e,t,n){for(const i in e)if(i!==n&&(!t||t.indexOf(i)<0))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){const t=[];for(const n of e)this._el.contains(n.target)&&t.push(n);return t}handleEvent(e,t){this._updatingCamera=!0;const n="renderFrame"===e.type,i=n?void 0:e,r={needsRenderFrame:!1},o={},a={},s=e.touches?this._getMapTouches(e.touches):void 0,l=s?m(this._el,s):n?void 0:p(this._el,e);for(const{handlerName:n,handler:c,allowed:u}of this._handlers){if(!c.isEnabled())continue;let h;this._blockedByActive(a,u,n)?c.reset():c[t||e.type]&&(h=c[t||e.type](e,l,s),this.mergeHandlerResult(r,o,h,n,i),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||c.isActive())&&(a[n]=c)}const c={};for(const e in this._previousActiveHandlers)a[e]||(c[e]=i);this._previousActiveHandlers=a,(Object.keys(c).length||$r(r))&&(this._changes.push([r,o,c]),this._triggerRenderFrame()),(Object.keys(a).length||$r(r))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:u}=r;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))}mergeHandlerResult(t,n,i,r,o){if(!i)return;e.extend(t,i);const a={handlerName:r,originalEvent:i.originalEvent||o};
vendor: 3,427 bytes, line 2
2void 0!==i.zoomDelta&&(n.zoom=a),void 0!==i.panDelta&&(n.drag=a),void 0!==i.pitchDelta&&(n.pitch=a),void 0!==i.bearingDelta&&(n.rotate=a)}_applyChanges(){const t={},n={},i={};for(const[r,o,a]of this._changes)r.panDelta&&(t.panDelta=(t.panDelta||new e.pointGeometry(0,0))._add(r.panDelta)),r.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+r.pitchDelta),void 0!==r.around&&(t.around=r.around),void 0!==r.aroundCoord&&(t.aroundCoord=r.aroundCoord),void 0!==r.pinchAround&&(t.pinchAround=r.pinchAround),r.noInertia&&(t.noInertia=r.noInertia),e.extend(n,o),e.extend(i,a);this._updateMapTransform(t,n,i),this._changes=[]}_updateMapTransform(t,n,i){const r=this._map,o=r.transform,a=e=>[e.x,e.y,e.z];if((e=>{const t=this._eventsInProgress.drag;return t&&!this._handlersById[t.handlerName].isActive()})()&&!$r(t)){const e=o.zoom;o.cameraElevationReference="sea",o.recenterOnTerrain(),o.cameraElevationReference="ground",e!==o.zoom&&this._map._update(!0)}if(o._isCameraConstrained&&r._stop(!0),!$r(t))return void this._fireEvents(n,i,!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:h,aroundCoord:d,pinchAround:f}=t;o._isCameraConstrained&&(l>0&&(l=0),o._isCameraConstrained=!1),void 0!==f&&(h=f),(e=>n.drag&&!this._eventsInProgress.drag)()&&h&&(this._dragOrigin=a(o.pointCoordinate3D(h)),this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",r._stop(!0),h=h||r.transform.centerPoint,c&&(o.bearing+=c),u&&(o.pitch+=u),o._updateCameraState();const p=[0,0,0];if(s)if("mercator"===o.projection.name){const e=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h).dir),t=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(h.sub(s)).dir);p[0]=t[0]-e[0],p[1]=t[1]-e[1]}else{const t=o.pointCoordinate(h);if("globe"===o.projection.name){s=s.rotate(-o.angle);const n=o._pixelsPerMercatorPixel/o.worldSize;p[0]=-s.x*e.mercatorScale(e.latFromMercatorY(t.y))*n,p[1]=-s.y*e.mercatorScale(o.center.lat)*n}else{const e=o.pointCoordinate(h.sub(s));t&&e&&(p[0]=e.x-t.x,p[1]=e.y-t.y)}}const m=o.zoom,g=[0,0,0];if(l){const t=a(d||o.pointCoordinate3D(h)),n={dir:e.normalize([],e.sub([],t,o._camera.position))};if(n.dir[2]<0){const i=o.zoomDeltaToMovement(t,l);e.scale$2(g,n.dir,i)}}const _=e.add(p,p,g);o._translateCameraConstrained(_),l&&Math.abs(o.zoom-m)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,i,!0)}_fireEvents(t,n,i){const r=Vr(this._eventsInProgress),o=Vr(t),a={};for(const e in t){const{originalEvent:n}=t[e];this._eventsInProgress[e]||(a[`${e}start`]=n),this._eventsInProgress[e]=t[e]}!r&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in a)this._fireEvent(e,a[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:n}=t[e];this._fireEvent(e,n)}const s={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:i}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=n[t]||i,s[`${e}end`]=l)}for(const e in s)this._fireEvent(e,s[e]);const c=Vr(this._eventsInProgress);if(i&&(r||o)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),n=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;
2t?(n(t.bearing||this._map.getBearing())&&(t.bearing=0),this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new e.Event("moveend",{originalEvent:l})),n(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,n){this._map.fire(new e.Event(t,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{this._frameId=void 0,this.handleEvent(new Gr("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Zr="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Xr extends e.Evented{constructor(t,n){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=n.bearingSnap,e.bindAll(["_renderFrameCallback"],this)}getCenter(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,n,i){return t=e.pointGeometry.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},n),i)}panTo(t,n,i){return this.easeTo(e.extend({center:t},n),i)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(t,n,i){return this.easeTo(e.extend({zoom:t},n),i)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(t,n,i){return this.easeTo(e.extend({bearing:t},n),i)}resetNorth(t,n){return this.rotateTo(0,e.extend({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},t),n),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(t,n){t=e.LngLatBounds.convert(t);const i=n&&n.bearing||0,r=n&&n.pitch||0,o=t.getNorthWest(),a=t.getSouthEast();return this._cameraForBounds(this.transform,o,a,i,r,n)}_extendCameraOptions(t){const n={top:0,bottom:0,right:0,left:0};if("number"==typeof(t=e.extend({padding:n,offset:[0,0],maxZoom:this.transform.maxZoom},t)).padding){const e=t.padding;t.padding={top:e,bottom:e,right:e,left:e}}return t.padding=e.extend(n,t.padding),t}_minimumAABBFrustumDistance(e,t){const n=t.max[0]-t.min[0],i=t.max[1]-t.min[1];return n/i>e.aspect?n/(2*Math.tan(.5*e.fovX)*e.aspect):i/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(t,n,i,r,o,a){const s=t.clone(),l=this._extendCameraOptions(a);s.bearing=r,s.pitch=o;const c=e.LngLat.convert(n),u=e.LngLat.convert(i),h=.5*(c.lat+u.lat),d=.5*(c.lng+u.lng),f=e.latLngToECEF(h,d),p=e.normalize([],f),m=e.normalize([],e.cross([],p,[0,1,0])),g=e.cross([],m,p),_=[m[0],m[1],m[2],0,g[0],g[1],g[2],0,p[0],p[1],p[2],0,0,0,0,1],y=[f,e.latLngToECEF(c.lat,c.lng),e.latLngToECEF(u.lat,c.lng),e.latLngToECEF(u.lat,u.lng),e.latLngToECEF(c.lat,u.lng),e.latLngToECEF(h,c.lng),e.latLngToECEF(h,u.lng),e.latLngToECEF(c.lat,d),e.latLngToECEF(u.lat,d)];let v=e.Aabb.fromPoints(y.map((t=>[e.dot(m,t),e.dot(g,t),e.dot(p,t)])));const x=e.transformMat4([],v.center,_);0===e.squaredLength(x)&&e.set(x,0,0,1),e.normalize(x,x),e.scale$2(x,x,e.GLOBE_RADIUS),s.center=e.ecefToLatLng(x);const b=s.getWorldToCameraMatrix(),w=e.invert(new Float64Array(16),b);v=e.Aabb.applyTransform(v,e.multiply([],b,_)),e.transformMat4(x,x,b);const E=.5*(v.max[2]-v.min[2]),T=this._minimumAABBFrustumDistance(s,v),S=e.scale$2([],[0,0,1],E),A=e.add(S,x,S),C=T+(0===s.pitch?0:e.distance(x,A)),k=s.globeCenterInViewSpace,M=e.sub([],x,[k[0],k[1],k[2]]);e.normalize(M,M),e.scale$2(M,M,C);const I=e.add([],x,M);e.transformMat4(I,I,w);const P=e.earthRadius/e.GLOBE_RADIUS,D=e.length(I),z=e.mercatorZfromAltitude(D*P-e.earthRadius,0),L=Math.min(s.zoomFromMercatorZAdjusted(z),l.maxZoom);return L>.5*(e.GLOBE_ZOOM_THRESHOLD_MIN+e.GLOBE_ZOOM_THRESHOLD_MAX)?(s.setProjection({name:"mercator"}),s.zoom=L,this._cameraForBounds(s,n,i,r,o,a)):{center:s.center,zoom:L,bearing:r,pitch:o}}queryTerrainElevation(t,n){const i=this.transform.elevation;return i?(n=e.extend({},{exaggerated:!0}
2,n),i.getAtPoint(e.MercatorCoordinate.fromLngLat(t),null,n.exaggerated)):null}_cameraForBounds(t,n,i,r,o,a){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,n,i,r,o,a);const s=t.clone(),l=this._extendCameraOptions(a),c=s.padding;s.bearing=r,s.pitch=o;const u=e.LngLat.convert(n),h=e.LngLat.convert(i),d=new e.LngLat(u.lng,h.lat),f=new e.LngLat(h.lng,u.lat),p=s.project(u),m=s.project(h),g=this.queryTerrainElevation(u),_=this.queryTerrainElevation(h),y=this.queryTerrainElevation(d),v=this.queryTerrainElevation(f),x=[[p.x,p.y,Math.min(g||0,_||0,y||0,v||0)],[m.x,m.y,Math.max(g||0,_||0,y||0,v||0)]];let b=e.Aabb.fromPoints(x);const w=s.getWorldToCameraMatrix(),E=e.invert(new Float64Array(16),w);b=e.Aabb.applyTransform(b,w);const T=e.sub([],b.max,b.min),S=c.left||0,A=c.right||0,C=c.bottom||0,k=c.top||0,{left:M,right:I,top:P,bottom:D}=l.padding,z=.5*(S+A),L=.5*(k+C),O=Math.min(s.scaleZoom(s.scale*Math.min((s.width-(S+A+M+I))/T[0],(s.height-(C+k+D+P))/T[1])),l.maxZoom),R=s.scale/s.zoomScale(O);b=new e.Aabb([b.min[0]-(M+z)*R,b.min[1]-(D+L)*R,b.min[2]],[b.max[0]+(I+z)*R,b.max[1]+(P+L)*R,b.max[2]]);const B=.5*T[2],F=this._minimumAABBFrustumDistance(s,b),N=[0,0,1,0];e.transformMat4$1(N,N,w),e.normalize$2(N,N);const j=e.scale$2([],N,F+B),U=e.add([],b.center,j),V=("number"==typeof l.offset.x&&"number"==typeof l.offset.y?new e.pointGeometry(l.offset.x,l.offset.y):e.pointGeometry.convert(l.offset)).rotate(-e.degToRad(r));b.center[0]-=V.x*R,b.center[1]+=V.y*R,e.transformMat4(b.center,b.center,E),e.transformMat4(U,U,E);const G=[b.center[0],b.center[1],U[2]*s.pixelsPerMeter];e.scale$2(G,G,1/s.worldSize);const q=e.lngFromMercatorX(G[0]),$=e.latFromMercatorY(G[1]),W=Math.min(s._zoomFromMercatorZ(G[2]),l.maxZoom),Z=new e.LngLat(q,$);return s.mercatorFromTransition&&W<.5*(e.GLOBE_ZOOM_THRESHOLD_MIN+e.GLOBE_ZOOM_THRESHOLD_MAX)?(s.setProjection({name:"globe"}),s.zoom=W,this._cameraForBounds(s,n,i,r,o,a)):{center:Z,zoom:W,bearing:r,pitch:o}}fitBounds(e,t,n){const i=this.cameraForBounds(e,t);return this._fitInternal(i,t,n)}fitScreenCoordinates(t,n,i,r,o){const a=e.pointGeometry.convert(t),s=e.pointGeometry.convert(n),l=new e.pointGeometry(Math.min(a.x,s.x),Math.min(a.y,s.y)),c=new e.pointGeometry(Math.max(a.x,s.x),Math.max(a.y,s.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(a,s))return this;const u=this.transform.pointLocation3D(l),h=this.transform.pointLocation3D(c),d=this.transform.pointLocation3D(new e.pointGeometry(l.x,c.y)),f=this.transform.pointLocation3D(new e.pointGeometry(c.x,l.y)),p=[Math.min(u.lng,h.lng,d.lng,f.lng),Math.min(u.lat,h.lat,d.lat,f.lat)],m=[Math.max(u.lng,h.lng,d.lng,f.lng),Math.max(u.lat,h.lat,d.lat,f.lat)],g=r&&r.pitch?r.pitch:this.getPitch(),_=this._cameraForBounds(this.transform,p,m,i,g,r);return this._fitInternal(_,r,o)}_fitInternal(t,n,i){return t?(delete(n=e.extend(t,n)).padding,n.linear?this.easeTo(n,i):this.flyTo(n,i)):this}jumpTo(t,n){this.stop();const i=t.preloadOnly?this.transform.clone():this.transform;let r=!1,o=!1,a=!1;return"zoom"in t&&i.zoom!==+t.zoom&&(r=!0,i.zoom=+t.zoom),void 0!==t.center&&(i.center=e.LngLat.convert(t.center)),"bearing"in t&&i.bearing!==+t.bearing&&(o=!0,i.bearing=+t.bearing),"pitch"in t&&i.pitch!==+t.pitch&&(a=!0,i.pitch=+t.pitch),null==t.padding||i.isPaddingEqual(t.padding)||(i.padding=t.padding),t.preloadOnly?(this._preloadTiles(i),this):(this.fire(new e.Event("movestart",n)).fire(new e.Event("move",n)),r&&this.fire(new e.Event("zoomstart",n)).fire(new e.Event("zoom",n)).fire(new e.Event("zoomend",n)),o&&this.fire(new e.Event("rotatestart",n)).fire(new e.Event("rotate",n)).fire(new e.Event("rotateend",n)),a&&this.fire(new e.Event("pitchstart",n)).fire(new e.Event("pitch",n)).fire(new e.Event("pitchend",n)),this.fire(new e.Event("moveend",n)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.warnOnce(Zr),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,n){const i=this.transform;if(!i.projection.supportsFreeCamera)return e.warnOnce(Zr),this;this.stop();const r=i.zoom,o=i.pitch,a=i.bearing;i.setFreeCameraOptions(t);const s=r!==i.zoom,l=o!==i.pitch,c=a!==i.bearing;return this.fire(new e.Event("movestart",n)).fire(new e.Event("move",n)),s&&this.fire(new e.Event("zoomstart",n)).fire(new e.Event("zoom",n)).fire(new e.Event("zoomend",n)),c&&this.fire(new e.Event("rotatestart",n)).fire(new e.Event("rotate",n)).fire(new e.Event("rotateend",n)),l&&this.fire(new e.Event("pitchstart",n)).fire(new e.Event("pitch",n)).fire(new e.Event("pitchend",n)),this.fire(new e.Event("moveend",n)),this}easeTo(t,n){this._stop(!1,t.easeId),(!1===(t=e.extend({offset:[0,0],duration:500,easing:e.ease},t)).animate||!t.essential&&e.exported.prefersReducedMotion)&&(t.duration=0);const i=this.transform,r=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?+t.zoom:r,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,h="padding"in t?t.padding:i.padding,d=e.pointGeometry.convert(t.offset);let f,p,m;if("globe"===i.projection.name){const n=e.MercatorCoordinate.fromLngLat(i.center),r=d.rotate(-i.angle);n.x+=r.x/i.worldSize,n.y+=r.y/i.worldSize;const o=n.toLngLat(),a=e.LngLat.convert(t.center||o);this._normalizeCenter(a),f=i.centerPoint.add(r),p=new e.pointGeometry(n.x,n.y).mult(i.worldSize),m=new e.pointGeometry(e.mercatorXfromLng(a.lng),e.mercatorYfromLat(a.lat)).mult(i.worldSize).sub(p)}else{f=i.centerPoint.add(d);const n=i.pointLocation(f),r=e.LngLat.convert(t.center||n);this._normalizeCenter(r),p=i.project(n),m=i.project(r).sub(p)}const g=i.zoomScale(l-r);let _,y;t.around&&(_=e.LngLat.convert(t.around),y=i.locationPoint(_));const v=this._zooming||l!==r,x=this._rotating||o!==c,b=this._pitching||u!==a,w=!i.isPaddingEqual(h),E=i=>E=>{if(v&&(i.zoom=e.number(r,l,E)),x&&(i.bearing=e.number(o,c,E)),b&&(i.pitch=e.number(a,u,E)),w&&(i.interpolatePadding(s,h,E),f=i.centerPoint.add(d)),_)i.setLocationAtPoint(_,y);else{const e=i.zoomScale(i.zoom-r),t=l>r?Math.min(2,g):Math.max(.5,g),n=Math.pow(t,1-E),o=i.unproject(p.add(m.mult(E*n)).mult(e));i.setLocationAtPoint(i.renderWorldCopies?o.wrap():o,f)}return t.preloadOnly||this._fireMoveEvents(n),i};if(t.preloadOnly){const e=this._emulate(E,t.duration,i);return this._preloadTiles(e),this}const T={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=v,this._rotating=x,this._pitching=b,this._padding=w,this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,T),this._ease(E(i),(e=>{i.recenterOnTerrain(),this._afterEase(n,e)}),t),this}_prepareEase(t,n,i={}){this._moving=!0,this.transform.cameraElevationReference="sea",n||i.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!i.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!i.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!i.pitching&&this.fire(new e.Event("pitchstart",t))}_fireMoveEvents(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const i=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new e.Event("zoomend",t)),r&&this.fire(new e.Event("rotateend",t)),o&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}flyTo(t,n){if(!t.essential&&e.exported.prefersReducedMotion){const i=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,n)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);const i=this.transform,r=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?e.clamp(+t.zoom,i.minZoom,i.maxZoom):r,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,h="padding"in t?t.padding:i.padding,d=i.zoomScale(l-r),f=e.pointGeometry.convert(t.offset);let p=i.centerPoint.add(f);const m=i.pointLocation(p),g=e.LngLat.convert(t.center||m);this._normalizeCenter(g);const _=i.project(m),y=i.project(g).sub(_);let v=t.curve;const x=Math.max(i.width,i.height),b=x/d,w=y.mag();if("minZoom"in t){const n=e.clamp(Math.min(t.minZoom,r,l),i.minZ
vendor: 4,319 bytes, line 2
2oom,i.maxZoom),o=x/i.zoomScale(n-r);v=Math.sqrt(o/w*2)}const E=v*v;function T(e){const t=(b*b-x*x+(e?-1:1)*E*E*w*w)/(2*(e?b:x)*E*w);return Math.log(Math.sqrt(t*t+1)-t)}function S(e){return(Math.exp(e)-Math.exp(-e))/2}function A(e){return(Math.exp(e)+Math.exp(-e))/2}const C=T(0);let k=function(e){return A(C)/A(C+v*e)},M=function(e){return x*((A(C)*(S(t=C+v*e)/A(t))-S(C))/E)/w;var t},I=(T(1)-C)/v;if(Math.abs(w)<1e-6||!isFinite(I)){if(Math.abs(x-b)<1e-6)return this.easeTo(t,n);const e=b<x?-1:1;I=Math.abs(Math.log(b/x))/v,M=function(){return 0},k=function(t){return Math.exp(e*v*t)}}t.duration="duration"in t?+t.duration:1e3*I/("screenSpeed"in t?+t.screenSpeed/v:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0);const P=o!==c,D=u!==a,z=!i.isPaddingEqual(h),L=i=>d=>{const m=d*I,v=1/k(m);i.zoom=1===d?l:r+i.scaleZoom(v),P&&(i.bearing=e.number(o,c,d)),D&&(i.pitch=e.number(a,u,d)),z&&(i.interpolatePadding(s,h,d),p=i.centerPoint.add(f));const x=1===d?g:i.unproject(_.add(y.mult(M(m))).mult(v));return i.setLocationAtPoint(i.renderWorldCopies?x.wrap():x,p),i._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(n),i};if(t.preloadOnly){const e=this._emulate(L,t.duration,i);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=P,this._pitching=D,this._padding=z,this._prepareEase(n,!1),this._ease(L(i),(()=>this._afterEase(n)),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const e=this._onEaseEnd;this._onEaseEnd=void 0,e.call(this,t)}if(!e){const e=this.handlers;e&&e.stop(!1)}return this}_ease(t,n,i){!1===i.animate||0===i.duration?(t(1),n()):(this._easeStart=e.exported.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((e.exported.now()-this._easeStart)/this._easeOptions.duration,1),n=this._onEaseFrame;n&&n(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,n){t=e.wrap(t,-180,180);const i=Math.abs(t-n);return Math.abs(t-360-n)<i&&(t-=360),Math.abs(t+360-n)<i&&(t+=360),t}_normalizeCenter(e){const t=this.transform;if(!t.renderWorldCopies||t.maxBounds)return;const n=e.lng-t.center.lng;e.lng+=n>180?-360:n<-180?360:0}_emulate(e,t,n){const i=Math.ceil(15*t/1e3),r=[],o=e(n.clone());for(let e=0;e<=i;e++){const t=o(e/i);r.push(t.clone())}return r}}class Hr{constructor(t={}){this.options=t,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){const t=this.options&&this.options.compact;return this._map=e,this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=o("button","mapboxgl-ctrl-attrib-button",this._container),o("span","mapboxgl-ctrl-icon",this._compactButton).setAttribute("aria-hidden","true"),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_setElementTitle(e,t){const n=this._map._getUIString(`AttributionControl.${t}`);e.setAttribute("aria-label",n),e.removeAttribute("title"),e.firstElementChild&&e.firstElementChild.setAttribute("title",n)}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","fal
2se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const n=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){const i=n.reduce(((e,t,i)=>(t.value&&(e+=`${t.key}=${t.value}${i<n.length-1?"&":""}`),e)),"?");t.href=`${e.config.FEEDBACK_URL}/${i}#${Ji(this._map,!0)}`,t.rel="noopener nofollow",this._setElementTitle(t,"MapFeedback")}}_updateData(e){!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType||(this._updateAttributions(),this._updateEditLink())}_updateAttributions(){if(!this._map.style)return;let e=[];if(this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style._sourceCaches;for(const n in t){const i=t[n];if(i.used){const t=i.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,n)=>{for(let i=n+1;i<e.length;i++)if(e[i].indexOf(t)>=0)return!1;return!0})),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[...this.options.customAttribution,...e]:e.unshift(this.options.customAttribution));const n=e.join(" | ");n!==this._attribHTML&&(this._attribHTML=n,e.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Yr{constructor(){e.bindAll(["_updateLogo","_updateCompact"],this)}onAdd(e){this._map=e,this._container=o("div","mapboxgl-ctrl");const t=o("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(const t in e){const n=e[t].getSource();if(n.hasOwnProperty("mapbox_logo")&&!n.mapbox_logo)return!1}return!0}_updateCompact(){const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}}}class Kr{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,n=t?this._queue.concat(t):this._queue;for(const t of n)if(t.id===e)return void(t.cancelled=!0)}run(e=0){const t=this._currentlyRunning=this._queue;this._queue=[];for(const n of t)if(!n.cancelled&&(n.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Jr(t,n,i){if(t=new e.LngLat(t.lng,t.lat),n){const r=new e.LngLat(t.lng-360,t.lat),o=new e.LngLat(t.lng+360,t.lat),a=360*Math.ceil(Math.abs(t.lng-i.center.lng)/360),s=i.locationPoint(t).distSqr(n),l=n.x<0||n.y<0||n.x>i.width||n.y>i.height;i.locationPoint(r).distSqr(n)<s&&(l||Math.abs(r.lng-i.center.lng)<a)?t=r:i.locationPoint(o).distSqr(n)<s&&(l||Math.abs(o.lng-i.center.lng)<a)&&(t=o)}for(;Math.abs(t.lng-i.center.lng)>180;){const e=i.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=i.width&&e.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t}
vendor: 4,521 bytes, line 2
2const Qr={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class eo extends e.Evented{constructor(t,n){if(super(),(t instanceof e.window.HTMLElement||n)&&(t=e.extend({element:t},n)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=t&&t.occludedOpacity||.2,t&&t.element)this._element=t.element,this._offset=e.pointGeometry.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=o("div");const n=41,i=27,r=a("svg",{display:"block",height:n*this._scale+"px",width:i*this._scale+"px",viewBox:`0 0 ${i} ${n}`},this._element),s=a("radialGradient",{id:"shadowGradient"},a("defs",{},r));a("stop",{offset:"10%","stop-opacity":.4},s),a("stop",{offset:"100%","stop-opacity":.05},s),a("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},r),a("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},r),a("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},r),a("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},r),this._offset=e.pointGeometry.convert(t&&t.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()}));const i=this._element.classList;for(const e in Qr)i.remove(`mapboxgl-marker-anchor-${e}`);i.add(`mapboxgl-marker-anchor-${this._anchor}`),this._popup=null}addTo(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}remove(){const e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=38.1,n=13.5,i=Math.sqrt(Math.pow(n,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[i,-1*(t-n+i)],"bottom-right":[-i,-1*(t-n+i)],left:[n,-1*(t-n)],right:[-n,-1*(t-n)]}:this._offset}this._popup=e,e._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","fal
2se")}return this}_onKeyPress(e){const t=e.code,n=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==n&&13!==n||this.togglePopup()}_onMapClick(e){const t=e.originalEvent.target,n=this._element;this._popup&&(t===n||n.contains(t))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const e=this._map,t=this._pos;if(!e||!t)return!1;const n=e.unproject(t),i=e.getFreeCameraOptions();if(!i.position)return!1;const r=i.position.toLngLat();return r.distanceTo(n)<.9*r.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const n=this._pos;if(!n||n.x<0||n.x>t.transform.width||n.y<0||n.y>t.transform.height)return void this._clearFadeTimer();const i=t.unproject(n);let r;t._showingGlobe()&&e.isLngLatBehindGlobe(t.transform,this._lngLat)?r=0:(r=1-t._queryFogOpacity(i),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(r*=this._occludedOpacity)),this._element.style.opacity=`${r}`,this._element.style.pointerEvents=r>0?"auto":"none",this._popup&&this._popup._setOpacity(r),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const e=this._pos;if(!e||!this._map)return;const t=this._offset.mult(this._scale);this._element.style.transform=`\n            translate(${e.x}px,${e.y}px)\n            ${Qr[this._anchor]}\n            ${this._calculateXYTransform()} ${this._calculateZTransform()}\n            translate(${t.x}px,${t.y}px)\n        `}_calculateXYTransform(){const t=this._pos,n=this._map,i=this.getPitchAlignment();if(!n||!t||"map"!==i)return"";if(!n._showingGlobe()){const e=n.getPitch();return e?`rotateX(${e}deg)`:""}const r=e.radToDeg(e.globeTiltAtLngLat(n.transform,this._lngLat)),o=t.sub(e.globeCenterToScreenPoint(n.transform)),a=Math.abs(o.x)+Math.abs(o.y);if(0===a)return"";const s=r/a;return`rotateX(${-o.y*s}deg) rotateY(${o.x*s}deg)`}_calculateZTransform(){const t=this._pos,n=this._map;if(!n||!t)return"";let i=0;const r=this.getRotationAlignment();if("map"===r)if(n._showingGlobe()){const t=n.project(new e.LngLat(this._lngLat.lng,this._lngLat.lat+.001)),r=n.project(new e.LngLat(this._lngLat.lng,this._lngLat.lat-.001)).sub(t);i=e.radToDeg(Math.atan2(r.y,r.x))-90}else i=-n.getBearing();else if("horizon"===r){const r=e.smoothstep(4,6,n.getZoom()),o=e.globeCenterToScreenPoint(n.transform);o.y+=r*n.transform.height;const a=t.sub(o),s=e.radToDeg(Math.atan2(a.y,a.x));i=(s>90?s-270:s+90)*(1-r)}return i+=this._rotation,i?`rotateZ(${i}deg)`:""}_update(t){e.window.cancelAnimationFrame(this._updateFrameId);const n=this._map;
vendor: 6,761 bytes, line 2
2n&&(n.transform.renderWorldCopies&&(this._lngLat=Jr(this._lngLat,this._pos,n.transform)),this._pos=n.project(this._lngLat),!0===t?this._updateFrameId=e.window.requestAnimationFrame((()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())})):this._pos=this._pos.round(),n._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(n._showingGlobe()||n.getTerrain()||n.getFog())&&!this._fadeTimer&&(this._fadeTimer=setTimeout(this._evaluateOpacity.bind(this),60)))})))}getOffset(){return this._offset}setOffset(t){return this._offset=e.pointGeometry.convert(t),this._update(),this}_onMove(t){const n=this._map;if(!n)return;const i=this._pointerdownPos,r=this._positionDelta;if(i&&r){if(!this._isDragging){const e=this._clickTolerance||n._clickTolerance;if(t.point.dist(i)<e)return;this._isDragging=!0}this._pos=t.point.sub(r),this._lngLat=n.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag"))}}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1;const t=this._map;t&&(t.off("mousemove",this._onMove),t.off("touchmove",this._onMove)),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"}_addDragHandler(e){const t=this._map,n=this._pos;t&&n&&this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(n),this._pointerdownPos=e.point,this._state="pending",t.on("mousemove",this._onMove),t.on("touchmove",this._onMove),t.once("mouseup",this._onUp),t.once("touchend",this._onUp))}setDraggable(e){this._draggable=!!e;const t=this._map;return t&&(e?(t.on("mousedown",this._addDragHandler),t.on("touchstart",this._addDragHandler)):(t.off("mousedown",this._addDragHandler),t.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return"auto"===this._rotationAlignment||"horizon"===this._rotationAlignment&&this._map&&!this._map._showingGlobe()?"viewport":this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e||"auto",this._update(),this}getPitchAlignment(){return"auto"===this._pitchAlignment?this.getRotationAlignment():this._pitchAlignment}setOccludedOpacity(e){return this._occludedOpacity=e||.2,this._update(),this}getOccludedOpacity(){return this._occludedOpacity}}const to={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},no=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function io(t=new e.pointGeometry(0,0),n="bottom"){if("number"==typeof t){const i=Math.round(Math.sqrt(.5*Math.pow(t,2)));switch(n){case"top":return new e.pointGeometry(0,t);case"top-left":return new e.pointGeometry(i,i);case"top-right":return new e.pointGeometry(-i,i);case"bottom":return new e.pointGeometry(0,-t);case"bottom-left":return new e.pointGeometry(i,-i);case"bottom-right":return new e.pointGeometry(-i,-i);case"left":return new e.pointGeometry(t,0);case"right":return new e.pointGeometry(-t,0)}return new e.pointGeometry(0,0)}return t instanceof e.pointGeometry||Array.isArray(t)?e.pointGeometry.convert(t):e.pointGeometry.convert(t[n]||[0,0])}class ro{constructor(e){this.jumpTo(e)}getValue(t){if(t<=this._startTime)return this._start;if(t>=this._endTime)return this._end;const n=e.easeCubicInOut((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-n)+this._end*n}isEasing(e){return e>=this._startTime&&e<=this._endTime}jumpTo(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}easeTo(e,t,n){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+n}}const oo={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use ⌘ + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"},ao={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,optimizeForTerrain:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},so={showCompass:!0,showZoom:!0,visualizePitch:!1};class lo{constructor(t,n,i=!1){this._clickTolerance=10,this.element=n,this.mouseRotate=new xr({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,i&&(this.mousePitch=new br({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),n.addEventListener("mousedown",this.mousedown),n.addEventListener("touchstart",this.touchstart,{passive:!1}),n.addEventListener("touchmove",this.touchmove),n.addEventListener("touchend",this.touchend),n.addEventListener("touchcancel",this.reset)}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),u()}move(e,t){const n=this.map,i=this.mouseRotate.mousemoveWindow(e,t),r=i&&i.bearingDelta;if(r&&n.setBearing(n.getBearing()+r),this.mousePitch){const i=this.mousePitch.mousemoveWindow(e,t),r=i&&i.pitchDelta;r&&n.setPitch(n.getPitch()+r)}}off(){const e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart,{passive:!1}),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}
2offTemp(){h(),e.window.removeEventListener("mousemove",this.mousemove),e.window.removeEventListener("mouseup",this.mouseup)}mousedown(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),p(this.element,t)),e.window.addEventListener("mousemove",this.mousemove),e.window.addEventListener("mouseup",this.mouseup)}mousemove(e){this.move(e,p(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=m(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=m(this.element,e.targetTouches)[0],this.move({preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}const co={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0,showUserHeading:!1},uo={maxWidth:100,unit:"metric"};function ho(e,t,n){const i=fo(t),r=i/t,o={kilometer:"km",meter:"m",mile:"mi",foot:"ft","nautical-mile":"nm"}[n];this._map._requestDomTask((()=>{this._container.style.width=e*r+"px",this._container.innerHTML=`${i}&nbsp;${o}`}))}function fo(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:n>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(n),t*n}const po={version:e.version,supported:n,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:class extends Xr{constructor(t){if(e.LivePerformanceUtils.mark(e.PerformanceMarkers.create),null!=(t=e.extend({},ao,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(t.antialias&&e.isSafariWithAntialiasingBug(e.window)&&(t.antialias=!1,e.warnOnce("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new Hi(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),t),this._interactive=t.interactive,this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=t.crossSourceCollisions,this._collectResourceTiming=t.collectResourceTiming,this._optimizeForTerrain=t.optimizeForTerrain,this._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new Kr,this._domRenderTaskQueue=new Kr,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.uniqueId(),this._locale=e.extend({},oo,t.locale),this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._containerWidth=0,this._containerHeight=0,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new ro(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken,t.testMode),this._silenceAuthErrors=!!t.testMode,"string"==typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error(`Container '${t.container}' not found.`)}
vendor: 20,297 bytes, line 2
2else{if(!(t.container instanceof e.window.HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(this._container.childNodes.length>0&&e.warnOnce("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),void 0!==e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1),e.window.addEventListener("webkitfullscreenchange",this._onWindowResize,!1),e.window.addEventListener("visibilitychange",this._onVisibilityChange,!1)),this.handlers=new Wr(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),t.projection&&this.setProjection(t.projection),this._hash=t.hash&&new Ki("string"==typeof t.hash&&t.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),t.attributionControl&&this.addControl(new Hr({customAttribution:t.customAttribution})),this._logoControl=new Yr,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.Event(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.Event(`${t.dataType}dataloading`,t))}))}_getMapId(){return this._mapId}addControl(t,n){if(void 0===n&&(n=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const i=t.onAdd(this);this._controls.push(t);const r=this._controlPositions[n];return-1!==n.indexOf("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const n=this._controls.indexOf(t);return n>-1&&this._controls.splice(n,1),t.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const n=!this._moving;return n&&this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t)),this.fire(new e.Event("resize",t)),n&&this.fire(new e.Event("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t?this.setZoom(t):this.fire(new e.Event("zoomstart")).fire(new e.Event("zoom")).fire(new e.Event("zoomend")),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t?this.setZoom(t):this.fire(new e.Event("zoomstart")).fire(new e.Event("zoom")).fire(new e.Event("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t?this.setPitch(t):this.fire(new e.Event("pitchstart")).fire(new e.Event("pitch")).fire(new e.Event("pitchend")),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?85:t)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t?this.setPitch(t):this.fire(new e.Event("pitchstart")).fire(new e.Event("pitch")).fire(new e.Event("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(t){return"auto"===t?e.window.navigator.language:Array.isArray(t)?0===t.length?void 0:t.map((t=>"auto"===t?e.window.navigator.language:t)):t}setLanguage(e){const t=this._parseLanguage(e);if(!this.style||t===this._language)return this;this._language=t,this.style._reloadSources();for(const e of this._controls)e._setLanguage&&e._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(e){return this.style&&e!==this._worldview?(this._worldview=e,this.style._reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.stylesheet?this.style.stylesheet.projection:null)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,n=t.projection.name;let i;"globe"===n&&t.zoom>=e.GLOBE_ZOOM_THRESHOLD_MAX?(t.setMercatorFromTransition(),i=!0):"mercator"===n&&t.zoom<e.GLOBE_ZOOM_THRESHOLD_MAX&&(t.setProjection({name:"globe"}),i=!0),i&&(this.style.applyProjectionUpdate(),this.style._forceSymbolLayerUpdate())}_prioritizeAndUpdateProjection(e,t){return this._updateProjection(e||t||{name:"mercator"})}_updateProjection(t){let n;if(n="globe"===t.name&&this.transform.zoom>=e.GLOBE_ZOOM_THRESHOLD_MAX?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate(),n){this.painter.clearBackgroundTiles();for(const e in this.style._sourceCaches)this.style._sourceCaches[e].clearTiles();this._update(!0),this._forceMarkerAndPopupUpdate(!0)}return this}project(t){return this.transform.locationPoint3D(e.LngLat.convert(t))}unproject(t){return this.transform.pointLocation3D(e.pointGeometry.convert(t))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(e,t,n){if("mouseenter"===e||"mouseover"===e){let i=!1;const r=r=>{const o=t.filter((e=>this.getLayer(e))),a=o.length?this.queryRenderedFeatures(r.point,{layers:o}):[];a.length?i||(i=!0,n.call(this,new sr(e,this,r.originalEvent,{features:a}))):i=!1},o=()=>{i=!1};return{layers:new Set(t),listener:n,delegates:{mousemove:r,mouseout:o}}}if("mouseleave"===e||"mouseout"===e){let i=!1;const r=r=>{const o=t.filter((e=>this.getLayer(e)));(o.length?this.queryRenderedFeatures(r.point,{layers:o}):[]).length?i=!0:i&&(i=!1,n.call(this,new sr(e,this,r.originalEvent)))},o=t=>{i&&(i=!1,n.call(this,new sr(e,this,t.originalEvent)))};return{layers:new Set(t),listener:n,delegates:{mousemove:r,mouseout:o}}}{const i=e=>{const i=t.filter((e=>this.getLayer(e))),r=i.length?this.queryRenderedFeatures(e.point,{layers:i}):[];r.length&&(e.features=r,n.call(this,e),delete e.features)};return{layers:new Set(t),listener:n,delegates:{[e]:i}}}}on(e,t,n){if(void 0===n)return super.on(e,t);Array.isArray(t)||(t=[t]);const i=this._createDelegatedListener(e,t,n);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i);for(const e in i.delegates)this.on(e,i.delegates[e]);return this}once(e,t,n){if(void 0===n)return super.once(e,t);Array.isArray(t)||(t=[t]);const i=this._createDelegatedListener(e,t,n);for(const e in i.delegates)this.once(e,i.delegates[e]);return this}off(e,t,n){if(void 0===n)return super.off(e,t);t=new Set(Array.isArray(t)?t:[t]);const i=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0},r=this._delegatedListeners?this._delegatedListeners[e]:void 0;return r&&(e=>{for(let r=0;r<e.length;r++){const o=e[r];if(o.listener===n&&i(o.layers,t)){for(const e in o.delegates)this.off(e,o.delegates[e]);return e.splice(r,1),this}}})(r),this}queryRenderedFeatures(t,n){return this.style?(void 0!==n||void 0===t||t instanceof e.pointGeometry||Array.isArray(t)||(n=t,t=void 0),this.style.queryRenderedFeatures(t=t||[[0,0],[this.transform.width,this.transform.height]],n=n||{},this.transform)):[]}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(t,n){return!1!==(n=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily,localFontFamily:this._localFontFamily},n)).diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&n.localFontFamily===this._localFontFamily&&this.style&&t?(this._diffStyle(t,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._localFontFamily=n.localFontFamily,this._updateStyle(t,n))}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){return this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),e&&(this.style=new Jt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e)),this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new Jt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,n){if("string"==typeof t){const i=this._requestManager.normalizeStyleURL(t),r=this._requestManager.transformRequest(i,e.ResourceType.Style);e.getJSON(r,((t,i)=>{t?this.fire(new e.ErrorEvent(t)):i&&this._updateDiff(i,n)}))}else"object"==typeof t&&this._updateDiff(t,n)}_updateDiff(t,n){try{this.style.setState(t)&&this._update(!0)}catch(i){e.warnOnce(`Unable to perform style diff: ${i.message||i.error||i}.  Rebuilding the style from scratch.`),this._updateStyle(t,n)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.warnOnce("There is no style added to the map."),!1)}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){return!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){const e=this.style&&this.style._sourceCaches;for(const t in e){const n=e[t]._tiles;for(const e in n){const t=n[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}addSourceType(e,t,n){this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,n)}removeSource(e){return this.style.removeSource(e),this._updateTerrain(),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(t,n,{pixelRatio:i=1,sdf:r=!1,stretchX:o,stretchY:a,content:s}={}){if(this._lazyInitEmptyStyle(),n instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&n instanceof e.window.ImageBitmap){const{width:l,height:c,data:u}=e.exported.getImageData(n);this.style.addImage(t,{data:new e.RGBAImage({width:l,height:c},u),pixelRatio:i,stretchX:o,stretchY:a,content:s,sdf:r,version:0})}else if(void 0===n.width||void 0===n.height)this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:l,height:c}=n,u=n;this.style.addImage(t,{data:new e.RGBAImage({width:l,height:c},new Uint8Array(u.data)),pixelRatio:i,stretchX:o,stretchY:a,content:s,sdf:r,version:0,userImage:u}),u.onAdd&&u.onAdd(this,t)}}updateImage(t,n){const i=this.style.getImage(t);if(!i)return void this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const r=n instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&n instanceof e.window.ImageBitmap?e.exported.getImageData(n):n,{width:o,height:a}=r;void 0!==o&&void 0!==a?o===i.data.width&&a===i.data.height?(i.data.replace(r.data,!(n instanceof e.window.HTMLImageElement||e.window.ImageBitmap&&n instanceof e.window.ImageBitmap)),this.style.updateImage(t,i)):this.fire(new e.ErrorEvent(new Error(`The width and height of the updated image (${o}, ${a})\n                must be that same as the previous version of the image\n                (${i.data.width}, ${i.data.height})`))):this.fire(new e.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")))}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(t,n){e.getImage(this._requestManager.transformRequest(t,e.ResourceType.Image),((t,i)=>{n(t,i instanceof e.window.HTMLImageElement?e.exported.getImageData(i):i)}))}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}setLayerZoomRange(e,t,n){return this.style.setLayerZoomRange(e,t,n),this._update(!0)}setFilter(e,t,n={}){return this.style.setFilter(e,t,n),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,n,i={}){return this.style.setPaintProperty(e,t,n,i),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,n,i={}){return this.style.setLayoutProperty(e,t,n,i),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setTerrain(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}getFog(){return this.style?this.style.getFog():null}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.LngLat.convert(t),this.transform):0}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}_updateContainerDimensions(){if(!this._container)return;const t=this._container.getBoundingClientRect().width||400,n=this._container.getBoundingClientRect().height||300;let i,r,o,a=this._container;for(;a&&(!r||!o);){const t=e.window.getComputedStyle(a).transform;t&&"none"!==t&&(i=t.match(/matrix.*\((.+)\)/)[1].split(", "),i[0]&&"0"!==i[0]&&"1"!==i[0]&&(r=i[0]),i[3]&&"0"!==i[3]&&"1"!==i[3]&&(o=i[3])),a=a.parentElement}this._containerWidth=r?Math.abs(t/r):t,this._containerHeight=o?Math.abs(n/o):n}_detectMissingCSS(){"rgb(250, 128, 114)"!==e.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=o("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=o("div","mapboxgl-canvas-container",e);this._interactive&&t.classList.add("mapboxgl-interactive"),this._canvas=o("canvas","mapboxgl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const n=this._controlContainer=o("div","mapboxgl-control-container",e),i=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{i[e]=o("div",`mapboxgl-ctrl-${e}`,n)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,n){const i=e.exported.devicePixelRatio||1;this._canvas.width=i*Math.ceil(t),this._canvas.height=i*Math.ceil(n),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${n}px`}_addMarker(e){this._markers.push(e)}_removeMarker(e){const t=this._markers.indexOf(e);-1!==t&&this._markers.splice(t,1)}_addPopup(e){this._popups.push(e)}_removePopup(e){const t=this._popups.indexOf(e);-1!==t&&this._popups.splice(t,1)}_setupPainter(){const t=e.extend({},n.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl",t)||this._canvas.getContext("experimental-webgl",t);i?(e.storeAuthState(i,!0),this.painter=new Ri(i,this.transform),this.on("data",(e=>{"source"===e.dataType&&this.painter.setTileLoadedFlag(!0)})),e.exported$1.testSupport(i)):this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:t}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_requestDomTask(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}_render(t){let n;const i=this.painter.context.extTimerQuery,r=e.exported.now();if(this.listens("gpu-timing-frame")&&(n=i.createQueryEXT(),i.beginQueryEXT(i.TIME_ELAPSED_EXT,n)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&
2(this._interactionRange[0]=Math.min(this._interactionRange[0],e.window.performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],e.window.performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const o=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,n=this.transform.pitch,i=e.exported.now(),r=new e.EvaluationParameters(t,{now:i,fadeDuration:o,pitch:n,transition:this.style.getTransition()});this.style.update(r)}this.style&&this.style.fog&&this.style.fog.hasTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let a=!1;if(this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),a=this._updateAverageElevation(r),this.style._updateSources(this.transform),this._forceMarkerAndPopupUpdate()):a=this._updateAverageElevation(r),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,o,this._crossSourceCollisions),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showTerrainWireframe:this.showTerrainWireframe,showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:o,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.Event("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),n){const t=e.exported.now()-r;i.endQueryEXT(i.TIME_ELAPSED_EXT,n),setTimeout((()=>{const o=i.getQueryObjectEXT(n,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(n),this.fire(new e.Event("gpu-timing-frame",{cpuTime:t,gpuTime:o})),e.window.performance.mark("frame-gpu",{startTime:r,detail:{gpuTime:o}})}),50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout((()=>{const n=this.painter.queryGpuTimers(t);this.fire(new e.Event("gpu-timing-layer",{layerTimes:n}))}),50)}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout((()=>{const n=this.painter.queryGpuTimeDeferredRender(t);this.fire(new e.Event("gpu-timing-deferred-render",{gpuTime:n}))}),50)}const s=this._sourcesDirty||this._styleDirty||this._placementDirty||a;if(s||this._repaint)this.triggerRepaint();else{const t=!this.isMoving()&&this.loaded();if(t&&(a=this._updateAverageElevation(r,!0)),a)this.triggerRepaint();else if(this._triggerFrame(!1),t&&(this.fire(new e.Event("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new e.Event("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,e.LivePerformanceUtils.mark(e.PerformanceMarkers.fullLoad),this._performanceMetricsCollection&&e.postPerformanceEvent(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(e){for(const t of this._markers)e&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!e||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(e,t=!1){const n=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&n(0);if((t||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){const t=this.transform.averageElevation;let i=this.transform.sampleAverageElevation(),r=!1;this.transform.elevation&&(r=this.transform.elevation.exaggeration()!==this._averageElevationExaggeration,this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(i)?i=0:this._averageElevationLastSampledAt=e;const o=Math.abs(t-i);if(o>1){if(this._isInitialLoad||r)return this._averageElevation.jumpTo(i),n(i);this._averageElevation.easeTo(i,e,300)}else if(o>1e-4)return this._averageElevation.jumpTo(i),n(i)}return!!this._averageElevation.isEasing(e)&&n(this._averageElevation.getValue(e))}_authenticate(){e.getMapSessionAPI(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(t=>
vendor: 9,340 bytes, line 2
2{if(t&&(t.message===e.AUTH_ERR_MSG||401===t.status)){const t=this.painter.context.gl;e.storeAuthState(t,!1),this._logoControl instanceof Yr&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.ErrorEvent(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}})),e.postMapLoadEvent(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}))}_updateTerrain(){const e=this._isDragging();this.painter.updateTerrain(this.style,e)}_calculateSpeedIndex(){const e=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const n=this.painter.context.gl,i=n.createFramebuffer();function r(e){n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,e,0);const t=new Uint8Array(n.drawingBufferWidth*n.drawingBufferHeight*4);return n.readPixels(0,0,n.drawingBufferWidth,n.drawingBufferHeight,n.RGBA,n.UNSIGNED_BYTE,t),t}return n.bindFramebuffer(n.FRAMEBUFFER,i),this._canvasPixelComparison(r(e),t.canvasCopies.map(r),t.timeStamps)}_canvasPixelComparison(e,t,n){let i=n[1]-n[0];const r=e.length/4;for(let o=0;o<t.length;o++){const a=t[o];let s=0;for(let t=0;t<a.length;t+=4)a[t]===e[t]&&a[t+1]===e[t+1]&&a[t+2]===e[t+2]&&a[t+3]===e[t+3]&&(s+=1);i+=(n[o+2]-n[o+1])*(1-s/r)}return i}remove(){this._hash&&this._hash.remove();for(const e of this._controls)e.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this._domRenderTaskQueue.clear(),this.style&&this.style.destroy(),this.painter.destroy(),this.handlers&&this.handlers.destroy(),this.handlers=void 0,this.setStyle(null),void 0!==e.window&&(e.window.removeEventListener("resize",this._onWindowResize,!1),e.window.removeEventListener("orientationchange",this._onWindowResize,!1),e.window.removeEventListener("webkitfullscreenchange",this._onWindowResize,!1),e.window.removeEventListener("online",this._onWindowOnline,!1),e.window.removeEventListener("visibilitychange",this._onVisibilityChange,!1));const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._missingCSSCanary.remove(),this._canvas=void 0,this._canvasContainer=void 0,this._controlContainer=void 0,this._missingCSSCanary=void 0,this._container.classList.remove("mapboxgl-map"),this._container.removeEventListener("scroll",this._onMapScroll,!1),e.removeAuthState(this.painter.context.gl),this._removed=!0,this.fire(new e.Event("remove"))}triggerRepaint(){this._triggerFrame(!0)}_triggerFrame(t){this._renderNextFrame=this._renderNextFrame||t,this.style&&!this._frame&&(this._frame=e.exported.frame((e=>{const t=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,t&&this._render(e)})))}_preloadTiles(t){const n=this.style?Object.values(this.style._sourceCaches):[];return e.asyncAll(n,((e,n)=>e._preloadTiles(t,n)),(()=>{this.triggerRepaint()})),this}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}_onVisibilityChange(){"hidden"===e.window.document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(e){this._speedIndexTiming!==e&&(this._speedIndexTiming=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(e){this._showTileAABBs!==e&&(this._showTileAABBs=e,e&&this._update())}_setCacheLimits(t,n){e.setCacheLimits(t,n)}get version(){return e.version}},NavigationControl:class{constructor(t){this.options=e.extend({},so,t),this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(e.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(e=>{this._map&&this._map.zoomIn({},{originalEvent:e})})),o("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(e=>{this._map&&this._map.zoomOut({},{originalEvent:e})})),o("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(e=>{const t=this._map;t&&(this.options.visualizePitch?t.resetNorthPitch({},{originalEvent:e}):t.resetNorth({},{originalEvent:e}))})),this._compassIcon=o("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const e=this._map;if(!e)return;const t=e.getZoom(),n=t===e.getMaxZoom(),i=t===e.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())}_rotateCompassArrow(){const e=this._map;if(!e)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(e.transform.pitch*(Math.PI/180)),.5)}) rotateX(${e.transform.pitch}deg) rotateZ(${e.transform.angle*(180/Math.PI)}deg)`:`rotate(${e.transform.angle*(180/Math.PI)}deg)`;e._requestDomTask((()=>{this._compassIcon&&(this._compassIcon.style.transform=t)}))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),e.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&e.on("pitch",this._rotateCompassArrow),e.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new lo(e,this._compass,this.options.visualizePitch)),this._container}onRemove(){const e=this._map;e&&(this._container.remove(),this.options.showZoom&&e.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&e.off("pitch",this._rotateCompassArrow),e.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(e,t){const n=o("button",e,this._container);return n.type="button",n.addEventListener("click",t),n}_setButtonTitle(e,t){if(!this._map)return;const n=this._map._getUIString(`NavigationControl.${t}`);e.setAttribute("aria-label",n),e.firstElementChild&&e.firstElementChild.setAttribute("title",n)}},GeolocateControl:class extends e.Evented{constructor(t){super(),this.options=e.extend({geolocation:e.window.navigator.geolocation},co,t),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Yi(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(e){return this._map=e,this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(t){const n=(e=!!this.options.geolocation)=>{this._supportsGeolocation=e,t(e)};void 0!==this._supportsGeolocation?t(this._supportsGeolocation):void 0!==e.window.navigator.permissions?e.window.navigator.permissions.query({name:"geolocation"}).then((e=>n("denied"!==e.state))).catch((()=>n())):n()}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),n=e.coords;return!!t&&(n.longitude<t.getWest()||n.longitude>t.getEast()||n.latitude<t.getSouth()||n.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
2RROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}}_updateCamera(t){const n=new e.LngLat(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,r=this._map.getBearing(),o=e.extend({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(n.toBounds(i),o,{geolocateSource:!0})}_updateMarker(t){if(t){const n=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map.transform,n=e.mercatorZfromAltitude(1,t._center.lat)*t.worldSize,i=Math.ceil(2*this._accuracy*n);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._dotElement.classList.add("mapboxgl-user-location-show-heading")):(this._dotElement.classList.remove("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(t){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=o("button","mapboxgl-ctrl-geolocate",this._container),o("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
2se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o("div","mapboxgl-user-location"),this._dotElement.appendChild(o("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(o("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new eo({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=o("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new eo({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new e.Event("trackuserlocationend")))}))}}_onDeviceOrientation(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(e={maximumAge:6e5,timeout:0},this._noTimeout=!0):(e=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,e),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const t=()=>{e.window.addEventListener("ondeviceorientationabsolute"in e.window?"deviceorientationabsolute":"deviceorientation",this._onDeviceOrientation)};void 0!==e.window.DeviceMotionEvent&&"function"==typeof e.window.DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((e=>{"granted"===e&&t()})).catch(console.error):t()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),e.window.removeEventListener("deviceorientation",this._onDeviceOrientation),e.window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
2se"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Hr,ScaleControl:class{constructor(t){this.options=e.extend({},uo,t),function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"narrow",unit:"meter"}),!0}catch(e){return!1}}()||(this._setScale=ho.bind(this)),e.bindAll(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const e=this.options.maxWidth||100,t=this._map,n=t._containerHeight/2,i=t._containerWidth/2-e/2,r=t.unproject([i,n]),o=t.unproject([i+e,n]),a=r.distanceTo(o);if("imperial"===this.options.unit){const t=3.2808*a;t>5280?this._setScale(e,t/5280,"mile"):this._setScale(e,t,"foot")}else"nautical"===this.options.unit?this._setScale(e,a/1852,"nautical-mile"):a>=1e3?this._setScale(e,a/1e3,"kilometer"):this._setScale(e,a,"meter")}_setScale(e,t,n){const i=fo(t),r=i/t;this._map._requestDomTask((()=>{this._container.style.width=e*r+"px",this._container.innerHTML="nautical-mile"!==n?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"narrow",unit:n}).format(i):`${i}&nbsp;nm`}))}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=o("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(e){this._language=e,this._update()}setUnit(e){this.options.unit=e,this._update()}},FullscreenControl:class{constructor(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.
vendor: 8,860 bytes, line 2
2window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in e.window.document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=o("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!e.window.document.fullscreenEnabled&&!e.window.document.webkitFullscreenEnabled)}_setupUI(){const t=this._fullscreenButton=o("button","mapboxgl-ctrl-fullscreen",this._controlContainer);o("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(e.window.document.fullscreenElement||e.window.document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends e.Evented{constructor(t){super(),this.options=e.extend(Object.create(to),t),e.bindAll(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(t&&t.className?t.className.trim().split(/\s+/):[])}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new e.Event("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new e.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update();const n=this._map;return n&&(n.on("move",this._update),n.off("mousemove",this._onMouseEvent),n._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(e.window.document.createTextNode(t))}setHTML(t){const n=e.window.document.createDocumentFragment(),i=e.window.document.createElement("body");let r;for(i.innerHTML=t;r=i.firstChild,r;)n.appendChild(r);return this.setDOMContent(n)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=o("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){const e=this._closeButton=o("button","mapboxgl-popup-close-button",t);e.type="button",e.setAttribute("aria-label","Close popup"),e.setAttribute("aria-hidden","true"),e.innerHTML="&#215;",e.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(e){return this._classList.add(e),this._updateClassList(),this}removeClassName(e){return this._classList.delete(e),this._updateClassList(),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){let t;return this._classList.delete(e)?t=!1:(this._classList.add(e),t=!0),this._updateClassList(),t}_onMouseEvent(e){this._update(e.point)}_getAnchor(e){if(this.options.anchor)return this.options.anchor;const t=this._map,n=this._container,i=this._pos;if(!t||!n||!i)return"bottom";const r=n.offsetWidth,o=n.offsetHeight,a=i.x<r/2,s=i.x>t.transform.width-r/2;if(i.y+e<o)return a?"top-left":s?"top-right":"top";if(i.y>t.transform.height-o){if(a)return"bottom-left";if(s)return"bottom-right"}return a?"left":s?"right":"bottom"}_updateClassList(){const e=this._container;if(!e)return;const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),e.className=t.join(" ")}_update(t){const n=this._map,i=this._content;if(!n||!this._lngLat&&!this._trackPointer||!i)return;let r=this._container;if(r||(r=this._container=o("div","mapboxgl-popup",n.getContainer()),this._tip=o("div","mapboxgl-popup-tip",r),r.appendChild(i)),this.options.maxWidth&&r.style.maxWidth!==this.options.maxWidth&&(r.style.maxWidth=this.options.maxWidth),n.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Jr(this._lngLat,this._pos,n.transform)),!this._trackPointer||t){const e=this._pos=this._trackPointer&&t?t:n.project(this._lngLat),i=io(this.options.offset),r=this._anchor=this._getAnchor(i.y),o=io(this.options.offset,r),a=e.add(o).round();n._requestDomTask((()=>{this._container&&r&&(this._container.style.transform=`${Qr[r]} translate(${a.x}px,${a.y}px)`)}))}if(!this._marker&&n._showingGlobe()){const t=e.isLngLatBehindGlobe(n.transform,this._lngLat)?0:1;this._setOpacity(t)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(no);e&&e.focus()}_onClose(){this.remove()}_setOpacity(e){this._container&&(this._container.style.opacity=`${e}`),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}},Marker:eo,Style:Jt,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.pointGeometry,MercatorCoordinate:e.MercatorCoordinate,FreeCameraOptions:Ui,Evented:e.Evented,config:e.config,prewarm:function(){Ue().acquire(Fe)},clearPrewarmedResources:function(){const e=je;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(Fe),je=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return Ne.workerCount},set workerCount(e){Ne.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(t){e.clearTileCache(t)},workerUrl:"",workerClass:null,setNow:e.exported.setNow,restoreNow:e.exported.restoreNow};return po})),n}()},813:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function r(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;
vendor: 4,942 bytes, line 2
2if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var a,s,l=r(e),c=1;c<arguments.length;c++){for(var u in a=Object(arguments[c]))n.call(a,u)&&(l[u]=a[u]);if(t){s=t(a);for(var h=0;h<s.length;h++)i.call(a,s[h])&&(l[s[h]]=a[s[h]])}}return l}},799:(e,t,n)=>{"use strict";var i=n(526),r=n(813),o=n(851);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!i)throw Error(a(227));var s=new Set,l={};function c(e,t){u(e,t),u(e+"Capture",t)}function u(e,t){for(l[e]=t,e=0;e<t.length;e++)s.add(t[e])}var h=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f=Object.prototype.hasOwnProperty,p={},m={};function g(e,t,n,i,r,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){_[e]=new g(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){_[e]=new g(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){_[e]=new g(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){_[e]=new g(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){_[e]=new g(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function v(e){return e[1].toUpperCase()}function x(e,t,n,i){var r=_.hasOwnProperty(t)?_[t]:null;(null!==r?0===r.type:!i&&2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1]))||(function(e,t,n,i){if(null==t||function(e,t,n,i){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!i&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,i))return!0;if(i)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,r,i)&&(n=null),i||null===r?function(e){return!!f.call(m,e)||!f.call(p,e)&&(d.test(e)?m[e]=!0:(p[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=null===n?3!==r.type&&"":n:(t=r.attributeName,i=r.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(r=r.type)||4===r&&!0===n?"":""+n,i?e.setAttributeNS(i,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode
2-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,v);_[t]=new g(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,v);_[t]=new g(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,v);_[t]=new g(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)})),_.xlinkHref=new g("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)}));var b=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=60103,E=60106,T=60107,S=60108,A=60114,C=60109,k=60110,M=60112,I=60113,P=60120,D=60115,z=60116,L=60121,O=60128,R=60129,B=60130,F=60131;if("function"==typeof Symbol&&Symbol.for){var N=Symbol.for;w=N("react.element"),E=N("react.portal"),T=N("react.fragment"),S=N("react.strict_mode"),A=N("react.profiler"),C=N("react.provider"),k=N("react.context"),M=N("react.forward_ref"),I=N("react.suspense"),P=N("react.suspense_list"),D=N("react.memo"),z=N("react.lazy"),L=N("react.block"),N("react.scope"),O=N("react.opaque.id"),R=N("react.debug_trace_mode"),B=N("react.offscreen"),F=N("react.legacy_hidden")}var j,U="function"==typeof Symbol&&Symbol.iterator;function V(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=U&&e[U]||e["@@iterator"])?e:null}function G(e){if(void 0===j)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);j=t&&t[1]||""}return"\n"+j+e}var q=!1;function $(e,t){if(!e||q)return"";q=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var i=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){i=e}e.call(t.prototype)}else{try{throw Error()}catch(e){i=e}e()}}catch(e){if(e&&i&&"string"==typeof e.stack){for(var r=e.stack.split("\n"),o=i.stack.split("\n"),a=r.length-1,s=o.length-1;1<=a&&0<=s&&r[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(r[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||r[a]!==o[s])return"\n"+r[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{q=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?G(e):""}function W(e){switch(e.tag){case 5:return G(e.type);case 16:return G("Lazy");case 13:return G("Suspense");case 19:return G("SuspenseList");case 0:case 2:case 15:return $(e.type,!1);case 11:return $(e.type.render,!1);case 22:return $(e.type._render,!1);case 1:return $(e.type,!0);default:return""}}function Z(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case T:return"Fragment";case E:return"Portal";case A:return"Profiler";case S:return"StrictMode";case I:return"Suspense";case P:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case k:return(e.displayName||"Context")+".Consumer";case C:return(e._context.displayName||"Context")+".Provider";case M:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case D:return Z(e.type);case L:return Z(e._render);case z:t=e._payload,e=e._init;try{return Z(e(t))}catch(e){}}return null}function X(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function H(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Y(e){e._valueTracker||(e._valueTracker=function(e){var t=H(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var r=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){i=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(e){i=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function K(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=H(e)?e.checked?"true":"false":e.value),(e=i)!==n&&(t.setValue(e),!0)}function J(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Q(e,t){var n=t.checked;return r({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function ee(e,t){var n=null==t.defaultValue?"":t.defaultValue,i=null!=t.checked?t.checked:t.defaultChecked;n=X(null!=t.value?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function te(e,t){null!=(t=t.checked)&&x(e,"checked",t,!1)}function ne(e,t){te(e,t);var n=X(t.value),i=t.type;if(null!=n)"number"===i?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===i||"reset"===i)return void e.removeAttribute("value");t.hasOwnProperty("value")?re(e,t.type,n):t.hasOwnProperty("defaultValue")&&re(e,t.type,X(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function ie(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!("submit"!==i&&"reset"!==i||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function re(e,t,n){"number"===t&&J(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function oe(e,t){return e=r({children:void 0},t),(t=function(e){var t="";
vendor: 4,105 bytes, line 2
2return i.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function ae(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+X(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(i&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function se(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(a(91));return r({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function le(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(a(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(a(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:X(n)}}function ce(e,t){var n=X(t.value),i=X(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=i&&(e.defaultValue=""+i)}function ue(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var he="http://www.w3.org/1999/xhtml";function de(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function fe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?de(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var pe,me,ge=(me=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((pe=pe||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=pe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,i){MSApp.execUnsafeLocalFunction((function(){return me(e,t)}))}:me);function _e(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ye={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ve=["Webkit","ms","Moz","O"];function xe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ye.hasOwnProperty(e)&&ye[e]?(""+t).trim():t+"px"}function be(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var i=0===n.indexOf("--"),r=xe(n,t[n],i);"float"===n&&(n="cssFloat"),i?e.setProperty(n,r):e[n]=r}}Object.keys(ye).forEach((function(e){ve.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ye[t]=ye[e]}))}));var we=r({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ee(e,t){if(t){if(we[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(a(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(a(62))}}function Te(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Se(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.n
vendor: 8,471 bytes, line 2
2odeType?e.parentNode:e}var Ae=null,Ce=null,ke=null;function Me(e){if(e=nr(e)){if("function"!=typeof Ae)throw Error(a(280));var t=e.stateNode;t&&(t=rr(t),Ae(e.stateNode,e.type,t))}}function Ie(e){Ce?ke?ke.push(e):ke=[e]:Ce=e}function Pe(){if(Ce){var e=Ce,t=ke;if(ke=Ce=null,Me(e),t)for(e=0;e<t.length;e++)Me(t[e])}}function De(e,t){return e(t)}function ze(e,t,n,i,r){return e(t,n,i,r)}function Le(){}var Oe=De,Re=!1,Be=!1;function Fe(){null===Ce&&null===ke||(Le(),Pe())}function Ne(e,t){var n=e.stateNode;if(null===n)return null;var i=rr(n);if(null===i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(a(231,t,typeof n));return n}var je=!1;if(h)try{var Ue={};Object.defineProperty(Ue,"passive",{get:function(){je=!0}}),window.addEventListener("test",Ue,Ue),window.removeEventListener("test",Ue,Ue)}catch(me){je=!1}function Ve(e,t,n,i,r,o,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var Ge=!1,qe=null,$e=!1,We=null,Ze={onError:function(e){Ge=!0,qe=e}};function Xe(e,t,n,i,r,o,a,s,l){Ge=!1,qe=null,Ve.apply(Ze,arguments)}function He(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Ye(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function Ke(e){if(He(e)!==e)throw Error(a(188))}function Je(e){if(e=function(e){var t=e.alternate;if(!t){if(null===(t=He(e)))throw Error(a(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(null===r)break;var o=r.alternate;if(null===o){if(null!==(i=r.return)){n=i;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===n)return Ke(r),e;if(o===i)return Ke(r),t;o=o.sibling}throw Error(a(188))}if(n.return!==i.return)n=r,i=o;else{for(var s=!1,l=r.child;l;){if(l===n){s=!0,n=r,i=o;break}if(l===i){s=!0,i=r,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,i=r;break}if(l===i){s=!0,i=o,n=r;break}l=l.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==i)throw Error(a(190))}if(3!==n.tag)throw Error(a(188));return n.stateNode.current===n?e:t}(e),!e)return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Qe(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var et,tt,nt,it,rt=!1,ot=[],at=null,st=null,lt=null,ct=new Map,ut=new Map,ht=[],dt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ft(e,t,n,i,r){return{blockedOn:e,domEventName:t,eventSystemFlags:16|n,nativeEvent:r,targetContainers:[i]}}function pt(e,t){switch(e){case"focusin":case"focusout":at=null;break;case"dragenter":case"dragleave":st=null;break;case"mouseover":case"mouseout":lt=null;break;case"pointerover":case"pointerout":ct.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ut.delete(t.pointerId)}}function mt(e,t,n,i,r,o){return null===e||e.nativeEvent!==o?(e=ft(t,n,i,r,o),null!==t&&null!==(t=nr(t))&&tt(t),e):(e.eventSystemFlags|=i,t=e.targetContainers,null!==r&&-1===t.indexOf(r)&&t.push(r),e)}function gt(e){var t=tr(e.target);if(null!==t){var n=He(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Ye(n)))return e.blockedOn=t,void it(e.lanePriority,(function(){o.unstable_runWithPriority(e.priority,(function(){nt(n)}))}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function _t(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=nr(n))&&tt(t),e.blockedOn=n,!1;t.shift()}return!0}function yt(e,t,n){_t(e)&&n.delete(t)}function vt(){for(rt=!1;0<ot.length;){var e=ot[0];if(null!==e.blockedOn){null!==(e=nr(e.blockedOn))&&et(e);break}for(var t=e.targetContainers;0<t.length;){var n=Jt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n){e.blockedOn=n;break}t.shift()}null===e.blockedOn&&ot.shift()}null!==at&&_t(at)&&(at=null),null!==st&&_t(st)&&(st=null),null!==lt&&_t(lt)&&(lt=null),ct.forEach(yt),ut.forEach(yt)}function xt(e,t){e.blockedOn===t&&(e.blockedOn=null,rt||(rt=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,vt)))}function bt(e){function t(t){return xt(t,e)}if(0<ot.length){xt(ot[0],e);for(var n=1;n<ot.length;n++){var i=ot[n];i.blockedOn===e&&(i.blockedOn=null)}}for(null!==at&&xt(at,e),null!==st&&xt(st,e),null!==lt&&xt(lt,e),ct.forEach(t),ut.forEach(t),n=0;n<ht.length;n++)(i=ht[n]).blockedOn===e&&(i.blockedOn=null);for(;0<ht.length&&null===(n=ht[0]).blockedOn;)gt(n),null===n.blockedOn&&ht.shift()}function wt(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Et={animationend:wt("Animation","AnimationEnd"),animationiteration:wt("Animation","AnimationIteration"),animationstart:wt("Animation","AnimationStart"),transitionend:wt("Transition","TransitionEnd")},Tt={},St={};function At(e){if(Tt[e])return Tt[e];if(!Et[e])return e;var t,n=Et[e];for(t in n)if(n.hasOwnProperty(t)&&t in St)return Tt[e]=n[t];return e}h&&(St=document.createElement("div").style,"AnimationEvent"in window||(delete Et.animationend.animation,delete Et.animationiteration.animation,delete Et.animationstart.animation),"TransitionEvent"in window||delete Et.transitionend.transition);var Ct=At("animationend"),kt=At("animationiteration"),Mt=At("animationstart"),It=At("transitionend"),Pt=new Map,Dt=new Map,zt=["abort","abort",Ct,"animationEnd",kt,"animationIteration",Mt,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",It,"transitionEnd","waiting","waiting"];function Lt(e,t){for(var n=0;n<e.length;n+=2){var i=e[n],r=e[n+1];r="on"+(r[0].toUpperCase()+r.slice(1)),Dt.set(i,t),Pt.set(i,r),c(r,[i])}}(0,o.unstable_now)();var Ot=8;function Rt(e){if(0!=(1&e))return Ot=15,1;if(0!=(2&e))return Ot=14,2;if(0!=(4&e))return Ot=13,4;var t=24&e;return 0!==t?(Ot=12,t):0!=(32&e)?(Ot=11,32):0!=(t=192&e)?(Ot=10,t):0!=(256&e)?(Ot=9,256):0!=(t=3584&e)?(Ot=8,t):0!=(4096&e)?(Ot=7,4096):0!=(t=4186112&e)?(Ot=6,t):0!=(t=62914560&e)?(Ot=5,t):67108864&e?(Ot=4,67108864):0!=(134217728&e)?(Ot=3,134217728):0!=(t=805306368&e)?(Ot=2,t):0!=(1073741824&e)?(Ot=1,1073741824):(Ot=8,e)}function Bt(e,t){var n=e.pendingLanes;if(0===n)return Ot=0;var i=0,r=0,o=e.expiredLanes,a=e.suspendedLanes,s=e.pingedLanes;if(0!==o)i=o,r=Ot=15;else if(0!=(o=134217727&n)){var l=o&~a;0!==l?(i=Rt(l),r=Ot):0!=(s&=o)&&(i=Rt(s),r=Ot)}else 0!=(o=n&~a)?(i=Rt(o),r=Ot):0!==s&&(i=Rt(s),r=Ot);if(0===i)return 0;if(i=n&((0>(i=31-Gt(i))?0:1<<i)<<1)-1,0!==t&&t!==i&&0==(t&a)){if(Rt(t),r<=Ot)return t;Ot=r}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=i;0<t;)r=1<<(n=31-Gt(t)),i|=e[n],t&=~r;return i}function Ft(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Nt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=jt(24&~t))?Nt(10,t):e;case 10:return 0===(e=jt(192&~t))?Nt(8,t):e;case 8:return 0===(e=jt(3584&~t))&&0===(e=jt(4186112&~t))&&(e=512),e;case 2:return 0===(t=jt(805306368&~t))&&(t=268435456),t}throw Error(a(358,e))}function jt(e){return e&-e}function Ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Vt(e,t,n){e.pendingLanes|=t;var i=t-1;e.suspendedLanes&=i,e.pingedLanes&=i,(e=e.eventTimes)[t=31-Gt(t)]=n}
vendor: 4,198 bytes, line 2
2var Gt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(qt(e)/$t|0)|0},qt=Math.log,$t=Math.LN2,Wt=o.unstable_UserBlockingPriority,Zt=o.unstable_runWithPriority,Xt=!0;function Ht(e,t,n,i){Re||Le();var r=Kt,o=Re;Re=!0;try{ze(r,e,t,n,i)}finally{(Re=o)||Fe()}}function Yt(e,t,n,i){Zt(Wt,Kt.bind(null,e,t,n,i))}function Kt(e,t,n,i){var r;if(Xt)if((r=0==(4&t))&&0<ot.length&&-1<dt.indexOf(e))e=ft(null,e,t,n,i),ot.push(e);else{var o=Jt(e,t,n,i);if(null===o)r&&pt(e,i);else{if(r){if(-1<dt.indexOf(e))return e=ft(o,e,t,n,i),void ot.push(e);if(function(e,t,n,i,r){switch(t){case"focusin":return at=mt(at,e,t,n,i,r),!0;case"dragenter":return st=mt(st,e,t,n,i,r),!0;case"mouseover":return lt=mt(lt,e,t,n,i,r),!0;case"pointerover":var o=r.pointerId;return ct.set(o,mt(ct.get(o)||null,e,t,n,i,r)),!0;case"gotpointercapture":return o=r.pointerId,ut.set(o,mt(ut.get(o)||null,e,t,n,i,r)),!0}return!1}(o,e,t,n,i))return;pt(e,i)}Li(e,t,i,null,n)}}}function Jt(e,t,n,i){var r=Se(i);if(null!==(r=tr(r))){var o=He(r);if(null===o)r=null;else{var a=o.tag;if(13===a){if(null!==(r=Ye(o)))return r;r=null}else if(3===a){if(o.stateNode.hydrate)return 3===o.tag?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return Li(e,t,i,r,n),null}var Qt=null,en=null,tn=null;function nn(){if(tn)return tn;var e,t,n=en,i=n.length,r="value"in Qt?Qt.value:Qt.textContent,o=r.length;for(e=0;e<i&&n[e]===r[e];e++);var a=i-e;for(t=1;t<=a&&n[i-t]===r[o-t];t++);return tn=r.slice(e,1<t?1-t:void 0)}function rn(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function on(){return!0}function an(){return!1}function sn(e){function t(t,n,i,r,o){for(var a in this._reactName=t,this._targetInst=i,this.type=n,this.nativeEvent=r,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(r):r[a]);return this.isDefaultPrevented=(null!=r.defaultPrevented?r.defaultPrevented:!1===r.returnValue)?on:an,this.isPropagationStopped=an,this}return r(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=on)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=on)},persist:function(){},isPersistent:on}),t}var ln,cn,un,hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dn=sn(hn),fn=r({},hn,{view:0,detail:0}),pn=sn(fn),mn=r({},fn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==un&&(un&&"mousemove"===e.type?(ln=e.screenX-un.screenX,cn=e.screenY-un.screenY):cn=ln=0,un=e),ln)},movementY:function(e){return"movementY"in e?e.movementY:cn}}),gn=sn(mn),_n=sn(r({},mn,{dataTransfer:0})),yn=sn(r({},fn,{relatedTarget:0})),vn=sn(r({},hn,{animationName:0,elapsedTime:0,pseudoElement:0})),xn=r({},hn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bn=sn(xn),wn=sn(r({},hn,{data:0})),En={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Tn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function An(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Sn[e])&&!!t[e]}function Cn(){return An}
vendor: 24,043 bytes, line 2
2var kn=r({},fn,{key:function(e){if(e.key){var t=En[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=rn(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Tn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cn,charCode:function(e){return"keypress"===e.type?rn(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?rn(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Mn=sn(kn),In=sn(r({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Pn=sn(r({},fn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cn})),Dn=sn(r({},hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=r({},mn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ln=sn(zn),On=[9,13,27,32],Rn=h&&"CompositionEvent"in window,Bn=null;h&&"documentMode"in document&&(Bn=document.documentMode);var Fn=h&&"TextEvent"in window&&!Bn,Nn=h&&(!Rn||Bn&&8<Bn&&11>=Bn),jn=String.fromCharCode(32),Un=!1;function Vn(e,t){switch(e){case"keyup":return-1!==On.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var qn=!1,$n={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Wn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!$n[e.type]:"textarea"===t}function Zn(e,t,n,i){Ie(i),0<(t=Ri(t,"onChange")).length&&(n=new dn("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Xn=null,Hn=null;function Yn(e){ki(e,0)}function Kn(e){if(K(ir(e)))return e}function Jn(e,t){if("change"===e)return t}var Qn=!1;if(h){var ei;if(h){var ti="oninput"in document;if(!ti){var ni=document.createElement("div");ni.setAttribute("oninput","return;"),ti="function"==typeof ni.oninput}ei=ti}else ei=!1;Qn=ei&&(!document.documentMode||9<document.documentMode)}function ii(){Xn&&(Xn.detachEvent("onpropertychange",ri),Hn=Xn=null)}function ri(e){if("value"===e.propertyName&&Kn(Hn)){var t=[];if(Zn(t,Hn,e,Se(e)),e=Yn,Re)e(t);else{Re=!0;try{De(e,t)}finally{Re=!1,Fe()}}}}function oi(e,t,n){"focusin"===e?(ii(),Hn=n,(Xn=t).attachEvent("onpropertychange",ri)):"focusout"===e&&ii()}function ai(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Kn(Hn)}function si(e,t){if("click"===e)return Kn(t)}function li(e,t){if("input"===e||"change"===e)return Kn(t)}var ci="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},ui=Object.prototype.hasOwnProperty;function hi(e,t){if(ci(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++)if(!ui.call(t,n[i])||!ci(e[n[i]],t[n[i]]))return!1;return!0}function di(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fi(e,t){var n,i=di(e);for(e=0;i;){if(3===i.nodeType){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=di(i)}}function pi(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?pi(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function mi(){for(var e=window,t=J();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=J((e=t.contentWindow).document)}return t}function gi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var _i=h&&"documentMode"in document&&11>=document.documentMode,yi=null,vi=null,xi=null,bi=!1;function wi(e,t,n){var i=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;bi||null==yi||yi!==J(i)||(i="selectionStart"in(i=yi)&&gi(i)?{start:i.selectionStart,end:i.selectionEnd}:{anchorNode:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset},xi&&hi(xi,i)||(xi=i,0<(i=Ri(vi,"onSelect")).length&&(t=new dn("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=yi)))}Lt("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Lt("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Lt(zt,2);for(var Ei="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Ti=0;Ti<Ei.length;Ti++)Dt.set(Ei[Ti],0);u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Si="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ai=new Set("cancel close invalid load scroll toggle".split(" ").concat(Si));function Ci(e,t,n){var i=e.type||"unknown-event";e.currentTarget=n,function(e,t,n,i,r,o,s,l,c){if(Xe.apply(this,arguments),Ge){if(!Ge)throw Error(a(198));var u=qe;Ge=!1,qe=null,$e||($e=!0,We=u)}}(i,t,void 0,e),e.currentTarget=null}function ki(e,t){t=0!=(4&t);for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var o=void 0;if(t)for(var a=i.length-1;0<=a;a--){var s=i[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&r.isPropagationStopped())break e;Ci(r,s,c),o=l}else for(a=0;a<i.length;a++){if(l=(s=i[a]).instance,c=s.currentTarget,s=s.listener,l!==o&&r.isPropagationStopped())break e;Ci(r,s,c),o=l}}}if($e)throw e=We,$e=!1,We=null,e}function Mi(e,t){var n=or(t),i=e+"__bubble";n.has(i)||(zi(t,e,2,!1),n.add(i))}var Ii="_reactListening"+Math.random().toString(36).slice(2);function Pi(e){e[Ii]||(e[Ii]=!0,s.forEach((function(t){Ai.has(t)||Di(t,!1,e,null),Di(t,!0,e,null)})))}function Di(e,t,n,i){var r=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,o=n;if("selectionchange"===e&&9!==n.nodeType&&(o=n.ownerDocument),null!==i&&!t&&Ai.has(e)){if("scroll"!==e)return;r|=2,o=i}var a=or(o),s=e+"__"+(t?"capture":"bubble");a.has(s)||(t&&(r|=4),zi(o,e,r,t),a.add(s))}function zi(e,t,n,i){var r=Dt.get(t);switch(void 0===r?2:r){case 0:r=Ht;break;case 1:r=Yt;break;default:r=Kt}n=r.bind(null,t,n,e),r=void 0,!je||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(r=!0),i?void 0!==r?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):void 0!==r?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Li(e,t,n,i,r){var o=i;if(0==(1&t)&&0==(2&t)&&null!==i)e:for(;;){if(null===i)return;var a=i.tag;if(3===a||4===a){var s=i.stateNode.containerInfo;if(s===r||8===s.nodeType&&s.parentNode===r)break;if(4===a)for(a=i.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===r||8===l.nodeType&&l.parentNode===r))return;a=a.return}for(;null!==s;){if(null===(a=tr(s)))return;if(5===(l=a.tag)||6===l){i=o=a;continue e}s=s.parentNode}}i=i.return}!function(e,t,n){if(Be)return e();Be=!0;try{Oe(e,t,n)}finally{Be=!1,Fe()}}((function(){var i=o,r=Se(n),a=[];e:{var s=Pt.get(e);if(void 0!==s){var l=dn,c=e;switch(e){case"keypress":if(0===rn(n))break e;case"keydown":case"keyup":l=Mn;break;case"focusin":c="focus",l=yn;break;case"focusout":c="blur",l=yn;break;case"beforeblur":case"afterblur":l=yn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=gn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=_n;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=Pn;break;case Ct:case kt:case Mt:l=vn;break;case It:l=Dn;break;case"scroll":l=pn;break;case"wheel":l=Ln;break;case"copy":case"cut":case"paste":l=bn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=In}var u=0!=(4&t),h=!u&&"scroll"===e,d=u?null!==s?s+"Capture":null:s;u=[];for(var f,p=i;null!==p;){var m=(f=p).stateNode;if(5===f.tag&&null!==m&&(f=m,null!==d&&null!=(m=Ne(p,d))&&u.push(Oi(p,m,f))),h)break;p=p.return}0<u.length&&(s=new l(s,c,null,n,r),a.push({event:s,listeners:u}))}}if(0==(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||0!=(16&t)||!(c=n.relatedTarget||n.fromElement)||!tr(c)&&!c[Qi])&&(l||s)&&(s=r.window===r?r:(s=r.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=i,null!==(c=(c=n.relatedTarget||n.toElement)?tr(c):null)&&(c!==(h=He(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=i),l!==c)){if(u=gn,m="onMouseLeave",d="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(u=In,m="onPointerLeave",d="onPointerEnter",p="pointer"),h=null==l?s:ir(l),f=null==c?s:ir(c),(s=new u(m,p+"leave",l,n,r)).target=h,s.relatedTarget=f,m=null,tr(r)===i&&((u=new u(d,p+"enter",c,n,r)).target=f,u.relatedTarget=h,m=u),h=m,l&&c)e:{for(d=c,p=0,f=u=l;f;f=Bi(f))p++;for(f=0,m=d;m;m=Bi(m))f++;for(;0<p-f;)u=Bi(u),p--;for(;0<f-p;)d=Bi(d),f--;for(;p--;){if(u===d||null!==d&&u===d.alternate)break e;u=Bi(u),d=Bi(d)}u=null}else u=null;null!==l&&Fi(a,s,l,u,!1),null!==c&&null!==h&&Fi(a,h,c,u,!0)}if("select"===(l=(s=i?ir(i):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Jn;else if(Wn(s))if(Qn)g=li;else{g=ai;var _=oi}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=si);switch(g&&(g=g(e,i))?Zn(a,g,n,r):(_&&_(e,s,i),"focusout"===e&&(_=s._wrapperState)&&_.controlled&&"number"===s.type&&re(s,"number",s.value)),_=i?ir(i):window,e){case"focusin":(Wn(_)||"true"===_.contentEditable)&&(yi=_,vi=i,xi=null);break;case"focusout":xi=vi=yi=null;break;case"mousedown":bi=!0;break;case"contextmenu":case"mouseup":case"dragend":bi=!1,wi(a,n,r);break;case"selectionchange":if(_i)break;case"keydown":case"keyup":wi(a,n,r)}var y;if(Rn)e:{switch(e){case"compositionstart":var v="onCompositionStart";break e;case"compositionend":v="onCompositionEnd";break e;case"compositionupdate":v="onCompositionUpdate";break e}v=void 0}else qn?Vn(e,n)&&(v="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(v="onCompositionStart");v&&(Nn&&"ko"!==n.locale&&(qn||"onCompositionStart"!==v?"onCompositionEnd"===v&&qn&&(y=nn()):(en="value"in(Qt=r)?Qt.value:Qt.textContent,qn=!0)),0<(_=Ri(i,v)).length&&(v=new wn(v,e,null,n,r),a.push({event:v,listeners:_}),(y||null!==(y=Gn(n)))&&(v.data=y))),(y=Fn?function(e,t){switch(e){case"compositionend":return Gn(t);case"keypress":return 32!==t.which?null:(Un=!0,jn);case"textInput":return(e=t.data)===jn&&Un?null:e;default:return null}}(e,n):function(e,t){if(qn)return"compositionend"===e||!Rn&&Vn(e,t)?(e=nn(),tn=en=Qt=null,qn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Nn&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(i=Ri(i,"onBeforeInput")).length&&(r=new wn("onBeforeInput","beforeinput",null,n,r),a.push({event:r,listeners:i}),r.data=y)}ki(a,t)}))}function Oi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ri(e,t){for(var n=t+"Capture",i=[];null!==e;){var r=e,o=r.stateNode;5===r.tag&&null!==o&&(r=o,null!=(o=Ne(e,n))&&i.unshift(Oi(e,o,r)),null!=(o=Ne(e,t))&&i.push(Oi(e,o,r))),e=e.return}return i}function Bi(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Fi(e,t,n,i,r){for(var o=t._reactName,a=[];null!==n&&n!==i;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===i)break;5===s.tag&&null!==c&&(s=c,r?null!=(l=Ne(n,o))&&a.unshift(Oi(n,l,s)):r||null!=(l=Ne(n,o))&&a.push(Oi(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}function Ni(){}var ji=null,Ui=null;function Vi(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Gi(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var qi="function"==typeof setTimeout?setTimeout:void 0,$i="function"==typeof clearTimeout?clearTimeout:void 0;function Wi(e){(1===e.nodeType||9===e.nodeType&&null!=(e=e.body))&&(e.textContent="")}function Zi(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function Xi(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var Hi=0,Yi=Math.random().toString(36).slice(2),Ki="__reactFiber$"+Yi,Ji="__reactProps$"+Yi,Qi="__reactContainer$"+Yi,er="__reactEvents$"+Yi;function tr(e){var t=e[Ki];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Qi]||n[Ki]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=Xi(e);null!==e;){if(n=e[Ki])return n;e=Xi(e)}return t}n=(e=n).parentNode}return null}function nr(e){return!(e=e[Ki]||e[Qi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function ir(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(a(33))}function rr(e){return e[Ji]||null}function or(e){var t=e[er];return void 0===t&&(t=e[er]=new Set),t}var ar=[],sr=-1;function lr(e){return{current:e}}function cr(e){0>sr||(e.current=ar[sr],ar[sr]=null,sr--)}function ur(e,t){sr++,ar[sr]=e.current,e.current=t}var hr={},dr=lr(hr),fr=lr(!1),pr=hr;function mr(e,t){var n=e.type.contextTypes;if(!n)return hr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var r,o={};for(r in n)o[r]=t[r];return i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function gr(e){return null!=e.childContextTypes}function _r(){cr(fr),cr(dr)}function yr(e,t,n){if(dr.current!==hr)throw Error(a(168));ur(dr,t),ur(fr,n)}function vr(e,t,n){var i=e.stateNode;if(e=t.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var o in i=i.getChildContext())if(!(o in e))throw Error(a(108,Z(t)||"Unknown",o));return r({},n,i)}function xr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||hr,pr=dr.current,ur(dr,e),ur(fr,fr.current),!0}function br(e,t,n){var i=e.stateNode;if(!i)throw Error(a(169));n?(e=vr(e,t,pr),i.__reactInternalMemoizedMergedChildContext=e,cr(fr),cr(dr),ur(dr,e)):cr(fr),ur(fr,n)}var wr=null,Er=null,Tr=o.unstable_runWithPriority,Sr=o.unstable_scheduleCallback,Ar=o.unstable_cancelCallback,Cr=o.unstable_shouldYield,kr=o.unstable_requestPaint,Mr=o.unstable_now,Ir=o.unstable_getCurrentPriorityLevel,Pr=o.unstable_ImmediatePriority,Dr=o.unstable_UserBlockingPriority,zr=o.unstable_NormalPriority,Lr=o.unstable_LowPriority,Or=o.unstable_IdlePriority,Rr={},Br=void 0!==kr?kr:function(){},Fr=null,Nr=null,jr=!1,Ur=Mr(),Vr=1e4>Ur?Mr:function(){return Mr()-Ur};function Gr(){switch(Ir()){case Pr:return 99;case Dr:return 98;case zr:return 97;case Lr:return 96;case Or:return 95;default:throw Error(a(332))}}function qr(e){switch(e){case 99:return Pr;case 98:return Dr;case 97:return zr;case 96:return Lr;case 95:return Or;default:throw Error(a(332))}}function $r(e,t){return e=qr(e),Tr(e,t)}function Wr(e,t,n){return e=qr(e),Sr(e,t,n)}function Zr(){if(null!==Nr){var e=Nr;Nr=null,Ar(e)}Xr()}function Xr(){if(!jr&&null!==Fr){jr=!0;var e=0;try{var t=Fr;$r(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Fr=null}catch(t){throw null!==Fr&&(Fr=Fr.slice(e+1)),Sr(Pr,Zr),t}finally{jr=!1}}}var Hr=b.ReactCurrentBatchConfig;function Yr(e,t){if(e&&e.defaultProps){for(var n in t=r({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var Kr=lr(null),Jr=null,Qr=null,eo=null;function to(){eo=Qr=Jr=null}function no(e){var t=Kr.current;cr(Kr),e.type._context._currentValue=t}function io(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function ro(e,t){Jr=e,eo=Qr=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Ra=!0),e.firstContext=null)}function oo(e,t){if(eo!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(eo=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Qr){if(null===Jr)throw Error(a(308));Qr=t,Jr.dependencies={lanes:0,firstContext:t,responders:null}}else Qr=Qr.next=t;return e._currentValue}var ao=!1;function so(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function lo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function uo(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function ho(e,t){var n=e.updateQueue,i=e.alternate;if(null!==i&&n===(i=i.updateQueue)){var r=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?r=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?r=o=t:o=o.next=t}else r=o=t;return n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:i.shared,effects:i.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function fo(e,t,n,i){var o=e.updateQueue;ao=!1;var a=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(null!==l){o.shared.pending=null;var c=l,u=c.next;c.next=null,null===s?a=u:s.next=u,s=c;var h=e.alternate;if(null!==h){var d=(h=h.updateQueue).lastBaseUpdate;d!==s&&(null===d?h.firstBaseUpdate=u:d.next=u,h.lastBaseUpdate=c)}}if(null!==a){for(d=o.baseState,s=0,h=u=c=null;;){l=a.lane;var f=a.eventTime;if((i&l)===l){null!==h&&(h=h.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,m=a;switch(l=t,f=n,m.tag){case 1:if("function"==typeof(p=m.payload)){d=p.call(f,d,l);break e}d=p;break e;case 3:p.flags=-4097&p.flags|64;case 0:if(null==(l="function"==typeof(p=m.payload)?p.call(f,d,l):p))break e;d=r({},d,l);break e;case 2:ao=!0}}null!==a.callback&&(e.flags|=32,null===(l=o.effects)?o.effects=[a]:l.push(a))}else f={eventTime:f,lane:l,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===h?(u=h=f,c=d):h=h.next=f,s|=l;if(null===(a=a.next)){if(null===(l=o.shared.pending))break;a=l.next,l.next=null,o.lastBaseUpdate=l,o.shared.pending=null}}null===h&&(c=d),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=h,Fs|=s,e.lanes=s,e.memoizedState=d}}function po(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var i=e[t],r=i.callback;if(null!==r){if(i.callback=null,i=n,"function"!=typeof r)throw Error(a(191,r));r.call(i)}}}var mo=(new i.Component).refs;function go(e,t,n,i){n=null==(n=n(i,t=e.memoizedState))?t:r({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var _o={isMounted:function(e){return!!(e=e._reactInternals)&&He(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var i=cl(),r=ul(e),o=co(i,r);o.payload=t,null!=n&&(o.callback=n),uo(e,o),hl(e,r,i)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=cl(),r=ul(e),o=co(i,r);o.tag=1,o.payload=t,null!=n&&(o.callback=n),uo(e,o),hl(e,r,i)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=cl(),i=ul(e),r=co(n,i);r.tag=2,null!=t&&(r.callback=t),uo(e,r),hl(e,i,n)}};function yo(e,t,n,i,r,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(i,o,a):!(t.prototype&&t.prototype.isPureReactComponent&&hi(n,i)&&hi(r,o))}function vo(e,t,n){var i=!1,r=hr,o=t.contextType;return"object"==typeof o&&null!==o?o=oo(o):(r=gr(t)?pr:dr.current,o=(i=null!=(i=t.contextTypes))?mr(e,r):hr),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=_o,e.stateNode=t,t._reactInternals=e,i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=o),t}function xo(e,t,n,i){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&_o.enqueueReplaceState(t,t.state,null)}function bo(e,t,n,i){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs=mo,so(e);var o=t.contextType;"object"==typeof o&&null!==o?r.context=oo(o):(o=gr(t)?pr:dr.current,r.context=mr(e,o)),fo(e,n,r,i),r.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(go(e,t,o,n),r.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof r.getSnapshotBeforeUpdate||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||(t=r.state,"function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),t!==r.state&&_o.enqueueReplaceState(r,r.state,null),fo(e,n,r,i),r.state=e.memoizedState),"function"==typeof r.componentDidMount&&(e.flags|=4)}var wo=Array.isArray;function Eo(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(a(309));var i=n.stateNode}if(!i)throw Error(a(147,e));var r=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===r?t.ref:(t=function(e){var t=i.refs;t===mo&&(t=i.refs={}),null===e?delete t[r]:t[r]=e},t._stringRef=r,t)}if("string"!=typeof e)throw Error(a(284));if(!n._owner)throw Error(a(290,e))}return e}function To(e,t){if("textarea"!==e.type)throw Error(a(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function So(e){function t(t,n){if(e){var i=t.lastEffect;null!==i?(i.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}
vendor: 10,344 bytes, line 2
2function n(n,i){if(!e)return null;for(;null!==i;)t(n,i),i=i.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function r(e,t){return(e=Gl(e,t)).index=0,e.sibling=null,e}function o(t,n,i){return t.index=i,e?null!==(i=t.alternate)?(i=i.index)<n?(t.flags=2,n):i:(t.flags=2,n):n}function s(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,i){return null===t||6!==t.tag?((t=Zl(n,e.mode,i)).return=e,t):((t=r(t,n)).return=e,t)}function c(e,t,n,i){return null!==t&&t.elementType===n.type?((i=r(t,n.props)).ref=Eo(e,t,n),i.return=e,i):((i=ql(n.type,n.key,n.props,null,e.mode,i)).ref=Eo(e,t,n),i.return=e,i)}function u(e,t,n,i){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Xl(n,e.mode,i)).return=e,t):((t=r(t,n.children||[])).return=e,t)}function h(e,t,n,i,o){return null===t||7!==t.tag?((t=$l(n,e.mode,i,o)).return=e,t):((t=r(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Zl(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case w:return(n=ql(t.type,t.key,t.props,null,e.mode,n)).ref=Eo(e,null,t),n.return=e,n;case E:return(t=Xl(t,e.mode,n)).return=e,t}if(wo(t)||V(t))return(t=$l(t,e.mode,n,null)).return=e,t;To(e,t)}return null}function f(e,t,n,i){var r=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==r?null:l(e,t,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case w:return n.key===r?n.type===T?h(e,t,n.props.children,i,r):c(e,t,n,i):null;case E:return n.key===r?u(e,t,n,i):null}if(wo(n)||V(n))return null!==r?null:h(e,t,n,i,null);To(e,n)}return null}function p(e,t,n,i,r){if("string"==typeof i||"number"==typeof i)return l(t,e=e.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case w:return e=e.get(null===i.key?n:i.key)||null,i.type===T?h(t,e,i.props.children,r,i.key):c(t,e,i,r);case E:return u(t,e=e.get(null===i.key?n:i.key)||null,i,r)}if(wo(i)||V(i))return h(t,e=e.get(n)||null,i,r,null);To(t,i)}return null}function m(r,a,s,l){for(var c=null,u=null,h=a,m=a=0,g=null;null!==h&&m<s.length;m++){h.index>m?(g=h,h=null):g=h.sibling;var _=f(r,h,s[m],l);if(null===_){null===h&&(h=g);break}e&&h&&null===_.alternate&&t(r,h),a=o(_,a,m),null===u?c=_:u.sibling=_,u=_,h=g}if(m===s.length)return n(r,h),c;if(null===h){for(;m<s.length;m++)null!==(h=d(r,s[m],l))&&(a=o(h,a,m),null===u?c=h:u.sibling=h,u=h);return c}for(h=i(r,h);m<s.length;m++)null!==(g=p(h,r,m,s[m],l))&&(e&&null!==g.alternate&&h.delete(null===g.key?m:g.key),a=o(g,a,m),null===u?c=g:u.sibling=g,u=g);return e&&h.forEach((function(e){return t(r,e)})),c}function g(r,s,l,c){var u=V(l);if("function"!=typeof u)throw Error(a(150));if(null==(l=u.call(l)))throw Error(a(151));for(var h=u=null,m=s,g=s=0,_=null,y=l.next();null!==m&&!y.done;g++,y=l.next()){m.index>g?(_=m,m=null):_=m.sibling;var v=f(r,m,y.value,c);if(null===v){null===m&&(m=_);break}e&&m&&null===v.alternate&&t(r,m),s=o(v,s,g),null===h?u=v:h.sibling=v,h=v,m=_}if(y.done)return n(r,m),u;if(null===m){for(;!y.done;g++,y=l.next())null!==(y=d(r,y.value,c))&&(s=o(y,s,g),null===h?u=y:h.sibling=y,h=y);return u}for(m=i(r,m);!y.done;g++,y=l.next())null!==(y=p(m,r,g,y.value,c))&&(e&&null!==y.alternate&&m.delete(null===y.key?g:y.key),s=o(y,s,g),null===h?u=y:h.sibling=y,h=y);return e&&m.forEach((function(e){return t(r,e)})),u}return function(e,i,o,l){var c="object"==typeof o&&null!==o&&o.type===T&&null===o.key;c&&(o=o.props.children);var u="object"==typeof o&&null!==o;if(u)switch(o.$$typeof){case w:e:{for(u=o.key,c=i;null!==c;){if(c.key===u){if(7===c.tag){if(o.type===T){n(e,c.sibling),(i=r(c,o.props.children)).return=e,e=i;break e}}else if(c.elementType===o.type){n(e,c.sibling),(i=r(c,o.props)).ref=Eo(e,c,o),i.return=e,e=i;break e}n(e,c);break}t(e,c),c=c.sibling}o.type===T?((i=$l(o.props.children,e.mode,l,o.key)).return=e,e=i):((l=ql(o.type,o.key,o.props,null,e.mode,l)).ref=Eo(e,i,o),l.return=e,e=l)}return s(e);case E:e:{for(c=o.key;null!==i;){if(i.key===c){if(4===i.tag&&i.stateNode.containerInfo===o.containerInfo&&i.stateNode.implementation===o.implementation){n(e,i.sibling),(i=r(i,o.children||[])).return=e,e=i;break e}n(e,i);break}t(e,i),i=i.sibling}(i=Xl(o,e.mode,l)).return=e,e=i}return s(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==i&&6===i.tag?(n(e,i.sibling),(i=r(i,o)).return=e,e=i):(n(e,i),(i=Zl(o,e.mode,l)).return=e,e=i),s(e);if(wo(o))return m(e,i,o,l);if(V(o))return g(e,i,o,l);if(u&&To(e,o),void 0===o&&!c)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(a(152,Z(e.type)||"Component"))}return n(e,i)}}var Ao=So(!0),Co=So(!1),ko={},Mo=lr(ko),Io=lr(ko),Po=lr(ko);function Do(e){if(e===ko)throw Error(a(174));return e}function zo(e,t){switch(ur(Po,t),ur(Io,e),ur(Mo,ko),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fe(null,"");break;default:t=fe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}cr(Mo),ur(Mo,t)}function Lo(){cr(Mo),cr(Io),cr(Po)}function Oo(e){Do(Po.current);var t=Do(Mo.current),n=fe(t,e.type);t!==n&&(ur(Io,e),ur(Mo,n))}function Ro(e){Io.current===e&&(cr(Mo),cr(Io))}var Bo=lr(0);function Fo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var No=null,jo=null,Uo=!1;function Vo(e,t){var n=Ul(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Go(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);default:return!1}}function qo(e){if(Uo){var t=jo;if(t){var n=t;if(!Go(e,t)){if(!(t=Zi(n.nextSibling))||!Go(e,t))return e.flags=-1025&e.flags|2,Uo=!1,void(No=e);Vo(No,n)}No=e,jo=Zi(t.firstChild)}else e.flags=-1025&e.flags|2,Uo=!1,No=e}}function $o(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;No=e}function Wo(e){if(e!==No)return!1;if(!Uo)return $o(e),Uo=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Gi(t,e.memoizedProps))for(t=jo;t;)Vo(e,t),t=Zi(t.nextSibling);if($o(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(a(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){jo=Zi(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}jo=null}}else jo=No?Zi(e.stateNode.nextSibling):null;return!0}function Zo(){jo=No=null,Uo=!1}var Xo=[];function Ho(){for(var e=0;e<Xo.length;e++)Xo[e]._workInProgressVersionPrimary=null;Xo.length=0}var Yo=b.ReactCurrentDispatcher,Ko=b.ReactCurrentBatchConfig,Jo=0,Qo=null,ea=null,ta=null,na=!1,ia=!1;function ra(){throw Error(a(321))}function oa(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ci(e[n],t[n]))return!1;return!0}function aa(e,t,n,i,r,o){if(Jo=o,Qo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yo.current=null===e||null===e.memoizedState?Da:za,e=n(i,r),ia){o=0;do{if(ia=!1,!(25>o))throw Error(a(301));o+=1,ta=ea=null,t.updateQueue=null,Yo.current=La,e=n(i,r)}while(ia)}if(Yo.current=Pa,t=null!==ea&&null!==ea.next,Jo=0,ta=ea=Qo=null,na=!1,t)throw Error(a(300));return e}function sa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ta?Qo.memoizedState=ta=e:ta=ta.next=e,ta}function la(){if(null===ea){var e=Qo.alternate;e=null!==e?e.memoizedState:null}else e=ea.next;var t=null===ta?Qo.memoizedState:ta.next;if(null!==t)ta=t,ea=e;else{if(null===e)throw Error(a(310));e={memoizedState:(ea=e).memoizedState,baseState:ea.baseState,baseQueue:ea.baseQueue,queue:ea.queue,next:null},null===ta?Qo.memoizedState=ta=e:ta=ta.next=e}return ta}function ca(e,t){return"function"==typeof t?t(e):t}function ua(e){var t=la(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var i=ea,r=i.baseQueue,o=n.pending;if(null!==o){if(null!==r){var s=r.next;r.next=o.next,o.next=s}i.baseQueue=r=o,n.pending=null}if(null!==r){r=r.next,i=i.baseState;var l=s=o=null,c=r;do{var u=c.lane;if((Jo&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),i=c.eagerReducer===e?c.eagerState:e(i,c.action);else{var h={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===l?(s=l=h,o=i):l=l.next=h,Qo.lanes|=u,Fs|=u}c=c.next}while(null!==c&&c!==r);null===l?o=i:l.next=s,ci(i,t.memoizedState)||(Ra=!0),t.memoizedState=i,t.baseState=o,t.baseQueue=l,n.lastRenderedState=i}return[t.memoizedState,n.dispatch]}function ha(e){var t=la(),n=t.queue;if(null===n)throw Error(a(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,o=t.memoizedState;if(null!==r){n.pending=null;var s=r=r.next;do{o=e(o,s.action),s=s.next}while(s!==r);ci(o,t.memoizedState)||(Ra=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,i]}function da(e,t,n){var i=t._getVersion;i=i(t._source);var r=t._workInProgressVersionPrimary;if(null!==r?e=r===i:(e=e.mutableReadLanes,(e=(Jo&e)===e)&&(t._workInProgressVersionPrimary=i,Xo.push(t))),e)return n(t._source);throw Xo.push(t),Error(a(350))}function fa(e,t,n,i){var r=Is;if(null===r)throw Error(a(349));var o=t._getVersion,s=o(t._source),l=Yo.current,c=l.useState((function(){return da(r,t,n)})),u=c[1],h=c[0];c=ta;var d=e.memoizedState,f=d.refs,p=f.getSnapshot,m=d.source;d=d.subscribe;var g=Qo;return e.memoizedState={refs:f,source:t,subscribe:i},l.useEffect((function(){f.getSnapshot=n,f.setSnapshot=u;var e=o(t._source);if(!ci(s,e)){e=n(t._source),ci(h,e)||(u(e),e=ul(g),r.mutableReadLanes|=e&r.pendingLanes),e=r.mutableReadLanes,r.entangledLanes|=e;for(var i=r.entanglements,a=e;0<a;){var l=31-Gt(a),c=1<<l;i[l]|=e,a&=~c}}}),[n,t,i]),l.useEffect((function(){return i(t._source,(function(){var e=f.getSnapshot,n=f.setSnapshot;
vendor: 4,744 bytes, line 2
2try{n(e(t._source));var i=ul(g);r.mutableReadLanes|=i&r.pendingLanes}catch(e){n((function(){throw e}))}}))}),[t,i]),ci(p,n)&&ci(m,t)&&ci(d,i)||((e={pending:null,dispatch:null,lastRenderedReducer:ca,lastRenderedState:h}).dispatch=u=Ia.bind(null,Qo,e),c.queue=e,c.baseQueue=null,h=da(r,t,n),c.memoizedState=c.baseState=h),h}function pa(e,t,n){return fa(la(),e,t,n)}function ma(e){var t=sa();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ca,lastRenderedState:e}).dispatch=Ia.bind(null,Qo,e),[t.memoizedState,e]}function ga(e,t,n,i){return e={tag:e,create:t,destroy:n,deps:i,next:null},null===(t=Qo.updateQueue)?(t={lastEffect:null},Qo.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function _a(e){return e={current:e},sa().memoizedState=e}function ya(){return la().memoizedState}function va(e,t,n,i){var r=sa();Qo.flags|=e,r.memoizedState=ga(1|t,n,void 0,void 0===i?null:i)}function xa(e,t,n,i){var r=la();i=void 0===i?null:i;var o=void 0;if(null!==ea){var a=ea.memoizedState;if(o=a.destroy,null!==i&&oa(i,a.deps))return void ga(t,n,o,i)}Qo.flags|=e,r.memoizedState=ga(1|t,n,o,i)}function ba(e,t){return va(516,4,e,t)}function wa(e,t){return xa(516,4,e,t)}function Ea(e,t){return xa(4,2,e,t)}function Ta(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Sa(e,t,n){return n=null!=n?n.concat([e]):null,xa(4,2,Ta.bind(null,t,e),n)}function Aa(){}function Ca(e,t){var n=la();t=void 0===t?null:t;var i=n.memoizedState;return null!==i&&null!==t&&oa(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function ka(e,t){var n=la();t=void 0===t?null:t;var i=n.memoizedState;return null!==i&&null!==t&&oa(t,i[1])?i[0]:(e=e(),n.memoizedState=[e,t],e)}function Ma(e,t){var n=Gr();$r(98>n?98:n,(function(){e(!0)})),$r(97<n?97:n,(function(){var n=Ko.transition;Ko.transition=1;try{e(!1),t()}finally{Ko.transition=n}}))}function Ia(e,t,n){var i=cl(),r=ul(e),o={lane:r,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?o.next=o:(o.next=a.next,a.next=o),t.pending=o,a=e.alternate,e===Qo||null!==a&&a===Qo)ia=na=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=a(s,n);if(o.eagerReducer=a,o.eagerState=l,ci(l,s))return}catch(e){}hl(e,r,i)}}var Pa={readContext:oo,useCallback:ra,useContext:ra,useEffect:ra,useImperativeHandle:ra,useLayoutEffect:ra,useMemo:ra,useReducer:ra,useRef:ra,useState:ra,useDebugValue:ra,useDeferredValue:ra,useTransition:ra,useMutableSource:ra,useOpaqueIdentifier:ra,unstable_isNewReconciler:!1},Da={readContext:oo,useCallback:function(e,t){return sa().memoizedState=[e,void 0===t?null:t],e},useContext:oo,useEffect:ba,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,va(4,2,Ta.bind(null,t,e),n)},useLayoutEffect:function(e,t){return va(4,2,e,t)},useMemo:function(e,t){var n=sa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=sa();return t=void 0!==n?n(t):t,i.memoizedState=i.baseState=t,e=(e=i.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Ia.bind(null,Qo,e),[i.memoizedState,e]},useRef:_a,useState:ma,useDebugValue:Aa,useDeferredValue:function(e){var t=ma(e),n=t[0],i=t[1];return ba((function(){var t=Ko.transition;Ko.transition=1;try{i(e)}finally{Ko.transition=t}}),[e]),n},useTransition:function(){var e=ma(!1),t=e[0];return _a(e=Ma.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var i=sa();return i.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},fa(i,e,t,n)},useOpaqueIdentifier:function(){if(Uo){var e=!1,t=function(e){return{$$typeof:O,toString:e,valueOf:e}}((function(){throw e||(e=!0,n("r:"+(Hi++).toString(36))),Error(a(355))})),n=ma(t)[1];return 0==(2&Qo.mode)&&(Qo.flags|=516,ga(5,(function(){n("r:"+(Hi++).toString(36))}),void 0,null)),t}return ma(t="r:"+(Hi++).toString(36)),t},unstable_isNewReconciler:!1},za={readContext:oo,useCallback:Ca,useContext:oo,useEffect:wa,useImperativeHandle:Sa,useLayoutEffect:Ea,useMemo:ka,useReducer:ua,useRef:ya,useState:function(){return ua(ca)},useDebugValue:Aa,useDeferredValue:function(e){var t=ua(ca),n=t[0],i=t[1];return wa((function(){var t=Ko.transition;Ko.transition=1;try{i(e)}finally{Ko.transition=t}}),[e]),n},useTransition:function(){var e=ua(ca)[0];return[ya().current,e]},useMutableSource:pa,useOpaqueIdentifier:function(){return ua(ca)[0]},unstable_isNewReconciler:!1},La={readContext:oo,useCallback:Ca,useContext:oo,useEffect:wa,useImperativeHandle:Sa,useLayoutEffect:Ea,useMemo:ka,useReducer:ha,useRef
vendor: 8,576 bytes, line 2
2:ya,useState:function(){return ha(ca)},useDebugValue:Aa,useDeferredValue:function(e){var t=ha(ca),n=t[0],i=t[1];return wa((function(){var t=Ko.transition;Ko.transition=1;try{i(e)}finally{Ko.transition=t}}),[e]),n},useTransition:function(){var e=ha(ca)[0];return[ya().current,e]},useMutableSource:pa,useOpaqueIdentifier:function(){return ha(ca)[0]},unstable_isNewReconciler:!1},Oa=b.ReactCurrentOwner,Ra=!1;function Ba(e,t,n,i){t.child=null===e?Co(t,null,n,i):Ao(t,e.child,n,i)}function Fa(e,t,n,i,r){n=n.render;var o=t.ref;return ro(t,r),i=aa(e,t,n,i,o,r),null===e||Ra?(t.flags|=1,Ba(e,t,i,r),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~r,ns(e,t,r))}function Na(e,t,n,i,r,o){if(null===e){var a=n.type;return"function"!=typeof a||Vl(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=ql(n.type,null,i,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,ja(e,t,a,i,r,o))}return a=e.child,0==(r&o)&&(r=a.memoizedProps,(n=null!==(n=n.compare)?n:hi)(r,i)&&e.ref===t.ref)?ns(e,t,o):(t.flags|=1,(e=Gl(a,i)).ref=t.ref,e.return=t,t.child=e)}function ja(e,t,n,i,r,o){if(null!==e&&hi(e.memoizedProps,i)&&e.ref===t.ref){if(Ra=!1,0==(o&r))return t.lanes=e.lanes,ns(e,t,o);0!=(16384&e.flags)&&(Ra=!0)}return Ga(e,t,n,i,o)}function Ua(e,t,n){var i=t.pendingProps,r=i.children,o=null!==e?e.memoizedState:null;if("hidden"===i.mode||"unstable-defer-without-hiding"===i.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},vl(0,n);else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},vl(0,e),null;t.memoizedState={baseLanes:0},vl(0,null!==o?o.baseLanes:n)}else null!==o?(i=o.baseLanes|n,t.memoizedState=null):i=n,vl(0,i);return Ba(e,t,r,n),t.child}function Va(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Ga(e,t,n,i,r){var o=gr(n)?pr:dr.current;return o=mr(t,o),ro(t,r),n=aa(e,t,n,i,o,r),null===e||Ra?(t.flags|=1,Ba(e,t,n,r),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~r,ns(e,t,r))}function qa(e,t,n,i,r){if(gr(n)){var o=!0;xr(t)}else o=!1;if(ro(t,r),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),vo(t,n,i),bo(t,n,i,r),i=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;c="object"==typeof c&&null!==c?oo(c):mr(t,c=gr(n)?pr:dr.current);var u=n.getDerivedStateFromProps,h="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;h||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==i||l!==c)&&xo(t,a,i,c),ao=!1;var d=t.memoizedState;a.state=d,fo(t,i,a,r),l=t.memoizedState,s!==i||d!==l||fr.current||ao?("function"==typeof u&&(go(t,n,u,i),l=t.memoizedState),(s=ao||yo(t,n,s,i,d,l,c))?(h||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4)):("function"==typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=i,t.memoizedState=l),a.props=i,a.state=l,a.context=c,i=s):("function"==typeof a.componentDidMount&&(t.flags|=4),i=!1)}else{a=t.stateNode,lo(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Yr(t.type,s),a.props=c,h=t.pendingProps,d=a.context,l="object"==typeof(l=n.contextType)&&null!==l?oo(l):mr(t,l=gr(n)?pr:dr.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==h||d!==l)&&xo(t,a,i,l),ao=!1,d=t.memoizedState,a.state=d,fo(t,i,a,r);var p=t.memoizedState;s!==h||d!==p||fr.current||ao?("function"==typeof f&&(go(t,n,f,i),p=t.memoizedState),(c=ao||yo(t,n,c,i,d,p,l))?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(i,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(i,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),t.memoizedProps=i,t.memoizedState=p),a.props=i,a.state=p,a.context=l,i=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&d===e.memoizedState||(t.flags|=256),i=!1)}return $a(e,t,n,i,o,r)}function $a(e,t,n,i,r,o){Va(e,t);var a=0!=(64&t.flags);if(!i&&!a)return r&&br(t,n,!1),ns(e,t,o);i=t.stateNode,Oa.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:i.render();return t.flags|=1,null!==e&&a?(t.child=Ao(t,e.child,null,o),t.child=Ao(t,null,s,o)):Ba(e,t,s,o),t.memoizedState=i.state,r&&br(t,n,!0),t.child}function Wa(e){var t=e.stateNode;t.pendingContext?yr(0,t.pendingContext,t.pendingContext!==t.context):t.context&&yr(0,t.context,!1),zo(e,t.containerInfo)}var Za,Xa,Ha,Ya={dehydrated:null,retryLane:0};function Ka(e,t,n){var i,r=t.pendingProps,o=Bo.current,a=!1;return(i=0!=(64&t.flags))||(i=(null===e||null!==e.memoizedState)&&0!=(2&o)),i?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===r.fallback||!0===r.unstable_avoidThisFallback||(o|=1),ur(Bo,1&o),null===e?(void 0!==r.fallback&&qo(t),e=r.children,o=r.fallback,a?(e=Ja(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Ya,e):"number"==typeof r.unstable_expectedLoadTime?(e=Ja(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=Ya,t.lanes=33554432,e):((n=Wl({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(r=function(e,t,n,i,r){var o=t.mode,a=e.child;e=a.sibling;var s={mode:"hidden",children:n};return 0==(2&o)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=Gl(a,s),null!==e?i=Gl(e,i):(i=$l(i,o,r,null)).flags|=2,i.return=t,n.return=t,n.sibling=i,t.child=n,i}(e,t,r.children,r.fallback,n),a=t.child,o=e.child.memoizedState,a.memoizedState=null===o?{baseLanes:n}:{baseLanes:o.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=Ya,r):(n=function(e,t,n,i){var r=e.child;return e=r.sibling,n=Gl(r,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=i),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}(e,t,r.children,n),t.memoizedState=null,n))}function Ja(e,t,n,i){var r=e.mode,o=e.child;return t={mode:"hidden",children:t},0==(2&r)&&null!==o?(o.childLanes=0,o.pendingProps=t):o=Wl(t,r,0,null),n=$l(n,r,i,null),o.return=e,n.return=e,o.sibling=n,e.child=o,n}function Qa(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),io(e.return,t)}function es(e,t,n,i,r,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,lastEffect:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailMode=r,a.lastEffect=o)}function ts(e,t,n){var i=t.pendingProps,r=i.revealOrder,o=i.tail;if(Ba(e,t,i.children,n),0!=(2&(i=Bo.current)))i=1&i|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Qa(e,n);else if(19===e.tag)Qa(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(ur(Bo,i),0==(2&t.mode))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;null!==n;)null!==(e=n.alternate)&&null===Fo(e)&&(r=n),n=n.sibling;null===(n=r)?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),es(t,!1,r,n,o,t.lastEffect);break;case"backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===Fo(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}es(t,!0,n,null,o,t.lastEffect);break;case"together":es(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function ns(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),Fs|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(a(153));if(null!==t.child){for(n=Gl(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;
vendor: 5,214 bytes, line 2
2)e=e.sibling,(n=n.sibling=Gl(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function is(e,t){if(!Uo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?t||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null}}function rs(e,t,n){var i=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return gr(t.type)&&_r(),null;case 3:return Lo(),cr(fr),cr(dr),Ho(),(i=t.stateNode).pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==e&&null!==e.child||(Wo(t)?t.flags|=4:i.hydrate||(t.flags|=256)),null;case 5:Ro(t);var o=Do(Po.current);if(n=t.type,null!==e&&null!=t.stateNode)Xa(e,t,n,i),e.ref!==t.ref&&(t.flags|=128);else{if(!i){if(null===t.stateNode)throw Error(a(166));return null}if(e=Do(Mo.current),Wo(t)){i=t.stateNode,n=t.type;var s=t.memoizedProps;switch(i[Ki]=t,i[Ji]=s,n){case"dialog":Mi("cancel",i),Mi("close",i);break;case"iframe":case"object":case"embed":Mi("load",i);break;case"video":case"audio":for(e=0;e<Si.length;e++)Mi(Si[e],i);break;case"source":Mi("error",i);break;case"img":case"image":case"link":Mi("error",i),Mi("load",i);break;case"details":Mi("toggle",i);break;case"input":ee(i,s),Mi("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Mi("invalid",i);break;case"textarea":le(i,s),Mi("invalid",i)}for(var c in Ee(n,s),e=null,s)s.hasOwnProperty(c)&&(o=s[c],"children"===c?"string"==typeof o?i.textContent!==o&&(e=["children",o]):"number"==typeof o&&i.textContent!==""+o&&(e=["children",""+o]):l.hasOwnProperty(c)&&null!=o&&"onScroll"===c&&Mi("scroll",i));switch(n){case"input":Y(i),ie(i,s,!0);break;case"textarea":Y(i),ue(i);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(i.onclick=Ni)}i=e,t.updateQueue=i,null!==i&&(t.flags|=4)}else{switch(c=9===o.nodeType?o:o.ownerDocument,e===he&&(e=de(n)),e===he?"script"===n?((e=c.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof i.is?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),"select"===n&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Ki]=t,e[Ji]=i,Za(e,t),t.stateNode=e,c=Te(n,i),n){case"dialog":Mi("cancel",e),Mi("close",e),o=i;break;case"iframe":case"object":case"embed":Mi("load",e),o=i;break;case"video":case"audio":for(o=0;o<Si.length;o++)Mi(Si[o],e);o=i;break;case"source":Mi("error",e),o=i;break;case"img":case"image":case"link":Mi("error",e),Mi("load",e),o=i;break;case"details":Mi("toggle",e),o=i;break;case"input":ee(e,i),o=Q(e,i),Mi("invalid",e);break;case"option":o=oe(e,i);break;case"select":e._wrapperState={wasMultiple:!!i.multiple},o=r({},i,{value:void 0}),Mi("invalid",e);break;case"textarea":le(e,i),o=se(e,i),Mi("invalid",e);break;default:o=i}Ee(n,o);var u=o;for(s in u)if(u.hasOwnProperty(s)){var h=u[s];"style"===s?be(e,h):"dangerouslySetInnerHTML"===s?null!=(h=h?h.__html:void 0)&&ge(e,h):"children"===s?"string"==typeof h?("textarea"!==n||""!==h)&&_e(e,h):"number"==typeof h&&_e(e,""+h):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(l.hasOwnProperty(s)?null!=h&&"onScroll"===s&&Mi("scroll",e):null!=h&&x(e,s,h,c))}switch(n){case"input":Y(e),ie(e,i,!1);break;case"textarea":Y(e),ue(e);break;case"option":null!=i.value&&e.setAttribute("value",""+X(i.value));break;case"select":e.multiple=!!i.multiple,null!=(s=i.value)?ae(e,!!i.multiple,s,!1):null!=i.defaultValue&&ae(e,!!i.multiple,i.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=Ni)}Vi(n,i)&&(t.flags|=4)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)Ha(0,t,e.memoizedProps,i);else{if("string"!=typeof i&&null===t.stateNode)throw Error(a(166));n=Do(Po.current),Do(Mo.current),Wo(t)?(i=t.stateNode,n=t.memoizedProps,i[Ki]=t,i.nodeValue!==n&&(t.flags|=4)):((i=(9===n.nodeType?n:n.ownerDocument).createTextNode(i))[Ki]=t,t.stateNode=i)}return null;case 13:return cr(Bo),i=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(i=null!==i,n=!1,null===e?void 0!==t.memoizedProps.fallback&&Wo(t):n=null!==e.memoizedState,i&&!n&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Bo.current)?0===Os&&(Os=3):(0!==Os&&3!==Os||(Os=4),null===Is||0==(134217727&Fs)&&0==(134217727&Ns)||ml(Is,Ds))),(i||n)&&(t.flags|=4),null);case 4:return Lo(),null===e&&Pi(t.stateNode.containerInfo),null;case 10:return no(t),null;case 19:if(cr(Bo),null===(i=t.memoizedState))return null;if(s=0!=(64&t.flags),null===(c=i.rendering))if(s)is(i,!1);else{if(0!==Os||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(c=Fo(e))){for(t.flags|=64,is(i,!1),null!==(s=c.updateQueue)&&(t.updateQueue=s,t.flags|=4),null===i.lastEffect&&(t.firstEffect=null),t.lastEffect=i.lastEffect,i=n,n=t.child;null!==n;)e=i,(s=n).flags&=2,s.nextEffect=null,s.firstEffect=null,s.lastEffect=null,null===(c=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,
vendor: 4,569 bytes, line 2
2s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,e=c.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ur(Bo,1&Bo.current|2),t.child}e=e.sibling}null!==i.tail&&Vr()>Gs&&(t.flags|=64,s=!0,is(i,!1),t.lanes=33554432)}else{if(!s)if(null!==(e=Fo(c))){if(t.flags|=64,s=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.flags|=4),is(i,!0),null===i.tail&&"hidden"===i.tailMode&&!c.alternate&&!Uo)return null!==(t=t.lastEffect=i.lastEffect)&&(t.nextEffect=null),null}else 2*Vr()-i.renderingStartTime>Gs&&1073741824!==n&&(t.flags|=64,s=!0,is(i,!1),t.lanes=33554432);i.isBackwards?(c.sibling=t.child,t.child=c):(null!==(n=i.last)?n.sibling=c:t.child=c,i.last=c)}return null!==i.tail?(n=i.tail,i.rendering=n,i.tail=n.sibling,i.lastEffect=t.lastEffect,i.renderingStartTime=Vr(),n.sibling=null,t=Bo.current,ur(Bo,s?1&t|2:1&t),n):null;case 23:case 24:return xl(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==i.mode&&(t.flags|=4),null}throw Error(a(156,t.tag))}function os(e){switch(e.tag){case 1:gr(e.type)&&_r();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(Lo(),cr(fr),cr(dr),Ho(),0!=(64&(t=e.flags)))throw Error(a(285));return e.flags=-4097&t|64,e;case 5:return Ro(e),null;case 13:return cr(Bo),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return cr(Bo),null;case 4:return Lo(),null;case 10:return no(e),null;case 23:case 24:return xl(),null;default:return null}}function as(e,t){try{var n="",i=t;do{n+=W(i),i=i.return}while(i);var r=n}catch(e){r="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:r}}function ss(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}Za=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Xa=function(e,t,n,i){var o=e.memoizedProps;if(o!==i){e=t.stateNode,Do(Mo.current);var a,s=null;switch(n){case"input":o=Q(e,o),i=Q(e,i),s=[];break;case"option":o=oe(e,o),i=oe(e,i),s=[];break;case"select":o=r({},o,{value:void 0}),i=r({},i,{value:void 0}),s=[];break;case"textarea":o=se(e,o),i=se(e,i),s=[];break;default:"function"!=typeof o.onClick&&"function"==typeof i.onClick&&(e.onclick=Ni)}for(h in Ee(n,i),n=null,o)if(!i.hasOwnProperty(h)&&o.hasOwnProperty(h)&&null!=o[h])if("style"===h){var c=o[h];for(a in c)c.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==h&&"children"!==h&&"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&"autoFocus"!==h&&(l.hasOwnProperty(h)?s||(s=[]):(s=s||[]).push(h,null));for(h in i){var u=i[h];if(c=null!=o?o[h]:void 0,i.hasOwnProperty(h)&&u!==c&&(null!=u||null!=c))if("style"===h)if(c){for(a in c)!c.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&c[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(s||(s=[]),s.push(h,n)),n=u;else"dangerouslySetInnerHTML"===h?(u=u?u.__html:void 0,c=c?c.__html:void 0,null!=u&&c!==u&&(s=s||[]).push(h,u)):"children"===h?"string"!=typeof u&&"number"!=typeof u||(s=s||[]).push(h,""+u):"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&(l.hasOwnProperty(h)?(null!=u&&"onScroll"===h&&Mi("scroll",e),s||c===u||(s=[])):"object"==typeof u&&null!==u&&u.$$typeof===O?u.toString():(s=s||[]).push(h,u))}n&&(s=s||[]).push("style",n);var h=s;(t.updateQueue=h)&&(t.flags|=4)}},Ha=function(e,t,n,i){n!==i&&(t.flags|=4)};var ls="function"==typeof WeakMap?WeakMap:Map;function cs(e,t,n){(n=co(-1,n)).tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){Zs||(Zs=!0,Xs=i),ss(0,t)},n}function us(e,t,n){(n=co(-1,n)).tag=3;var i=e.type.getDerivedStateFromError;if("function"==typeof i){var r=t.value;n.payload=function(){return ss(0,t),i(r)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){"function"!=typeof i&&(null===Hs?Hs=new Set([this]):Hs.add(this),ss(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var hs="function"==typeof WeakSet?WeakSet:Set;function ds(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Bl(e,t)}else t.current=null}function fs(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 
vendor: 8,452 bytes, line 2
26:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,i=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Yr(t.type,n),i),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(256&t.flags&&Wi(t.stateNode.containerInfo))}throw Error(a(163))}function ps(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var i=e.create;e.destroy=i()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var r=e;i=r.next,0!=(4&(r=r.tag))&&0!=(1&r)&&(Ll(n,e),zl(n,e)),e=i}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(i=n.elementType===n.type?t.memoizedProps:Yr(n.type,t.memoizedProps),e.componentDidUpdate(i,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&po(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:case 1:e=n.child.stateNode}po(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&Vi(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&bt(n)))))}throw Error(a(163))}function ms(e,t){for(var n=e;;){if(5===n.tag){var i=n.stateNode;if(t)"function"==typeof(i=i.style).setProperty?i.setProperty("display","none","important"):i.display="none";else{i=n.stateNode;var r=n.memoizedProps.style;r=null!=r&&r.hasOwnProperty("display")?r.display:null,i.style.display=xe("display",r)}}else if(6===n.tag)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function gs(e,t){if(Er&&"function"==typeof Er.onCommitFiberUnmount)try{Er.onCommitFiberUnmount(wr,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var i=n,r=i.destroy;if(i=i.tag,void 0!==r)if(0!=(4&i))Ll(t,n);else{i=t;try{r()}catch(e){Bl(i,e)}}n=n.next}while(n!==e)}break;case 1:if(ds(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){Bl(t,e)}break;case 5:ds(t);break;case 4:ws(e,t)}}function _s(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function ys(e){return 5===e.tag||3===e.tag||4===e.tag}function vs(e){e:{for(var t=e.return;null!==t;){if(ys(t))break e;t=t.return}throw Error(a(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var i=!1;break;case 3:case 4:t=t.containerInfo,i=!0;break;default:throw Error(a(161))}16&n.flags&&(_e(t,""),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||ys(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}i?xs(e,n,t):bs(e,n,t)}function xs(e,t,n){var i=e.tag,r=5===i||6===i;if(r)e=r?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Ni));else if(4!==i&&null!==(e=e.child))for(xs(e,t,n),e=e.sibling;null!==e;)xs(e,t,n),e=e.sibling}function bs(e,t,n){var i=e.tag,r=5===i||6===i;if(r)e=r?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==i&&null!==(e=e.child))for(bs(e,t,n),e=e.sibling;null!==e;)bs(e,t,n),e=e.sibling}function ws(e,t){for(var n,i,r=t,o=!1;;){if(!o){o=r.return;e:for(;;){if(null===o)throw Error(a(160));switch(n=o.stateNode,o.tag){case 5:i=!1;break e;case 3:case 4:n=n.containerInfo,i=!0;break e}o=o.return}o=!0}if(5===r.tag||6===r.tag){e:for(var s=e,l=r,c=l;;)if(gs(s,c),null!==c.child&&4!==c.tag)c.child.return=c,c=c.child;else{if(c===l)break e;for(;null===c.sibling;){if(null===c.return||c.return===l)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}i?(s=n,l=r.stateNode,8===s.nodeType?s.parentNode.removeChild(l):s.removeChild(l)):n.removeChild(r.stateNode)}else if(4===r.tag){if(null!==r.child){n=r.stateNode.containerInfo,i=!0,r.child.return=r,r=r.child;continue}}else if(gs(e,r),null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;4===(r=r.return).tag&&(o=!1)}r.sibling.return=r.return,r=r.sibling}}function Es(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var i=n=n.next;do{3==(3&i.tag)&&(e=i.destroy,i.destroy=void 0,void 0!==e&&e()),i=i.next}while(i!==n)}return;case 1:case 12:case 17:return;case 5:if(null!=(n=t.stateNode)){i=t.memoizedProps;var r=null!==e?e.memoizedProps:i;e=t.type;var o=t.updateQueue;if(t.updateQueue=null,null!==o){for(n[Ji]=i,"input"===e&&"radio"===i.type&&null!=i.name&&te(n,i),Te(e,r),t=Te(e,i),r=0;r<o.length;r+=2){var s=o[r],l=o[r+1];"style"===s?be(n,l):"dangerouslySetInnerHTML"===s?ge(n,l):"children"===s?_e(n,l):x(n,s,l,t)}switch(e){case"input":ne(n,i);break;case"textarea":ce(n,i);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!i.multiple,null!=(o=i.value)?ae(n,!!i.multiple,o,!1):e!==!!i.multiple&&(null!=i.defaultValue?ae(n,!!i.multiple,i.defaultValue,!0):ae(n,!!i.multiple,i.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(a(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((n=t.stateNode).hydrate&&(n.hydrate=!1,bt(n.containerInfo)));case 13:return null!==t.memoizedState&&(Vs=Vr(),ms(t.child,!0)),void Ts(t);case 19:return void Ts(t);case 23:case 24:return void ms(t,null!==t.memoizedState)}throw Error(a(163))}function Ts(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new hs),t.forEach((function(t){var i=Nl.bind(null,e,t);n.has(t)||(n.add(t),t.then(i,i))}))}}function Ss(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&null!==(t=t.memoizedState)&&null===t.dehydrated}var As=Math.ceil,Cs=b.ReactCurrentDispatcher,ks=b.ReactCurrentOwner,Ms=0,Is=null,Ps=null,Ds=0,zs=0,Ls=lr(0),Os=0,Rs=null,Bs=0,Fs=0,Ns=0,js=0,Us=null,Vs=0,Gs=1/0;function qs(){Gs=Vr()+500}var $s,Ws=null,Zs=!1,Xs=null,Hs=null,Ys=!1,Ks=null,Js=90,Qs=[],el=[],tl=null,nl=0,il=null,rl=-1,ol=0,al=0,sl=null,ll=!1;function cl(){return 0!=(48&Ms)?Vr():-1!==rl?rl:rl=Vr()}function ul(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Gr()?1:2;if(0===ol&&(ol=Bs),0!==Hr.transition){0!==al&&(al=null!==Us?Us.pendingLanes:0),e=ol;var t=4186112&~al;return 0==(t&=-t)&&0==(t=(e=4186112&~e)&-e)&&(t=8192),t}return e=Gr(),e=Nt(0!=(4&Ms)&&98===e?12:e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),ol)}function hl(e,t,n){if(50<nl)throw nl=0,il=null,Error(a(185));if(null===(e=dl(e,t)))return null;Vt(e,t,n),e===Is&&(Ns|=t,4===Os&&ml(e,Ds));var i=Gr();1===t?0!=(8&Ms)&&0==(48&Ms)?gl(e):(fl(e,n),0===Ms&&(qs(),Zr())):(0==(4&Ms)||98!==i&&99!==i||(null===tl?tl=new Set([e]):tl.add(e)),fl(e,n)),Us=e}function dl(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function fl(e,t){for(var n=e.callbackNode,i=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var l=31-Gt(s),c=1<<l,u=o[l];if(-1===u){if(0==(c&i)||0!=(c&r)){u=t,Rt(c);var h=Ot;o[l]=10<=h?u+250:6<=h?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);s&=~c}if(i=Bt(e,e===Is?Ds:0),t=Ot,0===i)null!==n&&(n!==Rr&&Ar(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Rr&&Ar(n)}15===t?(n=gl.bind(null,e),null===Fr?(Fr=[n],Nr=Sr(Pr,Xr)):Fr.push(n),n=Rr):14===t?n=Wr(99,gl.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;
vendor: 1,679 bytes, line 2
2case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(a(358,e))}}(t),n=Wr(n,pl.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function pl(e){if(rl=-1,al=ol=0,0!=(48&Ms))throw Error(a(327));var t=e.callbackNode;if(Dl()&&e.callbackNode!==t)return null;var n=Bt(e,e===Is?Ds:0);if(0===n)return null;var i=n,r=Ms;Ms|=16;var o=El();for(Is===e&&Ds===i||(qs(),bl(e,i));;)try{Al();break}catch(t){wl(e,t)}if(to(),Cs.current=o,Ms=r,null!==Ps?i=0:(Is=null,Ds=0,i=Os),0!=(Bs&Ns))bl(e,0);else if(0!==i){if(2===i&&(Ms|=64,e.hydrate&&(e.hydrate=!1,Wi(e.containerInfo)),0!==(n=Ft(e))&&(i=Tl(e,n))),1===i)throw t=Rs,bl(e,0),ml(e,n),fl(e,Vr()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,i){case 0:case 1:throw Error(a(345));case 2:case 5:Ml(e);break;case 3:if(ml(e,n),(62914560&n)===n&&10<(i=Vs+500-Vr())){if(0!==Bt(e,0))break;if(((r=e.suspendedLanes)&n)!==n){cl(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=qi(Ml.bind(null,e),i);break}Ml(e);break;case 4:if(ml(e,n),(4186112&n)===n)break;for(i=e.eventTimes,r=-1;0<n;){var s=31-Gt(n);o=1<<s,(s=i[s])>r&&(r=s),n&=~o}if(n=r,10<(n=(120>(n=Vr()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*As(n/1960))-n)){e.timeoutHandle=qi(Ml.bind(null,e),n);break}Ml(e);break;default:throw Error(a(329))}}return fl(e,Vr()),e.callbackNode===t?pl.bind(null,e):null}function ml(e,t){for(t&=~js,t&=~Ns,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Gt(t),i=1<<n;e[n]=-1,t&=~i}}function gl(e){if(0!=(48&Ms))throw Error(a(327));if(Dl(),e===Is&&0!=(e.expiredLanes&Ds)){var t=Ds,n=Tl(e,t);0!=(Bs&Ns)&&(n=Tl(e,t=Bt(e,t)))}
vendor: 5,501 bytes, line 2
2else n=Tl(e,t=Bt(e,0));if(0!==e.tag&&2===n&&(Ms|=64,e.hydrate&&(e.hydrate=!1,Wi(e.containerInfo)),0!==(t=Ft(e))&&(n=Tl(e,t))),1===n)throw n=Rs,bl(e,0),ml(e,t),fl(e,Vr()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ml(e),fl(e,Vr()),null}function _l(e,t){var n=Ms;Ms|=1;try{return e(t)}finally{0===(Ms=n)&&(qs(),Zr())}}function yl(e,t){var n=Ms;Ms&=-2,Ms|=8;try{return e(t)}finally{0===(Ms=n)&&(qs(),Zr())}}function vl(e,t){ur(Ls,zs),zs|=t,Bs|=t}function xl(){zs=Ls.current,cr(Ls)}function bl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,$i(n)),null!==Ps)for(n=Ps.return;null!==n;){var i=n;switch(i.tag){case 1:null!=(i=i.type.childContextTypes)&&_r();break;case 3:Lo(),cr(fr),cr(dr),Ho();break;case 5:Ro(i);break;case 4:Lo();break;case 13:case 19:cr(Bo);break;case 10:no(i);break;case 23:case 24:xl()}n=n.return}Is=e,Ps=Gl(e.current,null),Ds=zs=Bs=t,Os=0,Rs=null,js=Ns=Fs=0}function wl(e,t){for(;;){var n=Ps;try{if(to(),Yo.current=Pa,na){for(var i=Qo.memoizedState;null!==i;){var r=i.queue;null!==r&&(r.pending=null),i=i.next}na=!1}if(Jo=0,ta=ea=Qo=null,ia=!1,ks.current=null,null===n||null===n.return){Os=1,Rs=t,Ps=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=Ds,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l;if(0==(2&s.mode)){var u=s.alternate;u?(s.updateQueue=u.updateQueue,s.memoizedState=u.memoizedState,s.lanes=u.lanes):(s.updateQueue=null,s.memoizedState=null)}var h=0!=(1&Bo.current),d=a;do{var f;if(f=13===d.tag){var p=d.memoizedState;if(null!==p)f=null!==p.dehydrated;else{var m=d.memoizedProps;f=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!h)}}if(f){var g=d.updateQueue;if(null===g){var _=new Set;_.add(c),d.updateQueue=_}else g.add(c);if(0==(2&d.mode)){if(d.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var y=co(-1,1);y.tag=2,uo(s,y)}s.lanes|=1;break e}l=void 0,s=t;var v=o.pingCache;if(null===v?(v=o.pingCache=new ls,l=new Set,v.set(c,l)):void 0===(l=v.get(c))&&(l=new Set,v.set(c,l)),!l.has(s)){l.add(s);var x=Fl.bind(null,o,c,s);c.then(x,x)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(null!==d);l=Error((Z(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==Os&&(Os=2),l=as(l,s),d=a;do{switch(d.tag){case 3:o=l,d.flags|=4096,t&=-t,d.lanes|=t,ho(d,cs(0,o,t));break e;case 1:o=l;var b=d.type,w=d.stateNode;if(0==(64&d.flags)&&("function"==typeof b.getDerivedStateFromError||null!==w&&"function"==typeof w.componentDidCatch&&(null===Hs||!Hs.has(w)))){d.flags|=4096,t&=-t,d.lanes|=t,ho(d,us(d,o,t));break e}}d=d.return}while(null!==d)}kl(n)}catch(e){t=e,Ps===n&&null!==n&&(Ps=n=n.return);continue}break}}function El(){var e=Cs.current;return Cs.current=Pa,null===e?Pa:e}function Tl(e,t){var n=Ms;Ms|=16;var i=El();for(Is===e&&Ds===t||bl(e,t);;)try{Sl();break}catch(t){wl(e,t)}if(to(),Ms=n,Cs.current=i,null!==Ps)throw Error(a(261));return Is=null,Ds=0,Os}function Sl(){for(;null!==Ps;)Cl(Ps)}function Al(){for(;null!==Ps&&!Cr();)Cl(Ps)}function Cl(e){var t=$s(e.alternate,e,zs);e.memoizedProps=e.pendingProps,null===t?kl(e):Ps=t,ks.current=null}function kl(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=rs(n,t,zs)))return void(Ps=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&zs)||0==(4&n.mode)){for(var i=0,r=n.child;null!==r;)i|=r.lanes|r.childLanes,r=r.sibling;n.childLanes=i}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=os(t)))return n.flags&=2047,void(Ps=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(Ps=t);Ps=t=e}while(null!==t);0===Os&&(Os=5)}function Ml(e){var t=Gr();return $r(99,Il.bind(null,e,t)),null}function Il(e,t){do{Dl()}while(null!==Ks);if(0!=(48&Ms))throw Error(a(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(a(177));e.callbackNode=null;var i=n.lanes|n.childLanes,r=i,o=e.pendingLanes&~r;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=r,e.mutableReadLanes&=r,e.entangledLanes&=r,r=e.entanglements;for(var s=e.eventTimes,l=e.expirationTimes;0<o;){var c=31-Gt(o),u=1<<c;r[c]=0,s[c]=-1,l[c]=-1,o&=~u}if(null!==tl&&0==(24&i)&&tl.has(e)&&tl.delete(e),e===Is&&(Ps=Is=null,Ds=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,i=n.firstEffect):i=n:i=n.firstEffect,null!==i){if(r=Ms,Ms|=32,ks.current=null,ji=Xt,gi(s=mi())){if("selectionStart"in s)l={start:s.selectionStart,end:s.selectionEnd};else e:if(l=(l=s.ownerDocument)&&l.defaultView||window,(u=l.getSelection&&l.getSelection())&&0!==u.rangeCount){l=u.anchorNode,o=u.anchorOffset,c=u.focusNode,u=u.focusOffset;try{l.nodeType,c.nodeType}catch(e){l=null;break e}var h=0,d=-1,f=-1,p=0,m=0,g=s,_=null;t:for(;;){for(var y;g!==l||0!==o&&3!==g.nodeType||(d=h+o),g!==c||0!==u&&3!==g.nodeType||(f=h+u),3===g.nodeType&&(h+=g.nodeValue.length),null!==(y=g.firstChild);)_=g,g=y;for(;;){if(g===s)break t;if(_===l&&++p===o&&(d=h),_===c&&++m===u&&(f=h),null!==(y=g.nextSibling))break;_=(g=_).parentNode}g=y}
vendor: 4,683 bytes, line 2
2l=-1===d||-1===f?null:{start:d,end:f}}else l=null;l=l||{start:0,end:0}}else l=null;Ui={focusedElem:s,selectionRange:l},Xt=!1,sl=null,ll=!1,Ws=i;do{try{Pl()}catch(e){if(null===Ws)throw Error(a(330));Bl(Ws,e),Ws=Ws.nextEffect}}while(null!==Ws);sl=null,Ws=i;do{try{for(s=e;null!==Ws;){var v=Ws.flags;if(16&v&&_e(Ws.stateNode,""),128&v){var x=Ws.alternate;if(null!==x){var b=x.ref;null!==b&&("function"==typeof b?b(null):b.current=null)}}switch(1038&v){case 2:vs(Ws),Ws.flags&=-3;break;case 6:vs(Ws),Ws.flags&=-3,Es(Ws.alternate,Ws);break;case 1024:Ws.flags&=-1025;break;case 1028:Ws.flags&=-1025,Es(Ws.alternate,Ws);break;case 4:Es(Ws.alternate,Ws);break;case 8:ws(s,l=Ws);var w=l.alternate;_s(l),null!==w&&_s(w)}Ws=Ws.nextEffect}}catch(e){if(null===Ws)throw Error(a(330));Bl(Ws,e),Ws=Ws.nextEffect}}while(null!==Ws);if(b=Ui,x=mi(),v=b.focusedElem,s=b.selectionRange,x!==v&&v&&v.ownerDocument&&pi(v.ownerDocument.documentElement,v)){null!==s&&gi(v)&&(x=s.start,void 0===(b=s.end)&&(b=x),"selectionStart"in v?(v.selectionStart=x,v.selectionEnd=Math.min(b,v.value.length)):(b=(x=v.ownerDocument||document)&&x.defaultView||window).getSelection&&(b=b.getSelection(),l=v.textContent.length,w=Math.min(s.start,l),s=void 0===s.end?w:Math.min(s.end,l),!b.extend&&w>s&&(l=s,s=w,w=l),l=fi(v,w),o=fi(v,s),l&&o&&(1!==b.rangeCount||b.anchorNode!==l.node||b.anchorOffset!==l.offset||b.focusNode!==o.node||b.focusOffset!==o.offset)&&((x=x.createRange()).setStart(l.node,l.offset),b.removeAllRanges(),w>s?(b.addRange(x),b.extend(o.node,o.offset)):(x.setEnd(o.node,o.offset),b.addRange(x))))),x=[];for(b=v;b=b.parentNode;)1===b.nodeType&&x.push({element:b,left:b.scrollLeft,top:b.scrollTop});for("function"==typeof v.focus&&v.focus(),v=0;v<x.length;v++)(b=x[v]).element.scrollLeft=b.left,b.element.scrollTop=b.top}Xt=!!ji,Ui=ji=null,e.current=n,Ws=i;do{try{for(v=e;null!==Ws;){var E=Ws.flags;if(36&E&&ps(v,Ws.alternate,Ws),128&E){x=void 0;var T=Ws.ref;if(null!==T){var S=Ws.stateNode;Ws.tag,x=S,"function"==typeof T?T(x):T.current=x}}Ws=Ws.nextEffect}}catch(e){if(null===Ws)throw Error(a(330));Bl(Ws,e),Ws=Ws.nextEffect}}while(null!==Ws);Ws=null,Br(),Ms=r}else e.current=n;if(Ys)Ys=!1,Ks=e,Js=t;else for(Ws=i;null!==Ws;)t=Ws.nextEffect,Ws.nextEffect=null,8&Ws.flags&&((E=Ws).sibling=null,E.stateNode=null),Ws=t;if(0===(i=e.pendingLanes)&&(Hs=null),1===i?e===il?nl++:(nl=0,il=e):nl=0,n=n.stateNode,Er&&"function"==typeof Er.onCommitFiberRoot)try{Er.onCommitFiberRoot(wr,n,void 0,64==(64&n.current.flags))}catch(e){}if(fl(e,Vr()),Zs)throw Zs=!1,e=Xs,Xs=null,e;return 0!=(8&Ms)||Zr(),null}function Pl(){for(;null!==Ws;){var e=Ws.alternate;ll||null===sl||(0!=(8&Ws.flags)?Qe(Ws,sl)&&(ll=!0):13===Ws.tag&&Ss(e,Ws)&&Qe(Ws,sl)&&(ll=!0));var t=Ws.flags;0!=(256&t)&&fs(e,Ws),0==(512&t)||Ys||(Ys=!0,Wr(97,(function(){return Dl(),null}))),Ws=Ws.nextEffect}}function Dl(){if(90!==Js){var e=97<Js?97:Js;return Js=90,$r(e,Ol)}return!1}function zl(e,t){Qs.push(t,e),Ys||(Ys=!0,Wr(97,(function(){return Dl(),null})))}function Ll(e,t){el.push(t,e),Ys||(Ys=!0,Wr(97,(function(){return Dl(),null})))}function Ol(){if(null===Ks)return!1;var e=Ks;if(Ks=null,0!=(48&Ms))throw Error(a(331));var t=Ms;Ms|=32;var n=el;el=[];for(var i=0;i<n.length;i+=2){var r=n[i],o=n[i+1],s=r.destroy;if(r.destroy=void 0,"function"==typeof s)try{s()}catch(e){if(null===o)throw Error(a(330));Bl(o,e)}}for(n=Qs,Qs=[],i=0;i<n.length;i+=2){r=n[i],o=n[i+1];try{var l=r.create;r.destroy=l()}catch(e){if(null===o)throw Error(a(330));Bl(o,e)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return Ms=t,Zr(),!0}function Rl(e,t,n){uo(e,t=cs(0,t=as(n,t),1)),t=cl(),null!==(e=dl(e,1))&&(Vt(e,1,t),fl(e,t))}function Bl(e,t){if(3===e.tag)Rl(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){Rl(n,e,t);break}if(1===n.tag){var i=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===Hs||!Hs.has(i))){var r=us(n,e=as(t,e),1);if(uo(n,r),r=cl(),null!==(n=dl(n,1)))Vt(n,1,r),fl(n,r);else if("function"==typeof i.componentDidCatch&&(null===Hs||!Hs.has(i)))try{i.componentDidCatch(t,e)}catch(e){}break}}n=n.return}}function Fl(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),t=cl(),e.pingedLanes|=e.suspendedLanes&n,Is===e&&(Ds&n)===n&&(4===Os||3===Os&&(62914560&Ds)===Ds&&500>Vr()-Vs?bl(e,0):js|=n),fl(e,t)}function Nl(e,t){var n=e.stateNode;null!==n&&n.delete(t),0==(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Gr()?1:2:(0===ol&&(ol=Bs),0===(t=jt(62914560&~ol))&&(t=4194304))),n=cl(),null!==(e=dl(e,t))&&(Vt(e,t,n),fl(e,n))}function jl(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 4,661 bytes, line 2
2ype=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function Ul(e,t,n,i){return new jl(e,t,n,i)}function Vl(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Gl(e,t){var n=e.alternate;return null===n?((n=Ul(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ql(e,t,n,i,r,o){var s=2;if(i=e,"function"==typeof e)Vl(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case T:return $l(n.children,r,o,t);case R:s=8,r|=16;break;case S:s=8,r|=1;break;case A:return(e=Ul(12,n,t,8|r)).elementType=A,e.type=A,e.lanes=o,e;case I:return(e=Ul(13,n,t,r)).type=I,e.elementType=I,e.lanes=o,e;case P:return(e=Ul(19,n,t,r)).elementType=P,e.lanes=o,e;case B:return Wl(n,r,o,t);case F:return(e=Ul(24,n,t,r)).elementType=F,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case C:s=10;break e;case k:s=9;break e;case M:s=11;break e;case D:s=14;break e;case z:s=16,i=null;break e;case L:s=22;break e}throw Error(a(130,null==e?e:typeof e,""))}return(t=Ul(s,n,t,r)).elementType=e,t.type=i,t.lanes=o,t}function $l(e,t,n,i){return(e=Ul(7,e,i,t)).lanes=n,e}function Wl(e,t,n,i){return(e=Ul(23,e,i,t)).elementType=B,e.lanes=n,e}function Zl(e,t,n){return(e=Ul(6,e,null,t)).lanes=n,e}function Xl(e,t,n){return(t=Ul(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hl(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=Ut(0),this.expirationTimes=Ut(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.mutableSourceEagerHydrationData=null}function Yl(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:E,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}}function Kl(e,t,n,i){var r=t.current,o=cl(),s=ul(r);e:if(n){t:{if(He(n=n._reactInternals)!==n||1!==n.tag)throw Error(a(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(gr(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(a(171))}if(1===n.tag){var c=n.type;if(gr(c)){n=vr(n,c,l);break e}}n=l}else n=hr;return null===t.context?t.context=n:t.pendingContext=n,(t=co(o,s)).payload={element:e},null!==(i=void 0===i?null:i)&&(t.callback=i),uo(r,t),hl(r,s,o),s}function Jl(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Ql(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function ec(e,t){Ql(e,t),(e=e.alternate)&&Ql(e,t)}function tc(e,t,n){var i=null!=n&&null!=n.hydrationOptions&&n.hydrationOptions.mutableSources||null;if(n=new Hl(e,t,null!=n&&!0===n.hydrate),t=Ul(3,null,null,2===t?7:1===t?3:0),n.current=t,t.stateNode=n,so(t),e[Qi]=n.current,Pi(8===e.nodeType?e.parentNode:e),i)for(e=0;e<i.length;e++){var r=(t=i[e])._getVersion;r=r(t._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[t,r]:n.mutableSourceEagerHydrationData.push(t,r)}this._internalRoot=n}function nc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function ic(e,t,n,i,r){var o=n._reactRootContainer;if(o){var a=o._internalRoot;if("function"==typeof r){var s=r;r=function(){var e=Jl(a);s.call(e)}}Kl(t,a,e,r)}else{if(o=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new tc(e,0,t?{hydrate:!0}:void 0)}(n,i),a=o._internalRoot,"function"==typeof r){var l=r;r=function(){var e=Jl(a);l.call(e)}}yl((function(){Kl(t,a,e,r)}
vendor: 9,384 bytes, line 2
2))}return Jl(a)}function rc(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!nc(t))throw Error(a(200));return Yl(e,t,null,n)}$s=function(e,t,n){var i=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||fr.current)Ra=!0;else{if(0==(n&i)){switch(Ra=!1,t.tag){case 3:Wa(t),Zo();break;case 5:Oo(t);break;case 1:gr(t.type)&&xr(t);break;case 4:zo(t,t.stateNode.containerInfo);break;case 10:i=t.memoizedProps.value;var r=t.type._context;ur(Kr,r._currentValue),r._currentValue=i;break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?Ka(e,t,n):(ur(Bo,1&Bo.current),null!==(t=ns(e,t,n))?t.sibling:null);ur(Bo,1&Bo.current);break;case 19:if(i=0!=(n&t.childLanes),0!=(64&e.flags)){if(i)return ts(e,t,n);t.flags|=64}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null,r.lastEffect=null),ur(Bo,Bo.current),i)break;return null;case 23:case 24:return t.lanes=0,Ua(e,t,n)}return ns(e,t,n)}Ra=0!=(16384&e.flags)}else Ra=!1;switch(t.lanes=0,t.tag){case 2:if(i=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,r=mr(t,dr.current),ro(t,n),r=aa(null,t,i,e,r,n),t.flags|=1,"object"==typeof r&&null!==r&&"function"==typeof r.render&&void 0===r.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,gr(i)){var o=!0;xr(t)}else o=!1;t.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,so(t);var s=i.getDerivedStateFromProps;"function"==typeof s&&go(t,i,s,e),r.updater=_o,t.stateNode=r,r._reactInternals=t,bo(t,i,e,n),t=$a(null,t,i,!0,o,n)}else t.tag=0,Ba(null,t,r,n),t=t.child;return t;case 16:r=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,r=(o=r._init)(r._payload),t.type=r,o=t.tag=function(e){if("function"==typeof e)return Vl(e)?1:0;if(null!=e){if((e=e.$$typeof)===M)return 11;if(e===D)return 14}return 2}(r),e=Yr(r,e),o){case 0:t=Ga(null,t,r,e,n);break e;case 1:t=qa(null,t,r,e,n);break e;case 11:t=Fa(null,t,r,e,n);break e;case 14:t=Na(null,t,r,Yr(r.type,e),i,n);break e}throw Error(a(306,r,""))}return t;case 0:return i=t.type,r=t.pendingProps,Ga(e,t,i,r=t.elementType===i?r:Yr(i,r),n);case 1:return i=t.type,r=t.pendingProps,qa(e,t,i,r=t.elementType===i?r:Yr(i,r),n);case 3:if(Wa(t),i=t.updateQueue,null===e||null===i)throw Error(a(282));if(i=t.pendingProps,r=null!==(r=t.memoizedState)?r.element:null,lo(e,t),fo(t,i,null,n),(i=t.memoizedState.element)===r)Zo(),t=ns(e,t,n);else{if((o=(r=t.stateNode).hydrate)&&(jo=Zi(t.stateNode.containerInfo.firstChild),No=t,o=Uo=!0),o){if(null!=(e=r.mutableSourceEagerHydrationData))for(r=0;r<e.length;r+=2)(o=e[r])._workInProgressVersionPrimary=e[r+1],Xo.push(o);for(n=Co(t,null,i,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Ba(e,t,i,n),Zo();t=t.child}return t;case 5:return Oo(t),null===e&&qo(t),i=t.type,r=t.pendingProps,o=null!==e?e.memoizedProps:null,s=r.children,Gi(i,r)?s=null:null!==o&&Gi(i,o)&&(t.flags|=16),Va(e,t),Ba(e,t,s,n),t.child;case 6:return null===e&&qo(t),null;case 13:return Ka(e,t,n);case 4:return zo(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=Ao(t,null,i,n):Ba(e,t,i,n),t.child;case 11:return i=t.type,r=t.pendingProps,Fa(e,t,i,r=t.elementType===i?r:Yr(i,r),n);case 7:return Ba(e,t,t.pendingProps,n),t.child;case 8:case 12:return Ba(e,t,t.pendingProps.children,n),t.child;case 10:e:{i=t.type._context,r=t.pendingProps,s=t.memoizedProps,o=r.value;var l=t.type._context;if(ur(Kr,l._currentValue),l._currentValue=o,null!==s)if(l=s.value,0==(o=ci(l,o)?0:0|("function"==typeof i._calculateChangedBits?i._calculateChangedBits(l,o):1073741823))){if(s.children===r.children&&!fr.current){t=ns(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var c=l.dependencies;if(null!==c){s=l.child;for(var u=c.firstContext;null!==u;){if(u.context===i&&0!=(u.observedBits&o)){1===l.tag&&((u=co(-1,n&-n)).tag=2,uo(l,u)),l.lanes|=n,null!==(u=l.alternate)&&(u.lanes|=n),io(l.return,n),c.lanes|=n;break}u=u.next}}else s=10===l.tag&&l.type===t.type?null:l.child;if(null!==s)s.return=l;else for(s=l;null!==s;){if(s===t){s=null;break}if(null!==(l=s.sibling)){l.return=s.return,s=l;break}s=s.return}l=s}Ba(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,i=(o=t.pendingProps).children,ro(t,n),i=i(r=oo(r,o.unstable_observedBits)),t.flags|=1,Ba(e,t,i,n),t.child;case 14:return o=Yr(r=t.type,t.pendingProps),Na(e,t,r,o=Yr(r.type,o),i,n);case 15:return ja(e,t,t.type,t.pendingProps,i,n);case 17:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Yr(i,r),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,gr(i)?(e=!0,xr(t)):e=!1,ro(t,n),vo(t,i,r),bo(t,i,r,n),$a(null,t,i,!0,e,n);case 19:return ts(e,t,n);case 23:case 24:return Ua(e,t,n)}throw Error(a(156,t.tag))},tc.prototype.render=function(e){Kl(e,this._internalRoot,null,null)},tc.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Kl(null,e,null,(function(){t[Qi]=null}))},et=function(e){13===e.tag&&(hl(e,4,cl()),ec(e,4))},tt=function(e){13===e.tag&&(hl(e,67108864,cl()),ec(e,67108864))},nt=function(e){if(13===e.tag){var t=cl(),n=ul(e);hl(e,n,t),ec(e,n)}},it=function(e,t){return t()},Ae=function(e,t,n){switch(t){case"input":if(ne(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=rr(i);if(!r)throw Error(a(90));K(i),ne(i,r)}}}break;case"textarea":ce(e,n);break;case"select":null!=(t=n.value)&&ae(e,!!n.multiple,t,!1)}},De=_l,ze=function(e,t,n,i,r){var o=Ms;Ms|=4;try{return $r(98,e.bind(null,t,n,i,r))}finally{0===(Ms=o)&&(qs(),Zr())}},Le=function(){0==(49&Ms)&&(function(){if(null!==tl){var e=tl;tl=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,fl(e,Vr())}))}Zr()}(),Dl())},Oe=function(e,t){var n=Ms;Ms|=2;try{return e(t)}finally{0===(Ms=n)&&(qs(),Zr())}};var oc={Events:[nr,ir,rr,Ie,Pe,Dl,{current:!1}]},ac={findFiberByHostInstance:tr,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},sc={bundleType:ac.bundleType,version:ac.version,rendererPackageName:ac.rendererPackageName,rendererConfig:ac.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:b.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Je(e))?null:e.stateNode},findFiberByHostInstance:ac.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!lc.isDisabled&&lc.supportsFiber)try{wr=lc.inject(sc),Er=lc}catch(me){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=oc,t.createPortal=rc,t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(a(188));throw Error(a(268,Object.keys(e)))}return null===(e=Je(t))?null:e.stateNode},t.flushSync=function(e,t){var n=Ms;if(0!=(48&n))return e(t);Ms|=1;try{if(e)return $r(99,e.bind(null,t))}finally{Ms=n,Zr()}},t.hydrate=function(e,t,n){if(!nc(t))throw Error(a(200));return ic(null,e,t,!0,n)},t.render=function(e,t,n){if(!nc(t))throw Error(a(200));return ic(null,e,t,!1,n)},t.unmountComponentAtNode=function(e){if(!nc(e))throw Error(a(40));return!!e._reactRootContainer&&(yl((function(){ic(null,null,e,!1,(function(){e._reactRootContainer=null,e[Qi]=null}))})),!0)},t.unstable_batchedUpdates=_l,t.unstable_createPortal=function(e,t){return rc(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},t.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!nc(n))throw Error(a(200));if(null==e||void 0===e._reactInternals)throw Error(a(38));return ic(e,t,n,!1,i)},t.version="17.0.2"},961:(e,t,n)=>{"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(799)},194:(e,t,n)=>{(()=>{var t={296:(e,t,n)=>{var i=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),h=Object.prototype.toString,d=Math.max,f=Math.min,p=function(){return u.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==h.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=o.test(e);return n||a.test(e)?s(e.slice(2),n?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var i,r,o,a,s,l,c=0,u=!1,h=!1,_=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=i,o=r;return i=r=void 0,c=t,a=e.apply(o,n)}function v(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=o}function x(){var e=p();if(v(e))return b(e);s=setTimeout(x,function(e){var n=t-(e-l);return h?f(n,o-(e-c)):n}(e))}
2function b(e){return s=void 0,_&&i?y(e):(i=r=void 0,a)}function w(){var e=p(),n=v(e);if(i=arguments,r=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(x,t),u?y(e):a}(l);if(h)return s=setTimeout(x,t),y(l)}return void 0===s&&(s=setTimeout(x,t)),a}return t=g(t)||0,m(n)&&(u=!!n.leading,o=(h="maxWait"in n)?d(g(n.maxWait)||0,t):o,_="trailing"in n?!!n.trailing:_),w.cancel=function(){void 0!==s&&clearTimeout(s),c=0,i=l=r=s=void 0},w.flush=function(){return void 0===s?a:b(p())},w}},96:(e,t,n)=>{var i="Expected a function",r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,l=parseInt,c="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,u="object"==typeof self&&self&&self.Object===Object&&self,h=c||u||Function("return this")(),d=Object.prototype.toString,f=Math.max,p=Math.min,m=function(){return h.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function _(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var n=a.test(e);return n||s.test(e)?l(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError(i);return g(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),function(e,t,n){var r,o,a,s,l,c,u=0,h=!1,d=!1,y=!0;if("function"!=typeof e)throw new TypeError(i);function v(t){var n=r,i=o;return r=o=void 0,u=t,s=e.apply(i,n)}function x(e){var n=e-c;return void 0===c||n>=t||n<0||d&&e-u>=a}function b(){var e=m();if(x(e))return w(e);l=setTimeout(b,function(e){var n=t-(e-c);return d?p(n,a-(e-u)):n}(e))}function w(e){return l=void 0,y&&r?v(e):(r=o=void 0,s)}function E(){var e=m(),n=x(e);if(r=arguments,o=this,c=e,n){if(void 0===l)return function(e){return u=e,l=setTimeout(b,t),h?v(e):s}(c);if(d)return l=setTimeout(b,t),v(c)}return void 0===l&&(l=setTimeout(b,t)),s}return t=_(t)||0,g(n)&&(h=!!n.leading,a=(d="maxWait"in n)?f(_(n.maxWait)||0,t):a,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==l&&clearTimeout(l),u=0,r=c=o=l=void 0},E.flush=function(){return void 0===l?s:w(m())},E}(e,t,{leading:r,maxWait:t,trailing:o})}},703:(e,t,n)=>{"use strict";var i=n(414);function r(){}function o(){}o.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,o,a){if(a!==i){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:r};return n.PropTypes=n,n}},697:(e,t,n)=>{e.exports=n(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}},i={};function r(e){var n=i[e];if(void 0!==n)return n.exports;var o=i[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";r.r(o),r.d(o,{LazyLoadComponent:()=>W,LazyLoadImage:()=>ie,trackWindowScroll:()=>O});const e=n(526);var t=r.n(e),i=r(697);const a=n(961);var s=r.n(a);function l(){return"undefined"!=typeof window&&"IntersectionObserver"in window&&"isIntersecting"in window.IntersectionObserverEntry.prototype}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function h(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==c(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===c(t)?t:String(t)}
2function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}var g=function(e){e.forEach((function(e){e.isIntersecting&&e.target.onVisible()}))},_={},y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(f,e);var n,i,r,o,a=(r=f,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=m(r);if(o){var n=m(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function f(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),(t=a.call(this,e)).supportsObserver=!e.scrollPosition&&e.useIntersectionObserver&&l(),t.supportsObserver){var n=e.threshold;t.observer=function(e){return _[e]=_[e]||new IntersectionObserver(g,{rootMargin:e+"px"}),_[e]}(n)}return t}return n=f,i=[{key:"componentDidMount",value:function(){this.placeholder&&this.observer&&(this.placeholder.onVisible=this.props.onVisible,this.observer.observe(this.placeholder)),this.supportsObserver||this.updateVisibility()}},{key:"componentWillUnmount",value:function(){this.observer&&this.placeholder&&this.observer.unobserve(this.placeholder)}},{key:"componentDidUpdate",value:function(){this.supportsObserver||this.updateVisibility()}},{key:"getPlaceholderBoundingBox",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props.scrollPosition,t=this.placeholder.getBoundingClientRect(),n=s().findDOMNode(this.placeholder).style,i=parseInt(n.getPropertyValue("margin-left"),10)||0,r=parseInt(n.getPropertyValue("margin-top"),10)||0;return{bottom:e.y+t.bottom+r,left:e.x+t.left+i,right:e.x+t.right+i,top:e.y+t.top+r}}},{key:"isPlaceholderInViewport",value:function(){if("undefined"==typeof window||!this.placeholder)return!1;var e=this.props,t=e.scrollPosition,n=e.threshold,i=this.getPlaceholderBoundingBox(t),r=t.y+window.innerHeight,o=t.x,a=t.x+window.innerWidth,s=t.y;return Boolean(s-n<=i.bottom&&r+n>=i.top&&o-n<=i.right&&a+n>=i.left)}},{key:"updateVisibility",value:function(){this.isPlaceholderInViewport()&&this.props.onVisible()}},{key:"render",value:function(){var e=this,n=this.props,i=n.className,r=n.height,o=n.placeholder,a=n.style,s=n.width;if(o&&"function"!=typeof o.type)return t().cloneElement(o,{ref:function(t){return e.placeholder=t}});var l=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({display:"inline-block"},a);return void 0!==s&&(l.width=s),void 0!==r&&(l.height=r),t().createElement("span",{className:i,ref:function(t){return e.placeholder=t},style:l},o)}}],i&&d(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),f}(t().Component);y.propTypes={onVisible:i.PropTypes.func.isRequired,className:i.PropTypes.string,height:i.PropTypes.oneOfType([i.PropTypes.number,i.PropTypes.string]),placeholder:i.PropTypes.element,threshold:i.PropTypes.number,useIntersectionObserver:i.PropTypes.bool,scrollPosition:i.PropTypes.shape({x:i.PropTypes.number.isRequired,y:i.PropTypes.number.isRequired}),width:i.PropTypes.oneOfType([i.PropTypes.number,i.PropTypes.string])},y.defaultProps={className:"",placeholder:null,threshold:100,useIntersectionObserver:!0};const v=y;var x=r(296),b=r.n(x),w=r(96),E=r.n(w),T=function(e){var t=getComputedStyle(e,null);return t.getPropertyValue("overflow")+t.getPropertyValue("overflow-y")+t.getPropertyValue("overflow-x")};const S=function(e){if(!(e instanceof HTMLElement))return window;for(var t=e;t&&t instanceof HTMLElement;){if(/(scroll|auto)/.test(T(t)))return t;t=t.parentNode}return window}
2;function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}var C=["delayMethod","delayTime"];function k(){return k=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},k.apply(this,arguments)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}function I(e,t){if(t&&("object"===A(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return P(e)}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D(e){return D=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},D(e)}var z=function(){return"undefined"==typeof window?0:window.scrollX||window.pageXOffset},L=function(){return"undefined"==typeof window?0:window.scrollY||window.pageYOffset};const O=function(e){var n=function(n){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(u,n);var i,r,o,a,c=(o=u,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=D(o);if(a){var n=D(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return I(this,e)});function u(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(n=c.call(this,e)).useIntersectionObserver=e.useIntersectionObserver&&l(),n.useIntersectionObserver)return I(n);var i=n.onChangeScroll.bind(P(n));return"debounce"===e.delayMethod?n.delayedScroll=b()(i,e.delayTime):"throttle"===e.delayMethod&&(n.delayedScroll=E()(i,e.delayTime)),n.state={scrollPosition:{x:z(),y:L()}},n.baseComponentRef=t().createRef(),n}return i=u,(r=[{key:"componentDidMount",value:function(){this.addListeners()}},{key:"componentWillUnmount",value:function(){this.removeListeners()}},{key:"componentDidUpdate",value:function(){"undefined"==typeof window||this.useIntersectionObserver||S(s().findDOMNode(this.baseComponentRef.current))!==this.scrollElement&&(this.removeListeners(),this.addListeners())}},{key:"addListeners",value:function(){"undefined"==typeof window||this.useIntersectionObserver||(this.scrollElement=S(s().findDOMNode(this.baseComponentRef.current)),this.scrollElement.addEventListener("scroll",this.delayedScroll,{passive:!0}),window.addEventListener("resize",this.delayedScroll,{passive:!0}),this.scrollElement!==window&&window.addEventListener("scroll",this.delayedScroll,{passive:!0}))}},{key:"removeListeners",value:function(){"undefined"==typeof window||this.useIntersectionObserver||(this.scrollElement.removeEventListener("scroll",this.delayedScroll),window.removeEventListener("resize",this.delayedScroll),this.scrollElement!==window&&window.removeEventListener("scroll",this.delayedScroll))}},{key:"onChangeScroll",value:function(){this.useIntersectionObserver||this.setState({scrollPosition:{x:z(),y:L()}})}},{key:"render",value:function(){var n=this.props,i=(n.delayMethod,n.delayTime,function(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(n,C)),r=this.useIntersectionObserver?null:this.state.scrollPosition;return t().createElement(e,k({forwardRef:this.baseComponentRef,scrollPosition:r},i))}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=function(e,t){if("object"!==A(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==A(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===A(r)?r:String(r)),i)}var r}(i.prototype,r),Object.defineProperty(i,"prototype",{writable:!1}),u}(t().Component);return n.propTypes={delayMethod:i.PropTypes.oneOf(["debounce","throttle"]),delayTime:i.PropTypes.number,useIntersectionObserver:i.PropTypes.bool},n.defaultProps={delayMethod:"throttle",delayTime:300,useIntersectionObserver:!0},n};function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}
2function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},B(e,t)}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}(s,e);var n,i,r,o,a=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=F(r);if(o){var n=F(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===R(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),a.call(this,e)}return n=s,(i=[{key:"render",value:function(){return t().createElement(v,this.props)}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=function(e,t){if("object"!==R(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==R(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===R(r)?r:String(r)),i)}var r}(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);const j=O(N);function U(e){return U="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(e)}function V(e,t){return V=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},V(e,t)}function G(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e){return q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},q(e)}var $=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&V(e,t)}(s,e);var n,i,r,o,a=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=q(r);if(o){var n=q(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===U(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return G(e)}(this,e)});function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),t=a.call(this,e);var n=e.afterLoad,i=e.beforeLoad,r=e.scrollPosition,o=e.visibleByDefault;return t.state={visible:o},o&&(i(),n()),t.onVisible=t.onVisible.bind(G(t)),t.isScrollTracked=Boolean(r&&Number.isFinite(r.x)&&r.x>=0&&Number.isFinite(r.y)&&r.y>=0),t}return n=s,(i=[{key:"componentDidUpdate",value:function(e,t){t.visible!==this.state.visible&&this.props.afterLoad()}},{key:"onVisible",value:function(){this.props.beforeLoad(),this.setState({visible:!0})}},{key:"render",value:function(){if(this.state.visible)return this.props.children;var e=this.props,n=e.className,i=e.delayMethod,r=e.delayTime,o=e.height,a=e.placeholder,s=e.scrollPosition,c=e.style,u=e.threshold,h=e.useIntersectionObserver,d=e.width;return this.isScrollTracked||h&&l()?t().createElement(v,{className:n,height:o,onVisible:this.onVisible,placeholder:a,scrollPosition:s,style:c,threshold:u,useIntersectionObserver:h,width:d}):t().createElement(j,{className:n,delayMethod:i,delayTime:r,height:o,onVisible:this.onVisible,placeholder:a,style:c,threshold:u,width:d})}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=function(e,t){if("object"!==U(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==U(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(i.key),"symbol"===U(r)?r:String(r)),i)}var r}
2(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);$.propTypes={afterLoad:i.PropTypes.func,beforeLoad:i.PropTypes.func,useIntersectionObserver:i.PropTypes.bool,visibleByDefault:i.PropTypes.bool},$.defaultProps={afterLoad:function(){return{}},beforeLoad:function(){return{}},useIntersectionObserver:!0,visibleByDefault:!1};const W=$;function Z(e){return Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z(e)}var X=["afterLoad","beforeLoad","delayMethod","delayTime","effect","placeholder","placeholderSrc","scrollPosition","threshold","useIntersectionObserver","visibleByDefault","wrapperClassName","wrapperProps"];function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){K(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function K(e,t,n){return(t=Q(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},J.apply(this,arguments)}function Q(e){var t=function(e,t){if("object"!==Z(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==Z(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Z(t)?t:String(t)}function ee(e,t){return ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ee(e,t)}function te(e){return te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},te(e)}var ne=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ee(e,t)}(s,e);var n,i,r,o,a=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=te(r);if(o){var n=te(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Z(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=a.call(this,e)).state={loaded:!1},t}return n=s,(i=[{key:"onImageLoad",value:function(){var e=this;return this.state.loaded?null:function(t){e.props.onLoad(t),e.props.afterLoad(),e.setState({loaded:!0})}}},{key:"getImg",value:function(){var e=this.props,n=(e.afterLoad,e.beforeLoad,e.delayMethod,e.delayTime,e.effect,e.placeholder,e.placeholderSrc,e.scrollPosition,e.threshold,e.useIntersectionObserver,e.visibleByDefault,e.wrapperClassName,e.wrapperProps,function(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}(e,X));
2return t().createElement("img",J({},n,{onLoad:this.onImageLoad()}))}},{key:"getLazyLoadImage",value:function(){var e=this.props,n=e.beforeLoad,i=e.className,r=e.delayMethod,o=e.delayTime,a=e.height,s=e.placeholder,l=e.scrollPosition,c=e.style,u=e.threshold,h=e.useIntersectionObserver,d=e.visibleByDefault,f=e.width;return t().createElement(W,{beforeLoad:n,className:i,delayMethod:r,delayTime:o,height:a,placeholder:s,scrollPosition:l,style:c,threshold:u,useIntersectionObserver:h,visibleByDefault:d,width:f},this.getImg())}},{key:"getWrappedLazyLoadImage",value:function(e){var n=this.props,i=n.effect,r=n.height,o=n.placeholderSrc,a=n.width,s=n.wrapperClassName,l=n.wrapperProps,c=this.state.loaded,u=c?" lazy-load-image-loaded":"",h=c||!o?{}:{backgroundImage:"url(".concat(o,")"),backgroundSize:"100% 100%"};return t().createElement("span",J({className:s+" lazy-load-image-background "+i+u,style:Y(Y({},h),{},{color:"transparent",display:"inline-block",height:r,width:a})},l),e)}},{key:"render",value:function(){var e=this.props,t=e.effect,n=e.placeholderSrc,i=e.visibleByDefault,r=e.wrapperClassName,o=e.wrapperProps,a=this.getLazyLoadImage();return(t||n)&&!i||r||o?this.getWrappedLazyLoadImage(a):a}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,Q(i.key),i)}}(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),s}(t().Component);ne.propTypes={onLoad:i.PropTypes.func,afterLoad:i.PropTypes.func,beforeLoad:i.PropTypes.func,delayMethod:i.PropTypes.string,delayTime:i.PropTypes.number,effect:i.PropTypes.string,placeholderSrc:i.PropTypes.string,threshold:i.PropTypes.number,useIntersectionObserver:i.PropTypes.bool,visibleByDefault:i.PropTypes.bool,wrapperClassName:i.PropTypes.string,wrapperProps:i.PropTypes.object},ne.defaultProps={onLoad:function(){},afterLoad:function(){return{}},beforeLoad:function(){return{}},delayMethod:"throttle",delayTime:300,effect:"",placeholderSrc:null,threshold:100,useIntersectionObserver:!0,visibleByDefault:!1,wrapperClassName:""};const ie=ne})(),e.exports=o})()},218:(e,t,n)=>{"use strict";var i=n(813),r=60103,o=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,l=60112;t.Suspense=60113;var c=60115,u=60116;if("function"==typeof Symbol&&Symbol.for){var h=Symbol.for;r=h("react.element"),o=h("react.portal"),t.Fragment=h("react.fragment"),t.StrictMode=h("react.strict_mode"),t.Profiler=h("react.profiler"),a=h("react.provider"),s=h("react.context"),l=h("react.forward_ref"),t.Suspense=h("react.suspense"),c=h("react.memo"),u=h("react.lazy")}var d="function"==typeof Symbol&&Symbol.iterator;function f(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m={};function g(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}function _(){}function y(e,t,n){this.props=e,this.context=t,this.refs=m,this.updater=n||p}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(f(85));this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=g.prototype;var v=y.prototype=new _;v.constructor=y,i(v,g.prototype),v.isPureReactComponent=!0;var x={current:null},b=Object.prototype.hasOwnProperty,w={key:!0,ref:!0,__self:!0,__source:!0};function E(e,t,n){var i,o={},a=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)b.call(t,i)&&!w.hasOwnProperty(i)&&(o[i]=t[i]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(i in l=e.defaultProps)void 0===o[i]&&(o[i]=l[i]);return{$$typeof:r,type:e,key:a,ref:s,props:o,_owner:x.current}}function T(e){return"object"==typeof e&&null!==e&&e.$$typeof===r}var S=/\/+/g;function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function C(e,t,n,i,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case r:case o:l=!0}}if(l)return a=a(l=e),e=""===i?"."+A(l,0):i,Array.isArray(a)?(n="",null!=e&&(n=e.replace(S,"$&/")+"/"),C(a,t,n,"",(function(e){return e}))):null!=a&&(T(a)&&(a=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,n+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(S,"$&/")+"/")+e)),t.push(a)),1;if(l=0,i=""===i?".":i+":",Array.isArray(e))for(var c=0;c<e.length;c++){var u=i+A(s=e[c],c);l+=C(s,t,n,u,a)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(s=e.next()).done;)l+=C(s=s.value,t,n,u=i+A(s,c++),a);else if("object"===s)throw t=""+e,Error(f(31,"[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t));return l}
vendor: 8,142 bytes, line 2
2function k(e,t,n){if(null==e)return e;var i=[],r=0;return C(e,i,"","",(function(e){return t.call(n,e,r++)})),i}function M(e){if(-1===e._status){var t=e._result;t=t(),e._status=0,e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}if(1===e._status)return e._result;throw e._result}var I={current:null};function P(){var e=I.current;if(null===e)throw Error(f(321));return e}var D={ReactCurrentDispatcher:I,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:x,IsSomeRendererActing:{current:!1},assign:i};t.Children={map:k,forEach:function(e,t,n){k(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return k(e,(function(){t++})),t},toArray:function(e){return k(e,(function(e){return e}))||[]},only:function(e){if(!T(e))throw Error(f(143));return e}},t.Component=g,t.PureComponent=y,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=D,t.cloneElement=function(e,t,n){if(null==e)throw Error(f(267,e));var o=i({},e.props),a=e.key,s=e.ref,l=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,l=x.current),void 0!==t.key&&(a=""+t.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(u in t)b.call(t,u)&&!w.hasOwnProperty(u)&&(o[u]=void 0===t[u]&&void 0!==c?c[u]:t[u])}var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){c=Array(u);for(var h=0;h<u;h++)c[h]=arguments[h+2];o.children=c}return{$$typeof:r,type:e.type,key:a,ref:s,props:o,_owner:l}},t.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:a,_context:e},e.Consumer=e},t.createElement=E,t.createFactory=function(e){var t=E.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:l,render:e}},t.isValidElement=T,t.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:M}},t.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},t.useCallback=function(e,t){return P().useCallback(e,t)},t.useContext=function(e,t){return P().useContext(e,t)},t.useDebugValue=function(){},t.useEffect=function(e,t){return P().useEffect(e,t)},t.useImperativeHandle=function(e,t,n){return P().useImperativeHandle(e,t,n)},t.useLayoutEffect=function(e,t){return P().useLayoutEffect(e,t)},t.useMemo=function(e,t){return P().useMemo(e,t)},t.useReducer=function(e,t,n){return P().useReducer(e,t,n)},t.useRef=function(e){return P().useRef(e)},t.useState=function(e){return P().useState(e)},t.version="17.0.2"},526:(e,t,n)=>{"use strict";e.exports=n(218)},196:(e,t)=>{"use strict";var n,i,r,o;if("object"==typeof performance&&"function"==typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var c=null,u=null,h=function(){if(null!==c)try{var e=t.unstable_now();c(!0,e),c=null}catch(e){throw setTimeout(h,0),e}};n=function(e){null!==c?setTimeout(n,0,e):(c=e,setTimeout(h,0))},i=function(e,t){u=setTimeout(e,t)},r=function(){clearTimeout(u)},t.unstable_shouldYield=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var d=window.setTimeout,f=window.clearTimeout;if("undefined"!=typeof console){var p=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var m=!1,g=null,_=-1,y=5,v=0;t.unstable_shouldYield=function(){return t.unstable_now()>=v},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,b=x.port2;x.port1.onmessage=function(){if(null!==g){var e=t.unstable_now();v=e+y;try{g(!0,e)?b.postMessage(null):(m=!1,g=null)}catch(e){throw b.postMessage(null),e}}else m=!1},n=function(e){g=e,m||(m=!0,b.postMessage(null))},i=function(e,n){_=d((function(){e(t.unstable_now())}),n)},r=function(){f(_),_=-1}}function w(e,t){var n=e.length;e.push(t);e:for(;;){var i=n-1>>>1,r=e[i];if(!(void 0!==r&&0<S(r,t)))break e;e[i]=t,e[n]=r,n=i}}function E(e){return void 0===(e=e[0])?null:e}function T(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,r=e.length;i<r;){var o=2*(i+1)-1,a=e[o],s=o+1,l=e[s];if(void 0!==a&&0>S(a,n))void 0!==l&&0>S(l,a)?(e[i]=l,e[s]=n,i=s):(e[i]=a,e[o]=n,i=o);else{if(!(void 0!==l&&0>S(l,n)))break e;e[i]=l,e[s]=n,i=s}}}return t}return null}function S(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var A=[],C=[],k=1,M=null,I=3,P=!1,D=!1,z=!1;function L(e){for(var t=E(C);null!==t;){if(null===t.callback)T(C);else{if(!(t.startTime<=e))break;T(C),t.sortIndex=t.expirationTime,w(A,t)}t=E(C)}}function O(e){if(z=!1,L(e),!D)if(null!==E(A))D=!0,n(R);else{var t=E(C);null!==t&&i(O,t.startTime-e)}}function R(e,n){D=!1,z&&(z=!1,r()),P=!0;var o=I;try{for(L(n),M=E(A);null!==M&&(!(M.expirationTime>n)||e&&!t.unstable_shouldYield());){var a=M.callback;if("function"==typeof a){M.callback=null,I=M.priorityLevel;var s=a(M.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?M.callback=s:M===E(A)&&T(A),L(n)}else T(A);M=E(A)}if(null!==M)var l=!0;else{var c=E(C);null!==c&&i(O,c.startTime-n),l=!1}return l}finally{M=null,I=o,P=!1}}var B=o;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){D||P||(D=!0,n(R))},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_getFirstCallbackNode=function(){return E(A)},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_scheduleCallback=function(e,o,a){var s=t.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?s+a:s,e){case 1:var l=-1;break;case 2:l=250;break;case 5:l=1073741823;break;case 4:l=1e4;break;default:l=5e3}return e={id:k++,callback:o,priorityLevel:e,startTime:a,expirationTime:l=a+l,sortIndex:-1},a>s?(e.sortIndex=a,w(C,e),null===E(A)&&e===E(C)&&(z?r():z=!0,i(O,a-s))):(e.sortIndex=l,w(A,e),D||P||(D=!0,n(R))),e},t.unstable_wrapCallback=function(e){var t=I;return function(){var n=I;I=t;try{return e.apply(this,arguments)}finally{I=n}}}},851:(e,t,n)=>{"use strict";e.exports=n(196)},701:e=>{"use strict";var t=[];function n(e){for(var n=-1,i=0;i<t.length;i++)if(t[i].identifier===e){n=i;break}return n}function i(e,i){for(var o={},a=[],s=0;s<e.length;s++){var l=e[s],c=i.base?l[0]+i.base:l[0],u=o[c]||0,h="".concat(c," ").concat(u);o[c]=u+1;var d=n(h),f={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==d)t[d].references++,t[d].updater(f);else{var p=r(f,i);i.byIndex=s,t.splice(s,0,{identifier:h,updater:p,references:1})}a.push(h)}return a}function r(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,r){var o=i(e=e||[],r=r||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var s=n(o[a]);t[s].references--}for(var l=i(e,r),c=0;c<o.length;c++){var u=n(o[c]);0===t[u].references&&(t[u].updater(),t.splice(u,1))}o=l}}},80:e=>{"use strict";var t={};e.exports=function(e,n){var i=function(e){if(void 0===t[e]){var n=document.querySelector(e);
2if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(n)}},182:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},850:(e,t,n)=>{"use strict";e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},236:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var i="";n.supports&&(i+="@supports (".concat(n.supports,") {")),n.media&&(i+="@media ".concat(n.media," {"));var r=void 0!==n.layer;r&&(i+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),i+=n.css,r&&(i+="}"),n.media&&(i+="}"),n.supports&&(i+="}");var o=n.sourceMap;o&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},213:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},558:(e,t,n)=>{var i,r;!function(o,a){i=[n(360)],r=function(e){return function(e,t){"use strict";function n(){}var i=n.prototype=Object.create(t.prototype);i.bindHandles=function(){this._bindHandles(!0)},i.unbindHandles=function(){this._bindHandles(!1)},i._bindHandles=function(t){for(var n=(t=void 0===t||t)?"addEventListener":"removeEventListener",i=t?this._touchActionValue:"",r=0;r<this.handles.length;r++){var o=this.handles[r];this._bindStartEvent(o,t),o[n]("click",this),e.PointerEvent&&(o.style.touchAction=i)}},i._touchActionValue="none",i.pointerDown=function(e,t){this.okayPointerDown(e)&&(this.pointerDownPointer={pageX:t.pageX,pageY:t.pageY},e.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(e),this.emitEvent("pointerDown",[e,t]))};var r={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},o={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};return i.okayPointerDown=function(e){var t=r[e.target.nodeName],n=o[e.target.type],i=!t||n;return i||this._pointerReset(),i},i.pointerDownBlur=function(){var e=document.activeElement;e&&e.blur&&e!=document.body&&e.blur()},i.pointerMove=function(e,t){var n=this._dragPointerMove(e,t);this.emitEvent("pointerMove",[e,t,n]),this._dragMove(e,t,n)},i._dragPointerMove=function(e,t){var n={x:t.pageX-this.pointerDownPointer.pageX,y:t.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this._dragStart(e,t),n},i.hasDragStarted=function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3},i.pointerUp=function(e,t){this.emitEvent("pointerUp",[e,t]),this._dragPointerUp(e,t)},i._dragPointerUp=function(e,t){this.isDragging?this._dragEnd(e,t):this._staticClick(e,t)},i._dragStart=function(e,t){this.isDragging=!0,this.isPreventing
2Clicks=!0,this.dragStart(e,t)},i.dragStart=function(e,t){this.emitEvent("dragStart",[e,t])},i._dragMove=function(e,t,n){this.isDragging&&this.dragMove(e,t,n)},i.dragMove=function(e,t,n){e.preventDefault(),this.emitEvent("dragMove",[e,t,n])},i._dragEnd=function(e,t){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(e,t)},i.dragEnd=function(e,t){this.emitEvent("dragEnd",[e,t])},i.onclick=function(e){this.isPreventingClicks&&e.preventDefault()},i._staticClick=function(e,t){this.isIgnoringMouseUp&&"mouseup"==e.type||(this.staticClick(e,t),"mouseup"!=e.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},i.staticClick=function(e,t){this.emitEvent("staticClick",[e,t])},n.getPointerPoint=t.getPointerPoint,n}(o,e)}.apply(t,i),void 0===r||(e.exports=r)}(window)},360:(e,t,n)=>{var i,r;!function(o,a){i=[n(508)],r=function(e){return function(e,t){"use strict";function n(){}var i=n.prototype=Object.create(t.prototype);i.bindStartEvent=function(e){this._bindStartEvent(e,!0)},i.unbindStartEvent=function(e){this._bindStartEvent(e,!1)},i._bindStartEvent=function(t,n){var i=(n=void 0===n||n)?"addEventListener":"removeEventListener",r="mousedown";"ontouchstart"in e?r="touchstart":e.PointerEvent&&(r="pointerdown"),t[i](r,this)},i.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},i.getTouch=function(e){for(var t=0;t<e.length;t++){var n=e[t];if(n.identifier==this.pointerIdentifier)return n}},i.onmousedown=function(e){var t=e.button;t&&0!==t&&1!==t||this._pointerDown(e,e)},i.ontouchstart=function(e){this._pointerDown(e,e.changedTouches[0])},i.onpointerdown=function(e){this._pointerDown(e,e)},i._pointerDown=function(e,t){e.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,this.pointerDown(e,t))},i.pointerDown=function(e,t){this._bindPostStartEvents(e),this.emitEvent("pointerDown",[e,t])};var r={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};return i._bindPostStartEvents=function(t){if(t){var n=r[t.type];n.forEach((function(t){e.addEventListener(t,this)}),this),this._boundPointerEvents=n}},i._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach((function(t){e.removeEventListener(t,this)}),this),delete this._boundPointerEvents)},i.onmousemove=function(e){this._pointerMove(e,e)},i.onpointermove=function(e){e.pointerId==this.pointerIdentifier&&this._pointerMove(e,e)},i.ontouchmove=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerMove(e,t)},i._pointerMove=function(e,t){this.pointerMove(e,t)},i.pointerMove=function(e,t){this.emitEvent("pointerMove",[e,t])},i.onmouseup=function(e){this._pointerUp(e,e)},i.onpointerup=function(e){e.pointerId==this.pointerIdentifier&&this._pointerUp(e,e)},i.ontouchend=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerUp(e,t)},i._pointerUp=function(e,t){this._pointerDone(),this.pointerUp(e,t)},i.pointerUp=function(e,t){this.emitEvent("pointerUp",[e,t])},i._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},i._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},i.pointerDone=function(){},i.onpointercancel=function(e){e.pointerId==this.pointerIdentifier&&this._pointerCancel(e,e)},i.ontouchcancel=function(e){var t=this.getTouch(e.changedTouches);t&&this._pointerCancel(e,t)},i._pointerCancel=function(e,t){this._pointerDone(),this.pointerCancel(e,t)},i.pointerCancel=function(e,t){this.emitEvent("pointerCancel",[e,t])},n.getPointerPoint=function(e){return{x:e.pageX,y:e.pageY}},n}(o,e)}.apply(t,i),void 0===r||(e.exports=r)}(window)}},t={};function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={id:i,loaded:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}
2}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),n.nc=void 0,(()=>{"use strict";var e={};n.r(e);var t=n(701),i=n.n(t),r=n(236),o=n.n(r),a=n(80),s=n.n(a),l=n(850),c=n.n(l),u=n(182),h=n.n(u),d=n(213),f=n.n(d),p={};p.styleTagTransform=f(),p.setAttributes=c(),p.insert=s().bind(null,"head"),p.domAPI=o(),p.insertStyleElement=h(),i()(e.default,p),e.default&&e.default.locals&&e.default.locals;const m="transitionend",g=e=>{const t=(e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null}return t})(e);return t?document.querySelector(t):null},y=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),v=e=>y(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(e):null,x=e=>{if(!y(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t},b=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),w=e=>{e.offsetHeight},E=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,T=[],S=()=>"rtl"===document.documentElement.dir,A=e=>{"function"==typeof e&&e()},C=(e,t,n=!0)=>{if(!n)return void A(e);const i=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const i=Number.parseFloat(t),r=Number.parseFloat(n);return i||r?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let r=!1;const o=({target:n})=>{n===t&&(r=!0,t.removeEventListener(m,o),A(e))};t.addEventListener(m,o),setTimeout((()=>{r||t.dispatchEvent(new Event(m))}),i)},k=/[^.]*(?=\..*)\.|.*/,M=/\..*/,I=/::\d+$/,P={};let D=1;
vendor: 4,497 bytes, line 2
2const z={mouseenter:"mouseover",mouseleave:"mouseout"},L=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function O(e,t){return t&&`${t}::${D++}`||e.uidEvent||D++}function R(e){const t=O(e);return e.uidEvent=t,P[t]=P[t]||{},P[t]}function B(e,t,n=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===n))}function F(e,t,n){const i="string"==typeof t,r=i?n:t||n;let o=V(e);return L.has(o)||(o=e),[i,r,o]}function N(e,t,n,i,r){if("string"!=typeof t||!e)return;let[o,a,s]=F(t,n,i);if(t in z){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};a=e(a)}const l=R(e),c=l[s]||(l[s]={}),u=B(c,a,o?n:null);if(u)return void(u.oneOff=u.oneOff&&r);const h=O(a,t.replace(k,"")),d=o?function(e,t,n){return function i(r){const o=e.querySelectorAll(t);for(let{target:a}=r;a&&a!==this;a=a.parentNode)for(const s of o)if(s===a)return q(r,{delegateTarget:a}),i.oneOff&&G.off(e,r.type,t,n),n.apply(a,[r])}}(e,n,a):function(e,t){return function n(i){return q(i,{delegateTarget:e}),n.oneOff&&G.off(e,i.type,t),t.apply(e,[i])}}(e,a);d.delegationSelector=o?n:null,d.callable=a,d.oneOff=r,d.uidEvent=h,c[h]=d,e.addEventListener(s,d,o)}function j(e,t,n,i,r){const o=B(t[n],i,r);o&&(e.removeEventListener(n,o,Boolean(r)),delete t[n][o.uidEvent])}function U(e,t,n,i){const r=t[n]||{};for(const o of Object.keys(r))if(o.includes(i)){const i=r[o];j(e,t,n,i.callable,i.delegationSelector)}}function V(e){return e=e.replace(M,""),z[e]||e}const G={on(e,t,n,i){N(e,t,n,i,!1)},one(e,t,n,i){N(e,t,n,i,!0)},off(e,t,n,i){if("string"!=typeof t||!e)return;const[r,o,a]=F(t,n,i),s=a!==t,l=R(e),c=l[a]||{},u=t.startsWith(".");if(void 0===o){if(u)for(const n of Object.keys(l))U(e,l,n,t.slice(1));for(const n of Object.keys(c)){const i=n.replace(I,"");if(!s||t.includes(i)){const t=c[n];j(e,l,a,t.callable,t.delegationSelector)}}}else{if(!Object.keys(c).length)return;j(e,l,a,o,r?n:null)}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const i=E();let r=null,o=!0,a=!0,s=!1;t!==V(t)&&i&&(r=i.Event(t,n),i(e).trigger(r),o=!r.isPropagationStopped(),a=!r.isImmediatePropagationStopped(),s=r.isDefaultPrevented());let l=new Event(t,{bubbles:o,cancelable:!0});return l=q(l,n),s&&l.preventDefault(),a&&e.dispatchEvent(l),l.defaultPrevented&&r&&r.preventDefault(),l}};function q(e,t){for(const[n,i]of Object.entries(t||{}))try{e[n]=i}catch{Object.defineProperty(e,n,{configurable:!0,get:()=>i})}return e}const $=G,W={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const n=[];let i=e.parentNode.closest(t);for(;i;)n.push(i),i=i.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((e=>`${e}:not([tabindex^="-"])`)).join(",");return this.find(t,e).filter((e=>!b(e)&&x(e)))}};function Z(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function X(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const H={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${X(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${X(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter((e=>e.startsWith("bs")&&!e.startsWith("bsConfig")));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=Z(e.dataset[i])}return t},getDataAttribute:(e,t)=>
vendor: 10,102 bytes, line 2
2Z(e.getAttribute(`data-bs-${X(t)}`))},Y=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",K=".sticky-top",J="padding-right",Q="margin-right",ee=new Map,te={set(e,t,n){ee.has(e)||ee.set(e,new Map);const i=ee.get(e);i.has(t)||0===i.size?i.set(t,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(i.keys())[0]}.`)},get:(e,t)=>ee.has(e)&&ee.get(e).get(t)||null,remove(e,t){if(!ee.has(e))return;const n=ee.get(e);n.delete(t),0===n.size&&ee.delete(e)}},ne=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=y(t)?H.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...y(t)?H.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const i of Object.keys(t)){const r=t[i],o=e[i],a=y(o)?"element":null==(n=o)?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(r).test(a))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${a}" but expected type "${r}".`)}var n}},ie=class extends ne{constructor(e,t){super(),(e=v(e))&&(this._element=e,this._config=this._getConfig(t),te.set(this._element,this.constructor.DATA_KEY,this))}dispose(){te.remove(this._element,this.constructor.DATA_KEY),$.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){C(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return te.get(v(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.2.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}},re="backdrop",oe="show",ae=`mousedown.bs.${re}`,se={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},le={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"},ce=class extends ne{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return se}static get DefaultType(){return le}static get NAME(){return re}show(e){if(!this._config.isVisible)return void A(e);this._append();const t=this._getElement();this._config.isAnimated&&w(t),t.classList.add(oe),this._emulateAnimation((()=>{A(e)}))}hide(e){this._config.isVisible?(this._getElement().classList.remove(oe),this._emulateAnimation((()=>{this.dispose(),A(e)}))):A(e)}dispose(){this._isAppended&&($.off(this._element,ae),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=v(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),$.on(e,ae,(()=>{A(this._config.clickCallback)})),this._isAppended=!0}_emulateAnimation(e){C(e,this._getElement(),this._config.isAnimated)}},ue=".bs.focustrap",he=`focusin${ue}`,de=`keydown.tab${ue}`,fe="backward",pe={autofocus:!0,trapElement:null},me={autofocus:"boolean",trapElement:"element"},ge=class extends ne{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return pe}static get DefaultType(){return me}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),$.off(document,ue),$.on(document,he,(e=>this._handleFocusin(e))),$.on(document,de,(e=>this._handleKeydown(e))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,$.off(document,ue))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const n=W.focusableChildren(t);0===n.length?t.focus():this._lastTabNavDirection===fe?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?fe:"forward")}},_e=".bs.modal",ye=`hide${_e}`,ve=`hidePrevented${_e}`,xe=`hidden${_e}`,be=`show${_e}`,we=`shown${_e}`,Ee=`resize${_e}`,Te=`click.dismiss${_e}`,Se=`mousedown.dismiss${_e}`,Ae=`keydown.dismiss${_e}`,Ce=`click${_e}.data-api`,ke="modal-open",Me="show",Ie="modal-static",Pe={backdrop:!0,focus:!0,keyboard:!0},De={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class ze extends ie{constructor(e,t){super(e,t),this._dialog=W.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new class{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,J,(t=>t+e)),this._setElementAttributes(Y,J,(t=>t+e)),this._setElementAttributes(K,Q,(t=>t-e))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,J),this._resetElementAttributes(Y,J),this._resetElementAttributes(K,Q)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,n){const i=this.getWidth();this._applyManipulationCallback(e,(e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+i)return;this._saveInitialAttribute(e,t);const r=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${n(Number.parseFloat(r))}px`)}))}_saveInitialAttribute(e,t){const n=e.style.getPropertyValue(t);n&&H.setDataAttribute(e,t,n)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,(e=>{const n=H.getDataAttribute(e,t);null!==n?(H.removeDataAttribute(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)}))}_applyManipulationCallback(e,t){if(y(e))t(e);else for(const n of W.find(e,this._element))t(n)}},this._addEventListeners()}static get Default(){return Pe}static get DefaultType(){return De}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||$.trigger(this._element,be,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(ke),this._adjustDialog(),this._backdrop.show((()=>this._showElement(e))))}hide(){this._isShown&&!this._isTransitioning&&($.trigger(this._element,ye).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Me),this._queueCallback((()=>this._hideModal()),this._element,this._isAnimated())))}dispose(){for(const e of[window,this._dialog])$.off(e,_e);this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new ce({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ge({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=W.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),w(this._element),this._element.classList.add(Me),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,$.trigger(this._element,we,{relatedTarget:e})}),this._dialog,this._isAnimated())}_addEventListeners(){$.on(this._element,Ae,(e=>{if("Escape"===e.key)return this._config.keyboard?(e.preventDefault(),void this.hide()):void this._triggerBackdropTransition()})),$.on(window,Ee,(()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()})),$.on(this._element,Se,(e=>{$.one(this._element,Te,(t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())}))}))}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(ke),this._resetAdjustments(),this._scrollBar.reset(),$.trigger(this._element,xe)}))}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if($.trigger(this._element,ve).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(Ie)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(Ie),this._queueCallback((()=>{this._element.classList.remove(Ie),this._queueCallback((()=>{this._element.style.overflowY=t}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){const e=S()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!n&&e){const e=S()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each((function(){const n=ze.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError(`No method n
2amed "${e}"`);n[e](t)}}))}}var Le,Oe;$.on(document,Ce,'[data-bs-toggle="modal"]',(function(e){const t=g(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),$.one(t,be,(e=>{e.defaultPrevented||$.one(t,xe,(()=>{x(this)&&this.focus()}))}));const n=W.findOne(".modal.show");n&&ze.getInstance(n).hide(),ze.getOrCreateInstance(t).toggle(this)})),((e,t="hide")=>{const n=`click.dismiss${e.EVENT_KEY}`,i=e.NAME;$.on(document,n,`[data-bs-dismiss="${i}"]`,(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),b(this))return;const r=g(this)||this.closest(`.${i}`);e.getOrCreateInstance(r)[t]()}))})(ze),Le=ze,Oe=()=>{const e=E();if(e){const t=Le.NAME,n=e.fn[t];e.fn[t]=Le.jQueryInterface,e.fn[t].Constructor=Le,e.fn[t].noConflict=()=>(e.fn[t]=n,Le.jQueryInterface)}},"loading"===document.readyState?(T.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of T)e()})),T.push(Oe)):Oe(),n(179);var Re={uri:"",portalId:0,endpoint:{listCategories:"/api/MPRT_WebApi/Web/GetEventsCategories",listEvents:"/api/MPRT_WebApi/Web/SearchEventsPackages"},settings:{startDate:"",endDate:"",type:"e",skip:0,show:12,openTabId:-1}},Be=(Re.portalId,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"e",o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";Re.settings.startDate=e,Re.settings.endDate=t,Re.settings.skip=Number(o);var a=new URLSearchParams({startdate:Re.settings.startDate,enddate:Re.settings.endDate,search:n,tagsearch:i,type:r,skip:Re.settings.skip.toString(),opentabid:Re.settings.openTabId.toString(),portalid:Re.portalId.toString()});return fetch("".concat(Re.uri).concat(Re.endpoint.listEvents,"?").concat(a)).then((function(e){if(!e.ok)throw e;return e.json()}))}),Fe=function(){return[].filter.call(document.querySelector("#pnlFilter").querySelectorAll("input[type='checkbox']"),(function(e){return e.checked})).map((function(e,t){return e.id}))};function Ne(e,t,n){n||(t.list.innerHTML=""),t.noresults.classList.add("d-none"),t.loadMore.classList.add("d-none"),e.length>=1?e.map((function(e,n){""==e.EventImage?e.EventImageFullPath="/Portals/_default/Skins/_global/dist/img/placeholder.jpeg?format=webp&w=600":e.EventImageFullPath="/Portals/"+Re.portalId+"/Events/"+e.EventImage;var i=document.createElement("div");i.classList.add("col-12","col-lg-4","my-2"),i.innerHTML='\n      <article class="listing listing__initiated" data-id="'.concat(e.EventId,'">\n        <a class="stretched-link" href="').concat(e.Slug,'"></a>\n        <img class="listing__image" loading="lazy" src="').concat(e.EventImageFullPath,'">\n        <div class="py-3 px-4 text-white listing__card listing__card_content">\n            <h3 class="h3 font--secondary mt-2">\n              ').concat(e.EventTitle,'\n            </h3>\n            <span class="font--subline">').concat(e.Datetext,"</span>\n        </div>\n      </article>\n      "),t.list.appendChild(i),t.loadMore.classList.remove("d-none")})):(t.noresults.classList.remove("d-none"),t.noresults.innerHTML="<p>No results.</p>")}var je={uri:"",endpoint:{0:{list:"/api/MPRT_WebApi/Web/LoadTripPlanner",add:"/api/MPRT_WebApi/Web/AddToTripPlanner",remove:"/api/MPRT_WebAPI/Web/RemoveFromTripPlanner"},1:{list:"/api/MPRT_WebApi/Web/getRFP",add:"/api/MPRT_WebApi/Web/AddToRFP",remove:"/api/MPRT_WebApi/Web/RemoveRFP"}}};function Ue(e,t,n,i){var r=new URLSearchParams({ListingID:t,Collection:i});return fetch("".concat(je.uri).concat(je.endpoint[n][e],"?").concat(r)).then((function(e){if(e.ok)return e.json();throw new Error("Something went wrong.")}))}window.addEventListener("load",(function(){var e=[],t={filter:document.querySelector("#pnlFilter"),list:document.querySelector("#pnlList"),noresults:document.querySelector("#pnlNoResults"),loadMore:document.querySelector("#btnLoadMore")},n={startDate:document.querySelector("#hdnStartDate"),endDate:document.querySelector("#hdnEndDate")};if(t.filter&&t.list&&t.noresults&&t.loadMore){var i={filter:t.filter.querySelector("fieldset.f
2ilter"),search:document.querySelector("#txtSearch")};Re.settings.openTabId=Number(t.list.getAttribute("data-opentabid")),Re.settings.type=t.list.getAttribute("data-event-type"),fetch("".concat(je.uri).concat(je.endpoint[0].list)).then((function(e){if(e.ok)return e.json();throw e.status})).then((function(t){e=t.trip.map((function(e,t){return e.ATDWListingID})),document.querySelectorAll("[trip-planner-id]").forEach((function(t,n){var i,r;i=t.getAttribute("trip-planner-id"),r=t,e.includes(i)&&(r.classList.add("listing__tripplanner_active"),r.querySelector("img").setAttribute("src","/Portals/_default/Skins/_global/dist/img/nav/icon__Trip_Planner_active.svg")),r.addEventListener("click",(function(){e.includes(i)?(r.classList.remove("listing__tripplanner_active"),Ue("remove",i,0),e=e.filter((function(e){return e!==i})),r.querySelector("img").setAttribute("src","/Portals/_default/Skins/_global/dist/img/nav/icon__Trip_Planner_alt.svg")):(r.classList.add("listing__tripplanner_active"),Ue("add",i,0),e.push(i),r.querySelector("img").setAttribute("src","/Portals/_default/Skins/_global/dist/img/nav/icon__Trip_Planner_active.svg"))}))}))})),fetch("".concat(Re.uri).concat(Re.endpoint.listCategories)).then((function(e){if(!e.ok)throw e;return e.json()})).catch((function(e){console.error("Error: ",e)})).then((function(e){i.filter.innerHTML="",e.length>0&&e.forEach((function(e){var r=document.createElement("div");r.classList.add("filter__option","col-lg-3","col-sm-6"),r.innerHTML='\n              <input type="checkbox" name="'.concat(e.Name,'" id="').concat(e.Id,'">\n              <label for="').concat(e.Id,'">').concat(e.Name,"</label>\n            "),i.filter.appendChild(r),r.querySelector("input").addEventListener("change",(function(){t.list.innerHTML='<div class="loader"><span class="far fa-spinner fa-pulse fa-fw"></span></div>',Be(n.startDate.value,n.endDate.value,document.querySelector("input#txtsearch").value,Fe(),Re.settings.type.toString()).then((function(e){Ne(e,t,!1)}))}))})),t.filter.querySelector("button").addEventListener("click",(function(){return i.filter.classList.toggle("d-none")})),i.search.addEventListener("input",(function(){i.search.value.length>=3?Be(n.startDate.value,n.endDate.value,i.search.value,Fe(),Re.settings.type.toString()).then((function(e){Ne(e,t,!1)})):Be(n.startDate.value,n.endDate.value,"",Fe(),Re.settings.type.toString()).then((function(e){Ne(e,t,!1)}))})),t.loadMore.addEventListener("click",(function(){Re.settings.skip+=Re.settings.show,Be(n.startDate.value,n.endDate.value,i.search.value,Fe(),Re.settings.type.toString(),Re.settings.skip.toString()).then((function(e){Ne(e,t,!0)}))}))}))}}));var Ve=n(811),Ge=n.n(Ve);const qe=function(e,t,n){var i=e.element.parentNode.querySelector(".timeline__pagination_index"),r=e.element.parentNode.querySelector(".timeline__pagination_total");i&&(i.innerHTML=t+1),r&&(r.innerHTML=n)},$e=function(e,t){var n=e.element.parentNode.querySelector(".timeline__track_pill");n&&(n.style.width=100/t+"%")},We=function(e,t,n){var i=e.element.parentNode.querySelector(".timeline__pagination_index"),r=e.element.parentNode.querySelector(".timeline__pagination_total");i&&(i.innerHTML=t+1),r&&(r.innerHTML=n)},Ze=function(e,t,n){var i=e.element.parentNode.querySelector(".timeline__track");i&&(e.element.parentNode.querySelector(".timeline__track_pill").style.transform="translateX("+i.clientWidth*(100/n*t/100)+"px)")};window.addEventListener("load",(function(){document.querySelectorAll(".favourites").forEach((function(e){var t=e.querySelector(".carouselfav"),n=e.querySelector(".carouselfilter");if(t&&n){var i=null,r=function(){var e=n.value,r=t.querySelectorAll(".carousel__item");"all"===e?r.forEach((function(e){e.classList.remove("d-none")})):r.forEach((function(t){t.classList.add("d-none"),t.getAttribute("data-month")===e&&t.classList.remove("d-none")})),i&&i.destroy(),i=new(Ge())(t,{imagesLoaded:!0,groupCells:!0,pageDots:!1,prevNextButtons:!0,lazyLoad:!0,on:{ready:function(){qe(this,this.selectedIndex,this.slides.length),$e(this,this.slides.length)},change:function(e){We(this,e,this.slides.length),Ze(this,e,this.slides.length)}}})};n&&(n.querySelectorAll("option")[(new Date).getMonth()+1].selected=!0,r()),n.addEventListener("change",(function(){return r()}))}else console.warn("Ignoring invalid `Favourites Filter`. Missing carouselElement or filterElement.")}))})),window.addEventListener("load",(function(){document.querySelectorAll(".gallery").forEach((function(e){new(Ge())(e,{imagesLoaded:!0,pageDots:!1,prevNextButtons:!0,lazyLoad:!0,wrapAround:!0,on:{ready:function(){1===this.slides.length?(this.element.nextSibling.nextSibling.classList="container d-none",this.element.classList.add("slide-single")):(qe(this,this.selectedIndex,this.slides.length),$e(this,this.slides.length))},change:function(e){1!=this.slides.length&&(We(this,e,this.slides.length),Ze(this,e,this.slides.length))}}})}))}));var Xe=n(373),He=n.n(Xe),Ye=n(526),Ke=n(961);function Je(e){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Je(e)}function Qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function et(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?Qe(Object(n),!0).forEach((function(t){tt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function tt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Je(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==Je(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Je(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var it="pk.eyJ1Ijoid2VibWF0cml4YXUiLCJhIjoiY2t2OHE5YW5jNXR3dzJ4cGdrMXM1c2tlOSJ9.bwVx2qUsKXb5Alb21nkvcw",rt=function(e){var t,n,i=e._event,r=e.active,o=(t=(0,Ye.useState)(r||!1),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(t,n)||function(e,t){if(e){if("string"==typeof e)return nt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?nt(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],s=o[1];return Ye.createElement(Ye.Fragment,null,Ye.createElement("div",{className:"position-relative"},Ye.createElement("a",{href:"".concat(i.properties.url)},Ye.createElement("div",{className:"ratio ratio-16x9"},Ye.createElement("img",{src:"".concat(i.properties.image.match(/(https|http):\/\/(assets.atdw-online.com.au|www.visitmorningtonpeninsula.org).*(.jpeg|.jpg|.png)/g),"?w=800"),style:{objectFit:"cover"}}))),Ye.createElement("div",{className:"iconography mb-1"},i.properties.email&&Ye.createElement("a",{className:"mx-2",href:"mailto:".concat(i.properties.email)},Ye.createElement("img",{src:"/Portals/_default/Skins/_global/dist/img/map/mapicon__envelope.svg",alt:""})),i.properties.phone&&Ye.createElement("a",{className:"mx-2",href:"tel:".concat(i.properties.phone.replaceAll(" ",""))},Ye.createElement("img",{src:"/Portals/_default/Skins/_global/dist/img/map/mapicon__phone.svg",alt:""})),i.properties.website&&Ye.createElement("a",{className:"mx-2",href:"//".concat(i.properties.website.replaceAll("https://","").replaceAll("http://","")),target:"_blank"},Ye.createElement("img",{src:"/Portals/_default/Skins/_global/dist/img/map/mapicon__globe.svg",alt:""})),i.properties.id&&Ye.createElement("button",{className:"mx-2",type:"button",onClick:function(){Ue(a?"remove":"add",i.properties.id,0),s(!a)}},Ye.createElement("img",{src:"/Portals/_default/Skins/_global/dist/img/map/mapicon__tripplanner_".concat(a?"active":"inactive",".svg"),alt:""})))),Ye.createElement("a",{href:i.properties.url,className:"d-block p-2",target:"_blank"},Ye.createElement("div",{className:"title"},i.properties.title)))},ot={removeLayer:function(e,t){t.getLayer(e+"_cluster__bg")&&t.removeLayer(e+"_cluster__bg"),t.getLayer(e+"_cluster")&&t.removeLayer(e+"_cluster"),t.getLayer(e+"_layer")&&t.removeLayer(e+"_layer"),t.getSource(e)&&t.removeSource(e)},addLayer:function(e,t,n){t.addSource(e,{type:"geojson",data:ot.convertGeoJSON(n),cluster:!0,clusterMaxZoom:12,clusterRadius:40})},renderLayer:function(e,t,n){n.addLayer({id:"".concat(e,"_layer"),type:"symbol",source:e,filter:["!",["has","point_count"]],layout:{"icon-image":t,"icon-size":.3,"icon-allow-overlap":!0}})},clickEvent:function(e,t){t.on("click","".concat(e,"_layer"),(function(e){var n={location:e.features[0].geometry.coordinates.slice(),properties:e.features[0].properties},i=t.getZoom();t.flyTo({zoom:15,center:n.location}),Ue("list",n.properties.id,0).then((function(e){var r=e.trip.map((function(e){return e.ATDWListingID})).includes(n.properties.id),o=document.createElement("div");Ke.render(Ye.createElement(rt,{_event:n,active:r}),o),new(He().Popup)({anchor:"bottom",offset:[0,-30]}
2).setLngLat(n.location).setDOMContent(o).addTo(t).on("close",(function(e){t.flyTo({zoom:i,center:n.location})}))}))})),t.on("mouseenter","".concat(e,"_layer"),(function(){t.getCanvas().style.cursor="pointer"})),t.on("mouseleave","".concat(e,"_layer"),(function(){t.getCanvas().style.cursor=""}))},clusterIcons:function(e,t){t.addLayer({id:"".concat(e,"_cluster__bg"),type:"symbol",source:e,filter:["has","point_count"],layout:{"icon-image":"Blank","icon-size":.25,"icon-allow-overlap":!0}}),t.addLayer({id:"".concat(e,"_cluster"),type:"symbol",source:e,filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["Arial Unicode MS Bold"],"text-size":16,"text-allow-overlap":!0},paint:{"text-color":"#ffffff"}}),t.on("mouseenter","".concat(e,"_cluster__bg"),(function(){t.getCanvas().style.cursor="pointer"})),t.on("mouseleave","".concat(e,"_cluster__bg"),(function(){t.getCanvas().style.cursor=""})),t.on("click","".concat(e,"_cluster__bg"),(function(n){var i=t.queryRenderedFeatures(n.point,{layers:["".concat(e,"_cluster__bg")]})[0].properties.cluster_id;t.getSource(e).getClusterChildren(i,(function(e,n){var i=new(He().LngLatBounds);n.forEach((function(e){i.extend(e.geometry.coordinates)})),t.fitBounds(i,{padding:200})}))}))},convertGeoJSON:function(e){return{type:"FeatureCollection",features:e.map((function(e){return{type:"Feature",properties:et({},e),geometry:{type:"Point",coordinates:[e.location.lng,e.location.lat]},id:e.id}}))}}},at=[{title:"Accommodation",id:1139,color:"#38644A",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__accommodation.png"},{title:"Arts & Culture",id:1133,color:"#5A3A4C",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__arts.png"},{title:"Beaches, Piers & Jetties",id:1129,color:"#DC9759",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__beaches.png"},{title:"Bike Tracks",id:1202,color:"#26565C",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__biketracks.png"},{title:"Food & Drink",id:1174,color:"#A14B50",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__foodandwine.png"},{title:"Wine, Food & Farmgate",id:1181,color:"#2B2C29",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__wffg.png"},{title:"Land & Adventure Attractions",id:1168,color:"#98A77C",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__attractions.png"},{title:"Markets & Shopping",id:1171,color:"#958068",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__markets.png"},{title:"Parks & Picnic Spots",id:1210,color:"#F2D6A7",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__picnics.png"},{title:"Tours & Transport",color:"#284761",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__transport.png",id:1159},{title:"Walks",id:1163,color:"#478695",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__walks.png"}];function st(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||lt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(e,t){if(e){if("string"==typeof e)return ct(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ct(e,t):void 0}}function ct(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var ut=function(e){var t=e.location,n=e.zoom,i=e.marker,r=e.file,o=st((0,Ye.useState)(null),2),a=o[0],s=o[1],l=st((0,Ye.useState)(!1),2),c=l[0],u=l[1],h=(0,Ye.useRef)();return(0,Ye.useEffect)((function(){!0===c&&(He().accessToken=it,s(new(He().Map)({container:h.current,style:"mapbox://styles/webmatrixau/ckrpn3ea40efs17mxr84bbemq",center:t,zoom:n})))}),[c]),(0,Ye.useEffect)((function(){var e;a&&Promise.all([{title:"Undefined",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__undefined.png"},{title:"Blank",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__blank.png"}].concat((e=at,function(e){if(Array.isArray(e))return ct(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||lt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())).map((function(e){a.loadImage(e.icon,(function(t,n){if(t)throw t;a.addImage(e.title,n)}))})))}),[a]),(0,Ye.useEffect)((function(){a&&a.on("load",(function(){a.addSource("instances",{type:"geojson",data:{type:"Feature",geometry:{type:"Point",coordinates:t}}}),a.addLayer({id:"instances__layer",type:"symbol",source:"instances",layout:{"icon-image":i||"Blank","icon-size":.3,"icon-allow-overlap":!0,"icon-offset":[0,-48]}}),void 0!==r&&fetch(r).then((function(e){if(e.ok)return e.json();throw"Response not happy for file output."})).then((function(e){a.addSource("file",{type:"geojson",data:e}),a.addLayer({id:"route__layer",type:"line",source:"file",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#000","line-width":3}})}))}))}),[a]),Ye.createElement("div",{className:"regionMap__map bg-light ratio ratio-16x9 rounded"},!c&&Ye.createElement("div",null,Ye.createElement("button",{type:"button",onClick:function(){u(!0)},className:"btn btn-primary position-absolute",style:{zIndex:50,left:"1rem",top:"1rem"}},"Load Interactive Map")),Ye.createElement("div",{className:"rounded"},Ye.createElement("img",{src:"https://api.mapbox.com/styles/v1/webmatrixau/ckrpn3ea40efs17mxr84bbemq/static/url-https%3A%2F%2Fwww.visitmorningtonpeninsula.org%2Fimages%2Fmapbox.png(".concat(t.join(","),")/").concat(t.join(","),",").concat(n,",0/960x540?access_token=").concat(it,"&attribution=true"),className:"rounded"})),Ye.createElement("div",{ref:h,className:"rounded"}))};function ht(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,i=0;i<e.length;i++)""!==(n=ht(e[i]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}window.addEventListener("load",(function(){document.querySelectorAll('[data-map="true"]').forEach((function(e){var t={location:e.getAttribute("data-map-location").split(",").map((function(e){return parseFloat(e)})),zoom:parseFloat(e.getAttribute("data-map-zoom")),marker:e.getAttribute("data-map-marker")||"null",file:e.getAttribute("data-map-file")||void 0};Ke.render(Ye.createElement(ut,t),e)}))}
2)),n(507);var dt=n(59),ft=n.n(dt),pt=n(194),mt="/DesktopModules/WMCollectionMapper/API/Operators",gt=function(e,t,n){return"?"+new URLSearchParams([["f",e.join(",")],["c",t],["pid",n.toString()]])},_t=function(){return Ye.createElement("div",{className:"alert alert-danger text-center my-5",role:"alert"},Ye.createElement("p",{className:"text-center h2 mt-3"},Ye.createElement("i",{className:"fa-solid fa-hexagon-exclamation"})),Ye.createElement("p",{className:"h2 fw-bold mt-2 mb-4"},"Oops,we hit a snag!"),Ye.createElement("p",null,"Please refresh the page and try again, if the problem persists try again later."))};function yt(e){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yt(e)}function vt(){return vt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},vt.apply(this,arguments)}function xt(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==yt(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!==yt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===yt(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bt(e){return function(e){if(Array.isArray(e))return Tt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Et(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||Et(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Et(e,t){if(e){if("string"==typeof e)return Tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function St(e){new URLSearchParams(window.location.search);var t,n=(0,Ye.useRef)(),i=wt((0,Ye.useState)("grid"),2),r=i[0],o=i[1],a=wt((0,Ye.useState)([]||[]),2),s=a[0],l=a[1],c=wt((0,Ye.useState)(e.tripplanner?JSON.parse(e.tripplanner):[]),2),u=c[0],h=c[1],d=wt((0,Ye.useState)(!1),2),f=d[0],p=d[1],m=Boolean(e.hideCategories),g=Boolean(e.isJourney),_=(Boolean(e.zoom),wt((0,Ye.useState)([]),2)),y=_[0],v=_[1];return(0,Ye.useEffect)((function(){var e=function(){var e=bt(y);e.push(window.location.pathname),v(e)};return window.addEventListener("popstate",e),function(){window.removeEventListener("popstate",e)}}),[y]),Ye.createElement("div",{className:"grid__app"},Ye.createElement("div",{className:"d-flex align-items-center justify-content-between flex-wrap flex-lg-nowrap mb-4"},Ye.createElement("div",{className:"grid__app-title"},Ye.createElement("h2",{className:"font--secondary mb-3",id:"heading"},e.subtitle),Ye.createElement("button",{type:"button",className:"mb-4 btn btn-outline-primary d-block d-lg-none",onClick:function(){return p(!f)}},"Toggle Filters"),e.filters&&e.filters.length>1?Ye.createElement("fieldset",{className:ht(["filter mb-4 d-lg-flex",(t={},xt(t,"d-none",!f),xt(t,"d-flex",f),t)]),ref:n},e.filters.map((function(e){return Ye.createElement("div",{className:"filter__option",key:e.ID},Ye.createElement("input",{type:"checkbox",onChange:function(){return e=n.current,void l([].filter.call(e.querySelectorAll("input"),(function(e){return e.checked})).map((function(e,t){return e.id})));var e},name:e.Text,id:e.ID,key:e.ID,checked:s.includes(e.ID)}),Ye.createElement("label",{htmlFor:e.ID},e.Text))}))):Ye.createElement("div",{className:"my-3"})),Ye.createElement("fieldset",{className:"filter filter__map p-1"},Ye.createElement("button",{type:"button",onClick:function(){return o("grid")}},Ye.createElement("img",{src:"/Portals/_default/Skins/_global/dist/img/filter/filtericon__grid.svg",alt:"",className:"grid"==r?"filter__icon filter__icon_active":"filter__icon"})),Ye.createElement("button",{type:"button",onClick:function(){return o("map")}},Ye.createElement("img",{src:"/Portals/_default/Skins/_global/dist/img/filter/filtericon__pin.svg",alt:"",className:"map"==r?"filter__icon filter__icon_active":"filter__icon"})))),"grid"===r&&Ye.createElement(Ct,vt({activeFilters:s,activeTripPlanner:u,setActiveTripPlanner:h,hideCategories:m,isJourney:g},e)),"map"===r&&Ye.createElement(kt,vt({activeFilters:s,activeTripPlanner:u,setActiveTripPlanner:h},e)))}function At(e){var t=e.activeTripPlanner.includes(e.listingID);"1"===e.pid&&(t=e.activeTripPlanner.includes(e.listingID+"-"+e.collection));var n=wt((0,Ye.useState)(!1),2),i=n[0],r=n[1],o=wt((0,Ye.useState)(!1),2),a=o[0],s=o[1];return Ye.createElement("button",{className:ht(["listing__tripplanner",{listing__tripplanner_active:t,listing__tripplanner_loading:a||i}]),onClick:function(t){if(t.preventDefault(),!a){s(!0);var n=e.activeTripPlanner.includes(e.listingID),i=e.listingID;"1"===e.pid&&(i=e.listingID+"-"+e.collection),"1"===e.pid&&(n=e.activeTripPlanner.includes(e.listingID+"-"+e.collection)),n?(Ue("remove",e.listingID,e.pid,e.collection).then((function(t){s(!1),"0"===e.pid&&(document.querySelector(".icon-counter").innerHTML=t.count),"1"===e.pid&&(document.querySelector(".icon-counter-be").innerHTML=t.count)}
2)).catch((function(){return r(!0)})),e.setActiveTripPlanner(e.activeTripPlanner.filter((function(e){return e!==i})))):(e.setActiveTripPlanner([].concat(bt(e.activeTripPlanner),[i])),Ue("add",e.listingID,e.pid,e.collection).then((function(t){s(!1),"0"===e.pid&&(document.querySelector(".icon-counter").innerHTML=t.count),"1"===e.pid&&(document.querySelector(".icon-counter-be").innerHTML=t.count)})).catch((function(){return r(!0)})))}}},a||i?Ye.createElement("span",null,a&&Ye.createElement("i",{className:"fa-regular fa-spinner-third fa-spin"}),i&&Ye.createElement("i",{className:"fa-regular fa-hexagon-exclamation"})):Ye.createElement("img",{src:t?"/Portals/_default/Skins/_global/dist/img/nav/icon__Trip_Planner_active.svg":"/Portals/_default/Skins/_global/dist/img/nav/icon__Trip_Planner_alt.svg"}))}function Ct(e){var t=wt((0,Ye.useState)([]),2),n=(t[0],t[1],window.location.pathname,""!==window.location.hash?window.location.hash.replace("#page-",""):"1"),i=wt((0,Ye.useState)([]),2),r=i[0],o=i[1],a=wt((0,Ye.useState)(!0),2),s=a[0],l=a[1],c=wt((0,Ye.useState)(parseInt(n)),2),u=c[0],h=c[1],d=wt((0,Ye.useState)(12),1)[0],f=wt((0,Ye.useState)([]),2),p=f[0],m=f[1];window.onpopstate=function(){var e=""!==window.location.hash?window.location.hash.replace("#page-",""):"1";h(parseInt(e)),document.getElementById("heading").scrollIntoView({behavior:"smooth"})},e.activeFilters.toString().trim()!==p.toString().trim()&&(m(e.activeFilters),h(1),window.history.pushState("",document.title,window.location.pathname));var g=wt((0,Ye.useState)(""),2),_=g[0],y=g[1],v=document.querySelector("#hdnSiteAlias").value,x=function(t){var n=function(e,t,n,i,r,o){return"?"+new URLSearchParams([["p",(0).toString()],["ps",t.toString()],["f",n.join(",")],["c",i.toString()],["pid",r.toString()],["o",o.toString()]])}(0,e.pageSize,e.activeFilters,e.collection,e.pid,e.orderby);l(!0),fetch("".concat(v).concat(mt).concat(n)).then((function(e){if(e.ok)return e.json();throw new Error("Something went wrong.")})).then((function(e){o(e.data),l(!1)})).catch((function(e){document.querySelector(".grid__app").scrollIntoView(),console.error("Error:",e),y(e)}))};(0,Ye.useEffect)((function(){return x()}),[]),(0,Ye.useEffect)((function(){return x()}),[e.activeFilters]),(0,Ye.useEffect)((function(){return x()}),[u]);var b,w,E,T=u*d,S=T-d,A=r.slice(S,T),C=Math.ceil(r.length/d),k=(0,Ye.useRef)(null),M=bt(Array(C+1).keys()).slice(1),I=C>5?(E=(b=M.indexOf(u))+3,(w=b-2)<0&&(w=0,E=5),E>M.length&&(w=(E=M.length)-5),M.slice(w,E)):M,P=C>5&&I.indexOf(1)<0,D=C>5&&I.indexOf(C)<0,z=Math.floor((u-1)/2),L=Math.floor(u+(C-u)/2),O=function(e){h(e),document.getElementById("heading").scrollIntoView({behavior:"smooth"})},R=function(){localStorage.setItem("currentFilters",JSON.stringify(e.activeFilters.toString()))};return _?Ye.createElement(_t,null):Ye.createElement("div",{className:"row",ref:k},A&&A.map((function(t){return Ye.createElement("article",{className:"col-12 col-lg-4 mb-4",key:t.id,id:t.id},Ye.createElement("div",{className:"listing listing__initiated"},Ye.createElement(At,{activeTripPlanner:e.activeTripPlanner,setActiveTripPlanner:e.setActiveTripPlanner,listingID:t.id,pid:e.pid,collection:e.collection}),t.image.indexOf("?")>0?Ye.createElement(pt.LazyLoadImage,{src:"".concat(t.image,"&w=600"),width:600,height:400,PlaceholderSrc:"/Portals/_default/Skins/_global/dist/img/placeholder.jpeg",alt:"".concat(t.title),class:"listing__image"}):Ye.createElement(pt.LazyLoadImage,{src:"".concat(t.image,"?w=600"),width:600,height:400,PlaceholderSrc:"/Portals/_default/Skins/_global/dist/img/placeholder.jpeg",alt:"".concat(t.title),class:"listing__image"}),e.isJourney&&""!=t.JourneyRating&&Ye.createElement("img",{src:"/Portals/".concat(e.pid,"/images/walks-indicator-").concat(t.JourneyRating,"-index.svg"),className:"difficulty__rating"}),Ye.createElement("a",{href:t.url,className:"stretched-link",onClick:R}),Ye.createElement("div",{className:"py-3 px-4 text-white listing__card listing__card_content"},Ye.createElement("div",{className:"h3 font--secondary"},t.title),!e.hideCategories&&Ye.createElement("small",{className:"font--subline"},t.collection))))})),s?Ye.createElement("div",{className:"col-12 text-center"},Ye.createElement("button",{type:"button",className:"btn btn-lg btn-outline-dark font--secondary"},"Loading...")):Ye.createElement("div",{className:"col-12 text-center"},C>1?Ye.createElement("ul",{className:"pagination justify-content-center"},1!==u?Ye.createElement("li",null,Ye.createElement("a",{onClick:function(){1!==u&&O(u-1)},href:"#page-".concat(u)},"<")):"",1==P?Ye.createElement("li",null,Ye.createElement("a",{onClick:function(){return O(z)},href:"#page-".concat(z)},"...")):"",I.map((function(e){return Ye.createElement("li",{key:e,className:"".concat(u==e?"active":""," ")},Ye.createElement("a",{onClick:function(){return O(e)},href:"#page-".concat(e)},e))})),1==D?Ye.createElement("li",null,Ye.createElement("a",{onClick:function(){return O(L)},href:"#page-".concat(L)},"...")):"",u!==C?Ye.createElement("li",null,Ye.createElement("a",{onClick:function(){u!==C&&O(u+1)},href:"#page-".concat(u)},">")):""):""))}function kt(e){var t=wt((0,Ye.useState)(null),2),n=t[0],i=t[1],r=(0,Ye.useRef)(),o=wt((0,Ye.useState)(!1),2),a=o[0],s=o[1],l=document.querySelector("#hdnSiteAlias").value;return(0,Ye.useEffect)((function(){He().accessToken=it,i(new(He().Map)({container:r.current,style:e.mapStyle,center:[145.0903408356885,-38.32280575257686],zoom:null!=e.zoom?e.zoom:10}))}),[]),(0,Ye.useEffect)((function(){n&&(n.on("load",(function(){n.addControl(new(He().NavigationControl)),n.scrollZoom.disable()})),n.on("load",(function(){Promise.all([{title:"Undefined",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__undefined.png"},{title:"Blank",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__blank.png"}].concat(bt(at)).map((function(e){n.loadImage(e.icon,(function(t,i){if(t)throw t;n.addImage(e.title,i)}
2))}))).then((function(){if(a)throw a;var t=gt(e.activeFilters,e.collection,e.pid);fetch("".concat(l).concat(mt).concat(t)).then((function(e){if(console.log("1"),e.ok)return e.json();throw new Error("Something went wrong.")})).then((function(e){var t=ft().uniqBy(e.data,"maincategory").map((function(e){return e.maincategory})),i=[];return at.map((function(e){i[e.id.toString()]=e.title})),t.map((function(t){ot.addLayer(t.toString(),n,e.data),ot.renderLayer(t.toString(),i[t]&&i[t]||"Undefined",n),ot.clusterIcons(t.toString(),n),ot.clickEvent(t.toString(),n)})),e})).catch((function(e){s(!0),console.error(e)}))}))})))}),[n]),(0,Ye.useEffect)((function(){if(n){var t=gt(e.activeFilters,e.collection,"1");fetch("".concat(l).concat(mt).concat(t)).then((function(e){if(console.log("2"),e.ok)return e.json();throw new Error("Something went wrong.")})).then((function(e){var t=ft().uniqBy(e.data,"maincategory").map((function(e){return e.maincategory})),i=[];return at.map((function(e){i[e.id.toString()]=e.title})),t.map((function(t){ot.removeLayer(t.toString(),n),ot.addLayer(t.toString(),n,e.data),ot.renderLayer(t.toString(),i[t]&&i[t]||"Undefined",n),ot.clusterIcons(t.toString(),n),ot.clickEvent(t.toString(),n)})),e})).catch((function(e){console.log(e),s(e)}))}}),[e.activeFilters]),a?Ye.createElement(_t,null):Ye.createElement("div",{className:"ratio rounded"},Ye.createElement("div",{id:"map",className:"bg-dark rounded w-100 h-100 position-absolute",ref:r}))}function Mt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||It(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function It(e,t){if(e){if("string"==typeof e)return Pt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pt(e,t):void 0}}function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Dt(e){var t=Mt((0,Ye.useState)(null),2),n=t[0],i=t[1],r=(0,Ye.useRef)(),o=(0,Ye.useRef)(),a=Mt((0,Ye.useState)([]),2),s=a[0],l=a[1],c=Mt((0,Ye.useState)([]),2),u=c[0],h=c[1],d=document.querySelector("#hdnSiteAlias").value;return(0,Ye.useEffect)((function(){He().accessToken=it,i(new(He().Map)({container:r.current,style:"mapbox://styles/webmatrixau/ckrpn3ea40efs17mxr84bbemq",center:[145.0903408356885,-38.32280575257686],zoom:9}))}),[]),(0,Ye.useEffect)((function(){var e;n&&Promise.all([{title:"Undefined",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__undefined.png"},{title:"Blank",icon:"/Portals/_default/Skins/_global/dist/img/map/mapicon__blank.png"}].concat((e=at,function(e){if(Array.isArray(e))return Pt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||It(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())).map((function(e){n.loadImage(e.icon,(function(t,i){if(t)throw t;n.addImage(e.title,i)}))})))}),[n]),(0,Ye.useEffect)((function(){n&&(void 0===n.getSource("instances")?fetch("".concat(d,"/api/MPRT_WebApi/Web/GetRegionData")).then((function(e){if(e.ok)return e.json();throw"Something went wrong."})).then((function(e){var t=JSON.parse(e);console.log("res",e),console.log("json",t),n.addSource("instances",{type:"geojson",data:ot.convertGeoJSON(t.data),cluster:!0,clusterMaxZoom:12,clusterRadius:64}),at.map((function(e){var t=[];at.map((function(e){t[e.id.toString()]=e.title})),n.addLayer({id:"".concat(e.id,"_layer"),type:"symbol",source:"instances",filter:["all",["==","maincategory",e.id]],layout:{"icon-image":t[e.id]&&t[e.id]||"
2Undefined","icon-size":.3,"icon-allow-overlap":!0,"icon-offset":[0,-48]}}),ot.clickEvent(e.id,n)})),ot.clusterIcons("instances",n),h(t.data)})):n.getSource("instances").setData(ot.convertGeoJSON(u.filter((function(e){return 0===s.length||s.includes(e.maincategory?e.maincategory.toString():"undefined")})))))}),[s,n]),(0,Ye.useEffect)((function(){n&&n.on("load",(function(){n.addControl(new(He().FullscreenControl)),n.addControl(new(He().NavigationControl)),n.scrollZoom.disable()}))}),[n]),Ye.createElement(Ye.Fragment,null,Ye.createElement("style",null,at.map((function(e){return'[for="'.concat(e.id,'"] { border-color: ').concat(e.color,' !important; }\n            .filter__option input[type=checkbox]:checked + [for="').concat(e.id,'"] { background-color: ').concat(e.color,"; color: white; }")}))),Ye.createElement("div",{className:"regionMap__filter filter"},Ye.createElement("fieldset",{className:"filter mb-4",ref:o},at.map((function(e){return Ye.createElement("div",{className:"filter__option",key:e.id},Ye.createElement("input",{type:"checkbox",name:e.title,id:e.id,onChange:function(){return function(e){l([].filter.call(e.querySelectorAll("input"),(function(e){return e.checked})).map((function(e,t){return e.id})))}(o.current)}}),Ye.createElement("label",{htmlFor:e.id},e.title))})))),Ye.createElement("div",{className:"regionMap__map bg-light ratio ratio-16x9 rounded"},Ye.createElement("div",{ref:r,className:"rounded"})))}function zt(e,t,n,i){return new(n||(n=Promise))((function(r,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function Lt(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}window.addEventListener("load",(function(){document.querySelectorAll("[data-grid-app]").forEach((function(e){Ke.render(Ye.createElement(St,{title:e.getAttribute("data-grid-app")||"",subtitle:e.getAttribute("data-grid-app-subtitle")||"",collection:e.getAttribute("data-grid-app-collection")||null,filters:e.getAttribute("data-grid-app-filters")?JSON.parse(e.getAttribute("data-grid-app-filters").replaceAll("'",'"')):null,tripplanner:e.getAttribute("data-grid-app-tripbuilder")||null,pid:e.getAttribute("data-grid-app-portalid"),hideCategories:!!e.getAttribute("data-grid-hide-cats")&&"1"===e.getAttribute("data-grid-hide-cats"),zoom:e.getAttribute("data-grid-zoom")?parseInt(e.getAttribute("data-grid-zoom")):10,mapStyle:e.getAttribute("data-grid-map-style")?e.getAttribute("data-grid-map-style"):"mapbox://styles/webmatrixau/ckrpn3ea40efs17mxr84bbemq",orderby:e.getAttribute("data-grid-order")?parseInt(e.getAttribute("data-grid-order")):0,isJourney:!!e.getAttribute("data-grid-journey")&&"1"===e.getAttribute("data-grid-journey"),pageSize:e.getAttribute("data-grid-page-size")?parseInt(e.getAttribute("data-grid-page-size")):12}),e)}))})),n(493),window.addEventListener("load",(function(){var e=document.querySelector("#regionMap");e&&Ke.render(Ye.createElement(Dt,null),e)}));var Ot,Rt=function(){},Bt=Rt(),Ft=Object,Nt=function(e){return e===Bt},jt=function(e){return"function"==typeof e},Ut=function(e,t){return Ft.assign({},e,t)},Vt="undefined",Gt=function(){return typeof window!=Vt},qt=new WeakMap,$t=0,Wt=function(e){var t,n,i=typeof e,r=e&&e.constructor,o=r==Date;
2if(Ft(e)!==e||o||r==RegExp)t=o?e.toJSON():"symbol"==i?e.toString():"string"==i?JSON.stringify(e):""+e;else{if(t=qt.get(e))return t;if(t=++$t+"~",qt.set(e,t),r==Array){for(t="@",n=0;n<e.length;n++)t+=Wt(e[n])+",";qt.set(e,t)}if(r==Ft){t="#";for(var a=Ft.keys(e).sort();!Nt(n=a.pop());)Nt(e[n])||(t+=n+":"+Wt(e[n])+",");qt.set(e,t)}}return t},Zt=!0,Xt=Gt(),Ht=typeof document!=Vt,Yt=Xt&&window.addEventListener?window.addEventListener.bind(window):Rt,Kt=Ht?document.addEventListener.bind(document):Rt,Jt=Xt&&window.removeEventListener?window.removeEventListener.bind(window):Rt,Qt=Ht?document.removeEventListener.bind(document):Rt,en={isOnline:function(){return Zt},isVisible:function(){var e=Ht&&document.visibilityState;return Nt(e)||"hidden"!==e}},tn={initFocus:function(e){return Kt("visibilitychange",e),Yt("focus",e),function(){Qt("visibilitychange",e),Jt("focus",e)}},initReconnect:function(e){var t=function(){Zt=!0,e()},n=function(){Zt=!1};return Yt("online",t),Yt("offline",n),function(){Jt("online",t),Jt("offline",n)}}},nn=!Gt()||"Deno"in window,rn=nn?Ye.useEffect:Ye.useLayoutEffect,on="undefined"!=typeof navigator&&navigator.connection,an=!nn&&on&&(["slow-2g","2g"].includes(on.effectiveType)||on.saveData),sn=function(e){if(jt(e))try{e=e()}catch(t){e=""}var t=[].concat(e);return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?Wt(e):"",t,e?"$swr$"+e:""]},ln=new WeakMap,cn=function(e,t,n,i,r,o,a){void 0===a&&(a=!0);var s=ln.get(e),l=s[0],c=s[1],u=s[3],h=l[t],d=c[t];if(a&&d)for(var f=0;f<d.length;++f)d[f](n,i,r);return o&&(delete u[t],h&&h[0])?h[0](2).then((function(){return e.get(t)})):e.get(t)},un=0,hn=function(){return++un},dn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return zt(void 0,void 0,void 0,(function(){var t,n,i,r,o,a,s,l,c,u,h,d,f,p,m,g,_,y,v,x,b;return Lt(this,(function(w){switch(w.label){case 0:if(t=e[0],n=e[1],i=e[2],r=e[3],a=!!Nt((o="boolean"==typeof r?{revalidate:r}:r||{}).populateCache)||o.populateCache,s=!1!==o.revalidate,l=!1!==o.rollbackOnError,c=o.optimisticData,u=sn(n),h=u[0],d=u[2],!h)return[2];if(f=ln.get(t),p=f[2],e.length<3)return[2,cn(t,h,t.get(h),Bt,Bt,s,!0)];if(m=i,_=hn(),p[h]=[_,0],y=!Nt(c),v=t.get(h),y&&(x=jt(c)?c(v):c,t.set(h,x),cn(t,h,x)),jt(m))try{m=m(t.get(h))}catch(e){g=e}return m&&jt(m.then)?[4,m.catch((function(e){g=e}))]:[3,2];case 1:if(m=w.sent(),_!==p[h][0]){if(g)throw g;return[2,m]}g&&y&&l&&(a=!0,m=v,t.set(h,v)),w.label=2;case 2:return a&&(g||(jt(a)&&(m=a(m,v)),t.set(h,m)),t.set(d,Ut(t.get(d),{error:g}))),p[h][1]=hn(),[4,cn(t,h,m,g,Bt,s,!!a)];case 3:if(b=w.sent(),g)throw g;return[2,a?b:m]}}))}))},fn=function(e,t){for(var n in e)e[n][0]&&e[n][0](t)},pn=function(e,t){if(!ln.has(e)){var n=Ut(tn,t),i={},r=dn.bind(Bt,e),o=Rt;if(ln.set(e,[i,{},{},{},r]),!nn){var a=n.initFocus(setTimeout.bind(Bt,fn.bind(Bt,i,0))),s=n.initReconnect(setTimeout.bind(Bt,fn.bind(Bt,i,1)));o=function(){a&&a(),s&&s(),ln.delete(e)}}return[e,r,o]}return[e,ln.get(e)[4]]},mn=pn(new Map),gn=mn[0],_n=mn[1],yn=Ut({onLoadingSlow:Rt,onSuccess:Rt,onError:Rt,onErrorRetry:function(e,t,n,i,r){var o=n.errorRetryCount,a=r.retryCount,s=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!Nt(o)&&a>o||setTimeout(i,s,r)},onDiscarded:Rt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:an?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:an?5e3:3e3,compare:function(e,t){return Wt(e)==Wt(t)},isPaused:function(){return!1},cache:gn,mutate:_n,fallback:{}},en),vn=function(e,t){var n=Ut(e,t);if(t){var i=e.use,r=e.fallback,o=t.use,a=t.fallback;i&&o&&(n.use=i.concat(o)),r&&a&&(n.fallback=Ut(r,a))}return n},xn=(0,Ye.createContext)({}),bn=function(e){return jt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}]},wn=function(){return Ut(yn,(0,Ye.useContext)(xn))},En=function(e,t,n){var i=t[e]||(t[e]=[]);return i.push(n),function(){var e=i.indexOf(n);e>=0&&(i[e]=i[i.length-1],i.pop())}},Tn={dedupe:!0},Sn=(Ft.defineProperty((function(e){var t=e.value,n=vn((0,Ye.useContext)(xn),t),i=t&&t.provider,r=(0,Ye.useState)((function(){return i?pn(i(n.cache||gn),t):Bt}))[0];return r&&(n.cache=r[0],n.mutate=r[1]),rn((function(){return r?r[2]:Bt}),[]),(0,Ye.createElement)(xn.Provider,Ut(e,{value:n}))}),"default",{value:yn}),Ot=function(e,t,n){var i=n.cache,r=n.compare,o=n.fallbackData,a=n.suspense,s=n.revalidateOnMount,l=n.refreshInterval,c=n.refreshWhenHidden,u=n.refreshWhenOffline,h=ln.get(i),d=h[0],f=h[1],p=h[2],m=h[3],g=sn(e),_=g[0],y=g[1],v=g[2],x=(0,Ye.useRef)(!1),b=(0,Ye.useRef)(!1),w=(0,Ye.useRef)(_),E=(0,Ye.useRef)(t),T=(0,Ye.useRef)(n),S=function(){return T.current},A=function(){return S().isVisible()&&S().isOnline()},C=function(e){return i.set(v,Ut(i.get(v),e))},k=i.get(_),M=Nt(o)?n.fallback[_]:o,I=Nt(k)?M:k,P=i.get(v)||{},D=P.error,z=!x.current,L=function(){return z&&!Nt(s)?s:!S().isPaused()&&(a?!Nt(I)&&n.revalidateIfStale:Nt(I)||n.revalidateIfStale)},O=!(!_||!t)&&(!!P.isValidating||z&&L()),R=function(e,t){var n=(0,Ye.useState)({})[1],i=(0,Ye.useRef)(e),r=(0,Ye.useRef)({data:!1,error:!1,isValidating:!1}),o=(0,Ye.useCallback)((function(e){var o=!1,a=i.current;for(var s in e){var l=s;a[l]!==e[l]&&(a[l]=e[l],r.current[l]&&(o=!0))}o&&!t.current&&n({})}),[]);return rn((function(){i.current=e})),[i,r.current,o]}({data:I,error:D,isValidating:O},b),B=R[0],F=R[1],N=R[2],j=(0,Ye.useCallback)((function(e){return zt(void 0,void 0,void 0,(function(){var t,o,a,s,l,c,u,h,d,f,g,v,T;return Lt(this,(function(k){switch(k.label){case 0:if(t=E.current,!_||!t||b.current||S().isPaused())return[2,!1];s=!0,l=e||{},c=!m[_]||!l.dedupe,u=function(){return!b.current&&_===w.current&&x.current},h=function(){var e=m[_];e&&e[1]===a&&delete m[_]},d={isValidating:!1},f=function(){C({isValidating:!1}),u()&&N(d)},C({isValidating:!0}),N({isValidating:!0}),k.label=1;case 1:return k.trys.push([1,3,,4]),c&&(cn(i,_,B.current.data,B.current.error,!0),n.loadingTimeout&&!i.get(_)&&setTimeout((function(){s&&u()&&S().onLoadingSlow(_,n)}),n.loadingTimeout),m[_]=[t.apply(void 0,y),hn()]),T=m[_],o=T[0],a=T[1],[4,o];case 2:return o=k.sent(),c&&setTimeout(h,n.dedupingInterval),m[_]&&m[_][1]===a?(C({error:Bt}),d.error=Bt,g=p[_],!Nt(g)&&(a<=g[0]||a<=g[1]||0===g[1])?(f(),c&&u()&&S().onDiscarded(_),[2,!1]):(r(B.current.data,o)?d.data=B.current.data:d.data=o,r(i.get(_),o)||i.set(_,o),c&&u()&&S().onSuccess(o,_,n),[3,4])):(c&&u()&&S().onDiscarded(_),[2,!1]);case 3:return v=k.sent(),h(),S().isPaused()||(C({error:v}),d.error=v,c&&u()&&(S().onError(v,_,n),("boolean"==typeof n.shouldRetryOnError&&n.shouldRetryOnError||jt(n.shouldRetryOnError)&&n.shouldRetryOnError(v))&&A()&&S().onErrorRetry(v,_,n,j,{retryCount:(l.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return s=!1,f(),u()&&c&&cn(i,_,d.data,d.error,!1),[2,!0]}}))}))}),[_]),U=(0,Ye.useCallback)(dn.bind(Bt,i,(function(){return w.current})),[]);if(rn((function(){E.current=t,T.current=n}
2)),rn((function(){if(_){var e=_!==w.current,t=j.bind(Bt,Tn),n=0,i=En(_,f,(function(e,t,n){N(Ut({error:t,isValidating:n},r(B.current.data,e)?Bt:{data:e}))})),o=En(_,d,(function(e){if(0==e){var i=Date.now();S().revalidateOnFocus&&i>n&&A()&&(n=i+S().focusThrottleInterval,t())}else if(1==e)S().revalidateOnReconnect&&A()&&t();else if(2==e)return j()}));return b.current=!1,w.current=_,x.current=!0,e&&N({data:I,error:D,isValidating:O}),L()&&(Nt(I)||nn?t():(a=t,Gt()&&typeof window.requestAnimationFrame!=Vt?window.requestAnimationFrame(a):setTimeout(a,1))),function(){b.current=!0,i(),o()}}var a}),[_,j]),rn((function(){var e;function t(){var t=jt(l)?l(I):l;t&&-1!==e&&(e=setTimeout(n,t))}function n(){B.current.error||!c&&!S().isVisible()||!u&&!S().isOnline()?t():j(Tn).then(t)}return t(),function(){e&&(clearTimeout(e),e=-1)}}),[l,c,u,j]),(0,Ye.useDebugValue)(I),a&&Nt(I)&&_)throw E.current=t,T.current=n,b.current=!1,Nt(D)?j(Tn):D;return{mutate:U,get data(){return F.data=!0,I},get error(){return F.error=!0,D},get isValidating(){return F.isValidating=!0,O}}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=wn(),i=bn(e),r=i[0],o=i[1],a=i[2],s=vn(n,a),l=Ot,c=s.use;if(c)for(var u=c.length;u-- >0;)l=c[u](l);return l(r,o||s.fetcher,s)});const An=function(e){return Ye.createElement("div",{className:"pt-5 pb-3 text-center bg-black text-white"},Ye.createElement("span",{className:"font--subline"},"Search results for"),Ye.createElement("h1",{className:"h2 font--secondary mt-2 mb-4"},'"',e.searchQuery,'"'))},Cn=function(e){return Ye.createElement("div",{className:"col-12 col-lg-3"},Ye.createElement("div",{className:"my-2"},Ye.createElement("div",{className:"w-100 d-flex align-items-center justify-content-between mb-4"},Ye.createElement("h2",{className:"font--secondary mb-0"},"Filters"),Ye.createElement("button",{type:"button",className:"btn btn-sm btn-outline-danger",onClick:function(){e.filterStateSetter(""),e.pageSetter(1)}},"Reset")),Ye.createElement("h3",{className:"visually-hidden"},"Site Section"),Ye.createElement("div",{className:"searchfilter__options mb-5"},Object.keys(On).map((function(t,n){var i=On[t],r=i.title,o=i.description,a=i.key;return Ye.createElement("div",{className:"searchfilter__option",key:t},Ye.createElement("input",{type:"radio",name:"searchfilter__option_radio",id:t,checked:e.filterState===a,onChange:function(){return e.filterStateSetter(a)}}),Ye.createElement("label",{htmlFor:t},Ye.createElement("h4",{className:"h5 fw-bold font--secondary mb-1"},r),o?Ye.createElement("small",null,o):null))}))),Ye.createElement("h3",{className:"font--secondary h4 mb-4"},"Facets"),Ye.createElement("div",{className:"searchfilter__options mb-5"},e.facetsAvailable.map((function(e,t){var n=ft().snakeCase(e.Title);return Ye.createElement("div",{className:"searchfilter__option",key:n},Ye.createElement("input",{type:"checkbox",className:"searchfilter__option_radio",name:n,id:n}),Ye.createElement("label",{htmlFor:n},e.Title," ",Ye.createElement("small",{className:"font--subline"},"(",e.Count,")")))}))),Ye.createElement("h3",{className:"font--secondary h4 mb-4"},"Regions"),Ye.createElement("div",{className:"searchfilter__options mb-5"},Rn.map((function(e,t){var n=ft().snakeCase(e);return Ye.createElement("div",{className:"searchfilter__option",key:n},Ye.createElement("input",{type:"checkbox",className:"searchfilter__option_radio",name:n,id:n}),Ye.createElement("label",{htmlFor:n},e))})))))};function kn(e){return function(e){if(Array.isArray(e))return Mn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Mn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Mn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var In="«";const Pn=function(e){return Ye.createElement("div",{className:"d-flex flex-wrap justify-content align-items-center mt-5"},Ye.createElement("ul",{className:"pagination mx-auto"},function(e,t,n){if(e>9){var i=Math.max(2,t-2),r=Math.min(e-1,t+3),o=_.each(_.range(i,t<2?r+1:r),(function(e){return e.toString()})),a=i>2,s=e-r>1,l=7-(o.length+1);switch(!0){case a&&!s:var c=_.range(i-l,i-1);o=[In].concat(kn(c),kn(o));break;case!a&&s:var u=_.range(r+1,r+l);o=[].concat(kn(o),kn(u),["»"]);break;default:o=[In].concat(kn(o),["»"])}
2return[1].concat(kn(o),[e])}return _.range(1,e)}(e.total,e.current).map((function(t,n){return Ye.createElement("li",{className:e.current==parseInt(t)?"page-item active":"page-item",key:n},Ye.createElement("button",{type:"button",className:"page-link",onClick:function(){isNaN(parseInt(t))?t==In?e.stateSetter(e.current-1):"»"==t&&e.stateSetter(e.current+1):e.stateSetter(t)}},t))}))))},Dn=function(e){return Ye.createElement("div",{className:"searchfilter__results"},e.data.map((function(e,t){return Ye.createElement("div",{className:"searchfilter__result mb-3",key:e.DocId},Ye.createElement("div",{className:"searchfilter__result_description"},Ye.createElement("h3",{className:"font--secondary mb-3"},Ye.createElement("a",{href:e.URL,dangerouslySetInnerHTML:{__html:e.Title}})),Ye.createElement("div",null,e.Description)),Ye.createElement("div",{className:"searchfilter__result_image"}))})))};function zn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(s.push(i.value),s.length!==t);l=!0);}catch(e){c=!0,r=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ln(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ln(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ln(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var On=[{key:"",title:"All"},{key:"thingstodo",title:"Things To Do",description:"Find yourself some adventurous attractions, beautiful landscapes and secluded getaways."},{key:"placestosee",title:"Places To See",description:"See why the Mornington Peninsula has long been a favourite getaway destination."},{key:"whatson",title:"What's On",description:"Explore upcoming events around the Peninsula and see just what we have to offer."},{key:"accommodation",title:"Accommodation",description:"Find places to stay to extend your visit and experience more."},{key:"blog",title:"Blog",description:"Find enthralling stories from around Mornington and see what makes us unique."}],Rn=["Balnarring","Dromana","Flinders","Frankston","Hastings","McCrae","Mornington","Mount Eliza","Mount Martha","Portsea","Red Hill and Main Ridge","Rosebud","Rye","Sorrento"],Bn=function(e){return fetch(e).then((function(e){return e.json()}))};function Fn(e){var t=zn((0,Ye.useState)(""),2),n=t[0],i=t[1],r=zn((0,Ye.useState)([]),2),o=r[0],a=r[1],s=zn((0,Ye.useState)(1),2),l=s[0],c=s[1],u=new URLSearchParams(window.location.search).get("q"),h={"sb-bhvr":"1","sb-search":u,"sb-page":l.toString(),portalId:"0",format:"json"},d=new URLSearchParams(h);d.sort();var f=Sn("".concat("/DesktopModules/DnnSharp/SearchBoost/SearchService.ashx","?")+d.toString(),Bn),p=f.data,m=f.error;return Ye.createElement("section",{id:"content"},Ye.createElement(An,{searchQuery:u}),Ye.createElement("div",{className:"container pb-4 px-4 px-lg-5 rounded-1"},Ye.createElement("div",{className:"row my-5"},Ye.createElement(Cn,{filterState:n,filterStateSetter:i,filterRegion:o,filterRegionSetter:a,pageSetter:c,facetsAvailable:p?p.Facets:[]}),p?Ye.createElement("div",{className:"col-12 col-lg-9"},Ye.createElement(Dn,{pageCurrent:l,pageLast:p.TotalResultsPages,pageSize:p.PageSize,total:p.TotalResults,data:p.SearchResults}),Ye.createElement(Pn,{stateSetter:c,current:l,total:p.TotalResultsPages})):null,m?Ye.createElement("span",null,"SOMETHING WENT HORRIBLY WRONG"):null)))}window.addEventListener("load",(function(){document.querySelectorAll("[data-search-app]").forEach((function(e){Ke.render(Ye.createElement(Fn,null),e)}))})),n(926),window.addEventListener("load",(function(){null!=document.querySelector(".carousel")&&document.querySelectorAll(".carousel").forEach((function(e){new(Ge())(e,{imagesLoaded:!0,groupCells:!0,pageDots:!1,prevNextButtons:!0,lazyLoad:!0,on:{ready:function(){1===this.slides.length?(null!=this.element.nextSibling.nextSibling&&(this.element.nextSibling.nextSibling.classList="container d-none"),this.element.classList.add("slide-single")):(qe(this,this.selectedIndex,this.slides.length),$e(this,this.slides.length))},change:function(e){1!=this.slides.length&&(We(this,e,this.slides.length),Ze(this,e,this.slides.length))}}})})),null!=document.querySelector(".slipper")&&document.querySelectorAll(".slipper").forEach((function(e){new(Ge())(e,{imagesLoaded:!0,groupCells:!0,pageDots:!1,prevNextButtons:!0,wrapAround:!1,lazyLoad:!0,on:{ready:function(){1===this.slides.length?(this.element.nextSibling.nextSibling.classList="container d-none",this.element.classList.add("slide-single")):(qe(this,this.selectedIndex,this.slides.length),$e(this,this.slides.length))},change:function(e){1!=this.slides.length&&(We(this,e,this.slides.length),Ze(this,e,this.slides.length))}}})})),null!=document.querySelector(".corporate")&&new(Ge())(document.querySelector(".corporate"),{imagesLoaded:!0,pageDots:!1,prevNextButtons:!1,wrapAround:!0,autoPlay:2500,pauseAutoPlayOnHover:!1})}));var Nn=n(905),jn=n.n(Nn);window.addEventListener("load",(function(){jn().init({svgSelector:"img.svg",initClass:"js-inlinesvg"},(function(){}))}));var Un=[];function Vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?Vn(Object(n),!0).forEach((function(t){$n(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qn(e){return qn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qn(e)}function $n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wn(){return Wn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Wn.apply(this,arguments)}function Zn(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Xn(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}window.addEventListener("load",(function(){var e;He().accessToken=it,null!=document.querySelector(".trail__app")&&(e=new(He().Map)({container:document.querySelector(".trail__app_canvas #map"),style:"mapbox://styles/webmatrixau/ckrpn3ea40efs17mxr84bbemq",center:[145.0903408356885,-38.32280575257686],zoom:9})).on("load",(function(){e.addControl(new(He().NavigationControl)),e.scrollZoom.disable();var t=new(He().LngLatBounds);e.addSource("filekml",{type:"vector",url:"mapbox://".concat(_MAP.id)}),e.addLayer({id:"filekml-line",type:"line",source:"filekml","source-layer":_MAP.layer,layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#000","line-width":3,"line-opacity":1}}),_MAP.data.forEach((function(n,i){var r=new(He().Popup)({offset:25,closeButton:!1,closeOnClick:!1,closeOnMove:!0}).setHTML('\n          <img src="'.concat(n.Image,'" />\n          <h5>').concat(n.Title,"</h5>\n        ")),o=document.createElement("div");o.className="marker",o.innerHTML=(i+1).toString(),o.classList.add("trail__card_index"),o.setAttribute("id","trail__marker_"+n.ID),o.setAttribute("data-id","trail__marker_"+n.ID),o.setAttribute("data-index",i.toString()),o.setAttribute("content-index","trail__"+i.toString()),o.addEventListener("click",(function(t){var n=t.target;e.setZoom(15),e.flyTo({center:[_MAP.data[n.getAttribute("data-index")].Location.Longitude,_MAP.data[n.getAttribute("data-index")].Location.Latitude]}),document.querySelector("a[name="+n.getAttribute("content-index")+"]").scrollIntoView(!0),setTimeout((function(){window.scrollBy(0,-350)}),500)}));var a=new(He().Marker)(o).setLngLat([n.Location.Longitude,n.Location.Latitude]).setPopup(r).addTo(e);t.extend([n.Location.Longitude,n.Location.Latitude]),Un.push(a)})),e.fitBounds(t,{padding:100})})),document.addEventListener("scroll",(function(t){var n=0;document.querySelectorAll(".trail__card").forEach((function(e){e.getBoundingClientRect().top-450<0&&n++})),n>0&&Un.length>0&&"_lngLat"in Un[n-1]&&(e.flyTo({center:Un[n-1]._lngLat,speed:5,curve:1,bearing:0,zoom:_MAP.data[n-1].Zoom}),new(He().Popup)({offset:25,closeButton:!1,closeOnClick:!1,closeOnMove:!0}).setHTML('\n            <img src="'.concat(_MAP.data[n-1].Image,'" />\n            <h5>').concat(_MAP.data[n-1].Title,"</h5>\n          ")).setLngLat(Un[n-1]._lngLat).addTo(e))}))}));var Hn=Xn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Yn=Xn(/Edge/i),Kn=Xn(/firefox/i),Jn=Xn(/safari/i)&&!Xn(/chrome/i)&&!Xn(/android/i),Qn=Xn(/iP(ad|od|hone)/i),ei=Xn(/chrome/i)&&Xn(/android/i),ti={capture:!1,passive:!1};function ni(e,t,n){e.addEventListener(t,n,!Hn&&ti)}function ii(e,t,n){e.removeEventListener(t,n,!Hn&&ti)}function ri(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function oi(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function ai(e,t,n,i){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&ri(e,t):ri(e,t))||i&&e===n)return e;if(e===n)break}while(e=oi(e))}return null}var si,li=/\s+/g;function ci(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(li," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(li," ")}}
vendor: 4,267 bytes, line 2
2function ui(e,t,n){var i=e&&e.style;if(i){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in i||-1!==t.indexOf("webkit")||(t="-webkit-"+t),i[t]=n+("string"==typeof n?"":"px")}}function hi(e,t){var n="";if("string"==typeof e)n=e;else do{var i=ui(e,"transform");i&&"none"!==i&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var r=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return r&&new r(n)}function di(e,t,n){if(e){var i=e.getElementsByTagName(t),r=0,o=i.length;if(n)for(;r<o;r++)n(i[r],r);return i}return[]}function fi(){return document.scrollingElement||document.documentElement}function pi(e,t,n,i,r){if(e.getBoundingClientRect||e===window){var o,a,s,l,c,u,h;if(e!==window&&e.parentNode&&e!==fi()?(a=(o=e.getBoundingClientRect()).top,s=o.left,l=o.bottom,c=o.right,u=o.height,h=o.width):(a=0,s=0,l=window.innerHeight,c=window.innerWidth,u=window.innerHeight,h=window.innerWidth),(t||n)&&e!==window&&(r=r||e.parentNode,!Hn))do{if(r&&r.getBoundingClientRect&&("none"!==ui(r,"transform")||n&&"static"!==ui(r,"position"))){var d=r.getBoundingClientRect();a-=d.top+parseInt(ui(r,"border-top-width")),s-=d.left+parseInt(ui(r,"border-left-width")),l=a+o.height,c=s+o.width;break}}while(r=r.parentNode);if(i&&e!==window){var f=hi(r||e),p=f&&f.a,m=f&&f.d;f&&(l=(a/=m)+(u/=m),c=(s/=p)+(h/=p))}return{top:a,left:s,bottom:l,right:c,width:h,height:u}}}function mi(e,t,n){for(var i=xi(e,!0),r=pi(e)[t];i;){var o=pi(i)[n];if(!("top"===n||"left"===n?r>=o:r<=o))return i;if(i===fi())break;i=xi(i,!1)}return!1}function gi(e,t,n,i){for(var r=0,o=0,a=e.children;o<a.length;){if("none"!==a[o].style.display&&a[o]!==wr.ghost&&(i||a[o]!==wr.dragged)&&ai(a[o],n.draggable,e,!1)){if(r===t)return a[o];r++}o++}return null}function _i(e,t){for(var n=e.lastElementChild;n&&(n===wr.ghost||"none"===ui(n,"display")||t&&!ri(n,t));)n=n.previousElementSibling;return n||null}function yi(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===wr.clone||t&&!ri(e,t)||n++;return n}function vi(e){var t=0,n=0,i=fi();if(e)do{var r=hi(e),o=r.a,a=r.d;t+=e.scrollLeft*o,n+=e.scrollTop*a}while(e!==i&&(e=e.parentNode));return[t,n]}function xi(e,t){if(!e||!e.getBoundingClientRect)return fi();var n=e,i=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var r=ui(n);if(n.clientWidth<n.scrollWidth&&("auto"==r.overflowX||"scroll"==r.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==r.overflowY||"scroll"==r.overflowY)){if(!n.getBoundingClientRect||n===document.body)return fi();if(i||t)return n;i=!0}}}while(n=n.parentNode);return fi()}function bi(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function wi(e,t){return function(){if(!si){var n=arguments,i=this;1===n.length?e.call(i,n[0]):e.apply(i,n),si=setTimeout((function(){si=void 0}),t)}}}function Ei(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Ti(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var Si="Sortable"+(new Date).getTime();var Ai=[],Ci={initializeByDefault:!0},ki={mount:function(e){for(var t in Ci)Ci.hasOwnProperty(t)&&!(t in e)&&(e[t]=Ci[t]);Ai.forEach((function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")})),Ai.push(e)},pluginEvent:function(e,t,n){var i=this;this.eventCanceled=!1,n.cancel=function(){i.eventCanceled=!0};var r=e+"Global";Ai.forEach((function(i){t[i.pluginName]&&(t[i.pluginName][r]&&t[i.pluginName][r](Gn({sortable:t},n)),t.options[i.pluginName]&&t[i.pluginName][e]&&t[i.pluginName][e](Gn({sortable:t},n)))}))},initializePlugins:function(e,t,n,i){for(var r in Ai.forEach((function(i){var r=i.pluginName;if(e.options[r]||i.initializeByDefault){var o=new i(e,t,e.options);o.sortable=e,o.options=e.options,e[r]=o,Wn(n,o.defaults)}})),e.options)if(e.options.hasOwnProperty(r)){var o=this.modifyOption(e,r,e.options[r]);void 0!==o&&(e.options[r]=o)}},getEventProperties:function(e,t){var n={};
vendor: 2,147 bytes, line 2
2return Ai.forEach((function(i){"function"==typeof i.eventProperties&&Wn(n,i.eventProperties.call(t[i.pluginName],e))})),n},modifyOption:function(e,t,n){var i;return Ai.forEach((function(r){e[r.pluginName]&&r.optionListeners&&"function"==typeof r.optionListeners[t]&&(i=r.optionListeners[t].call(e[r.pluginName],n))})),i}};var Mi=["evt"],Ii=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.evt,r=Zn(n,Mi);ki.pluginEvent.bind(wr)(e,t,Gn({dragEl:Di,parentEl:zi,ghostEl:Li,rootEl:Oi,nextEl:Ri,lastDownEl:Bi,cloneEl:Fi,cloneHidden:Ni,dragStarted:Ji,putSortable:$i,activeSortable:wr.active,originalEvent:i,oldIndex:ji,oldDraggableIndex:Vi,newIndex:Ui,newDraggableIndex:Gi,hideGhostForTarget:yr,unhideGhostForTarget:vr,cloneNowHidden:function(){Ni=!0},cloneNowShown:function(){Ni=!1},dispatchSortableEvent:function(e){Pi({sortable:t,name:e,originalEvent:i})}},r))};function Pi(e){!function(e){var t=e.sortable,n=e.rootEl,i=e.name,r=e.targetEl,o=e.cloneEl,a=e.toEl,s=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,h=e.newDraggableIndex,d=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Si]){var m,g=t.options,_="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||Hn||Yn?(m=document.createEvent("Event")).initEvent(i,!0,!0):m=new CustomEvent(i,{bubbles:!0,cancelable:!0}),m.to=a||n,m.from=s||n,m.item=r||n,m.clone=o,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=u,m.newDraggableIndex=h,m.originalEvent=d,m.pullMode=f?f.lastPutMode:void 0;var y=Gn(Gn({},p),ki.getEventProperties(i,t));for(var v in y)m[v]=y[v];n&&n.dispatchEvent(m),g[_]&&g[_].call(t,m)}}(Gn({putSortable:$i,cloneEl:Fi,targetEl:Di,rootEl:Oi,oldIndex:ji,oldDraggableIndex:Vi,newIndex:Ui,newDraggableIndex:Gi},e))}var Di,zi,Li,Oi,Ri,Bi,Fi,Ni,ji,Ui,Vi,Gi,qi,$i,Wi,Zi,Xi,Hi,Yi,Ki,Ji,Qi,er,tr,nr,ir=!1,rr=!1,or=[],ar=!1,sr=!1,lr=[],cr=!1,ur=[],hr="undefined"!=typeof document,dr=Qn,fr=Yn||Hn?"cssFloat":"float",pr=hr&&!ei&&!Qn&&"draggable"in document.createElement("div"),mr=function(){if(hr){if(Hn)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}
vendor: 4,391 bytes, line 2
2(),gr=function(e,t){var n=ui(e),i=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),r=gi(e,0,t),o=gi(e,1,t),a=r&&ui(r),s=o&&ui(o),l=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+pi(r).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+pi(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&"none"!==a.float){var u="left"===a.float?"left":"right";return!o||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return r&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||l>=i&&"none"===n[fr]||o&&"none"===n[fr]&&l+c>i)?"vertical":"horizontal"},_r=function(e){function t(e,n){return function(i,r,o,a){var s=i.options.group.name&&r.options.group.name&&i.options.group.name===r.options.group.name;if(null==e&&(n||s))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(i,r,o,a),n)(i,r,o,a);var l=(n?i:r).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},i=e.group;i&&"object"==qn(i)||(i={name:i}),n.name=i.name,n.checkPull=t(i.pull,!0),n.checkPut=t(i.put),n.revertClone=i.revertClone,e.group=n},yr=function(){!mr&&Li&&ui(Li,"display","none")},vr=function(){!mr&&Li&&ui(Li,"display","")};hr&&!ei&&document.addEventListener("click",(function(e){if(rr)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),rr=!1,!1}),!0);var xr=function(e){if(Di){e=e.touches?e.touches[0]:e;var t=(r=e.clientX,o=e.clientY,or.some((function(e){var t=e[Si].options.emptyInsertThreshold;if(t&&!_i(e)){var n=pi(e),i=r>=n.left-t&&r<=n.right+t,s=o>=n.top-t&&o<=n.bottom+t;return i&&s?a=e:void 0}})),a);if(t){var n={};for(var i in e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Si]._onDragOver(n)}}var r,o,a},br=function(e){Di&&Di.parentNode[Si]._isOutsideThisEl(e.target)};function wr(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Wn({},t),e[Si]=this;var n,i,r={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return gr(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==wr.supportPointer&&"PointerEvent"in window&&!Jn,emptyInsertThreshold:5};for(var o in ki.initializePlugins(this,e,r),r)!(o in t)&&(t[o]=r[o]);for(var a in _r(t),this)"_"===a.charAt(0)&&"function"==typeof this[a]&&(this[a]=this[a].bind(this));this.nativeDraggable=!t.forceFallback&&pr,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ni(e,"pointerdown",this._onTapStart):(ni(e,"mousedown",this._onTapStart),ni(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ni(e,"dragover",this),ni(e,"dragenter",this)),or.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Wn(this,(i=[],{captureAnimationState:function(){i=[],this.options.animation&&[].slice.call(this.el.children).forEach((function(e){if("none"!==ui(e,"display")&&e!==wr.ghost){i.push({target:e,rect:pi(e)});var t=Gn({},i[i.length-1].rect);if(e.thisAnimationDuration){var n=hi(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}}))},addAnimationState:function(e){i.push(e)},removeAnimationState:function(e){i.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var i in t)if(t.hasOwnProperty(i)&&t[i]===e[n][i])return Number(n);return-1}(i,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var r=!1,o=0;
vendor: 6,303 bytes, line 2
2i.forEach((function(e){var n=0,i=e.target,a=i.fromRect,s=pi(i),l=i.prevFromRect,c=i.prevToRect,u=e.rect,h=hi(i,!0);h&&(s.top-=h.f,s.left-=h.e),i.toRect=s,i.thisAnimationDuration&&bi(l,s)&&!bi(a,s)&&(u.top-s.top)/(u.left-s.left)==(a.top-s.top)/(a.left-s.left)&&(n=function(e,t,n,i){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*i.animation}(u,l,c,t.options)),bi(s,a)||(i.prevFromRect=a,i.prevToRect=s,n||(n=t.options.animation),t.animate(i,u,s,n)),n&&(r=!0,o=Math.max(o,n),clearTimeout(i.animationResetTimer),i.animationResetTimer=setTimeout((function(){i.animationTime=0,i.prevFromRect=null,i.fromRect=null,i.prevToRect=null,i.thisAnimationDuration=null}),n),i.thisAnimationDuration=n)})),clearTimeout(n),r?n=setTimeout((function(){"function"==typeof e&&e()}),o):"function"==typeof e&&e(),i=[]},animate:function(e,t,n,i){if(i){ui(e,"transition",""),ui(e,"transform","");var r=hi(this.el),o=r&&r.a,a=r&&r.d,s=(t.left-n.left)/(o||1),l=(t.top-n.top)/(a||1);e.animatingX=!!s,e.animatingY=!!l,ui(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),ui(e,"transition","transform "+i+"ms"+(this.options.easing?" "+this.options.easing:"")),ui(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout((function(){ui(e,"transition",""),ui(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1}),i)}}}))}function Er(e,t,n,i,r,o,a,s){var l,c,u=e[Si],h=u.options.onMove;return!window.CustomEvent||Hn||Yn?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=i,l.related=r||t,l.relatedRect=o||pi(t),l.willInsertAfter=s,l.originalEvent=a,e.dispatchEvent(l),h&&(c=h.call(u,l,a)),c}function Tr(e){e.draggable=!1}function Sr(){cr=!1}function Ar(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,i=0;n--;)i+=t.charCodeAt(n);return i.toString(36)}function Cr(e){return setTimeout(e,0)}function kr(e){return clearTimeout(e)}wr.prototype={constructor:wr,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(Qi=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Di):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,i=this.options,r=i.preventOnFilter,o=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(a||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=i.filter;if(function(e){ur.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var i=t[n];i.checked&&ur.push(i)}}(n),!Di&&!(/mousedown|pointerdown/.test(o)&&0!==e.button||i.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!Jn||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=ai(s,i.draggable,n,!1))&&s.animated||Bi===s)){if(ji=yi(s),Vi=yi(s,i.draggable),"function"==typeof c){if(c.call(this,e,s,this))return Pi({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),Ii("filter",t,{evt:e}),void(r&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some((function(i){if(i=ai(l,i.trim(),n,!1))return Pi({sortable:t,rootEl:i,name:"filter",targetEl:s,fromEl:n,toEl:n}),Ii("filter",t,{evt:e}),!0}))))return void(r&&e.cancelable&&e.preventDefault());i.handle&&!ai(l,i.handle,n,!1)||this._prepareDragStart(e,a,s)}}},_prepareDragStart:function(e,t,n){var i,r=this,o=r.el,a=r.options,s=o.ownerDocument;if(n&&!Di&&n.parentNode===o){var l=pi(n);if(Oi=o,zi=(Di=n).parentNode,Ri=Di.nextSibling,Bi=n,qi=a.group,wr.dragged=Di,Wi={target:Di,clientX:(t||e).clientX,clientY:(t||e).clientY},Yi=Wi.clientX-l.left,Ki=Wi.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Di.style["will-change"]="all",i=function(){Ii("delayEnded",r,{evt:e}),wr.eventCanceled?r._onDrop():(r._disableDelayedDragEvents(),!Kn&&r.nativeDraggable&&(Di.draggable=!0),r._triggerDragStart(e,t),Pi({sortable:r,name:"choose",originalEvent:e}),ci(Di,a.chosenClass,!0))},a.ignore.split(",").forEach((function(e){di(Di,e.trim(),Tr)})),ni(s,"dragover",xr),ni(s,"mousemove",xr),ni(s,"touchmove",xr),ni(s,"mouseup",r._onDrop),ni(s,"touchend",r._onDrop),ni(s,"touchcancel",r._onDrop),Kn&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Di.draggable=!0),Ii("delayStart",this,{evt:e}),!a.delay||a.delayOnTouchOnly&&!t||this.nativeDraggable&&(Yn||Hn))i();else{if(wr.eventCanceled)return void this._onDrop();ni(s,"mouseup",r._disableDelayedDrag),ni(s,"touchend",r._disableDelayedDrag),ni(s,"touchcancel",r._disableDelayedDrag),ni(s,"mousemove",r._delayedDragTouchMoveHandler),ni(s,"touchmove",r._delayedDragTouchMoveHandler),a.supportPointer&&ni(s,"pointermove",r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(i,a.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Di&&Tr(Di),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;ii(e,"mouseup",this._disableDelayedDrag),ii(e,"touchend",this._disableDelayedDrag),ii(e,"touchcancel",this._disableDelayedDrag),ii(e,"mousemove",this._delayedDragTouchMoveHandler),ii(e,"touchmove",this._delayedDragTouchMoveHandler),ii(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?ni(document,"pointermove",this._onTouchMove):ni(document,t?"touchmove":"mousemove",this._onTouchMove):(ni(Di,"dragend",this),ni(Oi,"dragstart",this._onDragStart));try{document.selection?Cr((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(ir=!1,Oi&&Di){Ii("dragStarted",this,{evt:t}),this.nativeDraggable&&ni(document,"dragover",br);var n=this.options;!e&&ci(Di,n.dragClass,!1),ci(Di,n.ghostClass,!0),wr.active=this,e&&this._appendGhost(),Pi({sortable:this,name:"start",originalEvent:t})}
vendor: 8,231 bytes, line 2
2else this._nulling()},_emulateDragOver:function(){if(Zi){this._lastX=Zi.clientX,this._lastY=Zi.clientY,yr();for(var e=document.elementFromPoint(Zi.clientX,Zi.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Zi.clientX,Zi.clientY))!==t;)t=e;if(Di.parentNode[Si]._isOutsideThisEl(e),t)do{if(t[Si]&&t[Si]._onDragOver({clientX:Zi.clientX,clientY:Zi.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);vr()}},_onTouchMove:function(e){if(Wi){var t=this.options,n=t.fallbackTolerance,i=t.fallbackOffset,r=e.touches?e.touches[0]:e,o=Li&&hi(Li,!0),a=Li&&o&&o.a,s=Li&&o&&o.d,l=dr&&nr&&vi(nr),c=(r.clientX-Wi.clientX+i.x)/(a||1)+(l?l[0]-lr[0]:0)/(a||1),u=(r.clientY-Wi.clientY+i.y)/(s||1)+(l?l[1]-lr[1]:0)/(s||1);if(!wr.active&&!ir){if(n&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(Li){o?(o.e+=c-(Xi||0),o.f+=u-(Hi||0)):o={a:1,b:0,c:0,d:1,e:c,f:u};var h="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");ui(Li,"webkitTransform",h),ui(Li,"mozTransform",h),ui(Li,"msTransform",h),ui(Li,"transform",h),Xi=c,Hi=u,Zi=r}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Li){var e=this.options.fallbackOnBody?document.body:Oi,t=pi(Di,!0,dr,!0,e),n=this.options;if(dr){for(nr=e;"static"===ui(nr,"position")&&"none"===ui(nr,"transform")&&nr!==document;)nr=nr.parentNode;nr!==document.body&&nr!==document.documentElement?(nr===document&&(nr=fi()),t.top+=nr.scrollTop,t.left+=nr.scrollLeft):nr=fi(),lr=vi(nr)}ci(Li=Di.cloneNode(!0),n.ghostClass,!1),ci(Li,n.fallbackClass,!0),ci(Li,n.dragClass,!0),ui(Li,"transition",""),ui(Li,"transform",""),ui(Li,"box-sizing","border-box"),ui(Li,"margin",0),ui(Li,"top",t.top),ui(Li,"left",t.left),ui(Li,"width",t.width),ui(Li,"height",t.height),ui(Li,"opacity","0.8"),ui(Li,"position",dr?"absolute":"fixed"),ui(Li,"zIndex","100000"),ui(Li,"pointerEvents","none"),wr.ghost=Li,e.appendChild(Li),ui(Li,"transform-origin",Yi/parseInt(Li.style.width)*100+"% "+Ki/parseInt(Li.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,i=e.dataTransfer,r=n.options;Ii("dragStart",this,{evt:e}),wr.eventCanceled?this._onDrop():(Ii("setupClone",this),wr.eventCanceled||((Fi=Ti(Di)).removeAttribute("id"),Fi.draggable=!1,Fi.style["will-change"]="",this._hideClone(),ci(Fi,this.options.chosenClass,!1),wr.clone=Fi),n.cloneId=Cr((function(){Ii("clone",n),wr.eventCanceled||(n.options.removeCloneOnHide||Oi.insertBefore(Fi,Di),n._hideClone(),Pi({sortable:n,name:"clone"}))})),!t&&ci(Di,r.dragClass,!0),t?(rr=!0,n._loopId=setInterval(n._emulateDragOver,50)):(ii(document,"mouseup",n._onDrop),ii(document,"touchend",n._onDrop),ii(document,"touchcancel",n._onDrop),i&&(i.effectAllowed="move",r.setData&&r.setData.call(n,i,Di)),ni(document,"drop",n),ui(Di,"transform","translateZ(0)")),ir=!0,n._dragStartId=Cr(n._dragStarted.bind(n,t,e)),ni(document,"selectstart",n),Ji=!0,Jn&&ui(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,i,r,o=this.el,a=e.target,s=this.options,l=s.group,c=wr.active,u=qi===l,h=s.sort,d=$i||c,f=this,p=!1;if(!cr){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),a=ai(a,s.draggable,o,!0),M("dragOver"),wr.eventCanceled)return p;if(Di.contains(e.target)||a.animated&&a.animatingX&&a.animatingY||f._ignoreWhileAnimating===a)return P(!1);if(rr=!1,c&&!s.disabled&&(u?h||(i=zi!==Oi):$i===this||(this.lastPutMode=qi.checkPull(this,c,Di,e))&&l.checkPut(this,c,Di,e))){if(r="vertical"===this._getDirection(e,a),t=pi(Di),M("dragOverValid"),wr.eventCanceled)return p;if(i)return zi=Oi,I(),this._hideClone(),M("revert"),wr.eventCanceled||(Ri?Oi.insertBefore(Di,Ri):Oi.appendChild(Di)),P(!0);var m=_i(o,s.draggable);if(!m||function(e,t,n){var i=pi(_i(n.el,n.options.draggable));return t?e.clientX>i.right+10||e.clientX<=i.right&&e.clientY>i.bottom&&e.clientX>=i.left:e.clientX>i.right&&e.clientY>i.top||e.clientX<=i.right&&e.clientY>i.bottom+10}(e,r,this)&&!m.animated){if(m===Di)return P(!1);if(m&&o===e.target&&(a=m),a&&(n=pi(a)),!1!==Er(Oi,o,Di,t,a,n,e,!!a))return I(),m&&m.nextSibling?o.insertBefore(Di,m.nextSibling):o.appendChild(Di),zi=o,D(),P(!0)}else if(m&&function(e,t,n){var i=pi(gi(n.el,0,n.options,!0));return t?e.clientX<i.left-10||e.clientY<i.top&&e.clientX<i.right:e.clientY<i.top-10||e.clientY<i.bottom&&e.clientX<i.left}(e,r,this)){var g=gi(o,0,s,!0);if(g===Di)return P(!1);if(n=pi(a=g),!1!==Er(Oi,o,Di,t,a,n,e,!1))return I(),o.insertBefore(Di,g),zi=o,D(),P(!0)}else if(a.parentNode===o){n=pi(a);var _,y,v,x=Di.parentNode!==o,b=!function(e,t,n){var i=n?e.left:e.top,r=n?e.right:e.bottom,o=n?e.width:e.height,a=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return i===a||r===s||i+o/2===a+l/2}(Di.animated&&Di.toRect||t,a.animated&&a.toRect||n,r),w=r?"top":"left",E=mi(a,"top","top")||mi(Di,"top","top"),T=E?E.scrollTop:void 0;if(Qi!==a&&(y=n[w],ar=!1,sr=!b&&s.invertSwap||x),_=function(e,t,n,i,r,o,a,s){var l=i?e.clientY:e.clientX,c=i?n.height:n.width,u=i?n.top:n.left,h=i?n.bottom:n.right,d=!1;if(!a)if(s&&tr<c*r){if(!ar&&(1===er?l>u+c*o/2:l<h-c*o/2)&&(ar=!0),ar)d=!0;else if(1===er?l<u+tr:l>h-tr)return-er}else if(l>u+c*(1-r)/2&&l<h-c*(1-r)/2)return function(e){return yi(Di)<yi(e)?1:-1}(t);return(d=d||a)&&(l<u+c*o/2||l>h-c*o/2)?l>u+c/2?1:-1:0}(e,a,n,r,b?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,sr,Qi===a),0!==_){var S=yi(Di);do{S-=_,v=zi.children[S]}while(v&&("none"===ui(v,"display")||v===Li))}if(0===_||v===a)return P(!1);Qi=a,er=_;var A=a.nextElementSibling,C=!1,k=Er(Oi,o,Di,t,a,n,e,C=1===_);if(!1!==k)return 1!==k&&-1!==k||(C=1===k),cr=!0,setTimeout(Sr,30),I(),C&&!A?o.appendChild(Di):a.parentNode.insertBefore(Di,C?A:a),E&&Ei(E,0,T-E.scrollTop),zi=Di.parentNode,void 0===y||sr||(tr=Math.abs(y-pi(a)[w])),D(),P(!0)}if(o.contains(Di))return P(!1)}return!1}function M(s,l){Ii(s,f,Gn({evt:e,isOwner:u,axis:r?"vertical":"horizontal",revert:i,dragRect:t,targetRect:n,canSort:h,fromSortable:d,target:a,completed:P,onMove:function(n,i){return Er(Oi,o,Di,t,n,pi(n),e,i)},changed:D},l))}function I(){M("dragOverAnimationCapture"),f.captureAnimationState(),f!==d&&d.captureAnimationState()}function P(t){return M("dragOverCompleted",{insertion:t}),t&&(u?c._hideClone():c._showClone(f),f!==d&&(ci(Di,$i?$i.options.ghostClass:c.options.ghostClass,!1),ci(Di,s.ghostClass,!0)),$i!==f&&f!==wr.active?$i=f:f===wr.active&&$i&&($i=null),d===f&&(f._ignoreWhileAnimating=a),f.animateAll((function(){M("dragOverAnimationComplete"),f._ignoreWhileAnimating=null})),f!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(a===Di&&!Di.animated||a===o&&!a.animated)&&(Qi=null),s.dragoverBubble||e.rootEl||a===document||(Di.parentNode[Si]._isOutsideThisEl(e.target),!t&&xr(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),p=!0}function D(){Ui=yi(Di),Gi=yi(Di,s.draggable),Pi({sortable:f,name:"change",toEl:o,newIndex:Ui,newDraggableIndex:Gi,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){ii(document,"mousemove",this._onTouchMove),ii(document,"touchmove",this._onTouchMove),ii(document,"pointermove",this._onTouchMove),ii(document,"dragover",xr),ii(document,"mousemove",xr),ii(document,"touchmove",xr)},_offUpEvents:function(){var e=this.el.ownerDocument;ii(e,"mouseup",this._onDrop),ii(e,"touchend",this._onDrop),ii(e,"pointerup",this._onDrop),ii(e,"touchcancel",this._onDrop),ii(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;Ui=yi(Di),Gi=yi(Di,n.draggable),Ii("drop",this,{evt:e}),zi=Di&&Di.parentNode,Ui=yi(Di),Gi=yi(Di,n.draggable),wr.eventCanceled||(ir=!1,sr=!1,ar=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),kr(this.cloneId),kr(this._dragStartId),this.nativeDraggable&&(ii(document,"drop",this),ii(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Jn&&ui(document.body,"user-select",""),ui(Di,"transform",""),e&&(Ji&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),Li&&Li.parentNode&&Li.parentNode.removeChild(Li),(Oi===zi||$i&&"clone"!==$i.lastPutMode)&&Fi&&Fi.parentNode&&Fi.parentNode.removeChild(Fi),Di&&(this.nativeDraggable&&ii(Di,"dragend",this),Tr(Di),Di.style["will-change"]="",Ji&&
vendor: 5,163 bytes, line 2
2!ir&&ci(Di,$i?$i.options.ghostClass:this.options.ghostClass,!1),ci(Di,this.options.chosenClass,!1),Pi({sortable:this,name:"unchoose",toEl:zi,newIndex:null,newDraggableIndex:null,originalEvent:e}),Oi!==zi?(Ui>=0&&(Pi({rootEl:zi,name:"add",toEl:zi,fromEl:Oi,originalEvent:e}),Pi({sortable:this,name:"remove",toEl:zi,originalEvent:e}),Pi({rootEl:zi,name:"sort",toEl:zi,fromEl:Oi,originalEvent:e}),Pi({sortable:this,name:"sort",toEl:zi,originalEvent:e})),$i&&$i.save()):Ui!==ji&&Ui>=0&&(Pi({sortable:this,name:"update",toEl:zi,originalEvent:e}),Pi({sortable:this,name:"sort",toEl:zi,originalEvent:e})),wr.active&&(null!=Ui&&-1!==Ui||(Ui=ji,Gi=Vi),Pi({sortable:this,name:"end",toEl:zi,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Ii("nulling",this),Oi=Di=zi=Li=Ri=Fi=Bi=Ni=Wi=Zi=Ji=Ui=Gi=ji=Vi=Qi=er=$i=qi=wr.dragged=wr.ghost=wr.clone=wr.active=null,ur.forEach((function(e){e.checked=!0})),ur.length=Xi=Hi=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Di&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,i=0,r=n.length,o=this.options;i<r;i++)ai(e=n[i],o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||Ar(e));return t},sort:function(e,t){var n={},i=this.el;this.toArray().forEach((function(e,t){var r=i.children[t];ai(r,this.options.draggable,i,!1)&&(n[e]=r)}),this),t&&this.captureAnimationState(),e.forEach((function(e){n[e]&&(i.removeChild(n[e]),i.appendChild(n[e]))})),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return ai(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var i=ki.modifyOption(this,e,t);n[e]=void 0!==i?i:t,"group"===e&&_r(n)},destroy:function(){Ii("destroy",this);var e=this.el;e[Si]=null,ii(e,"mousedown",this._onTapStart),ii(e,"touchstart",this._onTapStart),ii(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(ii(e,"dragover",this),ii(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),(function(e){e.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),or.splice(or.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Ni){if(Ii("hideClone",this),wr.eventCanceled)return;ui(Fi,"display","none"),this.options.removeCloneOnHide&&Fi.parentNode&&Fi.parentNode.removeChild(Fi),Ni=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(Ni){if(Ii("showClone",this),wr.eventCanceled)return;Di.parentNode!=Oi||this.options.group.revertClone?Ri?Oi.insertBefore(Fi,Ri):Oi.appendChild(Fi):Oi.insertBefore(Fi,Di),this.options.group.revertClone&&this.animate(Di,Fi),ui(Fi,"display",""),Ni=!1}}else this._hideClone()}},hr&&ni(document,"touchmove",(function(e){(wr.active||ir)&&e.cancelable&&e.preventDefault()})),wr.utils={on:ni,off:ii,css:ui,find:di,is:function(e,t){return!!ai(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:wi,closest:ai,toggleClass:ci,clone:Ti,index:yi,nextTick:Cr,cancelNextTick:kr,detectDirection:gr,getChild:gi},wr.get=function(e){return e[Si]},wr.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach((function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(wr.utils=Gn(Gn({},wr.utils),e.utils)),ki.mount(e)}))},wr.create=function(e,t){return new wr(e,t)},wr.version="1.15.0";var Mr,Ir,Pr,Dr,zr,Lr,Or=[],Rr=!1;function Br(){Or.forEach((function(e){clearInterval(e.pid)})),Or=[]}function Fr(){clearInterval(Lr)}var Nr=wi((function(e,t,n,i){if(t.scroll){var r,o=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,c=fi(),u=!1;Ir!==n&&(Ir=n,Br(),Mr=t.scroll,r=t.scrollFn,!0===Mr&&(Mr=xi(n,!0)));var h=0,d=Mr;do{var f=d,p=pi(f),m=p.top,g=p.bottom,_=p.left,y=p.right,v=p.width,x=p.height,b=void 0,w=void 0,E=f.scrollWidth,T=f.scrollHeight,S=ui(f),A=f.scrollLeft,C=f.scrollTop;f===c?(b=v<E&&("auto"===S.overflowX||"scroll"===S.overflowX||"visible"===S.overflowX),w=x<T&&("auto"===S.overflowY||"scroll"===S.overflowY||"visible"===S.overflowY)):(b=v<E&&("auto"===S.overflowX||"scroll"===S.overflowX),w=x<T&&("auto"===S.overflowY||"scroll"===S.overflowY));var k=b&&(Math.abs(y-o)<=s&&A+v<E)-(Math.abs(_-o)<=s&&!!A),M=w&&(Math.abs(g-a)<=s&&C+x<T)-(Math.abs(m-a)<=s&&!!C);if(!Or[h])for(var I=0;I<=h;I++)Or[I]||(Or[I]={});Or[h].vx==k&&Or[h].vy==M&&Or[h].el===f||(Or[h].el=f,Or[h].vx=k,Or[h].vy=M,clearInterval(Or[h].pid),0==k&&0==M||(u=!0,Or[h].pid=setInterval(function(){i&&0===this.layer&&wr.active._onTouchMove(zr);var t=Or[this.layer].vy?Or[this.layer].vy*l:0,n=Or[this.layer].vx?Or[this.layer].vx*l:0;"function"==typeof r&&"continue"!==r.call(wr.dragged.parentNode[Si],n,t,e,zr,Or[this.layer].el)||Ei(Or[this.layer].el,n,t)}.bind({layer:h}),24))),h++}
2while(t.bubbleScroll&&d!==c&&(d=xi(d,!1)));Rr=u}}),30),jr=function(e){var t=e.originalEvent,n=e.putSortable,i=e.dragEl,r=e.activeSortable,o=e.dispatchSortableEvent,a=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=n||r;a();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(c.clientX,c.clientY);s(),l&&!l.el.contains(u)&&(o("spill"),this.onSpill({dragEl:i,putSortable:n}))}};function Ur(){}function Vr(){}Ur.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var i=gi(this.sortable.el,this.startIndex,this.options);i?this.sortable.el.insertBefore(t,i):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:jr},Wn(Ur,{pluginName:"revertOnSpill"}),Vr.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:jr},Wn(Vr,{pluginName:"removeOnSpill"}),wr.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?ni(document,"dragover",this._handleAutoScroll):this.options.supportPointer?ni(document,"pointermove",this._handleFallbackAutoScroll):t.touches?ni(document,"touchmove",this._handleFallbackAutoScroll):ni(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?ii(document,"dragover",this._handleAutoScroll):(ii(document,"pointermove",this._handleFallbackAutoScroll),ii(document,"touchmove",this._handleFallbackAutoScroll),ii(document,"mousemove",this._handleFallbackAutoScroll)),Fr(),Br(),clearTimeout(si),si=void 0},nulling:function(){zr=Ir=Mr=Rr=Lr=Pr=Dr=null,Or.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,i=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,o=document.elementFromPoint(i,r);if(zr=e,t||this.options.forceAutoScrollFallback||Yn||Hn||Jn){Nr(e,this.options,o,t);var a=xi(o,!0);!Rr||Lr&&i===Pr&&r===Dr||(Lr&&Fr(),Lr=setInterval((function(){var o=xi(document.elementFromPoint(i,r),!0);o!==a&&(a=o,Br()),Nr(e,n.options,o,t)}),10),Pr=i,Dr=r)}else{if(!this.options.bubbleScroll||xi(o,!0)===fi())return void Br();Nr(e,this.options,xi(o,!1),!1)}}},Wn(e,{pluginName:"scroll",initializeByDefault:!0})}),wr.mount(Vr,Ur);const Gr=wr;window.addEventListener("load",(function(){var e=document.querySelector(".suburbblogmain");e&&Gr.create(e,{forceFallback:!0,onUpdate:function(){var e=Array.from(document.querySelectorAll(".board-item")).map((function(e){return e.getAttribute("data-id")})).join(",");fetch("/api/MPRT_WebApi/Web/UpdateTripOrder?items=".concat(e),{method:"GET",cache:"no-cache",headers:{contentType:"application/json",dataType:"json"}}),document.querySelectorAll(".board-item").forEach((function(e,t){e.querySelector(".event__card_content_date span").innerHTML=function(e){for(var t,n="";e>0;)t=(e-1)%26,n=String.fromCharCode(65+t)+n,e=(e-t)/26|0;return n||void 0}(t+1)}))}})})),n(949),n(514),n(248),window.addEventListener("load",(function(){new(Ge())(document.querySelector("nav ul"),{cellAlign:"left",freeScroll:!0,prevNextButtons:!1,pageDots:!1,contain:!0,watchCSS:!0})}))})()})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.