PageSourceSearch

https://familiengrundschulzentren.nrw/app/themes/base-theme/dist/assets/main-f62cc9e3.js?ver=7.1

js familiengrundschulzentren.nrw collected 2026-10-07 01:02:34 UTC 1,060,510 bytes, 590 lines download raw bytes

1/*!
2 * Glide.js v3.6.0
3 * (c) 2013-2022 Jędrzej Chałubek (https://github.com/jedrzejchalubek/)
4 * Released under the MIT License.
5 */function Oc(y){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Oc=function(p){return typeof p}:Oc=function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},Oc(y)}function Gc(y,p){if(!(y instanceof p))throw new TypeError("Cannot call a class as a function")}function Xd(y,p){for(var b=0;b<p.length;b++){var I=p[b];I.enumerable=I.enumerable||!1,I.configurable=!0,"value"in I&&(I.writable=!0),Object.defineProperty(y,I.key,I)}}function Hc(y,p,b){return p&&Xd(y.prototype,p),b&&Xd(y,b),y}function V_(y,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(p&&p.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),p&&qu(y,p)}function Pl(y){return Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(b){return b.__proto__||Object.getPrototypeOf(b)},Pl(y)}function qu(y,p){return qu=Object.setPrototypeOf||function(I,R){return I.__proto__=R,I},qu(y,p)}function Z_(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(y){return!1}}function j_(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}function $_(y,p){if(p&&(typeof p=="object"||typeof p=="function"))return p;if(p!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return j_(y)}function q_(y){var p=Z_();return function(){var I=Pl(y),R;if(p){var N=Pl(this).constructor;R=Reflect.construct(I,arguments,N)}else R=I.apply(this,arguments);return $_(this,R)}}function G_(y,p){for(;!Object.prototype.hasOwnProperty.call(y,p)&&(y=Pl(y),y!==null););return y}function Fc(){return typeof Reflect!="undefined"&&Reflect.get?Fc=Reflect.get:Fc=function(p,b,I){var R=G_(p,b);if(R){var N=Object.getOwnPropertyDescriptor(R,b);return N.get?N.get.call(arguments.length<3?p:I):N.value}},Fc.apply(this,arguments)}var H_={type:"slider",startAt:0,perView:1,focusAt:0,gap:10,autoplay:!1,hoverpause:!0,keyboard:!0,bound:!1,swipeThreshold:80,dragThreshold:120,perSwipe:"",touchRatio:.5,touchAngle:45,animationDuration:400,rewind:!0,rewindDuration:800,animationTimingFunc:"cubic-bezier(.165, .840, .440, 1)",waitForTransition:!0,throttle:10,direction:"ltr",peek:0,cloningRatio:1,breakpoints:{},classes:{swipeable:"glide--swipeable",dragging:"glide--dragging",direction:{ltr:"glide--ltr",rtl:"glide--rtl"},type:{slider:"glide--slider",carousel:"glide--carousel"},slide:{clone:"glide__slide--clone",active:"glide__slide--active"},arrow:{disabled:"glide__arrow--disabled"},nav:{active:"glide__bullet--active"}}};function ys(y){console.error("[Glide warn]: ".concat(y))}function Wn(y){return parseInt(y)}function W_(y){return parseFloat(y)}function Gu(y){return typeof y=="string"}function Il(y){var p=Oc(y);return p==="function"||p==="object"&&!!y}function jc(y){return typeof y=="function"}function Jp(y){return typeof y=="undefined"}function Hu(y){return y.constructor===Array}function K_(y,p,b){var I={};for(var R in p)jc(p[R])?I[R]=p[R](y,I,b):ys("Extension must be a function");for(var N in I)jc(I[N].mount)&&I[N].mount();return I}function Hi(y,p,b){Object.defineProperty(y,p,b)}function X_(y){return Object.keys(y).sort().reduce(function(p,b){return p[b]=y[b],p[b],p},{})}function Wu(y,p){var b=Object.assign({},y,p);return p.hasOwnProperty("classes")&&(b.classes=Object.assign({},y.classes,p.classes),p.classes.hasOwnProperty("direction")&&(b.classes.direction=Object.assign({},y.classes.direction,p.classes.direction)),p.classes.hasOwnProperty("type")&&(b.classes.type=Object.assign({},y.classes.type,p.classes.type)),p.classes.hasOwnProperty("slide")&&(b.classes.slide=Object.assign({},y.classes.slide,p.classes.slide)),p.classes.hasOwnProperty("arrow")&&(b.classes.arrow=Object.assign({},y.classes.arrow,p.classes.arrow)),p.classes.hasOwnProperty("nav")&&(b.classes.nav=Object.assign({},y.classes.nav,p.classes.nav))),p.hasOwnProperty("breakpoints")&&(b.breakpoints=Object.assign({},y.breakpoints,p.breakpoints)),b}var Y_=function(){function y(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gc(this,y),this.events=p,this.hop=p.hasOwnProperty}return Hc(y,[{key:"on",value:function(b,I){if(Hu(b)){for(var R=0;R<b.length;R++)this.on(b[R],I);return}this.hop.call(this.events,b)||(this.events[b]=[]);var N=this.events[b].push(I)-1;return{remove:function(){delete this.events[b][N]}}}},{key:"emit",value:function(b,I){if(Hu(b)){for(var R=0;R<b.length;
5R++)this.emit(b[R],I);return}this.hop.call(this.events,b)&&this.events[b].forEach(function(N){N(I||{})})}}]),y}(),J_=function(){function y(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Gc(this,y),this._c={},this._t=[],this._e=new Y_,this.disabled=!1,this.selector=p,this.settings=Wu(H_,b),this.index=this.settings.startAt}return Hc(y,[{key:"mount",value:function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this._e.emit("mount.before"),Il(b)?this._c=K_(this,b,this._e):ys("You need to provide a object on `mount()`"),this._e.emit("mount.after"),this}},{key:"mutate",value:function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return Hu(b)?this._t=b:ys("You need to provide a array on `mutate()`"),this}},{key:"update",value:function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.settings=Wu(this.settings,b),b.hasOwnProperty("startAt")&&(this.index=b.startAt),this._e.emit("update"),this}},{key:"go",value:function(b){return this._c.Run.make(b),this}},{key:"move",value:function(b){return this._c.Transition.disable(),this._c.Move.make(b),this}},{key:"destroy",value:function(){return this._e.emit("destroy"),this}},{key:"play",value:function(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return b&&(this.settings.autoplay=b),this._e.emit("play"),this}},{key:"pause",value:function(){return this._e.emit("pause"),this}},{key:"disable",value:function(){return this.disabled=!0,this}},{key:"enable",value:function(){return this.disabled=!1,this}},{key:"on",value:function(b,I){return this._e.on(b,I),this}},{key:"isType",value:function(b){return this.settings.type===b}},{key:"settings",get:function(){return this._o},set:function(b){Il(b)?this._o=b:ys("Options must be an `object` instance.")}},{key:"index",get:function(){return this._i},set:function(b){this._i=Wn(b)}},{key:"type",get:function(){return this.settings.type}},{key:"disabled",get:function(){return this._d},set:function(b){this._d=!!b}}]),y}();function Q_(y,p,b){var I={mount:function(){this._o=!1},make:function(X){var ge=this;y.disabled||(!y.settings.waitForTransition||y.disable(),this.move=X,b.emit("run.before",this.move),this.calculate(),b.emit("run",this.move),p.Transition.after(function(){ge.isStart()&&b.emit("run.start",ge.move),ge.isEnd()&&b.emit("run.end",ge.move),ge.isOffset()&&(ge._o=!1,b.emit("run.offset",ge.move)),b.emit("run.after",ge.move),y.enable()}))},calculate:function(){var X=this.move,ge=this.length,ve=X.steps,pe=X.direction,Re=1;if(pe==="="){if(y.settings.bound&&Wn(ve)>ge){y.index=ge;return}y.index=ve;return}if(pe===">"&&ve===">"){y.index=ge;return}if(pe==="<"&&ve==="<"){y.index=0;return}if(pe==="|"&&(Re=y.settings.perView||1),pe===">"||pe==="|"&&ve===">"){var ut=R(Re);ut>ge&&(this._o=!0),y.index=N(ut,Re);return}if(pe==="<"||pe==="|"&&ve==="<"){var ze=$(Re);ze<0&&(this._o=!0),y.index=l(ze,Re);return}ys("Invalid direction pattern [".concat(pe).concat(ve,"] has been used"))},isStart:function(){return y.index<=0},isEnd:function(){return y.index>=this.length},isOffset:function(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0;return X?this._o?X==="|>"?this.move.direction==="|"&&this.move.steps===">":X==="|<"?this.move.direction==="|"&&this.move.steps==="<":this.move.direction===X:!1:this._o},isBound:function(){return y.isType("slider")&&y.settings.focusAt!=="center"&&y.settings.bound}};function R(se){var X=y.index;return y.isType("carousel")?X+se:X+(se-X%se)}function N(se,X){var ge=I.length;return se<=ge?se:y.isType("carousel")?se-(ge+1):y.settings.rewind?I.isBound()&&!I.isEnd()?ge:0:I.isBound()?ge:Math.floor(ge/X)*X}function $(se){var X=y.index;if(y.isType("carousel"))return X-se;var ge=Math.ceil(X/se);return(ge-1)*se}function l(se,X){var ge=I.length;return se>=0?se:y.isType("carousel")?se+(ge+1):y.settings.rewind?I.isBound()&&I.isStart()?ge:Math.floor(ge/X)*X:0}return Hi(I,"move",{get:function(){return this._m},set:function(X){var ge=X.substr(1);this._m={direction:X.substr(0,1),steps:ge?Wn(ge)?Wn(ge):ge:0}}}),Hi(I,"length",{get:function(){var X=y.settings,ge=p.Html.slides.length;return this.isBound()?ge-1-(Wn(X.perView)-1)+Wn(X.focusAt):ge-1}}),Hi(I,"offset",{get:function(){return this._o}}),I}function Yd(){return new Date().getTime()}function Wc(y,p,b){var I,R,N,$,l=0;b||(b={});var se=function(){l=b.leading===!1?0:Yd(),I=null,$=y.apply(R,N),I||(R=N=null)},X=function(){var ve=Yd();!l&&b.leading===!1&&(l=ve);var pe=p-(ve-l);return R=this,N=arguments,pe<=0||pe>p?(I&&(clearTimeout(I),I=null),l=ve,$=y.apply(R,N),I||(R=N=null)):!I&&b.trailing!==!1&&(I=setTimeout(se,pe)),$};return X.cancel=function(){clearTimeout(I),l=0,I=R=N=null},X}var Mc={ltr:["marginLeft","marginRight"],rtl:["marginRight","marginLeft"]};function eg(y,p,b){var I={apply:function(N){for(var $=0,l=N.length;$<l;$++){var se=N[$].style,X=p.Direction.value;$!==0?se[Mc[X][0]]="".concat(this.value/2,"px"):se[Mc[X][0]]="",$!==N.length-1?se[Mc[X][1]]="".concat(this.value/2,"px"):se[Mc[X][1]]=""}},remove:function(N){for(var $=0,l=N.length;$<l;$++){var se=N[$].style;se.marginLeft="",se.marginRight=""}}};return Hi(I,"value",{get:function(){return Wn(y.settings.gap)}}),Hi(I,"grow",{get:function(){return I.value*p.Sizes.length}}),Hi(I,"reductor",{get:function(){var N=y.settings.perView;return I.value*(N-1)/N}}),b.on(["build.after","update"],Wc(function(){I.apply(p.Html.wrapper.children)},30)),b.on("destroy",function(){I.remove(p.Html.wrapper.children)}),I}function Qp(y){if(y&&y.parentNode){for(var p=y.parentNode.firstChild,b=[];p;p=p.nextSibling)p.nodeType===1&&p!==y&&b.push(p);return b}return[]}function Jd(y){return!!(y&&y instanceof window.HTMLElement)}function Ku(y){return Array.prototype.slice.call(y)}var Qd='[data-glide-el="track"]';function tg(y,p,b){var I={mount:function(){this.root=y.selector,this.track=this.root.querySelector(Qd),this.collectSlides()},collectSlides:function(){this.slides=Ku(this.wrapper.children).filter(function(N){return!N.classList.contains(y.settings.classes.slide.clone)})}};return Hi(I,"root",{get:function(){return I._r},set:function(N){Gu(N)&&(N=document.querySelector(N)),Jd(N)?I._r=N:ys("Root element must be a existing Html node")}}),Hi(I,"track",{get:function(){return I._t},set:function(N){Jd(N)?I._t=N:ys("Could not find track element. Please use ".concat(Qd," attribute."))}}),Hi(I,"wrapper",{get:function(){return I.track.children[0]}}),b.on("update",function(){I.collectSlides()}),I}function ig(y,p,b){var I={mount:function(){this.value=y.settings.peek}};return Hi(I,"value",{get:function(){return I._v},set:function(N){Il(N)?(N.before=Wn(N.before),N.after=Wn(N.after)):N=Wn(N),I._v=N}}),Hi(I,"reductor",{get:function(){var N=I.value,$=y.settings.perView;return Il(N)?N.before/$+N.after/$:N*2/$}}),b.on(["resize","update"],function(){I.mount()}),I}function ng(y,p,b){var I={mount:function(){this._o=0},make:function(){var N=this,$=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;this.offset=$,b.emit("move",{movement:this.value}),p.Transition.after(function(){b.emit("move.after",{movement:N.value})})}};return Hi(I,"offset",{get:function(){return I._o},set:function(N){I._o=Jp(N)?0:Wn(N)}}),Hi(I,"translate",{get:function(){return p.Sizes.slideWidth*y.index}}),Hi(I,"value",{get:function(){var N=this.offset,$=this.translate;return p.Direction.is("rtl")?$+N:$-N}}),b.on(["build.before","run"],function(){I.make()}),I}function rg(y,p,b){var I={setupSlides:function(){for(var N="".concat(this.slideWidth,"px"),$=p.Html.slides,l=0;l<$.length;l++)$[l].style.width=N},setupWrapper:function(){p.Html.wrapper.style.width="".concat(this.wrapperSize,"px")},remove:function(){for(var N=p.Html.slides,$=0;$<N.length;$++)N[$].style.width="";p.Html.wrapper.style.width=""}};return Hi(I,"length",{get:function(){return p.Html.slides.length}}),Hi(I,"width",{get:function(){return p.Html.track.offsetWidth}}),Hi(I,"wrapperSize",{get:function(){return I.slideWidth*I.length+p.Gaps.grow+p.Clones.grow}}),Hi(I,"slideWidth",{get:function(){return I.width/y.settings.perView-p.Peek.reductor-p.Gaps.reductor}}),b.on(["build.before","resize","update"],function(){I.setupSlides(),I.setupWrapper()}),b.on("destroy",function(){I.remove()}),I}function og(y,p,b){var I={mount:function(){b.emit("build.before"),this.typeClass(),this.activeClass(),b.emit("build.after")},typeClass:function(){p.Html.root.classList.add(y.settings.classes.type[y.settings.type])},activeClass:function(){var N=y.settings.classes,$=p.Html.slides[y.index];$&&($.classList.add(N.slide.active),Qp($).forEach(function(l){l.classList.remove(N.slide.active)}))},removeClasses:function(){var N=y.settings.classes,$=N.type,l=N.slide;p.Html.root.classList.remove($[y.settings.type]),p.Html.slides.forEac
5h(function(se){se.classList.remove(l.active)})}};return b.on(["destroy","update"],function(){I.removeClasses()}),b.on(["resize","update"],function(){I.mount()}),b.on("move.after",function(){I.activeClass()}),I}function sg(y,p,b){var I={mount:function(){this.items=[],y.isType("carousel")&&(this.items=this.collect())},collect:function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=p.Html.slides,l=y.settings,se=l.perView,X=l.classes,ge=l.cloningRatio;if($.length!==0)for(var ve=+!!y.settings.peek,pe=se+ve+Math.round(se/2),Re=$.slice(0,pe).reverse(),ut=$.slice(pe*-1),ze=0;ze<Math.max(ge,Math.floor(se/$.length));ze++){for(var Tt=0;Tt<Re.length;Tt++){var pt=Re[Tt].cloneNode(!0);pt.classList.add(X.slide.clone),N.push(pt)}for(var zt=0;zt<ut.length;zt++){var Dt=ut[zt].cloneNode(!0);Dt.classList.add(X.slide.clone),N.unshift(Dt)}}return N},append:function(){for(var N=this.items,$=p.Html,l=$.wrapper,se=$.slides,X=Math.floor(N.length/2),ge=N.slice(0,X).reverse(),ve=N.slice(X*-1).reverse(),pe="".concat(p.Sizes.slideWidth,"px"),Re=0;Re<ve.length;Re++)l.appendChild(ve[Re]);for(var ut=0;ut<ge.length;ut++)l.insertBefore(ge[ut],se[0]);for(var ze=0;ze<N.length;ze++)N[ze].style.width=pe},remove:function(){for(var N=this.items,$=0;$<N.length;$++)p.Html.wrapper.removeChild(N[$])}};return Hi(I,"grow",{get:function(){return(p.Sizes.slideWidth+p.Gaps.value)*I.items.length}}),b.on("update",function(){I.remove(),I.mount(),I.append()}),b.on("build.before",function(){y.isType("carousel")&&I.append()}),b.on("destroy",function(){I.remove()}),I}var Sa=function(){function y(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gc(this,y),this.listeners=p}return Hc(y,[{key:"on",value:function(b,I,R){var N=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;Gu(b)&&(b=[b]);for(var $=0;$<b.length;$++)this.listeners[b[$]]=R,I.addEventListener(b[$],this.listeners[b[$]],N)}},{key:"off",value:function(b,I){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Gu(b)&&(b=[b]);for(var N=0;N<b.length;N++)I.removeEventListener(b[N],this.listeners[b[N]],R)}},{key:"destroy",value:function(){delete this.listeners}}]),y}();function ag(y,p,b){var I=new Sa,R={mount:function(){this.bind()},bind:function(){I.on("resize",window,Wc(function(){b.emit("resize")},y.settings.throttle))},unbind:function(){I.off("resize",window)}};return b.on("destroy",function(){R.unbind(),I.destroy()}),R}var lg=["ltr","rtl"],cg={">":"<","<":">","=":"="};function ug(y,p,b){var I={mount:function(){this.value=y.settings.direction},resolve:function(N){var $=N.slice(0,1);return this.is("rtl")?N.split($).join(cg[$]):N},is:function(N){return this.value===N},addClass:function(){p.Html.root.classList.add(y.settings.classes.direction[this.value])},removeClass:function(){p.Html.root.classList.remove(y.settings.classes.direction[this.value])}};return Hi(I,"value",{get:function(){return I._v},set:function(N){lg.indexOf(N)>-1?I._v=N:ys("Direction value must be `ltr` or `rtl`")}}),b.on(["destroy","update"],function(){I.removeClass()}),b.on("update",function(){I.mount()}),b.on(["build.before","update"],function(){I.addClass()}),I}function hg(y,p){return{modify:function(I){return p.Direction.is("rtl")?-I:I}}}function dg(y,p){return{modify:function(I){var R=Math.floor(I/p.Sizes.slideWidth);return I+p.Gaps.value*R}}}function pg(y,p){return{modify:function(I){return I+p.Clones.grow/2}}}function fg(y,p){return{modify:function(I){if(y.settings.focusAt>=0){var R=p.Peek.value;return Il(R)?I-R.before:I-R}return I}}}function mg(y,p){return{modify:function(I){var R=p.Gaps.value,N=p.Sizes.width,$=y.settings.focusAt,l=p.Sizes.slideWidth;return $==="center"?I-(N/2-l/2):I-l*$-R*$}}}function _g(y,p,b){var I=[dg,pg,fg,mg].concat(y._t,[hg]);return{mutate:function(N){for(var $=0;$<I.length;$++){var l=I[$];jc(l)&&jc(l().modify)?N=l(y,p,b).modify(N):ys("Transformer should be a function that returns an object with `modify()` method")}return N}}}function gg(y,p,b){var I={set:function(N){var $=_g(y,p).mutate(N),l="translate3d(".concat(-1*$,"px, 0px, 0px)");p.Html.wrapper.style.mozTransform=l,p.Html.wrapper.style.webkitTransform=l,p.Html.wrapper.style.transform=l},remove:function(){p.Html.wrapper.style.transform=""}
5,getStartIndex:function(){var N=p.Sizes.length,$=y.index,l=y.settings.perView;return p.Run.isOffset(">")||p.Run.isOffset("|>")?N+($-l):($+l)%N},getTravelDistance:function(){var N=p.Sizes.slideWidth*y.settings.perView;return p.Run.isOffset(">")||p.Run.isOffset("|>")?N*-1:N}};return b.on("move",function(R){if(!y.isType("carousel")||!p.Run.isOffset())return I.set(R.movement);p.Transition.after(function(){b.emit("translate.jump"),I.set(p.Sizes.slideWidth*y.index)});var N=p.Sizes.slideWidth*p.Translate.getStartIndex();return I.set(N-p.Translate.getTravelDistance())}),b.on("destroy",function(){I.remove()}),I}function yg(y,p,b){var I=!1,R={compose:function($){var l=y.settings;return I?"".concat($," 0ms ").concat(l.animationTimingFunc):"".concat($," ").concat(this.duration,"ms ").concat(l.animationTimingFunc)},set:function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";p.Html.wrapper.style.transition=this.compose($)},remove:function(){p.Html.wrapper.style.transition=""},after:function($){setTimeout(function(){$()},this.duration)},enable:function(){I=!1,this.set()},disable:function(){I=!0,this.set()}};return Hi(R,"duration",{get:function(){var $=y.settings;return y.isType("slider")&&p.Run.offset?$.rewindDuration:$.animationDuration}}),b.on("move",function(){R.set()}),b.on(["build.before","resize","translate.jump"],function(){R.disable()}),b.on("run",function(){R.enable()}),b.on("destroy",function(){R.remove()}),R}var ef=!1;try{var ep=Object.defineProperty({},"passive",{get:function(){ef=!0}});window.addEventListener("testPassive",null,ep),window.removeEventListener("testPassive",null,ep)}catch(y){}var Xu=ef,kc=["touchstart","mousedown"],tp=["touchmove","mousemove"],ip=["touchend","touchcancel","mouseup","mouseleave"],np=["mousedown","mousemove","mouseup","mouseleave"];function vg(y,p,b){var I=new Sa,R=0,N=0,$=0,l=!1,se=Xu?{passive:!0}:!1,X={mount:function(){this.bindSwipeStart()},start:function(ve){if(!l&&!y.disabled){this.disable();var pe=this.touches(ve);R=null,N=Wn(pe.pageX),$=Wn(pe.pageY),this.bindSwipeMove(),this.bindSwipeEnd(),b.emit("swipe.start")}},move:function(ve){if(!y.disabled){var pe=y.settings,Re=pe.touchAngle,ut=pe.touchRatio,ze=pe.classes,Tt=this.touches(ve),pt=Wn(Tt.pageX)-N,zt=Wn(Tt.pageY)-$,Dt=Math.abs(pt<<2),fi=Math.abs(zt<<2),Xe=Math.sqrt(Dt+fi),_t=Math.sqrt(fi);if(R=Math.asin(_t/Xe),R*180/Math.PI<Re)ve.stopPropagation(),p.Move.make(pt*W_(ut)),p.Html.root.classList.add(ze.dragging),b.emit("swipe.move");else return!1}},end:function(ve){if(!y.disabled){var pe=y.settings,Re=pe.perSwipe,ut=pe.touchAngle,ze=pe.classes,Tt=this.touches(ve),pt=this.threshold(ve),zt=Tt.pageX-N,Dt=R*180/Math.PI;this.enable(),zt>pt&&Dt<ut?p.Run.make(p.Direction.resolve("".concat(Re,"<"))):zt<-pt&&Dt<ut?p.Run.make(p.Direction.resolve("".concat(Re,">"))):p.Move.make(),p.Html.root.classList.remove(ze.dragging),this.unbindSwipeMove(),this.unbindSwipeEnd(),b.emit("swipe.end")}},bindSwipeStart:function(){var ve=this,pe=y.settings,Re=pe.swipeThreshold,ut=pe.dragThreshold;Re&&I.on(kc[0],p.Html.wrapper,function(ze){ve.start(ze)},se),ut&&I.on(kc[1],p.Html.wrapper,function(ze){ve.start(ze)},se)},unbindSwipeStart:function(){I.off(kc[0],p.Html.wrapper,se),I.off(kc[1],p.Html.wrapper,se)},bindSwipeMove:function(){var ve=this;I.on(tp,p.Html.wrapper,Wc(function(pe){ve.move(pe)},y.settings.throttle),se)},unbindSwipeMove:function(){I.off(tp,p.Html.wrapper,se)},bindSwipeEnd:function(){var ve=this;I.on(ip,p.Html.wrapper,function(pe){ve.end(pe)})},unbindSwipeEnd:function(){I.off(ip,p.Html.wrapper)},touches:function(ve){return np.indexOf(ve.type)>-1?ve:ve.touches[0]||ve.changedTouches[0]},threshold:function(ve){var pe=y.settings;return np.indexOf(ve.type)>-1?pe.dragThreshold:pe.swipeThreshold},enable:function(){return l=!1,p.Transition.enable(),this},disable:function(){return l=!0,p.Transition.disable(),this}};return b.on("build.after",function(){p.Html.root.classList.add(y.settings.classes.swipeable)}),b.on("destroy",function(){X.unbindSwipeStart(),X.unbindSwipeMove(),X.unbindSwipeEnd(),I.destroy()}),X}function xg(y,p,b){var I=new Sa,R={mount:function(){this.bind()},bind:function(){I.on("dragstart",p.Html.wrapper,this.dragstart)},unbind:function(){I.off("dragstart",p.Html.wrapper)},dragstart:function($){$.preventDefault()}};return b.on("destroy",function(){R.unbind(),I.destroy()}),R}function bg(y,p,b){var I=new Sa,R=!1,N=!1,$={mount:function(){this._a=p.Html.wrapper.querySelectorAll("a"),this.bind()},bind:function(){I.on("click",p.Html.wrapper,this.click)},unbind:function(){I.off("click",p.Html.wrapper)},click:function(se){N&&(se.stopPropagation(),se.preventDefault())},detach:function(){if(N=!0,!R){for(var se=0;se<this.items.length;se++)this.items[se].draggable=!1;R=!0}return this},attach:function(){if(N=!1,R){for(var se=0;se<this.items.length;se++)this.items[se].draggable=!0;R=!1}return this}};return Hi($,"items",{get:function(){return $._a}}),b.on("swipe.move",function(){$.detach()}),b.on("swipe.end",function(){p.Transition.after(function(){$.attach()})}),b.on("destroy",function(){$.attach(),$.unbind(),I.destroy()}),$}
5var wg='[data-glide-el="controls[nav]"]',lh='[data-glide-el^="controls"]',Tg="".concat(lh,' [data-glide-dir*="<"]'),Sg="".concat(lh,' [data-glide-dir*=">"]');function Ag(y,p,b){var I=new Sa,R=Xu?{passive:!0}:!1,N={mount:function(){this._n=p.Html.root.querySelectorAll(wg),this._c=p.Html.root.querySelectorAll(lh),this._arrowControls={previous:p.Html.root.querySelectorAll(Tg),next:p.Html.root.querySelectorAll(Sg)},this.addBindings()},setActive:function(){for(var l=0;l<this._n.length;l++)this.addClass(this._n[l].children)},removeActive:function(){for(var l=0;l<this._n.length;l++)this.removeClass(this._n[l].children)},addClass:function(l){var se=y.settings,X=l[y.index];X&&X&&(X.classList.add(se.classes.nav.active),Qp(X).forEach(function(ge){ge.classList.remove(se.classes.nav.active)}))},removeClass:function(l){var se=l[y.index];se&&se.classList.remove(y.settings.classes.nav.active)},setArrowState:function(){if(!y.settings.rewind){var l=N._arrowControls.next,se=N._arrowControls.previous;this.resetArrowState(l,se),y.index===0&&this.disableArrow(se),y.index===p.Run.length&&this.disableArrow(l)}},resetArrowState:function(){for(var l=y.settings,se=arguments.length,X=new Array(se),ge=0;ge<se;ge++)X[ge]=arguments[ge];X.forEach(function(ve){Ku(ve).forEach(function(pe){pe.classList.remove(l.classes.arrow.disabled)})})},disableArrow:function(){for(var l=y.settings,se=arguments.length,X=new Array(se),ge=0;ge<se;ge++)X[ge]=arguments[ge];X.forEach(function(ve){Ku(ve).forEach(function(pe){pe.classList.add(l.classes.arrow.disabled)})})},addBindings:function(){for(var l=0;l<this._c.length;l++)this.bind(this._c[l].children)},removeBindings:function(){for(var l=0;l<this._c.length;l++)this.unbind(this._c[l].children)},bind:function(l){for(var se=0;se<l.length;se++)I.on("click",l[se],this.click),I.on("touchstart",l[se],this.click,R)},unbind:function(l){for(var se=0;se<l.length;se++)I.off(["click","touchstart"],l[se])},click:function(l){!Xu&&l.type==="touchstart"&&l.preventDefault();var se=l.currentTarget.getAttribute("data-glide-dir");p.Run.make(p.Direction.resolve(se))}};return Hi(N,"items",{get:function(){return N._c}}),b.on(["mount.after","move.after"],function(){N.setActive()}),b.on(["mount.after","run"],function(){N.setArrowState()}),b.on("destroy",function(){N.removeBindings(),N.removeActive(),I.destroy()}),N}function Pg(y,p,b){var I=new Sa,R={mount:function(){y.settings.keyboard&&this.bind()},bind:function(){I.on("keyup",document,this.press)},unbind:function(){I.off("keyup",document)},press:function($){var l=y.settings.perSwipe;$.code==="ArrowRight"&&p.Run.make(p.Direction.resolve("".concat(l,">"))),$.code==="ArrowLeft"&&p.Run.make(p.Direction.resolve("".concat(l,"<")))}};return b.on(["destroy","update"],function(){R.unbind()}),b.on("update",function(){R.mount()}),b.on("destroy",function(){I.destroy()}),R}function Ig(y,p,b){var I=new Sa,R={mount:function(){this.enable(),this.start(),y.settings.hoverpause&&this.bind()},enable:function(){this._e=!0},disable:function(){this._e=!1},start:function(){var $=this;this._e&&(this.enable(),y.settings.autoplay&&Jp(this._i)&&(this._i=setInterval(function(){$.stop(),p.Run.make(">"),$.start(),b.emit("autoplay")},this.time)))},stop:function(){this._i=clearInterval(this._i)},bind:function(){var $=this;I.on("mouseover",p.Html.root,function(){$._e&&$.stop()}),I.on("mouseout",p.Html.root,function(){$._e&&$.start()})},unbind:function(){I.off(["mouseover","mouseout"],p.Html.root)}};return Hi(R,"time",{get:function(){var $=p.Html.slides[y.index].getAttribute("data-glide-autoplay");return Wn($||y.settings.autoplay)}}),b.on(["destroy","update"],function(){R.unbind()}),b.on(["run.before","swipe.start","update"],function(){R.stop()}),b.on(["pause","destroy"],function(){R.disable(),R.stop()}),b.on(["run.after","swipe.end"],function(){R.start()}),b.on(["play"],function(){R.enable(),R.start()}),b.on("update",function(){R.mount()}),b.on("destroy",function(){I.destroy()}),R}function rp(y){return Il(y)?X_(y):(ys("Breakpoints option must be an object"),{})}function Lg(y,p,b){var I=new Sa,R=y.settings,N=rp(R.breakpoints),$=Object.assign({},R),l={match:function(X){if(typeof window.matchMedia!="undefined"){for(var ge in X)if(X.hasOwnProperty(ge)&&window.matchMedia("(max-width: ".concat(ge,"px)")).matches)return X[ge]}return $}};return Object.assign(R,l.match(N)),I.on("resize",window,Wc(function(){y.settings=Wu(R,l.match(N))},y.settings.throttle)),b.on("update",function(){N=rp(N),$=Object.assign({},R)}),b.on("destroy",function(){I.off("resize",window)}),l}var Eg={Html:tg,Translate:gg,Transition:yg,Direction:ug,Peek:ig,Sizes:rg,Gaps:eg,Move:ng,Clones:sg,Re
5size:ag,Build:og,Run:Q_,Swipe:vg,Images:xg,Anchors:bg,Controls:Ag,Keyboard:Pg,Autoplay:Ig,Breakpoints:Lg},Cg=function(y){V_(b,y);var p=q_(b);function b(){return Gc(this,b),p.apply(this,arguments)}return Hc(b,[{key:"mount",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Fc(Pl(b.prototype),"mount",this).call(this,Object.assign({},Eg,R))}}]),b}(J_),tf=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Mg(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var $c={},kg={get exports(){return $c},set exports(y){$c=y}};/* @preserve
6 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
7 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
8 */(function(y,p){(function(b,I){I(p)})(tf,function(b){var I="1.9.4";function R(r){var c,g,S,M;for(g=1,S=arguments.length;g<S;g++){M=arguments[g];for(c in M)r[c]=M[c]}return r}var N=Object.create||function(){function r(){}return function(c){return r.prototype=c,new r}}();function $(r,c){var g=Array.prototype.slice;if(r.bind)return r.bind.apply(r,g.call(arguments,1));var S=g.call(arguments,2);return function(){return r.apply(c,S.length?S.concat(g.call(arguments)):arguments)}}var l=0;function se(r){return"_leaflet_id"in r||(r._leaflet_id=++l),r._leaflet_id}function X(r,c,g){var S,M,V,ne;return ne=function(){S=!1,M&&(V.apply(g,M),M=!1)},V=function(){S?M=arguments:(r.apply(g,arguments),setTimeout(ne,c),S=!0)},V}function ge(r,c,g){var S=c[1],M=c[0],V=S-M;return r===S&&g?r:((r-M)%V+V)%V+M}function ve(){return!1}function pe(r,c){if(c===!1)return r;var g=Math.pow(10,c===void 0?6:c);return Math.round(r*g)/g}function Re(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function ut(r){return Re(r).split(/\s+/)}function ze(r,c){Object.prototype.hasOwnProperty.call(r,"options")||(r.options=r.options?N(r.options):{});for(var g in c)r.options[g]=c[g];return r.options}function Tt(r,c,g){var S=[];for(var M in r)S.push(encodeURIComponent(g?M.toUpperCase():M)+"="+encodeURIComponent(r[M]));return(!c||c.indexOf("?")===-1?"?":"&")+S.join("&")}var pt=/\{ *([\w_ -]+) *\}/g;function zt(r,c){return r.replace(pt,function(g,S){var M=c[S];if(M===void 0)throw new Error("No value provided for variable "+g);return typeof M=="function"&&(M=M(c)),M})}var Dt=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"};function fi(r,c){for(var g=0;g<r.length;g++)if(r[g]===c)return g;return-1}var Xe="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function _t(r){return window["webkit"+r]||window["moz"+r]||window["ms"+r]}var Qe=0;function at(r){var c=+new Date,g=Math.max(0,16-(c-Qe));return Qe=c+g,window.setTimeout(r,g)}var yt=window.requestAnimationFrame||_t("RequestAnimationFrame")||at,nt=window.cancelAnimationFrame||_t("CancelAnimationFrame")||_t("CancelRequestAnimationFrame")||function(r){window.clearTimeout(r)};function xt(r,c,g){if(g&&yt===at)r.call(c);else return yt.call(window,$(r,c))}function rt(r){r&&nt.call(window,r)}var Pt={__proto__:null,extend:R,create:N,bind:$,get lastId(){return l},stamp:se,throttle:X,wrapNum:ge,falseFn:ve,formatNum:pe,trim:Re,splitWords:ut,setOptions:ze,getParamString:Tt,template:zt,isArray:Dt,indexOf:fi,emptyImageUrl:Xe,requestFn:yt,cancelFn:nt,requestAnimFrame:xt,cancelAnimFrame:rt};function ft(){}ft.extend=function(r){var c=function(){ze(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},g=c.__super__=this.prototype,S=N(g);S.constructor=c,c.prototype=S;for(var M in this)Object.prototype.hasOwnProperty.call(this,M)&&M!=="prototype"&&M!=="__super__"&&(c[M]=this[M]);return r.statics&&R(c,r.statics),r.includes&&(Ut(r.includes),R.apply(null,[S].concat(r.includes))),R(S,r),delete S.statics,delete S.includes,S.options&&(S.options=g.options?N(g.options):{},R(S.options,r.options)),S._initHooks=[],S.callInitHooks=function(){if(!this._initHooksCalled){g.callInitHooks&&g.callInitHooks.call(this),this._initHooksCalled=!0;for(var V=0,ne=S._initHooks.length;V<ne;V++)S._initHooks[V].call(this)}},c},ft.include=function(r){var c=this.prototype.options;return R(this.prototype,r),r.options&&(this.prototype.options=c,this.mergeOptions(r.options)),this},ft.mergeOptions=function(r){return R(this.prototype.options,r),this},ft.addInitHook=function(r){var c=Array.prototype.slice.call(arguments,1
8),g=typeof r=="function"?r:function(){this[r].apply(this,c)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(g),this};function Ut(r){if(!(typeof L=="undefined"||!L||!L.Mixin)){r=Dt(r)?r:[r];for(var c=0;c<r.length;c++)r[c]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Ct={on:function(r,c,g){if(typeof r=="object")for(var S in r)this._on(S,r[S],c);else{r=ut(r);for(var M=0,V=r.length;M<V;M++)this._on(r[M],c,g)}return this},off:function(r,c,g){if(!arguments.length)delete this._events;else if(typeof r=="object")for(var S in r)this._off(S,r[S],c);else{r=ut(r);for(var M=arguments.length===1,V=0,ne=r.length;V<ne;V++)M?this._off(r[V]):this._off(r[V],c,g)}return this},_on:function(r,c,g,S){if(typeof c!="function"){console.warn("wrong listener type: "+typeof c);return}if(this._listens(r,c,g)===!1){g===this&&(g=void 0);var M={fn:c,ctx:g};S&&(M.once=!0),this._events=this._events||{},this._events[r]=this._events[r]||[],this._events[r].push(M)}},_off:function(r,c,g){var S,M,V;if(this._events&&(S=this._events[r],!!S)){if(arguments.length===1){if(this._firingCount)for(M=0,V=S.length;M<V;M++)S[M].fn=ve;delete this._events[r];return}if(typeof c!="function"){console.warn("wrong listener type: "+typeof c);return}var ne=this._listens(r,c,g);if(ne!==!1){var ye=S[ne];this._firingCount&&(ye.fn=ve,this._events[r]=S=S.slice()),S.splice(ne,1)}}},fire:function(r,c,g){if(!this.listens(r,g))return this;var S=R({},c,{type:r,target:this,sourceTarget:c&&c.sourceTarget||this});if(this._events){var M=this._events[r];if(M){this._firingCount=this._firingCount+1||1;for(var V=0,ne=M.length;V<ne;V++){var ye=M[V],Se=ye.fn;ye.once&&this.off(r,Se,ye.ctx),Se.call(ye.ctx||this,S)}this._firingCount--}}return g&&this._propagateEvent(S),this},listens:function(r,c,g,S){typeof r!="string"&&console.warn('"string" type argument expected');var M=c;typeof c!="function"&&(S=!!c,M=void 0,g=void 0);var V=this._events&&this._events[r];if(V&&V.length&&this._listens(r,M,g)!==!1)return!0;if(S){for(var ne in this._eventParents)if(this._eventParents[ne].listens(r,c,g,S))return!0}return!1},_listens:function(r,c,g){if(!this._events)return!1;var S=this._events[r]||[];if(!c)return!!S.length;g===this&&(g=void 0);for(var M=0,V=S.length;M<V;M++)if(S[M].fn===c&&S[M].ctx===g)return M;return!1},once:function(r,c,g){if(typeof r=="object")for(var S in r)this._on(S,r[S],c,!0);else{r=ut(r);for(var M=0,V=r.length;M<V;M++)this._on(r[M],c,g,!0)}return this},addEventParent:function(r){return this._eventParents=this._eventParents||{},this._eventParents[se(r)]=r,this},removeEventParent:function(r){return this._eventParents&&delete this._eventParents[se(r)],this},_propagateEvent:function(r){for(var c in this._eventParents)this._eventParents[c].fire(r.type,R({layer:r.target,propagatedFrom:r.target},r),!0)}};Ct.addEventListener=Ct.on,Ct.removeEventListener=Ct.clearAllEventListeners=Ct.off,Ct.addOneTimeEventListener=Ct.once,Ct.fireEvent=Ct.fire,Ct.hasEventListeners=Ct.listens;var ni=ft.extend(Ct);function et(r,c,g){this.x=g?Math.round(r):r,this.y=g?Math.round(c):c}var Ui=Math.trunc||function(r){return r>0?Math.floor(r):Math.ceil(r)};et.prototype={clone:function(){return new et(this.x,this.y)},add:function(r){return this.clone()._add(mt(r))},_add:function(r){return this.x+=r.x,this.y+=r.y,this},subtract:function(r){return this.clone()._subtract(mt(r))},_subtract:function(r){return this.x-=r.x,this.y-=r.y,this},divideBy:function(r){return this.clone()._divideBy(r)},_divideBy:function(r){return this.x/=r,this.y/=r,this},multiplyBy:function(r){return this.clone()._multiplyBy(r)},_multiplyBy:function(r){return this.x*=r,this.y*=r,this},scaleBy:function(r){return new et(this.x*r.x,this.y*r.y)},unscaleBy:function(r){return new et(this.x/r.x,this.y/r.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Ui(this.x),this.y=Ui(this.y),this},distanceTo:function(r){r=mt(r);var c=r.x-this.x,g=r.y-this.y;return Math.sqrt(c*c+g*g)},equals:function(r){return r=mt(r),r.x===this.x&&r.y===this.y},contains:function(r){return r=mt(r),Math.abs(r.x)<=Math.abs(this.x)&&Math.abs(r.y)<=Math.abs(this.y)},toString:function(){return"Point("+pe(this.x)+", "+pe(this.y)+")"}};function mt(r,c,g){return r instanceof et?r:Dt(r)?new et(r[0],r[1]):r==null?r:typeof r=="object"&&"x"in r&&"y"in r?new et(r.x,r.y):new et(r,c,g)}function Mt(r,c){if(r)for(var g=c?[r,c]:r,S=0,M=g.length;S<M;S++)this.extend(g[S])}Mt.prototype={extend:function(r){var c,g;if(!r)return this;if(r instanceof et||typeof r[0]=="number"||"x"in r)c=g=mt(r);else if(r=ci(r),c=r.min,g=r.max,!c||!g)return this;return!this.min&&!this.max?(this.min=c.clone(),this.max=g.clone()):(this.min.x=Math.min(c.x,this.min.x),this.max.x=Math.max(g.x,this.max.x),this.min.y=Math.min(c.y,this.min.y),this.max.y=Math.max(g.y,this.max.y)),this},getCenter:function(r){return mt((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,r)},getBottomLeft:function(){return mt(this.min.x,this.max.y)},getTopRight:function(){return mt(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(r){var c,g;return typeof r[0]=="number"||r instanceof et?r=mt(r):r=ci(r),r instanceof Mt?(c=r.min,g=r.max):c=g=r,c.x>=this.min.x&&g.x<=this.max.x&&c.y>=this.min.y&&g.y<=this.max.y},intersects:function(r){r=ci(r);var c=this.min,g=this.max,S=r.min,M=r.max,V=M.x>=c.x&&S.x<=g.x,ne=M.y>=c.y&&S.y<=g.y;return V&&ne},overlaps:function(r){r=ci(r);var c=this.min,g=this.max,S=r.min,M=r.max,V=M.x>c.x&&S.x<g.x,ne=M.y>c.y&&S.y<g.y;return V&&ne},isValid:function(){return!!(this.min&&this.max)},pad:function(r){var c=this.min,g=this.max,S=Math.abs(c.x-g.x)*r,M=Math.abs(c.y-g.y)*r;return ci(mt(c.x-S,c.y-M),mt(g.x+S,g.y+M))},equals:function(r){return r?(r=ci(r),this.min.equals(r.getTopLeft())&&this.max.equals(r.getBottomRight())):!1}};function ci(r,c){return!r||r instanceof Mt?r:new Mt(r,c)}function Lt(r,c){if(r)for(var g=c?[r,c]:r,S=0,M=g.length;S<M;S++)this.extend(g[S])}Lt.prototype={extend:function(r){var c=this._southWest,g=this._northEast,S,M;if(r instanceof qt)S=r,M=r;else if(r instanceof Lt){if(S=r._southWest,M=r._northEast,!S||!M)return this}else return r?this.extend(Vt(r)||$t(r)):this;return!c&&!g?(this._southWest=new qt(S.lat,S.lng),this._northEast=new qt(M.lat,M.lng)):(c.lat=Math.min(S.lat,c.lat),c.lng=Math.min(S.lng,c.lng),g.lat=Math.max(M.lat,g.lat),g.lng=Math.max(M.lng,g.lng)),this},pad:function(r){var c=this._southWest,g=this._northEast,S=Math.abs(c.lat-g.lat)*r,M=Math.abs(c.lng-g.lng)*r;
8return new Lt(new qt(c.lat-S,c.lng-M),new qt(g.lat+S,g.lng+M))},getCenter:function(){return new qt((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new qt(this.getNorth(),this.getWest())},getSouthEast:function(){return new qt(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(r){typeof r[0]=="number"||r instanceof qt||"lat"in r?r=Vt(r):r=$t(r);var c=this._southWest,g=this._northEast,S,M;return r instanceof Lt?(S=r.getSouthWest(),M=r.getNorthEast()):S=M=r,S.lat>=c.lat&&M.lat<=g.lat&&S.lng>=c.lng&&M.lng<=g.lng},intersects:function(r){r=$t(r);var c=this._southWest,g=this._northEast,S=r.getSouthWest(),M=r.getNorthEast(),V=M.lat>=c.lat&&S.lat<=g.lat,ne=M.lng>=c.lng&&S.lng<=g.lng;return V&&ne},overlaps:function(r){r=$t(r);
8var c=this._southWest,g=this._northEast,S=r.getSouthWest(),M=r.getNorthEast(),V=M.lat>c.lat&&S.lat<g.lat,ne=M.lng>c.lng&&S.lng<g.lng;return V&&ne},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(r,c){return r?(r=$t(r),this._southWest.equals(r.getSouthWest(),c)&&this._northEast.equals(r.getNorthEast(),c)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function $t(r,c){return r instanceof Lt?r:new Lt(r,c)}function qt(r,c,g){if(isNaN(r)||isNaN(c))throw new Error("Invalid LatLng object: ("+r+", "+c+")");this.lat=+r,this.lng=+c,g!==void 0&&(this.alt=+g)}qt.prototype={equals:function(r,c){if(!r)return!1;r=Vt(r);var g=Math.max(Math.abs(this.lat-r.lat),Math.abs(this.lng-r.lng));return g<=(c===void 0?1e-9:c)},toString:function(r){return"LatLng("+pe(this.lat,r)+", "+pe(this.lng,r)+")"},distanceTo:function(r){return mn.distance(this,Vt(r))},wrap:function(){return mn.wrapLatLng(this)},toBounds:function(r){var c=180*r/40075017,g=c/Math.cos(Math.PI/180*this.lat);return $t([this.lat-c,this.lng-g],[this.lat+c,this.lng+g])},clone:function(){return new qt(this.lat,this.lng,this.alt)}};function Vt(r,c,g){return r instanceof qt?r:Dt(r)&&typeof r[0]!="object"?r.length===3?new qt(r[0],r[1],r[2]):r.length===2?new qt(r[0],r[1]):null:r==null?r:typeof r=="object"&&"lat"in r?new qt(r.lat,"lng"in r?r.lng:r.lon,r.alt):c===void 0?null:new qt(r,c,g)}var Tn={latLngToPoint:function(r,c){var g=this.projection.project(r),S=this.scale(c);return this.transformation._transform(g,S)},pointToLatLng:function(r,c){var g=this.scale(c),S=this.transformation.untransform(r,g);return this.projection.unproject(S)},project:function(r){return this.projection.project(r)},unproject:function(r){return this.projection.unproject(r)},scale:function(r){return 256*Math.pow(2,r)},zoom:function(r){return Math.log(r/256)/Math.LN2},getProjectedBounds:function(r){if(this.infinite)return null;var c=this.projection.bounds,g=this.scale(r),S=this.transformation.transform(c.min,g),M=this.transformation.transform(c.max,g);return new Mt(S,M)},infinite:!1,wrapLatLng:function(r){var c=this.wrapLng?ge(r.lng,this.wrapLng,!0):r.lng,g=this.wrapLat?ge(r.lat,this.wrapLat,!0):r.lat,S=r.alt;return new qt(g,c,S)},wrapLatLngBounds:function(r){var c=r.getCenter(),g=this.wrapLatLng(c),S=c.lat-g.lat,M=c.lng-g.lng;if(S===0&&M===0)return r;
8var V=r.getSouthWest(),ne=r.getNorthEast(),ye=new qt(V.lat-S,V.lng-M),Se=new qt(ne.lat-S,ne.lng-M);return new Lt(ye,Se)}},mn=R({},Tn,{wrapLng:[-180,180],R:6371e3,distance:function(r,c){var g=Math.PI/180,S=r.lat*g,M=c.lat*g,V=Math.sin((c.lat-r.lat)*g/2),ne=Math.sin((c.lng-r.lng)*g/2),ye=V*V+Math.cos(S)*Math.cos(M)*ne*ne,Se=2*Math.atan2(Math.sqrt(ye),Math.sqrt(1-ye));return this.R*Se}}),Kn=6378137,Sn={R:Kn,MAX_LATITUDE:85.0511287798,project:function(r){var c=Math.PI/180,g=this.MAX_LATITUDE,S=Math.max(Math.min(g,r.lat),-g),M=Math.sin(S*c);return new et(this.R*r.lng*c,this.R*Math.log((1+M)/(1-M))/2)},unproject:function(r){var c=180/Math.PI;return new qt((2*Math.atan(Math.exp(r.y/this.R))-Math.PI/2)*c,r.x*c/this.R)},bounds:function(){var r=Kn*Math.PI;return new Mt([-r,-r],[r,r])}()};function To(r,c,g,S){if(Dt(r)){this._a=r[0],this._b=r[1],this._c=r[2],this._d=r[3];return}this._a=r,this._b=c,this._c=g,this._d=S}To.prototype={transform:function(r,c){return this._transform(r.clone(),c)},_transform:function(r,c){return c=c||1,r.x=c*(this._a*r.x+this._b),r.y=c*(this._c*r.y+this._d),r},untransform:function(r,c){return c=c||1,new et((r.x/c-this._b)/this._a,(r.y/c-this._d)/this._c)}};function Xn(r,c,g,S){return new To(r,c,g,S)}var So=R({},mn,{code:"EPSG:3857",projection:Sn,transformation:function(){var r=.5/(Math.PI*Sn.R);return Xn(r,.5,-r,.5)}()}),kr=R({},So,{code:"EPSG:900913"});function Ao(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Jr(r,c){var g="",S,M,V,ne,ye,Se;for(S=0,V=r.length;S<V;S++){for(ye=r[S],M=0,ne=ye.length;M<ne;M++)Se=ye[M],g+=(M?"L":"M")+Se.x+" "+Se.y;g+=c?_e.svg?"z":"x":""}return g||"M0 0"}var vr=document.documentElement.style,ar="ActiveXObject"in window,Po=ar&&!document.addEventListener,Pe="msLaunchUri"in navigator&&!("documentMode"in document),hn=Ae("webkit"),Bn=Ae("android"),yi=Ae("android 2")||Ae("android 3"),li=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),xr=Bn&&Ae("Google")&&li<537&&!("AudioNode"in window),Qr=!!window.opera,br=!Pe&&Ae("chrome"),vs=Ae("gecko")&&!hn&&!Qr&&!ar,Ko=!br&&Ae("safari"),zr=Ae("phantom"),eo="OTransition"in vr,Fe=navigator.platform.indexOf("Win")===0,lr=ar&&"transition"in vr,Ci="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!yi,to="MozPerspective"in vr,Dr=!window.L_DISABLE_3D&&(lr||Ci||to)&&!eo&&!zr,Oe=typeof orientation!="undefined"||Ae("mobile"),Rt=Oe&&hn,It=Oe&&Ci,dn=!window.PointerEvent&&window.MSPointerEvent,cr=!!(window.PointerEvent||dn),Et="ontouchstart"in window||!!window.TouchEvent,Rr=!window.L_NO_TOUCH&&(Et||cr),Y=Oe&&Qr,B=Oe&&vs,F=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,q=function(){var r=!1;try{var c=Object.defineProperty({},"passive",{get:function(){r=!0}});window.addEventListener("testPassiveEventSupport",ve,c),window.removeEventListener("testPassiveEventSupport",ve,c)}catch(g){}return r}(),Q=function(){return!!document.createElement("canvas").getContext}(),ee=!!(document.createElementNS&&Ao("svg").createSVGRect),fe=!!ee&&function(){var r=document.createElement("div");return r.innerHTML="<svg/>",(r.firstChild&&r.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),le=!ee&&function(){try{var r=document.createElement("div");r.innerHTML='<v:shape adj="1"/>';var c=r.firstChild;return c.style.behavior="url(#default#VML)",c&&typeof c.adj=="object"}catch(g){return!1}}(),re=navigator.platform.indexOf("Mac")===0,ue=navigator.platform.indexOf("Linux")===0;function Ae(r){return navigator.userAgent.toLowerCase().indexOf(r)>=0}var _e={ie:ar,ielt9:Po,edge:Pe,webkit:hn,android:Bn,android23:yi,androidStock:xr,opera:Qr,chrome:br,gecko:vs,safari:Ko,phantom:zr,opera12:eo,win:Fe,ie3d:lr,webkit3d:Ci,gecko3d:to,any3d:Dr,mobile:Oe,mobileWebkit:Rt,mobileWebkit3d:It,msPointer:dn,pointer:cr,touch:Rr,touchNative:Et,mobileOpera:Y,mobileGecko:B,retina:F,passiveEvents:q,canvas:Q,svg:ee,vml:le,inlineSvg:fe,mac:re,linux:ue},Le=_e.msPointer?"MSPointerDown":"pointerdown",lt=_e.msPointer?"MSPointerMove":"pointermove",vt=_e.msPointer?"MSPointerUp":"pointerup",Ye=_e.msPointer?"MSPointerCancel":"pointercancel",ct={touchstart:Le,touchmove:lt,touchend:vt,touchcancel:Ye},St={touchstart:Ja,touchmove:_n,touchend:_n,touchcancel:_n},ei={},mi=!1;function ri(r,c,g){return c==="touchstart"&&en(),St[c]?(g=St[c].bind(this,g),r.addEventListener(ct[c],g,!1),g):(console.warn("wrong event specified:",c),ve)}function ti(r,c,g){if(!ct[c]){console.warn("wrong event specified:",c);return}r.removeEventListener(ct[c],g,!1)}function pn(r){ei[r.pointerId]=r}function Ti(r){ei[r.pointerId]&&(ei[r.pointerId]=r)}function Vi(r){delete ei[r.pointerId]}function en(){mi||(document.addEventListener(Le,pn,!0),document.addEventListener(lt,Ti,!0),document.addEventListener(vt,Vi,!0),document.addEventListener(Ye,Vi,!0),mi=!0)}function _n(r,c){if(c.pointerType!==(c.MSPOINTER_TYPE_MOUSE||"mouse")){c.touches=[];for(var g in ei)c.touches.push(ei[g]);c.changedTouches=[c],r(c)}}function Ja(r,c){c.MSPOINTER_TYPE_TOUCH&&c.pointerType===c.MSPOINTER_TYPE_TOUCH&&Ni(c),_n(r,c)}function Xo(r){var c={}
8,g,S;for(S in r)g=r[S],c[S]=g&&g.bind?g.bind(r):g;return r=c,c.type="dblclick",c.detail=2,c.isTrusted=!1,c._simulated=!0,c}var Yo=200;function El(r,c){r.addEventListener("dblclick",c);var g=0,S;function M(V){if(V.detail!==1){S=V.detail;return}if(!(V.pointerType==="mouse"||V.sourceCapabilities&&!V.sourceCapabilities.firesTouchEvents)){var ne=Wt(V);if(!(ne.some(function(Se){return Se instanceof HTMLLabelElement&&Se.attributes.for})&&!ne.some(function(Se){return Se instanceof HTMLInputElement||Se instanceof HTMLSelectElement}))){var ye=Date.now();ye-g<=Yo?(S++,S===2&&c(Xo(V))):S=1,g=ye}}}return r.addEventListener("click",M),{dblclick:c,simDblclick:M}}function _i(r,c){r.removeEventListener("dblclick",c.dblclick),r.removeEventListener("click",c.simDblclick)}var xs=ws(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),io=ws(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),tn=io==="webkitTransition"||io==="OTransition"?io+"End":"transitionend";function An(r){return typeof r=="string"?document.getElementById(r):r}function bs(r,c){var g=r.style[c]||r.currentStyle&&r.currentStyle[c];if((!g||g==="auto")&&document.defaultView){var S=document.defaultView.getComputedStyle(r,null);g=S?S[c]:null}return g==="auto"?null:g}function Bt(r,c,g){var S=document.createElement(r);return S.className=c||"",g&&g.appendChild(S),S}function Ht(r){var c=r.parentNode;c&&c.removeChild(r)}function Io(r){for(;r.firstChild;)r.removeChild(r.firstChild)}function ur(r){var c=r.parentNode;c&&c.lastChild!==r&&c.appendChild(r)}function vi(r){var c=r.parentNode;c&&c.firstChild!==r&&c.insertBefore(r,c.firstChild)}function ai(r,c){if(r.classList!==void 0)return r.classList.contains(c);var g=gn(r);return g.length>0&&new RegExp("(^|\\s)"+c+"(\\s|$)").test(g)}function kt(r,c){if(r.classList!==void 0)for(var g=ut(c),S=0,M=g.length;S<M;S++)r.classList.add(g[S]);else if(!ai(r,c)){var V=gn(r);Jo(r,(V?V+" ":"")+c)}}function Ot(r,c){r.classList!==void 0?r.classList.remove(c):Jo(r,Re((" "+gn(r)+" ").replace(" "+c+" "," ")))}function Jo(r,c){r.className.baseVal===void 0?r.className=c:r.className.baseVal=c}function gn(r){return r.correspondingElement&&(r=r.correspondingElement),r.className.baseVal===void 0?r.className:r.className.baseVal}function Pn(r,c){"opacity"in r.style?r.style.opacity=c:"filter"in r.style&&no(r,c)}function no(r,c){var g=!1,S="DXImageTransform.Microsoft.Alpha";try{g=r.filters.item(S)}
8catch(M){if(c===1)return}c=Math.round(c*100),g?(g.Enabled=c!==100,g.Opacity=c):r.style.filter+=" progid:"+S+"(opacity="+c+")"}function ws(r){for(var c=document.documentElement.style,g=0;g<r.length;g++)if(r[g]in c)return r[g];return!1}function Br(r,c,g){var S=c||new et(0,0);r.style[xs]=(_e.ie3d?"translate("+S.x+"px,"+S.y+"px)":"translate3d("+S.x+"px,"+S.y+"px,0)")+(g?" scale("+g+")":"")}function Oi(r,c){r._leaflet_pos=c,_e.any3d?Br(r,c):(r.style.left=c.x+"px",r.style.top=c.y+"px")}function wr(r){return r._leaflet_pos||new et(0,0)}var Yn,Lo,Eo;if("onselectstart"in document)Yn=function(){Ft(window,"selectstart",Ni)},Lo=function(){bi(window,"selectstart",Ni)};else{var Qo=ws(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Yn=function(){if(Qo){var r=document.documentElement.style;Eo=r[Qo],r[Qo]="none"}},Lo=function(){Qo&&(document.documentElement.style[Qo]=Eo,Eo=void 0)}}function Aa(){Ft(window,"dragstart",Ni)}function Ts(){bi(window,"dragstart",Ni)}var es,Gs;function Pa(r){for(;r.tabIndex===-1;)r=r.parentNode;r.style&&(Ss(),es=r,Gs=r.style.outlineStyle,r.style.outlineStyle="none",Ft(window,"keydown",Ss))}function Ss(){es&&(es.style.outlineStyle=Gs,es=void 0,Gs=void 0,bi(window,"keydown",Ss))}function Ia(r){do r=r.parentNode;while((!r.offsetWidth||!r.offsetHeight)&&r!==document.body);return r}function ts(r){var c=r.getBoundingClientRect();return{x:c.width/r.offsetWidth||1,y:c.height/r.offsetHeight||1,boundingClientRect:c}}var Qa={__proto__:null,TRANSFORM:xs,TRANSITION:io,TRANSITION_END:tn,get:An,getStyle:bs,create:Bt,remove:Ht,empty:Io,toFront:ur,toBack:vi,hasClass:ai,addClass:kt,removeClass:Ot,setClass:Jo,getClass:gn,setOpacity:Pn,testProp:ws,setTransform:Br,setPosition:Oi,getPosition:wr,get disableTextSelection(){return Yn},get enableTextSelection(){return Lo},disableImageDrag:Aa,enableImageDrag:Ts,preventOutline:Pa,restoreOutline:Ss,getSizedParentNode:Ia,getScale:ts};function Ft(r,c,g,S){if(c&&typeof c=="object")for(var M in c)In(r,M,c[M],g);else{c=ut(c);for(var V=0,ne=c.length;V<ne;V++)In(r,c[V],g,S)}return this}var Jn="_leaflet_events";function bi(r,c,g,S){if(arguments.length===1)ro(r),delete r[Jn];else if(c&&typeof c=="object")for(var M in c)ns(r,M,c[M],g);else if(c=ut(c),arguments.length===2)ro(r,function(ye){return fi(c,ye)!==-1});else for(var V=0,ne=c.length;V<ne;V++)ns(r,c[V],g,S);return this}function ro(r,c){for(var g in r[Jn]){var S=g.split(/\d/)[0];(!c||c(S))&&ns(r,S,null,null,g)}}
8var is={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function In(r,c,g,S){var M=c+se(g)+(S?"_"+se(S):"");if(r[Jn]&&r[Jn][M])return this;var V=function(ye){return g.call(S||r,ye||window.event)},ne=V;!_e.touchNative&&_e.pointer&&c.indexOf("touch")===0?V=ri(r,c,V):_e.touch&&c==="dblclick"?V=El(r,V):"addEventListener"in r?c==="touchstart"||c==="touchmove"||c==="wheel"||c==="mousewheel"?r.addEventListener(is[c]||c,V,_e.passiveEvents?{passive:!1}:!1):c==="mouseenter"||c==="mouseleave"?(V=function(ye){ye=ye||window.event,Ps(r,ye)&&ne(ye)},r.addEventListener(is[c],V,!1)):r.addEventListener(c,ne,!1):r.attachEvent("on"+c,V),r[Jn]=r[Jn]||{},r[Jn][M]=V}function ns(r,c,g,S,M){M=M||c+se(g)+(S?"_"+se(S):"");var V=r[Jn]&&r[Jn][M];if(!V)return this;!_e.touchNative&&_e.pointer&&c.indexOf("touch")===0?ti(r,c,V):_e.touch&&c==="dblclick"?_i(r,V):"removeEventListener"in r?r.removeEventListener(is[c]||c,V,!1):r.detachEvent("on"+c,V),r[Jn][M]=null}function Tr(r){return r.stopPropagation?r.stopPropagation():r.originalEvent?r.originalEvent._stopped=!0:r.cancelBubble=!0,this}function Co(r){return In(r,"wheel",Tr),this}function oo(r){return Ft(r,"mousedown touchstart dblclick contextmenu",Tr),r._leaflet_disable_click=!0,this}function Ni(r){return r.preventDefault?r.preventDefault():r.returnValue=!1,this}function Ln(r){return Ni(r),Tr(r),this}function Wt(r){if(r.composedPath)return r.composedPath();for(var c=[],g=r.target;g;)c.push(g),g=g.parentNode;return c}function As(r,c){if(!c)return new et(r.clientX,r.clientY);var g=ts(c),S=g.boundingClientRect;return new et((r.clientX-S.left)/g.x-c.clientLeft,(r.clientY-S.top)/g.y-c.clientTop)}var On=_e.linux&&_e.chrome?window.devicePixelRatio:_e.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function En(r){return _e.edge?r.wheelDeltaY/2:r.deltaY&&r.deltaMode===0?-r.deltaY/On:r.deltaY&&r.deltaMode===1?-r.deltaY*20:r.deltaY&&r.deltaMode===2?-r.deltaY*60:r.deltaX||r.deltaZ?0:r.wheelDelta?(r.wheelDeltaY||r.wheelDelta)/2:r.detail&&Math.abs(r.detail)<32765?-r.detail*20:r.detail?r.detail/-32765*60:0}function Ps(r,c){var g=c.relatedTarget;if(!g)return!0;try{for(;g&&g!==r;)g=g.parentNode}catch(S){return!1}return g!==r}var Hs={__proto__:null,on:Ft,off:bi,stopPropagation:Tr,disableScrollPropagation:Co,disableClickPropagation:oo,preventDefault:Ni,stop:Ln,getPropagationPath:Wt,getMousePosition:As,getWheelDelta:En,isExternalTarget:Ps,addListener:Ft,removeListener:bi},Is=ni.extend({run:function(r,c,g,S){this.stop(),this._el=r,this._inProgress=!0,this._duration=g||.25,this._easeOutPower=1/Math.max(S||.5,.2),this._startPos=wr(r),this._offset=c.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=xt(this._animate,this),this._step()},_step:function(r){var c=+new Date-this._startTime,g=this._duration*1e3;c<g?this._runFrame(this._easeOut(c/g),r):(this._runFrame(1),this._complete())},_runFrame:function(r,c){var g=this._startPos.add(this._offset.multiplyBy(r));c&&g._round(),Oi(this._el,g),this.fire("step")},_complete:function(){rt(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(r){return 1-Math.pow(1-r,this._easeOutPower)}}),oi=ni.extend({options:{crs:So,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(r,c){c=ze(this,c),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(r),this._initLayout(),this._onResize=$(this._onResize,this),this._initEvents(),c.maxBounds&&this.setMaxBounds(c.maxBounds),c.zoom!==void 0&&(this._zoom=this._limitZoom(c.zoom)),c.center&&c.zoom!==void 0&&this.setView(Vt(c.center),c.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=io&&_e.any3d&&!_e.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Ft(this._proxy,tn,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)}
vendor: 5,786 bytes, line 8
8,setView:function(r,c,g){if(c=c===void 0?this._zoom:this._limitZoom(c),r=this._limitCenter(Vt(r),c,this.options.maxBounds),g=g||{},this._stop(),this._loaded&&!g.reset&&g!==!0){g.animate!==void 0&&(g.zoom=R({animate:g.animate},g.zoom),g.pan=R({animate:g.animate,duration:g.duration},g.pan));var S=this._zoom!==c?this._tryAnimatedZoom&&this._tryAnimatedZoom(r,c,g.zoom):this._tryAnimatedPan(r,g.pan);if(S)return clearTimeout(this._sizeTimer),this}return this._resetView(r,c,g.pan&&g.pan.noMoveStart),this},setZoom:function(r,c){return this._loaded?this.setView(this.getCenter(),r,{zoom:c}):(this._zoom=r,this)},zoomIn:function(r,c){return r=r||(_e.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+r,c)},zoomOut:function(r,c){return r=r||(_e.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-r,c)},setZoomAround:function(r,c,g){var S=this.getZoomScale(c),M=this.getSize().divideBy(2),V=r instanceof et?r:this.latLngToContainerPoint(r),ne=V.subtract(M).multiplyBy(1-1/S),ye=this.containerPointToLatLng(M.add(ne));return this.setView(ye,c,{zoom:g})},_getBoundsCenterZoom:function(r,c){c=c||{},r=r.getBounds?r.getBounds():$t(r);var g=mt(c.paddingTopLeft||c.padding||[0,0]),S=mt(c.paddingBottomRight||c.padding||[0,0]),M=this.getBoundsZoom(r,!1,g.add(S));if(M=typeof c.maxZoom=="number"?Math.min(c.maxZoom,M):M,M===1/0)return{center:r.getCenter(),zoom:M};var V=S.subtract(g).divideBy(2),ne=this.project(r.getSouthWest(),M),ye=this.project(r.getNorthEast(),M),Se=this.unproject(ne.add(ye).divideBy(2).add(V),M);return{center:Se,zoom:M}},fitBounds:function(r,c){if(r=$t(r),!r.isValid())throw new Error("Bounds are not valid.");var g=this._getBoundsCenterZoom(r,c);return this.setView(g.center,g.zoom,c)},fitWorld:function(r){return this.fitBounds([[-90,-180],[90,180]],r)},panTo:function(r,c){return this.setView(r,this._zoom,{pan:c})},panBy:function(r,c){if(r=mt(r).round(),c=c||{},!r.x&&!r.y)return this.fire("moveend");if(c.animate!==!0&&!this.getSize().contains(r))return this._resetView(this.unproject(this.project(this.getCenter()).add(r)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Is,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),c.noMoveStart||this.fire("movestart"),c.animate!==!1){kt(this._mapPane,"leaflet-pan-anim");var g=this._getMapPanePos().subtract(r).round();this._panAnim.run(this._mapPane,g,c.duration||.25,c.easeLinearity)}else this._rawPanBy(r),this.fire("move").fire("moveend");return this},flyTo:function(r,c,g){if(g=g||{},g.animate===!1||!_e.any3d)return this.setView(r,c,g);this._stop();var S=this.project(this.getCenter()),M=this.project(r),V=this.getSize(),ne=this._zoom;r=Vt(r),c=c===void 0?ne:c;var ye=Math.max(V.x,V.y),Se=ye*this.getZoomScale(ne,c),Me=M.distanceTo(S)||1,Ke=1.42,At=Ke*Ke;function Xt(Pi){var Ii=Pi?-1:1,zi=Pi?Se:ye,hs=Se*Se-ye*ye+Ii*At*At*Me*Me,Bs=2*zi*At*Me,jo=hs/Bs,ho=Math.sqrt(jo*jo+1)-jo,Ua=ho<1e-9?-18:Math.log(ho);return Ua}function xi(Pi){return(Math.exp(Pi)-Math.exp(-Pi))/2}function Zi(Pi){return(Math.exp(Pi)+Math.exp(-Pi))/2}function Ge(Pi){return xi(Pi)/Zi(Pi)}var Je=Xt(0);function Er(Pi){return ye*(Zi(Je)/Zi(Je+Ke*Pi))}function Oa(Pi){return ye*(Zi(Je)*Ge(Je+Ke*Pi)-xi(Je))/At}function Fa(Pi){return 1-Math.pow(1-Pi,1.5)}var ji=Date.now(),fa=(Xt(1)-Je)/Ke,er=g.duration?1e3*g.duration:1e3*fa*.8;function Na(){var Pi=(Date.now()-ji)/er,Ii=Fa(Pi)*fa;Pi<=1?(this._flyToFrame=xt(Na,this),this._move(this.unproject(S.add(M.subtract(S).multiplyBy(Oa(Ii)/Me)),ne),this.getScaleZoom(ye/Er(Ii),ne),{flyTo:!0})):this._move(r,c)._moveEnd(!0)}return this._moveStart(!0,g.noMoveStart),Na.call(this),this},flyToBounds:function(r,c){var g=this._getBoundsCenterZoom(r,c);return this.flyTo(g.center,g.zoom,c)},setMaxBounds:function(r){return r=$t(r),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),r.isValid()?(this.options.maxBounds=r,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(r){var c=this.options.minZoom;return this.options.minZoom=r,this._loaded&&c!==r&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(r):this},setMaxZoom:function(r){var c=this.options.maxZoom;return this.options.maxZoom=r,this._loaded&&c!==r&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(r):this},panInsideBounds:function(r,c){this._enforcingBounds=!0;var g=this.getCenter(),S=this._limitCenter(g,this._zoom,$t(r));return g.equals(S)||this.panTo(S,c),this._enforcingBounds=!1,this},panInside:function(r,c){c=c||{};var g=mt(c.paddingTopLeft||c.padding||[0,0]),S=mt(c.paddingBottomRight||c.padding||[0,0]),M=this.project(this.getCenter()),V=this.project(r),ne=this.getPixelBounds(),ye=ci([ne.min.add(g),ne.max.subtract(S)]),Se=ye.getSize();if(!ye.contains(V)){this._enforcingBounds=!0;var Me=V.subtract(ye.getCenter()),Ke=ye.extend(V).getSize().subtract(Se);M.x+=Me.x<0?-Ke.x:Ke.x,M.y+=Me.y<0?-Ke.y:Ke.y,this.panTo(this.unproject(M),c),this._enforcingBounds=!1}return this},invalidateSize:function(r){if(!this._loaded)return this;r=R({animate:!1,pan:!0},r===!0?{animate:!0}:r);var c=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var g=this.getSize(),S=c.divideBy(2).round(),M=g.divideBy(2).round(),V=S.subtract(M);return!V.x&&!V.y?this:(r.animate&&r.pan?this.panBy(V):(r.pan&&this._rawPanBy(V),this.fire("move"),r.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout($(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:c,newSize:g}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(r){if(r=this._locateOptions=R({timeout:1e4,watch:!1}
8,r),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var c=$(this._handleGeolocationResponse,this),g=$(this._handleGeolocationError,this);return r.watch?this._locationWatchId=navigator.geolocation.watchPosition(c,g,r):navigator.geolocation.getCurrentPosition(c,g,r),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(r){if(this._container._leaflet_id){var c=r.code,g=r.message||(c===1?"permission denied":c===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:c,message:"Geolocation error: "+g+"."})}},_handleGeolocationResponse:function(r){if(this._container._leaflet_id){var c=r.coords.latitude,g=r.coords.longitude,S=new qt(c,g),M=S.toBounds(r.coords.accuracy*2),V=this._locateOptions;if(V.setView){var ne=this.getBoundsZoom(M);this.setView(S,V.maxZoom?Math.min(ne,V.maxZoom):ne)}var ye={latlng:S,bounds:M,timestamp:r.timestamp};for(var Se in r.coords)typeof r.coords[Se]=="number"&&(ye[Se]=r.coords[Se]);this.fire("locationfound",ye)}},addHandler:function(r,c){if(!c)return this;var g=this[r]=new c(this);return this._handlers.push(g),this.options[r]&&g.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(c){this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Ht(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(rt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var r;for(r in this._layers)this._layers[r].remove();for(r in this._panes)Ht(this._panes[r]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(r,c){var g="leaflet-pane"+(r?" leaflet-"+r.replace("Pane","")+"-pane":""),S=Bt("div",g,c||this._mapPane);return r&&(this._panes[r]=S),S},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var r=this.getPixelBounds(),c=this.unproject(r.getBottomLeft()),g=this.unproject(r.getTopRight());return new Lt(c,g)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(r,c,g){r=$t(r),g=mt(g||[0,0]);var S=this.getZoom()||0,M=this.getMinZoom(),V=this.getMaxZoom(),ne=r.getNorthWest(),ye=r.getSouthEast(),Se=this.getSize().subtract(g),Me=ci(this.project(ye,S),this.project(ne,S)).getSize(),Ke=_e.any3d?this.options.zoomSnap:1,At=Se.x/Me.x,Xt=Se.y/Me.y,xi=c?Math.max(At,Xt):Math.min(At,Xt);return S=this.getScaleZoom(xi,S),Ke&&(S=Math.round(S/(Ke/100))*(Ke/100),S=c?Math.ceil(S/Ke)*Ke:Math.floor(S/Ke)*Ke),Math.max(M,Math.min(V,S))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new et(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(r,c){var g=this._getTopLeftPoint(r,c);return new Mt(g,g.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(r){return this.options.crs.getProjectedBounds(r===void 0?this.getZoom():r)},getPane:function(r){return typeof r=="string"?this._panes[r]:r},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(r,c){var g=this.options.crs;return c=c===void 0?this._zoom:c,g.scale(r)/g.scale(c)},getScaleZoom:function(r,c){var g=this.options.crs;c=c===void 0?this._zoom:c;var S=g.zoom(r*g.scale(c));return isNaN(S)?1/0:S},project:function(r,c){return c=c===void 0?this._zoom:c,this.options.crs.latLngToPoint(Vt(r),c)},unproject:function(r,c){return c=c===void 0?this._zoom:c,this.options.crs.pointToLatLng(mt(r),c)},layerPointToLatLng:function(r){var c=mt(r).add(this.getPixelOrigin());return this.unproject(c)},latLngToLayerPoint:function(r){var c=this.project(Vt(r))._round();return c._subtract(this.getPixelOrigin())},wrapLatLng:function(r){return this.options.crs.wrapLatLng(Vt(r))},wrapLatLngBounds:function(r){return this.options.crs.wrapLatLngBounds($t(r))},distance:function(r,c){return this.options.crs.distance(Vt(r),Vt(c))},containerPointToLayerPoint:function(r){return mt(r).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(r){return mt(r).add(this._getMapPanePos())},containerPointToLatLng:function(r){var c=this.containerPointToLayerPoint(mt(r));return this.layerPointToLatLng(c)},latLngToContainerPoint:function(r){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Vt(r)))},mouseEventToContainerPoint:function(r){return As(r,this._container)},mouseEventToLayerPoint:function(r){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(r))},mouseEventToLatLng:function(r){return this.layerPointToLatLng(this.mouseEventToLayerPoint(r))},_initContainer:function(r){var c=this._container=An(r);if(c){if(c._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ft(c,"scroll",this._onScroll,this),this._containerId=se(c)},_initLayout:function(){var r=this._container;this._fadeAnimated=this.options.fadeAnimation&&_e.any3d,kt(r,"leaflet-container"+(_e.touch?" leaflet-touch":"")+(_e.retina?" leaflet-retina":"")+(_e.ielt9?" leaflet-oldie":"")+(_e.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var c=bs(r,"position");c!=="absolute"&&c!=="relative"&&c!=="fixed"&&c!=="sticky"&&(r.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var r=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Oi(this._mapPane,new et(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(kt(r.markerPane,"leaflet-zoom-hide"),kt(r.shadowPane,"leaflet-zoom-hide"))},_resetView:function(r,c,g){Oi(this._mapPane,new et(0,0));var S=!this._loaded;this._loaded=!0,c=this._limitZoom(c),this.fire("viewprereset");var M=this._zoom!==c;this._moveStart(M,g)._move(r,c)._moveEnd(M),this.fire("viewreset"),S&&this.fire("load")},_moveStart:function(r,c){return r&&this.fire("zoomstart"),c||this.fire("movestart"),this},_move:function(r,c,g,S){c===void 0&&(c=this._zoom);var M=this._zoom!==c;return this._zoom=c,this._lastCenter=r,this._pixelOrigin=this._getNewPixelOrigin(r),S?g&&g.pinch&&this.fire("zoom",g):((M||g&&g.pinch)&&this.fire("zoom",g),this.fire("move",g)),this},_moveEnd:function(r){return r&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return rt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(r){Oi(this._mapPane,this._getMapPanePos().subtract(r))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(r){this._targets={},this._targets[se(this._container)]=this;var c=r?bi:Ft;c(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&c(window,"resize",this._onResize,this),_e.any3d&&this.options.transform3DLimit&&(r?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){rt(this._resizeRequest),this._resizeRequest=xt(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var r=this._getMapPanePos();Math.max(Math.abs(r.x),Math.abs(r.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(r,c){for(var g=[],S,M=c==="mouseout"||c==="mouseover",V=r.target||r.srcElement,ne=!1;V;){if(S=this._targets[se(V)],S&&(c==="click"||c==="preclick")&&this._draggableMoved(S)){ne=!0;break}if(S&&S.listens(c,!0)&&(M&&!Ps(V,r)||(g.push(S),M))||V===this._container)break;V=V.parentNode}return!g.length&&!ne&&!M&&this.listens(c,!0)&&(g=[this]),g}
8,_isClickDisabled:function(r){for(;r&&r!==this._container;){if(r._leaflet_disable_click)return!0;r=r.parentNode}},_handleDOMEvent:function(r){var c=r.target||r.srcElement;if(!(!this._loaded||c._leaflet_disable_events||r.type==="click"&&this._isClickDisabled(c))){var g=r.type;g==="mousedown"&&Pa(c),this._fireDOMEvent(r,g)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(r,c,g){if(r.type==="click"){var S=R({},r);S.type="preclick",this._fireDOMEvent(S,S.type,g)}var M=this._findEventTargets(r,c);if(g){for(var V=[],ne=0;ne<g.length;ne++)g[ne].listens(c,!0)&&V.push(g[ne]);M=V.concat(M)}if(M.length){c==="contextmenu"&&Ni(r);var ye=M[0],Se={originalEvent:r};if(r.type!=="keypress"&&r.type!=="keydown"&&r.type!=="keyup"){var Me=ye.getLatLng&&(!ye._radius||ye._radius<=10);Se.containerPoint=Me?this.latLngToContainerPoint(ye.getLatLng()):this.mouseEventToContainerPoint(r),Se.layerPoint=this.containerPointToLayerPoint(Se.containerPoint),Se.latlng=Me?ye.getLatLng():this.layerPointToLatLng(Se.layerPoint)}for(ne=0;ne<M.length;ne++)if(M[ne].fire(c,Se,!0),Se.originalEvent._stopped||M[ne].options.bubblingMouseEvents===!1&&fi(this._mouseEvents,c)!==-1)return}},_draggableMoved:function(r){return r=r.dragging&&r.dragging.enabled()?r:this,r.dragging&&r.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var r=0,c=this._handlers.length;r<c;r++)this._handlers[r].disable()},whenReady:function(r,c){return this._loaded?r.call(c||this,{target:this}):this.on("load",r,c),this},_getMapPanePos:function(){return wr(this._mapPane)||new et(0,0)},_moved:function(){var r=this._getMapPanePos();return r&&!r.equals([0,0])},_getTopLeftPoint:function(r,c){var g=r&&c!==void 0?this._getNewPixelOrigin(r,c):this.getPixelOrigin();return g.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(r,c){var g=this.getSize()._divideBy(2);return this.project(r,c)._subtract(g)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(r,c,g){var S=this._getNewPixelOrigin(g,c);return this.project(r,c)._subtract(S)},_latLngBoundsToNewLayerBounds:function(r,c,g){var S=this._getNewPixelOrigin(g,c);
8return ci([this.project(r.getSouthWest(),c)._subtract(S),this.project(r.getNorthWest(),c)._subtract(S),this.project(r.getSouthEast(),c)._subtract(S),this.project(r.getNorthEast(),c)._subtract(S)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(r){return this.latLngToLayerPoint(r).subtract(this._getCenterLayerPoint())},_limitCenter:function(r,c,g){if(!g)return r;var S=this.project(r,c),M=this.getSize().divideBy(2),V=new Mt(S.subtract(M),S.add(M)),ne=this._getBoundsOffset(V,g,c);return Math.abs(ne.x)<=1&&Math.abs(ne.y)<=1?r:this.unproject(S.add(ne),c)},_limitOffset:function(r,c){if(!c)return r;var g=this.getPixelBounds(),S=new Mt(g.min.add(r),g.max.add(r));return r.add(this._getBoundsOffset(S,c))},_getBoundsOffset:function(r,c,g){var S=ci(this.project(c.getNorthEast(),g),this.project(c.getSouthWest(),g)),M=S.min.subtract(r.min),V=S.max.subtract(r.max),ne=this._rebound(M.x,-V.x),ye=this._rebound(M.y,-V.y);return new et(ne,ye)},_rebound:function(r,c){return r+c>0?Math.round(r-c)/2:Math.max(0,Math.ceil(r))-Math.max(0,Math.floor(c))},_limitZoom:function(r){var c=this.getMinZoom(),g=this.getMaxZoom(),S=_e.any3d?this.options.zoomSnap:1;return S&&(r=Math.round(r/S)*S),Math.max(c,Math.min(g,r))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Ot(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(r,c){var g=this._getCenterOffset(r)._trunc();return(c&&c.animate)!==!0&&!this.getSize().contains(g)?!1:(this.panBy(g,c),!0)},_createAnimProxy:function(){var r=this._proxy=Bt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(r),this.on("zoomanim",function(c){var g=xs,S=this._proxy.style[g];Br(this._proxy,this.project(c.center,c.zoom),this.getZoomScale(c.zoom,1)),S===this._proxy.style[g]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Ht(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var r=this.getCenter(),c=this.getZoom();Br(this._proxy,this.project(r,c),this.getZoomScale(c,1))},_catchTransitionEnd:function(r){this._animatingZoom&&r.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(r,c,g){if(this._animatingZoom)return!0;if(g=g||{},!this._zoomAnimated||g.animate===!1||this._nothingToAnimate()||Math.abs(c-this._zoom)>this.options.zoomAnimationThreshold)return!1;var S=this.getZoomScale(c),M=this._getCenterOffset(r)._divideBy(1-1/S);return g.animate!==!0&&!this.getSize().contains(M)?!1:(xt(function(){this._moveStart(!0,g.noMoveStart||!1)._animateZoom(r,c,!0)},this),!0)},_animateZoom:function(r,c,g,S){this._mapPane&&(g&&(this._animatingZoom=!0,this._animateToCenter=r,this._animateToZoom=c,kt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:r,zoom:c,noUpdate:S}
vendor: 11,229 bytes, line 8
8),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout($(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Ot(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function La(r,c){return new oi(r,c)}var Cn=ft.extend({options:{position:"topright"},initialize:function(r){ze(this,r)},getPosition:function(){return this.options.position},setPosition:function(r){var c=this._map;return c&&c.removeControl(this),this.options.position=r,c&&c.addControl(this),this},getContainer:function(){return this._container},addTo:function(r){this.remove(),this._map=r;var c=this._container=this.onAdd(r),g=this.getPosition(),S=r._controlCorners[g];return kt(c,"leaflet-control"),g.indexOf("bottom")!==-1?S.insertBefore(c,S.firstChild):S.appendChild(c),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Ht(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(r){this._map&&r&&r.screenX>0&&r.screenY>0&&this._map.getContainer().focus()}}),Mo=function(r){return new Cn(r)};oi.include({addControl:function(r){return r.addTo(this),this},removeControl:function(r){return r.remove(),this},_initControlPos:function(){var r=this._controlCorners={},c="leaflet-",g=this._controlContainer=Bt("div",c+"control-container",this._container);function S(M,V){var ne=c+M+" "+c+V;r[M+V]=Bt("div",ne,g)}S("top","left"),S("top","right"),S("bottom","left"),S("bottom","right")},_clearControlPos:function(){for(var r in this._controlCorners)Ht(this._controlCorners[r]);Ht(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ws=Cn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(r,c,g,S){return g<S?-1:S<g?1:0}},initialize:function(r,c,g){ze(this,g),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var S in r)this._addLayer(r[S],S);for(S in c)this._addLayer(c[S],S,!0)},onAdd:function(r){this._initLayout(),this._update(),this._map=r,r.on("zoomend",this._checkDisabledLayers,this);for(var c=0;c<this._layers.length;c++)this._layers[c].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(r){return Cn.prototype.addTo.call(this,r),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var r=0;r<this._layers.length;r++)this._layers[r].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(r,c){return this._addLayer(r,c),this._map?this._update():this},addOverlay:function(r,c){return this._addLayer(r,c,!0),this._map?this._update():this},removeLayer:function(r){r.off("add remove",this._onLayerChange,this);var c=this._getLayer(se(r));return c&&this._layers.splice(this._layers.indexOf(c),1),this._map?this._update():this},expand:function(){kt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var r=this._map.getSize().y-(this._container.offsetTop+50);return r<this._section.clientHeight?(kt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=r+"px"):Ot(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Ot(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var r="leaflet-control-layers",c=this._container=Bt("div",r),g=this.options.collapsed;c.setAttribute("aria-haspopup",!0),oo(c),Co(c);var S=this._section=Bt("section",r+"-list");g&&(this._map.on("click",this.collapse,this),Ft(c,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var M=this._layersLink=Bt("a",r+"-toggle",c);M.href="#",M.title="Layers",M.setAttribute("role","button"),Ft(M,{keydown:function(V){V.keyCode===13&&this._expandSafely()},click:function(V){Ni(V),this._expandSafely()}},this),g||this.expand(),this._baseLayersList=Bt("div",r+"-base",S),this._separator=Bt("div",r+"-separator",S),this._overlaysList=Bt("div",r+"-overlays",S),c.appendChild(S)},_getLayer:function(r){for(var c=0;c<this._layers.length;c++)if(this._layers[c]&&se(this._layers[c].layer)===r)return this._layers[c]},_addLayer:function(r,c,g){this._map&&r.on("add remove",this._onLayerChange,this),this._layers.push({layer:r,name:c,overlay:g}),this.options.sortLayers&&this._layers.sort($(function(S,M){return this.options.sortFunction(S.layer,M.layer,S.name,M.name)},this)),this.options.autoZIndex&&r.setZIndex&&(this._lastZIndex++,r.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Io(this._baseLayersList),Io(this._overlaysList),this._layerControlInputs=[];var r,c,g,S,M=0;for(g=0;g<this._layers.length;g++)S=this._layers[g],this._addItem(S),c=c||S.overlay,r=r||!S.overlay,M+=S.overlay?0:1;return this.options.hideSingleBase&&(r=r&&M>1,this._baseLayersList.style.display=r?"":"none"),this._separator.style.display=c&&r?"":"none",this},_onLayerChange:function(r){this._handlingClick||this._update();var c=this._getLayer(se(r.target)),g=c.overlay?r.type==="add"?"overlayadd":"overlayremove":r.type==="add"?"baselayerchange":null;g&&this._map.fire(g,c)},_createRadioElement:function(r,c){var g='<input type="radio" class="leaflet-control-layers-selector" name="'+r+'"'+(c?' checked="checked"':"")+"/>",S=document.createElement("div");return S.innerHTML=g,S.firstChild},_addItem:function(r){var c=document.createElement("label"),g=this._map.hasLayer(r.layer),S;r.overlay?(S=document.createElement("input"),S.type="checkbox",S.className="leaflet-control-layers-selector",S.defaultChecked=g):S=this._createRadioElement("leaflet-base-layers_"+se(this),g),this._layerControlInputs.push(S),S.layerId=se(r.layer),Ft(S,"click",this._onInputClick,this);var M=document.createElement("span");M.innerHTML=" "+r.name;var V=document.createElement("span");c.appendChild(V),V.appendChild(S),V.appendChild(M);var ne=r.overlay?this._overlaysList:this._baseLayersList;return ne.appendChild(c),this._checkDisabledLayers(),c},_onInputClick:function(){if(!this._preventClick){var r=this._layerControlInputs,c,g,S=[],M=[];this._handlingClick=!0;for(var V=r.length-1;V>=0;V--)c=r[V],g=this._getLayer(c.layerId).layer,c.checked?S.push(g):c.checked||M.push(g);for(V=0;V<M.length;V++)this._map.hasLayer(M[V])&&this._map.removeLayer(M[V]);for(V=0;V<S.length;V++)this._map.hasLayer(S[V])||this._map.addLayer(S[V]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var r=this._layerControlInputs,c,g,S=this._map.getZoom(),M=r.length-1;M>=0;M--)c=r[M],g=this._getLayer(c.layerId).layer,c.disabled=g.options.minZoom!==void 0&&S<g.options.minZoom||g.options.maxZoom!==void 0&&S>g.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var r=this._section;this._preventClick=!0,Ft(r,"click",Ni),this.expand();var c=this;setTimeout(function(){bi(r,"click",Ni),c._preventClick=!1})}}),Ks=function(r,c,g){return new Ws(r,c,g)},Xs=Cn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(r){var c="leaflet-control-zoom",g=Bt("div",c+" leaflet-bar"),S=this.options;return this._zoomInButton=this._createButton(S.zoomInText,S.zoomInTitle,c+"-in",g,this._zoomIn),this._zoomOutButton=this._createButton(S.zoomOutText,S.zoomOutTitle,c+"-out",g,this._zoomOut),this._updateDisabled(),r.on("zoomend zoomlevelschange",this._updateDisabled,this),g},onRemove:function(r){r.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(r){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(r.shiftKey?3:1))},_zoomOut:function(r){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(r.shiftKey?3:1))},_createButton:function(r,c,g,S,M){var V=Bt("a",g,S);return V.innerHTML=r,V.href="#",V.title=c,V.setAttribute("role","button"),V.setAttribute("aria-label",c),oo(V),Ft(V,"click",Ln),Ft(V,"click",M,this),Ft(V,"click",this._refocusOnMap,this),V},_updateDisabled:function(){var r=this._map,c="leaflet-disabled";Ot(this._zoomInButton,c),Ot(this._zoomOutButton,c),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||r._zoom===r.getMinZoom())&&(kt(this._zoomOutButton,c),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||r._zoom===r.getMaxZoom())&&(kt(this._zoomInButton,c),this._zoomInButton.setAttribute("aria-disabled","true"))}});oi.mergeOptions({zoomControl:!0}),oi.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Xs,this.addControl(this.zoomControl))});var el=function(r){return new Xs(r)},ko=Cn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(r){var c="leaflet-control-scale",g=Bt("div",c),S=this.options;return this._addScales(S,c+"-line",g),r.on(S.updateWhenIdle?"moveend":"move",this._update,this),r.whenReady(this._update,this),g},onRemove:function(r){r.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(r,c,g){r.metric&&(this._mScale=Bt("div",c,g)),r.imperial&&(this._iScale=Bt("div",c,g))},_update:function(){var r=this._map,c=r.getSize().y/2,g=r.distance(r.containerPointToLatLng([0,c]),r.containerPointToLatLng([this.options.maxWidth,c]));this._updateScales(g)},_updateScales:function(r){this.options.metric&&r&&this._updateMetric(r),this.options.imperial&&r&&this._updateImperial(r)},_updateMetric:function(r){var c=this._getRoundNum(r),g=c<1e3?c+" m":c/1e3+" km";this._updateScale(this._mScale,g,c/r)},_updateImperial:function(r){var c=r*3.2808399,g,S,M;c>5280?(g=c/5280,S=this._getRoundNum(g),this._updateScale(this._iScale,S+" mi",S/g)):(M=this._getRoundNum(c),this._updateScale(this._iScale,M+" ft",M/c))},_updateScale:function(r,c,g){r.style.width=Math.round(this.options.maxWidth*g)+"px",r.innerHTML=c},_getRoundNum:function(r){var c=Math.pow(10,(Math.floor(r)+"").length-1),g=r/c;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:1,c*g}}),Cl=function(r){return new ko(r)},Ml='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Ea=Cn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(_e.inlineSvg?Ml+" ":"")+"Leaflet</a>"},initialize:function(r){ze(this,r),this._attributions={}}
8,onAdd:function(r){r.attributionControl=this,this._container=Bt("div","leaflet-control-attribution"),oo(this._container);for(var c in r._layers)r._layers[c].getAttribution&&this.addAttribution(r._layers[c].getAttribution());return this._update(),r.on("layeradd",this._addAttribution,this),this._container},onRemove:function(r){r.off("layeradd",this._addAttribution,this)},_addAttribution:function(r){r.layer.getAttribution&&(this.addAttribution(r.layer.getAttribution()),r.layer.once("remove",function(){this.removeAttribution(r.layer.getAttribution())},this))},setPrefix:function(r){return this.options.prefix=r,this._update(),this},addAttribution:function(r){return r?(this._attributions[r]||(this._attributions[r]=0),this._attributions[r]++,this._update(),this):this},removeAttribution:function(r){return r?(this._attributions[r]&&(this._attributions[r]--,this._update()),this):this},_update:function(){if(this._map){var r=[];for(var c in this._attributions)this._attributions[c]&&r.push(c);var g=[];this.options.prefix&&g.push(this.options.prefix),r.length&&g.push(r.join(", ")),this._container.innerHTML=g.join(' <span aria-hidden="true">|</span> ')}}});oi.mergeOptions({attributionControl:!0}),oi.addInitHook(function(){this.options.attributionControl&&new Ea().addTo(this)});var kl=function(r){return new Ea(r)};Cn.Layers=Ws,Cn.Zoom=Xs,Cn.Scale=ko,Cn.Attribution=Ea,Mo.layers=Ks,Mo.zoom=el,Mo.scale=Cl,Mo.attribution=kl;var Sr=ft.extend({initialize:function(r){this._map=r},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Sr.addTo=function(r,c){return r.addHandler(c,this),this};var zl={Events:Ct},Ys=_e.touch?"touchstart mousedown":"mousedown",hr=ni.extend({options:{clickTolerance:3},initialize:function(r,c,g,S){ze(this,S),this._element=r,this._dragStartTarget=c||r,this._preventOutline=g},enable:function(){this._enabled||(Ft(this._dragStartTarget,Ys,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(hr._dragging===this&&this.finishDrag(!0),bi(this._dragStartTarget,Ys,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(r){if(this._enabled&&(this._moved=!1,!ai(this._element,"leaflet-zoom-anim"))){if(r.touches&&r.touches.length!==1){hr._dragging===this&&this.finishDrag();return}if(!(hr._dragging||r.shiftKey||r.which!==1&&r.button!==1&&!r.touches)&&(hr._dragging=this,this._preventOutline&&Pa(this._element),Aa(),Yn(),!this._moving)){this.fire("down");var c=r.touches?r.touches[0]:r,g=Ia(this._element);this._startPoint=new et(c.clientX,c.clientY),this._startPos=wr(this._element),this._parentScale=ts(g);var S=r.type==="mousedown";Ft(document,S?"mousemove":"touchmove",this._onMove,this),Ft(document,S?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(r){if(this._enabled){if(r.touches&&r.touches.length>1){this._moved=!0;return}var c=r.touches&&r.touches.length===1?r.touches[0]:r,g=new et(c.clientX,c.clientY)._subtract(this._startPoint);!g.x&&!g.y||Math.abs(g.x)+Math.abs(g.y)<this.options.clickTolerance||(g.x/=this._parentScale.x,g.y/=this._parentScale.y,Ni(r),this._moved||(this.fire("dragstart"),this._moved=!0,kt(document.body,"leaflet-dragging"),this._lastTarget=r.target||r.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),kt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(g),this._moving=!0,this._lastEvent=r,this._updatePosition())}},_updatePosition:function(){var r={originalEvent:this._lastEvent};this.fire("predrag",r),Oi(this._element,this._newPos),this.fire("drag",r)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(r){Ot(document.body,"leaflet-dragging"),this._lastTarget&&(Ot(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),bi(document,"mousemove touchmove",this._onMove,this),bi(document,"mouseup touchend touchcancel",this._onUp,this),Ts(),Lo();var c=this._moved&&this._moving;this._moving=!1,hr._dragging=!1,c&&this.fire("dragend",{noInertia:r,distance:this._newPos.distanceTo(this._startPos)})}});function Js(r,c,g){var S,M=[1,4,2,8],V,ne,ye,Se,Me,Ke,At,Xt;for(V=0,Ke=r.length;V<Ke;V++)r[V]._code=gi(r[V],c);for(ye=0;ye<4;ye++){for(At=M[ye],S=[],V=0,Ke=r.length,ne=Ke-1;V<Ke;ne=V++)Se=r[V],Me=r[ne],Se._code&At?Me._code&At||(Xt=si(Me,Se,At,c,g),Xt._code=gi(Xt,c),S.push(Xt)):(Me._code&At&&(Xt=si(Me,Se,At,c,g),Xt._code=gi(Xt,c),S.push(Xt)),S.push(Se));r=S}return r}function Qs(r,c){var g,S,M,V,ne,ye,Se,Me,Ke;if(!r||r.length===0)throw new Error("latlngs not passed");Yi(r)||(console.warn("latlngs are not flat! Only the first ring will be used"),r=r[0]);var At=Vt([0,0]),Xt=$t(r),xi=Xt.getNorthWest().distanceTo(Xt.getSouthWest
8())*Xt.getNorthEast().distanceTo(Xt.getNorthWest());xi<1700&&(At=so(r));var Zi=r.length,Ge=[];for(g=0;g<Zi;g++){var Je=Vt(r[g]);Ge.push(c.project(Vt([Je.lat-At.lat,Je.lng-At.lng])))}for(ye=Se=Me=0,g=0,S=Zi-1;g<Zi;S=g++)M=Ge[g],V=Ge[S],ne=M.y*V.x-V.y*M.x,Se+=(M.x+V.x)*ne,Me+=(M.y+V.y)*ne,ye+=ne*3;ye===0?Ke=Ge[0]:Ke=[Se/ye,Me/ye];var Er=c.unproject(mt(Ke));return Vt([Er.lat+At.lat,Er.lng+At.lng])}function so(r){for(var c=0,g=0,S=0,M=0;M<r.length;M++){var V=Vt(r[M]);c+=V.lat,g+=V.lng,S++}return Vt([c/S,g/S])}var tl={__proto__:null,clipPolygon:Js,polygonCenter:Qs,centroid:so};function Ca(r,c){if(!c||!r.length)return r.slice();var g=c*c;return r=rs(r,g),r=il(r,g),r}function ea(r,c,g){return Math.sqrt(Zt(r,c,g,!0))}function zo(r,c,g){return Zt(r,c,g)}function il(r,c){var g=r.length,S=typeof Uint8Array!=void 0+""?Uint8Array:Array,M=new S(g);M[0]=M[g-1]=1,Ar(r,M,c,0,g-1);var V,ne=[];for(V=0;V<g;V++)M[V]&&ne.push(r[V]);return ne}function Ar(r,c,g,S,M){var V=0,ne,ye,Se;for(ye=S+1;ye<=M-1;ye++)Se=Zt(r[ye],r[S],r[M],!0),Se>V&&(ne=ye,V=Se);V>g&&(c[ne]=1,Ar(r,c,g,S,ne),Ar(r,c,g,ne,M))}function rs(r,c){for(var g=[r[0]],S=1,M=0,V=r.length;S<V;S++)Dl(r[S],r[M])>c&&(g.push(r[S]),M=S);return M<V-1&&g.push(r[V-1]),g}var Ma;function ta(r,c,g,S,M){var V=S?Ma:gi(r,g),ne=gi(c,g),ye,Se,Me;for(Ma=ne;;){if(!(V|ne))return[r,c];if(V&ne)return!1;ye=V||ne,Se=si(r,c,ye,g,M),Me=gi(Se,g),ye===V?(r=Se,V=Me):(c=Se,ne=Me)}}function si(r,c,g,S,M){var V=c.x-r.x,ne=c.y-r.y,ye=S.min,Se=S.max,Me,Ke;return g&8?(Me=r.x+V*(Se.y-r.y)/ne,Ke=Se.y):g&4?(Me=r.x+V*(ye.y-r.y)/ne,Ke=ye.y):g&2?(Me=Se.x,Ke=r.y+ne*(Se.x-r.x)/V):g&1&&(Me=ye.x,Ke=r.y+ne*(ye.x-r.x)/V),new et(Me,Ke,M)}function gi(r,c){var g=0;return r.x<c.min.x?g|=1:r.x>c.max.x&&(g|=2),r.y<c.min.y?g|=4:r.y>c.max.y&&(g|=8),g}function Dl(r,c){var g=c.x-r.x,S=c.y-r.y;return g*g+S*S}function Zt(r,c,g,S){var M=c.x,V=c.y,ne=g.x-M,ye=g.y-V,Se=ne*ne+ye*ye,Me;return Se>0&&(Me=((r.x-M)*ne+(r.y-V)*ye)/Se,Me>1?(M=g.x,V=g.y):Me>0&&(M+=ne*Me,V+=ye*Me)),ne=r.x-M,ye=r.y-V,S?ne*ne+ye*ye:new et(M,V)}function Yi(r){return!Dt(r[0])||typeof r[0][0]!="object"&&typeof r[0][0]!="undefined"}function Mi(r){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Yi(r)}function Ai(r,c){var g,S,M,V,ne,ye,Se,Me;if(!r||r.length===0)throw new Error("latlngs not passed");Yi(r)||(console.warn("latlngs are not flat! Only the first ring will be used"),r=r[0]);var Ke=Vt([0,0]),At=$t(r),Xt=At.getNorthWest().distanceTo(At.getSouthWest
vendor: 4,096 bytes, line 8
8())*At.getNorthEast().distanceTo(At.getNorthWest());Xt<1700&&(Ke=so(r));var xi=r.length,Zi=[];for(g=0;g<xi;g++){var Ge=Vt(r[g]);Zi.push(c.project(Vt([Ge.lat-Ke.lat,Ge.lng-Ke.lng])))}for(g=0,S=0;g<xi-1;g++)S+=Zi[g].distanceTo(Zi[g+1])/2;if(S===0)Me=Zi[0];else for(g=0,V=0;g<xi-1;g++)if(ne=Zi[g],ye=Zi[g+1],M=ne.distanceTo(ye),V+=M,V>S){Se=(V-S)/M,Me=[ye.x-Se*(ye.x-ne.x),ye.y-Se*(ye.y-ne.y)];break}var Je=c.unproject(mt(Me));return Vt([Je.lat+Ke.lat,Je.lng+Ke.lng])}var Ls={__proto__:null,simplify:Ca,pointToSegmentDistance:ea,closestPointOnSegment:zo,clipSegment:ta,_getEdgeIntersection:si,_getBitCode:gi,_sqClosestPointOnSegment:Zt,isFlat:Yi,_flat:Mi,polylineCenter:Ai},ia={project:function(r){return new et(r.lng,r.lat)},unproject:function(r){return new qt(r.y,r.x)},bounds:new Mt([-180,-90],[180,90])},Es={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Mt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(r){var c=Math.PI/180,g=this.R,S=r.lat*c,M=this.R_MINOR/g,V=Math.sqrt(1-M*M),ne=V*Math.sin(S),ye=Math.tan(Math.PI/4-S/2)/Math.pow((1-ne)/(1+ne),V/2);return S=-g*Math.log(Math.max(ye,1e-10)),new et(r.lng*c*g,S)},unproject:function(r){for(var c=180/Math.PI,g=this.R,S=this.R_MINOR/g,M=Math.sqrt(1-S*S),V=Math.exp(-r.y/g),ne=Math.PI/2-2*Math.atan(V),ye=0,Se=.1,Me;ye<15&&Math.abs(Se)>1e-7;ye++)Me=M*Math.sin(ne),Me=Math.pow((1-Me)/(1+Me),M/2),Se=Math.PI/2-2*Math.atan(V*Me)-ne,ne+=Se;return new qt(ne*c,r.x*c/g)}},na={__proto__:null,LonLat:ia,Mercator:Es,SphericalMercator:Sn},ra=R({},mn,{code:"EPSG:3395",projection:Es,transformation:function(){var r=.5/(Math.PI*Es.R);return Xn(r,.5,-r,.5)}()}),oa=R({},mn,{code:"EPSG:4326",projection:ia,transformation:Xn(1/180,1,-1/180,.5)}),sa=R({},Tn,{projection:ia,transformation:Xn(1,0,-1,0),scale:function(r){return Math.pow(2,r)},zoom:function(r){return Math.log(r)/Math.LN2},distance:function(r,c){var g=c.lng-r.lng,S=c.lat-r.lat;return Math.sqrt(g*g+S*S)},infinite:!0});Tn.Earth=mn,Tn.EPSG3395=ra,Tn.EPSG3857=So,Tn.EPSG900913=kr,Tn.EPSG4326=oa,Tn.Simple=sa;var Fn=ni.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(r){return r.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(r){return r&&r.removeLayer(this),this},getPane:function(r){return this._map.getPane(r?this.options[r]||r:this.options.pane)},addInteractiveTarget:function(r){return this._map._targets[se(r)]=this,this},removeInteractiveTarget:function(r){return delete this._map._targets[se(r)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(r){var c=r.target;if(c.hasLayer(this)){if(this._map=c,this._zoomAnimated=c._zoomAnimated,this.getEvents){var g=this.getEvents();c.on(g,this),this.once("remove",function(){c.off(g,this)},this)}this.onAdd(c),this.fire("add"),c.fire("layeradd",{layer:this})}}});oi.include({addLayer:function(r){if(!r._layerAdd)throw new Error("The provided object is not a Layer.");var c=se(r);return this._layers[c]?this:(this._layers[c]=r,r._mapToAdd=this,r.beforeAdd&&r.beforeAdd(this),this.whenReady(r._layerAdd,r),this)},removeLayer:function(r){var c=se(r);return this._layers[c]?(this._loaded&&r.onRemove(this),delete this._layers[c],this._loaded&&(this.fire("layerremove",{layer:r}),r.fire("remove")),r._map=r._mapToAdd=null,this):this},hasLayer:function(r){return se(r)in this._layers},eachLayer:function(r,c){for(var g in this._layers)r.call(c,this._layers[g]);return this},_addLayers:function(r){r=r?Dt(r)?r:[r]:[];for(var c=0,g=r.length;c<g;c++)this.addLayer(r[c])},_addZoomLimit:function(r){(!isNaN(r.options.maxZoom)||!isNaN(r.options.minZoom))&&(this._zoomBoundLayers[se(r)]=r,this._updateZoomLevels())},_removeZoomLimit:function(r){var c=se(r);this._zoomBoundLayers[c]&&(delete this._zoomBoundLayers[c],this._updateZoomLevels())},_updateZoomLevels:function(){var r=1/0,c=-1/0,g=this._getZoomSpan();for(var S in this._zoomBoundLayers){var M=this._zoomBoundLayers[S].options;r=M.minZoom===void 0?r:Math.min(r,M.minZoom),c=M.maxZoom===void 0?c:Math.max(c,M.maxZoom)}
8this._layersMaxZoom=c===-1/0?void 0:c,this._layersMinZoom=r===1/0?void 0:r,g!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Pr=Fn.extend({initialize:function(r,c){ze(this,c),this._layers={};var g,S;if(r)for(g=0,S=r.length;g<S;g++)this.addLayer(r[g])},addLayer:function(r){var c=this.getLayerId(r);return this._layers[c]=r,this._map&&this._map.addLayer(r),this},removeLayer:function(r){var c=r in this._layers?r:this.getLayerId(r);return this._map&&this._layers[c]&&this._map.removeLayer(this._layers[c]),delete this._layers[c],this},hasLayer:function(r){var c=typeof r=="number"?r:this.getLayerId(r);return c in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(r){var c=Array.prototype.slice.call(arguments,1),g,S;for(g in this._layers)S=this._layers[g],S[r]&&S[r].apply(S,c);return this},onAdd:function(r){this.eachLayer(r.addLayer,r)},onRemove:function(r){this.eachLayer(r.removeLayer,r)},eachLayer:function(r,c){for(var g in this._layers)r.call(c,this._layers[g]);return this},getLayer:function(r){return this._layers[r]},getLayers:function(){var r=[];return this.eachLayer(r.push,r),r},setZIndex:function(r){return this.invoke("setZIndex",r)},getLayerId:function(r){return se(r)}}),Cs=function(r,c){return new Pr(r,c)},Nn=Pr.extend({addLayer:function(r){return this.hasLayer(r)?this:(r.addEventParent(this),Pr.prototype.addLayer.call(this,r),this.fire("layeradd",{layer:r}))},removeLayer:function(r){return this.hasLayer(r)?(r in this._layers&&(r=this._layers[r]),r.removeEventParent(this),Pr.prototype.removeLayer.call(this,r),this.fire("layerremove",{layer:r})):this},setStyle:function(r){return this.invoke("setStyle",r)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var r=new Lt;for(var c in this._layers){var g=this._layers[c];r.extend(g.getBounds?g.getBounds():g.getLatLng())}return r}}),Rl=function(r,c){return new Nn(r,c)},ao=ft.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(r){ze(this,r)},createIcon:function(r){return this._createIcon("icon",r)},createShadow:function(r){return this._createIcon("shadow",r)},_createIcon:function(r,c){var g=this._getIconUrl(r);if(!g){if(r==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var S=this._createImg(g,c&&c.tagName==="IMG"?c:null);return this._setIconStyles(S,r),(this.options.crossOrigin||this.options.crossOrigin==="")&&(S.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),S},_setIconStyles:function(r,c){var g=this.options,S=g[c+"Size"];typeof S=="number"&&(S=[S,S]);var M=mt(S),V=mt(c==="shadow"&&g.shadowAnchor||g.iconAnchor||M&&M.divideBy(2,!0));r.className="leaflet-marker-"+c+" "+(g.className||""),V&&(r.style.marginLeft=-V.x+"px",r.style.marginTop=-V.y+"px"),M&&(r.style.width=M.x+"px",r.style.height=M.y+"px")},_createImg:function(r,c){return c=c||document.createElement("img"),c.src=r,c},_getIconUrl:function(r){return _e.retina&&this.options[r+"RetinaUrl"]||this.options[r+"Url"]}});function Bl(r){return new ao(r)}var os=ao.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(r){return typeof os.imagePath!="string"&&(os.imagePath=this._detectIconPath()),(this.options.imagePath||os.imagePath)+ao.prototype._getIconUrl.call(this,r)},_stripUrl:function(r){var c=function(g,S,M){var V=S.exec(g);return V&&V[M]};return r=c(r,/^url\((['"])?(.+)\1\)$/,2),r&&c(r,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var r=Bt("div","leaflet-default-icon-path",document.body),c=bs(r,"background-image")||bs(r,"backgroundImage");if(document.body.removeChild(r),c=this._stripUrl(c),c)return c;var g=document.querySelector('link[href$="leaflet.css"]');return g?g.href.substring(0,g.href.length-11-1):""}}),Ms=Sr.extend({initialize:function(r){this._marker=r},addHooks:function(){var r=this._marker._icon;this._draggable||(this._draggable=new hr(r,r,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),kt(r,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Ot(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(r){var c=this._marker,g=c._map,S=this._marker.options.autoPanSpeed,M=this._marker.options.autoPanPadding,V=wr
vendor: 9,200 bytes, line 8
8(c._icon),ne=g.getPixelBounds(),ye=g.getPixelOrigin(),Se=ci(ne.min._subtract(ye).add(M),ne.max._subtract(ye).subtract(M));if(!Se.contains(V)){var Me=mt((Math.max(Se.max.x,V.x)-Se.max.x)/(ne.max.x-Se.max.x)-(Math.min(Se.min.x,V.x)-Se.min.x)/(ne.min.x-Se.min.x),(Math.max(Se.max.y,V.y)-Se.max.y)/(ne.max.y-Se.max.y)-(Math.min(Se.min.y,V.y)-Se.min.y)/(ne.min.y-Se.min.y)).multiplyBy(S);g.panBy(Me,{animate:!1}),this._draggable._newPos._add(Me),this._draggable._startPos._add(Me),Oi(c._icon,this._draggable._newPos),this._onDrag(r),this._panRequest=xt(this._adjustPan.bind(this,r))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(r){this._marker.options.autoPan&&(rt(this._panRequest),this._panRequest=xt(this._adjustPan.bind(this,r)))},_onDrag:function(r){var c=this._marker,g=c._shadow,S=wr(c._icon),M=c._map.layerPointToLatLng(S);g&&Oi(g,S),c._latlng=M,r.latlng=M,r.oldLatLng=this._oldLatLng,c.fire("move",r).fire("drag",r)},_onDragEnd:function(r){rt(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",r)}}),ss=Fn.extend({options:{icon:new os,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(r,c){ze(this,c),this._latlng=Vt(r)},onAdd:function(r){this._zoomAnimated=this._zoomAnimated&&r.options.markerZoomAnimation,this._zoomAnimated&&r.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(r){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&r.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(r){var c=this._latlng;return this._latlng=Vt(r),this.update(),this.fire("move",{oldLatLng:c,latlng:this._latlng})},setZIndexOffset:function(r){return this.options.zIndexOffset=r,this.update()},getIcon:function(){return this.options.icon},setIcon:function(r){return this.options.icon=r,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var r=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(r)}return this},_initIcon:function(){var r=this.options,c="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),g=r.icon.createIcon(this._icon),S=!1;g!==this._icon&&(this._icon&&this._removeIcon(),S=!0,r.title&&(g.title=r.title),g.tagName==="IMG"&&(g.alt=r.alt||"")),kt(g,c),r.keyboard&&(g.tabIndex="0",g.setAttribute("role","button")),this._icon=g,r.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Ft(g,"focus",this._panOnFocus,this);var M=r.icon.createShadow(this._shadow),V=!1;M!==this._shadow&&(this._removeShadow(),V=!0),M&&(kt(M,c),M.alt=""),this._shadow=M,r.opacity<1&&this._updateOpacity(),S&&this.getPane().appendChild(this._icon),this._initInteraction(),M&&V&&this.getPane(r.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&bi(this._icon,"focus",this._panOnFocus,this),Ht(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Ht(this._shadow),this._shadow=null},_setPos:function(r){this._icon&&Oi(this._icon,r),this._shadow&&Oi(this._shadow,r),this._zIndex=r.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(r){this._icon&&(this._icon.style.zIndex=this._zIndex+r)},_animateZoom:function(r){var c=this._map._latLngToNewLayerPoint(this._latlng,r.zoom,r.center).round();this._setPos(c)},_initInteraction:function(){if(this.options.interactive&&(kt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ms)){var r=this.options.draggable;this.dragging&&(r=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ms(this),r&&this.dragging.enable()}},setOpacity:function(r){return this.options.opacity=r,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var r=this.options.opacity;this._icon&&Pn(this._icon,r),this._shadow&&Pn(this._shadow,r)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var r=this._map;if(r){var c=this.options.icon.options,g=c.iconSize?mt(c.iconSize):mt(0,0),S=c.iconAnchor?mt(c.iconAnchor):mt(0,0);r.panInside(this._latlng,{paddingTopLeft:S,paddingBottomRight:g.subtract(S)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function nl(r,c){return new ss(r,c)}var Or=Fn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(r){this._renderer=r.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(r){return ze(this,r),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&r&&Object.prototype.hasOwnProperty.call(r,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),lo=Or.extend({options:{fill:!0,radius:10},initialize:function(r,c){ze(this,c),this._latlng=Vt(r),this._radius=this.options.radius},setLatLng:function(r){var c=this._latlng;return this._latlng=Vt(r),this.redraw(),this.fire("move",{oldLatLng:c,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(r){return this.options.radius=this._radius=r,this.redraw()},getRadius:function(){return this._radius},setStyle:function(r){var c=r&&r.radius||this._radius;return Or.prototype.setStyle.call(this,r),this.setRadius(c),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var r=this._radius,c=this._radiusY||r,g=this._clickTolerance(),S=[r+g,c+g];this._pxBounds=new Mt(this._point.subtract(S),this._point.add(S))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(r){return r.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function aa(r,c){return new lo(r,c)}var as=lo.extend({initialize:function(r,c,g){if(typeof c=="number"&&(c=R({},g,{radius:c})),ze(this,c),this._latlng=Vt(r),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(r){return this._mRadius=r,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var r=[this._radius,this._radiusY||this._radius];return new Lt(this._map.layerPointToLatLng(this._point.subtract(r)),this._map.layerPointToLatLng(this._point.add(r)))},setStyle:Or.prototype.setStyle,_project:function(){var r=this._latlng.lng,c=this._latlng.lat,g=this._map,S=g.options.crs;if(S.distance===mn.distance){var M=Math.PI/180,V=this._mRadius/mn.R/M,ne=g.project([c+V,r]),ye=g.project([c-V,r]),Se=ne.add(ye).divideBy(2),Me=g.unproject(Se).lat,Ke=Math.acos((Math.cos(V*M)-Math.sin(c*M)*Math.sin(Me*M))/(Math.cos(c*M)*Math.cos(Me*M)))/M;(isNaN(Ke)||Ke===0)&&(Ke=V/Math.cos(Math.PI/180*c)),this._point=Se.subtract(g.getPixelOrigin()),this._radius=isNaN(Ke)?0:Se.x-g.project([Me,r-Ke]).x,this._radiusY=Se.y-ne.y}else{var At=S.unproject(S.project(this._latlng).subtract([this._mRadius,0]));this._point=g.latLngToLayerPoint(this._latlng),this._radius=this._point.x-g.latLngToLayerPoint(At).x}this._updateBounds()}});function rl(r,c,g){return new as(r,c,g)}var ui=Or.extend({options:{smoothFactor:1,noClip:!1},initialize:function(r,c){ze(this,c),this._setLatLngs(r)},getLatLngs:function(){return this._latlngs},setLatLngs:function(r){return this._setLatLngs(r),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(r){for(var c=1/0,g=null,S=Zt,M,V,ne=0,ye=this._parts.length;ne<ye;ne++)for(var Se=this._parts[ne],Me=1,Ke=Se.length;Me<Ke;Me++){M=Se[Me-1],V=Se[Me];var At=S(r,M,V,!0);At<c&&(c=At,g=S(r,M,V))}return g&&(g.distance=Math.sqrt(c)),g}
8,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Ai(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(r,c){return c=c||this._defaultShape(),r=Vt(r),c.push(r),this._bounds.extend(r),this.redraw()},_setLatLngs:function(r){this._bounds=new Lt,this._latlngs=this._convertLatLngs(r)},_defaultShape:function(){return Yi(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(r){for(var c=[],g=Yi(r),S=0,M=r.length;S<M;S++)g?(c[S]=Vt(r[S]),this._bounds.extend(c[S])):c[S]=this._convertLatLngs(r[S]);return c},_project:function(){var r=new Mt;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,r),this._bounds.isValid()&&r.isValid()&&(this._rawPxBounds=r,this._updateBounds())},_updateBounds:function(){var r=this._clickTolerance(),c=new et(r,r);this._rawPxBounds&&(this._pxBounds=new Mt([this._rawPxBounds.min.subtract(c),this._rawPxBounds.max.add(c)]))},_projectLatlngs:function(r,c,g){var S=r[0]instanceof qt,M=r.length,V,ne;if(S){for(ne=[],V=0;V<M;V++)ne[V]=this._map.latLngToLayerPoint(r[V]),g.extend(ne[V]);c.push(ne)}else for(V=0;V<M;V++)this._projectLatlngs(r[V],c,g)},_clipPoints:function(){var r=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(r))){if(this.options.noClip){this._parts=this._rings;return}var c=this._parts,g,S,M,V,ne,ye,Se;for(g=0,M=0,V=this._rings.length;g<V;g++)for(Se=this._rings[g],S=0,ne=Se.length;S<ne-1;S++)ye=ta(Se[S],Se[S+1],r,S,!0),ye&&(c[M]=c[M]||[],c[M].push(ye[0]),(ye[1]!==Se[S+1]||S===ne-2)&&(c[M].push(ye[1]),M++))}},_simplifyPoints:function(){for(var r=this._parts,c=this.options.smoothFactor,g=0,S=r.length;g<S;g++)r[g]=Ca(r[g],c)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(r,c){var g,S,M,V,ne,ye,Se=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(r))return!1;for(g=0,V=this._parts.length;g<V;g++)for(ye=this._parts[g],S=0,ne=ye.length,M=ne-1;S<ne;M=S++)if(!(!c&&S===0)&&ea(r,ye[M],ye[S])<=Se)return!0;return!1}});function Do(r,c){return new ui(r,c)}ui._flat=Mi;var Wi=ui.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length}
8,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Qs(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(r){var c=ui.prototype._convertLatLngs.call(this,r),g=c.length;return g>=2&&c[0]instanceof qt&&c[0].equals(c[g-1])&&c.pop(),c},_setLatLngs:function(r){ui.prototype._setLatLngs.call(this,r),Yi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Yi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var r=this._renderer._bounds,c=this.options.weight,g=new et(c,c);if(r=new Mt(r.min.subtract(g),r.max.add(g)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(r))){if(this.options.noClip){this._parts=this._rings;return}for(var S=0,M=this._rings.length,V;S<M;S++)V=Js(this._rings[S],r,!0),V.length&&this._parts.push(V)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(r){var c=!1,g,S,M,V,ne,ye,Se,Me;if(!this._pxBounds||!this._pxBounds.contains(r))return!1;for(V=0,Se=this._parts.length;V<Se;V++)for(g=this._parts[V],ne=0,Me=g.length,ye=Me-1;ne<Me;ye=ne++)S=g[ne],M=g[ye],S.y>r.y!=M.y>r.y&&r.x<(M.x-S.x)*(r.y-S.y)/(M.y-S.y)+S.x&&(c=!c);return c||ui.prototype._containsPoint.call(this,r,!0)}});function ls(r,c){return new Wi(r,c)}var Un=Nn.extend({initialize:function(r,c){ze(this,c),this._layers={},r&&this.addData(r)},addData:function(r){var c=Dt(r)?r:r.features,g,S,M;if(c){for(g=0,S=c.length;g<S;g++)M=c[g],(M.geometries||M.geometry||M.features||M.coordinates)&&this.addData(M);return this}var V=this.options;if(V.filter&&!V.filter(r))return this;var ne=Ro(r,V);return ne?(ne.feature=zs(r),ne.defaultOptions=ne.options,this.resetStyle(ne),V.onEachFeature&&V.onEachFeature(r,ne),this.addLayer(ne)):this},resetStyle:function(r){return r===void 0?this.eachLayer(this.resetStyle,this):(r.options=R({},r.defaultOptions),this._setLayerStyle(r,this.options.style),this)},setStyle:function(r){return this.eachLayer(function(c){this._setLayerStyle(c,r)},this)},_setLayerStyle:function(r,c){r.setStyle&&(typeof c=="function"&&(c=c(r.feature)),r.setStyle(c))}});function Ro(r,c){var g=r.type==="Feature"?r.geometry:r,S=g?g.coordinates:null,M=[],V=c&&c.pointToLayer,ne=c&&c.coordsToLatLng||Bo,ye,Se,Me,Ke;if(!S&&!g)return null;switch(g.type){case"Point":return ye=ne(S),co(V,r,ye,c);case"MultiPoint":for(Me=0,Ke=S.length;Me<Ke;Me++)ye=ne(S[Me]),M.push(co(V,r,ye,c));return new Nn(M);case"LineString":case"MultiLineString":return Se=Fr(S,g.type==="LineString"?0:1,ne),new ui(Se,c);case"Polygon":case"MultiPolygon":return Se=Fr(S,g.type==="Polygon"?1:2,ne),new Wi(Se,c);case"GeometryCollection":for(Me=0,Ke=g.geometries.length;Me<Ke;Me++){var At=Ro({geometry:g.geometries[Me],type:"Feature",properties:r.properties},c);At&&M.push(At)}return new Nn(M);case"FeatureCollection":for(Me=0,Ke=g.features.length;Me<Ke;Me++){var Xt=Ro(g.features[Me],c);Xt&&M.push(Xt)}return new Nn(M);default:throw new Error("Invalid GeoJSON object.")}}function co(r,c,g,S){return r?r(c,g):new ss(g,S&&S.markersInheritOptions&&S)}function Bo(r){return new qt(r[1],r[0],r[2])}function Fr(r,c,g){for(var S=[],M=0,V=r.length,ne;M<V;M++)ne=c?Fr(r[M],c-1,g):(g||Bo)(r[M]),S.push(ne);return S}function la(r,c){return r=Vt(r),r.alt!==void 0?[pe(r.lng,c),pe(r.lat,c),pe(r.alt,c)]:[pe(r.lng,c),pe(r.lat,c)]}function ks(r,c,g,S){for(var M=[],V=0,ne=r.length;V<ne;V++)M.push(c?ks(r[V],Yi(r[V])?0:c-1,g,S):la(r[V],S));return!c&&g&&M.length>0&&M.push(M[0].slice()),M}function Oo(r,c){return r.feature?R({},r.feature,{geometry:c}):zs(c)}function zs(r){return r.type==="Feature"||r.type==="FeatureCollection"?r:{type:"Feature",properties:{},geometry:r}}var ca={toGeoJSON:function(r){return Oo(this,{type:"Point",coordinates:la(this.getLatLng(),r)})}};ss.include(ca),as.include(ca),lo.include(ca),ui.include({toGeoJSON:function(r){var c=!Yi(this._latlngs),g=ks(this._latlngs,c?1:0,!1,r);return Oo(this,{type:(c?"Multi":"")+"LineString",coordinates:g})}}),Wi.include({toGeoJSON:function(r){var c=!Yi(this._latlngs),g=c&&!Yi(this._latlngs[0]),S=ks(this._latlngs,g?2:c?1:0,!0,r);return c||(S=[S]),Oo(this,{type:(g?"Multi":"")+"Polygon",coordinates:S})}}),Pr.include({toMultiPoint:function(r){var c=[];return this.eachLayer(function(g){c.push(g.toGeoJSON(r).geometry.coordinates)}),Oo(this,{type:"MultiPoint",coordinates:c})},toGeoJSON:function(r){var c=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(c==="MultiPoint")return this.toMultiPoint(r);var g=c==="GeometryCollection",S=[];return this.eachLayer(function(M){if(M.toGeoJSON){var V=M.toGeoJSON(r);if(g)S.push(V.geometry);else{var ne=zs(V);ne.type==="FeatureCollection"?S.push.apply(S,ne.features):S.push(ne)}}}),g?Oo(this,{geometries:S,type:"GeometryCollection"}):{type:"FeatureCollection",features:S}}});function dr(r,c){return new Un(r,c)}var Ds=dr,fn=Fn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(r,c,g){this._url=r,this._bounds=$t(c),ze(this,g)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(kt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Ht(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(r){return this.options.opacity=r,this._image&&this._updateOpacity(),this},setStyle:function(r){return r.opacity&&this.setOpacity(r.opacity),this},bringToFront:function(){return this._map&&ur(this._image),this},bringToBack:function(){return this._map&&vi(this._image),this},setUrl:function(r){return this._url=r,this._image&&(this._image.src=r),this},setBounds:function(r){return this._bounds=$t(r),this._map&&this._reset(),this},getEvents:function(){var r={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(r.zoomanim=this._animateZoom),r},setZIndex:function(r){return this.options.zIndex=r,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var r=this._url.tagName==="IMG",c=this._image=r?this._url:Bt("img");if(kt(c,"leaflet-image-layer"),this._zoomAnimated&&kt(c,"leaflet-zoom-animated"),this.options.className&&kt(c,this.options.className),c.onselectstart=ve,c.onmousemove=ve,c.onload=$(this.fire,this,"load"),c.onerror=$(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),r){this._url=c.src;return}c.src=this._url,c.alt=this.options.alt},_animateZoom:function(r){var c=this._map.getZoomScale(r.zoom),g=this._map._latLngBoundsToNewLayerBounds(this._bounds,r.zoom,r.center).min;Br(this._image,g,c)},_reset:function(){var r=this._image,c=new Mt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),g=c.getSize();Oi(r,c.min),r.style.width=g.x+"px",r.style.height=g.y+"px"},_updateOpacity:function(){Pn(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var r=this.options.errorOverlayUrl;r&&this._url!==r&&(this._url=r,this._image.src=r)},getCenter:function(){return this._bounds.getCenter()}}),Rs=function(r,c,g){return new fn(r,c,g)},ka=fn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInl
vendor: 8,913 bytes, line 8
8ine:!0},_initImage:function(){var r=this._url.tagName==="VIDEO",c=this._image=r?this._url:Bt("video");if(kt(c,"leaflet-image-layer"),this._zoomAnimated&&kt(c,"leaflet-zoom-animated"),this.options.className&&kt(c,this.options.className),c.onselectstart=ve,c.onmousemove=ve,c.onloadeddata=$(this.fire,this,"load"),r){for(var g=c.getElementsByTagName("source"),S=[],M=0;M<g.length;M++)S.push(g[M].src);this._url=g.length>0?S:[c.src];return}Dt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(c.style,"objectFit")&&(c.style.objectFit="fill"),c.autoplay=!!this.options.autoplay,c.loop=!!this.options.loop,c.muted=!!this.options.muted,c.playsInline=!!this.options.playsInline;for(var V=0;V<this._url.length;V++){var ne=Bt("source");ne.src=this._url[V],c.appendChild(ne)}}});function ol(r,c,g){return new ka(r,c,g)}var za=fn.extend({_initImage:function(){var r=this._image=this._url;kt(r,"leaflet-image-layer"),this._zoomAnimated&&kt(r,"leaflet-zoom-animated"),this.options.className&&kt(r,this.options.className),r.onselectstart=ve,r.onmousemove=ve}});function Nr(r,c,g){return new za(r,c,g)}var pr=Fn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(r,c){r&&(r instanceof qt||Dt(r))?(this._latlng=Vt(r),ze(this,c)):(ze(this,r),this._source=c),this.options.content&&(this._content=this.options.content)},openOn:function(r){return r=arguments.length?r:this._source._map,r.hasLayer(this)||r.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(r){return this._map?this.close():(arguments.length?this._source=r:r=this._source,this._prepareOpen(),this.openOn(r._map)),this},onAdd:function(r){this._zoomAnimated=r._zoomAnimated,this._container||this._initLayout(),r._fadeAnimated&&Pn(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),r._fadeAnimated&&Pn(this._container,1),this.bringToFront(),this.options.interactive&&(kt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(r){r._fadeAnimated?(Pn(this._container,0),this._removeTimeout=setTimeout($(Ht,void 0,this._container),200)):Ht(this._container),this.options.interactive&&(Ot(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(r){return this._latlng=Vt(r),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(r){return this._content=r,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var r={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(r.zoomanim=this._animateZoom),r},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ur(this._container),this},bringToBack:function(){return this._map&&vi(this._container),this},_prepareOpen:function(r){var c=this._source;if(!c._map)return!1;if(c instanceof Nn){c=null;var g=this._source._layers;for(var S in g)if(g[S]._map){c=g[S];break}if(!c)return!1;this._source=c}if(!r)if(c.getCenter)r=c.getCenter();else if(c.getLatLng)r=c.getLatLng();else if(c.getBounds)r=c.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(r),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var r=this._contentNode,c=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof c=="string")r.innerHTML=c;else{for(;r.hasChildNodes();)r.removeChild(r.firstChild);r.appendChild(c)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var r=this._map.latLngToLayerPoint(this._latlng),c=mt(this.options.offset),g=this._getAnchor();this._zoomAnimated?Oi(this._container,r.add(g)):c=c.add(r).add(g);var S=this._containerBottom=-c.y,M=this._containerLeft=-Math.round(this._containerWidth/2)+c.x;this._container.style.bottom=S+"px",this._container.style.left=M+"px"}},_getAnchor:function(){return[0,0]}});oi.include({_initOverlay:function(r,c,g,S){var M=c;return M instanceof r||(M=new r(S).setContent(c)),g&&M.setLatLng(g),M}}),Fn.include({_initOverlay:function(r,c,g,S){var M=g;return M instanceof r?(ze(M,S),M._source=this):(M=c&&!S?c:new r(S,this),M.setContent(g)),M}});var yn=pr.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(r){return r=arguments.length?r:this._source._map,!r.hasLayer(this)&&r._popup&&r._popup.options.autoClose&&r.removeLayer(r._popup),r._popup=this,pr.prototype.openOn.call(this,r)},onAdd:function(r){pr.prototype.onAdd.call(this,r),r.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Or||this._source.on("preclick",Tr))},onRemove:function(r){pr.prototype.onRemove.call(this,r),r.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Or||this._source.off("preclick",Tr))},getEvents:function(){var r=pr.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(r.preclick=this.close),this.options.keepInView&&(r.moveend=this._adjustPan),r},_initLayout:function(){var r="leaflet-popup",c=this._container=Bt("div",r+" "+(this.options.className||"")+" leaflet-zoom-animated"),g=this._wrapper=Bt("div",r+"-content-wrapper",c);if(this._contentNode=Bt("div",r+"-content",g),oo(c),Co(this._contentNode),Ft(c,"contextmenu",Tr),this._tipContainer=Bt("div",r+"-tip-container",c),this._tip=Bt("div",r+"-tip",this._tipContainer),this.options.closeButton){var S=this._closeButton=Bt("a",r+"-close-button",c);S.setAttribute("role","button"),S.setAttribute("aria-label","Close popup"),S.href="#close",S.innerHTML='<span aria-hidden="true">&#215;</span>',Ft(S,"click",function(M){Ni(M),this.close()},this)}},_updateLayout:function(){var r=this._contentNode,c=r.style;c.width="",c.whiteSpace="nowrap";var g=r.offsetWidth;g=Math.min(g,this.options.maxWidth),g=Math.max(g,this.options.minWidth),c.width=g+1+"px",c.whiteSpace="",c.height="";var S=r.offsetHeight,M=this.options.maxHeight,V="leaflet-popup-scrolled";M&&S>M?(c.height=M+"px",kt(r,V)):Ot(r,V),this._containerWidth=this._container.offsetWidth},_animateZoom:function(r){var c=this._map._latLngToNewLayerPoint(this._latlng,r.zoom,r.center),g=this._getAnchor();Oi(this._container,c.add(g))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var r=this._map,c=parseInt(bs(this._container,"marginBottom"),10)||0,g=this._container.offsetHeight+c,S=this._containerWidth,M=new et(this._containerLeft,-g-this._containerBottom);M._add(wr(this._container));var V=r.layerPointToContainerPoint(M),ne=mt(this.options.autoPanPadding),ye=mt(this.options.autoPanPaddingTopLeft||ne),Se=mt(this.options.autoPanPaddingBottomRight||ne),Me=r.getSize(),Ke=0,At=0;V.x+S+Se.x>Me.x&&(Ke=V.x+S-Me.x+Se.x),V.x-Ke-ye.x<0&&(Ke=V.x-ye.x),V.y+g+Se.y>Me.y&&(At=V.y+g-Me.y+Se.y),V.y-At-ye.y<0&&(At=V.y-ye.y),(Ke||At)&&(this.options.keepInView&&(this._autopanning=!0),r.fire("autopanstart").panBy([Ke,At]))}},_getAnchor:function(){return mt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Ur=function(r,c){return new yn(r,c)};oi.mergeOptions({closePopupOnClick:!0}),oi.include({openPopup:function(r,c,g){return this._initOverlay(yn,r,c,g).openOn(this),this},closePopup:function(r){return r=arguments.length?r:this._popup,r&&r.close(),this}}),Fn.include({bindPopup:function(r,c){return this._popup=this._initOverlay(yn,this._popup,r,c),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(r){return this._popup&&(this instanceof Nn||(this._popup._source=this),this._popup._prepareOpen(r||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1}
8,setPopupContent:function(r){return this._popup&&this._popup.setContent(r),this},getPopup:function(){return this._popup},_openPopup:function(r){if(!(!this._popup||!this._map)){Ln(r);var c=r.layer||r.target;if(this._popup._source===c&&!(c instanceof Or)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(r.latlng);return}this._popup._source=c,this.openPopup(r.latlng)}},_movePopup:function(r){this._popup.setLatLng(r.latlng)},_onKeyPress:function(r){r.originalEvent.keyCode===13&&this._openPopup(r)}});var Fo=pr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(r){pr.prototype.onAdd.call(this,r),this.setOpacity(this.options.opacity),r.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(r){pr.prototype.onRemove.call(this,r),r.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var r=pr.prototype.getEvents.call(this);return this.options.permanent||(r.preclick=this.close),r},_initLayout:function(){var r="leaflet-tooltip",c=r+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Bt("div",c),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+se(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(r){var c,g,S=this._map,M=this._container,V=S.latLngToContainerPoint(S.getCenter()),ne=S.layerPointToContainerPoint(r),ye=this.options.direction,Se=M.offsetWidth,Me=M.offsetHeight,Ke=mt(this.options.offset),At=this._getAnchor();ye==="top"?(c=Se/2,g=Me):ye==="bottom"?(c=Se/2,g=0):ye==="center"?(c=Se/2,g=Me/2):ye==="right"?(c=0,g=Me/2):ye==="left"?(c=Se,g=Me/2):ne.x<V.x?(ye="right",c=0,g=Me/2):(ye="left",c=Se+(Ke.x+At.x)*2,g=Me/2),r=r.subtract(mt(c,g,!0)).add(Ke).add(At),Ot(M,"leaflet-tooltip-right"),Ot(M,"leaflet-tooltip-left"),Ot(M,"leaflet-tooltip-top"),Ot(M,"leaflet-tooltip-bottom"),kt(M,"leaflet-tooltip-"+ye),Oi(M,r)},_updatePosition:function(){var r=this._map.latLngToLayerPoint(this._latlng);this._setPosition(r)},setOpacity:function(r){this.options.opacity=r,this._container&&Pn(this._container,r)},_animateZoom:function(r){var c=this._map._latLngToNewLayerPoint(this._latlng,r.zoom,r.center);this._setPosition(c)},_getAnchor:function(){return mt(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Vr=function(r,c){return new Fo(r,c)};oi.include({openTooltip:function(r,c,g){return this._initOverlay(Fo,r,c,g).openOn(this),this},closeTooltip:function(r){return r.close(),this}}),Fn.include({bindTooltip:function(r,c){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Fo,this._tooltip,r,c),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(r){if(!(!r&&this._tooltipHandlersAdded)){var c=r?"off":"on",g={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?g.add=this._openTooltip:(g.mouseover=this._openTooltip,g.mouseout=this.closeTooltip,g.click=this._openTooltip,this._map?this._addFocusListeners():g.add=this._addFocusListeners),this._tooltip.options.sticky&&(g.mousemove=this._moveTooltip),this[c](g),this._tooltipHandlersAdded=!r}},openTooltip:function(r){return this._tooltip&&(this instanceof Nn||(this._tooltip._source=this),this._tooltip._prepareOpen(r)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(r){return this._tooltip&&this._tooltip.setContent(r),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(r){var c=typeof r.getElement=="function"&&r.getElement();c&&(Ft(c,"focus",function(){this._tooltip._source=r,this.openTooltip()},this),Ft(c,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(r){var c=typeof r.getElement=="function"&&r.getElement();c&&c.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(r){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var c=this;
vendor: 5,582 bytes, line 8
8this._map.once("moveend",function(){c._openOnceFlag=!1,c._openTooltip(r)});return}this._tooltip._source=r.layer||r.target,this.openTooltip(this._tooltip.options.sticky?r.latlng:void 0)}},_moveTooltip:function(r){var c=r.latlng,g,S;this._tooltip.options.sticky&&r.originalEvent&&(g=this._map.mouseEventToContainerPoint(r.originalEvent),S=this._map.containerPointToLayerPoint(g),c=this._map.layerPointToLatLng(S)),this._tooltip.setLatLng(c)}});var Ir=ao.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(r){var c=r&&r.tagName==="DIV"?r:document.createElement("div"),g=this.options;if(g.html instanceof Element?(Io(c),c.appendChild(g.html)):c.innerHTML=g.html!==!1?g.html:"",g.bgPos){var S=mt(g.bgPos);c.style.backgroundPosition=-S.x+"px "+-S.y+"px"}return this._setIconStyles(c,"icon"),c},createShadow:function(){return null}});function Ol(r){return new Ir(r)}ao.Default=os;var No=Fn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:_e.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(r){ze(this,r)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(r){r._addZoomLimit(this)},onRemove:function(r){this._removeAllTiles(),Ht(this._container),r._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ur(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(vi(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(r){return this.options.opacity=r,this._updateOpacity(),this},setZIndex:function(r){return this.options.zIndex=r,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var r=this._clampZoom(this._map.getZoom());r!==this._tileZoom&&(this._tileZoom=r,this._updateLevels()),this._update()}return this},getEvents:function(){var r={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=X(this._onMoveEnd,this.options.updateInterval,this)),r.move=this._onMove),this._zoomAnimated&&(r.zoomanim=this._animateZoom),r},createTile:function(){return document.createElement("div")},getTileSize:function(){var r=this.options.tileSize;return r instanceof et?r:new et(r,r)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(r){for(var c=this.getPane().children,g=-r(-1/0,1/0),S=0,M=c.length,V;S<M;S++)V=c[S].style.zIndex,c[S]!==this._container&&V&&(g=r(g,+V));isFinite(g)&&(this.options.zIndex=g+r(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!_e.ielt9){Pn(this._container,this.options.opacity);var r=+new Date,c=!1,g=!1;for(var S in this._tiles){var M=this._tiles[S];if(!(!M.current||!M.loaded)){var V=Math.min(1,(r-M.loaded)/200);Pn(M.el,V),V<1?c=!0:(M.active?g=!0:this._onOpaqueTile(M),M.active=!0)}}g&&!this._noPrune&&this._pruneTiles(),c&&(rt(this._fadeFrame),this._fadeFrame=xt(this._updateOpacity,this))}},_onOpaqueTile:ve,_initContainer:function(){this._container||(this._container=Bt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var r=this._tileZoom,c=this.options.maxZoom;if(r!==void 0){for(var g in this._levels)g=Number(g),this._levels[g].el.children.length||g===r?(this._levels[g].el.style.zIndex=c-Math.abs(r-g),this._onUpdateLevel(g)):(Ht(this._levels[g].el),this._removeTilesAtZoom(g),this._onRemoveLevel(g),delete this._levels[g]);var S=this._levels[r],M=this._map;return S||(S=this._levels[r]={},S.el=Bt("div","leaflet-tile-container leaflet-zoom-animated",this._container),S.el.style.zIndex=c,S.origin=M.project(M.unproject(M.getPixelOrigin()),r).round(),S.zoom=r,this._setZoomTransform(S,M.getCenter(),M.getZoom()),ve(S.el.offsetWidth),this._onCreateLevel(S)),this._level=S,S}},_onUpdateLevel:ve,_onRemoveLevel:ve,_onCreateLevel:ve,_pruneTiles:function(){if(this._map){var r,c,g=this._map.getZoom();if(g>this.options.maxZoom||g<this.options.minZoom){this._removeAllTiles();return}for(r in this._tiles)c=this._tiles[r],c.retain=c.current;for(r in this._tiles)if(c=this._tiles[r],c.current&&!c.active){var S=c.coords;this._retainParent(S.x,S.y,S.z,S.z-5)||this._retainChildren(S.x,S.y,S.z,S.z+2)}for(r in this._tiles)this._tiles[r].retain||this._removeTile(r)}},_removeTilesAtZoom:function(r){for(var c in this._tiles)this._tiles[c].coords.z===r&&this._removeTile(c)},_removeAllTiles:function(){for(var r in this._tiles)this._removeTile(r)},_invalidateAll:function(){for(var r in this._levels)Ht(this._levels[r].el),this._onRemoveLevel(Number(r)),delete this._levels[r];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(r,c,g,S){var M=Math.floor(r/2),V=Math.floor(c/2),ne=g-1,ye=new et(+M,+V);ye.z=+ne;var Se=this._tileCoordsToKey(ye),Me=this._tiles[Se];return Me&&Me.active?(Me.retain=!0,!0):(Me&&Me.loaded&&(Me.retain=!0),ne>S?this._retainParent(M,V,ne,S):!1)},_retainChildren:function(r,c,g,S){for(var M=2*r;M<2*r+2;M++)for(var V=2*c;V<2*c+2;V++){var ne=new et(M,V);ne.z=g+1;var ye=this._tileCoordsToKey(ne),Se=this._tiles[ye];
vendor: 6,107 bytes, line 8
8if(Se&&Se.active){Se.retain=!0;continue}else Se&&Se.loaded&&(Se.retain=!0);g+1<S&&this._retainChildren(M,V,g+1,S)}},_resetView:function(r){var c=r&&(r.pinch||r.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),c,c)},_animateZoom:function(r){this._setView(r.center,r.zoom,!0,r.noUpdate)},_clampZoom:function(r){var c=this.options;return c.minNativeZoom!==void 0&&r<c.minNativeZoom?c.minNativeZoom:c.maxNativeZoom!==void 0&&c.maxNativeZoom<r?c.maxNativeZoom:r},_setView:function(r,c,g,S){var M=Math.round(c);this.options.maxZoom!==void 0&&M>this.options.maxZoom||this.options.minZoom!==void 0&&M<this.options.minZoom?M=void 0:M=this._clampZoom(M);var V=this.options.updateWhenZooming&&M!==this._tileZoom;(!S||V)&&(this._tileZoom=M,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),M!==void 0&&this._update(r),g||this._pruneTiles(),this._noPrune=!!g),this._setZoomTransforms(r,c)},_setZoomTransforms:function(r,c){for(var g in this._levels)this._setZoomTransform(this._levels[g],r,c)},_setZoomTransform:function(r,c,g){var S=this._map.getZoomScale(g,r.zoom),M=r.origin.multiplyBy(S).subtract(this._map._getNewPixelOrigin(c,g)).round();_e.any3d?Br(r.el,M,S):Oi(r.el,M)},_resetGrid:function(){var r=this._map,c=r.options.crs,g=this._tileSize=this.getTileSize(),S=this._tileZoom,M=this._map.getPixelWorldBounds(this._tileZoom);M&&(this._globalTileRange=this._pxBoundsToTileRange(M)),this._wrapX=c.wrapLng&&!this.options.noWrap&&[Math.floor(r.project([0,c.wrapLng[0]],S).x/g.x),Math.ceil(r.project([0,c.wrapLng[1]],S).x/g.y)],this._wrapY=c.wrapLat&&!this.options.noWrap&&[Math.floor(r.project([c.wrapLat[0],0],S).y/g.x),Math.ceil(r.project([c.wrapLat[1],0],S).y/g.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(r){var c=this._map,g=c._animatingZoom?Math.max(c._animateToZoom,c.getZoom()):c.getZoom(),S=c.getZoomScale(g,this._tileZoom),M=c.project(r,this._tileZoom).floor(),V=c.getSize().divideBy(S*2);return new Mt(M.subtract(V),M.add(V))},_update:function(r){var c=this._map;if(c){var g=this._clampZoom(c.getZoom());if(r===void 0&&(r=c.getCenter()),this._tileZoom!==void 0){var S=this._getTiledPixelBounds(r),M=this._pxBoundsToTileRange(S),V=M.getCenter(),ne=[],ye=this.options.keepBuffer,Se=new Mt(M.getBottomLeft().subtract([ye,-ye]),M.getTopRight().add([ye,-ye]));if(!(isFinite(M.min.x)&&isFinite(M.min.y)&&isFinite(M.max.x)&&isFinite(M.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Me in this._tiles){var Ke=this._tiles[Me].coords;(Ke.z!==this._tileZoom||!Se.contains(new et(Ke.x,Ke.y)))&&(this._tiles[Me].current=!1)}if(Math.abs(g-this._tileZoom)>1){this._setView(r,g);return}for(var At=M.min.y;At<=M.max.y;At++)for(var Xt=M.min.x;Xt<=M.max.x;Xt++){var xi=new et(Xt,At);if(xi.z=this._tileZoom,!!this._isValidTile(xi)){var Zi=this._tiles[this._tileCoordsToKey(xi)];Zi?Zi.current=!0:ne.push(xi)}}if(ne.sort(function(Je,Er){return Je.distanceTo(V)-Er.distanceTo(V)}),ne.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Ge=document.createDocumentFragment();for(Xt=0;Xt<ne.length;Xt++)this._addTile(ne[Xt],Ge);this._level.el.appendChild(Ge)}}}},_isValidTile:function(r){var c=this._map.options.crs;if(!c.infinite){var g=this._globalTileRange;if(!c.wrapLng&&(r.x<g.min.x||r.x>g.max.x)||!c.wrapLat&&(r.y<g.min.y||r.y>g.max.y))return!1}if(!this.options.bounds)return!0;var S=this._tileCoordsToBounds(r);return $t(this.options.bounds).overlaps(S)},_keyToBounds:function(r){return this._tileCoordsToBounds(this._keyToTileCoords(r))},_tileCoordsToNwSe:function(r){var c=this._map,g=this.getTileSize(),S=r.scaleBy(g),M=S.add(g),V=c.unproject(S,r.z),ne=c.unproject(M,r.z);return[V,ne]},_tileCoordsToBounds:function(r){var c=this._tileCoordsToNwSe(r),g=new Lt(c[0],c[1]);return this.options.noWrap||(g=this._map.wrapLatLngBounds(g)),g},_tileCoordsToKey:function(r){return r.x+":"+r.y+":"+r.z},_keyToTileCoords:function(r){var c=r.split(":"),g=new et(+c[0],+c[1]);return g.z=+c[2],g},_removeTile:function(r){var c=this._tiles[r];c&&(Ht(c.el),delete this._tiles[r],this.fire("tileunload",{tile:c.el,coords:this._keyToTileCoords(r)}))},_initTile:function(r){kt(r,"leaflet-tile");var c=this.getTileSize();r.style.width=c.x+"px",r.style.height=c.y+"px",r.onselectstart=ve,r.onmousemove=ve,_e.ielt9&&this.options.opacity<1&&Pn(r,this.options.opacity)},_addTile:function(r,c){var g=this._getTilePos(r),S=this._tileCoordsToKey(r),M=this.createTile(this._wrapCoords(r),$(this._tileReady,this,r));this._initTile(M),this.createTile.length<2&&xt($(this._tileReady,this,r,null,M)),Oi(M,g),this._tiles[S]={el:M,coords:r,current:!0},c.appendChild(M),this.fire("tileloadstart",{tile:M,coords:r})},_tileReady:function(r,c,g){c&&this.fire("tileerror",{error:c,tile:g,coords:r});var S=this._tileCoordsToKey(r);g=this._tiles[S],g&&(g.loaded=+new Date,this._map._fadeAnimated?(Pn(g.el,0),rt(this._fadeFrame),this._fadeFrame=xt(this._updateOpacity,this)):(g.active=!0,this._pruneTiles()),c||(kt(g.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:g.el,coords:r})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),_e.ielt9||!this._map._fadeAnimated?xt(this._pruneTiles,this):setTimeout($(this._pruneTiles,this),250)))},_getTilePos:function(r){return r.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(r){var c=new et(this._wrapX?ge(r.x,this._wrapX):r.x,this._wrapY?ge(r.y,this._wrapY):r.y);return c.z=r.z,c},_pxBoundsToTileRange:function(r){var c=this.getTileSize();return new Mt(r.min.unscaleBy(c).floor(),r.max.unscaleBy(c).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var r in this._tiles)if(!this._tiles[r].loaded)return!1;return!0}});function sl(r){return new No(r)}var Zr=No.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(r,c){this._url=r,c=ze(this,c),c.detectRetina&&_e.retina&&c.maxZoom>0?(c.tileSize=Math.floor(c.tileSize/2),c.zoomReverse?(c.zoomOffset--,c.minZoom=Math.min(c.maxZoom,c.minZ
vendor: 4,681 bytes, line 8
8oom+1)):(c.zoomOffset++,c.maxZoom=Math.max(c.minZoom,c.maxZoom-1)),c.minZoom=Math.max(0,c.minZoom)):c.zoomReverse?c.minZoom=Math.min(c.maxZoom,c.minZoom):c.maxZoom=Math.max(c.minZoom,c.maxZoom),typeof c.subdomains=="string"&&(c.subdomains=c.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(r,c){return this._url===r&&c===void 0&&(c=!0),this._url=r,c||this.redraw(),this},createTile:function(r,c){var g=document.createElement("img");return Ft(g,"load",$(this._tileOnLoad,this,c,g)),Ft(g,"error",$(this._tileOnError,this,c,g)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(g.referrerPolicy=this.options.referrerPolicy),g.alt="",g.src=this.getTileUrl(r),g},getTileUrl:function(r){var c={r:_e.retina?"@2x":"",s:this._getSubdomain(r),x:r.x,y:r.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var g=this._globalTileRange.max.y-r.y;this.options.tms&&(c.y=g),c["-y"]=g}return zt(this._url,R(c,this.options))},_tileOnLoad:function(r,c){_e.ielt9?setTimeout($(r,this,null,c),0):r(null,c)},_tileOnError:function(r,c,g){var S=this.options.errorTileUrl;S&&c.getAttribute("src")!==S&&(c.src=S),r(g,c)},_onTileRemove:function(r){r.tile.onload=null},_getZoomForUrl:function(){var r=this._tileZoom,c=this.options.maxZoom,g=this.options.zoomReverse,S=this.options.zoomOffset;return g&&(r=c-r),r+S},_getSubdomain:function(r){var c=Math.abs(r.x+r.y)%this.options.subdomains.length;return this.options.subdomains[c]},_abortLoading:function(){var r,c;for(r in this._tiles)if(this._tiles[r].coords.z!==this._tileZoom&&(c=this._tiles[r].el,c.onload=ve,c.onerror=ve,!c.complete)){c.src=Xe;var g=this._tiles[r].coords;Ht(c),delete this._tiles[r],this.fire("tileabort",{tile:c,coords:g})}},_removeTile:function(r){var c=this._tiles[r];if(c)return c.el.setAttribute("src",Xe),No.prototype._removeTile.call(this,r)},_tileReady:function(r,c,g){if(!(!this._map||g&&g.getAttribute("src")===Xe))return No.prototype._tileReady.call(this,r,c,g)}});function Uo(r,c){return new Zr(r,c)}var Lr=Zr.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(r,c){this._url=r;var g=R({},this.defaultWmsParams);for(var S in c)S in this.options||(g[S]=c[S]);c=ze(this,c);var M=c.detectRetina&&_e.retina?2:1,V=this.getTileSize();g.width=V.x*M,g.height=V.y*M,this.wmsParams=g},onAdd:function(r){this._crs=this.options.crs||r.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var c=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[c]=this._crs.code,Zr.prototype.onAdd.call(this,r)},getTileUrl:function(r){var c=this._tileCoordsToNwSe(r),g=this._crs,S=ci(g.project(c[0]),g.project(c[1])),M=S.min,V=S.max,ne=(this._wmsVersion>=1.3&&this._crs===oa?[M.y,M.x,V.y,V.x]:[M.x,M.y,V.x,V.y]).join(","),ye=Zr.prototype.getTileUrl.call(this,r);return ye+Tt(this.wmsParams,ye,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ne},setParams:function(r,c){return R(this.wmsParams,r),c||this.redraw(),this}});function He(r,c){return new Lr(r,c)}Zr.WMS=Lr,Uo.wms=He;var Qn=Fn.extend({options:{padding:.1},initialize:function(r){ze(this,r),se(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),kt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var r={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(r.zoomanim=this._onAnimZoom),r},_onAnimZoom:function(r){this._updateTransform(r.center,r.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(r,c){var g=this._map.getZoomScale(c,this._zoom),S=this._map.getSize().multiplyBy(.5+this.options.padding),M=this._map.project(this._center,c),V=S.multiplyBy(-g).add(M).subtract(this._map._getNewPixelOrigin(r,c));_e.any3d?Br(this._container,V,g):Oi(this._container,V)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var r in this._layers)this._layers[r]._reset()},_onZoomEnd:function(){for(var r in this._layers)this._layers[r]._project()},_updatePaths:function(){for(var r in this._layers)this._layers[r]._update()},_update:function(){var r=this.options.padding,c=this._map.getSize(),g=this._map.containerPointToLayerPoint(c.multiplyBy(-r)).roun
vendor: 10,867 bytes, line 8
8d();this._bounds=new Mt(g,g.add(c.multiplyBy(1+r*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),jr=Qn.extend({options:{tolerance:0},getEvents:function(){var r=Qn.prototype.getEvents.call(this);return r.viewprereset=this._onViewPreReset,r},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Qn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var r=this._container=document.createElement("canvas");Ft(r,"mousemove",this._onMouseMove,this),Ft(r,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ft(r,"mouseout",this._handleMouseOut,this),r._leaflet_disable_events=!0,this._ctx=r.getContext("2d")},_destroyContainer:function(){rt(this._redrawRequest),delete this._ctx,Ht(this._container),bi(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var r;this._redrawBounds=null;for(var c in this._layers)r=this._layers[c],r._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Qn.prototype._update.call(this);var r=this._bounds,c=this._container,g=r.getSize(),S=_e.retina?2:1;Oi(c,r.min),c.width=S*g.x,c.height=S*g.y,c.style.width=g.x+"px",c.style.height=g.y+"px",_e.retina&&this._ctx.scale(2,2),this._ctx.translate(-r.min.x,-r.min.y),this.fire("update")}},_reset:function(){Qn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(r){this._updateDashArray(r),this._layers[se(r)]=r;var c=r._order={layer:r,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=c),this._drawLast=c,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(r){this._requestRedraw(r)},_removePath:function(r){var c=r._order,g=c.next,S=c.prev;g?g.prev=S:this._drawLast=S,S?S.next=g:this._drawFirst=g,delete r._order,delete this._layers[se(r)],this._requestRedraw(r)},_updatePath:function(r){this._extendRedrawBounds(r),r._project(),r._update(),this._requestRedraw(r)},_updateStyle:function(r){this._updateDashArray(r),this._requestRedraw(r)},_updateDashArray:function(r){if(typeof r.options.dashArray=="string"){var c=r.options.dashArray.split(/[, ]+/),g=[],S,M;for(M=0;M<c.length;M++){if(S=Number(c[M]),isNaN(S))return;g.push(S)}r.options._dashArray=g}else r.options._dashArray=r.options.dashArray},_requestRedraw:function(r){this._map&&(this._extendRedrawBounds(r),this._redrawRequest=this._redrawRequest||xt(this._redraw,this))},_extendRedrawBounds:function(r){if(r._pxBounds){var c=(r.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Mt,this._redrawBounds.extend(r._pxBounds.min.subtract([c,c])),this._redrawBounds.extend(r._pxBounds.max.add([c,c]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var r=this._redrawBounds;if(r){var c=r.getSize();this._ctx.clearRect(r.min.x,r.min.y,c.x,c.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var r,c=this._redrawBounds;if(this._ctx.save(),c){var g=c.getSize();this._ctx.beginPath(),this._ctx.rect(c.min.x,c.min.y,g.x,g.y),this._ctx.clip()}this._drawing=!0;for(var S=this._drawFirst;S;S=S.next)r=S.layer,(!c||r._pxBounds&&r._pxBounds.intersects(c))&&r._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(r,c){if(this._drawing){var g,S,M,V,ne=r._parts,ye=ne.length,Se=this._ctx;if(ye){for(Se.beginPath(),g=0;g<ye;g++){for(S=0,M=ne[g].length;S<M;S++)V=ne[g][S],Se[S?"lineTo":"moveTo"](V.x,V.y);c&&Se.closePath()}this._fillStroke(Se,r)}}},_updateCircle:function(r){if(!(!this._drawing||r._empty())){var c=r._point,g=this._ctx,S=Math.max(Math.round(r._radius),1),M=(Math.max(Math.round(r._radiusY),1)||S)/S;M!==1&&(g.save(),g.scale(1,M)),g.beginPath(),g.arc(c.x,c.y/M,S,0,Math.PI*2,!1),M!==1&&g.restore(),this._fillStroke(g,r)}},_fillStroke:function(r,c){var g=c.options;g.fill&&(r.globalAlpha=g.fillOpacity,r.fillStyle=g.fillColor||g.color,r.fill(g.fillRule||"evenodd")),g.stroke&&g.weight!==0&&(r.setLineDash&&r.setLineDash(c.options&&c.options._dashArray||[]),r.globalAlpha=g.opacity,r.lineWidth=g.weight,r.strokeStyle=g.color,r.lineCap=g.lineCap,r.lineJoin=g.lineJoin,r.stroke())},_onClick:function(r){for(var c=this._map.mouseEventToLayerPoint(r),g,S,M=this._drawFirst;M;M=M.next)g=M.layer,g.options.interactive&&g._containsPoint(c)&&(!(r.type==="click"||r.type==="preclick")||!this._map._draggableMoved(g))&&(S=g);this._fireEvent(S?[S]:!1,r)},_onMouseMove:function(r){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var c=this._map.mouseEventToLayerPoint(r);this._handleMouseHover(r,c)}},_handleMouseOut:function(r){var c=this._hoveredLayer;c&&(Ot(this._container,"leaflet-interactive"),this._fireEvent([c],r,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(r,c){if(!this._mouseHoverThrottled){for(var g,S,M=this._drawFirst;M;M=M.next)g=M.layer,g.options.interactive&&g._containsPoint(c)&&(S=g);S!==this._hoveredLayer&&(this._handleMouseOut(r),S&&(kt(this._container,"leaflet-interactive"),this._fireEvent([S],r,"mouseover"),this._hoveredLayer=S)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,r),this._mouseHoverThrottled=!0,setTimeout($(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(r,c,g){this._map._fireDOMEvent(c,g||c.type,r)},_bringToFront:function(r){var c=r._order;if(c){var g=c.next,S=c.prev;if(g)g.prev=S;else return;S?S.next=g:g&&(this._drawFirst=g),c.prev=this._drawLast,this._drawLast.next=c,c.next=null,this._drawLast=c,this._requestRedraw(r)}},_bringToBack:function(r){var c=r._order;if(c){var g=c.next,S=c.prev;if(S)S.next=g;else return;g?g.prev=S:S&&(this._drawLast=S),c.prev=null,c.next=this._drawFirst,this._drawFirst.prev=c,this._drawFirst=c,this._requestRedraw(r)}}});function Vo(r){return _e.canvas?new jr(r):null}var cs=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(r){return document.createElement("<lvml:"+r+' class="lvml">')}}catch(r){}return function(r){return document.createElement("<"+r+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),je={_initContainer:function(){this._container=Bt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Qn.prototype._update.call(this),this.fire("update"))},_initPath:function(r){var c=r._container=cs("shape");kt(c,"leaflet-vml-shape "+(this.options.className||"")),c.coordsize="1 1",r._path=cs("path"),c.appendChild(r._path),this._updateStyle(r),this._layers[se(r)]=r},_addPath:function(r){var c=r._container;this._container.appendChild(c),r.options.interactive&&r.addInteractiveTarget(c)},_removePath:function(r){var c=r._container;Ht(c),r.removeInteractiveTarget(c),delete this._layers[se(r)]},_updateStyle:function(r){var c=r._stroke,g=r._fill,S=r.options,M=r._container;M.stroked=!!S.stroke,M.filled=!!S.fill,S.stroke?(c||(c=r._stroke=cs("stroke")),M.appendChild(c),c.weight=S.weight+"px",c.color=S.color,c.opacity=S.opacity,S.dashArray?c.dashStyle=Dt(S.dashArray)?S.dashArray.join(" "):S.dashArray.replace(/( *, *)/g," "):c.dashStyle="",c.endcap=S.lineCap.replace("butt","flat"),c.joinstyle=S.lineJoin):c&&(M.removeChild(c),r._stroke=null),S.fill?(g||(g=r._fill=cs("fill")),M.appendChild(g),g.color=S.fillColor||S.color,g.opacity=S.fillOpacity):g&&(M.removeChild(g),r._fill=null)},_updateCircle:function(r){var c=r._point.round(),g=Math.round(r._radius),S=Math.round(r._radiusY||g);this._setPath(r,r._empty()?"M0 0":"AL "+c.x+","+c.y+" "+g+","+S+" 0,"+65535*360)},_setPath:function(r,c){r._path.v=c},_bringToFront:function(r){ur(r._container)},_bringToBack:function(r){vi(r._container)}},us=_e.vml?cs:Ao,Zo=Qn.extend({_initContainer:function(){this._container=us("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=us("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Ht(this._container),bi(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Qn.prototype._update.call(this);var r=this._bounds,c=r.getSize(),g=this._container;(!this._svgSize||!this._svgSize.equals(c))&&(this._svgSize=c,g.setAttribute("width",c.x),g.setAttribute("height",c.y)),Oi(g,r.min),g.setAttribute("viewBox",[r.min.x,r.min.y,c.x,c.y].join(" ")),this.fire("update")}},_initPath:function(r){var c=r._path=us("path");r.options.className&&kt(c,r.options.className),r.options.interactive&&kt(c,"leaflet-interactive"),this._updateStyle(r),this._layers[se(r)]=r},_addPath:function(r){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(r._path),r.addInteractiveTarget(r._path)},_removePath:function(r){Ht(r._path),r.removeInteractiveTarget(r._path),delete this._layers[se(r)]},_updatePath:function(r){r._project(),r._update()},_updateStyle:function(r){var c=r._path,g=r.options;c&&(g.stroke?(c.setAttribute("stroke",g.color),c.setAttribute("stroke-opacity",g.opacity),c.setAttribute("stroke-width",g.weight),c.setAttribute("stroke-linecap",g.lineCap),c.setAttribute("stroke-linejoin",g.lineJoin),g.dashArray?c.setAttribute("stroke-dasharray",g.dashArray):c.removeAttribute("stroke-dasharray"),g.dashOffset?c.setAttribute("stroke-dashoffset",g.dashOffset):c.removeAttribute("stroke-dashoffset")):c.setAttribute("stroke","none"),g.fill?(c.setAttribute("fill",g.fillColor||g.color),c.setAttribute("fill-opacity",g.fillOpacity),c.setAttribute("fill-rule",g.fillRule||"evenodd")):c.setAttribute("fill","none"))},_updatePoly:function(r,c){this._setPath(r,Jr(r._parts,c))},_updateCircle:function(r){var c=r._point,g=Math.max(Math.round(r._radius),1),S=Math.max(Math.round(r._radiusY),1)||g,M="a"+g+","+S+" 0 1,0 ",V=r._empty()?"M0 0":"M"+(c.x-g)+","+c.y+M+g*2+",0 "+M+-g*2+",0 ";this._setPath(r,V)},_setPath:function(r,c){r._path.setAttribute("d",c)},_bringToFront:function(r){ur(r._path)},_bringToBack:function(r){vi(r._path)}});_e.vml&&Zo.include(je);function al(r){return _e.svg||_e.vml?new Zo(r):null}oi.include({getRenderer:function(r){var c=r.options.renderer||this._getPaneRenderer(r.options.pane)||this.options.renderer||this._renderer;return c||(c=this._renderer=this._createRenderer()),this.hasLayer(c)||this.addLayer(c),c},_getPaneRenderer:function(r){if(r==="overlayPane"||r===void 0)return!1;var c=this._paneRenderers[r];return c===void 0&&(c=this._createRenderer({pane:r}),this._paneRenderers[r]=c),c},_createRenderer:function(r){return this.options.preferCanvas&&Vo(r)||al(r)}});var ua=Wi.extend({initialize:function(r,c){Wi.prototype.initialize.call(this,this._boundsToLatLngs(r),c)},setBounds:function(r){return this.setLatLngs(this._boundsToLatLngs(r))}
vendor: 11,623 bytes, line 8
8,_boundsToLatLngs:function(r){return r=$t(r),[r.getSouthWest(),r.getNorthWest(),r.getNorthEast(),r.getSouthEast()]}});function ll(r,c){return new ua(r,c)}Zo.create=us,Zo.pointsToPath=Jr,Un.geometryToLayer=Ro,Un.coordsToLatLng=Bo,Un.coordsToLatLngs=Fr,Un.latLngToCoords=la,Un.latLngsToCoords=ks,Un.getFeature=Oo,Un.asFeature=zs,oi.mergeOptions({boxZoom:!0});var Da=Sr.extend({initialize:function(r){this._map=r,this._container=r._container,this._pane=r._panes.overlayPane,this._resetStateTimeout=0,r.on("unload",this._destroy,this)},addHooks:function(){Ft(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){bi(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Ht(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(r){if(!r.shiftKey||r.which!==1&&r.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Yn(),Aa(),this._startPoint=this._map.mouseEventToContainerPoint(r),Ft(document,{contextmenu:Ln,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(r){this._moved||(this._moved=!0,this._box=Bt("div","leaflet-zoom-box",this._container),kt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(r);var c=new Mt(this._point,this._startPoint),g=c.getSize();Oi(this._box,c.min),this._box.style.width=g.x+"px",this._box.style.height=g.y+"px"},_finish:function(){this._moved&&(Ht(this._box),Ot(this._container,"leaflet-crosshair")),Lo(),Ts(),bi(document,{contextmenu:Ln,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(r){if(!(r.which!==1&&r.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout($(this._resetState,this),0);var c=new Lt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(c).fire("boxzoomend",{boxZoomBounds:c})}},_onKeyDown:function(r){r.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});oi.addInitHook("addHandler","boxZoom",Da),oi.mergeOptions({doubleClickZoom:!0});var Ra=Sr.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(r){var c=this._map,g=c.getZoom(),S=c.options.zoomDelta,M=r.originalEvent.shiftKey?g-S:g+S;c.options.doubleClickZoom==="center"?c.setZoom(M):c.setZoomAround(r.containerPoint,M)}});oi.addInitHook("addHandler","doubleClickZoom",Ra),oi.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var cl=Sr.extend({addHooks:function(){if(!this._draggable){var r=this._map;this._draggable=new hr(r._mapPane,r._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),r.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),r.on("zoomend",this._onZoomEnd,this),r.whenReady(this._onZoomEnd,this))}kt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Ot(this._map._container,"leaflet-grab"),Ot(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var r=this._map;if(r._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var c=$t(this._map.options.maxBounds);this._offsetLimit=ci(this._map.latLngToContainerPoint(c.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(c.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;r.fire("movestart").fire("dragstart"),r.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(r){if(this._map.options.inertia){var c=this._lastTime=+new Date,g=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(g),this._times.push(c),this._prunePositions(c)}this._map.fire("move",r).fire("drag",r)},_prunePositions:function(r){for(;this._positions.length>1&&r-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var r=this._map.getSize().divideBy(2),c=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=c.subtract(r).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(r,c){return r-(r-c)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var r=this._draggable._newPos.subtract(this._draggable._startPos),c=this._offsetLimit;r.x<c.min.x&&(r.x=this._viscousLimit(r.x,c.min.x)),r.y<c.min.y&&(r.y=this._viscousLimit(r.y,c.min.y)),r.x>c.max.x&&(r.x=this._viscousLimit(r.x,c.max.x)),r.y>c.max.y&&(r.y=this._viscousLimit(r.y,c.max.y)),this._draggable._newPos=this._draggable._startPos.add(r)}},_onPreDragWrap:function(){var r=this._worldWidth,c=Math.round(r/2),g=this._initialWorldOffset,S=this._draggable._newPos.x,M=(S-c+g)%r+c-g,V=(S+c+g)%r-c-g,ne=Math.abs(M+g)<Math.abs(V+g)?M:V;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=ne},_onDragEnd:function(r){var c=this._map,g=c.options,S=!g.inertia||r.noInertia||this._times.length<2;if(c.fire("dragend",r),S)c.fire("moveend");else{this._prunePositions(+new Date);var M=this._lastPos.subtract(this._positions[0]),V=(this._lastTime-this._times[0])/1e3,ne=g.easeLinearity,ye=M.multiplyBy(ne/V),Se=ye.distanceTo([0,0]),Me=Math.min(g.inertiaMaxSpeed,Se),Ke=ye.multiplyBy(Me/Se),At=Me/(g.inertiaDeceleration*ne),Xt=Ke.multiplyBy(-At/2).round();!Xt.x&&!Xt.y?c.fire("moveend"):(Xt=c._limitOffset(Xt,c.options.maxBounds),xt(function(){c.panBy(Xt,{duration:At,easeLinearity:ne,noMoveStart:!0,animate:!0})}))}}});oi.addInitHook("addHandler","dragging",cl),oi.mergeOptions({keyboard:!0,keyboardPanDelta:80});var ha=Sr.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(r){this._map=r,this._setPanDelta(r.options.keyboardPanDelta),this._setZoomDelta(r.options.zoomDelta)},addHooks:function(){var r=this._map._container;r.tabIndex<=0&&(r.tabIndex="0"),Ft(r,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),bi(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var r=document.body,c=document.documentElement,g=r.scrollTop||c.scrollTop,S=r.scrollLeft||c.scrollLeft;this._map._container.focus(),window.scrollTo(S,g)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(r){var c=this._panKeys={},g=this.keyCodes,S,M;for(S=0,M=g.left.length;S<M;S++)c[g.left[S]]=[-1*r,0];for(S=0,M=g.right.length;S<M;S++)c[g.right[S]]=[r,0];for(S=0,M=g.down.length;S<M;S++)c[g.down[S]]=[0,r];for(S=0,M=g.up.length;S<M;S++)c[g.up[S]]=[0,-1*r]},_setZoomDelta:function(r){var c=this._zoomKeys={},g=this.keyCodes,S,M;for(S=0,M=g.zoomIn.length;S<M;S++)c[g.zoomIn[S]]=r;for(S=0,M=g.zoomOut.length;S<M;S++)c[g.zoomOut[S]]=-r},_addHooks:function(){Ft(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){bi(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(r){if(!(r.altKey||r.ctrlKey||r.metaKey)){var c=r.keyCode,g=this._map,S;if(c in this._panKeys){if(!g._panAnim||!g._panAnim._inProgress)if(S=this._panKeys[c],r.shiftKey&&(S=mt(S).multiplyBy(3)),g.options.maxBounds&&(S=g._limitOffset(mt(S),g.options.maxBounds)),g.options.worldCopyJump){var M=g.wrapLatLng(g.unproject(g.project(g.getCenter()).add(S)));g.panTo(M)}else g.panBy(S)}else if(c in this._zoomKeys)g.setZoom(g.getZoom()+(r.shiftKey?3:1)*this._zoomKeys[c]);else if(c===27&&g._popup&&g._popup.options.closeOnEscapeKey)g.closePopup();else return;Ln(r)}}});oi.addInitHook("addHandler","keyboard",ha),oi.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var da=Sr.extend({addHooks:function(){Ft(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){bi(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(r){var c=En(r),g=this._map.options.wheelDebounceTime;this._delta+=c,this._lastMousePos=this._map.mouseEventToContainerPoint(r),this._startTime||(this._startTime=+new Date);var S=Math.max(g-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout($(this._performZoom,this),S),Ln(r)},_performZoom:function(){var r=this._map,c=r.getZoom(),g=this._map.options.zoomSnap||0;r._stop();var S=this._delta/(this._map.options.wheelPxPerZoomLevel*4),M=4*Math.log(2/(1+Math.exp(-Math.abs(S))))/Math.LN2,V=g?Math.ceil(M/g)*g:M,ne=r._limitZoom(c+(this._delta>0?V:-V))-c;this._delta=0,this._startTime=null,ne&&(r.options.scrollWheelZoom==="center"?r.setZoom(c+ne):r.setZoomAround(this._lastMousePos,c+ne))}});oi.addInitHook("addHandler","scrollWheelZoom",da);var Ba=600;oi.mergeOptions({tapHold:_e.touchNative&&_e.safari&&_e.mobile,tapTolerance:15});var pa=Sr.extend({addHooks:function(){Ft(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){bi(this._map._container,"touchstart",this._onDown,this)},_onDown:function(r){if(clearTimeout(this._holdTimeout),r.touches.length===1){var c=r.touches[0];this._startPos=this._newPos=new et(c.clientX,c.clientY),this._holdTimeout=setTimeout($(function(){this._cancel(),this._isTapValid()&&(Ft(document,"touchend",Ni),Ft(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",c))},this),Ba),Ft(document,"touchend touchcancel contextmenu",this._cancel,this),Ft(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function r(){bi(document,"touchend",Ni),bi(document,"touchend touchcancel",r)},_cancel:function(){clearTimeout(this._holdTimeout),bi(document,"touchend touchcancel contextmenu",this._cancel,this),bi(document,"touchmove",this._onMove,this)},_onMove:function(r){var c=r.touches[0];this._newPos=new et(c.clientX,c.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(r,c){var g=new MouseEvent(r,{bubbles:!0,cancelable:!0,view:window,screenX:c.screenX,screenY:c.screenY,clientX:c.clientX,clientY:c.clientY});g._simulated=!0,c.target.dispatchEvent(g)}});oi.addInitHook("addHandler","tapHold",pa),oi.mergeOptions({touchZoom:_e.touch,bounceAtZoomLimits:!0});var vn=Sr.extend({addHooks:function(){kt(this._map._container,"leaflet-touch-zoom"),Ft(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Ot(this._map._container,"leaflet-touch-zoom"),bi(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(r){var c=this._map;if(!(!r.touches||r.touches.length!==2||c._animatingZoom||this._zooming)){var g=c.mouseEventToContainerPoint(r.touches[0]),S=c.mouseEventToContainerPoint(r.touches[1]);
8this._centerPoint=c.getSize()._divideBy(2),this._startLatLng=c.containerPointToLatLng(this._centerPoint),c.options.touchZoom!=="center"&&(this._pinchStartLatLng=c.containerPointToLatLng(g.add(S)._divideBy(2))),this._startDist=g.distanceTo(S),this._startZoom=c.getZoom(),this._moved=!1,this._zooming=!0,c._stop(),Ft(document,"touchmove",this._onTouchMove,this),Ft(document,"touchend touchcancel",this._onTouchEnd,this),Ni(r)}},_onTouchMove:function(r){if(!(!r.touches||r.touches.length!==2||!this._zooming)){var c=this._map,g=c.mouseEventToContainerPoint(r.touches[0]),S=c.mouseEventToContainerPoint(r.touches[1]),M=g.distanceTo(S)/this._startDist;if(this._zoom=c.getScaleZoom(M,this._startZoom),!c.options.bounceAtZoomLimits&&(this._zoom<c.getMinZoom()&&M<1||this._zoom>c.getMaxZoom()&&M>1)&&(this._zoom=c._limitZoom(this._zoom)),c.options.touchZoom==="center"){if(this._center=this._startLatLng,M===1)return}else{var V=g._add(S)._divideBy(2)._subtract(this._centerPoint);if(M===1&&V.x===0&&V.y===0)return;this._center=c.unproject(c.project(this._pinchStartLatLng,this._zoom).subtract(V),this._zoom)}this._moved||(c._moveStart(!0,!1),this._moved=!0),rt(this._animRequest);var ne=$(c._move,c,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=xt(ne,this,!0),Ni(r)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,rt(this._animRequest),bi(document,"touchmove",this._onTouchMove,this),bi(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});oi.addInitHook("addHandler","touchZoom",vn),oi.BoxZoom=Da,oi.DoubleClickZoom=Ra,oi.Drag=cl,oi.Keyboard=ha,oi.ScrollWheelZoom=da,oi.TapHold=pa,oi.TouchZoom=vn,b.Bounds=Mt,b.Browser=_e,b.CRS=Tn,b.Canvas=jr,b.Circle=as,b.CircleMarker=lo,b.Class=ft,b.Control=Cn,b.DivIcon=Ir,b.DivOverlay=pr,b.DomEvent=Hs,b.DomUtil=Qa,b.Draggable=hr,b.Evented=ni,b.FeatureGroup=Nn,b.GeoJSON=Un,b.GridLayer=No,b.Handler=Sr,b.Icon=ao,b.ImageOverlay=fn,b.LatLng=qt,b.LatLngBounds=Lt,b.Layer=Fn,b.LayerGroup=Pr,b.LineUtil=Ls,b.Map=oi,b.Marker=ss,b.Mixin=zl,b.Path=Or,b.Point=et,b.PolyUtil=tl,b.Polygon=Wi,b.Polyline=ui,b.Popup=yn,b.PosAnimation=Is,b.Projection=na,b.Rectangle=ua,b.Renderer=Qn,b.SVG=Zo,b.SVGOverlay=za,b.TileLayer=Zr,b.Tooltip=Fo,b.Transformation=To,b.Util=Pt,b.VideoOverlay=ka,b.bind=$,b.bounds=ci,b.canvas=Vo,b.circle=rl,b.circleMarker=aa,b.control=Mo,b.divIcon=Ol,b.extend=R,b.featureGroup=Rl,b.geoJSON=dr,b.geoJson=Ds,b.gridLayer=sl,b.icon=Bl,b.imageOverlay=Rs,b.latLng=Vt,b.latLngBounds=$t,b.layerGroup=Cs,b.map=La,b.marker=nl,b.point=mt,b.polygon=ls,b.polyline=Do,b.popup=Ur,b.rectangle=ll,b.setOptions=ze,b.stamp=se,b.svg=al,b.svgOverlay=Nr,b.tileLayer=Uo,b.tooltip=Vr,b.transformation=Xn,b.version=I,b.videoOverlay=ol;var uo=window.L;b.noConflict=function(){return window.L=uo,this},window.L=b})})(kg,$c);const wt=$c;var Yu={},zg={get exports(){return Yu},set exports(y){Yu=y}};(function(y,p){(function(b,I){y.exports=I()})(tf,function(){var b,I,R;function N(l,se){if(!b)b=se;else if(!I)I=se;else{var X="var sharedChunk = {}; ("+b+")(sharedChunk); ("+I+")(sharedChunk);",ge={};b(ge),R=se(ge),typeof window!="undefined"&&(R.workerUrl=window.URL.createObjectURL(new Blob([X],{type:"text/javascript"})))}}N(["exports"],function(l){function se(i,e,n,s){return new(n||(n=Promise))(function(u,f){function _(P){try{T(s.next(P))}catch(C){f(C)}}function v(P){try{T(s.throw(P))}catch(C){f(C)}}function T(P){var C;P.done?u(P.value):(C=P.value,C instanceof n?C:new n(function(D){D(C)})).then(_,v)}T((s=s.apply(i,e||[])).next())})}function X(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var ge=ve;function ve(i,e){this.x=i,this.y=e}ve.prototype={clone:function(){return new ve(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)}
8,rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,n=i.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),n=Math.sin(i),s=n*this.x+e*this.y;return this.x=e*this.x-n*this.y,this.y=s,this},_rotateAround:function(i,e){var n=Math.cos(i),s=Math.sin(i),u=e.y+s*(this.x-e.x)+n*(this.y-e.y);return this.x=e.x+n*(this.x-e.x)-s*(this.y-e.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ve.convert=function(i){return i instanceof ve?i:Array.isArray(i)?new ve(i[0],i[1]):i};var pe=X(ge),Re=ut;function ut(i,e,n,s){this.cx=3*i,this.bx=3*(n-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(s-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=n,this.p2y=s}ut.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var n=i,s=0;s<8;s++){var u=this.sampleCurveX(n)-i;if(Math.abs(u)<e)return n;var f=this.sampleCurveDerivativeX(n);if(Math.abs(f)<1e-6)break;n-=u/f}var _=0,v=1;for(n=i,s=0;s<20&&(u=this.sampleCurveX(n),!(Math.abs(u-i)<e));s++)i>u?_=n:v=n,n=.5*(v-_)+_;return n},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var ze=X(Re);let Tt,pt;function zt(){return Tt==null&&(Tt=typeof OffscreenCanvas!="undefined"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),Tt}function Dt(){if(pt==null&&(pt=!1,zt())){const e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let s=0;s<5*5;s++){const u=4*s;e.fillStyle=`rgb(${u},${u+1},${u+2})`,e.fillRect(s%5,Math.floor(s/5),1,1)}const n=e.getImageData(0,0,5,5).data;for(let s=0;s<5*5*4;s++)if(s%4!=3&&n[s]!==s){pt=!0;break}}}return pt||!1}function fi(i,e,n,s){const u=new ze(i,e,n,s);return function(f){return u.solve(f)}}const Xe=fi(.25,.1,.25,1);function _t(i,e,n){return Math.min(n,Math.max(e,i))}function Qe(i,e,n){const s=n-e,u=((i-e)%s+s)%s+e;return u===e?n:u}function at(i,...e){for(const n of e)for(const s in n)i[s]=n[s];return i}let yt=1;function nt(i,e,n){const s={};for(const u in i)s[u]=e.call(n||this,i[u],u,i);return s}function xt(i,e,n){const s={};for(const u in i)e.call(n||this,i[u],u,i)&&(s[u]=i[u]);return s}function rt(i){return Array.isArray(i)?i.map(rt):typeof i=="object"&&i?nt(i,rt):i}const Pt={};function ft(i){Pt[i]||(typeof console!="undefined"&&console.warn(i),Pt[i]=!0)}function Ut(i,e,n){return(n.y-i.y)*(e.x-i.x)>(e.y-i.y)*(n.x-i.x)}function Ct(i){let e=0;for(let n,s,u=0,f=i.length,_=f-1;u<f;_=u++)n=i[u],s=i[_],e+=(s.x-n.x)*(n.y+s.y);return e}function ni(){return typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope}let et=null;function Ui(i){return typeof ImageBitmap!="undefined"&&i instanceof ImageBitmap}const mt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Mt(i,e,n,s,u){return se(this,void 0,void 0,function*(){if(typeof VideoFrame=="undefined")throw new Error("VideoFrame not supported");const f=new VideoFrame(i,{timestamp:0});try{const _=f==null?void 0:f.format;if(!_||!_.startsWith("BGR")&&!_.startsWith("RGB"))throw new Error(`Unrecognized format ${_}`);const v=_.startsWith("BGR"),T=new Uint8ClampedArray(s*u*4);if(yield f.copyTo(T,function(P,C,D,O,Z){const j=4*Math.max(-C,0),H=(Math.max(0,D)-D)*O*4+j,te=4*O,oe=Math.max(0,C),de=Math.max(0,D);return{rect:{x:oe,y:de,width:Math.min(P.width,C+O)-oe,height:Math.min(P.height,D+Z)-de}
8,layout:[{offset:H,stride:te}]}}(i,e,n,s,u)),v)for(let P=0;P<T.length;P+=4){const C=T[P];T[P]=T[P+2],T[P+2]=C}return T}finally{f.close()}})}let ci,Lt,$t,qt;const Vt={now:typeof performance!="undefined"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(i){const e=requestAnimationFrame(i);return{cancel:()=>cancelAnimationFrame(e)}},getImageData(i,e=0){return this.getImageCanvasContext(i).getImageData(-e,-e,i.width+2*e,i.height+2*e)},getImageCanvasContext(i){const e=window.document.createElement("canvas"),n=e.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return e.width=i.width,e.height=i.height,n.drawImage(i,0,0,i.width,i.height),n},resolveURL:i=>($t||($t=document.createElement("a")),$t.href=i,$t.href),hardwareConcurrency:typeof navigator!="undefined"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(qt==null&&(qt=matchMedia("(prefers-reduced-motion: reduce)")),qt.matches)}},Tn={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};class mn extends Error{constructor(e,n,s,u){super(`AJAXError: ${n} (${e}): ${s}`),this.status=e,this.statusText=n,this.url=s,this.body=u}}const Kn=ni()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href,Sn=i=>Tn.REGISTERED_PROTOCOLS[i.substring(0,i.indexOf("://"))];function To(i,e){const n=new AbortController,s=new Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,cache:i.cache,referrer:Kn(),signal:n.signal});let u=!1,f=!1;return i.type==="json"&&s.headers.set("Accept","application/json"),f||fetch(s).then(_=>_.ok?(v=>{(i.type==="arrayBuffer"||i.type==="image"?v.arrayBuffer():i.type==="json"?v.json():v.text()).then(T=>{f||(u=!0,e(null,T,v.headers.get("Cache-Control"),v.headers.get("Expires")))}).catch(T=>{f||e(new Error(T.message))})})(_):_.blob().then(v=>e(new mn(_.status,_.statusText,i.url,v)))).catch(_=>{_.code!==20&&e(new Error(_.message))}),{cancel:()=>{f=!0,u||n.abort()}}}const Xn=function(i,e){if(/:\/\//.test(i.url)&&!/^https?:|^file:/.test(i.url)){if(ni()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e);if(!ni())return(Sn(i.url)||To)(i,e)}if(!(/^file:/.test(n=i.url)||/^file:/.test(Kn())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return To(i,e);if(ni()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,e,void 0,!0)}var n;return function(s,u){const f=new XMLHttpRequest;f.open(s.method||"GET",s.url,!0),s.type!=="arrayBuffer"&&s.type!=="image"||(f.responseType="arraybuffer");for(const _ in s.headers)f.setRequestHeader(_,s.headers[_]);return s.type==="json"&&(f.responseType="text",f.setRequestHeader("Accept","application/json")),f.withCredentials=s.credentials==="include",f.onerror=()=>{u(new Error(f.statusText))},f.onload=()=>{if((f.status>=200&&f.status<300||f.status===0)&&f.response!==null){let _=f.response;if(s.type==="json")try{_=JSON.parse(f.response)}catch(v){return u(v)}u(null,_,f.getResponseHeader("Cache-Control"),f.getResponseHeader("Expires"))}else{const _=new Blob([f.response],{type:f.getResponseHeader("Content-Type")});u(new mn(f.status,f.statusText,s.url,_))}},f.send(s.body),{cancel:()=>f.abort()}}(i,e)},So=function(i,e){return Xn(at(i,{type:"arrayBuffer"}),e)};function kr(i){if(!i||i.indexOf("://")<=0||i.indexOf("data:image/")===0||i.indexOf("blob:")===0)return!0;const e=new URL(i),n=window.location;return e.protocol===n.protocol&&e.host===n.host}function Ao(i,e,n){n[i]&&n[i].indexOf(e)!==-1||(n[i]=n[i]||[],n[i].push(e))}function Jr(i,e,n){if(n&&n[i]){const s=n[i].indexOf(e);s!==-1&&n[i].splice(s,1)}}class vr{constructor(e,n={}){at(this,n),this.type=e}}class ar extends vr{constructor(e,n={}){super("error",at({error:e},n))}}class Po{on(e,n){return this._listeners=this._listeners||{},Ao(e,n,this._listeners),this}off(e,n){return Jr(e,n,this._listeners),Jr(e,n,this._oneTimeListeners),this}once(e,n){return n?(this._oneTimeListeners=this._oneTimeListeners||{},Ao(e,n,this._oneTimeListeners),this):new Promise(s=>this.once(e,s))}fire(e,n){typeof e=="string"&&(e=new vr(e,n||{}));const s=e.type;if(this.listens(s)){e.target=this;const u=this._listeners&&this._listeners[s]?this._listeners[s].slice():[];for(const v of u)v.call(this,e);const f=this._oneTimeListeners&&this._oneTimeListeners[s]?this._oneTimeListeners[s].slice():[];for(const v of f)Jr(s,v,this._oneTimeListeners),v.call(this,e);const _=this._eventedParent;_&&(at(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),_.fire(e))}else e instanceof ar&&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,n){return this._eventedParent=e,this._eventedParentData=n,this}}
vendor: 3,695 bytes, line 8
8var Pe={$version:8,$root:{version:{required:!0,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"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,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:!0,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:!1},"*":{type:"*"}},source_raster:{type:{required:!0,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:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},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
vendor: 10,514 bytes, line 8
8","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,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:!1,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"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,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:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,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:!0,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:!1,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:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,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:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,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:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,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:!0,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:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:!1,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:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,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:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,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"}},
vendor: 1,289 bytes, line 8
8filter:{type:"array",value:"*"},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:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5
vendor: 14,262 bytes, line 8
8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,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"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const 
8hn=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Bn(i,e){const n={};for(const s in i)s!=="ref"&&(n[s]=i[s]);return hn.forEach(s=>{s in e&&(n[s]=e[s])}),n}function yi(i,e){if(Array.isArray(i)){if(!Array.isArray(e)||i.length!==e.length)return!1;for(let n=0;n<i.length;n++)if(!yi(i[n],e[n]))return!1;return!0}if(typeof i=="object"&&i!==null&&e!==null){if(typeof e!="object"||Object.keys(i).length!==Object.keys(e).length)return!1;for(const n in i)if(!yi(i[n],e[n]))return!1;return!0}return i===e}const li={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"};function xr(i,e,n){n.push({command:li.addSource,args:[i,e[i]]})}
vendor: 27,641 bytes, line 8
8function Qr(i,e,n){e.push({command:li.removeSource,args:[i]}),n[i]=!0}function br(i,e,n,s){Qr(i,n,s),xr(i,e,n)}function vs(i,e,n){let s;for(s in i[n])if(Object.prototype.hasOwnProperty.call(i[n],s)&&s!=="data"&&!yi(i[n][s],e[n][s]))return!1;for(s in e[n])if(Object.prototype.hasOwnProperty.call(e[n],s)&&s!=="data"&&!yi(i[n][s],e[n][s]))return!1;return!0}function Ko(i,e,n,s,u,f){let _;for(_ in e=e||{},i=i||{})Object.prototype.hasOwnProperty.call(i,_)&&(yi(i[_],e[_])||n.push({command:f,args:[s,_,e[_],u]}));for(_ in e)Object.prototype.hasOwnProperty.call(e,_)&&!Object.prototype.hasOwnProperty.call(i,_)&&(yi(i[_],e[_])||n.push({command:f,args:[s,_,e[_],u]}))}function zr(i){return i.id}function eo(i,e){return i[e.id]=e,i}class Fe{constructor(e,n,s,u){this.message=(e?`${e}: `:"")+s,u&&(this.identifier=u),n!=null&&n.__line__&&(this.line=n.__line__)}}function lr(i,...e){for(const n of e)for(const s in n)i[s]=n[s];return i}class Ci extends Error{constructor(e,n){super(n),this.message=n,this.key=e}}class to{constructor(e,n=[]){this.parent=e,this.bindings={};for(const[s,u]of n)this.bindings[s]=u}concat(e){return new to(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)}}const Dr={kind:"null"},Oe={kind:"number"},Rt={kind:"string"},It={kind:"boolean"},dn={kind:"color"},cr={kind:"object"},Et={kind:"value"},Rr={kind:"collator"},Y={kind:"formatted"},B={kind:"padding"},F={kind:"resolvedImage"},q={kind:"variableAnchorOffsetCollection"};function Q(i,e){return{kind:"array",itemType:i,N:e}}function ee(i){if(i.kind==="array"){const e=ee(i.itemType);return typeof i.N=="number"?`array<${e}, ${i.N}>`:i.itemType.kind==="value"?"array":`array<${e}>`}return i.kind}const fe=[Dr,Oe,Rt,It,dn,Y,cr,Q(Et),B,F,q];function le(i,e){if(e.kind==="error")return null;if(i.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!le(i.itemType,e.itemType))&&(typeof i.N!="number"||i.N===e.N))return null}else{if(i.kind===e.kind)return null;if(i.kind==="value"){for(const n of fe)if(!le(n,e))return null}}return`Expected ${ee(i)} but found ${ee(e)} instead.`}function re(i,e){return e.some(n=>n.kind===i.kind)}function ue(i,e){return e.some(n=>n==="null"?i===null:n==="array"?Array.isArray(i):n==="object"?i&&!Array.isArray(i)&&typeof i=="object":n===typeof i)}function Ae(i,e){return i.kind==="array"&&e.kind==="array"?i.itemType.kind===e.itemType.kind&&typeof i.N=="number":i.kind===e.kind}const _e=.96422,Le=.82521,lt=4/29,vt=6/29,Ye=3*vt*vt,ct=vt*vt*vt,St=Math.PI/180,ei=180/Math.PI;function mi(i){return(i%=360)<0&&(i+=360),i}function ri([i,e,n,s]){let u,f;const _=pn((.2225045*(i=ti(i))+.7168786*(e=ti(e))+.0606169*(n=ti(n)))/1);i===e&&e===n?u=f=_:(u=pn((.4360747*i+.3850649*e+.1430804*n)/_e),f=pn((.0139322*i+.0971045*e+.7141733*n)/Le));const v=116*_-16;return[v<0?0:v,500*(u-_),200*(_-f),s]}function ti(i){return i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function pn(i){return i>ct?Math.pow(i,1/3):i/Ye+lt}function Ti([i,e,n,s]){let u=(i+16)/116,f=isNaN(e)?u:u+e/500,_=isNaN(n)?u:u-n/200;return u=1*en(u),f=_e*en(f),_=Le*en(_),[Vi(3.1338561*f-1.6168667*u-.4906146*_),Vi(-.9787684*f+1.9161415*u+.033454*_),Vi(.0719453*f-.2289914*u+1.4052427*_),s]}function Vi(i){return(i=i<=.00304?12.92*i:1.055*Math.pow(i,1/2.4)-.055)<0?0:i>1?1:i}function en(i){return i>vt?i*i*i:Ye*(i-lt)}function _n(i){return parseInt(i.padEnd(2,i),16)/255}function Ja(i,e){return Xo(e?i/100:i,0,1)}function Xo(i,e,n){return Math.min(Math.max(e,i),n)}function Yo(i){return!i.some(Number.isNaN)}const El={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class _i{constructor(e,n,s,u=1,f=!0){this.r=e,this.g=n,this.b=s,this.a=u,f||(this.r*=u,this.g*=u,this.b*=u,u||this.overwriteGetter("rgb",[e,n,s,u]))}static parse(e){if(e instanceof _i)return e;if(typeof e!="string")return;const n=function(s){if((s=s.toLowerCase().trim())==="transparent")return[0,0,0,0];const u=El[s];if(u){const[_,v,T]=u;return[_/255,v/255,T/255,1]}if(s.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(s)){const _=s.length<6?1:2;let v=1;return[_n(s.slice(v,v+=_)),_n(s.slice(v,v+=_)),_n(s.slice(v,v+=_)),_n(s.slice(v,v+_)||"ff")]}if(s.startsWith("rgb")){const _=s.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(_){const[v,T,P,C,D,O,Z,j,H,te,oe,de]=_,ae=[C||" ",Z||" ",te].join("");if(ae==="  "||ae==="  /"||ae===",,"||ae===",,,"){const me=[P,O,H].join(""),be=me==="%%%"?100:me===""?255:0;if(be){const Ee=[Xo(+T/be,0,1),Xo(+D/be,0,1),Xo(+j/be,0,1),oe?Ja(+oe,de):1];if(Yo(Ee))return Ee}}return}}const f=s.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(f){const[_,v,T,P,C,D,O,Z,j]=f,H=[T||" ",C||" ",O].join("");if(H==="  "||H==="  /"||H===",,"||H===",,,"){const te=[+v,Xo(+P,0,100),Xo(+D,0,100),Z?Ja(+Z,j):1];if(Yo(te))return function([oe,de,ae,me]){function be(Ee){const qe=(Ee+oe/30)%12,it=de*Math.min(ae,1-ae);return ae-it*Math.max(-1,Math.min(qe-3,9-qe,1))}return oe=mi(oe),de/=100,ae/=100,[be(0),be(8),be(4),me]}(te)}}}(e);return n?new _i(...n,!1):void 0}get rgb(){const{r:e,g:n,b:s,a:u}=this,f=u||1/0;return this.overwriteGetter("rgb",[e/f,n/f,s/f,u])}get hcl(){return this.overwriteGetter("hcl",function(e){const[n,s,u,f]=ri(e),_=Math.sqrt(s*s+u*u);return[Math.round(1e4*_)?mi(Math.atan2(u,s)*ei):NaN,_,n,f]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ri(this.rgb))}overwriteGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}toString(){const[e,n,s,u]=this.rgb;return`rgba(${[e,n,s].map(f=>Math.round(255*f)).join(",")},${u})`}}_i.black=new _i(0,0,0,1),_i.white=new _i(1,1,1,1),_i.transparent=new _i(0,0,0,0),_i.red=new _i(1,0,0,1);class xs{constructor(e,n,s){this.sensitivity=e?n?"variant":"case":n?"accent":"base",this.locale=s,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,n){return this.collator.compare(e,n)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class io{constructor(e,n,s,u,f){this.text=e,this.image=n,this.scale=s,this.fontStack=u,this.textColor=f}}class tn{constructor(e){this.sections=e}static fromString(e){return new tn([new io(e,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof tn?e:tn.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}}class An{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof An)return e;if(typeof e=="number")return new An([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const n of e)if(typeof n!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new An(e)}}toString(){return JSON.stringify(this.values)}}const bs=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Bt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Bt)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let n=0;n<e.length;n+=2){const s=e[n],u=e[n+1];if(typeof s!="string"||!bs.has(s)||!Array.isArray(u)||u.length!==2||typeof u[0]!="number"||typeof u[1]!="number")return}return new Bt(e)}}toString(){return JSON.stringify(this.values)}}class Ht{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Ht({name:e,available:!1}):null}}function Io(i,e,n,s){return typeof i=="number"&&i>=0&&i<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof n=="number"&&n>=0&&n<=255?s===void 0||typeof s=="number"&&s>=0&&s<=1?null:`Invalid rgba value [${[i,e,n,s].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof s=="number"?[i,e,n,s]:[i,e,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ur(i){if(i===null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||i instanceof _i||i instanceof xs||i instanceof tn||i instanceof An||i instanceof Bt||i instanceof Ht)return!0;if(Array.isArray(i)){for(const e of i)if(!ur(e))return!1;return!0}if(typeof i=="object"){for(const e in i)if(!ur(i[e]))return!1;return!0}return!1}function vi(i){if(i===null)return Dr;if(typeof i=="string")return Rt;if(typeof i=="boolean")return It;if(typeof i=="number")return Oe;if(i instanceof _i)return dn;if(i instanceof xs)return Rr;if(i instanceof tn)return Y;if(i instanceof An)return B;if(i instanceof Bt)return q;if(i instanceof Ht)return F;if(Array.isArray(i)){const e=i.length;let n;for(const s of i){const u=vi(s);if(n){if(n===u)continue;n=Et;break}n=u}return Q(n||Et,e)}return cr}function ai(i){const e=typeof i;return i===null?"":e==="string"||e==="number"||e==="boolean"?String(i):i instanceof _i||i instanceof tn||i instanceof An||i instanceof Bt||i instanceof Ht?i.toString():JSON.stringify(i)}class kt{constructor(e,n){this.type=e,this.value=n}static parse(e,n){if(e.length!==2)return n.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!ur(e[1]))return n.error("invalid value");const s=e[1];let u=vi(s);const f=n.expectedType;return u.kind!=="array"||u.N!==0||!f||f.kind!=="array"||typeof f.N=="number"&&f.N!==0||(u=f),new kt(u,s)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ot{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Jo={string:Rt,number:Oe,boolean:It,object:cr};class gn{constructor(e,n){this.type=e,this.args=n}static parse(e,n){if(e.length<2)return n.error("Expected at least one argument.");let s,u=1;const f=e[0];if(f==="array"){let v,T;if(e.length>2){const P=e[1];if(typeof P!="string"||!(P in Jo)||P==="object")return n.error('The item type argument of "array" must be one of string, number, boolean',1);v=Jo[P],u++}else v=Et;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return n.error('The length argument to "array" must be a positive integer literal',2);T=e[2],u++}s=Q(v,T)}else{if(!Jo[f])throw new Error(`Types doesn't contain name = ${f}`);s=Jo[f]}const _=[];for(;u<e.length;u++){const v=n.parse(e[u],u,Et);if(!v)return null;_.push(v)}return new gn(s,_)}evaluate(e){for(let n=0;n<this.args.length;n++){const s=this.args[n].evaluate(e);if(!le(this.type,vi(s)))return s;if(n===this.args.length-1)throw new Ot(`Expected value to be of type ${ee(this.type)}, but found ${ee(vi(s))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const Pn={"to-boolean":It,"to-color":dn,"to-number":Oe,"to-string":Rt};class no{constructor(e,n){this.type=e,this.args=n}static parse(e,n){if(e.length<2)return n.error("Expected at least one argument.");const s=e[0];if(!Pn[s])throw new Error(`Can't parse ${s} as it is not part of the known types`);if((s==="to-boolean"||s==="to-string")&&e.length!==2)return n.error("Expected one argument.");const u=Pn[s],f=[];for(let _=1;_<e.length;_++){const v=n.parse(e[_],_,Et);if(!v)return null;f.push(v)}return new no(u,f)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let n,s;for(const u of this.args){if(n=u.evaluate(e),s=null,n instanceof _i)return n;if(typeof n=="string"){const f=e.parseColor(n);if(f)return f}else if(Array.isArray(n)&&(s=n.length<3||n.length>4?`Invalid rbga value ${JSON.stringify(n)}: expected an array containing either three or four numeric values.`:Io(n[0],n[1],n[2],n[3]),!s))return new _i(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new Ot(s||`Could not parse color from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"padding":{let n;for(const s of this.args){n=s.evaluate(e);const u=An.parse(n);if(u)return u}throw new Ot(`Could not parse padding from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"variableAnchorOffsetCollection":{let n;for(const s of this.args){n=s.evaluate(e);const u=Bt.parse(n);if(u)return u}throw new Ot(`Could not parse variableAnchorOffsetCollection from value '${typeof n=="string"?n:JSON.stringify(n)}'`)}case"number":{let n=null;for(const s of this.args){if(n=s.evaluate(e),n===null)return 0;const u=Number(n);if(!isNaN(u))return u}throw new Ot(`Could not convert ${JSON.stringify(n)} to number.`)}case"formatted":return tn.fromString(ai(this.args[0].evaluate(e)));case"resolvedImage":return Ht.fromString(ai(this.args[0].evaluate(e)));default:return ai(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const ws=["Unknown","Point","LineString","Polygon"];class Br{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?ws[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||{}}parseColor(e){let n=this._parseColorCache[e];return n||(n=this._parseColorCache[e]=_i.parse(e)),n}}class Oi{constructor(e,n,s=[],u,f=new to,_=[]){this.registry=e,this.path=s,this.key=s.map(v=>`[${v}]`).join(""),this.scope=f,this.errors=_,this.expectedType=u,this._isConstant=n}parse(e,n,s,u,f={}){return n?this.concat(n,s,u)._parse(e,f):this._parse(e,f)}_parse(e,n){function s(u,f,_){return _==="assert"?new gn(f,[u]):_==="coerce"?new no(f,[u]):u}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const u=e[0];if(typeof u!="string")return this.error(`Expression name must be a string, but found ${typeof u} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const f=this.registry[u];if(f){let _=f.parse(e,this);if(!_)return null;if(this.expectedType){const v=this.expectedType,T=_.type;if(v.kind!=="string"&&v.kind!=="number"&&v.kind!=="boolean"&&v.kind!=="object"&&v.kind!=="array"||T.kind!=="value")if(v.kind!=="color"&&v.kind!=="formatted"&&v.kind!=="resolvedImage"||T.kind!=="value"&&T.kind!=="string")if(v.kind!=="padding"||T.kind!=="value"&&T.kind!=="number"&&T.kind!=="array")if(v.kind!=="variableAnchorOffsetCollection"||T.kind!=="value"&&T.kind!=="array"){if(this.checkSubtype(v,T))return null}else _=s(_,v,n.typeAnnotation||"coerce");else _=s(_,v,n.typeAnnotation||"coerce");else _=s(_,v,n.typeAnnotation||"coerce");else _=s(_,v,n.typeAnnotation||"assert")}if(!(_ instanceof kt)&&_.type.kind!=="resolvedImage"&&this._isConstant(_)){const v=new Br;try{_=new kt(_.type,_.evaluate(v))}catch(T){return this.error(T.message),null}}return _}return this.error(`Unknown expression "${u}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,n,s){const u=typeof e=="number"?this.path.concat(e):this.path,f=s?this.scope.concat(s):this.scope;return new Oi(this.registry,this._isConstant,u,n||null,f,this.errors)}error(e,...n){const s=`${this.key}${n.map(u=>`[${u}]`).join("")}`;this.errors.push(new Ci(s,e))}checkSubtype(e,n){const s=le(e,n);return s&&this.error(s),s}}class wr{constructor(e,n,s){this.type=Rr,this.locale=s,this.caseSensitive=e,this.diacriticSensitive=n}static parse(e,n){if(e.length!==2)return n.error("Expected one argument.");const s=e[1];if(typeof s!="object"||Array.isArray(s))return n.error("Collator options argument must be an object.");const u=n.parse(s["case-sensitive"]!==void 0&&s["case-sensitive"],1,It);if(!u)return null;const f=n.parse(s["diacritic-sensitive"]!==void 0&&s["diacritic-sensitive"],1,It);if(!f)return null;let _=null;return s.locale&&(_=n.parse(s.locale,1,Rt),!_)?null:new wr(u,f,_)}evaluate(e){return new xs(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}}const Yn=8192;function Lo(i,e){i[0]=Math.min(i[0],e[0]),i[1]=Math.min(i[1],e[1]),i[2]=Math.max(i[2],e[0]),i[3]=Math.max(i[3],e[1])}function Eo(i,e){return!(i[0]<=e[0]||i[2]>=e[2]||i[1]<=e[1]||i[3]>=e[3])}function Qo(i,e){const n=(180+i[0])/360,s=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,u=Math.pow(2,e.z);return[Math.round(n*u*Yn),Math.round(s*u*Yn)]}function Aa(i,e,n){const s=i[0]-e[0],u=i[1]-e[1],f=i[0]-n[0],_=i[1]-n[1];return s*_-f*u==0&&s*f<=0&&u*_<=0}function Ts(i,e){let n=!1;for(let _=0,v=e.length;_<v;_++){const T=e[_];for(let P=0,C=T.length;P<C-1;P++){if(Aa(i,T[P],T[P+1]))return!1;(u=T[P])[1]>(s=i)[1]!=(f=T[P+1])[1]>s[1]&&s[0]<(f[0]-u[0])*(s[1]-u[1])/(f[1]-u[1])+u[0]&&(n=!n)}}var s,u,f;return n}function es(i,e){for(let n=0;n<e.length;n++)if(Ts(i,e[n]))return!0;return!1}function Gs(i,e,n,s){const u=s[0]-n[0],f=s[1]-n[1],_=(i[0]-n[0])*f-u*(i[1]-n[1]),v=(e[0]-n[0])*f-u*(e[1]-n[1]);return _>0&&v<0||_<0&&v>0}function Pa(i,e,n){for(const P of n)for(let C=0;C<P.length-1;++C)if((v=[(_=P[C+1])[0]-(f=P[C])[0],_[1]-f[1]])[0]*(T=[(u=e)[0]-(s=i)[0],u[1]-s[1]])[1]-v[1]*T[0]!=0&&Gs(s,u,f,_)&&Gs(f,_,s,u))return!0;var s,u,f,_,v,T;return!1}function Ss(i,e){for(let n=0;n<i.length;++n)if(!Ts(i[n],e))return!1;for(let n=0;n<i.length-1;++n)if(Pa(i[n],i[n+1],e))return!1;return!0}function Ia(i,e){for(let n=0;n<e.length;n++)if(Ss(i,e[n]))return!0;return!1}function ts(i,e,n){const s=[];for(let u=0;u<i.length;u++){const f=[];for(let _=0;_<i[u].length;_++){const v=Qo(i[u][_],n);Lo(e,v),f.push(v)}s.push(f)}return s}function Qa(i,e,n){const s=[];for(let u=0;u<i.length;u++){const f=ts(i[u],e,n);s.push(f)}return s}function Ft(i,e,n,s){if(i[0]<n[0]||i[0]>n[2]){const u=.5*s;let f=i[0]-n[0]>u?-s:n[0]-i[0]>u?s:0;f===0&&(f=i[0]-n[2]>u?-s:n[2]-i[0]>u?s:0),i[0]+=f}Lo(e,i)}function Jn(i,e,n,s){const u=Math.pow(2,s.z)*Yn,f=[s.x*Yn,s.y*Yn],_=[];for(const v of i)for(const T of v){const P=[T.x+f[0],T.y+f[1]];Ft(P,e,n,u),_.push(P)}return _}function bi(i,e,n,s){const u=Math.pow(2,s.z)*Yn,f=[s.x*Yn,s.y*Yn],_=[];for(const T of i){const P=[];for(const C of T){const D=[C.x+f[0],C.y+f[1]];Lo(e,D),P.push(D)}_.push(P)}if(e[2]-e[0]<=u/2){(v=e)[0]=v[1]=1/0,v[2]=v[3]=-1/0;for(const T of _)for(const P of T)Ft(P,e,n,u)}var v;return _}class ro{constructor(e,n){this.type=It,this.geojson=e,this.geometries=n}static parse(e,n){if(e.length!==2)return n.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ur(e[1])){const s=e[1];if(s.type==="FeatureCollection")for(let u=0;u<s.features.length;++u){const f=s.features[u].geometry.type;if(f==="Polygon"||f==="MultiPolygon")return new ro(s,s.features[u].geometry)}else if(s.type==="Feature"){const u=s.geometry.type;if(u==="Polygon"||u==="MultiPolygon")return new ro(s,s.geometry)}else if(s.type==="Polygon"||s.type==="MultiPolygon")return new ro(s,s)}return n.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(n,s){const u=[1/0,1/0,-1/0,-1/0],f=[1/0,1/0,-1/0,-1/0],_=n.canonicalID();if(s.type==="Polygon"){const v=ts(s.coordinates,f,_),T=Jn(n.geometry(),u,f,_);if(!Eo(u,f))return!1;for(const P of T)if(!Ts(P,v))return!1}if(s.type==="MultiPolygon"){const v=Qa(s.coordinates,f,_),T=Jn(n.geometry(),u,f,_);if(!Eo(u,f))return!1;for(const P of T)if(!es(P,v))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(n,s){const u=[1/0,1/0,-1/0,-1/0],f=[1/0,1/0,-1/0,-1/0],_=n.canonicalID();if(s.type==="Polygon"){const v=ts(s.coordinates,f,_),T=bi(n.geometry(),u,f,_);if(!Eo(u,f))return!1;for(const P of T)if(!Ss(P,v))return!1}if(s.type==="MultiPolygon"){const v=Qa(s.coordinates,f,_),T=bi(n.geometry(),u,f,_);if(!Eo(u,f))return!1;for(const P of T)if(!Ia(P,v))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class is{constructor(e,n){this.type=n.type,this.name=e,this.boundExpression=n}static parse(e,n){if(e.length!==2||typeof e[1]!="string")return n.error("'var' expression requires exactly one string literal argument.");const s=e[1];return n.scope.has(s)?new is(s,n.scope.get(s)):n.error(`Unknown variable "${s}". Make sure "${s}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class In{constructor(e,n,s,u){this.name=e,this.type=n,this._evaluate=s,this.args=u}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,n){const s=e[0],u=In.definitions[s];if(!u)return n.error(`Unknown expression "${s}". If you wanted a literal array, use ["literal", [...]].`,0);const f=Array.isArray(u)?u[0]:u.type,_=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,v=_.filter(([P])=>!Array.isArray(P)||P.length===e.length-1);let T=null;for(const[P,C]of v){T=new Oi(n.registry,ns,n.path,null,n.scope);const D=[];let O=!1;for(let Z=1;Z<e.length;Z++){const j=e[Z],H=Array.isArray(P)?P[Z-1]:P.type,te=T.parse(j,1+D.length,H);if(!te){O=!0;break}D.push(te)}if(!O)if(Array.isArray(P)&&P.length!==D.length)T.error(`Expected ${P.length} arguments, but found ${D.length} instead.`);else{for(let Z=0;Z<D.length;Z++){const j=Array.isArray(P)?P[Z]:P.type,H=D[Z];T.concat(Z+1).checkSubtype(j,H.type)}if(T.errors.length===0)return new In(s,f,C,D)}}if(v.length===1)n.errors.push(...T.errors);else{const P=(v.length?v:_).map(([D])=>{return O=D,Array.isArray(O)?`(${O.map(ee).join(", ")})`:`(${ee(O.type)}...)`;var O}).join(" | "),C=[];for(let D=1;D<e.length;D++){const O=n.parse(e[D],1+C.length);if(!O)return null;C.push(ee(O.type))}n.error(`Expected arguments of type ${P}, but found (${C.join(", ")}) instead.`)}return null}static register(e,n){In.definitions=n;for(const s in n)e[s]=In}}function ns(i){if(i instanceof is)return ns(i.boundExpression);if(i instanceof In&&i.name==="error"||i instanceof wr||i instanceof ro)return!1;const e=i instanceof no||i instanceof gn;let n=!0;return i.eachChild(s=>{n=e?n&&ns(s):n&&s instanceof kt}),!!n&&Tr(i)&&oo(i,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Tr(i){if(i instanceof In&&(i.name==="get"&&i.args.length===1||i.name==="feature-state"||i.name==="has"&&i.args.length===1||i.name==="properties"||i.name==="geometry-type"||i.name==="id"||/^filter-/.test(i.name))||i instanceof ro)return!1;let e=!0;return i.eachChild(n=>{e&&!Tr(n)&&(e=!1)}),e}function Co(i){if(i instanceof In&&i.name==="feature-state")return!1;let e=!0;return i.eachChild(n=>{e&&!Co(n)&&(e=!1)}),e}function oo(i,e){if(i instanceof In&&e.indexOf(i.name)>=0)return!1;let n=!0;return i.eachChild(s=>{n&&!oo(s,e)&&(n=!1)}),n}function Ni(i,e){const n=i.length-1;let s,u,f=0,_=n,v=0;for(;f<=_;)if(v=Math.floor((f+_)/2),s=i[v],u=i[v+1],s<=e){if(v===n||e<u)return v;f=v+1}else{if(!(s>e))throw new Ot("Input is not a number.");_=v-1}return 0}class Ln{constructor(e,n,s){this.type=e,this.input=n,this.labels=[],this.outputs=[];for(const[u,f]of s)this.labels.push(u),this.outputs.push(f)}static parse(e,n){if(e.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return n.error("Expected an even number of arguments.");const s=n.parse(e[1],1,Oe);if(!s)return null;const u=[];let f=null;n.expectedType&&n.expectedType.kind!=="value"&&(f=n.expectedType);for(let _=1;_<e.length;_+=2){const v=_===1?-1/0:e[_],T=e[_+1],P=_,C=_+1;if(typeof v!="number")return n.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not c
8omputed expressions) for the input values.',P);if(u.length&&u[u.length-1][0]>=v)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',P);const D=n.parse(T,C,f);if(!D)return null;f=f||D.type,u.push([v,D])}return new Ln(f,s,u)}evaluate(e){const n=this.labels,s=this.outputs;if(n.length===1)return s[0].evaluate(e);const u=this.input.evaluate(e);if(u<=n[0])return s[0].evaluate(e);const f=n.length;return u>=n[f-1]?s[f-1].evaluate(e):s[Ni(n,u)].evaluate(e)}eachChild(e){e(this.input);for(const n of this.outputs)e(n)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Wt(i,e,n){return i+n*(e-i)}function As(i,e,n){return i.map((s,u)=>Wt(s,e[u],n))}const On={number:Wt,color:function(i,e,n,s="rgb"){switch(s){case"rgb":{const[u,f,_,v]=As(i.rgb,e.rgb,n);return new _i(u,f,_,v,!1)}case"hcl":{const[u,f,_,v]=i.hcl,[T,P,C,D]=e.hcl;let O,Z;if(isNaN(u)||isNaN(T))isNaN(u)?isNaN(T)?O=NaN:(O=T,_!==1&&_!==0||(Z=P)):(O=u,C!==1&&C!==0||(Z=f));else{let de=T-u;T>u&&de>180?de-=360:T<u&&u-T>180&&(de+=360),O=u+n*de}const[j,H,te,oe]=function([de,ae,me,be]){return de=isNaN(de)?0:de*St,Ti([me,Math.cos(de)*ae,Math.sin(de)*ae,be])}([O,Z!=null?Z:Wt(f,P,n),Wt(_,C,n),Wt(v,D,n)]);return new _i(j,H,te,oe,!1)}case"lab":{const[u,f,_,v]=Ti(As(i.lab,e.lab,n));return new _i(u,f,_,v,!1)}}},array:As,padding:function(i,e,n){return new An(As(i.values,e.values,n))},variableAnchorOffsetCollection:function(i,e,n){const s=i.values,u=e.values;if(s.length!==u.length)throw new Ot(`Cannot interpolate values of different length. from: ${i.toString()}, to: ${e.toString()}`);const f=[];for(let _=0;_<s.length;_+=2){if(s[_]!==u[_])throw new Ot(`Cannot interpolate values containing mismatched anchors. from[${_}]: ${s[_]}, to[${_}]: ${u[_]}`);f.push(s[_]);const[v,T]=s[_+1],[P,C]=u[_+1];f.push([Wt(v,P,n),Wt(T,C,n)])}return new Bt(f)}};class En{constructor(e,n,s,u,f){this.type=e,this.operator=n,this.interpolation=s,this.input=u,this.labels=[],this.outputs=[];for(const[_,v]of f)this.labels.push(_),this.outputs.push(v)}static interpolationFactor(e,n,s,u){let f=0;if(e.name==="exponential")f=Ps(n,e.base,s,u);else if(e.name==="linear")f=Ps(n,1,s,u);else if(e.name==="cubic-bezier"){const _=e.controlPoints;f=new ze(_[0],_[1],_[2],_[3]).solve(Ps(n,1,s,u))}return f}static parse(e,n){let[s,u,f,..._]=e;if(!Array.isArray(u)||u.length===0)return n.error("Expected an interpolation type expression.",1);if(u[0]==="linear")u={name:"linear"};else if(u[0]==="exponential"){const P=u[1];if(typeof P!="number")return n.error("Exponential interpolation requires a numeric base.",1,1);u={name:"exponential",base:P}}else{if(u[0]!=="cubic-bezier")return n.error(`Unknown interpolation type ${String(u[0])}`,1,0);{const P=u.slice(1);if(P.length!==4||P.some(C=>typeof C!="number"||C<0||C>1))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);u={name:"cubic-bezier",controlPoints:P}}}if(e.length-1<4)return n.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(f=n.parse(f,2,Oe),!f)return null;const v=[];let T=null;s==="interpolate-hcl"||s==="interpolate-lab"?T=dn:n.expectedType&&n.expectedType.kind!=="value"&&(T=n.expectedType);for(let P=0;P<_.length;P+=2){const C=_[P],D=_[P+1],O=P+3,Z=P+4;if(typeof C!="number")return n.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',O);if(v.length&&v[v.length-1][0]>=C)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',O);const j=n.parse(D,Z,T);if(!j)return null;T=T||j.type,v.push([C,j])}return Ae(T,Oe)||Ae(T,dn)||Ae(T,B)||Ae(T,q)||Ae(T,Q(Oe))?new En(T,s,u,f,v):n.error(`Type ${ee(T)} is not interpolatable.`)}evaluate(e){const n=this.labels,s=this.outputs;if(n.length===1)return s[0].evaluate(e);const u=this.input.evaluate(e);if(u<=n[0])return s[0].evaluate(e);const f=n.length;if(u>=n[f-1])return s[f-1].evaluate(e);const _=Ni(n,u),v=En.interpolationFactor(this.interpolation,u,n[_],n[_+1]),T=s[_].evaluate(e),P=s[_+1].evaluate(e);switch(this.operator){case"interpolate":return On[this.type.kind](T,P,v);case"interpolate-hcl":return On.color(T,P,v,"hcl");case"interpolate-lab":return On.color(T,P,v,"lab")}}eachChild(e){e(this.input);for(const n of this.outputs)e(n)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Ps(i,e,n,s){const u=s-n,f=i-n;return u===0?0:e===1?f/u:(Math.pow(e,f)-1)/(Math.pow(e,u)-1)}class Hs{constructor(e,n){this.type=e,this.args=n}static parse(e,n){if(e.length<2)return n.error("Expectected at least one argument.");let s=null;const u=n.expectedType;u&&u.kind!=="value"&&(s=u);const f=[];for(const v of e.slice(1)){const T=n.parse(v,1+f.length,s,void 0,{typeAnnotation:"omit"});if(!T)return null;s=s||T.type,f.push(T)}if(!s)throw new Error("No output type");const _=u&&f.some(v=>le(u,v.type));return new Hs(_?Et:s,f)}evaluate(e){let n,s=null,u=0;for(const f of this.args)if(u++,s=f.evaluate(e),s&&s instanceof Ht&&!s.available&&(n||(n=s.name),s=null,u===this.args.length&&(s=n)),s!==null)break;return s}
vendor: 18,414 bytes, line 8
8eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}class Is{constructor(e,n){this.type=n.type,this.bindings=[].concat(e),this.result=n}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const n of this.bindings)e(n[1]);e(this.result)}static parse(e,n){if(e.length<4)return n.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const s=[];for(let f=1;f<e.length-1;f+=2){const _=e[f];if(typeof _!="string")return n.error(`Expected string, but found ${typeof _} instead.`,f);if(/[^a-zA-Z0-9_]/.test(_))return n.error("Variable names must contain only alphanumeric characters or '_'.",f);const v=n.parse(e[f+1],f+1);if(!v)return null;s.push([_,v])}const u=n.parse(e[e.length-1],e.length-1,n.expectedType,s);return u?new Is(s,u):null}outputDefined(){return this.result.outputDefined()}}class oi{constructor(e,n,s){this.type=e,this.index=n,this.input=s}static parse(e,n){if(e.length!==3)return n.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=n.parse(e[1],1,Oe),u=n.parse(e[2],2,Q(n.expectedType||Et));return s&&u?new oi(u.type.itemType,s,u):null}evaluate(e){const n=this.index.evaluate(e),s=this.input.evaluate(e);if(n<0)throw new Ot(`Array index out of bounds: ${n} < 0.`);if(n>=s.length)throw new Ot(`Array index out of bounds: ${n} > ${s.length-1}.`);if(n!==Math.floor(n))throw new Ot(`Array index must be an integer, but found ${n} instead.`);return s[n]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class La{constructor(e,n){this.type=It,this.needle=e,this.haystack=n}static parse(e,n){if(e.length!==3)return n.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const s=n.parse(e[1],1,Et),u=n.parse(e[2],2,Et);return s&&u?re(s.type,[It,Rt,Oe,Dr,Et])?new La(s,u):n.error(`Expected first argument to be of type boolean, string, number or null, but found ${ee(s.type)} instead`):null}evaluate(e){const n=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!s)return!1;if(!ue(n,["boolean","string","number","null"]))throw new Ot(`Expected first argument to be of type boolean, string, number or null, but found ${ee(vi(n))} instead.`);if(!ue(s,["string","array"]))throw new Ot(`Expected second argument to be of type array or string, but found ${ee(vi(s))} instead.`);return s.indexOf(n)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Cn{constructor(e,n,s){this.type=Oe,this.needle=e,this.haystack=n,this.fromIndex=s}static parse(e,n){if(e.length<=2||e.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=n.parse(e[1],1,Et),u=n.parse(e[2],2,Et);if(!s||!u)return null;if(!re(s.type,[It,Rt,Oe,Dr,Et]))return n.error(`Expected first argument to be of type boolean, string, number or null, but found ${ee(s.type)} instead`);if(e.length===4){const f=n.parse(e[3],3,Oe);return f?new Cn(s,u,f):null}return new Cn(s,u)}evaluate(e){const n=this.needle.evaluate(e),s=this.haystack.evaluate(e);if(!ue(n,["boolean","string","number","null"]))throw new Ot(`Expected first argument to be of type boolean, string, number or null, but found ${ee(vi(n))} instead.`);if(!ue(s,["string","array"]))throw new Ot(`Expected second argument to be of type array or string, but found ${ee(vi(s))} instead.`);if(this.fromIndex){const u=this.fromIndex.evaluate(e);return s.indexOf(n,u)}return s.indexOf(n)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Mo{constructor(e,n,s,u,f,_){this.inputType=e,this.type=n,this.input=s,this.cases=u,this.outputs=f,this.otherwise=_}static parse(e,n){if(e.length<5)return n.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return n.error("Expected an even number of arguments.");let s,u;n.expectedType&&n.expectedType.kind!=="value"&&(u=n.expectedType);const f={},_=[];for(let P=2;P<e.length-1;P+=2){let C=e[P];const D=e[P+1];Array.isArray(C)||(C=[C]);const O=n.concat(P);if(C.length===0)return O.error("Expected at least one branch label.");for(const j of C){if(typeof j!="number"&&typeof j!="string")return O.error("Branch labels must be numbers or strings.");if(typeof j=="number"&&Math.abs(j)>Number.MAX_SAFE_INTEGER)return O.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof j=="number"&&Math.floor(j)!==j)return O.error("Numeric branch labels must be integer values.");if(s){if(O.checkSubtype(s,vi(j)))return null}else s=vi(j);if(f[String(j)]!==void 0)return O.error("Branch labels must be unique.");f[String(j)]=_.length}const Z=n.parse(D,P,u);if(!Z)return null;u=u||Z.type,_.push(Z)}const v=n.parse(e[1],1,Et);if(!v)return null;const T=n.parse(e[e.length-1],e.length-1,u);return T?v.type.kind!=="value"&&n.concat(1).checkSubtype(s,v.type)?null:new Mo(s,u,v,f,_,T):null}evaluate(e){const n=this.input.evaluate(e);return(vi(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}}class Ws{constructor(e,n,s){this.type=e,this.branches=n,this.otherwise=s}static parse(e,n){if(e.length<4)return n.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return n.error("Expected an odd number of arguments.");let s;n.expectedType&&n.expectedType.kind!=="value"&&(s=n.expectedType);const u=[];for(let _=1;_<e.length-1;_+=2){const v=n.parse(e[_],_,It);if(!v)return null;const T=n.parse(e[_+1],_+1,s);if(!T)return null;u.push([v,T]),s=s||T.type}const f=n.parse(e[e.length-1],e.length-1,s);if(!f)return null;if(!s)throw new Error("Can't infer output type");return new Ws(s,u,f)}evaluate(e){for(const[n,s]of this.branches)if(n.evaluate(e))return s.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[n,s]of this.branches)e(n),e(s);e(this.otherwise)}outputDefined(){return this.branches.every(([e,n])=>n.outputDefined())&&this.otherwise.outputDefined()}}class Ks{constructor(e,n,s,u){this.type=e,this.input=n,this.beginIndex=s,this.endIndex=u}static parse(e,n){if(e.length<=2||e.length>=5)return n.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const s=n.parse(e[1],1,Et),u=n.parse(e[2],2,Oe);if(!s||!u)return null;if(!re(s.type,[Q(Et),Rt,Et]))return n.error(`Expected first argument to be of type array or string, but found ${ee(s.type)} instead`);if(e.length===4){const f=n.parse(e[3],3,Oe);return f?new Ks(s.type,s,u,f):null}return new Ks(s.type,s,u)}evaluate(e){const n=this.input.evaluate(e),s=this.beginIndex.evaluate(e);if(!ue(n,["string","array"]))throw new Ot(`Expected first argument to be of type array or string, but found ${ee(vi(n))} instead.`);if(this.endIndex){const u=this.endIndex.evaluate(e);return n.slice(s,u)}return n.slice(s)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Xs(i,e){return i==="=="||i==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}function el(i,e,n,s){return s.compare(e,n)===0}function ko(i,e,n){const s=i!=="=="&&i!=="!=";return class nf{constructor(f,_,v){this.type=It,this.lhs=f,this.rhs=_,this.collator=v,this.hasUntypedArgument=f.type.kind==="value"||_.type.kind==="value"}static parse(f,_){if(f.length!==3&&f.length!==4)return _.error("Expected two or three arguments.");const v=f[0];let T=_.parse(f[1],1,Et);if(!T)return null;if(!Xs(v,T.type))return _.concat(1).error(`"${v}" comparisons are not supported for type '${ee(T.type)}'.`);let P=_.parse(f[2],2,Et);if(!P)return null;if(!Xs(v,P.type))return _.concat(2).error(`"${v}" comparisons are not supported for type '${ee(P.type)}'.`);if(T.type.kind!==P.type.kind&&T.type.kind!=="value"&&P.type.kind!=="value")return _.error(`Cannot compare types '${ee(T.type)}' and '${ee(P.type)}'.`);s&&(T.type.kind==="value"&&P.type.kind!=="value"?T=new gn(P.type,[T]):T.type.kind!=="value"&&P.type.kind==="value"&&(P=new gn(T.type,[P])));let C=null;if(f.length===4){if(T.type.kind!=="string"&&P.type.kind!=="string"&&T.type.kind!=="value"&&P.type.kind!=="value")return _.error("Cannot use collator to compare non-string types.");if(C=_.parse(f[3],3,Rr),!C)return null}return new nf(T,P,C)}evaluate(f){const _=this.lhs.evaluate(f),v=this.rhs.evaluate(f);if(s&&this.hasUntypedArgument){const T=vi(_),P=vi(v);if(T.kind!==P.kind||T.kind!=="string"&&T.kind!=="number")throw new Ot(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${T.kind}, ${P.kind}) instead.`)}if(this.collator&&!s&&this.hasUntypedArgument){const T=vi(_),P=vi(v);if(T.kind!=="string"||P.kind!=="string")return e(f,_,v)}return this.collator?n(f,_,v,this.collator.evaluate(f)):e(f,_,v)}eachChild(f){f(this.lhs),f(this.rhs),this.collator&&f(this.collator)}outputDefined(){return!0}}}const Cl=ko("==",function(i,e,n){return e===n},el),Ml=ko("!=",function(i,e,n){return e!==n},function(i,e,n,s){return!el(0,e,n,s)}),Ea=ko("<",function(i,e,n){return e<n},function(i,e,n,s){return s.compare(e,n)<0}),kl=ko(">",function(i,e,n){return e>n},function(i,e,n,s){return s.compare(e,n)>0}),Sr=ko("<=",function(i,e,n){return e<=n},function(i,e,n,s){return s.compare(e,n)<=0}),zl=ko(">=",function(i,e,n){return e>=n},function(i,e,n,s){return s.compare(e,n)>=0});class Ys{constructor(e,n,s,u,f){this.type=Rt,this.number=e,this.locale=n,this.currency=s,this.minFractionDigits=u,this.maxFractionDigits=f}static parse(e,n){if(e.length!==3)return n.error("Expected two arguments.");const s=n.parse(e[1],1,Oe);if(!s)return null;const u=e[2];if(typeof u!="object"||Array.isArray(u))return n.error("NumberFormat options argument must be an object.");let f=null;if(u.locale&&(f=n.parse(u.locale,1,Rt),!f))return null;let _=null;if(u.currency&&(_=n.parse(u.currency,1,Rt),!_))return null;let v=null;if(u["min-fraction-digits"]&&(v=n.parse(u["min-fraction-digits"],1,Oe),!v))return null;let T=null;return u["max-fraction-digits"]&&(T=n.parse(u["max-fraction-digits"],1,Oe),!T)?null:new Ys(s,f,_,v,T)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class hr{constructor(e){this.type=Y,this.sections=e}static parse(e,n){if(e.length<2)return n.error("Expected at least one argument.");const s=e[1];if(!Array.isArray(s)&&typeof s=="object")return n.error("First argument must be an image or text section.");const u=[];let f=!1;for(let _=1;_<=e.length-1;++_){const v=e[_];if(f&&typeof v=="object"&&!Array.isArray(v)){f=!1;let T=null;if(v["font-scale"]&&(T=n.parse(v["font-scale"],1,Oe),!T))return null;let P=null;if(v["text-font"]&&(P=n.parse(v["text-font"],1,Q(Rt)),!P))return null;let C=null;if(v["text-color"]&&(C=n.parse(v["text-color"],1,dn),!C))return null;const D=u[u.length-1];D.scale=T,D.font=P,D.textColor=C}else{const T=n.parse(e[_],1,Et);if(!T)return null;const P=T.type.kind;if(P!=="string"&&P!=="value"&&P!=="null"&&P!=="resolvedImage")return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");f=!0,u.push({content:T,scale:null,font:null,textColor:null})}}return new hr(u)}evaluate(e){return new tn(this.sections.map(n=>{const s=n.content.evaluate(e);return vi(s)===F?new io("",s,null,null,null):new io(ai(s),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null)}))}eachChild(e){for(const n of this.sections)e(n.content),n.scale&&e(n.scale),n.font&&e(n.font),n.textColor&&e(n.textColor)}outputDefined(){return!1}}class Js{constructor(e){this.type=F,this.input=e}static parse(e,n){if(e.length!==2)return n.error("Expected two arguments.");const s=n.parse(e[1],1,Rt);return s?new Js(s):n.error("No image name provided.")}evaluate(e){const n=this.input.evaluate(e),s=Ht.fromString(n);return s&&e.availableImages&&(s.available=e.availableImages.indexOf(n)>-1),s}eachChild(e){e(this.input)}outputDefined(){return!1}}class Qs{constructor(e){this.type=Oe,this.input=e}static parse(e,n){if(e.length!==2)return n.error(`Expected 1 argument, but found ${e.length-1} instead.`);const s=n.parse(e[1],1);return s?s.type.kind!=="array"&&s.type.kind!=="string"&&s.type.kind!=="value"?n.error(`Expected argument of type string or array, but found ${ee(s.type)} instead.`):new Qs(s):null}evaluate(e){const n=this.input.evaluate(e);if(typeof n=="string"||Array.isArray(n))return n.length;throw new Ot(`Expected value to be of type string or array, but found ${ee(vi(n))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const so={"==":Cl,"!=":Ml,">":kl,"<":Ea,">=":zl,"<=":Sr,array:gn,at:oi,boolean:gn,case:Ws,coalesce:Hs,collator:wr,format:hr,image:Js,in:La,"index-of":Cn,interpolate:En,"interpolate-hcl":En,"interpolate-lab":En,length:Qs,let:Is,literal:kt,match:Mo,number:gn,"number-format":Ys,object:gn,slice:Ks,step:Ln,string:gn,"to-boolean":no,"to-color":no,"to-number":no,"to-string":no,var:is,within:ro};function tl(i,[e,n,s,u]){e=e.evaluate(i),n=n.evaluate(i),s=s.evaluate(i);const f=u?u.evaluate(i):1,_=Io(e,n,s,f);if(_)throw new Ot(_);return new _i(e/255,n/255,s/255,f,!1)}function Ca(i,e){return i in e}function ea(i,e){const n=e[i];return n===void 0?null:n}function zo(i){return{type:i}}function il(i){return{result:"success",value:i}}function Ar(i){return{result:"error",value:i}}function rs(i){return i["property-type"]==="data-driven"||i["property-type"]==="cross-faded-data-driven"}function Ma(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function ta(i){return!!i.expression&&i.expression.interpolated}function si(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":i===null?"null":typeof i}function gi(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function Dl(i){return i}function Zt(i,e){const n=e.type==="color",s=i.stops&&typeof i.stops[0][0]=="object",u=s||!(s||i.property!==void 0),f=i.type||(ta(e)?"exponential":"interval");if(n||e.type==="padding"){const C=n?_i.parse:An.parse;(i=lr({},i)).stops&&(i.stops=i.stops.map(D=>[D[0],C(D[1])])),i.default=C(i.default?i.default:e.default)}if(i.colorSpace&&(_=i.colorSpace)!=="rgb"&&_!=="hcl"&&_!=="lab")throw new Error(`Unknown color space: "${i.colorSpace}"`);var _;let v,T,P;if(f==="exponential")v=Ls;else if(f==="interval")v=Ai;else if(f==="categorical"){v=Mi,T=Object.create(null);for(const C of i.stops)T[C[0]]=C[1];P=typeof i.stops[0][0]}else{if(f!=="identity")throw new Error(`Unknown function type "${f}"`);v=ia}if(s){const C={},D=[];for(let j=0;j<i.stops.length;j++){const H=i.stops[j],te=H[0].zoom;C[te]===void 0&&(C[te]={zoom:te,type:i.type,property:i.property,default:i.default,stops:[]},D.push(te)),C[te].stops.push([H[0].value,H[1]])}const O=[];for(const j of D)O.push([C[j].zoom,Zt(C[j],e)]);const Z={name:"linear"};return{kind:"composite",interpolationType:Z,interpolationFactor:En.interpolationFactor.bind(void 0,Z),zoomStops:O.map(j=>j[0]),evaluate:({zoom:j},H)=>Ls({stops:O,base:i.base},e,j).evaluate(j,H)}}if(u){const C=f==="exponential"?{name:"exponential",base:i.base!==void 0?i.base:1}:null;return{kind:"camera",interpolationType:C,interpolationFactor:En.interpolationFactor.bind(void 0,C),zoomStops:i.stops.map(D=>D[0]),evaluate:({zoom:D})=>v(i,e,D,T,P)}}return{kind:"source",evaluate(C,D){const O=D&&D.properties?D.properties[i.property]:void 0;return O===void 0?Yi(i.default,e.default):v(i,e,O,T,P)}}}function Yi(i,e,n){return i!==void 0?i:e!==void 0?e:n!==void 0?n:void 0}function Mi(i,e,n,s,u){return Yi(typeof n===u?s[n]:void 0,i.default,e.default)}function Ai(i,e,n){if(si(n)!=="number")return Yi(i.default,e.default);const s=i.stops.length;if(s===1||n<=i.stops[0][0])return i.stops[0][1];if(n>=i.stops[s-1][0])return i.stops[s-1][1];const u=Ni(i.stops.map(f=>f[0]),n);return i.stops[u][1]}function Ls(i,e,n){const s=i.base!==void 0?i.base:1;if(si(n)!=="number")return Yi(i.default,e.default);const u=i.stops.length;if(u===1||n<=i.stops[0][0])return i.stops[0][1];if(n>=i.stops[u-1][0])return i.stops[u-1][1];const f=Ni(i.stops.map(C=>C[0]),n),_=function(C,D,O,Z){const j=Z-O,H=C-O;return j===0?0:D===1?H/j:(Math.pow(D,H)-1)/(Math.pow(D,j)-1)}(n,s,i.stops[f][0],i.stops[f+1][0]),v=i.stops[f][1],T=i.stops[f+1][1],P=On[e.type]||Dl;return typeof v.evaluate=="function"?{evaluate(...C){const D=v.evaluate.apply(void 0,C),O=T.evaluate.apply(void 0,C);if(D!==void 0&&O!==void 0)return P(D,O,_,i.colorSpace)}}:P(v,T,_,i.colorSpace)}function ia(i,e,n){switch(e.type){case"color":n=_i.parse(n);break;case"formatted":n=tn.fromString(n.toString());break;case"resolvedImage":n=Ht.fromString(n.toString());break;case"padding":n=An.parse(n);break;default:si(n)===e.type||e.type==="enum"&&e.values[n]||(n=void 0)}return Yi(n,i.default,e.default)}In.register(so,{error:[{kind:"error"},[Rt],(i,[e])=>{throw new Ot(e.evaluate(i))}],typeof:[Rt,[Et],(i,[e])=>ee(vi(e.evaluate(i)))],"to-rgba":[Q(Oe,4),[dn],(i,[e])=>{const[n,s,u,f]=e.evaluate(i).rgb;return[255*n,255*s,255*u,f]}],rgb:[dn,[Oe,Oe,Oe],tl],rgba:[dn,[Oe,Oe,Oe,Oe],tl],has:{type:It,overloads:[[[Rt],(i,[e])=>Ca(e.evaluate(i),i.properties())],[[Rt,cr],(i,[e,n])=>Ca(e.evaluate(i),n.evaluate(i))]]},get:{type:Et,overloads:[[[Rt],(i,[e])=>ea(e.evaluate(i),i.properties())],[[Rt,cr],(i,[e,n])=>ea(e.evaluate(i),n.evaluate(i))]]},"feature-state":[Et,[Rt],(i,[e])=>ea(e.evaluate(i),i.featureState||{})],properties:[cr,[],i=>i.properties()],"geometry-type":[Rt,[],i=>i.geometryType()],id:[Et,[],i=>i.id()],zoom:[Oe,[],i=>i.globals.zoom],"heatmap-density":[Oe,[],i=>i.globals.heatmapDensity||0],"line-progress":[Oe,[],i=>i.globals.lineProgress||0],accumulated:[Et,[],i=>i.globals.accumulated===void 0?null:i.globals.accumulated],"+":[Oe,zo(Oe),(i,e)=>{let n=0;for(const s of e)n+=s.evaluate(i);return n}],"*":[Oe,zo(Oe),(i,e)=>{let n=1;for(const s of e)n*=s.evaluate(i);return n}
vendor: 7,580 bytes, line 8
8],"-":{type:Oe,overloads:[[[Oe,Oe],(i,[e,n])=>e.evaluate(i)-n.evaluate(i)],[[Oe],(i,[e])=>-e.evaluate(i)]]},"/":[Oe,[Oe,Oe],(i,[e,n])=>e.evaluate(i)/n.evaluate(i)],"%":[Oe,[Oe,Oe],(i,[e,n])=>e.evaluate(i)%n.evaluate(i)],ln2:[Oe,[],()=>Math.LN2],pi:[Oe,[],()=>Math.PI],e:[Oe,[],()=>Math.E],"^":[Oe,[Oe,Oe],(i,[e,n])=>Math.pow(e.evaluate(i),n.evaluate(i))],sqrt:[Oe,[Oe],(i,[e])=>Math.sqrt(e.evaluate(i))],log10:[Oe,[Oe],(i,[e])=>Math.log(e.evaluate(i))/Math.LN10],ln:[Oe,[Oe],(i,[e])=>Math.log(e.evaluate(i))],log2:[Oe,[Oe],(i,[e])=>Math.log(e.evaluate(i))/Math.LN2],sin:[Oe,[Oe],(i,[e])=>Math.sin(e.evaluate(i))],cos:[Oe,[Oe],(i,[e])=>Math.cos(e.evaluate(i))],tan:[Oe,[Oe],(i,[e])=>Math.tan(e.evaluate(i))],asin:[Oe,[Oe],(i,[e])=>Math.asin(e.evaluate(i))],acos:[Oe,[Oe],(i,[e])=>Math.acos(e.evaluate(i))],atan:[Oe,[Oe],(i,[e])=>Math.atan(e.evaluate(i))],min:[Oe,zo(Oe),(i,e)=>Math.min(...e.map(n=>n.evaluate(i)))],max:[Oe,zo(Oe),(i,e)=>Math.max(...e.map(n=>n.evaluate(i)))],abs:[Oe,[Oe],(i,[e])=>Math.abs(e.evaluate(i))],round:[Oe,[Oe],(i,[e])=>{const n=e.evaluate(i);return n<0?-Math.round(-n):Math.round(n)}],floor:[Oe,[Oe],(i,[e])=>Math.floor(e.evaluate(i))],ceil:[Oe,[Oe],(i,[e])=>Math.ceil(e.evaluate(i))],"filter-==":[It,[Rt,Et],(i,[e,n])=>i.properties()[e.value]===n.value],"filter-id-==":[It,[Et],(i,[e])=>i.id()===e.value],"filter-type-==":[It,[Rt],(i,[e])=>i.geometryType()===e.value],"filter-<":[It,[Rt,Et],(i,[e,n])=>{const s=i.properties()[e.value],u=n.value;return typeof s==typeof u&&s<u}],"filter-id-<":[It,[Et],(i,[e])=>{const n=i.id(),s=e.value;return typeof n==typeof s&&n<s}],"filter->":[It,[Rt,Et],(i,[e,n])=>{const s=i.properties()[e.value],u=n.value;return typeof s==typeof u&&s>u}],"filter-id->":[It,[Et],(i,[e])=>{const n=i.id(),s=e.value;return typeof n==typeof s&&n>s}],"filter-<=":[It,[Rt,Et],(i,[e,n])=>{const s=i.properties()[e.value],u=n.value;return typeof s==typeof u&&s<=u}],"filter-id-<=":[It,[Et],(i,[e])=>{const n=i.id(),s=e.value;return typeof n==typeof s&&n<=s}],"filter->=":[It,[Rt,Et],(i,[e,n])=>{const s=i.properties()[e.value],u=n.value;return typeof s==typeof u&&s>=u}],"filter-id->=":[It,[Et],(i,[e])=>{const n=i.id(),s=e.value;return typeof n==typeof s&&n>=s}],"filter-has":[It,[Et],(i,[e])=>e.value in i.properties()],"filter-has-id":[It,[],i=>i.id()!==null&&i.id()!==void 0],"filter-type-in":[It,[Q(Rt)],(i,[e])=>e.value.indexOf(i.geometryType())>=0],"filter-id-in":[It,[Q(Et)],(i,[e])=>e.value.indexOf(i.id())>=0],"filter-in-small":[It,[Rt,Q(Et)],(i,[e,n])=>n.value.indexOf(i.properties()[e.value])>=0],"filter-in-large":[It,[Rt,Q(Et)],(i,[e,n])=>function(s,u,f,_){for(;f<=_;){const v=f+_>>1;if(u[v]===s)return!0;u[v]>s?_=v-1:f=v+1}return!1}(i.properties()[e.value],n.value,0,n.value.length-1)],all:{type:It,overloads:[[[It,It],(i,[e,n])=>e.evaluate(i)&&n.evaluate(i)],[zo(It),(i,e)=>{for(const n of e)if(!n.evaluate(i))return!1;return!0}]]},any:{type:It,overloads:[[[It,It],(i,[e,n])=>e.evaluate(i)||n.evaluate(i)],[zo(It),(i,e)=>{for(const n of e)if(n.evaluate(i))return!0;return!1}]]},"!":[It,[It],(i,[e])=>!e.evaluate(i)],"is-supported-script":[It,[Rt],(i,[e])=>{const n=i.globals&&i.globals.isSupportedScript;return!n||n(e.evaluate(i))}],upcase:[Rt,[Rt],(i,[e])=>e.evaluate(i).toUpperCase()],downcase:[Rt,[Rt],(i,[e])=>e.evaluate(i).toLowerCase()],concat:[Rt,zo(Et),(i,e)=>e.map(n=>ai(n.evaluate(i))).join("")],"resolved-locale":[Rt,[Rr],(i,[e])=>e.evaluate(i).resolvedLocale()]});class Es{constructor(e,n){var s;this.expression=e,this._warningHistory={},this._evaluator=new Br,this._defaultValue=n?(s=n).type==="color"&&gi(s.default)?new _i(0,0,0,0):s.type==="color"?_i.parse(s.default)||null:s.type==="padding"?An.parse(s.default)||null:s.type==="variableAnchorOffsetCollection"?Bt.parse(s.default)||null:s.default===void 0?null:s.default:null,this._enumValues=n&&n.type==="enum"?n.values:null}evaluateWithoutErrorHandling(e,n,s,u,f,_){return this._evaluator.globals=e,this._evaluator.feature=n,this._evaluator.featureState=s,this._evaluator.canonical=u,this._evaluator.availableImages=f||null,this._evaluator.formattedSection=_,this.expression.evaluate(this._evaluator)}evaluate(e,n,s,u,f,_){this._evaluator.globals=e,this._evaluator.feature=n||null,this._evaluator.featureState=s||null,this._evaluator.canonical=u,this._evaluator.availableImages=f||null,this._evaluator.formattedSection=_||null;try{const v=this.expression.evaluate(this._evaluator);if(v==null||typeof v=="number"&&v!=v)return this._defaultValue;if(this._enumValues&&!(v in this._enumValues))throw new Ot(`Expected value to be one of ${Object.keys(this._enumValues).map(T=>JSON.stringify(T)).join(", ")}, but found ${JSON.stringify(v)} instead.`);return v}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console!="undefined"&&console.warn(v.message)),this._defaultValue}}}function na(i){return Array.isArray(i)&&i.length>0&&typeof i[0]=="string"&&i[0]in so}function ra(i,e){const n=new Oi(so,ns,[],e?function(u){const f={color:dn,string:Rt,number:Oe,enum:Rt,boolean:It,formatted:Y,padding:B,resolvedImage:F,variableAnchorOffsetCollection:q};return u.type==="array"?Q(f[u.value]||Et,u.length):f[u.type]}(e):void 0),s=n.parse(i,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return s?il(new Es(s,e)):Ar(n.errors)}class oa{constructor(e,n){this.kind=e,this._styleExpression=n,this.isStateDependent=e!=="constant"&&!Co(n.expression)}evaluateWithoutErrorHandling(e,n,s,u,f,_){return this._styleExpression.evaluateWithoutErrorHandling(e,n,s,u,f,_)}evaluate(e,n,s,u,f,_){return this._styleExpression.evaluate(e,n,s,u,f,_)}}class sa{constructor(e,n,s,u){this.kind=e,this.zoomStops=s,this._styleExpression=n,this.isStateDependent=e!=="camera"&&!Co(n.expression),this.interpolationType=u}evaluateWithoutErrorHandling(e,n,s,u,f,_){return this._styleExpression.evaluateWithoutErrorHandling(e,n,s,u,f,_)}evaluate(e,n,s,u,f,_){return this._styleExpression.evaluate(e,n,s,u,f,_)}interpolationFactor(e,n,s){return this.interpolationType?En.interpolationFactor(this.interpolationType,e,n,s):0}}function Fn(i,e){const n=ra(i,e);if(n.result==="error")return n;const s=n.value.expression,u=Tr(s);if(!u&&!rs(e))return Ar([new Ci("","data expressions not supported")]);const f=oo(s,["zoom"]);if(!f&&!Ma(e))return Ar([new Ci("","zoom expressions not supported")]);const _=Cs(s);return _||f?_ instanceof Ci?Ar([_]):_ instanceof En&&!ta(e)?Ar([new Ci("",'"interpolate" expressions cannot be used with this property')]):il(_?new sa(u?"camera":"composite",n.value,_.labels,_ instanceof En?_.interpolation:void 0):new oa(u?"constant":"source",n.value)):Ar([new Ci("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Pr{constructor(e,n){this._parameters=e,this._specification=n,lr(this,Zt(this._parameters,this._specification))}static deserialize(e){return new Pr(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Cs(i){let e=null;if(i instanceof Is)e=Cs(i.result);else if(i instanceof Hs){for(const n of i.args)if(e=Cs(n),e)break}else(i instanceof Ln||i instanceof En)&&i.input instanceof In&&i.input.name==="zoom"&&(e=i);return e instanceof Ci||i.eachChild(n=>{const s=Cs(n);s instanceof Ci?e=s:!e&&s?e=new Ci("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&s&&e!==s&&(e=new Ci("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Nn(i){if(i===!0||i===!1)return!0;
vendor: 4,413 bytes, line 8
8if(!Array.isArray(i)||i.length===0)return!1;switch(i[0]){case"has":return i.length>=2&&i[1]!=="$id"&&i[1]!=="$type";case"in":return i.length>=3&&(typeof i[1]!="string"||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return i.length!==3||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const e of i.slice(1))if(!Nn(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}const Rl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ao(i){if(i==null)return{filter:()=>!0,needGeometry:!1};Nn(i)||(i=Ms(i));const e=ra(i,Rl);if(e.result==="error")throw new Error(e.value.map(n=>`${n.key}: ${n.message}`).join(", "));return{filter:(n,s,u)=>e.value.evaluate(n,s,{},u),needGeometry:os(i)}}function Bl(i,e){return i<e?-1:i>e?1:0}function os(i){if(!Array.isArray(i))return!1;if(i[0]==="within")return!0;for(let e=1;e<i.length;e++)if(os(i[e]))return!0;return!1}function Ms(i){if(!i)return!0;const e=i[0];return i.length<=1?e!=="any":e==="=="?ss(i[1],i[2],"=="):e==="!="?lo(ss(i[1],i[2],"==")):e==="<"||e===">"||e==="<="||e===">="?ss(i[1],i[2],e):e==="any"?(n=i.slice(1),["any"].concat(n.map(Ms))):e==="all"?["all"].concat(i.slice(1).map(Ms)):e==="none"?["all"].concat(i.slice(1).map(Ms).map(lo)):e==="in"?nl(i[1],i.slice(2)):e==="!in"?lo(nl(i[1],i.slice(2))):e==="has"?Or(i[1]):e==="!has"?lo(Or(i[1])):e!=="within"||i;var n}function ss(i,e,n){switch(i){case"$type":return[`filter-type-${n}`,e];case"$id":return[`filter-id-${n}`,e];default:return[`filter-${n}`,i,e]}}function nl(i,e){if(e.length===0)return!1;switch(i){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(n=>typeof n!=typeof e[0])?["filter-in-large",i,["literal",e.sort(Bl)]]:["filter-in-small",i,["literal",e]]}}function Or(i){switch(i){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",i]}}function lo(i){return["!",i]}function aa(i){const e=typeof i;if(e==="number"||e==="boolean"||e==="string"||i==null)return JSON.stringify(i);if(Array.isArray(i)){let u="[";for(const f of i)u+=`${aa(f)},`;return`${u}]`}const n=Object.keys(i).sort();let s="{";for(let u=0;u<n.length;u++)s+=`${JSON.stringify(n[u])}:${aa(i[n[u]])},`;return`${s}}`}function as(i){let e="";for(const n of hn)e+=`/${aa(i[n])}`;return e}function rl(i){const e=i.value;return e?[new Fe(i.key,e,"constants have been deprecated as of v8")]:[]}function ui(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function Do(i){if(Array.isArray(i))return i.map(Do);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const e={};for(const n in i)e[n]=Do(i[n]);return e}return ui(i)}function Wi(i){const e=i.key,n=i.value,s=i.valueSpec||{},u=i.objectElementValidators||{},f=i.style,_=i.styleSpec,v=i.validateSpec;let T=[];const P=si(n);if(P!=="object")return[new Fe(e,n,`object expected, ${P} found`)];for(const C in n){const D=C.split(".")[0],O=s[D]||s["*"];let Z;if(u[D])Z=u[D];else if(s[D])Z=v;else if(u["*"])Z=u["*"];else{if(!s["*"]){T.push(new Fe(e,n[C],`unknown property "${C}"`));continue}Z=v}T=T.concat(Z({key:(e&&`${e}.`)+C,value:n[C],valueSpec:O,style:f,styleSpec:_,object:n,objectKey:C,validateSpec:v},n))}for(const C in s)u[C]||s[C].required&&s[C].default===void 0&&n[C]===void 0&&T.push(new Fe(e,n,`missing required property "${C}"`));return T}function ls(i){const e=i.value,n=i.valueSpec,s=i.style,u=i.styleSpec,f=i.key,_=i.arrayElementValidator||i.validateSpec;if(si(e)!=="array")return[new Fe(f,e,`array expected, ${si(e)} found`)];if(n.length&&e.length!==n.length)return[new Fe(f,e,`array length ${n.length} expected, length ${e.length} found`)];if(n["min-length"]&&e.length<n["min-length"])return[new Fe(f,e,`array length at least ${n["min-length"]} expected, length ${e.length} found`)];let v={type:n.value,values:n.values};u.$version<7&&(v.function=n.function),si(n.value)==="object"&&(v=n.value);let T=[];for(let P=0;P<e.length;P++)T=T.concat(_({array:e,arrayIndex:P,value:e[P],valueSpec:v,validateSpec:i.validateSpec,style:s,styleSpec:u,key:`${f}[${P}]`}));return T}function Un(i){const e=i.key,n=i.value,s=i.valueSpec;let u=si(n);return u==="number"&&n!=n&&(u="NaN"),u!=="number"?[new Fe(e,n,`number expected, ${u}
8 found`)]:"minimum"in s&&n<s.minimum?[new Fe(e,n,`${n} is less than the minimum value ${s.minimum}`)]:"maximum"in s&&n>s.maximum?[new Fe(e,n,`${n} is greater than the maximum value ${s.maximum}`)]:[]}function Ro(i){const e=i.valueSpec,n=ui(i.value.type);let s,u,f,_={};const v=n!=="categorical"&&i.value.property===void 0,T=!v,P=si(i.value.stops)==="array"&&si(i.value.stops[0])==="array"&&si(i.value.stops[0][0])==="object",C=Wi({key:i.key,value:i.value,valueSpec:i.styleSpec.function,validateSpec:i.validateSpec,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(Z){if(n==="identity")return[new Fe(Z.key,Z.value,'identity function may not have a "stops" property')];let j=[];const H=Z.value;return j=j.concat(ls({key:Z.key,value:H,valueSpec:Z.valueSpec,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec,arrayElementValidator:D})),si(H)==="array"&&H.length===0&&j.push(new Fe(Z.key,H,"array must have at least one stop")),j},default:function(Z){return Z.validateSpec({key:Z.key,value:Z.value,valueSpec:e,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec})}}});return n==="identity"&&v&&C.push(new Fe(i.key,i.value,'missing required property "property"')),n==="identity"||i.value.stops||C.push(new Fe(i.key,i.value,'missing required property "stops"')),n==="exponential"&&i.valueSpec.expression&&!ta(i.valueSpec)&&C.push(new Fe(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(T&&!rs(i.valueSpec)?C.push(new Fe(i.key,i.value,"property functions not supported")):v&&!Ma(i.valueSpec)&&C.push(new Fe(i.key,i.value,"zoom functions not supported"))),n!=="categorical"&&!P||i.value.property!==void 0||C.push(new Fe(i.key,i.value,'"property" property is required')),C;function D(Z){let j=[];const H=Z.value,te=Z.key;if(si(H)!=="array")return[new Fe(te,H,`array expected, ${si(H)} found`)];if(H.length!==2)return[new Fe(te,H,`array length 2 expected, length ${H.length} found`)];if(P){if(si(H[0])!=="object")return[new Fe(te,H,`object expected, ${si(H[0])} found`)];if(H[0].zoom===void 0)return[new Fe(te,H,"object stop key must have zoom")];if(H[0].value===void 0)return[new Fe(te,H,"object stop key must have value")];if(f&&f>ui(H[0].zoom))return[new Fe(te,H[0].zoom,"stop zoom values must appear in ascending order")];ui(H[0].zoom)!==f&&(f=ui(H[0].zoom),u=void 0,_={}),j=j.concat(Wi({key:`${te}[0]`,value:H[0],valueSpec:{zoom:{}},validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec,objectElementValidators:{zoom:Un,value:O}}))}else j=j.concat(O({key:`${te}[0]`,value:H[0],valueSpec:{},validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec},H));return na(Do(H[1]))?j.concat([new Fe(`${te}[1]`,H[1],"expressions are not allowed in function stops.")]):j.concat(Z.validateSpec({key:`${te}[1]`,value:H[1],valueSpec:e,validateSpec:Z.validateSpec,style:Z.style,styleSpec:Z.styleSpec}))}function O(Z,j){const H=si(Z.value),te=ui(Z.value),oe=Z.value!==null?Z.value:j;if(s){if(H!==s)return[new Fe(Z.key,oe,`${H} stop domain type must match previous stop domain type ${s}`)]}else s=H;if(H!=="number"&&H!=="string"&&H!=="boolean")return[new Fe(Z.key,oe,"stop domain value must be a number, string, or boolean")];if(H!=="number"&&n!=="categorical"){let de=`number expected, ${H} found`;return rs(e)&&n===void 0&&(de+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Fe(Z.key,oe,de)]}return n!=="categorical"||H!=="number"||isFinite(te)&&Math.floor(te)===te?n!=="categorical"&&H==="number"&&u!==void 0&&te<u?[new Fe(Z.key,oe,"stop domain values must appear in ascending order")]:(u=te,n==="categorical"&&te in _?[new Fe(Z.key,oe,"stop domain values must be unique")]:(_[te]=!0,[])):[new Fe(Z.key,oe,`integer expected, found ${te}`)]}}function co(i){const e=(i.expressionContext==="property"?Fn:ra)(Do(i.value),i.valueSpec);if(e.result==="error")return e.value.map(s=>new Fe(`${i.key}${s.key}`,i.value,s.message));const n=e.value.expression||e.value._styleExpression.expression;if(i.expressionContext==="property"&&i.propertyKey==="text-font"&&!n.outputDefined())return[new Fe(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if(i.expressionContext==="property"&&i.propertyType==="layout"&&!Co(n))return[new Fe(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if(i.expressionContext==="filter"&&!Co(n))return[new Fe(i.key,i.value,'"feature-state" data expressions are not supported with filters.')];if(i.expressionContext&&i.expressionContext.indexOf("cluster")===0){if(!oo(n,["zoom","feature-state"]))return[new Fe(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(i.expressionContext==="cluster-initial"&&!Tr(n))return[new Fe(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Bo(i){const e=i.key,n=i.value,s=i.valueSpec,u=[];return Array.isArray(s.values)?s.values.indexOf(ui(n))===-1&&u.push(new Fe(e,n,`expected one of [${s.values.join(", ")}], ${JSON.stringify(n)} found`)):Object.keys(s.values).indexOf(ui(n))===-1&&u.push(new Fe(e,n,`expected one of [${Object.keys(s.values).join(", ")}], ${JSON.stringify(n)} found`)),u}function Fr(i){return Nn(Do(i.value))?co(lr({},i,{expressionContext:"filter",valueSpec:{value:"boolean"}})):la(i)}
vendor: 15,445 bytes, lines 8-9
8function la(i){const e=i.value,n=i.key;if(si(e)!=="array")return[new Fe(n,e,`array expected, ${si(e)} found`)];const s=i.styleSpec;let u,f=[];if(e.length<1)return[new Fe(n,e,"filter array must have at least 1 element")];switch(f=f.concat(Bo({key:`${n}[0]`,value:e[0],valueSpec:s.filter_operator,style:i.style,styleSpec:i.styleSpec})),ui(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&ui(e[1])==="$type"&&f.push(new Fe(n,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&f.push(new Fe(n,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(u=si(e[1]),u!=="string"&&f.push(new Fe(`${n}[1]`,e[1],`string expected, ${u} found`)));for(let _=2;_<e.length;_++)u=si(e[_]),ui(e[1])==="$type"?f=f.concat(Bo({key:`${n}[${_}]`,value:e[_],valueSpec:s.geometry_type,style:i.style,styleSpec:i.styleSpec})):u!=="string"&&u!=="number"&&u!=="boolean"&&f.push(new Fe(`${n}[${_}]`,e[_],`string, number, or boolean expected, ${u} found`));break;case"any":case"all":case"none":for(let _=1;_<e.length;_++)f=f.concat(la({key:`${n}[${_}]`,value:e[_],style:i.style,styleSpec:i.styleSpec}));break;case"has":case"!has":u=si(e[1]),e.length!==2?f.push(new Fe(n,e,`filter array for "${e[0]}" operator must have 2 elements`)):u!=="string"&&f.push(new Fe(`${n}[1]`,e[1],`string expected, ${u} found`));break;case"within":u=si(e[1]),e.length!==2?f.push(new Fe(n,e,`filter array for "${e[0]}" operator must have 2 elements`)):u!=="object"&&f.push(new Fe(`${n}[1]`,e[1],`object expected, ${u} found`))}return f}function ks(i,e){const n=i.key,s=i.validateSpec,u=i.style,f=i.styleSpec,_=i.value,v=i.objectKey,T=f[`${e}_${i.layerType}`];if(!T)return[];const P=v.match(/^(.*)-transition$/);if(e==="paint"&&P&&T[P[1]]&&T[P[1]].transition)return s({key:n,value:_,valueSpec:f.transition,style:u,styleSpec:f});const C=i.valueSpec||T[v];if(!C)return[new Fe(n,_,`unknown property "${v}"`)];let D;if(si(_)==="string"&&rs(C)&&!C.tokens&&(D=/^{([^}]+)}$/.exec(_)))return[new Fe(n,_,`"${v}" does not support interpolation syntax
9Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(D[1])} }\`.`)];const O=[];return i.layerType==="symbol"&&(v==="text-field"&&u&&!u.glyphs&&O.push(new Fe(n,_,'use of "text-field" requires a style "glyphs" property')),v==="text-font"&&gi(Do(_))&&ui(_.type)==="identity"&&O.push(new Fe(n,_,'"text-font" does not support identity functions'))),O.concat(s({key:i.key,value:_,valueSpec:C,style:u,styleSpec:f,expressionContext:"property",propertyType:e,propertyKey:v}))}function Oo(i){return ks(i,"paint")}function zs(i){return ks(i,"layout")}function ca(i){let e=[];const n=i.value,s=i.key,u=i.style,f=i.styleSpec;n.type||n.ref||e.push(new Fe(s,n,'either "type" or "ref" is required'));let _=ui(n.type);const v=ui(n.ref);if(n.id){const T=ui(n.id);for(let P=0;P<i.arrayIndex;P++){const C=u.layers[P];ui(C.id)===T&&e.push(new Fe(s,n.id,`duplicate layer id "${n.id}", previously used at line ${C.id.__line__}`))}}if("ref"in n){let T;["type","source","source-layer","filter","layout"].forEach(P=>{P in n&&e.push(new Fe(s,n[P],`"${P}" is prohibited for ref layers`))}),u.layers.forEach(P=>{ui(P.id)===v&&(T=P)}),T?T.ref?e.push(new Fe(s,n.ref,"ref cannot reference another ref layer")):_=ui(T.type):e.push(new Fe(s,n.ref,`ref layer "${v}" not found`))}else if(_!=="background")if(n.source){const T=u.sources&&u.sources[n.source],P=T&&ui(T.type);T?P==="vector"&&_==="raster"?e.push(new Fe(s,n.source,`layer "${n.id}" requires a raster source`)):P!=="raster-dem"&&_==="hillshade"?e.push(new Fe(s,n.source,`layer "${n.id}" requires a raster-dem source`)):P==="raster"&&_!=="raster"?e.push(new Fe(s,n.source,`layer "${n.id}" requires a vector source`)):P!=="vector"||n["source-layer"]?P==="raster-dem"&&_!=="hillshade"?e.push(new Fe(s,n.source,"raster-dem source can only be used with layer type 'hillshade'.")):_!=="line"||!n.paint||!n.paint["line-gradient"]||P==="geojson"&&T.lineMetrics||e.push(new Fe(s,n,`layer "${n.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Fe(s,n,`layer "${n.id}" must specify a "source-layer"`)):e.push(new Fe(s,n.source,`source "${n.source}" not found`))}else e.push(new Fe(s,n,'missing required property "source"'));return e=e.concat(Wi({key:s,value:n,valueSpec:f.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${s}.type`,value:n.type,valueSpec:f.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:n,objectKey:"type"}),filter:Fr,layout:T=>Wi({layer:n,key:T.key,value:T.value,style:T.style,styleSpec:T.styleSpec,validateSpec:T.validateSpec,objectElementValidators:{"*":P=>zs(lr({layerType:_},P))}}),paint:T=>Wi({layer:n,key:T.key,value:T.value,style:T.style,styleSpec:T.styleSpec,validateSpec:T.validateSpec,objectElementValidators:{"*":P=>Oo(lr({layerType:_},P))}})}})),e}function dr(i){const e=i.value,n=i.key,s=si(e);return s!=="string"?[new Fe(n,e,`string expected, ${s} found`)]:[]}const Ds={promoteId:function({key:i,value:e}){if(si(e)==="string")return dr({key:i,value:e});{const n=[];for(const s in e)n.push(...dr({key:`${i}.${s}`,value:e[s]}));return n}}};function fn(i){const e=i.value,n=i.key,s=i.styleSpec,u=i.style,f=i.validateSpec;if(!e.type)return[new Fe(n,e,'"type" is required')];const _=ui(e.type);let v;switch(_){case"vector":case"raster":return v=Wi({key:n,value:e,valueSpec:s[`source_${_.replace("-","_")}`],style:i.style,styleSpec:s,objectElementValidators:Ds,validateSpec:f}),v;case"raster-dem":return v=function(T){var P;const C=(P=T.sourceName)!==null&&P!==void 0?P:"",D=T.value,O=T.styleSpec,Z=O.source_raster_dem,j=T.style;let H=[];const te=si(D);if(D===void 0)return H;if(te!=="object")return H.push(new Fe("source_raster_dem",D,`object expected, ${te} found`)),H;const oe=ui(D.encoding)==="custom",de=["redFactor","greenFactor","blueFactor","baseShift"],ae=T.value.encoding?`"${T.value.encoding}"`:"Default";for(const me in D)!oe&&de.includes(me)?H.push(new Fe(me,D[me],`In "${C}": "${me}" is only valid when "encoding" is set to "custom". ${ae} encoding found`)):Z[me]?H=H.concat(T.validateSpec({key:me,value:D[me],valueSpec:Z[me],validateSpec:T.validateSpec,style:j,styleSpec:O})):H.push(new Fe(me,D[me],`unknown property "${me}"`));return H}({sourceName:n,value:e,style:i.style,styleSpec:s,validateSpec:f}),v;case"geojson":if(v=Wi({key:n,value:e,valueSpec:s.source_geojson,style:u,styleSpec:s,validateSpec:f,objectElementValidators:Ds}),e.cluster)for(const T in e.clusterProperties){const[P,C]=e.clusterProperties[T],D=typeof P=="string"?[P,["accumulated"],["get",T]]:P;v.push(...co({key:`${n}.${T}.map`,value:C,validateSpec:f,expressionContext:"cluster-map"})),v.push(...co({key:`${n}.${T}.reduce`,value:D,validateSpec:f,expressionContext:"cluster-reduce"}))}return v;case"video":return Wi({key:n,value:e,valueSpec:s.source_video,style:u,validateSpec:f,styleSpec:s});case"image":return Wi({key:n,value:e,valueSpec:s.source_image,style:u,validateSpec:f,styleSpec:s});case"canvas":return[new Fe(n,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Bo({key:`${n}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:u,validateSpec:f,styleSpec:s})}}function Rs(i){const e=i.value,n=i.styleSpec,s=n.light,u=i.style;let f=[];const _=si(e);if(e===void 0)return f;if(_!=="object")return f=f.concat([new Fe("light",e,`object expected, ${_} found`)]),f;for(const v in e){const T=v.match(/^(.*)-transition$/);f=f.concat(T&&s[T[1]]&&s[T[1]].transition?i.validateSpec({key:v,value:e[v],valueSpec:n.transition,validateSpec:i.validateSpec,style:u,styleSpec:n}):s[v]?i.validateSpec({key:v,value:e[v],valueSpec:s[v],validateSpec:i.validateSpec,style:u,styleSpec:n}):[new Fe(v,e[v],`unknown property "${v}"`)])}return f}function ka(i){const e=i.value,n=i.styleSpec,s=n.terrain,u=i.style;let f=[];const _=si(e);if(e===void 0)return f;if(_!=="object")return f=f.concat([new Fe("terrain",e,`object expected, ${_} found`)]),f;for(const v in e)f=f.concat(s[v]?i.validateSpec({key:v,value:e[v],valueSpec:s[v],validateSpec:i.validateSpec,style:u,styleSpec:n}):[new Fe(v,e[v],`unknown property "${v}"`)]);return f}function ol(i){let e=[];const n=i.value,s=i.key;if(Array.isArray(n)){const u=[],f=[];for(const _ in n)n[_].id&&u.includes(n[_].id)&&e.push(new Fe(s,n,`all the sprites' ids must be unique, but ${n[_].id} is duplicated`)),u.push(n[_].id),n[_].url&&f.includes(n[_].url)&&e.push(new Fe(s,n,`all the sprites' URLs must be unique, but ${n[_].url} is duplicated`)),f.push(n[_].url),e=e.concat(Wi({key:`${s}[${_}]`,value:n[_],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:i.validateSpec}));return e}return dr({key:s,value:n})}const za={"*":()=>[],array:ls,boolean:function(i){const e=i.value,n=i.key,s=si(e);return s!=="boolean"?[new Fe(n,e,`boolean expected, ${s} found`)]:[]},number:Un,color:function(i){const e=i.key,n=i.value,s=si(n);return s!=="string"?[new Fe(e,n,`color expected, ${s} found`)]:_i.parse(String(n))?[]:[new Fe(e,n,`color expected, "${n}" found`)]},constants:rl,enum:Bo,filter:Fr,function:Ro,layer:ca,object:Wi,source:fn,light:Rs,terrain:ka,string:dr,formatted:function(i){return dr(i).length===0?[]:co(i)},resolvedImage:function(i){return dr(i).length===0?[]:co(i)},padding:function(i){const e=i.key,n=i.value;if(si(n)==="array"){if(n.length<1||n.length>4)return[new Fe(e,n,`padding requires 1 to 4 values; ${n.length} values found`)];const s={type:"number"};let u=[];for(let f=0;f<n.length;f++)u=u.concat(i.validateSpec({key:`${e}[${f}]`,value:n[f],validateSpec:i.validateSpec,valueSpec:s}));return u}return Un({key:e,value:n,valueSpec:{}})},variableAnchorOffsetCollection:function(i){const e=i.key,n=i.value,s=si(n),u=i.styleSpec;if(s!=="array"||n.length<1||n.length%2!=0)return[new Fe(e,n,"variableAnchorOffsetCollection requires a non-empty array of even length")];let f=[];for(let _=0;_<n.length;_+=2)f=f.concat(Bo({key:`${e}[${_}]`,value:n[_],valueSpec:u.layout_symbol["text-anchor"]})),f=f.concat(ls({key:`${e}[${_+1}]`,value:n[_+1],valueSpec:{length:2,value:"number"},validateSpec:i.validateSpec,style:i.style,styleSpec:u}));return f},sprite:ol};function Nr(i){const e=i.value,n=i.valueSpec,s=i.styleSpec;return i.validateSpec=Nr,n.expression&&gi(ui(e))?Ro(i):n.expression&&na(Do(e))?co(i):n.type&&za[n.type]?za[n.type](i):Wi(lr({},i,{valueSpec:n.type?s[n.type]:n}))}function pr(i){const e=i.value,n=i.key,s=dr(i);return s.length||(e.indexOf("{fontstack}")===-1&&s.push(new Fe(n,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&s.push(new Fe(n,e,'"glyphs" url must include a "{range}" token'))),s}function yn(i,e=Pe){let n=[];return n=n.concat(Nr({key:"",value:i,valueSpec:e.$root,styleSpec:e,style:i,validateSpec:Nr,objectElementValidators:{glyphs:pr,"*":()=>[]}})),i.constants&&(n=n.concat(rl({key:"constants",value:i.constants,style:i,styleSpec:e,validateSpec:Nr}))),Fo(n)}function Ur(i){return function(e){return i({...e,validateSpec:Nr})}}function Fo(i){return[].concat(i).sort((e,n)=>e.line-n.line)}function Vr(i){return function(...e){return Fo(i.apply(this,e))}}yn.source=Vr(Ur(fn)),yn.sprite=Vr(Ur(ol)),yn.glyphs=Vr(Ur(pr)),yn.light=Vr(Ur(Rs)),yn.terrain=Vr(Ur(ka)),yn.layer=Vr(Ur(ca)),yn.filter=Vr(Ur(Fr)),yn.paintProperty=Vr(Ur(Oo)),yn.layoutProperty=Vr(Ur(zs));const Ir=yn,Ol=Ir.light,No=Ir.paintProperty,sl=Ir.layoutProperty;function Zr(i,e){let n=!1;if(e&&e.length)for(const s of e)i.fire(new ar(new Error(s.message))),n=!0;return n}class Uo{constructor(e,n,s){const u=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const _=new Int32Array(this.arrayBuffer);e=_[0],this.d=(n=_[1])+2*(s=_[2]);for(let T=0;T<this.d*this.d;T++){const P=_[3+T],C=_[3+T+1];u.push(P===C?null:_.subarray(P,C))}const v=_[3+u.length+1];this.keys=_.subarray(_[3+u.length],v),this.bboxes=_.subarray(v),this.insert=this._insertReadonly}else{this.d=n+2*s;for(let _=0;_<this.d*this.d;_++)u.push([]);this.keys=[],this.bboxes=[]}this.n=n,this.extent=e,this.padding=s,this.scale=n/e,this.uid=0;const f=s/n*e;this.min=-f,this.max=e+f}insert(e,n,s,u,f){this._forEachCell(n,s,u,f,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(u),this.bboxes.push(f)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,n,s,u,f,_){this.cells[f].push(_)}query(e,n,s,u,f){const _=this.min,v=this.max;if(e<=_&&n<=_&&v<=s&&v<=u&&!f)return Array.prototype.slice.call(this.keys);{const T=[];return this._forEachCell(e,n,s,u,this._queryCell,T,{},f),T}}_queryCell(e,n,s,u,f,_,v,T){const P=this.cells[f];if(P!==null){const C=this.keys,D=this.bboxes;for(let O=0;O<P.length;O++){const Z=P[O];if(v[Z]===void 0){const j=4*Z;(T?T(D[j+0],D[j+1],D[j+2],D[j+3]):e<=D[j+2]&&n<=D[j+3]&&s>=D[j+0]&&u>=D[j+1])?(v[Z]=!0,_.push(C[Z])):v[Z]=!1}}}}_forEachCell(e,n,s,u,f,_,v,T){const P=this._convertToCellCoord(e),C=this._convertToCellCoord(n),D=this._convertToCellCoord(s),O=this._convertToCellCoord(u);for(let Z=P;Z<=D;Z++)for(let j=C;j<=O;j++){const H=this.d*j+Z;if((!T||T(this._convertFromCellCoord(Z),this._convertFromCellCoord(j),this._convertFromCellCoord(Z+1),this._convertFromCellCoord(j+1)))&&f.call(this,e,n,s,u,H,_,v,T))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,n=3+this.cells.length+1+1;let s=0;for(let _=0;_<this.cells.length;_++)s+=this.cells[_].length;const u=new Int32Array(n+s+this.keys.length+this.bboxes.length);u[0]=this.extent,u[1]=this.n,u[2]=this.padding;let f=n;for(let _=0;_<e.length;_++){const v=e[_];u[3+_]=f,u.set(v,f),f+=v.length}return u[3+e.length]=f,u.set(this.keys,f),f+=this.keys.length,u[3+e.length+1]=f,u.set(this.bboxes,f),f+=this.bboxes.length,u.buffer}static serialize(e,n){const s=e.toArrayBuffer();return n&&n.push(s),{buffer:s}}static deserialize(e){return new Uo(e.buffer)}}const Lr={};function He(i,e,n={}){if(Lr[i])throw new Error(`${i} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:i,writeable:!1}),Lr[i]={klass:e,omit:n.omit||[],shallow:n.shallow||[]}}He("Object",Object),He("TransferableGridIndex",Uo),He("Color",_i),He("Error",Error),He("AJAXError",mn),He("ResolvedImage",Ht),He("StylePropertyFunction",Pr),He("StyleExpression",Es,{omit:["_evaluator"]}),He("ZoomDependentExpression",sa),He("ZoomConstantExpression",oa),He("CompoundExpression",In,{omit:["_evaluate"]});for(const i in so)so[i]._classRegistryKey||He(`Expression_${i}`,so[i]);function Qn(i){return i&&typeof ArrayBuffer!="undefined"&&(i instanceof ArrayBuffer||i.constructor&&i.constructor.name==="ArrayBuffer")}function jr(i,e){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob)return i;if(Qn(i)||Ui(i))return e&&e.push(i),i;if(ArrayBuffer.isView(i)){const n=i;return e&&e.push(n.buffer),n}if(i instanceof ImageData)return e&&e.push(i.data.buffer),i;if(Array.isArray(i)){const n=[];for(const s of i)n.push(jr(s,e));return n}
9if(typeof i=="object"){const n=i.constructor,s=n._classRegistryKey;if(!s)throw new Error("can't serialize object of unregistered class");if(!Lr[s])throw new Error(`${s} is not registered.`);const u=n.serialize?n.serialize(i,e):{};if(n.serialize){if(e&&u===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const f in i){if(!i.hasOwnProperty(f)||Lr[s].omit.indexOf(f)>=0)continue;const _=i[f];u[f]=Lr[s].shallow.indexOf(f)>=0?_:jr(_,e)}i instanceof Error&&(u.message=i.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return s!=="Object"&&(u.$name=s),u}throw new Error("can't serialize object of type "+typeof i)}function Vo(i){if(i==null||typeof i=="boolean"||typeof i=="number"||typeof i=="string"||i instanceof Boolean||i instanceof Number||i instanceof String||i instanceof Date||i instanceof RegExp||i instanceof Blob||Qn(i)||Ui(i)||ArrayBuffer.isView(i)||i instanceof ImageData)return i;if(Array.isArray(i))return i.map(Vo);if(typeof i=="object"){const e=i.$name||"Object";if(!Lr[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:n}=Lr[e];if(!n)throw new Error(`can't deserialize unregistered class ${e}`);if(n.deserialize)return n.deserialize(i);const s=Object.create(n.prototype);for(const u of Object.keys(i)){if(u==="$name")continue;const f=i[u];s[u]=Lr[e].shallow.indexOf(u)>=0?f:Vo(f)}return s}throw new Error("can't deserialize object of type "+typeof i)}class cs{constructor(){this.first=!0}update(e,n){const s=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=s,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=s,!0):(this.lastFloorZoom>s?(this.lastIntegerZoom=s+1,this.lastIntegerZoomTime=n):this.lastFloorZoom<s&&(this.lastIntegerZoom=s,this.lastIntegerZoomTime=n),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=s,!0))}}const je={"Latin-1 Supplement":i=>i>=128&&i<=255,Arabic:i=>i>=1536&&i<=1791,"Arabic Supplement":i=>i>=1872&&i<=1919,"Arabic Extended-A":i=>i>=2208&&i<=2303,"Hangul Jamo":i=>i>=4352&&i<=4607,"Unified Canadian Aboriginal Syllabics":i=>i>=5120&&i<=5759,Khmer:i=>i>=6016&&i<=6143,"Unified Canadian Aboriginal Syllabics Extended":i=>i>=6320&&i<=6399,"General Punctuation":i=>i>=8192&&i<=8303,"Letterlike Symbols":i=>i>=8448&&i<=8527,"Number Forms":i=>i>=8528&&i<=8591,"Miscellaneous Technical":i=>i>=8960&&i<=9215,"Control Pictures":i=>i>=9216&&i<=9279,"Optical Character Recognition":i=>i>=9280&&i<=9311,"Enclosed Alphanumerics":i=>i>=9312&&i<=9471,"Geometric Shapes":i=>i>=9632&&i<=9727,"Miscellaneous Symbols":i=>i>=9728&&i<=9983,"Miscellaneous Symbols and Arrows":i=>i>=11008&&i<=11263,"CJK Radicals Supplement":i=>i>=11904&&i<=12031,"Kangxi Radicals":i=>i>=12032&&i<=12255,"Ideographic Description Characters":i=>i>=12272&&i<=12287,"CJK Symbols and Punctuation":i=>i>=12288&&i<=12351,Hiragana:i=>i>=12352&&i<=12447,Katakana:i=>i>=12448&&i<=12543,Bopomofo:i=>i>=12544&&i<=12591,"Hangul Compatibility Jamo":i=>i>=12592&&i<=12687,Kanbun:i=>i>=12688&&i<=12703,"Bopomofo Extended":i=>i>=12704&&i<=12735,"CJK Strokes":i=>i>=12736&&i<=12783,"Katakana Phonetic Extensions":i=>i>=12784&&i<=12799,"Enclosed CJK Letters and Months":i=>i>=12800&&i<=13055,"CJK Compatibility":i=>i>=13056&&i<=13311,"CJK Unified Ideographs Extension A":i=>i>=13312&&i<=19903,"Yijing Hexagram Symbols":i=>i>=19904&&i<=19967,"CJK Unified Ideographs":i=>i>=19968&&i<=40959,"Yi Syllables":i=>i>=40960&&i<=42127,"Yi Radicals":i=>i>=42128&&i<=42191,"Hangul Jamo Extended-A":i=>i>=43360&&i<=43391,"Hangul Syllables":i=>i>=44032&&i<=55215,"Hangul Jamo Extended-B":i=>i>=55216&&i<=55295,"Private Use Area":i=>i>=57344&&i<=63743,"CJK Compatibility Ideographs":i=>i>=63744&&i<=64255,"Arabic Presentation Forms-A":i=>i>=64336&&i<=65023,"Vertical Forms":i=>i>=65040&&i<=65055,"CJK Compatibility Forms":i=>i>=65072&&i<=65103,"Small Form Variants":i=>i>=65104&&i<=65135,"Arabic Presentation Forms-B":i=>i>=65136&&i<=65279,"Halfwidth and Fullwidth Forms":i=>i>=65280&&i<=65519};function us(i){for(const e of i)if(ua(e.charCodeAt(0)))return!0;return!1}function Zo(i){for(const e of i)if(!al(e.charCodeAt(0)))return!1;return!0}function al(i){return!(je.Arabic(i)||je["Arabic Supplement"](i)||je["Arabic Extended-A"](i)||je["Arabic Presentation Forms-A"](i)||je["Arabic Presentation Forms-B"](i))}function ua(i){return!(i!==746&&i!==747&&(i<4352||!(je["Bopomofo Extended"](i)||je.Bopomofo(i)||je["CJK Compatibility Forms"](i)&&!(i>=65097&&i<=65103)||je["CJK Compatibility Ideographs"](i)||je["CJK Compatibility"](i)||je["CJK Radicals Supplement"](i)||je["CJK Strokes"](i)||!(!je["CJK Symbols and Punctuation"](i)||i>=12296&&i<=12305||i>=12308&&i<=12319||i===12336)||je["CJK Unified Ideographs Extension A"](i)||je["CJK Unified Ideographs"](i)||je["Enclosed CJK Letters and Months"](i)||je["Hangul Compatibility Jamo"](i)||je["Hangul Jamo Extended-A"](i)||je["Hangul Jamo Extended-B"](i)||je["Hangul Jamo"](i)||je["Hangul Syllables"](i)||je.Hiragana(i)||je["Ideographic Description Characters"](i)||je.Kanbun(i)||je["Kangxi Radicals"](i)||je["Katakana Phonet
9ic Extensions"](i)||je.Katakana(i)&&i!==12540||!(!je["Halfwidth and Fullwidth Forms"](i)||i===65288||i===65289||i===65293||i>=65306&&i<=65310||i===65339||i===65341||i===65343||i>=65371&&i<=65503||i===65507||i>=65512&&i<=65519)||!(!je["Small Form Variants"](i)||i>=65112&&i<=65118||i>=65123&&i<=65126)||je["Unified Canadian Aboriginal Syllabics"](i)||je["Unified Canadian Aboriginal Syllabics Extended"](i)||je["Vertical Forms"](i)||je["Yijing Hexagram Symbols"](i)||je["Yi Syllables"](i)||je["Yi Radicals"](i))))}function ll(i){return!(ua(i)||function(e){return!!(je["Latin-1 Supplement"](e)&&(e===167||e===169||e===174||e===177||e===188||e===189||e===190||e===215||e===247)||je["General Punctuation"](e)&&(e===8214||e===8224||e===8225||e===8240||e===8241||e===8251||e===8252||e===8258||e===8263||e===8264||e===8265||e===8273)||je["Letterlike Symbols"](e)||je["Number Forms"](e)||je["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||e===9003||e>=9085&&e<=9114||e>=9150&&e<=9165||e===9167||e>=9169&&e<=9179||e>=9186&&e<=9215)||je["Control Pictures"](e)&&e!==9251||je["Optical Character Recognition"](e)||je["Enclosed Alphanumerics"](e)||je["Geometric Shapes"](e)||je["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||je["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||je["CJK Symbols and Punctuation"](e)||je.Katakana(e)||je["Private Use Area"](e)||je["CJK Compatibility Forms"](e)||je["Small Form Variants"](e)||je["Halfwidth and Fullwidth Forms"](e)||e===8734||e===8756||e===8757||e>=9984&&e<=10087||e>=10102&&e<=10131||e===65532||e===65533)}(i))}function Da(i){return i>=1424&&i<=2303||je["Arabic Presentation Forms-A"](i)||je["Arabic Presentation Forms-B"](i)}function Ra(i,e){return!(!e&&Da(i)||i>=2304&&i<=3583||i>=3840&&i<=4255||je.Khmer(i))}function cl(i){for(const e of i)if(Da(e.charCodeAt(0)))return!0;return!1}const ha="deferred",da="loading",Ba="loaded";let pa=null,vn="unavailable",uo=null;const r=function(i){i&&typeof i=="string"&&i.indexOf("NetworkError")>-1&&(vn="error"),pa&&pa(i)};function c(){g.fire(new vr("pluginStateChange",{pluginStatus:vn,pluginURL:uo}))}const g=new Po,S=function(){return vn},M=function(){if(vn!==ha||!uo)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");vn=da,c(),uo&&So({url:uo},i=>{i?r(i):(vn=Ba,c())})},V={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>vn===Ba||V.applyArabicShaping!=null,isLoading:()=>vn===da,setState(i){if(!ni())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");vn=i.pluginStatus,uo=i.pluginURL},isParsed(){if(!ni())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return V.applyArabicShaping!=null&&V.processBidirectionalText!=null&&V.processStyledBidirectionalText!=null},getPluginURL(){if(!ni())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return uo}};class ne{constructor(e,n){this.zoom=e,n?(this.now=n.now,this.fadeDuration=n.fadeDuration,this.zoomHistory=n.zoomHistory,this.transition=n.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new cs,this.transition={})}isSupportedScript(e){return function(n,s){for(const u of n)if(!Ra(u.charCodeAt(0),s))return!1;return!0}(e,V.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,n=e-Math.floor(e),s=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:n+(1-n)*s}:{fromScale:.5,toScale:1,t:1-(1-s)*n}}}class ye{constructor(e,n){this.property=e,this.value=n,this.expression=function(s,u){if(gi(s))return new Pr(s,u);if(na(s)){const f=Fn(s,u);if(f.result==="error")throw new Error(f.value.map(_=>`${_.key}: ${_.message}`).join(", "));return f.value}{let f=s;return u.type==="color"&&typeof s=="string"?f=_i.parse(s):u.type!=="padding"||typeof s!="number"&&!Array.isArray(s)?u.type==="variableAnchorOffsetCollection"&&Array.isArray(s)&&(f=Bt.parse(s)):f=An.parse(s),{kind:"constant",evaluate:()=>f}}}(n===void 0?e.specification.default:n,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(e,n,s){return this.property.possiblyEvaluate(this,e,n,s)}}class Se{constructor(e){this.property=e,this.value=new ye(e,void 0)}
vendor: 18,346 bytes, line 9
9transitioned(e,n){return new Ke(this.property,this.value,n,at({},e.transition,this.transition),e.now)}untransitioned(){return new Ke(this.property,this.value,null,{},0)}}class Me{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return rt(this._values[e].value.value)}setValue(e,n){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Se(this._values[e].property)),this._values[e].value=new ye(this._values[e].property,n===null?void 0:rt(n))}getTransition(e){return rt(this._values[e].transition)}setTransition(e,n){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Se(this._values[e].property)),this._values[e].transition=rt(n)||void 0}serialize(){const e={};for(const n of Object.keys(this._values)){const s=this.getValue(n);s!==void 0&&(e[n]=s);const u=this.getTransition(n);u!==void 0&&(e[`${n}-transition`]=u)}return e}transitioned(e,n){const s=new At(this._properties);for(const u of Object.keys(this._values))s._values[u]=this._values[u].transitioned(e,n._values[u]);return s}untransitioned(){const e=new At(this._properties);for(const n of Object.keys(this._values))e._values[n]=this._values[n].untransitioned();return e}}class Ke{constructor(e,n,s,u,f){this.property=e,this.value=n,this.begin=f+u.delay||0,this.end=this.begin+u.duration||0,e.specification.transition&&(u.delay||u.duration)&&(this.prior=s)}possiblyEvaluate(e,n,s){const u=e.now||0,f=this.value.possiblyEvaluate(e,n,s),_=this.prior;if(_){if(u>this.end)return this.prior=null,f;if(this.value.isDataDriven())return this.prior=null,f;if(u<this.begin)return _.possiblyEvaluate(e,n,s);{const v=(u-this.begin)/(this.end-this.begin);return this.property.interpolate(_.possiblyEvaluate(e,n,s),f,function(T){if(T<=0)return 0;if(T>=1)return 1;const P=T*T,C=P*T;return 4*(T<.5?C:3*(T-P)+C-.75)}(v))}}return f}}class At{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,n,s){const u=new Zi(this._properties);for(const f of Object.keys(this._values))u._values[f]=this._values[f].possiblyEvaluate(e,n,s);return u}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Xt{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return rt(this._values[e].value)}setValue(e,n){this._values[e]=new ye(this._values[e].property,n===null?void 0:rt(n))}serialize(){const e={};for(const n of Object.keys(this._values)){const s=this.getValue(n);s!==void 0&&(e[n]=s)}return e}possiblyEvaluate(e,n,s){const u=new Zi(this._properties);for(const f of Object.keys(this._values))u._values[f]=this._values[f].possiblyEvaluate(e,n,s);return u}}class xi{constructor(e,n,s){this.property=e,this.value=n,this.parameters=s}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,n,s,u){return this.property.evaluate(this.value,this.parameters,e,n,s,u)}}class Zi{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ge{constructor(e){this.specification=e}possiblyEvaluate(e,n){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(n)}interpolate(e,n,s){const u=On[this.specification.type];return u?u(e,n,s):e}}class Je{constructor(e,n){this.specification=e,this.overrides=n}possiblyEvaluate(e,n,s,u){return new xi(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(n,null,{},s,u)}:e.expression,n)}interpolate(e,n,s){if(e.value.kind!=="constant"||n.value.kind!=="constant")return e;if(e.value.value===void 0||n.value.value===void 0)return new xi(this,{kind:"constant",value:void 0},e.parameters);const u=On[this.specification.type];if(u){const f=u(e.value.value,n.value.value,s);return new xi(this,{kind:"constant",value:f},e.parameters)}return e}evaluate(e,n,s,u,f,_){return e.kind==="constant"?e.value:e.evaluate(n,s,u,f,_)}}class Er extends Je{possiblyEvaluate(e,n,s,u){if(e.value===void 0)return new xi(this,{kind:"constant",value:void 0},n);if(e.expression.kind==="constant"){const f=e.expression.evaluate(n,null,{},s,u),_=e.property.specification.type==="resolvedImage"&&typeof f!="string"?f.name:f,v=this._calculate(_,_,_,n);return new xi(this,{kind:"constant",value:v},n)}if(e.expression.kind==="camera"){const f=this._calculate(e.expression.evaluate({zoom:n.zoom-1}),e.expression.evaluate({zoom:n.zoom}),e.expression.evaluate({zoom:n.zoom+1}),n);return new xi(this,{kind:"constant",value:f},n)}return new xi(this,e.expression,n)}evaluate(e,n,s,u,f,_){if(e.kind==="source"){const v=e.evaluate(n,s,u,f,_);return this._calculate(v,v,v,n)}return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(n.zoom)-1},s,u),e.evaluate({zoom:Math.floor(n.zoom)},s,u),e.evaluate({zoom:Math.floor(n.zoom)+1},s,u),n):e.value}_calculate(e,n,s,u){return u.zoom>u.zoomHistory.lastIntegerZoom?{from:e,to:n}:{from:s,to:n}}interpolate(e){return e}}class Oa{constructor(e){this.specification=e}possiblyEvaluate(e,n,s,u){if(e.value!==void 0){if(e.expression.kind==="constant"){const f=e.expression.evaluate(n,null,{},s,u);return this._calculate(f,f,f,n)}return this._calculate(e.expression.evaluate(new ne(Math.floor(n.zoom-1),n)),e.expression.evaluate(new ne(Math.floor(n.zoom),n)),e.expression.evaluate(new ne(Math.floor(n.zoom+1),n)),n)}}_calculate(e,n,s,u){return u.zoom>u.zoomHistory.lastIntegerZoom?{from:e,to:n}:{from:s,to:n}}interpolate(e){return e}}class Fa{constructor(e){this.specification=e}possiblyEvaluate(e,n,s,u){return!!e.expression.evaluate(n,null,{},s,u)}interpolate(){return!1}}class ji{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const n in e){const s=e[n];s.specification.overridable&&this.overridableProperties.push(n);const u=this.defaultPropertyValues[n]=new ye(s,void 0),f=this.defaultTransitionablePropertyValues[n]=new Se(s);this.defaultTransitioningPropertyValues[n]=f.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=u.possiblyEvaluate({})}}}He("DataDrivenProperty",Je),He("DataConstantProperty",Ge),He("CrossFadedDataDrivenProperty",Er),He("CrossFadedProperty",Oa),He("ColorRampProperty",Fa);const fa="-transition";class er extends Po{constructor(e,n){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},e.type!=="custom"&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),n.layout&&(this._unevaluatedLayout=new Xt(n.layout)),n.paint)){this._transitionablePaint=new Me(n.paint);for(const s in e.paint)this.setPaintProperty(s,e.paint[s],{validate:!1});for(const s in e.layout)this.setLayoutProperty(s,e.layout[s],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Zi(n.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,n,s={}){n!=null&&this._validate(sl,`layers.${this.id}.layout.${e}`,e,n,s)||(e!=="visibility"?this._unevaluatedLayout.setValue(e,n):this.visibility=n)}getPaintProperty(e){return e.endsWith(fa)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,n,s={}){if(n!=null&&this._validate(No,`layers.${this.id}.paint.${e}`,e,n,s))return!1;if(e.endsWith(fa))return this._transitionablePaint.setTransition(e.slice(0,-11),n||void 0),!1;{const u=this._transitionablePaint._values[e],f=u.property.specification["property-type"]==="cross-faded-data-driven",_=u.value.isDataDriven(),v=u.value;this._transitionablePaint.setValue(e,n),this._handleSpecialPaintPropertyUpdate(e);const T=this._transitionablePaint._values[e].value;return T.isDataDriven()||_||f||this._handleOverridablePaintPropertyUpdate(e,v,T)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,n,s){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,n){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,n)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,n)}serialize(){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),xt(e,(n,s)=>!(n===void 0||s==="layout"&&!Object.keys(n).length||s==="paint"&&!Object.keys(n).length))}_validate(e,n,s,u,f={}){return(!f||f.validate!==!1)&&Zr(this,e.call(Ir,{key:n,layerType:this.type,objectKey:s,value:u,styleSpec:Pe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const n=this.paint.get(e);if(n instanceof xi&&rs(n.property.specification)&&(n.value.kind==="source"||n.value.kind==="composite")&&n.value.isStateDependent)return!0}return!1}}const Na={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Pi{constructor(e,n){this._structArray=e,this._pos1=n*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Ii{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,n){return e._trim(),n&&(e.isTransferred=!0,n.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const n=Object.create(this.prototype);return n.arrayBuffer=e.arrayBuffer,n.length=e.length,n.capacity=e.arrayBuffer.byteLength/n.bytesPerElement,n._refreshViews(),n}_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 n=this.uint8;this._refreshViews(),n&&this.uint8.set(n)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function zi(i,e=1){let n=0,s=0;return{members:i.map(u=>{const f=Na[u.type].BYTES_PER_ELEMENT,_=n=hs(n,Math.max(e,f)),v=u.components||1;return s=Math.max(s,f),n+=f*v,{name:u.name,type:u.type,components:v,offset:_}}),size:hs(n,Math.max(s,e)),alignment:e}}function hs(i,e){return Math.ceil(i/e)*e}class Bs extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,n)}emplace(e,n,s){const u=2*e;return this.int16[u+0]=n,this.int16[u+1]=s,e}}Bs.prototype.bytesPerElement=4,He("StructArrayLayout2i4",Bs);class jo extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,s){const u=this.length;return this.resize(u+1),this.emplace(u,e,n,s)}emplace(e,n,s,u){const f=3*e;return this.int16[f+0]=n,this.int16[f+1]=s,this.int16[f+2]=u,e}}jo.prototype.bytesPerElement=6,He("StructArrayLayout3i6",jo);class ho extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,s,u){const f=this.length;return this.resize(f+1),this.emplace(f,e,n,s,u)}emplace(e,n,s,u,f){const _=4*e;return this.int16[_+0]=n,this.int16[_+1]=s,this.int16[_+2]=u,this.int16[_+3]=f,e}}ho.prototype.bytesPerElement=8,He("StructArrayLayout4i8",ho);class Ua extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,s,u,f,_){const v=this.length;return this.resize(v+1),this.emplace(v,e,n,s,u,f,_)}emplace(e,n,s,u,f,_,v){const T=6*e;return this.int16[T+0]=n,this.int16[T+1]=s,this.int16[T+2]=u,this.int16[T+3]=f,this.int16[T+4]=_,this.int16[T+5]=v,e}}Ua.prototype.bytesPerElement=12,He("StructArrayLayout2i4i12",Ua);class Fl extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,s,u,f,_){const v=this.length;return this.resize(v+1),this.emplace(v,e,n,s,u,f,_)}emplace(e,n,s,u,f,_,v){const T=4*e,P=8*e;return this.int16[T+0]=n,this.int16[T+1]=s,this.uint8[P+4]=u,this.uint8[P+5]=f,this.uint8[P+6]=_,this.uint8[P+7]=v,e}}Fl.prototype.bytesPerElement=8,He("StructArrayLayout2i4ub8",Fl);class ma extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,n)}emplace(e,n,s){const u=2*e;return this.float32[u+0]=n,this.float32[u+1]=s,e}}ma.prototype.bytesPerElement=8,He("StructArrayLayout2f8",ma);class Nl extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n,s,u,f,_,v,T,P,C){const D=this.length;return this.resize(D+1),this.emplace(D,e,n,s,u,f,_,v,T,P,C)}emplace(e,n,s,u,f,_,v,T,P,C,D){const O=10*e;return this.uint16[O+0]=n,this.uint16[O+1]=s,this.uint16[O+2]=u,this.uint16[O+3]=f,this.uint16[O+4]=_,this.uint16[O+5]=v,this.uint16[O+6]=T,this.uint16[O+7]=P,this.uint16[O+8]=C,this.uint16[O+9]=D,e}}Nl.prototype.bytesPerElement=20,He("StructArrayLayout10ui20",Nl);class Ul extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n,s,u,f,_,v,T,P,C,D,O){const Z=this.length;return this.resize(Z+1),this.emplace(Z,e,n,s,u,f,_,v,T,P,C,D,O)}emplace(e,n,s,u,f,_,v,T,P,C,D,O,Z){const j=12*e;return this.int16[j+0]=n,this.int16[j+1]=s,this.int16[j+2]=u,this.int16[j+3]=f,this.uint16[j+4]=_,this.uint16[j+5]=v,this.uint16[j+6]=T,this.uint16[j+7]=P,this.int16[j+8]=C,this.int16[j+9]=D,this.int16[j+10]=O,this.int16[j+11]=Z,e}}Ul.prototype.bytesPerElement=24,He("StructArrayLayout4i4ui4i24",Ul);class hi extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,s){const u=this.length;return this.resize(u+1),this.emplace(u,e,n,s)}emplace(e,n,s,u){const f=3*e;return this.float32[f+0]=n,this.float32[f+1]=s,this.float32[f+2]=u,e}}hi.prototype.bytesPerElement=12,He("StructArrayLayout3f12",hi);class d extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const n=this.length;return this.resize(n+1),this.emplace(n,e)}emplace(e,n){return this.uint32[1*e+0]=n,e}}d.prototype.bytesPerElement=4,He("StructArrayLayout1ul4",d);class t extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n,s,u,f,_,v,T,P){const C=this.length;return this.resize(C+1),this.emplace(C,e,n,s,u,f,_,v,T,P)}emplace(e,n,s,u,f,_,v,T,P,C){const D=10*e,O=5*e;return this.int16[D+0]=n,this.int16[D+1]=s,this.int16[D+2]=u,this.int16[D+3]=f,this.int16[D+4]=_,this.int16[D+5]=v,this.uint32[O+3]=T,this.uint16[D+8]=P,this.uint16[D+9]=C,e}}t.prototype.bytesPerElement=20,He("StructArrayLayout6i1ul2ui20",t);class o extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,s,u,f,_){const v=this.length;return this.resize(v+1),this.emplace(v,e,n,s,u,f,_)}emplace(e,n,s,u,f,_,v){const T=6*e;return this.int16[T+0]=n,this.int16[T+1]=s,this.int16[T+2]=u,this.int16[T+3]=f,this.int16[T+4]=_,this.int16[T+5]=v,e}}o.prototype.bytesPerElement=12,He("StructArrayLayout2i2i2i12",o);class a extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,n,s,u,f){const _=this.length;return this.resize(_+1),this.emplace(_,e,n,s,u,f)}emplace(e,n,s,u,f,_){const v=4*e,T=8*e;return this.float32[v+0]=n,this.float32[v+1]=s,this.float32[v+2]=u,this.int16[T+6]=f,this.int16[T+7]=_,e}}a.prototype.bytesPerElement=16,He("StructArrayLayout2f1f2i16",a);class h extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,s,u){const f=this.length;return this.resize(f+1),this.emplace(f,e,n,s,u)}emplace(e,n,s,u,f){const _=12*e,v=3*e;return this.uint8[_+0]=n,this.uint8[_+1]=s,this.float32[v+1]=u,this.float32[v+2]=f,e}}h.prototype.bytesPerElement=12,He("StructArrayLayout2ub2f12",h);class m extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n,s){const u=this.length;return this.resize(u+1),this.emplace(u,e,n,s)}emplace(e,n,s,u){const f=3*e;return this.uint16[f+0]=n,this.uint16[f+1]=s,this.uint16[f+2]=u,e}}m.prototype.bytesPerElement=6,He("StructArrayLayout3ui6",m);class x extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,s,u,f,_,v,T,P,C,D,O,Z,j,H,te,oe){const de=this.length;return this.resize(de+1),this.emplace(de,e,n,s,u,f,_,v,T,P,C,D,O,Z,j,H,te,oe)}emplace(e,n,s,u,f,_,v,T,P,C,D,O,Z,j,H,te,oe,de){const ae=24*e,me=12*e,be=48*e;
vendor: 16,690 bytes, line 9
9return this.int16[ae+0]=n,this.int16[ae+1]=s,this.uint16[ae+2]=u,this.uint16[ae+3]=f,this.uint32[me+2]=_,this.uint32[me+3]=v,this.uint32[me+4]=T,this.uint16[ae+10]=P,this.uint16[ae+11]=C,this.uint16[ae+12]=D,this.float32[me+7]=O,this.float32[me+8]=Z,this.uint8[be+36]=j,this.uint8[be+37]=H,this.uint8[be+38]=te,this.uint32[me+10]=oe,this.int16[ae+22]=de,e}}x.prototype.bytesPerElement=48,He("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",x);class w extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,s,u,f,_,v,T,P,C,D,O,Z,j,H,te,oe,de,ae,me,be,Ee,qe,it,$e,Ze,Ne,We){const Ue=this.length;return this.resize(Ue+1),this.emplace(Ue,e,n,s,u,f,_,v,T,P,C,D,O,Z,j,H,te,oe,de,ae,me,be,Ee,qe,it,$e,Ze,Ne,We)}emplace(e,n,s,u,f,_,v,T,P,C,D,O,Z,j,H,te,oe,de,ae,me,be,Ee,qe,it,$e,Ze,Ne,We,Ue){const De=32*e,ht=16*e;return this.int16[De+0]=n,this.int16[De+1]=s,this.int16[De+2]=u,this.int16[De+3]=f,this.int16[De+4]=_,this.int16[De+5]=v,this.int16[De+6]=T,this.int16[De+7]=P,this.uint16[De+8]=C,this.uint16[De+9]=D,this.uint16[De+10]=O,this.uint16[De+11]=Z,this.uint16[De+12]=j,this.uint16[De+13]=H,this.uint16[De+14]=te,this.uint16[De+15]=oe,this.uint16[De+16]=de,this.uint16[De+17]=ae,this.uint16[De+18]=me,this.uint16[De+19]=be,this.uint16[De+20]=Ee,this.uint16[De+21]=qe,this.uint16[De+22]=it,this.uint32[ht+12]=$e,this.float32[ht+13]=Ze,this.float32[ht+14]=Ne,this.uint16[De+30]=We,this.uint16[De+31]=Ue,e}}w.prototype.bytesPerElement=64,He("StructArrayLayout8i15ui1ul2f2ui64",w);class A extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const n=this.length;return this.resize(n+1),this.emplace(n,e)}emplace(e,n){return this.float32[1*e+0]=n,e}}A.prototype.bytesPerElement=4,He("StructArrayLayout1f4",A);class E extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,s){const u=this.length;return this.resize(u+1),this.emplace(u,e,n,s)}emplace(e,n,s,u){const f=3*e;return this.uint16[6*e+0]=n,this.float32[f+1]=s,this.float32[f+2]=u,e}}E.prototype.bytesPerElement=12,He("StructArrayLayout1ui2f12",E);class k extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n,s){const u=this.length;return this.resize(u+1),this.emplace(u,e,n,s)}emplace(e,n,s,u){const f=4*e;return this.uint32[2*e+0]=n,this.uint16[f+2]=s,this.uint16[f+3]=u,e}}k.prototype.bytesPerElement=8,He("StructArrayLayout1ul2ui8",k);class z extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,n){const s=this.length;return this.resize(s+1),this.emplace(s,e,n)}emplace(e,n,s){const u=2*e;return this.uint16[u+0]=n,this.uint16[u+1]=s,e}}z.prototype.bytesPerElement=4,He("StructArrayLayout2ui4",z);class U extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const n=this.length;return this.resize(n+1),this.emplace(n,e)}emplace(e,n){return this.uint16[1*e+0]=n,e}}U.prototype.bytesPerElement=2,He("StructArrayLayout1ui2",U);class K extends Ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,n,s,u){const f=this.length;return this.resize(f+1),this.emplace(f,e,n,s,u)}emplace(e,n,s,u,f){const _=4*e;return this.float32[_+0]=n,this.float32[_+1]=s,this.float32[_+2]=u,this.float32[_+3]=f,e}}K.prototype.bytesPerElement=16,He("StructArrayLayout4f16",K);class W extends Pi{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new pe(this.anchorPointX,this.anchorPointY)}}W.prototype.size=20;class J extends t{get(e){return new W(this,e)}}He("CollisionBoxArray",J);class G extends Pi{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}G.prototype.size=48;class ce extends x{get(e){return new G(this,e)}}He("PlacedSymbolArray",ce);class xe extends Pi{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}xe.prototype.size=64;class ie extends w{get(e){return new xe(this,e)}}He("SymbolInstanceArray",ie);class he extends A{getoffsetX(e){return this.float32[1*e+0]}}He("GlyphOffsetArray",he);class we extends jo{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}He("SymbolLineVertexArray",we);class Te extends Pi{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Te.prototype.size=12;class Ie extends E{get(e){return new Te(this,e)}}He("TextAnchorOffsetArray",Ie);class ke extends Pi{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]}}ke.prototype.size=8;class Ce extends k{get(e){return new ke(this,e)}}He("FeatureIndexArray",Ce);class Be extends Bs{}class tt extends Bs{}class Yt extends Bs{}class Ve extends Ua{}class gt extends Fl{}class ot extends ma{}class wi extends Nl{}class Kt extends Ul{}class Nt extends hi{}class Jt extends d{}class $i extends o{}class ki extends h{}class xn extends m{}class nn extends z{}const Ki=zi([{name:"a_pos",components:2,type:"Int16"}],4),{members:fr}=Ki;class Di{constructor(e=[]){this.segments=e}prepareSegment(e,n,s,u){let f=this.segments[this.segments.length-1];return e>Di.MAX_VERTEX_ARRAY_LENGTH&&ft(`Max vertices per segment is ${Di.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!f||f.vertexLength+e>Di.MAX_VERTEX_ARRAY_LENGTH||f.sortKey!==u)&&(f={vertexOffset:n.length,primitiveOffset:s.length,vertexLength:0,primitiveLength:0},u!==void 0&&(f.sortKey=u),this.segments.push(f)),f}get(){return this.segments}destroy(){for(const e of this.segments)for(const n in e.vaos)e.vaos[n].destroy()}static simpleSegment(e,n,s,u){return new Di([{vertexOffset:e,primitiveOffset:n,vertexLength:s,primitiveLength:u,vaos:{},sortKey:0}])}}function po(i,e){return 256*(i=_t(Math.floor(i),0,255))+_t(Math.floor(e),0,255)}Di.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,He("SegmentVector",Di);const fo=zi([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var ds={exports:{}},Os={exports:{}};Os.exports=function(i,e){var n,s,u,f,_,v,T,P;for(s=i.length-(n=3&i.length),u=e,_=3432918353,v=461845907,P=0;P<s;)T=255&i.charCodeAt(P)|(255&i.charCodeAt(++P))<<8|(255&i.charCodeAt(++P))<<16|(255&i.charCodeAt(++P))<<24,++P,u=27492+(65535&(f=5*(65535&(u=(u^=T=(65535&(T=(T=(65535&T)*_+(((T>>>16)*_&65535)<<16)&4294967295)<<15|T>>>17))*v+(((T>>>16)*v&65535)<<16)&4294967295)<<13|u>>>19))+((5*(u>>>16)&65535)<<16)&4294967295))+((58964+(f>>>16)&65535)<<16);switch(T=0,n){case 3:T^=(255&i.charCodeAt(P+2))<<16;case 2:T^=(255&i.charCodeAt(P+1))<<8;case 1:u^=T=(65535&(T=(T=(65535&(T^=255&i.charCodeAt(P)))*_+(((T>>>16)*_&65535)<<16)&4294967295)<<15|T>>>17))*v+(((T>>>16)*v&65535)<<16)&4294967295}return u^=i.length,u=2246822507*(65535&(u^=u>>>16))+((2246822507*(u>>>16)&65535)<<16)&4294967295,u=3266489909*(65535&(u^=u>>>13))+((3266489909*(u>>>16)&65535)<<16)&4294967295,(u^=u>>>16)>>>0};var _a=Os.exports,Mn={exports:{}};Mn.exports=function(i,e){for(var n,s=i.length,u=e^s,f=0;s>=4;)n=1540483477*(65535&(n=255&i.charCodeAt(f)|(255&i.charCodeAt(++f))<<8|(255&i.charCodeAt(++f))<<16|(255&i.charCodeAt(++f))<<24))+((1540483477*(n>>>16)&65535)<<16),u=1540483477*(65535&u)+((1540483477*(u>>>16)&65535)<<16)^(n=1540483477*(65535&(n^=n>>>24))+((1540483477*(n>>>16)&65535)<<16)),s-=4,++f;switch(s){case 3:u^=(255&i.charCodeAt(f+2))<<16;case 2:u^=(255&i.charCodeAt(f+1))<<8;case 1:u=1540483477*(65535&(u^=255&i.charCodeAt(f)))+((1540483477*(u>>>16)&65535)<<16)}return u=1540483477*(65535&(u^=u>>>13))+((1540483477*(u>>>16)&65535)<<16),(u^=u>>>15)>>>0};var bn=_a,Vn=Mn.exports;ds.exports=bn,ds.exports.murmur3=bn,ds.exports.murmur2=Vn;var Fs=X(ds.exports);class qi{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,n,s,u){this.ids.push(rn(e)),this.positions.push(n,s,u)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const n=rn(e);let s=0,u=this.ids.length-1;for(;s<u;){const _=s+u>>1;this.ids[_]>=n?u=_:s=_+1}const f=[];for(;this.ids[s]===n;)f.push({index:this.positions[3*s],start:this.positions[3*s+1],end:this.positions[3*s+2]}),s++;return f}static serialize(e,n){const s=new Float64Array(e.ids),u=new Uint32Array(e.positions);return tr(s,u,0,s.length-1),n&&n.push(s.buffer,u.buffer),{ids:s,positions:u}}static deserialize(e){const n=new qi;return n.ids=e.ids,n.positions=e.positions,n.indexed=!0,n}}function rn(i){const e=+i;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Fs(String(i))}function tr(i,e,n,s){for(;n<s;){const u=i[n+s>>1];let f=n-1,_=s+1;for(;;){do f++;while(i[f]<u);do _--;while(i[_]>u);if(f>=_)break;Gi(i,f,_),Gi(e,3*f,3*_),Gi(e,3*f+1,3*_+1),Gi(e,3*f+2,3*_+2)}_-n<s-_?(tr(i,e,n,_),n=_+1):(tr(i,e,_+1,s),s=_)}}function Gi(i,e,n){const s=i[e];i[e]=i[n],i[n]=s}He("FeaturePositionMap",qi);class Ns{constructor(e,n){this.gl=e.gl,this.location=n}}class ul extends Ns{constructor(e,n){super(e,n),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class lc extends Ns{constructor(e,n){super(e,n),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class cc extends Ns{constructor(e,n){super(e,n),this.current=_i.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const Qc=new Float32Array(16);function Vl(i){return[po(255*i.r,255*i.g),po(255*i.b,255*i.a)]}class mo{constructor(e,n,s){this.value=e,this.uniformNames=n.map(u=>`u_${u}`),this.type=s}setUniform(e,n,s){e.set(s.constantOr(this.value))}getBinding(e,n,s){return this.type==="color"?new cc(e,n):new ul(e,n)}}class Us{constructor(e,n){this.uniformNames=n.map(s=>`u_${s}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,n){this.pixelRatioFrom=n.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=n.tlbr,this.patternTo=e.tlbr}setUniform(e,n,s,u){const f=u==="u_pattern_to"?this.patternTo:u==="u_pattern_from"?this.patternFrom:u==="u_pixel_ratio_to"?this.pixelRatioTo:u==="u_pixel_ratio_from"?this.pixelRatioFrom:null;f&&e.set(f)}getBinding(e,n,s){return s.substr(0,9)==="u_pattern"?new lc(e,n):new ul(e,n)}}class _o{constructor(e,n,s,u){this.expression=e,this.type=s,this.maxValue=0,this.paintVertexAttributes=n.map(f=>({name:`a_${f}`,type:"Float32",components:s==="color"?2:1,offset:0})),this.paintVertexArray=new u}populatePaintArray(e,n,s,u,f){const _=this.paintVertexArray.length,v=this.expression.evaluate(new ne(0),n,{},u,[],f);this.paintVertexArray.resize(e),this._setPaintValue(_,e,v)}updatePaintArray(e,n,s,u){const f=this.expression.evaluate({zoom:0},s,u);this._setPaintValue(e,n,f)}_setPaintValue(e,n,s){if(this.type==="color"){const u=Vl(s);for(let f=e;f<n;f++)this.paintVertexArray.emplace(f,u[0],u[1])}else{for(let u=e;u<n;u++)this.paintVertexArray.emplace(u,s);this.maxValue=Math.max(this.maxValue,Math.abs(s))}}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 Cr{constructor(e,n,s,u,f,_){this.expression=e,this.uniformNames=n.map(v=>`u_${v}_t`),this.type=s,this.useIntegerZoom=u,this.zoom=f,this.maxValue=0,this.paintVertexAttributes=n.map(v=>({name:`a_${v}`,type:"Float32",components:s==="color"?4:2,offset:0})),this.paintVertexArray=new _}populatePaintArray(e,n,s,u,f){const _=this.expression.evaluate(new ne(this.zoom),n,{},u,[],f),v=this.expression.evaluate(new ne(this.zoom+1),n,{},u,[],f),T=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(T,e,_,v)}updatePaintArray(e,n,s,u){const f=this.expression.evaluate({zoom:this.zoom},s,u),_=this.expression.evaluate({zoom:this.zoom+1},s,u);this._setPaintValue(e,n,f,_)}
vendor: 6,660 bytes, line 9
9_setPaintValue(e,n,s,u){if(this.type==="color"){const f=Vl(s),_=Vl(u);for(let v=e;v<n;v++)this.paintVertexArray.emplace(v,f[0],f[1],_[0],_[1])}else{for(let f=e;f<n;f++)this.paintVertexArray.emplace(f,s,u);this.maxValue=Math.max(this.maxValue,Math.abs(s),Math.abs(u))}}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,n){const s=this.useIntegerZoom?Math.floor(n.zoom):n.zoom,u=_t(this.expression.interpolationFactor(s,this.zoom,this.zoom+1),0,1);e.set(u)}getBinding(e,n,s){return new ul(e,n)}}class go{constructor(e,n,s,u,f,_){this.expression=e,this.type=n,this.useIntegerZoom=s,this.zoom=u,this.layerId=_,this.zoomInPaintVertexArray=new f,this.zoomOutPaintVertexArray=new f}populatePaintArray(e,n,s){const u=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(u,e,n.patterns&&n.patterns[this.layerId],s)}updatePaintArray(e,n,s,u,f){this._setPaintValues(e,n,s.patterns&&s.patterns[this.layerId],f)}_setPaintValues(e,n,s,u){if(!u||!s)return;const{min:f,mid:_,max:v}=s,T=u[f],P=u[_],C=u[v];if(T&&P&&C)for(let D=e;D<n;D++)this.zoomInPaintVertexArray.emplace(D,P.tl[0],P.tl[1],P.br[0],P.br[1],T.tl[0],T.tl[1],T.br[0],T.br[1],P.pixelRatio,T.pixelRatio),this.zoomOutPaintVertexArray.emplace(D,P.tl[0],P.tl[1],P.br[0],P.br[1],C.tl[0],C.tl[1],C.br[0],C.br[1],P.pixelRatio,C.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,fo.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,fo.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Zl{constructor(e,n,s){this.binders={},this._buffers=[];const u=[];for(const f in e.paint._values){if(!s(f))continue;const _=e.paint.get(f);if(!(_ instanceof xi&&rs(_.property.specification)))continue;const v=Hf(f,e.type),T=_.value,P=_.property.specification.type,C=_.property.useIntegerZoom,D=_.property.specification["property-type"],O=D==="cross-faded"||D==="cross-faded-data-driven";if(T.kind==="constant")this.binders[f]=O?new Us(T.value,v):new mo(T.value,v,P),u.push(`/u_${f}`);else if(T.kind==="source"||O){const Z=_h(f,P,"source");this.binders[f]=O?new go(T,P,C,n,Z,e.id):new _o(T,v,P,Z),u.push(`/a_${f}`)}else{const Z=_h(f,P,"composite");this.binders[f]=new Cr(T,v,P,C,n,Z),u.push(`/z_${f}`)}}this.cacheKey=u.sort().join("")}getMaxValue(e){const n=this.binders[e];return n instanceof _o||n instanceof Cr?n.maxValue:0}populatePaintArrays(e,n,s,u,f){for(const _ in this.binders){const v=this.binders[_];(v instanceof _o||v instanceof Cr||v instanceof go)&&v.populatePaintArray(e,n,s,u,f)}}setConstantPatternPositions(e,n){for(const s in this.binders){const u=this.binders[s];u instanceof Us&&u.setConstantPatternPositions(e,n)}}updatePaintArrays(e,n,s,u,f){let _=!1;for(const v in e){const T=n.getPositions(v);for(const P of T){const C=s.feature(P.index);for(const D in this.binders){const O=this.binders[D];if((O instanceof _o||O instanceof Cr||O instanceof go)&&O.expression.isStateDependent===!0){const Z=u.paint.get(D);O.expression=Z.value,O.updatePaintArray(P.start,P.end,C,e[v],f),_=!0}}}}return _}defines(){const e=[];for(const n in this.binders){const s=this.binders[n];(s instanceof mo||s instanceof Us)&&e.push(...s.uniformNames.map(u=>`#define HAS_UNIFORM_${u}`))}return e}getBinderAttributes(){const e=[];for(const n in this.binders){const s=this.binders[n];if(s instanceof _o||s instanceof Cr)for(let u=0;u<s.paintVertexAttributes.length;u++)e.push(s.paintVertexAttributes[u].name);else if(s instanceof go)for(let u=0;u<fo.members.length;u++)e.push(fo.members[u].name)}return e}getBinderUniforms(){const e=[];for(const n in this.binders){const s=this.binders[n];if(s instanceof mo||s instanceof Us||s instanceof Cr)for(const u of s.uniformNames)e.push(u)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,n){const s=[];for(const u in this.binders){const f=this.binders[u];if(f instanceof mo||f instanceof Us||f instanceof Cr){for(const _ of f.uniformNames)if(n[_]){const v=f.getBinding(e,n[_],_);s.push({name:_,property:u,binding:v})}}}return s}setUniforms(e,n,s,u){for(const{name:f,property:_,binding:v}of n)this.binders[_].setUniform(v,u,s.get(_),f)}updatePaintBuffers(e){this._buffers=[];for(const n in this.binders){const s=this.binders[n];if(e&&s instanceof go){const u=e.fromScale===2?s.zoomInPaintVertexBuffer:s.zoomOutPaintVertexBuffer;u&&this._buffers.push(u)}else(s instanceof _o||s instanceof Cr)&&s.paintVertexBuffer&&this._buffers.push(s.paintVertexBuffer)}}upload(e){for(const n in this.binders){const s=this.binders[n];(s instanceof _o||s instanceof Cr||s instanceof go)&&s.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const n=this.binders[e];(n instanceof _o||n instanceof Cr||n instanceof go)&&n.destroy()}}}class $o{constructor(e,n,s=()=>!0){this.programConfigurations={};for(const u of e)this.programConfigurations[u.id]=new Zl(u,n,s);this.needsUpload=!1,this._featureMap=new qi,this._bufferOffset=0}populatePaintArrays(e,n,s,u,f,_){for(const v in this.programConfigurations)this.programConfigurations[v].populatePaintArrays(e,n,u,f,_);n.id!==void 0&&this._featureMap.add(n.id,s,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,n,s,u){for(const f of s)this.needsUpload=this.programConfigurations[f.id].updatePaintArrays(e,this._featureMap,n,f,u)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const n in this.programConfigurations)this.programConfigurations[n].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Hf(i,e){return{"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
9pwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[i]||[i.replace(`${e}-`,"").replace(/-/g,"_")]}function _h(i,e,n){const s={color:{source:ma,composite:K},number:{source:A,composite:ma}},u=function(f){return{"line-pattern":{source:wi,composite:wi},"fill-pattern":{source:wi,composite:wi},"fill-extrusion-pattern":{source:wi,composite:wi}}[f]}(i);return u&&u[n]||s[e][n]}He("ConstantBinder",mo),He("CrossFadedConstantBinder",Us),He("SourceExpressionBinder",_o),He("CrossFadedCompositeBinder",go),He("CompositeExpressionBinder",Cr),He("ProgramConfiguration",Zl,{omit:["_buffers"]}),He("ProgramConfigurationSet",$o);const Ji=8192,eu=Math.pow(2,14)-1,gh=-eu-1;function Va(i){const e=Ji/i.extent,n=i.loadGeometry();for(let s=0;s<n.length;s++){const u=n[s];for(let f=0;f<u.length;f++){const _=u[f],v=Math.round(_.x*e),T=Math.round(_.y*e);_.x=_t(v,gh,eu),_.y=_t(T,gh,eu),(v<_.x||v>_.x+1||T<_.y||T>_.y+1)&&ft("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return n}function Za(i,e){return{type:i.type,id:i.id,properties:i.properties,geometry:e?Va(i):[]}}function uc(i,e,n,s,u){i.emplaceBack(2*e+(s+1)/2,2*n+(u+1)/2)}class tu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(n=>n.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new tt,this.indexArray=new xn,this.segments=new Di,this.programConfigurations=new $o(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(n=>n.isStateDependent()).map(n=>n.id)}populate(e,n,s){const u=this.layers[0],f=[];let _=null,v=!1;u.type==="circle"&&(_=u.layout.get("circle-sort-key"),v=!_.isConstant());for(const{feature:T,id:P,index:C,sourceLayerIndex:D}of e){const O=this.layers[0]._featureFilter.needGeometry,Z=Za(T,O);if(!this.layers[0]._featureFilter.filter(new ne(this.zoom),Z,s))continue;const j=v?_.evaluate(Z,{},s):void 0,H={id:P,properties:T.properties,type:T.type,sourceLayerIndex:D,index:C,geometry:O?Z.geometry:Va(T),patterns:{},sortKey:j};f.push(H)}v&&f.sort((T,P)=>T.sortKey-P.sortKey);for(const T of f){const{geometry:P,index:C,sourceLayerIndex:D}=T,O=e[C].feature;this.addFeature(T,P,C,s),n.featureIndex.insert(O,P,C,D,this.index)}}update(e,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,n,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,fr),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())}addFeature(e,n,s,u){for(const f of n)for(const _ of f){const v=_.x,T=_.y;if(v<0||v>=Ji||T<0||T>=Ji)continue;const P=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),C=P.vertexLength;uc(this.layoutVertexArray,v,T,-1,-1),uc(this.layoutVertexArray,v,T,1,-1),uc(this.layoutVertexArray,v,T,1,1),uc(this.layoutVertexArray,v,T,-1,1),this.indexArray.emplaceBack(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),P.vertexLength+=4,P.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,{},u)}}function yh(i,e){for(let n=0;n<i.length;n++)if(hl(e,i[n]))return!0;for(let n=0;n<e.length;n++)if(hl(i,e[n]))return!0;return!!iu(i,e)}function Wf(i,e,n){return!!hl(i,e)||!!nu(e,i,n)}function vh(i,e){if(i.length===1)return bh(e,i[0]);for(let n=0;n<e.length;n++){const s=e[n];for(let u=0;u<s.length;u++)if(hl(i,s[u]))return!0}for(let n=0;n<i.length;n++)if(bh(e,i[n]))return!0;for(let n=0;n<e.length;n++)if(iu(i,e[n]))return!0;return!1}function Kf(i,e,n){if(i.length>1){if(iu(i,e))return!0;for(let s=0;s<e.length;s++)if(nu(e[s],i,n))return!0}for(let s=0;s<i.length;s++)if(nu(i[s],e,n))return!0;return!1}function iu(i,e){if(i.length===0||e.length===0)return!1;for(let n=0;n<i.length-1;n++){const s=i[n],u=i[n+1];for(let f=0;f<e.length-1;f++)if(Xf(s,u,e[f],e[f+1]))return!0}return!1}
vendor: 9,198 bytes, line 9
9function Xf(i,e,n,s){return Ut(i,n,s)!==Ut(e,n,s)&&Ut(i,e,n)!==Ut(i,e,s)}function nu(i,e,n){const s=n*n;if(e.length===1)return i.distSqr(e[0])<s;for(let u=1;u<e.length;u++)if(xh(i,e[u-1],e[u])<s)return!0;return!1}function xh(i,e,n){const s=e.distSqr(n);if(s===0)return i.distSqr(e);const u=((i.x-e.x)*(n.x-e.x)+(i.y-e.y)*(n.y-e.y))/s;return i.distSqr(u<0?e:u>1?n:n.sub(e)._mult(u)._add(e))}function bh(i,e){let n,s,u,f=!1;for(let _=0;_<i.length;_++){n=i[_];for(let v=0,T=n.length-1;v<n.length;T=v++)s=n[v],u=n[T],s.y>e.y!=u.y>e.y&&e.x<(u.x-s.x)*(e.y-s.y)/(u.y-s.y)+s.x&&(f=!f)}return f}function hl(i,e){let n=!1;for(let s=0,u=i.length-1;s<i.length;u=s++){const f=i[s],_=i[u];f.y>e.y!=_.y>e.y&&e.x<(_.x-f.x)*(e.y-f.y)/(_.y-f.y)+f.x&&(n=!n)}return n}function Yf(i,e,n){const s=n[0],u=n[2];if(i.x<s.x&&e.x<s.x||i.x>u.x&&e.x>u.x||i.y<s.y&&e.y<s.y||i.y>u.y&&e.y>u.y)return!1;const f=Ut(i,e,n[0]);return f!==Ut(i,e,n[1])||f!==Ut(i,e,n[2])||f!==Ut(i,e,n[3])}function jl(i,e,n){const s=e.paint.get(i).value;return s.kind==="constant"?s.value:n.programConfigurations.get(e.id).getMaxValue(i)}function hc(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1])}function dc(i,e,n,s,u){if(!e[0]&&!e[1])return i;const f=pe.convert(e)._mult(u);n==="viewport"&&f._rotate(-s);const _=[];for(let v=0;v<i.length;v++)_.push(i[v].sub(f));return _}let wh,Th;He("CircleBucket",tu,{omit:["layers"]});var Jf={get paint(){return Th=Th||new ji({"circle-radius":new Je(Pe.paint_circle["circle-radius"]),"circle-color":new Je(Pe.paint_circle["circle-color"]),"circle-blur":new Je(Pe.paint_circle["circle-blur"]),"circle-opacity":new Je(Pe.paint_circle["circle-opacity"]),"circle-translate":new Ge(Pe.paint_circle["circle-translate"]),"circle-translate-anchor":new Ge(Pe.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ge(Pe.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ge(Pe.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Je(Pe.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Je(Pe.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Je(Pe.paint_circle["circle-stroke-opacity"])})},get layout(){return wh=wh||new ji({"circle-sort-key":new Je(Pe.layout_circle["circle-sort-key"])})}},ir=1e-6,dl=typeof Float32Array!="undefined"?Float32Array:Array;function ru(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Sh(i,e,n){var s=e[0],u=e[1],f=e[2],_=e[3],v=e[4],T=e[5],P=e[6],C=e[7],D=e[8],O=e[9],Z=e[10],j=e[11],H=e[12],te=e[13],oe=e[14],de=e[15],ae=n[0],me=n[1],be=n[2],Ee=n[3];return i[0]=ae*s+me*v+be*D+Ee*H,i[1]=ae*u+me*T+be*O+Ee*te,i[2]=ae*f+me*P+be*Z+Ee*oe,i[3]=ae*_+me*C+be*j+Ee*de,i[4]=(ae=n[4])*s+(me=n[5])*v+(be=n[6])*D+(Ee=n[7])*H,i[5]=ae*u+me*T+be*O+Ee*te,i[6]=ae*f+me*P+be*Z+Ee*oe,i[7]=ae*_+me*C+be*j+Ee*de,i[8]=(ae=n[8])*s+(me=n[9])*v+(be=n[10])*D+(Ee=n[11])*H,i[9]=ae*u+me*T+be*O+Ee*te,i[10]=ae*f+me*P+be*Z+Ee*oe,i[11]=ae*_+me*C+be*j+Ee*de,i[12]=(ae=n[12])*s+(me=n[13])*v+(be=n[14])*D+(Ee=n[15])*H,i[13]=ae*u+me*T+be*O+Ee*te,i[14]=ae*f+me*P+be*Z+Ee*oe,i[15]=ae*_+me*C+be*j+Ee*de,i}Math.hypot||(Math.hypot=function(){for(var i=0,e=arguments.length;e--;)i+=arguments[e]*arguments[e];return Math.sqrt(i)});var $l,Qf=Sh;function pc(i,e,n){var s=e[0],u=e[1],f=e[2],_=e[3];return i[0]=n[0]*s+n[4]*u+n[8]*f+n[12]*_,i[1]=n[1]*s+n[5]*u+n[9]*f+n[13]*_,i[2]=n[2]*s+n[6]*u+n[10]*f+n[14]*_,i[3]=n[3]*s+n[7]*u+n[11]*f+n[15]*_,i}$l=new dl(4),dl!=Float32Array&&($l[0]=0,$l[1]=0,$l[2]=0,$l[3]=0);class em extends er{constructor(e){super(e,Jf)}createBucket(e){return new tu(e)}queryRadius(e){const n=e;return jl("circle-radius",this,n)+jl("circle-stroke-width",this,n)+hc(this.paint.get("circle-translate"))}queryIntersectsFeature(e,n,s,u,f,_,v,T){const P=dc(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),_.angle,v),C=this.paint.get("circle-radius").evaluate(n,s)+this.paint.get("circle-stroke-width").evaluate(n,s),D=this.paint.get("circle-pitch-alignment")==="map",O=D?P:function(j,H){return j.map(te=>Ah(te,H))}(P,T),Z=D?C*v:C;for(const j of u)for(const H of j){const te=D?H:Ah(H,T);let oe=Z;const de=pc([],[H.x,H.y,0,1],T);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?oe*=de[3]/_.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(oe*=_.cameraToCenterDistance/de[3]),Wf(O,te,oe))return!0}return!1}}function Ah(i,e){const n=pc([],[i.x,i.y,0,1],e);return new pe(n[0]/n[3],n[1]/n[3])}class Ph extends tu{}let Ih;He("HeatmapBucket",Ph,{omit:["layers"]});var tm={get paint(){return Ih=Ih||new ji({"heatmap-radius":new Je(Pe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Je(Pe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ge(Pe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Fa(Pe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ge(Pe.paint_heatmap["heatmap-opacity"])})}};function ou(i,{width:e,height:n},s,u){if(u){if(u instanceof Uint8ClampedArray)u=new Uint8Array(u.buffer);else if(u.length!==e*n*s)throw new RangeError(`mismatched image size. expected: ${u.length} but got: ${e*n*s}`)}else u=new Uint8Array(e*n*s);return i.width=e,i.height=n,i.data=u,i}function Lh(i,{width:e,height:n},s){if(e===i.width&&n===i.height)return;const u=ou({},{width:e,height:n},s);su(i,u,{x:0,y:0},{x:0,y:0},{width:Math.min(i.width,e),height:Math.min(i.height,n)},s),i.width=e,i.height=n,i.data=u.data}function su(i,e,n,s,u,f){if(u.width===0||u.height===0)return e;if(u.width>i.width||u.height>i.height||n.x>i.width-u.width||n.y>i.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>e.width||u.height>e.height||s.x>e.width-u.width||s.y>e.height-u.height)throw new RangeError("out of range destination coordinates for image copy");const _=i.data,v=e.data;if(_===v)throw new Error("srcData equals dstData, so image is already copied");for(let T=0;T<u.height;T++){const P=((n.y+T)*i.width+n.x)*f,C=((s.y+T)*e.width+s.x)*f;for(let D=0;D<u.width*f;D++)v[C+D]=_[P+D]}return e}class ql{constructor(e,n){ou(this,e,1,n)}resize(e){Lh(this,e,1)}clone(){return new ql({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,n,s,u,f){su(e,n,s,u,f,1)}}class $r{constructor(e,n){ou(this,e,4,n)}resize(e){Lh(this,e,4)}replace(e,n){n?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new $r({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,n,s,u,f){su(e,n,s,u,f,4)}}function Eh(i){const e={},n=i.resolution||256,s=i.clips?i.clips.length:1,u=i.image||new $r({width:n,height:s});if(Math.log(n)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${n}`);const f=(_,v,T)=>{e[i.evaluationKey]=T;const P=i.expression.evaluate(e);u.data[_+v+0]=Math.floor(255*P.r/P.a),u.data[_+v+1]=Math.floor(255*P.g/P.a),u.data[_+v+2]=Math.floor(255*P.b/P.a),u.data[_+v+3]=Math.floor(255*P.a)};if(i.clips)for(let _=0,v=0;_<s;++_,v+=4*n)for(let T=0,P=0;T<n;T++,P+=4){const C=T/(n-1),{start:D,end:O}=i.clips[_];f(v,P,D*(1-C)+O*C)}else for(let _=0,v=0;_<n;_++,v+=4)f(0,v,_/(n-1));return u}He("AlphaImage",ql),He("RGBAImage",$r);class im extends er{createBucket(e){return new Ph(e)}constructor(e){super(e,tm),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Eh({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(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let Ch;var nm={get paint(){return Ch=Ch||new ji({"hillshade-illumination-direction":new Ge(Pe.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ge(Pe.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ge(Pe.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ge(Pe.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ge(Pe.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ge(Pe.paint_hillshade["hillshade-accent-color"])})}};class rm extends er{constructor(e){super(e,nm)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const om=zi([{name:"a_pos",components:2,type:"Int16"}],4),{members:sm}=om;var au={exports:{}};function fc(i,e,n){n=n||2;var s,u,f,_,v,T,P,C=e&&e.length,D=C?e[0]*n:i.length,O=Mh(i,0,D,n,!0),Z=[];if(!O||O.next===O.prev)return Z;if(C&&(O=function(H,te,oe,de){var ae,me,be,Ee=[];for(ae=0,me=te.length;ae<me;ae++)(be=Mh(H,te[ae]*de,ae<me-1?te[ae+1]*de:H.length,de,!1))===be.next&&(be.steiner=!0),Ee.push(fm(be));for(Ee.sort(hm),ae=0;ae<Ee.length;ae++)oe=dm(Ee[ae],oe);return oe}(i,e,O,n)),i.length>80*n){s=f=i[0],u=_=i[1];for(var j=n;j<D;j+=n)(v=i[j])<s&&(s=v),(T=i[j+1])<u&&(u=T),v>f&&(f=v),T>_&&(_=T);P=(P=Math.max(f-s,_-u))!==0?32767/P:0}
vendor: 5,869 bytes, line 9
9return Gl(O,Z,n,s,u,P,0),Z}function Mh(i,e,n,s,u){var f,_;if(u===uu(i,e,n,s)>0)for(f=e;f<n;f+=s)_=Dh(f,i[f],i[f+1],_);else for(f=n-s;f>=e;f-=s)_=Dh(f,i[f],i[f+1],_);return _&&mc(_,_.next)&&(Wl(_),_=_.next),_}function ja(i,e){if(!i)return i;e||(e=i);var n,s=i;do if(n=!1,s.steiner||!mc(s,s.next)&&Xi(s.prev,s,s.next)!==0)s=s.next;else{if(Wl(s),(s=e=s.prev)===s.next)break;n=!0}while(n||s!==e);return e}function Gl(i,e,n,s,u,f,_){if(i){!_&&f&&function(C,D,O,Z){var j=C;do j.z===0&&(j.z=lu(j.x,j.y,D,O,Z)),j.prevZ=j.prev,j.nextZ=j.next,j=j.next;while(j!==C);j.prevZ.nextZ=null,j.prevZ=null,function(H){var te,oe,de,ae,me,be,Ee,qe,it=1;do{for(oe=H,H=null,me=null,be=0;oe;){for(be++,de=oe,Ee=0,te=0;te<it&&(Ee++,de=de.nextZ);te++);for(qe=it;Ee>0||qe>0&&de;)Ee!==0&&(qe===0||!de||oe.z<=de.z)?(ae=oe,oe=oe.nextZ,Ee--):(ae=de,de=de.nextZ,qe--),me?me.nextZ=ae:H=ae,ae.prevZ=me,me=ae;oe=de}me.nextZ=null,it*=2}while(be>1)}(j)}(i,s,u,f);for(var v,T,P=i;i.prev!==i.next;)if(v=i.prev,T=i.next,f?lm(i,s,u,f):am(i))e.push(v.i/n|0),e.push(i.i/n|0),e.push(T.i/n|0),Wl(i),i=T.next,P=T.next;else if((i=T)===P){_?_===1?Gl(i=cm(ja(i),e,n),e,n,s,u,f,2):_===2&&um(i,e,n,s,u,f):Gl(ja(i),e,n,s,u,f,1);break}}}function am(i){var e=i.prev,n=i,s=i.next;if(Xi(e,n,s)>=0)return!1;for(var u=e.x,f=n.x,_=s.x,v=e.y,T=n.y,P=s.y,C=u<f?u<_?u:_:f<_?f:_,D=v<T?v<P?v:P:T<P?T:P,O=u>f?u>_?u:_:f>_?f:_,Z=v>T?v>P?v:P:T>P?T:P,j=s.next;j!==e;){if(j.x>=C&&j.x<=O&&j.y>=D&&j.y<=Z&&pl(u,v,f,T,_,P,j.x,j.y)&&Xi(j.prev,j,j.next)>=0)return!1;j=j.next}return!0}function lm(i,e,n,s){var u=i.prev,f=i,_=i.next;if(Xi(u,f,_)>=0)return!1;for(var v=u.x,T=f.x,P=_.x,C=u.y,D=f.y,O=_.y,Z=v<T?v<P?v:P:T<P?T:P,j=C<D?C<O?C:O:D<O?D:O,H=v>T?v>P?v:P:T>P?T:P,te=C>D?C>O?C:O:D>O?D:O,oe=lu(Z,j,e,n,s),de=lu(H,te,e,n,s),ae=i.prevZ,me=i.nextZ;ae&&ae.z>=oe&&me&&me.z<=de;){if(ae.x>=Z&&ae.x<=H&&ae.y>=j&&ae.y<=te&&ae!==u&&ae!==_&&pl(v,C,T,D,P,O,ae.x,ae.y)&&Xi(ae.prev,ae,ae.next)>=0||(ae=ae.prevZ,me.x>=Z&&me.x<=H&&me.y>=j&&me.y<=te&&me!==u&&me!==_&&pl(v,C,T,D,P,O,me.x,me.y)&&Xi(me.prev,me,me.next)>=0))return!1;me=me.nextZ}for(;ae&&ae.z>=oe;){if(ae.x>=Z&&ae.x<=H&&ae.y>=j&&ae.y<=te&&ae!==u&&ae!==_&&pl(v,C,T,D,P,O,ae.x,ae.y)&&Xi(ae.prev,ae,ae.next)>=0)return!1;ae=ae.prevZ}for(;me&&me.z<=de;){if(me.x>=Z&&me.x<=H&&me.y>=j&&me.y<=te&&me!==u&&me!==_&&pl(v,C,T,D,P,O,me.x,me.y)&&Xi(me.prev,me,me.next)>=0)return!1;me=me.nextZ}return!0}function cm(i,e,n){var s=i;do{var u=s.prev,f=s.next.next;!mc(u,f)&&kh(u,s,s.next,f)&&Hl(u,f)&&Hl(f,u)&&(e.push(u.i/n|0),e.push(s.i/n|0),e.push(f.i/n|0),Wl(s),Wl(s.next),s=i=f),s=s.next}while(s!==i);return ja(s)}function um(i,e,n,s,u,f){var _=i;do{for(var v=_.next.next;v!==_.prev;){if(_.i!==v.i&&mm(_,v)){var T=zh(_,v);return _=ja(_,_.next),T=ja(T,T.next),Gl(_,e,n,s,u,f,0),void Gl(T,e,n,s,u,f,0)}v=v.next}_=_.next}while(_!==i)}function hm(i,e){return i.x-e.x}function dm(i,e){var n=function(u,f){var _,v=f,T=u.x,P=u.y,C=-1/0;do{if(P<=v.y&&P>=v.next.y&&v.next.y!==v.y){var D=v.x+(P-v.y)*(v.next.x-v.x)/(v.next.y-v.y);if(D<=T&&D>C&&(C=D,_=v.x<v.next.x?v:v.next,D===T))return _}v=v.next}while(v!==f);if(!_)return null;var O,Z=_,j=_.x,H=_.y,te=1/0;v=_;do T>=v.x&&v.x>=j&&T!==v.x&&pl(P<H?T:C,P,j,H,P<H?C:T,P,v.x,v.y)&&(O=Math.abs(P-v.y)/(T-v.x),Hl(v,u)&&(O<te||O===te&&(v.x>_.x||v.x===_.x&&pm(_,v)))&&(_=v,te=O)),v=v.next;while(v!==Z);return _}(i,e);if(!n)return e;var s=zh(n,i);return ja(s,s.next),ja(n,n.next)}function pm(i,e){return Xi(i.prev,i,e.prev)<0&&Xi(e.next,i,i.next)<0}function lu(i,e,n,s,u){return(i=1431655765&((i=858993459&((i=252645135&((i=16711935&((i=(i-n)*u|0)|i<<8))|i<<4))|i<<2))|i<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-s)*u|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function fm(i){var e=i,n=i;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==i);return n}function pl(i,e,n,s,u,f,_,v){return(u-_)*(e-v)>=(i-_)*(f-v)&&(i-_)*(s-v)>=(n-_)*(e-v)&&(n-_)*(f-v)>=(u-_)*(s-v)}function mm(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!function(n,s){var u=n;do{if(u.i!==n.i&&u.next.i!==n.i&&u.i!==s.i&&u.next.i!==s.i&&kh(u,u.next,n,s))return!0;u=u.next}while(u!==n);return!1}(i,e)&&(Hl(i,e)&&Hl(e,i)&&function(n,s){var u=n,f=!1,_=(n.x+s.x)/2,v=(n.y+s.y)/2;do u.y>v!=u.next.y>v&&u.next.y!==u.y&&_<(u.next.x-u.x)*(v-u.y)/(u.next.y-u.y)+u.x&&(f=!f),u=u.next;while(u!==n);return f}(i,e)&&(Xi(i.prev,i,e.prev)||Xi(i,e.prev,e))||mc(i,e)&&Xi(i.prev,i,i.next)>0&&Xi(e.prev,e,e.next)>0)}function Xi(i,e,n){return(e.y-i.y)*(n.x-e.x)-(e.x-i.x)*(n.y-e.y)}function mc(i,e){return i.x===e.x&&i.y===e.y}function kh(i,e,n,s){var u=gc(Xi(i,e,n)),f=gc(Xi(i,e,s)),_=gc(Xi(n,s,i)),v=gc(Xi(n,s,e));return u!==f&&_!==v||!(u!==0||!_c(i,n,e))||!(f!==0||!_c(i,s,e))||!(_!==0||!_c(n,i,s))||!(v!==0||!_c(n,e,s))}function _c(i,e,n){return e.x<=Math.max(i.x,n.x)&&e.x>=Math.min(i.x,n.x)&&e.y<=Math.max(i.y,n.y)&&e.y>=Math.min(i.y,n.y)}function gc(i){return i>0?1:i<0?-1:0}function Hl(i,e){return Xi(i.prev,i,i.next)<0?Xi(i,e,i.next)>=0&&Xi(i,i.prev,e)>=0:Xi(i,e,i.prev)<0||Xi(i,i.next,e)<0}function zh(i,e){var n=new cu(i.i,i.x,i.y),s=new cu(e.i,e.x,e.y),u=i.next,f=e.prev;return i.next=e,e.prev=i,n.next=u,u.prev=n,s.next=n,n.prev=s,f.next=s,s.prev=f,s}function Dh(i,e,n,s){var u=new cu(i,e,n);return s?(u.next=s.next,u.prev=s,s.next.prev=u,s.next=u):(u.prev=u,u.next=u),u}function Wl(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function cu(i,e,n){this.i=i,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function uu(i,e,n,s){for(var u=0,f=e,_=n-s;f<n;f+=s)u+=(i[_]-i[f])*(i[f+1]+i[_+1]),_=f;return u}au.exports=fc,au.exports.default=fc,fc.deviation=function(i,e,n,s){var u=e&&e.length,f=Math.abs(uu(i,0,u?e[0]*n:i.length,n));if(u)for(var _=0,v=e.length;_<v;_++)f-=Math.abs(uu(i,e[_]*n,_<v-1?e[_+1]*n:i.length,n));var T=0;for(_=0;_<s.length;_+=3){var P=s[_]*n,C=s[_+1]*n,D=s[_+2]*n;
vendor: 4,721 bytes, line 9
9T+=Math.abs((i[P]-i[D])*(i[C+1]-i[P+1])-(i[P]-i[C])*(i[D+1]-i[P+1]))}return f===0&&T===0?0:Math.abs((T-f)/f)},fc.flatten=function(i){for(var e=i[0][0].length,n={vertices:[],holes:[],dimensions:e},s=0,u=0;u<i.length;u++){for(var f=0;f<i[u].length;f++)for(var _=0;_<e;_++)n.vertices.push(i[u][f][_]);u>0&&n.holes.push(s+=i[u-1].length)}return n};var Rh=X(au.exports);function _m(i,e,n,s,u){Bh(i,e,n||0,s||i.length-1,u||gm)}function Bh(i,e,n,s,u){for(;s>n;){if(s-n>600){var f=s-n+1,_=e-n+1,v=Math.log(f),T=.5*Math.exp(2*v/3),P=.5*Math.sqrt(v*T*(f-T)/f)*(_-f/2<0?-1:1);Bh(i,e,Math.max(n,Math.floor(e-_*T/f+P)),Math.min(s,Math.floor(e+(f-_)*T/f+P)),u)}var C=i[e],D=n,O=s;for(Kl(i,n,e),u(i[s],C)>0&&Kl(i,n,s);D<O;){for(Kl(i,D,O),D++,O--;u(i[D],C)<0;)D++;for(;u(i[O],C)>0;)O--}u(i[n],C)===0?Kl(i,n,O):Kl(i,++O,s),O<=e&&(n=O+1),e<=O&&(s=O-1)}}function Kl(i,e,n){var s=i[e];i[e]=i[n],i[n]=s}function gm(i,e){return i<e?-1:i>e?1:0}function hu(i,e){const n=i.length;if(n<=1)return[i];const s=[];let u,f;for(let _=0;_<n;_++){const v=Ct(i[_]);v!==0&&(i[_].area=Math.abs(v),f===void 0&&(f=v<0),f===v<0?(u&&s.push(u),u=[i[_]]):u.push(i[_]))}if(u&&s.push(u),e>1)for(let _=0;_<s.length;_++)s[_].length<=e||(_m(s[_],e,1,s[_].length-1,ym),s[_]=s[_].slice(0,e));return s}function ym(i,e){return e.area-i.area}function du(i,e,n){const s=n.patternDependencies;let u=!1;for(const f of e){const _=f.paint.get(`${i}-pattern`);_.isConstant()||(u=!0);const v=_.constantOr(null);v&&(u=!0,s[v.to]=!0,s[v.from]=!0)}return u}function pu(i,e,n,s,u){const f=u.patternDependencies;for(const _ of e){const v=_.paint.get(`${i}-pattern`).value;if(v.kind!=="constant"){let T=v.evaluate({zoom:s-1},n,{},u.availableImages),P=v.evaluate({zoom:s},n,{},u.availableImages),C=v.evaluate({zoom:s+1},n,{},u.availableImages);T=T&&T.name?T.name:T,P=P&&P.name?P.name:P,C=C&&C.name?C.name:C,f[T]=!0,f[P]=!0,f[C]=!0,n.patterns[_.id]={min:T,mid:P,max:C}}}return n}class fu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(n=>n.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Yt,this.indexArray=new xn,this.indexArray2=new nn,this.programConfigurations=new $o(e.layers,e.zoom),this.segments=new Di,this.segments2=new Di,this.stateDependentLayerIds=this.layers.filter(n=>n.isStateDependent()).map(n=>n.id)}populate(e,n,s){this.hasPattern=du("fill",this.layers,n);const u=this.layers[0].layout.get("fill-sort-key"),f=!u.isConstant(),_=[];for(const{feature:v,id:T,index:P,sourceLayerIndex:C}of e){const D=this.layers[0]._featureFilter.needGeometry,O=Za(v,D);if(!this.layers[0]._featureFilter.filter(new ne(this.zoom),O,s))continue;const Z=f?u.evaluate(O,{},s,n.availableImages):void 0,j={id:T,properties:v.properties,type:v.type,sourceLayerIndex:C,index:P,geometry:D?O.geometry:Va(v),patterns:{},sortKey:Z};_.push(j)}f&&_.sort((v,T)=>v.sortKey-T.sortKey);for(const v of _){const{geometry:T,index:P,sourceLayerIndex:C}=v;if(this.hasPattern){const D=pu("fill",this.layers,v,this.zoom,n);this.patternFeatures.push(D)}else this.addFeature(v,T,P,s,{});n.featureIndex.insert(e[P].feature,T,P,C,this.index)}}update(e,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,n,this.stateDependentLayers,s)}addFeatures(e,n,s){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,sm),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,n,s,u,f){for(const _ of hu(n,500)){let v=0;for(const Z of _)v+=Z.length;const T=this.segments.prepareSegment(v,this.layoutVertexArray,this.indexArray),P=T.vertexLength,C=[],D=[];for(const Z of _){if(Z.length===0)continue;Z!==_[0]&&D.push(C.length/2);const j=this.segments2.prepareSegment(Z.length,this.layoutVertexArray,this.indexArray2),H=j.vertexLength;this.layoutVertexArray.emplaceBack(Z[0].x,Z[0].y),this.indexArray2.emplaceBack(H+Z.length-1,H),C.push(Z[0].x),C.push(Z[0].y);for(let te=1;te<Z.length;te++)this.layoutVertexArray.emplaceBack(Z[te].x,Z[te].y),this.indexArray2.emplaceBack(H+te-1,H+te),C.push(Z[te].x),C.push(Z[te].y);j.vertexLength+=Z.length,j.primitiveLength+=Z.length}const O=Rh(C,D);for(let Z=0;Z<O.length;
vendor: 10,215 bytes, line 9
9Z+=3)this.indexArray.emplaceBack(P+O[Z],P+O[Z+1],P+O[Z+2]);T.vertexLength+=v,T.primitiveLength+=O.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,f,u)}}let Oh,Fh;He("FillBucket",fu,{omit:["layers","patternFeatures"]});var vm={get paint(){return Fh=Fh||new ji({"fill-antialias":new Ge(Pe.paint_fill["fill-antialias"]),"fill-opacity":new Je(Pe.paint_fill["fill-opacity"]),"fill-color":new Je(Pe.paint_fill["fill-color"]),"fill-outline-color":new Je(Pe.paint_fill["fill-outline-color"]),"fill-translate":new Ge(Pe.paint_fill["fill-translate"]),"fill-translate-anchor":new Ge(Pe.paint_fill["fill-translate-anchor"]),"fill-pattern":new Er(Pe.paint_fill["fill-pattern"])})},get layout(){return Oh=Oh||new ji({"fill-sort-key":new Je(Pe.layout_fill["fill-sort-key"])})}};class xm extends er{constructor(e){super(e,vm)}recalculate(e,n){super.recalculate(e,n);const s=this.paint._values["fill-outline-color"];s.value.kind==="constant"&&s.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new fu(e)}queryRadius(){return hc(this.paint.get("fill-translate"))}queryIntersectsFeature(e,n,s,u,f,_,v){return vh(dc(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),_.angle,v),u)}isTileClipped(){return!0}}const bm=zi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),wm=zi([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Tm}=bm;var ga={},Sm=ge,Nh=fl;function fl(i,e,n,s,u){this.properties={},this.extent=n,this.type=0,this._pbf=i,this._geometry=-1,this._keys=s,this._values=u,i.readFields(Am,this,e)}function Am(i,e,n){i==1?e.id=n.readVarint():i==2?function(s,u){for(var f=s.readVarint()+s.pos;s.pos<f;){var _=u._keys[s.readVarint()],v=u._values[s.readVarint()];u.properties[_]=v}}(n,e):i==3?e.type=n.readVarint():i==4&&(e._geometry=n.pos)}function Pm(i){for(var e,n,s=0,u=0,f=i.length,_=f-1;u<f;_=u++)s+=((n=i[_]).x-(e=i[u]).x)*(e.y+n.y);return s}fl.types=["Unknown","Point","LineString","Polygon"],fl.prototype.loadGeometry=function(){var i=this._pbf;i.pos=this._geometry;for(var e,n=i.readVarint()+i.pos,s=1,u=0,f=0,_=0,v=[];i.pos<n;){if(u<=0){var T=i.readVarint();s=7&T,u=T>>3}if(u--,s===1||s===2)f+=i.readSVarint(),_+=i.readSVarint(),s===1&&(e&&v.push(e),e=[]),e.push(new Sm(f,_));else{if(s!==7)throw new Error("unknown command "+s);e&&e.push(e[0].clone())}}return e&&v.push(e),v},fl.prototype.bbox=function(){var i=this._pbf;i.pos=this._geometry;for(var e=i.readVarint()+i.pos,n=1,s=0,u=0,f=0,_=1/0,v=-1/0,T=1/0,P=-1/0;i.pos<e;){if(s<=0){var C=i.readVarint();n=7&C,s=C>>3}if(s--,n===1||n===2)(u+=i.readSVarint())<_&&(_=u),u>v&&(v=u),(f+=i.readSVarint())<T&&(T=f),f>P&&(P=f);else if(n!==7)throw new Error("unknown command "+n)}return[_,T,v,P]},fl.prototype.toGeoJSON=function(i,e,n){var s,u,f=this.extent*Math.pow(2,n),_=this.extent*i,v=this.extent*e,T=this.loadGeometry(),P=fl.types[this.type];function C(Z){for(var j=0;j<Z.length;j++){var H=Z[j];Z[j]=[360*(H.x+_)/f-180,360/Math.PI*Math.atan(Math.exp((180-360*(H.y+v)/f)*Math.PI/180))-90]}}switch(this.type){case 1:var D=[];for(s=0;s<T.length;s++)D[s]=T[s][0];C(T=D);break;case 2:for(s=0;s<T.length;s++)C(T[s]);break;case 3:for(T=function(Z){var j=Z.length;if(j<=1)return[Z];for(var H,te,oe=[],de=0;de<j;de++){var ae=Pm(Z[de]);ae!==0&&(te===void 0&&(te=ae<0),te===ae<0?(H&&oe.push(H),H=[Z[de]]):H.push(Z[de]))}return H&&oe.push(H),oe}(T),s=0;s<T.length;s++)for(u=0;u<T[s].length;u++)C(T[s][u])}T.length===1?T=T[0]:P="Multi"+P;var O={type:"Feature",geometry:{type:P,coordinates:T},properties:this.properties};return"id"in this&&(O.id=this.id),O};var Im=Nh,Uh=Vh;function Vh(i,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=i,this._keys=[],this._values=[],this._features=[],i.readFields(Lm,this,e),this.length=this._features.length}function Lm(i,e,n){i===15?e.version=n.readVarint():i===1?e.name=n.readString():i===5?e.extent=n.readVarint():i===2?e._features.push(n.pos):i===3?e._keys.push(n.readString()):i===4&&e._values.push(function(s){for(var u=null,f=s.readVarint()+s.pos;s.pos<f;){var _=s.readVarint()>>3;u=_===1?s.readString():_===2?s.readFloat():_===3?s.readDouble():_===4?s.readVarint64():_===5?s.readVarint():_===6?s.readSVarint():_===7?s.readBoolean():null}return u}(n))}Vh.prototype.feature=function(i){if(i<0||i>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[i];var e=this._pbf.readVarint()+this._pbf.pos;return new Im(this._pbf,e,this.extent,this._keys,this._values)};var Em=Uh;function Cm(i,e,n){if(i===3){var s=new Em(n,n.readVarint()+n.pos);s.length&&(e[s.name]=s)}}ga.VectorTile=function(i,e){this.layers=i.readFields(Cm,{},e)},ga.VectorTileFeature=Nh,ga.VectorTileLayer=Uh;const Mm=ga.VectorTileFeature.types,mu=Math.pow(2,13);function Xl(i,e,n,s,u,f,_,v){i.emplaceBack(e,n,2*Math.floor(s*mu)+_,u*mu*2,f*mu*2,Math.round(v))}class _u{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(n=>n.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ve,this.centroidVertexArray=new Be,this.indexArray=new xn,this.programConfigurations=new $o(e.layers,e.zoom),this.segments=new Di,this.stateDependentLayerIds=this.layers.filter(n=>n.isStateDependent()).map(n=>n.id)}populate(e,n,s){this.features=[],this.hasPattern=du("fill-extrusion",this.layers,n);for(const{feature:u,id:f,index:_,sourceLayerIndex:v}of e){const T=this.layers[0]._featureFilter.needGeometry,P=Za(u,T);if(!this.layers[0]._featureFilter.filter(new ne(this.zoom),P,s))continue;const C={id:f,sourceLayerIndex:v,index:_,geometry:T?P.geometry:Va(u),properties:u.properties,type:u.type,patterns:{}};this.hasPattern?this.features.push(pu("fill-extrusion",this.layers,C,this.zoom,n)):this.addFeature(C,C.geometry,_,s,{}),n.featureIndex.insert(u,C.geometry,_,v,this.index,!0)}}addFeatures(e,n,s){for(const u of this.features){const{geometry:f}=u;this.addFeature(u,f,u.index,n,s)}}update(e,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,n,this.stateDependentLayers,s)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Tm),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,wm.members,!0),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(),this.centroidVertexBuffer.destroy())}addFeature(e,n,s,u,f){const _={x:0,y:0,vertexCount:0};for(const v of hu(n,500)){let T=0;for(const j of v)T+=j.length;let P=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const j of v){if(j.length===0||zm(j))continue;let H=0;for(let te=0;te<j.length;te++){const oe=j[te];if(te>=1){const de=j[te-1];if(!km(oe,de)){P.vertexLength+4>Di.MAX_VERTEX_ARRAY_LENGTH&&(P=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const ae=oe.sub(de)._perp()._unit(),me=de.dist(oe);H+me>32768&&(H=0),Xl(this.layoutVertexArray,oe.x,oe.y,ae.x,ae.y,0,0,H),Xl(this.layoutVertexArray,oe.x,oe.y,ae.x,ae.y,0,1,H),_.x+=2*oe.x,_.y+=2*oe.y,_.vertexCount+=2,H+=me,Xl(this.layoutVertexArray,de.x,de.y,ae.x,ae.y,0,0,H),Xl(this.layoutVertexArray,de.x,de.y,ae.x,ae.y,0,1,H),_.x+=2*de.x,_.y+=2*de.y,_.vertexCount+=2;const be=P.vertexLength;this.indexArray.emplaceBack(be,be+2,be+1),this.indexArray.emplaceBack(be+1,be+2,be+3),P.vertexLength+=4,P.primitiveLength+=2}}}}if(P.vertexLength+T>Di.MAX_VERTEX_ARRAY_LENGTH&&(P=this.segments.prepareSegment(T,this.layoutVertexArray,this.indexArray)),Mm[e.type]!=="Polygon")continue;const C=[],D=[],O=P.vertexLength;for(const j of v)if(j.length!==0){j!==v[0]&&D.push(C.length/2);for(let H=0;H<j.length;H++){const te=j[H];Xl(this.layoutVertexArray,te.x,te.y,0,0,1,1,0),_.x+=te.x,_.y+=te.y,_.vertexCount+=1,C.push(te.x),C.push(te.y)}}const Z=Rh(C,D);for(let j=0;j<Z.length;j+=3)this.indexArray.emplaceBack(O+Z[j],O+Z[j+2],O+Z[j+1]);P.primitiveLength+=Z.length/3,P.vertexLength+=T}for(let v=0;v<_.vertexCount;v++)this.centroidVertexArray.emplaceBack(Math.floor(_.x/_.vertexCount),Math.floor(_.y/_.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,f,u)}}function km(i,e){return i.x===e.x&&(i.x<0||i.x>Ji)||i.y===e.y&&(i.y<0||i.y>Ji)}function zm(i){return i.every(e=>e.x<0)||i.every(e=>e.x>Ji)||i.every(e=>e.y<0)||i.every(e=>e.y>Ji)}let Zh;He("FillExtrusionBucket",_u,{omit:["layers","features"]});var Dm={get paint(){return Zh=Zh||new ji({"fill-extrusion-opacity":new Ge(Pe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Je(Pe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ge(Pe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ge(Pe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Er(Pe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Je(Pe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Je(Pe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ge(Pe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Rm extends er{constructor(e){super(e,Dm)}createBucket(e){return new _u(e)}queryRadius(){return hc(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,n,s,u,f,_,v,T){const P=dc(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),_.angle,v),C=this.paint.get("fill-extrusion-height").evaluate(n,s),D=this.paint.get("fill-extrusion-base").evaluate(n,s),O=function(j,H,te,oe){const de=[];for(const ae of j){const me=[ae.x,ae.y,0,1];pc(me,me,H),de.push(new pe(me[0]/me[3],me[1]/me[3]))}return de}(P,T),Z=function(j,H,te,oe){const de=[],ae=[],me=oe[8]*H,be=oe[9]*H,Ee=
vendor: 11,011 bytes, line 9
9oe[10]*H,qe=oe[11]*H,it=oe[8]*te,$e=oe[9]*te,Ze=oe[10]*te,Ne=oe[11]*te;for(const We of j){const Ue=[],De=[];for(const ht of We){const st=ht.x,Gt=ht.y,Ri=oe[0]*st+oe[4]*Gt+oe[12],Fi=oe[1]*st+oe[5]*Gt+oe[13],sn=oe[2]*st+oe[6]*Gt+oe[14],Mr=oe[3]*st+oe[7]*Gt+oe[15],nr=sn+Ee,Qi=Mr+qe,wn=Ri+it,zn=Fi+$e,rr=sn+Ze,or=Mr+Ne,an=new pe((Ri+me)/Qi,(Fi+be)/Qi);an.z=nr/Qi,Ue.push(an);const ln=new pe(wn/or,zn/or);ln.z=rr/or,De.push(ln)}de.push(Ue),ae.push(De)}return[de,ae]}(u,D,C,T);return function(j,H,te){let oe=1/0;vh(te,H)&&(oe=jh(te,H[0]));for(let de=0;de<H.length;de++){const ae=H[de],me=j[de];for(let be=0;be<ae.length-1;be++){const Ee=ae[be],qe=[Ee,ae[be+1],me[be+1],me[be],Ee];yh(te,qe)&&(oe=Math.min(oe,jh(te,qe)))}}return oe!==1/0&&oe}(Z[0],Z[1],O)}}function Yl(i,e){return i.x*e.x+i.y*e.y}function jh(i,e){if(i.length===1){let n=0;const s=e[n++];let u;for(;!u||s.equals(u);)if(u=e[n++],!u)return 1/0;for(;n<e.length;n++){const f=e[n],_=i[0],v=u.sub(s),T=f.sub(s),P=_.sub(s),C=Yl(v,v),D=Yl(v,T),O=Yl(T,T),Z=Yl(P,v),j=Yl(P,T),H=C*O-D*D,te=(O*Z-D*j)/H,oe=(C*j-D*Z)/H,de=s.z*(1-te-oe)+u.z*te+f.z*oe;if(isFinite(de))return de}return 1/0}{let n=1/0;for(const s of e)n=Math.min(n,s.z);return n}}const Bm=zi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Om}=Bm,Fm=zi([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Nm}=Fm,Um=ga.VectorTileFeature.types,Vm=Math.cos(Math.PI/180*37.5),$h=Math.pow(2,14)/.5;class gu{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(n=>n.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(n=>{this.gradients[n.id]={}}),this.layoutVertexArray=new gt,this.layoutVertexArray2=new ot,this.indexArray=new xn,this.programConfigurations=new $o(e.layers,e.zoom),this.segments=new Di,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(n=>n.isStateDependent()).map(n=>n.id)}populate(e,n,s){this.hasPattern=du("line",this.layers,n);const u=this.layers[0].layout.get("line-sort-key"),f=!u.isConstant(),_=[];for(const{feature:v,id:T,index:P,sourceLayerIndex:C}of e){const D=this.layers[0]._featureFilter.needGeometry,O=Za(v,D);if(!this.layers[0]._featureFilter.filter(new ne(this.zoom),O,s))continue;const Z=f?u.evaluate(O,{},s):void 0,j={id:T,properties:v.properties,type:v.type,sourceLayerIndex:C,index:P,geometry:D?O.geometry:Va(v),patterns:{},sortKey:Z};_.push(j)}f&&_.sort((v,T)=>v.sortKey-T.sortKey);for(const v of _){const{geometry:T,index:P,sourceLayerIndex:C}=v;if(this.hasPattern){const D=pu("line",this.layers,v,this.zoom,n);this.patternFeatures.push(D)}else this.addFeature(v,T,P,s,{});n.featureIndex.insert(e[P].feature,T,P,C,this.index)}}update(e,n,s){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,n,this.stateDependentLayers,s)}addFeatures(e,n,s){for(const u of this.patternFeatures)this.addFeature(u,u.geometry,u.index,n,s)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Nm)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Om),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&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,n,s,u,f){const _=this.layers[0].layout,v=_.get("line-join").evaluate(e,{}),T=_.get("line-cap"),P=_.get("line-miter-limit"),C=_.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const D of n)this.addLine(D,e,v,T,P,C);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,s,f,u)}addLine(e,n,s,u,f,_){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let oe=0;oe<e.length-1;oe++)this.totalDistance+=e[oe].dist(e[oe+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const v=Um[n.type]==="Polygon";let T=e.length;for(;T>=2&&e[T-1].equals(e[T-2]);)T--;let P=0;for(;P<T-1&&e[P].equals(e[P+1]);)P++;if(T<(v?3:2))return;s==="bevel"&&(f=1.05);const C=this.overscaling<=16?15*Ji/(512*this.overscaling):0,D=this.segments.prepareSegment(10*T,this.layoutVertexArray,this.indexArray);let O,Z,j,H,te;this.e1=this.e2=-1,v&&(O=e[T-2],te=e[P].sub(O)._unit()._perp());for(let oe=P;oe<T;oe++){if(j=oe===T-1?v?e[P+1]:void 0:e[oe+1],j&&e[oe].equals(j))continue;te&&(H=te),O&&(Z=O),O=e[oe],te=j?j.sub(O)._unit()._perp():H,H=H||te;let de=H.add(te);de.x===0&&de.y===0||de._unit();const ae=H.x*te.x+H.y*te.y,me=de.x*te.x+de.y*te.y,be=me!==0?1/me:1/0,Ee=2*Math.sqrt(2-2*me),qe=me<Vm&&Z&&j,it=H.x*te.y-H.y*te.x>0;if(qe&&oe>P){const Ne=O.dist(Z);if(Ne>2*C){const We=O.sub(O.sub(Z)._mult(C/Ne)._round());this.updateDistance(Z,We),this.addCurrentVertex(We,H,0,0,D),Z=We}}const $e=Z&&j;let Ze=$e?s:v?"butt":u;if($e&&Ze==="round"&&(be<_?Ze="miter":be<=2&&(Ze="fakeround")),Ze==="miter"&&be>f&&(Ze="bevel"),Ze==="bevel"&&(be>2&&(Ze="flipbevel"),be<f&&(Ze="miter")),Z&&this.updateDistance(Z,O),Ze==="miter")de._mult(be),this.addCurrentVertex(O,de,0,0,D);else if(Ze==="flipbevel"){if(be>100)de=te.mult(-1);else{const Ne=be*H.add(te).mag()/H.sub(te).mag();de._perp()._mult(Ne*(it?-1:1))}this.addCurrentVertex(O,de,0,0,D),this.addCurrentVertex(O,de.mult(-1),0,0,D)}else if(Ze==="bevel"||Ze==="fakeround"){const Ne=-Math.sqrt(be*be-1),We=it?Ne:0,Ue=it?0:Ne;if(Z&&this.addCurrentVertex(O,H,We,Ue,D),Ze==="fakeround"){const De=Math.round(180*Ee/Math.PI/20);for(let ht=1;ht<De;ht++){let st=ht/De;if(st!==.5){const Ri=st-.5;st+=st*Ri*(st-1)*((1.0904+ae*(ae*(3.55645-1.43519*ae)-3.2452))*Ri*Ri+(.848013+ae*(.215638*ae-1.06021)))}const Gt=te.sub(H)._mult(st)._add(H)._unit()._mult(it?-1:1);this.addHalfVertex(O,Gt.x,Gt.y,!1,it,0,D)}}j&&this.addCurrentVertex(O,te,-We,-Ue,D)}else if(Ze==="butt")this.addCurrentVertex(O,de,0,0,D);else if(Ze==="square"){const Ne=Z?1:-1;this.addCurrentVertex(O,de,Ne,Ne,D)}else Ze==="round"&&(Z&&(this.addCurrentVertex(O,H,0,0,D),this.addCurrentVertex(O,H,1,1,D,!0)),j&&(this.addCurrentVertex(O,te,-1,-1,D,!0),this.addCurrentVertex(O,te,0,0,D)));if(qe&&oe<T-1){const Ne=O.dist(j);if(Ne>2*C){const We=O.add(j.sub(O)._mult(C/Ne)._round());this.updateDistance(O,We),this.addCurrentVertex(We,te,0,0,D),O=We}}}}addCurrentVertex(e,n,s,u,f,_=!1){const v=n.y*u-n.x,T=-n.y-n.x*u;this.addHalfVertex(e,n.x+n.y*s,n.y-n.x*s,_,!1,s,f),this.addHalfVertex(e,v,T,_,!0,-u,f),this.distance>$h/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,n,s,u,f,_))}addHalfVertex({x:e,y:n},s,u,f,_,v,T){const P=.5*(this.lineClips?this.scaledDistance*($h-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(f?1:0),(n<<1)+(_?1:0),Math.round(63*s)+128,Math.round(63*u)+128,1+(v===0?0:v<0?-1:1)|(63&P)<<2,P>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const C=T.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,C),T.primitiveLength++),_?this.e2=C:this.e1=C}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,n){this.distance+=e.dist(n),this.updateScaledDistance()}}let qh,Gh;He("LineBucket",gu,{omit:["layers","patternFeatures"]});var Hh={get paint(){return Gh=Gh||new ji({"line-opacity":new Je(Pe.paint_line["line-opacity"]),"line-color":new Je(Pe.paint_line["line-color"]),"line-translate":new Ge(Pe.paint_line["line-translate"]),"line-translate-anchor":new Ge(Pe.paint_line["line-translate-anchor"]),"line-width":new Je(Pe.paint_line["line-width"]),"line-gap-width":new Je(Pe.paint_line["line-gap-width"]),"line-offset":new Je(Pe.paint_line["line-offset"]),"line-blur":new Je(Pe.paint_line["line-blur"]),"line-dasharray":new Oa(Pe.paint_line["line-dasharray"]),"line-pattern":new Er(Pe.paint_line["line-pattern"]),"line-gradient":new Fa(Pe.paint_line["line-gradient"])})},get layout(){return qh=qh||new ji({"line-cap":new Ge(Pe.layout_line["line-cap"]),"line-join":new Je(Pe.layout_line["line-join"]),"line-miter-limit":new Ge(Pe.layout_line["line-miter-limit"]),"line-round-limit":new Ge(Pe.layout_line["line-round-limit"]),"line-sort-key":new Je(Pe.layout_line["line-sort-key"])})}};class Zm extends Je{possiblyEvaluate(e,n){return n=new ne(Math.floor(n.zoom),{now:n.now,fadeDuration:n.fadeDuration,zoomHistory:n.zoomHistory,transition:n.transition}),super.possiblyEvaluate(e,n)}evaluate(e,n,s,u){return n=at({},n,{zoom:Math.floor(n.zoom)}),super.evaluate(e,n,s,u)}}let yc;class jm extends er{constructor(e){super(e,Hh),this.gradientVersion=0,yc||(yc=new Zm(Hh.paint.properties["line-width"].specification),yc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){const n=this.gradientExpression();this.stepInterpolant=!!function(s){return s._styleExpression!==void 0}(n)&&n._styleExpression.expression instanceof Ln,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,n){super.recalculate(e,n),this.paint._values["line-floorwidth"]=yc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new gu(e)}queryRadius(e){const n=e,s=Wh(jl("line-width",this,n),jl("line-gap-width",this,n)),u=jl("line-offset",this,n);return s/2+Math.abs(u)+hc(this.paint.get("line-translate"))}queryIntersectsFeature(e,n,s,u,f,_,v){const T=dc(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),_.angle,v),P=v/2*Wh(this.paint.get("line-width").evaluate(n,s),this.paint.get("line-gap-width").evaluate(n,s)),C=this.paint.get("line-offset").evaluate(n,s);return C&&(u=function(D,O){const Z=[];for(let j=0;j<D.length;j++){const H=D[j],te=[];for(let oe=0;oe<H.length;oe++){const de=H[oe-1],ae=H[oe],me=H[oe+1],be=oe===0?new pe(0,0):ae.sub(de)._unit()._perp(),Ee=oe===H.length-1?new pe(0,0):me.sub(ae)._unit()._perp(),qe=be._add(Ee)._unit(),it=qe.x*Ee.x+qe.y*Ee.y;it!==0&&qe._mult(1/it),te.push(qe._mult(O)._add(ae))}Z.push(te)}return Z}(u,C*v)),function(D,O,Z){for(let j=0;j<O.length;j++){const H=O[j];if(D.length>=3){for(let te=0;te<H.length;te++)if(hl(D,H[te]))return!0}if(Kf(D,H,Z))return!0}return!1}(T,u,P)}
vendor: 4,513 bytes, line 9
9isTileClipped(){return!0}}function Wh(i,e){return e>0?e+2*i:i}const $m=zi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),qm=zi([{name:"a_projected_pos",components:3,type:"Float32"}],4);zi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Gm=zi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);zi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Kh=zi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Hm=zi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Wm(i,e,n){return i.sections.forEach(s=>{s.text=function(u,f,_){const v=f.layout.get("text-transform").evaluate(_,{});return v==="uppercase"?u=u.toLocaleUpperCase():v==="lowercase"&&(u=u.toLocaleLowerCase()),V.applyArabicShaping&&(u=V.applyArabicShaping(u)),u}(s.text,e,n)}),i}zi([{name:"triangle",components:3,type:"Uint16"}]),zi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{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"}]),zi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{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",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),zi([{type:"Float32",name:"offsetX"}]),zi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),zi([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Jl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var on=24,Xh=Si,Yh=function(i,e,n,s,u){var f,_,v=8*u-s-1,T=(1<<v)-1,P=T>>1,C=-7,D=n?u-1:0,O=n?-1:1,Z=i[e+D];for(D+=O,f=Z&(1<<-C)-1,Z>>=-C,C+=v;C>0;
vendor: 4,521 bytes, line 9
9f=256*f+i[e+D],D+=O,C-=8);for(_=f&(1<<-C)-1,f>>=-C,C+=s;C>0;_=256*_+i[e+D],D+=O,C-=8);if(f===0)f=1-P;else{if(f===T)return _?NaN:1/0*(Z?-1:1);_+=Math.pow(2,s),f-=P}return(Z?-1:1)*_*Math.pow(2,f-s)},Jh=function(i,e,n,s,u,f){var _,v,T,P=8*f-u-1,C=(1<<P)-1,D=C>>1,O=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,Z=s?0:f-1,j=s?1:-1,H=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(v=isNaN(e)?1:0,_=C):(_=Math.floor(Math.log(e)/Math.LN2),e*(T=Math.pow(2,-_))<1&&(_--,T*=2),(e+=_+D>=1?O/T:O*Math.pow(2,1-D))*T>=2&&(_++,T/=2),_+D>=C?(v=0,_=C):_+D>=1?(v=(e*T-1)*Math.pow(2,u),_+=D):(v=e*Math.pow(2,D-1)*Math.pow(2,u),_=0));u>=8;i[n+Z]=255&v,Z+=j,v/=256,u-=8);for(_=_<<u|v,P+=u;P>0;i[n+Z]=255&_,Z+=j,_/=256,P-=8);i[n+Z-j]|=128*H};function Si(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}Si.Varint=0,Si.Fixed64=1,Si.Bytes=2,Si.Fixed32=5;var yu=4294967296,Qh=1/yu,ed=typeof TextDecoder=="undefined"?null:new TextDecoder("utf8");function Vs(i){return i.type===Si.Bytes?i.readVarint()+i.pos:i.pos+1}function ml(i,e,n){return n?4294967296*e+(i>>>0):4294967296*(e>>>0)+(i>>>0)}function td(i,e,n){var s=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(s);for(var u=n.pos-1;u>=i;u--)n.buf[u+s]=n.buf[u]}function Km(i,e){for(var n=0;n<i.length;n++)e.writeVarint(i[n])}function Xm(i,e){for(var n=0;n<i.length;n++)e.writeSVarint(i[n])}function Ym(i,e){for(var n=0;n<i.length;n++)e.writeFloat(i[n])}function Jm(i,e){for(var n=0;n<i.length;n++)e.writeDouble(i[n])}function Qm(i,e){for(var n=0;n<i.length;n++)e.writeBoolean(i[n])}function e_(i,e){for(var n=0;n<i.length;n++)e.writeFixed32(i[n])}function t_(i,e){for(var n=0;n<i.length;n++)e.writeSFixed32(i[n])}function i_(i,e){for(var n=0;n<i.length;n++)e.writeFixed64(i[n])}function n_(i,e){for(var n=0;n<i.length;n++)e.writeSFixed64(i[n])}function vc(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+16777216*i[e+3]}function _l(i,e,n){i[n]=e,i[n+1]=e>>>8,i[n+2]=e>>>16,i[n+3]=e>>>24}function id(i,e){return(i[e]|i[e+1]<<8|i[e+2]<<16)+(i[e+3]<<24)}Si.prototype={destroy:function(){this.buf=null},readFields:function(i,e,n){for(n=n||this.length;this.pos<n;){var s=this.readVarint(),u=s>>3,f=this.pos;this.type=7&s,i(u,e,this),this.pos===f&&this.skip(s)}return e},readMessage:function(i,e){return this.readFields(i,e,this.readVarint()+this.pos)},readFixed32:function(){var i=vc(this.buf,this.pos);return this.pos+=4,i},readSFixed32:function(){var i=id(this.buf,this.pos);return this.pos+=4,i},readFixed64:function(){var i=vc(this.buf,this.pos)+vc(this.buf,this.pos+4)*yu;return this.pos+=8,i},readSFixed64:function(){var i=vc(this.buf,this.pos)+id(this.buf,this.pos+4)*yu;return this.pos+=8,i},readFloat:function(){var i=Yh(this.buf,this.pos,!0,23,4);return this.pos+=4,i},readDouble:function(){var i=Yh(this.buf,this.pos,!0,52,8);return this.pos+=8,i},readVarint:function(i){var e,n,s=this.buf;return e=127&(n=s[this.pos++]),n<128?e:(e|=(127&(n=s[this.pos++]))<<7,n<128?e:(e|=(127&(n=s[this.pos++]))<<14,n<128?e:(e|=(127&(n=s[this.pos++]))<<21,n<128?e:function(u,f,_){var v,T,P=_.buf;if(v=(112&(T=P[_.pos++]))>>4,T<128||(v|=(127&(T=P[_.pos++]))<<3,T<128)||(v|=(127&(T=P[_.pos++]))<<10,T<128)||(v|=(127&(T=P[_.pos++]))<<17,T<128)||(v|=(127&(T=P[_.pos++]))<<24,T<128)||(v|=(1&(T=P[_.pos++]))<<31,T<128))return ml(u,v,f);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=s[this.pos]))<<28,i,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var i=this.readVarint();return i%2==1?(i+1)/-2:i/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var i=this.readVarint()+this.pos,e=this.pos;return this.pos=i,i-e>=12&&ed?function(n,s,u){return ed.decode(n.subarray(s,u))}(this.buf,e,i):function(n,s,u){for(var f="",_=s;_<u;){var v,T,P,C=n[_],D=null,O=C>239?4:C>223?3:C>191?2:1;if(_+O>u)break;O===1?C<128&&(D=C):O===2?(192&(v=n[_+1]))==128&&(D=(31&C)<<6|63&v)<=127&&(D=null):O===3?(T=n[_+2],(192&(v=n[_+1]))==128&&(192&T)==128&&((D=(15&C)<<12|(63&v)<<6|63&T)<=2047||D>=55296&&D<=57343)&&(D=null)):O===4&&(T=n[_+2],P=n[_+3],(192&(v=n[_+1]))==128&&(192&T)==128&&(192&P)==128&&((D=(15&C)<<18|(63&v)<<12|(63&T)<<6|63&P)<=65535||D>=1114112)&&(D=null)),D===null?(D=65533,O=1):D>65535&&(D-=65536,f+=String.fromCharCode(D>>>10&1023|55296),D=56320|1023&D),f+=String.fromCharCode(D),_+=O}return f}(this.buf,e,i)},readBytes:function(){var i=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,i);return this.pos=i,e}
vendor: 5,627 bytes, line 9
9,readPackedVarint:function(i,e){if(this.type!==Si.Bytes)return i.push(this.readVarint(e));var n=Vs(this);for(i=i||[];this.pos<n;)i.push(this.readVarint(e));return i},readPackedSVarint:function(i){if(this.type!==Si.Bytes)return i.push(this.readSVarint());var e=Vs(this);for(i=i||[];this.pos<e;)i.push(this.readSVarint());return i},readPackedBoolean:function(i){if(this.type!==Si.Bytes)return i.push(this.readBoolean());var e=Vs(this);for(i=i||[];this.pos<e;)i.push(this.readBoolean());return i},readPackedFloat:function(i){if(this.type!==Si.Bytes)return i.push(this.readFloat());var e=Vs(this);for(i=i||[];this.pos<e;)i.push(this.readFloat());return i},readPackedDouble:function(i){if(this.type!==Si.Bytes)return i.push(this.readDouble());var e=Vs(this);for(i=i||[];this.pos<e;)i.push(this.readDouble());return i},readPackedFixed32:function(i){if(this.type!==Si.Bytes)return i.push(this.readFixed32());var e=Vs(this);for(i=i||[];this.pos<e;)i.push(this.readFixed32());return i},readPackedSFixed32:function(i){if(this.type!==Si.Bytes)return i.push(this.readSFixed32());var e=Vs(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed32());return i},readPackedFixed64:function(i){if(this.type!==Si.Bytes)return i.push(this.readFixed64());var e=Vs(this);for(i=i||[];this.pos<e;)i.push(this.readFixed64());return i},readPackedSFixed64:function(i){if(this.type!==Si.Bytes)return i.push(this.readSFixed64());var e=Vs(this);for(i=i||[];this.pos<e;)i.push(this.readSFixed64());return i},skip:function(i){var e=7&i;if(e===Si.Varint)for(;this.buf[this.pos++]>127;);else if(e===Si.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Si.Fixed32)this.pos+=4;else{if(e!==Si.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(i,e){this.writeVarint(i<<3|e)},realloc:function(i){for(var e=this.length||16;e<this.pos+i;)e*=2;if(e!==this.length){var n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(i){this.realloc(4),_l(this.buf,i,this.pos),this.pos+=4},writeSFixed32:function(i){this.realloc(4),_l(this.buf,i,this.pos),this.pos+=4},writeFixed64:function(i){this.realloc(8),_l(this.buf,-1&i,this.pos),_l(this.buf,Math.floor(i*Qh),this.pos+4),this.pos+=8},writeSFixed64:function(i){this.realloc(8),_l(this.buf,-1&i,this.pos),_l(this.buf,Math.floor(i*Qh),this.pos+4),this.pos+=8},writeVarint:function(i){(i=+i||0)>268435455||i<0?function(e,n){var s,u;if(e>=0?(s=e%4294967296|0,u=e/4294967296|0):(u=~(-e/4294967296),4294967295^(s=~(-e%4294967296))?s=s+1|0:(s=0,u=u+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");n.realloc(10),function(f,_,v){v.buf[v.pos++]=127&f|128,f>>>=7,v.buf[v.pos++]=127&f|128,f>>>=7,v.buf[v.pos++]=127&f|128,f>>>=7,v.buf[v.pos++]=127&f|128,v.buf[v.pos]=127&(f>>>=7)}(s,0,n),function(f,_){var v=(7&f)<<4;_.buf[_.pos++]|=v|((f>>>=3)?128:0),f&&(_.buf[_.pos++]=127&f|((f>>>=7)?128:0),f&&(_.buf[_.pos++]=127&f|((f>>>=7)?128:0),f&&(_.buf[_.pos++]=127&f|((f>>>=7)?128:0),f&&(_.buf[_.pos++]=127&f|((f>>>=7)?128:0),f&&(_.buf[_.pos++]=127&f)))))}(u,n)}(i,this):(this.realloc(4),this.buf[this.pos++]=127&i|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=127&(i>>>=7)|(i>127?128:0),i<=127||(this.buf[this.pos++]=i>>>7&127))))},writeSVarint:function(i){this.writeVarint(i<0?2*-i-1:2*i)},writeBoolean:function(i){this.writeVarint(!!i)},writeString:function(i){i=String(i),this.realloc(4*i.length),this.pos++;var e=this.pos;this.pos=function(s,u,f){for(var _,v,T=0;T<u.length;T++){if((_=u.charCodeAt(T))>55295&&_<57344){if(!v){_>56319||T+1===u.length?(s[f++]=239,s[f++]=191,s[f++]=189):v=_;continue}if(_<56320){s[f++]=239,s[f++]=191,s[f++]=189,v=_;continue}_=v-55296<<10|_-56320|65536,v=null}else v&&(s[f++]=239,s[f++]=191,s[f++]=189,v=null);_<128?s[f++]=_:(_<2048?s[f++]=_>>6|192:(_<65536?s[f++]=_>>12|224:(s[f++]=_>>18|240,s[f++]=_>>12&63|128),s[f++]=_>>6&63|128),s[f++]=63&_|128)}return f}(this.buf,i,this.pos);var n=this.pos-e;n>=128&&td(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(i){this.realloc(4),Jh(this.buf,i,this.pos,!0,23,4),this.pos+=4},writeDouble:function(i){this.realloc(8),Jh(this.buf,i,this.pos,!0,52,8),this.pos+=8},writeBytes:function(i){var e=i.length;this.writeVarint(e),this.realloc(e);for(var n=0;n<e;n++)this.buf[this.pos++]=i[n]},writeRawMessage:function(i,e){this.pos++;var n=this.pos;i(e,this);var s=this.pos-n;s>=128&&td(n,s,this),this.pos=n-1,this.writeVarint(s),this.pos+=s},writeMessage:function(i,e,n){this.writeTag(i,Si.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(i,e){e.length&&this.writeMessage(i,Km,e)},writePackedSVarint:function(i,e){e.length&&this.writeMessage(i,Xm,e)},writePackedBoolean:function(i,e){e.length&&this.writeMessage(i,Qm,e)},writePackedFloat:function(i,e){e.length&&this.writeMessage(i,Ym,e)},writePackedDouble:function(i,e){e.length&&this.writeMessage(i,Jm,e)},writePackedFixed32:function(i,e){e.length&&this.writeMessage(i,e_,e)},writePackedSFixed32:function(i,e){e.length&&this.writeMessage(i,t_,e)},writePackedFixed64:function(i,e){e.length&&this.writeMessage(i,i_,e)},writePackedSFixed64:function(i,e){e.length&&this.writeMessage(i,n_,e)},writeBytesField:function(i,e){this.writeTag(i,Si.Bytes),this.writeBytes(e)},writeFixed32Field:function(i,e){this.writeTag(i,Si.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(i,e){this.writeTag(i,Si.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(i,e){this.writeTag(i,Si.Fixed64),this.writeFixed64
vendor: 15,053 bytes, line 9
9(e)},writeSFixed64Field:function(i,e){this.writeTag(i,Si.Fixed64),this.writeSFixed64(e)},writeVarintField:function(i,e){this.writeTag(i,Si.Varint),this.writeVarint(e)},writeSVarintField:function(i,e){this.writeTag(i,Si.Varint),this.writeSVarint(e)},writeStringField:function(i,e){this.writeTag(i,Si.Bytes),this.writeString(e)},writeFloatField:function(i,e){this.writeTag(i,Si.Fixed32),this.writeFloat(e)},writeDoubleField:function(i,e){this.writeTag(i,Si.Fixed64),this.writeDouble(e)},writeBooleanField:function(i,e){this.writeVarintField(i,!!e)}};var vu=X(Xh);const xu=3;function r_(i,e,n){i===1&&n.readMessage(o_,e)}function o_(i,e,n){if(i===3){const{id:s,bitmap:u,width:f,height:_,left:v,top:T,advance:P}=n.readMessage(s_,{});e.push({id:s,bitmap:new ql({width:f+2*xu,height:_+2*xu},u),metrics:{width:f,height:_,left:v,top:T,advance:P}})}}function s_(i,e,n){i===1?e.id=n.readVarint():i===2?e.bitmap=n.readBytes():i===3?e.width=n.readVarint():i===4?e.height=n.readVarint():i===5?e.left=n.readSVarint():i===6?e.top=n.readSVarint():i===7&&(e.advance=n.readVarint())}const nd=xu;function rd(i){let e=0,n=0;for(const _ of i)e+=_.w*_.h,n=Math.max(n,_.w);i.sort((_,v)=>v.h-_.h);const s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),n),h:1/0}];let u=0,f=0;for(const _ of i)for(let v=s.length-1;v>=0;v--){const T=s[v];if(!(_.w>T.w||_.h>T.h)){if(_.x=T.x,_.y=T.y,f=Math.max(f,_.y+_.h),u=Math.max(u,_.x+_.w),_.w===T.w&&_.h===T.h){const P=s.pop();v<s.length&&(s[v]=P)}else _.h===T.h?(T.x+=_.w,T.w-=_.w):_.w===T.w?(T.y+=_.h,T.h-=_.h):(s.push({x:T.x+_.w,y:T.y,w:T.w-_.w,h:_.h}),T.y+=_.h,T.h-=_.h);break}}return{w:u,h:f,fill:e/(u*f)||0}}const mr=1;class bu{constructor(e,{pixelRatio:n,version:s,stretchX:u,stretchY:f,content:_}){this.paddedRect=e,this.pixelRatio=n,this.stretchX=u,this.stretchY=f,this.content=_,this.version=s}get tl(){return[this.paddedRect.x+mr,this.paddedRect.y+mr]}get br(){return[this.paddedRect.x+this.paddedRect.w-mr,this.paddedRect.y+this.paddedRect.h-mr]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*mr)/this.pixelRatio,(this.paddedRect.h-2*mr)/this.pixelRatio]}}class od{constructor(e,n){const s={},u={};this.haveRenderCallbacks=[];const f=[];this.addImages(e,s,f),this.addImages(n,u,f);const{w:_,h:v}=rd(f),T=new $r({width:_||1,height:v||1});for(const P in e){const C=e[P],D=s[P].paddedRect;$r.copy(C.data,T,{x:0,y:0},{x:D.x+mr,y:D.y+mr},C.data)}for(const P in n){const C=n[P],D=u[P].paddedRect,O=D.x+mr,Z=D.y+mr,j=C.data.width,H=C.data.height;$r.copy(C.data,T,{x:0,y:0},{x:O,y:Z},C.data),$r.copy(C.data,T,{x:0,y:H-1},{x:O,y:Z-1},{width:j,height:1}),$r.copy(C.data,T,{x:0,y:0},{x:O,y:Z+H},{width:j,height:1}),$r.copy(C.data,T,{x:j-1,y:0},{x:O-1,y:Z},{width:1,height:H}),$r.copy(C.data,T,{x:0,y:0},{x:O+j,y:Z},{width:1,height:H})}this.image=T,this.iconPositions=s,this.patternPositions=u}addImages(e,n,s){for(const u in e){const f=e[u],_={x:0,y:0,w:f.data.width+2*mr,h:f.data.height+2*mr};s.push(_),n[u]=new bu(_,f),f.hasRenderCallback&&this.haveRenderCallbacks.push(u)}}patchUpdatedImages(e,n){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const s in e.updatedImages)this.patchUpdatedImage(this.iconPositions[s],e.getImage(s),n),this.patchUpdatedImage(this.patternPositions[s],e.getImage(s),n)}patchUpdatedImage(e,n,s){if(!e||!n||e.version===n.version)return;e.version=n.version;const[u,f]=e.tl;s.update(n.data,void 0,{x:u,y:f})}}var ya;He("ImagePosition",bu),He("ImageAtlas",od),l.ai=void 0,(ya=l.ai||(l.ai={}))[ya.none=0]="none",ya[ya.horizontal=1]="horizontal",ya[ya.vertical=2]="vertical",ya[ya.horizontalOnly=3]="horizontalOnly";const Ql=-17;class ec{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,n){const s=new ec;return s.scale=e||1,s.fontStack=n,s}static forImage(e){const n=new ec;return n.imageName=e,n}}class gl{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,n){const s=new gl;for(let u=0;u<e.sections.length;u++){const f=e.sections[u];f.image?s.addImageSection(f):s.addTextSection(f,n)}return s}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let n="";for(let s=0;s<e.length;s++){const u=e.charCodeAt(s+1)||null,f=e.charCodeAt(s-1)||null;n+=u&&ll(u)&&!Jl[e[s+1]]||f&&ll(f)&&!Jl[e[s-1]]||!Jl[e[s]]?e[s]:Jl[e[s]]}return n}(this.text)}trim(){let e=0;for(let s=0;s<this.text.length&&bc[this.text.charCodeAt(s)];s++)e++;let n=this.text.length;for(let s=this.text.length-1;s>=0&&s>=e&&bc[this.text.charCodeAt(s)];s--)n--;this.text=this.text.substring(e,n),this.sectionIndex=this.sectionIndex.slice(e,n)}substring(e,n){const s=new gl;return s.text=this.text.substring(e,n),s.sectionIndex=this.sectionIndex.slice(e,n),s.sections=this.sections,s}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,n)=>Math.max(e,this.sections[n].scale),0)}addTextSection(e,n){this.text+=e.text,this.sections.push(ec.forText(e.scale,e.fontStack||n));const s=this.sections.length-1;for(let u=0;u<e.text.length;++u)this.sectionIndex.push(s)}addImageSection(e){const n=e.image?e.image.name:"";if(n.length===0)return void ft("Can't add FormattedSection with an empty image.");const s=this.getNextImageSectionCharCode();s?(this.text+=String.fromCharCode(s),this.sections.push(ec.forImage(n)),this.sectionIndex.push(this.sections.length-1)):ft("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function xc(i,e,n,s,u,f,_,v,T,P,C,D,O,Z,j,H){const te=gl.fromFeature(i,u);let oe;D===l.ai.vertical&&te.verticalizePunctuation();const{processBidirectionalText:de,processStyledBidirectionalText:ae}=V;if(de&&te.sections.length===1){oe=[];const Ee=de(te.toString(),wu(te,P,f,e,s,Z,j));for(const qe of Ee){const it=new gl;it.text=qe,it.sections=te.sections;for(let $e=0;$e<qe.length;$e++)it.sectionIndex.push(0);oe.push(it)}}else if(ae){oe=[];const Ee=ae(te.text,te.sectionIndex,wu(te,P,f,e,s,Z,j));for(const qe of Ee){const it=new gl;it.text=qe[0],it.sectionIndex=qe[1],it.sections=te.sections,oe.push(it)}}else oe=function(Ee,qe){const it=[],$e=Ee.text;let Ze=0;for(const Ne of qe)it.push(Ee.substring(Ze,Ne)),Ze=Ne;return Ze<$e.length&&it.push(Ee.substring(Ze,$e.length)),it}(te,wu(te,P,f,e,s,Z,j));const me=[],be={positionedLines:me,text:te.toString(),top:C[1],bottom:C[1],left:C[0],right:C[0],writingMode:D,iconsInText:!1,verticalizable:!1};return function(Ee,qe,it,$e,Ze,Ne,We,Ue,De,ht,st,Gt){let Ri=0,Fi=Ql,sn=0,Mr=0;const nr=Ue==="right"?1:Ue==="left"?0:.5;let Qi=0;for(const an of Ze){an.trim();const ln=an.getMaxScale(),Zn=(ln-1)*on,sr={positionedGlyphs:[],lineOffset:0};Ee.positionedLines[Qi]=sr;const jn=sr.positionedGlyphs;let _r=0;if(!an.length()){Fi+=Ne,++Qi;continue}for(let cn=0;cn<an.length();cn++){const ii=an.getSection(cn),$n=an.getSectionIndex(cn),Dn=an.getCharCode(cn);let un=0,yo=null,qo=null,Go=null,Zs=on;const vo=!(De===l.ai.horizontal||!st&&!ua(Dn)||st&&(bc[Dn]||(wn=Dn,je.Arabic(wn)||je["Arabic Supplement"](wn)||je["Arabic Extended-A"](wn)||je["Arabic Presentation Forms-A"](wn)||je["Arabic Presentation Forms-B"](wn))));if(ii.imageName){const Gr=$e[ii.imageName];if(!Gr)continue;Go=ii.imageName,Ee.iconsInText=Ee.iconsInText||!0,qo=Gr.paddedRect;const yr=Gr.displaySize;ii.scale=ii.scale*on/Gt,yo={width:yr[0],height:yr[1],left:mr,top:-nd,advance:vo?yr[1]:yr[0]},un=Zn+(on-yr[1]*ii.scale),Zs=yo.advance;const js=vo?yr[0]*ii.scale-on*ln:yr[1]*ii.scale-on*ln;js>0&&js>_r&&(_r=js)}else{const Gr=it[ii.fontStack],yr=Gr&&Gr[Dn];if(yr&&yr.rect)qo=yr.rect,yo=yr.metrics;else{const js=qe[ii.fontStack],oc=js&&js[Dn];if(!oc)continue;yo=oc.metrics}un=(ln-ii.scale)*on}vo?(Ee.verticalizable=!0,jn.push({glyph:Dn,imageName:Go,x:Ri,y:Fi+un,vertical:vo,scale:ii.scale,fontStack:ii.fontStack,sectionIndex:$n,metrics:yo,rect:qo}),Ri+=Zs*ii.scale+ht):(jn.push({glyph:Dn,imageName:Go,x:Ri,y:Fi+un,vertical:vo,scale:ii.scale,fontStack:ii.fontStack,sectionIndex:$n,metrics:yo,rect:qo}),Ri+=yo.advance*ii.scale+ht)}jn.length!==0&&(sn=Math.max(Ri-ht,sn),c_(jn,0,jn.length-1,nr,_r)),Ri=0;const gr=Ne*ln+_r;sr.lineOffset=Math.max(_r,Zn),Fi+=gr,Mr=Math.max(gr,Mr),++Qi}var wn;const zn=Fi-Ql,{horizontalAlign:rr,verticalAlign:or}=Tu(We);(function(an,ln,Zn,sr,jn,_r,gr,cn,ii){const $n=(ln-Zn)*jn;let Dn=0;Dn=_r!==gr?-cn*sr-Ql:(-sr*ii+.5)*gr;for(const un of an)for(const yo of un.positionedGlyphs)yo.x+=$n,yo.y+=Dn})(Ee.positionedLines,nr,rr,or,sn,Mr,Ne,zn,Ze.length),Ee.top+=-or*zn,Ee.bottom=Ee.top+zn,Ee.left+=-rr*sn,Ee.right=Ee.left+sn}(be,e,n,s,oe,_,v,T,D,P,O,H),!function(Ee){for(const qe of Ee)if(qe.positionedGlyphs.length!==0)return!1;return!0}(me)&&be}const bc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},a_={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 sd(i,e,n,s,u,f){if(e.imageName){const _=s[e.imageName];return _?_.displaySize[0]*e.scale*on/f+u:0}{const _=n[e.fontStack],v=_&&_[i];return v?v.metrics.advance*e.scale+u:0}}function ad(i,e,n,s){const u=Math.pow(i-e,2);return s?i<e?u/2:2*u:u+Math.abs(n)*n}function l_(i,e,n){let s=0;return i===10&&(s-=1e4),n&&(s+=150),i!==40&&i!==65288||(s+=50),e!==41&&e!==65289||(s+=50),s}function ld(i,e,n,s,u,f){let _=null,v=ad(e,n,u,f);for(const T of s){const P=ad(e-T.x,n,u,f)+T.badness;P<=v&&(_=T,v=P)}return{index:i,x:e,priorBreak:_,badness:v}}function cd(i){return i?cd(i.priorBreak).concat(i.index):[]}function wu(i,e,n,s,u,f,_){if(f!=="point")return[];if(!i)return[];const v=[],T=function(O,Z,j,H,te,oe){let de=0;for(let ae=0;ae<O.length();ae++){const me=O.getSection(ae);de+=sd(O.getCharCode(ae),me,H,te,Z,oe)}return de/Math.max(1,Math.ceil(de/j))}(i,e,n,s,u,_),P=i.text.indexOf("​")>=0;let C=0;for(let O=0;O<i.length();O++){const Z=i.getSection(O),j=i.getCharCode(O);if(bc[j]||(C+=sd(j,Z,s,u,e,_)),O<i.length()-1){const H=!((D=j)<11904||!(je["Bopomofo Extended"](D)||je.Bopomofo(D)||je["CJK Compatibility Forms"](D)||je["CJK Compatibility Ideographs"](D)||je["CJK Compatibility"](D)||je["CJK Radicals Supplement"](D)||je["CJK Strokes"](D)||je["CJK Symbols and Punctuation"](D)||je["CJK Unified Ideographs Extension A"](D)||je["CJK Unified Ideographs"](D)||je["Enclosed CJK Letters and Months"](D)||je["Halfwidth and Fullwidth Forms"](D)||je.Hiragana(D)||je["Ideographic Description Characters"](D)||je["Kangxi Radicals"](D)||je["Katakana Phonetic Extensions"](D)||je.Katakana(D)||je["Vertical Forms"](D)||je["Yi Radicals"](D)||je["Yi Syllables"](D)));(a_[j]||H||Z.imageName)&&v.push(ld(O+1,C,T,v,l_(j,i.getCharCode(O+1),H&&P),!1))}}var D;return cd(ld(i.length(),C,T,v,0,!0))}function Tu(i){let e=.5,n=.5;switch(i){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(i){case"bottom":case"bottom-right":case"bottom-left":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:e,verticalAlign:n}}function c_(i,e,n,s,u){if(!s&&!u)return;const f=i[n],_=(i[n].x+f.metrics.advance*f.scale)*s;for(let v=e;v<=n;v++)i[v].x-=_,i[v].y+=u}function u_(i,e,n){const{horizontalAlign:s,verticalAlign:u}=Tu(n),f=e[0]-i.displaySize[0]*s,_=e[1]-i.displaySize[1]*u;return{image:i,top:_,bottom:_+i.displaySize[1],left:f,right:f+i.displaySize[0]}}function ud(i,e,n,s,u,f){const _=i.image;let v;if(_.content){const te=_.content,oe=_.pixelRatio||1;v=[te[0]/oe,te[1]/oe,_.displaySize[0]-te[2]/oe,_.displaySize[1]-te[3]/oe]}const T=e.left*f,P=e.right*f;let C,D,O,Z;n==="width"||n==="both"?(Z=u[0]+T-s[3],D=u[0]+P+s[1]):(Z=u[0]+(T+P-_.displaySize[0])/2,D=Z+_.displaySize[0]);const j=e.top*f,H=e.bottom*f;return n==="height"||n==="both"?(C=u[1]+j-s[0],O=u[1]+H+s[2]):(C=u[1]+(j+H-_.displaySize[1])/2,O=C+_.displaySize[1]),{image:_,top:C,right:D,bottom:O,left:Z,collisionPadding:v}}const tc=255,ps=128,va=tc*ps;function hd(i,e){const{expression:n}=e;if(n.kind==="constant")return{kind:"constant",layoutSize:n.evaluate(new ne(i+1))};if(n.kind==="source")return{kind:"source"};{const{zoomStops:s,interpolationType:u}=n;let f=0;for(;f<s.length&&s[f]<=i;)f++;f=Math.max(0,f-1);let _=f;for(;_<s.length&&s[_]<i+1;)_++;_=Math.min(s.length-1,_);const v=s[f],T=s[_];return n.kind==="composite"?{kind:"composite",minZoom:v,maxZoom:T,interpolationType:u}:{kind:"camera",minZoom:v,maxZoom:T,minSize:n.evaluate(new ne(v)),maxSize:n.evaluate(new ne(T)),interpolationType:u}}}function Su(i,e,n){let s="never";const u=i.get(e);return u?s=u:i.get(n)&&(s="always"),s}const h_=ga.VectorTileFeature.types,d_=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function wc(i,e,n,s,u,f,_,v,T,P,C,D,O){const Z=v?Math.min(va,Math.round(v[0])):0,j=v?Math.min(va,Math.round(v[1])):0;i.emplaceBack(e,n,Math.round(32*s),Math.round(32*u),f,_,(Z<<1)+(T?1:0),j,16*P,16*C,256*D,256*O)}function Au(i,e,n){i.emplaceBack(e.x,e.y,n),i.emplaceBack(e.x,e.y,n),i.emplaceBack(e.x,e.y,n),i.emplaceBack(e.x,e.y,n)}function p_(i){for(const e of i.sections)if(cl(e.text))return!0;return!1}class Pu{constructor(e){this.layoutVertexArray=new Kt,this.indexArray=new xn,this.programConfigurations=e,this.segments=new Di,this.dynamicLayoutVertexArray=new Nt,this.opacityVertexArray=new Jt,this.hasVisibleVertices=!1,this.placedSymbolArray=new ce}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,n,s,u){this.isEmpty()||(s&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,$m.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,n),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,qm.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,d_,!0),this.opacityVertexBuffer.itemSize=1),(s||u)&&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())}}He("SymbolBuffers",Pu);class Iu{constructor(e,n,s){this.layoutVertexArray=new e,this.layoutAttributes=n,this.indexArray=new s,this.segments=new Di,this.collisionVertexArray=new ki}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Gm.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}He("CollisionBuffers",Iu);class yl{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(_=>_.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.s
vendor: 6,094 bytes, line 9
9ourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ru([]),this.placementViewportMatrix=ru([]);const n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=hd(this.zoom,n["text-size"]),this.iconSizeData=hd(this.zoom,n["icon-size"]);const s=this.layers[0].layout,u=s.get("symbol-sort-key"),f=s.get("symbol-z-order");this.canOverlap=Su(s,"text-overlap","text-allow-overlap")!=="never"||Su(s,"icon-overlap","icon-allow-overlap")!=="never"||s.get("text-ignore-placement")||s.get("icon-ignore-placement"),this.sortFeaturesByKey=f!=="viewport-y"&&!u.isConstant(),this.sortFeaturesByY=(f==="viewport-y"||f==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,s.get("symbol-placement")==="point"&&(this.writingModes=s.get("text-writing-mode").map(_=>l.ai[_])),this.stateDependentLayerIds=this.layers.filter(_=>_.isStateDependent()).map(_=>_.id),this.sourceID=e.sourceID}createArrays(){this.text=new Pu(new $o(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Pu(new $o(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new he,this.lineVertexArray=new we,this.symbolInstances=new ie,this.textAnchorOffsets=new Ie}calculateGlyphDependencies(e,n,s,u,f){for(let _=0;_<e.length;_++)if(n[e.charCodeAt(_)]=!0,(s||u)&&f){const v=Jl[e.charAt(_)];v&&(n[v.charCodeAt(0)]=!0)}}populate(e,n,s){const u=this.layers[0],f=u.layout,_=f.get("text-font"),v=f.get("text-field"),T=f.get("icon-image"),P=(v.value.kind!=="constant"||v.value.value instanceof tn&&!v.value.value.isEmpty()||v.value.value.toString().length>0)&&(_.value.kind!=="constant"||_.value.value.length>0),C=T.value.kind!=="constant"||!!T.value.value||Object.keys(T.parameters).length>0,D=f.get("symbol-sort-key");if(this.features=[],!P&&!C)return;const O=n.iconDependencies,Z=n.glyphDependencies,j=n.availableImages,H=new ne(this.zoom);for(const{feature:te,id:oe,index:de,sourceLayerIndex:ae}of e){const me=u._featureFilter.needGeometry,be=Za(te,me);if(!u._featureFilter.filter(H,be,s))continue;let Ee,qe;if(me||(be.geometry=Va(te)),P){const $e=u.getValueAndResolveTokens("text-field",be,s,j),Ze=tn.factory($e);p_(Ze)&&(this.hasRTLText=!0),(!this.hasRTLText||S()==="unavailable"||this.hasRTLText&&V.isParsed())&&(Ee=Wm(Ze,u,be))}if(C){const $e=u.getValueAndResolveTokens("icon-image",be,s,j);qe=$e instanceof Ht?$e:Ht.fromString($e)}if(!Ee&&!qe)continue;const it=this.sortFeaturesByKey?D.evaluate(be,{},s):void 0;if(this.features.push({id:oe,text:Ee,icon:qe,index:de,sourceLayerIndex:ae,geometry:be.geometry,properties:te.properties,type:h_[te.type],sortKey:it}),qe&&(O[qe.name]=!0),Ee){const $e=_.evaluate(be,{},s).join(","),Ze=f.get("text-rotation-alignment")!=="viewport"&&f.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(l.ai.vertical)>=0;for(const Ne of Ee.sections)if(Ne.image)O[Ne.image.name]=!0;else{const We=us(Ee.toString()),Ue=Ne.fontStack||$e,De=Z[Ue]=Z[Ue]||{};this.calculateGlyphDependencies(Ne.text,De,Ze,this.allowVerticalPlacement,We)}}}f.get("symbol-placement")==="line"&&(this.features=function(te){const oe={},de={},ae=[];let me=0;function be($e){ae.push(te[$e]),me++}function Ee($e,Ze,Ne){const We=de[$e];return delete de[$e],de[Ze]=We,ae[We].geometry[0].pop(),ae[We].geometry[0]=ae[We].geometry[0].concat(Ne[0]),We}function qe($e,Ze,Ne){const We=oe[Ze];return delete oe[Ze],oe[$e]=We,ae[We].geometry[0].shift(),ae[We].geometry[0]=Ne[0].concat(ae[We].geometry[0]),We}function it($e,Ze,Ne){const We=Ne?Ze[0][Ze[0].length-1]:Ze[0][0];return`${$e}:${We.x}:${We.y}`}for(let $e=0;$e<te.length;$e++){const Ze=te[$e],Ne=Ze.geometry,We=Ze.text?Ze.text.toString():null;if(!We){be($e);continue}const Ue=it(We,Ne),De=it(We,Ne,!0);if(Ue in de&&De in oe&&de[Ue]!==oe[De]){const ht=qe(Ue,De,Ne),st=Ee(Ue,De,ae[ht].geometry);delete oe[Ue],delete de[De],de[it(We,ae[st].geometry,!0)]=st,ae[ht].geometry=null}else Ue in de?Ee(Ue,De,Ne):De in oe?qe(Ue,De,Ne):(be($e),oe[Ue]=me-1,de[De]=me-1)}return ae.filter($e=>$e.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((te,oe)=>te.sortKey-oe.sortKey)}update(e,n,s){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,n,this.layers,s),this.icon.programConfigurations.updatePaintArrays(e,n,this.layers,s))}isEmpty(){return this.symbolInstances.length===0&&!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()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,n){const s=this.lineVertexArray.length;if(e.segment!==void 0){let u=e.dist(n[e.segment+1]),f=e.dist(n[e.segment]);const _={};for(let v=e.segment+1;v<n.length;v++)_[v]={x:n[v].x,y:n[v].y,tileUnitDistanceFromAnchor:u},v<n.length-1&&(u+=n[v+1].dist(n[v]));for(let v=e.segment||0;v>=0;v--)_[v]={x:n[v].x,y:n[v].y,tileUnitDistanceFromAnchor:f},v>0&&(f+=n[v-1].dist(n[v]));for(let v=0;v<n.length;v++){const T=_[v];this.lineVertexArray.emplaceBack(T.x,T.y,T.tileUnitDistanceFromAnchor)}}return{lineStartIndex:s,lineLength:this.lineVertexArray.length-s}}addSymbols(e,n,s,u,f,_,v,T,P,C,D,O){const Z=e.indexArray,j=e.layoutVertexArray,H=e.segments.prepareSegment(4*n.length,j,Z,this.canOverlap?_.sortKey:void 0),te=this.glyphOffsetArray.length,oe=H.vertexLength,de=this.allowVerticalPlacement&&v===l.ai.vertical?Math.PI/2:0,ae=_.text&&_.text.sections;for(let me=0;me<n.length;me++){const{tl:be,tr:Ee,bl:qe,br:it,tex:$e,pixelOffsetTL:Ze,pixelOffsetBR:Ne,minFontScaleX:We,minFontScaleY:Ue,glyphOffset:De,isSDF:ht,sectionIndex:st}=n[me],Gt=H.vertexLength,Ri=De[1];
vendor: 4,323 bytes, line 9
9wc(j,T.x,T.y,be.x,Ri+be.y,$e.x,$e.y,s,ht,Ze.x,Ze.y,We,Ue),wc(j,T.x,T.y,Ee.x,Ri+Ee.y,$e.x+$e.w,$e.y,s,ht,Ne.x,Ze.y,We,Ue),wc(j,T.x,T.y,qe.x,Ri+qe.y,$e.x,$e.y+$e.h,s,ht,Ze.x,Ne.y,We,Ue),wc(j,T.x,T.y,it.x,Ri+it.y,$e.x+$e.w,$e.y+$e.h,s,ht,Ne.x,Ne.y,We,Ue),Au(e.dynamicLayoutVertexArray,T,de),Z.emplaceBack(Gt,Gt+1,Gt+2),Z.emplaceBack(Gt+1,Gt+2,Gt+3),H.vertexLength+=4,H.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(De[0]),me!==n.length-1&&st===n[me+1].sectionIndex||e.programConfigurations.populatePaintArrays(j.length,_,_.index,{},O,ae&&ae[st])}e.placedSymbolArray.emplaceBack(T.x,T.y,te,this.glyphOffsetArray.length-te,oe,P,C,T.segment,s?s[0]:0,s?s[1]:0,u[0],u[1],v,0,!1,0,D)}_addCollisionDebugVertex(e,n,s,u,f,_){return n.emplaceBack(0,0),e.emplaceBack(s.x,s.y,u,f,Math.round(_.x),Math.round(_.y))}addCollisionDebugVertices(e,n,s,u,f,_,v){const T=f.segments.prepareSegment(4,f.layoutVertexArray,f.indexArray),P=T.vertexLength,C=f.layoutVertexArray,D=f.collisionVertexArray,O=v.anchorX,Z=v.anchorY;this._addCollisionDebugVertex(C,D,_,O,Z,new pe(e,n)),this._addCollisionDebugVertex(C,D,_,O,Z,new pe(s,n)),this._addCollisionDebugVertex(C,D,_,O,Z,new pe(s,u)),this._addCollisionDebugVertex(C,D,_,O,Z,new pe(e,u)),T.vertexLength+=4;const j=f.indexArray;j.emplaceBack(P,P+1),j.emplaceBack(P+1,P+2),j.emplaceBack(P+2,P+3),j.emplaceBack(P+3,P),T.primitiveLength+=4}addDebugCollisionBoxes(e,n,s,u){for(let f=e;f<n;f++){const _=this.collisionBoxArray.get(f);this.addCollisionDebugVertices(_.x1,_.y1,_.x2,_.y2,u?this.textCollisionBox:this.iconCollisionBox,_.anchorPoint,s)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Iu($i,Kh.members,nn),this.iconCollisionBox=new Iu($i,Kh.members,nn);for(let e=0;e<this.symbolInstances.length;e++){const n=this.symbolInstances.get(e);this.addDebugCollisionBoxes(n.textBoxStartIndex,n.textBoxEndIndex,n,!0),this.addDebugCollisionBoxes(n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n,!0),this.addDebugCollisionBoxes(n.iconBoxStartIndex,n.iconBoxEndIndex,n,!1),this.addDebugCollisionBoxes(n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex,n,!1)}}_deserializeCollisionBoxesForSymbol(e,n,s,u,f,_,v,T,P){const C={};for(let D=n;D<s;D++){const O=e.get(D);C.textBox={x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,anchorPointX:O.anchorPointX,anchorPointY:O.anchorPointY},C.textFeatureIndex=O.featureIndex;break}for(let D=u;D<f;D++){const O=e.get(D);C.verticalTextBox={x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,anchorPointX:O.anchorPointX,anchorPointY:O.anchorPointY},C.verticalTextFeatureIndex=O.featureIndex;break}for(let D=_;D<v;D++){const O=e.get(D);C.iconBox={x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,anchorPointX:O.anchorPointX,anchorPointY:O.anchorPointY},C.iconFeatureIndex=O.featureIndex;break}for(let D=T;D<P;D++){const O=e.get(D);C.verticalIconBox={x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,anchorPointX:O.anchorPointX,anchorPointY:O.anchorPointY},C.verticalIconFeatureIndex=O.featureIndex;break}return C}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let n=0;n<this.symbolInstances.length;n++){const s=this.symbolInstances.get(n);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,s.textBoxStartIndex,s.textBoxEndIndex,s.verticalTextBoxStartIndex,s.verticalTextBoxEndIndex,s.iconBoxStartIndex,s.iconBoxEndIndex,s.verticalIconBoxStartIndex,s.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,n){const s=e.placedSymbolArray.get(n),u=s.vertexStartIndex+4*s.numGlyphs;for(let f=s.vertexStartIndex;f<u;f+=4)e.indexArray.emplaceBack(f,f+1,f+2),e.indexArray.emplaceBack(f+1,f+2,f+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const n=Math.sin(e),s=Math.cos(e),u=[],f=[],_=[];for(let v=0;v<this.symbolInstances.length;++v){_.push(v);const T=this.symbolInstances.get(v);u.push(0|Math.round(n*T.anchorX+s*T.anchorY)),f.push(T.featureIndex)}return _.sort((v,T)=>u[v]-u[T]||f[T]-f[v]),_}
vendor: 14,874 bytes, line 9
9addToSortKeyRanges(e,n){const s=this.sortKeyRanges[this.sortKeyRanges.length-1];s&&s.sortKey===n?s.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:n,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 n of this.symbolInstanceIndexes){const s=this.symbolInstances.get(n);this.featureSortOrder.push(s.featureIndex),[s.rightJustifiedTextSymbolIndex,s.centerJustifiedTextSymbolIndex,s.leftJustifiedTextSymbolIndex].forEach((u,f,_)=>{u>=0&&_.indexOf(u)===f&&this.addIndicesForPlacedSymbol(this.text,u)}),s.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,s.verticalPlacedTextSymbolIndex),s.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.placedIconSymbolIndex),s.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,s.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let dd,pd;He("SymbolBucket",yl,{omit:["layers","collisionBoxArray","features","compareText"]}),yl.MAX_GLYPHS=65535,yl.addDynamicAttributes=Au;var Lu={get paint(){return pd=pd||new ji({"icon-opacity":new Je(Pe.paint_symbol["icon-opacity"]),"icon-color":new Je(Pe.paint_symbol["icon-color"]),"icon-halo-color":new Je(Pe.paint_symbol["icon-halo-color"]),"icon-halo-width":new Je(Pe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Je(Pe.paint_symbol["icon-halo-blur"]),"icon-translate":new Ge(Pe.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ge(Pe.paint_symbol["icon-translate-anchor"]),"text-opacity":new Je(Pe.paint_symbol["text-opacity"]),"text-color":new Je(Pe.paint_symbol["text-color"],{runtimeType:dn,getOverride:i=>i.textColor,hasOverride:i=>!!i.textColor}),"text-halo-color":new Je(Pe.paint_symbol["text-halo-color"]),"text-halo-width":new Je(Pe.paint_symbol["text-halo-width"]),"text-halo-blur":new Je(Pe.paint_symbol["text-halo-blur"]),"text-translate":new Ge(Pe.paint_symbol["text-translate"]),"text-translate-anchor":new Ge(Pe.paint_symbol["text-translate-anchor"])})},get layout(){return dd=dd||new ji({"symbol-placement":new Ge(Pe.layout_symbol["symbol-placement"]),"symbol-spacing":new Ge(Pe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ge(Pe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Je(Pe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ge(Pe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ge(Pe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ge(Pe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ge(Pe.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ge(Pe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ge(Pe.layout_symbol["icon-rotation-alignment"]),"icon-size":new Je(Pe.layout_symbol["icon-size"]),"icon-text-fit":new Ge(Pe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ge(Pe.layout_symbol["icon-text-fit-padding"]),"icon-image":new Je(Pe.layout_symbol["icon-image"]),"icon-rotate":new Je(Pe.layout_symbol["icon-rotate"]),"icon-padding":new Je(Pe.layout_symbol["icon-padding"]),"icon-keep-upright":new Ge(Pe.layout_symbol["icon-keep-upright"]),"icon-offset":new Je(Pe.layout_symbol["icon-offset"]),"icon-anchor":new Je(Pe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ge(Pe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ge(Pe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ge(Pe.layout_symbol["text-rotation-alignment"]),"text-field":new Je(Pe.layout_symbol["text-field"]),"text-font":new Je(Pe.layout_symbol["text-font"]),"text-size":new Je(Pe.layout_symbol["text-size"]),"text-max-width":new Je(Pe.layout_symbol["text-max-width"]),"text-line-height":new Ge(Pe.layout_symbol["text-line-height"]),"text-letter-spacing":new Je(Pe.layout_symbol["text-letter-spacing"]),"text-justify":new Je(Pe.layout_symbol["text-justify"]),"text-radial-offset":new Je(Pe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ge(Pe.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Je(Pe.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Je(Pe.layout_symbol["text-anchor"]),"text-max-angle":new Ge(Pe.layout_symbol["text-max-angle"]),"text-writing-mode":new Ge(Pe.layout_symbol["text-writing-mode"]),"text-rotate":new Je(Pe.layout_symbol["text-rotate"]),"text-padding":new Ge(Pe.layout_symbol["text-padding"]),"text-keep-upright":new Ge(Pe.layout_symbol["text-keep-upright"]),"text-transform":new Je(Pe.layout_symbol["text-transform"]),"text-offset":new Je(Pe.layout_symbol["text-offset"]),"text-allow-overlap":new Ge(Pe.layout_symbol["text-allow-overlap"]),"text-overlap":new Ge(Pe.layout_symbol["text-overlap"]),"text-ignore-placement":new Ge(Pe.layout_symbol["text-ignore-placement"]),"text-optional":new Ge(Pe.layout_symbol["text-optional"])})}};class fd{constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Dr,this.defaultValue=e}evaluate(e){if(e.formattedSection){const n=this.defaultValue.property.overrides;if(n&&n.hasOverride(e.formattedSection))return n.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}}He("FormatSectionOverride",fd,{omit:["defaultValue"]});class Tc extends er{constructor(e){super(e,Lu)}recalculate(e,n){if(super.recalculate(e,n),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const s=this.layout.get("text-writing-mode");if(s){const u=[];for(const f of s)u.indexOf(f)<0&&u.push(f);this.layout._values["text-writing-mode"]=u}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,n,s,u){const f=this.layout.get(e).evaluate(n,{},s,u),_=this._unevaluatedLayout._values[e];return _.isDataDriven()||na(_.value)||!f?f:function(v,T){return T.replace(/{([^{}]+)}/g,(P,C)=>v&&C in v?String(v[C]):"")}(n.properties,f)}createBucket(e){return new yl(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of Lu.paint.overridableProperties){if(!Tc.hasPaintOverride(this.layout,e))continue;const n=this.paint.get(e),s=new fd(n),u=new Es(s,n.property.specification);let f=null;f=n.value.kind==="constant"||n.value.kind==="source"?new oa("source",u):new sa("composite",u,n.value.zoomStops),this.paint._values[e]=new xi(n.property,f,n.parameters)}}_handleOverridablePaintPropertyUpdate(e,n,s){return!(!this.layout||n.isDataDriven()||s.isDataDriven())&&Tc.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,n){const s=e.get("text-field"),u=Lu.paint.properties[n];let f=!1;const _=v=>{for(const T of v)if(u.overrides&&u.overrides.hasOverride(T))return void(f=!0)};if(s.value.kind==="constant"&&s.value.value instanceof tn)_(s.value.value.sections);else if(s.value.kind==="source"){const v=P=>{f||(P instanceof kt&&vi(P.value)===Y?_(P.value.sections):P instanceof hr?_(P.sections):P.eachChild(v))},T=s.value;T._styleExpression&&v(T._styleExpression.expression)}return f}}let md;var f_={get paint(){return md=md||new ji({"background-color":new Ge(Pe.paint_background["background-color"]),"background-pattern":new Oa(Pe.paint_background["background-pattern"]),"background-opacity":new Ge(Pe.paint_background["background-opacity"])})}};class m_ extends er{constructor(e){super(e,f_)}}let _d;var __={get paint(){return _d=_d||new ji({"raster-opacity":new Ge(Pe.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ge(Pe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ge(Pe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ge(Pe.paint_raster["raster-brightness-max"]),"raster-saturation":new Ge(Pe.paint_raster["raster-saturation"]),"raster-contrast":new Ge(Pe.paint_raster["raster-contrast"]),"raster-resampling":new Ge(Pe.paint_raster["raster-resampling"]),"raster-fade-duration":new Ge(Pe.paint_raster["raster-fade-duration"])})}};class g_ extends er{constructor(e){super(e,__)}}class y_ extends er{constructor(e){super(e,{}),this.onAdd=n=>{this.implementation.onAdd&&this.implementation.onAdd(n,n.painter.context.gl)},this.onRemove=n=>{this.implementation.onRemove&&this.implementation.onRemove(n,n.painter.context.gl)},this.implementation=e}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class v_{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel!="undefined"&&(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(){delete this._channel,this._callback=()=>{}}}const Eu=63710088e-1;class xa{constructor(e,n){if(isNaN(e)||isNaN(n))throw new Error(`Invalid LngLat object: (${e}, ${n})`);if(this.lng=+e,this.lat=+n,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new xa(Qe(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const n=Math.PI/180,s=this.lat*n,u=e.lat*n,f=Math.sin(s)*Math.sin(u)+Math.cos(s)*Math.cos(u)*Math.cos((e.lng-this.lng)*n);return Eu*Math.acos(Math.min(f,1))}static convert(e){if(e instanceof xa)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new xa(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new xa(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 gd=2*Math.PI*Eu;function yd(i){return gd*Math.cos(i*Math.PI/180)}function vd(i){return(180+i)/360}function xd(i){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i*Math.PI/360)))/360}function bd(i,e){return i/yd(e)}function wd(i){return 360*i-180}function Cu(i){return 360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90}class Sc{constructor(e,n,s=0){this.x=+e,this.y=+n,this.z=+s}static fromLngLat(e,n=0){const s=xa.convert(e);return new Sc(vd(s.lng),xd(s.lat),bd(n,s.lat))}toLngLat(){return new xa(wd(this.x),Cu(this.y))}toAltitude(){return this.z*yd(Cu(this.y))}meterInMercatorCoordinateUnits(){return 1/gd*(e=Cu(this.y),1/Math.cos(e*Math.PI/180));var e}}function Td(i,e,n){var s=2*Math.PI*6378137/256/Math.pow(2,n);return[i*s-2*Math.PI*6378137/2,e*s-2*Math.PI*6378137/2]}class Mu{constructor(e,n,s){if(e<0||e>25||s<0||s>=Math.pow(2,e)||n<0||n>=Math.pow(2,e))throw new Error(`x=${n}, y=${s}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=n,this.y=s,this.key=ic(0,e,e,n,s)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,n,s){const u=(_=this.y,v=this.z,T=Td(256*(f=this.x),256*(_=Math.pow(2,v)-_-1),v),P=Td(256*(f+1),256*(_+1),v),T[0]+","+T[1]+","+P[0]+","+P[1]);var f,_,v,T,P;const C=function(D,O,Z){let j,H="";for(let te=D;te>0;te--)j=1<<te-1,H+=(O&j?1:0)+(Z&j?2:0);return H}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(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(s==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,n>1?"@2x":"").replace(/{quadkey}/g,C).replace(/{bbox-epsg-3857}/g,u)}isChildOf(e){const n=this.z-e.z;return n>0&&e.x===this.x>>n&&e.y===this.y>>n}getTilePoint(e){const n=Math.pow(2,this.z);return new pe((e.x*n-this.x)*Ji,(e.y*n-this.y)*Ji)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Sd{constructor(e,n){this.wrap=e,this.canonical=n,this.key=ic(e,n.z,n.z,n.x,n.y)}}class qr{constructor(e,n,s,u,f){if(e<s)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${s}`);this.overscaledZ=e,this.wrap=n,this.canonical=new Mu(s,+u,+f),this.key=ic(n,e,s,u,f)}clone(){return new qr(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const n=this.canonical.z-e;return e>this.canonical.z?new qr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new qr(e,this.wrap,e,this.canonical.x>>n,this.canonical.y>>n)}calculateScaledKey(e,n){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-e;return e>this.canonical.z?ic(this.wrap*+n,e,this.canonical.z,this.canonical.x,this.canonical.y):ic(this.wrap*+n,e,e,this.canonical.x>>s,this.canonical.y>>s)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const n=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>n&&e.canonical.y===this.canonical.y>>n}children(e){if(this.overscaledZ>=e)return[new qr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const n=this.canonical.z+1,s=2*this.canonical.x,u=2*this.canonical.y;return[new qr(n,this.wrap,n,s,u),new qr(n,this.wrap,n,s+1,u),new qr(n,this.wrap,n,s,u+1),new qr(n,this.wrap,n,s+1,u+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>
vendor: 5,048 bytes, line 9
9e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new qr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new qr(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 Sd(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Sc(e.x-this.wrap,e.y))}}function ic(i,e,n,s,u){(i*=2)<0&&(i=-1*i-1);const f=1<<n;return(f*f*i+f*u+s).toString(36)+n.toString(36)+e.toString(36)}He("CanonicalTileID",Mu),He("OverscaledTileID",qr,{omit:["posMatrix"]});class Ad{constructor(e,n,s,u=1,f=1,_=1,v=0){if(this.uid=e,n.height!==n.width)throw new RangeError("DEM tiles must be square");if(s&&!["mapbox","terrarium","custom"].includes(s))return void ft(`"${s}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=n.height;const T=this.dim=n.height-2;switch(this.data=new Uint32Array(n.data.buffer),s){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=u,this.greenFactor=f,this.blueFactor=_,this.baseShift=v;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let P=0;P<T;P++)this.data[this._idx(-1,P)]=this.data[this._idx(0,P)],this.data[this._idx(T,P)]=this.data[this._idx(T-1,P)],this.data[this._idx(P,-1)]=this.data[this._idx(P,0)],this.data[this._idx(P,T)]=this.data[this._idx(P,T-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(T,-1)]=this.data[this._idx(T-1,0)],this.data[this._idx(-1,T)]=this.data[this._idx(0,T-1)],this.data[this._idx(T,T)]=this.data[this._idx(T-1,T-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let P=0;P<T;P++)for(let C=0;C<T;C++){const D=this.get(P,C);D>this.max&&(this.max=D),D<this.min&&(this.min=D)}}get(e,n){const s=new Uint8Array(this.data.buffer),u=4*this._idx(e,n);return this.unpack(s[u],s[u+1],s[u+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,n){if(e<-1||e>=this.dim+1||n<-1||n>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(n+1)*this.stride+(e+1)}unpack(e,n,s){return e*this.redFactor+n*this.greenFactor+s*this.blueFactor-this.baseShift}getPixels(){return new $r({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,n,s){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let u=n*this.dim,f=n*this.dim+this.dim,_=s*this.dim,v=s*this.dim+this.dim;switch(n){case-1:u=f-1;break;case 1:f=u+1}switch(s){case-1:_=v-1;break;case 1:v=_+1}const T=-n*this.dim,P=-s*this.dim;for(let C=_;C<v;C++)for(let D=u;D<f;D++)this.data[this._idx(D,C)]=e.data[this._idx(D+T,C+P)]}}He("DEMData",Ad);class Pd{constructor(e){this._stringToNumber={},this._numberToString=[];for(let n=0;n<e.length;n++){const s=e[n];this._stringToNumber[s]=n,this._numberToString[n]=s}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Id{constructor(e,n,s,u,f){this.type="Feature",this._vectorTileFeature=e,e._z=n,e._x=s,e._y=u,this.properties=e.properties,this.id=f}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const n in this)n!=="_geometry"&&n!=="_vectorTileFeature"&&(e[n]=this[n]);return e}}class Ld{constructor(e,n){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Uo(Ji,16,0),this.grid3D=new Uo(Ji,16,0),this.featureIndexArray=new Ce,this.promoteId=n}insert(e,n,s,u,f,_){const v=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(s,u,f);const T=_?this.grid3D:this.grid;for(let P=0;P<n.length;P++){const C=n[P],D=[1/0,1/0,-1/0,-1/0];for(let O=0;O<C.length;O++){const Z=C[O];D[0]=Math.min(D[0],Z.x),D[1]=Math.min(D[1],Z.y),D[2]=Math.max(D[2],Z.x),D[3]=Math.max(D[3],Z.y)}D[0]<Ji&&D[1]<Ji&&D[2]>=0&&D[3]>=0&&T.insert(v,D[0],D[1],D[2],D[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ga.VectorTile(new vu(this.rawTileData)).layers,this.sourceLayerCoder=new Pd(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,n,s,u){this.loadVTLayers();const f=e.params||{},_=Ji/e.tileSize/e.scale,v=ao(f.filter),T=e.queryGeometry,P=e.queryPadding*_,C=Cd(T),D=this.grid.query(C.minX-P,C.minY-P,C.maxX+P,C.maxY+P),O=Cd(e.cameraQueryGeometry),Z=this.grid3D.query(O.minX-P,O.minY-P,O.maxX+P,O.maxY+P,(te,oe,de,ae)=>
vendor: 4,120 bytes, line 9
9function(me,be,Ee,qe,it){for(const Ze of me)if(be<=Ze.x&&Ee<=Ze.y&&qe>=Ze.x&&it>=Ze.y)return!0;const $e=[new pe(be,Ee),new pe(be,it),new pe(qe,it),new pe(qe,Ee)];if(me.length>2){for(const Ze of $e)if(hl(me,Ze))return!0}for(let Ze=0;Ze<me.length-1;Ze++)if(Yf(me[Ze],me[Ze+1],$e))return!0;return!1}(e.cameraQueryGeometry,te-P,oe-P,de+P,ae+P));for(const te of Z)D.push(te);D.sort(x_);const j={};let H;for(let te=0;te<D.length;te++){const oe=D[te];if(oe===H)continue;H=oe;const de=this.featureIndexArray.get(oe);let ae=null;this.loadMatchingFeature(j,de.bucketIndex,de.sourceLayerIndex,de.featureIndex,v,f.layers,f.availableImages,n,s,u,(me,be,Ee)=>(ae||(ae=Va(me)),be.queryIntersectsFeature(T,me,Ee,ae,this.z,e.transform,_,e.pixelPosMatrix)))}return j}loadMatchingFeature(e,n,s,u,f,_,v,T,P,C,D){const O=this.bucketLayerIDs[n];if(_&&!function(te,oe){for(let de=0;de<te.length;de++)if(oe.indexOf(te[de])>=0)return!0;return!1}(_,O))return;const Z=this.sourceLayerCoder.decode(s),j=this.vtLayers[Z].feature(u);if(f.needGeometry){const te=Za(j,!0);if(!f.filter(new ne(this.tileID.overscaledZ),te,this.tileID.canonical))return}else if(!f.filter(new ne(this.tileID.overscaledZ),j))return;const H=this.getId(j,Z);for(let te=0;te<O.length;te++){const oe=O[te];if(_&&_.indexOf(oe)<0)continue;const de=T[oe];if(!de)continue;let ae={};H&&C&&(ae=C.getState(de.sourceLayer||"_geojsonTileLayer",H));const me=at({},P[oe]);me.paint=Ed(me.paint,de.paint,j,ae,v),me.layout=Ed(me.layout,de.layout,j,ae,v);const be=!D||D(j,de,ae);if(!be)continue;const Ee=new Id(j,this.z,this.x,this.y,H);Ee.layer=me;let qe=e[oe];qe===void 0&&(qe=e[oe]=[]),qe.push({featureIndex:u,feature:Ee,intersectionZ:be})}}lookupSymbolFeatures(e,n,s,u,f,_,v,T){const P={};this.loadVTLayers();const C=ao(f);for(const D of e)this.loadMatchingFeature(P,s,u,D,C,_,v,T,n);return P}hasLayer(e){for(const n of this.bucketLayerIDs)for(const s of n)if(e===s)return!0;return!1}getId(e,n){let s=e.id;return this.promoteId&&(s=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[n]],typeof s=="boolean"&&(s=Number(s))),s}}function Ed(i,e,n,s,u){return nt(i,(f,_)=>{const v=e instanceof Zi?e.get(_):null;return v&&v.evaluate?v.evaluate(n,s,u):v})}function Cd(i){let e=1/0,n=1/0,s=-1/0,u=-1/0;for(const f of i)e=Math.min(e,f.x),n=Math.min(n,f.y),s=Math.max(s,f.x),u=Math.max(u,f.y);return{minX:e,minY:n,maxX:s,maxY:u}}function x_(i,e){return e-i}function Md(i,e,n,s,u){const f=[];for(let _=0;_<i.length;_++){const v=i[_];let T;for(let P=0;P<v.length-1;P++){let C=v[P],D=v[P+1];C.x<e&&D.x<e||(C.x<e?C=new pe(e,C.y+(e-C.x)/(D.x-C.x)*(D.y-C.y))._round():D.x<e&&(D=new pe(e,C.y+(e-C.x)/(D.x-C.x)*(D.y-C.y))._round()),C.y<n&&D.y<n||(C.y<n?C=new pe(C.x+(n-C.y)/(D.y-C.y)*(D.x-C.x),n)._round():D.y<n&&(D=new pe(C.x+(n-C.y)/(D.y-C.y)*(D.x-C.x),n)._round()),C.x>=s&&D.x>=s||(C.x>=s?C=new pe(s,C.y+(s-C.x)/(D.x-C.x)*(D.y-C.y))._round():D.x>=s&&(D=new pe(s,C.y+(s-C.x)/(D.x-C.x)*(D.y-C.y))._round()),C.y>=u&&D.y>=u||(C.y>=u?C=new pe(C.x+(u-C.y)/(D.y-C.y)*(D.x-C.x),u)._round():D.y>=u&&(D=new pe(C.x+(u-C.y)/(D.y-C.y)*(D.x-C.x),u)._round()),T&&C.equals(T[T.length-1])||(T=[C],f.push(T)),T.push(D)))))}}return f}He("FeatureIndex",Ld,{omit:["rawTileData","sourceLayerCoder"]});class ba extends pe{constructor(e,n,s,u){super(e,n),this.angle=s,u!==void 0&&(this.segment=u)}clone(){return new ba(this.x,this.y,this.angle,this.segment)}}function kd(i,e,n,s,u){if(e.segment===void 0||n===0)return!0;let f=e,_=e.segment+1,v=0;for(;v>-n/2;){if(_--,_<0)return!1;v-=i[_].dist(f),f=i[_]}v+=i[_].dist(i[_+1]),_++;const T=[];let P=0;for(;v<n/2;){const C=i[_],D=i[_+1];if(!D)return!1;let O=i[_-1].angleTo(C)-C.angleTo(D);for(O=Math.abs((O+3*Math.PI)%(2*Math.PI)-Math.PI),T.push({distance:v,angleDelta:O}),P+=O;v-T[0].distance>s;)P-=T.shift().angleDelta;if(P>u)return!1;_++,v+=C.dist(D)}return!0}function zd(i){let e=0;for(let n=0;n<i.length-1;n++)e+=i[n].dist(i[n+1]);return e}function Dd(i,e,n){return i?.6*e*n:0}function Rd(i,e){return Math.max(i?i.right-i.left:0,e?e.right-e.left:0)}function b_(i,e,n,s,u,f){const _=Dd(n,u,f),v=Rd(n,s)*f;let T=0;const P=zd(i)/2;for(let C=0;C<i.length-1;
vendor: 5,714 bytes, line 9
9C++){const D=i[C],O=i[C+1],Z=D.dist(O);if(T+Z>P){const j=(P-T)/Z,H=On.number(D.x,O.x,j),te=On.number(D.y,O.y,j),oe=new ba(H,te,O.angleTo(D),C);return oe._round(),!_||kd(i,oe,v,_,e)?oe:void 0}T+=Z}}function w_(i,e,n,s,u,f,_,v,T){const P=Dd(s,f,_),C=Rd(s,u),D=C*_,O=i[0].x===0||i[0].x===T||i[0].y===0||i[0].y===T;return e-D<e/4&&(e=D+e/4),Bd(i,O?e/2*v%e:(C/2+2*f)*_*v%e,e,P,n,D,O,!1,T)}function Bd(i,e,n,s,u,f,_,v,T){const P=f/2,C=zd(i);let D=0,O=e-n,Z=[];for(let j=0;j<i.length-1;j++){const H=i[j],te=i[j+1],oe=H.dist(te),de=te.angleTo(H);for(;O+n<D+oe;){O+=n;const ae=(O-D)/oe,me=On.number(H.x,te.x,ae),be=On.number(H.y,te.y,ae);if(me>=0&&me<T&&be>=0&&be<T&&O-P>=0&&O+P<=C){const Ee=new ba(me,be,de,j);Ee._round(),s&&!kd(i,Ee,f,s,u)||Z.push(Ee)}}D+=oe}return v||Z.length||_||(Z=Bd(i,D/2,n,s,u,f,_,!0,T)),Z}He("Anchor",ba);const vl=mr;function Od(i,e,n,s){const u=[],f=i.image,_=f.pixelRatio,v=f.paddedRect.w-2*vl,T=f.paddedRect.h-2*vl,P=i.right-i.left,C=i.bottom-i.top,D=f.stretchX||[[0,v]],O=f.stretchY||[[0,T]],Z=(Ne,We)=>Ne+We[1]-We[0],j=D.reduce(Z,0),H=O.reduce(Z,0),te=v-j,oe=T-H;let de=0,ae=j,me=0,be=H,Ee=0,qe=te,it=0,$e=oe;if(f.content&&s){const Ne=f.content;de=Ac(D,0,Ne[0]),me=Ac(O,0,Ne[1]),ae=Ac(D,Ne[0],Ne[2]),be=Ac(O,Ne[1],Ne[3]),Ee=Ne[0]-de,it=Ne[1]-me,qe=Ne[2]-Ne[0]-ae,$e=Ne[3]-Ne[1]-be}const Ze=(Ne,We,Ue,De)=>{const ht=Pc(Ne.stretch-de,ae,P,i.left),st=Ic(Ne.fixed-Ee,qe,Ne.stretch,j),Gt=Pc(We.stretch-me,be,C,i.top),Ri=Ic(We.fixed-it,$e,We.stretch,H),Fi=Pc(Ue.stretch-de,ae,P,i.left),sn=Ic(Ue.fixed-Ee,qe,Ue.stretch,j),Mr=Pc(De.stretch-me,be,C,i.top),nr=Ic(De.fixed-it,$e,De.stretch,H),Qi=new pe(ht,Gt),wn=new pe(Fi,Gt),zn=new pe(Fi,Mr),rr=new pe(ht,Mr),or=new pe(st/_,Ri/_),an=new pe(sn/_,nr/_),ln=e*Math.PI/180;if(ln){const jn=Math.sin(ln),_r=Math.cos(ln),gr=[_r,-jn,jn,_r];Qi._matMult(gr),wn._matMult(gr),rr._matMult(gr),zn._matMult(gr)}const Zn=Ne.stretch+Ne.fixed,sr=We.stretch+We.fixed;return{tl:Qi,tr:wn,bl:rr,br:zn,tex:{x:f.paddedRect.x+vl+Zn,y:f.paddedRect.y+vl+sr,w:Ue.stretch+Ue.fixed-Zn,h:De.stretch+De.fixed-sr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:or,pixelOffsetBR:an,minFontScaleX:qe/_/P,minFontScaleY:$e/_/C,isSDF:n}};if(s&&(f.stretchX||f.stretchY)){const Ne=Fd(D,te,j),We=Fd(O,oe,H);for(let Ue=0;Ue<Ne.length-1;Ue++){const De=Ne[Ue],ht=Ne[Ue+1];for(let st=0;st<We.length-1;st++)u.push(Ze(De,We[st],ht,We[st+1]))}}else u.push(Ze({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:v+1},{fixed:0,stretch:T+1}));return u}function Ac(i,e,n){let s=0;for(const u of i)s+=Math.max(e,Math.min(n,u[1]))-Math.max(e,Math.min(n,u[0]));return s}function Fd(i,e,n){const s=[{fixed:-vl,stretch:0}];for(const[u,f]of i){const _=s[s.length-1];s.push({fixed:u-_.stretch,stretch:_.stretch}),s.push({fixed:u-_.stretch,stretch:_.stretch+(f-u)})}return s.push({fixed:e+vl,stretch:n}),s}function Pc(i,e,n,s){return i/e*n+s}function Ic(i,e,n,s){return i-e*n/s}class Lc{constructor(e,n,s,u,f,_,v,T,P,C){if(this.boxStartIndex=e.length,P){let D=_.top,O=_.bottom;const Z=_.collisionPadding;Z&&(D-=Z[1],O+=Z[3]);let j=O-D;j>0&&(j=Math.max(10,j),this.circleDiameter=j)}else{let D=_.top*v-T[0],O=_.bottom*v+T[2],Z=_.left*v-T[3],j=_.right*v+T[1];const H=_.collisionPadding;if(H&&(Z-=H[0]*v,D-=H[1]*v,j+=H[2]*v,O+=H[3]*v),C){const te=new pe(Z,D),oe=new pe(j,D),de=new pe(Z,O),ae=new pe(j,O),me=C*Math.PI/180;te._rotate(me),oe._rotate(me),de._rotate(me),ae._rotate(me),Z=Math.min(te.x,oe.x,de.x,ae.x),j=Math.max(te.x,oe.x,de.x,ae.x),D=Math.min(te.y,oe.y,de.y,ae.y),O=Math.max(te.y,oe.y,de.y,ae.y)}e.emplaceBack(n.x,n.y,Z,D,j,O,s,u,f)}this.boxEndIndex=e.length}}class T_{constructor(e=[],n=S_){if(this.data=e,this.length=this.data.length,this.compare=n,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const e=this.data[0],n=this.data.pop();return this.length--,this.length>0&&(this.data[0]=n,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:n,compare:s}=this,u=n[e];for(;e>0;){const f=e-1>>1,_=n[f];if(s(u,_)>=0)break;n[e]=_,e=f}n[e]=u}_down(e){const{data:n,compare:s}=this,u=this.length>>1,f=n[e];for(;e<u;){let _=1+(e<<1),v=n[_];const T=_+1;if(T<this.length&&s(n[T],v)<0&&(_=T,v=n[T]),s(v,f)>=0)break;n[e]=v,e=_}n[e]=f}}function S_(i,e){return i<e?-1:i>e?1:0}function A_(i,e=1,n=!1){let s=1/0,u=1/0,f=-1/0,_=-1/0;const v=i[0];for(let Z=0;Z<v.length;Z++){const j=v[Z];(!Z||j.x<s)&&(s=j.x),(!Z||j.y<u)&&(u=j.y),(!Z||j.x>f)&&(f=j.x),(!Z||j.y>_)&&(_=j.y)}const T=Math.min(f-s,_-u);let P=T/2;const C=new T_([],P_);if(T===0)return new pe(s,u);for(let Z=s;Z<f;Z+=T)for(let j=u;j<_;j+=T)C.push(new xl(Z+P,j+P,P,i));let D=function(Z){let j=0,H=0,te=0;const oe=Z[0];for(let de=0,ae=oe.length,me=ae-1;de<ae;me=de++){const be=oe[de],Ee=oe[me],qe=be.x*Ee.y-Ee.x*be.y;H+=(be.x+Ee.x)*qe,te+=(be.y+Ee.y)*qe,j+=3*qe}return new xl(H/j,te/j,0,Z)}(i),O=C.length;for(;C.length;){const Z=C.pop();(Z.d>D.d||!D.d)&&(D=Z,n&&console.log("found best %d after %d probes",Math.round(1e4*Z.d)/1e4,O)),Z.max-D.d<=e||(P=Z.h/2,C.push(new xl(Z.p.x-P,Z.p.y-P,P,i)),C.push(new xl(Z.p.x+P,Z.p.y-P,P,i)),C.push(new xl(Z.p.x-P,Z.p.y+P,P,i)),C.push(new xl(Z.p.x+P,Z.p.y+P,P,i)),O+=4)}return n&&(console.log(`num probes: ${O}`),console.log(`best distance: ${D.d}`)),D.p}function P_(i,e){return e.max-i.max}function xl(i,e,n,s){this.p=new pe(i,e),this.h=n,this.d=function(u,f){let _=!1,v=1/0;for(let T=0;T<f.length;T++){const P=f[T];for(let C=0,D=P.length,O=D-1;C<D;O=C++){const Z=P[C],j=P[O];Z.y>u.y!=j.y>u.y&&u.x<(j.x-Z.x)*(u.y-Z.y)/(j.y-Z.y)+Z.x&&(_=!_),v=Math.min(v,xh(u,Z,j))}}return(_?1:-1)*Math.sqrt(v)}(this.p,s),this.max=this.d+this.h*Math.SQRT2}var kn;l.aq=void 0,(kn=l.aq||(l.aq={}
vendor: 11,174 bytes, line 9
9))[kn.center=1]="center",kn[kn.left=2]="left",kn[kn.right=3]="right",kn[kn.top=4]="top",kn[kn.bottom=5]="bottom",kn[kn["top-left"]=6]="top-left",kn[kn["top-right"]=7]="top-right",kn[kn["bottom-left"]=8]="bottom-left",kn[kn["bottom-right"]=9]="bottom-right";const wa=7,ku=Number.POSITIVE_INFINITY;function Nd(i,e){return e[1]!==ku?function(n,s,u){let f=0,_=0;switch(s=Math.abs(s),u=Math.abs(u),n){case"top-right":case"top-left":case"top":_=u-wa;break;case"bottom-right":case"bottom-left":case"bottom":_=-u+wa}switch(n){case"top-right":case"bottom-right":case"right":f=-s;break;case"top-left":case"bottom-left":case"left":f=s}return[f,_]}(i,e[0],e[1]):function(n,s){let u=0,f=0;s<0&&(s=0);const _=s/Math.SQRT2;switch(n){case"top-right":case"top-left":f=_-wa;break;case"bottom-right":case"bottom-left":f=-_+wa;break;case"bottom":f=-s+wa;break;case"top":f=s-wa}switch(n){case"top-right":case"bottom-right":u=-_;break;case"top-left":case"bottom-left":u=_;break;case"left":u=s;break;case"right":u=-s}return[u,f]}(i,e[0])}function Ud(i,e,n){var s;const u=i.layout,f=(s=u.get("text-variable-anchor-offset"))===null||s===void 0?void 0:s.evaluate(e,{},n);if(f){const v=f.values,T=[];for(let P=0;P<v.length;P+=2){const C=T[P]=v[P],D=v[P+1].map(O=>O*on);C.startsWith("top")?D[1]-=wa:C.startsWith("bottom")&&(D[1]+=wa),T[P+1]=D}return new Bt(T)}const _=u.get("text-variable-anchor");if(_){let v;v=i._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[u.get("text-radial-offset").evaluate(e,{},n)*on,ku]:u.get("text-offset").evaluate(e,{},n).map(P=>P*on);const T=[];for(const P of _)T.push(P,Nd(P,v));return new Bt(T)}return null}function zu(i){switch(i){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function I_(i,e,n,s,u,f,_,v,T,P,C){let D=f.textMaxSize.evaluate(e,{});D===void 0&&(D=_);const O=i.layers[0].layout,Z=O.get("icon-offset").evaluate(e,{},C),j=Zd(n.horizontal),H=_/24,te=i.tilePixelRatio*H,oe=i.tilePixelRatio*D/24,de=i.tilePixelRatio*v,ae=i.tilePixelRatio*O.get("symbol-spacing"),me=O.get("text-padding")*i.tilePixelRatio,be=function(De,ht,st,Gt=1){const Ri=De.get("icon-padding").evaluate(ht,{},st),Fi=Ri&&Ri.values;return[Fi[0]*Gt,Fi[1]*Gt,Fi[2]*Gt,Fi[3]*Gt]}(O,e,C,i.tilePixelRatio),Ee=O.get("text-max-angle")/180*Math.PI,qe=O.get("text-rotation-alignment")!=="viewport"&&O.get("symbol-placement")!=="point",it=O.get("icon-rotation-alignment")==="map"&&O.get("symbol-placement")!=="point",$e=O.get("symbol-placement"),Ze=ae/2,Ne=O.get("icon-text-fit");let We;s&&Ne!=="none"&&(i.allowVerticalPlacement&&n.vertical&&(We=ud(s,n.vertical,Ne,O.get("icon-text-fit-padding"),Z,H)),j&&(s=ud(s,j,Ne,O.get("icon-text-fit-padding"),Z,H)));const Ue=(De,ht)=>{ht.x<0||ht.x>=Ji||ht.y<0||ht.y>=Ji||function(st,Gt,Ri,Fi,sn,Mr,nr,Qi,wn,zn,rr,or,an,ln,Zn,sr,jn,_r,gr,cn,ii,$n,Dn,un,yo){const qo=st.addToLineVertexArray(Gt,Ri);let Go,Zs,vo,Gr,yr=0,js=0,oc=0,Gd=0,Vu=-1,Zu=-1;const $s={};let Hd=Fs("");if(st.allowVerticalPlacement&&Fi.vertical){const qn=Qi.layout.get("text-rotate").evaluate(ii,{},un)+90;vo=new Lc(wn,Gt,zn,rr,or,Fi.vertical,an,ln,Zn,qn),nr&&(Gr=new Lc(wn,Gt,zn,rr,or,nr,jn,_r,Zn,qn))}if(sn){const qn=Qi.layout.get("icon-rotate").evaluate(ii,{}),Hr=Qi.layout.get("icon-text-fit")!=="none",$a=Od(sn,qn,Dn,Hr),Wo=nr?Od(nr,qn,Dn,Hr):void 0;Zs=new Lc(wn,Gt,zn,rr,or,sn,jn,_r,!1,qn),yr=4*$a.length;const qa=st.iconSizeData;let fs=null;qa.kind==="source"?(fs=[ps*Qi.layout.get("icon-size").evaluate(ii,{})],fs[0]>va&&ft(`${st.layerIds[0]}: Value for "icon-size" is >= ${tc}. Reduce your "icon-size".`)):qa.kind==="composite"&&(fs=[ps*$n.compositeIconSizes[0].evaluate(ii,{},un),ps*$n.compositeIconSizes[1].evaluate(ii,{},un)],(fs[0]>va||fs[1]>va)&&ft(`${st.layerIds[0]}: Value for "icon-size" is >= ${tc}. Reduce your "icon-size".`)),st.addSymbols(st.icon,$a,fs,cn,gr,ii,l.ai.none,Gt,qo.lineStartIndex,qo.lineLength,-1,un),Vu=st.icon.placedSymbolArray.length-1,Wo&&(js=4*Wo.length,st.addSymbols(st.icon,Wo,fs,cn,gr,ii,l.ai.vertical,Gt,qo.lineStartIndex,qo.lineLength,-1,un),Zu=st.icon.placedSymbolArray.length-1)}const Wd=Object.keys(Fi.horizontal);for(const qn of Wd){const Hr=Fi.horizontal[qn];if(!Go){Hd=Fs(Hr.text);const Wo=Qi.layout.get("text-rotate").evaluate(ii,{},un);Go=new Lc(wn,Gt,zn,rr,or,Hr,an,ln,Zn,Wo)}const $a=Hr.positionedLines.length===1;if(oc+=Vd(st,Gt,Hr,Mr,Qi,Zn,ii,sr,qo,Fi.vertical?l.ai.horizontal:l.ai.horizontalOnly,$a?Wd:[qn],$s,Vu,$n,un),$a)break}Fi.vertical&&(Gd+=Vd(st,Gt,Fi.vertical,Mr,Qi,Zn,ii,sr,qo,l.ai.vertical,["vertical"],$s,Zu,$n,un));const C_=Go?Go.boxStartIndex:st.collisionBoxArray.length,M_=Go?Go.boxEndIndex:st.collisionBoxArray.length,k_=vo?vo.boxStartIndex:st.collisionBoxArray.length,z_=vo?vo.boxEndIndex:st.collisionBoxArray.length,D_=Zs?Zs.boxStartIndex:st.collisionBoxArray.length,R_=Zs?Zs.boxEndIndex:st.collisionBoxArray.length,B_=Gr?Gr.boxStartIndex:st.collisionBoxArray.length,O_=Gr?Gr.boxEndIndex:st.collisionBoxArray.length;let Ho=-1;const Cc=(qn,Hr)=>qn&&qn.circleDiameter?Math.max(qn.circleDiameter,Hr):Hr;Ho=Cc(Go,Ho),Ho=Cc(vo,Ho),Ho=Cc(Zs,Ho),Ho=Cc(Gr,Ho);const Kd=Ho>-1?1:0;Kd&&(Ho*=yo/on),st.glyphOffsetArray.length>=yl.MAX_GLYPHS&&ft("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ii.sortKey!==void 0&&st.addToSortKeyRanges(st.symbolInstances.length,ii.sortKey);const F_=Ud(Qi,ii,un),[N_,U_]=function(qn,Hr){const $a=qn.length,Wo=Hr==null?void 0:Hr.values;if((Wo==null?void 0:Wo.length)>0)for(let qa=0;qa<Wo.length;qa+=2){const fs=Wo[qa+1];qn.emplaceBack(l.aq[Wo[qa]],fs[0],fs[1])}return[$a,qn.length]}(st.textAnchorOffsets,F_);st.symbolInstances.emplaceBack(Gt.x,Gt.y,$s.right>=0?$s.right:-1,$s.center>=0?$s.center:-1,$s.left>=0?$s.left:-1,$s.vertical||-1,Vu,Zu,Hd,C_,M_,k_,z_,D_,R_,B_,O_,zn,oc,Gd,yr,js,Kd,0,an,Ho,N_,U_)}(i,ht,De,n,s,u,We,i.layers[0],i.collisionBoxArray,e.index,e.sourceLayerIndex,i.index,te,[me,me,me,me],qe,T,de,be,it,Z,e,f,P,C,_)};if($e==="line")for(const De of Md(e.geometry,0,0,Ji,Ji)){const ht=w_(De,ae,Ee,n.vertical||j,s,24,oe,i.overscaling,Ji);for(const st of ht)j&&L_(i,j.text,Ze,st)||Ue(De,st)}else if($e==="line-center"){for(const De of e.geometry)if(De.length>1){const ht=b_(De,Ee,n.vertical||j,s,24,oe);ht&&Ue(De,ht)}}else if(e.type==="Polygon")for(const De of hu(e.geometry,0)){const ht=A_(De,16);Ue(De[0],new ba(ht.x,ht.y,0))}else if(e.type==="LineString")for(const De of e.geometry)Ue(De,new ba(De[0].x,De[0].y,0));else if(e.type==="Point")for(const De of e.geometry)for(const ht of De)Ue([ht],new ba(ht.x,ht.y,0))}function Vd(i,e,n,s,u,f,_,v,T,P,C,D,O,Z,j){const H=function(de,ae,me,be,Ee,qe,it,$e){const Ze=be.layout.get("text-rotate").evaluate(qe,{})*Math.PI/180,Ne=[];for(const We of ae.positionedLines)for(const Ue of We.positionedGlyphs){if(!Ue.rect)continue;const De=Ue.rect||{};let ht=nd+1,st=!0,Gt=1,Ri=0;const Fi=(Ee||$e)&&Ue.vertical,sn=Ue.metrics.advance*Ue.scale/2;if($e&&ae.verticalizable&&(Ri=We.lineOffset/2-(Ue.imageName?-(on-Ue.metrics.width*Ue.scale)/2:(Ue.scale-1)*on)),Ue.imageName){const cn=it[Ue.imageName];st=cn.sdf,Gt=cn.pixelRatio,ht=mr/Gt}const Mr=Ee?[Ue.x+sn,Ue.y]:[0,0];let nr=Ee?[0,0]:[Ue.x+sn+me[0],Ue.y+me[1]-Ri],Qi=[0,0];Fi&&(Qi=nr,nr=[0,0]);const wn=Ue.metrics.isDoubleResolution?2:1,zn=(Ue.metrics.left-ht)*Ue.scale-sn+nr[0],rr=(-Ue.metrics.top-ht)*Ue.scale+nr[1],or=zn+De.w/wn*Ue.scale/Gt,an=rr+De.h/wn*Ue.scale/Gt,ln=new pe(zn,rr),Zn=new pe(or,rr),sr=new pe(zn,an),jn=new pe(or,an);if(Fi){const cn=new pe(-sn,sn-Ql),ii=-Math.PI/2,$n=on/2-sn,Dn=new pe(5-Ql-$n,-(Ue.imageName?$n:0)),un=new pe(...Qi);ln._rotateAround(ii,cn)._add(Dn)._add(un),Zn._rotateAround(ii,cn)._add(Dn)._add(un),sr._rotateAround(ii,cn)._add(Dn)._add(un),jn._rotateAround(ii,cn)._add(Dn)._add(un)}if(Ze){const cn=Math.sin(Ze),ii=Math.cos(Ze),$n=[ii,-cn,cn,ii];ln._matMult($n),Zn._matMult($n),sr._matMult($n),jn._matMult($n)}const _r=new pe(0,0),gr=new pe(0,0);Ne.push({tl:ln,tr:Zn,bl:sr,br:jn,tex:De,writingMode:ae.writingMode,glyphOffset:Mr,sectionIndex:Ue.sectionIndex,isSDF:st,pixelOffsetTL:_r,pixelOffsetBR:gr,minFontScaleX:0,minFontScaleY:0})}return Ne}(0,n,v,u,f,_,s,i.allowVerticalPlacement),te=i.textSizeData;let oe=null;te.kind==="source"?(oe=[ps*u.layout.get("text-size").evaluate(_,{})],oe[0]>va&&ft(`${i.layerIds[0]}: Value for "text-size" is >= ${tc}. Reduce your "text-size".`)):te.kind==="composite"&&(oe=[ps*Z.compositeTextSizes[0].evaluate(_,{},j),ps*Z.compositeTextSizes[1].evaluate(_,{},j)],(oe[0]>va||oe[1]>va)&&ft(`${i.layerIds[0]}: Value for "text-size" is >= ${tc}. Reduce your "text-size".`)),i.addSymbols(i.text,H,oe,v,f,_,P,e,T.lineStartIndex,T.lineLength,O,j);for(const de of C)D[de]=i.text.placedSymbolArray.length-1;return 4*H.length}function Zd(i){for(const e in i)return i[e];return null}function L_(i,e,n,s){const u=i.compareText;if(e in u){const f=u[e];for(let _=f.length-1;_>=0;_--)if(s.dist(f[_])<n)return!0}else u[e]=[];return u[e].push(s),!1}const jd=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Du{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[n,s]=new Uint8Array(e,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");const u=s>>4;if(u!==1)throw new Error(`Got v${u} data when expected v1.`);const f=jd[15&s];if(!f)throw new Error("Unrecognized array type.");const[_]=new Uint16Array(e,2,1),[v]=new Uint32Array(e,4,1);return new Du(v,_,f,e)}constructor(e,n=64,s=Float64Array,u){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=s,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const f=jd.indexOf(this.ArrayType),_=2*e*this.ArrayType.BYTES_PER_ELEMENT,v=e*this.IndexArrayType.BYTES_PER_ELEMENT,T=(8-v%8)%8;if(f<0)throw new Error(`Unexpected typed array class: ${s}.`);u&&u instanceof ArrayBuffer?(this.data=u,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+v+T,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+_+v+T),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+v+T,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+f]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=e)}add(e,n){const s=this._pos>>1;return this.ids[s]=s,this.coords[this._pos++]=e,this.coords[this._pos++]=n,s}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Ru(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,n,s,u){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:f,coords:_,nodeSize:v}=this,T=[0,f.length-1,0],P=[];for(;T.length;){const C=T.pop()||0,D=T.pop()||0,O=T.pop()||0;if(D-O<=v){for(let te=O;te<=D;te++){const oe=_[2*te],de=_[2*te+1];oe>=e&&oe<=s&&de>=n&&de<=u&&P.push(f[te])}continue}const Z=O+D>>1,j=_[2*Z],H=_[2*Z+1];j>=e&&j<=s&&H>=n&&H<=u&&P.push(f[Z]),(C===0?e<=j:n<=H)&&(T.push(O),T.push(Z-1),T.push(1-C)),(C===0?s>=j:u>
9=H)&&(T.push(Z+1),T.push(D),T.push(1-C))}return P}within(e,n,s){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:u,coords:f,nodeSize:_}=this,v=[0,u.length-1,0],T=[],P=s*s;for(;v.length;){const C=v.pop()||0,D=v.pop()||0,O=v.pop()||0;if(D-O<=_){for(let te=O;te<=D;te++)qd(f[2*te],f[2*te+1],e,n)<=P&&T.push(u[te]);continue}const Z=O+D>>1,j=f[2*Z],H=f[2*Z+1];qd(j,H,e,n)<=P&&T.push(u[Z]),(C===0?e-s<=j:n-s<=H)&&(v.push(O),v.push(Z-1),v.push(1-C)),(C===0?e+s>=j:n+s>=H)&&(v.push(Z+1),v.push(D),v.push(1-C))}return T}}function Ru(i,e,n,s,u,f){if(u-s<=n)return;const _=s+u>>1;$d(i,e,_,s,u,f),Ru(i,e,n,s,_-1,1-f),Ru(i,e,n,_+1,u,1-f)}function $d(i,e,n,s,u,f){for(;u>s;){if(u-s>600){const P=u-s+1,C=n-s+1,D=Math.log(P),O=.5*Math.exp(2*D/3),Z=.5*Math.sqrt(D*O*(P-O)/P)*(C-P/2<0?-1:1);$d(i,e,n,Math.max(s,Math.floor(n-C*O/P+Z)),Math.min(u,Math.floor(n+(P-C)*O/P+Z)),f)}const _=e[2*n+f];let v=s,T=u;for(nc(i,e,s,n),e[2*u+f]>_&&nc(i,e,s,u);v<T;){for(nc(i,e,v,T),v++,T--;e[2*v+f]<_;)v++;for(;e[2*T+f]>_;)T--}e[2*s+f]===_?nc(i,e,s,T):(T++,nc(i,e,T,u)),T<=n&&(s=T+1),n<=T&&(u=T-1)}}function nc(i,e,n,s){Bu(i,n,s),Bu(e,2*n,2*s),Bu(e,2*n+1,2*s+1)}function Bu(i,e,n){const s=i[e];i[e]=i[n],i[n]=s}function qd(i,e,n,s){const u=i-n,f=e-s;return u*u+f*f}var Ou;l.bh=void 0,(Ou=l.bh||(l.bh={})).create="create",Ou.load="load",Ou.fullLoad="fullLoad";let Ec=null,rc=[];const Fu=1e3/60,Nu="loadTime",Uu="fullLoadTime",E_={mark(i){performance.mark(i)},frame(i){const e=i;Ec!=null&&rc.push(e-Ec),Ec=e},clearMetrics(){Ec=null,rc=[],performance.clearMeasures(Nu),performance.clearMeasures(Uu);for(const i in l.bh)performance.clearMarks(l.bh[i])},getPerformanceMetrics(){performance.measure(Nu,l.bh.create,l.bh.load),performance.measure(Uu,l.bh.create,l.bh.fullLoad);const i=performance.getEntriesByName(Nu)[0].duration,e=performance.getEntriesByName(Uu)[0].duration,n=rc.length,s=1/(rc.reduce((f,_)=>f+_,0)/n/1e3),u=rc.filter(f=>f>Fu).reduce((f,_)=>f+(_-Fu)/Fu,0);return{loadTime:i,fullLoadTime:e,fps:s,percentDroppedFrames:u/(n+u)*100,totalFrames:n}}};l.$=function(i,e,n){var s,u,f,_,v,T,P,C,D,O,Z,j,H=n[0],te=n[1],oe=n[2];return e===i?(i[12]=e[0]*H+e[4]*te+e[8]*oe+e[12],i[13]=e[1]*H+e[5]*te+e[9]*oe+e[13],i[14]=e[2]*H+e[6]*te+e[10]*oe+e[14],i[15]=e[3]*H+e[7]*te+e[11]*oe+e[15]):(u=e[1],f=e[2],_=e[3],v=e[4],T=e[5],P=e[6],C=e[7],D=e[8],O=e[9],Z=e[10],j=e[11],i[0]=s=e[0],i[1]=u,i[2]=f,i[3]=_,i[4]=v,i[5]=T,i[6]=P,i[7]=C,i[8]=D,i[9]=O,i[10]=Z,i[11]=j,i[12]=s*H+v*te+D*oe+e[12],i[13]=u*H+T*te+O*oe+e[13],i[14]=f*H+P*te+Z*oe+e[14],i[15]=_*H+C*te+j*oe+e[15]),i},l.A=dl,l.B=On,l.C=class{constructor(i,e,n){this.receive=s=>{const u=s.data,f=u.id;if(f&&(!u.targetMapId||this.mapId===u.targetMapId))if(u.type==="<cancel>"){delete this.tasks[f];const _=this.cancelCallbacks[f];delete this.cancelCallbacks[f],_&&_()}else ni()||u.mustQueue?(this.tasks[f]=u,this.taskQueue.push(f),this.invoker.trigger()):this.processTask(f,u)},this.process=()=>{if(!this.taskQueue.length)return;const s=this.taskQueue.shift(),u=this.tasks[s];delete this.tasks[s],this.taskQueue.length&&this.invoker.trigger(),u&&this.processTask(s,u)},this.target=i,this.parent=e,this.mapId=n,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new v_(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=ni()?i:window}send(i,e,n,s,u=!1){const f=Math.round(1e18*Math.random()).toString(36).substring(0,10);n&&(this.callbacks[f]=n);const _=[],v={id:f,type:i,hasCallback:!!n,targetMapId:s,mustQueue:u,sourceMapId:this.mapId,data:jr(e,_)};return this.target.postMessage(v,{transfer:_}),{cancel:()=>{n&&delete this.callbacks[f],this.target.postMessage({id:f,type:"<cancel>",targetMapId:s,sourceMapId:this.mapId})}}}processTask(i,e){if(e.type==="<response>"){const n=this.callbacks[i];delete this.callbacks[i],n&&(e.error?n(Vo(e.error)):n(null,Vo(e.data)))}else{let n=!1;const s=[],u=e.hasCallback?(v,T)=>{n=!0,delete this.cancelCallbacks[i];const P={id:i,type:"<response>",sourceMapId:this.mapId,error:v?jr(v):null,data:jr(T,s)};this.target.postMessage(P,{transfer:s})}:v=>{n=!0};let f=null;const _=Vo(e.data);if(this.parent[e.type])f=this.parent[e.type](e.sourceMapId,_,u);else if("getWorkerSource"in this.parent){const v=e.type.split(".");f=this.parent.getWorkerSource(e.sourceMapId,v[0],_.source)[v[1]](_,u)}else u(new Error(`Could not find function ${e.type}`));!n&&f&&f.cancel&&(this.cancelCallbacks[i]=f.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},l.D=Ge,l.E=Po,l.F=function(i,e){const n={};for(let s=0;s<e.length;s++){const u=e[s];u in i&&(n[u]=i[u])}return n},l.G=vd,l.H=xd,l.I=bu,l.J=zt,l.K=Dt,l.L=xa,l.M=Mt,l.N=Ji,l.O=qr,l.P=pe,l.Q=zi,l.R=$r,l.S=Di,l.T=Me,l.U=Sc,l.V=class extends ho{},l.W=Mu,l.X=function(i,e){const n=window.document.createElement("video");n.muted=!0,n.onloadstart=function(){e(null,n)};for(let s=0;s<i.length;s++){const u=window.document.createElement("source");kr(i[s])||(n.crossOrigin="Anonymous"),u.src=i[s],n.appendChild(u)}return{cancel:()=>{}}},l.Y=Fe,l.Z=function(){var i=new dl(16);return dl!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=0,i[12]=0,i[13]=0,i[14]=0),i[0]=1,i[5]=1,i[10]=1,i[15]=1,i},l._=se,l.a=Ui,l.a$=class extends U{},l.a0=function(i,e,n){var s=n[0],u=n[1],f=n[2];return i[0]=e[0]*s,i[1]=e[1]*s,i[2]=e[2]*s,i[3]=e[3]*s,i[4]=e[4]*u,i[5]=e[5]*u,i[6]=e[6]*u,i[7]=e[7]*u,i[8]=e[8]*f,i[9]=e[9]*f,i[10]=e[10]*f,i[11]=e[11]*f,i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},l.a1=Sh,l.a2=function(){return yt++},l.a3=J,l.a4=yl,l.a5=function(){V.isLoading()||V.isLoaded()||S()!=="deferred"||M()},l.a6=ao,l.a7=Za,l.a8=ne,l.a9=Id,l.aA=r,l.aB=function(i){i=i.slice();const e=Object.create(null);for(let n=0;n<i.length;n++)e[i[n].id]=i[n];for(let n=0;n<i.length;n++)"ref"in i[n]&&(i[n]=Bn(i[n],e[i[n].ref]));return i},l.aC=function(i){if(i.type==="custom")return new y_(i);switch(i.type){case"background":return new m_(i);case"circle":return new em(i);case"fill":return new xm(i);case"fill-extrusion":return new Rm(i);case"heatmap":return new im(i);case"hillshade":return new rm(i);case"line":return new jm(i);case"raster":return new g_(i);case"symbol":return new Tc(i)}},l.aD=rt,l.aE=function(i,e){if(!i)return[{command:li.setStyle,args:[e]}];let n=[];try{if(!yi(i.version,e.version))return[{command:li.setStyle,args:[e]}];yi(i.center,e.center)||n.push({command:li.setCenter,args:[e.center]}),yi(i.zoom,e.zoom)||n.push({command:li.setZoom,args:[e.zoom]}),yi(i.bearing,e.bearing)||n.push({command:li.setBearing,args:[e.bearing]}),yi(i.pitch,e.pitch)||n.push({command:li.setPitch,args:[e.pitch]}),yi(i.sprite,e.sprite)||n.push({command:li.setSprite,args:[e.sprite]}),yi(i.glyphs,e.glyphs)||n.push({command:li.setGlyphs,args:[e.glyphs]}),yi(i.transition,e.transition)||n.push({command:li.setTransition,args:[e.transition]}),yi(i.light,e.light)||n.push({command:li.setLight,args:[e.light]});const s={},u=[];(function(_,v,T,P){let C;for(C in v=v||{},_=_||{})Object.prototype.hasOwnProperty.call(_,C)&&(Object.prototype.hasOwnProperty.call(v,C)||Qr(C,T,P));for(C in v)Object.prototype.hasOwnProperty.call(v,C)&&(Object.prototype.hasOwnProperty.call(_,C)?yi(_[C],v[C])||(_[C].type==="geojson"&&v[C].type==="geojson"&&vs(_,v,C)?T.push({command:li.setGeoJSONSourceData,args:[C,v[C].data]}):br(C,v,T,P)):xr(C,v,T))})(i.sources,e.sources,u,s);const f=[];
9i.layers&&i.layers.forEach(_=>{s[_.source]?n.push({command:li.removeLayer,args:[_.id]}):f.push(_)}),n=n.concat(u),function(_,v,T){v=v||[];const P=(_=_||[]).map(zr),C=v.map(zr),D=_.reduce(eo,{}),O=v.reduce(eo,{}),Z=P.slice(),j=Object.create(null);let H,te,oe,de,ae,me,be;for(H=0,te=0;H<P.length;H++)oe=P[H],Object.prototype.hasOwnProperty.call(O,oe)?te++:(T.push({command:li.removeLayer,args:[oe]}),Z.splice(Z.indexOf(oe,te),1));for(H=0,te=0;H<C.length;H++)oe=C[C.length-1-H],Z[Z.length-1-H]!==oe&&(Object.prototype.hasOwnProperty.call(D,oe)?(T.push({command:li.removeLayer,args:[oe]}),Z.splice(Z.lastIndexOf(oe,Z.length-te),1)):te++,me=Z[Z.length-H],T.push({command:li.addLayer,args:[O[oe],me]}),Z.splice(Z.length-H,0,oe),j[oe]=!0);for(H=0;H<C.length;H++)if(oe=C[H],de=D[oe],ae=O[oe],!j[oe]&&!yi(de,ae))if(yi(de.source,ae.source)&&yi(de["source-layer"],ae["source-layer"])&&yi(de.type,ae.type)){for(be in Ko(de.layout,ae.layout,T,oe,null,li.setLayoutProperty),Ko(de.paint,ae.paint,T,oe,null,li.setPaintProperty),yi(de.filter,ae.filter)||T.push({command:li.setFilter,args:[oe,ae.filter]}),yi(de.minzoom,ae.minzoom)&&yi(de.maxzoom,ae.maxzoom)||T.push({command:li.setLayerZoomRange,args:[oe,ae.minzoom,ae.maxzoom]}),de)Object.prototype.hasOwnProperty.call(de,be)&&be!=="layout"&&be!=="paint"&&be!=="filter"&&be!=="metadata"&&be!=="minzoom"&&be!=="maxzoom"&&(be.indexOf("paint.")===0?Ko(de[be],ae[be],T,oe,be.slice(6),li.setPaintProperty):yi(de[be],ae[be])||T.push({command:li.setLayerProperty,args:[oe,be,ae[be]]}));for(be in ae)Object.prototype.hasOwnProperty.call(ae,be)&&!Object.prototype.hasOwnProperty.call(de,be)&&be!=="layout"&&be!=="paint"&&be!=="filter"&&be!=="metadata"&&be!=="minzoom"&&be!=="maxzoom"&&(be.indexOf("paint.")===0?Ko(de[be],ae[be],T,oe,be.slice(6),li.setPaintProperty):yi(de[be],ae[be])||T.push({command:li.setLayerProperty,args:[oe,be,ae[be]]}))}else T.push({command:li.removeLayer,args:[oe]}),me=Z[Z.lastIndexOf(oe)+1],T.push({command:li.addLayer,args:[ae,me]})}(f,e.layers,n)}catch(s){console.warn("Unable to compute style diff:",s),n=[{command:li.setStyle,args:[e]}]}return n},l.aF=function(i){const e=[],n=i.id;return n===void 0&&e.push({message:`layers.${n}: missing required property "id"`}),i.render===void 0&&e.push({message:`layers.${n}: missing required method "render"`}),i.renderingMode&&i.renderingMode!=="2d"&&i.renderingMode!=="3d"&&e.push({message:`layers.${n}: property "renderingMode" must be either "2d" or "3d"`}),e},l.aG=function i(e,n){if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let s=0;s<e.length;s++)if(!i(e[s],n[s]))return!1;return!0}if(typeof e=="object"&&e!==null&&n!==null){if(typeof n!="object"||Object.keys(e).length!==Object.keys(n).length)return!1;for(const s in e)if(!i(e[s],n[s]))return!1;return!0}return e===n},l.aH=nt,l.aI=xt,l.aJ=g,l.aK=function(i){return i({pluginStatus:vn,pluginURL:uo}),g.on("pluginStateChange",i),i},l.aL=class extends Ns{constructor(i,e){super(i,e),this.current=0}set(i){this.current!==i&&(this.current=i,this.gl.uniform1i(this.location,i))}},l.aM=ul,l.aN=class extends Ns{constructor(i,e){super(i,e),this.current=Qc}set(i){if(i[12]!==this.current[12]||i[0]!==this.current[0])return this.current=i,void this.gl.uniformMatrix4fv(this.location,!1,i);for(let e=1;e<16;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix4fv(this.location,!1,i);break}}},l.aO=lc,l.aP=class extends Ns{constructor(i,e){super(i,e),this.current=[0,0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]&&i[2]===this.current[2]||(this.current=i,this.gl.uniform3f(this.location,i[0],i[1],i[2]))}},l.aQ=class extends Ns{constructor(i,e){super(i,e),this.current=[0,0]}set(i){i[0]===this.current[0]&&i[1]===this.current[1]||(this.current=i,this.gl.uniform2f(this.location,i[0],i[1]))}},l.aR=cc,l.aS=function(i,e,n,s,u,f,_){var v=1/(e-n),T=1/(s-u),P=1/(f-_);return i[0]=-2*v,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=-2*T,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=2*P,i[11]=0,i[12]=(e+n)*v,i[13]=(u+s)*T,i[14]=(_+f)*P,i[15]=1,i},l.aT=_i,l.aU=Qf,l.aV=class extends a{},l.aW=Hm,l.aX=class extends m{},l.aY=function(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}
9,l.aZ=Eh,l.a_=Be,l.aa=function(i){const e={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(n,s,u,f)=>{const _=u||f;return e[s]=!_||_.toLowerCase(),""}),e["max-age"]){const n=parseInt(e["max-age"],10);isNaN(n)?delete e["max-age"]:e["max-age"]=n}return e},l.ab=function(i,e){const n=[];for(const s in i)s in e||n.push(s);return n},l.ac=function(i){if(et==null){const e=i.navigator?i.navigator.userAgent:null;et=!!i.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return et},l.ad=_t,l.ae=function(i,e,n){var s=Math.sin(n),u=Math.cos(n),f=e[0],_=e[1],v=e[2],T=e[3],P=e[4],C=e[5],D=e[6],O=e[7];return e!==i&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=f*u+P*s,i[1]=_*u+C*s,i[2]=v*u+D*s,i[3]=T*u+O*s,i[4]=P*u-f*s,i[5]=C*u-_*s,i[6]=D*u-v*s,i[7]=O*u-T*s,i},l.af=function(i){var e=new dl(16);return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e},l.ag=pc,l.ah=function(i,e){let n=0,s=0;if(i.kind==="constant")s=i.layoutSize;else if(i.kind!=="source"){const{interpolationType:u,minZoom:f,maxZoom:_}=i,v=u?_t(En.interpolationFactor(u,e,f,_),0,1):0;i.kind==="camera"?s=On.number(i.minSize,i.maxSize,v):n=v}return{uSizeT:n,uSize:s}},l.aj=function(i,{uSize:e,uSizeT:n},{lowerSize:s,upperSize:u}){return i.kind==="source"?s/ps:i.kind==="composite"?On.number(s/ps,u/ps,n):e},l.ak=Au,l.al=function(i,e,n,s){const u=e.y-i.y,f=e.x-i.x,_=s.y-n.y,v=s.x-n.x,T=_*f-v*u;if(T===0)return null;const P=(v*(i.y-n.y)-_*(i.x-n.x))/T;return new pe(i.x+P*f,i.y+P*u)},l.am=Md,l.an=yh,l.ao=ru,l.ap=on,l.ar=Su,l.as=function(i,e){var n=e[0],s=e[1],u=e[2],f=e[3],_=e[4],v=e[5],T=e[6],P=e[7],C=e[8],D=e[9],O=e[10],Z=e[11],j=e[12],H=e[13],te=e[14],oe=e[15],de=n*v-s*_,ae=n*T-u*_,me=n*P-f*_,be=s*T-u*v,Ee=s*P-f*v,qe=u*P-f*T,it=C*H-D*j,$e=C*te-O*j,Ze=C*oe-Z*j,Ne=D*te-O*H,We=D*oe-Z*H,Ue=O*oe-Z*te,De=de*Ue-ae*We+me*Ne+be*Ze-Ee*$e+qe*it;return De?(i[0]=(v*Ue-T*We+P*Ne)*(De=1/De),i[1]=(u*We-s*Ue-f*Ne)*De,i[2]=(H*qe-te*Ee+oe*be)*De,i[3]=(O*Ee-D*qe-Z*be)*De,i[4]=(T*Ze-_*Ue-P*$e)*De,i[5]=(n*Ue-u*Ze+f*$e)*De,i[6]=(te*me-j*qe-oe*ae)*De,i[7]=(C*qe-O*me+Z*ae)*De,i[8]=(_*We-v*Ze+P*it)*De,i[9]=(s*Ze-n*We-f*it)*De,i[10]=(j*Ee-H*me+oe*de)*De,i[11]=(D*me-C*Ee-Z*de)*De,i[12]=(v*$e-_*Ne-T*it)*De,i[13]=(n*Ne-s*$e+u*it)*De,i[14]=(H*ae-j*be-te*de)*De,i[15]=(C*be-D*ae+O*de)*De,i):null},l.at=zu,l.au=Tu,l.av=Du,l.aw=function(){const i={},e=Pe.$version;for(const n in Pe.$root){const s=Pe.$root[n];if(s.required){let u=null;u=n==="version"?e:s.type==="array"?[]:{},u!=null&&(i[n]=u)}}return i},l.ax=li,l.ay=cs,l.az=Kn,l.b=function(i,e){const n=new Blob([new Uint8Array(i)],{type:"image/png"});createImageBitmap(n).then(s=>{e(null,s)}).catch(s=>{e(new Error(`Could not load image because of ${s.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})},l.b0=xn,l.b1=function(i,e){var n=i[0],s=i[1],u=i[2],f=i[3],_=i[4],v=i[5],T=i[6],P=i[7],C=i[8],D=i[9],O=i[10],Z=i[11],j=i[12],H=i[13],te=i[14],oe=i[15],de=e[0],ae=e[1],me=e[2],be=e[3],Ee=e[4],qe=e[5],it=e[6],$e=e[7],Ze=e[8],Ne=e[9],We=e[10],Ue=e[11],De=e[12],ht=e[13],st=e[14],Gt=e[15];return Math.abs(n-de)<=ir*Math.max(1,Math.abs(n),Math.abs(de))&&Math.abs(s-ae)<=ir*Math.max(1,Math.abs(s),Math.abs(ae))&&Math.abs(u-me)<=ir*Math.max(1,Math.abs(u),Math.abs(me))&&Math.abs(f-be)<=ir*Math.max(1,Math.abs(f),Math.abs(be))&&Math.abs(_-Ee)<=ir*Math.max(1,Math.abs(_),Math.abs(Ee))&&Math.abs(v-qe)<=ir*Math.max(1,Math.abs(v),Math.abs(qe))&&Math.abs(T-it)<=ir*Math.max(1,Math.abs(T),Math.abs(it))&&Math.abs(P-$e)<=ir*Math.max(1,Math.abs(P),Math.abs($e))&&Math.abs(C-Ze)<=ir*Math.max(1,Math.abs(C),Math.abs(Ze))&&Math.abs(D-Ne)<=ir*Math.max(1,Math.abs(D),Math.abs(Ne))&&Math.abs(O-We)<=ir*Math.max(1,Math.abs(O),Math.abs(We))&&Math.abs(Z-Ue)<=ir*Math.max(1,Math.abs(Z),Math.abs(Ue))&&Math.abs(j-De)<=ir*Math.max(1,Math.abs(j),Math.abs(De))&&Math.abs(H-ht)<=ir*Math.max(1,Math.abs(H),Math.abs(ht))&&Math.abs(te-st)<=ir*Math.max(1,Math.abs(te),Math.abs(st))&&Math.abs(oe-Gt)<=ir*Math.max(1,Math.abs(oe),Math.abs(Gt))},l.b2=function(i,e){return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i},l.b3=function(i,e,n){return i[0]=e[0]*n[0],i[1]=e[1]*n[1],i[2]=e[2]*n[2],i[3]=e[3]*n[3],i},l.b4=function(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]+i[3]*e[3]},l.b5=Qe,l.b6=Sd,l.b7=bd,l.b8=function(i,e,n,s,u){var f,_=1/Math.tan(e/2);return i[0]=_/n,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=_,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[11]=-1,i[12]=0,i[13]=0,i[15]=0,u!=null&&u!==1/0?(i[10]=(u+s)*(f=1/(s-u)),i[14]=2*u*s*f):(i[10]=-1,i[14]=-2*s),i},l.b9=function(i,e,n){var s=Math.sin(n),u=Math.cos(n),f=e[4],_=e[5],v=e[6],T=e[7],P=e[8],C=e[9],D=e[10],O=e[11];return e!==i&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=f*u+P*s,i[5]=_*u+C*s,i[6]=v*u+D*s,i[7]=T*u+O*s,i[8]=P*u-f*s,i[9]=C*u-_*s,i[10]=D*u-v*s,i[11]=O*u-T*s,i},l.bA=ge,l.bB=Xh,l.bC=ra,l.bD=V,l.ba=fi,l.bb=Xe,l.bc=function(i,e){return i[0]=e[0],i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=e[1],i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=e[2],i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},l.bd=class extends jo{}
vendor: 4,972 bytes, line 9
9,l.be=Eu,l.bf=wd,l.bg=E_,l.bi=mn,l.bj=function(i,e,n=!1){if(vn===ha||vn===da||vn===Ba)throw new Error("setRTLTextPlugin cannot be called multiple times.");uo=Vt.resolveURL(i),vn=ha,pa=e,c(),n||M()},l.bk=S,l.bl=function(i,e){const n={};for(let u=0;u<i.length;u++){const f=e&&e[i[u].id]||as(i[u]);e&&(e[i[u].id]=f);let _=n[f];_||(_=n[f]=[]),_.push(i[u])}const s=[];for(const u in n)s.push(n[u]);return s},l.bm=He,l.bn=Pd,l.bo=Ld,l.bp=od,l.bq=function(i){i.bucket.createArrays(),i.bucket.tilePixelRatio=Ji/(512*i.bucket.overscaling),i.bucket.compareText={},i.bucket.iconsNeedLinear=!1;const e=i.bucket.layers[0],n=e.layout,s=e._unevaluatedLayout._values,u={layoutIconSize:s["icon-size"].possiblyEvaluate(new ne(i.bucket.zoom+1),i.canonical),layoutTextSize:s["text-size"].possiblyEvaluate(new ne(i.bucket.zoom+1),i.canonical),textMaxSize:s["text-size"].possiblyEvaluate(new ne(18))};if(i.bucket.textSizeData.kind==="composite"){const{minZoom:P,maxZoom:C}=i.bucket.textSizeData;u.compositeTextSizes=[s["text-size"].possiblyEvaluate(new ne(P),i.canonical),s["text-size"].possiblyEvaluate(new ne(C),i.canonical)]}if(i.bucket.iconSizeData.kind==="composite"){const{minZoom:P,maxZoom:C}=i.bucket.iconSizeData;u.compositeIconSizes=[s["icon-size"].possiblyEvaluate(new ne(P),i.canonical),s["icon-size"].possiblyEvaluate(new ne(C),i.canonical)]}const f=n.get("text-line-height")*on,_=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point",v=n.get("text-keep-upright"),T=n.get("text-size");for(const P of i.bucket.features){const C=n.get("text-font").evaluate(P,{},i.canonical).join(","),D=T.evaluate(P,{},i.canonical),O=u.layoutTextSize.evaluate(P,{},i.canonical),Z=u.layoutIconSize.evaluate(P,{},i.canonical),j={horizontal:{},vertical:void 0},H=P.text;let te,oe=[0,0];if(H){const me=H.toString(),be=n.get("text-letter-spacing").evaluate(P,{},i.canonical)*on,Ee=Zo(me)?be:0,qe=n.get("text-anchor").evaluate(P,{},i.canonical),it=Ud(e,P,i.canonical);if(!it){const Ue=n.get("text-radial-offset").evaluate(P,{},i.canonical);oe=Ue?Nd(qe,[Ue*on,ku]):n.get("text-offset").evaluate(P,{},i.canonical).map(De=>De*on)}let $e=_?"center":n.get("text-justify").evaluate(P,{},i.canonical);const Ze=n.get("symbol-placement"),Ne=Ze==="point"?n.get("text-max-width").evaluate(P,{},i.canonical)*on:0,We=()=>{i.bucket.allowVerticalPlacement&&us(me)&&(j.vertical=xc(H,i.glyphMap,i.glyphPositions,i.imagePositions,C,Ne,f,qe,"left",Ee,oe,l.ai.vertical,!0,Ze,O,D))};if(!_&&it){const Ue=new Set;if($e==="auto")for(let ht=0;ht<it.values.length;ht+=2)Ue.add(zu(it.values[ht]));else Ue.add($e);let De=!1;for(const ht of Ue)if(!j.horizontal[ht])if(De)j.horizontal[ht]=j.horizontal[0];else{const st=xc(H,i.glyphMap,i.glyphPositions,i.imagePositions,C,Ne,f,"center",ht,Ee,oe,l.ai.horizontal,!1,Ze,O,D);st&&(j.horizontal[ht]=st,De=st.positionedLines.length===1)}We()}else{$e==="auto"&&($e=zu(qe));const Ue=xc(H,i.glyphMap,i.glyphPositions,i.imagePositions,C,Ne,f,qe,$e,Ee,oe,l.ai.horizontal,!1,Ze,O,D);Ue&&(j.horizontal[$e]=Ue),We(),us(me)&&_&&v&&(j.vertical=xc(H,i.glyphMap,i.glyphPositions,i.imagePositions,C,Ne,f,qe,$e,Ee,oe,l.ai.vertical,!1,Ze,O,D))}}let de=!1;if(P.icon&&P.icon.name){const me=i.imageMap[P.icon.name];me&&(te=u_(i.imagePositions[P.icon.name],n.get("icon-offset").evaluate(P,{},i.canonical),n.get("icon-anchor").evaluate(P,{},i.canonical)),de=!!me.sdf,i.bucket.sdfIcons===void 0?i.bucket.sdfIcons=de:i.bucket.sdfIcons!==de&&ft("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(me.pixelRatio!==i.bucket.pixelRatio||n.get("icon-rotate").constantOr(1)!==0)&&(i.bucket.iconsNeedLinear=!0))}const ae=Zd(j.horizontal)||j.vertical;i.bucket.iconsInText=!!ae&&ae.iconsInText,(ae||te)&&I_(i.bucket,P,j,te,i.imageMap,u,O,Z,oe,de,i.canonical)}i.showCollisionBoxes&&i.bucket.generateCollisionDebugBuffers()},l.br=gu,l.bs=fu,l.bt=_u,l.bu=class{constructor(i){this._marks={start:[i.url,"start"].join("#"),end:[i.url,"end"].join("#"),measure:i.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let i=performance.getEntriesByName(this._marks.measure);return i.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),i=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),i}},l.bv=vu,l.bw=ga,l.bx=function(i,e,n,s,u){return se(this,void 0,void 0,function*(){if(Dt())try{return yield Mt(i,e,n,s,u)}catch(f){}return function(f,_,v,T,P){const C=f.width,D=f.height;ci&&Lt||(ci=new OffscreenCanvas(C,D),Lt=ci.getContext("2d",{willReadFrequently:!0})),ci.width=C,ci.height=D,Lt.drawImage(f,0,0,C,D);const O=Lt.getImageData(_,v,T,P);return Lt.clearRect(0,0,C,D),O.data}(i,e,n,s,u)})},l.by=Ad,l.bz=X,l.c=Tn,l.d=function(i,e){const n=new Image;n.onload=()=>{e(null,n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame(()=>{n.src=mt})},n.onerror=()=>
9e(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 s=new Blob([new Uint8Array(i)],{type:"image/png"});n.src=i.byteLength?URL.createObjectURL(s):mt},l.e=at,l.f=function(i,e){return Xn(at(i,{type:"json"}),e)},l.g=Sn,l.h=Vt,l.i=ni,l.j=ar,l.k=vr,l.l=So,l.m=Xn,l.n=function(i){return new vu(i).readFields(r_,[])},l.o=function(i,e,n){if(!i.length)return n(null,[]);let s=i.length;const u=new Array(i.length);let f=null;i.forEach((_,v)=>{e(_,(T,P)=>{T&&(f=T),u[v]=P,--s==0&&n(f,u)})})},l.p=rd,l.q=ql,l.r=ji,l.s=kr,l.t=Ol,l.u=je,l.v=Pe,l.w=ft,l.x=Zr,l.y=Ir,l.z=function([i,e,n]){return e+=90,e*=Math.PI/180,n*=Math.PI/180,{x:i*Math.cos(e)*Math.sin(n),y:i*Math.sin(e)*Math.sin(n),z:i*Math.cos(n)}}}),N(["./shared"],function(l){class se{constructor(B){this.keyCache={},B&&this.replace(B)}replace(B){this._layerConfigs={},this._layers={},this.update(B,[])}update(B,F){for(const Q of B){this._layerConfigs[Q.id]=Q;const ee=this._layers[Q.id]=l.aC(Q);ee._featureFilter=l.a6(ee.filter),this.keyCache[Q.id]&&delete this.keyCache[Q.id]}for(const Q of F)delete this.keyCache[Q],delete this._layerConfigs[Q],delete this._layers[Q];this.familiesBySource={};const q=l.bl(Object.values(this._layerConfigs),this.keyCache);for(const Q of q){const ee=Q.map(_e=>this._layers[_e.id]),fe=ee[0];if(fe.visibility==="none")continue;const le=fe.source||"";let re=this.familiesBySource[le];re||(re=this.familiesBySource[le]={});const ue=fe.sourceLayer||"_geojsonTileLayer";let Ae=re[ue];Ae||(Ae=re[ue]=[]),Ae.push(ee)}}}class X{constructor(B){const F={},q=[];for(const le in B){const re=B[le],ue=F[le]={};for(const Ae in re){const _e=re[+Ae];if(!_e||_e.bitmap.width===0||_e.bitmap.height===0)continue;const Le={x:0,y:0,w:_e.bitmap.width+2,h:_e.bitmap.height+2};q.push(Le),ue[Ae]={rect:Le,metrics:_e.metrics}}}const{w:Q,h:ee}=l.p(q),fe=new l.q({width:Q||1,height:ee||1});for(const le in B){const re=B[le];for(const ue in re){const Ae=re[+ue];if(!Ae||Ae.bitmap.width===0||Ae.bitmap.height===0)continue;const _e=F[le][ue].rect;l.q.copy(Ae.bitmap,fe,{x:0,y:0},{x:_e.x+1,y:_e.y+1},Ae.bitmap)}}this.image=fe,this.positions=F}}l.bm("GlyphAtlas",X);class ge{constructor(B){this.tileID=new l.O(B.tileID.overscaledZ,B.tileID.wrap,B.tileID.canonical.z,B.tileID.canonical.x,B.tileID.canonical.y),this.uid=B.uid,this.zoom=B.zoom,this.pixelRatio=B.pixelRatio,this.tileSize=B.tileSize,this.source=B.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=B.showCollisionBoxes,this.collectResourceTiming=!!B.collectResourceTiming,this.returnDependencies=!!B.returnDependencies,this.promoteId=B.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(B,F,q,Q,ee){this.status="parsing",this.data=B,this.collisionBoxArray=new l.a3;const fe=new l.bn(Object.keys(B.layers).sort()),le=new l.bo(this.tileID,this.promoteId);le.bucketLayerIDs=[];const re={},ue={featureIndex:le,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:q},Ae=F.familiesBySource[this.source];for(const ri in Ae){const ti=B.layers[ri];if(!ti)continue;ti.version===1&&l.w(`Vector tile source "${this.source}" layer "${ri}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const pn=fe.encode(ri),Ti=[];for(let Vi=0;Vi<ti.length;Vi++){const en=ti.feature(Vi),_n=le.getId(en,ri);Ti.push({feature:en,id:_n,index:Vi,sourceLayerIndex:pn})}for(const Vi of Ae[ri]){const en=Vi[0];en.source!==this.source&&l.w(`layer.source = ${en.source} does not equal this.source = ${this.source}`),en.minzoom&&this.zoom<Math.floor(en.minzoom)||en.maxzoom&&this.zoom>=en.maxzoom||en.visibility!=="none"&&(ve(Vi,this.zoom,q),(re[en.id]=en.createBucket({index:le.bucketLayerIDs.length,layers:Vi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:pn,sourceID:this.source})).populate(Ti,ue,this.tileID.canonical),le.bucketLayerIDs.push(Vi.map(_n=>_n.id)))}}let _e,Le,lt,vt;const Ye=l.aH(ue.glyphDependencies,ri=>Object.keys(ri).map(Number));
9this.inFlightDependencies.forEach(ri=>ri==null?void 0:ri.cancel()),this.inFlightDependencies=[];const ct=++this.dependencySentinel;Object.keys(Ye).length?this.inFlightDependencies.push(Q.send("getGlyphs",{uid:this.uid,stacks:Ye,source:this.source,tileID:this.tileID,type:"glyphs"},(ri,ti)=>{ct===this.dependencySentinel&&(_e||(_e=ri,Le=ti,mi.call(this)))})):Le={};const St=Object.keys(ue.iconDependencies);St.length?this.inFlightDependencies.push(Q.send("getImages",{icons:St,source:this.source,tileID:this.tileID,type:"icons"},(ri,ti)=>{ct===this.dependencySentinel&&(_e||(_e=ri,lt=ti,mi.call(this)))})):lt={};const ei=Object.keys(ue.patternDependencies);function mi(){if(_e)return ee(_e);if(Le&&lt&&vt){const ri=new X(Le),ti=new l.bp(lt,vt);for(const pn in re){const Ti=re[pn];Ti instanceof l.a4?(ve(Ti.layers,this.zoom,q),l.bq({bucket:Ti,glyphMap:Le,glyphPositions:ri.positions,imageMap:lt,imagePositions:ti.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Ti.hasPattern&&(Ti instanceof l.br||Ti instanceof l.bs||Ti instanceof l.bt)&&(ve(Ti.layers,this.zoom,q),Ti.addFeatures(ue,this.tileID.canonical,ti.patternPositions))}this.status="done",ee(null,{buckets:Object.values(re).filter(pn=>!pn.isEmpty()),featureIndex:le,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:ri.image,imageAtlas:ti,glyphMap:this.returnDependencies?Le:null,iconMap:this.returnDependencies?lt:null,glyphPositions:this.returnDependencies?ri.positions:null})}}ei.length?this.inFlightDependencies.push(Q.send("getImages",{icons:ei,source:this.source,tileID:this.tileID,type:"patterns"},(ri,ti)=>{ct===this.dependencySentinel&&(_e||(_e=ri,vt=ti,mi.call(this)))})):vt={},mi.call(this)}}function ve(Y,B,F){const q=new l.a8(B);for(const Q of Y)Q.recalculate(q,F)}function pe(Y,B){const F=l.l(Y.request,(q,Q,ee,fe)=>{if(q)B(q);else if(Q)try{const le=new l.bw.VectorTile(new l.bv(Q));B(null,{vectorTile:le,rawData:Q,cacheControl:ee,expires:fe})}catch(le){const re=new Uint8Array(Q);let ue=`Unable to parse the tile at ${Y.request.url}, `;ue+=re[0]===31&&re[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${le.messge}`,B(new Error(ue))}});return()=>{F.cancel(),B()}}class Re{constructor(B,F,q,Q){this.actor=B,this.layerIndex=F,this.availableImages=q,this.loadVectorData=Q||pe,this.fetching={},this.loading={},this.loaded={}}loadTile(B,F){const q=B.uid;this.loading||(this.loading={});const Q=!!(B&&B.request&&B.request.collectResourceTiming)&&new l.bu(B.request),ee=this.loading[q]=new ge(B);ee.abort=this.loadVectorData(B,(fe,le)=>{if(delete this.loading[q],fe||!le)return ee.status="done",this.loaded[q]=ee,F(fe);const re=le.rawData,ue={};le.expires&&(ue.expires=le.expires),le.cacheControl&&(ue.cacheControl=le.cacheControl);const Ae={};if(Q){const _e=Q.finish();_e&&(Ae.resourceTiming=JSON.parse(JSON.stringify(_e)))}ee.vectorTile=le.vectorTile,ee.parse(le.vectorTile,this.layerIndex,this.availableImages,this.actor,(_e,Le)=>{if(delete this.fetching[q],_e||!Le)return F(_e);F(null,l.e({rawTileData:re.slice(0)},Le,ue,Ae))}),this.loaded=this.loaded||{},this.loaded[q]=ee,this.fetching[q]={rawTileData:re,cacheControl:ue,resourceTiming:Ae}})}reloadTile(B,F){const q=this.loaded,Q=B.uid;if(q&&q[Q]){const ee=q[Q];ee.showCollisionBoxes=B.showCollisionBoxes,ee.status==="parsing"?ee.parse(ee.vectorTile,this.layerIndex,this.availableImages,this.actor,(fe,le)=>{if(fe||!le)return F(fe,le);let re;if(this.fetching[Q]){const{rawTileData:ue,cacheControl:Ae,resourceTiming:_e}=this.fetching[Q];delete this.fetching[Q],re=l.e({rawTileData:ue.slice(0)},le,Ae,_e)}else re=le;F(null,re)}):ee.status==="done"&&(ee.vectorTile?ee.parse(ee.vectorTile,this.layerIndex,this.availableImages,this.actor,F):F())}}abortTile(B,F){const q=this.loading,Q=B.uid;q&&q[Q]&&q[Q].abort&&(q[Q].abort(),delete q[Q]),F()}removeTile(B,F){const q=this.loaded,Q=B.uid;q&&q[Q]&&delete q[Q],F()}}class ut{constructor(){this.loaded={}}loadTile(B,F){return l._(this,void 0,void 0,function*(){const{uid:q,encoding:Q,rawImageData:ee,redFactor:fe,greenFactor:le,blueFactor:re,baseShift:ue}=B,Ae=ee.width+2,_e=ee.height+2,Le=l.a(ee)?new l.R({width:Ae,height:_e},yield l.bx(ee,-1,-1,Ae,_e)):ee,lt=new l.by(q,Le,Q,fe,le,re,ue);this.loaded=this.loaded||{},this.loaded[q]=lt,F(null,lt)})}removeTile(B){const F=this.loaded,q=B.uid;F&&F[q]&&delete F[q]}}function ze(Y,B){if(Y.length!==0){Tt(Y[0],B);for(var F=1;F<Y.length;F++)Tt(Y[F],!B)}}function Tt(Y,B){for(var F=0,q=0,Q=0,ee=Y.length,fe=ee-1;Q<ee;fe=Q++){var le=(Y[Q][0]-Y[fe][0])*(Y[fe][1]+Y[Q][1]),re=F+le;q+=Math.abs(F)>=Math.abs(le)?F-re+le:le-re+F,F=re}F+q>=0!=!!B&&Y.reverse()}var pt=l.bz(function Y(B,F){var q,Q=B&&B.type;if(Q==="FeatureCollection")for(q=0;q<B.features.length;q++)Y(B.features[q],F);else if(Q==="GeometryCollection")for(q=0;q<B.geometries.length;q++)Y(B.geometries[q],F);else if(Q==="Feature")Y(B.geometry,F);else if(Q==="Polygon")ze(B.coordinates,F);else if(Q==="MultiPolygon")for(q=0;q<B.coordinates.length;q++)ze(B.coordinates[q],F);return B});
vendor: 5,774 bytes, line 9
9const zt=l.bw.VectorTileFeature.prototype.toGeoJSON;var Dt={exports:{}},fi=l.bA,Xe=l.bw.VectorTileFeature,_t=Qe;function Qe(Y,B){this.options=B||{},this.features=Y,this.length=Y.length}function at(Y,B){this.id=typeof Y.id=="number"?Y.id:void 0,this.type=Y.type,this.rawGeometry=Y.type===1?[Y.geometry]:Y.geometry,this.properties=Y.tags,this.extent=B||4096}Qe.prototype.feature=function(Y){return new at(this.features[Y],this.options.extent)},at.prototype.loadGeometry=function(){var Y=this.rawGeometry;this.geometry=[];for(var B=0;B<Y.length;B++){for(var F=Y[B],q=[],Q=0;Q<F.length;Q++)q.push(new fi(F[Q][0],F[Q][1]));this.geometry.push(q)}return this.geometry},at.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Y=this.geometry,B=1/0,F=-1/0,q=1/0,Q=-1/0,ee=0;ee<Y.length;ee++)for(var fe=Y[ee],le=0;le<fe.length;le++){var re=fe[le];B=Math.min(B,re.x),F=Math.max(F,re.x),q=Math.min(q,re.y),Q=Math.max(Q,re.y)}return[B,q,F,Q]},at.prototype.toGeoJSON=Xe.prototype.toGeoJSON;var yt=l.bB,nt=_t;function xt(Y){var B=new yt;return function(F,q){for(var Q in F.layers)q.writeMessage(3,rt,F.layers[Q])}(Y,B),B.finish()}function rt(Y,B){var F;B.writeVarintField(15,Y.version||1),B.writeStringField(1,Y.name||""),B.writeVarintField(5,Y.extent||4096);var q={keys:[],values:[],keycache:{},valuecache:{}};for(F=0;F<Y.length;F++)q.feature=Y.feature(F),B.writeMessage(2,Pt,q);var Q=q.keys;for(F=0;F<Q.length;F++)B.writeStringField(3,Q[F]);var ee=q.values;for(F=0;F<ee.length;F++)B.writeMessage(4,et,ee[F])}function Pt(Y,B){var F=Y.feature;F.id!==void 0&&B.writeVarintField(1,F.id),B.writeMessage(2,ft,Y),B.writeVarintField(3,F.type),B.writeMessage(4,ni,F)}function ft(Y,B){var F=Y.feature,q=Y.keys,Q=Y.values,ee=Y.keycache,fe=Y.valuecache;for(var le in F.properties){var re=F.properties[le],ue=ee[le];if(re!==null){ue===void 0&&(q.push(le),ee[le]=ue=q.length-1),B.writeVarint(ue);var Ae=typeof re;Ae!=="string"&&Ae!=="boolean"&&Ae!=="number"&&(re=JSON.stringify(re));var _e=Ae+":"+re,Le=fe[_e];Le===void 0&&(Q.push(re),fe[_e]=Le=Q.length-1),B.writeVarint(Le)}}}function Ut(Y,B){return(B<<3)+(7&Y)}function Ct(Y){return Y<<1^Y>>31}function ni(Y,B){for(var F=Y.loadGeometry(),q=Y.type,Q=0,ee=0,fe=F.length,le=0;le<fe;le++){var re=F[le],ue=1;q===1&&(ue=re.length),B.writeVarint(Ut(1,ue));for(var Ae=q===3?re.length-1:re.length,_e=0;_e<Ae;_e++){_e===1&&q!==1&&B.writeVarint(Ut(2,Ae-1));var Le=re[_e].x-Q,lt=re[_e].y-ee;B.writeVarint(Ct(Le)),B.writeVarint(Ct(lt)),Q+=Le,ee+=lt}q===3&&B.writeVarint(Ut(7,1))}}function et(Y,B){var F=typeof Y;F==="string"?B.writeStringField(1,Y):F==="boolean"?B.writeBooleanField(7,Y):F==="number"&&(Y%1!=0?B.writeDoubleField(3,Y):Y<0?B.writeSVarintField(6,Y):B.writeVarintField(5,Y))}Dt.exports=xt,Dt.exports.fromVectorTileJs=xt,Dt.exports.fromGeojsonVt=function(Y,B){B=B||{};var F={};for(var q in Y)F[q]=new nt(Y[q].features,B),F[q].name=q,F[q].version=B.version,F[q].extent=B.extent;return xt({layers:F})},Dt.exports.GeoJSONWrapper=nt;var Ui=l.bz(Dt.exports);const mt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:Y=>Y},Mt=Math.fround||(ci=new Float32Array(1),Y=>(ci[0]=+Y,ci[0]));var ci;const Lt=3,$t=5,qt=6;class Vt{constructor(B){this.options=Object.assign(Object.create(mt),B),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(B){const{log:F,minZoom:q,maxZoom:Q}=this.options;F&&console.time("total time");const ee=`prepare ${B.length} points`;F&&console.time(ee),this.points=B;const fe=[];for(let re=0;re<B.length;re++){const ue=B[re];if(!ue.geometry)continue;const[Ae,_e]=ue.geometry.coordinates,Le=Mt(Kn(Ae)),lt=Mt(Sn(_e));fe.push(Le,lt,1/0,re,-1,1),this.options.reduce&&fe.push(0)}let le=this.trees[Q+1]=this._createTree(fe);F&&console.timeEnd(ee);for(let re=Q;re>=q;re--){const ue=+Date.now();le=this.trees[re]=this._createTree(this._cluster(le,re)),F&&console.log("z%d: %d clusters in %dms",re,le.numItems,+Date.now()-ue)}return F&&console.timeEnd("total time"),this}getClusters(B,F){let q=((B[0]+180)%360+360)%360-180;const Q=Math.max(-90,Math.min(90,B[1]));let ee=B[2]===180?180:((B[2]+180)%360+360)%360-180;const fe=Math.max(-90,Math.min(90,B[3]));if(B[2]-B[0]>=360)q=-180,ee=180;else if(q>ee){const _e=this.getClusters([q,Q,180,fe],F),Le=this.getClusters([-180,Q,ee,fe],F);return _e.concat(Le)}const le=this.trees[this._limitZoom(F)],re=le.range(Kn(q),Sn(fe),Kn(ee),Sn(Q)),ue=le.data,Ae=[];for(const _e of re){const Le=this.stride*_e;Ae.push(ue[Le+$t]>1?Tn(ue,Le,this.clusterProps):this.points[ue[Le+Lt]])}return Ae}getChildren(B){const F=this._getOriginId(B),q=this._getOriginZoom(B),Q="No cluster with the specified id.",ee=this.trees[q];if(!ee)throw new Error(Q);const fe=ee.data;if(F*this.stride>=fe.length)throw new Error(Q);const le=this.options.radius/(this.options.extent*Math.pow(2,q-1)),re=ee.within(fe[F*this.stride],fe[F*this.stride+1],le),ue=[];for(const Ae of re){const _e=Ae*this.stride;fe[_e+4]===B&&ue.push(fe[_e+$t]>1?Tn(fe,_e,this.clusterProps):this.points[fe[_e+Lt]])}if(ue.length===0)throw new Error(Q);return ue}getLeaves(B,F,q){const Q=[];return this._appendLeaves(Q,B,F=F||10,q=q||0,0),Q}getTile(B,F,q){const Q=this.trees[this._limitZoom(B)],ee=Math.pow(2,B),{extent:fe,radius:le}=this.options,re=le/fe,ue=(q-re)/ee,Ae=(q+1+re)/ee,_e={features:[]};return this._addTileFeatures(Q.range((F-re)/ee,ue,(F+1+re)/ee,Ae),Q.data,F,q,ee,_e),F===0&&this._addTileFeatures(Q.range(1-re/ee,ue,1,Ae),Q.data,ee,q,ee,_e),F===ee-1&&this._addTileFeatures(Q.range(0,ue,re/ee,Ae),Q.data,-1,q,ee,_e),_e.features.length?_e:null}getClusterExpansionZoom(B){let F=this._getOriginZoom(B)-1;for(;F<=this.options.maxZoom;){const q=this.getChildren(B);if(F++,q.length!==1)break;B=q[0].properties.cluster_id}return F}
9_appendLeaves(B,F,q,Q,ee){const fe=this.getChildren(F);for(const le of fe){const re=le.properties;if(re&&re.cluster?ee+re.point_count<=Q?ee+=re.point_count:ee=this._appendLeaves(B,re.cluster_id,q,Q,ee):ee<Q?ee++:B.push(le),B.length===q)break}return ee}_createTree(B){const F=new l.av(B.length/this.stride|0,this.options.nodeSize,Float32Array);for(let q=0;q<B.length;q+=this.stride)F.add(B[q],B[q+1]);return F.finish(),F.data=B,F}_addTileFeatures(B,F,q,Q,ee,fe){for(const le of B){const re=le*this.stride,ue=F[re+$t]>1;let Ae,_e,Le;if(ue)Ae=mn(F,re,this.clusterProps),_e=F[re],Le=F[re+1];else{const Ye=this.points[F[re+Lt]];Ae=Ye.properties;const[ct,St]=Ye.geometry.coordinates;_e=Kn(ct),Le=Sn(St)}const lt={type:1,geometry:[[Math.round(this.options.extent*(_e*ee-q)),Math.round(this.options.extent*(Le*ee-Q))]],tags:Ae};let vt;vt=ue||this.options.generateId?F[re+Lt]:this.points[F[re+Lt]].id,vt!==void 0&&(lt.id=vt),fe.features.push(lt)}}_limitZoom(B){return Math.max(this.options.minZoom,Math.min(Math.floor(+B),this.options.maxZoom+1))}_cluster(B,F){const{radius:q,extent:Q,reduce:ee,minPoints:fe}=this.options,le=q/(Q*Math.pow(2,F)),re=B.data,ue=[],Ae=this.stride;for(let _e=0;_e<re.length;_e+=Ae){if(re[_e+2]<=F)continue;re[_e+2]=F;const Le=re[_e],lt=re[_e+1],vt=B.within(re[_e],re[_e+1],le),Ye=re[_e+$t];let ct=Ye;for(const St of vt){const ei=St*Ae;re[ei+2]>F&&(ct+=re[ei+$t])}if(ct>Ye&&ct>=fe){let St,ei=Le*Ye,mi=lt*Ye,ri=-1;const ti=((_e/Ae|0)<<5)+(F+1)+this.points.length;for(const pn of vt){const Ti=pn*Ae;if(re[Ti+2]<=F)continue;re[Ti+2]=F;const Vi=re[Ti+$t];ei+=re[Ti]*Vi,mi+=re[Ti+1]*Vi,re[Ti+4]=ti,ee&&(St||(St=this._map(re,_e,!0),ri=this.clusterProps.length,this.clusterProps.push(St)),ee(St,this._map(re,Ti)))}re[_e+4]=ti,ue.push(ei/ct,mi/ct,1/0,ti,-1,ct),ee&&ue.push(ri)}else{for(let St=0;St<Ae;St++)ue.push(re[_e+St]);if(ct>1)for(const St of vt){const ei=St*Ae;if(!(re[ei+2]<=F)){re[ei+2]=F;for(let mi=0;mi<Ae;mi++)ue.push(re[ei+mi])}}}}return ue}_getOriginId(B){return B-this.points.length>>5}_getOriginZoom(B){return(B-this.points.length)%32}_map(B,F,q){if(B[F+$t]>1){const fe=this.clusterProps[B[F+qt]];return q?Object.assign({},fe):fe}const Q=this.points[B[F+Lt]].properties,ee=this.options.map(Q);return q&&ee===Q?Object.assign({},ee):ee}}function Tn(Y,B,F){return{type:"Feature",id:Y[B+Lt],properties:mn(Y,B,F),geometry:{type:"Point",coordinates:[(q=Y[B],360*(q-.5)),To(Y[B+1])]}};var q}function mn(Y,B,F){const q=Y[B+$t],Q=q>=1e4?`${Math.round(q/1e3)}k`:q>=1e3?Math.round(q/100)/10+"k":q,ee=Y[B+qt],fe=ee===-1?{}:Object.assign({},F[ee]);return Object.assign(fe,{cluster:!0,cluster_id:Y[B+Lt],point_count:q,point_count_abbreviated:Q})}function Kn(Y){return Y/360+.5}function Sn(Y){const B=Math.sin(Y*Math.PI/180),F=.5-.25*Math.log((1+B)/(1-B))/Math.PI;return F<0?0:F>1?1:F}function To(Y){const B=(180-360*Y)*Math.PI/180;return 360*Math.atan(Math.exp(B))/Math.PI-90}function Xn(Y,B,F,q){for(var Q,ee=q,fe=F-B>>1,le=F-B,re=Y[B],ue=Y[B+1],Ae=Y[F],_e=Y[F+1],Le=B+3;Le<F;Le+=3){var lt=So(Y[Le],Y[Le+1],re,ue,Ae,_e);if(lt>ee)Q=Le,ee=lt;else if(lt===ee){var vt=Math.abs(Le-fe);vt<le&&(Q=Le,le=vt)}}ee>q&&(Q-B>3&&Xn(Y,B,Q,q),Y[Q+2]=ee,F-Q>3&&Xn(Y,Q,F,q))}function So(Y,B,F,q,Q,ee){var fe=Q-F,le=ee-q;if(fe!==0||le!==0){var re=((Y-F)*fe+(B-q)*le)/(fe*fe+le*le);re>1?(F=Q,q=ee):re>0&&(F+=fe*re,q+=le*re)}return(fe=Y-F)*fe+(le=B-q)*le}function kr(Y,B,F,q){var Q={id:Y===void 0?null:Y,type:B,geometry:F,tags:q,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(ee){var fe=ee.geometry,le=ee.type;if(le==="Point"||le==="MultiPoint"||le==="LineString")Ao(ee,fe);else if(le==="Polygon"||le==="MultiLineString")for(var re=0;re<fe.length;re++)Ao(ee,fe[re]);else if(le==="MultiPolygon")for(re=0;re<fe.length;re++)for(var ue=0;ue<fe[re].length;ue++)Ao(ee,fe[re][ue])}(Q),Q}function Ao(Y,B){for(var F=0;F<B.length;F+=3)Y.minX=Math.min(Y.minX,B[F]),Y.minY=Math.min(Y.minY,B[F+1]),Y.maxX=Math.max(Y.maxX,B[F]),Y.maxY=Math.max(Y.maxY,B[F+1])}function Jr(Y,B,F,q){if(B.geometry){var Q=B.geometry.coordinates,ee=B.geometry.type,fe=Math.pow(F.tolerance/((1<<F.maxZoom)*F.extent),2),le=[],re=B.id;if(F.promoteId?re=B.properties[F.promoteId]:F.generateId&&(re=q||0),ee==="Point")vr(Q,le);else if(ee==="MultiPoint")for(var ue=0;ue<Q.length;ue++)vr(Q[ue],le);else if(ee==="LineString")ar(Q,le,fe,!1);else if(ee==="MultiLineString"){if(F.lineMetrics){for(ue=0;ue<Q.length;ue++)ar(Q[ue],le=[],fe,!1),Y.push(kr(re,"LineString",le,B.properties));return}Po(Q,le,fe,!1)}
vendor: 10,125 bytes, line 9
9else if(ee==="Polygon")Po(Q,le,fe,!0);else{if(ee!=="MultiPolygon"){if(ee==="GeometryCollection"){for(ue=0;ue<B.geometry.geometries.length;ue++)Jr(Y,{id:re,geometry:B.geometry.geometries[ue],properties:B.properties},F,q);return}throw new Error("Input data is not a valid GeoJSON object.")}for(ue=0;ue<Q.length;ue++){var Ae=[];Po(Q[ue],Ae,fe,!0),le.push(Ae)}}Y.push(kr(re,ee,le,B.properties))}}function vr(Y,B){B.push(Pe(Y[0])),B.push(hn(Y[1])),B.push(0)}function ar(Y,B,F,q){for(var Q,ee,fe=0,le=0;le<Y.length;le++){var re=Pe(Y[le][0]),ue=hn(Y[le][1]);B.push(re),B.push(ue),B.push(0),le>0&&(fe+=q?(Q*ue-re*ee)/2:Math.sqrt(Math.pow(re-Q,2)+Math.pow(ue-ee,2))),Q=re,ee=ue}var Ae=B.length-3;B[2]=1,Xn(B,0,Ae,F),B[Ae+2]=1,B.size=Math.abs(fe),B.start=0,B.end=B.size}function Po(Y,B,F,q){for(var Q=0;Q<Y.length;Q++){var ee=[];ar(Y[Q],ee,F,q),B.push(ee)}}function Pe(Y){return Y/360+.5}function hn(Y){var B=Math.sin(Y*Math.PI/180),F=.5-.25*Math.log((1+B)/(1-B))/Math.PI;return F<0?0:F>1?1:F}function Bn(Y,B,F,q,Q,ee,fe,le){if(q/=B,ee>=(F/=B)&&fe<q)return Y;if(fe<F||ee>=q)return null;for(var re=[],ue=0;ue<Y.length;ue++){var Ae=Y[ue],_e=Ae.geometry,Le=Ae.type,lt=Q===0?Ae.minX:Ae.minY,vt=Q===0?Ae.maxX:Ae.maxY;if(lt>=F&&vt<q)re.push(Ae);else if(!(vt<F||lt>=q)){var Ye=[];if(Le==="Point"||Le==="MultiPoint")yi(_e,Ye,F,q,Q);else if(Le==="LineString")li(_e,Ye,F,q,Q,!1,le.lineMetrics);else if(Le==="MultiLineString")Qr(_e,Ye,F,q,Q,!1);else if(Le==="Polygon")Qr(_e,Ye,F,q,Q,!0);else if(Le==="MultiPolygon")for(var ct=0;ct<_e.length;ct++){var St=[];Qr(_e[ct],St,F,q,Q,!0),St.length&&Ye.push(St)}if(Ye.length){if(le.lineMetrics&&Le==="LineString"){for(ct=0;ct<Ye.length;ct++)re.push(kr(Ae.id,Le,Ye[ct],Ae.tags));continue}Le!=="LineString"&&Le!=="MultiLineString"||(Ye.length===1?(Le="LineString",Ye=Ye[0]):Le="MultiLineString"),Le!=="Point"&&Le!=="MultiPoint"||(Le=Ye.length===3?"Point":"MultiPoint"),re.push(kr(Ae.id,Le,Ye,Ae.tags))}}}return re.length?re:null}function yi(Y,B,F,q,Q){for(var ee=0;ee<Y.length;ee+=3){var fe=Y[ee+Q];fe>=F&&fe<=q&&(B.push(Y[ee]),B.push(Y[ee+1]),B.push(Y[ee+2]))}}function li(Y,B,F,q,Q,ee,fe){for(var le,re,ue=xr(Y),Ae=Q===0?vs:Ko,_e=Y.start,Le=0;Le<Y.length-3;Le+=3){var lt=Y[Le],vt=Y[Le+1],Ye=Y[Le+2],ct=Y[Le+3],St=Y[Le+4],ei=Q===0?lt:vt,mi=Q===0?ct:St,ri=!1;fe&&(le=Math.sqrt(Math.pow(lt-ct,2)+Math.pow(vt-St,2))),ei<F?mi>F&&(re=Ae(ue,lt,vt,ct,St,F),fe&&(ue.start=_e+le*re)):ei>q?mi<q&&(re=Ae(ue,lt,vt,ct,St,q),fe&&(ue.start=_e+le*re)):br(ue,lt,vt,Ye),mi<F&&ei>=F&&(re=Ae(ue,lt,vt,ct,St,F),ri=!0),mi>q&&ei<=q&&(re=Ae(ue,lt,vt,ct,St,q),ri=!0),!ee&&ri&&(fe&&(ue.end=_e+le*re),B.push(ue),ue=xr(Y)),fe&&(_e+=le)}var ti=Y.length-3;lt=Y[ti],vt=Y[ti+1],Ye=Y[ti+2],(ei=Q===0?lt:vt)>=F&&ei<=q&&br(ue,lt,vt,Ye),ti=ue.length-3,ee&&ti>=3&&(ue[ti]!==ue[0]||ue[ti+1]!==ue[1])&&br(ue,ue[0],ue[1],ue[2]),ue.length&&B.push(ue)}function xr(Y){var B=[];return B.size=Y.size,B.start=Y.start,B.end=Y.end,B}function Qr(Y,B,F,q,Q,ee){for(var fe=0;fe<Y.length;fe++)li(Y[fe],B,F,q,Q,ee,!1)}function br(Y,B,F,q){Y.push(B),Y.push(F),Y.push(q)}function vs(Y,B,F,q,Q,ee){var fe=(ee-B)/(q-B);return Y.push(ee),Y.push(F+(Q-F)*fe),Y.push(1),fe}function Ko(Y,B,F,q,Q,ee){var fe=(ee-F)/(Q-F);return Y.push(B+(q-B)*fe),Y.push(ee),Y.push(1),fe}function zr(Y,B){for(var F=[],q=0;q<Y.length;q++){var Q,ee=Y[q],fe=ee.type;if(fe==="Point"||fe==="MultiPoint"||fe==="LineString")Q=eo(ee.geometry,B);else if(fe==="MultiLineString"||fe==="Polygon"){Q=[];for(var le=0;le<ee.geometry.length;le++)Q.push(eo(ee.geometry[le],B))}else if(fe==="MultiPolygon")for(Q=[],le=0;le<ee.geometry.length;le++){for(var re=[],ue=0;ue<ee.geometry[le].length;ue++)re.push(eo(ee.geometry[le][ue],B));Q.push(re)}F.push(kr(ee.id,fe,Q,ee.tags))}return F}function eo(Y,B){var F=[];F.size=Y.size,Y.start!==void 0&&(F.start=Y.start,F.end=Y.end);for(var q=0;q<Y.length;q+=3)F.push(Y[q]+B,Y[q+1],Y[q+2]);return F}function Fe(Y,B){if(Y.transformed)return Y;var F,q,Q,ee=1<<Y.z,fe=Y.x,le=Y.y;for(F=0;F<Y.features.length;F++){var re=Y.features[F],ue=re.geometry,Ae=re.type;if(re.geometry=[],Ae===1)for(q=0;q<ue.length;q+=2)re.geometry.push(lr(ue[q],ue[q+1],B,ee,fe,le));else for(q=0;q<ue.length;q++){var _e=[];for(Q=0;Q<ue[q].length;Q+=2)_e.push(lr(ue[q][Q],ue[q][Q+1],B,ee,fe,le));re.geometry.push(_e)}}return Y.transformed=!0,Y}function lr(Y,B,F,q,Q,ee){return[Math.round(F*(Y*q-Q)),Math.round(F*(B*q-ee))]}function Ci(Y,B,F,q,Q){for(var ee=B===Q.maxZoom?0:Q.tolerance/((1<<B)*Q.extent),fe={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:F,y:q,z:B,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},le=0;le<Y.length;le++){fe.numFeatures++,to(fe,Y[le],ee,Q);var re=Y[le].minX,ue=Y[le].minY,Ae=Y[le].maxX,_e=Y[le].maxY;re<fe.minX&&(fe.minX=re),ue<fe.minY&&(fe.minY=ue),Ae>fe.maxX&&(fe.maxX=Ae),_e>fe.maxY&&(fe.maxY=_e)}return fe}function to(Y,B,F,q){var Q=B.geometry,ee=B.type,fe=[];if(ee==="Point"||ee==="MultiPoint")for(var le=0;le<Q.length;le+=3)fe.push(Q[le]),fe.push(Q[le+1]),Y.numPoints++,Y.numSimplified++;else if(ee==="LineString")Dr(fe,Q,Y,F,!1,!1);else if(ee==="MultiLineString"||ee==="Polygon")for(le=0;le<Q.length;le++)Dr(fe,Q[le],Y,F,ee==="Polygon",le===0);else if(ee==="MultiPolygon")for(var re=0;re<Q.length;re++){var ue=Q[re];for(le=0;le<ue.length;le++)Dr(fe,ue[le],Y,F,!0,le===0)}if(fe.length){var Ae=B.tags||null;if(ee==="LineString"&&q.lineMetrics){for(var _e in Ae={},B.tags)Ae[_e]=B.tags[_e];Ae.mapbox_clip_start=Q.start/Q.size,Ae.mapbox_clip_end=Q.end/Q.size}var Le={geometry:fe,type:ee==="Polygon"||ee==="MultiPolygon"?3:ee==="LineString"||ee==="MultiLineString"?2:1,tags:Ae};B.id!==null&&(Le.id=B.id),Y.features.push(Le)}}function Dr(Y,B,F,q,Q,ee){var fe=q*q;if(q>0&&B.size<(Q?fe:q))F.numPoints+=B.length/3;else{for(var le=[],re=0;re<B.length;re+=3)(q===0||B[re+2]>fe)&&(F.numSimplified++,le.push(B[re]),le.push(B[re+1])),F.numPoints++;Q&&function(ue,Ae){for(var _e=0,Le=0,lt=ue.length,vt=lt-2;Le<lt;vt=Le,Le+=2)_e+=(ue[Le]-ue[vt])*(ue[Le+1]+ue[vt+1]);if(_e>0===Ae)for(Le=0,lt=ue.length;Le<lt/2;Le+=2){var Ye=ue[Le],ct=ue[Le+1];ue[Le]=ue[lt-2-Le],ue[Le+1]=ue[lt-1-Le],ue[lt-2-Le]=Ye,ue[lt-1-Le]=ct}}(le,ee),Y.push(le)}}function Oe(Y,B){var F=(B=this.options=function(Q,ee){for(var fe in ee)Q[fe]=ee[fe];return Q}(Object.create(this.options),B)).debug;if(F&&console.time("preprocess data"),B.maxZoom<0||B.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(B.promoteId&&B.generateId)throw new Error("promoteId and generateId cannot be used together.");var q=function(Q,ee){var fe=[];if(Q.type==="FeatureCollection")for(var le=0;le<Q.features.length;le++)Jr(fe,Q.features[le],ee,le);else Jr(fe,Q.type==="Feature"?Q:{geometry:Q},ee);return fe}(Y,B);this.tiles={},this.tileCoords=[],F&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",B.indexMaxZoom,B.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),q=function(Q,ee){var fe=ee.buffer/ee.extent,le=Q,re=Bn(Q,1,-1-fe,fe,0,-1,2,ee),ue=Bn(Q,1,1-fe,2+fe,0,-1,2,ee);return(re||ue)&&(le=Bn(Q,1,-fe,1+fe,0,-1,2,ee)||[],re&&(le=zr(re,1).concat(le)),ue&&(le=le.concat(zr(ue,-1)))),le}(q,B),q.length&&this.splitTile(q,0,0,0),F&&(q.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 Rt(Y,B,F){return 32*((1<<Y)*F+B)+Y}function It(Y,B){return B?Y.properties[B]:Y.id}function dn(Y,B){if(Y==null)return!0;if(Y.type==="Feature")return It(Y,B)!=null;if(Y.type==="FeatureCollection"){const F=new Set;for(const q of Y.features){const Q=It(q,B);if(Q==null||F.has(Q))return!1;F.add(Q)}return!0}return!1}function cr(Y,B){const F=new Map;if(Y!=null)if(Y.type==="Feature")F.set(It(Y,B),Y);else for(const q of Y.features)F.set(It(q,B),q);return F}Oe.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Oe.prototype.splitTile=function(Y,B,F,q,Q,ee,fe){for(var le=[Y,B,F,q],re=this.options,ue=re.debug;le.length;){q=le.pop(),F=le.pop(),B=le.pop(),Y=le.pop();var Ae=1<<B,_e=Rt(B,F,q),Le=this.tiles[_e];if(!Le&&(ue>1&&console.time("creation"),Le=this.tiles[_e]=Ci(Y,B,F,q,re),this.tileCoords.push({z:B,x:F,y:q}),ue)){ue>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",B,F,q,Le.numFeatures,Le.numPoints,Le.numSimplified),console.timeEnd("creation"));var lt="z"+B;this.stats[lt]=(this.stats[lt]||0)+1,this.total++}if(Le.source=Y,Q){if(B===re.maxZoom||B===Q)continue;var vt=1<<Q-B;if(F!==Math.floor(ee/vt)||q!==Math.floor(fe/vt))continue}else if(B===re.indexMaxZoom||Le.numPoints<=re.indexMaxPoints)continue;if(Le.source=null,Y.length!==0){ue>1&&console.time("clipping");var Ye,ct,St,ei,mi,ri,ti=.5*re.buffer/re.extent,pn=.5-ti,Ti=.5+ti,Vi=1+ti;Ye=ct=St=ei=null,mi=Bn(Y,Ae,F-ti,F+Ti,0,Le.minX,Le.maxX,re),ri=Bn(Y,Ae,F+pn,F+Vi,0,Le.minX,Le.maxX,re),Y=null,mi&&(Ye=Bn(mi,Ae,q-ti,q+Ti,1,Le.minY,Le.maxY,re),ct=Bn(mi,Ae,q+pn,q+Vi,1,Le.minY,Le.maxY,re),mi=null),ri&&(St=Bn(ri,Ae,q-ti,q+Ti,1,Le.minY,Le.maxY,re),ei=Bn(ri,Ae,q+pn,q+Vi,1,Le.minY,Le.maxY,re),ri=null),ue>1&&console.timeEnd("clipping"),le.push(Ye||[],B+1,2*F,2*q),le.push(ct||[],B+1,2*F,2*q+1),le.push(St||[],B+1,2*F+1,2*q),le.push(ei||[],B+1,2*F+1,2*q+1)}}},Oe.prototype.getTile=function(Y,B,F){var q=this.options,Q=q.extent,ee=q.debug;if(Y<0||Y>24)return null;var fe=1<<Y,le=Rt(Y,B=(B%fe+fe)%fe,F);if(this.tiles[le])return Fe(this.tiles[le],Q);ee>1&&console.log("drilling down to z%d-%d-%d",Y,B,F);for(var re,ue=Y,Ae=B,_e=F;!re&&ue>0;)ue--,Ae=Math.floor(Ae/2),_e=Math.floor(_e/2),re=this.tiles[Rt(ue,Ae,_e)];return re&&re.source?(ee>1&&console.log("found parent tile z%d-%d-%d",ue,Ae,_e),ee>1&&console.time("drilling down"),this.splitTile(re.source,ue,Ae,_e,Y,B,F),ee>1&&console.timeEnd("drilling down"),this.tiles[le]?Fe(this.tiles[le],Q):null):null};class Et extends Re{constructor(B,F,q,Q){super(B,F,q),this._dataUpdateable=new Map,this.loadGeoJSON=(ee,fe)=>{const{promoteId:le}=ee;if(ee.request)return l.f(ee.request,(re,ue,Ae,_e)=>{this._dataUpdateable=dn(ue,le)?cr(ue,le):void 0,fe(re,ue,Ae,_e)});
9if(typeof ee.data=="string")try{const re=JSON.parse(ee.data);this._dataUpdateable=dn(re,le)?cr(re,le):void 0,fe(null,re)}catch(re){fe(new Error(`Input data given to '${ee.source}' is not a valid GeoJSON object.`))}else ee.dataDiff?this._dataUpdateable?(function(re,ue,Ae){var _e,Le,lt,vt;if(ue.removeAll&&re.clear(),ue.remove)for(const Ye of ue.remove)re.delete(Ye);if(ue.add)for(const Ye of ue.add){const ct=It(Ye,Ae);ct!=null&&re.set(ct,Ye)}if(ue.update)for(const Ye of ue.update){let ct=re.get(Ye.id);if(ct==null)continue;const St=!Ye.removeAllProperties&&(((_e=Ye.removeProperties)===null||_e===void 0?void 0:_e.length)>0||((Le=Ye.addOrUpdateProperties)===null||Le===void 0?void 0:Le.length)>0);if((Ye.newGeometry||Ye.removeAllProperties||St)&&(ct=Object.assign({},ct),re.set(Ye.id,ct),St&&(ct.properties=Object.assign({},ct.properties))),Ye.newGeometry&&(ct.geometry=Ye.newGeometry),Ye.removeAllProperties)ct.properties={};else if(((lt=Ye.removeProperties)===null||lt===void 0?void 0:lt.length)>0)for(const ei of Ye.removeProperties)Object.prototype.hasOwnProperty.call(ct.properties,ei)&&delete ct.properties[ei];if(((vt=Ye.addOrUpdateProperties)===null||vt===void 0?void 0:vt.length)>0)for(const{key:ei,value:mi}of Ye.addOrUpdateProperties)ct.properties[ei]=mi}}(this._dataUpdateable,ee.dataDiff,le),fe(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):fe(new Error(`Cannot update existing geojson data in ${ee.source}`)):fe(new Error(`Input data given to '${ee.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}},this.loadVectorData=this.loadGeoJSONTile,Q&&(this.loadGeoJSON=Q)}loadGeoJSONTile(B,F){const q=B.tileID.canonical;if(!this._geoJSONIndex)return F(null,null);const Q=this._geoJSONIndex.getTile(q.z,q.x,q.y);if(!Q)return F(null,null);const ee=new class{constructor(le){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.N,this.length=le.length,this._features=le}feature(le){return new class{constructor(re){this._feature=re,this.extent=l.N,this.type=re.type,this.properties=re.tags,"id"in re&&!isNaN(re.id)&&(this.id=parseInt(re.id,10))}loadGeometry(){if(this._feature.type===1){const re=[];for(const ue of this._feature.geometry)re.push([new l.P(ue[0],ue[1])]);return re}{const re=[];for(const ue of this._feature.geometry){const Ae=[];for(const _e of ue)Ae.push(new l.P(_e[0],_e[1]));re.push(Ae)}return re}}toGeoJSON(re,ue,Ae){return zt.call(this,re,ue,Ae)}}(this._features[le])}}(Q.features);let fe=Ui(ee);fe.byteOffset===0&&fe.byteLength===fe.buffer.byteLength||(fe=new Uint8Array(fe)),F(null,{vectorTile:ee,rawData:fe.buffer})}loadData(B,F){var q;(q=this._pendingRequest)===null||q===void 0||q.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const Q=!!(B&&B.request&&B.request.collectResourceTiming)&&new l.bu(B.request);this._pendingCallback=F,this._pendingRequest=this.loadGeoJSON(B,(ee,fe)=>{if(delete this._pendingCallback,delete this._pendingRequest,ee||!fe)return F(ee);if(typeof fe!="object")return F(new Error(`Input data given to '${B.source}' is not a valid GeoJSON object.`));{pt(fe,!0);try{if(B.filter){const re=l.bC(B.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(re.result==="error")throw new Error(re.value.map(Ae=>`${Ae.key}: ${Ae.message}`).join(", "));fe={type:"FeatureCollection",features:fe.features.filter(Ae=>re.value.evaluate({zoom:0},Ae))}}this._geoJSONIndex=B.cluster?new Vt(function({superclusterOptions:re,clusterProperties:ue}){if(!ue||!re)return re;const Ae={},_e={},Le={accumulated:null,zoom:0},lt={properties:null},vt=Object.keys(ue);for(const Ye of vt){const[ct,St]=ue[Ye],ei=l.bC(St),mi=l.bC(typeof ct=="string"?[ct,["accumulated"],["get",Ye]]:ct);Ae[Ye]=ei.value,_e[Ye]=mi.value}return re.map=Ye=>{lt.properties=Ye;const ct={};for(const St of vt)ct[St]=Ae[St].evaluate(Le,lt);return ct},re.reduce=(Ye,ct)=>{lt.properties=ct;for(const St of vt)Le.accumulated=Ye[St],Ye[St]=_e[St].evaluate(Le,lt)},re}(B)).load(fe.features):function(re,ue){return new Oe(re,ue)}(fe,B.geojsonVtOptions)}catch(re){return F(re)}this.loaded={};const le={};if(Q){const re=Q.finish();re&&(le.resourceTiming={},le.resourceTiming[B.source]=JSON.parse(JSON.stringify(re)))}F(null,le)}})}reloadTile(B,F){const q=this.loaded;return q&&q[B.uid]?super.reloadTile(B,F):this.loadTile(B,F)}removeSource(B,F){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),F()}getClusterExpansionZoom(B,F){try{F(null,this._geoJSONIndex.getClusterExpansionZoom(B.clusterId))}catch(q){F(q)}}getClusterChildren(B,F){try{F(null,this._geoJSONIndex.getChildren(B.clusterId))}catch(q){F(q)}}getClusterLeaves(B,F){try{F(null,this._geoJSONIndex.getLeaves(B.clusterId,B.limit,B.offset))}catch(q){F(q)}}}class Rr{constructor(B){this.self=B,this.actor=new l.C(B,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Re,geojson:Et},this.workerSources={},this.demWorkerSources={}
9,this.self.registerWorkerSource=(F,q)=>{if(this.workerSourceTypes[F])throw new Error(`Worker source with name "${F}" already registered.`);this.workerSourceTypes[F]=q},this.self.registerRTLTextPlugin=F=>{if(l.bD.isParsed())throw new Error("RTL text plugin already registered.");l.bD.applyArabicShaping=F.applyArabicShaping,l.bD.processBidirectionalText=F.processBidirectionalText,l.bD.processStyledBidirectionalText=F.processStyledBidirectionalText}}setReferrer(B,F){this.referrer=F}setImages(B,F,q){this.availableImages[B]=F;for(const Q in this.workerSources[B]){const ee=this.workerSources[B][Q];for(const fe in ee)ee[fe].availableImages=F}q()}setLayers(B,F,q){this.getLayerIndex(B).replace(F),q()}updateLayers(B,F,q){this.getLayerIndex(B).update(F.layers,F.removedIds),q()}loadTile(B,F,q){this.getWorkerSource(B,F.type,F.source).loadTile(F,q)}loadDEMTile(B,F,q){this.getDEMWorkerSource(B,F.source).loadTile(F,q)}reloadTile(B,F,q){this.getWorkerSource(B,F.type,F.source).reloadTile(F,q)}abortTile(B,F,q){this.getWorkerSource(B,F.type,F.source).abortTile(F,q)}removeTile(B,F,q){this.getWorkerSource(B,F.type,F.source).removeTile(F,q)}removeDEMTile(B,F){this.getDEMWorkerSource(B,F.source).removeTile(F)}removeSource(B,F,q){if(!this.workerSources[B]||!this.workerSources[B][F.type]||!this.workerSources[B][F.type][F.source])return;const Q=this.workerSources[B][F.type][F.source];delete this.workerSources[B][F.type][F.source],Q.removeSource!==void 0?Q.removeSource(F,q):q()}loadWorkerSource(B,F,q){try{this.self.importScripts(F.url),q()}catch(Q){q(Q.toString())}}syncRTLPluginState(B,F,q){try{l.bD.setState(F);const Q=l.bD.getPluginURL();if(l.bD.isLoaded()&&!l.bD.isParsed()&&Q!=null){this.self.importScripts(Q);const ee=l.bD.isParsed();q(ee?void 0:new Error(`RTL Text Plugin failed to import scripts from ${Q}`),ee)}}catch(Q){q(Q.toString())}}getAvailableImages(B){let F=this.availableImages[B];return F||(F=[]),F}getLayerIndex(B){let F=this.layerIndexes[B];return F||(F=this.layerIndexes[B]=new se),F}getWorkerSource(B,F,q){return this.workerSources[B]||(this.workerSources[B]={}),this.workerSources[B][F]||(this.workerSources[B][F]={}),this.workerSources[B][F][q]||(this.workerSources[B][F][q]=new this.workerSourceTypes[F]({send:(Q,ee,fe)=>{this.actor.send(Q,ee,fe,B)}},this.getLayerIndex(B),this.getAvailableImages(B))),this.workerSources[B][F][q]}getDEMWorkerSource(B,F){return this.demWorkerSources[B]||(this.demWorkerSources[B]={}),this.demWorkerSources[B][F]||(this.demWorkerSources[B][F]=new ut),this.demWorkerSources[B][F]}}return l.i()&&(self.worker=new Rr(self)),Rr}),N(["./shared"],function(l){var se="3.6.2";class X{static testProp(t){if(!X.docStyle)return t[0];for(let o=0;o<t.length;o++)if(t[o]in X.docStyle)return t[o];return t[0]}static create(t,o,a){const h=window.document.createElement(t);return o!==void 0&&(h.className=o),a&&a.appendChild(h),h}static createNS(t,o){return window.document.createElementNS(t,o)}static disableDrag(){X.docStyle&&X.selectProp&&(X.userSelect=X.docStyle[X.selectProp],X.docStyle[X.selectProp]="none")}static enableDrag(){X.docStyle&&X.selectProp&&(X.docStyle[X.selectProp]=X.userSelect)}static setTransform(t,o){t.style[X.transformProp]=o}static addEventListener(t,o,a,h={}){t.addEventListener(o,a,"passive"in h?h:h.capture)}static removeEventListener(t,o,a,h={}){t.removeEventListener(o,a,"passive"in h?h:h.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",X.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",X.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",X.suppressClickInternal,!0)},0)}static mousePos(t,o){const a=t.getBoundingClientRect();return new l.P(o.clientX-a.left-t.clientLeft,o.clientY-a.top-t.clientTop)}static touchPos(t,o){const a=t.getBoundingClientRect(),h=[];for(let m=0;m<o.length;m++)h.push(new l.P(o[m].clientX-a.left-t.clientLeft,o[m].clientY-a.top-t.clientTop));return h}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}X.docStyle=typeof window!="undefined"&&window.document&&window.document.documentElement.style,X.selectProp=X.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),X.transformProp=X.testProp(["transform","WebkitTransform"]);const ge={supported:!1,testSupport:function(d){!Re&&pe&&(ut?ze(d):ve=d)}};let ve,pe,Re=!1,ut=!1;function ze(d){const t=d.createTexture();d.bindTexture(d.TEXTURE_2D,t);try{if(d.texImage2D(d.TEXTURE_2D,0,d.RGBA,d.RGBA,d.UNSIGNED_BYTE,pe),d.isContextLost())return;ge.supported=!0}
9catch(o){}d.deleteTexture(t),Re=!0}var Tt,pt;typeof document!="undefined"&&(pe=document.createElement("img"),pe.onload=function(){ve&&ze(ve),ve=null,ut=!0},pe.onerror=function(){Re=!0,ve=null},pe.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(d){let t,o,a,h;d.resetRequestQueue=()=>{t=[],o=0,a=0,h={}},d.addThrottleControl=E=>{const k=a++;return h[k]=E,k},d.removeThrottleControl=E=>{delete h[E],w()},d.getImage=(E,k,z=!0)=>{ge.supported&&(E.headers||(E.headers={}),E.headers.accept="image/webp,*/*");const U={requestParameters:E,supportImageRefresh:z,callback:k,cancelled:!1,completed:!1,cancel:()=>{U.completed||U.cancelled||(U.cancelled=!0,U.innerRequest&&(U.innerRequest.cancel(),o--),w())}};return t.push(U),w(),U};const m=E=>{const{requestParameters:k,supportImageRefresh:z,callback:U}=E;return l.e(k,{type:"image"}),(z!==!1||l.i()||l.g(k.url)||k.headers&&!Object.keys(k.headers).reduce((K,W)=>K&&W==="accept",!0)?l.m:A)(k,(K,W,J,G)=>{x(E,U,K,W,J,G)})},x=(E,k,z,U,K,W)=>{z?k(z):U instanceof HTMLImageElement||l.a(U)?k(null,U):U&&((J,G)=>{typeof createImageBitmap=="function"?l.b(J,G):l.d(J,G)})(U,(J,G)=>{J!=null?k(J):G!=null&&k(null,G,{cacheControl:K,expires:W})}),E.cancelled||(E.completed=!0,o--,w())},w=()=>{const E=(()=>{const k=Object.keys(h);let z=!1;if(k.length>0){for(const U of k)if(z=h[U](),z)break}return z})()?l.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:l.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let k=o;k<E&&t.length>0;k++){const z=t.shift();if(z.cancelled){k--;continue}const U=m(z);o++,z.innerRequest=U}},A=(E,k)=>{const z=new Image,U=E.url;let K=!1;const W=E.credentials;return W&&W==="include"?z.crossOrigin="use-credentials":(W&&W==="same-origin"||!l.s(U))&&(z.crossOrigin="anonymous"),z.fetchPriority="high",z.onload=()=>{k(null,z),z.onerror=z.onload=null},z.onerror=()=>{K||k(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.")),z.onerror=z.onload=null},z.src=U,{cancel:()=>{K=!0,z.src=""}}}}(Tt||(Tt={})),Tt.resetRequestQueue(),function(d){d.Glyphs="Glyphs",d.Image="Image",d.Source="Source",d.SpriteImage="SpriteImage",d.SpriteJSON="SpriteJSON",d.Style="Style",d.Tile="Tile",d.Unknown="Unknown"}(pt||(pt={}));class zt{constructor(t){this._transformRequestFn=t}transformRequest(t,o){return this._transformRequestFn&&this._transformRequestFn(t,o)||{url:t}}normalizeSpriteURL(t,o,a){const h=function(m){const x=m.match(Dt);if(!x)throw new Error(`Unable to parse URL "${m}"`);return{protocol:x[1],authority:x[2],path:x[3]||"/",params:x[4]?x[4].split("&"):[]}}(t);return h.path+=`${o}${a}`,function(m){const x=m.params.length?`?${m.params.join("&")}`:"";return`${m.protocol}://${m.authority}${m.path}${x}`}(h)}setTransformRequest(t){this._transformRequestFn=t}}const Dt=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function fi(d){var t=new l.A(3);return t[0]=d[0],t[1]=d[1],t[2]=d[2],t}var Xe,_t=function(d,t,o){return d[0]=t[0]-o[0],d[1]=t[1]-o[1],d[2]=t[2]-o[2],d};Xe=new l.A(3),l.A!=Float32Array&&(Xe[0]=0,Xe[1]=0,Xe[2]=0);var Qe=function(d){var t=d[0],o=d[1];return t*t+o*o};function at(d){const t=[];if(typeof d=="string")t.push({id:"default",url:d});else if(d&&d.length>0){const o=[];for(const{id:a,url:h}of d){const m=`${a}${h}`;o.indexOf(m)===-1&&(o.push(m),t.push({id:a,url:h}))}}return t}function yt(d,t,o,a,h){if(a)return void d(a);if(h!==Object.values(t).length||h!==Object.values(o).length)return;const m={};for(const x in t){m[x]={};const w=l.h.getImageCanvasContext(o[x]),A=t[x];for(const E in A){const{width:k,height:z,x:U,y:K,sdf:W,pixelRatio:J,stretchX:G,stretchY:ce,content:xe}=A[E];m[x][E]={data:null,pixelRatio:J,sdf:W,stretchX:G,stretchY:ce,content:xe,spriteData:{width:k,height:z,x:U,y:K,context:w}}}}d(null,m)}(function(){var d=new l.A(2);l.A!=Float32Array&&(d[0]=0,d[1]=0)})();class nt{constructor(t,o,a,h){this.context=t,this.format=a,this.texture=t.gl.createTexture(),this.update(o,h)}update(t,o,a){const{width:h,height:m}=t,x=!(this.size&&this.size[0]===h&&this.size[1]===m||a),{context:w}=this,{gl:A}=w;if(this.useMipmap=!!(o&&o.useMipmap),A.bindTexture(A.TEXTURE_2D,this.texture),w.pixelStoreUnpackFlipY.set(!1),w.pixelStoreUnpack.set(1),w.pixelStoreUnpackPremultiplyAlpha.set(this.format===A.RGBA&&(!o||o.premultiply!==!1)),x)this.size=[h,m],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||l.a(t)?A.texImage2D(A.TEXTURE_2D,0,this.format,this.format,A.UNSIGNED_BYTE,t):A.texImage2D(A.TEXTURE_2D,0,this.format,h,m,0,this.format,A.UNSIGNED_BYTE,t.data);else{const{x:E,y:k}=a||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||l.a(t)?A.texSubImage2D(A.TEXTURE_2D,0,E,k,A.RGBA,A.UNSIGNED_BYTE,t):A.texSubImage2D(A.TEXTURE_2D,0,E,k,h,m,A.RGBA,A.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&A.generateMipmap(A.TEXTURE_2D)}bind(t,o,a){const{context:h}=this,{gl:m}=h;m.bindTexture(m.TEXTURE_2D,this.texture),a!==m.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(a=m.LINEAR),t!==this.filter&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,t),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,a||t),this.filter=t),o!==this.wrap&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,o),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,o),this.wrap=o)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function xt(d){const{userImage:t}=d;return!!(t&&t.render&&t.render())&&(d.data.replace(new Uint8Array(t.data.buffer)),!0)}class rt extends l.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new l.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:o,callback:a}of this.requestors)this._notify(o,a);this.requestors=[]}}getImage(t){const o=this.images[t];if(o&&!o.data&&o.spriteData){const a=o.spriteData;o.data=new l.R({width:a.width,height:a.height},a.context.getImageData(a.x,a.y,a.width,a.height).data),o.spriteData=null}return o}addImage(t,o){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);
vendor: 4,214 bytes, line 9
9this._validate(t,o)&&(this.images[t]=o)}_validate(t,o){let a=!0;const h=o.data||o.spriteData;return this._validateStretch(o.stretchX,h&&h.width)||(this.fire(new l.j(new Error(`Image "${t}" has invalid "stretchX" value`))),a=!1),this._validateStretch(o.stretchY,h&&h.height)||(this.fire(new l.j(new Error(`Image "${t}" has invalid "stretchY" value`))),a=!1),this._validateContent(o.content,o)||(this.fire(new l.j(new Error(`Image "${t}" has invalid "content" value`))),a=!1),a}_validateStretch(t,o){if(!t)return!0;let a=0;for(const h of t){if(h[0]<a||h[1]<h[0]||o<h[1])return!1;a=h[1]}return!0}_validateContent(t,o){if(!t)return!0;if(t.length!==4)return!1;const a=o.spriteData,h=a&&a.width||o.data.width,m=a&&a.height||o.data.height;return!(t[0]<0||h<t[0]||t[1]<0||m<t[1]||t[2]<0||h<t[2]||t[3]<0||m<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,o,a=!0){const h=this.getImage(t);if(a&&(h.data.width!==o.data.width||h.data.height!==o.data.height))throw new Error(`size mismatch between old image (${h.data.width}x${h.data.height}) and new image (${o.data.width}x${o.data.height}).`);o.version=h.version+1,this.images[t]=o,this.updatedImages[t]=!0}removeImage(t){const o=this.images[t];delete this.images[t],delete this.patterns[t],o.userImage&&o.userImage.onRemove&&o.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t,o){let a=!0;if(!this.isLoaded())for(const h of t)this.images[h]||(a=!1);this.isLoaded()||a?this._notify(t,o):this.requestors.push({ids:t,callback:o})}_notify(t,o){const a={};for(const h of t){let m=this.getImage(h);m||(this.fire(new l.k("styleimagemissing",{id:h})),m=this.getImage(h)),m?a[h]={data:m.data.clone(),pixelRatio:m.pixelRatio,sdf:m.sdf,version:m.version,stretchX:m.stretchX,stretchY:m.stretchY,content:m.content,hasRenderCallback:!!(m.userImage&&m.userImage.render)}:l.w(`Image "${h}" 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.`)}o(null,a)}getPixelSize(){const{width:t,height:o}=this.atlasImage;return{width:t,height:o}}getPattern(t){const o=this.patterns[t],a=this.getImage(t);if(!a)return null;if(o&&o.position.version===a.version)return o.position;if(o)o.position.version=a.version;else{const h={w:a.data.width+2,h:a.data.height+2,x:0,y:0},m=new l.I(h,a);this.patterns[t]={bin:h,position:m}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const o=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new nt(t,this.atlasImage,o.RGBA),this.atlasTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const m in this.patterns)t.push(this.patterns[m].bin);const{w:o,h:a}=l.p(t),h=this.atlasImage;h.resize({width:o||1,height:a||1});for(const m in this.patterns){const{bin:x}=this.patterns[m],w=x.x+1,A=x.y+1,E=this.getImage(m).data,k=E.width,z=E.height;l.R.copy(E,h,{x:0,y:0},{x:w,y:A},{width:k,height:z}),l.R.copy(E,h,{x:0,y:z-1},{x:w,y:A-1},{width:k,height:1}),l.R.copy(E,h,{x:0,y:0},{x:w,y:A+z},{width:k,height:1}),l.R.copy(E,h,{x:k-1,y:0},{x:w-1,y:A},{width:1,height:z}),l.R.copy(E,h,{x:0,y:0},{x:w+k,y:A},{width:1,height:z})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const o of t){if(this.callbackDispatchedThisFrame[o])continue;this.callbackDispatchedThisFrame[o]=!0;const a=this.getImage(o);a||l.w(`Image with ID: "${o}" was not found`),xt(a)&&this.updateImage(o,a)}}}const Pt=1e20;function ft(d,t,o,a,h,m,x,w,A){for(let E=t;E<t+a;E++)Ut(d,o*m+E,m,h,x,w,A);for(let E=o;E<o+h;E++)Ut(d,E*m+t,1,a,x,w,A)}function Ut(d,t,o,a,h,m,x){m[0]=0,x[0]=-Pt,x[1]=Pt,h[0]=d[t];for(let w=1,A=0,E=0;w<a;w++){h[w]=d[t+w*o];const k=w*w;do{const z=m[A];E=(h[w]-h[z]+k-z*z)/(w-z)/2}while(E<=x[A]&&--A>-1);A++,m[A]=w,x[A]=E,x[A+1]=Pt}for(let w=0,A=0;w<a;w++){for(;x[A+1]<w;)A++;const E=m[A],k=w-E;d[t+w*o]=h[E]+k*k}}class Ct{constructor(t,o){this.requestManager=t,this.localIdeographFontFamily=o,this.entries={}}setURL(t){this.url=t}getGlyphs(t,o){const a=[];for(const h in t)for(const m of t[h])a.push({stack:h,id:m});l.o(a,({stack:h,id:m},x)=>{let w=this.entries[h];
9w||(w=this.entries[h]={glyphs:{},requests:{},ranges:{}});let A=w.glyphs[m];if(A!==void 0)return void x(null,{stack:h,id:m,glyph:A});if(A=this._tinySDF(w,h,m),A)return w.glyphs[m]=A,void x(null,{stack:h,id:m,glyph:A});const E=Math.floor(m/256);if(256*E>65535)return void x(new Error("glyphs > 65535 not supported"));if(w.ranges[E])return void x(null,{stack:h,id:m,glyph:A});if(!this.url)return void x(new Error("glyphsUrl is not set"));let k=w.requests[E];k||(k=w.requests[E]=[],Ct.loadGlyphRange(h,E,this.url,this.requestManager,(z,U)=>{if(U){for(const K in U)this._doesCharSupportLocalGlyph(+K)||(w.glyphs[+K]=U[+K]);w.ranges[E]=!0}for(const K of k)K(z,U);delete w.requests[E]})),k.push((z,U)=>{z?x(z):U&&x(null,{stack:h,id:m,glyph:U[m]||null})})},(h,m)=>{if(h)o(h);else if(m){const x={};for(const{stack:w,id:A,glyph:E}of m)(x[w]||(x[w]={}))[A]=E&&{id:E.id,bitmap:E.bitmap.clone(),metrics:E.metrics};o(null,x)}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(l.u["CJK Unified Ideographs"](t)||l.u["Hangul Syllables"](t)||l.u.Hiragana(t)||l.u.Katakana(t))}_tinySDF(t,o,a){const h=this.localIdeographFontFamily;if(!h||!this._doesCharSupportLocalGlyph(a))return;let m=t.tinySDF;if(!m){let w="400";/bold/i.test(o)?w="900":/medium/i.test(o)?w="500":/light/i.test(o)&&(w="200"),m=t.tinySDF=new Ct.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:h,fontWeight:w})}const x=m.draw(String.fromCharCode(a));return{id:a,bitmap:new l.q({width:x.width||60,height:x.height||60},x.data),metrics:{width:x.glyphWidth/2||24,height:x.glyphHeight/2||24,left:x.glyphLeft/2+.5||0,top:x.glyphTop/2-27.5||-8,advance:x.glyphAdvance/2||24,isDoubleResolution:!0}}}}Ct.loadGlyphRange=function(d,t,o,a,h){const m=256*t,x=m+255,w=a.transformRequest(o.replace("{fontstack}",d).replace("{range}",`${m}-${x}`),pt.Glyphs);l.l(w,(A,E)=>{if(A)h(A);else if(E){const k={};for(const z of l.n(E))k[z.id]=z;h(null,k)}})},Ct.TinySDF=class{constructor({fontSize:d=24,buffer:t=3,radius:o=8,cutoff:a=.25,fontFamily:h="sans-serif",fontWeight:m="normal",fontStyle:x="normal"}={}){this.buffer=t,this.cutoff=a,this.radius=o;const w=this.size=d+4*t,A=this._createCanvas(w),E=this.ctx=A.getContext("2d",{willReadFrequently:!0});E.font=`${x} ${m} ${d}px ${h}`,E.textBaseline="alphabetic",E.textAlign="left",E.fillStyle="black",this.gridOuter=new Float64Array(w*w),this.gridInner=new Float64Array(w*w),this.f=new Float64Array(w),this.z=new Float64Array(w+1),this.v=new Uint16Array(w)}_createCanvas(d){const t=document.createElement("canvas");return t.width=t.height=d,t}draw(d){const{width:t,actualBoundingBoxAscent:o,actualBoundingBoxDescent:a,actualBoundingBoxLeft:h,actualBoundingBoxRight:m}=this.ctx.measureText(d),x=Math.ceil(o),w=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(m-h))),A=Math.min(this.size-this.buffer,x+Math.ceil(a)),E=w+2*this.buffer,k=A+2*this.buffer,z=Math.max(E*k,0),U=new Uint8ClampedArray(z),K={data:U,width:E,height:k,glyphWidth:w,glyphHeight:A,glyphTop:x,glyphLeft:0,glyphAdvance:t};if(w===0||A===0)return K;const{ctx:W,buffer:J,gridInner:G,gridOuter:ce}=this;W.clearRect(J,J,w,A),W.fillText(d,J,J+x);const xe=W.getImageData(J,J,w,A);ce.fill(Pt,0,z),G.fill(0,0,z);for(let ie=0;ie<A;ie++)for(let he=0;he<w;he++){const we=xe.data[4*(ie*w+he)+3]/255;if(we===0)continue;const Te=(ie+J)*E+he+J;if(we===1)ce[Te]=0,G[Te]=Pt;else{const Ie=.5-we;ce[Te]=Ie>0?Ie*Ie:0,G[Te]=Ie<0?Ie*Ie:0}}ft(ce,0,0,E,k,E,this.f,this.v,this.z),ft(G,J,J,w,A,E,this.f,this.v,this.z);for(let ie=0;ie<z;ie++){const he=Math.sqrt(ce[ie])-Math.sqrt(G[ie]);U[ie]=Math.round(255-255*(he/this.radius+this.cutoff))}return K}};class ni{constructor(){this.specification=l.v.light.position}possiblyEvaluate(t,o){return l.z(t.expression.evaluate(o))}interpolate(t,o,a){return{x:l.B.number(t.x,o.x,a),y:l.B.number(t.y,o.y,a),z:l.B.number(t.z,o.z,a)}}}let et;class Ui extends l.E{constructor(t){super(),et=et||new l.r({anchor:new l.D(l.v.light.anchor),position:new ni,color:new l.D(l.v.light.color),intensity:new l.D(l.v.light.intensity)}),this._transitionable=new l.T(et),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,o={}
vendor: 5,813 bytes, line 9
9){if(!this._validate(l.t,t,o))for(const a in t){const h=t[a];a.endsWith("-transition")?this._transitionable.setTransition(a.slice(0,-11),h):this._transitionable.setValue(a,h)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,o,a){return(!a||a.validate!==!1)&&l.x(this,t.call(l.y,l.e({value:o,style:{glyphs:!0,sprite:!0},styleSpec:l.v})))}}class mt{constructor(t,o){this.width=t,this.height=o,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,o){const a=t.join(",")+String(o);return this.dashEntry[a]||(this.dashEntry[a]=this.addDash(t,o)),this.dashEntry[a]}getDashRanges(t,o,a){const h=[];let m=t.length%2==1?-t[t.length-1]*a:0,x=t[0]*a,w=!0;h.push({left:m,right:x,isDash:w,zeroLength:t[0]===0});let A=t[0];for(let E=1;E<t.length;E++){w=!w;const k=t[E];m=A*a,A+=k,x=A*a,h.push({left:m,right:x,isDash:w,zeroLength:k===0})}return h}addRoundDash(t,o,a){const h=o/2;for(let m=-a;m<=a;m++){const x=this.width*(this.nextRow+a+m);let w=0,A=t[w];for(let E=0;E<this.width;E++){E/A.right>1&&(A=t[++w]);const k=Math.abs(E-A.left),z=Math.abs(E-A.right),U=Math.min(k,z);let K;const W=m/a*(h+1);if(A.isDash){const J=h-Math.abs(W);K=Math.sqrt(U*U+J*J)}else K=h-Math.sqrt(U*U+W*W);this.data[x+E]=Math.max(0,Math.min(255,K+128))}}}addRegularDash(t){for(let w=t.length-1;w>=0;--w){const A=t[w],E=t[w+1];A.zeroLength?t.splice(w,1):E&&E.isDash===A.isDash&&(E.left=A.left,t.splice(w,1))}const o=t[0],a=t[t.length-1];o.isDash===a.isDash&&(o.left=a.left-this.width,a.right=o.right+this.width);const h=this.width*this.nextRow;let m=0,x=t[m];for(let w=0;w<this.width;w++){w/x.right>1&&(x=t[++m]);const A=Math.abs(w-x.left),E=Math.abs(w-x.right),k=Math.min(A,E);this.data[h+w]=Math.max(0,Math.min(255,(x.isDash?k:-k)+128))}}addDash(t,o){const a=o?7:0,h=2*a+1;if(this.nextRow+h>this.height)return l.w("LineAtlas out of space"),null;let m=0;for(let w=0;w<t.length;w++)m+=t[w];if(m!==0){const w=this.width/m,A=this.getDashRanges(t,this.width,w);o?this.addRoundDash(A,w,a):this.addRegularDash(A)}const x={y:(this.nextRow+a+.5)/this.height,height:2*a/this.height,width:m};return this.nextRow+=h,this.dirty=!0,x}bind(t){const o=t.gl;this.texture?(o.bindTexture(o.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.width,this.height,o.ALPHA,o.UNSIGNED_BYTE,this.data))):(this.texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.ALPHA,this.width,this.height,0,o.ALPHA,o.UNSIGNED_BYTE,this.data))}}class Mt{constructor(t,o,a){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=a;const h=this.workerPool.acquire(a);for(let m=0;m<h.length;m++){const x=new l.C(h[m],o,a);x.name=`Worker ${m}`,this.actors.push(x)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,o,a){l.o(this.actors,(h,m)=>{h.send(t,o,m)},a=a||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(o=>{o.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}}function ci(d,t,o){const a=function(h,m){if(h)return o(h);if(m){const x=l.F(l.e(m,d),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);m.vector_layers&&(x.vectorLayers=m.vector_layers,x.vectorLayerIds=x.vectorLayers.map(w=>w.id)),o(null,x)}};return d.url?l.f(t.transformRequest(d.url,pt.Source),a):l.h.frame(()=>a(null,d))}class Lt{constructor(t,o){t&&(o?this.setSouthWest(t).setNorthEast(o):Array.isArray(t)&&(t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof l.L?new l.L(t.lng,t.lat):l.L.convert(t),this}setSouthWest(t){return this._sw=t instanceof l.L?new l.L(t.lng,t.lat):l.L.convert(t),this}extend(t){const o=this._sw,a=this._ne;let h,m;if(t instanceof l.L)h=t,m=t;else{if(!(t instanceof Lt))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Lt.convert(t)):this.extend(l.L.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(l.L.convert(t)):this;if(h=t._sw,m=t._ne,!h||!m)return this}return o||a?(o.lng=Math.min(h.lng,o.lng),o.lat=Math.min(h.lat,o.lat),a.lng=Math.max(m.lng,a.lng),a.lat=Math.max(m.lat,a.lat)):(this._sw=new l.L(h.lng,h.lat),this._ne=new l.L(m.lng,m.lat)),this}getCenter(){return new l.L((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 l.L(this.getWest(),this.getNorth())}getSouthEast(){return new l.L(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(t){const{lng:o,lat:a}=l.L.convert(t);let h=this._sw.lng<=o&&o<=this._ne.lng;return this._sw.lng>this._ne.lng&&(h=this._sw.lng>=o&&o>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&h}static convert(t){return t instanceof Lt?t:t&&new Lt(t)}static fromLngLat(t,o=0){const a=360*o/40075017,h=a/Math.cos(Math.PI/180*t.lat);return new Lt(new l.L(t.lng-h,t.lat-a),new l.L(t.lng+h,t.lat+a))}}class $t{constructor(t,o,a){this.bounds=Lt.convert(this.validateBounds(t)),this.minzoom=o||0,this.maxzoom=a||24}
9validateBounds(t){return Array.isArray(t)&&t.length===4?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const o=Math.pow(2,t.z),a=Math.floor(l.G(this.bounds.getWest())*o),h=Math.floor(l.H(this.bounds.getNorth())*o),m=Math.ceil(l.G(this.bounds.getEast())*o),x=Math.ceil(l.H(this.bounds.getSouth())*o);return t.x>=a&&t.x<m&&t.y>=h&&t.y<x}}class qt extends l.E{constructor(t,o,a,h){if(super(),this.load=()=>{this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this._tileJSONRequest=ci(this._options,this.map._requestManager,(m,x)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),m?this.fire(new l.j(m)):x&&(l.e(this,x),x.bounds&&(this.tileBounds=new $t(x.bounds,this.minzoom,this.maxzoom)),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})))})},this.serialize=()=>l.e({},this._options),this.id=t,this.dispatcher=a,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,l.e(this,l.F(o,["url","scheme","tileSize","promoteId"])),this._options=l.e({type:"vector"},o),this._collectResourceTiming=o.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(h)}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}loadTile(t,o){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),h={request:this.map._requestManager.transformRequest(a,pt.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
9ype,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function m(x,w){return delete t.request,t.aborted?o(null):x&&x.status!==404?o(x):(w&&w.resourceTiming&&(t.resourceTiming=w.resourceTiming),this.map._refreshExpiredTiles&&w&&t.setExpiryData(w),t.loadVectorData(w,this.map.painter),o(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}h.request.collectResourceTiming=this._collectResourceTiming,t.actor&&t.state!=="expired"?t.state==="loading"?t.reloadCallback=o:t.request=t.actor.send("reloadTile",h,m.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",h,m.bind(this)))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)}unloadTile(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Vt extends l.E{constructor(t,o,a,h){super(),this.id=t,this.dispatcher=a,this.setEventedParent(h),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=l.e({type:"raster"},o),l.e(this,l.F(o,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this._tileJSONRequest=ci(this._options,this.map._requestManager,(t,o)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new l.j(t)):o&&(l.e(this,o),o.bounds&&(this.tileBounds=new $t(o.bounds,this.minzoom,this.maxzoom)),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}serialize(){return l.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t,o){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=Tt.getImage(this.map._requestManager.transformRequest(a,pt.Tile),(h,m,x)=>{if(delete t.request,t.aborted)t.state="unloaded",o(null);else if(h)t.state="errored",o(h);else if(m){this.map._refreshExpiredTiles&&x&&t.setExpiryData(x);const w=this.map.painter.context,A=w.gl;t.texture=this.map.painter.getTileTexture(m.width),t.texture?t.texture.update(m,{useMipmap:!0}):(t.texture=new nt(w,m,A.RGBA,{useMipmap:!0}),t.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE,A.LINEAR_MIPMAP_NEAREST),w.extTextureFilterAnisotropic&&A.texParameterf(A.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.extTextureFilterAnisotropicMax)),t.state="loaded",o(null)}},this.map._refreshExpiredTiles)}abortTile(t,o){t.request&&(t.request.cancel(),delete t.request),o()}unloadTile(t,o){t.texture&&this.map.painter.saveTileTexture(t.texture),o()}hasTransition(){return!1}}class Tn extends Vt{constructor(t,o,a,h){super(t,o,a,h),this.type="raster-dem",this.maxzoom=22,this._options=l.e({type:"raster-dem"},o),this.encoding=o.encoding||"mapbox",this.redFactor=o.redFactor,this.greenFactor=o.greenFactor,this.blueFactor=o.blueFactor,this.baseShift=o.baseShift}loadTile(t,o){const a=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),h=this.map._requestManager.transformRequest(a,pt.Tile);function m(x,w){x&&(t.state="errored",o(x)),w&&(t.dem=w,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",o(null))}t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.request=Tt.getImage(h,(x,w,A)=>l._(this,void 0,void 0,function*(){if(delete t.request,t.aborted)t.state="unloaded",o(null);else if(x)t.state="errored",o(x);else if(w){this.map._refreshExpiredTiles&&t.setExpiryData(A);const E=l.a(w)&&l.J()?w:yield function(z){return l._(this,void 0,void 0,function*(){if(typeof VideoFrame!="undefined"&&l.K()){const U=z.width+2,K=z.height+2;try{return new l.R({width:U,height:K},yield l.M(z,-1,-1,U,K))}catch(W){}}return l.h.getImageData(z,1)})}
9(w),k={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:E,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};t.actor&&t.state!=="expired"||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",k,m))}}),this.map._refreshExpiredTiles)}_getNeighboringTiles(t){const o=t.canonical,a=Math.pow(2,o.z),h=(o.x-1+a)%a,m=o.x===0?t.wrap-1:t.wrap,x=(o.x+1+a)%a,w=o.x+1===a?t.wrap+1:t.wrap,A={};return A[new l.O(t.overscaledZ,m,o.z,h,o.y).key]={backfilled:!1},A[new l.O(t.overscaledZ,w,o.z,x,o.y).key]={backfilled:!1},o.y>0&&(A[new l.O(t.overscaledZ,m,o.z,h,o.y-1).key]={backfilled:!1},A[new l.O(t.overscaledZ,t.wrap,o.z,o.x,o.y-1).key]={backfilled:!1},A[new l.O(t.overscaledZ,w,o.z,x,o.y-1).key]={backfilled:!1}),o.y+1<a&&(A[new l.O(t.overscaledZ,m,o.z,h,o.y+1).key]={backfilled:!1},A[new l.O(t.overscaledZ,t.wrap,o.z,o.x,o.y+1).key]={backfilled:!1},A[new l.O(t.overscaledZ,w,o.z,x,o.y+1).key]={backfilled:!1}),A}unloadTile(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})}}class mn extends l.E{constructor(t,o,a,h){super(),this.load=()=>{this._updateWorkerData()},this.serialize=()=>l.e({}
9,this._options,{type:this.type,data:this._data}),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=a.getActor(),this.setEventedParent(h),this._data=o.data,this._options=l.e({},o),this._collectResourceTiming=o.collectResourceTiming,o.maxzoom!==void 0&&(this.maxzoom=o.maxzoom),o.type&&(this.type=o.type),o.attribution&&(this.attribution=o.attribution),this.promoteId=o.promoteId;const m=l.N/this.tileSize;this.workerOptions=l.e({source:this.id,cluster:o.cluster||!1,geojsonVtOptions:{buffer:(o.buffer!==void 0?o.buffer:128)*m,tolerance:(o.tolerance!==void 0?o.tolerance:.375)*m,extent:l.N,maxZoom:this.maxzoom,lineMetrics:o.lineMetrics||!1,generateId:o.generateId||!1},superclusterOptions:{maxZoom:o.clusterMaxZoom!==void 0?o.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,o.clusterMinPoints||2),extent:l.N,radius:(o.clusterRadius||50)*m,log:!1,generateId:o.generateId||!1},clusterProperties:o.clusterProperties,filter:o.filter},o.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(t.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),t.clusterMa
9xZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t,o){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},o),this}getClusterChildren(t,o){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},o),this}getClusterLeaves(t,o,a,h){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:o,offset:a},h),this}_updateWorkerData(t){const o=l.e({},this.workerOptions);t?o.dataDiff=t:typeof this._data=="string"?(o.request=this.map._requestManager.transformRequest(l.h.resolveURL(this._data),pt.Source),o.request.collectResourceTiming=this._collectResourceTiming):o.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new l.k("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,o,(a,h)=>{if(this._pendingLoads--,this._removed||h&&h.abandoned)return void this.fire(new l.k("dataabort",{dataType:"source"}));let m=null;if(h&&h.resourceTiming&&h.resourceTiming[this.id]&&(m=h.resourceTiming[this.id].slice(0)),a)return void this.fire(new l.j(a));const x={dataType:"source"};this._collectResourceTiming&&m&&m.length>0&&l.e(x,{resourceTiming:m}),this.fire(new l.k("data",Object.assign(Object.assign({},x),{sourceDataType:"metadata"}))),this.fire(new l.k("data",Object.assign(Object.assign({},x),{sourceDataType:"content"})))})}loaded(){return this._pendingLoads===0}loadTile(t,o){const a=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const h={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(a,h,(m,x)=>(delete t.request,t.unloadVectorData(),t.aborted?o(null):m?o(m):(t.loadVectorData(x,this.map.painter,a==="reloadTile"),o(null))))}abortTile(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0}unloadTile(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.t
9ype,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}hasTransition(){return!1}}var Kn=l.Q([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Sn extends l.E{constructor(t,o,a,h){super(),this.load=(m,x)=>{this._loaded=!1,this.fire(new l.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=Tt.getImage(this.map._requestManager.transformRequest(this.url,pt.Image),(w,A)=>{this._request=null,this._loaded=!0,w?this.fire(new l.j(w)):A&&(this.image=A,m&&(this.coordinates=m),x&&x(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||!this.image)return;const m=this.map.painter.context,x=m.gl;this.boundsBuffer||(this.boundsBuffer=m.createVertexBuffer(this._boundsArray,Kn.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture||(this.texture=new nt(m,this.image,x.RGBA),this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE));let w=!1;for(const A in this.tiles){const E=this.tiles[A];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture,w=!0)}w&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"image",url:this.options.url,coordinates:this.coordinates}),this.id=t,this.dispatcher=a,this.coordinates=o.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(h),this.options=o}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.cancel(),this._request=null),this.options.url=t.url,this.load(t.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new l.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.cancel(),this._request=null)}setCoordinates(t){this.coordinates=t;const o=t.map(l.U.fromLngLat);this.tileID=function(h){let m=1/0,x=1/0,w=-1/0,A=-1/0;for(const U of h)m=Math.min(m,U.x),x=Math.min(x,U.y),w=Math.max(w,U.x),A=Math.max(A,U.y);const E=Math.max(w-m,A-x),k=Math.max(0,Math.floor(-Math.log(E)/Math.LN2)),z=Math.pow(2,k);return new l.W(k,Math.floor((m+w)/2*z),Math.floor((x+A)/2*z))}(o),this.minzoom=this.maxzoom=this.tileID.z;const a=o.map(h=>this.tileID.getTilePoint(h)._round());return this._boundsArray=new l.V,this._boundsArray.emplaceBack(a[0].x,a[0].y,0,0),this._boundsArray.emplaceBack(a[1].x,a[1].y,l.N,0),this._boundsArray.emplaceBack(a[3].x,a[3].y,0,l.N),this._boundsArray.emplaceBack(a[2].x,a[2].y,l.N,l.N),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new l.k("data",{dataType:"source",sourceDataType:"content"})),this}loadTile(t,o){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},o(null)):(t.state="errored",o(null))}hasTransition(){return!1}}class To extends Sn{constructor(t,o,a,h){super(t,o,a,h),this.load=()=>{this._loaded=!1;const m=this.options;this.urls=[];for(const x of m.urls)this.urls.push(this.map._requestManager.transformRequest(x,pt.Source).url);l.X(this.urls,(x,w)=>{this._loaded=!0,x?this.fire(new l.j(x)):w&&(this.video=w,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})},this.prepare=()=>{if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const m=this.map.painter.context,x=m.gl;this.boundsBuffer||(this.boundsBuffer=m.createVertexBuffer(this._boundsArray,Kn.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE),x.texSubImage2D(x.TEXTURE_2D,0,0,0,x.RGBA,x.UNSIGNED_BYTE,this.video)):(this.texture=new nt(m,this.video,x.RGBA),this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE));let w=!1;for(const A in this.tiles){const E=this.tiles[A];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture,w=!0)}w&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"video",urls:this.urls,coordinates:this.coordinates}),this.roundZoom=!0,this.type="video",this.options=o}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const o=this.video.seekable;t<o.start(0)||t>o.end(0)?this.fire(new l.j(new l.Y(`sources.${this.id}`,null,`Playback for this video can be set only between the ${o.start(0)} and ${o.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}
9onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}hasTransition(){return this.video&&!this.video.paused}}class Xn extends Sn{constructor(t,o,a,h){super(t,o,a,h),this.load=()=>{this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new l.j(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())},this.prepare=()=>{let m=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,m=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,m=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const x=this.map.painter.context,w=x.gl;this.boundsBuffer||(this.boundsBuffer=x.createVertexBuffer(this._boundsArray,Kn.members)),this.boundsSegments||(this.boundsSegments=l.S.simpleSegment(0,0,4,2)),this.texture?(m||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new nt(x,this.canvas,w.RGBA,{premultiply:!0});let A=!1;for(const E in this.tiles){const k=this.tiles[E];k.state!=="loaded"&&(k.state="loaded",k.texture=this.texture,A=!0)}A&&this.fire(new l.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))},this.serialize=()=>({type:"canvas",coordinates:this.coordinates}),o.coordinates?Array.isArray(o.coordinates)&&o.coordinates.length===4&&!o.coordinates.some(m=>!Array.isArray(m)||m.length!==2||m.some(x=>typeof x!="number"))||this.fire(new l.j(new l.Y(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new l.j(new l.Y(`sources.${t}`,null,'missing required property "coordinates"'))),o.animate&&typeof o.animate!="boolean"&&this.fire(new l.j(new l.Y(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),o.canvas?typeof o.canvas=="string"||o.canvas instanceof HTMLCanvasElement||this.fire(new l.j(new l.Y(`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 l.j(new l.Y(`sources.${t}`,null,'missing required property "canvas"'))),this.options=o,this.animate=o.animate===void 0||o.animate}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const So={},kr=d=>{switch(d){case"geojson":return mn;case"image":return Sn;case"raster":return Vt;case"raster-dem":return Tn;case"vector":return qt;case"video":return To;case"canvas":return Xn}return So[d]};function Ao(d,t){const o=l.Z();return l.$(o,o,[1,1,0]),l.a0(o,o,[.5*d.width,.5*d.height,1]),l.a1(o,o,d.calculatePosMatrix(t.toUnwrapped()))}function Jr(d,t,o,a,h,m){const x=function(z,U,K){if(z)for(const W of z){const J=U[W];if(J&&J.source===K&&J.type==="fill-extrusion")return!0}else for(const W in U){const J=U[W];if(J.source===K&&J.type==="fill-extrusion")return!0}return!1}(h&&h.layers,t,d.id),w=m.maxPitchScaleFactor(),A=d.tilesIn(a,w,x);A.sort(vr);const E=[];for(const z of A)E.push({wrappedTileID:z.tileID.wrapped().key,queryResults:z.tile.queryRenderedFeatures(t,o,d._state,z.queryGeometry,z.cameraQueryGeometry,z.scale,h,m,w,Ao(d.transform,z.tileID))});const k=function(z){const U={},K={};for(const W of z){const J=W.queryResults,G=W.wrappedTileID,ce=K[G]=K[G]||{};for(const xe in J){const ie=J[xe],he=ce[xe]=ce[xe]||{},we=U[xe]=U[xe]||[];for(const Te of ie)he[Te.featureIndex]||(he[Te.featureIndex]=!0,we.push(Te))}}return U}(E);for(const z in k)k[z].forEach(U=>{const K=U.feature,W=d.getFeatureState(K.layer["source-layer"],K.id);K.source=K.layer.source,K.layer["source-layer"]&&(K.sourceLayer=K.layer["source-layer"]),K.state=W});return k}function vr(d,t){const o=d.tileID,a=t.tileID;return o.overscaledZ-a.overscaledZ||o.canonical.y-a.canonical.y||o.wrap-a.wrap||o.canonical.x-a.canonical.x}class ar{constructor(t,o){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=l.a2(),this.uses=0,this.tileSize=o,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const o=t+this.timeAdded;o<this.fadeEndTime||(this.fadeEndTime=o)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,o,a){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(h,m){const x={};if(!m)return x;for(const w of h){const A=w.layerIds.map(E=>
vendor: 8,923 bytes, line 9
9m.getLayer(E)).filter(Boolean);if(A.length!==0){w.layers=A,w.stateDependentLayerIds&&(w.stateDependentLayers=w.stateDependentLayerIds.map(E=>A.filter(k=>k.id===E)[0]));for(const E of A)x[E.id]=w}}return x}(t.buckets,o.style),this.hasSymbolBuckets=!1;for(const h in this.buckets){const m=this.buckets[h];if(m instanceof l.a4){if(this.hasSymbolBuckets=!0,!a)break;m.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const h in this.buckets){const m=this.buckets[h];if(m instanceof l.a4&&m.hasRTLText){this.hasRTLText=!0,l.a5();break}}this.queryPadding=0;for(const h in this.buckets){const m=this.buckets[h];this.queryPadding=Math.max(this.queryPadding,o.style.getLayer(h).queryRadius(m))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new l.a3}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const a in this.buckets){const h=this.buckets[a];h.uploadPending()&&h.upload(t)}const o=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new nt(t,this.imageAtlas.image,o.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new nt(t,this.glyphAtlasImage,o.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,o,a,h,m,x,w,A,E,k){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:h,cameraQueryGeometry:m,scale:x,tileSize:this.tileSize,pixelPosMatrix:k,transform:A,params:w,queryPadding:this.queryPadding*E},t,o,a):{}}querySourceFeatures(t,o){const a=this.latestFeatureIndex;if(!a||!a.rawTileData)return;const h=a.loadVTLayers(),m=o&&o.sourceLayer?o.sourceLayer:"",x=h._geojsonTileLayer||h[m];if(!x)return;const w=l.a6(o&&o.filter),{z:A,x:E,y:k}=this.tileID.canonical,z={z:A,x:E,y:k};for(let U=0;U<x.length;U++){const K=x.feature(U);if(w.needGeometry){const G=l.a7(K,!0);if(!w.filter(new l.a8(this.tileID.overscaledZ),G,this.tileID.canonical))continue}else if(!w.filter(new l.a8(this.tileID.overscaledZ),K))continue;const W=a.getId(K,m),J=new l.a9(K,A,E,k,W);J.tile=z,t.push(J)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const o=this.expirationTime;if(t.cacheControl){const a=l.aa(t.cacheControl);a["max-age"]&&(this.expirationTime=Date.now()+1e3*a["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const a=Date.now();let h=!1;if(this.expirationTime>a)h=!1;else if(o)if(this.expirationTime<o)h=!0;else{const m=this.expirationTime-o;m?this.expirationTime=a+Math.max(m,3e4):h=!0}else h=!0;h?(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(t,o){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(t).length===0)return;const a=this.latestFeatureIndex.loadVTLayers();for(const h in this.buckets){if(!o.style.hasLayer(h))continue;const m=this.buckets[h],x=m.layers[0].sourceLayer||"_geojsonTileLayer",w=a[x],A=t[x];if(!w||!A||Object.keys(A).length===0)continue;m.update(A,w,this.imageAtlas&&this.imageAtlas.patternPositions||{});const E=o&&o.style&&o.style.getLayer(h);E&&(this.queryPadding=Math.max(this.queryPadding,E.queryRadius(m)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<l.h.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=l.h.now()+t}setDependencies(t,o){const a={};for(const h of o)a[h]=!0;this.dependencies[t]=a}hasDependency(t,o){for(const a of t){const h=this.dependencies[a];if(h){for(const m of o)if(h[m])return!0}}return!1}}class Po{constructor(t,o){this.max=t,this.onRemove=o,this.reset()}reset(){for(const t in this.data)for(const o of this.data[t])o.timeout&&clearTimeout(o.timeout),this.onRemove(o.value);return this.data={},this.order=[],this}add(t,o,a){const h=t.wrapped().key;this.data[h]===void 0&&(this.data[h]=[]);const m={value:o,timeout:void 0};if(a!==void 0&&(m.timeout=setTimeout(()=>{this.remove(t,m)},a)),this.data[h].push(m),this.order.push(h),this.order.length>this.max){const x=this._getAndRemoveByKey(this.order[0]);x&&this.onRemove(x)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const o=this.data[t].shift();return o.timeout&&clearTimeout(o.timeout),this.data[t].length===0&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),o.value}getByKey(t){const o=this.data[t];return o?o[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,o){if(!this.has(t))return this;const a=t.wrapped().key,h=o===void 0?0:this.data[a].indexOf(o),m=this.data[a][h];return this.data[a].splice(h,1),m.timeout&&clearTimeout(m.timeout),this.data[a].length===0&&delete this.data[a],this.onRemove(m.value),this.order.splice(this.order.indexOf(a),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this}filter(t){const o=[];for(const a in this.data)for(const h of this.data[a])t(h.value)||o.push(h);for(const a of o)this.remove(a.value.tileID,a)}}class Pe{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,o,a){const h=String(o);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][h]=this.stateChanges[t][h]||{},l.e(this.stateChanges[t][h],a),this.deletedStates[t]===null){this.deletedStates[t]={};for(const m in this.state[t])m!==h&&(this.deletedStates[t][m]=null)}else if(this.deletedStates[t]&&this.deletedStates[t][h]===null){this.deletedStates[t][h]={};for(const m in this.state[t][h])a[m]||(this.deletedStates[t][h][m]=null)}else for(const m in a)this.deletedStates[t]&&this.deletedStates[t][h]&&this.deletedStates[t][h][m]===null&&delete this.deletedStates[t][h][m]}removeFeatureState(t,o,a){if(this.deletedStates[t]===null)return;const h=String(o);if(this.deletedStates[t]=this.deletedStates[t]||{},a&&o!==void 0)this.deletedStates[t][h]!==null&&(this.deletedStates[t][h]=this.deletedStates[t][h]||{},this.deletedStates[t][h][a]=null);else if(o!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][h])for(a in this.deletedStates[t][h]={},this.stateChanges[t][h])this.deletedStates[t][h][a]=null;else this.deletedStates[t][h]=null;else this.deletedStates[t]=null}getState(t,o){const a=String(o),h=l.e({},(this.state[t]||{})[a],(this.stateChanges[t]||{})[a]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){const m=this.deletedStates[t][o];if(m===null)return{};for(const x in m)delete h[x]}return h}initializeTileState(t,o){t.setFeatureState(this.state,o)}coalesceChanges(t,o){const a={};for(const h in this.stateChanges){this.state[h]=this.state[h]||{};const m={};for(const x in this.stateChanges[h])this.state[h][x]||(this.state[h][x]={}),l.e(this.state[h][x],this.stateChanges[h][x]),m[x]=this.state[h][x];a[h]=m}for(const h in this.deletedStates){this.state[h]=this.state[h]||{};const m={};if(this.deletedStates[h]===null)for(const x in this.state[h])m[x]={},this.state[h][x]={};else for(const x in this.deletedStates[h]){if(this.deletedStates[h][x]===null)this.state[h][x]={};else for(const w of Object.keys(this.deletedStates[h][x]))delete this.state[h][x][w];m[x]=this.state[h][x]}a[h]=a[h]||{},l.e(a[h],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(a).length!==0)for(const h in t)t[h].setFeatureState(a,o)}}class hn extends l.E{constructor(t,o,a){super(),this.id=t,this.dispatcher=a,this.on("data",h=>{h.dataType==="source"&&h.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&h.dataType==="source"&&h.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((h,m,x,w)=>{const A=new(kr(m.type))(h,m,x,w);if(A.id!==h)throw new Error(`Expected Source id to be ${h} instead of ${A.id}`);return A})(t,o,a,this),this._tiles={},this._cache=new Po(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={}
9,this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Pe,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const o=this._tiles[t];if(o.state!=="loaded"&&o.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,o){return this._source.loadTile(t,o)}_unloadTile(t){if(this._source.unloadTile)return this._source.unloadTile(t,()=>{})}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,()=>{}),this._source.fire(new l.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const o in this._tiles){const a=this._tiles[o];a.upload(t),a.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(Bn).map(t=>t.key)}getRenderableIds(t){const o=[];for(const a in this._tiles)this._isIdRenderable(a,t)&&o.push(this._tiles[a]);return t?o.sort((a,h)=>{const m=a.tileID,x=h.tileID,w=new l.P(m.canonical.x,m.canonical.y)._rotate(this.transform.angle),A=new l.P(x.canonical.x,x.canonical.y)._rotate(this.transform.angle);return m.overscaledZ-x.overscaledZ||A.y-w.y||A.x-w.x}).map(a=>a.tileID.key):o.map(a=>a.tileID).sort(Bn).map(a=>a.key)}hasRenderableParent(t){const o=this.findLoadedParent(t,0);return!!o&&this._isIdRenderable(o.tileID.key)}_isIdRenderable(t,o){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(o||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)this._tiles[t].state!=="errored"&&this._reloadTile(t,"reloading")}}_reloadTile(t,o){const a=this._tiles[t];a&&(a.state!=="loading"&&(a.state=o),this._loadTile(a,this._tileLoaded.bind(this,a,t,o)))}_tileLoaded(t,o,a,h){if(h)return t.state="errored",void(h.status!==404?this._source.fire(new l.j(h,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=l.h.now(),a==="expired"&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(o,t),this.getSource().type==="raster-dem"&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new l.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const o=this.getRenderableIds();for(let h=0;h<o.length;h++){const m=o[h];if(t.neighboringTiles&&t.neighboringTiles[m]){const x=this.getTileByID(m);a(t,x),a(x,t)}}function a(h,m){h.needsHillshadePrepare=!0,h.needsTerrainPrepare=!0;let x=m.tileID.canonical.x-h.tileID.canonical.x;const w=m.tileID.canonical.y-h.tileID.canonical.y,A=Math.pow(2,h.tileID.canonical.z),E=m.tileID.key;x===0&&w===0||Math.abs(w)>1||(Math.abs(x)>1&&(Math.abs(x+A)===1?x+=A:Math.abs(x-A)===1&&(x-=A)),m.dem&&h.dem&&(h.dem.backfillBorder(m.dem,x,w),h.neighboringTiles&&h.neighboringTiles[E]&&(h.neighboringTiles[E].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,o,a,h){for(const m in this._tiles){let x=this._tiles[m];if(h[m]||!x.hasData()||x.tileID.overscaledZ<=o||x.tileID.overscaledZ>a)continue;let w=x.tileID;for(;x&&x.tileID.overscaledZ>o+1;){const E=x.tileID.scaledTo(x.tileID.overscaledZ-1);x=this._tiles[E.key],x&&x.hasData()&&(w=E)}let A=w;for(;A.overscaledZ>o;)if(A=A.scaledTo(A.overscaledZ-1),t[A.key]){h[w.key]=w;break}}}findLoadedParent(t,o){if(t.key in this._loadedParentTiles){const a=this._loadedParentTiles[t.key];return a&&a.tileID.overscaledZ>=o?a:null}for(let a=t.overscaledZ-1;a>=o;a--){const h=t.scaledTo(a),m=this._getLoadedTile(h);if(m)return m}}_getLoadedTile(t){const o=this._tiles[t.key];return o&&o.hasData()?o:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const o=Math.ceil(t.width/this._source.tileSize)+1,a=Math.ceil(t.height/this._source.tileSize)+1,h=Math.floor(o*a*(this._maxTileC
vendor: 4,681 bytes, line 9
9acheZoomLevels===null?l.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),m=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,h):h;this._cache.setMaxSize(m)}handleWrapJump(t){const o=Math.round((t-(this._prevLng===void 0?t:this._prevLng))/360);if(this._prevLng=t,o){const a={};for(const h in this._tiles){const m=this._tiles[h];m.tileID=m.tileID.unwrapTo(m.tileID.wrap+o),a[m.tileID.key]=m}this._tiles=a;for(const h in this._timers)clearTimeout(this._timers[h]),delete this._timers[h];for(const h in this._tiles)this._setTileReloadTimer(h,this._tiles[h])}}update(t,o){if(this.transform=t,this.terrain=o,!this._sourceLoaded||this._paused)return;let a;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?a=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(k=>new l.O(k.canonical.z,k.wrap,k.canonical.z,k.canonical.x,k.canonical.y)):(a=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:o}),this._source.hasTile&&(a=a.filter(k=>this._source.hasTile(k)))):a=[];const h=t.coveringZoomLevel(this._source),m=Math.max(h-hn.maxOverzooming,this._source.minzoom),x=Math.max(h+hn.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const k={};for(const z of a)if(z.canonical.z>this._source.minzoom){const U=z.scaledTo(z.canonical.z-1);k[U.key]=U;const K=z.scaledTo(Math.max(this._source.minzoom,Math.min(z.canonical.z,5)));k[K.key]=K}a=a.concat(Object.values(k))}const w=a.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,w&&this.fire(new l.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const A=this._updateRetainedTiles(a,h);if(yi(this._source.type)){const k={},z={},U=Object.keys(A),K=l.h.now();for(const W of U){const J=A[W],G=this._tiles[W];if(!G||G.fadeEndTime!==0&&G.fadeEndTime<=K)continue;const ce=this.findLoadedParent(J,m);ce&&(this._addTile(ce.tileID),k[ce.tileID.key]=ce.tileID),z[W]=J}this._retainLoadedChildren(z,h,x,A);for(const W in k)A[W]||(this._coveredTiles[W]=!0,A[W]=k[W]);if(o){const W={},J={};for(const G of a)this._tiles[G.key].hasData()?W[G.key]=G:J[G.key]=G;for(const G in J){const ce=J[G].children(this._source.maxzoom);this._tiles[ce[0].key]&&this._tiles[ce[1].key]&&this._tiles[ce[2].key]&&this._tiles[ce[3].key]&&(W[ce[0].key]=A[ce[0].key]=ce[0],W[ce[1].key]=A[ce[1].key]=ce[1],W[ce[2].key]=A[ce[2].key]=ce[2],W[ce[3].key]=A[ce[3].key]=ce[3],delete J[G])}for(const G in J){const ce=this.findLoadedParent(J[G],this._source.minzoom);if(ce){W[ce.tileID.key]=A[ce.tileID.key]=ce.tileID;for(const xe in W)W[xe].isChildOf(ce.tileID)&&delete W[xe]}}for(const G in this._tiles)W[G]||(this._coveredTiles[G]=!0)}}for(const k in A)this._tiles[k].clearFadeHold();const E=l.ab(this._tiles,A);for(const k of E){const z=this._tiles[k];z.hasSymbolBuckets&&!z.holdingForFade()?z.setHoldDuration(this.map._fadeDuration):z.hasSymbolBuckets&&!z.symbolFadeFinished()||this._removeTile(k)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,o){const a={},h={},m=Math.max(o-hn.maxOverzooming,this._source.minzoom),x=Math.max(o+hn.maxUnderzooming,this._source.minzoom),w={};for(const A of t){const E=this._addTile(A);a[A.key]=A,E.hasData()||o<this._source.maxzoom&&(w[A.key]=A)}this._retainLoadedChildren(w,o,x,a);for(const A of t){let E=this._tiles[A.key];if(E.hasData())continue;if(o+1>this._source.maxzoom){const z=A.children(this._source.maxzoom)[0],U=this.getTile(z);if(U&&U.hasData()){a[z.key]=z;continue}}else{const z=A.children(this._source.maxzoom);if(a[z[0].key]&&a[z[1].key]&&a[z[2].key]&&a[z[3].key])continue}let k=E.wasRequested();for(let z=A.overscaledZ-1;z>=m;--z){const U=A.scaledTo(z);if(h[U.key])break;if(h[U.key]=!0,E=this.getTile(U),!E&&k&&(E=this._addTile(U)),E){const K=E.hasData();if((k||K)&&(a[U.key]=U),k=E.wasRequested(),K)break}}}return a}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const o=[];let a,h=this._tiles[t].tileID;for(;h.overscaledZ>0;){if(h.key in this._loadedParentTiles){a=this._loadedParentTiles[h.key];break}o.push(h.key);const m=h.scaledTo(h.overscaledZ-1);if(a=this._getLoadedTile(m),a)break;h=m}for(const m of o)this._loadedParentTiles[m]=a}}_addTile(t){let o=this._tiles[t.key];if(o)return o;o=this._cache.getAndRemove(t),o&&(this._setTileReloadTimer(t.key,o),o.tileID=t,this._state.initializeTileState(
9o,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,o)));const a=o;return o||(o=new ar(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(o,this._tileLoaded.bind(this,o,t.key,o.state))),o.uses++,this._tiles[t.key]=o,a||this._source.fire(new l.k("dataloading",{tile:o,coord:o.tileID,dataType:"source"})),o}_setTileReloadTimer(t,o){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const a=o.getExpiryTimeout();a&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},a))}_removeTile(t){const o=this._tiles[t];o&&(o.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),o.uses>0||(o.hasData()&&o.state!=="reloading"?this._cache.add(o.tileID,o,o.getExpiryTimeout()):(o.aborted=!0,this._abortTile(o),this._unloadTile(o))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,o,a){const h=[],m=this.transform;if(!m)return h;const x=a?m.getCameraQueryGeometry(t):t,w=t.map(W=>m.pointCoordinate(W,this.terrain)),A=x.map(W=>m.pointCoordinate(W,this.terrain)),E=this.getIds();let k=1/0,z=1/0,U=-1/0,K=-1/0;for(const W of A)k=Math.min(k,W.x),z=Math.min(z,W.y),U=Math.max(U,W.x),K=Math.max(K,W.y);for(let W=0;W<E.length;W++){const J=this._tiles[E[W]];if(J.holdingForFade())continue;const G=J.tileID,ce=Math.pow(2,m.zoom-J.tileID.overscaledZ),xe=o*J.queryPadding*l.N/J.tileSize/ce,ie=[G.getTilePoint(new l.U(k,z)),G.getTilePoint(new l.U(U,K))];if(ie[0].x-xe<l.N&&ie[0].y-xe<l.N&&ie[1].x+xe>=0&&ie[1].y+xe>=0){const he=w.map(Te=>G.getTilePoint(Te)),we=A.map(Te=>G.getTilePoint(Te));h.push({tile:J,tileID:G,queryGeometry:he,cameraQueryGeometry:we,scale:ce})}}return h}getVisibleCoordinates(t){const o=this.getRenderableIds(t).map(a=>this._tiles[a].tileID);for(const a of o)a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped());return o}hasTransition(){if(this._source.hasTransition())return!0;if(yi(this._source.type)){const t=l.h.now();for(const o in this._tiles)if(this._tiles[o].fadeEndTime>=t)return!0}return!1}setFeatureState(t,o,a){this._state.updateState(t=t||"_geojsonTileLayer",o,a)}removeFeatureState(t,o,a){this._state.removeFeatureState(t=t||"_geojsonTileLayer",o,a)}getFeatureState(t,o){return this._state.getState(t=t||"_geojsonTileLayer",o)}setDependencies(t,o,a){const h=this._tiles[t];h&&h.setDependencies(o,a)}reloadTilesForDependencies(t,o){for(const a in this._tiles)this._tiles[a].hasDependency(t,o)&&this._reloadTile(a,"reloading");this._cache.filter(a=>!a.hasDependency(t,o))}}function Bn(d,t){const o=Math.abs(2*d.wrap)-+(d.wrap<0),a=Math.abs(2*t.wrap)-+(t.wrap<0);return d.overscaledZ-t.overscaledZ||a-o||t.canonical.y-d.canonical.y||t.canonical.x-d.canonical.x}function yi(d){return d==="raster"||d==="image"||d==="video"}hn.maxOverzooming=10,hn.maxUnderzooming=3;const li="mapboxgl_preloaded_worker_pool";class xr{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<xr.workerCount;)this.workers.push(new Worker(l.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],this.numActive()===0&&(this.workers.forEach(o=>{o.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[li]}numActive(){return Object.keys(this.active).length}}const Qr=Math.floor(l.h.hardwareConcurrency/2);let br;function vs(){return br||(br=new xr),br}xr.workerCount=l.ac(globalThis)?Math.max(Math.min(Qr,3),1):1;class Ko{constructor(t,o){this.reset(t,o)}reset(t,o){this.points=t||[],this._distances=[0];for(let a=1;a<this.points.length;a++)this._distances[a]=this._distances[a-1]+this.points[a].dist(this.points[a-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(o||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(this.points.length===1)return this.points[0];t=l.ad(t,0,1);let o=1,a=this._distances[o];const h=t*this.paddedLength+this.padding;
vendor: 4,351 bytes, line 9
9for(;a<h&&o<this._distances.length;)a=this._distances[++o];const m=o-1,x=this._distances[m],w=a-x,A=w>0?(h-x)/w:0;return this.points[m].mult(1-A).add(this.points[o].mult(A))}}function zr(d,t){let o=!0;return d==="always"||d!=="never"&&t!=="never"||(o=!1),o}class eo{constructor(t,o,a){const h=this.boxCells=[],m=this.circleCells=[];this.xCellCount=Math.ceil(t/a),this.yCellCount=Math.ceil(o/a);for(let x=0;x<this.xCellCount*this.yCellCount;x++)h.push([]),m.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=o,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,o,a,h,m){this._forEachCell(o,a,h,m,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(o),this.bboxes.push(a),this.bboxes.push(h),this.bboxes.push(m)}insertCircle(t,o,a,h){this._forEachCell(o-h,a-h,o+h,a+h,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(o),this.circles.push(a),this.circles.push(h)}_insertBoxCell(t,o,a,h,m,x){this.boxCells[m].push(x)}_insertCircleCell(t,o,a,h,m,x){this.circleCells[m].push(x)}_query(t,o,a,h,m,x,w){if(a<0||t>this.width||h<0||o>this.height)return[];const A=[];if(t<=0&&o<=0&&this.width<=a&&this.height<=h){if(m)return[{key:null,x1:t,y1:o,x2:a,y2:h}];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 k=this.circles[3*E],z=this.circles[3*E+1],U=this.circles[3*E+2];A.push({key:this.circleKeys[E],x1:k-U,y1:z-U,x2:k+U,y2:z+U})}}else this._forEachCell(t,o,a,h,this._queryCell,A,{hitTest:m,overlapMode:x,seenUids:{box:{},circle:{}}},w);return A}query(t,o,a,h){return this._query(t,o,a,h,!1,null)}hitTest(t,o,a,h,m,x){return this._query(t,o,a,h,!0,m,x).length>0}hitTestCircle(t,o,a,h,m){const x=t-a,w=t+a,A=o-a,E=o+a;if(w<0||x>this.width||E<0||A>this.height)return!1;const k=[];return this._forEachCell(x,A,w,E,this._queryCellCircle,k,{hitTest:!0,overlapMode:h,circle:{x:t,y:o,radius:a},seenUids:{box:{},circle:{}}},m),k.length>0}_queryCell(t,o,a,h,m,x,w,A){const{seenUids:E,hitTest:k,overlapMode:z}=w,U=this.boxCells[m];if(U!==null){const W=this.bboxes;for(const J of U)if(!E.box[J]){E.box[J]=!0;const G=4*J,ce=this.boxKeys[J];if(t<=W[G+2]&&o<=W[G+3]&&a>=W[G+0]&&h>=W[G+1]&&(!A||A(ce))&&(!k||!zr(z,ce.overlapMode))&&(x.push({key:ce,x1:W[G],y1:W[G+1],x2:W[G+2],y2:W[G+3]}),k))return!0}}const K=this.circleCells[m];if(K!==null){const W=this.circles;for(const J of K)if(!E.circle[J]){E.circle[J]=!0;const G=3*J,ce=this.circleKeys[J];if(this._circleAndRectCollide(W[G],W[G+1],W[G+2],t,o,a,h)&&(!A||A(ce))&&(!k||!zr(z,ce.overlapMode))){const xe=W[G],ie=W[G+1],he=W[G+2];if(x.push({key:ce,x1:xe-he,y1:ie-he,x2:xe+he,y2:ie+he}),k)return!0}}}return!1}_queryCellCircle(t,o,a,h,m,x,w,A){const{circle:E,seenUids:k,overlapMode:z}=w,U=this.boxCells[m];if(U!==null){const W=this.bboxes;for(const J of U)if(!k.box[J]){k.box[J]=!0;const G=4*J,ce=this.boxKeys[J];if(this._circleAndRectCollide(E.x,E.y,E.radius,W[G+0],W[G+1],W[G+2],W[G+3])&&(!A||A(ce))&&!zr(z,ce.overlapMode))return x.push(!0),!0}}const K=this.circleCells[m];if(K!==null){const W=this.circles;for(const J of K)if(!k.circle[J]){k.circle[J]=!0;const G=3*J,ce=this.circleKeys[J];if(this._circlesCollide(W[G],W[G+1],W[G+2],E.x,E.y,E.radius)&&(!A||A(ce))&&!zr(z,ce.overlapMode))return x.push(!0),!0}}}_forEachCell(t,o,a,h,m,x,w,A){const E=this._convertToXCellCoord(t),k=this._convertToYCellCoord(o),z=this._convertToXCellCoord(a),U=this._convertToYCellCoord(h);for(let K=E;K<=z;K++)for(let W=k;W<=U;W++)if(m.call(this,t,o,a,h,this.xCellCount*W+K,x,w,A))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,o,a,h,m,x){const w=h-t,A=m-o,E=a+x;return E*E>w*w+A*A}_circleAndRectCollide(t,o,a,h,m,x,w){const A=(x-h)/2,E=Math.abs(t-(h+A));if(E>A+a)return!1;const k=(w-m)/2,z=Math.abs(o-(m+k));if(z>k+a)return!1;if(E<=A||z<=k)return!0;const U=E-A,K=z-k;return U*U+K*K<=a*a}}function Fe(d,t,o,a,h){const m=l.Z();return t?(l.a0(m,m,[1/h,1/h,1]),o||l.ae(m,m,a.angle)):l.a1(m,a.labelPlaneMatr
9ix,d),m}function lr(d,t,o,a,h){if(t){const m=l.af(d);return l.a0(m,m,[h,h,1]),o||l.ae(m,m,-a.angle),m}return a.glCoordMatrix}function Ci(d,t,o){let a;o?(a=[d.x,d.y,o(d.x,d.y),1],l.ag(a,a,t)):(a=[d.x,d.y,0,1],Q(a,a,t));const h=a[3];return{point:new l.P(a[0]/h,a[1]/h),signedDistanceFromCamera:h}}function to(d,t){return .5+d/t*.5}function Dr(d,t){const o=d[0]/d[3],a=d[1]/d[3];return o>=-t[0]&&o<=t[0]&&a>=-t[1]&&a<=t[1]}function Oe(d,t,o,a,h,m,x,w,A,E){const k=a?d.textSizeData:d.iconSizeData,z=l.ah(k,o.transform.zoom),U=[256/o.width*2+1,256/o.height*2+1],K=a?d.text.dynamicLayoutVertexArray:d.icon.dynamicLayoutVertexArray;K.clear();const W=d.lineVertexArray,J=a?d.text.placedSymbolArray:d.icon.placedSymbolArray,G=o.transform.width/o.transform.height;let ce=!1;for(let xe=0;xe<J.length;xe++){const ie=J.get(xe);if(ie.hidden||ie.writingMode===l.ai.vertical&&!ce){q(ie.numGlyphs,K);continue}let he;if(ce=!1,E?(he=[ie.anchorX,ie.anchorY,E(ie.anchorX,ie.anchorY),1],l.ag(he,he,t)):(he=[ie.anchorX,ie.anchorY,0,1],Q(he,he,t)),!Dr(he,U)){q(ie.numGlyphs,K);continue}const we=to(o.transform.cameraToCenterDistance,he[3]),Te=l.aj(k,z,ie),Ie=x?Te/we:Te*we,ke=new l.P(ie.anchorX,ie.anchorY),Ce=Ci(ke,h,E).point,Be={projections:{},offsets:{}},tt=dn(ie,Ie,!1,w,t,h,m,d.glyphOffsetArray,W,K,Ce,ke,Be,G,A,E);ce=tt.useVertical,(tt.notEnoughRoom||ce||tt.needsFlipping&&dn(ie,Ie,!0,w,t,h,m,d.glyphOffsetArray,W,K,Ce,ke,Be,G,A,E).notEnoughRoom)&&q(ie.numGlyphs,K)}a?d.text.dynamicLayoutVertexBuffer.updateData(K):d.icon.dynamicLayoutVertexBuffer.updateData(K)}function Rt(d,t,o,a,h,m,x,w,A,E,k,z,U){const K=w.glyphStartIndex+w.numGlyphs,W=w.lineStartIndex,J=w.lineStartIndex+w.lineLength,G=t.getoffsetX(w.glyphStartIndex),ce=t.getoffsetX(K-1),xe=B(d*G,o,a,h,m,x,w.segment,W,J,A,E,k,z,U);if(!xe)return null;const ie=B(d*ce,o,a,h,m,x,w.segment,W,J,A,E,k,z,U);return ie?{first:xe,last:ie}:null}function It(d,t,o,a){return d===l.ai.horizontal&&Math.abs(o.y-t.y)>Math.abs(o.x-t.x)*a?{useVertical:!0}:(d===l.ai.vertical?t.y<o.y:t.x>o.x)?{needsFlipping:!0}:null}function dn(d,t,o,a,h,m,x,w,A,E,k,z,U,K,W,J){const G=t/24,ce=d.lineOffsetX*G,xe=d.lineOffsetY*G;let ie;if(d.numGlyphs>1){const he=d.glyphStartIndex+d.numGlyphs,we=d.lineStartIndex,Te=d.lineStartIndex+d.lineLength,Ie=Rt(G,w,ce,xe,o,k,z,d,A,m,U,W,J);if(!Ie)return{notEnoughRoom:!0};const ke=Ci(Ie.first.point,x,J).point,Ce=Ci(Ie.last.point,x,J).point;if(a&&!o){const Be=It(d.writingMode,ke,Ce,K);if(Be)return Be}ie=[Ie.first];for(let Be=d.glyphStartIndex+1;Be<he-1;Be++)ie.push(B(G*w.getoffsetX(Be),ce,xe,o,k,z,d.segment,we,Te,A,m,U,W,J));ie.push(Ie.last)}else{if(a&&!o){const we=Ci(z,h,J).point,Te=d.lineStartIndex+d.segment+1,Ie=new l.P(A.getx(Te),A.gety(Te)),ke=Ci(Ie,h,J),Ce=ke.signedDistanceFromCamera>0?ke.point:cr(z,Ie,we,1,h,J),Be=It(d.writingMode,we,Ce,K);if(Be)return Be}const he=B(G*w.getoffsetX(d.glyphStartIndex),ce,xe,o,k,z,d.segment,d.lineStartIndex,d.lineStartIndex+d.lineLength,A,m,U,W,J);if(!he)return{notEnoughRoom:!0};ie=[he]}for(const he of ie)l.ak(E,he.point,he.angle);return{}}function cr(d,t,o,a,h,m){const x=Ci(d.add(d.sub(t)._unit()),h,m).point,w=o.sub(x);return o.add(w._mult(a/w.mag()))}function Et(d,t){const{projectionCache:o,lineVertexArray:a,labelPlaneMatrix:h,tileAnchorPoint:m,distanceFromAnchor:x,getElevation:w,previousVertex:A,direction:E,absOffsetX:k}=t;if(o.projections[d])return o.projections[d];const z=new l.P(a.getx(d),a.gety(d)),U=Ci(z,h,w);if(U.signedDistanceFromCamera>0)return o.projections[d]=U.point,U.point;const K=d-E;return cr(x===0?m:new l.P(a.getx(K),a.gety(K)),z,A,k-x+1,h,w)}function Rr(d,t,o){return d._unit()._perp()._mult(t*o)}function Y(d,t,o,a,h,m,x,w){const{projectionCache:A,direction:E}=w;
9if(A.offsets[d])return A.offsets[d];const k=o.add(t);if(d+E<a||d+E>=h)return A.offsets[d]=k,k;const z=Et(d+E,w),U=Rr(z.sub(o),x,E),K=o.add(U),W=z.add(U);return A.offsets[d]=l.al(m,k,K,W)||k,A.offsets[d]}function B(d,t,o,a,h,m,x,w,A,E,k,z,U,K){const W=a?d-t:d+t;let J=W>0?1:-1,G=0;a&&(J*=-1,G=Math.PI),J<0&&(G+=Math.PI);let ce,xe,ie=J>0?w+x:w+x+1,he=h,we=h,Te=0,Ie=0;const ke=Math.abs(W),Ce=[];let Be;for(;Te+Ie<=ke;){if(ie+=J,ie<w||ie>=A)return null;Te+=Ie,we=he,xe=ce;const Ve={projectionCache:z,lineVertexArray:E,labelPlaneMatrix:k,tileAnchorPoint:m,distanceFromAnchor:Te,getElevation:K,previousVertex:we,direction:J,absOffsetX:ke};if(he=Et(ie,Ve),o===0)Ce.push(we),Be=he.sub(we);else{let gt;const ot=he.sub(we);gt=ot.mag()===0?Rr(Et(ie+J,Ve).sub(he),o,J):Rr(ot,o,J),xe||(xe=we.add(gt)),ce=Y(ie,gt,he,w,A,xe,o,Ve),Ce.push(xe),Be=ce.sub(xe)}Ie=Be.mag()}const tt=Be._mult((ke-Te)/Ie)._add(xe||we),Yt=G+Math.atan2(he.y-we.y,he.x-we.x);return Ce.push(tt),{point:tt,angle:U?Yt:0,path:Ce}}const F=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function q(d,t){for(let o=0;o<d;o++){const a=t.length;t.resize(a+4),t.float32.set(F,3*a)}}function Q(d,t,o){const a=t[0],h=t[1];return d[0]=o[0]*a+o[4]*h+o[12],d[1]=o[1]*a+o[5]*h+o[13],d[3]=o[3]*a+o[7]*h+o[15],d}const ee=100;class fe{constructor(t,o=new eo(t.width+200,t.height+200,25),a=new eo(t.width+200,t.height+200,25)){this.transform=t,this.grid=o,this.ignoredGrid=a,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+ee,this.screenBottomBoundary=t.height+ee,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,o,a,h,m,x){const w=this.projectAndGetPerspectiveRatio(h,t.anchorPointX,t.anchorPointY,x),A=a*w.perspectiveRatio,E=t.x1*A+w.point.x,k=t.y1*A+w.point.y,z=t.x2*A+w.point.x,U=t.y2*A+w.point.y;return!this.isInsideGrid(E,k,z,U)||o!=="always"&&this.grid.hitTest(E,k,z,U,o,m)||w.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[E,k,z,U],offscreen:this.isOffscreen(E,k,z,U)}}placeCollisionCircles(t,o,a,h,m,x,w,A,E,k,z,U,K,W){const J=[],G=new l.P(o.anchorX,o.anchorY),ce=Ci(G,x,W),xe=to(this.transform.cameraToCenterDistance,ce.signedDistanceFromCamera),ie=(k?m/xe:m*xe)/l.ap,he=Ci(G,w,W).point,we=Rt(ie,h,o.lineOffsetX*ie,o.lineOffsetY*ie,!1,he,G,o,a,w,{projections:{},offsets:{}},!1,W);let Te=!1,Ie=!1,ke=!0;if(we){const Ce=.5*U*xe+K,Be=new l.P(-100,-100),tt=new l.P(this.screenRightBoundary,this.screenBottomBoundary),Yt=new Ko,Ve=we.first,gt=we.last;let ot=[];for(let Nt=Ve.path.length-1;Nt>=1;Nt--)ot.push(Ve.path[Nt]);for(let Nt=1;Nt<gt.path.length;Nt++)ot.push(gt.path[Nt]);const wi=2.5*Ce;if(A){const Nt=ot.map(Jt=>Ci(Jt,A,W));ot=Nt.some(Jt=>Jt.signedDistanceFromCamera<=0)?[]:Nt.map(Jt=>Jt.point)}let Kt=[];if(ot.length>0){const Nt=ot[0].clone(),Jt=ot[0].clone();for(let $i=1;$i<ot.length;$i++)Nt.x=Math.min(Nt.x,ot[$i].x),Nt.y=Math.min(Nt.y,ot[$i].y),Jt.x=Math.max(Jt.x,ot[$i].x),Jt.y=Math.max(Jt.y,ot[$i].y);Kt=Nt.x>=Be.x&&Jt.x<=tt.x&&Nt.y>=Be.y&&Jt.y<=tt.y?[ot]:Jt.x<Be.x||Nt.x>tt.x||Jt.y<Be.y||Nt.y>tt.y?[]:l.am([ot],Be.x,Be.y,tt.x,tt.y)}for(const Nt of Kt){Yt.reset(Nt,.25*Ce);let Jt=0;Jt=Yt.length<=.5*Ce?1:Math.ceil(Yt.paddedLength/wi)+1;for(let $i=0;$i<Jt;$i++){const ki=$i/Math.max(Jt-1,1),xn=Yt.lerp(ki),nn=xn.x+ee,Ki=xn.y+ee;J.push(nn,Ki,Ce,0);const fr=nn-Ce,Di=Ki-Ce,po=nn+Ce,fo=Ki+Ce;if(ke=ke&&this.isOffscreen(fr,Di,po,fo),Ie=Ie||this.isInsideGrid(fr,Di,po,fo),t!=="always"&&this.grid.hitTestCircle(nn,Ki,Ce,t,z)&&(Te=!0,!E))return{circles:[],offscreen:!1,collisionDetected:Te}}}}return{circles:!E&&Te||!Ie||xe<this.perspectiveRatioCutoff?[]:J,offscreen:ke,collisionDetected:Te}}queryRenderedSymbols(t){if(t.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const o=[];let a=1/0,h=1/0,m=-1/0,x=-1/0;for(const k of t){const z=new l.P(k.x+ee,k.y+ee);a=Math.min(a,z.x),h=Math.min(h,z.y),m=Math.max(m,z.x),x=Math.max(x,z.y),o.push(z)}const w=this.grid.query(a,h,m,x).concat(this.ignoredGrid.query(a,h,m,x)),A={},E={};for(const k of w){const z=k.key;if(A[z.bucketInstanceId]===void 0&&(A[z.bucketInstanceId]={}),A[z.bucketInstanceId][z.featureIndex])continue;const U=[new l.P(k.x1,k.y1),new l.P(k.x2,k.y1),new l.P(k.x2,k.y2),new l.P(k.x1,k.y2)];l.an(o,U)&&(A[z.bucketInstanceId][z.featureIndex]=!0,E[z.bucketInstanceId]===void 0&&(E[z.bucketInstanceId]=[]),E[z.bucketInstanceId].push(z.featureIndex))}return E}insertCollisionBox(t,o,a,h,m,x){(a?this.ignoredGrid:this.grid).insert({bucketInstanceId:h,featureIndex:m,collisionGroupID:x,overlapMode:o},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,o,a,h,m,x){const w=a?this.ignoredGrid:this.grid,A={bucketInstanceId:h,featureIndex:m,collisionGroupID:x,overlapMode:o};for(let E=0;E<t.length;
9E+=4)w.insertCircle(A,t[E],t[E+1],t[E+2])}projectAndGetPerspectiveRatio(t,o,a,h){let m;return h?(m=[o,a,h(o,a),1],l.ag(m,m,t)):(m=[o,a,0,1],Q(m,m,t)),{point:new l.P((m[0]/m[3]+1)/2*this.transform.width+ee,(-m[1]/m[3]+1)/2*this.transform.height+ee),perspectiveRatio:.5+this.transform.cameraToCenterDistance/m[3]*.5}}isOffscreen(t,o,a,h){return a<ee||t>=this.screenRightBoundary||h<ee||o>this.screenBottomBoundary}isInsideGrid(t,o,a,h){return a>=0&&t<this.gridRightBoundary&&h>=0&&o<this.gridBottomBoundary}getViewportMatrix(){const t=l.ao([]);return l.$(t,t,[-100,-100,0]),t}}function le(d,t,o){return t*(l.N/(d.tileSize*Math.pow(2,o-d.tileID.overscaledZ)))}class re{constructor(t,o,a,h){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?o:-o))):h&&a?1:0,this.placed=a}isHidden(){return this.opacity===0&&!this.placed}}class ue{constructor(t,o,a,h,m){this.text=new re(t?t.text:null,o,a,m),this.icon=new re(t?t.icon:null,o,h,m)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ae{constructor(t,o,a){this.text=t,this.icon=o,this.skipFade=a}}class _e{constructor(){this.invProjMatrix=l.Z(),this.viewportMatrix=l.Z(),this.circles=[]}}class Le{constructor(t,o,a,h,m){this.bucketInstanceId=t,this.featureIndex=o,this.sourceLayerIndex=a,this.bucketIndex=h,this.tileID=m}}class lt{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const o=++this.maxGroupID;this.collisionGroups[t]={ID:o,predicate:a=>a.collisionGroupID===o}}return this.collisionGroups[t]}}function vt(d,t,o,a,h){const{horizontalAlign:m,verticalAlign:x}=l.au(d);return new l.P(-(m-.5)*t+a[0]*h,-(x-.5)*o+a[1]*h)}function Ye(d,t,o,a,h,m){const{x1:x,x2:w,y1:A,y2:E,anchorPointX:k,anchorPointY:z}=d,U=new l.P(t,o);return a&&U._rotate(h?m:-m),{x1:x+U.x,y1:A+U.y,x2:w+U.x,y2:E+U.y,anchorPointX:k,anchorPointY:z}}class ct{constructor(t,o,a,h,m){this.transform=t.clone(),this.terrain=o,this.collisionIndex=new fe(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=a,this.retainedQueryData={},this.collisionGroups=new lt(h),this.collisionCircleArrays={},this.prevPlacement=m,m&&(m.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,o,a,h){const m=a.getBucket(o),x=a.latestFeatureIndex;if(!m||!x||o.id!==m.layerIds[0])return;const w=a.collisionBoxArray,A=m.layers[0].layout,E=Math.pow(2,this.transform.zoom-a.tileID.overscaledZ),k=a.tileSize/l.N,z=this.transform.calculatePosMatrix(a.tileID.toUnwrapped()),U=A.get("text-pitch-alignment")==="map",K=A.get("text-rotation-alignment")==="map",W=le(a,1,this.transform.zoom),J=Fe(z,U,K,this.transform,W);let G=null;if(U){const xe=lr(z,U,K,this.transform,W);G=l.a1([],this.transform.labelPlaneMatrix,xe)}this.retainedQueryData[m.bucketInstanceId]=new Le(m.bucketInstanceId,x,m.sourceLayerIndex,m.index,a.tileID);const ce={bucket:m,layout:A,posMatrix:z,textLabelPlaneMatrix:J,labelToScreenMatrix:G,scale:E,textPixelRatio:k,holdingForFade:a.holdingForFade(),collisionBoxArray:w,partiallyEvaluatedTextSize:l.ah(m.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(m.sourceID)};if(h)for(const xe of m.sortKeyRanges){const{sortKey:ie,symbolInstanceStart:he,symbolInstanceEnd:we}=xe;t.push({sortKey:ie,symbolInstanceStart:he,symbolInstanceEnd:we,parameters:ce})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:m.symbolInstances.length,parameters:ce})}attemptAnchorPlacement(t,o,a,h,m,x,w,A,E,k,z,U,K,W,J,G){const ce=l.aq[t.textAnchor],xe=[t.textOffset0,t.textOffset1],ie=vt(ce,a,h,xe,m),he=this.collisionIndex.placeCollisionBox(Ye(o,ie.x,ie.y,x,w,this.transform.angle),z,A,E,k.predicate,G);if((!J||this.collisionIndex.placeCollisionBox(Ye(J,ie.x,ie.y,x,w,this.transform.angle),z,A,E,k.predicate,G).box.length!==0)&&he.box.length>0){let we;if(this.prevPlacement&&this.prevPlacement.variableOffsets[U.crossTileID]&&this.prevPlacement.placements[U.crossTileID]&&this.prevPlacement.placements[U.crossTileID].text&&(we=this.prevPlacement.variableOffsets[U.crossTileID].anchor),U.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[U.crossTileID]={textOffset:xe,width:a,height:h,anchor:ce,textBoxScale:m,prevAnchor:we},this.markUsedJustification(K,ce,U,W),K.allowVerticalPlacement&&(this.markUsedOrientation(K,W,U),this.placedOrientations[U.crossTileID]=W),{shift:ie,placedGlyphBoxes:he}}}placeLayerBucketPart(t,o,a){const{bucket:h,layout:m,posMatrix:x,textLabelPlaneMatr
9ix:w,labelToScreenMatrix:A,textPixelRatio:E,holdingForFade:k,collisionBoxArray:z,partiallyEvaluatedTextSize:U,collisionGroup:K}=t.parameters,W=m.get("text-optional"),J=m.get("icon-optional"),G=l.ar(m,"text-overlap","text-allow-overlap"),ce=G==="always",xe=l.ar(m,"icon-overlap","icon-allow-overlap"),ie=xe==="always",he=m.get("text-rotation-alignment")==="map",we=m.get("text-pitch-alignment")==="map",Te=m.get("icon-text-fit")!=="none",Ie=m.get("symbol-z-order")==="viewport-y",ke=ce&&(ie||!h.hasIconData()||J),Ce=ie&&(ce||!h.hasTextData()||W);!h.collisionArrays&&z&&h.deserializeCollisionBoxes(z);const Be=this.retainedQueryData[h.bucketInstanceId].tileID,tt=this.terrain?(Ve,gt)=>this.terrain.getElevation(Be,Ve,gt):null,Yt=(Ve,gt)=>{var ot,wi;if(o[Ve.crossTileID])return;if(k)return void(this.placements[Ve.crossTileID]=new Ae(!1,!1,!1));let Kt=!1,Nt=!1,Jt=!0,$i=null,ki={box:null,offscreen:null},xn={box:null,offscreen:null},nn=null,Ki=null,fr=null,Di=0,po=0,fo=0;gt.textFeatureIndex?Di=gt.textFeatureIndex:Ve.useRuntimeCollisionCircles&&(Di=Ve.featureIndex),gt.verticalTextFeatureIndex&&(po=gt.verticalTextFeatureIndex);const ds=gt.textBox;if(ds){const Mn=qi=>{let rn=l.ai.horizontal;if(h.allowVerticalPlacement&&!qi&&this.prevPlacement){const tr=this.prevPlacement.placedOrientations[Ve.crossTileID];tr&&(this.placedOrientations[Ve.crossTileID]=tr,rn=tr,this.markUsedOrientation(h,rn,Ve))}return rn},bn=(qi,rn)=>{if(h.allowVerticalPlacement&&Ve.numVerticalGlyphVertices>0&&gt.verticalTextBox){for(const tr of h.writingModes)if(tr===l.ai.vertical?(ki=rn(),xn=ki):ki=qi(),ki&&ki.box&&ki.box.length)break}else ki=qi()},Vn=Ve.textAnchorOffsetStartIndex,Fs=Ve.textAnchorOffsetEndIndex;if(Fs===Vn){const qi=(rn,tr)=>{const Gi=this.collisionIndex.placeCollisionBox(rn,G,E,x,K.predicate,tt);return Gi&&Gi.box&&Gi.box.length&&(this.markUsedOrientation(h,tr,Ve),this.placedOrientations[Ve.crossTileID]=tr),Gi};bn(()=>qi(ds,l.ai.horizontal),()=>{const rn=gt.verticalTextBox;return h.allowVerticalPlacement&&Ve.numVerticalGlyphVertices>0&&rn?qi(rn,l.ai.vertical):{box:null,offscreen:null}}),Mn(ki&&ki.box&&ki.box.length)}else{let qi=l.aq[(wi=(ot=this.prevPlacement)===null||ot===void 0?void 0:ot.variableOffsets[Ve.crossTileID])===null||wi===void 0?void 0:wi.anchor];const rn=(Gi,Ns,ul)=>{const lc=Gi.x2-Gi.x1,cc=Gi.y2-Gi.y1,Qc=Ve.textBoxScale,Vl=Te&&xe==="never"?Ns:null;let mo={box:[],offscreen:!1},Us=G==="never"?1:2,_o="never";qi&&Us++;for(let Cr=0;Cr<Us;Cr++){for(let go=Vn;go<Fs;go++){const Zl=h.textAnchorOffsets.get(go);if(qi&&Zl.textAnchor!==qi)continue;const $o=this.attemptAnchorPlacement(Zl,Gi,lc,cc,Qc,he,we,E,x,K,_o,Ve,h,ul,Vl,tt);if($o&&(mo=$o.placedGlyphBoxes,mo&&mo.box&&mo.box.length))return Kt=!0,$i=$o.shift,mo}qi?qi=null:_o=G}return mo};bn(()=>rn(ds,gt.iconBox,l.ai.horizontal),()=>{const Gi=gt.verticalTextBox;return h.allowVerticalPlacement&&!(ki&&ki.box&&ki.box.length)&&Ve.numVerticalGlyphVertices>0&&Gi?rn(Gi,gt.verticalIconBox,l.ai.vertical):{box:null,offscreen:null}}),ki&&(Kt=ki.box,Jt=ki.offscreen);const tr=Mn(ki&&ki.box);if(!Kt&&this.prevPlacement){const Gi=this.prevPlacement.variableOffsets[Ve.crossTileID];Gi&&(this.variableOffsets[Ve.crossTileID]=Gi,this.markUsedJustification(h,Gi.anchor,Ve,tr))}}}if(nn=ki,Kt=nn&&nn.box&&nn.box.length>0,Jt=nn&&nn.offscreen,Ve.useRuntimeCollisionCircles){const Mn=h.text.placedSymbolArray.get(Ve.centerJustifiedTextSymbolIndex),bn=l.aj(h.textSizeData,U,Mn),Vn=m.get("text-padding");Ki=this.collisionIndex.placeCollisionCircles(G,Mn,h.lineVertexArray,h.glyphOffsetArray,bn,x,w,A,a,we,K.predicate,Ve.collisionCircleDiameter,Vn,tt),Ki.circles.length&&Ki.collisionDetected&&!a&&l.w("Collisions detected, but collision boxes are not shown"),Kt=ce||Ki.circles.length>0&&!Ki.collisionDetected,Jt=Jt&&Ki.offscreen}if(gt.iconFeatureIndex&&(fo=gt.iconFeatureIndex),gt.iconBox){const Mn=bn=>{const Vn=Te&&$i?Ye(bn,$i.x,$i.y,he,we,this.transform.angle):bn;return this.collisionIndex.placeCollisionBox(Vn,xe,E,x,K.predicate,tt)};xn&&xn.box&&xn.box.length&&gt.verticalIconBox?(fr=Mn(gt.verticalIconBox),Nt=fr.box.length>0):(fr=Mn(gt.iconBox),Nt=fr.box.length>0),Jt=Jt&&fr.offscreen}const Os=W||Ve.numHorizontalGlyphVertices===0&&Ve.numVerticalGlyphVertices===0,_a=J||Ve.numIconVertices===0;if(Os||_a?_a?Os||(Nt=Nt&&Kt):Kt=Nt&&Kt:Nt=Kt=Nt&&Kt,Kt&&nn&&nn.box&&this.collisionIndex.insertCollisionBox(nn.box,G,m.get("text-ignore-placement"),h.bucketInstanceId,xn&&xn.box&&po?po:Di,K.ID),Nt&&fr&&this.collisionIndex.insertCollisionBox(fr.box,xe,m.get("icon-ignore-placement"),h.bucketInstanceId,fo,K.ID),Ki&&(Kt&&this.collisionIndex.insertCollisionCircles(Ki.circles,G,m.get("text-ignore-placement"),h.bucketInstanceId,Di,K.ID),a)){const Mn=h.bucketInstanceId;let bn=this.collisionCircleArrays[Mn];bn===void 0&&(bn=this.collisionCircleArrays[Mn]=new _e);for(let Vn=0;Vn<Ki.circles.length;Vn+=4)bn.circles.push(Ki.circles[Vn+0]),bn.circles.push(Ki.circles[Vn+1]),bn.circles.push(Ki.circles[Vn+2]),bn.circles.push(Ki.collisionDetected?1:0)}if(Ve.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(h.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Ve.crossTileID]=new Ae(Kt||ke,Nt||Ce,Jt||h.justReloaded),o[Ve.crossTileID]=!0};if(Ie){if(t.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");
vendor: 4,356 bytes, line 9
9const Ve=h.getSortedSymbolIndexes(this.transform.angle);for(let gt=Ve.length-1;gt>=0;--gt){const ot=Ve[gt];Yt(h.symbolInstances.get(ot),h.collisionArrays[ot])}}else for(let Ve=t.symbolInstanceStart;Ve<t.symbolInstanceEnd;Ve++)Yt(h.symbolInstances.get(Ve),h.collisionArrays[Ve]);if(a&&h.bucketInstanceId in this.collisionCircleArrays){const Ve=this.collisionCircleArrays[h.bucketInstanceId];l.as(Ve.invProjMatrix,x),Ve.viewportMatrix=this.collisionIndex.getViewportMatrix()}h.justReloaded=!1}markUsedJustification(t,o,a,h){let m;m=h===l.ai.vertical?a.verticalPlacedTextSymbolIndex:{left:a.leftJustifiedTextSymbolIndex,center:a.centerJustifiedTextSymbolIndex,right:a.rightJustifiedTextSymbolIndex}[l.at(o)];const x=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex,a.verticalPlacedTextSymbolIndex];for(const w of x)w>=0&&(t.text.placedSymbolArray.get(w).crossTileID=m>=0&&w!==m?0:a.crossTileID)}markUsedOrientation(t,o,a){const h=o===l.ai.horizontal||o===l.ai.horizontalOnly?o:0,m=o===l.ai.vertical?o:0,x=[a.leftJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.rightJustifiedTextSymbolIndex];for(const w of x)t.text.placedSymbolArray.get(w).placedOrientation=h;a.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).placedOrientation=m)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const o=this.prevPlacement;let a=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;const h=o?o.symbolFadeChange(t):1,m=o?o.opacities:{},x=o?o.variableOffsets:{},w=o?o.placedOrientations:{};for(const A in this.placements){const E=this.placements[A],k=m[A];k?(this.opacities[A]=new ue(k,h,E.text,E.icon),a=a||E.text!==k.text.placed||E.icon!==k.icon.placed):(this.opacities[A]=new ue(null,h,E.text,E.icon,E.skipFade),a=a||E.text||E.icon)}for(const A in m){const E=m[A];if(!this.opacities[A]){const k=new ue(E,h,!1,!1);k.isHidden()||(this.opacities[A]=k,a=a||E.text.placed||E.icon.placed)}}for(const A in x)this.variableOffsets[A]||!this.opacities[A]||this.opacities[A].isHidden()||(this.variableOffsets[A]=x[A]);for(const A in w)this.placedOrientations[A]||!this.opacities[A]||this.opacities[A].isHidden()||(this.placedOrientations[A]=w[A]);if(o&&o.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");a?this.lastPlacementChangeTime=t:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:t)}updateLayerOpacities(t,o){const a={};for(const h of o){const m=h.getBucket(t);m&&h.latestFeatureIndex&&t.id===m.layerIds[0]&&this.updateBucketOpacities(m,a,h.collisionBoxArray)}}updateBucketOpacities(t,o,a){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const h=t.layers[0],m=h.layout,x=new ue(null,0,!1,!1,!0),w=m.get("text-allow-overlap"),A=m.get("icon-allow-overlap"),E=h._unevaluatedLayout.hasValue("text-variable-anchor")||h._unevaluatedLayout.hasValue("text-variable-anchor-offset"),k=m.get("text-rotation-alignment")==="map",z=m.get("text-pitch-alignment")==="map",U=m.get("icon-text-fit")!=="none",K=new ue(null,0,w&&(A||!t.hasIconData()||m.get("icon-optional")),A&&(w||!t.hasTextData()||m.get("text-optional")),!0);!t.collisionArrays&&a&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(a);const W=(J,G,ce)=>{for(let xe=0;xe<G/4;xe++)J.opacityVertexArray.emplaceBack(ce);J.hasVisibleVertices=J.hasVisibleVertices||ce!==_n};for(let J=0;J<t.symbolInstances.length;J++){const G=t.symbolInstances.get(J),{numHorizontalGlyphVertices:ce,numVerticalGlyphVertices:xe,crossTileID:ie}=G;let he=this.opacities[ie];o[ie]?he=x:he||(he=K,this.opacities[ie]=he),o[ie]=!0;const we=G.numIconVertices>0,Te=this.placedOrientations[G.crossTileID],Ie=Te===l.ai.vertical,ke=Te===l.ai.horizontal||Te===l.ai.horizontalOnly;if(ce>0||xe>0){const Ce=en(he.text);W(t.text,ce,Ie?_n:Ce),W(t.text,xe,ke?_n:Ce);const Be=he.text.isHidden();[G.rightJustifiedTextSymbolIndex,G.centerJustifiedTextSymbolIndex,G.leftJustifiedTextSymbolIndex].forEac
9h(Ve=>{Ve>=0&&(t.text.placedSymbolArray.get(Ve).hidden=Be||Ie?1:0)}),G.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(G.verticalPlacedTextSymbolIndex).hidden=Be||ke?1:0);const tt=this.variableOffsets[G.crossTileID];tt&&this.markUsedJustification(t,tt.anchor,G,Te);const Yt=this.placedOrientations[G.crossTileID];Yt&&(this.markUsedJustification(t,"left",G,Yt),this.markUsedOrientation(t,Yt,G))}if(we){const Ce=en(he.icon),Be=!(U&&G.verticalPlacedIconSymbolIndex&&Ie);G.placedIconSymbolIndex>=0&&(W(t.icon,G.numIconVertices,Be?Ce:_n),t.icon.placedSymbolArray.get(G.placedIconSymbolIndex).hidden=he.icon.isHidden()),G.verticalPlacedIconSymbolIndex>=0&&(W(t.icon,G.numVerticalIconVertices,Be?_n:Ce),t.icon.placedSymbolArray.get(G.verticalPlacedIconSymbolIndex).hidden=he.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const Ce=t.collisionArrays[J];if(Ce){let Be=new l.P(0,0);if(Ce.textBox||Ce.verticalTextBox){let Yt=!0;if(E){const Ve=this.variableOffsets[ie];Ve?(Be=vt(Ve.anchor,Ve.width,Ve.height,Ve.textOffset,Ve.textBoxScale),k&&Be._rotate(z?this.transform.angle:-this.transform.angle)):Yt=!1}Ce.textBox&&St(t.textCollisionBox.collisionVertexArray,he.text.placed,!Yt||Ie,Be.x,Be.y),Ce.verticalTextBox&&St(t.textCollisionBox.collisionVertexArray,he.text.placed,!Yt||ke,Be.x,Be.y)}const tt=!!(!ke&&Ce.verticalIconBox);Ce.iconBox&&St(t.iconCollisionBox.collisionVertexArray,he.icon.placed,tt,U?Be.x:0,U?Be.y:0),Ce.verticalIconBox&&St(t.iconCollisionBox.collisionVertexArray,he.icon.placed,!tt,U?Be.x:0,U?Be.y:0)}}}if(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.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const J=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=J.invProjMatrix,t.placementViewportMatrix=J.viewportMatrix,t.collisionCircleArray=J.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return this.fadeDuration===0?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,o){const a=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*a>t}setStale(){this.stale=!0}}function St(d,t,o,a,h){d.emplaceBack(t?1:0,o?1:0,a||0,h||0),d.emplaceBack(t?1:0,o?1:0,a||0,h||0),d.emplaceBack(t?1:0,o?1:0,a||0,h||0),d.emplaceBack(t?1:0,o?1:0,a||0,h||0)}const ei=Math.pow(2,25),mi=Math.pow(2,24),ri=Math.pow(2,17),ti=Math.pow(2,16),pn=Math.pow(2,9),Ti=Math.pow(2,8),Vi=Math.pow(2,1);function en(d){if(d.opacity===0&&!d.placed)return 0;if(d.opacity===1&&d.placed)return 4294967295;const t=d.placed?1:0,o=Math.floor(127*d.opacity);return o*ei+t*mi+o*ri+t*ti+o*pn+t*Ti+o*Vi+t}const _n=0;class Ja{constructor(t){this._sortAcrossTiles=t.layout.get("symbol-z-order")!=="viewport-y"&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,o,a,h,m){const x=this._bucketParts;for(;this._currentTileIndex<t.length;)if(o.getBucketParts(x,h,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,m())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,x.sort((w,A)=>w.sortKey-A.sortKey));this._currentPartIndex<x.length;)if(o.placeLayerBucketPart(x[this._currentPartIndex],this._seenCrossTileIDs,a),this._currentPartIndex++,m())return!0;return!1}}class Xo{constructor(t,o,a,h,m,x,w,A){this.placement=new ct(t,o,x,w,A),this._currentPlacementIndex=a.length-1,this._forceFullPlacement=h,this._showCollisionBoxes=m,this._done=!1}isDone(){return this._done}continuePlacement(t,o,a){const h=l.h.now(),m=()=>!this._forceFullPlacement&&l.h.now()-h>2;for(;this._currentPlacementIndex>=0;){const x=o[t[this._currentPlacementIndex]],w=this.placement.collisionIndex.transform.zoom;if(x.type==="symbol"&&(!x.minzoom||x.minzoom<=w)&&(!x.maxzoom||x.maxzoom>w)){if(this._inProgressLayer||(this._inProgressLayer=new Ja(x)),this._inProgressLayer.continuePlacement(a[x.source],this.placement,this._showCollisionBoxes,x,m))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const Yo=512/l.N/2;class El{constructor(t,o,a){this.tileID=t,this.bucketInstanceId=a,this._symbolsByKey={};const h=new Map;for(let m=0;m<o.length;m++){const x=o.get(m),w=x.key,A=h.get(w);A?A.push(x):h.set(w,[x])}for(const[m,x]of h){const w={positions:x.map(A=>({x:Math.floor(A.anchorX*Yo),y:Math.floor(A.anchorY*Yo)})),crossTileIDs:x.map(A=>A.crossTileID)};if(w.positions.length>128){const A=new l.av(w.positions.length,16,Uint16Array);for(const{x:E,y:k}of w.positions)A.add(E,k);A.finish(),delete w.positions,w.index=A}this._symbolsByKey[m]=w}}getScaledCoordinates(t,o){const{x:a,y:h,z:m}=this.tileID.canonical,{x,y:w,z:A}=o.canonical,E=Yo/Math.pow(2,A-m),k=(w*l.N+t.anchorY)*E,z=h*l.N*Yo;return{x:Math.floor((x*l.N+t.anchorX)*E-a*l.N*Yo),y:Math.floor(k-z)}}
9findMatches(t,o,a){const h=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z);for(let m=0;m<t.length;m++){const x=t.get(m);if(x.crossTileID)continue;const w=this._symbolsByKey[x.key];if(!w)continue;const A=this.getScaledCoordinates(x,o);if(w.index){const E=w.index.range(A.x-h,A.y-h,A.x+h,A.y+h).sort();for(const k of E){const z=w.crossTileIDs[k];if(!a[z]){a[z]=!0,x.crossTileID=z;break}}}else if(w.positions)for(let E=0;E<w.positions.length;E++){const k=w.positions[E],z=w.crossTileIDs[E];if(Math.abs(k.x-A.x)<=h&&Math.abs(k.y-A.y)<=h&&!a[z]){a[z]=!0,x.crossTileID=z;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}}class _i{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class xs{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const o=Math.round((t-this.lng)/360);if(o!==0)for(const a in this.indexes){const h=this.indexes[a],m={};for(const x in h){const w=h[x];w.tileID=w.tileID.unwrapTo(w.tileID.wrap+o),m[w.tileID.key]=w}this.indexes[a]=m}this.lng=t}addBucket(t,o,a){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let m=0;m<o.symbolInstances.length;m++)o.symbolInstances.get(m).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const h=this.usedCrossTileIDs[t.overscaledZ];for(const m in this.indexes){const x=this.indexes[m];if(Number(m)>t.overscaledZ)for(const w in x){const A=x[w];A.tileID.isChildOf(t)&&A.findMatches(o.symbolInstances,t,h)}else{const w=x[t.scaledTo(Number(m)).key];w&&w.findMatches(o.symbolInstances,t,h)}}for(let m=0;m<o.symbolInstances.length;m++){const x=o.symbolInstances.get(m);x.crossTileID||(x.crossTileID=a.generate(),h[x.crossTileID]=!0)}return this.indexes[t.overscaledZ]===void 0&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new El(t,o.symbolInstances,o.bucketInstanceId),!0}removeBucketCrossTileIDs(t,o){for(const a of o.getCrossTileIDsLists())for(const h of a)delete this.usedCrossTileIDs[t][h]}removeStaleBuckets(t){let o=!1;for(const a in this.indexes){const h=this.indexes[a];for(const m in h)t[h[m].bucketInstanceId]||(this.removeBucketCrossTileIDs(a,h[m]),delete h[m],o=!0)}return o}}class io{constructor(){this.layerIndexes={},this.crossTileIDs=new _i,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,o,a){let h=this.layerIndexes[t.id];h===void 0&&(h=this.layerIndexes[t.id]=new xs);let m=!1;const x={};h.handleWrapJump(a);for(const w of o){const A=w.getBucket(t);A&&t.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),h.addBucket(w.tileID,A,this.crossTileIDs)&&(m=!0),x[A.bucketInstanceId]=!0)}return h.removeStaleBuckets(x)&&(m=!0),m}pruneUnusedLayers(t){const o={};t.forEach(a=>{o[a]=!0});for(const a in this.layerIndexes)o[a]||delete this.layerIndexes[a]}}const tn=(d,t)=>l.x(d,t&&t.filter(o=>o.identifier!=="source.canvas")),An=l.F(l.ax,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setGlyphs","setSprite"]),bs=l.F(l.ax,["setCenter","setZoom","setBearing","setPitch"]),Bt=l.aw();class Ht extends l.E{constructor(t,o={}){super(),this.map=t,this.dispatcher=new Mt(vs(),this,t._getMapId()),this.imageManager=new rt,this.imageManager.setEventedParent(this),this.glyphManager=new Ct(t._requestManager,o.localIdeographFontFamily),this.lineAtlas=new mt(256,512),this.crossTileSymbolIndex=new io,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new l.ay,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",l.az());const a=this;this._rtlTextPluginCallback=Ht.registerForPluginStateChange(h=>{a.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:h.pluginStatus,pluginURL:h.pluginURL},(m,x)=>{if(l.aA(m),x&&x.every(w=>w))for(const w in a.sourceCaches){const A=a.sourceCaches[w].getSource().type;A!=="vector"&&A!=="geojson"||a.sourceCaches[w].reload()}})}),this.on("data",h=>{if(h.dataType!=="source"||h.sourceDataType!=="metadata")return;const m=this.sourceCaches[h.sourceId];if(!m)return;const x=m.getSource();if(x&&x.vectorLayerIds)for(const w in this._layers){const A=this._layers[w];
9A.source===x.id&&this._validateLayer(A)}})}loadURL(t,o={},a){this.fire(new l.k("dataloading",{dataType:"style"})),o.validate=typeof o.validate!="boolean"||o.validate;const h=this.map._requestManager.transformRequest(t,pt.Style);this._request=l.f(h,(m,x)=>{this._request=null,m?this.fire(new l.j(m)):x&&this._load(x,o,a)})}loadJSON(t,o={},a){this.fire(new l.k("dataloading",{dataType:"style"})),this._request=l.h.frame(()=>{this._request=null,o.validate=o.validate!==!1,this._load(t,o,a)})}loadEmpty(){this.fire(new l.k("dataloading",{dataType:"style"})),this._load(Bt,{validate:!1})}_load(t,o,a){var h;const m=o.transformStyle?o.transformStyle(a,t):t;if(!o.validate||!tn(this,l.y(m))){this._loaded=!0,this.stylesheet=m;for(const x in m.sources)this.addSource(x,m.sources[x],{validate:!1});m.sprite?this._loadSprite(m.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(m.glyphs),this._createLayers(),this.light=new Ui(this.stylesheet.light),this.map.setTerrain((h=this.stylesheet.terrain)!==null&&h!==void 0?h:null),this.fire(new l.k("data",{dataType:"style"})),this.fire(new l.k("style.load"))}}_createLayers(){const t=l.aB(this.stylesheet.layers);this.dispatcher.broadcast("setLayers",t),this._order=t.map(o=>o.id),this._layers={},this._serializedLayers=null;for(const o of t){const a=l.aC(o);a.setEventedParent(this,{layer:{id:o.id}}),this._layers[o.id]=a}}_loadSprite(t,o=!1,a=void 0){this.imageManager.setLoaded(!1),this._spriteRequest=function(h,m,x,w){const A=at(h),E=A.length,k=x>1?"@2x":"",z={},U={},K={};for(const{id:W,url:J}of A){const G=m.transformRequest(m.normalizeSpriteURL(J,k,".json"),pt.SpriteJSON),ce=`${W}_${G.url}`;z[ce]=l.f(G,(he,we)=>{delete z[ce],U[W]=we,yt(w,U,K,he,E)});const xe=m.transformRequest(m.normalizeSpriteURL(J,k,".png"),pt.SpriteImage),ie=`${W}_${xe.url}`;z[ie]=Tt.getImage(xe,(he,we)=>{delete z[ie],K[W]=we,yt(w,U,K,he,E)})}return{cancel(){for(const W of Object.values(z))W.cancel()}}}(t,this.map._requestManager,this.map.getPixelRatio(),(h,m)=>{if(this._spriteRequest=null,h)this.fire(new l.j(h));else if(m)for(const x in m){this._spritesImagesIds[x]=[];const w=this._spritesImagesIds[x]?this._spritesImagesIds[x].filter(A=>!(A in m)):[];for(const A of w)this.imageManager.removeImage(A),this._changedImages[A]=!0;for(const A in m[x]){const E=x==="default"?A:`${x}:${A}`;this._spritesImagesIds[x].push(E),E in this.imageManager.images?this.imageManager.updateImage(E,m[x][A],!1):this.imageManager.addImage(E,m[x][A]),o&&(this._changedImages[E]=!0)}}this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),o&&(this._changed=!0),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"})),a&&a(h)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}_validateLayer(t){const o=this.sourceCaches[t.source];if(!o)return;const a=t.sourceLayer;if(!a)return;const h=o.getSource();(h.type==="geojson"||h.vectorLayerIds&&h.vectorLayerIds.indexOf(a)===-1)&&this.fire(new l.j(new Error(`Source layer "${a}" does not exist on source "${h.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){const o=this._serializedAllLayers();if(!t||t.length===0)return Object.values(o);const a=[];for(const h of t)o[h]&&a.push(o[h]);return a}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const o=Object.keys(this._layers);for(const a of o){const h=this._layers[a];h.type!=="custom"&&(t[a]=h.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const o=this._changed;if(this._changed){const h=Object.keys(this._updatedLayers),m=Object.keys(this._removedLayers);(h.length||m.length)&&this._updateWorkerLayers(h,m);for(const x in this._updatedSources){const w=this._updatedSources[x];if(w==="reload")this._reloadSource(x);else{if(w!=="clear")throw new Error(`Invalid action ${w}`);this._clearSource(x)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const x in this._updatedPaintProps)this._layers[x].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const a={};for(const h in this.sourceCaches){const m=this.sourceCaches[h];a[h]=m.used,m.used=!1}for(const h of this._order){const m=this._layers[h];m.recalculate(t,this._availableImages),!m.isHidden(t.zoom)&&m.source&&(this.sourceCaches[m.source].used=!0)}for(const h in a){const m=this.sourceCaches[h];a[h]!==m.used&&m.fire(new l.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:h}))}this.light.recalculate(t),this.z=t.zoom,o&&this.fire(new l.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const o in this.sourceCaches)this.sourceCaches[o].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,o){this.dispatcher.broadcast("updateLayers",{layers:this._serializeByIds(t),removedIds:o})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,o={}){this._checkLoaded();const a=this.serialize();if(t=o.transformStyle?o.transformStyle(a,t):t,tn(this,l.y(t)))return!1;(t=l.aD(t)).layers=l.aB(t.layers);const h=l.aE(a,t).filter(x=>!(x.command in bs));if(h.length===0)return!1;const m=h.filter(x=>!(x.command in An));if(m.length>0)throw new Error(`Unimplemented: ${m.map(x=>x.command).join(", ")}.`);for(const x of h)x.command!=="setTransition"&&this[x.command].apply(this,x.args);return this.stylesheet=t,this._serializedLayers=null,!0}addImage(t,o){if(this.getImage(t))return this.fire(new l.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,o),this._afterImageUpdated(t)}updateImage(t,o){this.imageManager.updateImage(t,o)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new l.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,o,a={}){if(this._checkLoaded(),this.sourceCaches[t]!==void 0)throw new Error(`Source "${t}" already exists.`);if(!o.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Ob
9ject.keys(o).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(o.type)>=0&&this._validate(l.y.source,`sources.${t}`,o,null,a))return;this.map&&this.map._collectResourceTiming&&(o.collectResourceTiming=!0);const h=this.sourceCaches[t]=new hn(t,o,this.dispatcher);h.style=this,h.setEventedParent(this,()=>({isSourceLoaded:h.loaded(),source:h.serialize(),sourceId:t})),h.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error("There is no source with this ID");for(const a in this._layers)if(this._layers[a].source===t)return this.fire(new l.j(new Error(`Source "${t}" cannot be removed while layer "${a}" is using it.`)));const o=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],o.fire(new l.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),o.setEventedParent(null),o.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,o){if(this._checkLoaded(),this.sourceCaches[t]===void 0)throw new Error(`There is no source with this ID=${t}`);const a=this.sourceCaches[t].getSource();if(a.type!=="geojson")throw new Error(`geojsonSource.type is ${a.type}, which is !== 'geojson`);a.setData(o),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,o,a={}){this._checkLoaded();const h=t.id;if(this.getLayer(h))return void this.fire(new l.j(new Error(`Layer "${h}" already exists on this map.`)));let m;if(t.type==="custom"){if(tn(this,l.aF(t)))return;m=l.aC(t)}else{if("source"in t&&typeof t.source=="object"&&(this.addSource(h,t.source),t=l.aD(t),t=l.e(t,{source:h})),this._validate(l.y.layer,`layers.${h}`,t,{arrayIndex:-1},a))return;m=l.aC(t),this._validateLayer(m),m.setEventedParent(this,{layer:{id:h}})}const x=o?this._order.indexOf(o):this._order.length;if(o&&x===-1)this.fire(new l.j(new Error(`Cannot add layer "${h}" before non-existing layer "${o}".`)));else{if(this._order.splice(x,0,h),this._layerOrderChanged=!0,this._layers[h]=m,this._removedLayers[h]&&m.source&&m.type!=="custom"){const w=this._removedLayers[h];delete this._removedLayers[h],w.type!==m.type?this._updatedSources[m.source]="clear":(this._updatedSources[m.source]="reload",this.sourceCaches[m.source].pause())}this._updateLayer(m),m.onAdd&&m.onAdd(this.map)}}moveLayer(t,o){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new l.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===o)return;const a=this._order.indexOf(t);this._order.splice(a,1);const h=o?this._order.indexOf(o):this._order.length;o&&h===-1?this.fire(new l.j(new Error(`Cannot move layer "${t}" before non-existing layer "${o}".`))):(this._order.splice(h,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const o=this._layers[t];if(!o)return void this.fire(new l.j(new Error(`Cannot remove non-existing layer "${t}".`)));o.setEventedParent(null);const a=this._order.indexOf(t);this._order.splice(a,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=o,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],o.onRemove&&o.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,o,a){this._checkLoaded();const h=this.getLayer(t);h?h.minzoom===o&&h.maxzoom===a||(o!=null&&(h.minzoom=o),a!=null&&(h.maxzoom=a),this._updateLayer(h)):this.fire(new l.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,o,a={}){this._checkLoaded();const h=this.getLayer(t);if(h){if(!l.aG(h.filter,o))return o==null?(h.filter=void 0,void this._updateLayer(h)):void(this._validate(l.y.filter,`layers.${h.id}.filter`,o,null,a)||(h.filter=l.aD(o),this._updateLayer(h)))}else this.fire(new l.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return l.aD(this.getLayer(t).filter)}setLayoutProperty(t,o,a,h={}){this._checkLoaded();const m=this.getLayer(t);m?l.aG(m.getLayoutProperty(o),a)||(m.setLayoutProperty(o,a,h),this._updateLayer(m)):this.fire(new l.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,o){const a=this.getLayer(t);if(a)return a.getLayoutProperty(o);this.fire(new l.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,o,a,h={}){this._checkLoaded();const m=this.getLayer(t);m?l.aG(m.getPaintProperty(o),a)||(m.setPaintProperty(o,a,h)&&this._updateLayer(m),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new l.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,o){return this.getLayer(t).getPaintProperty(o)}setFeatureState(t,o){this._checkLoaded();const a=t.source,h=t.sourceLayer,m=this.sourceCaches[a];if(m===void 0)return void this.fire(new l.j(new Error(`The source '${a}' does not exist in the map's style.`)));const x=m.getSource().type;x==="geojson"&&h?this.fire(new l.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):x!=="vector"||h?(t.id===void 0&&this.fire(new l.j(new Error("The feature id parameter must be provided."))),m.setFeatureState(h,t.id,o)):this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,o){this._checkLoaded();const a=t.source,h=this.sourceCaches[a];if(h===void 0)return void this.fire(new l.j(new Error(`The source '${a}' does not exist in the map's style.`)));const m=h.getSource().type,x=m==="vector"?t.sourceLayer:void 0;m!=="vector"||x?o&&typeof t.id!="string"&&typeof t.id!="number"?this.fire(new l.j(new Error("A feature id is required to remove its specific state property."))):h.removeFeatureState(x,t.id,o):this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const o=t.source,a=t.sourceLayer,h=this.sourceCaches[o];if(h!==void 0)return h.getSource().type!=="vector"||a?(t.id===void 0&&this.fire(new l.j(new Error("The feature id parameter must be provided."))),h.getFeatureState(a,t.id)):void this.fire(new l.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new l.j(new Error(`The source '${o}' does not exist in the map's style.`)))}getTransition(){return l.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=l.aH(this.sourceCaches,m=>m.serialize()),o=this._serializeByIds(this._order),a=this.map.getTerrain()||void 0,h=this.stylesheet;return l.aI({version:h.version,name:h.name,metadata:h.metadata,light:h.light,center:h.center,zoom:h.zoom,bearing:h.bearing,pitch:h.pitch,sprite:h.sprite,glyphs:h.glyphs,transition:h.transition,sources:t,layers:o,terrain:a},m=>m!==void 0)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&this.sourceCaches[t.source].getSource().type!=="raster"&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const o=x=>this._layers[x].type==="fill-extrusion",a={},h=[];for(let x=this._order.length-1;x>=0;x--){const w=this._order[x];if(o(w)){a[w]=x;for(const A of t){const E=A[w];if(E)for(const k of E)h.push(k)}}}h.sort((x,w)=>w.intersectionZ-x.intersectionZ);const m=[];for(let x=this._order.length-1;x>=0;x--){const w=this._order[x];if(o(w))for(let A=h.length-1;A>=0;A--){const E=h[A].feature;if(a[E.layer.id]<x)break;m.push(E),h.pop()}else for(const A of t){const E=A[w];if(E)for(const k of E)m.push(k.feature)}}return m}
9queryRenderedFeatures(t,o,a){o&&o.filter&&this._validate(l.y.filter,"queryRenderedFeatures.filter",o.filter,null,o);const h={};if(o&&o.layers){if(!Array.isArray(o.layers))return this.fire(new l.j(new Error("parameters.layers must be an Array."))),[];for(const w of o.layers){const A=this._layers[w];if(!A)return this.fire(new l.j(new Error(`The layer '${w}' does not exist in the map's style and cannot be queried for features.`))),[];h[A.source]=!0}}const m=[];o.availableImages=this._availableImages;const x=this._serializedAllLayers();for(const w in this.sourceCaches)o.layers&&!h[w]||m.push(Jr(this.sourceCaches[w],this._layers,x,t,o,a));return this.placement&&m.push(function(w,A,E,k,z,U,K){const W={},J=U.queryRenderedSymbols(k),G=[];for(const ce of Object.keys(J).map(Number))G.push(K[ce]);G.sort(vr);for(const ce of G){const xe=ce.featureIndex.lookupSymbolFeatures(J[ce.bucketInstanceId],A,ce.bucketIndex,ce.sourceLayerIndex,z.filter,z.layers,z.availableImages,w);for(const ie in xe){const he=W[ie]=W[ie]||[],we=xe[ie];we.sort((Te,Ie)=>{const ke=ce.featureSortOrder;if(ke){const Ce=ke.indexOf(Te.featureIndex);return ke.indexOf(Ie.featureIndex)-Ce}return Ie.featureIndex-Te.featureIndex});for(const Te of we)he.push(Te)}}for(const ce in W)W[ce].forEach(xe=>{const ie=xe.feature,he=E[w[ce].source].getFeatureState(ie.layer["source-layer"],ie.id);ie.source=ie.layer.source,ie.layer["source-layer"]&&(ie.sourceLayer=ie.layer["source-layer"]),ie.state=he});return W}(this._layers,x,this.sourceCaches,t,o,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(m)}querySourceFeatures(t,o){o&&o.filter&&this._validate(l.y.filter,"querySourceFeatures.filter",o.filter,null,o);const a=this.sourceCaches[t];return a?function(h,m){const x=h.getRenderableIds().map(E=>h.getTileByID(E)),w=[],A={};for(let E=0;E<x.length;E++){const k=x[E],z=k.tileID.canonical.key;A[z]||(A[z]=!0,k.querySourceFeatures(w,m))}return w}(a,o):[]}addSourceType(t,o,a){return kr(t)?a(new Error(`A source type called "${t}" already exists.`)):(((h,m)=>{So[h]=m})(t,o),o.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:o.workerSourceURL},a):a(null,null))}getLight(){return this.light.getLight()}setLight(t,o={}){this._checkLoaded();const a=this.light.getLight();let h=!1;for(const x in t)if(!l.aG(t[x],a[x])){h=!0;break}if(!h)return;const m={now:l.h.now(),transition:l.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,o),this.light.updateTransitions(m)}_validate(t,o,a,h,m={}){return(!m||m.validate!==!1)&&tn(this,t.call(l.y,l.e({key:o,style:this.serialize(),value:a,styleSpec:l.v},h)))}_remove(t=!0){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),l.aJ.off("pluginStateChange",this._rtlTextPluginCallback);for(const o in this._layers)this._layers[o].setEventedParent(null);for(const o in this.sourceCaches){const a=this.sourceCaches[o];a.setEventedParent(null),a.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const o in this.sourceCaches)this.sourceCaches[o].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,o,a,h,m=!1){let x=!1,w=!1;const A={};for(const E of this._order){const k=this._layers[E];if(k.type!=="symbol")continue;if(!A[k.source]){const U=this.sourceCaches[k.source];A[k.source]=U.getRenderableIds(!0).map(K=>U.getTileByID(K)).sort((K,W)=>W.tileID.overscaledZ-K.tileID.overscaledZ||(K.tileID.isLessThan(W.tileID)?-1:1))}const z=this.crossTileSymbolIndex.addLayer(k,A[k.source],t.center.lng);x=x||z}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((m=m||this._layerOrderChanged||a===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l.h.now(),t.zoom))&&(this.pauseablePlacement=new Xo(t,this.map.terrain,this._order,m,o,a,h,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(l.h.now()),w=!0),x&&this.pauseablePlacement.placement.setStale()),w||x)for(const E of this._order){const k=this._layers[E];k.type==="symbol"&&this.placement.updateLayerOpacities(k,A[k.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(l.h.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,o,a){this.imageManager.getImages(o.icons,a),this._updateTilesForChangedImages();const h=this.sourceCaches[o.source];h&&h.setDependencies(o.tileID.key,o.type,o.icons)}getGlyphs(t,o,a){this.glyphManager.getGlyphs(o.stacks,a);const h=this.sourceCaches[o.source];h&&h.setDependencies(o.tileID.key,o.type,[""])}getResource(t,o,a){return l.m(o,a)}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,o={}
vendor: 4,919 bytes, lines 9-68
9){this._checkLoaded(),t&&this._validate(l.y.glyphs,"glyphs",t,null,o)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,o,a={},h){this._checkLoaded();const m=[{id:t,url:o}],x=[...at(this.stylesheet.sprite),...m];this._validate(l.y.sprite,"sprite",x,null,a)||(this.stylesheet.sprite=x,this._loadSprite(m,!0,h))}removeSprite(t){this._checkLoaded();const o=at(this.stylesheet.sprite);if(o.find(a=>a.id===t)){if(this._spritesImagesIds[t])for(const a of this._spritesImagesIds[t])this.imageManager.removeImage(a),this._changedImages[a]=!0;o.splice(o.findIndex(a=>a.id===t),1),this.stylesheet.sprite=o.length>0?o:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.k("data",{dataType:"style"}))}else this.fire(new l.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return at(this.stylesheet.sprite)}setSprite(t,o={},a){this._checkLoaded(),t&&this._validate(l.y.sprite,"sprite",t,null,o)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,a):(this._unloadSprite(),a&&a(null)))}}Ht.registerForPluginStateChange=l.aK;var Io=l.Q([{name:"a_pos",type:"Int16",components:2}]),ur="attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_depth;void main() {float extent=8192.0;float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/extent;gl_Position=u_matrix*vec4(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}";const vi={prelude:ai(`#ifdef GL_ES
10precision mediump float;
11#else
12#if !defined(lowp)
13#define lowp
14#endif
15#if !defined(mediump)
16#define mediump
17#endif
18#if !defined(highp)
19#define highp
20#endif
21#endif
22`,`#ifdef GL_ES
23precision highp float;
24#else
25#if !defined(lowp)
26#define lowp
27#endif
28#if !defined(mediump)
29#define mediump
30#endif
31#if !defined(highp)
32#define highp
33#endif
34#endif
35vec2 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(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
36);}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);return (tile_units_to_pixels*pos+offset)/pattern_size;}
37#ifdef TERRAIN3D
38uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
39#endif
40const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
41#ifdef TERRAIN3D
42highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
43#else
44return 1.0;
45#endif
46}float calculate_visibility(vec4 pos) {
47#ifdef TERRAIN3D
48vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
49#else
50return 1.0;
51#endif
52}float ele(vec2 pos) {
53#ifdef TERRAIN3D
54vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
55#else
56return 0.0;
57#endif
58}float get_elevation(vec2 pos) {
59#ifdef TERRAIN3D
60vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
61#else
62return 0.0;
63#endif
64}`),background:ai(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
65#ifdef OVERDRAW_INSPECTOR
66gl_FragColor=vec4(1.0);
67#endif
68}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:ai(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;
68uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
69#ifdef OVERDRAW_INSPECTOR
70gl_FragColor=vec4(1.0);
71#endif
72}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:ai(`varying vec3 v_data;varying float v_visibility;
73#pragma mapbox: define highp vec4 color
74#pragma mapbox: define mediump float radius
75#pragma mapbox: define lowp float blur
76#pragma mapbox: define lowp float opacity
77#pragma mapbox: define highp vec4 stroke_color
78#pragma mapbox: define mediump float stroke_width
79#pragma mapbox: define lowp float stroke_opacity
80void main() {
81#pragma mapbox: initialize highp vec4 color
82#pragma mapbox: initialize mediump float radius
83#pragma mapbox: initialize lowp float blur
84#pragma mapbox: initialize lowp float opacity
85#pragma mapbox: initialize highp vec4 stroke_color
86#pragma mapbox: initialize mediump float stroke_width
87#pragma mapbox: initialize lowp float stroke_opacity
88vec2 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(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
89#ifdef OVERDRAW_INSPECTOR
90gl_FragColor=vec4(1.0);
91#endif
92}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;
93#pragma mapbox: define highp vec4 color
94#pragma mapbox: define mediump float radius
95#pragma mapbox: define lowp float blur
96#pragma mapbox: define lowp float opacity
97#pragma mapbox: define highp vec4 stroke_color
98#pragma mapbox: define mediump float stroke_width
99#pragma mapbox: define lowp float stroke_opacity
100void main(void) {
101#pragma mapbox: initialize highp vec4 color
102#pragma mapbox: initialize mediump float radius
103#pragma mapbox: initialize lowp float blur
104#pragma mapbox: initialize lowp float opacity
105#pragma mapbox: initialize highp vec4 stroke_color
106#pragma mapbox: initialize mediump float stroke_width
107#pragma mapbox: initialize lowp float stroke_opacity
108vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:ai("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:ai(`uniform highp float u_intensity;varying vec2 v_extrude;
109#pragma mapbox: define highp float weight
110#define GAUSS_COEF 0.3989422804014327
111void main() {
112#pragma mapbox: initialize highp float weight
113float 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);
114#ifdef OVERDRAW_INSPECTOR
115gl_FragColor=vec4(1.0);
116#endif
117}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
118#pragma mapbox: define highp float weight
119#pragma mapbox: define mediump float radius
120const highp float ZERO=1.0/255.0/16.0;
121#define GAUSS_COEF 0.3989422804014327
122void main(void) {
123#pragma mapbox: initialize highp float weight
124#pragma mapbox: initialize mediump float radius
125vec2 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;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:ai(`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;
126#ifdef OVERDRAW_INSPECTOR
127gl_FragColor=vec4(0.0);
128#endif
129}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:ai("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;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_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:ai("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;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;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-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(0.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:ai("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;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:ai(`#pragma mapbox: define highp vec4 color
130#pragma mapbox: define lowp float opacity
131void main() {
132#pragma mapbox: initialize highp vec4 color
133#pragma mapbox: initialize lowp float opacity
134gl_FragColor=color*opacity;
135#ifdef OVERDRAW_INSPECTOR
136gl_FragColor=vec4(1.0);
137#endif
138}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
139#pragma mapbox: define highp vec4 color
140#pragma mapbox: define lowp float opacity
141void main() {
142#pragma mapbox: initialize highp vec4 color
143#pragma mapbox: initialize lowp float opacity
144gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:ai(`varying vec2 v_pos;
145#pragma mapbox: define highp vec4 outline_color
146#pragma mapbox: define lowp float opacity
147void main() {
148#pragma mapbox: initialize highp vec4 outline_color
149#pragma mapbox: initialize lowp float opacity
150float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
151#ifdef OVERDRAW_INSPECTOR
152gl_FragColor=vec4(1.0);
153#endif
154}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
155#pragma mapbox: define highp vec4 outline_color
156#pragma mapbox: define lowp float opacity
157void main() {
158#pragma mapbox: initialize highp vec4 outline_color
159#pragma mapbox: initialize lowp float opacity
160gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:ai(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
161#pragma mapbox: define lowp float opacity
162#pragma mapbox: define lowp vec4 pattern_from
163#pragma mapbox: define lowp vec4 pattern_to
164void main() {
165#pragma mapbox: initialize lowp float opacity
166#pragma mapbox: initialize mediump vec4 pattern_from
167#pragma mapbox: initialize mediump vec4 pattern_to
168vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
169#ifdef OVERDRAW_INSPECTOR
170gl_FragColor=vec4(1.0);
171#endif
172}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
173#pragma mapbox: define lowp float opacity
174#pragma mapbox: define lowp vec4 pattern_from
175#pragma mapbox: define lowp vec4 pattern_to
176#pragma mapbox: define lowp float pixel_ratio_from
177#pragma mapbox: define lowp float pixel_ratio_to
178void main() {
179#pragma mapbox: initialize lowp float opacity
180#pragma mapbox: initialize mediump vec4 pattern_from
181#pragma mapbox: initialize mediump vec4 pattern_to
182#pragma mapbox: initialize lowp float pixel_ratio_from
183#pragma mapbox: initialize lowp float pixel_ratio_to
184vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:ai(`#ifdef GL_ES
185precision highp float;
186#endif
187uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
188#pragma mapbox: define lowp float opacity
189#pragma mapbox: define lowp vec4 pattern_from
190#pragma mapbox: define lowp vec4 pattern_to
191void main() {
192#pragma mapbox: initialize lowp float opacity
193#pragma mapbox: initialize mediump vec4 pattern_from
194#pragma mapbox: initialize mediump vec4 pattern_to
195vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
196#ifdef OVERDRAW_INSPECTOR
197gl_FragColor=vec4(1.0);
198#endif
199}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
200#pragma mapbox: define lowp float opacity
201#pragma mapbox: define lowp vec4 pattern_from
202#pragma mapbox: define lowp vec4 pattern_to
203#pragma mapbox: define lowp float pixel_ratio_from
204#pragma mapbox: define lowp float pixel_ratio_to
205void main() {
206#pragma mapbox: initialize lowp float opacity
207#pragma mapbox: initialize mediump vec4 pattern_from
208#pragma mapbox: initialize mediump vec4 pattern_to
209#pragma mapbox: initialize lowp float pixel_ratio_from
210#pragma mapbox: initialize lowp float pixel_ratio_to
211vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:ai(`varying vec4 v_color;void main() {gl_FragColor=v_color;
212#ifdef OVERDRAW_INSPECTOR
213gl_FragColor=vec4(1.0);
214#endif
215}`,`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;attribute vec2 a_pos;attribute vec4 a_normal_ed;
216#ifdef TERRAIN3D
217attribute vec2 a_centroid;
218#endif
219varying vec4 v_color;
220#pragma mapbox: define highp float base
221#pragma mapbox: define highp float height
222#pragma mapbox: define highp vec4 color
223void main() {
224#pragma mapbox: initialize highp float base
225#pragma mapbox: initialize highp float height
226#pragma mapbox: initialize highp vec4 color
227vec3 normal=a_normal_ed.xyz;
228#ifdef TERRAIN3D
229float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
230#else
231float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
232#endif
233base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.072
2332;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:ai(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
234#pragma mapbox: define lowp float base
235#pragma mapbox: define lowp float height
236#pragma mapbox: define lowp vec4 pattern_from
237#pragma mapbox: define lowp vec4 pattern_to
238#pragma mapbox: define lowp float pixel_ratio_from
239#pragma mapbox: define lowp float pixel_ratio_to
240void main() {
241#pragma mapbox: initialize lowp float base
242#pragma mapbox: initialize lowp float height
243#pragma mapbox: initialize mediump vec4 pattern_from
244#pragma mapbox: initialize mediump vec4 pattern_to
245#pragma mapbox: initialize lowp float pixel_ratio_from
246#pragma mapbox: initialize lowp float pixel_ratio_to
247vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
248#ifdef OVERDRAW_INSPECTOR
249gl_FragColor=vec4(1.0);
250#endif
251}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;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 vec2 a_pos;attribute vec4 a_normal_ed;
252#ifdef TERRAIN3D
253attribute vec2 a_centroid;
254#endif
255varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
256#pragma mapbox: define lowp float base
257#pragma mapbox: define lowp float height
258#pragma mapbox: define lowp vec4 pattern_from
259#pragma mapbox: define lowp vec4 pattern_to
260#pragma mapbox: define lowp float pixel_ratio_from
261#pragma mapbox: define lowp float pixel_ratio_to
262void main() {
263#pragma mapbox: initialize lowp float base
264#pragma mapbox: initialize lowp float height
265#pragma mapbox: initialize mediump vec4 pattern_from
266#pragma mapbox: initialize mediump vec4 pattern_to
267#pragma mapbox: initialize lowp float pixel_ratio_from
268#pragma mapbox: initialize lowp float pixel_ratio_to
269vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
270#ifdef TERRAIN3D
271float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
272#else
273float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
274#endif
275base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
276? a_pos
277: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:ai(`#ifdef GL_ES
278precision highp float;
279#endif
280uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);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((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
281#ifdef OVERDRAW_INSPECTOR
282gl_FragColor=vec4(1.0);
283#endif
284}`,"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:ai(`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;
285#define PI 3.141592653589793
286void 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;
286float 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;
287#ifdef OVERDRAW_INSPECTOR
288gl_FragColor=vec4(1.0);
289#endif
290}`,"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;}"),line:ai(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
291#pragma mapbox: define highp vec4 color
292#pragma mapbox: define lowp float blur
293#pragma mapbox: define lowp float opacity
294void main() {
295#pragma mapbox: initialize highp vec4 color
296#pragma mapbox: initialize lowp float blur
297#pragma mapbox: initialize lowp float opacity
298float 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);gl_FragColor=color*(alpha*opacity);
299#ifdef OVERDRAW_INSPECTOR
300gl_FragColor=vec4(1.0);
301#endif
302}`,`
303#define scale 0.015873016
304attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;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 float v_linesofar;
305#pragma mapbox: define highp vec4 color
306#pragma mapbox: define lowp float blur
307#pragma mapbox: define lowp float opacity
308#pragma mapbox: define mediump float gapwidth
309#pragma mapbox: define lowp float offset
310#pragma mapbox: define mediump float width
311void main() {
312#pragma mapbox: initialize highp vec4 color
313#pragma mapbox: initialize lowp float blur
314#pragma mapbox: initialize lowp float opacity
315#pragma mapbox: initialize mediump float gapwidth
316#pragma mapbox: initialize lowp float offset
317#pragma mapbox: initialize mediump float width
318float 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;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.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_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
319#ifdef TERRAIN3D
320v_gamma_scale=1.0;
321#else
322float 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;
323#endif
324v_width2=vec2(outset,inset);}`),lineGradient:ai(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
325#pragma mapbox: define lowp float blur
326#pragma mapbox: define lowp float opacity
327void main() {
328#pragma mapbox: initialize lowp float blur
329#pragma mapbox: initialize lowp float opacity
330float 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);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
331#ifdef OVERDRAW_INSPECTOR
332gl_FragColor=vec4(1.0);
333#endif
334}`,`
335#define scale 0.015873016
336attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
337#pragma mapbox: define lowp float blur
338#pragma mapbox: define lowp float opacity
339#pragma mapbox: define mediump float gapwidth
340#pragma mapbox: define lowp float offset
341#pragma mapbox: define mediump float width
342void main() {
343#pragma mapbox: initialize lowp float blur
344#pragma mapbox: initialize lowp float opacity
345#pragma mapbox: initialize mediump float gapwidth
346#pragma mapbox: initialize lowp float offset
347#pragma mapbox: initialize mediump float width
348float 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;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);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_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
349#ifdef TERRAIN3D
350v_gamma_scale=1.0;
351#else
352float 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;
353#endif
354v_width2=vec2(outset,inset);}`),linePattern:ai(`#ifdef GL_ES
355precision highp float;
356#endif
357uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;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;
358#pragma mapbox: define lowp vec4 pattern_from
359#pragma mapbox: define lowp vec4 pattern_to
360#pragma mapbox: define lowp float pixel_ratio_from
361#pragma mapbox: define lowp float pixel_ratio_to
362#pragma mapbox: define lowp float blur
363#pragma mapbox: define lowp float opacity
364void main() {
365#pragma mapbox: initialize mediump vec4 pattern_from
366#pragma mapbox: initialize mediump vec4 pattern_to
367#pragma mapbox: initialize lowp float pixel_ratio_from
368#pragma mapbox: initialize lowp float pixel_ratio_to
369#pragma mapbox: initialize lowp float blur
370#pragma mapbox: initialize lowp float opacity
371vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.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_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
372#ifdef OVERDRAW_INSPECTOR
373gl_FragColor=vec4(1.0);
374#endif
375}`,`
376#define scale 0.015873016
377#define LINE_DISTANCE_SCALE 2.0
378attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;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;
379#pragma mapbox: define lowp float blur
380#pragma mapbox: define lowp float opacity
381#pragma mapbox: define lowp float offset
382#pragma mapbox: define mediump float gapwidth
383#pragma mapbox: define mediump float width
384#pragma mapbox: define lowp float floorwidth
385#pragma mapbox: define lowp vec4 pattern_from
386#pragma mapbox: define lowp vec4 pattern_to
387#pragma mapbox: define lowp float pixel_ratio_from
388#pragma mapbox: define lowp float pixel_ratio_to
389void main() {
390#pragma mapbox: initialize lowp float blur
391#pragma mapbox: initialize lowp float opacity
392#pragma mapbox: initialize lowp float offset
393#pragma mapbox: initialize mediump float gapwidth
394#pragma mapbox: initialize mediump float width
395#pragma mapbox: initialize lowp float floorwidth
396#pragma mapbox: initialize mediump vec4 pattern_from
397#pragma mapbox: initialize mediump vec4 pattern_to
398#pragma mapbox: initialize lowp float pixel_ratio_from
399#pragma mapbox: initialize lowp float pixel_ratio_to
400float 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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
401#ifdef TERRAIN3D
402v_gamma_scale=1.0;
403#else
404float 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;
405#endif
406v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:ai(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
406uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
407#pragma mapbox: define highp vec4 color
408#pragma mapbox: define lowp float blur
409#pragma mapbox: define lowp float opacity
410#pragma mapbox: define mediump float width
411#pragma mapbox: define lowp float floorwidth
412void main() {
413#pragma mapbox: initialize highp vec4 color
414#pragma mapbox: initialize lowp float blur
415#pragma mapbox: initialize lowp float opacity
416#pragma mapbox: initialize mediump float width
417#pragma mapbox: initialize lowp float floorwidth
418float 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 sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
419#ifdef OVERDRAW_INSPECTOR
420gl_FragColor=vec4(1.0);
421#endif
422}`,`
423#define scale 0.015873016
424#define LINE_DISTANCE_SCALE 2.0
425attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
426#pragma mapbox: define highp vec4 color
427#pragma mapbox: define lowp float blur
428#pragma mapbox: define lowp float opacity
429#pragma mapbox: define mediump float gapwidth
430#pragma mapbox: define lowp float offset
431#pragma mapbox: define mediump float width
432#pragma mapbox: define lowp float floorwidth
433void main() {
434#pragma mapbox: initialize highp vec4 color
435#pragma mapbox: initialize lowp float blur
436#pragma mapbox: initialize lowp float opacity
437#pragma mapbox: initialize mediump float gapwidth
438#pragma mapbox: initialize lowp float offset
439#pragma mapbox: initialize mediump float width
440#pragma mapbox: initialize lowp float floorwidth
441float 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;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;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_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
442#ifdef TERRAIN3D
443v_gamma_scale=1.0;
444#else
445float 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;
446#endif
447v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:ai(`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(dot(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);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
448#ifdef OVERDRAW_INSPECTOR
449gl_FragColor=vec4(1.0);
450#endif
451}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:ai(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
452#pragma mapbox: define lowp float opacity
453void main() {
454#pragma mapbox: initialize lowp float opacity
455lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
456#ifdef OVERDRAW_INSPECTOR
457gl_FragColor=vec4(1.0);
458#endif
459}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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 highp float u_pitch;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;varying vec2 v_tex;varying float v_fade_opacity;
460#pragma mapbox: define lowp float opacity
461void main() {
462#pragma mapbox: initialize lowp float opacity
463vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
464camera_to_anchor_distance/u_camera_to_center_distance :
465u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:ai(`#define SDF_PX 8.0
466uniform 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_text;varying vec2 v_data0;varying vec3 v_data1;
467#pragma mapbox: define highp vec4 fill_color
468#pragma mapbox: define highp vec4 halo_color
469#pragma mapbox: define lowp float opacity
470#pragma mapbox: define lowp float halo_width
471#pragma mapbox: define lowp float halo_blur
472void main() {
473#pragma mapbox: initialize highp vec4 fill_color
474#pragma mapbox: initialize highp vec4 halo_color
475#pragma mapbox: initialize lowp float opacity
476#pragma mapbox: initialize lowp float halo_width
477#pragma mapbox: initialize lowp float halo_blur
478float 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 inner_edge=(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);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);
479#ifdef OVERDRAW_INSPECTOR
480gl_FragColor=vec4(1.0);
481#endif
482}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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 highp float u_pitch;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;varying vec2 v_data0;varying vec3 v_data1;
483#pragma mapbox: define highp vec4 fill_color
484#pragma mapbox: define highp vec4 halo_color
485#pragma mapbox: define lowp float opacity
486#pragma mapbox: define lowp float halo_width
487#pragma mapbox: define lowp float halo_blur
488void main() {
489#pragma mapbox: initialize highp vec4 fill_color
490#pragma mapbox: initialize highp vec4 halo_color
491#pragma mapbox: initialize lowp float opacity
492#pragma mapbox: initialize lowp float halo_width
493#pragma mapbox: initialize lowp float halo_blur
494vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
495camera_to_anchor_distance/u_camera_to_center_distance :
496u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:ai(`#define SDF_PX 8.0
497#define SDF 1.0
498#define ICON 0.0
499uniform 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;
500#pragma mapbox: define highp vec4 fill_color
501#pragma mapbox: define highp vec4 halo_color
502#pragma mapbox: define lowp float opacity
503#pragma mapbox: define lowp float halo_width
504#pragma mapbox: define lowp float halo_blur
505void main() {
506#pragma mapbox: initialize highp vec4 fill_color
507#pragma mapbox: initialize highp vec4 halo_color
508#pragma mapbox: initialize lowp float opacity
509#pragma mapbox: initialize lowp float halo_width
510#pragma mapbox: initialize lowp float halo_blur
511float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
511gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
512#ifdef OVERDRAW_INSPECTOR
513gl_FragColor=vec4(1.0);
514#endif
515return;}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);
516#ifdef OVERDRAW_INSPECTOR
517gl_FragColor=vec4(1.0);
518#endif
519}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform 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 highp float u_pitch;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 vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
520#pragma mapbox: define highp vec4 fill_color
521#pragma mapbox: define highp vec4 halo_color
522#pragma mapbox: define lowp float opacity
523#pragma mapbox: define lowp float halo_width
524#pragma mapbox: define lowp float halo_blur
525void main() {
526#pragma mapbox: initialize highp vec4 fill_color
527#pragma mapbox: initialize highp vec4 halo_color
528#pragma mapbox: initialize lowp float opacity
529#pragma mapbox: initialize lowp float halo_width
530#pragma mapbox: initialize lowp float halo_blur
531vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
532camera_to_anchor_distance/u_camera_to_center_distance :
533u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp 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);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:ai("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",ur),terrainDepth:ai("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",ur),terrainCoords:ai("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",ur)};
vendor: 4,912 bytes, lines 533-584
533function ai(d,t){const o=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,a=t.match(/attribute ([\w]+) ([\w]+)/g),h=d.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),x=m?m.concat(h):h,w={};return{fragmentSource:d=d.replace(o,(A,E,k,z,U)=>(w[U]=!0,E==="define"?`
534#ifndef HAS_UNIFORM_u_${U}
535varying ${k} ${z} ${U};
536#else
537uniform ${k} ${z} u_${U};
538#endif
539`:`
540#ifdef HAS_UNIFORM_u_${U}
541    ${k} ${z} ${U} = u_${U};
542#endif
543`)),vertexSource:t=t.replace(o,(A,E,k,z,U)=>{const K=z==="float"?"vec2":"vec4",W=U.match(/color/)?"color":K;return w[U]?E==="define"?`
544#ifndef HAS_UNIFORM_u_${U}
545uniform lowp float u_${U}_t;
546attribute ${k} ${K} a_${U};
547varying ${k} ${z} ${U};
548#else
549uniform ${k} ${z} u_${U};
550#endif
551`:W==="vec4"?`
552#ifndef HAS_UNIFORM_u_${U}
553    ${U} = a_${U};
554#else
555    ${k} ${z} ${U} = u_${U};
556#endif
557`:`
558#ifndef HAS_UNIFORM_u_${U}
559    ${U} = unpack_mix_${W}(a_${U}, u_${U}_t);
560#else
561    ${k} ${z} ${U} = u_${U};
562#endif
563`:E==="define"?`
564#ifndef HAS_UNIFORM_u_${U}
565uniform lowp float u_${U}_t;
566attribute ${k} ${K} a_${U};
567#else
568uniform ${k} ${z} u_${U};
569#endif
570`:W==="vec4"?`
571#ifndef HAS_UNIFORM_u_${U}
572    ${k} ${z} ${U} = a_${U};
573#else
574    ${k} ${z} ${U} = u_${U};
575#endif
576`:`
577#ifndef HAS_UNIFORM_u_${U}
578    ${k} ${z} ${U} = unpack_mix_${W}(a_${U}, u_${U}_t);
579#else
580    ${k} ${z} ${U} = u_${U};
581#endif
582`}),staticAttributes:a,staticUniforms:x}}class kt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,o,a,h,m,x,w,A,E){this.context=t;let k=this.boundPaintVertexBuffers.length!==h.length;for(let z=0;!k&&z<h.length;z++)this.boundPaintVertexBuffers[z]!==h[z]&&(k=!0);!this.vao||this.boundProgram!==o||this.boundLayoutVertexBuffer!==a||k||this.boundIndexBuffer!==m||this.boundVertexOffset!==x||this.boundDynamicVertexBuffer!==w||this.boundDynamicVertexBuffer2!==A||this.boundDynamicVertexBuffer3!==E?this.freshBind(o,a,h,m,x,w,A,E):(t.bindVertexArray.set(this.vao),w&&w.bind(),m&&m.dynamicDraw&&m.bind(),A&&A.bind(),E&&E.bind())}freshBind(t,o,a,h,m,x,w,A){const E=t.numAttributes,k=this.context,z=k.gl;this.vao&&this.destroy(),this.vao=k.createVertexArray(),k.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=o,this.boundPaintVertexBuffers=a,this.boundIndexBuffer=h,this.boundVertexOffset=m,this.boundDynamicVertexBuffer=x,this.boundDynamicVertexBuffer2=w,this.boundDynamicVertexBuffer3=A,o.enableAttributes(z,t);for(const U of a)U.enableAttributes(z,t);x&&x.enableAttributes(z,t),w&&w.enableAttributes(z,t),A&&A.enableAttributes(z,t),o.bind(),o.setVertexAttribPointers(z,t,m);for(const U of a)U.bind(),U.setVertexAttribPointers(z,t,m);x&&(x.bind(),x.setVertexAttribPointers(z,t,m)),h&&h.bind(),w&&(w.bind(),w.setVertexAttribPointers(z,t,m)),A&&(A.bind(),A.setVertexAttribPointers(z,t,m)),k.currentNumAttributes=E}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function Ot(d){const t=[];for(let o=0;o<d.length;o++){if(d[o]===null)continue;const a=d[o].split(" ");t.push(a.pop())}return t}class Jo{constructor(t,o,a,h,m,x){const w=t.gl;this.program=w.createProgram();const A=Ot(o.staticAttributes),E=a?a.getBinderAttributes():[],k=A.concat(E),z=vi.prelude.staticUniforms?Ot(vi.prelude.staticUniforms):[],U=o.staticUniforms?Ot(o.staticUniforms):[],K=a?a.getBinderUniforms():[],W=z.concat(U).concat(K),J=[];for(const Te of W)J.indexOf(Te)<0&&J.push(Te);const G=a?a.defines():[];m&&G.push("#define OVERDRAW_INSPECTOR;"),x&&G.push("#define TERRAIN3D;");const ce=G.concat(vi.prelude.fragmentSource,o.fragmentSource).join(`
583`),xe=G.concat(vi.prelude.vertexSource,o.vertexSource).join(`
584`),ie=w.createShader(w.FRAGMENT_SHADER);if(w.isContextLost())return void(this.failedToCreate=!0);if(w.shaderSource(ie,ce),w.compileShader(ie),!w.getShaderParameter(ie,w.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${w.getShaderInfoLog(ie)}`);w.attachShader(this.program,ie);const he=w.createShader(w.VERTEX_SHADER);if(w.isContextLost())return void(this.failedToCreate=!0);if(w.shaderSource(he,xe),w.compileShader(he),!w.getShaderParameter(he,w.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${w.getShaderInfoLog(he)}`);w.attachShader(this.program,he),this.attributes={};const we={};this.numAttributes=k.length;for(let Te=0;Te<this.numAttributes;Te++)k[Te]&&(w.bindAttribLocation(this.program,Te,k[Te]),this.attributes[k[Te]]=Te);if(w.linkProgram(this.program),!w.getProgramParameter(this.program,w.LINK_STATUS))throw new Error(`Program failed to link: ${w.getProgramInfoLog(this.program)}`);w.deleteShader(he),w.deleteShader(ie);for(let Te=0;Te<J.length;Te++){const Ie=J[Te];if(Ie&&!we[Ie]){const ke=w.getUniformLocation(this.program,Ie);ke&&(we[Ie]=ke)}}this.fixedUniforms=h(t,we),this.terrainUniforms=((Te,Ie)=>
vendor: 5,499 bytes, line 584
584({u_depth:new l.aL(Te,Ie.u_depth),u_terrain:new l.aL(Te,Ie.u_terrain),u_terrain_dim:new l.aM(Te,Ie.u_terrain_dim),u_terrain_matrix:new l.aN(Te,Ie.u_terrain_matrix),u_terrain_unpack:new l.aO(Te,Ie.u_terrain_unpack),u_terrain_exaggeration:new l.aM(Te,Ie.u_terrain_exaggeration)}))(t,we),this.binderUniforms=a?a.getUniforms(t,we):[]}draw(t,o,a,h,m,x,w,A,E,k,z,U,K,W,J,G,ce,xe){const ie=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(a),t.setStencilMode(h),t.setColorMode(m),t.setCullFace(x),A){t.activeTexture.set(ie.TEXTURE2),ie.bindTexture(ie.TEXTURE_2D,A.depthTexture),t.activeTexture.set(ie.TEXTURE3),ie.bindTexture(ie.TEXTURE_2D,A.texture);for(const we in this.terrainUniforms)this.terrainUniforms[we].set(A[we])}for(const we in this.fixedUniforms)this.fixedUniforms[we].set(w[we]);J&&J.setUniforms(t,this.binderUniforms,K,{zoom:W});let he=0;switch(o){case ie.LINES:he=2;break;case ie.TRIANGLES:he=3;break;case ie.LINE_STRIP:he=1}for(const we of U.get()){const Te=we.vaos||(we.vaos={});(Te[E]||(Te[E]=new kt)).bind(t,this,k,J?J.getPaintVertexBuffers():[],z,we.vertexOffset,G,ce,xe),ie.drawElements(o,we.primitiveLength*he,ie.UNSIGNED_SHORT,we.primitiveOffset*he*2)}}}function gn(d,t,o){const a=1/le(o,1,t.transform.tileZoom),h=Math.pow(2,o.tileID.overscaledZ),m=o.tileSize*Math.pow(2,t.transform.tileZoom)/h,x=m*(o.tileID.canonical.x+o.tileID.wrap*h),w=m*o.tileID.canonical.y;return{u_image:0,u_texsize:o.imageAtlasTexture.size,u_scale:[a,d.fromScale,d.toScale],u_fade:d.t,u_pixel_coord_upper:[x>>16,w>>16],u_pixel_coord_lower:[65535&x,65535&w]}}const Pn=(d,t,o,a)=>{const h=t.style.light,m=h.properties.get("position"),x=[m.x,m.y,m.z],w=function(){var E=new l.A(9);return l.A!=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}();h.properties.get("anchor")==="viewport"&&function(E,k){var z=Math.sin(k),U=Math.cos(k);E[0]=U,E[1]=z,E[2]=0,E[3]=-z,E[4]=U,E[5]=0,E[6]=0,E[7]=0,E[8]=1}(w,-t.transform.angle),function(E,k,z){var U=k[0],K=k[1],W=k[2];E[0]=U*z[0]+K*z[3]+W*z[6],E[1]=U*z[1]+K*z[4]+W*z[7],E[2]=U*z[2]+K*z[5]+W*z[8]}(x,x,w);const A=h.properties.get("color");return{u_matrix:d,u_lightpos:x,u_lightintensity:h.properties.get("intensity"),u_lightcolor:[A.r,A.g,A.b],u_vertical_gradient:+o,u_opacity:a}},no=(d,t,o,a,h,m,x)=>l.e(Pn(d,t,o,a),gn(m,t,x),{u_height_factor:-Math.pow(2,h.overscaledZ)/x.tileSize/8}),ws=d=>({u_matrix:d}),Br=(d,t,o,a)=>l.e(ws(d),gn(o,t,a)),Oi=(d,t)=>({u_matrix:d,u_world:t}),wr=(d,t,o,a,h)=>l.e(Br(d,t,o,a),{u_world:h}),Yn=(d,t,o,a)=>{const h=d.transform;let m,x;if(a.paint.get("circle-pitch-alignment")==="map"){const w=le(o,1,h.zoom);m=!0,x=[w,w]}else m=!1,x=h.pixelsToGLUnits;return{u_camera_to_center_distance:h.cameraToCenterDistance,u_scale_with_map:+(a.paint.get("circle-pitch-scale")==="map"),u_matrix:d.translatePosMatrix(t.posMatrix,o,a.paint.get("circle-translate"),a.paint.get("circle-translate-anchor")),u_pitch_with_map:+m,u_device_pixel_ratio:d.pixelRatio,u_extrude_scale:x}},Lo=(d,t,o)=>{const a=le(o,1,t.zoom),h=Math.pow(2,t.zoom-o.tileID.overscaledZ),m=o.tileID.overscaleFactor();return{u_matrix:d,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:a,u_extrude_scale:[t.pixelsToGLUnits[0]/(a*h),t.pixelsToGLUnits[1]/(a*h)],u_overscale_factor:m}},Eo=(d,t,o=1)=>({u_matrix:d,u_color:t,u_overlay:0,u_overlay_scale:o}),Qo=d=>({u_matrix:d}),Aa=(d,t,o,a)=>({u_matrix:d,u_extrude_scale:le(t,1,o),u_intensity:a});function Ts(d,t){const o=Math.pow(2,t.canonical.z),a=t.canonical.y;return[new l.U(0,a/o).toLngLat().lat,new l.U(0,(a+1)/o).toLngLat().lat]}const es=(d,t,o,a)=>{const h=d.transform;return{u_matrix:ts(d,t,o,a),u_ratio:1/le(t,1,h.zoom),u_device_pixel_ratio:d.pixelRatio,u_units_to_pixels:[1/h.pixelsToGLUnits[0],1/h.pixelsToGLUnits[1]]}},Gs=(d,t,o,a,h)=>l.e(es(d,t,o,h),{u_image:0,u_image_height:a}),Pa=(d,t,o,a,h)=>{const m=d.transform,x=Ia(t,m);return{u_matrix:ts(d,t,o,h),u_texsize:t.imageAtlasTexture.size,u_ratio:1/le(t,1,m.zoom),u_device_pixel_ratio:d.pixelRatio,u_image:0,u_scale:[x,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]]}},Ss=(d,t,o,a,h,m)=>{const x=d.lineAtlas,w=Ia(t,d.transform),A=o.layout.get("line-cap")==="round",E=x.getDash(a.from,A),k=x.getDash(a.to,A),z=E.width*h.fromScale,U=k.width*h.toScale;return l.e(es(d,t,o,m),{u_patternscale_a:[w/z,-E.height/2],u_patternscale_b:[w/U,-k.height/2],u_sdfgamma:x.width/(256*Math.min(z,U)*d.pixelRatio)/2,u_image:0,u_tex_y_a:E.y,u_tex_y_b:k.y,u_mix:h.t})};function Ia(d,t){return 1/le(d,1,t.tileZoom)}function ts(d,t,o,a){return d.translatePosMatrix(a?a.posMatrix:t.tileID.posMatrix,t,o.paint.get("line-translate"),o.paint.get("line-translate-anchor"))}const Qa=(d,t,o,a,h)=>{return{u_matrix:d,u_tl_parent:t,u_scale_parent:o,u_buffer_scale:1,u_fade_t:a.mix,u_opacity:a.opacity*h.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:h.paint.get("raster-brightness-min"),u_brightness_high:h.paint.get("raster-brightness-max"),u_saturation_factor:(x=h.paint.get("raster-saturation"),x>0?1-1/(1.001-x):-x),u_contrast_factor:(m=h.paint.get("raster-contrast"),m>0?1/(1-m):1+m),u_spin_weights:Ft(h.paint.get("raster-hue-rotate"))};var m,x};function Ft(d){d*=Math.PI/180;const t=Math.sin(d),o=Math.cos(d);return[(2*o+1)/3,(-Math.sqrt(3)*t-o+1)/3,(Math.sqrt(3)*t-o+1)/3]}const Jn=(d,t,o,a,h,m,x,w,A,E)=>{const k=h.transform;return{u_is_size_zoom_constant:+(d==="constant"||d==="source"),u_is_size_feature_constant:+(d==="constant"||d==="c
584amera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:k.cameraToCenterDistance,u_pitch:k.pitch/360*2*Math.PI,u_rotate_symbol:+o,u_aspect_ratio:k.width/k.height,u_fade_change:h.options.fadeDuration?h.symbolFadeChange:1,u_matrix:m,u_label_plane_matrix:x,u_coord_matrix:w,u_is_text:+A,u_pitch_with_map:+a,u_texsize:E,u_texture:0}},bi=(d,t,o,a,h,m,x,w,A,E,k)=>{const z=h.transform;return l.e(Jn(d,t,o,a,h,m,x,w,A,E),{u_gamma_scale:a?Math.cos(z._pitch)*z.cameraToCenterDistance:1,u_device_pixel_ratio:h.pixelRatio,u_is_halo:+k})},ro=(d,t,o,a,h,m,x,w,A,E)=>l.e(bi(d,t,o,a,h,m,x,w,!0,A,!0),{u_texsize_icon:E,u_texture_icon:1}),is=(d,t,o)=>({u_matrix:d,u_opacity:t,u_color:o}),In=(d,t,o,a,h,m)=>l.e(function(x,w,A,E){const k=A.imageManager.getPattern(x.from.toString()),z=A.imageManager.getPattern(x.to.toString()),{width:U,height:K}=A.imageManager.getPixelSize(),W=Math.pow(2,E.tileID.overscaledZ),J=E.tileSize*Math.pow(2,A.transform.tileZoom)/W,G=J*(E.tileID.canonical.x+E.tileID.wrap*W),ce=J*E.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:k.tl,u_pattern_br_a:k.br,u_pattern_tl_b:z.tl,u_pattern_br_b:z.br,u_texsize:[U,K],u_mix:w.t,u_pattern_size_a:k.displaySize,u_pattern_size_b:z.displaySize,u_scale_a:w.fromScale,u_scale_b:w.toScale,u_tile_units_to_pixels:1/le(E,1,A.transform.tileZoom),u_pixel_coord_upper:[G>>16,ce>>16],u_pixel_coord_lower:[65535&G,65535&ce]}}(a,m,o,h),{u_matrix:d,u_opacity:t}),ns={fillExtrusion:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_lightpos:new l.aP(d,t.u_lightpos),u_lightintensity:new l.aM(d,t.u_lightintensity),u_lightcolor:new l.aP(d,t.u_lightcolor),u_vertical_gradient:new l.aM(d,t.u_vertical_gradient),u_opacity:new l.aM(d,t.u_opacity)}),fillExtrusionPattern:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_lightpos:new l.aP(d,t.u_lightpos),u_lightintensity:new l.aM(d,t.u_lightintensity),u_lightcolor:new l.aP(d,t.u_lightcolor),u_vertical_gradient:new l.aM(d,t.u_vertical_gradient),u_height_factor:new l.aM(d,t.u_height_factor),u_image:new l.aL(d,t.u_image),u_texsize:new l.aQ(d,t.u_texsize),u_pixel_coord_upper:new l.aQ(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(d,t.u_pixel_coord_lower),u_scale:new l.aP(d,t.u_scale),u_fade:new l.aM(d,t.u_fade),u_opacity:new l.aM(d,t.u_opacity)}),fill:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix)}),fillPattern:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_image:new l.aL(d,t.u_image),u_texsize:new l.aQ(d,t.u_texsize),u_pixel_coord_upper:new l.aQ(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(d,t.u_pixel_coord_lower),u_scale:new l.aP(d,t.u_scale),u_fade:new l.aM(d,t.u_fade)}),fillOutline:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_world:new l.aQ(d,t.u_world)}),fillOutlinePattern:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_world:new l.aQ(d,t.u_world),u_image:new l.aL(d,t.u_image),u_texsize:new l.aQ(d,t.u_texsize),u_pixel_coord_upper:new l.aQ(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(d,t.u_pixel_coord_lower),u_scale:new l.aP(d,t.u_scale),u_fade:new l.aM(d,t.u_fade)}),circle:(d,t)=>({u_camera_to_center_distance:new l.aM(d,t.u_camera_to_center_distance),u_scale_with_map:new l.aL(d,t.u_scale_with_map),u_pitch_with_map:new l.aL(d,t.u_pitch_with_map),u_extrude_scale:new l.aQ(d,t.u_extrude_scale),u_device_pixel_ratio:new l.aM(d,t.u_device_pixel_ratio),u_matrix:new l.aN(d,t.u_matrix)}),collisionBox:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_camera_to_center_distance:new l.aM(d,t.u_camera_to_center_distance),u_pixels_to_tile_units:new l.aM(d,t.u_pixels_to_tile_units),u_extrude_scale:new l.aQ(d,t.u_extrude_scale),u_overscale_factor:new l.aM(d,t.u_overscale_factor)}),collisionCircle:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_inv_matrix:new l.aN(d,t.u_inv_matrix),u_camera_to_center_distance:new l.aM(d,t.u_camera_to_center_distance),u_viewport_size:new l.aQ(d,t.u_viewport_size)}),debug:(d,t)=>({u_color:new l.aR(d,t.u_color),u_matrix:new l.aN(d,t.u_matrix),u_overlay:new l.aL(d,t.u_overlay),u_overlay_scale:new l.aM(d,t.u_overlay_scale)}),clippingMask:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix)}),heatmap:(d,t)=>({u_extrude_scale:new l.aM(d,t.u_extrude_scale),u_intensity:new l.aM(d,t.u_intensity),u_matrix:new l.aN(d,t.u_matrix)}),heatmapTexture:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_world:new l.aQ(d,t.u_world),u_image:new l.aL(d,t.u_image),u_color_ramp:new l.aL(d,t.u_color_ramp),u_opacity:new l.aM(d,t.u_opacity)}),hillshade:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_image:new l.aL(d,t.u_image),u_latrange:new l.aQ(d,t.u_latrange),u_light:new l.aQ(d,t.u_light),u_shadow:new l.aR(d,t.u_shadow),u_highlight:new l.aR(d,t.u_highlight),u_accent:new l.aR(d,t.u_accent)}),hillshadePrepare:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_image:new l.aL(d,t.u_image),u_dimension:new l.aQ(d,t.u_dimension),u_zoom:new l.aM(d,t.u_zoom),u_unpack:new l.aO(d,t.u_unpack)}),line:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_ratio:new l.aM(d,t.u_ratio),u_device_pixel_ratio:new l.aM(d,t.u_device_pixel_ratio),u_units_to_pixels:new l.aQ(d,t.u_units_to_pixels)}),lineGradient:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_ratio:new l.aM(d,t.u_ratio),u_device_pixel_ratio:new l.aM(d,t.u_device_pixel_ratio),u_units_to_pixels:new l.aQ(d,t.u_units_to_pixels),u_image:new l.aL(d,t.u_image),u_image_height:new l.aM(d,t.u_image_height)}),linePattern:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_texsize:new l.aQ(d,t.u_texsize),u_ratio:new l.aM(d,t.u_ratio),u_device_pixel_ratio:new l.aM(d,t.u_device_pixel_ratio),u_image:new l.aL(d,t.u_image),u_units_to_pixels:new l.aQ(d,t.u_units_to_pixels),u_scale:new l.aP(d,t.u_scale),u_fade:new l.aM(d,t.u_fade)}),lineSDF:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_ratio:new l.aM(d,t.u_ratio),u_device_pixel_ratio:new l.aM(d,t.u_device_pixel_ratio),u_units_to_pixels:new l.aQ(d,t.u_units_to_pixels),u_patternscale_a:new l.aQ(d,t.u_patternscale_a),u_patternscale_b:new l.aQ(d,t.u_patternscale_b),u_sdfgamma:new l.aM(d,t.u_sdfgamma),u_image:new l.aL(d,t.u_image),u_tex_y_a:new l.aM(d,t.u_tex_y_a),u_tex_y_b:new l.aM(d,t.u_tex_y_b),u_mix:new l.aM(d,t.u_mix)}),raster:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_tl_parent:new l.aQ(d,t.u_tl_parent),u_scale_parent:new l.aM(d,t.u_scale_parent),u_buffer_scale:new l.aM(d,t.u_buffer_scale),u_fade_t:new l.aM(d,t.u_fade_t),u_opacity:new l.aM(d,t.u_opacity),u_image0:new l.aL(d,t.u_image0),u_image1:new l.aL(d,t.u_image1),u_brightness_low:new l.aM(d,t.u_brightness_low),u_brightness_high:new l.aM(d,t.u_brightness_high),u_saturation_factor:new l.aM(d,t.u_saturation_factor),u_contrast_factor:new l.aM(d,t.u_contrast_factor),u_spin_weights:new l.aP(d,t.u_spin_weights)}),symbolIcon:(d,t)=>({u_is_size_zoom_constant:new l.aL(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aL(d,t.u_is_size_feature_constant),u_size_t:new l.aM(d,t.u_size_t),u_size:new l.aM(d,t.u_size),u_camera_to_center_distance:new l.aM(d,t.u_camera_to_center_distance),u_pitch:new l.aM(d,t.u_pitch),u_rotate_symbol:new l.aL(d,t.u_rotate_symbol),u_aspect_ratio:new l.aM(d,t.u_aspect_ratio),u_fade_change:new l.aM(d,t.u_fade_change),u_matrix:new l.aN(d,t.u_matrix),u_label_plane_matrix:new l.aN(d,t.u_label_plane_matrix
vendor: 18,887 bytes, line 584
584),u_coord_matrix:new l.aN(d,t.u_coord_matrix),u_is_text:new l.aL(d,t.u_is_text),u_pitch_with_map:new l.aL(d,t.u_pitch_with_map),u_texsize:new l.aQ(d,t.u_texsize),u_texture:new l.aL(d,t.u_texture)}),symbolSDF:(d,t)=>({u_is_size_zoom_constant:new l.aL(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aL(d,t.u_is_size_feature_constant),u_size_t:new l.aM(d,t.u_size_t),u_size:new l.aM(d,t.u_size),u_camera_to_center_distance:new l.aM(d,t.u_camera_to_center_distance),u_pitch:new l.aM(d,t.u_pitch),u_rotate_symbol:new l.aL(d,t.u_rotate_symbol),u_aspect_ratio:new l.aM(d,t.u_aspect_ratio),u_fade_change:new l.aM(d,t.u_fade_change),u_matrix:new l.aN(d,t.u_matrix),u_label_plane_matrix:new l.aN(d,t.u_label_plane_matrix),u_coord_matrix:new l.aN(d,t.u_coord_matrix),u_is_text:new l.aL(d,t.u_is_text),u_pitch_with_map:new l.aL(d,t.u_pitch_with_map),u_texsize:new l.aQ(d,t.u_texsize),u_texture:new l.aL(d,t.u_texture),u_gamma_scale:new l.aM(d,t.u_gamma_scale),u_device_pixel_ratio:new l.aM(d,t.u_device_pixel_ratio),u_is_halo:new l.aL(d,t.u_is_halo)}),symbolTextAndIcon:(d,t)=>({u_is_size_zoom_constant:new l.aL(d,t.u_is_size_zoom_constant),u_is_size_feature_constant:new l.aL(d,t.u_is_size_feature_constant),u_size_t:new l.aM(d,t.u_size_t),u_size:new l.aM(d,t.u_size),u_camera_to_center_distance:new l.aM(d,t.u_camera_to_center_distance),u_pitch:new l.aM(d,t.u_pitch),u_rotate_symbol:new l.aL(d,t.u_rotate_symbol),u_aspect_ratio:new l.aM(d,t.u_aspect_ratio),u_fade_change:new l.aM(d,t.u_fade_change),u_matrix:new l.aN(d,t.u_matrix),u_label_plane_matrix:new l.aN(d,t.u_label_plane_matrix),u_coord_matrix:new l.aN(d,t.u_coord_matrix),u_is_text:new l.aL(d,t.u_is_text),u_pitch_with_map:new l.aL(d,t.u_pitch_with_map),u_texsize:new l.aQ(d,t.u_texsize),u_texsize_icon:new l.aQ(d,t.u_texsize_icon),u_texture:new l.aL(d,t.u_texture),u_texture_icon:new l.aL(d,t.u_texture_icon),u_gamma_scale:new l.aM(d,t.u_gamma_scale),u_device_pixel_ratio:new l.aM(d,t.u_device_pixel_ratio),u_is_halo:new l.aL(d,t.u_is_halo)}),background:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_opacity:new l.aM(d,t.u_opacity),u_color:new l.aR(d,t.u_color)}),backgroundPattern:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_opacity:new l.aM(d,t.u_opacity),u_image:new l.aL(d,t.u_image),u_pattern_tl_a:new l.aQ(d,t.u_pattern_tl_a),u_pattern_br_a:new l.aQ(d,t.u_pattern_br_a),u_pattern_tl_b:new l.aQ(d,t.u_pattern_tl_b),u_pattern_br_b:new l.aQ(d,t.u_pattern_br_b),u_texsize:new l.aQ(d,t.u_texsize),u_mix:new l.aM(d,t.u_mix),u_pattern_size_a:new l.aQ(d,t.u_pattern_size_a),u_pattern_size_b:new l.aQ(d,t.u_pattern_size_b),u_scale_a:new l.aM(d,t.u_scale_a),u_scale_b:new l.aM(d,t.u_scale_b),u_pixel_coord_upper:new l.aQ(d,t.u_pixel_coord_upper),u_pixel_coord_lower:new l.aQ(d,t.u_pixel_coord_lower),u_tile_units_to_pixels:new l.aM(d,t.u_tile_units_to_pixels)}),terrain:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_texture:new l.aL(d,t.u_texture),u_ele_delta:new l.aM(d,t.u_ele_delta)}),terrainDepth:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_ele_delta:new l.aM(d,t.u_ele_delta)}),terrainCoords:(d,t)=>({u_matrix:new l.aN(d,t.u_matrix),u_texture:new l.aL(d,t.u_texture),u_terrain_coords_id:new l.aM(d,t.u_terrain_coords_id),u_ele_delta:new l.aM(d,t.u_ele_delta)})};class Tr{constructor(t,o,a){this.context=t;const h=t.gl;this.buffer=h.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),h.bufferData(h.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?h.DYNAMIC_DRAW:h.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const o=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Co={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class oo{constructor(t,o,a,h){this.length=o.length,this.attributes=a,this.itemSize=o.bytesPerElement,this.dynamicDraw=h,this.context=t;const m=t.gl;this.buffer=m.createBuffer(),t.bindVertexBuffer.set(this.buffer),m.bufferData(m.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,o){for(let a=0;a<this.attributes.length;a++){const h=o.attributes[this.attributes[a].name];h!==void 0&&t.enableVertexAttribArray(h)}}setVertexAttribPointers(t,o,a){for(let h=0;h<this.attributes.length;h++){const m=this.attributes[h],x=o.attributes[m.name];x!==void 0&&t.vertexAttribPointer(x,m.components,t[Co[m.type]],!1,this.itemSize,m.offset+this.itemSize*(a||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Ni=new WeakMap;function Ln(d){var t;if(Ni.has(d))return Ni.get(d);{const o=(t=d.getParameter(d.VERSION))===null||t===void 0?void 0:t.startsWith("WebGL 2.0");return Ni.set(d,o),o}}class Wt{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class As extends Wt{getDefault(){return l.aT.transparent}set(t){const o=this.current;(t.r!==o.r||t.g!==o.g||t.b!==o.b||t.a!==o.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class On extends Wt{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class En extends Wt{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class Ps extends Wt{getDefault(){return[!0,!0,!0,!0]}set(t){const o=this.current;(t[0]!==o[0]||t[1]!==o[1]||t[2]!==o[2]||t[3]!==o[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Hs extends Wt{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class Is extends Wt{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class oi extends Wt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const o=this.current;(t.func!==o.func||t.ref!==o.ref||t.mask!==o.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class La extends Wt{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const o=this.current;(t[0]!==o[0]||t[1]!==o[1]||t[2]!==o[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Cn extends Wt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;t?o.enable(o.STENCIL_TEST):o.disable(o.STENCIL_TEST),this.current=t,this.dirty=!1}}class Mo extends Wt{getDefault(){return[0,1]}set(t){const o=this.current;(t[0]!==o[0]||t[1]!==o[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Ws extends Wt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;t?o.enable(o.DEPTH_TEST):o.disable(o.DEPTH_TEST),this.current=t,this.dirty=!1}}class Ks extends Wt{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class Xs extends Wt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;t?o.enable(o.BLEND):o.disable(o.BLEND),this.current=t,this.dirty=!1}}class el extends Wt{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const o=this.current;(t[0]!==o[0]||t[1]!==o[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class ko extends Wt{getDefault(){return l.aT.transparent}set(t){const o=this.current;(t.r!==o.r||t.g!==o.g||t.b!==o.b||t.a!==o.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Cl extends Wt{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Ml extends Wt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;t?o.enable(o.CULL_FACE):o.disable(o.CULL_FACE),this.current=t,this.dirty=!1}}class Ea extends Wt{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class kl extends Wt{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class Sr extends Wt{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class zl extends Wt{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class Ys extends Wt{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const o=this.current;(t[0]!==o[0]||t[1]!==o[1]||t[2]!==o[2]||t[3]!==o[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class hr extends Wt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;o.bindFramebuffer(o.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Js extends Wt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;o.bindRenderbuffer(o.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Qs extends Wt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;o.bindTexture(o.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class so extends Wt{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;o.bindBuffer(o.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class tl extends Wt{getDefault(){return null}set(t){const o=this.gl;o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Ca extends Wt{getDefault(){return null}set(t){var o;if(t===this.current&&!this.dirty)return;const a=this.gl;Ln(a)?a.bindVertexArray(t):(o=a.getExtension("OES_vertex_array_object"))===null||o===void 0||o.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class ea extends Wt{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;o.pixelStorei(o.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class zo extends Wt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class il extends Wt{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const o=this.gl;o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class Ar extends Wt{constructor(t,o){super(t),this.context=t,this.parent=o}getDefault(){return null}}class rs extends Ar{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const o=this.gl;o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class Ma extends Ar{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const o=this.gl;o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class ta extends Ar{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const o=this.gl;o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_STENCIL_ATTACHMENT,o.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class si{constructor(t,o,a,h,m){this.context=t,this.width=o,this.height=a;const x=t.gl,w=this.framebuffer=x.createFramebuffer();if(this.colorAttachment=new rs(t,w),h)this.depthAttachment=m?new ta(t,w):new Ma(t,w);else if(m)throw new Error("Stencil cannot be setted without depth");if(x.checkFramebufferStatus(x.FRAMEBUFFER)!==x.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const t=this.context.gl,o=this.colorAttachment.get();if(o&&t.deleteTexture(o),this.depthAttachment){const a=this.depthAttachment.get();a&&t.deleteRenderbuffer(a)}t.deleteFramebuffer(this.framebuffer)}}class gi{constructor(t,o,a){this.blendFunction=t,this.blendColor=o,this.mask=a}}gi.Replace=[1,0],gi.disabled=new gi(gi.Replace,l.aT.transparent,[!1,!1,!1,!1]),gi.unblended=new gi(gi.Replace,l.aT.transparent,[!0,!0,!0,!0]),gi.alphaBlended=new gi([1,771],l.aT.transparent,[!0,!0,!0,!0]);class Dl{constructor(t){var o,a;if(this.gl=t,this.clearColor=new As(this),this.clearDepth=new On(this),this.clearStencil=new En(this),this.colorMask=new Ps(this),this.depthMask=new Hs(this),this.stencilMask=new Is(this),this.stencilFunc=new oi(this),this.stencilOp=new La(this),this.stencilTest=new Cn(this),this.depthRange=new Mo(this),this.depthTest=new Ws(this),this.depthFunc=new Ks(this),this.blend=new Xs(this),this.blendFunc=new el(this),this.blendColor=new ko(this),this.blendEquation=new Cl(this),this.cullFace=new Ml(this),this.cullFaceSide=new Ea(this),this.frontFace=new kl(this),this.program=new Sr(this),this.activeTexture=new zl(this),this.viewport=new Ys(this),this.bindFramebuffer=new hr(this),this.bindRenderbuffer=new Js(this),this.bindTexture=new Qs(this),this.bindVertexBuffer=new so(this),this.bindElementBuffer=new tl(this),this.bindVertexArray=new Ca(this),this.pixelStoreUnpack=new ea(this),this.pixelStoreUnpackPremultiplyAlpha=new zo(this),this.pixelStoreUnpackFlipY=new il(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),Ln(t)){this.HALF_FLOAT=t.HALF_FLOAT;const h=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(o=t.RGBA16F)!==null&&o!==void 0?o:h==null?void 0:h.RGBA16F_EXT,this.RGB16F=(a=t.RGB16F)!==null&&a!==void 0?a:h==null?void 0:h.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const h=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=h==null?void 0:h.HALF_FLOAT_OES}}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.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,o){return new Tr(this,t,o)}createVertexBuffer(t,o,a){return new oo(this,t,o,a)}createRenderbuffer(t,o,a){const h=this.gl,m=h.createRenderbuffer();return this.bindRenderbuffer.set(m),h.renderbufferStorage(h.RENDERBUFFER,t,o,a),this.bindRenderbuffer.set(null),m}createFramebuffer(t,o,a,h){return new si(this,t,o,a,h)}clear({color:t,depth:o,stencil:a}){const h=this.gl;let m=0;t&&(m|=h.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),o!==void 0&&(m|=h.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(o),this.depthMask.set(!0)),a!==void 0&&(m|=h.STENCIL_BUFFER_BIT,this.clearStencil.set(a),this.stencilMask.set(255)),h.clear(m)}setCullFace(t){t.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){l.aG(t.blendFunction,gi.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return Ln(this.gl)?this.gl.createVertexArray():(t=this.gl.getExtension("OES_vertex_array_object"))===null||t===void 0?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var o;return Ln(this.gl)?this.gl.deleteVertexArray(t):(o=this.gl.getExtension("OES_vertex_array_object"))===null||o===void 0?void 0:o.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}class Zt{constructor(t,o,a){this.func=t,this.mask=o,this.range=a}}Zt.ReadOnly=!1,Zt.ReadWrite=!0,Zt.disabled=new Zt(519,Zt.ReadOnly,[0,1]);const Yi=7680;class Mi{constructor(t,o,a,h,m,x){this.test=t,this.ref=o,this.mask=a,this.fail=h,this.depthFail=m,this.pass=x}}Mi.disabled=new Mi({func:519,mask:0},0,0,Yi,Yi,Yi);class Ai{constructor(t,o,a){this.enable=t,this.mode=o,this.frontFace=a}}let Ls;function ia(d,t,o,a,h,m,x){const w=d.context,A=w.gl,E=d.useProgram("collisionBox"),k=[];let z=0,U=0;for(let ie=0;ie<a.length;ie++){const he=a[ie],we=t.getTile(he),Te=we.getBucket(o);if(!Te)continue;let Ie=he.posMatrix;h[0]===0&&h[1]===0||(Ie=d.translatePosMatrix(he.posMatrix,we,h,m));const ke=x?Te.textCollisionBox:Te.iconCollisionBox,Ce=Te.collisionCircleArray;
vendor: 20,703 bytes, line 584
584if(Ce.length>0){const Be=l.Z(),tt=Ie;l.aU(Be,Te.placementInvProjMatrix,d.transform.glCoordMatrix),l.aU(Be,Be,Te.placementViewportMatrix),k.push({circleArray:Ce,circleOffset:U,transform:tt,invTransform:Be,coord:he}),z+=Ce.length/4,U=z}ke&&E.draw(w,A.LINES,Zt.disabled,Mi.disabled,d.colorModeForRenderPass(),Ai.disabled,Lo(Ie,d.transform,we),d.style.map.terrain&&d.style.map.terrain.getTerrainData(he),o.id,ke.layoutVertexBuffer,ke.indexBuffer,ke.segments,null,d.transform.zoom,null,null,ke.collisionVertexBuffer)}if(!x||!k.length)return;const K=d.useProgram("collisionCircle"),W=new l.aV;W.resize(4*z),W._trim();let J=0;for(const ie of k)for(let he=0;he<ie.circleArray.length/4;he++){const we=4*he,Te=ie.circleArray[we+0],Ie=ie.circleArray[we+1],ke=ie.circleArray[we+2],Ce=ie.circleArray[we+3];W.emplace(J++,Te,Ie,ke,Ce,0),W.emplace(J++,Te,Ie,ke,Ce,1),W.emplace(J++,Te,Ie,ke,Ce,2),W.emplace(J++,Te,Ie,ke,Ce,3)}(!Ls||Ls.length<2*z)&&(Ls=function(ie){const he=2*ie,we=new l.aX;we.resize(he),we._trim();for(let Te=0;Te<he;Te++){const Ie=6*Te;we.uint16[Ie+0]=4*Te+0,we.uint16[Ie+1]=4*Te+1,we.uint16[Ie+2]=4*Te+2,we.uint16[Ie+3]=4*Te+2,we.uint16[Ie+4]=4*Te+3,we.uint16[Ie+5]=4*Te+0}return we}(z));const G=w.createIndexBuffer(Ls,!0),ce=w.createVertexBuffer(W,l.aW.members,!0);for(const ie of k){const he={u_matrix:ie.transform,u_inv_matrix:ie.invTransform,u_camera_to_center_distance:(xe=d.transform).cameraToCenterDistance,u_viewport_size:[xe.width,xe.height]};K.draw(w,A.TRIANGLES,Zt.disabled,Mi.disabled,d.colorModeForRenderPass(),Ai.disabled,he,d.style.map.terrain&&d.style.map.terrain.getTerrainData(ie.coord),o.id,ce,G,l.S.simpleSegment(0,2*ie.circleOffset,ie.circleArray.length,ie.circleArray.length/2),null,d.transform.zoom,null,null,null)}var xe;ce.destroy(),G.destroy()}Ai.disabled=new Ai(!1,1029,2305),Ai.backCCW=new Ai(!0,1029,2305);const Es=l.ao(new Float32Array(16));function na(d,t,o,a,h,m){const{horizontalAlign:x,verticalAlign:w}=l.au(d);return new l.P((-(x-.5)*t/h+a[0])*m,(-(w-.5)*o/h+a[1])*m)}function ra(d,t,o,a,h,m,x,w,A,E,k){const z=d.text.placedSymbolArray,U=d.text.dynamicLayoutVertexArray,K=d.icon.dynamicLayoutVertexArray,W={};U.clear();for(let J=0;J<z.length;J++){const G=z.get(J),ce=G.hidden||!G.crossTileID||d.allowVerticalPlacement&&!G.placedOrientation?null:a[G.crossTileID];if(ce){const xe=new l.P(G.anchorX,G.anchorY),ie=Ci(xe,o?x:m,k),he=to(h.cameraToCenterDistance,ie.signedDistanceFromCamera);let we=l.aj(d.textSizeData,A,G)*he/l.ap;o&&(we*=d.tilePixelRatio/w);const{width:Te,height:Ie,anchor:ke,textOffset:Ce,textBoxScale:Be}=ce,tt=na(ke,Te,Ie,Ce,Be,we),Yt=o?Ci(xe.add(tt),m,k).point:ie.point.add(t?tt.rotate(-h.angle):tt),Ve=d.allowVerticalPlacement&&G.placedOrientation===l.ai.vertical?Math.PI/2:0;for(let gt=0;gt<G.numGlyphs;gt++)l.ak(U,Yt,Ve);E&&G.associatedIconIndex>=0&&(W[G.associatedIconIndex]={shiftedAnchor:Yt,angle:Ve})}else q(G.numGlyphs,U)}if(E){K.clear();const J=d.icon.placedSymbolArray;for(let G=0;G<J.length;G++){const ce=J.get(G);if(ce.hidden)q(ce.numGlyphs,K);else{const xe=W[G];if(xe)for(let ie=0;ie<ce.numGlyphs;ie++)l.ak(K,xe.shiftedAnchor,xe.angle);else q(ce.numGlyphs,K)}}d.icon.dynamicLayoutVertexBuffer.updateData(K)}d.text.dynamicLayoutVertexBuffer.updateData(U)}function oa(d,t,o){return o.iconsInText&&t?"symbolTextAndIcon":d?"symbolSDF":"symbolIcon"}function sa(d,t,o,a,h,m,x,w,A,E,k,z){const U=d.context,K=U.gl,W=d.transform,J=w==="map",G=A==="map",ce=w!=="viewport"&&o.layout.get("symbol-placement")!=="point",xe=J&&!G&&!ce,ie=!o.layout.get("symbol-sort-key").isConstant();let he=!1;const we=d.depthModeForSublayer(0,Zt.ReadOnly),Te=o._unevaluatedLayout.hasValue("text-variable-anchor")||o._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Ie=[];for(const ke of a){const Ce=t.getTile(ke),Be=Ce.getBucket(o);if(!Be)continue;const tt=h?Be.text:Be.icon;if(!tt||!tt.segments.get().length||!tt.hasVisibleVertices)continue;const Yt=tt.programConfigurations.get(o.id),Ve=h||Be.sdfIcons,gt=h?Be.textSizeData:Be.iconSizeData,ot=G||W.pitch!==0,wi=d.useProgram(oa(Ve,h,Be),Yt),Kt=l.ah(gt,W.zoom),Nt=d.style.map.terrain&&d.style.map.terrain.getTerrainData(ke);let Jt,$i,ki,xn,nn=[0,0],Ki=null;if(h)$i=Ce.glyphAtlasTexture,ki=K.LINEAR,Jt=Ce.glyphAtlasTexture.size,Be.iconsInText&&(nn=Ce.imageAtlasTexture.size,Ki=Ce.imageAtlasTexture,xn=ot||d.options.rotating||d.options.zooming||gt.kind==="composite"||gt.kind==="camera"?K.LINEAR:K.NEAREST);else{const qi=o.layout.get("icon-size").constantOr(0)!==1||Be.iconsNeedLinear;$i=Ce.imageAtlasTexture,ki=Ve||d.options.rotating||d.options.zooming||qi||ot?K.LINEAR:K.NEAREST,Jt=Ce.imageAtlasTexture.size}const fr=le(Ce,1,d.transform.zoom),Di=Fe(ke.posMatrix,G,J,d.transform,fr),po=lr(ke.posMatrix,G,J,d.transform,fr),fo=Te&&Be.hasTextData(),ds=o.layout.get("icon-text-fit")!=="none"&&fo&&Be.hasIconData();if(ce){const qi=d.style.map.terrain?(tr,Gi)=>d.style.map.terrain.getElevation(ke,tr,Gi):null,rn=o.layout.get("text-rotation-alignment")==="map";Oe(Be,ke.posMatrix,d,h,Di,po,G,E,rn,qi)}const Os=d.translatePosMatrix(ke.posMatrix,Ce,m,x),_a=ce||h&&Te||ds?Es:Di,Mn=d.translatePosMatrix(po,Ce,m,x,!0),bn=Ve&&o.paint.get(h?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Vn;Vn=Ve?Be.iconsInText?ro(gt.kind,Kt,xe,G,d,Os,_a,Mn,Jt,nn):bi(gt.kind,Kt,xe,G,d,Os,_a,Mn,h,Jt,!0):Jn(gt.kind,Kt,xe,G,d,Os,_a,Mn,h,Jt);const Fs={program:wi,buffers:tt,uniformValues:Vn,atlasTexture:$i,atlasTextureIcon:Ki,atlasInterpolation:ki,atlasInterpolationIcon:xn,isSDF:Ve,hasHalo:bn};if(ie&&Be.canOverlap){he=!0;const qi=tt.segments.get();for(const rn of qi)Ie.push({segments:new l.S([rn]),sortKey:rn.sortKey,state:Fs,terrainData:Nt})}else Ie.push({segments:tt.segments,sortKey:0,state:Fs,terrainData:Nt})}he&&Ie.sort((ke,Ce)=>ke.sortKey-Ce.sortKey);for(const ke of Ie){const Ce=ke.state;if(U.activeTexture.set(K.TEXTURE0),Ce.atlasTexture.bind(Ce.atlasInterpolation,K.CLAMP_TO_EDGE),Ce.atlasTextureIcon&&(U.activeTexture.set(K.TEXTURE1),Ce.atlasTextureIcon&&Ce.atlasTextureIcon.bind(Ce.atlasInterpolationIcon,K.CLAMP_TO_EDGE)),Ce.isSDF){const Be=Ce.uniformValues;Ce.hasHalo&&(Be.u_is_halo=1,Fn(Ce.buffers,ke.segments,o,d,Ce.program,we,k,z,Be,ke.terrainData)),Be.u_is_halo=0}Fn(Ce.buffers,ke.segments,o,d,Ce.program,we,k,z,Ce.uniformValues,ke.terrainData)}}function Fn(d,t,o,a,h,m,x,w,A,E){const k=a.context;h.draw(k,k.gl.TRIANGLES,m,x,w,Ai.disabled,A,E,o.id,d.layoutVertexBuffer,d.indexBuffer,t,o.paint,a.transform.zoom,d.programConfigurations.get(o.id),d.dynamicLayoutVertexBuffer,d.opacityVertexBuffer)}function Pr(d,t,o,a,h){if(!o||!a||!a.imageAtlas)return;const m=a.imageAtlas.patternPositions;let x=m[o.to.toString()],w=m[o.from.toString()];if(!x&&w&&(x=w),!w&&x&&(w=x),!x||!w){const A=h.getPaintProperty(t);x=m[A],w=m[A]}x&&w&&d.setConstantPatternPositions(x,w)}function Cs(d,t,o,a,h,m,x){const w=d.context.gl,A="fill-pattern",E=o.paint.get(A),k=E&&E.constantOr(1),z=o.getCrossfadeParameters();let U,K,W,J,G;x?(K=k&&!o.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",U=w.LINES):(K=k?"fillPattern":"fill",U=w.TRIANGLES);const ce=E.constantOr(null);for(const xe of a){const ie=t.getTile(xe);if(k&&!ie.patternsLoaded())continue;const he=ie.getBucket(o);if(!he)continue;const we=he.programConfigurations.get(o.id),Te=d.useProgram(K,we),Ie=d.style.map.terrain&&d.style.map.terrain.getTerrainData(xe);k&&(d.context.activeTexture.set(w.TEXTURE0),ie.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),we.updatePaintBuffers(z)),Pr(we,A,ce,ie,o);const ke=Ie?xe:null,Ce=d.translatePosMatrix(ke?ke.posMatrix:xe.posMatrix,ie,o.paint.get("fill-translate"),o.paint.get("fill-translate-anchor"));if(x){J=he.indexBuffer2,G=he.segments2;const Be=[w.drawingBufferWidth,w.drawingBufferHeight];W=K==="fillOutlinePattern"&&k?wr(Ce,d,z,ie,Be):Oi(Ce,Be)}else J=he.indexBuffer,G=he.segments,W=k?Br(Ce,d,z,ie):ws(Ce);Te.draw(d.context,U,h,d.stencilModeForClipping(xe),m,Ai.disabled,W,Ie,o.id,he.layoutVertexBuffer,J,G,o.paint,d.transform.zoom,we)}}function Nn(d,t,o,a,h,m,x){const w=d.context,A=w.gl,E="fill-extrusion-pattern",k=o.paint.get(E),z=k.constantOr(1),U=o.getCrossfadeParameters(),K=o.paint.get("fill-extrusion-opacity"),W=k.constantOr(null);for(const J of a){const G=t.getTile(J),ce=G.getBucket(o);if(!ce)continue;const xe=d.style.map.terrain&&d.style.map.terrain.getTerrainData(J),ie=ce.programConfigurations.get(o.id),he=d.useProgram(z?"fillExtrusionPattern":"fillExtrusion",ie);z&&(d.context.activeTexture.set(A.TEXTURE0),G.imageAtlasTexture.bind(A.LINEAR,A.CLAMP_TO_EDGE),ie.updatePaintBuffers(U)),Pr(ie,E,W,G,o);const we=d.translatePosMatrix(J.posMatrix,G,o.paint.get("fill-extrusion-translate"),o.paint.get("fill-extrusion-translate-anchor")),Te=o.paint.get("fill-extrusion-vertical-gradient"),Ie=z?no(we,d,Te,K,J,U,G):Pn(we,d,Te,K);he.draw(w,w.gl.TRIANGLES,h,m,x,Ai.backCCW,Ie,xe,o.id,ce.layoutVertexBuffer,ce.indexBuffer,ce.segments,o.paint,d.transform.zoom,ie,d.style.map.terrain&&ce.centroidVertexBuffer)}}function Rl(d,t,o,a,h,m,x){const w=d.context,A=w.gl,E=o.fbo;if(!E)return;const k=d.useProgram("hillshade"),z=d.style.map.terrain&&d.style.map.terrain.getTerrainData(t);w.activeTexture.set(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,E.colorAttachment.get()),k.draw(w,A.TRIANGLES,h,m,x,Ai.disabled,((U,K,W,J)=>{const G=W.paint.get("hillshade-shadow-color"),ce=W.paint.get("hillshade-highlight-color"),xe=W.paint.get("hillshade-accent-color");let ie=W.paint.get("hillshade-illumination-direction")*(Math.PI/180);W.paint.get("hillshade-illumination-anchor")==="viewport"&&(ie-=U.transform.angle);const he=!U.options.moving;return{u_matrix:J?J.posMatrix:U.transform.calculatePosMatrix(K.tileID.toUnwrapped(),he),u_image:0,u_latrange:Ts(0,K.tileID),u_light:[W.paint.get("hillshade-exaggeration"),ie],u_shadow:G,u_highlight:ce,u_accent:xe}})(d,o,a,z?t:null),z,a.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments)}function ao(d,t,o,a,h,m){const x=d.context,w=x.gl,A=t.dem;if(A&&A.data){const E=A.dim,k=A.stride,z=A.getPixels();if(x.activeTexture.set(w.TEXTURE1),x.pixelStoreUnpackPremultiplyAlpha.set(!1),t.demTexture=t.demTexture||d.getTileTexture(k),t.demTexture){const K=t.demTexture;K.update(z,{premultiply:!1}),K.bind(w.NEAREST,w.CLAMP_TO_EDGE)}else t.demTexture=new nt(x,z,w.RGBA,{premultiply:!1}),t.demTexture.bind(w.NEAREST,w.CLAMP_TO_EDGE);x.activeTexture.set(w.TEXTURE0);let U=t.fbo;if(!U){const K=new nt(x,{width:E,height:E,data:null},w.RGBA);K.bind(w.LINEAR,w.CLAMP_TO_EDGE),U=t.fbo=x.createFramebuffer(E,E,!0,!1),U.colorAttachment.set(K.texture)}x.bindFramebuffer.set(U.framebuffer),x.viewport.set([0,0,E,E]),d.useProgram("hillshadePrepare").draw(x,w.TRIANGLES,a,h,m,Ai.disabled,((K,W)=>{const J=W.stride,G=l.Z();return l.aS(G,0,l.N,-l.N,0,0,1),l.$(G,G,[0,-l.N,0]),{u_matrix:G,u_image:1,u_dimension:[J,J],u_zoom:K.overscaledZ,u_unpack:W.getUnpackVector()}})(t.tileID,A),null,o.id,d.rasterBoundsBuffer,d.quadTriangleIndexBuffer,d.rasterBoundsSegments),t.needsHillshadePrepare=!1}}function Bl(d,t,o,a,h,m){const x=a.paint.get("raster-fade-duration");if(!m&&x>0){const w=l.h.now(),A=(w-d.timeAdded)/x,E=t?(w-t.timeAdded)/x:-1,k=o.getSource(),z=h.coveringZoomLevel({tileSize:k.tileSize,roundZoom:k.roundZoom}),U=!t||Math.abs(t.tileID.overscaledZ-z)>Math.abs(d.tileID.overscaledZ-z),K=U&&d.refreshedUponExpiration?1:l.ad(U?A:1-E,0,1);return d.refreshedUponExpiration&&A>=1&&(d.refreshedUponExpiration=!1),t?{opacity:1,mix:1-K}:{opacity:K,mix:0}}return{opacity:1,mix:0}}const os=new l.aT(1,0,0,1),Ms=new l.aT(0,1,0,1),ss=new l.aT(0,0,1,1),nl=new l.aT(1,0,1,1),Or=new l.aT(0,1,1,1);function lo(d,t,o,a){as(d,0,t+o/2,d.transform.width,o,a)}function aa(d,t,o,a){as(d,t-o/2,0,o,d.transform.height,a)}function as(d,t,o,a,h,m){const x=d.context,w=x.gl;w.enable(w.SCISSOR_TEST),w.scissor(t*d.pixelRatio,o*d.pixelRatio,a*d.pixelRatio,h*d.pixelRatio),x.clear({color:m}),w.disable(w.SCISSOR_TEST)}function rl(d,t,o){const a=d.context,h=a.gl,m=o.posMatrix,x=d.useProgram("debug"),w=Zt.disabled,A=Mi.disabled,E=d.colorModeForRenderPass(),k="$debug",z=d.style.map.terrain&&d.style.map.terrain.getTerrainData(o);a.activeTexture.set(h.TEXTURE0);const U=t.getTileByID(o.key).latestRawTileData,K=Math.floor((U&&U.byteLength||0)/1024),W=t.getTile(o).tileSize,J=512/Math.min(W,512)*(o.overscaledZ/d.transform.zoom)*.5;let G=o.canonical.toString();o.overscaledZ!==o.canonical.z&&(G+=` => ${o.overscaledZ}`),function(ce,xe){ce.initDebugOverlayCanvas();const ie=ce.debugOverlayCanvas,he=ce.context.gl,we=ce.debugOverlayCanvas.getContext("2d");we.clearRect(0,0,ie.width,ie.height),we.shadowColor="white",we.shadowBlur=2,we.lineWidth=1.5,we.strokeStyle="white",we.textBaseline="top",we.font="bold 36px Open Sans, sans-serif",we.fillText(xe,5,5),we.strokeText(xe,5,5),ce.debugOverlayTexture.update(ie),ce.debugOverlayTexture.bind(he.LINEAR,he.CLAMP_TO_EDGE)}(d,`${G} ${K}kB`),x.draw(a,h.TRIANGLES,w,A,gi.alphaBlended,Ai.disabled,Eo(m,l.aT.transparent,J),null,k,d.debugBuffer,d.quadTriangleIndexBuffer,d.debugSegments),x.draw(a,h.LINE_STRIP,w,A,E,Ai.disabled,Eo(m,l.aT.red),z,k,d.debugBuffer,d.tileBorderIndexBuffer,d.debugSegments)}function ui(d,t,o){const a=d.context,h=a.gl,m=d.colorModeForRenderPass(),x=new Zt(h.LEQUAL,Zt.ReadWrite,d.depthRangeFor3D),w=d.useProgram("terrain"),A=t.getTerrainMesh();a.bindFramebuffer.set(null),a.viewport.set([0,0,d.width,d.height]);for(const E of o){const k=d.renderToTexture.getTexture(E),z=t.getTerrainData(E.tileID);a.activeTexture.set(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,k.texture);const U={u_matrix:d.transform.calculatePosMatrix(E.tileID.toUnwrapped()),u_texture:0,u_ele_delta:t.getMeshFrameDelta(d.transform.zoom)};w.draw(a,h.TRIANGLES,x,Mi.disabled,m,Ai.backCCW,U,z,"terrain",A.vertexBuffer,A.indexBuffer,A.segments)}}class Do{constructor(t,o){this.context=new Dl(t),this.transform=o,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:l.Z(),renderTime:0},this.setup(),this.numSublayers=hn.maxUnderzooming+hn.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new io}resize(t,o,a){if(this.width=Math.floor(t*a),this.height=Math.floor(o*a),this.pixelRatio=a,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const h of this.style._order)this.style._layers[h].resize()}setup(){const t=this.context,o=new l.a_;o.emplaceBack(0,0),o.emplaceBack(l.N,0),o.emplaceBack(0,l.N),o.emplaceBack(l.N,l.N),this.tileExtentBuffer=t.createVertexBuffer(o,Io.members),this.tileExtentSegments=l.S.simpleSegment(0,0,4,2);const a=new l.a_;a.emplaceBack(0,0),a.emplaceBack(l.N,0),a.emplaceBack(0,l.N),a.emplaceBack(l.N,l.N),this.debugBuffer=t.createVertexBuffer(a,Io.members),this.debugSegments=l.S.simpleSegment(0,0,4,5);const h=new l.V;h.emplaceBack(0,0,0,0),h.emplaceBack(l.N,0,l.N,0),h.emplaceBack(0,l.N,0,l.N),h.emplaceBack(l.N,l.N,l.N,l.N),this.rasterBoundsBuffer=t.createVertexBuffer(h,Kn.members),this.rasterBoundsSegments=l.S.simpleSegment(0,0,4,2);const m=new l.a_;m.emplaceBack(0,0),m.emplaceBack(1,0),m.emplaceBack(0,1),m.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(m,Io.members),this.viewportSegments=l.S.simpleSegment(0,0,4,2);const x=new l.a$;x.emplaceBack(0),x.emplaceBack(1),x.emplaceBack(3),x.emplaceBack(2),x.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(x);const w=new l.b0;w.emplaceBack(0,1,2),w.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(w);const A=this.context.gl;this.stencilClearMode=new Mi({func:A.ALWAYS,mask:0},0,255,A.ZERO,A.ZERO,A.ZERO)}clearStencil(){const t=this.context,o=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const a=l.Z();l.aS(a,0,this.width,this.height,0,0,1),l.a0(a,a,[o.drawingBufferWidth,o.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,o.TRIANGLES,Zt.disabled,this.stencilClearMode,gi.disabled,Ai.disabled,Qo(a),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,o){if(this.currentStencilSource===t.source||!t.isTileClipped()||!o||!o.length)return;this.currentStencilSource=t.source;const a=this.context,h=a.gl;this.nextStencilID+o.length>256&&this.clearStencil(),a.setColorMode(gi.disabled),a.setDepthMode(Zt.disabled);const m=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const x of o){const w=this._tileClippingMaskIDs[x.key]=this.nextStencilID++,A=this.style.map.terrain&&this.style.map.terrain.getTerrainData(x);m.draw(a,h.TRIANGLES,Zt.disabled,new Mi({func:h.ALWAYS,mask:0},w,255,h.KEEP,h.KEEP,h.REPLACE),gi.disabled,Ai.disabled,Qo(x.posMatrix),A,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,o=this.context.gl;return new Mi({func:o.NOTEQUAL,mask:255},t,255,o.KEEP,o.KEEP,o.REPLACE)}stencilModeForClipping(t){const o=this.context.gl;return new Mi({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,o.KEEP,o.KEEP,o.REPLACE)}stencilConfigForOverlap(t){const o=this.context.gl,a=t.sort((x,w)=>w.overscaledZ-x.overscaledZ),h=a[a.length-1].overscaledZ,m=a[0].overscaledZ-h+1;if(m>1){this.currentStencilSource=void 0,this.nextStencilID+m>256&&this.clearStencil();const x={};for(let w=0;w<m;w++)x[w+h]=new Mi({func:o.GEQUAL,mask:255},w+this.nextStencilID,255,o.KEEP,o.KEEP,o.REPLACE);return this.nextStencilID+=m,[x,a]}return[{[h]:Mi.disabled},a]}colorModeForRenderPass(){const t=this.context.gl;return this._showOverdrawInspector?new gi([t.CONSTANT_COLOR,t.ONE],new l.aT(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?gi.unblended:gi.alphaBlended}depthModeForSublayer(t,o,a){if(!this.opaquePassEnabledForLayer())return Zt.disabled;const h=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Zt(a||this.context.gl.LEQUAL,o,[h,h])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,o){this.style=t,this.options=o,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(l.h.now()),this.imageManager.beginFrame();const a=this.style._order,h=this.style.sourceCaches,m={},x={},w={};for(const A in h){const E=h[A];E.used&&E.prepare(this.context),m[A]=E.getVisibleCoordinates(),x[A]=m[A].slice().reverse(),w[A]=E.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let A=0;A<a.length;A++)if(this.style._layers[a[A]].is3D()){this.opaquePassCutoff=A;break}if(this.renderToTexture){this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0;const A=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!l.b1(this.terrainFacilitator.matrix,this.transform.projMatrix)||A.length)&&(l.b2(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(E,k){const z=E.context,U=z.gl,K=gi.unblended,W=new Zt(U.LEQUAL,Zt.ReadWrite,[0,1]),J=k.getTerrainMesh(),G=k.sourceCache.getRenderableTiles(),ce=E.useProgram("terrainDepth");z.bindFramebuffer.set(k.getFramebuffer("depth").framebuffer),z.viewport.set([0,0,E.width/devicePixelRatio,E.height/devicePixelRatio]),z.clear({color:l.aT.transparent,depth:1});for(const xe of G){const ie=k.getTerrainData(xe.tileID),he={u_matrix:E.transform.calculatePosMatrix(xe.tileID.toUnwrapped()),u_ele_delta:k.getMeshFrameDelta(E.transform.zoom)};ce.draw(z,U.TRIANGLES,W,Mi.disabled,K,Ai.backCCW,he,ie,"terrain",J.vertexBuffer,J.indexBuffer,J.segments)}z.bindFramebuffer.set(null),z.viewport.set([0,0,E.width,E.height])}(this,this.style.map.terrain),function(E,k){const z=E.context,U=z.gl,K=gi.unblended,W=new Zt(U.LEQUAL,Zt.ReadWrite,[0,1]),J=k.getTerrainMesh(),G=k.getCoordsTexture(),ce=k.sourceCache.getRenderableTiles(),xe=E.useProgram("terrainCoords");z.bindFramebuffer.set(k.getFramebuffer("coords").framebuffer),z.viewport.set([0,0,E.width/devicePixelRatio,E.height/devicePixelRatio]),z.clear({color:l.aT.transparent,depth:1}),k.coordsIndex=[];for(const ie of ce){const he=k.getTerrainData(ie.tileID);z.activeTexture.set(U.TEXTURE0),U.bindTexture(U.TEXTURE_2D,G.texture);const we={u_matrix:E.transform.calculatePosMatrix(ie.tileID.toUnwrapped()),u_terrain_coords_id:(255-k.coordsIndex.length)/255,u_texture:0,u_ele_delta:k.getMeshFrameDelta(E.transform.zoom)};xe.draw(z,U.TRIANGLES,W,Mi.disabled,K,Ai.backCCW,we,he,"terrain",J.vertexBuffer,J.indexBuffer,J.segments),k.coordsIndex.push(ie.tileID.key)}z.bindFramebuffer.set(null),z.viewport.set([0,0,E.width,E.height])}(this,this.style.map.terrain))}this.renderPass="offscreen";for(const A of a){const E=this.style._layers[A];if(!E.hasOffscreenPass()||E.isHidden(this.transform.zoom))continue;
584const k=x[E.source];(E.type==="custom"||k.length)&&this.renderLayer(this,h[E.source],E,k)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:o.showOverdrawInspector?l.aT.black:l.aT.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=o.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){const A=this.style._layers[a[this.currentLayer]],E=h[A.source],k=m[A.source];this._renderTileClippingMasks(A,k),this.renderLayer(this,E,A,k)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<a.length;this.currentLayer++){const A=this.style._layers[a[this.currentLayer]],E=h[A.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(A))continue;const k=(A.type==="symbol"?w:x)[A.source];this._renderTileClippingMasks(A,m[A.source]),this.renderLayer(this,E,A,k)}if(this.options.showTileBoundaries){const A=function(E,k){let z=null;const U=Object.values(E._layers).flatMap(G=>G.source&&!G.isHidden(k)?[E.sourceCaches[G.source]]:[]),K=U.filter(G=>G.getSource().type==="vector"),W=U.filter(G=>G.getSource().type!=="vector"),J=G=>{(!z||z.getSource().maxzoom<G.getSource().maxzoom)&&(z=G)};return K.forEach(G=>J(G)),z||W.forEach(G=>J(G)),z}(this.style,this.transform.zoom);A&&function(E,k,z){for(let U=0;U<z.length;U++)rl(E,k,z[U])}(this,A,A.getVisibleCoordinates())}this.options.showPadding&&function(A){const E=A.transform.padding;lo(A,A.transform.height-(E.top||0),3,os),lo(A,E.bottom||0,3,Ms),aa(A,E.left||0,3,ss),aa(A,A.transform.width-(E.right||0),3,nl);const k=A.transform.centerPoint;(function(z,U,K,W){as(z,U-1,K-10,2,20,W),as(z,U-10,K-1,20,2,W)})(A,k.x,A.transform.height-k.y,Or)}(this),this.context.setDefault()}renderLayer(t,o,a,h){if(!a.isHidden(this.transform.zoom)&&(a.type==="background"||a.type==="custom"||(h||[]).length))switch(this.id=a.id,a.type){case"symbol":(function(m,x,w,A,E){if(m.renderPass!=="translucent")return;const k=Mi.disabled,z=m.colorModeForRenderPass();(w._unevaluatedLayout.hasValue("text-variable-anchor")||w._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(U,K,W,J,G,ce,xe){const ie=K.transform,he=G==="map",we=ce==="map";for(const Te of U){const Ie=J.getTile(Te),ke=Ie.getBucket(W);if(!ke||!ke.text||!ke.text.segments.get().length)continue;const Ce=l.ah(ke.textSizeData,ie.zoom),Be=le(Ie,1,K.transform.zoom),tt=Fe(Te.posMatrix,we,he,K.transform,Be),Yt=W.layout.get("icon-text-fit")!=="none"&&ke.hasIconData();if(Ce){const Ve=Math.pow(2,ie.zoom-Ie.tileID.overscaledZ);ra(ke,he,we,xe,ie,tt,Te.posMatrix,Ve,Ce,Yt,K.style.map.terrain?(gt,ot)=>K.style.map.terrain.getElevation(Te,gt,ot):null)}}}(A,m,w,x,w.layout.get("text-rotation-alignment"),w.layout.get("text-pitch-alignment"),E),w.paint.get("icon-opacity").constantOr(1)!==0&&sa(m,x,w,A,!1,w.paint.get("icon-translate"),w.paint.get("icon-translate-anchor"),w.layout.get("icon-rotation-alignment"),w.layout.get("icon-pitch-alignment"),w.layout.get("icon-keep-upright"),k,z),w.paint.get("text-opacity").constantOr(1)!==0&&sa(m,x,w,A,!0,w.paint.get("text-translate"),w.paint.get("text-translate-anchor"),w.layout.get("text-rotation-alignment"),w.layout.get("text-pitch-alignment"),w.layout.get("text-keep-upright"),k,z),x.map.showCollisionBoxes&&(ia(m,x,w,A,w.paint.get("text-translate"),w.paint.get("text-translate-anchor"),!0),ia(m,x,w,A,w.paint.get("icon-translate"),w.paint.get("icon-translate-anchor"),!1))})(t,o,a,h,this.style.placement.variableOffsets);break;case"circle":(function(m,x,w,A){if(m.renderPass!=="translucent")return;const E=w.paint.get("circle-opacity"),k=w.paint.get("circle-stroke-width"),z=w.paint.get("circle-stroke-opacity"),U=!w.layout.get("circle-sort-key").isConstant();if(E.constantOr(1)===0&&(k.constantOr(1)===0||z.constantOr(1)===0))return;const K=m.context,W=K.gl,J=m.depthModeForSublayer(0,Zt.ReadOnly),G=Mi.disabled,ce=m.colorModeForRenderPass(),xe=[];for(let ie=0;ie<A.length;ie++){const he=A[ie],we=x.getTile(he),Te=we.getBucket(w);if(!Te)continue;const Ie=Te.programConfigurations.get(w.id),ke=m.useProgram("circle",Ie),Ce=Te.layoutVertexBuffer,Be=Te.indexBuffer,tt=m.style.map.terrain&&m.style.map.terrain.getTerrainData(he),Yt={programConfiguration:Ie,program:ke,layoutVertexBuffer:Ce,indexBuffer:Be,uniformValues:Yn(m,he,we,w),terrainData:tt};if(U){const Ve=Te.segments.get();for(const gt of Ve)xe.push({segments:new l.S([gt]),sortKey:gt.sort
584Key,state:Yt})}else xe.push({segments:Te.segments,sortKey:0,state:Yt})}U&&xe.sort((ie,he)=>ie.sortKey-he.sortKey);for(const ie of xe){const{programConfiguration:he,program:we,layoutVertexBuffer:Te,indexBuffer:Ie,uniformValues:ke,terrainData:Ce}=ie.state;we.draw(K,W.TRIANGLES,J,G,ce,Ai.disabled,ke,Ce,w.id,Te,Ie,ie.segments,w.paint,m.transform.zoom,he)}})(t,o,a,h);break;case"heatmap":(function(m,x,w,A){if(w.paint.get("heatmap-opacity")!==0)if(m.renderPass==="offscreen"){const E=m.context,k=E.gl,z=Mi.disabled,U=new gi([k.ONE,k.ONE],l.aT.transparent,[!0,!0,!0,!0]);(function(K,W,J){const G=K.gl;K.activeTexture.set(G.TEXTURE1),K.viewport.set([0,0,W.width/4,W.height/4]);let ce=J.heatmapFbo;if(ce)G.bindTexture(G.TEXTURE_2D,ce.colorAttachment.get()),K.bindFramebuffer.set(ce.framebuffer);else{const xe=G.createTexture();G.bindTexture(G.TEXTURE_2D,xe),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_WRAP_S,G.CLAMP_TO_EDGE),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_WRAP_T,G.CLAMP_TO_EDGE),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_MIN_FILTER,G.LINEAR),G.texParameteri(G.TEXTURE_2D,G.TEXTURE_MAG_FILTER,G.LINEAR),ce=J.heatmapFbo=K.createFramebuffer(W.width/4,W.height/4,!1,!1),function(ie,he,we,Te){var Ie,ke;const Ce=ie.gl,Be=(Ie=ie.HALF_FLOAT)!==null&&Ie!==void 0?Ie:Ce.UNSIGNED_BYTE,tt=(ke=ie.RGBA16F)!==null&&ke!==void 0?ke:Ce.RGBA;Ce.texImage2D(Ce.TEXTURE_2D,0,tt,he.width/4,he.height/4,0,Ce.RGBA,Be,null),Te.colorAttachment.set(we)}(K,W,xe,ce)}})(E,m,w),E.clear({color:l.aT.transparent});for(let K=0;K<A.length;K++){const W=A[K];if(x.hasRenderableParent(W))continue;const J=x.getTile(W),G=J.getBucket(w);if(!G)continue;const ce=G.programConfigurations.get(w.id),xe=m.useProgram("heatmap",ce),{zoom:ie}=m.transform;xe.draw(E,k.TRIANGLES,Zt.disabled,z,U,Ai.disabled,Aa(W.posMatrix,J,ie,w.paint.get("heatmap-intensity")),null,w.id,G.layoutVertexBuffer,G.indexBuffer,G.segments,w.paint,m.transform.zoom,ce)}E.viewport.set([0,0,m.width,m.height])}else m.renderPass==="translucent"&&(m.context.setColorMode(m.colorModeForRenderPass()),function(E,k){const z=E.context,U=z.gl,K=k.heatmapFbo;if(!K)return;z.activeTexture.set(U.TEXTURE0),U.bindTexture(U.TEXTURE_2D,K.colorAttachment.get()),z.activeTexture.set(U.TEXTURE1);let W=k.colorRampTexture;W||(W=k.colorRampTexture=new nt(z,k.colorRamp,U.RGBA)),W.bind(U.LINEAR,U.CLAMP_TO_EDGE),E.useProgram("heatmapTexture").draw(z,U.TRIANGLES,Zt.disabled,Mi.disabled,E.colorModeForRenderPass(),Ai.disabled,((J,G,ce,xe)=>{const ie=l.Z();l.aS(ie,0,J.width,J.height,0,0,1);const he=J.context.gl;return{u_matrix:ie,u_world:[he.drawingBufferWidth,he.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:G.paint.get("heatmap-opacity")}})(E,k),null,k.id,E.viewportBuffer,E.quadTriangleIndexBuffer,E.viewportSegments,k.paint,E.transform.zoom)}(m,w))})(t,o,a,h);break;case"line":(function(m,x,w,A){if(m.renderPass!=="translucent")return;const E=w.paint.get("line-opacity"),k=w.paint.get("line-width");if(E.constantOr(1)===0||k.constantOr(1)===0)return;const z=m.depthModeForSublayer(0,Zt.ReadOnly),U=m.colorModeForRenderPass(),K=w.paint.get("line-dasharray"),W=w.paint.get("line-pattern"),J=W.constantOr(1),G=w.paint.get("line-gradient"),ce=w.getCrossfadeParameters(),xe=J?"linePattern":K?"lineSDF":G?"lineGradient":"line",ie=m.context,he=ie.gl;let we=!0;for(const Te of A){const Ie=x.getTile(Te);if(J&&!Ie.patternsLoaded())continue;const ke=Ie.getBucket(w);if(!ke)continue;const Ce=ke.programConfigurations.get(w.id),Be=m.context.program.get(),tt=m.useProgram(xe,Ce),Yt=we||tt.program!==Be,Ve=m.style.map.terrain&&m.style.map.terrain.getTerrainData(Te),gt=W.constantOr(null);if(gt&&Ie.imageAtlas){const Kt=Ie.imageAtlas,Nt=Kt.patternPositions[gt.to.toString()],Jt=Kt.patternPositions[gt.from.toString()];Nt&&Jt&&Ce.setConstantPatternPositions(Nt,Jt)}const ot=Ve?Te:null,wi=J?Pa(m,Ie,w,ce,ot):K?Ss(m,Ie,w,K,ce,ot):G?Gs(m,Ie,w,ke.lineClipsArray.length,ot):es(m,Ie,w,ot);if(J)ie.activeTexture.set(he.TEXTURE0),Ie.imageAtlasTexture.bind(he.LINEAR,he.CLAMP_TO_EDGE),Ce.updatePaintBuffers(ce);else if(K&&(Yt||m.lineAtlas.dirty))ie.activeTexture.set(he.TEXTURE0),m.lineAtlas.bind(ie);else if(G){const Kt=ke.gradients[w.id];let Nt=Kt.texture;if(w.gradientVersion!==Kt.version){let Jt=256;if(w.stepInterpolant){const $i=x.getSource().maxzoom,ki=Te.canonical.z===$i?Math.
584ceil(1<<m.transform.maxZoom-Te.canonical.z):1;Jt=l.ad(l.aY(ke.maxLineLength/l.N*1024*ki),256,ie.maxTextureSize)}Kt.gradient=l.aZ({expression:w.gradientExpression(),evaluationKey:"lineProgress",resolution:Jt,image:Kt.gradient||void 0,clips:ke.lineClipsArray}),Kt.texture?Kt.texture.update(Kt.gradient):Kt.texture=new nt(ie,Kt.gradient,he.RGBA),Kt.version=w.gradientVersion,Nt=Kt.texture}ie.activeTexture.set(he.TEXTURE0),Nt.bind(w.stepInterpolant?he.NEAREST:he.LINEAR,he.CLAMP_TO_EDGE)}tt.draw(ie,he.TRIANGLES,z,m.stencilModeForClipping(Te),U,Ai.disabled,wi,Ve,w.id,ke.layoutVertexBuffer,ke.indexBuffer,ke.segments,w.paint,m.transform.zoom,Ce,ke.layoutVertexBuffer2),we=!1}})(t,o,a,h);break;case"fill":(function(m,x,w,A){const E=w.paint.get("fill-color"),k=w.paint.get("fill-opacity");if(k.constantOr(1)===0)return;const z=m.colorModeForRenderPass(),U=w.paint.get("fill-pattern"),K=m.opaquePassEnabledForLayer()&&!U.constantOr(1)&&E.constantOr(l.aT.transparent).a===1&&k.constantOr(0)===1?"opaque":"translucent";if(m.renderPass===K){const W=m.depthModeForSublayer(1,m.renderPass==="opaque"?Zt.ReadWrite:Zt.ReadOnly);Cs(m,x,w,A,W,z,!1)}if(m.renderPass==="translucent"&&w.paint.get("fill-antialias")){const W=m.depthModeForSublayer(w.getPaintProperty("fill-outline-color")?2:0,Zt.ReadOnly);Cs(m,x,w,A,W,z,!0)}})(t,o,a,h);break;case"fill-extrusion":(function(m,x,w,A){const E=w.paint.get("fill-extrusion-opacity");if(E!==0&&m.renderPass==="translucent"){const k=new Zt(m.context.gl.LEQUAL,Zt.ReadWrite,m.depthRangeFor3D);if(E!==1||w.paint.get("fill-extrusion-pattern").constantOr(1))Nn(m,x,w,A,k,Mi.disabled,gi.disabled),Nn(m,x,w,A,k,m.stencilModeFor3D(),m.colorModeForRenderPass());else{const z=m.colorModeForRenderPass();Nn(m,x,w,A,k,Mi.disabled,z)}}})(t,o,a,h);break;case"hillshade":(function(m,x,w,A){if(m.renderPass!=="offscreen"&&m.renderPass!=="translucent")return;const E=m.context,k=m.depthModeForSublayer(0,Zt.ReadOnly),z=m.colorModeForRenderPass(),[U,K]=m.renderPass==="translucent"?m.stencilConfigForOverlap(A):[{},A];for(const W of K){const J=x.getTile(W);J.needsHillshadePrepare!==void 0&&J.needsHillshadePrepare&&m.renderPass==="offscreen"?ao(m,J,w,k,Mi.disabled,z):m.renderPass==="translucent"&&Rl(m,W,J,w,k,U[W.overscaledZ],z)}E.viewport.set([0,0,m.width,m.height])})(t,o,a,h);break;case"raster":(function(m,x,w,A){if(m.renderPass!=="translucent"||w.paint.get("raster-opacity")===0||!A.length)return;const E=m.context,k=E.gl,z=x.getSource(),U=m.useProgram("raster"),K=m.colorModeForRenderPass(),[W,J]=z instanceof Sn?[{},A]:m.stencilConfigForOverlap(A),G=J[J.length-1].overscaledZ,ce=!m.options.moving;for(const xe of J){const ie=m.depthModeForSublayer(xe.overscaledZ-G,w.paint.get("raster-opacity")===1?Zt.ReadWrite:Zt.ReadOnly,k.LESS),he=x.getTile(xe);he.registerFadeDuration(w.paint.get("raster-fade-duration"));const we=x.findLoadedParent(xe,0),Te=Bl(he,we,x,w,m.transform,m.style.map.terrain);let Ie,ke;const Ce=w.paint.get("raster-resampling")==="nearest"?k.NEAREST:k.LINEAR;E.activeTexture.set(k.TEXTURE0),he.texture.bind(Ce,k.CLAMP_TO_EDGE,k.LINEAR_MIPMAP_NEAREST),E.activeTexture.set(k.TEXTURE1),we?(we.texture.bind(Ce,k.CLAMP_TO_EDGE,k.LINEAR_MIPMAP_NEAREST),Ie=Math.pow(2,we.tileID.overscaledZ-he.tileID.overscaledZ),ke=[he.tileID.canonical.x*Ie%1,he.tileID.canonical.y*Ie%1]):he.texture.bind(Ce,k.CLAMP_TO_EDGE,k.LINEAR_MIPMAP_NEAREST);const Be=m.style.map.terrain&&m.style.map.terrain.getTerrainData(xe),tt=Be?xe:null,Yt=tt?tt.posMatrix:m.transform.calculatePosMatrix(xe.toUnwrapped(),ce),Ve=Qa(Yt,ke||[0,0],Ie||1,Te,w);z instanceof Sn?U.draw(E,k.TRIANGLES,ie,Mi.disabled,K,Ai.disabled,Ve,Be,w.id,z.boundsBuffer,m.quadTriangleIndexBuffer,z.boundsSegments):U.draw(E,k.TRIANGLES,ie,W[xe.overscaledZ],K,Ai.disabled,Ve,Be,w.id,m.rasterBoundsBuffer,m.quadTriangleIndexBuffer,m.rasterBoundsSegments)}})(t,o,a,h);break;case"background":(function(m,x,w,A){const E=w.paint.get("background-color"),k=w.paint.get("background-opacity");if(k===0)return;const z=m.context,U=z.gl,K=m.transform,W=K.tileSize,J=w.paint.get("background-pattern");if(m.isPatternMissing(J))return;const G=!J&&E.a===1&&k===1&&m.opaquePassEnabledForLayer()?"opaque":"translucent";if(m.renderPass!==G)return;const ce=Mi.disabled,xe=m.depthModeForSublayer(0,G==="opaque"?Zt.ReadWrite:Zt.ReadOnly),ie=m.colorModeForRenderPass(),he=m.useProgram(J?"backgroundPattern":"background"),we=A||K.coveringTiles({tileSize:W,terrain:m.style.map.terrain});J&&(z.activeTexture.set(U.TEXTURE0),m.imageManager.bind(m.context));const Te=w.getCrossfadeParameters();for(const Ie of we){const ke=A?Ie.posMatrix:m.transform.calculatePosMatrix(Ie.toUnwrapped()),Ce=J?In(ke,k,m,J,{tileID:Ie,tileSize:W},Te):is(ke,k,E),Be=m.style.map.terrain&&m.style.map.terrain.getTerrainData(Ie);he.draw(z,U.TRIANGLES,xe,ce,ie,Ai.disabled,Ce,Be,w.id,m.tileExtentBuffer,m.quadTriangleIndexBuffer,m.tileExtentSegments)}})(t,0,a,h);break;
vendor: 12,084 bytes, line 584
584case"custom":(function(m,x,w){const A=m.context,E=w.implementation;if(m.renderPass==="offscreen"){const k=E.prerender;k&&(m.setCustomLayerDefaults(),A.setColorMode(m.colorModeForRenderPass()),k.call(E,A.gl,m.transform.customLayerMatrix()),A.setDirty(),m.setBaseState())}else if(m.renderPass==="translucent"){m.setCustomLayerDefaults(),A.setColorMode(m.colorModeForRenderPass()),A.setStencilMode(Mi.disabled);const k=E.renderingMode==="3d"?new Zt(m.context.gl.LEQUAL,Zt.ReadWrite,m.depthRangeFor3D):m.depthModeForSublayer(0,Zt.ReadOnly);A.setDepthMode(k),E.render(A.gl,m.transform.customLayerMatrix()),A.setDirty(),m.setBaseState(),A.bindFramebuffer.set(null)}})(t,0,a)}}translatePosMatrix(t,o,a,h,m){if(!a[0]&&!a[1])return t;const x=m?h==="map"?this.transform.angle:0:h==="viewport"?-this.transform.angle:0;if(x){const E=Math.sin(x),k=Math.cos(x);a=[a[0]*k-a[1]*E,a[0]*E+a[1]*k]}const w=[m?a[0]:le(o,a[0],this.transform.zoom),m?a[1]:le(o,a[1],this.transform.zoom),0],A=new Float32Array(16);return l.$(A,t,w),A}saveTileTexture(t){const o=this._tileTextures[t.size[0]];o?o.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const o=this._tileTextures[t];return o&&o.length>0?o.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const o=this.imageManager.getPattern(t.from.toString()),a=this.imageManager.getPattern(t.to.toString());return!o||!a}useProgram(t,o){this.cache=this.cache||{};const a=t+(o?o.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[a]||(this.cache[a]=new Jo(this.context,vi[t],o,ns[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[a]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new nt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:o}=this.context.gl;return this.width!==t||this.height!==o}}class Wi{constructor(t,o){this.points=t,this.planes=o}static fromInvProjectionMatrix(t,o,a){const h=Math.pow(2,a),m=[[-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(w=>{const A=1/(w=l.ag([],w,t))[3]/o*h;return l.b3(w,w,[A,A,1/w[3],A])}),x=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(w=>{const A=function(U,K){var W=K[0],J=K[1],G=K[2],ce=W*W+J*J+G*G;return ce>0&&(ce=1/Math.sqrt(ce)),U[0]=K[0]*ce,U[1]=K[1]*ce,U[2]=K[2]*ce,U}([],function(U,K,W){var J=K[0],G=K[1],ce=K[2],xe=W[0],ie=W[1],he=W[2];return U[0]=G*he-ce*ie,U[1]=ce*xe-J*he,U[2]=J*ie-G*xe,U}([],_t([],m[w[0]],m[w[1]]),_t([],m[w[2]],m[w[1]]))),E=-((k=A)[0]*(z=m[w[1]])[0]+k[1]*z[1]+k[2]*z[2]);var k,z;return A.concat(E)});return new Wi(m,x)}}class ls{constructor(t,o){this.min=t,this.max=o,this.center=function(a,h,m){return a[0]=.5*h[0],a[1]=.5*h[1],a[2]=.5*h[2],a}([],function(a,h,m){return a[0]=h[0]+m[0],a[1]=h[1]+m[1],a[2]=h[2]+m[2],a}([],this.min,this.max))}quadrant(t){const o=[t%2==0,t<2],a=fi(this.min),h=fi(this.max);for(let m=0;m<o.length;m++)a[m]=o[m]?this.min[m]:this.center[m],h[m]=o[m]?this.center[m]:this.max[m];return h[2]=this.max[2],new ls(a,h)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersects(t){const o=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let a=!0;for(let h=0;h<t.planes.length;h++){const m=t.planes[h];let x=0;for(let w=0;w<o.length;w++)l.b4(m,o[w])>=0&&x++;if(x===0)return 0;x!==o.length&&(a=!1)}if(a)return 2;for(let h=0;h<3;h++){let m=Number.MAX_VALUE,x=-Number.MAX_VALUE;for(let w=0;w<t.points.length;w++){const A=t.points[w][h]-this.min[h];m=Math.min(m,A),x=Math.max(x,A)}if(x<0||m>this.max[h]-this.min[h])return 0}return 1}}class Un{constructor(t=0,o=0,a=0,h=0){if(isNaN(t)||t<0||isNaN(o)||o<0||isNaN(a)||a<0||isNaN(h)||h<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=o,this.left=a,this.right=h}interpolate(t,o,a){return o.top!=null&&t.top!=null&&(this.top=l.B.number(t.top,o.top,a)),o.bottom!=null&&t.bottom!=null&&(this.bottom=l.B.number(t.bottom,o.bottom,a)),o.left!=null&&t.left!=null&&(this.left=l.B.number(t.left,o.left,a)),o.right!=null&&t.right!=null&&(this.right=l.B.number(t.right,o.right,a)),this}getCenter(t,o){const a=l.ad((this.left+t-this.right)/2,0,t),h=l.ad((this.top+o-this.bottom)/2,0,o);return new l.P(a,h)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Un(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Ro{constructor(t,o,a,h,m){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=m===void 0||!!m,this._minZoom=t||0,this._maxZoom=o||22,this._minPitch=a==null?0:a,this._maxPitch=h==null?60:h,this.setMaxBounds(),this.width=0,this.height=0,this._center=new l.L(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Un,this._posMatrixCache={},this._alignedPosMatrixCache={},this._minEleveationForCurrentTile=0}clone(){const t=new Ro(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this._minEleveationForCurrentTile=t._minEleveationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){t===void 0?t=!0:t===null&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new l.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const o=-l.b5(t,-180,180)*Math.PI/180;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=function(){var a=new l.A(4);return l.A!=Float32Array&&(a[1]=0,a[2]=0),a[0]=1,a[3]=1,a}(),function(a,h,m){var x=h[0],w=h[1],A=h[2],E=h[3],k=Math.sin(m),z=Math.cos(m);a[0]=x*z+A*k,a[1]=w*z+E*k,a[2]=x*-k+A*z,a[3]=w*-k+E*z}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const o=l.ad(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const o=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._zoom=o,this.tileZoom=Math.max(0,Math.floor(o)),this.scale=this.zoomScale(o),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,o,a){this._unmodified=!1,this._edgeInsets.interpolate(t,o,a),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const o=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,o)}getVisibleUnwrappedCoordinates(t){const o=[new l.b6(0,t)];if(this._renderWorldCopies){const a=this.pointCoordinate(new l.P(0,0)),h=this.pointCoordinate(new l.P(this.width,0)),m=this.pointCoordinate(new l.P(this.width,this.height)),x=this.pointCoordinate(new l.P(0,this.height)),w=Math.floor(Math.min(a.x,h.x,m.x,x.x)),A=Math.floor(Math.max(a.x,h.x,m.x,x.x)),E=1;for(let k=w-E;k<=A+E;k++)k!==0&&o.push(new l.b6(k,t))}return o}coveringTiles(t){var o,a;let h=this.coveringZoomLevel(t);const m=h;if(t.minzoom!==void 0&&h<t.minzoom)return[];t.maxzoom!==void 0&&h>t.maxzoom&&(h=t.maxzoom);const x=this.pointCoordinate(this.getCameraPoint()),w=l.U.fromLngLat(this.center),A=Math.pow(2,h),E=[A*x.x,A*x.y,0],k=[A*w.x,A*w.y,0],z=Wi.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,h);let U=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(U=h);const K=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,W=ie=>({aabb:new ls([ie*A,0,0],[(ie+1)*A,A,0]),zoom:0,x:0,y:0,wrap:ie,fullyVisible:!1}),J=[],G=[],ce=h,xe=t.reparseOverscaled?m:h;if(this._renderWorldCopies)for(let ie=1;ie<=3;ie++)J.push(W(-ie)),J.push(W(ie));for(J.push(W(0));J.length>0;){const ie=J.pop(),he=ie.x,we=ie.y;let Te=ie.fullyVisible;if(!Te){const tt=ie.aabb.intersects(z);if(tt===0)continue;Te=tt===2}const Ie=t.terrain?E:k,ke=ie.aabb.distanceX(Ie),Ce=ie.aabb.distanceY(Ie),Be=Math.max(Math.abs(ke),Math.abs(Ce));if(ie.zoom===ce||Be>K+(1<<ce-ie.zoom)-2&&ie.zoom>=U){const tt=ce-ie.zoom,Yt=E[0]-.5-(he<<tt),Ve=E[1]-.5-(we<<tt);G.push({tileID:new l.O(ie.zoom===ce?xe:ie.zoom,ie.wrap,ie.zoom,he,we),distanceSq:Qe([k[0]-.5-he,k[1]-.5-we]),tileDistanceToCamera:Math.sqrt(Yt*Yt+Ve*Ve)})}else for(let tt=0;tt<4;tt++){const Yt=(he<<1)+tt%2,Ve=(we<<1)+(tt>>1),gt=ie.zoom+1;let ot=ie.aabb.quadrant(tt);if(t.terrain){const wi=new l.O(gt,ie.wrap,gt,Yt,Ve),Kt=t.terrain.getMinMaxElevation(wi),Nt=(o=Kt.minElevation)!==null&&o!==void 0?o:this.elevation,Jt=(a=Kt.maxElevation)!==null&&a!==void 0?a:this.elevation;ot=new ls([ot.min[0],ot.min[1],Nt],[ot.max[0],ot.max[1],Jt])}J.push({aabb:ot,zoom:gt,x:Yt,y:Ve,wrap:ie.wrap,fullyVisible:Te})}}return G.sort((ie,he)=>ie.distanceSq-he.distanceSq).map(ie=>ie.tileID)}resize(t,o){this.width=t,this.height=o,this.pixelsToGLUnits=[2/t,-2/o],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const o=l.ad(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new l.P(l.G(t.lng)*this.worldSize,l.H(o)*this.worldSize)}unproject(t){return new l.U(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),alt
584itude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const o=this.pointLocation(this.centerPoint,t),a=t.getElevationForLngLatZoom(o,this.tileZoom);if(!(this.elevation-a))return;const h=this.getCameraPosition(),m=l.U.fromLngLat(h.lngLat,h.altitude),x=l.U.fromLngLat(o,a),w=m.x-x.x,A=m.y-x.y,E=m.z-x.z,k=Math.sqrt(w*w+A*A+E*E),z=this.scaleZoom(this.cameraToCenterDistance/k/this.tileSize);this._elevation=a,this._center=o,this.zoom=z}setLocationAtPoint(t,o){const a=this.pointCoordinate(o),h=this.pointCoordinate(this.centerPoint),m=this.locationCoordinate(t),x=new l.U(m.x-(a.x-h.x),m.y-(a.y-h.y));this.center=this.coordinateLocation(x),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,o){return o?this.coordinatePoint(this.locationCoordinate(t),o.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,o){return this.coordinateLocation(this.pointCoordinate(t,o))}locationCoordinate(t){return l.U.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,o){if(o){const U=o.pointCoordinate(t);if(U!=null)return U}const a=[t.x,t.y,0,1],h=[t.x,t.y,1,1];l.ag(a,a,this.pixelMatrixInverse),l.ag(h,h,this.pixelMatrixInverse);const m=a[3],x=h[3],w=a[1]/m,A=h[1]/x,E=a[2]/m,k=h[2]/x,z=(0-E)/(k-E);return new l.U(l.B.number(a[0]/m,h[0]/x,z)/this.worldSize,l.B.number(w,A,z)/this.worldSize)}coordinatePoint(t,o=0,a=this.pixelMatrix){const h=[t.x*this.worldSize,t.y*this.worldSize,o,1];return l.ag(h,h,a),new l.P(h[0]/h[3],h[1]/h[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return new Lt().extend(this.pointLocation(new l.P(0,t))).extend(this.pointLocation(new l.P(this.width,t))).extend(this.pointLocation(new l.P(this.width,this.height))).extend(this.pointLocation(new l.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Lt([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,o=!1){const a=t.key,h=o?this._alignedPosMatrixCache:this._posMatrixCache;if(h[a])return h[a];const m=t.canonical,x=this.worldSize/this.zoomScale(m.z),w=m.x+Math.pow(2,m.z)*t.wrap,A=l.ao(new Float64Array(16));return l.$(A,A,[w*x,m.y*x,0]),l.a0(A,A,[x/l.N,x/l.N,1]),l.a1(A,o?this.alignedProjMatrix:this.projMatrix,A),h[a]=new Float32Array(A),h[a]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,o,a,h,m=-90,x=90,w=-180,A=180;const E=this.size,k=this._unmodified;if(this.latRange){const K=this.latRange;m=l.H(K[1])*this.worldSize,x=l.H(K[0])*this.worldSize,t=x-m<E.y?E.y/(x-m):0}if(this.lngRange){const K=this.lngRange;w=l.b5(l.G(K[0])*this.worldSize,0,this.worldSize),A=l.b5(l.G(K[1])*this.worldSize,0,this.worldSize),A<w&&(A+=this.worldSize),o=A-w<E.x?E.x/(A-w):0}const z=this.point,U=Math.max(o||0,t||0);if(U)return this.center=this.unproject(new l.P(o?(A+w)/2:z.x,t?(x+m)/2:z.y)),this.zoom+=this.scaleZoom(U),this._unmodified=k,void(this._constraining=!1);if(this.latRange){const K=z.y,W=E.y/2;K-W<m&&(h=m+W),K+W>x&&(h=x-W)}if(this.lngRange){const K=(w+A)/2,W=l.b5(z.x,K-this.worldSize/2,K+this.worldSize/2),J=E.x/2;W-J<w&&(a=w+J),W+J>A&&(a=A-J)}a===void 0&&h===void 0||(this.center=this.unproject(new l.P(a!==void 0?a:z.x,h!==void 0?h:z.y)).wrap()),this._unmodified=k,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,o=this.point.x,a=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=l.b7(1,this.center.lat)*this.worldSize;let h=l.ao(new Float64Array(16));l.a0(h,h,[this.width/2,-this.height/2,1]),l.$(h,h,[1,-1,0]),this.labelPlaneMatr
vendor: 5,430 bytes, line 584
584ix=h,h=l.ao(new Float64Array(16)),l.a0(h,h,[1,-1,1]),l.$(h,h,[-1,-1,0]),l.a0(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h;const m=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),x=Math.min(this.elevation,this._minEleveationForCurrentTile),w=m-x*this._pixelPerMeter/Math.cos(this._pitch),A=x<0?w:m,E=Math.PI/2+this._pitch,k=this._fov*(.5+t.y/this.height),z=Math.sin(k)*A/Math.sin(l.ad(Math.PI-E-k,.01,Math.PI-.01)),U=this.getHorizon(),K=2*Math.atan(U/this.cameraToCenterDistance)*(.5+t.y/(2*U)),W=Math.sin(K)*A/Math.sin(l.ad(Math.PI-E-K,.01,Math.PI-.01)),J=Math.min(z,W),G=1.01*(Math.cos(Math.PI/2-this._pitch)*J+A),ce=this.height/50;h=new Float64Array(16),l.b8(h,this._fov,this.width/this.height,ce,G),h[8]=2*-t.x/this.width,h[9]=2*t.y/this.height,l.a0(h,h,[1,-1,1]),l.$(h,h,[0,0,-this.cameraToCenterDistance]),l.b9(h,h,this._pitch),l.ae(h,h,this.angle),l.$(h,h,[-o,-a,0]),this.mercatorMatrix=l.a0([],h,[this.worldSize,this.worldSize,this.worldSize]),l.a0(h,h,[1,1,this._pixelPerMeter]),this.pixelMatrix=l.a1(new Float64Array(16),this.labelPlaneMatrix,h),l.$(h,h,[0,0,-this.elevation]),this.projMatrix=h,this.invProjMatrix=l.as([],h),this.pixelMatrix3D=l.a1(new Float64Array(16),this.labelPlaneMatrix,h);const xe=this.width%2/2,ie=this.height%2/2,he=Math.cos(this.angle),we=Math.sin(this.angle),Te=o-Math.round(o)+he*xe+we*ie,Ie=a-Math.round(a)+he*ie+we*xe,ke=new Float64Array(h);if(l.$(ke,ke,[Te>.5?Te-1:Te,Ie>.5?Ie-1:Ie,0]),this.alignedProjMatrix=ke,h=l.as(new Float64Array(16),this.pixelMatrix),!h)throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new l.P(0,0)),o=[t.x*this.worldSize,t.y*this.worldSize,0,1];return l.ag(o,o,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new l.P(0,t))}getCameraQueryGeometry(t){const o=this.getCameraPoint();if(t.length===1)return[t[0],o];{let a=o.x,h=o.y,m=o.x,x=o.y;for(const w of t)a=Math.min(a,w.x),h=Math.min(h,w.y),m=Math.max(m,w.x),x=Math.max(x,w.y);return[new l.P(a,h),new l.P(m,h),new l.P(m,x),new l.P(a,x),new l.P(a,h)]}}}function co(d,t){let o,a=!1,h=null,m=null;const x=()=>{h=null,a&&(d.apply(m,o),h=setTimeout(x,t),a=!1)};return(...w)=>(a=!0,m=this,o=w,h||x(),h)}class Bo{constructor(t){this._getCurrentHash=()=>{const o=window.location.hash.replace("#","");if(this._hashName){let a;return o.split("&").map(h=>h.split("=")).forEach(h=>{h[0]===this._hashName&&(a=h)}),(a&&a[1]||"").split("/")}return o.split("/")},this._onHashChange=()=>{const o=this._getCurrentHash();if(o.length>=3&&!o.some(a=>isNaN(a))){const a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(o[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+o[2],+o[1]],zoom:+o[0],bearing:a,pitch:+(o[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const o=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,o)}catch(a){}},this._updateHash=co(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(t){const o=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,h=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),m=Math.pow(10,h),x=Math.round(o.lng*m)/m,w=Math.round(o.lat*m)/m,A=this._map.getBearing(),E=this._map.getPitch();let k="";if(k+=t?`/${x}/${w}/${a}`:`${a}/${w}/${x}`,(A||E)&&(k+="/"+Math.round(10*A)/10),E&&(k+=`/${Math.round(E)}`),this._hashName){const z=this._hashName;let U=!1;const K=window.location.hash.slice(1).split("&").map(W=>{const J=W.split("=")[0];return J===z?(U=!0,`${J}=${k}`):W}).filter(W=>W);return U||K.push(`${z}=${k}`),`#${K.join("&")}`}return`#${k}`}}const Fr={linearity:.3,easing:l.ba(0,0,.3,1)},la=l.e({deceleration:2500,maxSpeed:1400},Fr),ks=l.e({deceleration:20,maxSpeed:1400},Fr),Oo=l.e({deceleration:1e3,maxSpeed:360},Fr),zs=l.e({deceleration:1e3,maxSpeed:90},Fr);class ca{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:l.h.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,o=l.h.now();for(;t.length>0&&o-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const o={zoom:0,bearing:0,pitch:0,pan:new l.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:m}of this._inertiaBuffer)o.zoom+=m.zoomDelta||0,o.bearing+=m.bearingDelta||0,o.pitch+=m.pitchDelta||0,m.panDelta&&o.pan._add(m.panDelta),m.around&&(o.around=m.around),m.pinchAround&&(o.pinchAround=m.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,h={};if(o.pan.mag()){const m=Ds(o.pan.mag(),a,l.e({},la,t||{}));h.offset=o.pan.mult(m.amount/o.pan.mag()),h.center=this._map.transform.center,dr(h,m)}if(o.zoom){const m=Ds(o.zoom,a,ks);h.zoom=this._map.transform.zoom+m.amount,dr(h,m)}if(o.bearing){const m=Ds(o.bearing,a,Oo);
vendor: 4,633 bytes, line 584
584h.bearing=this._map.transform.bearing+l.ad(m.amount,-179,179),dr(h,m)}if(o.pitch){const m=Ds(o.pitch,a,zs);h.pitch=this._map.transform.pitch+m.amount,dr(h,m)}if(h.zoom||h.bearing){const m=o.pinchAround===void 0?o.around:o.pinchAround;h.around=m?this._map.unproject(m):this._map.getCenter()}return this.clear(),l.e(h,{noMoveStart:!0})}}function dr(d,t){(!d.duration||d.duration<t.duration)&&(d.duration=t.duration,d.easing=t.easing)}function Ds(d,t,o){const{maxSpeed:a,linearity:h,deceleration:m}=o,x=l.ad(d*h/(t/1e3),-a,a),w=Math.abs(x)/(m*h);return{easing:o.easing,duration:1e3*w,amount:x*(w/2)}}class fn extends l.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,o,a,h={}){const m=X.mousePos(o.getCanvasContainer(),a),x=o.unproject(m);super(t,l.e({point:m,lngLat:x,originalEvent:a},h)),this._defaultPrevented=!1,this.target=o}}class Rs extends l.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,o,a){const h=t==="touchend"?a.changedTouches:a.touches,m=X.touchPos(o.getCanvasContainer(),h),x=m.map(A=>o.unproject(A)),w=m.reduce((A,E,k,z)=>A.add(E.div(z.length)),new l.P(0,0));super(t,{points:m,point:w,lngLats:x,lngLat:o.unproject(w),originalEvent:a}),this._defaultPrevented=!1}}class ka extends l.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,o,a){super(t,{originalEvent:a}),this._defaultPrevented=!1}}class ol{constructor(t,o){this._map=t,this._clickTolerance=o.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new ka(t.type,this._map,t))}mousedown(t,o){return this._mousedownPos=o,this._firePreventable(new fn(t.type,this._map,t))}mouseup(t){this._map.fire(new fn(t.type,this._map,t))}click(t,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||this._map.fire(new fn(t.type,this._map,t))}dblclick(t){return this._firePreventable(new fn(t.type,this._map,t))}mouseover(t){this._map.fire(new fn(t.type,this._map,t))}mouseout(t){this._map.fire(new fn(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Rs(t.type,this._map,t))}touchmove(t){this._map.fire(new Rs(t.type,this._map,t))}touchend(t){this._map.fire(new Rs(t.type,this._map,t))}touchcancel(t){this._map.fire(new Rs(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class za{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new fn(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new fn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new fn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nr{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(l.P.convert(t),this._map.terrain)}}class pr{constructor(t,o){this._map=t,this._tr=new Nr(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=o.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,o){this.isEnabled()&&t.shiftKey&&t.button===0&&(X.disableDrag(),this._startPos=this._lastPos=o,this._active=!0)}mousemoveWindow(t,o){if(!this._active)return;const a=o;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)<this._clickTolerance)return;const h=this._startPos;this._lastPos=a,this._box||(this._box=X.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const m=Math.min(h.x,a.x),x=Math.max(h.x,a.x),w=Math.min(h.y,a.y),A=Math.max(h.y,a.y);X.setTransform(this._box,`translate(${m}px,${w}px)`),this._box.style.width=x-m+"px",this._box.style.height=A-w+"px"}mouseupWindow(t,o){if(!this._active||t.button!==0)return;const a=this._startPos,h=o;
vendor: 4,625 bytes, line 584
584if(this.reset(),X.suppressClick(),a.x!==h.x||a.y!==h.y)return this._map.fire(new l.k("boxzoomend",{originalEvent:t})),{cameraAnimation:m=>m.fitScreenCoordinates(a,h,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&t.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(X.remove(this._box),this._box=null),X.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,o){return this._map.fire(new l.k(t,{originalEvent:o}))}}function yn(d,t){if(d.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${d.length}, points ${t.length}`);const o={};for(let a=0;a<d.length;a++)o[d[a].identifier]=t[a];return o}class Ur{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,o,a){(this.centroid||a.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=t.timeStamp),a.length===this.numTouches&&(this.centroid=function(h){const m=new l.P(0,0);for(const x of h)m._add(x);return m.div(h.length)}(o),this.touches=yn(a,o)))}touchmove(t,o,a){if(this.aborted||!this.centroid)return;const h=yn(a,o);for(const m in this.touches){const x=h[m];(!x||x.dist(this.touches[m])>30)&&(this.aborted=!0)}}touchend(t,o,a){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const h=!this.aborted&&this.centroid;if(this.reset(),h)return h}}}class Fo{constructor(t){this.singleTap=new Ur(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,o,a){this.singleTap.touchstart(t,o,a)}touchmove(t,o,a){this.singleTap.touchmove(t,o,a)}touchend(t,o,a){const h=this.singleTap.touchend(t,o,a);if(h){const m=t.timeStamp-this.lastTime<500,x=!this.lastTap||this.lastTap.dist(h)<30;if(m&&x||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=h,this.count===this.numTaps)return this.reset(),h}}}class Vr{constructor(t){this._tr=new Nr(t),this._zoomIn=new Fo({numTouches:1,numTaps:2}),this._zoomOut=new Fo({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,o,a){this._zoomIn.touchstart(t,o,a),this._zoomOut.touchstart(t,o,a)}touchmove(t,o,a){this._zoomIn.touchmove(t,o,a),this._zoomOut.touchmove(t,o,a)}touchend(t,o,a){const h=this._zoomIn.touchend(t,o,a),m=this._zoomOut.touchend(t,o,a),x=this._tr;return h?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:x.zoom+1,around:x.unproject(h)},{originalEvent:t})}):m?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:x.zoom-1,around:x.unproject(m)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ir{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const o=this._moveFunction(...t);if(o.bearingDelta||o.pitchDelta||o.around||o.panDelta)return this._active=!0,o}dragStart(t,o){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=o.length?o[0]:o,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,o){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const h=o.length?o[0]:o;return!this._moved&&h.dist(a)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=h,this._move(a,h))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&X.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Ol={0:1,2:2};class No{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const o=X.mouseButton(t);this._eventButton=o}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}
584isValidMoveEvent(t){return!function(o,a){const h=Ol[a];return o.buttons===void 0||(o.buttons&h)!==h}(t,this._eventButton)}isValidEndEvent(t){return X.mouseButton(t)===this._eventButton}}class sl{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return t.targetTouches.length===1}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}const Zr=d=>{d.mousedown=d.dragStart,d.mousemoveWindow=d.dragMove,d.mouseup=d.dragEnd,d.contextmenu=function(t){t.preventDefault()}},Uo=({enable:d,clickTolerance:t,bearingDegreesPerPixelMoved:o=.8})=>{const a=new No({checkCorrectEvent:h=>X.mouseButton(h)===0&&h.ctrlKey||X.mouseButton(h)===2});return new Ir({clickTolerance:t,move:(h,m)=>({bearingDelta:(m.x-h.x)*o}),moveStateManager:a,enable:d,assignEvents:Zr})},Lr=({enable:d,clickTolerance:t,pitchDegreesPerPixelMoved:o=-.5})=>{const a=new No({checkCorrectEvent:h=>X.mouseButton(h)===0&&h.ctrlKey||X.mouseButton(h)===2});return new Ir({clickTolerance:t,move:(h,m)=>({pitchDelta:(m.y-h.y)*o}),moveStateManager:a,enable:d,assignEvents:Zr})};class He{constructor(t,o){this._minTouches=t.cooperativeGestures?2:1,this._clickTolerance=t.clickTolerance||1,this._map=o,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new l.P(0,0),setTimeout(()=>{this._cancelCooperativeMessage=!1},200)}touchstart(t,o,a){return this._calculateTransform(t,o,a)}touchmove(t,o,a){if(this._map._cooperativeGestures&&(this._minTouches===2&&a.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(t,!1,a.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(a.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,o,a)}touchend(t,o,a){this._calculateTransform(t,o,a),this._active&&a.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,o,a){a.length>0&&(this._active=!0);const h=yn(a,o),m=new l.P(0,0),x=new l.P(0,0);let w=0;for(const E in h){const k=h[E],z=this._touches[E];z&&(m._add(k),x._add(k.sub(z)),w++,h[E]=k)}if(this._touches=h,w<this._minTouches||!x.mag())return;const A=x.div(w);return this._sum._add(A),this._sum.mag()<this._clickTolerance?void 0:{around:m.div(w),panDelta:A}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Qn{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,o,a){this._firstTwoTouches||a.length<2||(this._firstTwoTouches=[a[0].identifier,a[1].identifier],this._start([o[0],o[1]]))}touchmove(t,o,a){if(!this._firstTwoTouches)return;t.preventDefault();const[h,m]=this._firstTwoTouches,x=jr(a,o,h),w=jr(a,o,m);if(!x||!w)return;const A=this._aroundCenter?null:x.add(w).div(2);return this._move([x,w],A,t)}touchend(t,o,a){if(!this._firstTwoTouches)return;const[h,m]=this._firstTwoTouches,x=jr(a,o,h),w=jr(a,o,m);x&&w||(this._active&&X.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&t.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function jr(d,t,o){for(let a=0;a<d.length;a++)if(d[a].identifier===o)return t[a]}function Vo(d,t){return Math.log(d/t)/Math.LN2}class cs extends Qn{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,o){const a=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Vo(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Vo(this._distance,a),pinchAround:o}}}function je(d,t){return 180*d.angleWith(t)/Math.PI}class us extends Qn{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,o){const a=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:je(this._vector,a),pinchAround:o}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const o=25/(Math.PI*this._minDiameter)*360,a=je(t,this._startVector);return Math.abs(a)<o}}function Zo(d){return Math.abs(d.y)>Math.abs(d.x)}class al extends Qn{constructor(t){super(),this._map=t}
vendor: 4,755 bytes, line 584
584reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,o,a){super.touchstart(t,o,a),this._currentTouchCount=a.length}_start(t){this._lastPoints=t,Zo(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,o,a){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const h=t[0].sub(this._lastPoints[0]),m=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(h,m,a.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(h.y+m.y)/2*-.5}):void 0}gestureBeginsVertically(t,o,a){if(this._valid!==void 0)return this._valid;const h=t.mag()>=2,m=o.mag()>=2;if(!h&&!m)return;if(!h||!m)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const x=t.y>0==o.y>0;return Zo(t)&&Zo(o)&&x}}const ua={panStep:100,bearingStep:15,pitchStep:10};class ll{constructor(t){this._tr=new Nr(t);const o=ua;this._panStep=o.panStep,this._bearingStep=o.bearingStep,this._pitchStep=o.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let o=0,a=0,h=0,m=0,x=0;switch(t.keyCode){case 61:case 107:case 171:case 187:o=1;break;case 189:case 109:case 173:o=-1;break;case 37:t.shiftKey?a=-1:(t.preventDefault(),m=-1);break;case 39:t.shiftKey?a=1:(t.preventDefault(),m=1);break;case 38:t.shiftKey?h=1:(t.preventDefault(),x=-1);break;case 40:t.shiftKey?h=-1:(t.preventDefault(),x=1);break;default:return}return this._rotationDisabled&&(a=0,h=0),{cameraAnimation:w=>{const A=this._tr;w.easeTo({duration:300,easeId:"keyboardHandler",easing:Da,zoom:o?Math.round(A.zoom)+o*(t.shiftKey?2:1):A.zoom,bearing:A.bearing+a*this._bearingStep,pitch:A.pitch+h*this._pitchStep,offset:[-m*this._panStep,-x*this._panStep],center:A.center},{originalEvent:t})}}}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 Da(d){return d*(2-d)}const Ra=4.000244140625;class cl{constructor(t,o){this._onTimeout=a=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)},this._map=t,this._tr=new Nr(t),this._el=t.getCanvasContainer(),this._triggerRenderFrame=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&t.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!t[this._map._metaKey])return;t.preventDefault()}let o=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const a=l.h.now(),h=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,o!==0&&o%Ra==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":h>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(h*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),t.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=t,this._delta-=o,this._active||this._start(t)),t.preventDefault()}_start(t){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 o=X.mousePos(this._el,t),a=this._tr;this._around=l.L.convert(this._aroundCenter?a.center:a.unproject(o)),this._aroundPoint=a.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const t=this._tr.transform;if(this._delta!==0){const w=this._type==="wheel"&&Math.abs(this._delta)>Ra?this._wheelZoomRate:this._defaultZoomRate;let A=2/(1+Math.exp(-Math.abs(this._delta*w)));this._delta<0&&A!==0&&(A=1/A);const E=typeof this._targetZoom=="number"?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(E*A))),this._type==="wheel"&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const o=typeof this._targetZoom=="number"?this._targetZoom:t.zoom,a=this._startZoom,h=this._easing;let m,x=!1;if(this._type==="wheel"&&a&&h){const w=Math.min((l.h.now()-this._lastWheelEventTime)/200,1),A=h(w);m=l.B.number(a,o,A),w<1?this._frameId||(this._frameId=!0):x=!0}else m=o,x=!0;return this._active=!0,x&&(this._active=!1,this._finishTimeout=setTimeout(()=>
vendor: 10,449 bytes, line 584
584{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!x,zoomDelta:m-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let o=l.bb;if(this._prevEase){const a=this._prevEase,h=(l.h.now()-a.start)/a.duration,m=a.easing(h+.01)-a.easing(h),x=.27/Math.sqrt(m*m+1e-4)*.01,w=Math.sqrt(.0729-x*x);o=l.ba(x,w,.25,1)}return this._prevEase={start:l.h.now(),duration:t,easing:o},o}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class ha{constructor(t,o){this._clickZoom=t,this._tapZoom=o}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 da{constructor(t){this._tr=new Nr(t),this.reset()}reset(){this._active=!1}dblclick(t,o){return t.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(o)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ba{constructor(){this._tap=new Fo({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,o,a){if(!this._swipePoint)if(this._tapTime){const h=o[0],m=t.timeStamp-this._tapTime<500,x=this._tapPoint.dist(h)<30;m&&x?a.length>0&&(this._swipePoint=h,this._swipeTouch=a[0].identifier):this.reset()}else this._tap.touchstart(t,o,a)}touchmove(t,o,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const h=o[0],m=h.y-this._swipePoint.y;return this._swipePoint=h,t.preventDefault(),this._active=!0,{zoomDelta:m/128}}}else this._tap.touchmove(t,o,a)}touchend(t,o,a){if(this._tapTime)this._swipePoint&&a.length===0&&this.reset();else{const h=this._tap.touchend(t,o,a);h&&(this._tapTime=t.timeStamp,this._tapPoint=h)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class pa{constructor(t,o,a){this._el=t,this._mousePan=o,this._touchPan=a}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class vn{constructor(t,o,a){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=o,this._mousePitch=a}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 uo{constructor(t,o,a,h){this._el=t,this._touchZoom=o,this._touchRotate=a,this._tapDragZoom=h,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-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 r=d=>d.zoom||d.drag||d.pitch||d.rotate;class c extends l.k{}function g(d){return d.panDelta&&d.panDelta.mag()||d.zoomDelta||d.bearingDelta||d.pitchDelta}class S{constructor(t,o){this.handleWindowEvent=h=>{this.handleEvent(h,`${h.type}Window`)},this.handleEvent=(h,m)=>{if(h.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const x=h.type==="renderFrame"?void 0:h,w={needsRenderFrame:!1},A={},E={},k=h.touches,z=k?this._getMapTouches(k):void 0,U=z?X.touchPos(this._el,z):X.mousePos(this._el,h);for(const{handlerName:J,handler:G,allowed:ce}of this._handlers){if(!G.isEnabled())continue;let xe;this._blockedByActive(E,ce,J)?G.reset():G[m||h.type]&&(xe=G[m||h.type](h,U,z),this.mergeHandlerResult(w,A,xe,J,x),xe&&xe.needsRenderFrame&&this._triggerRenderFrame()),(xe||G.isActive())&&(E[J]=G)}const K={};for(const J in this._previousActiveHandlers)E[J]||(K[J]=x);this._previousActiveHandlers=E,(Object.keys(K).length||g(w))&&(this._changes.push([w,A,K]),this._triggerRenderFrame()),(Object.keys(E).length||g(w))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:W}=w;W&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],W(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ca(t),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o);const a=this._el;this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]];for(const[h,m,x]of this._listeners)X.addEventListener(h,m,h===document?this.handleWindowEvent:this.handleEvent,x)}destroy(){for(const[t,o,a]of this._listeners)X.removeEventListener(t,o,t===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(t){const o=this._map,a=o.getCanvasContainer();this._add("mapEvent",new ol(o,t));const h=o.boxZoom=new pr(o,t);this._add("boxZoom",h),t.interactive&&t.boxZoom&&h.enable();const m=new Vr(o),x=new da(o);o.doubleClickZoom=new ha(x,m),this._add("tapZoom",m),this._add("clickZoom",x),t.interactive&&t.doubleClickZoom&&o.doubleClickZoom.enable();const w=new Ba;this._add("tapDragZoom",w);const A=o.touchPitch=new al(o);this._add("touchPitch",A),t.interactive&&t.touchPitch&&o.touchPitch.enable(t.touchPitch);const E=Uo(t),k=Lr(t);o.dragRotate=new vn(t,E,k),this._add("mouseRotate",E,["mousePitch"]),this._add("mousePitch",k,["mouseRotate"]),t.interactive&&t.dragRotate&&o.dragRotate.enable();const z=(({enable:ce,clickTolerance:xe})=>{const ie=new No({checkCorrectEvent:he=>X.mouseButton(he)===0&&!he.ctrlKey});return new Ir({clickTolerance:xe,move:(he,we)=>({around:we,panDelta:we.sub(he)}),activateOnStart:!0,moveStateManager:ie,enable:ce,assignEvents:Zr})})(t),U=new He(t,o);o.dragPan=new pa(a,z,U),this._add("mousePan",z),this._add("touchPan",U,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&o.dragPan.enable(t.dragPan);const K=new us,W=new cs;o.touchZoomRotate=new uo(a,W,K,w),this._add("touchRotate",K,["touchPan","touchZoom"]),this._add("touchZoom",W,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&o.touchZoomRotate.enable(t.touchZoomRotate);const J=o.scrollZoom=new cl(o,()=>this._triggerRenderFrame());this._add("scrollZoom",J,["mousePan"]),t.interactive&&t.scrollZoom&&o.scrollZoom.enable(t.scrollZoom);const G=o.keyboard=new ll(o);this._add("keyboard",G),t.interactive&&t.keyboard&&o.keyboard.enable(),this._add("blockableMapEvent",new za(o))}_add(t,o,a){this._handlers.push({handlerName:t,handler:o,allowed:a}),this._handlersById[t]=o}stop(t){if(!this._updatingCamera){for(const{handler:o}of this._handlers)o.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!r(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,o,a){for(const h in t)if(h!==a&&(!o||o.indexOf(h)<0))return!0;return!1}_getMapTouches(t){const o=[];for(const a of t)this._el.contains(a.target)&&o.push(a);return o}mergeHandlerResult(t,o,a,h,m){if(!a)return;l.e(t,a);const x={handlerName:h,originalEvent:a.originalEvent||m};a.zoomDelta!==void 0&&(o.zoom=x),a.panDelta!==void 0&&(o.drag=x),a.pitchDelta!==void 0&&(o.pitch=x),a.bearingDelta!==void 0&&(o.rotate=x)}_applyChanges(){const t={},o={},a={};for(const[h,m,x]of this._changes)h.panDelta&&(t.panDelta=(t.panDelta||new l.P(0,0))._add(h.panDelta)),h.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+h.zoomDelta),h.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+h.bearingDelta),h.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+h.pitchDelta),h.around!==void 0&&(t.around=h.around),h.pinchAround!==void 0&&(t.pinchAround=h.pinchAround),h.noInertia&&(t.noInertia=h.noInertia),l.e(o,m),l.e(a,x);this._updateMapTransform(t,o,a),this._changes=[]}_updateMapTransform(t,o,a){const h=this._map,m=h._getTransformForUpdate(),x=h.terrain;if(!(g(t)||x&&this._terrainMovement))return this._fireEvents(o,a,!0);let{panDelta:w,zoomDelta:A,bearingDelta:E,pitchDelta:k,around:z,pinchAround:U}=t;U!==void 0&&(z=U),h._stop(!0),z=z||h.transform.centerPoint;const K=m.pointLocation(w?z.sub(w):z);E&&(m.bearing+=E),k&&(m.pitch+=k),A&&(m.zoom+=A),x?this._terrainMovement||!o.drag&&!o.zoom?o.drag&&this._terrainMovement?m.center=m.pointLocation(m.centerPoint.sub(w)):m.setLocationAtPoint(K,z):(this._terrainMovement=!0,this._map._elevationFreeze=!0,m.setLocationAtPoint(K,z),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,m.recalculateZoom(h.terrain)})):m.setLocationAtPoint(K,z),h._applyUpdatedTransform(m),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(o,a,!0)}_fireEvents(t,o,a){const h=r(this._eventsInProgress),m=r(t),x={};for(const k in t){const{originalEvent:z}=t[k];
vendor: 1,266 bytes, line 584
584this._eventsInProgress[k]||(x[`${k}start`]=z),this._eventsInProgress[k]=t[k]}!h&&m&&this._fireEvent("movestart",m.originalEvent);for(const k in x)this._fireEvent(k,x[k]);m&&this._fireEvent("move",m.originalEvent);for(const k in t){const{originalEvent:z}=t[k];this._fireEvent(k,z)}const w={};let A;for(const k in this._eventsInProgress){const{handlerName:z,originalEvent:U}=this._eventsInProgress[k];this._handlersById[z].isActive()||(delete this._eventsInProgress[k],A=o[z]||U,w[`${k}end`]=A)}for(const k in w)this._fireEvent(k,w[k]);const E=r(this._eventsInProgress);if(a&&(h||m)&&!E){this._updatingCamera=!0;const k=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),z=U=>U!==0&&-this._bearingSnap<U&&U<this._bearingSnap;!k||!k.essential&&l.h.prefersReducedMotion?(this._map.fire(new l.k("moveend",{originalEvent:A})),z(this._map.getBearing())&&this._map.resetNorth()):(z(k.bearing||this._map.getBearing())&&(k.bearing=0),k.freezeElevation=!0,this._map.easeTo(k,{originalEvent:A})),this._updatingCamera=!1}}_fireEvent(t,o){this._map.fire(new l.k(t,o?{originalEvent:o}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new c("renderFrame",{timeStamp:t})),this._applyChanges()})}
vendor: 5,566 bytes, line 584
584_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class M extends l.E{constructor(t,o){super(),this._renderFrameCallback=()=>{const a=Math.min((l.h.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=o.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new l.L(this.transform.center.lng,this.transform.center.lat)}setCenter(t,o){return this.jumpTo({center:t},o)}panBy(t,o,a){return t=l.P.convert(t).mult(-1),this.panTo(this.transform.center,l.e({offset:t},o),a)}panTo(t,o,a){return this.easeTo(l.e({center:t},o),a)}getZoom(){return this.transform.zoom}setZoom(t,o){return this.jumpTo({zoom:t},o),this}zoomTo(t,o,a){return this.easeTo(l.e({zoom:t},o),a)}zoomIn(t,o){return this.zoomTo(this.getZoom()+1,t,o),this}zoomOut(t,o){return this.zoomTo(this.getZoom()-1,t,o),this}getBearing(){return this.transform.bearing}setBearing(t,o){return this.jumpTo({bearing:t},o),this}getPadding(){return this.transform.padding}setPadding(t,o){return this.jumpTo({padding:t},o),this}rotateTo(t,o,a){return this.easeTo(l.e({bearing:t},o),a)}resetNorth(t,o){return this.rotateTo(0,l.e({duration:1e3},t),o),this}resetNorthPitch(t,o){return this.easeTo(l.e({bearing:0,pitch:0,duration:1e3},t),o),this}snapToNorth(t,o){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,o):this}getPitch(){return this.transform.pitch}setPitch(t,o){return this.jumpTo({pitch:t},o),this}cameraForBounds(t,o){t=Lt.convert(t);const a=o&&o.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),a,o)}_cameraForBoxAndBearing(t,o,a,h){const m={top:0,bottom:0,right:0,left:0};if(typeof(h=l.e({padding:m,offset:[0,0],maxZoom:this.transform.maxZoom},h)).padding=="number"){const we=h.padding;h.padding={top:we,bottom:we,right:we,left:we}}h.padding=l.e(m,h.padding);const x=this.transform,w=x.padding,A=x.project(l.L.convert(t)),E=x.project(l.L.convert(o)),k=A.rotate(-a*Math.PI/180),z=E.rotate(-a*Math.PI/180),U=new l.P(Math.max(k.x,z.x),Math.max(k.y,z.y)),K=new l.P(Math.min(k.x,z.x),Math.min(k.y,z.y)),W=U.sub(K),J=(x.width-(w.left+w.right+h.padding.left+h.padding.right))/W.x,G=(x.height-(w.top+w.bottom+h.padding.top+h.padding.bottom))/W.y;if(G<0||J<0)return void l.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const ce=Math.min(x.scaleZoom(x.scale*Math.min(J,G)),h.maxZoom),xe=l.P.convert(h.offset),ie=new l.P((h.padding.left-h.padding.right)/2,(h.padding.top-h.padding.bottom)/2).rotate(a*Math.PI/180),he=xe.add(ie).mult(x.scale/x.zoomScale(ce));return{center:x.unproject(A.add(E).div(2).sub(he)),zoom:ce,bearing:a}}fitBounds(t,o,a){return this._fitInternal(this.cameraForBounds(t,o),o,a)}fitScreenCoordinates(t,o,a,h,m){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(l.P.convert(t)),this.transform.pointLocation(l.P.convert(o)),a,h),h,m)}_fitInternal(t,o,a){return t?(delete(o=l.e(t,o)).padding,o.linear?this.easeTo(o,a):this.flyTo(o,a)):this}jumpTo(t,o){this.stop();const a=this._getTransformForUpdate();let h=!1,m=!1,x=!1;return"zoom"in t&&a.zoom!==+t.zoom&&(h=!0,a.zoom=+t.zoom),t.center!==void 0&&(a.center=l.L.convert(t.center)),"bearing"in t&&a.bearing!==+t.bearing&&(m=!0,a.bearing=+t.bearing),"pitch"in t&&a.pitch!==+t.pitch&&(x=!0,a.pitch=+t.pitch),t.padding==null||a.isPaddingEqual(t.padding)||(a.padding=t.padding),this._applyUpdatedTransform(a),this.fire(new l.k("movestart",o)).fire(new l.k("move",o)),h&&this.fire(new l.k("zoomstart",o)).fire(new l.k("zoom",o)).fire(new l.k("zoomend",o)),m&&this.fire(new l.k("rotatestart",o)).fire(new l.k("rotate",o)).fire(new l.k("rotateend",o)),x&&this.fire(new l.k("pitchstart",o)).fire(new l.k("pitch",o)).fire(new l.k("pitchend",o)),this.fire(new l.k("moveend",o))}calculateCameraOptionsFromTo(t,o,a,h=0){const m=l.U.fromLngLat(t,o),x=l.U.fromLngLat(a,h),w=x.x-m.x,A=x.y-m.y,E=x.z-m.z,k=Math.hypot(w,A,E);if(k===0)throw new Error("Can't calculate camera options with same From and To");const z=Math.hypot(w,A),U=this.transform.scaleZoom(this.transform.cameraToCenterDistance/k/this.transform.tileSize),K=180*Math.atan2(w,-A)/Math.PI;let W=180*Math.acos(z/k)/Math.PI;return W=E<0?90-W:90+W,{center:x.toLngLat(),zoom:U,pitch:W,bearing:K}}easeTo(t,o){this._stop(!1,t.easeId),((t=l.e({offset:[0,0],duration:500,easing:l.bb},t)).animate===!1||!t.essential&&l.h.prefersReducedMotion)&&(t.duration=0);const a=this._getTransformForUpdate(),h=this.getZoom(),m=this.getBearing(),x=this.getPitch(),w=this.getPadding(),A="zoom"in t?+t.zoom:h,E="bearing"in t?this._normalizeBearing(t.bearing,m):m,k="pitch"in t?+t.pitch:x,z="padding"in t?t.padding:a.padding,U=l.P.convert(t.offset);let K=a.centerPoint.add(U);const W=a.pointLocation(K),J=l.L.convert(t.center||W);this._normalizeCenter(J);const G=a.project(W),ce=a.project(J).sub(G),xe=a.zoomScale(A-h);let ie,he;t.around&&(ie=l.L.convert(t.around),he=a.locationPoint(ie));const we={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||A!==h,this._rotating=this._rotating||m!==E,this._pitching=this._pitching||k!==x,this._padding=!a.isPaddingEqual(z),this._easeId=t.easeId,this._prepareEase(o,t.noMoveStart,we),this.terrain&&this._prepareElevation(J),this._ease(Te=>{if(this._zooming&&(a.zoom=l.B.number(h,A,Te)),this._rotating&&(
584a.bearing=l.B.number(m,E,Te)),this._pitching&&(a.pitch=l.B.number(x,k,Te)),this._padding&&(a.interpolatePadding(w,z,Te),K=a.centerPoint.add(U)),this.terrain&&!t.freezeElevation&&this._updateElevation(Te),ie)a.setLocationAtPoint(ie,he);else{const Ie=a.zoomScale(a.zoom-h),ke=A>h?Math.min(2,xe):Math.max(.5,xe),Ce=Math.pow(ke,1-Te),Be=a.unproject(G.add(ce.mult(Te*Ce)).mult(Ie));a.setLocationAtPoint(a.renderWorldCopies?Be.wrap():Be,K)}this._applyUpdatedTransform(a),this._fireMoveEvents(o)},Te=>{this.terrain&&this._finalizeElevation(),this._afterEase(o,Te)},t),this}_prepareEase(t,o,a={}){this._moving=!0,o||a.moving||this.fire(new l.k("movestart",t)),this._zooming&&!a.zooming&&this.fire(new l.k("zoomstart",t)),this._rotating&&!a.rotating&&this.fire(new l.k("rotatestart",t)),this._pitching&&!a.pitching&&this.fire(new l.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const o=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&o!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(a-(o-(a*t+this._elevationStart))/(1-t)),this._elevationTarget=o}this.transform.elevation=l.B.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;const o=t.clone(),{center:a,zoom:h,pitch:m,bearing:x,elevation:w}=this.transformCameraUpdate(o);a&&(o.center=a),h!==void 0&&(o.zoom=h),m!==void 0&&(o.pitch=m),x!==void 0&&(o.bearing=x),w!==void 0&&(o.elevation=w),this.transform.apply(o)}_fireMoveEvents(t){this.fire(new l.k("move",t)),this._zooming&&this.fire(new l.k("zoom",t)),this._rotating&&this.fire(new l.k("rotate",t)),this._pitching&&this.fire(new l.k("pitch",t))}_afterEase(t,o){if(this._easeId&&o&&this._easeId===o)return;delete this._easeId;const a=this._zooming,h=this._rotating,m=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,a&&this.fire(new l.k("zoomend",t)),h&&this.fire(new l.k("rotateend",t)),m&&this.fire(new l.k("pitchend",t)),this.fire(new l.k("moveend",t))}flyTo(t,o){if(!t.essential&&l.h.prefersReducedMotion){const ot=l.F(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(ot,o)}this.stop(),t=l.e({offset:[0,0],speed:1.2,curve:1.42,easing:l.bb},t);const a=this._getTransformForUpdate(),h=this.getZoom(),m=this.getBearing(),x=this.getPitch(),w=this.getPadding(),A="zoom"in t?l.ad(+t.zoom,a.minZoom,a.maxZoom):h,E="bearing"in t?this._normalizeBearing(t.bearing,m):m,k="pitch"in t?+t.pitch:x,z="padding"in t?t.padding:a.padding,U=a.zoomScale(A-h),K=l.P.convert(t.offset);let W=a.centerPoint.add(K);const J=a.pointLocation(W),G=l.L.convert(t.center||J);this._normalizeCenter(G);const ce=a.project(J),xe=a.project(G).sub(ce);let ie=t.curve;const he=Math.max(a.width,a.height),we=he/U,Te=xe.mag();if("minZoom"in t){const ot=l.ad(Math.min(t.minZoom,h,A),a.minZoom,a.maxZoom),wi=he/a.zoomScale(ot-h);ie=Math.sqrt(wi/Te*2)}const Ie=ie*ie;function ke(ot){const wi=(we*we-he*he+(ot?-1:1)*Ie*Ie*Te*Te)/(2*(ot?we:he)*Ie*Te);return Math.log(Math.sqrt(wi*wi+1)-wi)}function Ce(ot){return(Math.exp(ot)-Math.exp(-ot))/2}function Be(ot){return(Math.exp(ot)+Math.exp(-ot))/2}const tt=ke(!1);let Yt=function(ot){return Be(tt)/Be(tt+ie*ot)},Ve=function(ot){return he*((Be(tt)*(Ce(wi=tt+ie*ot)/Be(wi))-Ce(tt))/Ie)/Te;var wi},gt=(ke(!0)-tt)/ie;if(Math.abs(Te)<1e-6||!isFinite(gt)){if(Math.abs(he-we)<1e-6)return this.easeTo(t,o);const ot=we<he?-1:1;gt=Math.abs(Math.log(we/he))/ie,Ve=function(){return 0},Yt=function(wi){return Math.exp(ot*ie*wi)}}return t.duration="duration"in t?+t.duration:1e3*gt/("screenSpeed"in t?+t.screenSpeed/ie:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=m!==E,this._pitching=k!==x,this._padding=!a.isPaddingEqual(z),this._prepareEase(o,!1),this.terrain&&this._prepareElevation(G),this._ease(ot=>{const wi=ot*gt,Kt=1/Yt(wi);
584a.zoom=ot===1?A:h+a.scaleZoom(Kt),this._rotating&&(a.bearing=l.B.number(m,E,ot)),this._pitching&&(a.pitch=l.B.number(x,k,ot)),this._padding&&(a.interpolatePadding(w,z,ot),W=a.centerPoint.add(K)),this.terrain&&!t.freezeElevation&&this._updateElevation(ot);const Nt=ot===1?G:a.unproject(ce.add(xe.mult(Ve(wi))).mult(Kt));a.setLocationAtPoint(a.renderWorldCopies?Nt.wrap():Nt,W),this._applyUpdatedTransform(a),this._fireMoveEvents(o)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(o)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,o){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const a=this._onEaseEnd;delete this._onEaseEnd,a.call(this,o)}if(!t){const a=this.handlers;a&&a.stop(!1)}return this}_ease(t,o,a){a.animate===!1||a.duration===0?(t(1),o()):(this._easeStart=l.h.now(),this._easeOptions=a,this._onEaseFrame=t,this._onEaseEnd=o,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,o){t=l.b5(t,-180,180);const a=Math.abs(t-o);return Math.abs(t-360-o)<a&&(t-=360),Math.abs(t+360-o)<a&&(t+=360),t}_normalizeCenter(t){const o=this.transform;if(!o.renderWorldCopies||o.lngRange)return;const a=t.lng-o.center.lng;t.lng+=a>180?-360:a<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(l.L.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}class V{constructor(t={}){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=o=>{!o||o.sourceDataType!=="metadata"&&o.sourceDataType!=="visibility"&&o.dataType!=="style"&&o.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options&&this.options.compact,this._container=X.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=X.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=X.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){X.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,o){const a=this._map._getUIString(`AttributionControl.${o}`);t.title=a,t.setAttribute("aria-label",a)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(h=>typeof h!="string"?"":h)):typeof this.options.customAttribution=="str
584ing"&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const h=this._map.style.stylesheet;this.styleOwner=h.owner,this.styleId=h.id}const o=this._map.style.sourceCaches;for(const h in o){const m=o[h];if(m.used||m.usedForTerrain){const x=m.getSource();x.attribution&&t.indexOf(x.attribution)<0&&t.push(x.attribution)}}t=t.filter(h=>String(h).trim()),t.sort((h,m)=>h.length-m.length),t=t.filter((h,m)=>{for(let x=m+1;x<t.length;x++)if(t[x].indexOf(h)>=0)return!1;return!0});const a=t.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,t.length?(this._innerContainer.innerHTML=a,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class ne{constructor(t={}){this._updateCompact=()=>{const o=this._container.children;if(o.length){const a=o[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&a.classList.add("maplibregl-compact"):a.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=X.create("div","maplibregl-ctrl");const o=X.create("a","maplibregl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://maplibre.org/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){X.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ye{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const o=++this._id;return this._queue.push({callback:t,id:o,cancelled:!1}),o}remove(t){const o=this._currentlyRunning,a=o?this._queue.concat(o):this._queue;for(const h of a)if(h.id===t)return void(h.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const o=this._currentlyRunning=this._queue;this._queue=[];for(const a of o)if(!a.cancelled&&(a.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Se={"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","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"};var Me=l.Q([{name:"a_pos3d",type:"Int16",components:3}]);class Ke extends l.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,o){this.sourceCache.update(t,o),this._renderableTilesKeys=[];const a={};for(const h of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:o}))a[h.key]=!0,this._renderableTilesKeys.push(h.key),this._tiles[h.key]||(h.posMatrix=new Float64Array(16),l.aS(h.posMatrix,0,l.N,0,l.N,0,1),this._tiles[h.key]=new ar(h,this.tileSize));for(const h in this._tiles)a[h]||delete this._tiles[h]}freeRtt(t){for(const o in this._tiles){const a=this._tiles[o];(!t||a.tileID.equals(t)||a.tileID.isChildOf(t)||t.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const o={};for(const a of this._renderableTilesKeys){const h=this._tiles[a].tileID;if(h.canonical.equals(t.canonical)){const m=t.clone();m.posMatrix=new Float64Array(16),l.aS(m.posMatrix,0,l.N,0,l.N,0,1),o[a]=m}else if(h.canonical.isChildOf(t.canonical)){const m=t.clone();m.posMatrix=new Float64Array(16);const x=h.canonical.z-t.canonical.z,w=h.canonical.x-(h.canonical.x>>x<<x),A=h.canonical.y-(h.canonical.y>>x<<x),E=l.N>>x;l.aS(m.posMatrix,0,E,0,E,0,1),l.$(m.posMatrix,m.posMatrix,[-w*E,-A*E,0]),o[a]=m}else if(t.canonical.isChildOf(h.canonical)){const m=t.clone();m.posMatrix=new Float64Array(16);const x=t.canonical.z-h.canonical.z,w=t.canonical.x-(t.canonical.x>>x<<x),A=t.canonical.y-(t.canonical.y>>x<<x),E=l.N>>x;l.aS(m.posMatrix,0,l.N,0,l.N,0,1),l.$(m.posMatrix,m.posMatrix,[w*E,A*E,0]),l.a0(m.posMatrix,m.posMatrix,[1/2**x,1/2**x,0]),o[a]=m}}return o}getSourceTile(t,o){const a=this.sourceCache._source;let h=t.overscaledZ-this.deltaZoom;if(h>a.maxzoom&&(h=a.maxzoom),h<a.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(h).key);let m=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!m||!m.dem)&&o)for(;h>=a.minzoom&&(!m||!m.dem);)m=this.sourceCache.getTileByID(t.scaledTo(h--).key);return m}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(o=>o.timeAdded>=t)}}class At{constructor(t,o,a){this.painter=t,this.sourceCache=new Ke(o),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qual
vendor: 5,444 bytes, line 584
584ityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,o,a,h=l.N){var m;if(!(o>=0&&o<h&&a>=0&&a<h))return 0;const x=this.getTerrainData(t),w=(m=x.tile)===null||m===void 0?void 0:m.dem;if(!w)return 0;const A=function(W,J,G){var ce=J[0],xe=J[1];return W[0]=G[0]*ce+G[4]*xe+G[12],W[1]=G[1]*ce+G[5]*xe+G[13],W}([],[o/h*l.N,a/h*l.N],x.u_terrain_matrix),E=[A[0]*w.dim,A[1]*w.dim],k=Math.floor(E[0]),z=Math.floor(E[1]),U=E[0]-k,K=E[1]-z;return w.get(k,z)*(1-U)*(1-K)+w.get(k+1,z)*U*(1-K)+w.get(k,z+1)*(1-U)*K+w.get(k+1,z+1)*U*K}getElevationForLngLatZoom(t,o){const{tileID:a,mercatorX:h,mercatorY:m}=this._getOverscaledTileIDFromLngLatZoom(t,o);return this.getElevation(a,h%l.N,m%l.N,l.N)}getElevation(t,o,a,h=l.N){return this.getDEMElevation(t,o,a,h)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const h=this.painter.context,m=new l.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new nt(h,m,h.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new nt(h,new l.R({width:1,height:1}),h.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(h.gl.NEAREST,h.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=l.ao([])}const o=this.sourceCache.getSourceTile(t,!0);if(o&&o.dem&&(!o.demTexture||o.needsTerrainPrepare)){const h=this.painter.context;o.demTexture=this.painter.getTileTexture(o.dem.stride),o.demTexture?o.demTexture.update(o.dem.getPixels(),{premultiply:!1}):o.demTexture=new nt(h,o.dem.getPixels(),h.gl.RGBA,{premultiply:!1}),o.demTexture.bind(h.gl.NEAREST,h.gl.CLAMP_TO_EDGE),o.needsTerrainPrepare=!1}const a=o&&o+o.tileID.key+t.key;if(a&&!this._demMatrixCache[a]){const h=this.sourceCache.sourceCache._source.maxzoom;let m=t.canonical.z-o.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=h?m=t.canonical.z-h:l.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const x=t.canonical.x-(t.canonical.x>>m<<m),w=t.canonical.y-(t.canonical.y>>m<<m),A=l.bc(new Float64Array(16),[1/(l.N<<m),1/(l.N<<m),0]);l.$(A,A,[x*l.N,w*l.N,0]),this._demMatrixCache[t.key]={matrix:A,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:o&&o.dem&&o.dem.dim||1,u_terrain_matrix:a?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:o&&o.dem&&o.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(o&&o.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:o}}getFramebuffer(t){const o=this.painter,a=o.width/devicePixelRatio,h=o.height/devicePixelRatio;return!this._fbo||this._fbo.width===a&&this._fbo.height===h||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new nt(o.context,{width:a,height:h,data:null},o.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(o.context.gl.NEAREST,o.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new nt(o.context,{width:a,height:h,data:null},o.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(o.context.gl.NEAREST,o.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=o.context.createFramebuffer(a,h,!0,!1),this._fbo.depthAttachment.set(o.context.createRenderbuffer(o.context.gl.DEPTH_COMPONENT16,a,h))),this._fbo.colorAttachment.set(t==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const o=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let m=0,x=0;m<this._coordsTextureSize;m++)for(let w=0;w<this._coordsTextureSize;w++,x+=4)o[x+0]=255&w,o[x+1]=255&m,o[x+2]=w>>8<<4|m>>8,o[x+3]=0;const a=new l.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(o.buffer)),h=new nt(t,a,t.gl.RGBA,{premultiply:!1});return h.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=h,h}pointCoordinate(t){const o=new Uint8Array(4),a=this.painter.context,h=a.gl;a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),h.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,h.RGBA,h.UNSIGNED_BYTE,o),a.bindFramebuffer.set(null);const m=o[0]+(o[2]>>4<<8),x=o[1]+((15&o[2])<<8),w=this.coordsIndex[255-o[3]],A=w&&this.sourceCache.getTileByID(w);if(!A)return null;const E=this._coordsTextureSize,k=(1<<A.tileID.canonical.z)*E;return new l.U(this._allowMercatorOverflow(t,(A.tileID.canonical.x*E+m)/k),(A.tileID.canonical.y*E+x)/k,this.getElevation(A.tileID,m,x,E))}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.painter.context,o=new l.bd,a=new l.b0,h=this.meshSize,m=l.N/h,x=h*h;for(let z=0;z<=h;z++)for(let U=0;U<=h;U++)o.emplaceBack(U*m,z*m,0);for(let z=0;z<x;z+=h+1)for(let U=0;U<h;U++)a.emplaceBack(U+z,h+U+z+1,h+U+z+2),a.emplaceBack(U+z,h+U+z+2,U+z+1);const w=o.length,A=w+2*(h+1);for(const z of[0,1])for(let U=0;U<=h;U++)for(const K of[0,1])o.emplaceBack(U*m,z*l.N,K);for(let z=0;z<2*h;z+=2)a.emplaceBack(A+z,A+z+1,A+z+3),a.emplaceBack(A+z,A+z+3,A+z+2),a.emplaceBack(w+z,w+z+3,w+z+1),a.emplaceBack(w+z,w+z+2,w+z+3);const E=o.length,k=E+2*(h+1);for(const z of[0,1])for(let U=0;U<=h;U++)for(const K of[0,1])o.emplaceBack(z*l.N,U*m,K);for(let z=0;z<2*h;z+=2)a.emplaceBack(E+z,E+z+1,E+z+3),a.emplaceBack(E+z,E+z+3,E+z+2),a.emplaceBack(k+z,k+z+3,k+z
584+1),a.emplaceBack(k+z,k+z+2,k+z+3);return this._mesh={indexBuffer:t.createIndexBuffer(a),vertexBuffer:t.createVertexBuffer(o,Me.members),segments:l.S.simpleSegment(0,0,o.length,a.length)},this._mesh}getMeshFrameDelta(t){return 2*Math.PI*l.be/Math.pow(2,t)/5}getMinTileElevationForLngLatZoom(t,o){var a;const{tileID:h}=this._getOverscaledTileIDFromLngLatZoom(t,o);return(a=this.getMinMaxElevation(h).minElevation)!==null&&a!==void 0?a:0}getMinMaxElevation(t){const o=this.getTerrainData(t).tile,a={minElevation:null,maxElevation:null};return o&&o.dem&&(a.minElevation=o.dem.min*this.exaggeration,a.maxElevation=o.dem.max*this.exaggeration),a}_getOverscaledTileIDFromLngLatZoom(t,o){const a=l.U.fromLngLat(t.wrap()),h=(1<<o)*l.N,m=a.x*h,x=a.y*h,w=Math.floor(m/l.N),A=Math.floor(x/l.N);return{tileID:new l.O(o,0,o,w,A),mercatorX:m,mercatorY:x}}_allowMercatorOverflow(t,o){const a=t.x<this.painter.width/2;let h=l.bf(o);const m=this.painter.transform.center.lng;return a&&Math.sign(h)>0&&Math.sign(m)<0||!a&&Math.sign(h)<0&&Math.sign(m)>0?(h=360*Math.sign(m)+h,l.G(h)):o}}class Xt{constructor(t,o,a){this._context=t,this._size=o,this._tileSize=a,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const o=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),a=new nt(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return a.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),o.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),o.colorAttachment.set(a.texture),{id:t,fbo:o,texture:a,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(o=>t.id!==o),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const o of this._recentlyUsed)if(!this._objects[o].inUse)return this._objects[o];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(t=>!t.inUse)===!1}}const xi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Zi{constructor(t,o){this.painter=t,this.terrain=o,this.pool=new Xt(t.context,30,o.sourceCache.tileSize*o.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,o){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(a=>!t._layers[a].isHidden(o)),this._coordsDescendingInv={};for(const a in t.sourceCaches){this._coordsDescendingInv[a]={};const h=t.sourceCaches[a].getVisibleCoordinates();for(const m of h){const x=this.terrain.sourceCache.getTerrainCoords(m);for(const w in x)this._coordsDescendingInv[a][w]||(this._coordsDescendingInv[a][w]=[]),this._coordsDescendingInv[a][w].push(x[w])}}this._coordsDescendingInvStr={};for(const a of t._order){const h=t._layers[a],m=h.source;if(xi[h.type]&&!this._coordsDescendingInvStr[m]){this._coordsDescendingInvStr[m]={};for(const x in this._coordsDescendingInv[m])this._coordsDescendingInvStr[m][x]=this._coordsDescendingInv[m][x].map(w=>w.key).sort().join()}}for(const a of this._renderableTiles)for(const h in this._coordsDescendingInvStr){const m=this._coordsDescendingInvStr[h][a.tileID.key];m&&m!==a.rttCoords[h]&&(a.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const o=t.type,a=this.painter,h=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(xi[o]&&(this._prevType&&xi[this._prevType]||this._stacks.push([]),this._prevType=o,this._stacks[this._stacks.length-1].push(t.id),!h))return!0;if(xi[this._prevType]||xi[o]&&h){this._prevType=o;const m=this._stacks.length-1,x=this._stacks[m]||[];
vendor: 5,156 bytes, line 584
584for(const w of this._renderableTiles){if(this.pool.isFull()&&(ui(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(w),w.rtt[m]){const E=this.pool.getObjectForId(w.rtt[m].id);if(E.stamp===w.rtt[m].stamp){this.pool.useObject(E);continue}}const A=this.pool.getOrCreateFreeObject();this.pool.useObject(A),this.pool.stampObject(A),w.rtt[m]={id:A.id,stamp:A.stamp},a.context.bindFramebuffer.set(A.fbo.framebuffer),a.context.clear({color:l.aT.transparent,stencil:0}),a.currentStencilSource=void 0;for(let E=0;E<x.length;E++){const k=a.style._layers[x[E]],z=k.source?this._coordsDescendingInv[k.source][w.tileID.key]:[w.tileID];a.context.viewport.set([0,0,A.fbo.width,A.fbo.height]),a._renderTileClippingMasks(k,z),a.renderLayer(a,a.style.sourceCaches[k.source],k,z),k.source&&(w.rttCoords[k.source]=this._coordsDescendingInvStr[k.source][w.tileID.key])}}return ui(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),xi[o]}return!1}}const Ge=se,Je={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:l.c.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},Er=d=>{d.touchstart=d.dragStart,d.touchmoveWindow=d.dragMove,d.touchend=d.dragEnd},Oa={showCompass:!0,showZoom:!0,visualizePitch:!1};class Fa{constructor(t,o,a=!1){this.mousedown=x=>{this.startMouse(l.e({},x,{ctrlKey:!0,preventDefault:()=>x.preventDefault()}),X.mousePos(this.element,x)),X.addEventListener(window,"mousemove",this.mousemove),X.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=x=>{this.moveMouse(x,X.mousePos(this.element,x))},this.mouseup=x=>{this.mouseRotate.dragEnd(x),this.mousePitch&&this.mousePitch.dragEnd(x),this.offTemp()},this.touchstart=x=>{x.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=X.touchPos(this.element,x.targetTouches)[0],this.startTouch(x,this._startPos),X.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.addEventListener(window,"touchend",this.touchend))},this.touchmove=x=>{x.targetTouches.length!==1?this.reset():(this._lastPos=X.touchPos(this.element,x.targetTouches)[0],this.moveTouch(x,this._lastPos))},this.touchend=x=>{x.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const h=t.dragRotate._mouseRotate.getClickTolerance(),m=t.dragRotate._mousePitch.getClickTolerance();this.element=o,this.mouseRotate=Uo({clickTolerance:h,enable:!0}),this.touchRotate=(({enable:x,clickTolerance:w,bearingDegreesPerPixelMoved:A=.8})=>{const E=new sl;return new Ir({clickTolerance:w,move:(k,z)=>({bearingDelta:(z.x-k.x)*A}),moveStateManager:E,enable:x,assignEvents:Er})})({clickTolerance:h,enable:!0}),this.map=t,a&&(this.mousePitch=Lr({clickTolerance:m,enable:!0}),this.touchPitch=(({enable:x,clickTolerance:w,pitchDegreesPerPixelMoved:A=-.5})=>{const E=new sl;return new Ir({clickTolerance:w,move:(k,z)=>({pitchDelta:(z.y-k.y)*A}),moveStateManager:E,enable:x,assignEvents:Er})})({clickTolerance:m,enable:!0})),X.addEventListener(o,"mousedown",this.mousedown),X.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),X.addEventListener(o,"touchcancel",this.reset)}startMouse(t,o){this.mouseRotate.dragStart(t,o),this.mousePitch&&this.mousePitch.dragStart(t,o),X.disableDrag()}startTouch(t,o){this.touchRotate.dragStart(t,o),this.touchPitch&&this.touchPitch.dragStart(t,o),X.disableDrag()}moveMouse(t,o){const a=this.map,{bearingDelta:h}=this.mouseRotate.dragMove(t,o)||{};if(h&&a.setBearing(a.getBearing()+h),this.mousePitch){const{pitchDelta:m}=this.mousePitch.dragMove(t,o)||{};m&&a.setPitch(a.getPitch()+m)}}moveTouch(t,o){const a=this.map,{bearingDelta:h}=this.touchRotate.dragMove(t,o)||{};if(h&&a.setBearing(a.getBearing()+h),this.touchPitch){const{pitchDelta:m}=this.touchPitch.dragMove(t,o)||{};m&&a.setPitch(a.getPitch()+m)}}off(){const t=this.element;X.removeEventListener(t,"mousedown",this.mousedown),X.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),X.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.removeEventListener(window,"touchend",this.touchend),X.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){X.enableDrag(),X.removeEventListener(window,"mousemove",this.mousemove),
vendor: 9,406 bytes, line 584
584X.removeEventListener(window,"mouseup",this.mouseup),X.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),X.removeEventListener(window,"touchend",this.touchend)}}let ji;function fa(d,t,o){if(d=new l.L(d.lng,d.lat),t){const a=new l.L(d.lng-360,d.lat),h=new l.L(d.lng+360,d.lat),m=o.locationPoint(d).distSqr(t);o.locationPoint(a).distSqr(t)<m?d=a:o.locationPoint(h).distSqr(t)<m&&(d=h)}for(;Math.abs(d.lng-o.center.lng)>180;){const a=o.locationPoint(d);if(a.x>=0&&a.y>=0&&a.x<=o.width&&a.y<=o.height)break;d.lng>o.center.lng?d.lng-=360:d.lng+=360}return d}const er={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%)"};function Na(d,t,o){const a=d.classList;for(const h in er)a.remove(`maplibregl-${o}-anchor-${h}`);a.add(`maplibregl-${o}-anchor-${t}`)}class Pi extends l.E{constructor(t){if(super(),this._onKeyPress=o=>{const a=o.code,h=o.charCode||o.keyCode;a!=="Space"&&a!=="Enter"&&h!==32&&h!==13||this.togglePopup()},this._onMapClick=o=>{const a=o.originalEvent.target,h=this._element;this._popup&&(a===h||h.contains(a))&&this.togglePopup()},this._update=o=>{if(!this._map)return;const a=this._map.loaded()&&!this._map.isMoving();((o==null?void 0:o.type)==="terrain"||(o==null?void 0:o.type)==="render"&&!a)&&this._map.once("render",this._update),this._map.transform.renderWorldCopies&&(this._lngLat=fa(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let h="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?h=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(h=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let m="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?m="rotateX(0deg)":this._pitchAlignment==="map"&&(m=`rotateX(${this._map.getPitch()}deg)`),o&&o.type!=="moveend"||(this._pos=this._pos.round()),X.setTransform(this._element,`${er[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${m} ${h}`),this._map.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const x=this._map.unproject(this._pos),w=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=x.distanceTo(this._lngLat)>20*w?"0.2":"1.0",this._opacityTimeout=null},100))},this._onMove=o=>{if(!this._isDragging){const a=this._clickTolerance||this._map._clickTolerance;this._isDragging=o.point.dist(this._pointerdownPos)>=a}this._isDragging&&(this._pos=o.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new l.k("dragstart"))),this.fire(new l.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new l.k("dragend")),this._state="inactive"},this._addDragHandler=o=>{this._element.contains(o.originalEvent.target)&&(o.preventDefault(),this._positionDelta=o.point.sub(this._pos).add(this._offset),this._pointerdownPos=o.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},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"?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=l.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=X.create("div"),this._element.setAttribute("aria-label","Map marker");const o=X.createNS("http://www.w3.org/2000/svg","svg"),a=41,h=27;o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height",`${a}px`),o.setAttributeNS(null,"width",`${h}px`),o.setAttributeNS(null,"viewBox",`0 0 ${h} ${a}`);const m=X.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"stroke","none"),m.setAttributeNS(null,"stroke-width","1"),m.setAttributeNS(null,"fill","none"),m.setAttributeNS(null,"fill-rule","evenodd");const x=X.createNS("http://www.w3.org/2000/svg","g");x.setAttributeNS(null,"fill-rule","nonzero");const w=X.createNS("http://www.w3.org/2000/svg","g");w.setAttributeNS(null,"transform","translate(3.0, 29.0)"),w.setAttributeNS(null,"fill","#000000");const A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const ce of A){const xe=X.createNS("http://www.w3.org/2000/svg","ellipse");xe.setAttributeNS(null,"opacity","0.04"),xe.setAttributeNS(null,"cx","10.5"),xe.setAttributeNS(null,"cy","5.80029008"),xe.setAttributeNS(null,"rx",ce.rx),xe.setAttributeNS(null,"ry",ce.ry),w.appendChild(xe)}const E=X.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"fill",this._color);const k=X.createNS("http://www.w3.org/2000/svg","path");k.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),E.appendChild(k);const z=X.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"opacity","0.25"),z.setAttributeNS(null,"fill","#000000");const U=X.createNS("http://www.w3.org/2000/svg","path");U.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),z.appendChild(U);const K=X.createNS("http://www.w3.org/2000/svg","g");K.setAttributeNS(null,"transform","translate(6.0, 7.0)"),K.setAttributeNS(null,"fill","#FFFFFF");const W=X.createNS("http://www.w3.org/2000/svg","g");W.setAttributeNS(null,"transform","translate(8.0, 8.0)");const J=X.createNS("http://www.w3.org/2000/svg","circle");J.setAttributeNS(null,"fill","#000000"),J.setAttributeNS(null,"opacity","0.25"),J.setAttributeNS(null,"cx","5.5"),J.setAttributeNS(null,"cy","5.5"),J.setAttributeNS(null,"r","5.4999962");const G=X.createNS("http://www.w3.org/2000/svg","circle");G.setAttributeNS(null,"fill","#FFFFFF"),G.setAttributeNS(null,"cx","5.5"),G.setAttributeNS(null,"cy","5.5"),G.setAttributeNS(null,"r","5.4999962"),W.appendChild(J),W.appendChild(G),x.appendChild(w),x.appendChild(E),x.appendChild(z),x.appendChild(K),x.appendChild(W),o.appendChild(x),o.setAttributeNS(null,"height",a*this._scale+"px"),o.setAttributeNS(null,"width",h*this._scale+"px"),this._element.appendChild(o),this._offset=l.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",o=>{o.preventDefault()}),this._element.addEventListener("mousedown",o=>{o.preventDefault()}),Na(this._element,this._anchor,"marker"),t&&t.className)for(const o of t.className.split(" "))this._element.classList.add(o);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),X.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=l.L.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const h=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
5840,-38.1],"bottom-left":[h,-1*(38.1-13.5+h)],"bottom-right":[-h,-1*(38.1-13.5+h)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this}getOffset(){return this._offset}setOffset(t){return this._offset=l.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&t!=="auto"?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const Ii={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let zi=0,hs=!1;const Bs={maxWidth:100,unit:"metric"};function jo(d,t,o){const a=o&&o.maxWidth||100,h=d._container.clientHeight/2,m=d.unproject([0,h]),x=d.unproject([a,h]),w=m.distanceTo(x);if(o&&o.unit==="imperial"){const A=3.2808*w;A>5280?ho(t,a,A/5280,d._getUIString("ScaleControl.Miles")):ho(t,a,A,d._getUIString("ScaleControl.Feet"))}else o&&o.unit==="nautical"?ho(t,a,w/1852,d._getUIString("ScaleControl.NauticalMiles")):w>=1e3?ho(t,a,w/1e3,d._getUIString("ScaleControl.Kilometers")):ho(t,a,w,d._getUIString("ScaleControl.Meters"))}function ho(d,t,o,a){const h=function(m){const x=Math.pow(10,`${Math.floor(m)}`.length-1);let w=m/x;return w=w>=10?10:w>=5?5:w>=3?3:w>=2?2:w>=1?1:function(A){const E=Math.pow(10,Math.ceil(-Math.log(A)/Math.LN10));return Math.round(A*E)/E}(w),x*w}(o);d.style.width=t*(h/o)+"px",d.innerHTML=`${h}&nbsp;${a}`}const Ua={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Fl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ma(d){if(d){if(typeof d=="number"){const t=Math.round(Math.abs(d)/Math.SQRT2);return{center:new l.P(0,0),top:new l.P(0,d),"top-left":new l.P(t,t),"top-right":new l.P(-t,t),bottom:new l.P(0,-d),"bottom-left":new l.P(t,-t),"bottom-right":new l.P(-t,-t),left:new l.P(d,0),right:new l.P(-d,0)}}if(d instanceof l.P||Array.isArray(d)){const t=l.P.convert(d);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:l.P.convert(d.center||[0,0]),top:l.P.convert(d.top||[0,0]),"top-left":l.P.convert(d["top-left"]||[0,0]),"top-right":l.P.convert(d["top-right"]||[0,0]),bottom:l.P.convert(d.bottom||[0,0]),"bottom-left":l.P.convert(d["bottom-left"]||[0,0]),"bottom-right":l.P.convert(d["bottom-right"]||[0,0]),left:l.P.convert(d.left||[0,0]),right:l.P.convert(d.right||[0,0])}}return ma(new l.P(0,0))}const Nl={extend:(d,...t)=>l.e(d,...t),run(d){d()},logToElement(d,t=!1,o="log"){const a=window.document.getElementById(o);a&&(t&&(a.innerHTML=""),a.innerHTML+=`<br>${d}`)}},Ul=se;class hi{static get version(){return Ul}static get workerCount(){return xr.workerCount}static set workerCount(t){xr.workerCount=t}static get maxParallelImageRequests(){return l.c.MAX_PARALLEL_IMAGE_REQUESTS}static set maxParallelImageRequests(t){l.c.MAX_PARALLEL_IMAGE_REQUESTS=t}static get workerUrl(){return l.c.WORKER_URL}static set workerUrl(t){l.c.WORKER_URL=t}static addProtocol(t,o){l.c.REGISTERED_PROTOCOLS[t]=o}static removeProtocol(t){delete l.c.REGISTERED_PROTOCOLS[t]}}return hi.Map=class extends M{constructor(d){if(l.bg.mark(l.bh.create),(d=l.e({},Je,d)).minZoom!=null&&d.maxZoom!=null&&d.minZoom>d.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(d.minPitch!=null&&d.maxPitch!=null&&d.minPitch>d.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(d.minPitch!=null&&d.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(d.maxPitch!=null&&d.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Ro(d.minZoom,d.maxZoom,d.minPitch,d.maxPitch,d.renderWorldCopies),{bearingSnap:d.bearingSnap}),this._cooperativeGesturesOnWheel=t=>{this._onCooperativeGesture(t,t[this._metaKey],1)},this._contextLost=t=>{t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new l.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new l.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=d.interactive,this._cooperativeGestures=d.cooperativeGestures,this._metaKey=navigator.platform.indexOf("Mac")===0?"metaKey":"ctrlKey",this._maxTileC
584acheSize=d.maxTileCacheSize,this._maxTileCacheZoomLevels=d.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=d.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=d.preserveDrawingBuffer,this._antialias=d.antialias,this._trackResize=d.trackResize,this._bearingSnap=d.bearingSnap,this._refreshExpiredTiles=d.refreshExpiredTiles,this._fadeDuration=d.fadeDuration,this._crossSourceCollisions=d.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=d.collectResourceTiming,this._renderTaskQueue=new ye,this._controls=[],this._mapId=l.a2(),this._locale=l.e({},Se,d.locale),this._clickTolerance=d.clickTolerance,this._overridePixelRatio=d.pixelRatio,this._maxCanvasSize=d.maxCanvasSize,this.transformCameraUpdate=d.transformCameraUpdate,this._imageQueueHandle=Tt.addThrottleControl(()=>this.isMoving()),this._requestManager=new zt(d.transformRequest),typeof d.container=="string"){if(this._container=document.getElementById(d.container),!this._container)throw new Error(`Container '${d.container}' not found.`)}else{if(!(d.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=d.container}if(d.maxBounds&&this.setMaxBounds(d.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window!="undefined"){addEventListener("online",this._onWindowOnline,!1);let t=!1;const o=co(a=>{this._trackResize&&!this._removed&&this.resize(a)._update()},50);this._resizeObserver=new ResizeObserver(a=>{t?o(a):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new S(this,d),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=d.hash&&new Bo(typeof d.hash=="string"&&d.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch}),d.bounds&&(this.resize(),this.fitBounds(d.bounds,l.e({},d.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=d.localIdeographFontFamily,this._validateStyle=d.validateStyle,d.style&&this.setStyle(d.style,{localIdeographFontFamily:d.localIdeographFontFamily}),d.attributionControl&&this.addControl(new V({customAttribution:d.customAttribution})),d.maplibreLogo&&this.addControl(new ne,d.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update(t.dataType==="style"),this.fire(new l.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new l.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new l.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(d,t){if(t===void 0&&(t=d.getDefaultPosition?d.getDefaultPosition():"top-right"),!d||!d.onAdd)return this.fire(new l.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const o=d.onAdd(this);this._controls.push(d);const a=this._controlPositions[t];return t.indexOf("bottom")!==-1?a.insertBefore(o,a.firstChild):a.appendChild(o),this}removeControl(d){if(!d||!d.onRemove)return this.fire(new l.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const t=this._controls.indexOf(d);return t>-1&&this._controls.splice(t,1),d.onRemove(this),this}hasControl(d){return this._controls.indexOf(d)>-1}calculateCameraOptionsFromTo(d,t,o,a){return a==null&&this.terrain&&(a=this.terrain.getElevationForLngLatZoom(o,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(d,t,o,a)}resize(d){var t;const o=this._containerDimensions(),a=o[0],h=o[1],m=this._getClampedPixelRatio(a,h);if(this._resizeCanvas(a,h,m),this.painter.resize(a,h,m),this.painter.overLimit()){const w=this.painter.context.gl;this._maxCanvasSize=[w.drawingBufferWidth,w.drawingBufferHeight];const A=this._getClampedPixelRatio(a,h);this._resizeCanvas(a,h,A),this.painter.resize(a,h,A)}this.transform.resize(a,h),(t=this._requestedCameraState)===null||t===void 0||t.resize(a,h);const x=!this._moving;return x&&(this.stop(),this.fire(new l.k("movestart",d)).fire(new l.k("move",d))
584),this.fire(new l.k("resize",d)),x&&this.fire(new l.k("moveend",d)),this}_getClampedPixelRatio(d,t){const{0:o,1:a}=this._maxCanvasSize,h=this.getPixelRatio(),m=d*h,x=t*h;return Math.min(m>o?o/m:1,x>a?a/x:1)*h}getPixelRatio(){var d;return(d=this._overridePixelRatio)!==null&&d!==void 0?d:devicePixelRatio}setPixelRatio(d){this._overridePixelRatio=d,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(d){return this.transform.setMaxBounds(Lt.convert(d)),this._update()}setMinZoom(d){if((d=d==null?-2:d)>=-2&&d<=this.transform.maxZoom)return this.transform.minZoom=d,this._update(),this.getZoom()<d&&this.setZoom(d),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(d){if((d=d==null?22:d)>=this.transform.minZoom)return this.transform.maxZoom=d,this._update(),this.getZoom()>d&&this.setZoom(d),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(d){if((d=d==null?0:d)<0)throw new Error("minPitch must be greater than or equal to 0");if(d>=0&&d<=this.transform.maxPitch)return this.transform.minPitch=d,this._update(),this.getPitch()<d&&this.setPitch(d),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(d){if((d=d==null?60:d)>85)throw new Error("maxPitch must be less than or equal to 85");if(d>=this.transform.minPitch)return this.transform.maxPitch=d,this._update(),this.getPitch()>d&&this.setPitch(d),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(d){return this.transform.renderWorldCopies=d,this._update()}getCooperativeGestures(){return this._cooperativeGestures}setCooperativeGestures(d){return this._cooperativeGestures=d,this._cooperativeGestures?this._setupCooperativeGestures():this._destroyCooperativeGestures(),this}project(d){return this.transform.locationPoint(l.L.convert(d),this.style&&this.terrain)}unproject(d){return this.transform.pointLocation(l.P.convert(d),this.terrain)}isMoving(){var d;return this._moving||((d=this.handlers)===null||d===void 0?void 0:d.isMoving())}isZooming(){var d;return this._zooming||((d=this.handlers)===null||d===void 0?void 0:d.isZooming())}isRotating(){var d;return this._rotating||((d=this.handlers)===null||d===void 0?void 0:d.isRotating())}_createDelegatedListener(d,t,o){if(d==="mouseenter"||d==="mouseover"){let a=!1;return{layer:t,listener:o,delegates:{mousemove:m=>{const x=this.getLayer(t)?this.queryRenderedFeatures(m.point,{layers:[t]}):[];x.length?a||(a=!0,o.call(this,new fn(d,this,m.originalEvent,{features:x}))):a=!1},mouseout:()=>{a=!1}}}}if(d==="mouseleave"||d==="mouseout"){let a=!1;return{layer:t,listener:o,delegates:{mousemove:x=>{(this.getLayer(t)?this.queryRenderedFeatures(x.point,{layers:[t]}):[]).length?a=!0:a&&(a=!1,o.call(this,new fn(d,this,x.originalEvent)))},mouseout:x=>{a&&(a=!1,o.call(this,new fn(d,this,x.originalEvent)))}}}}{const a=h=>{const m=this.getLayer(t)?this.queryRenderedFeatures(h.point,{layers:[t]}):[];m.length&&(h.features=m,o.call(this,h),delete h.features)};return{layer:t,listener:o,delegates:{[d]:a}}}}on(d,t,o){if(o===void 0)return super.on(d,t);const a=this._createDelegatedListener(d,t,o);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[d]=this._delegatedListeners[d]||[],this._delegatedListeners[d].push(a);for(const h in a.delegates)this.on(h,a.delegates[h]);return this}once(d,t,o){if(o===void 0)return super.once(d,t);const a=this._createDelegatedListener(d,t,o);for(const h in a.delegates)this.once(h,a.delegates[h]);return this}off(d,t,o){return o===void 0?super.off(d,t):(this._delegatedListeners&&this._delegatedListeners[d]&&(a=>{const h=this._delegatedListeners[d];for(let m=0;m<h.length;m++){const x=h[m];if(x.layer===t&&x.listener===o){for(const w in x.delegates)this.off(w,x.delegates[w]);return h.splice(m,1),this}}})(),this)}queryRenderedFeatures(d,t){if(!this.style)return[];let o;const a=d instanceof l.P||Array.isArray(d),h=a?d:[[0,0],[this.transform.width,this.transform.height]];if(t=t||(a?{}:d)||{},h instanceof l.P||typeof h[0]=="number")o=[l.P.convert(h)];else{const m=l.P.convert(h[0]),x=l.P.convert(h[1]);o=[m,new l.P(x.x,m.y),x,new l.P(m.x,x.y),m]}return this.style.queryRenderedFeatures(o,t,this.transform)}querySourceFeatures(d,t){return this.style.querySourceFeatures(d,t)}setStyle(d,t){return(t=l.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._val
vendor: 9,188 bytes, line 584
584idateStyle},t)).diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&d?(this._diffStyle(d,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(d,t))}setTransformRequest(d){return this._requestManager.setTransformRequest(d),this}_getUIString(d){const t=this._locale[d];if(t==null)throw new Error(`Missing UI string '${d}'`);return t}_updateStyle(d,t){if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(d,t));const o=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!d)),d?(this.style=new Ht(this,t||{}),this.style.setEventedParent(this,{style:this.style}),typeof d=="string"?this.style.loadURL(d,t,o):this.style.loadJSON(d,t,o),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ht(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(d,t){if(typeof d=="string"){const o=this._requestManager.transformRequest(d,pt.Style);l.f(o,(a,h)=>{a?this.fire(new l.j(a)):h&&this._updateDiff(h,t)})}else typeof d=="object"&&this._updateDiff(d,t)}_updateDiff(d,t){try{this.style.setState(d,t)&&this._update(!0)}catch(o){l.w(`Unable to perform style diff: ${o.message||o.error||o}.  Rebuilding the style from scratch.`),this._updateStyle(d,t)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():l.w("There is no style added to the map.")}addSource(d,t){return this._lazyInitEmptyStyle(),this.style.addSource(d,t),this._update(!0)}isSourceLoaded(d){const t=this.style&&this.style.sourceCaches[d];if(t!==void 0)return t.loaded();this.fire(new l.j(new Error(`There is no source with ID '${d}'`)))}setTerrain(d){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),d){const t=this.style.sourceCaches[d.source];if(!t)throw new Error(`cannot load terrain, because there exists no source with ID: ${d.source}`);for(const o in this.style._layers){const a=this.style._layers[o];a.type==="hillshade"&&a.source===d.source&&l.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new At(this.painter,t,d),this.painter.renderToTexture=new Zi(this.painter,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=o=>{o.dataType==="style"?this.terrain.sourceCache.freeRtt():o.dataType==="source"&&o.tile&&(o.sourceId!==d.source||this._elevationFreeze||(this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(o.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0;return this.fire(new l.k("terrain",{terrain:d})),this}getTerrain(){var d,t;return(t=(d=this.terrain)===null||d===void 0?void 0:d.options)!==null&&t!==void 0?t:null}areTilesLoaded(){const d=this.style&&this.style.sourceCaches;for(const t in d){const o=d[t]._tiles;for(const a in o){const h=o[a];if(h.state!=="loaded"&&h.state!=="errored")return!1}}return!0}addSourceType(d,t,o){return this._lazyInitEmptyStyle(),this.style.addSourceType(d,t,o)}removeSource(d){return this.style.removeSource(d),this._update(!0)}getSource(d){return this.style.getSource(d)}addImage(d,t,o={}){const{pixelRatio:a=1,sdf:h=!1,stretchX:m,stretchY:x,content:w}=o;if(this._lazyInitEmptyStyle(),!(t instanceof HTMLImageElement||l.a(t))){if(t.width===void 0||t.height===void 0)return this.fire(new l.j(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`")));{const{width:A,height:E,data:k}=t,z=t;return this.style.addImage(d,{data:new l.R({width:A,height:E},new Uint8Array(k)),pixelRatio:a,stretchX:m,stretchY:x,content:w,sdf:h,version:0,userImage:z}),z.onAdd&&z.onAdd(this,d),this}}{const{width:A,height:E,data:k}=l.h.getImageData(t);this.style.addImage(d,{data:new l.R({width:A,height:E},k),pixelRatio:a,stretchX:m,stretchY:x,content:w,sdf:h,version:0})}}updateImage(d,t){const o=this.style.getImage(d);if(!o)return this.fire(new l.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=t instanceof HTMLImageElement||l.a(t)?l.h.getImageData(t):t,{width:h,height:m,data:x}=a;if(h===void 0||m===void 0)return this.fire(new l.j(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`")));if(h!==o.data.width||m!==o.data.height)return this.fire(new l.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const w=!(t instanceof HTMLImageElement||l.a(t));return o.data.replace(x,w),this.style.updateImage(d,o),this}getImage(d){return this.style.getImage(d)}hasImage(d){return d?!!this.style.getImage(d):(this.fire(new l.j(new Error("Missing required image id"))),!1)}removeImage(d){this.style.removeImage(d)}loadImage(d,t){Tt.getImage(this._requestManager.transformRequest(d,pt.Image),t)}listImages(){return this.style.listImages()}addLayer(d,t){return this._lazyInitEmptyStyle(),this.style.addLayer(d,t),this._update(!0)}moveLayer(d,t){return this.style.moveLayer(d,t),this._update(!0)}removeLayer(d){return this.style.removeLayer(d),this._update(!0)}getLayer(d){return this.style.getLayer(d)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(d,t,o){return this.style.setLayerZoomRange(d,t,o),this._update(!0)}setFilter(d,t,o={}){return this.style.setFilter(d,t,o),this._update(!0)}getFilter(d){return this.style.getFilter(d)}setPaintProperty(d,t,o,a={}){return this.style.setPaintProperty(d,t,o,a),this._update(!0)}getPaintProperty(d,t){return this.style.getPaintProperty(d,t)}setLayoutProperty(d,t,o,a={}){return this.style.setLayoutProperty(d,t,o,a),this._update(!0)}getLayoutProperty(d,t){return this.style.getLayoutProperty(d,t)}setGlyphs(d,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(d,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(d,t,o={}){return this._lazyInitEmptyStyle(),this.style.addSprite(d,t,o,a=>{a||this._update(!0)}),this}removeSprite(d){return this._lazyInitEmptyStyle(),this.style.removeSprite(d),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(d,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(d,t,o=>{o||this._update(!0)}),this}setLight(d,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(d,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(d,t){return this.style.setFeatureState(d,t),this._update()}removeFeatureState(d,t){return this.style.removeFeatureState(d,t),this._update()}getFeatureState(d){return this.style.getFeatureState(d)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let d=0,t=0;return this._container&&(d=this._container.clientWidth||400,t=this._container.clientHeight||300),[d,t]}_setupContainer(){const d=this._container;d.classList.add("maplibregl-map");const t=this._canvasContainer=X.create("div","maplibregl-canvas-container",d);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=X.create("canvas","maplibregl-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","Map"),this._canvas.setAttribute("role","region");const o=this._containerDimensions(),a=this._getClampedPixelRatio(o[0],o[1]);this._resizeCanvas(o[0],o[1],a);const h=this._controlContainer=X.create("div","maplibregl-control-container",d),m=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(x=>{m[x]=X.create("div",`maplibregl-ctrl-${x} `,h)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){this._cooperativeGesturesScreen=X.create("div","maplibregl-cooperative-gesture-screen",this._container);let d=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";
584navigator.platform.indexOf("Mac")===0&&(d=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map"),this._cooperativeGesturesScreen.innerHTML=`
585            <div class="maplibregl-desktop-message">${d}</div>
586            <div class="maplibregl-mobile-message">${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}</div>
587        `,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){X.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(d,t,o){this._canvas.width=Math.floor(o*d),this._canvas.height=Math.floor(o*t),this._canvas.style.width=`${d}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const d={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{t={requestedAttributes:d},a&&(t.statusMessage=a.statusMessage,t.type=a.type)},{once:!0});const o=this._canvas.getContext("webgl2",d)||this._canvas.getContext("webgl",d);if(!o){const a="Failed to initialize WebGL";throw t?(t.message=a,new Error(JSON.stringify(t))):new Error(a)}this.painter=new Do(o,this.transform),ge.testSupport(o)}_onCooperativeGesture(d,t,o){return!t&&o<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(d){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||d,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(d){return this._update(),this._renderTaskQueue.add(d)}_cancelRenderFrame(d){this._renderTaskQueue.remove(d)}_render(d){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(d),this._removed)return;let o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const h=this.transform.zoom,m=l.h.now();this.style.zoomHistory.update(h,m);const x=new l.a8(h,{now:m,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),w=x.crossFadingFactor();w===1&&w===this._crossFadingFactor||(o=!0,this._crossFadingFactor=w),this.style.update(x)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new l.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,l.bg.mark(l.bh.load),this.fire(new l.k("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.k("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,l.bg.mark(l.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var d;this._hash&&this._hash.remove();for(const o of this._controls)o.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window!="undefined"&&removeEventListener("online",this._onWindowOnline,!1),Tt.removeThrottleControl(this._imageQueueHandle),(d=this._resizeObserver)===null||d===void 0||d.disconnect();const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),X.remove(this._canvasContainer),X.remove(this._controlContainer),this._cooperativeGestures&&this._destroyCooperativeGestures(),this._container.classList.remove("maplibregl-map"),l.bg.clearMetrics(),this._removed=!0,this.fire(new l.k("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=l.h.frame(d=>{l.bg.frame(d),this._frame=null,this._render(d)}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(d){this._showTileBoundaries!==d&&(this._showTileBoundaries=d,this._update())}get showPadding(){return!!this._showPadding}set showPadding(d){this._showPadding!==d&&(this._showPadding=d,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(d){this._showCollisionBoxes!==d&&(this._showCollisionBoxes=d,d?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(d){this._showOverdrawInspector!==d&&(this._showOverdrawInspector=d,this._update())}get repaint(){return!!this._repaint}set repaint(d){this._repaint!==d&&(this._repaint=d,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(d){this._vertices=d,this._update()}get version(){return Ge}getCameraTargetElevation(){return this.transform.elevation}}
vendor: 6,722 bytes, line 587
587,hi.NavigationControl=class{constructor(d){this._updateZoomButtons=()=>{const t=this._map.getZoom(),o=t===this._map.getMaxZoom(),a=t===this._map.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=a,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",a.toString())},this._rotateCompassArrow=()=>{const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,o)=>{const a=this._map._getUIString(`NavigationControl.${o}`);t.title=a,t.setAttribute("aria-label",a)},this.options=l.e({},Oa,d),this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),X.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),X.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=X.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(d){return this._map=d,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Fa(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){X.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(d,t){const o=X.create("button",d,this._container);return o.type="button",o.addEventListener("click",t),o}},hi.GeolocateControl=class extends l.E{constructor(d){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new l.k("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("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(t),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new l.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const o=new l.L(t.coords.longitude,t.coords.latitude),a=t.coords.accuracy,h=this._map.getBearing(),m=l.e({bearing:h},this.options.fitBoundsOptions),x=Lt.fromLngLat(o,a);this._map.fitBounds(x,m,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const o=new l.L(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(o).addTo(this._map),this._userLocationDotMarker.setLngLat(o).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(t.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(t.code===3&&hs)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new l.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",o=>o.preventDefault()),this._geolocateButton=X.create("button","maplibregl-ctrl-geolocate",this._container),X.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",t===!1){l.w("Geolocation support is not available so the GeolocateControl will be disabled.");const o=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}else{const o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
587se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=X.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Pi({element:this._dotElement}),this._circleElement=X.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Pi({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",o=>{o.geolocateSource||this._watchState!=="ACTIVE_LOCK"||o.originalEvent&&o.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new l.k("trackuserlocationend")))})}},this.options=l.e({},Ii,d)}onAdd(d){return this._map=d,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),function(t,o=!1){ji===void 0||o?window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(a=>{ji=a.state!=="denied",t(ji)}).catch(()=>{ji=!!window.navigator.geolocation,t(ji)}):(ji=!!window.navigator.geolocation,t(ji)):t(ji)}(this._setupUI),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),X.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,zi=0,hs=!1}_isOutOfMapMaxBounds(d){const t=this._map.getMaxBounds(),o=d.coords;return t&&(o.longitude<t.getWest()||o.longitude>t.getEast()||o.latitude<t.getSouth()||o.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const d=this._map.getBounds(),t=d.getSouthEast(),o=d.getNorthEast(),a=t.distanceTo(o),h=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${h}px`,this._circleElement.style.height=`${h}px`}trigger(){if(!this._setup)return l.w("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 l.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":zi--,hs=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new l.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new l.k("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let d;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),zi++,zi>1?(d={maximumAge:6e5,timeout:0},hs=!0):(d=this.options.positionOptions,hs=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,d)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
587se"),this.options.showUserLocation&&this._updateMarker(null)}},hi.AttributionControl=V,hi.LogoControl=ne,hi.ScaleControl=class{constructor(d){this._onMove=()=>{jo(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,jo(this._map,this._container,this.options)},this.options=l.e({},Bs,d)}getDefaultPosition(){return"bottom-left"}onAdd(d){return this._map=d,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-scale",d.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){X.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},hi.FullscreenControl=class extends l.E{constructor(d={}){super(),this._onFullscreenChange=()=>{(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,d&&d.container&&(d.container instanceof HTMLElement?this._container=d.container:l.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(d){return this._map=d,this._container||(this._container=this._map.getContainer()),this._controlContainer=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){X.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const d=this._fullscreenButton=X.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);X.create("span","maplibregl-ctrl-icon",d).setAttribute("aria-hidden","true"),d.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const d=this._getTitle();this._fullscreenButton.setAttribute("aria-label",d),this._fullscreenButton.title=d}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new l.k("fullscreenstart")),this._map._cooperativeGestures&&(this._prevCooperativeGestures=this._map._cooperativeGestures,this._map.setCooperativeGestures())):(this.fire(new l.k("fullscreenend")),this._prevCooperativeGestures&&(this._map.setCooperativeGestures(this._prevCooperativeGestures),delete this._prevCooperativeGestures))}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},hi.TerrainControl=class{constructor(d){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))},this.options=d}onAdd(d){return this._map=d,this._container=X.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=X.create("button","maplibregl-ctrl-terrain",this._container),X.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.t
vendor: 4,385 bytes, line 587
587ype="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){X.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},hi.Popup=class extends l.E{constructor(d){super(),this.remove=()=>(this._content&&X.remove(this._content),this._container&&(X.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new l.k("close")),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=X.create("div","maplibregl-popup",this._map.getContainer()),this._tip=X.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const x of this.options.className.split(" "))this._container.classList.add(x);this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=fa(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!t)return;const o=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);let a=this.options.anchor;const h=ma(this.options.offset);if(!a){const x=this._container.offsetWidth,w=this._container.offsetHeight;let A;A=o.y+h.bottom.y<w?["top"]:o.y>this._map.transform.height-w?["bottom"]:[],o.x<x/2?A.push("left"):o.x>this._map.transform.width-x/2&&A.push("right"),a=A.length===0?"bottom":A.join("-")}const m=o.add(h[a]).round();X.setTransform(this._container,`${er[a]} translate(${m.x}px,${m.y}px)`),Na(this._container,a,"popup")},this._onClose=()=>{this.remove()},this.options=l.e(Object.create(Ua),d)}addTo(d){return this._map&&this.remove(),this._map=d,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new l.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(d){return this._lngLat=l.L.convert(d),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(d){return this.setDOMContent(document.createTextNode(d))}setHTML(d){const t=document.createDocumentFragment(),o=document.createElement("body");let a;for(o.innerHTML=d;a=o.firstChild,a;)t.appendChild(a);return this.setDOMContent(t)}getMaxWidth(){var d;return(d=this._container)===null||d===void 0?void 0:d.style.maxWidth}setMaxWidth(d){return this.options.maxWidth=d,this._update(),this}setDOMContent(d){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=X.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(d),this._createCloseButton(),this._update(),this._focusFirstElement(),this}
587addClassName(d){this._container&&this._container.classList.add(d)}removeClassName(d){this._container&&this._container.classList.remove(d)}setOffset(d){return this.options.offset=d,this._update(),this}toggleClassName(d){if(this._container)return this._container.classList.toggle(d)}_createCloseButton(){this.options.closeButton&&(this._closeButton=X.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const d=this._container.querySelector(Fl);d&&d.focus()}},hi.Marker=Pi,hi.Style=Ht,hi.LngLat=l.L,hi.LngLatBounds=Lt,hi.Point=l.P,hi.MercatorCoordinate=l.U,hi.Evented=l.E,hi.AJAXError=l.bi,hi.config=l.c,hi.CanvasSource=Xn,hi.GeoJSONSource=mn,hi.ImageSource=Sn,hi.RasterDEMTileSource=Tn,hi.RasterTileSource=Vt,hi.VectorTileSource=qt,hi.VideoSource=To,hi.setRTLTextPlugin=l.bj,hi.getRTLTextPluginStatus=l.bk,hi.prewarm=function(){vs().acquire(li)},hi.clearPrewarmedResources=function(){const d=br;d&&(d.isPreloaded()&&d.numActive()===1?(d.release(li),br=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()"))},Nl.extend(hi,{isSafari:l.ac,getPerformanceMetrics:l.bg.getPerformanceMetrics}),hi});var $=R;return $})})(zg);const Qt=Mg(Yu),rf="3.7.7",Dg=rf,Ll=typeof Buffer=="function",op=typeof TextDecoder=="function"?new TextDecoder:void 0,sp=typeof TextEncoder=="function"?new TextEncoder:void 0,Rg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ac=Array.prototype.slice.call(Rg),zc=(y=>{let p={};return y.forEach((b,I)=>p[b]=I),p})(ac),Bg=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Hn=String.fromCharCode.bind(String),ap=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):y=>new Uint8Array(Array.prototype.slice.call(y,0)),of=y=>y.replace(/=/g,"").replace(/[+\/]/g,p=>p=="+"?"-":"_"),sf=y=>y.replace(/[^A-Za-z0-9\+\/]/g,""),af=y=>{let p,b,I,R,N="";const $=y.length%3;for(let l=0;l<y.length;){if((b=y.charCodeAt(l++))>255||(I=y.charCodeAt(l++))>255||(R=y.charCodeAt(l++))>255)throw new TypeError("invalid character found");p=b<<16|I<<8|R,N+=ac[p>>18&63]+ac[p>>12&63]+ac[p>>6&63]+ac[p&63]}return $?N.slice(0,$-3)+"===".substring($):N},ch=typeof btoa=="function"?y=>btoa(y):Ll?y=>Buffer.from(y,"binary").toString("base64"):af,Ju=Ll?y=>Buffer.from(y).toString("base64"):y=>{let b=[];for(let I=0,R=y.length;I<R;I+=4096)b.push(Hn.apply(null,y.subarray(I,I+4096)));return ch(b.join(""))},Nc=(y,p=!1)=>p?of(Ju(y)):Ju(y),Og=y=>{if(y.length<2){var p=y.charCodeAt(0);return p<128?y:p<2048?Hn(192|p>>>6)+Hn(128|p&63):Hn(224|p>>>12&15)+Hn(128|p>>>6&63)+Hn(128|p&63)}else{var p=65536+(y.charCodeAt(0)-55296)*1024+(y.charCodeAt(1)-56320);return Hn(240|p>>>18&7)+Hn(128|p>>>12&63)+Hn(128|p>>>6&63)+Hn(128|p&63)}},Fg=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,lf=y=>y.replace(Fg,Og),lp=Ll?y=>Buffer.from(y,"utf8").toString("base64"):sp?y=>Ju(sp.encode(y)):y=>ch(lf(y)),wl=(y,p=!1)=>p?of(lp(y)):lp(y),cp=y=>wl(y,!0),Ng=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Ug=y=>{switch(y.length){case 4:var p=(7&y.charCodeAt(0))<<18|(63&y.charCodeAt(1))<<12|(63&y.charCodeAt(2))<<6|63&y.charCodeAt(3),b=p-65536;return Hn((b>>>10)+55296)+Hn((b&1023)+56320);case 3:return Hn((15&y.charCodeAt(0))<<12|(63&y.charCodeAt(1))<<6|63&y.charCodeAt(2));
587default:return Hn((31&y.charCodeAt(0))<<6|63&y.charCodeAt(1))}},cf=y=>y.replace(Ng,Ug),uf=y=>{if(y=y.replace(/\s+/g,""),!Bg.test(y))throw new TypeError("malformed base64.");y+="==".slice(2-(y.length&3));let p,b="",I,R;for(let N=0;N<y.length;)p=zc[y.charAt(N++)]<<18|zc[y.charAt(N++)]<<12|(I=zc[y.charAt(N++)])<<6|(R=zc[y.charAt(N++)]),b+=I===64?Hn(p>>16&255):R===64?Hn(p>>16&255,p>>8&255):Hn(p>>16&255,p>>8&255,p&255);return b},uh=typeof atob=="function"?y=>atob(sf(y)):Ll?y=>Buffer.from(y,"base64").toString("binary"):uf,hf=Ll?y=>ap(Buffer.from(y,"base64")):y=>ap(uh(y).split("").map(p=>p.charCodeAt(0))),df=y=>hf(pf(y)),Vg=Ll?y=>Buffer.from(y,"base64").toString("utf8"):op?y=>op.decode(hf(y)):y=>cf(uh(y)),pf=y=>sf(y.replace(/[-_]/g,p=>p=="-"?"+":"/")),Qu=y=>Vg(pf(y)),Zg=y=>{if(typeof y!="string")return!1;const p=y.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(p)||!/[^\s0-9a-zA-Z\-_]/.test(p)},ff=y=>({value:y,enumerable:!1,writable:!0,configurable:!0}),mf=function(){const y=(p,b)=>Object.defineProperty(String.prototype,p,ff(b));y("fromBase64",function(){return Qu(this)}),y("toBase64",function(p){return wl(this,p)}),y("toBase64URI",function(){return wl(this,!0)}),y("toBase64URL",function(){return wl(this,!0)}),y("toUint8Array",function(){return df(this)})},_f=function(){const y=(p,b)=>Object.defineProperty(Uint8Array.prototype,p,ff(b));y("toBase64",function(p){return Nc(this,p)}),y("toBase64URI",function(){return Nc(this,!0)}),y("toBase64URL",function(){return Nc(this,!0)})},jg=()=>{mf(),_f()},$g={version:rf,VERSION:Dg,atob:uh,atobPolyfill:uf,btoa:ch,btoaPolyfill:af,fromBase64:Qu,toBase64:wl,encode:wl,encodeURI:cp,encodeURL:cp,utob:lf,btou:cf,decode:Qu,isValid:Zg,fromUint8Array:Nc,toUint8Array:df,extendString:mf,extendUint8Array:_f,extendBuiltins:jg};var qc={},qg={get exports(){return qc},set exports(y){qc=y}},Tl=typeof Reflect=="object"?Reflect:null,up=Tl&&typeof Tl.apply=="function"?Tl.apply:function(p,b,I){return Function.prototype.apply.call(p,b,I)},Uc;Tl&&typeof Tl.ownKeys=="function"?Uc=Tl.ownKeys:Object.getOwnPropertySymbols?Uc=function(p){return Object.getOwnPropertyNames(p).concat(Object.getOwnPropertySymbols(p))}:Uc=function(p){return Object.getOwnPropertyNames(p)};function Gg(y){console&&console.warn&&console.warn(y)}var gf=Number.isNaN||function(p){return p!==p};function Bi(){Bi.init.call(this)}qg.exports=Bi;qc.once=Xg;Bi.EventEmitter=Bi;Bi.prototype._events=void 0;Bi.prototype._eventsCount=0;Bi.prototype._maxListeners=void 0;var hp=10;function Kc(y){if(typeof y!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof y)}Object.defineProperty(Bi,"defaultMaxListeners",{enumerable:!0,get:function(){return hp},set:function(y){if(typeof y!="number"||y<0||gf(y))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+y+".");hp=y}});Bi.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};Bi.prototype.setMaxListeners=function(p){if(typeof p!="number"||p<0||gf(p))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+p+".");return this._maxListeners=p,this};function yf(y){return y._maxListeners===void 0?Bi.defaultMaxListeners:y._maxListeners}Bi.prototype.getMaxListeners=function(){return yf(this)};Bi.prototype.emit=function(p){for(var b=[],I=1;I<arguments.length;I++)b.push(arguments[I]);var R=p==="error",N=this._events;if(N!==void 0)R=R&&N.error===void 0;else if(!R)return!1;if(R){var $;if(b.length>0&&($=b[0]),$ instanceof Error)throw $;var l=new Error("Unhandled error."+($?" ("+$.message+")":""));throw l.context=$,l}var se=N[p];if(se===void 0)return!1;if(typeof se=="function")up(se,this,b);else for(var X=se.length,ge=Tf(se,X),I=0;I<X;++I)up(ge[I],this,b);return!0};function vf(y,p,b,I){var R,N,$;if(Kc(b),N=y._events,N===void 0?(N=y._events=Object.create(null),y._eventsCount=0):(N.newListener!==void 0&&(y.emit("newListener",p,b.listener?b.listener:b),N=y._events),$=N[p]),$===void 0)$=N[p]=b,++y._eventsCount;else if(typeof $=="function"?$=N[p]=I?[b,$]:[$,b]:I?$.unshift(b):$.push(b),R=yf(y),R>0&&$.length>R&&!$.warned){$.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+$.length+" "+String(p)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=y,l.type=p,l.count=$.length,Gg(l)}return y}Bi.prototype.addListener=function(p,b){return vf(this,p,b,!1)};Bi.prototype.on=Bi.prototype.addListener;Bi.prototype.prependListener=function(p,b){return vf(this,p,b,!0)};function Hg(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function xf(y,p,b){var I={fired:!1,wrapFn:void 0,target:y,type:p,listener:b},R=Hg.bind(I);return R.listener=b,I.wrapFn=R,R}Bi.prototype.once=function(p,b){return Kc(b),this.on(p,xf(this,p,b)),this};Bi.prototype.prependOnceListener=function(p,b){return Kc(b),this.prependListener(p,xf(this,p,b)),this};Bi.prototype.removeListener=function(p,b){var I,R,N,$,l;if(Kc(b),R=this._events,R===void 0)return this;if(I=R[p],I===void 0)return this;if(I===b||I.listener===b)--this._eventsCount===0?this._events=Object.create(null):(delete R[p],R.removeListener&&this.emit
587("removeListener",p,I.listener||b));else if(typeof I!="function"){for(N=-1,$=I.length-1;$>=0;$--)if(I[$]===b||I[$].listener===b){l=I[$].listener,N=$;break}if(N<0)return this;N===0?I.shift():Wg(I,N),I.length===1&&(R[p]=I[0]),R.removeListener!==void 0&&this.emit("removeListener",p,l||b)}return this};Bi.prototype.off=Bi.prototype.removeListener;Bi.prototype.removeAllListeners=function(p){var b,I,R;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[p]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[p]),this;if(arguments.length===0){var N=Object.keys(I),$;for(R=0;R<N.length;++R)$=N[R],$!=="removeListener"&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(b=I[p],typeof b=="function")this.removeListener(p,b);else if(b!==void 0)for(R=b.length-1;R>=0;R--)this.removeListener(p,b[R]);return this};function bf(y,p,b){var I=y._events;if(I===void 0)return[];var R=I[p];return R===void 0?[]:typeof R=="function"?b?[R.listener||R]:[R]:b?Kg(R):Tf(R,R.length)}Bi.prototype.listeners=function(p){return bf(this,p,!0)};Bi.prototype.rawListeners=function(p){return bf(this,p,!1)};Bi.listenerCount=function(y,p){return typeof y.listenerCount=="function"?y.listenerCount(p):wf.call(y,p)};Bi.prototype.listenerCount=wf;function wf(y){var p=this._events;if(p!==void 0){var b=p[y];if(typeof b=="function")return 1;if(b!==void 0)return b.length}return 0}Bi.prototype.eventNames=function(){return this._eventsCount>0?Uc(this._events):[]};function Tf(y,p){for(var b=new Array(p),I=0;I<p;++I)b[I]=y[I];return b}function Wg(y,p){for(;p+1<y.length;p++)y[p]=y[p+1];y.pop()}function Kg(y){for(var p=new Array(y.length),b=0;b<p.length;++b)p[b]=y[b].listener||y[b];return p}function Xg(y,p){return new Promise(function(b,I){function R($){y.removeListener(p,N),I($)}function N(){typeof y.removeListener=="function"&&y.removeListener("error",R),b([].slice.call(arguments))}Sf(y,p,N,{once:!0}),p!=="error"&&Yg(y,R,{once:!0})})}function Yg(y,p,b){typeof y.on=="function"&&Sf(y,"error",p,b)}function Sf(y,p,b,I){if(typeof y.on=="function")I.once?y.once(p,b):y.on(p,b);else if(typeof y.addEventListener=="function")y.addEventListener(p,function R(N){I.once&&y.removeEventListener(p,R),b(N)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof y)}function Jg(){return typeof self!="undefined"?fetch.bind(self):typeof global!="undefined"&&global.fetch?global.fetch:null}class Qg{constructor(){this._apiKey="",this._fetch=Jg(),this.tileCacheSize=200}set apiKey(p){this._apiKey=p}get apiKey(){return this._apiKey}set fetch(p){this._fetch=p}get fetch(){return this._fetch}}const Sl=new Qg,ey={AUTO:"auto",ALBANIAN:"sq",ARABIC:"ar",ARMENIAN:"hy",AZERBAIJANI:"az",BELORUSSIAN:"be",BOSNIAN:"bs",BRETON:"br",BULGARIAN:"bg",CATALAN:"ca",CHINESE:"zh",CROATIAN:"hr",CZECH:"cs",DANISH:"da",DUTCH:"nl",ENGLISH:"en",ESPERANTO:"eo",ESTONIAN:"et",FINNISH:"fi",FRENCH:"fr",FRISIAN:"fy",GEORGIAN:"ka",GERMAN:"de",GREEK:"el",HEBREW:"he",HUNGARIAN:"hu",ICELANDIC:"is",IRISH:"ga",ITALIAN:"it",JAPANESE:"ja",KANNADA:"kn",KAZAKH:"kk",KOREAN:"ko",ROMAN_LATIN:"la",LATVIAN:"lv",LITHUANIAN:"lt",LUXEMBOURGISH:"lb",MACEDONIAN:"mk",MALTESE:"mt",NORWEGIAN:"no",POLISH:"pl",PORTUGUESE:"pt",ROMANIAN:"ro",ROMANSH:"rm",RUSSIAN:"ru",SCOTTISH_GAELIC:"gd",SERBIAN_CYRILLIC:"sr",SLOVAK:"sk",SLOVENE:"sl",SPANISH:"es",SWEDISH:"sv",THAI:"th",TURKISH:"tr",UKRAINIAN:"uk",WELSH:"cy"};new Set(Object.values(ey));async function ty(y,p={}){if(Sl.fetch===null)throw new Error("The fetch function was not found. If on NodeJS < 18 please specify the fetch function with config.fetch");if(new URL(y).searchParams.get("key").trim()==="")throw new Error("The MapTiler Cloud API key is missing. Set it in `config.apiKey` or get one for free at https://maptiler.com");return Sl.fetch(y,p)}const Af={maptilerApiURL:"https://api.maptiler.com/",mapStyle:"streets-v2"};Object.freeze(Af);class iy extends Error{constructor(p,b=""){super(`Call to enpoint ${p.url} failed with the status code ${p.status}. ${b}`),this.res=p}}const dp={403:"Key is missing, invalid or restricted"};async function ny(y={}){var N;const p=new URL("geolocation/ip.json",Af.maptilerApiURL);p.searchParams.set("key",(N=y.apiKey)!=null?N:Sl.apiKey);const b=p.toString(),I=await ty(b);if(!I.ok)throw new iy(I,I.status in dp?dp[I.status]:"");return await I.json()}const pp={info:ny};function Pf(y){const p=/^maptiler:\/\/(.*)/;let b;const I=y.trim();let R;return I.startsWith("http://")||I.startsWith("https://")?R=I:(b=p.exec(I))!==null?R=`https://api.maptiler.com/maps/${b[1]}
587/style.json`:R=`https://api.maptiler.com/maps/${I}/style.json`,R}class If{constructor(p,b,I,R,N,$){this.name=p,this.variantType=b,this.id=I,this.referenceStyle=R,this.description=N,this.imageURL=$}getName(){return this.name}getFullName(){return`${this.referenceStyle.getName()} ${this.name}`}getType(){return this.variantType}getId(){return this.id}getDescription(){return this.description}getReferenceStyle(){return this.referenceStyle}hasVariant(p){return this.referenceStyle.hasVariant(p)}getVariant(p){return this.referenceStyle.getVariant(p)}getVariants(){return this.referenceStyle.getVariants().filter(p=>p!==this)}getImageURL(){return this.imageURL}getExpandedStyleURL(){return Pf(this.getId())}}class Lf{constructor(p,b){this.name=p,this.id=b,this.variants={},this.orderedVariants=[]}getName(){return this.name}getId(){return this.id}addVariant(p){this.variants[p.getType()]=p,this.orderedVariants.push(p)}hasVariant(p){return p in this.variants}getVariant(p){return p in this.variants?this.variants[p]:this.orderedVariants[0]}getVariants(){return Object.values(this.variants)}getDefaultVariant(){return this.orderedVariants[0]}}const eh=[{referenceStyleID:"STREETS",name:"Streets",description:"",variants:[{id:"streets-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"streets-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"streets-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"streets-v2-night",name:"Night",variantType:"NIGHT",description:"",imageURL:""},{id:"streets-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OUTDOOR",name:"Outdoor",description:"",variants:[{id:"outdoor-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"outdoor-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"WINTER",name:"Winter",description:"",variants:[{id:"winter-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"winter-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""}]},{referenceStyleID:"SATELLITE",name:"Satellite",description:"",variants:[{id:"satellite",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"HYBRID",name:"Hybrid",description:"",variants:[{id:"hybrid",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"BASIC",name:"Basic",description:"",variants:[{id:"basic-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"basic-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"basic-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"BRIGHT",name:"Bright",description:"",variants:[{id:"bright-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"bright-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"bright-v2-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""},{id:"bright-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""}]},{referenceStyleID:"OPENSTREETMAP",name:"OpenStreetMap",description:"",variants:[{id:"openstreetmap",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]},{referenceStyleID:"TOPO",name:"Topo",description:"",variants:[{id:"topo-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"topo-v2-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"topo-v2-shiny",name:"Shiny",variantType:"SHINY",description:"",imageURL:""},{id:"topo-v2-pastel",name:"Pastel",variantType:"PASTEL",description:"",imageURL:""},{id:"topo-v2-topographique",name:"Topographique",variantType:"TOPOGRAPHIQUE",description:"",imageURL:""}]},{referenceStyleID:"VOYAGER",name:"Voyager",description:"",variants:[{id:"voyager-v2",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"voyager-v2-darkmatter",name:"Darkmatter",variantType:"DARK",description:"",imageURL:""},{id:"voyager-v2-positron",name:"Positron",variantType:"LIGHT",description:"",imageURL:""},{id:"voyager-v2-vintage",name:"Vintage",variantType:"VINTAGE",description:"",imageURL:""}]},{referenceStyleID:"TONER",name:"Toner",description:"",variants:[{id:"toner-v2",n
587ame:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"toner-v2-background",name:"Background",variantType:"BACKGROUND",description:"",imageURL:""},{id:"toner-v2-lite",name:"Lite",variantType:"LITE",description:"",imageURL:""},{id:"toner-v2-lines",name:"Lines",variantType:"LINES",description:"",imageURL:""}]},{referenceStyleID:"DATAVIZ",name:"Dataviz",description:"",variants:[{id:"dataviz",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"dataviz-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"dataviz-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"BACKDROP",name:"Backdrop",description:"",variants:[{id:"backdrop",name:"Default",variantType:"DEFAULT",description:"",imageURL:""},{id:"backdrop-dark",name:"Dark",variantType:"DARK",description:"",imageURL:""},{id:"backdrop-light",name:"Light",variantType:"LIGHT",description:"",imageURL:""}]},{referenceStyleID:"OCEAN",name:"Ocean",description:"",variants:[{id:"ocean",name:"Default",variantType:"DEFAULT",description:"",imageURL:""}]}];function ry(y){return new Proxy(y,{get(p,b,I){return p.hasVariant(b)?p.getVariant(b):b.toString().toUpperCase()===b?y.getDefaultVariant():Reflect.get(p,b,I)}})}function oy(){const y={};for(let p=0;p<eh.length;p+=1){const b=eh[p],I=ry(new Lf(b.name,b.referenceStyleID));for(let R=0;R<b.variants.length;R+=1){const N=b.variants[R],$=new If(N.name,N.variantType,N.id,I,N.description,N.imageURL);I.addVariant($)}y[b.referenceStyleID]=I}return y}const th=oy();let Dc;const sy=new Uint8Array(16);function ay(){if(!Dc&&(Dc=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Dc))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Dc(sy)}const Gn=[];for(let y=0;y<256;++y)Gn.push((y+256).toString(16).slice(1));function ly(y,p=0){return Gn[y[p+0]]+Gn[y[p+1]]+Gn[y[p+2]]+Gn[y[p+3]]+"-"+Gn[y[p+4]]+Gn[y[p+5]]+"-"+Gn[y[p+6]]+Gn[y[p+7]]+"-"+Gn[y[p+8]]+Gn[y[p+9]]+"-"+Gn[y[p+10]]+Gn[y[p+11]]+Gn[y[p+12]]+Gn[y[p+13]]+Gn[y[p+14]]+Gn[y[p+15]]}const cy=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),fp={randomUUID:cy};function uy(y,p,b){if(fp.randomUUID&&!p&&!y)return fp.randomUUID();y=y||{};const I=y.random||(y.rng||ay)();if(I[6]=I[6]&15|64,I[8]=I[8]&63|128,p){b=b||0;for(let R=0;R<16;++R)p[b+R]=I[R];return p}return ly(I)}const di={VISITOR:"visitor",VISITOR_ENGLISH:"visitor_en",STYLE:"style",AUTO:"auto",STYLE_LOCK:"style_lock",LATIN:"name:latin",NON_LATIN:"name:nonlatin",LOCAL:"name",INTERNATIONAL:"name_int",ALBANIAN:"name:sq",AMHARIC:"name:am",ARABIC:"name:ar",ARMENIAN:"name:hy",AZERBAIJANI:"name:az",BASQUE:"name:eu",BELORUSSIAN:"name:be",BENGALI:"name:bn",BOSNIAN:"name:bs",BRETON:"name:br",BULGARIAN:"name:bg",CATALAN:"name:ca",CHINESE:"name:zh",TRADITIONAL_CHINESE:"name:zh-Hant",SIMPLIFIED_CHINESE:"name:zh-Hans",CORSICAN:"name:co",CROATIAN:"name:hr",CZECH:"name:cs",DANISH:"name:da",DUTCH:"name:nl",ENGLISH:"name:en",ESPERANTO:"name:eo",ESTONIAN:"name:et",FINNISH:"name:fi",FRENCH:"name:fr",FRISIAN:"name:fy",GEORGIAN:"name:ka",GERMAN:"name:de",GREEK:"name:el",HEBREW:"name:he",HINDI:"name:hi",HUNGARIAN:"name:hu",ICELANDIC:"name:is",INDONESIAN:"name:id",IRISH:"name:ga",ITALIAN:"name:it",JAPANESE:"name:ja",JAPANESE_HIRAGANA:"name:ja-Hira",JAPANESE_KANA:"name:ja_kana",JAPANESE_LATIN:"name:ja_rm",JAPANESE_2018:"name:ja-Latn",KANNADA:"name:kn",KAZAKH:"name:kk",KOREAN:"name:ko",KOREAN_LATIN:"name:ko-Latn",KURDISH:"name:ku",ROMAN_LATIN:"name:la",LATVIAN:"name:lv",LITHUANIAN:"name:lt",LUXEMBOURGISH:"name:lb",MACEDONIAN:"name:mk",MALAYALAM:"name:ml",MALTESE:"name:mt",NORWEGIAN:"name:no",OCCITAN:"name:oc",PERSIAN:"name:fa",POLISH:"name:pl",PORTUGUESE:"name:pt",PUNJABI:"name:pa",WESTERN_PUNJABI:"name:pnb",ROMANIAN:"name:ro",ROMANSH:"name:rm",RUSSIAN:"name:ru",SCOTTISH_GAELIC:"name:gd",SERBIAN_CYRILLIC:"name:sr",SERBIAN_LATIN:"name:sr-Latn",SLOVAK:"name:sk",SLOVENE:"name:sl",SPANISH:"name:es",SWEDISH:"name:sv",TAMIL:"name:ta",TELUGU:"name:te",THAI:"name:th",TURKISH:"name:tr",UKRAINIAN:"name:uk",URDU:"name:ur",VIETNAMIAN_LATIN:"name:vi",WELSH:"name:cy"},hy=new Set(Object.values(di));function mp(y){return hy.has(y)}const dy=new Set(Object.values(di));function _p(){if(typeof navigator=="undefined")return`name:${Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0]}`;const y=Array.from(new Set(navigator.languages.map(p=>`name:${p.split("-")[0]}`))).filter(p=>dy.has(p));return y.length?y[0]:di.LOCAL}const wo={maptilerLogoURL:"https://api.maptiler.com/resources/logo.svg",maptilerURL:"https://www.maptiler.com/",maptilerApiHost:"api.maptiler.com",rtlPluginURL:"https://cdn.maptiler.com/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.min.js",primaryLanguage:di.STYLE,secondaryLanguage:di.LOCAL,terrainSourceURL:"https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json",terrainSourceId:"maptiler-terrain"};Object.freeze(wo);var py=Object.defineProperty,fy=(y,p,b)=>p in y?py(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,sc=(y,p,b)=>(fy(y,typeof p!="symbol"?p+"":p,b),b);const Ef=uy();class my extends qc{constructor(){super(),sc(this,"primaryLanguage",wo.primaryLanguage),sc(this,"secondaryLanguage"),sc(this,"session",!0),sc(this,"_unit","metric"),sc(this,"_apiKey","")}
587set unit(p){this._unit=p,this.emit("unit",p)}get unit(){return this._unit}set apiKey(p){this._apiKey=p,Sl.apiKey=p,this.emit("apiKey",p)}get apiKey(){return this._apiKey}set fetch(p){Sl.fetch=p}get fetch(){return Sl.fetch}}const Yr=new my;class _y extends Qt.LogoControl{onAdd(p){return super.onAdd(p)}}var gy=Object.defineProperty,yy=(y,p,b)=>p in y?gy(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,gp=(y,p,b)=>(yy(y,typeof p!="symbol"?p+"":p,b),b);class yp extends _y{constructor(p={}){var b,I;super(p),gp(this,"logoURL",""),gp(this,"linkURL",""),this.logoURL=(b=p.logoURL)!=null?b:wo.maptilerLogoURL,this.linkURL=(I=p.linkURL)!=null?I:wo.maptilerURL}onAdd(p){var b;this._map=p,this._compact=(b=this.options.compact)!=null?b:!1,this._container=window.document.createElement("div"),this._container.className="maplibregl-ctrl";const I=window.document.createElement("a");return I.style.backgroundRepeat="no-repeat",I.style.cursor="pointer",I.style.display="block",I.style.height="23px",I.style.margin="0 0 -4px -4px",I.style.overflow="hidden",I.style.width="88px",I.style.backgroundImage=`url(${this.logoURL})`,I.style.backgroundSize="100px 30px",I.style.width="100px",I.style.height="30px",I.target="_blank",I.rel="noopener",I.href=this.linkURL,I.setAttribute("aria-label","MapTiler logo"),I.setAttribute("rel","noopener"),this._container.appendChild(I),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}}var vy=Object.defineProperty,vp=Object.getOwnPropertySymbols,xy=Object.prototype.hasOwnProperty,by=Object.prototype.propertyIsEnumerable,xp=(y,p,b)=>p in y?vy(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,bp=(y,p)=>{for(var b in p||(p={}))xy.call(p,b)&&xp(y,b,p[b]);if(vp)for(var b of vp(p))by.call(p,b)&&xp(y,b,p[b]);return y};function wy(){Qt.getRTLTextPluginStatus()==="unavailable"&&Qt.setRTLTextPlugin(wo.rtlPluginURL,y=>{y&&console.error(y)},!0)}function Ty(y,p){y.forEach(b=>{typeof p[b]=="function"&&(p[b]=p[b].bind(p))})}function Ta(y,p,b){const I=window.document.createElement(y);return p!==void 0&&(I.className=p),b&&b.appendChild(I),I}function Cf(y){y.parentNode&&y.parentNode.removeChild(y)}function wp(y,p){let b=null;try{b=new URL(y)}catch(I){return{url:y}}return b.host===wo.maptilerApiHost&&(b.searchParams.has("key")||b.searchParams.append("key",Yr.apiKey),Yr.session&&b.searchParams.append("mtsid",Ef)),{url:b.href}}function Tp(y){return function(p,b){var I;if(y!==void 0){const R=y(p,b),N=wp((I=R==null?void 0:R.url)!=null?I:"");return bp(bp({},R),N)}else return wp(p)}}function Mf(){return Math.random().toString(36).substring(2)}function Xc(y){return/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(y)}function Sy(y){try{return JSON.parse(y)}catch(p){}return null}function Sp(y){return y?typeof y=="string"||y instanceof String?!y.startsWith("http")&&y.toLowerCase().includes(".json")?y:Pf(y):y instanceof If?y.getExpandedStyleURL():y instanceof Lf?y.getDefaultVariant().getExpandedStyleURL():y:th[eh[0].referenceStyleID].getDefaultVariant().getExpandedStyleURL()}var Ay=Object.defineProperty,Py=(y,p,b)=>p in y?Ay(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,ju=(y,p,b)=>(Py(y,typeof p!="symbol"?p+"":p,b),b);class Iy{constructor(){ju(this,"_map"),ju(this,"_container"),ju(this,"_terrainButton"),Ty(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(p){return this._map=p,this._container=Ta("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=Ta("button","maplibregl-ctrl-terrain",this._container),Ta("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){Cf(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.hasTerrain()?this._map.disableTerrain():this._map.enableTerrain(),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.hasTerrain()?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}}class Ly extends Qt.NavigationControl{onAdd(p){return super.onAdd(p)}}var Ey=Object.defineProperty,Cy=(y,p,b)=>p in y?Ey(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,My=(y,p,b)=>(Cy(y,typeof p!="symbol"?p+"":p,b),b);class ky extends Ly{constructor(){super({showCompass:!0,showZoom:!0,visualizePitch:!0}),My(this,"_rotateCompassArrow",()=>{const p=this.options.visualizePitch?`scale(${Math.min(1.5,1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)
587),.5))}) rotateX(${Math.min(70,this._map.transform.pitch)}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=p}),this._compass.removeEventListener("click",this._compass.clickFunction),this._compass.addEventListener("click",p=>{this._map.getPitch()===0?this._map.easeTo({pitch:Math.min(this._map.getMaxPitch(),80)}):this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:p}):this._map.resetNorth({},{originalEvent:p})})}_createButton(p,b){const I=super._createButton(p,b);return I.clickFunction=b,I}}class zy extends Qt.GeolocateControl{onAdd(p){return super.onAdd(p)}}var Dy=Object.defineProperty,Ry=Object.defineProperties,By=Object.getOwnPropertyDescriptors,Ap=Object.getOwnPropertySymbols,Oy=Object.prototype.hasOwnProperty,Fy=Object.prototype.propertyIsEnumerable,ih=(y,p,b)=>p in y?Dy(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,Ny=(y,p)=>{for(var b in p||(p={}))Oy.call(p,b)&&ih(y,b,p[b]);if(Ap)for(var b of Ap(p))Fy.call(p,b)&&ih(y,b,p[b]);return y},Uy=(y,p)=>Ry(y,By(p)),Rc=(y,p,b)=>(ih(y,typeof p!="symbol"?p+"":p,b),b);const Pp=Qt.Marker,Ip=Qt.LngLat,Vy=Qt.LngLatBounds;class Zy extends zy{constructor(){super(...arguments),Rc(this,"lastUpdatedCenter",new Ip(0,0)),Rc(this,"_updateCamera",p=>{var b,I,R;const N=new Ip(p.coords.longitude,p.coords.latitude),$=p.coords.accuracy,l=this._map.getBearing(),se=Uy(Ny({bearing:l},this.options.fitBoundsOptions),{linear:!0}),X=this._map.getZoom();X>((R=(I=(b=this.options)==null?void 0:b.fitBoundsOptions)==null?void 0:I.maxZoom)!=null?R:30)&&(se.zoom=X),this._map.fitBounds(Vy.fromLngLat(N,$),se,{geolocateSource:!0});let ge=!1;const ve=()=>{ge=!0};this._map.once("click",ve),this._map.once("dblclick",ve),this._map.once("dragstart",ve),this._map.once("mousedown",ve),this._map.once("touchstart",ve),this._map.once("wheel",ve),this._map.once("moveend",()=>{this._map.off("click",ve),this._map.off("dblclick",ve),this._map.off("dragstart",ve),this._map.off("mousedown",ve),this._map.off("touchstart",ve),this._map.off("wheel",ve),!ge&&(this.lastUpdatedCenter=this._map.getCenter())})}),Rc(this,"_setupUI",p=>{if(this.lastUpdatedCenter=this._map.getCenter(),this._container.addEventListener("contextmenu",b=>b.preventDefault()),this._geolocateButton=Ta("button","maplibregl-ctrl-geolocate",this._container),Ta("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",p===!1){const b=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=b,this._geolocateButton.setAttribute("aria-label",b)}else{const b=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=b,this._geolocateButton.setAttribute("aria-label",b)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=Ta("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Pp({element:this._dotElement}),this._circleElement=Ta("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Pp({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("move",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("moveend",b=>{const I=b.originalEvent&&b.originalEvent.type==="resize",R=this.lastUpdatedCenter.distanceTo(this._map.getCenter());!b.geolocateSource&&this._watchState==="ACTIVE_LOCK"&&!I&&R>1&&(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new Event("trackuserlocationend")))})}),Rc(this,"_onZoom",()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()})}_updateCircleRadius(){if(this._watchState!=="BACKGROUND"&&this._watchState!=="ACTIVE_LOCK")return;const p=[this._lastKnownPosition.coords.longitude,this._lastKnownPosition.coords.latitude],b=this._map.project(p),I=this._map.unproject([b.x,b.y]),R=this._map.unproject([b.x+20,b.y]),N=I.distanceTo(R)/20,$=Math.ceil(2*this._accuracy/N);this._circleElement.style.width=`${$}px`,this._circleElement.style.height=`${$}px`}}class jy extends Qt.AttributionControl{onAdd(p){return super.onAdd(p)}}class $y extends Qt.ScaleControl{onAdd(p){return super.onAdd(p)}}class qy extends Qt.FullscreenControl{onAdd(p){return super.onAdd(p)}}var Gy=Object.defineProperty,Hy=Object.defineProperties,Wy=Object.getOwnPropertyDescriptors,Lp=Object.getOwnPropertySymbols,Ky=Object.prototype.hasOwnProperty,Xy=Object.prototype.propertyIsEnumerable,nh=(y,p,b)=>p in y?Gy(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,Al=(y,p)=>{for(var b in p||(p={}))Ky.call(p,b)&&nh(y,b,p[b]);if(Lp)for(var b of Lp(p))Xy.call(p,b)&&nh(y,b,p[b]);return y},Ep=(y,p)=>Hy(y,Wy(p)),Yy=(y,p,b)=>(nh(y,typeof p!="symbol"?p+"":p,b),b),hh=(y,p,b)=>{if(!p.has(y))throw TypeError("Cannot "+b)},pi=(y,p,b)=>(hh(y,p,"read from private field"),b?b.call(y):p.get(y)),ms=(y,p,b)=>{if(p.has(y))throw TypeError("Cannot add the same private member more than once");p instanceof WeakSet?p.add(y):p.set(y,b)},bl=(y,p,b,I)=>(hh(y,p,"write to private field"),I?I.call(y,b):p.set(y,b),b),Wr=(y,p,b)=>(hh(y,p,"access private method"),b),Kr,gs,Ga,kf,Ha,xo,Vc,rh,zf,Xr,bo,oh,Df;class $u{constructor(p,b){ms(this,rh),ms(this,Xr),ms(this,oh),ms(this,Kr,void 0),Yy(this,"map"),ms(this,gs,void 0),ms(this,Ga,void 0),ms(this,kf,void 0),ms(this,Ha,void 0),ms(this,xo,!1),ms(this,Vc,void 0);var I;p.style!==void 0&&bl(this,xo,!0),bl(this,Kr,Ep(Al(Ep(Al({zoomAdjust:-4,position:"top-right"},b),{forceNoAttributionControl:!0,attributionControl:!1,navigationControl:!1,geolocateControl:!1,maptilerLogo:!1,minimap:!1,hash:!1,pitchAdjust:!1}),p),{containerStyle:Al({border:"1px solid #000",width:"400px",height:"300px"},(I=p.containerStyle)!=null?I:{})})),p.lockZoom!==void 0&&(pi(this,Kr).minZoom=p.lockZoom,pi(this,Kr).maxZoom=p.lockZoom)}setStyle(p,b){pi(this,xo)||this.map.setStyle(p,b),Wr(this,Xr,bo).call(this)}addLayer(p,b){return pi(this,xo)||this.map.addLayer(p,b),Wr(this,Xr,bo).call(this),this.map}moveLayer(p,b){return pi(this,xo)||this.map.moveLayer(p,b),Wr(this,Xr,bo).call(this),this.map}removeLayer(p){return pi(this,xo)||this.map.removeLayer(p),Wr(this,Xr,bo).call(this),this}
587setLayerZoomRange(p,b,I){return pi(this,xo)||this.map.setLayerZoomRange(p,b,I),Wr(this,Xr,bo).call(this),this}setFilter(p,b,I){return pi(this,xo)||this.map.setFilter(p,b,I),Wr(this,Xr,bo).call(this),this}setPaintProperty(p,b,I,R){return pi(this,xo)||this.map.setPaintProperty(p,b,I,R),Wr(this,Xr,bo).call(this),this}setLayoutProperty(p,b,I,R){return pi(this,xo)||this.map.setLayoutProperty(p,b,I,R),Wr(this,Xr,bo).call(this),this}setGlyphs(p,b){return pi(this,xo)||this.map.setGlyphs(p,b),Wr(this,Xr,bo).call(this),this}onAdd(p){bl(this,gs,p),bl(this,Ga,Ta("div","maplibregl-ctrl maplibregl-ctrl-group"));for(const[b,I]of Object.entries(pi(this,Kr).containerStyle))pi(this,Ga).style.setProperty(b,I);return pi(this,Kr).container=pi(this,Ga),pi(this,Kr).zoom=p.getZoom()+pi(this,Kr).zoomAdjust,this.map=new Rf(pi(this,Kr)),this.map.once("style.load",()=>{this.map.resize()}),this.map.once("load",()=>{Wr(this,rh,zf).call(this,pi(this,Kr).parentRect),bl(this,Vc,Wr(this,oh,Df).call(this))}),pi(this,Ga)}onRemove(){var p;(p=pi(this,Vc))==null||p.call(this),Cf(pi(this,Ga))}}Kr=new WeakMap;gs=new WeakMap;Ga=new WeakMap;kf=new WeakMap;Ha=new WeakMap;xo=new WeakMap;Vc=new WeakMap;rh=new WeakSet;zf=function(y){y===void 0||y.linePaint===void 0&&y.fillPaint===void 0||(bl(this,Ha,{type:"Feature",properties:{name:"parentRect"},geometry:{type:"Polygon",coordinates:[[[],[],[],[],[]]]}}),this.map.addSource("parentRect",{type:"geojson",data:pi(this,Ha)}),(y.lineLayout!==void 0||y.linePaint!==void 0)&&this.map.addLayer({id:"parentRectOutline",type:"line",source:"parentRect",layout:Al({},y.lineLayout),paint:Al({"line-color":"#FFF","line-width":1,"line-opacity":.85},y.linePaint)}),y.fillPaint!==void 0&&this.map.addLayer({id:"parentRectFill",type:"fill",source:"parentRect",layout:{},paint:Al({"fill-color":"#08F","fill-opacity":.135},y.fillPaint)}),Wr(this,Xr,bo).call(this))};Xr=new WeakSet;bo=function(){if(pi(this,Ha)===void 0)return;const{devicePixelRatio:y}=window,p=pi(this,gs).getCanvas(),b=p.width/y,I=p.height/y,R=pi(this,gs).unproject.bind(pi(this,gs)),N=R([0,0]),$=R([b,0]),l=R([0,I]),se=R([b,I]);pi(this,Ha).geometry.coordinates=[[l.toArray(),se.toArray(),$.toArray(),N.toArray(),l.toArray()]],this.map.getSource("parentRect").setData(pi(this,Ha))};oh=new WeakSet;Df=function(){const{pitchAdjust:y}=pi(this,Kr),p=()=>{N("parent")},b=()=>{N("minimap")},I=()=>{pi(this,gs).on("move",p),this.map.on("move",b)},R=()=>{pi(this,gs).off("move",p),this.map.off("move",b)},N=$=>{var l;R();const se=$==="parent"?pi(this,gs):this.map,X=$==="parent"?this.map:pi(this,gs),ge=se.getCenter(),ve=se.getZoom()+((l=pi(this,Kr).zoomAdjust)!=null?l:-4)*($==="parent"?1:-1),pe=se.getBearing(),Re=se.getPitch();X.jumpTo({center:ge,zoom:ve,bearing:pe,pitch:y?Re:0}),Wr(this,Xr,bo).call(this),I()};return I(),()=>{R()}};var Jy=Object.defineProperty,Qy=Object.defineProperties,ev=Object.getOwnPropertyDescriptors,Cp=Object.getOwnPropertySymbols,tv=Object.prototype.hasOwnProperty,iv=Object.prototype.propertyIsEnumerable,sh=(y,p,b)=>p in y?Jy(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,nv=(y,p)=>{for(var b in p||(p={}))tv.call(p,b)&&sh(y,b,p[b]);if(Cp)for(var b of Cp(p))iv.call(p,b)&&sh(y,b,p[b]);return y},rv=(y,p)=>Qy(y,ev(p)),qs=(y,p,b)=>(sh(y,typeof p!="symbol"?p+"":p,b),b),_s=(y,p,b)=>new Promise((I,R)=>{var N=se=>{try{l(b.next(se))}catch(X){R(X)}},$=se=>{try{l(b.throw(se))}catch(X){R(X)}},l=se=>se.done?I(se.value):Promise.resolve(se.value).then(N,$);l((b=b.apply(y,p)).next())});const ov={POINT:"POINT",COUNTRY:"COUNTRY"};let Rf=class extends Qt.Map{constructor(p){var b,I,R;p.apiKey&&(Yr.apiKey=p.apiKey);const N=Sp(p.style),$=location.hash;Yr.apiKey||console.warn("MapTiler Cloud API key is not set. Visit https://maptiler.com and try Cloud for free!"),super(rv(nv({},p),{style:N,maplibreLogo:!1,transformRequest:Tp(p.transformRequest)})),qs(this,"isTerrainEnabled",!1),qs(this,"terrainExaggeration",1),qs(this,"primaryLanguage"),qs(this,"terrainGrowing",!1),qs(this,"terrainFlattening",!1),qs(this,"minimap"),qs(this,"forceLanguageUpdate"),qs(this,"languageAlwaysBeenStyle"),qs(this,"isReady",!1),this.primaryLanguage=(b=p.language)!=null?b:Yr.primaryLanguage,this.forceLanguageUpdate=!(this.primaryLanguage===di.STYLE||this.primaryLanguage===di.STYLE_LOCK),this.languageAlwaysBeenStyle=this.primaryLanguage===di.STYLE,this.terrainExaggeration=(I=p.terrainExaggeration)!=null?I:this.terrainExaggeration,this.once("styledata",()=>_s(this,null,function*(){if(!p.geolocate||p.center||p.hash&&$)return;try{if(p.geolocate===ov.COUNTRY){yield this.fitToIpBounds();return}}catch(Re){console.warn(Re.message)}let ve;try{yield this.centerOnIpPoint(p.zoom),ve=this.getCameraHash()}catch(Re){console.warn(Re.message)}(yield navigator.permissions.query({name:"geolocation"})).state==="granted"&&navigator.geolocation.getCurrentPosition(Re=>{ve===this.getCameraHash()&&(this.terrain?this.easeTo({center:[Re.coords.longitude,Re.coords.latitude],zoom:p.zoom||12,duration:2e3}):this.once("terrain",()=>{this.easeTo({center:[Re.coords.longitude,Re.coords.latitude],zoom:p.zoom||12,duration:2e3})}))},null,{maximumAge:24*3600*1e3,timeout:5e3,enableHighAccuracy:!1})})),this.on("styledata",()=>{this.setPrimaryLanguage(this.primaryLanguage)}),this.on("styledata",()=>{this.getTerrain()===null&&this.isTerrainEnabled&&this.enableTerrain(this.terrainExaggeration)}),this.once("load",()=>_s(this,null,function*(){wy()})),this.once("load",()=>_s(this,null,function*(){let ve={logo:null};try{const pe=Object.keys(this.style.sourceCaches).map(ze=>this.getSource(ze)).filter(ze=>ze&&"url"in ze&&typeof ze.url=="string"&&(ze==null?void 0:ze.url.includes("tiles.json"))),Re=new URL(pe[0].url);Re.searchParams.has("key")||Re.searchParams.append("key",Yr.apiKey),ve=yield(yield fetch(Re.href)).json()}catch(pe){}if(p.forceNoAttributionControl!==!0)if("logo"in ve&&ve.logo){const pe=ve.logo;this.addControl(new yp({logoURL:pe}
587),p.logoPosition),p.attributionControl===!1&&this.addControl(new jy({customAttribution:p.customAttribution}))}else p.maptilerLogo&&this.addControl(new yp,p.logoPosition);if(p.scaleControl){const pe=p.scaleControl===!0||p.scaleControl===void 0?"bottom-right":p.scaleControl,Re=new $y({unit:Yr.unit});this.addControl(Re,pe),Yr.on("unit",ut=>{Re.setUnit(ut)})}if(p.navigationControl!==!1){const pe=p.navigationControl===!0||p.navigationControl===void 0?"top-right":p.navigationControl;this.addControl(new ky,pe)}if(p.geolocateControl!==!1){const pe=p.geolocateControl===!0||p.geolocateControl===void 0?"top-right":p.geolocateControl;this.addControl(new Zy({positionOptions:{enableHighAccuracy:!0,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!0,showAccuracyCircle:!0,showUserLocation:!0}),pe)}if(p.terrainControl){const pe=p.terrainControl===!0||p.terrainControl===void 0?"top-right":p.terrainControl;this.addControl(new Iy,pe)}if(p.fullscreenControl){const pe=p.fullscreenControl===!0||p.fullscreenControl===void 0?"top-right":p.fullscreenControl;this.addControl(new qy({}),pe)}this.isReady=!0,this.fire("ready",{target:this})}));let l=!1,se=!1,X;this.once("ready",()=>{l=!0,se&&this.fire("loadWithTerrain",X)}),this.once("style.load",()=>{var ve;const{minimap:pe}=p;if(typeof pe=="object"){const{zoom:Re,center:ut,style:ze,language:Tt,apiKey:pt,maptilerLogo:zt,antialias:Dt,refreshExpiredTiles:fi,maxBounds:Xe,scrollZoom:_t,minZoom:Qe,maxZoom:at,boxZoom:yt,locale:nt,fadeDuration:xt,crossSourceCollisions:rt,clickTolerance:Pt,bounds:ft,fitBoundsOptions:Ut,pixelRatio:Ct,validateStyle:ni}=p;this.minimap=new $u(pe,{zoom:Re,center:ut,style:ze,language:Tt,apiKey:pt,container:"null",maptilerLogo:zt,antialias:Dt,refreshExpiredTiles:fi,maxBounds:Xe,scrollZoom:_t,minZoom:Qe,maxZoom:at,boxZoom:yt,locale:nt,fadeDuration:xt,crossSourceCollisions:rt,clickTolerance:Pt,bounds:ft,fitBoundsOptions:Ut,pixelRatio:Ct,validateStyle:ni}),this.addControl(this.minimap,(ve=pe.position)!=null?ve:"bottom-left")}else pe===!0?(this.minimap=new $u({},p),this.addControl(this.minimap,"bottom-left")):pe!==void 0&&pe!==!1&&(this.minimap=new $u({},p),this.addControl(this.minimap,pe))});const ge=ve=>{ve.terrain&&(se=!0,X={type:"loadWithTerrain",target:this,terrain:ve.terrain},this.off("terrain",ge),l&&this.fire("loadWithTerrain",X))};this.on("terrain",ge),p.terrain&&this.enableTerrain((R=p.terrainExaggeration)!=null?R:this.terrainExaggeration)}onLoadAsync(){return _s(this,null,function*(){return new Promise(p=>{if(this.loaded())return p(this);this.once("load",()=>{p(this)})})})}onReadyAsync(){return _s(this,null,function*(){return new Promise(p=>{if(this.isReady)return p(this);this.once("ready",()=>{p(this)})})})}onLoadWithTerrainAsync(){return _s(this,null,function*(){return new Promise(p=>{if(this.isReady&&this.terrain)return p(this);this.once("loadWithTerrain",()=>{p(this)})})})}setStyle(p,b){var I;return(I=this.minimap)==null||I.setStyle(p),this.forceLanguageUpdate=!0,this.once("idle",()=>{this.forceLanguageUpdate=!1}),super.setStyle(Sp(p),b)}addLayer(p,b){var I;return(I=this.minimap)==null||I.addLayer(p,b),super.addLayer(p,b)}moveLayer(p,b){var I;return(I=this.minimap)==null||I.moveLayer(p,b),super.moveLayer(p,b)}removeLayer(p){var b;return(b=this.minimap)==null||b.removeLayer(p),super.removeLayer(p)}setLayerZoomRange(p,b,I){var R;return(R=this.minimap)==null||R.setLayerZoomRange(p,b,I),super.setLayerZoomRange(p,b,I)}setFilter(p,b,I){var R;return(R=this.minimap)==null||R.setFilter(p,b,I),super.setFilter(p,b,I)}setPaintProperty(p,b,I,R){var N;return(N=this.minimap)==null||N.setPaintProperty(p,b,I,R),super.setPaintProperty(p,b,I,R)}setLayoutProperty(p,b,I,R){var N;return(N=this.minimap)==null||N.setLayoutProperty(p,b,I,R),super.setLayoutProperty(p,b,I,R)}setGlyphs(p,b){var I;return(I=this.minimap)==null||I.setGlyphs(p,b),super.setGlyphs(p,b)}getStyleLanguage(){return!this.style.stylesheet.metadata||typeof this.style.stylesheet.metadata!="object"?null:"maptiler:language"in this.style.stylesheet.metadata&&typeof this.style.stylesheet.metadata["maptiler:language"]=="str
587ing"?this.style.stylesheet.metadata["maptiler:language"]:null}setLanguage(p){var b,I;(I=(b=this.minimap)==null?void 0:b.map)==null||I.setLanguage(p),this.onStyleReady(()=>{this.setPrimaryLanguage(p)})}setPrimaryLanguage(p){const b=this.getStyleLanguage();if(!(p===di.STYLE&&(b===di.AUTO||b===di.VISITOR))&&(p!==di.STYLE&&(this.languageAlwaysBeenStyle=!1),this.languageAlwaysBeenStyle||this.primaryLanguage===p&&!this.forceLanguageUpdate))return;if(!mp(p)){console.warn(`The language "${p}" is not supported.`);return}if(this.primaryLanguage===di.STYLE_LOCK){console.warn("The language cannot be changed because this map has been instantiated with the STYLE_LOCK language flag.");return}this.primaryLanguage=p;let I=p;if(p===di.STYLE){if(!b){console.warn("The style has no default languages.");return}if(!mp(b)){console.warn("The language defined in the style is not valid.");return}I=b}let R=di.LOCAL,N=`{${R}}`;I==di.VISITOR?(R=_p(),N=["case",["all",["has",R],["has",di.LOCAL]],["case",["==",["get",R],["get",di.LOCAL]],["get",di.LOCAL],["format",["get",R],{"font-scale":.8},`
588`,["get",di.LOCAL],{"font-scale":1.1}]],["get",di.LOCAL]]):I==di.VISITOR_ENGLISH?(R=di.ENGLISH,N=["case",["all",["has",R],["has",di.LOCAL]],["case",["==",["get",R],["get",di.LOCAL]],["get",di.LOCAL],["format",["get",R],{"font-scale":.8},`
589`,["get",di.LOCAL],{"font-scale":1.1}]],["get",di.LOCAL]]):I===di.AUTO?(R=_p(),N=["case",["has",R],["get",R],["get",di.LOCAL]]):I===di.LOCAL?(R=di.LOCAL,N=`{${R}}`):(R=I,N=["case",["has",R],["get",R],["get",di.LOCAL]]);const{layers:$}=this.getStyle();for(const{id:l,layout:se}of $){if(!se||!("text-field"in se))continue;const X=this.getLayoutProperty(l,"text-field");typeof X=="string"&&(X.toLowerCase().includes("ref")||X.toLowerCase().includes("housenumber"))||this.setLayoutProperty(l,"text-field",N)}}getPrimaryLanguage(){return this.primaryLanguage}getTerrainExaggeration(){return this.terrainExaggeration}hasTerrain(){return this.isTerrainEnabled}growTerrain(p,b=1e3){if(!this.terrain)return;const I=performance.now(),R=this.terrain.exaggeration,N=p-R,$=()=>{if(!this.terrain||this.terrainFlattening)return;const l=(performance.now()-I)/b;if(l<.99){const se=1-Math.pow(1-l,4),X=R+se*N;this.terrain.exaggeration=X,requestAnimationFrame($)}else this.terrainGrowing=!1,this.terrainFlattening=!1,this.terrain.exaggeration=p;this.triggerRepaint()};this.terrainGrowing=!0,this.terrainFlattening=!1,requestAnimationFrame($)}enableTerrain(p=this.terrainExaggeration){if(p<0){console.warn("Terrain exaggeration cannot be negative.");return}const b=R=>_s(this,null,function*(){!this.terrain||R.type!=="data"||R.dataType!=="source"||!("source"in R)||R.sourceId!=="maptiler-terrain"||R.source.type!=="raster-dem"||R.isSourceLoaded&&(this.off("data",b),this.growTerrain(p))}),I=()=>{this.isTerrainEnabled=!0,this.terrainExaggeration=p,this.on("data",b),this.addSource(wo.terrainSourceId,{type:"raster-dem",url:wo.terrainSourceURL}),this.setTerrain({source:wo.terrainSourceId,exaggeration:0})};if(this.getTerrain()){this.isTerrainEnabled=!0,this.growTerrain(p);return}this.loaded()||this.isTerrainEnabled?I():this.once("load",()=>{this.getTerrain()&&this.getSource(wo.terrainSourceId)||I()})}disableTerrain(){if(!this.terrain)return;this.isTerrainEnabled=!1;const p=1*1e3,b=performance.now(),I=this.terrain.exaggeration,R=()=>{if(!this.terrain||this.terrainGrowing)return;const N=(performance.now()-b)/p;if(N<.99){const $=Math.pow(1-N,4),l=I*$;this.terrain.exaggeration=l,requestAnimationFrame(R)}else this.terrain.exaggeration=0,this.terrainGrowing=!1,this.terrainFlattening=!1,this.setTerrain(),this.get
589Source(wo.terrainSourceId)&&this.removeSource(wo.terrainSourceId);this.triggerRepaint()};this.terrainGrowing=!1,this.terrainFlattening=!0,requestAnimationFrame(R)}setTerrainExaggeration(p,b=!0){!b&&this.terrain?(this.terrainExaggeration=p,this.terrain.exaggeration=p,this.triggerRepaint()):this.enableTerrain(p)}onStyleReady(p){this.isStyleLoaded()?p():this.once("styledata",()=>{p()})}fitToIpBounds(){return _s(this,null,function*(){const p=yield pp.info();this.fitBounds(p.country_bounds,{duration:0,padding:100})})}centerOnIpPoint(p){return _s(this,null,function*(){var b,I;const R=yield pp.info();this.jumpTo({center:[(b=R==null?void 0:R.longitude)!=null?b:0,(I=R==null?void 0:R.latitude)!=null?I:0],zoom:p||11})})}getCameraHash(){const p=new Float32Array(5),b=this.getCenter();return p[0]=b.lng,p[1]=b.lat,p[2]=this.getZoom(),p[3]=this.getPitch(),p[4]=this.getBearing(),$g.fromUint8Array(new Uint8Array(p.buffer))}getSdkConfig(){return Yr}getMaptilerSessionId(){return Ef}setTransformRequest(p){return super.setTransformRequest(Tp(p)),this}loadImageAsync(p){return _s(this,null,function*(){return new Promise((b,I)=>{this.loadImage(p,(R,N)=>{if(R){I(R);return}b(N)})})})}};class Vv extends Qt.Marker{addTo(p){return super.addTo(p)}}class Zv extends Qt.Popup{addTo(p){return super.addTo(p)}}class jv extends Qt.Style{constructor(p,b={}){super(p,b)}}class $v extends Qt.CanvasSource{onAdd(p){super.onAdd(p)}}class qv extends Qt.GeoJSONSource{onAdd(p){super.onAdd(p)}}class Gv extends Qt.ImageSource{onAdd(p){super.onAdd(p)}}class Hv extends Qt.RasterTileSource{onAdd(p){super.onAdd(p)}}class Wv extends Qt.RasterDEMTileSource{onAdd(p){super.onAdd(p)}}class Kv extends Qt.VectorTileSource{onAdd(p){super.onAdd(p)}}class Xv extends Qt.VideoSource{onAdd(p){super.onAdd(p)}}class Yv extends Qt.TerrainControl{onAdd(p){return super.onAdd(p)}}var sv=Object.defineProperty,Mp=Object.getOwnPropertySymbols,av=Object.prototype.hasOwnProperty,lv=Object.prototype.propertyIsEnumerable,kp=(y,p,b)=>p in y?sv(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,Ya=(y,p)=>{for(var b in p||(p={}))av.call(p,b)&&kp(y,b,p[b]);if(Mp)for(var b of Mp(p))lv.call(p,b)&&kp(y,b,p[b]);return y};function dh(y){if(typeof DOMParser!="undefined"){const p=new DOMParser().parseFromString(y,"application/xml");if(p.querySelector("parsererror"))throw new Error("The provided string is not valid XML");return p}else throw new Error("No XML parser found")}function Bf(y,p){if(!y.hasChildNodes())return!1;for(const b of Array.from(y.childNodes)){const I=b.nodeName;if(typeof I=="string"&&I.trim().toLowerCase()===p.toLowerCase())return!0}return!1}function zp(y){if(typeof XMLSerializer!="undefined")return new XMLSerializer().serializeToString(y);throw new Error("No XML serializer found")}function Of(y){if(typeof y=="string"&&(y=dh(y)),!Bf(y,"gpx"))throw new Error("The XML document is not valid GPX");const p=Rn(y,"trk"),b=Rn(y,"rte"),I=Rn(y,"wpt"),R={type:"FeatureCollection",features:[]};for(const N of Array.from(p)){const $=dv(N);$&&R.features.push($)}for(const N of Array.from(b)){const $=pv(N);$&&R.features.push($)}for(const N of Array.from(I))R.features.push(fv(N));return R}function Ff(y,p){var b;if(typeof y=="string"&&(y=dh(y)),!Bf(y,"kml"))throw new Error("The XML document is not valid KML");const I={type:"FeatureCollection",features:[]},R={},N={},$={},l=Rn(y,"Placemark"),se=Rn(y,"Style"),X=Rn(y,"StyleMap");for(const ge of Array.from(se)){const ve=Rp(p!==void 0?p(ge):zp(ge)).toString(16);R["#"+Wa(ge,"id")]=ve,N[ve]=ge}for(const ge of Array.from(X)){R["#"+Wa(ge,"id")]=Rp(p!==void 0?p(ge):zp(ge)).toString(16);const ve=Rn(ge,"Pair"),pe={};for(const Re of Array.from(ve))pe[(b=Li(jt(Re,"key")))!=null?b:""]=Li(jt(Re,"styleUrl"));$["#"+Wa(ge,"id")]=pe}for(const ge of Array.from(l))I.features=I.features.concat(hv(ge,R,N,$));return I}function Dp(y){if(y===null)return["#000000",1];let p="",b=1;return y.substring(0,1)==="#"&&(y=y.substring(1)),(y.length===6||y.length===3)&&(p=y),y.length===8&&(b=parseInt(y.substring(0,2),16)/255,p="#"+y.substring(6,8)+y.substring(4,6)+y.substring(2,4)),[p!=null?p:"#000000",b!=null?b:1]}function cv(y){return Vf(y.split(" "))}function uv(y){var p;let b=Rn(y,"coord");const I=[],R=[];b.length===0&&(b=Rn(y,"gx:coord"));for(const $ of Array.from(b))I.push(cv((p=Li($))!=null?p:""));const N=Rn(y,"when");for(const $ of Array.from(N))R.push(Li($));return{coords:I,times:R}}function Zc(y){var p,b,I;const R=["Polygon","LineString","Point","Track","gx:Track"];let N,$,l,se,X;const ge=[],ve=[];
589if(jt(y,"MultiGeometry")!==null)return Zc(jt(y,"MultiGeometry"));if(jt(y,"MultiTrack")!==null)return Zc(jt(y,"MultiTrack"));if(jt(y,"gx:MultiTrack")!==null)return Zc(jt(y,"gx:MultiTrack"));for(l=0;l<R.length;l++)if($=Rn(y,R[l]),$){for(se=0;se<$.length;se++)if(N=$[se],R[l]==="Point")ge.push({type:"Point",coordinates:Zf((p=Li(jt(N,"coordinates")))!=null?p:"")});else if(R[l]==="LineString")ge.push({type:"LineString",coordinates:Op((b=Li(jt(N,"coordinates")))!=null?b:"")});else if(R[l]==="Polygon"){const pe=Rn(N,"LinearRing"),Re=[];for(X=0;X<pe.length;X++)Re.push(Op((I=Li(jt(pe[X],"coordinates")))!=null?I:""));ge.push({type:"Polygon",coordinates:Re})}else if(R[l]==="Track"||R[l]==="gx:Track"){const pe=uv(N);ge.push({type:"LineString",coordinates:pe.coords}),pe.times.length&&ve.push(pe.times)}}return{geoms:ge,coordTimes:ve}}function hv(y,p,b,I){var R,N,$,l,se,X,ge,ve,pe,Re;const ut=Zc(y),ze={},Tt=Li(jt(y,"name")),pt=Li(jt(y,"address")),zt=Li(jt(y,"description")),Dt=jt(y,"TimeSpan"),fi=jt(y,"TimeStamp"),Xe=jt(y,"ExtendedData"),_t=jt(y,"visibility");let Qe,at=Li(jt(y,"styleUrl")),yt=jt(y,"LineStyle"),nt=jt(y,"PolyStyle");if(!ut.geoms.length)return[];if(Tt&&(ze.name=Tt),pt&&(ze.address=pt),at){at[0]!=="#"&&(at="#"+at),ze.styleUrl=at,p[at]&&(ze.styleHash=p[at]),I[at]&&(ze.styleMapHash=I[at],ze.styleHash=p[(R=I[at].normal)!=null?R:""]);const rt=b[(N=ze.styleHash)!=null?N:""];if(rt){yt||(yt=jt(rt,"LineStyle")),nt||(nt=jt(rt,"PolyStyle"));const Pt=jt(rt,"IconStyle");if(Pt){const ft=jt(Pt,"Icon");if(ft){const Ut=Li(jt(ft,"href"));Ut&&(ze.icon=Ut)}}}}if(zt&&(ze.description=zt),Dt){const rt=Li(jt(Dt,"begin")),Pt=Li(jt(Dt,"end"));rt&&Pt&&(ze.timespan={begin:rt,end:Pt})}if(fi!==null&&(ze.timestamp=($=Li(jt(fi,"when")))!=null?$:new Date().toISOString()),yt!==null){const rt=Dp(Li(jt(yt,"color"))),Pt=rt[0],ft=rt[1],Ut=parseFloat((l=Li(jt(yt,"width")))!=null?l:"");Pt&&(ze.stroke=Pt),isNaN(ft)||(ze["stroke-opacity"]=ft),isNaN(Ut)||(ze["stroke-width"]=Ut)}if(nt){const rt=Dp(Li(jt(nt,"color"))),Pt=rt[0],ft=rt[1],Ut=Li(jt(nt,"fill")),Ct=Li(jt(nt,"outline"));Pt&&(ze.fill=Pt),isNaN(ft)||(ze["fill-opacity"]=ft),Ut&&(ze["fill-opacity"]=Ut==="1"?ze["fill-opacity"]||1:0),Ct&&(ze["stroke-opacity"]=Ct==="1"?ze["stroke-opacity"]||1:0)}if(Xe){const rt=Rn(Xe,"Data"),Pt=Rn(Xe,"SimpleData");for(Qe=0;Qe<rt.length;Qe++)ze[(se=rt[Qe].getAttribute("name"))!=null?se:""]=(X=Li(jt(rt[Qe],"value")))!=null?X:"";for(Qe=0;Qe<Pt.length;Qe++)ze[(ge=Pt[Qe].getAttribute("name"))!=null?ge:""]=(ve=Li(Pt[Qe]))!=null?ve:""}_t!==null&&(ze.visibility=(pe=Li(_t))!=null?pe:""),ut.coordTimes.length!==0&&(ze.coordTimes=ut.coordTimes.length===1?ut.coordTimes[0]:ut.coordTimes);const xt={type:"Feature",geometry:ut.geoms.length===1?ut.geoms[0]:{type:"GeometryCollection",geometries:ut.geoms},properties:ze};return Wa(y,"id")&&(xt.id=(Re=Wa(y,"id"))!=null?Re:void 0),[xt]}function Nf(y,p){const b=Rn(y,p),I=[],R=[];let N=[];const $=b.length;if(!($<2)){for(let l=0;l<$;l++){const se=jf(b[l]);I.push(se.coordinates),se.time&&R.push(se.time),(se.heartRate||N.length)&&(N.length===0&&(N=new Array(l).fill(null)),N.push(se.heartRate))}return{line:I,times:R,heartRates:N}}}function dv(y){const p=Rn(y,"trkseg"),b=[],I=[],R=[];let N;for(let l=0;l<p.length;l++)if(N=Nf(p[l],"trkpt"),N!==void 0&&(N.line&&b.push(N.line),N.times&&N.times.length&&I.push(N.times),R.length||N.heartRates&&N.heartRates.length)){if(!R.length)for(let se=0;se<l;se++)R.push(new Array(b[se].length).fill(null));N.heartRates&&N.heartRates.length?R.push(N.heartRates):R.push(new Array(N.line.length).fill(null))}if(b.length===0)return;const $=Ya(Ya({},ph(y)),Uf(jt(y,"extensions")));return I.length!==0&&($.coordTimes=b.length===1?I[0]:I),R.length!==0&&($.heartRates=b.length===1?R[0]:R),b.length===1?{type:"Feature",properties:$,geometry:{type:"LineString",coordinates:b[0]}}:{type:"Feature",properties:$,geometry:{type:"MultiLineString",coordinates:b}}}function pv(y){const p=Nf(y,"rtept");return p===void 0?void 0:{type:"Feature",properties:Ya(Ya({},ph(y)),Uf(jt(y,"extensions"))),geometry:{type:"LineString",coordinates:p.line}}}function fv(y){return{type:"Feature",properties:Ya(Ya({},ph(y)),ah(y,["sym"])),geometry:{type:"Point",coordinates:jf(y).coordinates}}}function Uf(y){var p,b;const I={};if(y){const R=jt(y,"line");if(R){const N=Li(jt(R,"color")),$=parseFloat((p=Li(jt(R,"opacity")))!=null?p:"0"),l=parseFloat((b=Li(jt(R,"width")))!=null?b:"0");N&&(I.stroke=N),isNaN($)||(I["stroke-opacity"]=$),isNaN(l)||(I["stroke-width"]=l*96/25.4)}}return I}function ph(y){const p=ah(y,["name","cmt","desc","type","time","keywords"]),b=Rn(y,"link");if(b.length!==0){p.links=[];for(const I of Array.from(b)){const R=Ya({href:Wa(I,"href")},ah(I,["text","type"]));p.links.push(R)}}return p}function Rp(y){let p=0;if(!y||!y.length)return p;for(let b=0;b<y.length;b++)p=(p<<5)-p+y.charCodeAt(b)|0;return p}function Rn(y,p){return y.getElementsByTagName(p)}function Wa(y,p){return y.getAttribute(p)}function Bp(y,p){var b;return parseFloat((b=Wa(y,p))!=null?b:"0")}function jt(y,p){const b=Rn(y,p);return b.length?b[0]:null}function mv(y){return y.normalize&&y.normalize(),y}function Vf(y){return y.map(parseFloat).map(p=>isNaN(p)?null:p)}function Li(y){return y&&mv(y),y&&y.textContent}function ah(y,p){var b;const I={};let R,N;for(N=0;N<p.length;N++)R=jt(y,p[N]),R&&(I[p[N]]=(b=Li(R))!=null?b:"");return I}function Zf(y){return Vf(y.replace(/\s*/g,"").split(","))}function Op(y){const p=y.replace(/^\s*|\s*$/g,"").split(/\s+/),b=[];for(const I of p)b.push(Zf(I));return b}function jf(y){var p,b;const I=[Bp(y,"lon"),Bp(y,"lat")],R=jt(y,"ele"),N=jt(y,"gpxtpx:hr")||jt(y,"hr"),$=jt(y,"time");let l;return R&&(l=parseFloat((p=Li(R))!=null?p:"0"),isNaN(l)||I.push(l)),{coordinates:I,time:$?Li($):null,heartRate:N!==null?parseFloat((b=Li(N))!=null?b:"0"):null}}function _v(y){try{typeof y=="string"&&(y=dh(y))}catch(p){return null}try{return Of(y)}catch(p){}try{return Ff(y)}catch(p){}return null}var gv=Object.defineProperty,yv=(y,p,b)=>p in y?gv(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,Fp=(y,p,b)=>(yv(y,typeof p!="symbol"?p+"":p,b),b);function Bc(y){const p=y.toString(16);return p.length==1?"0"+p:p}function vv(y){return"#"+Bc(y[0])+Bc(y[1])+Bc(y[2])+(y.length===4?Bc(y[3]):"")}class bt extends Array{constructor(p={}){super(),Fp(this,"min",0),Fp(this,"max",1),"min"in p&&(this.min=p.min),"max"in p&&(this.max=p.max),"stops"in p&&this.setStops(p.stops,{clone:!1})}static fromArrayDefinition(p){return new bt({stops:p.map(b=>({value:b[0],color:b[1]}))})}setStops(p,b={clone:!0}){const I=b.clone?this.clone():this;I.length=0;let R=1/0,N=-1/0;for(let $=0;$<p.length;$+=1)R=Math.min(R,p[$].value),N=Math.max(N,p[$].value),I.push({value:p[$].value,color:p[$].color.slice()});return I.sort(($,l)=>$.value<l.value?-1:1),this.min=R,this.max=N,I}scale(p,b,I={clone:!0}){const R=I.clone,N=this[0].value,l=this.at(-1).value-N,se=b-p,X=[];for(let ge=0;ge<this.length;ge+=1){const Re=(this[ge].value-N)/l*se+p;R?X.push({value:Re,color:this[ge].color.slice()}):this[ge].value=Re}return R?new bt({stops:X}):this}at(p){return p<0?this[this.length+p]:this[p]}clone(){return new bt({stops:this.getRawColorStops()})}getRawColorStops(){const p=[];for(let b=0;b<this.length;b+=1)p.push({value:this[b].value,color:this[b].color});return p}reverse(p={clone:!0}){const b=p.clone?this.clone():this;for(let I=0;I<~~(b.length/2);I+=1){const R=b[I].color;b[I].color=b.at(-(I+1)).color,b.at(-(I+1)).color=R}return b}getBounds(){return{min:this.min,max:this.max}}getColor(p,b={smooth:!0}){if(p<=this[0].value)return this[0].color;if(p>=this.at(-1).value)return this.at(-1).color;for(let I=0;I<this.length-1;I+=1){if(p>this[I+1].value)continue;const R=this[I].color;if(!b.smooth)return R.slice();const N=this[I].value,$=this[I+1].value,l=this[I+1].color,se=($-p)/($-N);return R.map((X,ge)=>Math.round(X*se+l[ge]*(1-se)))}return[0,0,0]}getColorHex(p,b={smooth:!0,withAlpha:!1}){return vv(this.getColor(p,b))}getColorRelative(p,b={smooth:!0}){const I=this.getBounds();return this.getColor(I.min+p*(I.max-I.min),b)}getCanvasStrip(p={horizontal:!0,size:512,smooth:!0}){const b=document.createElement("canvas");b.width=p.horizontal?p.size:1,b.height=p.horizontal?1:p.size;const I=b.getContext("2d");if(!I)throw new Error("Canvs context is missing");const R=I.getImageData(0,0,b.width,b.height),N=R.data,$=p.size,l=this[0].value,ge=(this.at(-1).value-l)/$;for(let ve=0;ve<$;ve+=1){const pe=this.getColor(l+ve*ge,{smooth:p.smooth});N[ve*4]=pe[0],N[ve*4+1]=pe[1],N[ve*4+2]=pe[2],N[ve*4+3]=pe.length>3?pe[3]:255}return I.putImageData(R,0,0),b}resample(p,b=15){const I=this.getBounds(),R=this.scale(0,1),N=1/(b-1);let $;if(p==="ease-in-square")$=Array.from({length:b},(X,ge)=>
589{const ve=ge*N,pe=Math.pow(ve,2),Re=R.getColor(pe);return{value:ve,color:Re}});else if(p==="ease-out-square")$=Array.from({length:b},(X,ge)=>{const ve=ge*N,pe=1-Math.pow(1-ve,2),Re=R.getColor(pe);return{value:ve,color:Re}});else if(p==="ease-out-sqrt")$=Array.from({length:b},(X,ge)=>{const ve=ge*N,pe=Math.pow(ve,.5),Re=R.getColor(pe);return{value:ve,color:Re}});else if(p==="ease-in-sqrt")$=Array.from({length:b},(X,ge)=>{const ve=ge*N,pe=1-Math.pow(1-ve,.5),Re=R.getColor(pe);return{value:ve,color:Re}});else if(p==="ease-out-exp")$=Array.from({length:b},(X,ge)=>{const ve=ge*N,pe=1-Math.pow(2,-10*ve),Re=R.getColor(pe);return{value:ve,color:Re}});else if(p==="ease-in-exp")$=Array.from({length:b},(X,ge)=>{const ve=ge*N,pe=Math.pow(2,10*ve-10),Re=R.getColor(pe);return{value:ve,color:Re}});else throw new Error("Invalid ressampling method.");return new bt({stops:$}).scale(I.min,I.max)}transparentStart(){const p=this.getRawColorStops();return p.unshift({value:p[0].value,color:p[0].color.slice()}),p[1].value+=.001,p.forEach(b=>{b.color.length===3&&b.color.push(255)}),p[0].color[3]=0,new bt({stops:p})}hasTransparentStart(){return this[0].color.length===4&&this[0].color[3]===0}}const $f={NULL:new bt({stops:[{value:0,color:[0,0,0,0]},{value:1,color:[0,0,0,0]}]}),GRAY:new bt({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),JET:new bt({stops:[{value:0,color:[0,0,131]},{value:.125,color:[0,60,170]},{value:.375,color:[5,255,255]},{value:.625,color:[255,255,0]},{value:.875,color:[250,0,0]},{value:1,color:[128,0,0]}]}),HSV:new bt({stops:[{value:0,color:[255,0,0]},{value:.169,color:[253,255,2]},{value:.173,color:[247,255,2]},{value:.337,color:[0,252,4]},{value:.341,color:[0,252,10]},{value:.506,color:[1,249,255]},{value:.671,color:[2,0,253]},{value:.675,color:[8,0,253]},{value:.839,color:[255,0,251]},{value:.843,color:[255,0,245]},{value:1,color:[255,0,6]}]}),HOT:new bt({stops:[{value:0,color:[0,0,0]},{value:.3,color:[230,0,0]},{value:.6,color:[255,210,0]},{value:1,color:[255,255,255]}]}),SPRING:new bt({stops:[{value:0,color:[255,0,255]},{value:1,color:[255,255,0]}]}),SUMMER:new bt({stops:[{value:0,color:[0,128,102]},{value:1,color:[255,255,102]}]}),AUTOMN:new bt({stops:[{value:0,color:[255,0,0]},{value:1,color:[255,255,0]}]}),WINTER:new bt({stops:[{value:0,color:[0,0,255]},{value:1,color:[0,255,128]}]}),BONE:new bt({stops:[{value:0,color:[0,0,0]},{value:.376,color:[84,84,116]},{value:.753,color:[169,200,200]},{value:1,color:[255,255,255]}]}),COPPER:new bt({stops:[{value:0,color:[0,0,0]},{value:.804,color:[255,160,102]},{value:1,color:[255,199,127]}]}),GREYS:new bt({stops:[{value:0,color:[0,0,0]},{value:1,color:[255,255,255]}]}),YIGNBU:new bt({stops:[{value:0,color:[8,29,88]},{value:.125,color:[37,52,148]},{value:.25,color:[34,94,168]},{value:.375,color:[29,145,192]},{value:.5,color:[65,182,196]},{value:.625,color:[127,205,187]},{value:.75,color:[199,233,180]},{value:.875,color:[237,248,217]},{value:1,color:[255,255,217]}]}),GREENS:new bt({stops:[{value:0,color:[0,68,27]},{value:.125,color:[0,109,44]},{value:.25,color:[35,139,69]},{value:.375,color:[65,171,93]},{value:.5,color:[116,196,118]},{value:.625,color:[161,217,155]},{value:.75,color:[199,233,192]},{value:.875,color:[229,245,224]},{value:1,color:[247,252,245]}]}),YIORRD:new bt({stops:[{value:0,color:[128,0,38]},{value:.125,color:[189,0,38]},{value:.25,color:[227,26,28]},{value:.375,color:[252,78,42]},{value:.5,color:[253,141,60]},{value:.625,color:[254,178,76]},{value:.75,color:[254,217,118]},{value:.875,color:[255,237,160]},{value:1,color:[255,255,204]}]}),BLUERED:new bt({stops:[{value:0,color:[0,0,255]},{value:1,color:[255,0,0]}]}),RDBU:new bt({stops:[{value:0,color:[5,10,172]},{value:.35,color:[106,137,247]},{value:.5,color:[190,190,190]},{value:.6,color:[220,170,132]},{value:.7,color:[230,145,90]},{value:1,color:[178,10,28]}]}),PICNIC:new bt({stops:[{value:0,color:[0,0,255]},{value:.1,color:[51,153,255]},{value:.2,color:[102,204,255]},{value:.3,color:[153,204,255]},{value:.4,color:[204,204,255]},{value:.5,color:[255,255,255]},{value:.6,color:[255,204,255]},{value:.7,color:[255,153,255]},{value:.8,color:[255,102,204]},{value:.9,color:[255,102,102]},{value:1,color:[255,0,0]}]}),RAINBOW:new bt({stops:[{value:0,color:[150,0,90]},{value:.125,color:[0,0,200]},{value:.25,color:[0,25,255]},{value:.375,color:[0,152,255]},{value:.5,color:[44,255,150]},{value:.625,color:[151,255,0]}
589,{value:.75,color:[255,234,0]},{value:.875,color:[255,111,0]},{value:1,color:[255,0,0]}]}),PORTLAND:new bt({stops:[{value:0,color:[12,51,131]},{value:.25,color:[10,136,186]},{value:.5,color:[242,211,56]},{value:.75,color:[242,143,56]},{value:1,color:[217,30,30]}]}),BLACKBODY:new bt({stops:[{value:0,color:[0,0,0]},{value:.2,color:[230,0,0]},{value:.4,color:[230,210,0]},{value:.7,color:[255,255,255]},{value:1,color:[160,200,255]}]}),EARTH:new bt({stops:[{value:0,color:[0,0,130]},{value:.1,color:[0,180,180]},{value:.2,color:[40,210,40]},{value:.4,color:[230,230,50]},{value:.6,color:[120,70,20]},{value:1,color:[255,255,255]}]}),ELECTRIC:new bt({stops:[{value:0,color:[0,0,0]},{value:.15,color:[30,0,100]},{value:.4,color:[120,0,100]},{value:.6,color:[160,90,0]},{value:.8,color:[230,200,0]},{value:1,color:[255,250,220]}]}),VIRIDIS:new bt({stops:[{value:0,color:[68,1,84]},{value:.13,color:[71,44,122]},{value:.25,color:[59,81,139]},{value:.38,color:[44,113,142]},{value:.5,color:[33,144,141]},{value:.63,color:[39,173,129]},{value:.75,color:[92,200,99]},{value:.88,color:[170,220,50]},{value:1,color:[253,231,37]}]}),INFERNO:new bt({stops:[{value:0,color:[0,0,4]},{value:.13,color:[31,12,72]},{value:.25,color:[85,15,109]},{value:.38,color:[136,34,106]},{value:.5,color:[186,54,85]},{value:.63,color:[227,89,51]},{value:.75,color:[249,140,10]},{value:.88,color:[249,201,50]},{value:1,color:[252,255,164]}]}),MAGMA:new bt({stops:[{value:0,color:[0,0,4]},{value:.13,color:[28,16,68]},{value:.25,color:[79,18,123]},{value:.38,color:[129,37,129]},{value:.5,color:[181,54,122]},{value:.63,color:[229,80,100]},{value:.75,color:[251,135,97]},{value:.88,color:[254,194,135]},{value:1,color:[252,253,191]}]}),PLASMA:new bt({stops:[{value:0,color:[13,8,135]},{value:.13,color:[75,3,161]},{value:.25,color:[125,3,168]},{value:.38,color:[168,34,150]},{value:.5,color:[203,70,121]},{value:.63,color:[229,107,93]},{value:.75,color:[248,148,65]},{value:.88,color:[253,195,40]},{value:1,color:[240,249,33]}]}),WARM:new bt({stops:[{value:0,color:[125,0,179]},{value:.13,color:[172,0,187]},{value:.25,color:[219,0,170]},{value:.38,color:[255,0,130]},{value:.5,color:[255,63,74]},{value:.63,color:[255,123,0]},{value:.75,color:[234,176,0]},{value:.88,color:[190,228,0]},{value:1,color:[147,255,0]}]}),COOL:new bt({stops:[{value:0,color:[125,0,179]},{value:.13,color:[116,0,218]},{value:.25,color:[98,74,237]},{value:.38,color:[68,146,231]},{value:.5,color:[0,204,197]},{value:.63,color:[0,247,146]},{value:.75,color:[0,255,88]},{value:.88,color:[40,255,8]},{value:1,color:[147,255,0]}]}),RAINBOW_SOFT:new bt({stops:[{value:0,color:[125,0,179]},{value:.1,color:[199,0,180]},{value:.2,color:[255,0,121]},{value:.3,color:[255,108,0]},{value:.4,color:[222,194,0]},{value:.5,color:[150,255,0]},{value:.6,color:[0,255,55]},{value:.7,color:[0,246,150]},{value:.8,color:[50,167,222]},{value:.9,color:[103,51,235]},{value:1,color:[124,0,186]}]}),BATHYMETRY:new bt({stops:[{value:0,color:[40,26,44]},{value:.13,color:[59,49,90]},{value:.25,color:[64,76,139]},{value:.38,color:[63,110,151]},{value:.5,color:[72,142,158]},{value:.63,color:[85,174,163]},{value:.75,color:[120,206,163]},{value:.88,color:[187,230,172]},{value:1,color:[253,254,204]}]}),CDOM:new bt({stops:[{value:0,color:[47,15,62]},{value:.13,color:[87,23,86]},{value:.25,color:[130,28,99]},{value:.38,color:[171,41,96]},{value:.5,color:[206,67,86]},{value:.63,color:[230,106,84]},{value:.75,color:[242,149,103]},{value:.88,color:[249,193,135]},{value:1,color:[254,237,176]}]}),CHLOROPHYLL:new bt({stops:[{value:0,color:[18,36,20]},{value:.13,color:[25,63,41]},{value:.25,color:[24,91,59]},{value:.38,color:[13,119,72]},{value:.5,color:[18,148,80]},{value:.63,color:[80,173,89]},{value:.75,color:[132,196,122]},{value:.88,color:[175,221,162]},{value:1,color:[215,249,208]}]}),DENSITY:new bt({stops:[{value:0,color:[54,14,36]},{value:.13,color:[89,23,80]},{value:.25,color:[110,45,132]},{value:.38,color:[120,77,178]},{value:.5,color:[120,113,213]},{value:.63,color:[115,151,228]},{value:.75,color:[134,185,227]},{value:.88,color:[177,214,227]},{value:1,color:[230,241,241]}]}),FREESURFACE_BLUE:new bt({stops:[{value:0,color:[30,4,110]},{value:.13,color:[47,14,176]},{value:.25,color:[41,45,236]},{value:.38,color:[25,99,212]},{value:.5,color:[68,131,200]},{value:.63,color:[114,156,197]}
589,{value:.75,color:[157,181,203]},{value:.88,color:[200,208,216]},{value:1,color:[241,237,236]}]}),FREESURFACE_RED:new bt({stops:[{value:0,color:[60,9,18]},{value:.13,color:[100,17,27]},{value:.25,color:[142,20,29]},{value:.38,color:[177,43,27]},{value:.5,color:[192,87,63]},{value:.63,color:[205,125,105]},{value:.75,color:[216,162,148]},{value:.88,color:[227,199,193]},{value:1,color:[241,237,236]}]}),OXYGEN:new bt({stops:[{value:0,color:[64,5,5]},{value:.13,color:[106,6,15]},{value:.25,color:[144,26,7]},{value:.38,color:[168,64,3]},{value:.5,color:[188,100,4]},{value:.63,color:[206,136,11]},{value:.75,color:[220,174,25]},{value:.88,color:[231,215,44]},{value:1,color:[248,254,105]}]}),PAR:new bt({stops:[{value:0,color:[51,20,24]},{value:.13,color:[90,32,35]},{value:.25,color:[129,44,34]},{value:.38,color:[159,68,25]},{value:.5,color:[182,99,19]},{value:.63,color:[199,134,22]},{value:.75,color:[212,171,35]},{value:.88,color:[221,210,54]},{value:1,color:[225,253,75]}]}),PHASE:new bt({stops:[{value:0,color:[145,105,18]},{value:.13,color:[184,71,38]},{value:.25,color:[186,58,115]},{value:.38,color:[160,71,185]},{value:.5,color:[110,97,218]},{value:.63,color:[50,123,164]},{value:.75,color:[31,131,110]},{value:.88,color:[77,129,34]},{value:1,color:[145,105,18]}]}),SALINITY:new bt({stops:[{value:0,color:[42,24,108]},{value:.13,color:[33,50,162]},{value:.25,color:[15,90,145]},{value:.38,color:[40,118,137]},{value:.5,color:[59,146,135]},{value:.63,color:[79,175,126]},{value:.75,color:[120,203,104]},{value:.88,color:[193,221,100]},{value:1,color:[253,239,154]}]}),TEMPERATURE:new bt({stops:[{value:0,color:[4,35,51]},{value:.13,color:[23,51,122]},{value:.25,color:[85,59,157]},{value:.38,color:[129,79,143]},{value:.5,color:[175,95,130]},{value:.63,color:[222,112,101]},{value:.75,color:[249,146,66]},{value:.88,color:[249,196,65]},{value:1,color:[232,250,91]}]}),TURBIDITY:new bt({stops:[{value:0,color:[34,31,27]},{value:.13,color:[65,50,41]},{value:.25,color:[98,69,52]},{value:.38,color:[131,89,57]},{value:.5,color:[161,112,59]},{value:.63,color:[185,140,66]},{value:.75,color:[202,174,88]},{value:.88,color:[216,209,126]},{value:1,color:[233,246,171]}]}),VELOCITY_BLUE:new bt({stops:[{value:0,color:[17,32,64]},{value:.13,color:[35,52,116]},{value:.25,color:[29,81,156]},{value:.38,color:[31,113,162]},{value:.5,color:[50,144,169]},{value:.63,color:[87,173,176]},{value:.75,color:[149,196,189]},{value:.88,color:[203,221,211]},{value:1,color:[254,251,230]}]}),VELOCITY_GREEN:new bt({stops:[{value:0,color:[23,35,19]},{value:.13,color:[24,64,38]},{value:.25,color:[11,95,45]},{value:.38,color:[39,123,35]},{value:.5,color:[95,146,12]},{value:.63,color:[152,165,18]},{value:.75,color:[201,186,69]},{value:.88,color:[233,216,137]},{value:1,color:[255,253,205]}]}),CUBEHELIX:new bt({stops:[{value:0,color:[0,0,0]},{value:.07,color:[22,5,59]},{value:.13,color:[60,4,105]},{value:.2,color:[109,1,135]},{value:.27,color:[161,0,147]},{value:.33,color:[210,2,142]},{value:.4,color:[251,11,123]},{value:.47,color:[255,29,97]},{value:.53,color:[255,54,69]},{value:.6,color:[255,85,46]},{value:.67,color:[255,120,34]},{value:.73,color:[255,157,37]},{value:.8,color:[241,191,57]},{value:.87,color:[224,220,93]},{value:.93,color:[218,241,142]},{value:1,color:[227,253,198]}]}),CIVIDIS:new bt({stops:[{value:0,color:[0,32,77,255]},{value:.125,color:[5,54,110,255]},{value:.25,color:[65,77,108,255]},{value:.375,color:[97,100,111,255]},{value:.5,color:[125,124,121,255]},{value:.625,color:[156,149,120,255]},{value:.75,color:[190,175,111,255]},{value:.875,color:[225,204,94,255]},{value:1,color:[255,235,70,255]}]}),TURBO:new bt({stops:[{value:0,color:[48,18,59,255]},{value:.125,color:[70,107,227,255]},{value:.25,color:[40,187,236,255]},{value:.375,color:[49,242,153,255]},{value:.5,color:[162,252,60,255]},{value:.625,color:[237,208,58,255]},{value:.75,color:[251,128,34,255]},{value:.875,color:[210,49,5,255]},{value:1,color:[122,4,3,255]}]}),ROCKET:new bt({stops:[{value:0,color:[250,235,221,0]},{value:.133,color:[250,235,221,255]},{value:.266,color:[246,170,130,255]},{value:.4,color:[240,96,67,255]},{value:.533,color:[203,27,79,255]},{value:.666,color:[132,30,90,255]},{value:.8,color:[63,27,68,255]},{value:1,color:[3,5,26,255]}]}),MAKO:new bt({stops:[{value:0,color:[11,4,5,255]},{value:.125,color:[43,28,53,255]},{value:.25,color:[62,53,107,255]},{value:.375,color:[59,86,152,255]},{value:.5,color:[53,123,162,255]},{value:.625,color:[53,158,170,255]}
589,{value:.75,color:[73,193,173,255]},{value:.875,color:[150,221,181,255]},{value:1,color:[222,245,229,255]}]})},Np=[["#1D5B79","#468B97","#EF6262","#F3AA60"],["#614BC3","#33BBC5","#85E6C5","#C8FFE0"],["#461959","#7A316F","#CD6688","#AED8CC"],["#0079FF","#00DFA2","#F6FA70","#FF0060"],["#39B5E0","#A31ACB","#FF78F0","#F5EA5A"],["#37E2D5","#590696","#C70A80","#FBCB0A"],["#FFD36E","#FFF56D","#99FFCD","#9FB4FF"],["#00EAD3","#FFF5B7","#FF449F","#005F99"],["#10A19D","#540375","#FF7000","#FFBF00"]];function fh(){return Np[~~(Math.random()*Np.length)][~~(Math.random()*4)]}function Yc(){return`maptiler_source_${Mf()}`}function Jc(){return`maptiler_layer_${Mf()}`}function Up(y,p){if(p<=y[0].zoom)return y[0].value;if(p>=y[y.length-1].zoom)return y[y.length-1].value;for(let b=0;b<y.length-1;b+=1)if(p>=y[b].zoom&&p<y[b+1].zoom){const I=y[b+1].zoom-y[b].zoom,R=(p-y[b].zoom)/I;return R*y[b+1].value+(1-R)*y[b].value}return 0}function Ka(y){return["interpolate",["linear"],["zoom"],...y.map(p=>[p.zoom,p.value]).flat()]}function Ei(y){return["interpolate",["linear"],["zoom"],...y.map(p=>[p.zoom,p.value]).flat()]}function xv(y,p){if(typeof p=="number"&&typeof y=="number")return 2*p+y;if(typeof p=="number"&&Array.isArray(y))return["interpolate",["linear"],["zoom"],...y.map(b=>[b.zoom,2*p+b.value]).flat()];if(typeof y=="number"&&Array.isArray(p))return["interpolate",["linear"],["zoom"],...p.map(b=>[b.zoom,2*b.value+y]).flat()];if(Array.isArray(y)&&Array.isArray(p)){const b=Array.from(new Set([...y.map(I=>I.zoom),...p.map(I=>I.zoom)])).sort((I,R)=>I<R?-1:1);return["interpolate",["linear"],["zoom"],...b.map(I=>[I,2*Up(p,I)+Up(y,I)]).flat()]}return 0}function bv(y,p){return["interpolate",["linear"],["get",p],...y.map(b=>[b.propertyValue,b.value]).flat()]}function qf(y){const p=y.trimStart(),b=`${p}${" ".repeat(y.length-p.length)}`,I=Array.from(b);if(!I.every(l=>l===" "||l==="_"))throw new Error("A dash pattern must be composed only of whitespace and underscore characters.");if(!(I.some(l=>l==="_")&&I.some(l=>l===" ")))throw new Error("A dash pattern must contain at least one underscore and one whitespace character");const $=[1];for(let l=1;l<I.length;l+=1){const se=I[l-1],X=I[l];se===X?$[$.length-1]+=1:$.push(1)}return $}function Vp(y,p){return["interpolate",["linear"],["get",p],...y.map(b=>[b.value,b.color]).flat()]}function Zp(y,p,b=!0){return b?["interpolate",["linear"],["zoom"],0,["interpolate",["linear"],["get",p],...y.map(I=>[I.value,I.pointRadius*.025]).flat()],2,["interpolate",["linear"],["get",p],...y.map(I=>[I.value,I.pointRadius*.05]).flat()],4,["interpolate",["linear"],["get",p],...y.map(I=>[I.value,I.pointRadius*.1]).flat()],8,["interpolate",["linear"],["get",p],...y.map(I=>[I.value,I.pointRadius*.25]).flat()],16,["interpolate",["linear"],["get",p],...y.map(I=>[I.value,I.pointRadius]).flat()]]:["interpolate",["linear"],["get",p],...y.map(I=>[I.value,I.pointRadius]).flat()]}function wv(y,p,b=!0){return b?["interpolate",["linear"],["zoom"],0,["interpolate",["linear"],["get",p],...y.map(I=>[I.propertyValue,I.value*.025]).flat()],2,["interpolate",["linear"],["get",p],...y.map(I=>[I.propertyValue,I.value*.05]).flat()],4,["interpolate",["linear"],["get",p],...y.map(I=>[I.propertyValue,I.value*.1]).flat()],8,["interpolate",["linear"],["get",p],...y.map(I=>[I.propertyValue,I.value*.25]).flat()],16,["interpolate",["linear"],["get",p],...y.map(I=>[I.propertyValue,I.value]).flat()]]:["interpolate",["linear"],["get",p],...y.map(I=>[I.propertyValue,I.value]).flat()]}function jp(y,p){return y.every(b=>b.color[3]===y[0].color[3])?y[0].color[3]?y[0].color[3]/255:1:["interpolate",["linear"],["get",p],...y.getRawColorStops().map(b=>{const I=b.value,R=b.color;return[I,R.length===4?R[3]/255:1]}).flat()]}function Tv(y,p=10){return["interpolate",["linear"],["heatmap-density"],...Array.from({length:p+1},(b,I)=>{const R=I/p;return[R,y.getColorHex(R)]}).flat()]}var Sv=Object.defineProperty,Av=Object.defineProperties,Pv=Object.getOwnPropertyDescriptors,$p=Object.getOwnPropertySymbols,Iv=Object.prototype.hasOwnProperty,Lv=Object.prototype.propertyIsEnumerable,qp=(y,p,b)=>p in y?Sv(y,p,{enumerable:!0,configurable:!0,writable:!0,value:b}):y[p]=b,Xa=(y,p)=>{for(var b in p||(p={}))Iv.call(p,b)&&qp(y,b,p[b]);if($p)for(var b of $p(p))Lv.call(p,b)&&qp(y,b,p[b]);return y},Ev=(y,p)=>Av(y,Pv(p)),Cv=(y,p,b)=>new Promise((I,R)=>{var N=se=>{try{l(b.next(se))}catch(X){R(X)}},$=se=>{try{l(b.throw(se))}catch(X){R(X)}},l=se=>se.done?I(se.value):Promise.resolve(se.value).then(N,$);l((b=b.apply(y,p)).next())});function Mv(y,p){return Cv(this,arguments,function*(b,I,R={}){var N,$,l;if(!I.sourceId&&!I.data)throw new Error("Creating a polyline layer requires an existing .sourceId or a valid .data property");let se=I.data;if(typeof se=="string"){if(Xc(se))se=`https://api.maptiler.com/data/${I.data}/features.json?key=${Yr.apiKey}`;else if(((N=se.split(".").pop())==null?void 0:N.toLowerCase().trim())==="gpx"){const ge=yield(yield fetch(se,R)).text();se=Of(ge)}else if((($=se.split(".").pop())==null?void 0:$.toLowerCase().trim())==="kml"){const ge=yield(yield fetch(se,R)).text();se=Ff(ge)}else{const X=(l=Sy(se))!=null?l:_v(se);X&&(se=X)}if(!se)throw new Error("Polyline data was provided as string but is incompatible with valid formats.")}return kv(b,Ev(Xa({},I),{data:se}))})}function kv(y,p){var b,I,R,N,$,l,se,X,ge,ve,pe,Re,ut,ze,Tt,pt,zt,Dt,fi,Xe;if(p.layerId&&y.getLayer(p.layerId))throw new Error(`A layer already exists with the layer id: ${p.layerId}`);const _t=(b=p.sourceId)!=null?b:Yc(),Qe=(I=p.layerId)!=null?I:Jc(),at={polylineLayerId:Qe,polylineOutlineLayerId:"",polylineSourceId:_t};p.data&&!y.getSource(_t)&&y.addSource(_t,{type:"geojson",data:p.data});const yt=(R=p.lineWidth)!=null?R:3,nt=(N=p.lineColor)!=null?N:fh(),xt=($=p.lineOpacity)!=null?$:1,rt=(l=p.lineBlur)!=null?l:0,Pt=(se=p.lineGapWidth)!=null?se:0;let ft=(X=p.lineDashArray)!=null?X:null;const Ut=(ge=p.outlineWidth)!=null?ge:1,Ct=(ve=p.outlineColor)!=null?ve:"#FFFFFF",ni=(pe=p.outlineOpacity)!=null?pe
589:1,et=(Re=p.outlineBlur)!=null?Re:0;if(typeof ft=="string"&&(ft=qf(ft)),p.outline===!0){const Ui=`${Qe}_outline`;at.polylineOutlineLayerId=Ui,y.addLayer({id:Ui,type:"line",source:_t,layout:{"line-join":(ut=p.lineJoin)!=null?ut:"round","line-cap":(ze=p.lineCap)!=null?ze:"round"},minzoom:(Tt=p.minzoom)!=null?Tt:0,maxzoom:(pt=p.maxzoom)!=null?pt:23,paint:{"line-opacity":typeof ni=="number"?ni:Ei(ni),"line-color":typeof Ct=="string"?Ct:Ka(Ct),"line-width":xv(yt,Ut),"line-blur":typeof et=="number"?et:Ei(et)}},p.beforeId)}return y.addLayer({id:Qe,type:"line",source:_t,layout:{"line-join":(zt=p.lineJoin)!=null?zt:"round","line-cap":(Dt=p.lineCap)!=null?Dt:"round"},minzoom:(fi=p.minzoom)!=null?fi:0,maxzoom:(Xe=p.maxzoom)!=null?Xe:23,paint:Xa({"line-opacity":typeof xt=="number"?xt:Ei(xt),"line-color":typeof nt=="string"?nt:Ka(nt),"line-width":typeof yt=="number"?yt:Ei(yt),"line-blur":typeof rt=="number"?rt:Ei(rt),"line-gap-width":typeof Pt=="number"?Pt:Ei(Pt)},ft&&{"line-dasharray":ft})},p.beforeId),at}function zv(y,p){var b,I,R,N,$,l,se,X,ge,ve,pe;if(p.layerId&&y.getLayer(p.layerId))throw new Error(`A layer already exists with the layer id: ${p.layerId}`);const Re=(b=p.sourceId)!=null?b:Yc(),ut=(I=p.layerId)!=null?I:Jc(),ze={polygonLayerId:ut,polygonOutlineLayerId:p.outline?`${ut}_outline`:"",polygonSourceId:Re};if(p.data&&!y.getSource(Re)){let nt=p.data;typeof nt=="string"&&Xc(nt)&&(nt=`https://api.maptiler.com/data/${nt}/features.json?key=${Yr.apiKey}`),y.addSource(Re,{type:"geojson",data:nt})}let Tt=(R=p.outlineDashArray)!=null?R:null;const pt=(N=p.outlineWidth)!=null?N:1,zt=($=p.outlineColor)!=null?$:"#FFFFFF",Dt=(l=p.outlineOpacity)!=null?l:1,fi=(se=p.outlineBlur)!=null?se:0,Xe=(X=p.fillColor)!=null?X:fh(),_t=(ge=p.fillOpacity)!=null?ge:1,Qe=(ve=p.outlinePosition)!=null?ve:"center",at=(pe=p.pattern)!=null?pe:null;typeof Tt=="string"&&(Tt=qf(Tt));const yt=(nt=null)=>{var xt,rt,Pt,ft,Ut,Ct;if(y.addLayer({id:ut,type:"fill",source:Re,minzoom:(xt=p.minzoom)!=null?xt:0,maxzoom:(rt=p.maxzoom)!=null?rt:23,paint:Xa({"fill-color":typeof Xe=="string"?Xe:Ka(Xe),"fill-opacity":typeof _t=="number"?_t:Ei(_t)},nt&&{"fill-pattern":nt})},p.beforeId),p.outline===!0){let ni;Qe==="inside"?typeof pt=="number"?ni=.5*pt:ni=Ei(pt.map(({zoom:et,value:Ui})=>({zoom:et,value:.5*Ui}))):Qe==="outside"?typeof pt=="number"?ni=-.5*pt:ni=Ei(pt.map(et=>({zoom:et.zoom,value:-.5*et.value}))):ni=0,y.addLayer({id:ze.polygonOutlineLayerId,type:"line",source:Re,layout:{"line-join":(Pt=p.outlineJoin)!=null?Pt:"round","line-cap":(ft=p.outlineCap)!=null?ft:"butt"},minzoom:(Ut=p.minzoom)!=null?Ut:0,maxzoom:(Ct=p.maxzoom)!=null?Ct:23,paint:Xa({"line-opacity":typeof Dt=="number"?Dt:Ei(Dt),"line-color":typeof zt=="string"?zt:Ka(zt),"line-width":typeof pt=="number"?pt:Ei(pt),"line-blur":typeof fi=="number"?fi:Ei(fi),"line-offset":ni},Tt&&{"line-dasharray":Tt})},p.beforeId)}};return at?y.hasImage(at)?yt(at):y.loadImage(at,(nt,xt)=>{if(nt)return console.error("Could not load the pattern image.",nt.message),yt();if(!xt)return console.error(`An image cannot be created from the pattern URL ${at}.`),yt();y.addImage(at,xt),yt(at)}):yt(),ze}function Dv(y,p){var b,I,R,N,$,l,se,X,ge,ve,pe,Re,ut,ze,Tt,pt;if(p.layerId&&y.getLayer(p.layerId))throw new Error(`A layer already exists with the layer id: ${p.layerId}`);const zt=(b=p.minPointRadius)!=null?b:10,Dt=(I=p.maxPointRadius)!=null?I:50,fi=(R=p.cluster)!=null?R:!1,Xe=20,_t=Array.isArray(p.pointColor)?p.pointColor:$f.TURBO.scale(10,p.cluster?1e4:1e3).resample("ease-out-square"),Qe=_t.getBounds(),at=(N=p.sourceId)!=null?N:Yc(),yt=($=p.layerId)!=null?$:Jc(),nt=(l=p.showLabel)!=null?l:fi,xt=(se=p.alignOnViewport)!=null?se:!0,rt=(X=p.outline)!=null?X:!1,Pt=(ge=p.outlineOpacity)!=null?ge:1,ft=(ve=p.outlineWidth)!=null?ve:1,Ut=(pe=p.outlineColor)!=null?pe:"#FFFFFF";let Ct;const ni=(Re=p.zoomCompensation)!=null?Re:!0,et=(ut=p.minzoom)!=null?ut:0,Ui=(ze=p.maxzoom)!=null?ze:23;typeof p.pointOpacity=="number"?Ct=p.pointOpacity:Array.isArray(p.pointOpacity)?Ct=Ei(p.pointOpacity):p.cluster?Ct=jp(_t,"point_count"):p.property?Ct=jp(_t,p.property):Ct=Ei([{zoom:et,value:0},{zoom:et+.25,value:1},{zoom:Ui-.25,value:1},{zoom:Ui,value:0}]);const mt={pointLayerId:yt,clusterLayerId:"",labelLayerId:"",pointSourceId:at};if(p.data&&!y.getSource(at)){let Mt=p.data;typeof Mt=="string"&&Xc(Mt)&&(Mt=`https://api.maptiler.com/data/${Mt}/features.json?key=${Yr.apiKey}`),y.addSource(at,{type:"geojson",data:Mt,cluster:fi})}if(fi){mt.clusterLayerId=`${yt}_cluster`;const Mt=Array.from({length:Xe},(ci,Lt)=>{const $t=Qe.min+Lt*(Qe.max-Qe.min)/(Xe-1);return{value:$t,pointRadius:zt+(Dt-zt)*Math.pow(Lt/(Xe-1),.5),color:_t.getColorHex($t)}});
589y.addLayer({id:mt.clusterLayerId,type:"circle",source:at,filter:["has","point_count"],paint:Xa({"circle-color":typeof p.pointColor=="string"?p.pointColor:Vp(Mt,"point_count"),"circle-radius":typeof p.pointRadius=="number"?p.pointRadius:Array.isArray(p.pointRadius)?Ei(p.pointRadius):Zp(Mt,"point_count",!1),"circle-pitch-alignment":xt?"viewport":"map","circle-pitch-scale":"map","circle-opacity":Ct},rt&&{"circle-stroke-opacity":typeof Pt=="number"?Pt:Ei(Pt),"circle-stroke-width":typeof ft=="number"?ft:Ei(ft),"circle-stroke-color":typeof Ut=="string"?Ut:Ka(Ut)}),minzoom:et,maxzoom:Ui},p.beforeId),y.addLayer({id:mt.pointLayerId,type:"circle",source:at,filter:["!",["has","point_count"]],paint:Xa({"circle-pitch-alignment":xt?"viewport":"map","circle-pitch-scale":"map","circle-color":typeof p.pointColor=="string"?p.pointColor:_t.getColorHex(_t.getBounds().min),"circle-radius":typeof p.pointRadius=="number"?p.pointRadius:Array.isArray(p.pointRadius)?Ei(p.pointRadius):Mt[0].pointRadius*.75,"circle-opacity":Ct},rt&&{"circle-stroke-opacity":typeof Pt=="number"?Pt:Ei(Pt),"circle-stroke-width":typeof ft=="number"?ft:Ei(ft),"circle-stroke-color":typeof Ut=="string"?Ut:Ka(Ut)}),minzoom:et,maxzoom:Ui},p.beforeId)}else{let Mt=typeof p.pointColor=="string"?p.pointColor:Array.isArray(p.pointColor)?p.pointColor.getColorHex(p.pointColor.getBounds().min):fh(),ci=typeof p.pointRadius=="number"?ni?Ei([{zoom:0,value:p.pointRadius*.025},{zoom:2,value:p.pointRadius*.05},{zoom:4,value:p.pointRadius*.1},{zoom:8,value:p.pointRadius*.25},{zoom:16,value:p.pointRadius*1}]):p.pointRadius:Array.isArray(p.pointRadius)?Ei(p.pointRadius):ni?Ei([{zoom:0,value:zt*.05},{zoom:2,value:zt*.1},{zoom:4,value:zt*.2},{zoom:8,value:zt*.5},{zoom:16,value:zt*1}]):zt;if(p.property&&Array.isArray(p.pointColor)){const Lt=Array.from({length:Xe},($t,qt)=>{const Vt=Qe.min+qt*(Qe.max-Qe.min)/(Xe-1);return{value:Vt,pointRadius:typeof p.pointRadius=="number"?p.pointRadius:zt+(Dt-zt)*Math.pow(qt/(Xe-1),.5),color:typeof p.pointColor=="string"?p.pointColor:_t.getColorHex(Vt)}});Mt=Vp(Lt,p.property),ci=Zp(Lt,p.property,ni)}y.addLayer({id:mt.pointLayerId,type:"circle",source:at,layout:{"circle-sort-key":p.property?["/",1,["get",p.property]]:0},paint:Xa({"circle-pitch-alignment":xt?"viewport":"map","circle-pitch-scale":"map","circle-color":Mt,"circle-opacity":Ct,"circle-radius":ci},rt&&{"circle-stroke-opacity":typeof Pt=="number"?Pt:Ei(Pt),"circle-stroke-width":typeof ft=="number"?ft:Ei(ft),"circle-stroke-color":typeof Ut=="string"?Ut:Ka(Ut)}),minzoom:et,maxzoom:Ui},p.beforeId)}if(nt!==!1&&(p.cluster||p.property)){mt.labelLayerId=`${yt}_label`;const Mt=(Tt=p.labelColor)!=null?Tt:"#fff",ci=(pt=p.labelSize)!=null?pt:12;y.addLayer({id:mt.labelLayerId,type:"symbol",source:at,filter:["has",p.cluster?"point_count":p.property],layout:{"text-field":p.cluster?"{point_count_abbreviated}":`{${p.property}}`,"text-font":["Noto Sans Regular"],"text-size":ci,"text-pitch-alignment":xt?"viewport":"map","symbol-sort-key":["/",1,["get",p.cluster?"point_count":p.property]]},paint:{"text-color":Mt,"text-opacity":Ct},minzoom:et,maxzoom:Ui},p.beforeId)}return mt}function Rv(y,p){var b,I,R,N,$,l,se,X,ge,ve;if(p.layerId&&y.getLayer(p.layerId))throw new Error(`A layer already exists with the layer id: ${p.layerId}`);const pe=(b=p.sourceId)!=null?b:Yc(),Re=(I=p.layerId)!=null?I:Jc(),ut=(R=p.minzoom)!=null?R:0,ze=(N=p.maxzoom)!=null?N:23,Tt=($=p.zoomCompensation)!=null?$:!0,pt=(l=p.opacity)!=null?l:[{zoom:ut,value:0},{zoom:ut+.25,value:1},{zoom:ze-.25,value:1},{zoom:ze,value:0}];let zt=Array.isArray(p.colorRamp)?p.colorRamp:$f.TURBO.transparentStart();const Dt=zt.getBounds();(Dt.min!==0||Dt.max!==1)&&(zt=zt.scale(0,1)),zt.hasTransparentStart()||(zt=zt.transparentStart());const fi=(se=p.intensity)!=null?se:[{zoom:0,value:.01},{zoom:4,value:.2},{zoom:16,value:1}],Xe=(X=p.property)!=null?X:null,_t=(ge=p.weight)!=null?ge:1;let Qe=1;Xe?typeof _t=="number"?(Qe=_t,typeof p.weight=="number"&&console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`")):Array.isArray(_t)?Qe=bv(_t,Xe):console.warn("The option `.property` is ignored when `.propertyValueWeights` is not of type `PropertyValueWeights`"):typeof _t=="number"?Qe=_t:Array.isArray(_t)&&console.warn("The options `.propertyValueWeights` can only be used when `.property` is provided.");const at=[{zoom:0,value:50*.025},{zoom:2,value:50*.05},{zoom:4,value:50*.1},{zoom:8,value:50*.25},{zoom:16,value:50}],yt=(ve=p.radius)!=null?ve:Tt?at:10;let nt=1;typeof yt=="number"?nt=yt:Array.isArray(yt)&&"zoom"in yt[0]?nt=Ei(yt):Xe&&Array.isArray(yt)&&"propertyValue"in yt[0]?nt=wv(yt,Xe,Tt):!Xe&&Array.isArray(yt)&&"propertyValue"in yt[0]?(nt=Ei(at),console.warn("The option `.radius` can only be property-driven if the option `.property` is provided.")):nt=Ei(at);const xt={heatmapLayerId:Re,heatmapSourceId:pe};if(p.data&&!y.getSource(pe)){let rt=p.data;typeof rt=="string"&&Xc(rt)&&(rt=`https://api.maptiler.com/data/${rt}/features.json?key=${Yr.apiKey}`),y.addSource(pe,{type:"geojson",data:rt})}return y.addLayer({id:Re,type:"heatmap",source:pe,minzoom:ut,maxzoom:ze,paint:{"heatmap-weight":Qe,"heatmap-intensity":typeof fi=="number"?fi:Ei(fi),"heatmap-color":Tv(zt),"heatmap-radius":nt,"heatmap-opacity":typeof pt=="number"?pt:Ei(pt)}
589}),xt}const Gp={addPolyline:Mv,addPolygon:zv,addPoint:Dv,addHeatmap:Rv},{setRTLTextPlugin:Jv,getRTLTextPluginStatus:Qv,LngLat:Bv,LngLatBounds:e0,MercatorCoordinate:t0,Evented:i0,AJAXError:n0,prewarm:r0,clearPrewarmedResources:o0,version:s0,workerCount:a0,maxParallelImageRequests:l0,workerUrl:c0,addProtocol:u0,removeProtocol:h0}=Qt;Qt.Map;Qt.Marker;Qt.Popup;Qt.Style;Qt.CanvasSource;Qt.GeoJSONSource;Qt.ImageSource;Qt.RasterTileSource;Qt.RasterDEMTileSource;Qt.VectorTileSource;Qt.VideoSource;Qt.NavigationControl;Qt.GeolocateControl;Qt.AttributionControl;Qt.LogoControl;Qt.ScaleControl;Qt.FullscreenControl;Qt.TerrainControl;function Ov(){wt.MaptilerLayer=wt.Layer.extend({options:{updateInterval:32,padding:.1,interactive:!1,pane:"tilePane"},map:null,initialize:function(y){wt.setOptions(this,y),this._throttledUpdate=wt.Util.throttle(this._update,this.options.updateInterval,this)},onAdd:function(y){this._container||this._initContainer();const p=document.createElement("a");p.href="https://www.maptiler.com",p.style="position:absolute; left:10px; bottom:2px; z-index:999;";const b=document.createElement("img");b.src="https://api.maptiler.com/resources/logo.svg",b.alt="MapTiler logo",b.width="100",b.height="30",p.appendChild(b),y.getContainer().appendChild(p);const I=this.getPaneName();y.getPane(I).appendChild(this._container),this._initMaptilerSDK(),this._offset=this._map.containerPointToLayerPoint([0,0]),y.options.zoomAnimation&&wt.DomEvent.on(y._proxy,wt.DomUtil.TRANSITION_END,this._transitionEnd,this),y.attributionControl.addAttribution('<a href="https://www.maptiler.com/copyright/" target="_blank">&copy; MapTiler</a> <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap contributors</a>')},onRemove:function(y){this._map._proxy&&this._map.options.zoomAnimation&&wt.DomEvent.off(this._map._proxy,wt.DomUtil.TRANSITION_END,this._transitionEnd,this);const p=this.getPaneName();y.getPane(p).removeChild(this._container),this._maptilerMap.remove(),this._maptilerMap=null},getEvents:function(){return{move:this._throttledUpdate,zoomanim:this._animateZoom,zoom:this._pinchZoom,zoomstart:this._zoomStart,zoomend:this._zoomEnd,resize:this._resize}},getMaptilerSDKMap:function(){return this._maptilerMap},getCanvas:function(){return this._maptilerMap.getCanvas()},getSize:function(){return this._map.getSize().multiplyBy(1+this.options.padding*2)},getBounds:function(){const y=this.getSize().multiplyBy(.5),p=this._map.latLngToContainerPoint(this._map.getCenter());return wt.latLngBounds(this._map.containerPointToLatLng(p.subtract(y)),this._map.containerPointToLatLng(p.add(y)))},getContainer:function(){return this._container},getPaneName:function(){return this._map.getPane(this.options.pane)?this.options.pane:"tilePane"},setStyle:function(y){this._maptilerMap.setStyle(y)},setLanguage:function(y){this._maptilerMap.setLanguage(y)},_roundPoint:function(y){return{x:Math.round(y.x),y:Math.round(y.y)}},_initContainer:function(){const y=this._container=wt.DomUtil.create("div","leaflet-gl-layer"),p=this.getSize(),b=this._map.getSize().multiplyBy(this.options.padding);y.style.width=p.x+"px",y.style.height=p.y+"px";const I=this._map.containerPointToLayerPoint([0,0]).subtract(b);wt.DomUtil.setPosition(y,this._roundPoint(I))},_initMaptilerSDK:function(){const y=this._map.getCenter();let p=this.options.style,b=this.options.apiKey;if((typeof this.options.style=="string"||this.options.style instanceof String)&&this.options.style.startsWith("https://api.maptiler.com/maps/"))try{const N=new URL(this.options.style),$=N.searchParams.get("key");$&&(b=$,N.searchParams.delete("key"),p=N.href)}catch(N){console.error(N)}const I={...this.options,style:p,apiKey:b,container:this._container,center:[y.lng,y.lat],zoom:this._map.getZoom()-1,attributionControl:!1};this.options.geolocate&&(delete I.center,delete I.zoom),this._maptilerMap=new Rf(I),this._maptilerMap.once("load",()=>{this.fire("ready")}),this._maptilerMap.transform.freezeElevation=!0,this.options.geolocate&&this._maptilerMap.on("load",()=>
589{this._map.setView(this._maptilerMap.getCenter(),this._maptilerMap.getZoom()+1)}),this._maptilerMap.transform.latRange=null,this._maptilerMap.transform.maxValidLatitude=1/0,this._transformGL(),this._maptilerMap._actualCanvas=this._maptilerMap._canvas;const R=this._maptilerMap._actualCanvas;wt.DomUtil.addClass(R,"leaflet-image-layer"),wt.DomUtil.addClass(R,"leaflet-zoom-animated"),this.options.interactive&&wt.DomUtil.addClass(R,"leaflet-interactive"),this.options.className&&wt.DomUtil.addClass(R,this.options.className),Object.keys(Gp).forEach(N=>{this[N]=$=>Gp[N].apply(null,[this._maptilerMap,$])})},_update:function(){if(this._offset=this._map.containerPointToLayerPoint([0,0]),this._zooming)return;const y=this.getSize(),p=this._map.getSize().multiplyBy(this.options.padding),b=this._map.containerPointToLayerPoint([0,0]).subtract(p);wt.DomUtil.setPosition(this._container,this._roundPoint(b)),this._transformGL(),this._maptilerMap.transform.width!==y.x||this._maptilerMap.transform.height!==y.y?(this._container.style.width=y.x+"px",this._container.style.height=y.y+"px",this._maptilerMap._resize!==null&&this._maptilerMap._resize!==void 0?this._maptilerMap._resize():this._maptilerMap.resize()):this._maptilerMap._update!==null&&this._maptilerMap._update!==void 0?this._maptilerMap._update():this._maptilerMap.update()},_transformGL:function(){const y=this._map.getCenter(),p=this._maptilerMap.transform;p.center=Bv.convert([y.lng,y.lat]),p.zoom=this._map.getZoom()-1},_pinchZoom:function(){this._maptilerMap.jumpTo({zoom:this._map.getZoom()-1,center:this._map.getCenter()})},_animateZoom:function(y){const p=this._map.getZoomScale(y.zoom),b=this._map.getSize().multiplyBy(this.options.padding*p),I=this.getSize()._divideBy(2),R=this._map.project(y.center,y.zoom)._subtract(I)._add(this._map._getMapPanePos().add(b))._round(),N=this._map.project(this._map.getBounds().getNorthWest(),y.zoom)._subtract(R);wt.DomUtil.setTransform(this._maptilerMap._actualCanvas,N.subtract(this._offset),p)},_zoomStart:function(){this._zooming=!0},_zoomEnd:function(){const y=this._map.getZoomScale(this._map.getZoom());wt.DomUtil.setTransform(this._maptilerMap._actualCanvas,null,y),this._zooming=!1,this._update()},_transitionEnd:function(){wt.Util.requestAnimFrame(function(){const y=this._map.getZoom(),p=this._map.getCenter(),b=this._map.latLngToContainerPoint(this._map.getBounds().getNorthWest());wt.DomUtil.setTransform(this._maptilerMap._actualCanvas,b,1),this._maptilerMap.once("moveend",wt.Util.bind(function(){this._zoomEnd()},this)),this._maptilerMap.jumpTo({center:p,zoom:y-1})},this)},_resize:function(y){this._transitionEnd(y)}}),wt.MaptilerLayer,wt.maptilerLayer=function(y){return new wt.MaptilerLayer(y)},wt.maptilerLayer,wt.MaptilerStyle={},Object.keys(th).forEach(y=>{wt.MaptilerStyle[y]=th[y]}),wt.MaptilerStyle,wt.MaptilerStyle,wt.maptilerStyle=wt.MaptilerStyle,wt.MaptilerLanguage={},Object.keys(di).forEach(y=>{wt.MaptilerLanguage[y]=di[y]}),wt.MaptilerLanguage,wt.MaptilerLanguage,wt.maptilerLanguage=wt.MaptilerLanguage}(()=>{try{Ov()}catch(y){console.error(y)}})();CookieConsent.run({guiOptions:{consentModal:{layout:"bar inline",position:"bottom",equalWeightButtons:!0,flipButtons:!1},preferencesModal:{layout:"box",position:"middle center",equalWeightButtons:!0,flipButtons:!0}},categories:{analytics:{readOnly:!0},functionality:{}},language:{default:"de",translations:{de:{consentModal:{title:"Wir respektieren Ihre Privatsphäre",description:'Für ein optimales Website-Erlebnis nutzen wir 
589Cookies und ähnliche Technologien, um personalisierte Inhalte zu zeigen, Funktionen anzubieten und Statistiken zu erheben. Ein Klick auf "Alles akzeptieren" erlaubt uns diese Datenverarbeitung sowie die Weitergabe an Drittanbieter (gemäß unserer Datenschutzerklärung). Cookies lassen sich jederzeit ablehnen oder in den Einstellungen anpassen.',acceptAllBtn:"Alle akzeptieren",acceptNecessaryBtn:"Alle ablehnen",showPreferencesBtn:"Einstellungen verwalten",footer:`<a href="/impressum">Impressum</a>
590<a href="/datenschutz">Datenschutz</a>`},preferencesModal:{title:"Datenschutz-Einstellungen",acceptAllBtn:"Alle akzeptieren",acceptNecessaryBtn:"Alle ablehnen",savePreferencesBtn:"Einstellungen speichern",closeIconLabel:"Modal schließen",serviceCounterLabel:"Dienstleistungen",sections:[{title:"Verwendung von Cookies",description:"Mit diesem Tool können Sie, verschiedene Tags, Tracker und Analyse-Tools auf dieser Webseite auszuwählen und deaktivieren. Klicken Sie dazu die von Ihnen gewünschten Dienste an und danach auf 'Einstellungen speichern'. Ihre Entscheidung können Sie im Nachhinein jederzeit widerrufen."},{title:'Matomo Analytics <span class="pm__badge">Immer Aktiviert</span>',description:"Dies ist ein Open-Source-Webanalysedienst, der genutzt wird um das Nutzerverhalten zu analysieren und die Website zu optimieren. In diesem Fall handelt es sich um die lokal gehostete V
590ariante, wodurch keine Cookies ausgespielt werden. Weitere Informationen finden Sie in der Datenschutzerklärung.",linkedCategory:"analytics"},{title:"Maptiler - Kartenanbieter",description:"Dies ist ein Dienst zur Bereitstellung von Online-Karten. Weitere Informationen finden Sie in der Datenschutzerklärung.",linkedCategory:"functionality"}]}}}},onChange:({cookie:y,changedCategories:p,changedServices:b})=>{Gf()}});function Gf(){const y=CookieConsent.getUserPreferences();y.acceptType==="all"&&Hp(!0),y.acceptedCategories.includes("functionality")&&Hp(!0)}Gf();function Hp(y){const p=document.querySelectorAll(".js-map-forbidden");for(let I=0;I<p.length;I++)y?p[I].classList.add("hidden"):p[I].classList.remove("hidden");const b=document.querySelectorAll(".js-map-allowed");for(let I=0;I<b.length;I++)y?b[I].classList.remove("hidden"):b[I].classList.add("hidden")}if(document.querySelector(".glide")){let p=function(){const b=document.querySelector(".glide__track"),I=document.querySelectorAll(".glide__slide");var R;for(R=0;R<I.length;R++)I[R].style.height=b.offsetHeight+"px"};var glideHandleHeight=p;const y=new Cg(".glide",{perView:4,type:"carousel",gap:10,breakpoints:{1024:{perView:3},600:{perView:1}}});y.on("build.after",function(){p()}),y.on("run.after",function(){p()}),y.mount()}document.addEventListener("DOMContentLoaded",function(){});const Wp=document.querySelector(".menu-main"),Kp=document.querySelectorAll(".menu-main > .menu-item-has-children");Kp.forEach(function(y){y.querySelector("a").addEventListener("click",function(b){b.preventDefault(),Kp.forEach(function(I){I!==y&&I.classList.remove("active")}),y.classList.toggle("active")})});const Xp=document.querySelectorAll(".menu-main > .menu-item-has-children > .sub-menu > .menu-item-has-children");Xp.forEach(function(y){y.querySelector("a").addEventListener("click",function(b){b.preventDefault(),Xp.forEach(function(I){I!==y&&I.classList.remove("active")}),y.classList.toggle("active")})});document.addEventListener("click",function(y){y.target.closest(".menu-main")||Wp&&Wp.querySelectorAll(".menu-item-has-children").forEach(function(I){I.classList.remove("active")})});const Yp=document.querySelector(".mobilemenu-button");Yp&&Yp.addEventListener("click",function(y){y.preventDefault(),document.body.classList.toggle("menu-open")});const Fv=document.querySelectorAll("[data-accordion-trigger]");Fv.forEach(function(y){y.addEventListener("click",function(p){const b=document.querySelector('[data-accordion-target="'+y.dataset.accordionTrigger+'"]');b&&(b.classList.toggle("max-h-0"),b.classList.toggle("max-h-100"))})});if(window.location.hash){const y=document.querySelector('[data-accordion-target="'+window.location.hash.substr(1)+'"]');y&&(y.classList.remove("max-h-0"),y.classList.add("max-h-100"))}document.querySelectorAll(".js-filter select").forEach(y=>{y.addEventListener("change",function(){mh(this.name,this.value)})});function mh(y,p){const b=new URL(window.location.href);b.searchParams.set(y,p),window.location=b}document.querySelectorAll(".filter-label").forEach(y=>{y.addEventListener("click",function(){mh(y.getAttribute("data-key"),"")})});document.querySelectorAll(".js-filter .remove-all-filters").forEach(y=>{y.addEventListener("click",function(){window.location=window.location.pathname})});document.querySelectorAll(".search__icon-clear").forEach(y=>{y.addEventListener("click",function(){const p=this.closest(".search").querySelector("input");p.value="",mh(p.name,"")})});document.querySelectorAll("[data-random-quotes]").forEach(y=>{const p=y.getAttribute("data-random-quotes-endpoint");if(!p)return;let b=p;try{const I=new URL(p,window.location.origin);I.searchParams.set("_",Date.now().toString()),b=I.toString()}catch(I){b=p}fetch(b,{credentials:"same-origin",cache:"no-store"}).then(I=>{if(!I.ok)throw new Error("Could not fetch random quotes");return I.text()}).then(I=>{I.trim()&&(y.innerHTML=I)}).catch(()=>{})});if(document.getElementById("map")){let p=function(){return window.innerWidth<=699},b=function(){return p()?7:7.75},$=function(l){document.querySelectorAll(".markerfgz").forEach(se=>{se.remove()}
590),l=="extended"?dt.setZoom(b()):l=="overview"?dt.setZoom(8):l=="commune"?dt.setZoom(10):l=="fgz"&&dt.setZoom(11)};var isMobile=p,getExtendedZoom=b,d0=$;let y="overview";wt.icon({iconUrl:"/app/themes/base-theme/public/map/pin.png",shadowUrl:"",iconSize:[24,28],shadowSize:[24,28],iconAnchor:[24,28],shadowAnchor:[24,28],popupAnchor:[-3,-76]});var dt=wt.map("map",{center:[51.50194,7.575456],zoom:8,minZoom:b(),zoomSnap:.25,maxZoom:14,scrollWheelZoom:!1,doubleClickZoom:!1});dt.setMaxBounds([[52.831634,5.955435],[50.02146,9.47306]]),document.getElementById("map").setAttribute("data-zoom","overview");const I=wt.imageOverlay("/app/themes/base-theme/public/map/nrw_transparent.svg",[[52.831634,5.955435],[50.02146,9.47306]]),R="T5N0w4OZ1VefcZIkMzw1",N=wt.tileLayer("https://api.maptiler.com/maps/basic/{z}/{x}/{y}.png?key="+R,{apiKey:R});I.addTo(dt);for(let l=0;l<communeArr.length;l++)wt.marker([communeArr[l].lat,communeArr[l].lng],{icon:new wt.DivIcon({className:"marker",html:'<span data-commune="'+communeArr[l].id+'"><span class="marker__fgz">'+communeArr[l].fgz+'</span><img class="marker__pin" src="/app/themes/base-theme/public/map/pin.png"/><span class="marker__label">'+communeArr[l].name+"</span></span>"})}).addTo(dt);document.querySelectorAll("[data-commune]").forEach(l=>{l.addEventListener("click",function(){y="fgz";const se=this.getAttribute("data-commune");if(fgzArr[se]){var X=wt.latLngBounds();for(let ge=0;ge<fgzArr[se].length;ge++)X.extend([fgzArr[se][ge].lat,fgzArr[se][ge].lng]),wt.marker([fgzArr[se][ge].lat,fgzArr[se][ge].lng],{icon:new wt.DivIcon({className:"markerfgz",html:'<img class="markerfgz__pin" src="/app/themes/base-theme/public/map/kpin.png"/><div class="markerfgz__content">'+fgzArr[se][ge].name+"<br>"+fgzArr[se][ge].adress+"<br><a href=' "+fgzArr[se][ge].link+"' class='markerfgz__link'><span>Zum Steckbrief</span><svg xmlns='http://www.w3.org/2000/svg' width='22' height='14' viewBox='0 0 22 14' fill='none'><path d='M16 1L21 7' stroke='#931680' stroke-width='2' stroke-linecap='round'/><path d='M16 13L21 7' stroke='#931680' stroke-width='2' stroke-linecap='round'/><path d='M1 7H21' stroke='#931680' stroke-width='2' stroke-linecap='round'/></svg></a></div>"})}).addTo(dt);dt.fitBounds(X,{padding:[100,100]})}})}),document.querySelectorAll(".js-zoom-out").forEach(l=>{y=="extended"&&l.classList.add("opacity-30")}),dt.on("zoomend",function(){dt.getZoom()>=11?(y="fgz",dt.hasLayer(I)&&dt.removeLayer(I),dt.hasLayer(N)||N.addTo(dt)):dt.getZoom()==10?(y="commune",dt.hasLayer(I)&&dt.removeLayer(I),dt.hasLayer(N)||N.addTo(dt)):dt.getZoom()==8?(y="overview",dt.hasLayer(N)&&dt.removeLayer(N),dt.hasLayer(I)||I.addTo(dt)):(dt.getZoom()==7.75||dt.getZoom()==7)&&(y="extended",dt.hasLayer(N)&&dt.removeLayer(N),dt.hasLayer(I)||I.addTo(dt)),document.getElementById("map").setAttribute("data-zoom",y),document.querySelectorAll(".js-zoom-out").forEach(l=>{y=="extended"?l.classList.add("opacity-30"):l.classList.remove("opacity-30")}),document.querySelectorAll(".js-zoom-in").forEach(l=>{y=="commune"||y=="fgz"?l.classList.add("opacity-30"):l.classList.remove("opacity-30")})}),document.querySelectorAll(".js-zoom-in").forEach(l=>{l.addEventListener("click",function(){y=="overview"?$("commune"):y=="extended"&&$("overview")})}),document.querySelectorAll(".js-zoom-out").forEach(l=>{l.addEventListener("click",function(){console.log(y),y=="fgz"?$("commune"):y=="commune"?$("overview"):y=="overview"&&$("extended")})})}if(document.getElementById("map2")){let I=function(){return window.innerWidth<=699},R=function(){return I()?7:7.75},pe=function(){document.querySelectorAll(".marker").forEach(Xe=>{Xe.remove()})},Re=function(){N=0,$=0,l=0;let Xe=[];for(let Qe=0;Qe<communeArr.length;Qe++){let at=communeArr[Qe].count_msb,yt=communeArr[Qe].count_kinderstark,nt=communeArr[Qe].count_other;N+=at,$+=yt,l+=nt;let xt=at+yt+nt;b.length>0&&(xt=0,b.includes("msb")&&(xt+=at),b.includes("kinderstark")&&(xt+=yt),b.includes("other")&&(xt+=nt)),xt>0&&Xe.push({lat:communeArr[Qe].lat,lng:communeArr[Qe].lng,id:communeArr[Qe].id,name:communeArr[Qe].name,count:xt})}ut(Xe).forEach(Qe=>{wt.marker([Qe.lat,Qe.lng],{icon:new wt.DivIcon({className:"marker",html:'<span data-commune="'+Qe.id+'"><span class="marker__fgz">
590'+Qe.count+'</span><img class="marker__pin" src="/app/themes/base-theme/public/map/fgz-pin-kommune.png"/><span class="marker__label">'+Qe.name+"</span></span>"})}).addTo(dt)}),document.querySelector("[data-msb-count]").innerHTML=N,document.querySelector("[data-kinderstark-count]").innerHTML=$,document.querySelector("[data-other-count]").innerHTML=l},ut=function(Xe){let yt=[...Xe],nt=0;for(;nt<5;){let xt=!1;for(let rt=0;rt<yt.length;rt++)for(let Pt=rt+1;Pt<yt.length;Pt++){const ft=yt[rt],Ut=yt[Pt],Ct=ft.lat,ni=ft.lng,et=Ut.lat,Ui=Ut.lng;if(Math.sqrt(Math.pow(et-Ct,2)+Math.pow(Ui-ni,2))<.22){xt=!0;const Mt=Ui-ni,ci=et-Ct,Lt=Math.sqrt(Mt*Mt+ci*ci),$t=Mt/Lt*.005,qt=ci/Lt*.005;yt[rt].lat-=qt,yt[rt].lng-=$t,yt[Pt].lat+=qt,yt[Pt].lng+=$t}}if(!xt)break;nt++}return yt},ze=function(Xe){Tt(),Xe=="overview"?dt.setZoom(8):Xe=="extended"?dt.setZoom(R()):Xe=="commune"?dt.setZoom(10):Xe=="fgz"&&dt.setZoom(11)},Tt=function(){document.querySelectorAll(".markerfgz").forEach(Xe=>{Xe.remove()})},pt=function(){let Xe=0;if(N=0,$=0,l=0,fgzArr[p]){var _t=wt.latLngBounds();for(let Qe=0;Qe<fgzArr[p].length;Qe++){switch(fgzArr[p][Qe].type){case"msb":N++;break;case"kinderstark":$++;break;case"other":l++;break}if(b.length>0&&!b.includes(fgzArr[p][Qe].type))continue;Xe++;let at="";switch(fgzArr[p][Qe].type){case"msb":at="/app/themes/base-theme/public/map/fgz-msb.png";break;case"kinderstark":at="/app/themes/base-theme/public/map/fgz-kinderstark.png";break;case"other":at="/app/themes/base-theme/public/map/fgz-other.png";break}_t.extend([fgzArr[p][Qe].lat,fgzArr[p][Qe].lng]),wt.marker([fgzArr[p][Qe].lat,fgzArr[p][Qe].lng],{icon:new wt.DivIcon({className:"markerfgz",html:'<img class="markerfgz__pin" src="'+at+'"/><div class="markerfgz__content">'+fgzArr[p][Qe].name+"<br>"+fgzArr[p][Qe].adress+"<br><a href=' "+fgzArr[p][Qe].link+"' class='markerfgz__link'><span>Zum Steckbrief</span><svg xmlns='http://www.w3.org/2000/svg' width='22' height='14' viewBox='0 0 22 14' fill='none'><path d='M16 1L21 7' stroke='#931680' stroke-width='2' stroke-linecap='round'/><path d='M16 13L21 7' stroke='#931680' stroke-width='2' stroke-linecap='round'/><path d='M1 7H21' stroke='#931680' stroke-width='2' stroke-linecap='round'/></svg></a></div>"})}).addTo(dt)}document.querySelector("[data-msb-count]").innerHTML=N,document.querySelector("[data-kinderstark-count]").innerHTML=$,document.querySelector("[data-other-count]").innerHTML=l,Xe>0?dt.fitBounds(_t,{padding:[120,120]}):console.log("NO MARKERS TO FIT")}};var isMobile=I,getExtendedZoom=R,removeCommuneMakers=pe,addCommuneMakers=Re,adjustMarkerPositions=ut,d0=ze,removeMarkers=Tt,addMarkers=pt;let y="overview",p=null,b=[],N=document.querySelector("[data-msb-count]").innerHTML,$=document.querySelector("[data-kinderstark-count]").innerHTML,l=document.querySelector("[data-other-count]").innerHTML;wt.icon({iconUrl:"/app/themes/base-theme/public/map/pin.png",shadowUrl:"",iconSize:[24,28],shadowSize:[24,28],iconAnchor:[24,28],shadowAnchor:[24,28],popupAnchor:[-3,-76]});var dt=wt.map("map2",{center:[51.50194,7.575456],zoom:8,minZoom:R(),zoomSnap:.25,maxZoom:14,scrollWheelZoom:!1,doubleClickZoom:!1});dt.setMaxBounds([[52.831634,5.955435],[50.02146,9.47306]]),document.getElementById("map2").setAttribute("data-zoom","overview");const X=wt.imageOverlay("/app/themes/base-theme/public/map/nrw_transparent.svg",[[52.831634,5.955435],[50.02146,9.47306]]),ge="T5N0w4OZ1VefcZIkMzw1",ve=wt.tileLayer("https://api.maptiler.com/maps/basic/{z}/{x}/{y}.png?key="+ge,{apiKey:ge});X.addTo(dt),Re(),document.body.addEventListener("click",function(Xe){const _t=Xe.target.closest("[data-commune]");_t&&(Tt(),y="fgz",p=_t.getAttribute("data-commune"),pt())}),document.querySelectorAll(".js-zoom-out").forEach(Xe=>{y=="extended"&&Xe.classList.add("opacity-30")}),dt.on("zoomend",function(){dt.getZoom()>=11?(y="fgz",dt.hasLayer(X)&&dt.removeLayer(X),dt.hasLayer(ve)||ve.addTo(dt)):dt.getZoom()==10?(y="commune",dt.hasLayer(X)&&dt.removeLayer(X),dt.hasLayer(ve)||ve.addTo(dt),pe(),Re()):dt.getZoom()==8?(y="overview",dt.hasLayer(ve)&&dt.removeLayer(ve),dt.hasLayer(X)||X.addTo(dt),pe(),Re()):(dt.getZoom()==7.75||dt.getZoom()==7)&&(y="extended",dt.hasLayer(ve)&&dt.removeLayer(ve),dt.hasLayer(X)||X.addTo(dt),pe(),Re()),document.getElementById("map2").setAttribute("data-zoom",y),document.querySelectorAll(".js-zoom-out").forEach(Xe=>{y=="extended"?Xe.classList.add("opacity-30"):Xe.classList.remove("opacity-30")}),document.querySelectorAll(".js-zoom-in").forEach(Xe=>{y=="commune"||y=="fgz"?Xe.classList.add("opacity-30"):Xe.classList.remove("opacity-30")})}),document.querySelectorAll(".js-zoom-in").forEach(Xe=>{Xe.addEventListener("click",function(){y=="overview"?ze("commune"):y=="extended"&&ze("overview")})}),document.querySelectorAll(".js-zoom-out").forEach(Xe=>{Xe.addEventListener("click",function(){console.log("--",y),y=="fgz"?ze("commune"):y=="commune"?ze("overview"):y=="overview"&&ze("extended")})}),document.querySelectorAll("[data-marker-filter]").forEach(Xe=>{Xe.addEventListener("click",function(){this.classList.contains("bg-blue-l")?(b=b.filter(_t=>_t!==this.getAttribute("data-marker-filter")),this.classList.remove("bg-blue-l")):(b.push(this.getAttribute("data-marker-filter")),this.classList.add("bg-blue-l")),y=="overview"&&(pe(),Re()),y=="extended"&&(pe(),Re()),y=="commune"&&(pe(),Re()),y=="fgz"&&(Tt(),pt())})})}document.querySelectorAll("#mapsearch").forEach(y=>{y.addEventListener("input",function(){let p=!1;const b=this.value,I=document.getElementById("mapsearch-results");I.innerHTML="",b.length>=2&&autocompleteArr.forEach(R=>{if(R.key.toLowerCase().includes(b.toLowerCase())){p=!0;const N=document.createElement("div");N.classList.add("cursor-pointer","hover:text-purple-m"),N.innerHTML='<div class="hover:bg-white  bg-white transition-all w-full flex justify-between items-center"><span>'+R.key+"</span><svg xmlns='http://www.w3.org/2000/svg' width='22' height='14' viewBox='0 0 22 14' fill='none'><path d='M16 1L21 7' stroke='#931680' stroke-width='2' stroke-linecap='round'/><path d='M16 13L21 7' stroke='#931680' stroke-width='2' stroke-linecap='round'/>
590<path d='M1 7H21' stroke='#931680' stroke-width='2' stroke-linecap='round'/></svg></div>",N.addEventListener("click",function(){if(console.log(R.communeId),R.communeId){const $=document.querySelector(`[data-commune="${R.communeId}"]`);$&&$.click()}y.value="",I.classList.add("hidden"),I.classList.remove("block")}),I.appendChild(N)}}),p||(I.innerHTML="Keine Ergebnisse"),b.length==0&&(I.innerHTML="",p=!1),p?(I.classList.add("block"),I.classList.remove("hidden")):(I.classList.add("hidden"),I.classList.remove("block"))})});document.querySelectorAll(".mapsearch__icon-clear").forEach(y=>{y.addEventListener("click",function(){const p=this.closest(".mapsearch").querySelector("input");p.value="";const b=document.getElementById("mapsearch-results");b.innerHTML="",b.classList.add("hidden"),b.classList.remove("block"),document.getElementById("map2")&&d0("overview")})});document.querySelectorAll(".search.-header").forEach(y=>{y.addEventListener("click",function(){this.classList.add("-active")})});const Nv=document.querySelectorAll('a[href^="#"]');Nv.forEach(function(y){y.addEventListener("click",function(p){const b=y.getAttribute("href");if(!b||b==="#"||b.length<=1||y.classList.contains("js-youtube-modal"))return;const I=document.querySelector(b);I&&(p.preventDefault(),window.scrollTo({top:I.offsetTop,behavior:"smooth"}))})});document.addEventListener("click",function(y){const p=y.target.closest(".js-youtube-modal");if(!p)return;y.preventDefault();const b=p.getAttribute("data-youtube-id");if(!b)return;const I=`https://www.youtube-nocookie.com/embed/${b}?autoplay=1&rel=0`,R=document.createElement("div");R.className="fixed inset-0 bg-black/70 z-[10000] flex items-center justify-center p-4";const N=document.createElement("div");N.className="relative w-full max-w-4xl aspect-video bg-black rounded-lg overflow-hidden";const $=document.createElement("button");$.setAttribute("aria-label","Modal schließen"),$.className="absolute top-2 right-2 z-10 text-white/80 hover:text-white text-2xl leading-none",$.innerHTML="&times;";const l=document.createElement("iframe");l.src=I,l.title="YouTube video",l.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",l.allowFullscreen=!0,l.className="w-full h-full",l.setAttribute("referrerpolicy","strict-origin-when-cross-origin");function se(){R.remove()}R.addEventListener("click",function(X){X.target===R&&se()}),document.addEventListener("keydown",function X(ge){ge.key==="Escape"&&(document.removeEventListener("keydown",X),se())}),$.addEventListener("click",se),N.appendChild($),N.appendChild(l),R.appendChild(N),document.body.appendChild(R)});

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.