PageSourceSearch

https://fixitbay.net/static/js/7951.710da6aa.chunk.js

js fixitbay.net collected 2026-10-06 16:21:32 UTC 1,065,810 bytes, 1 lines download raw bytes

1(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[7951],{3693:(t,e,i)=>{var r=i(7736);t.exports=function(t,e,i){return(e=r(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t},t.exports.__esModule=!0,t.exports.default=t.exports},2897:(t,e,i)=>{var r=i(3693);function n(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,r)}return i}t.exports=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?n(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t},t.exports.__esModule=!0,t.exports.default=t.exports},9045:(t,e,i)=>{var r=i(3738).default;t.exports=function(t,e){if("object"!=r(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports},7736:(t,e,i)=>{var r=i(3738).default,n=i(9045);t.exports=function(t){var e=n(t,"string");return"symbol"==r(e)?e:e+""},t.exports.__esModule=!0,t.exports.default=t.exports},3738:t=>{function e(i){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(i)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},7951:function(t,e,i){var r=i(3693).default,n=i(2897).default;t.exports=function(){"use strict";var t={},e={};function i(i,r,n){if(e[i]=n,"index"===i){var o="var sharedModule = {}; ("+e.shared+")(sharedModule); ("+e.worker+")(sharedModule);",a={};return e.shared(a),e.index(t,a),"undefined"!==typeof window&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([o],{type:"text/javascript"}))),t}}return i("shared",["exports"],(function(t){function e(t,e,i,r){return new(i||(i=Promise))((function(n,o){function a(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}l((r=r.apply(t,e||[])).next())}))}function i(t,e){this.x=t,this.y=e}function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var a,s;"function"==typeof SuppressedError&&SuppressedError,i.prototype={clone(){return new i(this.x,this.y)},add(t){return this.clone()._add(t)},sub(t){return this.clone()._sub(t)},multByPoint(t){return this.clone()._multByPoint(t)},divByPoint(t){return this.clone()._divByPoint(t)},mult(t){return this.clone()._mult(t)},div(t){return this.clone()._div(t)},rotate(t){return this.clone()._rotate(t)},rotateAround(t,e){return this.clone()._rotateAround(t,e)},matMult(t){return this.clone()._matMult(t)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(t){return this.x===t.x&&this.y===t.y},dist(t){return Math.sqrt(this.distSqr(t))},distSqr(t){const e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle(){return Math.atan2(this.y,this.x)},angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith(t){return this.angleWithSep(t.x,t.y)},angleWithSep(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult(t){const e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add(t){return this.x+=t.x,this.y+=t.y,this},_sub(t){return this.x-=t.x,this.y-=t.y,this},_mult(t){return this.x*=t,this.y*=t,this},_div(t){return this.x/=t,this.y/=t,this},_multByPoint(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint(t){return this.x/=t.x,this.y/=t.y,this},_unit(){return this._div(this.mag()),this},_perp(){const t=this.y;return this.y=this.x,this.x=-t,this},_rotate(t){const e=Math.cos(t),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this}
1,_rotateAround(t,e){const i=Math.cos(t),r=Math.sin(t),n=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=n,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:i},i.convert=function(t){if(t instanceof i)return t;if(Array.isArray(t))return new i(+t[0],+t[1]);if(void 0!==t.x&&void 0!==t.y)return new i(+t.x,+t.y);throw new Error("Expected [x, y] or {x, y} point format")};var l=function(){if(s)return a;function t(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=r}return s=1,a=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var n=this.sampleCurveX(i)-t;if(Math.abs(n)<e)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i-=n/o}var a=0,s=1;for(i=t,r=0;r<20&&(n=this.sampleCurveX(i),!(Math.abs(n-t)<e));r++)t>n?a=i:s=i,i=.5*(s-a)+a;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},a}(),c=o(l);let h,u;function d(){return null==h&&(h="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),h}function p(){if(null==u&&(u=!1,d())){const t=5,e=new OffscreenCanvas(t,t).getContext("2d",{willReadFrequently:!0});if(e){for(let r=0;r<t*t;r++){const i=4*r;e.fillStyle="rgb(".concat(i,",").concat(i+1,",").concat(i+2,")"),e.fillRect(r%t,Math.floor(r/t),1,1)}const i=e.getImageData(0,0,t,t).data;for(let e=0;e<t*t*4;e++)if(e%4!=3&&i[e]!==e){u=!0;break}}}return u||!1}var f=1e-6,m="undefined"!=typeof Float32Array?Float32Array:Array;function g(){var t=new m(9);return m!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function _(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function y(){var t=new m(3);return m!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function v(t){var e=t[0],i=t[1],r=t[2];return Math.sqrt(e*e+i*i+r*r)}function x(t,e,i){var r=new m(3);return r[0]=t,r[1]=e,r[2]=i,r}function b(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function w(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function T(t,e,i){var r=e[0],n=e[1],o=e[2],a=i[0],s=i[1],l=i[2];return t[0]=n*l-o*s,t[1]=o*a-r*l,t[2]=r*s-n*a,t}var S,P=v;function I(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*o+i[12]*a,t[1]=i[1]*r+i[5]*n+i[9]*o+i[13]*a,t[2]=i[2]*r+i[6]*n+i[10]*o+i[14]*a,t[3]=i[3]*r+i[7]*n+i[11]*o+i[15]*a,t}function M(){var t=new m(4);return m!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function E(t,e,i,r){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",o=Math.PI/360;e*=o,r*=o,i*=o;var a=Math.sin(e),s=Math.cos(e),l=Math.sin(i),c=Math.cos(i),h=Math.sin(r),u=Math.cos(r);switch(n){case"xyz":t[0]=a*c*u+s*l*h,t[1]=s*l*u-a*c*h,t[2]=s*c*h+a*l*u,t[3]=s*c*u-a*l*h;break;case"xzy":t[0]=a*c*u-s*l*h,t[1]=s*l*u-a*c*h,t[2]=s*c*h+a*l*u,t[3]=s*c*u+a*l*h;break;case"yxz":t[0]=a*c*u+s*l*h,t[1]=s*l*u-a*c*h,t[2]=s*c*h-a*l*u,t[3]=s*c*u+a*l*h;break;case"yzx":t[0]=a*c*u+s*l*h,t[1]=s*l*u+a*c*h,t[2]=s*c*h-a*l*u,t[3]=s*c*u-a*l*h;break;case"zxy":t[0]=a*c*u-s*l*h,t[1]=s*l*u+a*c*h,t[2]=s*c*h+a*l*u,t[3]=s*c*u-a*l*h;break;case"zyx":t[0]=a*c*u-s*l*h,t[1]=s*l*u+a*c*h,t[2]=s*c*h-a*l*u,t[3]=s*c*u+a*l*h;break;default:throw new Error("Unknown angle order "+n)}return t}function C(){var t=new m(2);return m!=Float32Array&&(t[0]=0,t[1]=0),t}function A(t,e){var i=new m(2);return i[0]=t,i[1]=e,i}y(),S=new m(4),m!=Float32Array&&(S[0]=0,S[1]=0,S[2]=0,S[3]=0),y(),x(1,0,0),x(0,1,0),M(),M(),g(),C();const D=8192;function z(t,e,i){return e*(D/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}function k(t,e){return(t%e+e)%e}function R(t,e,i){return t*(1-i)+e*i}function F(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}function L(t,e,i,r){const n=new c(t,e,i,r);return t=>n.solve(t)}const B=L(.25,.1,.25,1);function O(t,e,i){return Math.min(i,Math.max(e,t))}function V(t,e,i){const r=i-e,n=((t-e)%r+r)%r+e;return n===e?i:n}function j(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];for(const n of i)for(const e in n)t[e]=n[e];return t}let N=1;function U(t,e,i){const r={};for(const n in t)r[n]=e.call(this,t[n],n,t);return r}function G(t,e,i){const r={};for(const n in t)e.call(this,t[n],n,t)&&(r[n]=t[n]);return r}function Z(t){return Array.isArray(t)?t.map(Z):"object"==typeof t&&t?U(t,Z):t}const q={};function W(t){q[t]||("undefined"!=typeof console&&console.warn(t),q[t]=!0)}function X(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function H(t){return"undefined"!=typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let Y=null;function K(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}const J="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Q(t,i,r,n,o){return e(this,void 0,void 0,(function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const e=new VideoFrame(t,{timestamp:0});try{const a=null==e?void 0:e.format;if(!a||!a.startsWith("BGR")&&!a.startsWith("RGB"))throw new Error("Unrecognized format ".concat(a));const s=a.startsWith("BGR"),l=new Uint8ClampedArray(n*o*4);
1if(yield e.copyTo(l,function(t,e,i,r,n){const o=4*Math.max(-e,0),a=(Math.max(0,i)-i)*r*4+o,s=4*r,l=Math.max(0,e),c=Math.max(0,i);return{rect:{x:l,y:c,width:Math.min(t.width,e+r)-l,height:Math.min(t.height,i+n)-c},layout:[{offset:a,stride:s}]}}(t,i,r,n,o)),s)for(let t=0;t<l.length;t+=4){const e=l[t];l[t]=l[t+2],l[t+2]=e}return l}finally{e.close()}}))}let $,tt;function et(t,e,i,r){return t.addEventListener(e,i,r),{unsubscribe:()=>{t.removeEventListener(e,i,r)}}}function it(t){return t*Math.PI/180}function rt(t){return t/Math.PI*180}const nt={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},ot={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},at="AbortError";class st extends Error{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:at;super(t instanceof Error?t.message:t),this.name=at,t instanceof Error&&t.stack&&(this.stack=t.stack)}}function lt(t){return t.name===at}const ct={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function ht(t){return ct.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}const ut="global-dispatcher";class dt extends Error{constructor(t,e,i,r){super("AJAXError: ".concat(e," (").concat(t,"): ").concat(i)),this.status=t,this.statusText=e,this.url=i,this.body=r}}const pt=()=>H(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,ft=function(t,i){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){const e=ht(t.url);if(e)return e(t,i);if(H(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:ut},i)}if(!(/^file:/.test(r=t.url)||/^file:/.test(pt())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,i){return e(this,void 0,void 0,(function*(){const e=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:pt(),signal:i.signal});let r,n;"json"!==t.type||e.headers.has("Accept")||e.headers.set("Accept","application/json");try{r=yield fetch(e)}catch(e){if(lt(e))throw e;throw new dt(0,e.message,t.url,new Blob)}if(!r.ok){const e=yield r.blob();throw new dt(r.status,r.statusText,t.url,e)}n="arrayBuffer"===t.type||"image"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text();const o=yield n;return i.signal.throwIfAborted(),{data:o,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires"),etag:r.headers.get("ETag")}}))}(t,i);if(H(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:ut},i)}var r;return function(t,e){return new Promise(((i,r)=>{var n;const o=new XMLHttpRequest;o.open(t.method||"GET",t.url,!0),"arrayBuffer"!==t.type&&"image"!==t.type||(o.responseType="arraybuffer");for(const e in t.headers)o.setRequestHeader(e,t.headers[e]);"json"===t.type&&(o.responseType="text",(null===(n=t.headers)||void 0===n?void 0:n.Accept)||o.setRequestHeader("Accept","application/json")),o.withCredentials="include"===t.credentials,o.onerror=()=>{r(new Error(o.statusText))},o.onload=()=>{if(!e.signal.aborted)if((o.status>=200&&o.status<300||0===o.status)&&null!==o.response){let e=o.response;if("json"===t.type)try{e=JSON.parse(o.response)}catch(t){return void r(t)}i({data:e,cacheControl:o.getResponseHeader("Cache-Control"),expires:o.getResponseHeader("Expires"),etag:o.getResponseHeader("ETag")})}else{const e=new Blob([o.response],{type:o.getResponseHeader("Content-Type")});r(new dt(o.status,o.statusText,t.url,e))}},e.signal.addEventListener("abort",(()=>{o.abort(),r(new st(e.signal.reason))})),o.send(t.body)}))}(t,i)};function mt(t){if(!t||t.indexOf("://")<=0||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;const e=new URL(t),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function gt(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function _t(t,e,i){if(i&&i[t]){const r=i[t].indexOf(e);-1!==r&&i[t].splice(r,1)}}class yt{constructor(t){j(this,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.type=t}}class vt extends yt{constructor(t){super("error",j({error:t},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}}class xt{on(t,e){return this._listeners=this._listeners||{},gt(t,e,this._listeners),{unsubscribe:()=>{this.off(t,e)}}}off(t,e){return _t(t,e,this._listeners),_t(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},gt(t,e,this._oneTimeListeners),this):new Promise((e=>this.once(t,e)))}fire(t,e){"string"==typeof t&&(t=new yt(t,e||{}));const i=t.type;if(this.listens(i)){t.target=this;const e=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(const i of e)i.call(this,t);const r=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(const o of r)_t(i,o,this._oneTimeListeners),o.call(this,t);const n=this._eventedParent;n&&(j(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(t))}else t instanceof vt&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var bt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"}
vendor: 20,999 bytes, line 1
1,bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},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},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{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:"filter"},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:{},"color-relief":{},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","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},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:"expression_name",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,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.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}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","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
vendor: 12,722 bytes, line 1
1"},"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","feature"]},"property-type":"cross-faded-data-driven"},"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}}
vendor: 1,653 bytes, line 1
1;const wt=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Tt(t,e){const i={};for(const r in t)"ref"!==r&&(i[r]=t[r]);return wt.forEach((t=>{t in e&&(i[t]=e[t])})),i}function St(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!St(t[i],e[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!St(t[i],e[i]))return!1;return!0}return t===e}function Pt(t,e){t.push(e)}function It(t,e,i){Pt(i,{command:"addSource",args:[t,e[t]]})}function Mt(t,e,i){Pt(e,{command:"removeSource",args:[t]}),i[t]=!0}function Et(t,e,i,r){Mt(t,i,r),It(t,e,i)}function Ct(t,e,i){let r;for(r in t[i])if(Object.prototype.hasOwnProperty.call(t[i],r)&&"data"!==r&&!St(t[i][r],e[i][r]))return!1;for(r in e[i])if(Object.prototype.hasOwnProperty.call(e[i],r)&&"data"!==r&&!St(t[i][r],e[i][r]))return!1;return!0}function At(t,e,i,r,n,o){t=t||{},e=e||{};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(St(t[a],e[a])||i.push({command:o,args:[r,a,e[a],n]}));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&!Object.prototype.hasOwnProperty.call(t,a)&&(St(t[a],e[a])||i.push({command:o,args:[r,a,e[a],n]}))}function Dt(t){return t.id}function zt(t,e){return t[e.id]=e,t}class kt{constructor(t,e,i,r){this.message=(t?"".concat(t,": "):"")+i,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)}}function Rt(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];for(const n of i)for(const e in n)t[e]=n[e];return t}
1class Ft extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class Lt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.parent=t,this.bindings={};for(const[i,r]of e)this.bindings[i]=r}concat(t){return new Lt(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error("".concat(t," not found in scope."))}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Bt={kind:"null"},Ot={kind:"number"},Vt={kind:"string"},jt={kind:"boolean"},Nt={kind:"color"},Ut={kind:"projectionDefinition"},Gt={kind:"object"},Zt={kind:"value"},qt={kind:"collator"},Wt={kind:"formatted"},Xt={kind:"padding"},Ht={kind:"colorArray"},Yt={kind:"numberArray"},Kt={kind:"resolvedImage"},Jt={kind:"variableAnchorOffsetCollection"};function Qt(t,e){return{kind:"array",itemType:t,N:e}}function $t(t){if("array"===t.kind){const e=$t(t.itemType);return"number"==typeof t.N?"array<".concat(e,", ").concat(t.N,">"):"value"===t.itemType.kind?"array":"array<".concat(e,">")}return t.kind}const te=[Bt,Ot,Vt,jt,Nt,Ut,Wt,Gt,Qt(Zt),Xt,Yt,Ht,Kt,Jt];function ee(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!ee(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of te)if(!ee(t,e))return null}return"Expected ".concat($t(t)," but found ").concat($t(e)," instead.")}function ie(t,e){return e.some((e=>e.kind===t.kind))}function re(t,e){return e.some((e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t))}function ne(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const oe=.96422,ae=.82521,se=4/29,le=6/29,ce=3*le*le,he=le*le*le,ue=Math.PI/180,de=180/Math.PI;function pe(t){return(t%=360)<0&&(t+=360),t}function fe(t){let e,i,[r,n,o,a]=t;const s=ge((.2225045*(r=me(r))+.7168786*(n=me(n))+.0606169*(o=me(o)))/1);r===n&&n===o?e=i=s:(e=ge((.4360747*r+.3850649*n+.1430804*o)/oe),i=ge((.0139322*r+.0971045*n+.7141733*o)/ae));const l=116*s-16;return[l<0?0:l,500*(e-s),200*(s-i),a]}function me(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ge(t){return t>he?Math.pow(t,1/3):t/ce+se}function _e(t){let[e,i,r,n]=t,o=(e+16)/116,a=isNaN(i)?o:o+i/500,s=isNaN(r)?o:o-r/200;return o=1*ve(o),a=oe*ve(a),s=ae*ve(s),[ye(3.1338561*a-1.6168667*o-.4906146*s),ye(-.9787684*a+1.9161415*o+.033454*s),ye(.0719453*a-.2289914*o+1.4052427*s),n]}
1function ye(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function ve(t){return t>le?t*t*t:ce*(t-se)}const xe=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function be(t,e){return xe(t,e)?t[e]:void 0}function we(t){return parseInt(t.padEnd(2,t),16)/255}function Te(t,e){return Se(e?t/100:t,0,1)}function Se(t,e,i){return Math.min(Math.max(e,t),i)}function Pe(t){return!t.some(Number.isNaN)}const Ie={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]};function Me(t,e,i){return t+i*(e-t)}function Ee(t,e,i){return t.map(((t,r)=>Me(t,e[r],i)))}class Ce{constructor(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.r=t,this.g=e,this.b=i,this.a=r,n||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[t,e,i,r]))}static parse(t){if(t instanceof Ce)return t;if("string"!=typeof t)return;const e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];const e=be(Ie,t);if(e){const[t,i,r]=e;return[t/255,i/255,r/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){const e=t.length<6?1:2;let i=1;return[we(t.slice(i,i+=e)),we(t.slice(i,i+=e)),we(t.slice(i,i+=e)),we(t.slice(i,i+e)||"ff")]}if(t.startsWith("rgb")){const e=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(e){const[t,i,r,n,o,a,s,l,c,h,u,d]=e,p=[n||" ",s||" ",h].join("");if("  "===p||"  /"===p||",,"===p||",,,"===p){const t=[r,a,c].join(""),e="%%%"===t?100:""===t?255:0;
1if(e){const t=[Se(+i/e,0,1),Se(+o/e,0,1),Se(+l/e,0,1),u?Te(+u,d):1];if(Pe(t))return t}}return}}const i=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){const[t,e,r,n,o,a,s,l,c]=i,h=[r||" ",o||" ",s].join("");if("  "===h||"  /"===h||",,"===h||",,,"===h){const t=[+e,Se(+n,0,100),Se(+a,0,100),l?Te(+l,c):1];if(Pe(t))return function(t){let[e,i,r,n]=t;function o(t){const n=(t+e/30)%12,o=i*Math.min(r,1-r);return r-o*Math.max(-1,Math.min(n-3,9-n,1))}return e=pe(e),i/=100,r/=100,[o(0),o(8),o(4),n]}(t)}}}(t);return e?new Ce(...e,!1):void 0}get rgb(){const{r:t,g:e,b:i,a:r}=this,n=r||1/0;return this.overwriteGetter("rgb",[t/n,e/n,i/n,r])}get hcl(){return this.overwriteGetter("hcl",function(t){const[e,i,r,n]=fe(t),o=Math.sqrt(i*i+r*r);return[Math.round(1e4*o)?pe(Math.atan2(r,i)*de):NaN,o,e,n]}(this.rgb))}get lab(){return this.overwriteGetter("lab",fe(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){const[t,e,i,r]=this.rgb;return"rgba(".concat([t,e,i].map((t=>Math.round(255*t))).join(","),",").concat(r,")")}static interpolate(t,e,i){switch(arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb"){case"rgb":{const[r,n,o,a]=Ee(t.rgb,e.rgb,i);return new Ce(r,n,o,a,!1)}case"hcl":{const[r,n,o,a]=t.hcl,[s,l,c,h]=e.hcl;let u,d;if(isNaN(r)||isNaN(s))isNaN(r)?isNaN(s)?u=NaN:(u=s,1!==o&&0!==o||(d=l)):(u=r,1!==c&&0!==c||(d=n));else{let t=s-r;s>r&&t>180?t-=360:s<r&&r-s>180&&(t+=360),u=r+i*t}const[p,f,m,g]=function(t){let[e,i,r,n]=t;return e=isNaN(e)?0:e*ue,_e([r,Math.cos(e)*i,Math.sin(e)*i,n])}([u,null!=d?d:Me(n,l,i),Me(o,c,i),Me(a,h,i)]);return new Ce(p,f,m,g,!1)}case"lab":{const[r,n,o,a]=_e(Ee(t.lab,e.lab,i));return new Ce(r,n,o,a,!1)}}}}Ce.black=new Ce(0,0,0,1),Ce.white=new Ce(1,1,1,1),Ce.transparent=new Ce(0,0,0,0),Ce.red=new Ce(1,0,0,1);class Ae{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const De=["bottom","center","top"];class ze{constructor(t,e,i,r,n,o){this.text=t,this.image=e,this.scale=i,this.fontStack=r,this.textColor=n,this.verticalAlign=o}}class ke{constructor(t){this.sections=t}static fromString(t){return new ke([new ze(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((t=>0!==t.text.length||t.image&&0!==t.image.name.length))}static factory(t){return t instanceof ke?t:ke.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((t=>t.text)).join("")}}class Re{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Re)return t;if("number"==typeof t)return new Re([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Re(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i){return new Re(Ee(t.values,e.values,i))}}class Fe{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Fe)return t;if("number"==typeof t)return new Fe([t]);if(Array.isArray(t)){for(const e of t)if("number"!=typeof e)return;return new Fe(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i){return new Fe(Ee(t.values,e.values,i))}}class Le{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Le)return t;if("string"==typeof t){const e=Ce.parse(t);if(!e)return;return new Le([e])}if(!Array.isArray(t))return;const e=[];for(const i of t){if("string"!=typeof i)return;const t=Ce.parse(i);if(!t)return;e.push(t)}return new Le(e)}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb";const n=[];if(t.values.length!=e.values.length)throw new Error("colorArray: Arrays have mismatched length (".concat(t.values.length," vs. ").concat(e.values.length,"), cannot interpolate."));for(let o=0;o<t.values.length;o++)n.push(Ce.interpolate(t.values[o],e.values[o],i,r));return new Le(n)}}
1class Be extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}const Oe=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ve{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Ve)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){const i=t[e],r=t[e+1];if("string"!=typeof i||!Oe.has(i))return;if(!Array.isArray(r)||2!==r.length||"number"!=typeof r[0]||"number"!=typeof r[1])return}return new Ve(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,i){const r=t.values,n=e.values;if(r.length!==n.length)throw new Be("Cannot interpolate values of different length. from: ".concat(t.toString(),", to: ").concat(e.toString()));const o=[];for(let a=0;a<r.length;a+=2){if(r[a]!==n[a])throw new Be("Cannot interpolate values containing mismatched anchors. from[".concat(a,"]: ").concat(r[a],", to[").concat(a,"]: ").concat(n[a]));o.push(r[a]);const[t,e]=r[a+1],[s,l]=n[a+1];o.push([Me(t,s,i),Me(e,l,i)])}return new Ve(o)}}class je{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new je({name:t,available:!1}):null}}class Ne{constructor(t,e,i){this.from=t,this.to=e,this.transition=i}static interpolate(t,e,i){return new Ne(t,e,i)}static parse(t){return t instanceof Ne?t:Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]?new Ne(t[0],t[1],t[2]):"object"==typeof t&&"string"==typeof t.from&&"string"==typeof t.to&&"number"==typeof t.transition?new Ne(t.from,t.to,t.transition):"string"==typeof t?new Ne(t,t,1):void 0}}function Ue(t,e,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:"Invalid rgba value [".concat([t,e,i,r].join(", "),"]: 'a' must be between 0 and 1."):"Invalid rgba value [".concat(("number"==typeof r?[t,e,i,r]:[t,e,i]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}function Ge(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof Ne||t instanceof Ce||t instanceof Ae||t instanceof ke||t instanceof Re||t instanceof Fe||t instanceof Le||t instanceof Ve||t instanceof je)return!0;if(Array.isArray(t)){for(const e of t)if(!Ge(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Ge(t[e]))return!1;return!0}return!1}function Ze(t){if(null===t)return Bt;if("string"==typeof t)return Vt;if("boolean"==typeof t)return jt;if("number"==typeof t)return Ot;if(t instanceof Ce)return Nt;if(t instanceof Ne)return Ut;if(t instanceof Ae)return qt;if(t instanceof ke)return Wt;if(t instanceof Re)return Xt;if(t instanceof Fe)return Yt;if(t instanceof Le)return Ht;if(t instanceof Ve)return Jt;if(t instanceof je)return Kt;if(Array.isArray(t)){const e=t.length;let i;for(const r of t){const t=Ze(r);if(i){if(i===t)continue;i=Zt;break}i=t}return Qt(i||Zt,e)}return Gt}function qe(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Ce||t instanceof Ne||t instanceof ke||t instanceof Re||t instanceof Fe||t instanceof Le||t instanceof Ve||t instanceof je?t.toString():JSON.stringify(t)}class We{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(!Ge(t[1]))return e.error("invalid value");const i=t[1];let r=Ze(i);const n=e.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new We(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Xe={string:Vt,number:Ot,boolean:jt,object:Gt};class He{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,r=1;const n=t[0];if("array"===n){let n,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in Xe)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=Xe[i],r++}else n=Zt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);o=t[2],r++}i=Qt(n,o)}else{if(!Xe[n])throw new Error("Types doesn't contain name = ".concat(n));i=Xe[n]}const o=[];for(;r<t.length;r++){const i=e.parse(t[r],r,Zt);if(!i)return null;o.push(i)}return new He(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);
1if(!ee(this.type,Ze(i)))return i;if(e===this.args.length-1)throw new Be("Expected value to be of type ".concat($t(this.type),", but found ").concat($t(Ze(i))," instead."))}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const Ye={"to-boolean":jt,"to-color":Nt,"to-number":Ot,"to-string":Vt};class Ke{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(!Ye[i])throw new Error("Can't parse ".concat(i," as it is not part of the known types"));if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const r=Ye[i],n=[];for(let o=1;o<t.length;o++){const i=e.parse(t[o],o,Zt);if(!i)return null;n.push(i)}return new Ke(r,n)}evaluate(t){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(t));case"color":{let e,i;for(const r of this.args){if(e=r.evaluate(t),i=null,e instanceof Ce)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?"Invalid rgba value ".concat(JSON.stringify(e),": expected an array containing either three or four numeric values."):Ue(e[0],e[1],e[2],e[3]),!i))return new Ce(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Be(i||"Could not parse color from value '".concat("string"==typeof e?e:JSON.stringify(e),"'"))}case"padding":{let e;for(const i of this.args){e=i.evaluate(t);const r=Re.parse(e);if(r)return r}throw new Be("Could not parse padding from value '".concat("string"==typeof e?e:JSON.stringify(e),"'"))}case"numberArray":{let e;for(const i of this.args){e=i.evaluate(t);const r=Fe.parse(e);if(r)return r}throw new Be("Could not parse numberArray from value '".concat("string"==typeof e?e:JSON.stringify(e),"'"))}case"colorArray":{let e;for(const i of this.args){e=i.evaluate(t);const r=Le.parse(e);if(r)return r}throw new Be("Could not parse colorArray from value '".concat("string"==typeof e?e:JSON.stringify(e),"'"))}case"variableAnchorOffsetCollection":{let e;for(const i of this.args){e=i.evaluate(t);const r=Ve.parse(e);if(r)return r}throw new Be("Could not parse variableAnchorOffsetCollection from value '".concat("string"==typeof e?e:JSON.stringify(e),"'"))}case"number":{let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const r=Number(e);if(!isNaN(r))return r}throw new Be("Could not convert ".concat(JSON.stringify(e)," to number."))}case"formatted":return ke.fromString(qe(this.args[0].evaluate(t)));case"resolvedImage":return je.fromString(qe(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return qe(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}const Je=["Unknown","Point","LineString","Polygon"];class Qe{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Je[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(t){let e=this._parseColorCache.get(t);return e||(e=Ce.parse(t),this._parseColorCache.set(t,e)),e}}class $e{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Lt,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];this.registry=t,this.path=i,this.key=i.map((t=>"[".concat(t,"]"))).join(""),this.scope=n,this.errors=o,this.expectedType=r,this._isConstant=e}parse(t,e,i,r){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return e?this.concat(e,i,r)._parse(t,n):this._parse(t,n)}_parse(t,e){function i(t,e,i){return"assert"===i?new He(e,[t]):"coerce"===i?new Ke(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=t[0];if("string"!=typeof r)return this.error("Expression name must be a string, but found ".concat(typeof r,' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;const n=this.registry[r];if(n){let r=n.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind){if("projectionDefinition"===t.kind&&["string","array"].includes(n.kind)||["color","formatted","resolvedImage"].includes(t.kind)&&["value","string"].includes(n.kind)||["padding","numberArray"].includes(t.kind)&&["value","number","array"].includes(n.kind)||"colorArray"===t.kind&&["value","string","array"].includes(n.kind)||"variableAnchorOffsetCollection"===t.kind&&["value","array"].includes(n.kind))r=i(r,t,e.typeAnnotation||"coerce");else if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof We)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){const e=new Qe;try{r=new We(r.type,r.evaluate(e))}catch(t){return this.error(t.message),null}}return r}return this.error('Unknown expression "'.concat(r,'". If you wanted a literal array, use ["literal", [...]].'),0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found ".concat(typeof t," instead."))}concat(t,e,i){const r="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new $e(this.registry,this._isConstant,r,e||null,n,this.errors)}error(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;r<e;r++)i[r-1]=arguments[r];const n="".concat(this.key).concat(i.map((t=>"[".concat(t,"]"))).join(""));this.errors.push(new Ft(n,t))}checkSubtype(t,e){const i=ee(t,e);return i&&this.error(i),i}}class ti{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found ".concat(t.length-1," instead."));const i=[];for(let n=1;n<t.length-1;n+=2){const r=t[n];if("string"!=typeof r)return e.error("Expected string, but found ".concat(typeof r," instead."),n);if(/[^a-zA-Z0-9_]/.test(r))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);const o=e.parse(t[n+1],n+1);if(!o)return null;i.push([r,o])}const r=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return r?new ti(i,r):null}outputDefined(){return this.result.outputDefined()}}class ei{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new ei(i,e.scope.get(i)):e.error('Unknown variable "'.concat(i,'". Make sure "').concat(i,'" has been bound in an enclosing "let" expression before using it.'),1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class ii{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));const i=e.parse(t[1],1,Ot),r=e.parse(t[2],2,Qt(e.expectedType||Zt));return i&&r?new ii(r.type.itemType,i,r):null}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new Be("Array index out of bounds: ".concat(e," < 0."));if(e>=i.length)throw new Be("Array index out of bounds: ".concat(e," > ").concat(i.length-1,"."));if(e!==Math.floor(e))throw new Be("Array index must be an integer, but found ".concat(e," instead."));return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class ri{constructor(t,e){this.type=jt,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));const i=e.parse(t[1],1,Zt),r=e.parse(t[2],2,Zt);return i&&r?ie(i.type,[jt,Vt,Ot,Bt,Zt])?new ri(i,r):e.error("Expected first argument to be of type boolean, string, number or null, but found ".concat($t(i.type)," instead")):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!re(e,["boolean","string","number","null"]))throw new Be("Expected first argument to be of type boolean, string, number or null, but found ".concat($t(Ze(e))," instead."));if(!re(i,["string","array"]))throw new Be("Expected second argument to be of type array or string, but found ".concat($t(Ze(i))," instead."));return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class ni{constructor(t,e,i){this.type=Ot,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 2 or 3 arguments, but found ".concat(t.length-1," instead."));const i=e.parse(t[1],1,Zt),r=e.parse(t[2],2,Zt);if(!i||!r)return null;if(!ie(i.type,[jt,Vt,Ot,Bt,Zt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found ".concat($t(i.type)," instead"));if(4===t.length){const n=e.parse(t[3],3,Ot);return n?new ni(i,r,n):null}return new ni(i,r)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!re(e,["boolean","string","number","null"]))throw new Be("Expected first argument to be of type boolean, string, number or null, but found ".concat($t(Ze(e))," instead."));let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(t)),re(i,["string"])){const t=i.indexOf(e,r);return-1===t?-1:[...i.slice(0,t)].length}if(re(i,["array"]))return i.indexOf(e,r);throw new Be("Expected second argument to be of type array or string, but found ".concat($t(Ze(i))," instead."))}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class oi{constructor(t,e,i,r,n,o){this.inputType=t,this.type=e,this.input=i,this.cases=r,this.outputs=n,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const n={},o=[];for(let l=2;l<t.length-1;l+=2){let a=t[l];const s=t[l+1];
1Array.isArray(a)||(a=[a]);const c=e.concat(l);if(0===a.length)return c.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return c.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,Ze(t)))return null}else i=Ze(t);if(void 0!==n[String(t)])return c.error("Branch labels must be unique.");n[String(t)]=o.length}const h=e.parse(s,l,r);if(!h)return null;r=r||h.type,o.push(h)}const a=e.parse(t[1],1,Zt);if(!a)return null;const s=e.parse(t[t.length-1],t.length-1,r);return s?"value"!==a.type.kind&&e.concat(1).checkSubtype(i,a.type)?null:new oi(i,r,a,n,o,s):null}evaluate(t){const e=this.input.evaluate(t);return(Ze(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))&&this.otherwise.outputDefined()}}class ai{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const r=[];for(let o=1;o<t.length-1;o+=2){const n=e.parse(t[o],o,jt);if(!n)return null;const a=e.parse(t[o+1],o+1,i);if(!a)return null;r.push([n,a]),i=i||a.type}const n=e.parse(t[t.length-1],t.length-1,i);if(!n)return null;if(!i)throw new Error("Can't infer output type");return new ai(i,r,n)}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every((t=>{let[e,i]=t;return i.outputDefined()}))&&this.otherwise.outputDefined()}}class si{constructor(t,e,i,r){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 2 or 3 arguments, but found ".concat(t.length-1," instead."));const i=e.parse(t[1],1,Zt),r=e.parse(t[2],2,Ot);if(!i||!r)return null;if(!ie(i.type,[Qt(Zt),Vt,Zt]))return e.error("Expected first argument to be of type array or string, but found ".concat($t(i.type)," instead"));if(4===t.length){const n=e.parse(t[3],3,Ot);return n?new si(i.type,i,r,n):null}return new si(i.type,i,r)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);let r;if(this.endIndex&&(r=this.endIndex.evaluate(t)),re(e,["string"]))return[...e].slice(i,r).join("");if(re(e,["array"]))return e.slice(i,r);throw new Be("Expected first argument to be of type array or string, but found ".concat($t(Ze(e))," instead."))}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function li(t,e){const i=t.length-1;let r,n,o=0,a=i,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),r=t[s],n=t[s+1],r<=e){if(s===i||e<n)return s;o=s+1}else{if(!(r>e))throw new Be("Input is not a number.");a=s-1}return 0}class ci{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[r,n]of i)this.labels.push(r),this.outputs.push(n)}static parse(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,Ot);if(!i)return null;const r=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let o=1;o<t.length;o+=2){const i=1===o?-1/0:t[o],a=t[o+1],s=o,l=o+1;if("number"!=typeof i)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(r.length&&r[r.length-1][0]>=i)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=e.parse(a,l,n);if(!c)return null;
vendor: 24,482 bytes, line 1
1n=n||c.type,r.push([i,c])}return new ci(n,i,r)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const n=e.length;return r>=e[n-1]?i[n-1].evaluate(t):i[li(e,r)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function hi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ui,di,pi=function(){if(di)return ui;function t(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=r}return di=1,ui=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var n=this.sampleCurveX(i)-t;if(Math.abs(n)<e)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i-=n/o}var a=0,s=1;for(i=t,r=0;r<20&&(n=this.sampleCurveX(i),!(Math.abs(n-t)<e));r++)t>n?a=i:s=i,i=.5*(s-a)+a;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},ui}(),fi=hi(pi);class mi{constructor(t,e,i,r,n){this.type=t,this.operator=e,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[o,a]of n)this.labels.push(o),this.outputs.push(a)}static interpolationFactor(t,e,i,r){let n=0;if("exponential"===t.name)n=gi(e,t.base,i,r);else if("linear"===t.name)n=gi(e,1,i,r);else if("cubic-bezier"===t.name){const o=t.controlPoints;n=new fi(o[0],o[1],o[2],o[3]).solve(gi(e,1,i,r))}return n}static parse(t,e){let[i,r,n,...o]=t;if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const t=r[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return e.error("Unknown interpolation type ".concat(String(r[0])),1,0);{const t=r.slice(1);if(4!==t.length||t.some((t=>"number"!=typeof t||t<0||t>1)))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(n=e.parse(n,2,Ot),!n)return null;const a=[];let s=null;"interpolate-hcl"!==i&&"interpolate-lab"!==i||e.expectedType==Ht?e.expectedType&&"value"!==e.expectedType.kind&&(s=e.expectedType):s=Nt;for(let l=0;l<o.length;l+=2){const t=o[l],i=o[l+1],r=l+3,n=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',r);if(a.length&&a[a.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',r);const c=e.parse(i,n,s);if(!c)return null;s=s||c.type,a.push([t,c])}return ne(s,Ot)||ne(s,Ut)||ne(s,Nt)||ne(s,Xt)||ne(s,Yt)||ne(s,Ht)||ne(s,Jt)||ne(s,Qt(Ot))?new mi(s,i,r,n,a):e.error("Type ".concat($t(s)," is not interpolatable."))}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const n=e.length;if(r>=e[n-1])return i[n-1].evaluate(t);const o=li(e,r),a=mi.interpolationFactor(this.interpolation,r,e[o],e[o+1]),s=i[o].evaluate(t),l=i[o+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Me(s,l,a);case"color":return Ce.interpolate(s,l,a);case"padding":return Re.interpolate(s,l,a);case"colorArray":return Le.interpolate(s,l,a);case"numberArray":return Fe.interpolate(s,l,a);case"variableAnchorOffsetCollection":return Ve.interpolate(s,l,a);case"array":return Ee(s,l,a);case"projectionDefinition":return Ne.interpolate(s,l,a)}case"interpolate-hcl":switch(this.type.kind){case"color":return Ce.interpolate(s,l,a,"hcl");case"colorArray":return Le.interpolate(s,l,a,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Ce.interpolate(s,l,a,"lab");case"colorArray":return Le.interpolate(s,l,a,"lab")}}}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every((t=>t.outputDefined()))}}function gi(t,e,i,r){const n=r-i,o=t-i;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}const _i={color:Ce.interpolate,number:Me,padding:Re.interpolate,numberArray:Fe.interpolate,colorArray:Le.interpolate,variableAnchorOffsetCollection:Ve.interpolate,array:Ee};class yi{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i=null;const r=e.expectedType;r&&"value"!==r.kind&&(i=r);const n=[];for(const a of t.slice(1)){const t=e.parse(a,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,n.push(t)}if(!i)throw new Error("No output type");const o=r&&n.some((t=>ee(r,t.type)));return new yi(o?Zt:i,n)}evaluate(t){let e,i=null,r=0;for(const n of this.args)if(r++,i=n.evaluate(t),i&&i instanceof je&&!i.available&&(e||(e=i.name),i=null,r===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every((t=>t.outputDefined()))}}function vi(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function xi(t,e,i,r){return 0===r.compare(e,i)}function bi(t,e,i){const r="=="!==t&&"!="!==t;return class n{constructor(t,e,i){this.type=jt,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let o=e.parse(t[1],1,Zt);if(!o)return null;if(!vi(i,o.type))return e.concat(1).error('"'.concat(i,"\" comparisons are not supported for type '").concat($t(o.type),"'."));let a=e.parse(t[2],2,Zt);if(!a)return null;if(!vi(i,a.type))return e.concat(2).error('"'.concat(i,"\" comparisons are not supported for type '").concat($t(a.type),"'."));if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '".concat($t(o.type),"' and '").concat($t(a.type),"'."));r&&("value"===o.type.kind&&"value"!==a.type.kind?o=new He(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new He(o.type,[a])));let s=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(s=e.parse(t[3],3,qt),!s)return null}return new n(o,a,s)}evaluate(n){const o=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){const e=Ze(o),i=Ze(a);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new Be('Expected arguments for "'.concat(t,'" to be (string, string) or (number, number), but found (').concat(e.kind,", ").concat(i.kind,") instead."))}if(this.collator&&!r&&this.hasUntypedArgument){const t=Ze(o),i=Ze(a);if("string"!==t.kind||"string"!==i.kind)return e(n,o,a)}return this.collator?i(n,o,a,this.collator.evaluate(n)):e(n,o,a)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}const wi=bi("==",(function(t,e,i){return e===i}),xi),Ti=bi("!=",(function(t,e,i){return e!==i}),(function(t,e,i,r){return!xi(0,e,i,r)})),Si=bi("<",(function(t,e,i){return e<i}),(function(t,e,i,r){return r.compare(e,i)<0})),Pi=bi(">",(function(t,e,i){return e>i}),(function(t,e,i,r){return r.compare(e,i)>0})),Ii=bi("<=",(function(t,e,i){return e<=i}),(function(t,e,i,r){return r.compare(e,i)<=0})),Mi=bi(">=",(function(t,e,i){return e>=i}),(function(t,e,i,r){return r.compare(e,i)>=0}));class Ei{constructor(t,e,i){this.type=qt,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const r=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,jt);if(!r)return null;const n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,jt);if(!n)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Vt),!o)?null:new Ei(r,n,o)}evaluate(t){return new Ae(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class Ci{constructor(t,e,i,r,n,o){this.type=Vt,this.number=t,this.locale=e,this.currency=i,this.unit=r,this.minFractionDigits=n,this.maxFractionDigits=o}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Ot);if(!i)return null;const r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");let n=null;if(r.locale&&(n=e.parse(r.locale,1,Vt),!n))return null;let o=null;if(r.currency&&(o=e.parse(r.currency,1,Vt),!o))return null;let a=null;if(r.unit&&(a=e.parse(r.unit,1,Vt),!a))return null;if(o&&a)return e.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(r["min-fraction-digits"]&&(s=e.parse(r["min-fraction-digits"],1,Ot),!s))return null;let l=null;return r["max-fraction-digits"]&&(l=e.parse(r["max-fraction-digits"],1,Ot),!l)?null:new Ci(i,n,o,a,s,l)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,unit:this.unit?this.unit.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.unit&&t(this.unit),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Ai{constructor(t){this.type=Wt,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const r=[];let n=!1;for(let o=1;o<=t.length-1;++o){const i=t[o];if(n&&"object"==typeof i&&!Array.isArray(i)){n=!1;let t=null;if(i["font-scale"]&&(t=e.parse(i["font-scale"],1,Ot),!t))return null;let o=null;if(i["text-font"]&&(o=e.parse(i["text-font"],1,Qt(Vt)),!o))return null;let a=null;if(i["text-color"]&&(a=e.parse(i["text-color"],1,Nt),!a))return null;let s=null;if(i["vertical-align"]){if("string"==typeof i["vertical-align"]&&!De.includes(i["vertical-align"]))return e.error("'vertical-align' must be one of: 'bottom', 'center', 'top' but found '".concat(i["vertical-align"],"' instead."));if(s=e.parse(i["vertical-align"],1,Vt),!s)return null}const l=r[r.length-1];l.scale=t,l.font=o,l.textColor=a,l.verticalAlign=s}else{const i=e.parse(t[o],1,Zt);if(!i)return null;const a=i.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:i,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Ai(r)}evaluate(t){return new ke(this.sections.map((e=>{const i=e.content.evaluate(t);return Ze(i)===Kt?new ze("",i,null,null,null,e.verticalAlign?e.verticalAlign.evaluate(t):null):new ze(qe(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null,e.verticalAlign?e.verticalAlign.evaluate(t):null)})))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor),e.verticalAlign&&t(e.verticalAlign)}outputDefined(){return!1}}class Di{constructor(t){this.type=Kt,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Vt);return i?new Di(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=je.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}}class zi{constructor(t){this.type=Ot,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found ".concat(t.length-1," instead."));const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found ".concat($t(i.type)," instead.")):new zi(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return[...e].length;if(Array.isArray(e))return e.length;throw new Be("Expected value to be of type string or array, but found ".concat($t(Ze(e))," instead."))}eachChild(t){t(this.input)}outputDefined(){return!1}}const ki=8192;function Ri(t,e){const i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,n=Math.pow(2,e.z);return[Math.round(i*n*ki),Math.round(r*n*ki)]}function Fi(t,e){const i=Math.pow(2,e.z);return[(n=(t[0]/ki+e.x)/i,360*n-180),(r=(t[1]/ki+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90)];var r,n}function Li(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Bi(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Oi(t,e,i){const r=t[0]-e[0],n=t[1]-e[1],o=t[0]-i[0],a=t[1]-i[1];return r*a-o*n==0&&r*o<=0&&n*a<=0}function Vi(t,e,i,r){return 0!=(n=[r[0]-i[0],r[1]-i[1]])[0]*(o=[e[0]-t[0],e[1]-t[1]])[1]-n[1]*o[0]&&!(!qi(t,e,i,r)||!qi(i,r,t,e));var n,o}function ji(t,e,i){for(const r of i)for(let i=0;i<r.length-1;++i)if(Vi(t,e,r[i],r[i+1]))return!0;return!1}function Ni(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!1;for(const s of e)for(let e=0;e<s.length-1;e++){if(Oi(t,s[e],s[e+1]))return i;(o=s[e])[1]>(n=t)[1]!=(a=s[e+1])[1]>n[1]&&n[0]<(a[0]-o[0])*(n[1]-o[1])/(a[1]-o[1])+o[0]&&(r=!r)}var n,o,a;return r}function Ui(t,e){for(const i of e)if(Ni(t,i))return!0;return!1}function Gi(t,e){for(const i of t)if(!Ni(i,e))return!1;for(let i=0;i<t.length-1;++i)if(ji(t[i],t[i+1],e))return!1;return!0}function Zi(t,e){for(const i of e)if(Gi(t,i))return!0;return!1}function qi(t,e,i,r){const n=r[0]-i[0],o=r[1]-i[1],a=(t[0]-i[0])*o-n*(t[1]-i[1]),s=(e[0]-i[0])*o-n*(e[1]-i[1]);return a>0&&s<0||a<0&&s>0}function Wi(t,e,i){const r=[];for(let n=0;n<t.length;n++){const o=[];for(let r=0;r<t[n].length;r++){const a=Ri(t[n][r],i);Li(e,a),o.push(a)}r.push(o)}return r}function Xi(t,e,i){const r=[];for(let n=0;n<t.length;n++){const o=Wi(t[n],e,i);r.push(o)}return r}function Hi(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){const e=.5*r;let n=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===n&&(n=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=n}Li(e,t)}function Yi(t,e,i,r){const n=Math.pow(2,r.z)*ki,o=[r.x*ki,r.y*ki],a=[];for(const s of t)for(const t of s){const r=[t.x+o[0],t.y+o[1]];Hi(r,e,i,n),a.push(r)}return a}function Ki(t,e,i,r){const n=Math.pow(2,r.z)*ki,o=[r.x*ki,r.y*ki],a=[];for(const l of t){const t=[];for(const i of l){const r=[i.x+o[0],i.y+o[1]];Li(e,r),t.push(r)}a.push(t)}if(e[2]-e[0]<=n/2){(s=e)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const t of a)for(const r of t)Hi(r,e,i,n)}var s;return a}class Ji{constructor(t,e){this.type=jt,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(Ge(t[1])){const e=t[1];if("FeatureCollection"===e.type){const t=[];for(const i of e.features){const{type:e,coordinates:r}=i.geometry;"Polygon"===e&&t.push(r),"MultiPolygon"===e&&t.push(...r)}if(t.length)return new Ji(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Ji(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Ji(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const o=Wi(e.coordinates,r,n),a=Yi(t.geometry(),i,r,n);if(!Bi(i,r))return!1;for(const t of a)if(!Ni(t,o))return!1}if("MultiPolygon"===e.type){const o=Xi(e.coordinates,r,n),a=Yi(t.geometry(),i,r,n);if(!Bi(i,r))return!1;for(const t of a)if(!Ui(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const o=Wi(e.coordinates,r,n),a=Ki(t.geometry(),i,r,n);if(!Bi(i,r))return!1;for(const t of a)if(!Gi(t,o))return!1}if("MultiPolygon"===e.type){const o=Xi(e.coordinates,r,n),a=Ki(t.geometry(),i,r,n);if(!Bi(i,r))return!1;for(const t of a)if(!Zi(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Qi=class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e)=>t<e?-1:t>e?1:0;if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const n=t-1>>1,o=e[n];if(i(r,o)>=0)break;e[t]=o,t=n}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,n=e[t];for(;t<r;){let r=1+(t<<1);const o=r+1;if(o<this.length&&i(e[o],e[r])<0&&(r=o),i(e[r],n)>=0)break;e[t]=e[r],t=r}e[t]=n}};function $i(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length-1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:er;for(;r>i;){if(r-i>600){const o=r-i+1,a=e-i+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);$i(t,e,Math.max(i,Math.floor(e-a*l/o+c)),Math.min(r,Math.floor(e+(o-a)*l/o+c)),n)}const o=t[e];let a=i,s=r;for(tr(t,i,e),n(t[r],o)>0&&tr(t,i,r);a<s;){for(tr(t,a,s),a++,s--;n(t[a],o)<0;)a++;for(;n(t[s],o)>0;)s--}0===n(t[i],o)?tr(t,i,s):(s++,tr(t,s,r)),s<=e&&(i=s+1),e<=s&&(r=s-1)}}function tr(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function er(t,e){return t<e?-1:t>e?1:0}function ir(t,e){if(t.length<=1)return[t];const i=[];let r,n;for(const o of t){const t=nr(o);0!==t&&(o.area=Math.abs(t),void 0===n&&(n=t<0),n===t<0?(r&&i.push(r),r=[o]):r.push(o))}if(r&&i.push(r),e>1)for(let o=0;o<i.length;o++)i[o].length<=e||($i(i[o],e,1,i[o].length-1,rr),i[o]=i[o].slice(0,e));return i}function rr(t,e){return e.area-t.area}function nr(t){let e=0;for(let i,r,n=0,o=t.length,a=o-1;n<o;a=n++)i=t[n],r=t[a],e+=(r.x-i.x)*(i.y+r.y);return e}const or=1/298.257223563,ar=or*(2-or),sr=Math.PI/180;class lr{constructor(t){const e=6378.137*sr*1e3,i=Math.cos(t*sr),r=1/(1-ar*(1-i*i)),n=Math.sqrt(r);this.kx=e*n*i,this.ky=e*n*r*(1-ar)}distance(t,e){const i=this.wrap(t[0]-e[0])*this.kx,r=(t[1]-e[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(t,e){let i,r,n,o,a=1/0;for(let s=0;s<t.length-1;s++){let l=t[s][0],c=t[s][1],h=this.wrap(t[s+1][0]-l)*this.kx,u=(t[s+1][1]-c)*this.ky,d=0;0===h&&0===u||(d=(this.wrap(e[0]-l)*this.kx*h+(e[1]-c)*this.ky*u)/(h*h+u*u),d>1?(l=t[s+1][0],c=t[s+1][1]):d>0&&(l+=h/this.kx*d,c+=u/this.ky*d)),h=this.wrap(e[0]-l)*this.kx,u=(e[1]-c)*this.ky;const p=h*h+u*u;p<a&&(a=p,i=l,r=c,n=s,o=d)}return{point:[i,r],index:n,t:Math.max(0,Math.min(1,o))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function cr(t,e){return e[0]-t[0]}function hr(t){return t[1]-t[0]+1}function ur(t,e){return t[1]>=t[0]&&t[1]<e}function dr(t,e){if(t[0]>t[1])return[null,null];const i=hr(t);if(e){if(2===i)return[t,null];const e=Math.floor(i/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===i)return[t,null];const r=Math.floor(i/2)-1;return[[t[0],t[0]+r],[t[0]+r+1,t[1]]]}function pr(t,e){if(!ur(e,t.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let r=e[0];r<=e[1];++r)Li(i,t[r]);return i}function fr(t){const e=[1/0,1/0,-1/0,-1/0];for(const i of t)for(const t of i)Li(e,t);return e}function mr(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function gr(t,e,i){if(!mr(t)||!mr(e))return NaN;let r=0,n=0;return t[2]<e[0]&&(r=e[0]-t[2]),t[0]>e[2]&&(r=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]<e[1]&&(n=e[1]-t[3]),i.distance([0,0],[r,n])}function _r(t,e,i){const r=i.pointOnLine(e,t);return i.distance(t,r.point)}function yr(t,e,i,r,n){const o=Math.min(_r(t,[i,r],n),_r(e,[i,r],n)),a=Math.min(_r(i,[t,e],n),_r(r,[t,e],n));return Math.min(o,a)}function vr(t,e,i,r,n){if(!ur(e,t.length)||!ur(r,i.length))return 1/0;let o=1/0;for(let a=e[0];a<e[1];++a){const e=t[a],s=t[a+1];for(let t=r[0];t<r[1];++t){const r=i[t],a=i[t+1];if(Vi(e,s,r,a))return 0;o=Math.min(o,yr(e,s,r,a,n))}}return o}function xr(t,e,i,r,n){if(!ur(e,t.length)||!ur(r,i.length))return NaN;let o=1/0;for(let a=e[0];a<=e[1];++a)for(let e=r[0];e<=r[1];++e)if(o=Math.min(o,n.distance(t[a],i[e])),0===o)return o;return o}function br(t,e,i){if(Ni(t,e,!0))return 0;let r=1/0;for(const n of e){const e=n[0],o=n[n.length-1];if(e!==o&&(r=Math.min(r,_r(t,[o,e],i)),0===r))return r;const a=i.pointOnLine(n,t);if(r=Math.min(r,i.distance(t,a.point)),0===r)return r}return r}function wr(t,e,i,r){if(!ur(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(Ni(t[o],i,!0))return 0;let n=1/0;for(let o=e[0];o<e[1];++o){const e=t[o],a=t[o+1];for(const t of i)for(let i=0,o=t.length,s=o-1;i<o;s=i++){const o=t[s],l=t[i];if(Vi(e,a,o,l))return 0;n=Math.min(n,yr(e,a,o,l,r))}}return n}function Tr(t,e){for(const i of t)for(const t of i)if(Ni(t,e,!0))return!0;return!1}function Sr(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;const n=fr(t),o=fr(e);if(r!==1/0&&gr(n,o,i)>=r)return r;if(Bi(n,o)){if(Tr(t,e))return 0}else if(Tr(e,t))return 0;let a=1/0;for(const s of t)for(let t=0,r=s.length,n=r-1;t<r;n=t++){const r=s[n],o=s[t];for(const t of e)for(let e=0,n=t.length,s=n-1;e<n;s=e++){const n=t[s],l=t[e];if(Vi(r,o,n,l))return 0;a=Math.min(a,yr(r,o,n,l,i))}}return a}function Pr(t,e,i,r,n,o){if(!o)return;const a=gr(pr(r,o),n,i);a<e&&t.push([a,o,[0,0]])}function Ir(t,e,i,r,n,o,a){if(!o||!a)return;const s=gr(pr(r,o),pr(n,a),i);s<e&&t.push([s,o,a])}function Mr(t,e,i,r){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,o=Math.min(r.distance(t[0],i[0][0]),n);if(0===o)return o;const a=new Qi([[0,[0,t.length-1],[0,0]]],cr),s=fr(i);for(;a.length>0;){const n=a.pop();if(n[0]>=o)continue;const l=n[1],c=e?50:100;if(hr(l)<=c){if(!ur(l,t.length))return NaN;if(e){const e=wr(t,l,i,r);if(isNaN(e)||0===e)return e;o=Math.min(o,e)}else for(let e=l[0];e<=l[1];++e){const n=br(t[e],i,r);if(o=Math.min(o,n),0===o)return 0}}else{const i=dr(l,e);Pr(a,o,r,t,s,i[0]),Pr(a,o,r,t,s,i[1])}}return o}function Er(t,e,i,r,n){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1/0,a=Math.min(o,n.distance(t[0],i[0]));if(0===a)return a;const s=new Qi([[0,[0,t.length-1],[0,i.length-1]]],cr);for(;s.length>0;){const o=s.pop();if(o[0]>=a)continue;const l=o[1],c=o[2],h=e?50:100,u=r?50:100;if(hr(l)<=h&&hr(c)<=u){if(!ur(l,t.length)&&ur(c,i.length))return NaN;let o;if(e&&r)o=vr(t,l,i,c,n),a=Math.min(a,o);else if(e&&!r){const e=t.slice(l[0],l[1]+1);for(let t=c[0];t<=c[1];++t)if(o=_r(i[t],e,n),a=Math.min(a,o),0===a)return a}else if(!e&&r){const e=i.slice(c[0],c[1]+1);for(let i=l[0];i<=l[1];++i)if(o=_r(t[i],e,n),a=Math.min(a,o),0===a)return a}else o=xr(t,l,i,c,n),a=Math.min(a,o)}else{const o=dr(l,e),h=dr(c,r);Ir(s,a,n,t,i,o[0],h[0]),Ir(s,a,n,t,i,o[0],h[1]),Ir(s,a,n,t,i,o[1],h[0]),Ir(s,a,n,t,i,o[1],h[1])}}return a}
1function Cr(t){return"MultiPolygon"===t.type?t.coordinates.map((t=>({type:"Polygon",coordinates:t}))):"MultiLineString"===t.type?t.coordinates.map((t=>({type:"LineString",coordinates:t}))):"MultiPoint"===t.type?t.coordinates.map((t=>({type:"Point",coordinates:t}))):[t]}class Ar{constructor(t,e){this.type=Ot,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error("'distance' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(Ge(t[1])){const e=t[1];if("FeatureCollection"===e.type)return new Ar(e,e.features.map((t=>Cr(t.geometry))).flat());if("Feature"===e.type)return new Ar(e,Cr(e.geometry));if("type"in e&&"coordinates"in e)return new Ar(e,Cr(e))}return e.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=t.geometry(),r=i.flat().map((e=>Fi([e.x,e.y],t.canonical)));if(0===i.length)return NaN;const n=new lr(r[0][1]);let o=1/0;for(const a of e){switch(a.type){case"Point":o=Math.min(o,Er(r,!1,[a.coordinates],!1,n,o));break;case"LineString":o=Math.min(o,Er(r,!1,a.coordinates,!0,n,o));break;case"Polygon":o=Math.min(o,Mr(r,!1,a.coordinates,n,o))}if(0===o)return o}return o}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=t.geometry(),r=i.flat().map((e=>Fi([e.x,e.y],t.canonical)));if(0===i.length)return NaN;const n=new lr(r[0][1]);let o=1/0;for(const a of e){switch(a.type){case"Point":o=Math.min(o,Er(r,!0,[a.coordinates],!1,n,o));break;case"LineString":o=Math.min(o,Er(r,!0,a.coordinates,!0,n,o));break;case"Polygon":o=Math.min(o,Mr(r,!0,a.coordinates,n,o))}if(0===o)return o}return o}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){const i=t.geometry();if(0===i.length||0===i[0].length)return NaN;const r=ir(i,0).map((e=>e.map((e=>e.map((e=>Fi([e.x,e.y],t.canonical))))))),n=new lr(r[0][0][0][1]);let o=1/0;for(const a of e)for(const t of r){switch(a.type){case"Point":o=Math.min(o,Mr([a.coordinates],!1,t,n,o));break;case"LineString":o=Math.min(o,Mr(a.coordinates,!0,t,n,o));break;case"Polygon":o=Math.min(o,Sr(t,a.coordinates,n,o))}if(0===o)return o}return o}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Dr{constructor(t){this.type=Zt,this.key=t}static parse(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found ".concat(t.length-1," instead."));const i=t[1];return null==i?e.error("Global state property must be defined."):"string"!=typeof i?e.error("Global state property must be string, but found ".concat(typeof t[1]," instead.")):new Dr(i)}evaluate(t){var e;const i=null===(e=t.globals)||void 0===e?void 0:e.globalState;return i&&0!==Object.keys(i).length?be(i,this.key):null}eachChild(){}outputDefined(){return!1}}const zr={"==":wi,"!=":Ti,">":Pi,"<":Si,">=":Mi,"<=":Ii,array:He,at:ii,boolean:He,case:ai,coalesce:yi,collator:Ei,format:Ai,image:Di,in:ri,"index-of":ni,interpolate:mi,"interpolate-hcl":mi,"interpolate-lab":mi,length:zi,let:ti,literal:We,match:oi,number:He,"number-format":Ci,object:He,slice:si,step:ci,string:He,"to-boolean":Ke,"to-color":Ke,"to-number":Ke,"to-string":Ke,var:ei,within:Ji,distance:Ar,"global-state":Dr};class kr{constructor(t,e,i,r){this.name=t,this.type=e,this._evaluate=i,this.args=r}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){const i=t[0],r=kr.definitions[i];if(!r)return e.error('Unknown expression "'.concat(i,'". If you wanted a literal array, use ["literal", [...]].'),0);const n=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=o.filter((e=>{let[i]=e;return!Array.isArray(i)||i.length===t.length-1}));let s=null;for(const[l,c]of a){s=new $e(e.registry,Or,e.path,null,e.scope);const r=[];let o=!1;for(let e=1;e<t.length;e++){const i=t[e],n=Array.isArray(l)?l[e-1]:l.type,a=s.parse(i,1+r.length,n);if(!a){o=!0;break}r.push(a)}if(!o)if(Array.isArray(l)&&l.length!==r.length)s.error("Expected ".concat(l.length," arguments, but found ").concat(r.length," instead."));else{for(let t=0;t<r.length;t++){const e=Array.isArray(l)?l[t]:l.type,i=r[t];s.concat(t+1).checkSubtype(e,i.type)}if(0===s.errors.length)return new kr(i,n,c,r)}}if(1===a.length)e.errors.push(...s.errors);else{const i=(a.length?a:o).map((t=>{let[e]=t;return i=e,Array.isArray(i)?"(".concat(i.map($t).join(", "),")"):"(".concat($t(i.type),"...)");var i})).join(" | "),r=[];for(let n=1;n<t.length;n++){const i=e.parse(t[n],1+r.length);if(!i)return null;r.push($t(i.type))}e.error("Expected arguments of type ".concat(i,", but found (").concat(r.join(", "),") instead."))}return null}static register(t,e){kr.definitions=e;for(const i in e)t[i]=kr}}function Rr(t,e){let[i,r,n,o]=e;i=i.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);const a=o?o.evaluate(t):1,s=Ue(i,r,n,a);if(s)throw new Be(s);return new Ce(i/255,r/255,n/255,a,!1)}function Fr(t,e){return t in e}function Lr(t,e){const i=e[t];return void 0===i?null:i}function Br(t){return{type:t}}function Or(t){if(t instanceof ei)return Or(t.boundExpression);if(t instanceof kr&&"error"===t.name)return!1;if(t instanceof Ei)return!1;if(t instanceof Ji)return!1;if(t instanceof Ar)return!1;if(t instanceof Dr)return!1;const e=t instanceof Ke||t instanceof He;let i=!0;return t.eachChild((t=>{i=e?i&&Or(t):i&&t instanceof We})),!!i&&Vr(t)&&Nr(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function Vr(t){if(t instanceof kr){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Ji)return!1;if(t instanceof Ar)return!1;let e=!0;return t.eachChild((t=>{e&&!Vr(t)&&(e=!1)})),e}function jr(t){if(t instanceof kr&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild((t=>{e&&!jr(t)&&(e=!1)})),e}function Nr(t,e){if(t instanceof kr&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild((t=>{i&&!Nr(t,e)&&(i=!1)})),i}function Ur(t){return{result:"success",value:t}}function Gr(t){return{result:"error",value:t}}function Zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function qr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Wr(t){return!!t.expression&&t.expression.interpolated}function Xr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Hr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&Ze(t)===Gt}function Yr(t){return t}function Kr(t,e){const i=t.stops&&"object"==typeof t.stops[0][0],r=i||!(i||void 0!==t.property),n=t.type||(Wr(e)?"exponential":"interval"),o=function(t){switch(t.type){case"color":return Ce.parse;case"padding":return Re.parse;case"numberArray":return Fe.parse;case"colorArray":return Le.parse;default:return null}}(e);if(o&&((t=Rt({},t)).stops&&(t.stops=t.stops.map((t=>[t[0],o(t[1])]))),t.default=o(t.default?t.default:e.default)),t.colorSpace&&"rgb"!==(a=t.colorSpace)&&"hcl"!==a&&"lab"!==a)throw new Error('Unknown color space: "'.concat(t.colorSpace,'"'));var a;const s=function(t){switch(t){case"exponential":return tn;case"interval":return $r;case"categorical":return Qr;case"identity":return en;default:throw new Error('Unknown function type "'.concat(t,'"'))}}(n);let l,c;if("categorical"===n){l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}if(i){const i={},r=[];for(let e=0;e<t.stops.length;e++){const n=t.stops[e],o=n[0].zoom;void 0===i[o]&&(i[o]={zoom:o,type:t.type,property:t.property,default:t.default,stops:[]},r.push(o)),i[o].stops.push([n[0].value,n[1]])}const n=[];for(const t of r)n.push([i[t].zoom,Kr(i[t],e)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:mi.interpolationFactor.bind(void 0,o),zoomStops:n.map((t=>t[0])),evaluate:(i,r)=>{let{zoom:o}=i;return tn({stops:n,base:t.base},e,o).evaluate(o,r)}}}if(r){const i="exponential"===n?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:mi.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map((t=>t[0])),evaluate:i=>{let{zoom:r}=i;return s(t,e,r,l,c)}}}return{kind:"source",evaluate(i,r){const n=r&&r.properties?r.properties[t.property]:void 0;return void 0===n?Jr(t.default,e.default):s(t,e,n,l,c)}}}function Jr(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Qr(t,e,i,r,n){return Jr(typeof i===n?r[i]:void 0,t.default,e.default)}function $r(t,e,i){if("number"!==Xr(i))return Jr(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const n=li(t.stops.map((t=>t[0])),i);return t.stops[n][1]}function tn(t,e,i){const r=void 0!==t.base?t.base:1;if("number"!==Xr(i))return Jr(t.default,e.default);const n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];const o=li(t.stops.map((t=>
1t[0])),i),a=function(t,e,i,r){const n=r-i,o=t-i;return 0===n?0:1===e?o/n:(Math.pow(e,o)-1)/(Math.pow(e,n)-1)}(i,r,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],l=t.stops[o+1][1],c=_i[e.type]||Yr;return"function"==typeof s.evaluate?{evaluate(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];const n=s.evaluate.apply(void 0,i),o=l.evaluate.apply(void 0,i);if(void 0!==n&&void 0!==o)return c(n,o,a,t.colorSpace)}}:c(s,l,a,t.colorSpace)}function en(t,e,i){switch(e.type){case"color":i=Ce.parse(i);break;case"formatted":i=ke.fromString(i.toString());break;case"resolvedImage":i=je.fromString(i.toString());break;case"padding":i=Re.parse(i);break;case"colorArray":i=Le.parse(i);break;case"numberArray":i=Fe.parse(i);break;default:Xr(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0)}return Jr(i,t.default,e.default)}kr.register(zr,{error:[{kind:"error"},[Vt],(t,e)=>{let[i]=e;throw new Be(i.evaluate(t))}],typeof:[Vt,[Zt],(t,e)=>{let[i]=e;return $t(Ze(i.evaluate(t)))}],"to-rgba":[Qt(Ot,4),[Nt],(t,e)=>{let[i]=e;const[r,n,o,a]=i.evaluate(t).rgb;return[255*r,255*n,255*o,a]}],rgb:[Nt,[Ot,Ot,Ot],Rr],rgba:[Nt,[Ot,Ot,Ot,Ot],Rr],has:{type:jt,overloads:[[[Vt],(t,e)=>{let[i]=e;return Fr(i.evaluate(t),t.properties())}],[[Vt,Gt],(t,e)=>{let[i,r]=e;return Fr(i.evaluate(t),r.evaluate(t))}]]},get:{type:Zt,overloads:[[[Vt],(t,e)=>{let[i]=e;return Lr(i.evaluate(t),t.properties())}],[[Vt,Gt],(t,e)=>{let[i,r]=e;return Lr(i.evaluate(t),r.evaluate(t))}]]},"feature-state":[Zt,[Vt],(t,e)=>{let[i]=e;return Lr(i.evaluate(t),t.featureState||{})}],properties:[Gt,[],t=>t.properties()],"geometry-type":[Vt,[],t=>t.geometryType()],id:[Zt,[],t=>t.id()],zoom:[Ot,[],t=>t.globals.zoom],"heatmap-density":[Ot,[],t=>t.globals.heatmapDensity||0],elevation:[Ot,[],t=>t.globals.elevation||0],"line-progress":[Ot,[],t=>t.globals.lineProgress||0],accumulated:[Zt,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Ot,Br(Ot),(t,e)=>{let i=0;for(const r of e)i+=r.evaluate(t);return i}],"*":[Ot,Br(Ot),(t,e)=>{let i=1;for(const r of e)i*=r.evaluate(t);return i}],"-":{type:Ot,overloads:[[[Ot,Ot],(t,e)=>{let[i,r]=e;return i.evaluate(t)-r.evaluate(t)}],[[Ot],(t,e)=>{let[i]=e;return-i.evaluate(t)}]]},"/":[Ot,[Ot,Ot],(t,e)=>{let[i,r]=e;return i.evaluate(t)/r.evaluate(t)}],"%":[Ot,[Ot,Ot],(t,e)=>{let[i,r]=e;return i.evaluate(t)%r.evaluate(t)}],ln2:[Ot,[],()=>Math.LN2],pi:[Ot,[],()=>Math.PI],e:[Ot,[],()=>Math.E],"^":[Ot,[Ot,Ot],(t,e)=>{let[i,r]=e;return Math.pow(i.evaluate(t),r.evaluate(t))}],sqrt:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.sqrt(i.evaluate(t))}],log10:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.log(i.evaluate(t))/Math.LN10}],ln:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.log(i.evaluate(t))}],log2:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.log(i.evaluate(t))/Math.LN2}],sin:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.sin(i.evaluate(t))}],cos:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.cos(i.evaluate(t))}],tan:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.tan(i.evaluate(t))}],asin:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.asin(i.evaluate(t))}],acos:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.acos(i.evaluate(t))}],atan:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.atan(i.evaluate(t))}],min:[Ot,Br(Ot),(t,e)=>Math.min(...e.map((e=>e.evaluate(t))))],max:[Ot,Br(Ot),(t,e)=>Math.max(...e.map((e=>e.evaluate(t))))],abs:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.abs(i.evaluate(t))}],round:[Ot,[Ot],(t,e)=>{let[i]=e;const r=i.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.floor(i.evaluate(t))}],ceil:[Ot,[Ot],(t,e)=>{let[i]=e;return Math.ceil(i.evaluate(t))}],"filter-==":[jt,[Vt,Zt],(t,e)=>{let[i,r]=e;return t.properties()[i.value]===r.value}],"filter-id-==":[jt,[Zt],(t,e)=>{let[i]=e;return t.id()===i.value}],"filter-type-==":[jt,[Vt],(t,e)=>{let[i]=e;return t.geometryType()===i.value}],"filter-<":[jt,[Vt,Zt],(t,e)=>{let[i,r]=e;const n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n<o}],"filter-id-<":[jt,[Zt],(t,e)=>{let[i]=e;const r=t.id(),n=i.value;return typeof r==typeof n&&r<n}],"filter->":[jt,[Vt,Zt],(t,e)=>{let[i,r]=e;const n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[jt,[Zt],(t,e)=>{let[i]=e;const r=t.id(),n=i.value;return typeof r==typeof n&&r>n}],"filter-<=":[jt,[Vt,Zt],(t,e)=>{let[i,r]=e;const n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[jt,[Zt],(t,e)=>{let[i]=e;const r=t.id(),n=i.value;return typeof r==typeof n&&r<=n}],"filter->=":[jt,[Vt,Zt],(t,e)=>{let[i,r]=e;const n=t.properties()[i.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[jt,[Zt],(t,e)=>{let[i]=e;const r=t.id(),n=i.value;return typeof r==typeof n&&r>=n}],"filter-has":[jt,[Zt],(t,e)=>{let[i]=e;return i.value in t.properties()}],"filter-has-id":[jt,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[jt,[Qt(Vt)],(t,e)=>{let[i]=e;return i.value.indexOf(t.geometryType())>=0}],"filter-id-in":[jt,[Qt(Zt)],(t,e)=>{let[i]=e;return i.value.indexOf(t.id())>=0}],"filter-in-small":[jt,[Vt,Qt(Zt)],(t,e)=>{let[i,r]=e;return r.value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[jt,[Vt,Qt(Zt)],(t,e)=>{let[i,r]=e;
1return function(t,e,i,r){for(;i<=r;){const n=i+r>>1;if(e[n]===t)return!0;e[n]>t?r=n-1:i=n+1}return!1}(t.properties()[i.value],r.value,0,r.value.length-1)}],all:{type:jt,overloads:[[[jt,jt],(t,e)=>{let[i,r]=e;return i.evaluate(t)&&r.evaluate(t)}],[Br(jt),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:jt,overloads:[[[jt,jt],(t,e)=>{let[i,r]=e;return i.evaluate(t)||r.evaluate(t)}],[Br(jt),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[jt,[jt],(t,e)=>{let[i]=e;return!i.evaluate(t)}],"is-supported-script":[jt,[Vt],(t,e)=>{let[i]=e;const r=t.globals&&t.globals.isSupportedScript;return!r||r(i.evaluate(t))}],upcase:[Vt,[Vt],(t,e)=>{let[i]=e;return i.evaluate(t).toUpperCase()}],downcase:[Vt,[Vt],(t,e)=>{let[i]=e;return i.evaluate(t).toLowerCase()}],concat:[Vt,Br(Zt),(t,e)=>e.map((e=>qe(e.evaluate(t)))).join("")],split:[Qt(Vt),[Vt,Vt],(t,e)=>{let[i,r]=e;return i.evaluate(t).split(r.evaluate(t))}],join:[Vt,[Qt(Vt),Vt],(t,e)=>{let[i,r]=e;return i.value.join(r.evaluate(t))}],"resolved-locale":[Vt,[qt],(t,e)=>{let[i]=e;return i.evaluate(t).resolvedLocale()}]});class rn{constructor(t,e,i){this.expression=t,this._warningHistory={},this._evaluator=new Qe,this._defaultValue=e?function(t){if("color"===t.type&&Hr(t.default))return new Ce(0,0,0,0);switch(t.type){case"color":return Ce.parse(t.default)||null;case"padding":return Re.parse(t.default)||null;case"numberArray":return Fe.parse(t.default)||null;case"colorArray":return Le.parse(t.default)||null;case"variableAnchorOffsetCollection":return Ve.parse(t.default)||null;case"projectionDefinition":return Ne.parse(t.default)||null;default:return void 0===t.default?null:t.default}}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null,this._globalState=i}evaluateWithoutErrorHandling(t,e,i,r,n,o){return this._globalState&&(t=dn(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,r,n,o){this._globalState&&(t=dn(t,this._globalState)),this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new Be("Expected value to be one of ".concat(Object.keys(this._enumValues).map((t=>JSON.stringify(t))).join(", "),", but found ").concat(JSON.stringify(t)," instead."));return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function nn(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in zr}function on(t,e,i){const r=new $e(zr,Or,[],e?function(t){const e={color:Nt,string:Vt,number:Ot,enum:Vt,boolean:jt,formatted:Wt,padding:Xt,numberArray:Yt,colorArray:Ht,projectionDefinition:Ut,resolvedImage:Kt,variableAnchorOffsetCollection:Jt};return"array"===t.type?Qt(e[t.value]||Zt,t.length):e[t.type]}(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Ur(new rn(n,e,i)):Gr(r.errors)}class an{constructor(t,e,i){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!jr(e.expression),this.globalStateRefs=un(e.expression),this._globalState=i}evaluateWithoutErrorHandling(t,e,i,r,n,o){return this._globalState&&(t=dn(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,o)}evaluate(t,e,i,r,n,o){return this._globalState&&(t=dn(t,this._globalState)),this._styleExpression.evaluate(t,e,i,r,n,o)}}class sn{constructor(t,e,i,r,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!jr(e.expression),this.globalStateRefs=un(e.expression),this.interpolationType=r,this._globalState=n}evaluateWithoutErrorHandling(t,e,i,r,n,o){return this._globalState&&(t=dn(t,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,o)}evaluate(t,e,i,r,n,o){return this._globalState&&(t=dn(t,this._globalState)),this._styleExpression.evaluate(t,e,i,r,n,o)}interpolationFactor(t,e,i){return this.interpolationType?mi.interpolationFactor(this.interpolationType,t,e,i):0}}
vendor: 1,215 bytes, line 1
1function ln(t,e,i){const r=on(t,e,i);if("error"===r.result)return r;const n=r.value.expression,o=Vr(n);if(!o&&!Zr(e))return Gr([new Ft("","data expressions not supported")]);const a=Nr(n,["zoom"]);if(!a&&!qr(e))return Gr([new Ft("","zoom expressions not supported")]);const s=hn(n);return s||a?s instanceof Ft?Gr([s]):s instanceof mi&&!Wr(e)?Gr([new Ft("",'"interpolate" expressions cannot be used with this property')]):Ur(s?new sn(o?"camera":"composite",r.value,s.labels,s instanceof mi?s.interpolation:void 0,i):new an(o?"constant":"source",r.value,i)):Gr([new Ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class cn{constructor(t,e){this._parameters=t,this._specification=e,Rt(this,Kr(this._parameters,this._specification))}static deserialize(t){return new cn(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function hn(t){let e=null;if(t instanceof ti)e=hn(t.result);else if(t instanceof yi){for(const i of t.args)if(e=hn(i),e)break}else(t instanceof ci||t instanceof mi)&&t.input instanceof kr&&"zoom"===t.input.name&&(e=t);return e instanceof Ft||t.eachChild((t=>{const i=hn(t);
1i instanceof Ft?e=i:!e&&i?e=new Ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new Ft("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),e}function un(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set;return t instanceof Dr&&e.add(t.key),t.eachChild((t=>{un(t,e)})),e}function dn(t,e){const{zoom:i,heatmapDensity:r,elevation:n,lineProgress:o,isSupportedScript:a,accumulated:s}=null!=t?t:{};return{zoom:i,heatmapDensity:r,elevation:n,lineProgress:o,isSupportedScript:a,accumulated:s,globalState:e}}function pn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!pn(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const fn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function mn(t,e){if(null==t)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};pn(t)||(t=yn(t));const i=on(t,fn,e);if("error"===i.result)throw new Error(i.value.map((t=>"".concat(t.key,": ").concat(t.message))).join(", "));return{filter:(t,e,r)=>i.value.evaluate(t,e,{},r),needGeometry:_n(t),getGlobalStateRefs:()=>un(i.value.expression)}}function gn(t,e){return t<e?-1:t>e?1:0}function _n(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e<t.length;e++)if(_n(t[e]))return!0;return!1}function yn(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?vn(t[1],t[2],"=="):"!="===e?wn(vn(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?vn(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(yn))):"all"===e?["all"].concat(t.slice(1).map(yn)):"none"===e?["all"].concat(t.slice(1).map(yn).map(wn)):"in"===e?xn(t[1],t.slice(2)):"!in"===e?wn(xn(t[1],t.slice(2))):"has"===e?bn(t[1]):"!has"!==e||wn(bn(t[1]));var i}function vn(t,e,i){switch(t){case"$type":return["filter-type-".concat(i),e];case"$id":return["filter-id-".concat(i),e];default:return["filter-".concat(i),t,e]}}function xn(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((t=>typeof t!=typeof e[0]))?["filter-in-large",t,["literal",e.sort(gn)]]:["filter-in-small",t,["literal",e]]}}function bn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function wn(t){return["!",t]}function Tn(t){const e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(const i of t)e+="".concat(Tn(i),",");return"".concat(e,"]")}const i=Object.keys(t).sort();let r="{";for(let n=0;n<i.length;n++)r+="".concat(JSON.stringify(i[n]),":").concat(Tn(t[i[n]]),",");return"".concat(r,"}")}function Sn(t){let e="";for(const i of wt)e+="/".concat(Tn(t[i]));return e}function Pn(t){const e=t.value;return e?[new kt(t.key,e,"constants have been deprecated as of v8")]:[]}function In(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Mn(t){if(Array.isArray(t))return t.map(Mn);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Mn(t[i]);return e}return In(t)}function En(t){const e=t.key,i=t.value,r=t.valueSpec||{},n=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=t.validateSpec;let l=[];const c=Xr(i);if("object"!==c)return[new kt(e,i,"object expected, ".concat(c," found"))];for(const h in i){const t=h.split(".")[0],c=be(r,t)||r["*"];let u;if(be(n,t))u=n[t];else if(be(r,t)){if(void 0===i[h])continue;u=s}else if(n["*"])u=n["*"];else{if(!r["*"]){l.push(new kt(e,i[h],'unknown property "'.concat(h,'"')));continue}u=s}
vendor: 6,511 bytes, line 1
1l=l.concat(u({key:(e?"".concat(e,"."):e)+h,value:i[h],valueSpec:c,style:o,styleSpec:a,object:i,objectKey:h,validateSpec:s},i))}for(const h in r)n[h]||r[h].required&&void 0===r[h].default&&void 0===i[h]&&l.push(new kt(e,i,'missing required property "'.concat(h,'"')));return l}function Cn(t){const e=t.value,i=t.valueSpec,r=t.style,n=t.styleSpec,o=t.key,a=t.arrayElementValidator||t.validateSpec;if("array"!==Xr(e))return[new kt(o,e,"array expected, ".concat(Xr(e)," found"))];if(i.length&&e.length!==i.length)return[new kt(o,e,"array length ".concat(i.length," expected, length ").concat(e.length," found"))];let s={type:i.value,values:i.values};n.$version<7&&(s.function=i.function),"object"===Xr(i.value)&&(s=i.value);let l=[];for(let c=0;c<e.length;c++)l=l.concat(a({array:e,arrayIndex:c,value:e[c],valueSpec:s,validateSpec:t.validateSpec,style:r,styleSpec:n,key:"".concat(o,"[").concat(c,"]")}));return l}function An(t){const e=t.key,i=t.value,r=t.valueSpec;let n=Xr(i);return"number"===n&&i!=i&&(n="NaN"),"number"!==n?[new kt(e,i,"number expected, ".concat(n," found"))]:"minimum"in r&&i<r.minimum?[new kt(e,i,"".concat(i," is less than the minimum value ").concat(r.minimum))]:"maximum"in r&&i>r.maximum?[new kt(e,i,"".concat(i," is greater than the maximum value ").concat(r.maximum))]:[]}function Dn(t){const e=t.valueSpec,i=In(t.value.type);let r,n,o,a={};const s="categorical"!==i&&void 0===t.value.property,l=!s,c="array"===Xr(t.value.stops)&&"array"===Xr(t.value.stops[0])&&"object"===Xr(t.value.stops[0][0]),h=En({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new kt(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const r=t.value;return e=e.concat(Cn({key:t.key,value:r,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:u})),"array"===Xr(r)&&0===r.length&&e.push(new kt(t.key,r,"array must have at least one stop")),e},default:function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&s&&h.push(new kt(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||h.push(new kt(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!Wr(t.valueSpec)&&h.push(new kt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Zr(t.valueSpec)?h.push(new kt(t.key,t.value,"property functions not supported")):s&&!qr(t.valueSpec)&&h.push(new kt(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==t.value.property||h.push(new kt(t.key,t.value,'"property" property is required')),h;function u(t){let i=[];const r=t.value,s=t.key;if("array"!==Xr(r))return[new kt(s,r,"array expected, ".concat(Xr(r)," found"))];if(2!==r.length)return[new kt(s,r,"array length 2 expected, length ".concat(r.length," found"))];if(c){if("object"!==Xr(r[0]))return[new kt(s,r,"object expected, ".concat(Xr(r[0])," found"))];if(void 0===r[0].zoom)return[new kt(s,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new kt(s,r,"object stop key must have value")];if(o&&o>In(r[0].zoom))return[new kt(s,r[0].zoom,"stop zoom values must appear in ascending order")];In(r[0].zoom)!==o&&(o=In(r[0].zoom),n=void 0,a={}),i=i.concat(En({key:"".concat(s,"[0]"),value:r[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:An,value:d}}))}else i=i.concat(d({key:"".concat(s,"[0]"),value:r[0],validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},r));return nn(Mn(r[1]))?i.concat([new kt("".concat(s,"[1]"),r[1],"expressions are not allowed in function stops.")]):i.concat(t.validateSpec({key:"".concat(s,"[1]"),value:r[1],valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function d(t,o){const s=Xr(t.value),l=In(t.value),c=null!==t.value?t.value:o;if(r){if(s!==r)return[new kt(t.key,c,"".concat(s," stop domain type must match previous stop domain type ").concat(r))]}else r=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new kt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==i){let r="number expected, ".concat(s," found");return Zr(e)&&void 0===i&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new kt(t.key,c,r)]}return"categorical"!==i||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===s&&void 0!==n&&l<n?[new kt(t.key,c,"stop domain values must appear in ascending order")]:(n=l,"categorical"===i&&l in a?[new kt(t.key,c,"stop domain values must be unique")]:(a[l]=!0,[])):[new kt(t.key,c,"integer expected, found ".concat(l))]}}function zn(t){const e=("property"===t.expressionContext?ln:on)(Mn(t.value),t.valueSpec);if("error"===e.result)return e.value.map((e=>new kt("".concat(t.key).concat(e.key),t.value,e.message)));const i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new kt(t.key,t.value,'Invalid data expression for "'.concat(t.propertyKey,'". Output values must be contained as literals within the expression.'))];if("property"===t.expressionContext&&"layout"===t.propertyType&&!jr(i))return[new kt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!jr(i))return[new kt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Nr(i,["zoom","feature-state"]))return[new kt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Vr(i))return[new kt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function kn(t){const e=t.key,i=t.value,r=Xr(i);return"string"!==r?[new kt(e,i,"color expected, ".concat(r," found"))]:Ce.parse(String(i))?[]:[new kt(e,i,'color expected, "'.concat(i,'" found'))]}function Rn(t){const e=t.key,i=t.value,r=t.valueSpec,n=[];return Array.isArray(r.values)?-1===r.values.indexOf(In(i))&&n.push(new kt(e,i,"expected one of [".concat(r.values.join(", "),"], ").
1concat(JSON.stringify(i)," found"))):-1===Object.keys(r.values).indexOf(In(i))&&n.push(new kt(e,i,"expected one of [".concat(Object.keys(r.values).join(", "),"], ").concat(JSON.stringify(i)," found"))),n}function Fn(t){return pn(Mn(t.value))?zn(Rt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Ln(t)}function Ln(t){const e=t.value,i=t.key;if("array"!==Xr(e))return[new kt(i,e,"array expected, ".concat(Xr(e)," found"))];const r=t.styleSpec;let n,o=[];if(e.length<1)return[new kt(i,e,"filter array must have at least 1 element")];switch(o=o.concat(Rn({key:"".concat(i,"[0]"),value:e[0],valueSpec:r.filter_operator,style:t.style,styleSpec:t.styleSpec})),In(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===In(e[1])&&o.push(new kt(i,e,'"$type" cannot be use with operator "'.concat(e[0],'"')));case"==":case"!=":3!==e.length&&o.push(new kt(i,e,'filter array for operator "'.concat(e[0],'" must have 3 elements')));case"in":case"!in":e.length>=2&&(n=Xr(e[1]),"string"!==n&&o.push(new kt("".concat(i,"[1]"),e[1],"string expected, ".concat(n," found"))));for(let a=2;a<e.length;a++)n=Xr(e[a]),"$type"===In(e[1])?o=o.concat(Rn({key:"".concat(i,"[").concat(a,"]"),value:e[a],valueSpec:r.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&o.push(new kt("".concat(i,"[").concat(a,"]"),e[a],"string, number, or boolean expected, ".concat(n," found")));break;case"any":case"all":case"none":for(let r=1;r<e.length;r++)o=o.concat(Ln({key:"".concat(i,"[").concat(r,"]"),value:e[r],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=Xr(e[1]),2!==e.length?o.push(new kt(i,e,'filter array for "'.concat(e[0],'" operator must have 2 elements'))):"string"!==n&&o.push(new kt("".concat(i,"[1]"),e[1],"string expected, ".concat(n," found")))}return o}function Bn(t,e){const i=t.key,r=t.validateSpec,n=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,l=o["".concat(e,"_").concat(t.layerType)];if(!l)return[];const c=s.match(/^(.*)-transition$/);if("paint"===e&&c&&l[c[1]]&&l[c[1]].transition)return r({key:i,value:a,valueSpec:o.transition,style:n,styleSpec:o});const h=t.valueSpec||l[s];if(!h)return[new kt(i,a,'unknown property "'.concat(s,'"'))];let u;if("string"===Xr(a)&&Zr(h)&&!h.tokens&&(u=/^{([^}]+)}$/.exec(a)))return[new kt(i,a,'"'.concat(s,'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": ').concat(JSON.stringify(u[1])," }`."))];const d=[];return"symbol"===t.layerType&&"text-font"===s&&Hr(Mn(a))&&"identity"===In(a.type)&&d.push(new kt(i,a,'"text-font" does not support identity functions')),d.concat(r({key:t.key,value:a,valueSpec:h,style:n,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:s}))}function On(t){return Bn(t,"paint")}function Vn(t){return Bn(t,"layout")}function jn(t){var e,i;let r=[];const n=t.value,o=t.key,a=t.style,s=t.styleSpec;if("object"!==Xr(n))return[new kt(o,n,"object expected, ".concat(Xr(n)," found"))];n.type||n.ref||r.push(new kt(o,n,'either "type" or "ref" is required'));let l=In(n.type);const c=In(n.ref);if(n.id){const e=In(n.id);for(let i=0;i<t.arrayIndex;i++){const t=a.layers[i];In(t.id)===e&&r.push(new kt(o,n.id,'duplicate layer id "'.concat(n.id,'", previously used at line ').concat(t.id.__line__)))}}if("ref"in n){let t;["type","source","source-layer","filter","layout"].forEach((t=>{t in n&&r.push(new kt(o,n[t],'"'.concat(t,'" is prohibited for ref layers')))})),a.layers.forEach((e=>{In(e.id)===c&&(t=e)})),t?t.ref?r.push(new kt(o,n.ref,"ref cannot reference another ref layer")):l=In(t.type):r.push(new kt(o,n.ref,'ref layer "'.concat(c,'" not found')))}else if("background"!==l)if(n.source){const t=a.sources&&a.sources[n.source],e=t&&In(t.type);t?"vector"===e&&"raster"===l?r.push(new kt(o,n.source,'layer "'.concat(n.id,'" requires a raster source'))):"raster-dem"!==e&&"hillshade"===l||"raster-dem"!==e&&"color-relief"===l?r.push(new kt(o,n.source,'layer "'.concat(n.id,'" requires a raster-dem source'))):"raster"===e&&"raster"!==l?r.push(new kt(o,n.source,'layer "'.concat(n.id,'" requires a vector source'))):"vector"!==e||n["source-layer"]?"raster-dem"===e&&"hillshade"!==l&&"color-relief"!==l?r.push(new kt(o,n.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"!==l||!n.paint||!n.paint["line-gradient"]||"geojson"===e&&t.lineMetrics||r.push(new kt(o,n,'layer "'.concat(n.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):r.push(new kt(o,n,'layer "'.concat(n.id,'" must specify a "source-layer"'))):r.push(new kt(o,n.source,'source "'.concat(n.source,'" not found')))}else r.push(new kt(o,n,'missing required property "source"'));return"raster"===l&&(null===(e=n.paint)||void 0===e?void 0:e.resampling)&&(null===(i=n.paint)||void 0===i?void 0:i["raster-resampling"])&&r.push(new kt(o,n.paint,'layer "'.concat(n.id,'" redundantly specifies "resampling" and "raster-resampling" paint properties, but only one is allowed. It is advised to use "resampling".'))),r=r.concat(En({key:o,value:n,valueSpec:s.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:"".concat(o,".type"),value:n.type,valueSpec:s.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:n,objectKey:"type"}),filter:Fn,layout:t=>En({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>Vn(Rt({layerType:l},t))}}),paint:t=>En({layer:n,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>On(Rt({layerType:l},t))}})}})),r}function Nn(t){const e=t.value,i=t.key,r=Xr(e);return"string"!==r?[new kt(i,e,"string expected, ".concat(r," found"))]:[]}const Un={promoteId:function(t){let{key:e,value:i}=t;if("string"===Xr(i))return Nn({key:e,value:i});{const t=[];for(const r in i)t.push(...Nn({key:"".concat(e,".").concat(r),value:i[r]}));return t}}};function Gn(t){const e=t.value,i=t.key,r=t.styleSpec,n=t.style,o=t.validateSpec;if(!e.type)return[new kt(i,e,'"type" is required')];const a=In(e.type);let s;switch(a){case"vector":case"raster":return s=En({key:i,value:e,valueSpec:r["source_".concat(a.replace("-","_"))],style:t.style,styleSpec:r,objectElementValidators:Un,validateSpec:o}),s;case"raster-dem":return s=function(t){var e;const i=null!==(e=t.sourceName)&&void 0!==e?e:"",r=t.value,n=t.styleSpec,o=n.source_raster_dem,a=t.style;let s=[];const l=Xr(r);if(void 0===r)return s;if("object"!==l)return s.push(new kt("source_raster_dem",r,"object expected, ".concat(l," found"))),s;const c="custom"===In(r.encoding),h=["redFactor","greenFactor","blueFactor","baseShift"],u=t.value.encoding?'"'.concat(t.value.encoding,'"'):"Default";for(const d in r)!c&&h.includes(d)?s.push(new kt(d,r[d],'In "'.concat(i,'": "').concat(d,'" is only valid when "encoding" is set to "custom". ').concat(u," encoding found"))):o[d]?s=s.concat(t.validateSpec({key:d,value:r[d],valueSpec:o[d],validateSpec:t.validateSpec,style:a,styleSpec:n})):s.push(new kt(d,r[d],'unknown property "'.concat(d,'"')));return s}({sourceName:i,value:e,style:t.style,styleSpec:r,validateSpec:o}),s;case"geojson":if(s=En({key:i,value:e,valueSpec:r.source_geojson,style:n,styleSpec:r,validateSpec:o,objectElementValidators:Un}),e.cluster)for(const t in e.clusterProperties){const[r,n]=e.clusterProperties[t],o="string"==typeof r?[r,["accumulated"],["get",t]]:r;
1s.push(...zn({key:"".concat(i,".").concat(t,".map"),value:n,expressionContext:"cluster-map"})),s.push(...zn({key:"".concat(i,".").concat(t,".reduce"),value:o,expressionContext:"cluster-reduce"}))}return s;case"video":return En({key:i,value:e,valueSpec:r.source_video,style:n,validateSpec:o,styleSpec:r});case"image":return En({key:i,value:e,valueSpec:r.source_image,style:n,validateSpec:o,styleSpec:r});case"canvas":return[new kt(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Rn({key:"".concat(i,".type"),value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function Zn(t){const e=t.value,i=t.styleSpec,r=i.light,n=t.style;let o=[];const a=Xr(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new kt("light",e,"object expected, ".concat(a," found"))]),o;for(const s in e){const a=s.match(/^(.*)-transition$/);o=o.concat(a&&r[a[1]]&&r[a[1]].transition?t.validateSpec({key:s,value:e[s],valueSpec:i.transition,validateSpec:t.validateSpec,style:n,styleSpec:i}):r[s]?t.validateSpec({key:s,value:e[s],valueSpec:r[s],validateSpec:t.validateSpec,style:n,styleSpec:i}):[new kt(s,e[s],'unknown property "'.concat(s,'"'))])}return o}function qn(t){const e=t.value,i=t.styleSpec,r=i.sky,n=t.style,o=Xr(e);if(void 0===e)return[];if("object"!==o)return[new kt("sky",e,"object expected, ".concat(o," found"))];let a=[];for(const s in e)a=a.concat(r[s]?t.validateSpec({key:s,value:e[s],valueSpec:r[s],style:n,styleSpec:i}):[new kt(s,e[s],'unknown property "'.concat(s,'"'))]);return a}function Wn(t){const e=t.value,i=t.styleSpec,r=i.terrain,n=t.style;let o=[];const a=Xr(e);if(void 0===e)return o;if("object"!==a)return o=o.concat([new kt("terrain",e,"object expected, ".concat(a," found"))]),o;for(const s in e)o=o.concat(r[s]?t.validateSpec({key:s,value:e[s],valueSpec:r[s],validateSpec:t.validateSpec,style:n,styleSpec:i}):[new kt(s,e[s],'unknown property "'.concat(s,'"'))]);return o}function Xn(t){let e=[];const i=t.value,r=t.key;if(Array.isArray(i)){const n=[],o=[];for(const a in i)i[a].id&&n.includes(i[a].id)&&e.push(new kt(r,i,"all the sprites' ids must be unique, but ".concat(i[a].id," is duplicated"))),n.push(i[a].id),i[a].url&&o.includes(i[a].url)&&e.push(new kt(r,i,"all the sprites' URLs must be unique, but ".concat(i[a].url," is duplicated"))),o.push(i[a].url),e=e.concat(En({key:"".concat(r,"[").concat(a,"]"),value:i[a],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return e}return Nn({key:r,value:i})}function Hn(t){return Boolean(t)&&t.constructor===Object}function Yn(t){return Hn(t.value)?[]:[new kt(t.key,t.value,"object expected, ".concat(Xr(t.value)," found"))]}const Kn={"*":()=>[],array:Cn,boolean:function(t){const e=t.value,i=t.key,r=Xr(e);return"boolean"!==r?[new kt(i,e,"boolean expected, ".concat(r," found"))]:[]},number:An,color:kn,constants:Pn,enum:Rn,filter:Fn,function:Dn,layer:jn,object:En,source:Gn,light:Zn,sky:qn,terrain:Wn,projection:function(t){const e=t.value,i=t.styleSpec,r=i.projection,n=t.style,o=Xr(e);if(void 0===e)return[];if("object"!==o)return[new kt("projection",e,"object expected, ".concat(o," found"))];let a=[];for(const s in e)a=a.concat(r[s]?t.validateSpec({key:s,value:e[s],valueSpec:r[s],style:n,styleSpec:i}):[new kt(s,e[s],'unknown property "'.concat(s,'"'))]);return a},projectionDefinition:function(t){const e=t.key;let i=t.value;i=i instanceof String?i.valueOf():i;const r=Xr(i);return"array"!==r||function(t){return Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]}(i)||function(t){return!!["interpolate","step","literal"].includes(t[0])}(i)?["array","string"].includes(r)?[]:[new kt(e,i,'projection expected, invalid type "'.concat(r,'" found'))]:[new kt(e,i,"projection expected, invalid array ".concat(JSON.stringify(i)," found"))]},string:Nn,formatted:function(t){return 0===Nn(t).length?[]:zn(t)},resolvedImage:function(t){return 0===Nn(t).length?[]:zn(t)},padding:function(t){const e=t.key,i=t.value;
1if("array"===Xr(i)){if(i.length<1||i.length>4)return[new kt(e,i,"padding requires 1 to 4 values; ".concat(i.length," values found"))];const r={type:"number"};let n=[];for(let o=0;o<i.length;o++)n=n.concat(t.validateSpec({key:"".concat(e,"[").concat(o,"]"),value:i[o],validateSpec:t.validateSpec,valueSpec:r}));return n}return An({key:e,value:i,valueSpec:{}})},numberArray:function(t){const e=t.key,i=t.value;if("array"===Xr(i)){const r={type:"number"};if(i.length<1)return[new kt(e,i,"array length at least 1 expected, length 0 found")];let n=[];for(let o=0;o<i.length;o++)n=n.concat(t.validateSpec({key:"".concat(e,"[").concat(o,"]"),value:i[o],validateSpec:t.validateSpec,valueSpec:r}));return n}return An({key:e,value:i,valueSpec:{}})},colorArray:function(t){const e=t.key,i=t.value;if("array"===Xr(i)){if(i.length<1)return[new kt(e,i,"array length at least 1 expected, length 0 found")];let t=[];for(let r=0;r<i.length;r++)t=t.concat(kn({key:"".concat(e,"[").concat(r,"]"),value:i[r]}));return t}return kn({key:e,value:i})},variableAnchorOffsetCollection:function(t){const e=t.key,i=t.value,r=Xr(i),n=t.styleSpec;if("array"!==r||i.length<1||i.length%2!=0)return[new kt(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let a=0;a<i.length;a+=2)o=o.concat(Rn({key:"".concat(e,"[").concat(a,"]"),value:i[a],valueSpec:n.layout_symbol["text-anchor"]})),o=o.concat(Cn({key:"".concat(e,"[").concat(a+1,"]"),value:i[a+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:n}));return o},sprite:Xn,state:Yn,fontFaces:function(t){const e=t.key,i=t.value,r=t.validateSpec,n=t.styleSpec,o=t.style;if(!Hn(i))return[new kt(e,i,"object expected, ".concat(Xr(i)," found"))];const a=[];for(const s in i){const t=i[s],l=Xr(t);if("string"===l)a.push(...Nn({key:"".concat(e,".").concat(s),value:t}));else if("array"===l){const i={url:{type:"string",required:!0},"unicode-range":{type:"array",value:"string"}};for(const[l,c]of t.entries())a.push(...En({key:"".concat(e,".").concat(s,"[").concat(l,"]"),value:c,valueSpec:i,styleSpec:n,style:o,validateSpec:r}))}else a.push(new kt("".concat(e,".").concat(s),t,"string or array expected, ".concat(l," found")))}return a}};function Jn(t){const e=t.value,i=t.valueSpec,r=t.styleSpec;return t.validateSpec=Jn,i.expression&&Hr(In(e))?Dn(t):i.expression&&nn(Mn(e))?zn(t):i.type&&Kn[i.type]?Kn[i.type](t):En(Rt({},t,{valueSpec:i.type?r[i.type]:i}))}function Qn(t){const e=t.value,i=t.key,r=Nn(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new kt(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new kt(i,e,'"glyphs" url must include a "{range}" token'))),r}function $n(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:bt,i=[];return i=i.concat(Jn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:Jn,objectElementValidators:{glyphs:Qn,"*":()=>[]}})),t.constants&&(i=i.concat(Pn({key:"constants",value:t.constants}))),eo(i)}function to(t){return function(e){return t(Object.assign({},e,{validateSpec:Jn}))}}function eo(t){return[].concat(t).sort(((t,e)=>t.line-e.line))}function io(t){return function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];return eo(t.apply(this,i))}}$n.source=io(to(Gn)),$n.sprite=io(to(Xn)),$n.glyphs=io(to(Qn)),$n.light=io(to(Zn)),$n.sky=io(to(qn)),$n.terrain=io(to(Wn)),$n.state=io(to(Yn)),$n.layer=io(to(jn)),$n.filter=io(to(Fn)),$n.paintProperty=io(to(On)),$n.layoutProperty=io(to(Vn));const ro={type:"enum","property-type":"data-constant",expression:{interpolated:!1,parameters:["global-state"]},values:{visible:{},none:{}},transition:!1,default:"visible"};class no{constructor(t,e){this._globalState=e,this.setValue(t)}evaluate(){var t;return null!==(t=this._literalValue)&&void 0!==t?t:this._compiledValue.evaluate({})}setValue(t){if(null==t||"visible"===t||"none"===t)return this._literalValue="none"===t?"none":"visible",this._compiledValue=void 0,void(this._globalStateRefs=new Set);const e=on(t,ro,this._globalState);if("error"===e.result)throw this._literalValue="visible",this._compiledValue=void 0,new Error(e.value.map((t=>"".concat(t.key,": ").concat(t.message))).join(", "));this._literalValue=void 0,this._compiledValue=e.value,this._globalStateRefs=un(e.value.expression)}getGlobalStateRefs(){return this._globalStateRefs}}const oo=bt,ao=$n,so=ao.light,lo=ao.sky,co=ao.paintProperty,ho=ao.layoutProperty;function uo(t,e){let i=!1;if(e&&e.length)for(const r of e)t.fire(new vt(new Error(r.message))),i=!0;return i}class po{constructor(t,e,i){const r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const n=new Int32Array(this.arrayBuffer);t=n[0],this.d=(e=n[1])+2*(i=n[2]);for(let t=0;t<this.d*this.d;
vendor: 8,648 bytes, line 1
1t++){const e=n[3+t],i=n[3+t+1];r.push(e===i?null:n.subarray(e,i))}const o=n[3+r.length+1];this.keys=n.subarray(n[3+r.length],o),this.bboxes=n.subarray(o),this.insert=this._insertReadonly}else{this.d=e+2*i;for(let t=0;t<this.d*this.d;t++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;const n=i/e*t;this.min=-n,this.max=t+n}insert(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,e,i,r,n,o){this.cells[n].push(o)}query(t,e,i,r,n){const o=this.min,a=this.max;if(t<=o&&e<=o&&a<=i&&a<=r&&!n)return Array.prototype.slice.call(this.keys);{const o=[];return this._forEachCell(t,e,i,r,this._queryCell,o,{},n),o}}_queryCell(t,e,i,r,n,o,a,s){const l=this.cells[n];if(null!==l){const n=this.keys,c=this.bboxes;for(let h=0;h<l.length;h++){const u=l[h];if(void 0===a[u]){const l=4*u;(s?s(c[l+0],c[l+1],c[l+2],c[l+3]):t<=c[l+2]&&e<=c[l+3]&&i>=c[l+0]&&r>=c[l+1])?(a[u]=!0,o.push(n[u])):a[u]=!1}}}}_forEachCell(t,e,i,r,n,o,a,s){const l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),h=this._convertToCellCoord(i),u=this._convertToCellCoord(r);for(let d=l;d<=h;d++)for(let l=c;l<=u;l++){const c=this.d*l+d;if((!s||s(this._convertFromCellCoord(d),this._convertFromCellCoord(l),this._convertFromCellCoord(d+1),this._convertFromCellCoord(l+1)))&&n.call(this,t,e,i,r,c,o,a,s))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,e=3+this.cells.length+1+1;let i=0;for(let o=0;o<this.cells.length;o++)i+=this.cells[o].length;const r=new Int32Array(e+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;let n=e;for(let o=0;o<t.length;o++){const e=t[o];r[3+o]=n,r.set(e,n),n+=e.length}return r[3+t.length]=n,r.set(this.keys,n),n+=this.keys.length,r[3+t.length+1]=n,r.set(this.bboxes,n),n+=this.bboxes.length,r.buffer}static serialize(t,e){const i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}}static deserialize(t){return new po(t.buffer)}}const fo={};function mo(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(fo[t])throw new Error("".concat(t," is already registered."));Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),fo[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}mo("Object",Object),mo("Set",Set),mo("TransferableGridIndex",po),mo("Color",Ce),mo("Error",Error),mo("AJAXError",dt),mo("ResolvedImage",je),mo("StylePropertyFunction",cn),mo("StyleExpression",rn,{omit:["_evaluator"]}),mo("ZoomDependentExpression",sn),mo("ZoomConstantExpression",an),mo("CompoundExpression",kr,{omit:["_evaluate"]});for(const r in zr)zr[r]._classRegistryKey||mo("Expression_".concat(r),zr[r]);function go(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function _o(t){return t.$name||t.constructor._classRegistryKey}function yo(t){return!function(t){if(null===t||"object"!=typeof t)return!1;const e=_o(t);return!(!e||"Object"===e)}(t)&&(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||go(t)||K(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function vo(t,e){if(yo(t))return(go(t)||K(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const i=[];for(const r of t)i.push(vo(r,e));return i}if("object"!=typeof t)throw new Error("can't serialize object of type "+typeof t);const i=_o(t);if(!i)throw new Error("can't serialize object of unregistered class ".concat(t.constructor.name));if(!fo[i])throw new Error("".concat(i," is not registered."));const{klass:r}=fo[i],n=r.serialize?r.serialize(t,e):{};if(r.serialize){if(e&&n===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const r in t){if(!t.hasOwnProperty(r))continue;if(fo[i].omit.indexOf(r)>=0)continue;const o=t[r];n[r]=fo[i].shallow.indexOf(r)>=0?o:vo(o,e)}t instanceof Error&&(n.message=t.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(n.$name=i),n}function xo(t){if(yo(t))return t;if(Array.isArray(t))return t.map(xo);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);const e=_o(t)||"Object";if(!fo[e])throw new Error("can't deserialize unregistered class ".concat(e));const{klass:i}=fo[e];if(!i)throw new Error("can't deserialize unregistered class ".concat(e));if(i.deserialize)return i.deserialize(t);const r=Object.create(i.prototype);for(const n of Object.keys(t)){if("$name"===n)continue;const i=t[n];r[n]=fo[e].shallow.indexOf(n)>=0?i:xo(i)}return r}class bo{constructor(){this.first=!0}update(t,e){const i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))}}function wo(t){return/[\u02EA\u02EB\u2E80-\u2FDF\u2FF0-\u303F\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FD-\u30FF\u3105-\u312F\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t))}function To(t){return/[\u02EA\u02EB\u1100-\u11FF\u1400-\u167F\u18B0-\u18F5\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u3007\u3012\u3013\u3020-\u302F\u3031-\u303F\u3041-\u3096\u309D-\u30FB\u30FD-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE48\uFE50-\uFE57\uFE5F-\uFE62\uFE67-\uFE6F\uFF00-\uFF07\uFF0A-\uFF0C\uFF0E-\uFF19\uFF1F-\uFF3A\uFF3C\uFF3E\uFF40-\uFF5A\uFFE0-\uFFE2\uFFE4-\uFFE7]|\uD802[\uDD80-\uDD9F]|\uD805[\uDD80-\uDDFF]|\uD806[\uDE00-\uDEBF]|\uD811[\uDC00-\uDE7F]|\uD81B[\uDFE0-\uDFE4\uDFF0-\uDFF6]|[\uD81C-\uD822\uD83D\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD30-\uDEFB]|\uD833[\uDEC0-\uDFCF]|\uD834[\uDC00-\uDDFF\uDEE0-\uDF7F]|\uD836[\uDC00-\uDEAF]|\uD83C[\uDC00-\uDE00\uDF00-\uDFFF]|\uD83E[\uDD00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t))}function So(t){return/[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]/.test(String.fromCodePoint(t))}function Po(t){for(const e of t)if(To(e.codePointAt(0)))return!0;return!1}function Io(t){for(const e of t)if(!Co(e.codePointAt(0)))return!1;return!0}function Mo(t){const e=t.map((t=>{try{return new RegExp("\\p{sc=".concat(t,"}"),"u").source}catch(t){return null}})).filter((t=>t));return new RegExp(e.join("|"),"u")}const Eo=Mo(["Arab","Dupl","Mong","Ougr","Syrc"]);function Co(t){return!Eo.test(String.fromCodePoint(t))}function Ao(t){return!(To(t)||(e=t,/[\xA7\xA9\xAE\xB1\xBC-\xBE\xD7\xF7\u2016\u2020\u2021\u2030\u2031\u203B\u203C\u2042\u2047-\u2049\u2051\u2100-\u218F\u221E\u2234\u2235\u2300-\u2307\u230C-\u231F\u2324-\u2328\u232B\u237D-\u239A\u23BE-\u23CD\u23CF\u23D1-\u23DB\u23E2-\u2422\u2424-\u24FF\u25A0-\u2619\u2620-\u2767\u2776-\u2793\u2B12-\u2B2F\u2B50-\u2B59\u2BB8-\u2BEB\u3000-\u303F\u30A0-\u30FF\uE000-\uF8FF\uFE30-\uFE6F\uFF00-\uFFEF\uFFFC\uFFFD]|[\uDB80-\uDBFF][\uDC00-\uDFFF]/gim.test(String.fromCodePoint(e)))
1);var e}const Do=Mo(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function zo(t){return Do.test(String.fromCodePoint(t))}function ko(t,e){return!(!e&&zo(t)||/[\u0900-\u0DFF\u0F00-\u109F\u1780-\u17FF]/gim.test(String.fromCodePoint(t)))}function Ro(t){for(const e of t)if(zo(e.codePointAt(0)))return!0;return!1}const Fo=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){if(Fo.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}syncState(t,i){return e(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if("loading"!==t.pluginStatus)return this.setState(t),t;const e=t.pluginURL,r=new Promise((t=>{this.loadScriptResolve=t}));i(e);const n=new Promise((t=>setTimeout((()=>t()),this.TIMEOUT)));if(yield Promise.race([r,n]),this.isParsed()){const t={pluginStatus:"loaded",pluginURL:e};return this.setState(t),t}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error("RTL Text Plugin failed to import scripts from ".concat(e))}))}};class Lo{constructor(t,e){this.isSupportedScript=Bo,this.zoom=t,e?(this.now=e.now||0,this.fadeDuration=e.fadeDuration||0,this.zoomHistory=e.zoomHistory||new bo,this.transition=e.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new bo,this.transition={})}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}}}function Bo(t){return function(t,e){for(const i of t)if(!ko(i.codePointAt(0),e))return!1;return!0}(t,"loaded"===Fo.getRTLTextPluginStatus())}const Oo="-transition";class Vo{constructor(t,e,i){this.property=t,this.value=e,this.expression=function(t,e,i){if(Hr(t))return new cn(t,e);if(nn(t)){const r=ln(t,e,i);if("error"===r.result)throw new Error(r.value.map((t=>"".concat(t.key,": ").concat(t.message))).join(", "));return r.value}{let i=t;return"color"===e.type&&"string"==typeof t?i=Ce.parse(t):"padding"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"numberArray"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"colorArray"!==e.type||"string"!=typeof t&&!Array.isArray(t)?"variableAnchorOffsetCollection"===e.type&&Array.isArray(t)?i=Ve.parse(t):"projectionDefinition"===e.type&&"string"==typeof t&&(i=Ne.parse(t)):i=Le.parse(t):i=Fe.parse(t):i=Re.parse(t),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>i}}}(void 0===e?t.specification.default:e,t.specification,i)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)}}class jo{constructor(t,e){this.property=t,this.value=new Vo(t,void 0,e)}transitioned(t,e){return new Uo(this.property,this.value,e,j({},t.transition,this.transition),t.now)}untransitioned(){return new Uo(this.property,this.value,null,{},0)}}class No{constructor(t,e){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues),this._globalState=e}getValue(t){return Z(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new jo(this._values[t].property,this._globalState)),this._values[t].value=new Vo(this._values[t].property,null===e?void 0:Z(e),this._globalState)}getTransition(t){return Z(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new jo(this._values[t].property,this._globalState)),this._values[t].transition=Z(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i);const r=this.getTransition(e);void 0!==r&&(t["".concat(e).concat(Oo)]=r)}return t}transitioned(t,e){const i=new Go(this._properties);for(const r of Object.keys(this._values))i._values[r]=this._values[r].transitioned(t,e._values[r]);return i}untransitioned(){const t=new Go(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class Uo{constructor(t,e,i,r,n){this.property=t,this.value=e,this.begin=n+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=i)}possiblyEvaluate(t,e,i){const r=t.now||0,n=this.value.possiblyEvaluate(t,e,i),o=this.prior;if(o){if(r>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r<this.begin)return o.possiblyEvaluate(t,e,i);{const a=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,i),n,F(a))}}return n}}class Go{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,i){const r=new Wo(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].possiblyEvaluate(t,e,i);return r}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class Zo{constructor(t,e){this._properties=t,this._values=Object.create(t.defaultPropertyValues),this._globalState=e}hasValue(t){return void 0!==this._values[t].value}getValue(t){return Z(this._values[t].value)}setValue(t,e){this._values[t]=new Vo(this._values[t].property,null===e?void 0:Z(e),this._globalState)}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i)}return t}possiblyEvaluate(t,e,i){const r=new Wo(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].possiblyEvaluate(t,e,i);return r}}class qo{constructor(t,e,i){this.property=t,this.value=e,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,i,r){return this.property.evaluate(this.value,this.parameters,t,e,i,r)}}class Wo{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class Xo{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,i){const r=_i[this.specification.type];return r?r(t,e,i):t}}class Ho{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,i,r){return new qo(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,r)}:t.expression,e)}interpolate(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new qo(this,{kind:"constant",value:void 0},t.parameters);const r=_i[this.specification.type];if(r){const n=r(t.value.value,e.value.value,i);return new qo(this,{kind:"constant",value:n},t.parameters)}return t}evaluate(t,e,i,r,n,o){return"constant"===t.kind?t.value:t.evaluate(e,i,r,n,o)}}class Yo extends Ho{possiblyEvaluate(t,e,i,r){if(void 0===t.value)return new qo(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){const n=t.expression.evaluate(e,null,{},i,r),o="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,a=this._calculate(o,o,o,e);return new qo(this,{kind:"constant",value:a},e)}if("camera"===t.expression.kind){const i=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new qo(this,{kind:"constant",value:i},e)}return new qo(this,t.expression,e)}evaluate(t,e,i,r,n,o){if("source"===t.kind){const a=t.evaluate(e,i,r,n,o);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,r),t.evaluate({zoom:Math.floor(e.zoom)},i,r),t.evaluate({zoom:Math.floor(e.zoom)+1},i,r),e):t.value}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class Ko{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,r){if(void 0!==t.value){if("constant"===t.expression.kind){const n=t.expression.evaluate(e,null,{},i,r);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new Lo(Math.floor(e.zoom-1),e)),t.expression.evaluate(new Lo(Math.floor(e.zoom),e)),t.expression.evaluate(new Lo(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class Jo{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,r){return!!t.expression.evaluate(e,null,{},i,r)}interpolate(){return!1}}class Qo{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const i=t[e];i.specification.overridable&&this.overridableProperties.push(e);const r=this.defaultPropertyValues[e]=new Vo(i,void 0,void 0),n=this.defaultTransitionablePropertyValues[e]=new jo(i,void 0);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}}}mo("DataDrivenProperty",Ho),mo("DataConstantProperty",Xo),mo("CrossFadedDataDrivenProperty",Yo),mo("CrossFadedProperty",Ko),mo("ColorRampProperty",Jo);class $o extends xt{constructor(t,e,i){if(super(),this.id=t.id,this.type=t.type,this._globalState=i,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},this._visibilityExpression=function(t,e){return new no(t,e)}(this.visibility,i),"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter,this._featureFilter=mn(t.filter,i)),e.layout&&(this._unevaluatedLayout=new Zo(e.layout,i)),e.paint)){this._transitionablePaint=new No(e.paint,i);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Wo(e.paint)}}setFilter(t){this.filter=t,this._featureFilter=mn(t,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}getLayoutAffectingGlobalStateRefs(){const t=new Set;for(const e of this._visibilityExpression.getGlobalStateRefs())t.add(e);if(this._unevaluatedLayout)for(const e in this._unevaluatedLayout._values){const i=this._unevaluatedLayout._values[e];for(const e of i.getGlobalStateRefs())t.add(e)}for(const e of this._featureFilter.getGlobalStateRefs())t.add(e);return t}getPaintAffectingGlobalStateRefs(){var t;const e=new globalThis.Map;if(this._transitionablePaint)for(const i in this._transitionablePaint._values){const r=this._transitionablePaint._values[i].value;for(const n of r.getGlobalStateRefs()){const o=null!==(t=e.get(n))&&void 0!==t?t:[];o.push({name:i,value:r.value}),e.set(n,o)}}return e}getVisibilityAffectingGlobalStateRefs(){return this._visibilityExpression.getGlobalStateRefs()}setLayoutProperty(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};
1if(null==e||!this._validate(ho,"layers.".concat(this.id,".layout.").concat(t),t,e,i))return"visibility"===t?(this.visibility=e,this._visibilityExpression.setValue(e),void this.recalculateVisibility()):void this._unevaluatedLayout.setValue(t,e)}getPaintProperty(t){return t.endsWith(Oo)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=e&&this._validate(co,"layers.".concat(this.id,".paint.").concat(t),t,e,i))return!1;if(t.endsWith(Oo))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{const i=this._transitionablePaint._values[t],r="cross-faded-data-driven"===i.property.specification["property-type"],n=i.value.isDataDriven(),o=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const a=this._transitionablePaint._values[t].value;return a.isDataDriven()||n||r||this._handleOverridablePaintPropertyUpdate(t,o,a)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,i){return!1}isHidden(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.minzoom,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!!(this.minzoom&&t<(e?Math.floor(this.minzoom):this.minzoom))||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this._evaluatedVisibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculateVisibility(){this._evaluatedVisibility=this._visibilityExpression.evaluate()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}
1serialize(){const t={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&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),G(t,((t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)))}_validate(t,e,i,r){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!n||!1!==n.validate)&&uo(this,t.call(ao,{key:e,layerType:this.type,objectKey:i,value:r,styleSpec:bt,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof qo&&Zr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}let ta;var ea={get paint(){return ta=ta||new Qo({"raster-opacity":new Xo(bt.paint_raster["raster-opacity"]),"raster-hue-rotate":new Xo(bt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Xo(bt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Xo(bt.paint_raster["raster-brightness-max"]),"raster-saturation":new Xo(bt.paint_raster["raster-saturation"]),"raster-contrast":new Xo(bt.paint_raster["raster-contrast"]),resampling:new Xo(bt.paint_raster.resampling),"raster-resampling":new Xo(bt.paint_raster["raster-resampling"]),"raster-fade-duration":new Xo(bt.paint_raster["raster-fade-duration"])})}};class ia extends $o{constructor(t,e){super(t,ea,e)}}const ra={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};
vendor: 4,431 bytes, line 1
1class na{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class oa{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_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(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function aa(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=0,r=0;return{members:t.map((t=>{const n=ra[t.type].BYTES_PER_ELEMENT,o=i=sa(i,Math.max(e,n)),a=t.components||1;return r=Math.max(r,n),i+=n*a,{name:t.name,type:t.type,components:a,offset:o}})),size:sa(i,Math.max(r,e)),alignment:e}}function sa(t,e){return Math.ceil(t/e)*e}class la extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.int16[r+0]=e,this.int16[r+1]=i,t}}la.prototype.bytesPerElement=4,mo("StructArrayLayout2i4",la);class ca extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.int16[n+0]=e,this.int16[n+1]=i,this.int16[n+2]=r,t}}ca.prototype.bytesPerElement=6,mo("StructArrayLayout3i6",ca);class ha extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)}emplace(t,e,i,r,n){const o=4*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=n,t}}ha.prototype.bytesPerElement=8,mo("StructArrayLayout4i8",ha);class ua extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)}emplace(t,e,i,r,n,o,a){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t}}ua.prototype.bytesPerElement=12,mo("StructArrayLayout2i4i12",ua);class da extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)}emplace(t,e,i,r,n,o,a){const s=4*t,l=8*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.uint8[l+4]=r,this.uint8[l+5]=n,this.uint8[l+6]=o,this.uint8[l+7]=a,t}}da.prototype.bytesPerElement=8,mo("StructArrayLayout2i4ub8",da);class pa extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.float32[r+0]=e,this.float32[r+1]=i,t}}pa.prototype.bytesPerElement=8,mo("StructArrayLayout2f8",pa);class fa extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o,a,s,l,c){const h=this.length;return this.resize(h+1),this.emplace(h,t,e,i,r,n,o,a,s,l,c)}emplace(t,e,i,r,n,o,a,s,l,c,h){const u=10*t;return this.uint16[u+0]=e,this.uint16[u+1]=i,this.uint16[u+2]=r,this.uint16[u+3]=n,this.uint16[u+4]=o,this.uint16[u+5]=a,this.uint16[u+6]=s,this.uint16[u+7]=l,this.uint16[u+8]=c,this.uint16[u+9]=h,t}}fa.prototype.bytesPerElement=20,mo("StructArrayLayout10ui20",fa);class ma extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}
vendor: 13,561 bytes, line 1
1emplaceBack(t,e,i,r,n,o,a,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,e,i,r,n,o,a,s)}emplace(t,e,i,r,n,o,a,s,l){const c=8*t;return this.uint16[c+0]=e,this.uint16[c+1]=i,this.uint16[c+2]=r,this.uint16[c+3]=n,this.uint16[c+4]=o,this.uint16[c+5]=a,this.uint16[c+6]=s,this.uint16[c+7]=l,t}}ma.prototype.bytesPerElement=16,mo("StructArrayLayout8ui16",ma);class ga extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o,a,s,l,c,h,u){const d=this.length;return this.resize(d+1),this.emplace(d,t,e,i,r,n,o,a,s,l,c,h,u)}emplace(t,e,i,r,n,o,a,s,l,c,h,u,d){const p=12*t;return this.int16[p+0]=e,this.int16[p+1]=i,this.int16[p+2]=r,this.int16[p+3]=n,this.uint16[p+4]=o,this.uint16[p+5]=a,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=h,this.int16[p+10]=u,this.int16[p+11]=d,t}}ga.prototype.bytesPerElement=24,mo("StructArrayLayout4i4ui4i24",ga);class _a extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.float32[n+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t}}_a.prototype.bytesPerElement=12,mo("StructArrayLayout3f12",_a);class ya extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}ya.prototype.bytesPerElement=4,mo("StructArrayLayout1ul4",ya);class va extends oa{_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(t,e,i,r,n,o,a,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,t,e,i,r,n,o,a,s,l)}emplace(t,e,i,r,n,o,a,s,l,c){const h=10*t,u=5*t;return this.int16[h+0]=e,this.int16[h+1]=i,this.int16[h+2]=r,this.int16[h+3]=n,this.int16[h+4]=o,this.int16[h+5]=a,this.uint32[u+3]=s,this.uint16[h+8]=l,this.uint16[h+9]=c,t}}va.prototype.bytesPerElement=20,mo("StructArrayLayout6i1ul2ui20",va);class xa extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)}emplace(t,e,i,r,n,o,a){const s=6*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,t}}xa.prototype.bytesPerElement=12,mo("StructArrayLayout2i2i2i12",xa);class ba extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n){const o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,r,n)}emplace(t,e,i,r,n,o){const a=4*t,s=8*t;return this.float32[a+0]=e,this.float32[a+1]=i,this.float32[a+2]=r,this.int16[s+6]=n,this.int16[s+7]=o,t}}ba.prototype.bytesPerElement=16,mo("StructArrayLayout2f1f2i16",ba);class wa extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,o)}emplace(t,e,i,r,n,o,a){const s=16*t,l=4*t,c=8*t;return this.uint8[s+0]=e,this.uint8[s+1]=i,this.float32[l+1]=r,this.float32[l+2]=n,this.int16[c+6]=o,this.int16[c+7]=a,t}}wa.prototype.bytesPerElement=16,mo("StructArrayLayout2ub2f2i16",wa);class Ta extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,this.uint16[n+2]=r,t}}Ta.prototype.bytesPerElement=6,mo("StructArrayLayout3ui6",Ta);class Sa extends oa{_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(t,e,i,r,n,o,a,s,l,c,h,u,d,p,f,m,g){const _=this.length;return this.resize(_+1),this.emplace(_,t,e,i,r,n,o,a,s,l,c,h,u,d,p,f,m,g)}emplace(t,e,i,r,n,o,a,s,l,c,h,u,d,p,f,m,g,_){const y=24*t,v=12*t,x=48*t;return this.int16[y+0]=e,this.int16[y+1]=i,this.uint16[y+2]=r,this.uint16[y+3]=n,this.uint32[v+2]=o,this.uint32[v+3]=a,this.uint32[v+4]=s,this.uint16[y+10]=l,this.uint16[y+11]=c,this.uint16[y+12]=h,this.float32[v+7]=u,this.float32[v+8]=d,this.uint8[x+36]=p,this.uint8[x+37]=f,this.uint8[x+38]=m,this.uint32[v+10]=g,this.int16[y+22]=_,t}}Sa.prototype.bytesPerElement=48,mo("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Sa);class Pa extends oa{_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(t,e,i,r,n,o,a,s,l,c,h,u,d,p,f,m,g,_,y,v,x,b,w,T,S,P,I,M){const E=this.length;return this.resize(E+1),this.emplace(E,t,e,i,r,n,o,a,s,l,c,h,u,d,p,f,m,g,_,y,v,x,b,w,T,S,P,I,M)}emplace(t,e,i,r,n,o,a,s,l,c,h,u,d,p,f,m,g,_,y,v,x,b,w,T,S,P,I,M,E){const C=32*t,A=16*t;return this.int16[C+0]=e,this.int16[C+1]=i,this.int16[C+2]=r,this.int16[C+3]=n,this.int16[C+4]=o,this.int16[C+5]=a,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=h,this.uint16[C+10]=u,this.uint16[C+11]=d,this.uint16[C+12]=p,this.uint16[C+13]=f,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=_,this.uint16[C+17]=y,this.uint16[C+18]=v,this.uint16[C+19]=x,this.uint16[C+20]=b,this.uint16[C+21]=w,this.uint16[C+22]=T,this.uint32[A+12]=S,this.float32[A+13]=P,this.float32[A+14]=I,this.uint16[C+30]=M,this.uint16[C+31]=E,t}}Pa.prototype.bytesPerElement=64,mo("StructArrayLayout8i15ui1ul2f2ui64",Pa);class Ia extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}Ia.prototype.bytesPerElement=4,mo("StructArrayLayout1f4",Ia);class Ma extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.uint16[6*t+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t}}Ma.prototype.bytesPerElement=12,mo("StructArrayLayout1ui2f12",Ma);class Ea extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=i,this.uint16[n+3]=r,t}}Ea.prototype.bytesPerElement=8,mo("StructArrayLayout1ul2ui8",Ea);class Ca extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,t}}Ca.prototype.bytesPerElement=4,mo("StructArrayLayout2ui4",Ca);class Aa extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}Aa.prototype.bytesPerElement=2,mo("StructArrayLayout1ui2",Aa);class Da extends oa{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)}emplace(t,e,i,r,n){const o=4*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=r,this.float32[o+3]=n,t}}Da.prototype.bytesPerElement=16,mo("StructArrayLayout4f16",Da);class za extends na{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 i(this.anchorPointX,this.anchorPointY)}}za.prototype.size=20;class ka extends va{get(t){return new za(this,t)}}mo("CollisionBoxArray",ka);class Ra extends na{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(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Ra.prototype.size=48;class Fa extends Sa{get(t){return new Ra(this,t)}}mo("PlacedSymbolArray",Fa);class La extends na{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(t){this._structArray.uint32[this._pos4+12]=t}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]}}La.prototype.size=64;class Ba extends Pa{get(t){return new La(this,t)}}mo("SymbolInstanceArray",Ba);class Oa extends Ia{getoffsetX(t){return this.float32[1*t+0]}}mo("GlyphOffsetArray",Oa);class Va extends ca{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}mo("SymbolLineVertexArray",Va);class ja extends na{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]}}ja.prototype.size=12;class Na extends Ma{get(t){return new ja(this,t)}}mo("TextAnchorOffsetArray",Na);class Ua extends na{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Ua.prototype.size=8;
1class Ga extends Ea{get(t){return new Ua(this,t)}}mo("FeatureIndexArray",Ga);class Za extends la{}class qa extends la{}class Wa extends la{}class Xa extends ua{}class Ha extends da{}class Ya extends pa{}class Ka extends fa{}class Ja extends ma{}class Qa extends ga{}class $a extends _a{}class ts extends ya{}class es extends xa{}class is extends wa{}class rs extends Ta{}class ns extends Ca{}const os=aa([{name:"a_pos",components:2,type:"Int16"}],4),{members:as}=os;class ss{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._forceNewSegmentOnNextPrepare=!1,this.segments=t}prepareSegment(t,e,i,r){const n=this.segments[this.segments.length-1];return t>ss.MAX_VERTEX_ARRAY_LENGTH&&W("Max vertices per segment is ".concat(ss.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(t,". Consider using the `fillLargeMeshArrays` function if you require meshes with more than ").concat(ss.MAX_VERTEX_ARRAY_LENGTH," vertices.")),this._forceNewSegmentOnNextPrepare||!n||n.vertexLength+t>ss.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==r?this.createNewSegment(e,i,r):n}createNewSegment(t,e,i){const r={vertexOffset:t.length,primitiveOffset:e.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==i&&(r.sortKey=i),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(r),r}getOrCreateLatestSegment(t,e,i){return this.prepareSegment(0,t,e,i)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,i,r){return new ss([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:r,vaos:{},sortKey:0}])}}function ls(t,e){return 256*(t=O(Math.floor(t),0,255))+O(Math.floor(e),0,255)}ss.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,mo("SegmentVector",ss);const cs=aa([{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"}]),hs=aa([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var us,ds,ps,fs={exports:{}},ms={exports:{}},gs={exports:{}},_s=function(){if(ps)return fs.exports;ps=1;var t=(us||(us=1,ms.exports=function(t,e){var i,r,n,o,a,s,l,c;for(r=t.length-(i=3&t.length),n=e,a=3432918353,s=461845907,c=0;c<r;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,n=27492+(65535&(o=5*(65535&(n=(n^=l=(6
vendor: 10,607 bytes, line 1
15535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}),ms.exports),e=(ds||(ds=1,gs.exports=function(t,e){for(var i,r=t.length,n=e^r,o=0;r>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:n^=(255&t.charCodeAt(o+2))<<16;case 2:n^=(255&t.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}),gs.exports);return fs.exports=t,fs.exports.murmur3=t,fs.exports.murmur2=e,fs.exports}(),ys=o(_s);class vs{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,i,r){this.ids.push(xs(t)),this.positions.push(e,i,r)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const e=xs(t);let i=0,r=this.ids.length-1;for(;i<r;){const t=i+r>>1;this.ids[t]>=e?r=t:i=t+1}const n=[];for(;this.ids[i]===e;)n.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return n}static serialize(t,e){const i=new Float64Array(t.ids),r=new Uint32Array(t.positions);return bs(i,r,0,i.length-1),e&&e.push(i.buffer,r.buffer),{ids:i,positions:r}}static deserialize(t){const e=new vs;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function xs(t){const e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:ys(String(t))}function bs(t,e,i,r){for(;i<r;){const n=t[i+r>>1];let o=i-1,a=r+1;for(;;){do{o++}while(t[o]<n);do{a--}while(t[a]>n);if(o>=a)break;ws(t,o,a),ws(e,3*o,3*a),ws(e,3*o+1,3*a+1),ws(e,3*o+2,3*a+2)}a-i<r-a?(bs(t,e,i,a),i=a+1):(bs(t,e,a+1,r),r=a)}}function ws(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}mo("FeaturePositionMap",vs);class Ts{constructor(t,e){this.gl=t.gl,this.location=e}}class Ss extends Ts{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class Ps extends Ts{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class Is extends Ts{constructor(t,e){super(t,e),this.current=Ce.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const Ms=new Float32Array(16);function Es(t){return[ls(255*t.r,255*t.g),ls(255*t.b,255*t.a)]}class Cs{constructor(t,e,i){this.value=t,this.uniformNames=e.map((t=>"u_".concat(t))),this.type=i}setUniform(t,e,i){t.set(i.constantOr(this.value))}getBinding(t,e,i){return"color"===this.type?new Is(t,e):new Ss(t,e)}}class As{constructor(t,e){this.uniformNames=e.map((t=>"u_".concat(t))),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setConstantDashPositions(t,e){this.dashTo=[0,t.y,t.height,t.width],this.dashFrom=[0,e.y,e.height,e.width]}setUniform(t,e,i,r){let n=null;"u_pattern_to"===r?n=this.patternTo:"u_pattern_from"===r?n=this.patternFrom:"u_dasharray_to"===r?n=this.dashTo:"u_dasharray_from"===r?n=this.dashFrom:"u_pixel_ratio_to"===r?n=this.pixelRatioTo:"u_pixel_ratio_from"===r&&(n=this.pixelRatioFrom),null!==n&&t.set(n)}getBinding(t,e,i){return i.startsWith("u_pattern")||i.startsWith("u_dasharray_")?new Ps(t,e):new Ss(t,e)}}class Ds{constructor(t,e,i,r){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:"a_".concat(t),type:"Float32",components:"color"===i?2:1,offset:0}))),this.paintVertexArray=new r}populatePaintArray(t,e,i){const r=this.paintVertexArray.length,n=this.expression.evaluate(new Lo(0,i),e,{},i.canonical,[],i.formattedSection);this.paintVertexArray.resize(t),this._setPaintValue(r,t,n)}updatePaintArray(t,e,i,r,n){const o=this.expression.evaluate(new Lo(0,n),i,r);this._setPaintValue(t,e,o)}_setPaintValue(t,e,i){if("color"===this.type){const r=Es(i);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r[0],r[1])}else{for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class zs{constructor(t,e,i,r,n,o){this.expression=t,this.uniformNames=e.map((t=>"u_".concat(t,"_t"))),this.type=i,this.useIntegerZoom=r,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map((t=>({name:"a_".concat(t),type:"Float32",components:"color"===i?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(t,e,i){const r=this.expression.evaluate(new Lo(this.zoom,i),e,{},i.canonical,[],i.formattedSection),n=this.expression.evaluate(new Lo(this.zoom+1,i),e,{},i.canonical,[],i.formattedSection),o=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(o,t,r,n)}updatePaintArray(t,e,i,r,n){const o=this.expression.evaluate(new Lo(this.zoom,n),i,r),a=this.expression.evaluate(new Lo(this.zoom+1,n),i,r);this._setPaintValue(t,e,o,a)}_setPaintValue(t,e,i,r){if("color"===this.type){const n=Es(i),o=Es(r);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1],o[0],o[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i,r);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(r))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){const i=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,r=O(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(r)}getBinding(t,e,i){return new Ss(t,e)}}class ks{constructor(t,e,i,r,n,o){this.expression=t,this.type=e,this.useIntegerZoom=i,this.zoom=r,this.layerId=o,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(t,e,i){const r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,this.getPositionIds(e),i)}updatePaintArray(t,e,i,r,n){this._setPaintValues(t,e,this.getPositionIds(i),n)}_setPaintValues(t,e,i,r){const n=this.getPositions(r);if(!n||!i)return;const o=n[i.min],a=n[i.mid],s=n[i.max];if(o&&a&&s)for(let l=t;l<e;l++)this.emplace(this.zoomInPaintVertexArray,l,a,o),this.emplace(this.zoomOutPaintVertexArray,l,a,s)}upload(t){if(this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer){const e=this.getVertexAttributes();this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,e,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,e,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Rs extends ks{getPositions(t){return t.imagePositions}getPositionIds(t){return t.patterns&&t.patterns[this.layerId]}getVertexAttributes(){return cs.members}emplace(t,e,i,r){t.emplace(e,i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.pixelRatio,r.pixelRatio)}}class Fs extends ks{getPositions(t){return t.dashPositions}getPositionIds(t){return t.dashes&&t.dashes[this.layerId]}getVertexAttributes(){return hs.members}emplace(t,e,i,r){t.emplace(e,0,i.y,i.height,i.width,0,r.y,r.height,r.width)}}class Ls{constructor(t,e,i){this.binders={},this._buffers=[];const r=[];for(const n in t.paint._values){if(!i(n))continue;const o=t.paint.get(n);if(!(o instanceof qo&&Zr(o.property.specification)))continue;const a=Os(n,t.type),s=o.value,l=o.property.specification.type,c=o.property.useIntegerZoom,h=o.property.specification["property-type"],u="cross-faded"===h||"cross-faded-data-driven"===h;if("constant"===s.kind)this.binders[n]=u?new As(s.value,a):new Cs(s.value,a,l),r.push("/u_".concat(n));else if("source"===s.kind||u){const i=Vs(n,l,"source");this.binders[n]=u?"line-dasharray"===n?new Fs(s,l,c,e,i,t.id):new Rs(s,l,c,e,i,t.id):new Ds(s,a,l,i),r.push("/a_".concat(n))}else{const t=Vs(n,l,"composite");this.binders[n]=new zs(s,a,l,c,e,t),r.push("/z_".concat(n))}}this.cacheKey=r.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof Ds||e instanceof zs?e.maxValue:0}populatePaintArrays(t,e,i){for(const r in this.binders){const n=this.binders[r];(n instanceof Ds||n instanceof zs||n instanceof ks)&&n.populatePaintArray(t,e,i)}}setConstantPatternPositions(t,e){for(const i in this.binders){const r=this.binders[i];r instanceof As&&r.setConstantPatternPositions(t,e)}}setConstantDashPositions(t,e){for(const i in this.binders){const r=this.binders[i];r instanceof As&&r.setConstantDashPositions(t,e)}}updatePaintArrays(t,e,i,r,n){let o=!1;for(const a in t){const s=e.getPositions(a);for(const e of s){const s=i.feature(e.index);for(const i in this.binders){const l=this.binders[i];if((l instanceof Ds||l instanceof zs||l instanceof ks)&&!0===l.expression.isStateDependent){const c=r.paint.get(i);l.expression=c.value,l.updatePaintArray(e.start,e.end,s,t[a],n),o=!0}}}}return o}defines(){const t=[];for(const e in this.binders){const i=this.binders[e];
vendor: 9,276 bytes, line 1
1(i instanceof Cs||i instanceof As)&&t.push(...i.uniformNames.map((t=>"#define HAS_UNIFORM_".concat(t))))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Ds||i instanceof zs)for(let e=0;e<i.paintVertexAttributes.length;e++)t.push(i.paintVertexAttributes[e].name);else if(i instanceof ks){const e=i.getVertexAttributes();for(const i of e)t.push(i.name)}}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Cs||i instanceof As||i instanceof zs)for(const e of i.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){const i=[];for(const r in this.binders){const n=this.binders[r];if(n instanceof Cs||n instanceof As||n instanceof zs)for(const o of n.uniformNames)if(e[o]){const a=n.getBinding(t,e[o],o);i.push({name:o,property:r,binding:a})}}return i}setUniforms(t,e,i,r){for(const{name:n,property:o,binding:a}of e)this.binders[o].setUniform(a,r,i.get(o),n)}updatePaintBuffers(t){this._buffers=[];for(const e in this.binders){const i=this.binders[e];if(t&&i instanceof ks){const e=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;e&&this._buffers.push(e)}else(i instanceof Ds||i instanceof zs)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(t){for(const e in this.binders){const i=this.binders[e];(i instanceof Ds||i instanceof zs||i instanceof ks)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof Ds||e instanceof zs||e instanceof ks)&&e.destroy()}}}class Bs{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>!0;this.programConfigurations={};for(const r of t)this.programConfigurations[r.id]=new Ls(r,e,i);this.needsUpload=!1,this._featureMap=new vs,this._bufferOffset=0}populatePaintArrays(t,e,i,r){for(const n in this.programConfigurations)this.programConfigurations[n].populatePaintArrays(t,e,r);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,i,r){for(const n of i)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,r)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function Os(t,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":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"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"]}[t]||[t.replace("".concat(e,"-"),"").replace(/-/g,"_")]}function Vs(t,e,i){const r={color:{source:pa,composite:Da},number:{source:Ia,composite:pa}},n=function(t){return{"line-pattern":{source:Ka,composite:Ka},"fill-pattern":{source:Ka,composite:Ka},"fill-extrusion-pattern":{source:Ka,composite:Ka},"line-dasharray":{source:Ja,composite:Ja}}[t]}(t);return n&&n[i]||r[e][i]}mo("ConstantBinder",Cs),mo("CrossFadedConstantBinder",As),mo("SourceExpressionBinder",Ds),mo("CrossFadedPatternBinder",Rs),mo("CrossFadedDasharrayBinder",Fs),mo("CompositeExpressionBinder",zs),mo("ProgramConfiguration",Ls,{omit:["_buffers"]}),mo("ProgramConfigurationSet",Bs);const js=Math.pow(2,14)-1,Ns=-js-1;function Us(t){const e=D/t.extent,i=t.loadGeometry();for(let r=0;r<i.length;r++){const t=i[r];for(let i=0;i<t.length;i++){const r=t[i],n=Math.round(r.x*e),o=Math.round(r.y*e);r.x=O(n,Ns,js),r.y=O(o,Ns,js),(n<r.x||n>r.x+1||o<r.y||o>r.y+1)&&W("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function Gs(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Us(t):[]}}const Zs=-32768;function qs(t,e,i,r,n){t.emplaceBack(Zs+8*e+r,Zs+8*i+n)}class Ws{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new qa,this.indexArray=new rs,this.segments=new ss,this.programConfigurations=new Bs(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){const r=this.layers[0],n=[];let o=null,a=!1,s="heatmap"===r.type;if("circle"===r.type){const t=r;o=t.layout.get("circle-sort-key"),a=!o.isConstant(),s=s||"map"===t.paint.get("circle-pitch-alignment")}const l=s?e.subdivisionGranularity.circle:1;for(const{feature:c,id:h,index:u,sourceLayerIndex:d}of t){const t=this.layers[0]._featureFilter.needGeometry,e=Gs(c,t);if(!this.layers[0]._featureFilter.filter(new Lo(this.zoom),e,i))continue;const r=a?o.evaluate(e,{},i):void 0,s={id:h,properties:c.properties,type:c.type,sourceLayerIndex:d,index:u,geometry:t?e.geometry:Us(c),patterns:{},sortKey:r};n.push(s)}a&&n.sort(((t,e)=>t.sortKey-e.sortKey));for(const c of n){const{geometry:r,index:n,sourceLayerIndex:o}=c,a=t[n].feature;this.addFeature(c,r,n,i,l),e.featureIndex.insert(a,r,n,o,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i})}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,as),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,i,r){let n,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;switch(o){case 1:n=[0,7];break;case 3:n=[0,2,5,7];break;case 5:n=[0,1,3,4,6,7];break;case 7:n=[0,1,2,3,4,5,6,7];break;default:throw new Error("Invalid circle bucket granularity: ".concat(o,"; valid values are 1, 3, 5, 7."))}const a=n.length;for(const s of e)for(const e of s){const i=e.x,r=e.y;if(i<0||i>=D||r<0||r>=D)continue;const o=this.segments.prepareSegment(a*a,this.layoutVertexArray,this.indexArray,t.sortKey),s=o.vertexLength;for(let t=0;t<a;t++)for(let e=0;e<a;e++)qs(this.layoutVertexArray,i,r,n[e],n[t]);for(let t=0;t<a-1;t++)for(let e=0;e<a-1;e++){const i=s+t*a+e,r=s+(t+1)*a+e;this.indexArray.emplaceBack(i,r+1,i+1),this.indexArray.emplaceBack(i,r,r+1)}o.vertexLength+=a*a,o.primitiveLength+=(a-1)*(a-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:{},canonical:r})}}function Xs(t,e){for(let i=0;i<t.length;i++)if(il(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(il(t,e[i]))return!0;return!!Js(t,e)}function Hs(t,e,i){return!!il(t,e)||!!$s(e,t,i)}function Ys(t,e){if(1===t.length)return el(e,t[0]);for(let i=0;i<e.length;i++){const r=e[i];for(let e=0;e<r.length;e++)if(il(t,r[e]))return!0}for(let i=0;i<t.length;i++)if(el(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(Js(t,e[i]))return!0;return!1}function Ks(t,e,i){if(t.length>1){if(Js(t,e))return!0;for(let r=0;r<e.length;r++)if($s(e[r],t,i))return!0}for(let r=0;r<t.length;r++)if($s(t[r],e,i))return!0;return!1}function Js(t,e){if(0===t.length||0===e.length)return!1;for(let i=0;i<t.length-1;i++){const r=t[i],n=t[i+1];for(let t=0;t<e.length-1;t++)if(Qs(r,n,e[t],e[t+1]))return!0}return!1}function Qs(t,e,i,r){return X(t,i,r)!==X(e,i,r)&&X(t,e,i)!==X(t,e,r)}function $s(t,e,i){const r=i*i;if(1===e.length)return t.distSqr(e[0])<r;for(let n=1;n<e.length;n++)if(tl(t,e[n-1],e[n])<r)return!0;return!1}function tl(t,e,i){const r=e.distSqr(i);if(0===r)return t.distSqr(e);const n=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return t.distSqr(n<0?e:n>1?i:i.sub(e)._mult(n)._add(e))}function el(t,e){let i,r,n,o=!1;for(let a=0;a<t.length;a++){i=t[a];for(let t=0,a=i.length-1;t<i.length;a=t++)r=i[t],n=i[a],r.y>e.y!=n.y>e.y&&e.x<(n.x-r.x)*(e.y-r.y)/(n.y-r.y)+r.x&&(o=!o)}return o}function il(t,e){let i=!1;for(let r=0,n=t.length-1;r<t.length;n=r++){const o=t[r],a=t[n];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(i=!i)}return i}function rl(t,e,i){const r=i[0],n=i[2];if(t.x<r.x&&e.x<r.x||t.x>n.x&&e.x>n.x||t.y<r.y&&e.y<r.y||t.y>n.y&&e.y>n.y)return!1;const o=X(t,e,i[0]);return o!==X(t,e,i[1])||o!==X(t,e,i[2])||o!==X(t,e,i[3])}function nl(t,e,i){const r=e.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function ol(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function al(t,e,r,n,o){if(!e[0]&&!e[1])return t;const a=i.convert(e)._mult(o);"viewport"===r&&a._rotate(-n);const s=[];for(let i=0;i<t.length;i++)s.push(t[i].sub(a));return s}function sl(t){const e=[];for(let i=0;i<t.length;i++){const r=t[i],n=e.at(-1);
1(0===i||n&&!r.equals(n))&&e.push(r)}return e}function ll(t,e){let{queryGeometry:i,size:r}=t;return Hs(i,e,r)}function cl(t,e){let{queryGeometry:i,size:r,transform:n,unwrappedTileID:o,getElevation:a}=t;return Hs(i,e,r*(n.projectTileCoordinates(e.x,e.y,o,a).signedDistanceFromCamera/n.cameraToCenterDistance))}function hl(t,e){let{queryGeometry:i,size:r,transform:n,unwrappedTileID:o,getElevation:a}=t;const s=n.projectTileCoordinates(e.x,e.y,o,a).signedDistanceFromCamera,l=r*(n.cameraToCenterDistance/s);return Hs(i,pl(e,n,o,a),l)}function ul(t,e){let{queryGeometry:i,size:r,transform:n,unwrappedTileID:o,getElevation:a}=t;return Hs(i,pl(e,n,o,a),r)}function dl(t,e){let{queryGeometry:i,size:r,transform:n,unwrappedTileID:o,getElevation:a,pitchAlignment:s="map",pitchScale:l="map"}=t;const c="map"===s?"map"===l?ll:cl:"map"===l?hl:ul,h={queryGeometry:i,size:r,transform:n,unwrappedTileID:o,getElevation:a};for(const u of e)for(const t of u)if(c(h,t))return!0;return!1}function pl(t,e,r,n){const o=e.projectTileCoordinates(t.x,t.y,r,n).point;return new i((.5*o.x+.5)*e.width,(.5*-o.y+.5)*e.height)}let fl,ml;mo("CircleBucket",Ws,{omit:["layers"]});var gl={get paint(){return ml=ml||new Qo({"circle-radius":new Ho(bt.paint_circle["circle-radius"]),"circle-color":new Ho(bt.paint_circle["circle-color"]),"circle-blur":new Ho(bt.paint_circle["circle-blur"]),"circle-opacity":new Ho(bt.paint_circle["circle-opacity"]),"circle-translate":new Xo(bt.paint_circle["circle-translate"]),"circle-translate-anchor":new Xo(bt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Xo(bt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Xo(bt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ho(bt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ho(bt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ho(bt.paint_circle["circle-stroke-opacity"])})},get layout(){return fl=fl||new Qo({"circle-sort-key":new Ho(bt.layout_circle["circle-sort-key"])})}};class _l extends $o{constructor(t,e){super(t,gl,e)}createBucket(t){return new Ws(t)}queryRadius(t){const e=t;return nl("circle-radius",this,e)+nl("circle-stroke-width",this,e)+ol(this.paint.get("circle-translate"))}queryIntersectsFeature(t){let{queryGeometry:e,feature:i,featureState:r,geometry:n,transform:o,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:l}=t;const c=al(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-o.bearingInRadians,a),h=this.paint.get("circle-radius").evaluate(i,r)+this.paint.get("circle-stroke-width").evaluate(i,r),u=this.paint.get("circle-pitch-scale"),d=this.paint.get("circle-pitch-alignment");let p,f;return"map"===d?(p=c,f=h*a):(p=function(t,e,i,r){return t.map((t=>pl(t,e,i,r)))}(c,o,s,l),f=h),dl({queryGeometry:p,size:f,transform:o,unwrappedTileID:s,getElevation:l,pitchAlignment:d,pitchScale:u},n)}}class yl extends Ws{}let vl;mo("HeatmapBucket",yl,{omit:["layers"]});var xl={get paint(){return vl=vl||new Qo({"heatmap-radius":new Ho(bt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ho(bt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Xo(bt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Jo(bt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Xo(bt.paint_heatmap["heatmap-opacity"])})}};function bl(t,e,i,r){let{width:n,height:o}=e;if(r){if(r instanceof Uint8ClampedArray)r=new Uint8Array(r.buffer);else if(r.length!==n*o*i)throw new RangeError("mismatched image size. expected: ".concat(r.length," but got: ").concat(n*o*i))}else r=new Uint8Array(n*o*i);return t.width=n,t.height=o,t.data=r,t}function wl(t,e,i){let{width:r,height:n}=e;if(r===t.width&&n===t.height)return;const o=bl({},{width:r,height:n},i);Tl(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,r),height:Math.min(t.height,n)},i),t.width=r,t.height=n,t.data=o.data}function Tl(t,e,i,r,n,o){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");const a=t.data,s=e.data;if(a===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){const c=((i.y+l)*t.width+i.x)*o,h=((r.y+l)*e.width+r.x)*o;for(let t=0;t<n.width*o;t++)s[h+t]=a[c+t]}return e}class Sl{constructor(t,e){bl(this,t,1,e)}resize(t){wl(this,t,1)}clone(){return new Sl({width:this.width,height:this.height},new Uint8Array(this.data))}
1static copy(t,e,i,r,n){Tl(t,e,i,r,n,1)}}class Pl{constructor(t,e){bl(this,t,4,e)}resize(t){wl(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Pl({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,r,n){Tl(t,e,i,r,n,4)}setPixel(t,e,i){const r=4*(t*this.width+e);this.data[r+0]=Math.round(255*i.r/i.a),this.data[r+1]=Math.round(255*i.g/i.a),this.data[r+2]=Math.round(255*i.b/i.a),this.data[r+3]=Math.round(255*i.a)}}function Il(t){const e=new Uint8Array(t.length);for(let i=0;i<t.length;i+=4){const r=t[i+3];e[i+0]=Math.round(t[i+0]*r/255),e[i+1]=Math.round(t[i+1]*r/255),e[i+2]=Math.round(t[i+2]*r/255),e[i+3]=r}return e}function Ml(t){const e={},i=t.resolution||256,r=t.clips?t.clips.length:1,n=t.image||new Pl({width:i,height:r});if(Math.log(i)/Math.LN2%1!=0)throw new Error("width is not a power of 2 - ".concat(i));const o=(r,o,a)=>{e[t.evaluationKey]=a;const s=t.expression.evaluate(e);n.setPixel(r/4/i,o/4,s)};if(t.clips)for(let a=0,s=0;a<r;++a,s+=4*i)for(let e=0,r=0;e<i;e++,r+=4){const n=e/(i-1),{start:l,end:c}=t.clips[a];o(s,r,l*(1-n)+c*n)}else for(let a=0,s=0;a<i;a++,s+=4)o(0,s,a/(i-1));return n}mo("AlphaImage",Sl),mo("RGBAImage",Pl);const El="big-fb";class Cl extends $o{createBucket(t){return new yl(t)}constructor(t,e){super(t,xl,e),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Ml({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(El)&&this.heatmapFbos.delete(El)}queryRadius(t){return nl("heatmap-radius",this,t)}queryIntersectsFeature(t){let{queryGeometry:e,feature:i,featureState:r,geometry:n,transform:o,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:l}=t;return dl({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(i,r)*a,transform:o,unwrappedTileID:s,getElevation:l},n)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&!this.isHidden()}}let Al;var Dl={get paint(){return Al=Al||new Qo({"hillshade-illumination-direction":new Xo(bt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new Xo(bt.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new Xo(bt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Xo(bt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Xo(bt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Xo(bt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Xo(bt.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new Xo(bt.paint_hillshade["hillshade-method"]),resampling:new Xo(bt.paint_hillshade.resampling)})}};class zl extends $o{constructor(t,e){super(t,Dl,e),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let t=this.paint.get("hillshade-illumination-direction").values,e=this.paint.get("hillshade-illumination-altitude").values,i=this.paint.get("hillshade-highlight-color").values,r=this.paint.get("hillshade-shadow-color").values;const n=Math.max(t.length,e.length,i.length,r.length);t=t.concat(Array(n-t.length).fill(t.at(-1))),e=e.concat(Array(n-e.length).fill(e.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1)));const o=e.map(it);return{directionRadians:t.map(it),altitudeRadians:o,shadowColor:r,highlightColor:i}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&!this.isHidden()}}let kl;var Rl={get paint(){return kl=kl||new Qo({"color-relief-opacity":new Xo(bt["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new Jo(bt["paint_color-relief"]["color-relief-color"]),resampling:new Xo(bt["paint_color-relief"].resampling)})}};function Fl(t){return"data"in t}class Ll{constructor(t,e,i,r){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this._ownedHandle=this.texture,this.update(e,r)}update(t,e,i){const{width:r,height:n}=t,o=!(this.size&&this.size[0]===r&&this.size[1]===n||i),{context:a}=this,{gl:s}=a;this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1);const l=this.format===s.RGBA&&(!e||!1!==e.premultiply);if(o)this.size=[r,n],Fl(t)?(a.pixelStoreUnpackPremultiplyAlpha.set(!1),this._uploadRawData(t,l,r,n,s)):(a.pixelStoreUnpackPremultiplyAlpha.set(l),this._uploadDomImage(t,s));else{const{x:e,y:o}=i||{x:0,y:0};Fl(t)?(a.pixelStoreUnpackPremultiplyAlpha.set(!1),this._updateRawData(t,l,e,o,r,n,s)):(a.pixelStoreUnpackPremultiplyAlpha.set(l),this._updateDomImage(t,e,o,s))}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D),a.pixelStoreUnpackFlipY.setDefault(),a.pixelStoreUnpack.setDefault(),a.pixelStoreUnpackPremultiplyAlpha.setDefault()}_uploadDomImage(t,e){e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t)}
1_uploadRawData(t,e,i,r,n){let{data:o}=t;e&&o&&(o=Il(o)),n.texImage2D(n.TEXTURE_2D,0,this.format,i,r,0,this.format,n.UNSIGNED_BYTE,o)}_updateDomImage(t,e,i,r){r.texSubImage2D(r.TEXTURE_2D,0,e,i,r.RGBA,r.UNSIGNED_BYTE,t)}_updateRawData(t,e,i,r,n,o,a){let{data:s}=t;e&&s&&(s=Il(s)),a.texSubImage2D(a.TEXTURE_2D,0,i,r,n,o,a.RGBA,a.UNSIGNED_BYTE,s)}bind(t,e,i){const{context:r}=this,{gl:n}=r;this.texture!==this._ownedHandle&&(this.texture=this._ownedHandle),n.bindTexture(n.TEXTURE_2D,this.texture),i!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}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,this._ownedHandle=null}}class Bl{constructor(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i))return void W('"'.concat(i,'" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".'));this.stride=e.height;const s=this.dim=e.height-2;switch(this.data=new Uint32Array(e.data.buffer),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=r,this.greenFactor=n,this.blueFactor=o,this.baseShift=a;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let l=0;l<s;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(s,l)]=this.data[this._idx(s-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,s)]=this.data[this._idx(l,s-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(s,-1)]=this.data[this._idx(s-1,0)],this.data[this._idx(-1,s)]=this.data[this._idx(0,s-1)],this.data[this._idx(s,s)]=this.data[this._idx(s-1,s-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let l=0;l<s;l++)for(let t=0;t<s;t++){const e=this.get(l,t);e>this.max&&(this.max=e),e<this.min&&(this.min=e)}}get(t,e){const i=new Uint8Array(this.data.buffer),r=4*this._idx(t,e);return this.unpack(i[r],i[r+1],i[r+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("Out of range source coordinates for DEM data. x: ".concat(t,", y: ").concat(e,", dim: ").concat(this.dim));return(e+1)*this.stride+(t+1)}
1unpack(t,e,i){return t*this.redFactor+e*this.greenFactor+i*this.blueFactor-this.baseShift}pack(t){return Ol(t,this.getUnpackVector())}getPixels(){return new Pl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let r=e*this.dim,n=e*this.dim+this.dim,o=i*this.dim,a=i*this.dim+this.dim;switch(e){case-1:r=n-1;break;case 1:n=r+1}switch(i){case-1:o=a-1;break;case 1:a=o+1}const s=-e*this.dim,l=-i*this.dim;for(let c=o;c<a;c++)for(let e=r;e<n;e++)this.data[this._idx(e,c)]=t.data[this._idx(e+s,c+l)]}}function Ol(t,e){const i=e[0],r=e[1],n=e[2],o=e[3],a=Math.min(i,r,n),s=Math.round((t+o)/a);return{r:Math.floor(s*a/i)%256,g:Math.floor(s*a/r)%256,b:Math.floor(s*a/n)%256}}mo("DEMData",Bl);class Vl extends $o{constructor(t,e){super(t,Rl,e)}_createColorRamp(t){const e={elevationStops:[],colorStops:[]},i=this._transitionablePaint._values["color-relief-color"].value.expression;if(i instanceof an&&i._styleExpression.expression instanceof mi){this.colorRampExpression=i;const t=i._styleExpression.expression;e.elevationStops=t.labels,e.colorStops=[];for(const i of e.elevationStops)e.colorStops.push(t.evaluate({globals:{elevation:i}}))}if(e.elevationStops.length<1&&(e.elevationStops=[0],e.colorStops=[Ce.transparent]),e.elevationStops.length<2&&(e.elevationStops.push(e.elevationStops[0]+1),e.colorStops.push(e.colorStops[0])),e.elevationStops.length<=t)return e;const r={elevationStops:[],colorStops:[]},n=(e.elevationStops.length-1)/(t-1);for(let o=0;o<e.elevationStops.length-.5;o+=n)r.elevationStops.push(e.elevationStops[Math.round(o)]),r.colorStops.push(e.colorStops[Math.round(o)]);return W("Too many colors in specification of ".concat(this.id," color-relief layer, may not render properly. Max possible colors: ").concat(t,", provided: ").concat(e.elevationStops.length)),r}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(t,e,i){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;const r=this._createColorRamp(e),n=new Pl({width:r.colorStops.length,height:1}),o=new Pl({width:r.colorStops.length,height:1});for(let a=0;a<r.elevationStops.length;a++){const t=Ol(r.elevationStops[a],i);o.setPixel(0,a,new Ce(t.r/255,t.g/255,t.b/255,1)),n.setPixel(0,a,r.colorStops[a])}return this.colorRampTextures={elevationTexture:new Ll(t,o,t.gl.RGBA),colorTexture:new Ll(t,n,t.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return!this.isHidden()&&!!this.colorRampTextures}}const jl=aa([{name:"a_pos",components:2,type:"Int16"}],4),{members:Nl}=jl;function Ul(t,e,i){const r=i.patternDependencies;let n=!1;for(const o of e){const e=o.paint.get("".concat(t,"-pattern"));e.isConstant()||(n=!0);const i=e.constantOr(null);i&&(n=!0,r[i.to]=!0,r[i.from]=!0)}return n}function Gl(t,e,i,r,n){const{zoom:o}=r,a=n.patternDependencies;for(const s of e){const e=s.paint.get("".concat(t,"-pattern")).value;if("constant"!==e.kind){let t=e.evaluate({zoom:o-1},i,{},n.availableImages),r=e.evaluate({zoom:o},i,{},n.availableImages),l=e.evaluate({zoom:o+1},i,{},n.availableImages);t=t&&t.name?t.name:t,r=r&&r.name?r.name:r,l=l&&l.name?l.name:l,a[t]=!0,a[r]=!0,a[l]=!0,i.patterns[s.id]={min:t,mid:r,max:l}}}return i}function Zl(t,e,i,r,n){let o;if(n===function(t,e,i,r){let n=0;for(let o=e,a=i-r;o<i;o+=r)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}(t,e,i,r)>0)for(let a=e;a<i;a+=r)o=dc(a/r|0,t[a],t[a+1],o);else for(let a=i-r;a>=e;a-=r)o=dc(a/r|0,t[a],t[a+1],o);return o&&ac(o,o.next)&&(pc(o),o=o.next),o}function ql(t,e){if(!t)return t;e||(e=t);let i,r=t;do{if(i=!1,r.steiner||!ac(r,r.next)&&0!==oc(r.prev,r,r.next))r=r.next;else{if(pc(r),r=e=r.prev,r===r.next)break;i=!0}}while(i||r!==e);return e}function Wl(t,e,i,r,n,o,a){if(!t)return;!a&&o&&function(t,e,i,r){let n=t;do{0===n.z&&(n.z=tc(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){let e,i=1;do{let r,n=t;t=null;let o=null;for(e=0;n;){e++;let a=n,s=0;for(let t=0;t<i&&(s++,a=a.nextZ,a);t++);let l=i;for(;s>0||l>0&&a;)0!==s&&(0===l||!a||n.z<=a.z)?(r=n,n=n.nextZ,s--):(r=a,a=a.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=a}o.nextZ=null,i*=2}while(e>1)}(n)}(t,r,n,o);let s=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(o?Hl(t,r,n,o):Xl(t))e.push(l.i,t.i,c.i),pc(t),t=c.next,s=c.next;else if((t=c)===s){a?1===a?Wl(t=Yl(ql(t),e),e,i,r,n,o,2):2===a&&Kl(t,e,i,r,n,o):Wl(ql(t),e,i,r,n,o,1);break}}}function Xl(t){const e=t.prev,i=t,r=t.next;if(oc(e,i,r)>=0)return!1;const n=e.x,o=i.x,a=r.x,s=e.y,l=i.y,c=r.y,h=Math.min(n,o,a),u=Math.min(s,l,c),d=Math.max(n,o,a),p=Math.max(s,l,c);let f=r.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&rc(n,s,o,l,a,c,f.x,f.y)&&oc(f.prev,f,f.next)>=0)return!1;
vendor: 11,590 bytes, line 1
1f=f.next}return!0}function Hl(t,e,i,r){const n=t.prev,o=t,a=t.next;if(oc(n,o,a)>=0)return!1;const s=n.x,l=o.x,c=a.x,h=n.y,u=o.y,d=a.y,p=Math.min(s,l,c),f=Math.min(h,u,d),m=Math.max(s,l,c),g=Math.max(h,u,d),_=tc(p,f,e,i,r),y=tc(m,g,e,i,r);let v=t.prevZ,x=t.nextZ;for(;v&&v.z>=_&&x&&x.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==a&&rc(s,h,l,u,c,d,v.x,v.y)&&oc(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==a&&rc(s,h,l,u,c,d,x.x,x.y)&&oc(x.prev,x,x.next)>=0)return!1;x=x.nextZ}for(;v&&v.z>=_;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=g&&v!==n&&v!==a&&rc(s,h,l,u,c,d,v.x,v.y)&&oc(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=g&&x!==n&&x!==a&&rc(s,h,l,u,c,d,x.x,x.y)&&oc(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Yl(t,e){let i=t;do{const r=i.prev,n=i.next.next;!ac(r,n)&&sc(r,i,i.next,n)&&hc(r,n)&&hc(n,r)&&(e.push(r.i,i.i,n.i),pc(i),pc(i.next),i=t=n),i=i.next}while(i!==t);return ql(i)}function Kl(t,e,i,r,n,o){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&nc(a,t)){let s=uc(a,t);return a=ql(a,a.next),s=ql(s,s.next),Wl(a,e,i,r,n,o,0),void Wl(s,e,i,r,n,o,0)}t=t.next}a=a.next}while(a!==t)}function Jl(t,e){let i=t.x-e.x;return 0===i&&(i=t.y-e.y,0===i)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)),i}function Ql(t,e){const i=function(t,e){let i=e;const r=t.x,n=t.y;let o,a=-1/0;if(ac(t,i))return i;do{if(ac(t,i.next))return i.next;if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){const t=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=r&&t>a&&(a=t,o=i.x<i.next.x?i:i.next,t===r))return o}i=i.next}while(i!==e);if(!o)return null;const s=o,l=o.x,c=o.y;let h=1/0;i=o;do{if(r>=i.x&&i.x>=l&&r!==i.x&&ic(n<c?r:a,n,l,c,n<c?a:r,n,i.x,i.y)){const e=Math.abs(n-i.y)/(r-i.x);hc(i,t)&&(e<h||e===h&&(i.x>o.x||i.x===o.x&&$l(o,i)))&&(o=i,h=e)}i=i.next}while(i!==s);return o}(t,e);if(!i)return e;const r=uc(i,t);return ql(r,r.next),ql(i,i.next)}function $l(t,e){return oc(t.prev,t,e.prev)<0&&oc(e.next,t,t.next)<0}function tc(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ec(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function ic(t,e,i,r,n,o,a,s){return(n-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(r-s)>=(i-a)*(e-s)&&(i-a)*(o-s)>=(n-a)*(r-s)}function rc(t,e,i,r,n,o,a,s){return!(t===a&&e===s)&&ic(t,e,i,r,n,o,a,s)}function nc(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&sc(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(hc(t,e)&&hc(e,t)&&function(t,e){let i=t,r=!1;const n=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(oc(t.prev,t,e.prev)||oc(t,e.prev,e))||ac(t,e)&&oc(t.prev,t,t.next)>0&&oc(e.prev,e,e.next)>0)}function oc(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function ac(t,e){return t.x===e.x&&t.y===e.y}function sc(t,e,i,r){const n=cc(oc(t,e,i)),o=cc(oc(t,e,r)),a=cc(oc(i,r,t)),s=cc(oc(i,r,e));return n!==o&&a!==s||!(0!==n||!lc(t,i,e))||!(0!==o||!lc(t,r,e))||!(0!==a||!lc(i,t,r))||!(0!==s||!lc(i,e,r))}function lc(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function cc(t){return t>0?1:t<0?-1:0}function hc(t,e){return oc(t.prev,t,t.next)<0?oc(t,e,t.next)>=0&&oc(t,t.prev,e)>=0:oc(t,e,t.prev)<0||oc(t,t.next,e)<0}function uc(t,e){const i=fc(t.i,t.x,t.y),r=fc(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function dc(t,e,i,r){const n=fc(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function pc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function fc(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class mc{constructor(t,e){if(e>t)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class gc{constructor(t){this.fill=t.fill,this.line=t.line,this.tile=t.tile,this.stencil=t.stencil,this.circle=t.circle}}gc.noSubdivision=new gc({fill:new mc(0,0),line:new mc(0,0),tile:new mc(0,0),stencil:new mc(0,0),circle:1}),mo("SubdivisionGranularityExpression",mc),mo("SubdivisionGranularitySetting",gc);const _c=-32768,yc=32767;class vc{constructor(t,e){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=t,this._granularityCellSize=D/t,this._canonical=e}_getKey(t,e){return(t+=32768)<<16|e+32768}_vertexToIndex(t,e){if(t<-32768||e<-32768||t>32767||e>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");const i=0|Math.round(t),r=0|Math.round(e),n=this._getKey(i,r);if(this._vertexDictionary.has(n))return this._vertexDictionary.get(n);const o=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,o),this._vertexBuffer.push(i,r),o}_subdivideTrianglesScanline(t){if(this._granularity<2)return function(t,e){const i=[];for(let r=0;r<e.length;r+=3){const n=e[r],o=e[r+1],a=e[r+2],s=t[2*n],l=t[2*n+1];(t[2*o]-s)*(t[2*a+1]-l)-(t[2*o+1]-l)*(t[2*a]-s)>0?(i.push(n),i.push(a),i.push(o)):(i.push(n),i.push(o),i.push(a))}return i}(this._vertexBuffer,t);const e=[],i=t.length;for(let r=0;r<i;r+=3){const i=[t[r+0],t[r+1],t[r+2]],n=[this._vertexBuffer[2*t[r+0]+0],this._vertexBuffer[2*t[r+0]+1],this._vertexBuffer[2*t[r+1]+0],this._vertexBuffer[2*t[r+1]+1],this._vertexBuffer[2*t[r+2]+0],this._vertexBuffer[2*t[r+2]+1]];let o=1/0,a=1/0,s=-1/0,l=-1/0;for(let t=0;t<3;t++){const e=n[2*t],i=n[2*t+1];o=Math.min(o,e),s=Math.max(s,e),a=Math.min(a,i),l=Math.max(l,i)}if(o===s||a===l)continue;const c=Math.floor(o/this._granularityCellSize),h=Math.ceil(s/this._granularityCellSize),u=Math.floor(a/this._granularityCellSize),d=Math.ceil(l/this._granularityCellSize);if(c!==h||u!==d)for(let t=u;t<d;t++){const r=this._scanlineGenerateVertexRingForCellRow(t,n,i);wc(this._vertexBuffer,r,e)}else e.push(...i)}return e}_scanlineGenerateVertexRingForCellRow(t,e,i){const r=t*this._granularityCellSize,n=r+this._granularityCellSize,o=[];for(let a=0;a<3;a++){const t=e[2*a],s=e[2*a+1],l=e[2*(a+1)%6],c=e[(2*(a+1)+1)%6],h=e[2*(a+2)%6],u=e[(2*(a+2)+1)%6],d=l-t,p=c-s,f=0===d,m=0===p,g=(r-s)/p,_=(n-s)/p,y=Math.min(g,_),v=Math.max(g,_);if(!m&&(y>=1||v<=0)||m&&(s<r||s>n)){c>=r&&c<=n&&o.push(i[(a+1)%3]);continue}!m&&y>0&&o.push(this._vertexToIndex(t+d*y,s+p*y));const x=t+d*Math.max(y,0),b=t+d*Math.min(v,1);f||this._generateIntraEdgeVertices(o,t,s,l,c,x,b),!m&&v<1&&o.push(this._vertexToIndex(t+d*v,s+p*v)),(m||c>=r&&c<=n)&&o.push(i[(a+1)%3]),!m&&(c<=r||c>=n)&&this._generateInterEdgeVertices(o,t,s,l,c,h,u,b,r,n)}return o}_generateIntraEdgeVertices(t,e,i,r,n,o,a){const s=r-e,l=n-i,c=0===l,h=c?Math.min(e,r):Math.min(o,a),u=c?Math.max(e,r):Math.max(o,a),d=Math.floor(h/this._granularityCellSize)+1,p=Math.ceil(u/this._granularityCellSize)-1;if(c?e<r:o<a)for(let f=d;f<=p;f++){const r=f*this._granularityCellSize;t.push(this._vertexToIndex(r,i+l*(r-e)/s))}else for(let f=p;f>=d;f--){const r=f*this._granularityCellSize;t.push(this._vertexToIndex(r,i+l*(r-e)/s))}}_generateInterEdgeVertices(t,e,i,r,n,o,a,s,l,c){const h=n-i,u=o-r,d=a-n,p=(l-n)/d,f=(c-n)/d,m=Math.min(p,f),g=Math.max(p,f),_=r+u*m;let y=Math.floor(Math.min(_,s)/this._granularityCellSize)+1,v=Math.ceil(Math.max(_,s)/this._granularityCellSize)-1,x=s<_;const b=0===d;if(b&&(a===l||a===c))return;if(b||m>=1||g<=0){const t=i-a,r=o+(e-o)*Math.min((l-a)/t,(c-a)/t);y=Math.floor(Math.min(r,s)/this._granularityCellSize)+1,v=Math.ceil(Math.max(r,s)/this._granularityCellSize)-1,x=s<r}const w=h>0?c:l;if(x)for(let T=y;T<=v;T++)t.push(this._vertexToIndex(T*this._granularityCellSize,w));else for(let T=v;T>=y;T--)t.push(this._vertexToIndex(T*this._granularityCellSize,w))}_generateOutline(t){const e=[];for(const i of t){const t=bc(i,this._granularity,!0),r=this._pointArrayToIndices(t),n=[];for(let e=1;e<r.length;e++)n.push(r[e-1]),n.push(r[e]);e.push(n)}return e}_handlePoles(t){let e=!1,i=!1;this._canonical&&(0===this._canonical.y&&(e=!0),this._canonical.y===(1<<this._canonical.z)-1&&(i=!0)),(e||i)&&this._fillPoles(t,e,i)}_ensureNoPoleVertices(){const t=this._vertexBuffer;for(let e=0;e<t.length;e+=2){const i=t[e+1];i===_c&&(t[e+1]=-32767),i===yc&&(t[e+1]=32766)}}_generatePoleQuad(t,e,i,r,n,o){r>n!=(o===_c)?(t.push(e),t.push(i),t.push(this._vertexToIndex(r,o)),t.push(i),t.push(this._vertexToIndex(n,o)),t.push(this._vertexToIndex(r,o))):(t.push(i),t.push(e),t.push(this._vertexToIndex(r,o)),t.push(this._vertexToIndex(n,o)),t.push(i),t.push(this._vertexToIndex(r,o)))}_fillPoles(t,e,i){const r=this._vertexBuffer,n=D,o=t.length;for(let a=2;a<o;a+=3){const o=t[a-2],s=t[a-1],l=t[a],c=r[2*o],h=r[2*o+1],u=r[2*s],d=r[2*s+1],p=r[2*l],f=r[2*l+1];e&&(0===h&&0===d&&this._generatePoleQuad(t,o,s,c,u,_c),0===d&&0===f&&this._generatePoleQuad(t,s,l,u,p,_c),0===f&&0===h&&this._generatePoleQuad(t,l,o,p,c,_c)),i&&(h===n&&d===n&&this._generatePoleQuad(t,o,s,c,u,yc),d===n&&f===n&&this._generatePoleQuad(t,s,l,u,p,yc),f===n&&h===n&&this._generatePoleQuad(t,l,o,p,c,yc))}}_initializeVertices(t){for(let e=0;e<t.length;e+=2)this._vertexToIndex(t[e],t[e+1])}subdividePolygonInternal(t,e){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:i,holeIndices:r}=function(t){const e=[],i=[];for(const r of t)if(0!==r.length){r!==t[0]&&e.push(i.length/2);for(let t=0;t<r.length;t++)i.push(r[t].x),i.push(r[t].y)}return{flattened:i,holeIndices:e}}(t);let n;this._initializeVertices(i);try{const t=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;const r=e&&e.length,n=r?e[0]*i:t.length;let o=Zl(t,0,n,i,!0);const a=[];if(!o||o.next===o.prev)return a;let s,l,c;if(r&&(o=function(t,e,i,r){const n=[];for(let o=0,a=e.length;o<a;o++){const i=Zl(t,e[o]*r,o<a-1?e[o+1]*r:t.length,r,!1);i===i.next&&(i.steiner=!0),n.push(ec(i))}n.sort(Jl);for(let o=0;o<n.length;o++)i=Ql(n[o],i);return i}(t,e,o,i)),t.length>80*i){s=t[0],l=t[1];let e=s,r=l;for(let o=i;o<n;o+=i){const i=t[o],n=t[o+1];i<s&&(s=i),n<l&&(l=n),i>e&&(e=i),n>r&&(r=n)}c=Math.max(e-s,r-l),c=0!==c?32767/c:0}return Wl(o,a,i,s,l,c,0),a}(i,r),e=this._convertIndices(i,t);n=this._subdivideTrianglesScanline(e)}catch(t){console.error(t)}let o=[];return e&&(o=this._generateOutline(t)),this._ensureNoPoleVertices(),this._handlePoles(n),{verticesFlattened:this._vertexBuffer,indicesTriangles:n,indicesLineList:o}}_convertIndices(t,e){const i=[];for(let r=0;r<e.length;r++)i.push(this._vertexToIndex(t[2*e[r]],t[2*e[r]+1]));return i}_pointArrayToIndices(t){const e=[];for(let i=0;i<t.length;i++){const r=t[i];e.push(this._vertexToIndex(r.x,r.y))}return e}}function xc(t,e,i){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return new vc(i,e).subdividePolygonInternal(t,r)}function bc(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t||t.length<1)return[];if(t.length<2)return[];const n=t[0],o=t[t.length-1],a=r&&(n.x!==o.x||n.y!==o.y);if(e<2)return a?[...t,t[0]]:[...t];const s=Math.floor(D/e),l=[];l.push(new i(t[0].x,t[0].y));const c=t.length,h=a?c:c-1;for(let u=0;u<h;u++){const e=t[u],r=u<c-1?t[u+1]:t[0],n=e.x,o=e.y,a=r.x,h=r.y,d=n!==a,p=o!==
vendor: 9,777 bytes, line 1
1h;if(!d&&!p)continue;const f=a-n,m=h-o,g=Math.abs(f),_=Math.abs(m);let y=n,v=o;for(;;){const t=f>0?(Math.floor(y/s)+1)*s:(Math.ceil(y/s)-1)*s,e=m>0?(Math.floor(v/s)+1)*s:(Math.ceil(v/s)-1)*s,r=Math.abs(y-t),n=Math.abs(v-e),o=Math.abs(y-a),c=Math.abs(v-h),u=d?r/g:Number.POSITIVE_INFINITY,x=p?n/_:Number.POSITIVE_INFINITY;if((o<=r||!d)&&(c<=n||!p))break;if(u<x&&d||!p){y=t,v+=m*u;const e=new i(y,Math.round(v));l[l.length-1].x===e.x&&l[l.length-1].y===e.y||l.push(e)}else{y+=f*x,v=e;const t=new i(Math.round(y),v);l[l.length-1].x===t.x&&l[l.length-1].y===t.y||l.push(t)}}const x=new i(a,h);l[l.length-1].x===x.x&&l[l.length-1].y===x.y||l.push(x)}return l}function wc(t,e,i){if(0===e.length)throw new Error("Subdivision vertex ring is empty.");let r=0,n=t[2*e[0]];for(let l=1;l<e.length;l++){const i=t[2*e[l]];i<n&&(n=i,r=l)}const o=e.length;let a=r,s=(a+1)%o;for(;;){const r=a-1>=0?a-1:o-1,n=(s+1)%o,l=t[2*e[r]],c=t[2*e[n]],h=t[2*e[a]],u=t[2*e[a]+1],d=t[2*e[s]+1];let p=!1;if(l<c)p=!0;else if(l>c)p=!1;else{const i=d-u,o=-(t[2*e[s]]-h),a=u<d?1:-1;((l-h)*i+(t[2*e[r]+1]-u)*o)*a>((c-h)*i+(t[2*e[n]+1]-u)*o)*a&&(p=!0)}if(p){const t=e[r],n=e[a],l=e[s];t!==n&&t!==l&&n!==l&&i.push(l,n,t),a--,a<0&&(a=o-1)}else{const t=e[n],r=e[a],l=e[s];t!==r&&t!==l&&r!==l&&i.push(l,r,t),s++,s>=o&&(s=0)}if(r===n)break}}function Tc(t,e,i,r,n,o,a,s,l){const c=n.length/2,h=a&&s&&l;if(c<ss.MAX_VERTEX_ARRAY_LENGTH){const u=e.prepareSegment(c,i,r),d=u.vertexLength;for(let t=0;t<o.length;t+=3)r.emplaceBack(d+o[t],d+o[t+1],d+o[t+2]);let p,f;u.vertexLength+=c,u.primitiveLength+=o.length/3,h&&(f=a.prepareSegment(c,i,s),p=f.vertexLength,f.vertexLength+=c);for(let e=0;e<n.length;e+=2)t(n[e],n[e+1]);if(h)for(let t=0;t<l.length;t++){const e=l[t];for(let t=1;t<e.length;t+=2)s.emplaceBack(p+e[t-1],p+e[t]);f.primitiveLength+=e.length/2}}else!function(t,e,i,r,n,o){const a=[];for(let u=0;u<r.length/2;u++)a.push(-1);const s={count:0};let l=0,c=t.getOrCreateLatestSegment(e,i),h=c.vertexLength;for(let u=2;u<n.length;u+=3){const d=n[u-2],p=n[u-1],f=n[u];let m=a[d]<l,g=a[p]<l,_=a[f]<l;c.vertexLength+((m?1:0)+(g?1:0)+(_?1:0))>ss.MAX_VERTEX_ARRAY_LENGTH&&(c=t.createNewSegment(e,i),l=s.count,m=!0,g=!0,_=!0,h=0);const y=Sc(a,r,o,s,d,m,c),v=Sc(a,r,o,s,p,g,c),x=Sc(a,r,o,s,f,_,c);i.emplaceBack(h+y-l,h+v-l,h+x-l),c.primitiveLength++}}(e,i,r,n,o,t),h&&function(t,e,i,r,n,o){const a=[];for(let u=0;u<r.length/2;u++)a.push(-1);const s={count:0};let l=0,c=t.getOrCreateLatestSegment(e,i),h=c.vertexLength;for(let u=0;u<n.length;u++){const d=n[u];for(let p=1;p<n[u].length;p+=2){const n=d[p-1],u=d[p];let f=a[n]<l,m=a[u]<l;c.vertexLength+((f?1:0)+(m?1:0))>ss.MAX_VERTEX_ARRAY_LENGTH&&(c=t.createNewSegment(e,i),l=s.count,f=!0,m=!0,h=0);const g=Sc(a,r,o,s,n,f,c),_=Sc(a,r,o,s,u,m,c);i.emplaceBack(h+g-l,h+_-l),c.primitiveLength++}}}(a,i,s,n,l,t),e.forceNewSegmentOnNextPrepare(),null==a||a.forceNewSegmentOnNextPrepare()}function Sc(t,e,i,r,n,o,a){if(o){const o=r.count;return i(e[2*n],e[2*n+1]),t[n]=r.count,r.count++,a.vertexLength++,o}return t[n]}class Pc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new Wa,this.indexArray=new rs,this.indexArray2=new ns,this.programConfigurations=new Bs(t.layers,t.zoom),this.segments=new ss,this.segments2=new ss,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.hasDependencies=Ul("fill",this.layers,e);const r=this.layers[0].layout.get("fill-sort-key"),n=!r.isConstant(),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,h=Gs(a,t);if(!this.layers[0]._featureFilter.filter(new Lo(this.zoom),h,i))continue;const u=n?r.evaluate(h,{},i,e.availableImages):void 0,d={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:t?h.geometry:Us(a),patterns:{},sortKey:u};o.push(d)}n&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const a of o){const{geometry:r,index:n,sourceLayerIndex:o}=a;if(this.hasDependencies){const t=Gl("fill",this.layers,a,{zoom:this.zoom},e);this.patternFeatures.push(t)}else this.addFeature(a,r,n,i,{},e.subdivisionGranularity);e.featureIndex.insert(t[n].feature,r,n,o,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i})}addFeatures(t,e,i){for(const r of this.patternFeatures)this.addFeature(r,r.geometry,r.index,e,i,t.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Nl),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),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(t,e,i,r,n,o){for(const a of ir(e,500)){const t=xc(a,r,o.fill.getGranularityForZoomLevel(r.z)),e=this.layoutVertexArray;Tc(((t,i)=>{e.emplaceBack(t,i)}),this.segments,this.layoutVertexArray,this.indexArray,t.verticesFlattened,t.indicesTriangles,this.segments2,this.indexArray2,t.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:n,canonical:r})}}let Ic,Mc;mo("FillBucket",Pc,{omit:["layers","patternFeatures"]});var Ec={get paint(){return Mc=Mc||new Qo({"fill-antialias":new Xo(bt.paint_fill["fill-antialias"]),"fill-opacity":new Ho(bt.paint_fill["fill-opacity"]),"fill-color":new Ho(bt.paint_fill["fill-color"]),"fill-outline-color":new Ho(bt.paint_fill["fill-outline-color"]),"fill-translate":new Xo(bt.paint_fill["fill-translate"]),"fill-translate-anchor":new Xo(bt.paint_fill["fill-translate-anchor"]),"fill-pattern":new Yo(bt.paint_fill["fill-pattern"])})},get layout(){return Ic=Ic||new Qo({"fill-sort-key":new Ho(bt.layout_fill["fill-sort-key"])})}};class Cc extends $o{constructor(t,e){super(t,Ec,e)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Pc(t)}queryRadius(){return ol(this.paint.get("fill-translate"))}queryIntersectsFeature(t){let{queryGeometry:e,geometry:i,transform:r,pixelsToTileUnits:n}=t;return Ys(al(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,n),i)}isTileClipped(){return!0}}const Ac=aa([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Dc=aa([{name:"a_centroid",components:2,type:"Int16"}],4),{members:zc}=Ac;class kc{constructor(t,e,i,r,n){this.properties={},this.extent=i,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=n,t.readFields(Rc,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos,r=[];let n,o=1,a=0,s=0,l=0;for(;t.pos<e;){if(a<=0){const e=t.readVarint();o=7&e,a=e>>3}if(a--,1===o||2===o)s+=t.readSVarint(),l+=t.readSVarint(),1===o&&(n&&r.push(n),n=[]),n&&n.push(new i(s,l));else{if(7!==o)throw new Error("unknown command ".concat(o));n&&n.push(n[0].clone())}}return n&&r.push(n),r}bbox(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let i=1,r=0,n=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;for(;t.pos<e;){if(r<=0){const e=t.readVarint();i=7&e,r=e>>3}if(r--,1===i||2===i)n+=t.readSVarint(),o+=t.readSVarint(),n<a&&(a=n),n>s&&(s=n),o<l&&(l=o),o>c&&(c=o);else if(7!==i)throw new Error("unknown command ".concat(i))}return[a,l,s,c]}toGeoJSON(t,e,i){const r=this.extent*Math.pow(2,i),n=this.extent*t,o=this.extent*e,a=this.loadGeometry();function s(t){return[360*(t.x+n)/r-180,360/Math.PI*Math.atan(Math.exp((1-2*(t.y+o)/r)*Math.PI))-90]}function l(t){return t.map(s)}let c;if(1===this.type){const t=[];for(const i of a)t.push(i[0]);const e=l(t);c=1===t.length?{type:"Point",coordinates:e[0]}:{type:"MultiPoint",coordinates:e}}else if(2===this.type){const t=a.map(l);c=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}}else{if(3!==this.type)throw new Error("unknown feature type");{const t=Fc(a),e=[];for(const i of t)e.push(i.map(l));c=1===e.length?{type:"Polygon",coordinates:e[0]}:{type:"MultiPolygon",coordinates:e}}}const h={type:"Feature",geometry:c,properties:this.properties};return null!=this.id&&(h.id=this.id),h}}function Rc(t,e,i){1===t?e.id=i.readVarint():2===t?function(t,e){const i=t.readVarint()+t.pos;for(;t.pos<i;){const i=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[i]=r}}(i,e):3===t?e.type=i.readVarint():4===t&&(e._geometry=i.pos)}function Fc(t){const e=t.length;if(e<=1)return[t];const i=[];let r,n;for(let o=0;o<e;o++){const e=Lc(t[o]);0!==e&&(void 0===n&&(n=e<0),n===e<0?(r&&i.push(r),r=[t[o]]):r&&r.push(t[o]))}return r&&i.push(r),i}function Lc(t){let e=0;for(let i,r,n=0,o=t.length,a=o-1;n<o;a=n++)i=t[n],r=t[a],e+=(r.x-i.x)*(i.y+r.y);return e}kc.types=["Unknown","Point","LineString","Polygon"];class Bc{constructor(t,e){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Oc,this,e),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const e=this._pbf.readVarint()+this._pbf.pos;return new kc(this._pbf,e,this.extent,this._keys,this._values)}}
1function Oc(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){let e=null;const i=t.readVarint()+t.pos;for(;t.pos<i;){const i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}if(null==e)throw new Error("unknown feature value");return e}(i))}class Vc{constructor(t,e){this.layers=t.readFields(jc,{},e)}}function jc(t,e,i){if(3===t){const t=new Bc(i,i.readVarint()+i.pos);t.length&&(e[t.name]=t)}}const Nc=Math.pow(2,13);function Uc(t,e,i,r,n,o,a,s){t.emplaceBack(e,i,2*Math.floor(r*Nc)+a,n*Nc*2,o*Nc*2,Math.round(s))}class Gc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasDependencies=!1,this.layoutVertexArray=new Xa,this.centroidVertexArray=new Za,this.indexArray=new rs,this.programConfigurations=new Bs(t.layers,t.zoom),this.segments=new ss,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.features=[],this.hasDependencies=Ul("fill-extrusion",this.layers,e);for(const{feature:r,id:n,index:o,sourceLayerIndex:a}of t){const t=this.layers[0]._featureFilter.needGeometry,s=Gs(r,t);if(!this.layers[0]._featureFilter.filter(new Lo(this.zoom),s,i))continue;const l={id:n,sourceLayerIndex:a,index:o,geometry:t?s.geometry:Us(r),properties:r.properties,type:r.type,patterns:{}};this.hasDependencies?this.features.push(Gl("fill-extrusion",this.layers,l,{zoom:this.zoom},e)):this.addFeature(l,l.geometry,o,i,{},e.subdivisionGranularity),e.featureIndex.insert(r,l.geometry,o,a,this.index,!0)}}addFeatures(t,e,i){for(const r of this.features){const{geometry:n}=r;this.addFeature(r,n,r.index,e,i,t.subdivisionGranularity)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i})}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,zc),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Dc.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,i,r,n,o){for(const a of ir(e,500)){const e={x:0,y:0,sampleCount:0},i=this.layoutVertexArray.length;this.processPolygon(e,r,t,a,o);const n=this.layoutVertexArray.length-i,s=Math.floor(e.x/e.sampleCount),l=Math.floor(e.y/e.sampleCount);for(let t=0;t<n;t++)this.centroidVertexArray.emplaceBack(s,l)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:n,canonical:r})}processPolygon(t,e,i,r,n){if(r.length<1)return;if(Wc(r[0]))return;for(const h of r)0!==h.length&&Zc(t,h);const o={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},a=n.fill.getGranularityForZoomLevel(e.z),s="Polygon"===kc.types[i.type];for(const h of r){if(0===h.length)continue;if(Wc(h))continue;const t=bc(h,a,s);this._generateSideFaces(t,o)}if(!s)return;const l=xc(r,e,a,!1),c=this.layoutVertexArray;Tc(((t,e)=>{Uc(c,t,e,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(t,e){let i=0;for(let r=1;r<t.length;r++){const n=t[r],o=t[r-1];if(qc(n,o))continue;e.segment.vertexLength+4>ss.MAX_VERTEX_ARRAY_LENGTH&&(e.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const a=n.sub(o)._perp()._unit(),s=o.dist(n);i+s>32768&&(i=0),Uc(this.layoutVertexArray,n.x,n.y,a.x,a.y,0,0,i),Uc(this.layoutVertexArray,n.x,n.y,a.x,a.y,0,1,i),i+=s,Uc(this.layoutVertexArray,o.x,o.y,a.x,a.y,0,0,i),Uc(this.layoutVertexArray,o.x,o.y,a.x,a.y,0,1,i);const l=e.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),e.segment.vertexLength+=4,e.segment.primitiveLength+=2}}}function Zc(t,e){for(let i=0;i<e.length;i++){const r=e[i];i===e.length-1&&e[0].x===r.x&&e[0].y===r.y||(t.x+=r.x,t.y+=r.y,t.sampleC
vendor: 4,428 bytes, line 1
1ount++)}}function qc(t,e){return t.x===e.x&&(t.x<0||t.x>D)||t.y===e.y&&(t.y<0||t.y>D)}function Wc(t){return t.every((t=>t.x<0))||t.every((t=>t.x>D))||t.every((t=>t.y<0))||t.every((t=>t.y>D))}let Xc;mo("FillExtrusionBucket",Gc,{omit:["layers","features"]});var Hc={get paint(){return Xc=Xc||new Qo({"fill-extrusion-opacity":new Xo(bt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ho(bt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Xo(bt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Xo(bt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Yo(bt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ho(bt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ho(bt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Xo(bt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Yc extends $o{constructor(t,e){super(t,Hc,e)}createBucket(t){return new Gc(t)}queryRadius(){return ol(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t){let{queryGeometry:e,feature:r,featureState:n,geometry:o,transform:a,pixelsToTileUnits:s,pixelPosMatrix:l}=t;const c=al(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,s),h=this.paint.get("fill-extrusion-height").evaluate(r,n),u=this.paint.get("fill-extrusion-base").evaluate(r,n),d=function(t,e){const r=[];for(const n of t){const t=[n.x,n.y,0,1];I(t,t,e),r.push(new i(t[0]/t[3],t[1]/t[3]))}return r}(c,l),p=function(t,e,r,n){const o=[],a=[],s=n[8]*e,l=n[9]*e,c=n[10]*e,h=n[11]*e,u=n[8]*r,d=n[9]*r,p=n[10]*r,f=n[11]*r;for(const m of t){const t=[],e=[];for(const r of m){const o=r.x,a=r.y,m=n[0]*o+n[4]*a+n[12],g=n[1]*o+n[5]*a+n[13],_=n[2]*o+n[6]*a+n[14],y=n[3]*o+n[7]*a+n[15],v=_+c,x=y+h,b=m+u,w=g+d,T=_+p,S=y+f,P=new i((m+s)/x,(g+l)/x);P.z=v/x,t.push(P);const I=new i(b/S,w/S);I.z=T/S,e.push(I)}o.push(t),a.push(e)}return[o,a]}(o,u,h,l);return function(t,e,i){let r=1/0;Ys(i,e)&&(r=Jc(i,e[0]));for(let n=0;n<e.length;n++){const o=e[n],a=t[n];for(let t=0;t<o.length-1;t++){const e=o[t],n=[e,o[t+1],a[t+1],a[t],e];Xs(i,n)&&(r=Math.min(r,Jc(i,n)))}}return r!==1/0&&r}(p[0],p[1],d)}}function Kc(t,e){return t.x*e.x+t.y*e.y}function Jc(t,e){if(1===t.length){let i=0;const r=e[i++];let n;for(;!n||r.equals(n);)if(n=e[i++],!n)return 1/0;for(;i<e.length;i++){const o=e[i],a=t[0],s=n.sub(r),l=o.sub(r),c=a.sub(r),h=Kc(s,s),u=Kc(s,l),d=Kc(l,l),p=Kc(c,s),f=Kc(c,l),m=h*d-u*u,g=(d*p-u*f)/m,_=(h*f-u*p)/m,y=r.z*(1-g-_)+n.z*g+o.z*_;if(isFinite(y))return y}return 1/0}{let t=1/0;for(const i of e)t=Math.min(t,i.z);return t}}const Qc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class $c{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,i]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const r=i>>4;if(1!==r)throw new Error("Got v".concat(r," data when expected v1."));const n=Qc[15&i];if(!n)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new $c(a,o,n,t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,r=arguments.length>3?arguments[3]:void 0;if(isNaN(t)||t<0)throw new Error("Unpexpected numItems value: ".concat(t,"."));this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const n=Qc.indexOf(this.ArrayType),o=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-a%8)%8;if(n<0)throw new Error("Unexpected typed array class: ".concat(i,"."));r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+o+a+s),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+s,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+n]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}
1add(t,e){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=e,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error("Added ".concat(t," items when expected ").concat(this.numItems,"."));return th(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:o,nodeSize:a}=this,s=[0,n.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,h=s.pop()||0,u=s.pop()||0;if(h-u<=a){for(let a=u;a<=h;a++){const s=o[2*a],c=o[2*a+1];s>=t&&s<=i&&c>=e&&c<=r&&l.push(n[a])}continue}const d=u+h>>1,p=o[2*d],f=o[2*d+1];p>=t&&p<=i&&f>=e&&f<=r&&l.push(n[d]),(0===c?t<=p:e<=f)&&(s.push(u),s.push(d-1),s.push(1-c)),(0===c?i>=p:r>=f)&&(s.push(d+1),s.push(h),s.push(1-c))}return l}within(t,e,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:n,nodeSize:o}=this,a=[0,r.length-1,0],s=[],l=i*i;for(;a.length;){const c=a.pop()||0,h=a.pop()||0,u=a.pop()||0;if(h-u<=o){for(let i=u;i<=h;i++)nh(n[2*i],n[2*i+1],t,e)<=l&&s.push(r[i]);continue}const d=u+h>>1,p=n[2*d],f=n[2*d+1];nh(p,f,t,e)<=l&&s.push(r[d]),(0===c?t-i<=p:e-i<=f)&&(a.push(u),a.push(d-1),a.push(1-c)),(0===c?t+i>=p:e+i>=f)&&(a.push(d+1),a.push(h),a.push(1-c))}return s}}function th(t,e,i,r,n,o){if(n-r<=i)return;const a=r+n>>1;eh(t,e,a,r,n,o),th(t,e,i,r,a-1,1-o),th(t,e,i,a+1,n,1-o)}function eh(t,e,i,r,n,o){for(;n>r;){if(n-r>600){const a=n-r+1,s=i-r+1,l=Math.log(a),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);eh(t,e,i,Math.max(r,Math.floor(i-s*c/a+h)),Math.min(n,Math.floor(i+(a-s)*c/a+h)),o)}const a=e[2*i+o];let s=r,l=n;for(ih(t,e,r,i),e[2*n+o]>a&&ih(t,e,r,n);s<l;){for(ih(t,e,s,l),s++,l--;e[2*s+o]<a;)s++;for(;e[2*l+o]>a;)l--}e[2*r+o]===a?ih(t,e,r,l):(l++,ih(t,e,l,n)),l<=i&&(r=l+1),i<=l&&(n=l-1)}}function ih(t,e,i,r){rh(t,i,r),rh(e,2*i,2*r),rh(e,2*i+1,2*r+1)}function rh(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function nh(t,e,i,r){const n=t-i,o=e-r;return n*n+o*o}function oh(t,e,i,r){let n=r;const o=e+(i-e>>1);let a,s=i-e;const l=t[e],c=t[e+1],h=t[i],u=t[i+1];for(let d=e+3;d<i;d+=3){const e=ah(t[d],t[d+1],l,c,h,u);if(e>n)a=d,n=e;else if(e===n){const t=Math.abs(d-o);t<s&&(a=d,s=t)}}n>r&&(a-e>3&&oh(t,e,a,r),t[a+2]=n,i-a>3&&oh(t,a,i,r))}function ah(t,e,i,r,n,o){let a=n-i,s=o-r;if(0!==a||0!==s){const l=((t-i)*a+(e-r)*s)/(a*a+s*s);l>1?(i=n,r=o):l>0&&(i+=a*l,r+=s*l)}return a=t-i,s=e-r,a*a+s*s}function sh(t,e,i,r){const n={type:e,geom:i},o={id:null==t?null:t,type:n.type,geometry:n.geom,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};switch(n.type){case"Point":case"MultiPoint":case"LineString":lh(o,n.geom);break;case"Polygon":lh(o,n.geom[0]);break;case"MultiLineString":for(const t of n.geom)lh(o,t);break;case"MultiPolygon":for(const t of n.geom)lh(o,t[0])}return o}function lh(t,e){for(let i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function ch(t,e){const i=[];switch(t.type){case"FeatureCollection":for(let r=0;r<t.features.length;r++)hh(i,t.features[r],e,r);break;case"Feature":hh(i,t,e);break;default:hh(i,{geometry:t,properties:void 0},e)}return i}function hh(t,e,i,r){if(!e.geometry)return;if("GeometryCollection"===e.geometry.type)return void function(t,e,i,r,n){for(const o of i.geometries)hh(t,{id:e.id,geometry:o,properties:e.properties},r,n)}(t,e,e.geometry,i,r);const n=e.geometry.coordinates;if(null===n||void 0===n||!n.length)return;const o=function(t,e,i,r){return e.promoteId?null===(r=t.properties)||void 0===r?void 0:r[e.promoteId]:e.generateId?i||0:t.id}(e,i,r),a=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);switch(e.geometry.type){case"Point":return void function(t,e,i,r){const n=[];n.push(ph(i.coordinates[0]),fh(i.coordinates[1]),0),t.push(sh(e,"Point",n,r))}(t,o,e.geometry,e.properties);case"MultiPoint":return void function(t,e,i,r){const n=[];for(const o of i.coordinates)n.push(ph(o[0]),fh(o[1]),0);t.push(sh(e,"MultiPoint",n,r))}(t,o,e.geometry,e.properties);
1case"LineString":return void function(t,e,i,r,n){const o=[];uh(i.coordinates,o,r,!1),t.push(sh(e,"LineString",o,n))}(t,o,e.geometry,a,e.properties);case"MultiLineString":return void function(t,e,i,r,n,o){if(n.lineMetrics)for(const a of i.coordinates){const i=[];uh(a,i,r,!1),t.push(sh(e,"LineString",i,o))}else{const n=[];dh(i.coordinates,n,r,!1),t.push(sh(e,"MultiLineString",n,o))}}(t,o,e.geometry,a,i,e.properties);case"Polygon":return void function(t,e,i,r,n){const o=[];dh(i.coordinates,o,r,!0),t.push(sh(e,"Polygon",o,n))}(t,o,e.geometry,a,e.properties);case"MultiPolygon":return void function(t,e,i,r,n){const o=[];for(const a of i.coordinates){const t=[];dh(a,t,r,!0),o.push(t)}t.push(sh(e,"MultiPolygon",o,n))}(t,o,e.geometry,a,e.properties);default:throw new Error("Input data is not a valid GeoJSON object.")}}function uh(t,e,i,r){let n,o,a=0;for(let l=0;l<t.length;l++){const i=ph(t[l][0]),s=fh(t[l][1]);e.push(i,s,0),l>0&&(a+=r?(n*s-i*o)/2:Math.sqrt(Math.pow(i-n,2)+Math.pow(s-o,2))),n=i,o=s}const s=e.length-3;e[2]=1,i>0&&oh(e,0,s,i),e[s+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function dh(t,e,i,r){for(let n=0;n<t.length;n++){const o=[];uh(t[n],o,i,r),e.push(o)}}function ph(t){return t/360+.5}function fh(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function mh(t){const e={type:"Feature",geometry:gh(t),properties:t.tags};return null!=t.id&&(e.id=t.id),e}function gh(t){const{type:e,geometry:i}=t;switch(e){case"Point":return{type:e,coordinates:yh(i[0],i[1])};case"MultiPoint":case"LineString":return{type:e,coordinates:_h(i)};case"MultiLineString":case"Polygon":return{type:e,coordinates:i.map((t=>_h(t)))};case"MultiPolygon":return{type:e,coordinates:i.map((t=>t.map((t=>_h(t)))))}}}function _h(t){const e=[];for(let i=0;i<t.length;i+=3)e.push(yh(t[i],t[i+1]));return e}function yh(t,e){return[vh(t),xh(e)]}function vh(t){return 360*(t-.5)}function xh(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}var bh;
1function wh(t,e,i,r,n,o,a,s){if(r/=e,o>=(i/=e)&&a<r)return t;if(a<i||o>=r)return null;const l=[];for(const c of t){const t=n===bh.X?c.minX:c.minY,e=n===bh.X?c.maxX:c.maxY;if(t>=i&&e<r)l.push(c);else if(!(e<i||t>=r))switch(c.type){case"Point":case"MultiPoint":Th(c,l,i,r,n);continue;case"LineString":Sh(c,l,i,r,n,s);continue;case"MultiLineString":Ph(c,l,i,r,n);continue;case"Polygon":Ih(c,l,i,r,n);continue;case"MultiPolygon":Mh(c,l,i,r,n);continue}}return l.length?l:null}function Th(t,e,i,r,n){const o=[];(function(t,e,i,r,n){for(let o=0;o<t.length;o+=3){const a=t[o+n];a>=i&&a<=r&&Dh(e,t[o],t[o+1],t[o+2])}})(t.geometry,o,i,r,n),o.length&&e.push(sh(t.id,3===o.length?"Point":"MultiPoint",o,t.tags))}function Sh(t,e,i,r,n,o){const a=[];if(Eh(t.geometry,a,i,r,n,!1,o.lineMetrics),a.length)if(o.lineMetrics)for(const s of a)e.push(sh(t.id,"LineString",s,t.tags));else e.push(a.length>1?sh(t.id,"MultiLineString",a,t.tags):sh(t.id,"LineString",a[0],t.tags))}function Ph(t,e,i,r,n){const o=[];Ah(t.geometry,o,i,r,n,!1),o.length&&e.push(1!==o.length?sh(t.id,"MultiLineString",o,t.tags):sh(t.id,"LineString",o[0],t.tags))}function Ih(t,e,i,r,n){const o=[];Ah(t.geometry,o,i,r,n,!0),o.length&&e.push(sh(t.id,"Polygon",o,t.tags))}function Mh(t,e,i,r,n){const o=[];for(const a of t.geometry){const t=[];Ah(a,t,i,r,n,!0),t.length&&o.push(t)}o.length&&e.push(sh(t.id,"MultiPolygon",o,t.tags))}function Eh(t,e,i,r,n,o,a){let s=Ch(t);const l=n===bh.X?zh:kh;let c,h,u=t.start;for(let g=0;g<t.length-3;g+=3){const d=t[g],p=t[g+1],f=t[g+2],m=t[g+3],_=t[g+4],y=n===bh.X?d:p,v=n===bh.X?m:_;let x=!1;a&&(c=Math.sqrt(Math.pow(d-m,2)+Math.pow(p-_,2))),y<i?v>i&&(h=l(s,d,p,m,_,i),a&&(s.start=u+c*h)):y>r?v<r&&(h=l(s,d,p,m,_,r),a&&(s.start=u+c*h)):Dh(s,d,p,f),v<i&&y>=i&&(h=l(s,d,p,m,_,i),x=!0),v>r&&y<=r&&(h=l(s,d,p,m,_,r),x=!0),!o&&x&&(a&&(s.end=u+c*h),e.push(s),s=Ch(t)),a&&(u+=c)}let d=t.length-3;const p=t[d],f=t[d+1],m=n===bh.X?p:f;m>=i&&m<=r&&Dh(s,p,f,t[d+2]),d=s.length-3,o&&d>=3&&(s[d]!==s[0]||s[d+1]!==s[1])&&Dh(s,s[0],s[1],s[2]),s.length&&e.push(s)}function Ch(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function Ah(t,e,i,r,n,o){for(const a of t)Eh(a,e,i,r,n,o,!1)}function Dh(t,e,i,r){t.push(e,i,r)}
1function zh(t,e,i,r,n,o){const a=(o-e)/(r-e);return Dh(t,o,i+(n-i)*a,1),a}function kh(t,e,i,r,n,o){const a=(o-i)/(n-i);return Dh(t,e+(r-e)*a,o,1),a}function Rh(t,e){const i=e.buffer/e.extent;let r=t;const n=wh(t,1,-1-i,i,bh.X,-1,2,e),o=wh(t,1,1-i,2+i,bh.X,-1,2,e);return n||o?(r=wh(t,1,-i,1+i,bh.X,-1,2,e)||[],n&&(r=Fh(n,1).concat(r)),o&&(r=r.concat(Fh(o,-1))),r):r}function Fh(t,e){const i=[];for(const r of t)switch(r.type){case"Point":case"MultiPoint":case"LineString":{const t=Lh(r.geometry,e);i.push(sh(r.id,r.type,t,r.tags));continue}case"MultiLineString":case"Polygon":{const t=[];for(const i of r.geometry)t.push(Lh(i,e));i.push(sh(r.id,r.type,t,r.tags));continue}case"MultiPolygon":{const t=[];for(const i of r.geometry){const r=[];for(const t of i)r.push(Lh(t,e));t.push(r)}i.push(sh(r.id,r.type,t,r.tags));continue}}return i}function Lh(t,e){const i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(let r=0;r<t.length;r+=3)i.push(t[r]+e,t[r+1],t[r+2]);return i}function Bh(t,e,i){var r,o;const a=!!e.newGeometry,s=e.removeAllProperties||(null===(r=e.removeProperties)||void 0===r?void 0:r.length)>0||(null===(o=e.addOrUpdateProperties)||void 0===o?void 0:o.length)>0;if(a){let r=ch({type:"FeatureCollection",features:[{type:"Feature",id:t.id,geometry:e.newGeometry,properties:s?Oh(t.tags,e):t.tags}]},i);return r=Rh(r,i),r[0]}if(s){const i=n({},t);return i.tags=Oh(i.tags,e),i}return null}function Oh(t,e){if(e.removeAllProperties)return{};const i=n({},t||{});if(e.removeProperties)for(const r of e.removeProperties)delete i[r];if(e.addOrUpdateProperties)for(const{key:r,value:n}of e.addOrUpdateProperties)i[r]=n;return i}!function(t){t[t.X=0]="X",t[t.Y=1]="Y"}(bh||(bh={}));const Vh={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t};class jh{constructor(t){r(this,"options",void 0),r(this,"trees",void 0),r(this,"stride",void 0),r(this,"clusterProps",void 0),r(this,"points",void 0),this.options=Object.assign(Object.create(Vh),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[],this.points=[]}load(t){const e=[];for(const i of t){if(!i.geometry)continue;const[t,r]=i.geometry.coordinates,[n,o]=[ph(t),fh(r)];e.push({id:i.id,type:"Point",geometry:[n,o],tags:i.properties})}this.createIndex(e)}initialize(t){const e=[];for(const i of t)"Point"===i.type&&e.push(i);this.createIndex(e)}updateIndex(t,e,i){this.options=Object.assign(Object.create(Vh),i.clusterOptions),this.initialize(t)}createIndex(t){const{log:e,minZoom:i,maxZoom:r}=this.options;e&&console.time("total time");const n="prepare ".concat(t.length," points");e&&console.time(n),this.points=t;const o=[];for(let s=0;s<t.length;s++){const e=t[s];if(null===e||void 0===e||!e.geometry)continue;let[i,r]=e.geometry;i=Math.fround(i),r=Math.fround(r),o.push(i,r,1/0,s,-1,1),this.options.reduce&&o.push(0)}let a=this.trees[r+1]=this.createTree(o);e&&console.timeEnd(n);for(let s=r;s>=i;s--){const t=Date.now();a=this.trees[s]=this.createTree(this.cluster(a,s)),e&&console.log("z%d: %d clusters in %dms",s,a.numItems,Date.now()-t)}e&&console.timeEnd("total time")}getClusters(t,e){return this.getClustersInternal(t,e).map((t=>mh(t)))}getClustersInternal(t,e){let i=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let n=180===t[2]?180:((t[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,n=180;else if(i>n){const t=this.getClustersInternal([i,r,180,o],e),a=this.getClustersInternal([-180,r,n,o],e);return t.concat(a)}const a=this.trees[this.limitZoom(e)],s=a.range(ph(i),fh(o),ph(n),fh(r)),l=a.flatData,c=[];for(const h of s){const t=this.stride*h;c.push(l[t+5]>1?Nh(l,t,this.clusterProps):this.points[l[t+3]])}return c}getChildren(t){const e=this.getOriginId(t),i=this.getOriginZoom(t),r=new Error("No cluster with the specified id: "+t),n=this.trees[i];if(!n)throw r;const o=n.flatData;if(e*this.stride>=o.length)throw r;const a=this.options.radius/(this.options.extent*Math.pow(2,i-1)),s=n.within(o[e*this.stride],o[e*this.stride+1],a),l=[];for(const c of s){const e=c*this.stride;o[e+4]===t&&l.push(o[e+5]>1?Uh(o,e,this.clusterProps):mh(this.points[o[e+3]]))}if(0===l.length)throw r;return l}getLeaves(t,e,i){const r=[];return this.appendLeaves(r,t,e=e||10,i=i||0,0),r}getTile(t,e,i){const r=this.trees[this.limitZoom(t)];if(!r)return null;const n=Math.pow(2,t),{extent:o,radius:a}=this.options,s=a/o,l=(i-s)/n,c=(i+1+s)/n,h={transformed:!0,features:[],source:null,x:e,y:i,z:t};return this.addTileFeatures(r.range((e-s)/n,l,(e+1+s)/n,c),r.flatData,e,i,n,h),0===e&&this.addTileFeatures(r.range(1-s/n,l,1,c),r.flatData,n,i,n,h),e===n-1&&this.addTileFeatures(r.range(0,l,s/n,c),r.flatData,-1,i,n,h),h}getClusterExpansionZoom(t){return this.getOriginZoom(t)}appendLeaves(t,e,i,r,n){const o=this.getChildren(e);for(const a of o){const e=a.properties;if(null!==e&&void 0!==e&&e.cluster?n+e.point_count<=r?n+=e.point_count:n=this.appendLeaves(t,e.cluster_id,i,r,n):n<r?n++:t.push(a),t.length===i)break}return n}createTree(t){const e=new $c(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let i=0;i<t.length;i+=this.stride)e.add(t[i],t[i+1]);return e.finish(),e.flatData=t,e.data=null,e}addTileFeatures(t,e,i,r,n,o){for(const a of t){const t=a*this.stride,s=e[t+5]>1;let l,c,h;if(s)l=Gh(e,t,this.clusterProps),c=e[t],h=e[t+1];else{const i=this.points[e[t+3]];l=i.tags,[c,h]=i.geometry}const u={type:1,geometry:[[Math.round(this.options.extent*(c*n-i)),Math.round(this.options.extent*(h*n-r))]],tags:l};let d;d=s||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(u.id=d),o.features.push(u)}}limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}cluster(t,e){const{radius:i,extent:r,reduce:n,minPoints:o}=this.options,a=i/(r*Math.pow(2,e)),s=t.flatData,l=[],c=this.stride;for(let h=0;h<s.length;h+=c){if(s[h+2]<=e)continue;s[h+2]=e;const i=s[h],r=s[h+1],u=t.within(s[h],s[h+1],a),d=s[h+5];let p=d;for(const t of u){const i=t*c;s[i+2]>e&&(p+=s[i+5])}if(p>d&&p>=o){let t,o=i*d,a=r*d,f=-1;const m=(h/c<<5)+(e+1)+this.points.length;for(const i of u){const r=i*c;if(s[r+2]<=e)continue;s[r+2]=e;const l=s[r+5];o+=s[r]*l,a+=s[r+1]*l,s[r+4]=m,n&&(t||(t=this.map(s,h,!0),f=this.clusterProps.length,this.clusterProps.push(t)),n(t,this.map(s,r)))}s[h+4]=m,l.push(o/p,a/p,1/0,m,-1,p),n&&l.push(f)}else{for(let t=0;t<c;t++)l.push(s[h+t]);if(p>1)for(const t of u){const i=t*c;if(!(s[i+2]<=e)){s[i+2]=e;for(let t=0;t<c;t++)l.push(s[i+t])}}}}return l}getOriginId(t){return t-this.points.length>>5}getOriginZoom(t){return(t-this.points.length)%32}map(t,e,i){if(t[e+5]>1){const r=this.clusterProps[t[e+6]];return i?Object.assign({},r):r}const r=this.points[t[e+3]].tags,n=this.options.map(r);return i&&n===r?Object.assign({},n):n}}function Nh(t,e,i){return{id:t[e+3],type:"Point",tags:Gh(t,e,i),geometry:[t[e],t[e+1]]}}function Uh(t,e,i){return{type:"Feature",id:t[e+3],properties:Gh(t,e,i),geometry:{type:"Point",coordinates:[vh(t[e]),xh(t[e+1])]}}}
vendor: 6,578 bytes, line 1
1function Gh(t,e,i){const r=t[e+5],n=r>=1e4?"".concat(Math.round(r/1e3),"k"):r>=1e3?Math.round(r/100)/10+"k":r,o=t[e+6],a=-1===o?{}:Object.assign({},i[o]);return Object.assign(a,{cluster:!0,cluster_id:t[e+3],point_count:r,point_count_abbreviated:n})}const Zh="geojsonvt_clip_start",qh="geojsonvt_clip_end";function Wh(t,e,i,r,n){const o=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),a={transformed:!1,features:[],source:null,x:i,y:r,z:e,minX:2,minY:1,maxX:-1,maxY:0,numPoints:0,numSimplified:0,numFeatures:t.length};for(const s of t)Xh(a,s,o,n);return a}function Xh(t,e,i,r){switch(t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),e.type){case"Point":case"MultiPoint":return void function(t,e){const i=[];for(let n=0;n<e.geometry.length;n+=3)i.push(e.geometry[n],e.geometry[n+1]),t.numPoints++,t.numSimplified++;if(!i.length)return;const r={type:1,tags:e.tags||null,geometry:i};null!==e.id&&(r.id=e.id),t.features.push(r)}(t,e);case"LineString":return void function(t,e,i,r){const n=[];if(Hh(n,e.geometry,t,i,!1,!1),!n.length)return;let o=e.tags||null;if(r.lineMetrics){o={};for(const t in e.tags)o[t]=e.tags[t];o[Zh]=e.geometry.start/e.geometry.size,o[qh]=e.geometry.end/e.geometry.size}const a={type:2,tags:o,geometry:n};null!==e.id&&(a.id=e.id),t.features.push(a)}(t,e,i,r);case"MultiLineString":case"Polygon":return void function(t,e,i){const r=[];for(let o=0;o<e.geometry.length;o++)Hh(r,e.geometry[o],t,i,"Polygon"===e.type,0===o);if(!r.length)return;const n={type:"Polygon"===e.type?3:2,tags:e.tags||null,geometry:r};null!==e.id&&(n.id=e.id),t.features.push(n)}(t,e,i);case"MultiPolygon":return void function(t,e,i){const r=[];for(let o=0;o<e.geometry.length;o++){const n=e.geometry[o];for(let e=0;e<n.length;e++)Hh(r,n[e],t,i,!0,0===e)}if(!r.length)return;const n={type:3,tags:e.tags||null,geometry:r};null!==e.id&&(n.id=e.id),t.features.push(n)}(t,e,i)}}function Hh(t,e,i,r,n,o){const a=r*r;if(r>0&&e.size<(n?a:r))return void(i.numPoints+=e.length/3);const s=[];for(let l=0;l<e.length;l+=3)(0===r||e[l+2]>a)&&(i.numSimplified++,s.push(e[l],e[l+1])),i.numPoints++;n&&function(t,e){let i=0;for(let r=0,n=t.length,o=n-2;r<n;o=r,r+=2)i+=(t[r]-t[o])*(t[r+1]+t[o+1]);if(i>0===e)for(let r=0,n=t.length;r<n/2;r+=2){const e=t[r],i=t[r+1];t[r]=t[n-2-r],t[r+1]=t[n-1-r],t[n-2-r]=e,t[n-1-r]=i}}(s,o),t.push(s)}function Yh(t,e){if(t.transformed)return t;const i=1<<t.z,r=t.x,n=t.y;for(const o of t.features)1===o.type?Kh(o,e,i,r,n):Jh(o,e,i,r,n);return t.transformed=!0,t}function Kh(t,e,i,r,n){const o=t,a=t.geometry,s=[];for(let l=0;l<a.length;l+=2)s.push(Qh(a[l],a[l+1],e,i,r,n));return o.geometry=s,o}function Jh(t,e,i,r,n){const o=t,a=t.geometry,s=[];for(const l of a){const t=[];for(let o=0;o<l.length;o+=2)t.push(Qh(l[o],l[o+1],e,i,r,n));s.push(t)}return o.geometry=s,o}function Qh(t,e,i,r,n,o){return[Math.round(i*(t*r-n)),Math.round(i*(e*r-o))]}class $h{constructor(t){r(this,"options",void 0),r(this,"tileCoords",void 0),r(this,"tiles",void 0),r(this,"stats",{}),r(this,"total",0),this.options=t,this.tiles={},this.tileCoords=[],this.stats={},this.total=0}initialize(t){this.splitTile(t,0,0,0),this.options.debug&&(t.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)))}updateIndex(t,e,i){i.debug>1&&(console.log("invalidating tiles"),console.time("invalidating")),this.invalidateTiles(e),i.debug>1&&console.timeEnd("invalidating");const[r,n,o]=[0,0,0],a=Wh(t,r,n,o,i);a.source=t;const s=tu(r,n,o);if(this.tiles[s]=a,this.tileCoords.push({z:r,x:n,y:o,id:s}),i.debug){const t="z".concat(r);this.stats[t]=(this.stats[t]||0)+1,this.total++}}getClusterExpansionZoom(t){return null}getChildren(t){return null}getLeaves(t,e,i){return null}getTile(t,e,i){var r;const{extent:n,debug:o}=this.options,a=1<<t,s=tu(t,e=e+a&a-1,i);if(this.tiles[s])return Yh(this.tiles[s],n);o>1&&console.log("drilling down to z%d-%d-%d",t,e,i);let l,c=t,h=e,u=i;for(;!l&&c>0;)c--,h>>=1,u>>=1,l=this.tiles[tu(c,h,u)];return null!==(r=l)&&void 0!==r&&r.source?(o>1&&(console.log("found parent tile z%d-%d-%d",c,h,u),console.time("drilling down")),this.splitTile(l.source,c,h,u,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[s]?Yh(this.tiles[s],n):null):null}splitTile(t,e,i,r,n,o,a){const s=[t,e,i,r],l=this.options,c=l.debug;for(;s.length;){r=s.pop(),i=s.pop(),e=s.pop(),t=s.pop();const h=1<<e,u=tu(e,i,r);let d=this.tiles[u];if(!d&&(c>1&&console.time("creation"),d=this.tiles[u]=Wh(t,e,i,r,l),this.tileCoords.push({z:e,x:i,y:r,id:u}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,r,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const t="z".concat(e);this.stats[t]=(this.stats[t]||0)+1,this.total++}if(d.source=t,null==n){if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(null!=n){const t=n-e;if(i!==o>>t||r!==a>>t)continue}}if(d.source=null,!t.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,f=.5-p,m=.5+p,g=1+p;let _=null,y=null,v=null,x=null;const b=wh(t,h,i-p,i+m,bh.X,d.minX,d.maxX,l),w=wh(t,h,i+f,i+g,bh.X,d.minX,d.maxX,l);b&&(_=wh(b,h,r-p,r+m,bh.Y,d.minY,d.maxY,l),y=wh(b,h,r+f,r+g,bh.Y,d.minY,d.maxY,l)),w&&(v=wh(w,h,r-p,r+m,bh.Y,d.minY,d.maxY,l),x=wh(w,h,r+f,r+g,bh.Y,d.minY,d.maxY,l)),c>1&&console.timeEnd("clipping"),s.push(_||[],e+1,2*i,2*r),s.push(y||[],e+1,2*i,2*r+1),s.push(v||[],e+1,2*i+1,2*r),s.push(x||[],e+1,2*i+1,2*r+1)}}invalidateTiles(t){if(!t.length)return;const e=this.options,{debug:i}=e;let r=1/0,n=-1/0,o=1/0,a=-1/0;for(const c of t)r=Math.min(r,c.minX),n=Math.max(n,c.maxX),o=Math.min(o,c.minY),a=Math.max(a,c.maxY);const s=e.buffer/e.extent,l=new Set;for(const c in this.tiles){const e=this.tiles[c],h=1<<e.z,u=(e.x-s)/h,d=(e.x+1+s)/h,p=(e.y-s)/h,f=(e.y+1+s)/h;if(n<u||r>=d||a<p||o>=f)continue;let m=!1;for(const i of t)if(i.maxX>=u&&i.minX<d&&i.maxY>=p&&i.minY<f){m=!0;break}if(m){if(i){i>1&&console.log("invalidate tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e.z,e.x,e.y,e.numFeatures,e.numPoints,e.numSimplified);const t="z".concat(e.z);this.stats[t]=(this.stats[t]||0)-1,this.total--}delete this.tiles[c],l.add(c)}}l.size&&(this.tileCoords=this.tileCoords.filter((t=>!l.has(t.id))))}}function tu(t,e,i){return 32*((1<<t)*i+e)+t}const eu={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,updateable:!1,
1cluster:!1,clusterOptions:Vh,debug:0},iu=aa([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:ru}=iu,nu=aa([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:ou}=nu,au=Math.cos(Math.PI/180*37.5),su=Math.pow(2,14)/.5;class lu{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=t.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((t=>{this.gradients[t.id]={}})),this.layoutVertexArray=new Ha,this.layoutVertexArray2=new Ya,this.indexArray=new rs,this.programConfigurations=new Bs(t.layers,t.zoom),this.segments=new ss,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id))}populate(t,e,i){this.hasDependencies=Ul("line",this.layers,e)||this.hasLineDasharray(this.layers);const r=this.layers[0].layout.get("line-sort-key"),n=!r.isConstant(),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,e=Gs(a,t);if(!this.layers[0]._featureFilter.filter(new Lo(this.zoom),e,i))continue;const h=n?r.evaluate(e,{},i):void 0,u={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:t?e.geometry:Us(a),patterns:{},dashes:{},sortKey:h};o.push(u)}n&&o.sort(((t,e)=>t.sortKey-e.sortKey));for(const a of o){const{geometry:r,index:n,sourceLayerIndex:o}=a;this.hasDependencies?(Ul("line",this.layers,e)?Gl("line",this.layers,a,{zoom:this.zoom},e):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,a,this.zoom,e),this.patternFeatures.push(a)):this.addFeature(a,r,n,i,{},{},e.subdivisionGranularity),e.featureIndex.insert(t[n].feature,r,n,o,this.index)}}update(t,e,i,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,{imagePositions:i,dashPositions:r})}addFeatures(t,e,i,r){for(const n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,e,i,r,t.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,ou)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ru),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,Zh)&&Object.prototype.hasOwnProperty.call(t.properties,qh))return{start:+t.properties[Zh],end:+t.properties[qh]}}addFeature(t,e,i,r,n,o,a){const s=this.layers[0].layout,l=s.get("line-join").evaluate(t,{}),c=s.get("line-cap"),h=s.get("line-miter-limit"),u=s.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const d of e)this.addLine(d,t,l,c,h,u,r,a);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{imagePositions:n,dashPositions:o,canonical:r})}
1addLine(t,e,i,r,n,o,a,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,t=bc(t,a?s.line.getGranularityForZoomLevel(a.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const l="Polygon"===kc.types[e.type];let c=t.length;for(;c>=2&&t[c-1].equals(t[c-2]);)c--;let h=0;for(;h<c-1&&t[h].equals(t[h+1]);)h++;if(c<(l?3:2))return;"bevel"===i&&(n=1.05);const u=this.overscaling<=16?122880/(512*this.overscaling):0,d=this.segments.prepareSegment(10*c,this.layoutVertexArray,this.indexArray);let p,f,m,g,_;this.e1=this.e2=-1,l&&(p=t[c-2],_=t[h].sub(p)._unit()._perp());for(let y=h;y<c;y++){if(m=y===c-1?l?t[h+1]:void 0:t[y+1],m&&t[y].equals(m))continue;_&&(g=_),p&&(f=p),p=t[y],_=m?m.sub(p)._unit()._perp():g,g=g||_;let e=g.add(_);0===e.x&&0===e.y||e._unit();const a=g.x*_.x+g.y*_.y,s=e.x*_.x+e.y*_.y,v=0!==s?1/s:1/0,x=2*Math.sqrt(2-2*s),b=s<au&&f&&m,w=g.x*_.y-g.y*_.x>0;if(b&&y>h){const t=p.dist(f);if(t>2*u){const e=p.sub(p.sub(f)._mult(u/t)._round());this.updateDistance(f,e),this.addCurrentVertex(e,g,0,0,d),f=e}}const T=f&&m;let S=T?i:l?"butt":r;if(T&&"round"===S&&(v<o?S="miter":v<=2&&(S="fakeround")),"miter"===S&&v>n&&(S="bevel"),"bevel"===S&&(v>2&&(S="flipbevel"),v<n&&(S="miter")),f&&this.updateDistance(f,p),"miter"===S)e._mult(v),this.addCurrentVertex(p,e,0,0,d);else if("flipbevel"===S){if(v>100)e=_.mult(-1);else{const t=v*g.add(_).mag()/g.sub(_).mag();e._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(p,e,0,0,d),this.addCurrentVertex(p,e.mult(-1),0,0,d)}else if("bevel"===S||"fakeround"===S){const t=-Math.sqrt(v*v-1),e=w?t:0,i=w?0:t;if(f&&this.addCurrentVertex(p,g,e,i,d),"fakeround"===S){const t=Math.round(180*x/Math.PI/20);for(let e=1;e<t;e++){let i=e/t;if(.5!==i){const t=i-.5;i+=i*t*(i-1)*((1.0904+a*(a*(3.55645-1.43519*a)-3.2452))*t*t+(.848013+a*(.215638*a-1.06021)))}const r=_.sub(g)._mult(i)._add(g)._unit()._mult(w?-1:1);this.addHalfVertex(p,r.x,r.y,!1,w,0,d)}}m&&this.addCurrentVertex(p,_,-e,-i,d)}else if("butt"===S)this.addCurrentVertex(p,e,0,0,d);else if("square"===S){const t=f?1:-1;this.addCurrentVertex(p,e,t,t,d)}else"round"===S&&(f&&(this.addCurrentVertex(p,g,0,0,d),this.addCurrentVertex(p,g,1,1,d,!0)),m&&(this.addCurrentVertex(p,_,-1,-1,d,!0),this.addCurrentVertex(p,_,0,0,d)));if(b&&y<c-1){const t=p.dist(m);if(t>2*u){const e=p.add(m.sub(p)._mult(u/t)._round());this.updateDistance(p,e),this.addCurrentVertex(e,_,0,0,d),p=e}}}}addCurrentVertex(t,e,i,r,n){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const a=e.y*r-e.x,s=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,o,!1,i,n),this.addHalfVertex(t,a,s,o,!0,-r,n),this.distance>su/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,i,r,n,o))}addHalfVertex(t,e,i,r,n,o,a){let{x:s,y:l}=t;const c=.5*(this.lineClips?this.scaledDistance*(su-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(r?1:0),(l<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*i)+128,1+(0===o?0:o<0?-1:1)|(63&c)<<2,c>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const h=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,h,this.e2),a.primitiveLength++),n?this.e2=h:this.e1=h}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}hasLineDasharray(t){for(const e of t){const t=e.paint.get("line-dasharray");if(t&&!t.isConstant())return!0}return!1}addLineDashDependencies(t,e,i,r){for(const n of t){const t=n.paint.get("line-dasharray");if(!t||"constant"===t.value.kind)continue;const o="round"===n.layout.get("line-cap"),a={dasharray:t.value.evaluate({zoom:i-1},e,{}),round:o},s={dasharray:t.value.evaluate({zoom:i},e,{}),round:o},l={dasharray:t.value.evaluate({zoom:i+1},e,{}),round:o},c="".concat(a.dasharray.join(","),",").concat(a.round),h="".concat(s.dasharray.join(","),",").concat(s.round),u="".concat(l.dasharray.join(","),",").concat(l.round);r.dashDependencies[c]=a,r.dashDependencies[h]=s,r.dashDependencies[u]=l,e.dashes[n.id]={min:c,mid:h,max:u}}}}let cu,hu;mo("LineBucket",lu,{omit:["layers","patternFeatures"]});var uu={get paint(){return hu=hu||new Qo({"line-opacity":new Ho(bt.paint_line["line-opacity"]),"line-color":new Ho(bt.paint_line["line-color"]),"line-translate":new Xo(bt.paint_line["line-translate"]),"line-translate-anchor":new Xo(bt.paint_line["line-translate-anchor"]),"line-width":new Ho(bt.paint_line["line-width"]),"line-gap-width":new Ho(bt.paint_line["line-gap-width"]),"line-offset":new Ho(bt.paint_line["line-offset"]),"line-blur"
1:new Ho(bt.paint_line["line-blur"]),"line-dasharray":new Yo(bt.paint_line["line-dasharray"]),"line-pattern":new Yo(bt.paint_line["line-pattern"]),"line-gradient":new Jo(bt.paint_line["line-gradient"])})},get layout(){return cu=cu||new Qo({"line-cap":new Xo(bt.layout_line["line-cap"]),"line-join":new Ho(bt.layout_line["line-join"]),"line-miter-limit":new Xo(bt.layout_line["line-miter-limit"]),"line-round-limit":new Xo(bt.layout_line["line-round-limit"]),"line-sort-key":new Ho(bt.layout_line["line-sort-key"])})}};class du extends Ho{possiblyEvaluate(t,e){return e=new Lo(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,r){return e=j({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,r)}}let pu;class fu extends $o{constructor(t,e){super(t,uu,e),this.gradientVersion=0,pu||(pu=new du(uu.paint.properties["line-width"].specification),pu.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this.gradientExpression();this.stepInterpolant=!!function(t){return void 0!==t._styleExpression}(t)&&t._styleExpression.expression instanceof ci,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=pu.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new lu(t)}queryRadius(t){const e=t,i=mu(nl("line-width",this,e),nl("line-gap-width",this,e)),r=nl("line-offset",this,e);return i/2+Math.abs(r)+ol(this.paint.get("line-translate"))}queryIntersectsFeature(t){let{queryGeometry:e,feature:r,featureState:n,geometry:o,transform:a,pixelsToTileUnits:s}=t;const l=al(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,s),c=s/2*mu(this.paint.get("line-width").evaluate(r,n),this.paint.get("line-gap-width").evaluate(r,n)),h=this.paint.get("line-offset").evaluate(r,n);return h&&(o=function(t,e){const r=[];for(let n=0;n<t.length;n++){const o=sl(t[n]),a=[];for(let t=0;t<o.length;t++){const r=o[t],n=o[t-1],s=o[t+1],l=0===t?new i(0,0):r.sub(n)._unit()._perp(),c=t===o.length-1?new i(0,0):s.sub(r)._unit()._perp(),h=l._add(c)._unit(),u=h.x*c.x+h.y*c.y;0!==u&&h._mult(1/u),a.push(h._mult(e)._add(r))}r.push(a)}return r}(o,h*s)),function(t,e,i){for(let r=0;r<e.length;r++){const n=e[r];if(t.length>=3)for(let e=0;e<n.length;e++)if(il(t,n[e]))return!0;if(Ks(t,n,i))return!0}return!1}(l,o,c)}isTileClipped(){return!0}}function mu(t,e){return e>0?e+2*t:t}const gu=aa([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),_u=aa([{name:"a_projected_pos",components:3,type:"Float32"}],4);aa([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const yu=aa([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);aa([{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 vu=aa([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),xu=aa([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function bu(t,e,i){return t.sections.forEach((t=>{t.text=function(t,e,i){const r=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),Fo.applyArabicShaping&&(t=Fo.applyArabicShaping(t)),t}(t.text,e,i)})),t}aa([{name:"triangle",components:3,type:"Uint16"}]),aa([{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"}]),aa([{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"}]),aa([{type:"Float32",name:"offsetX"}]),aa([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),aa([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var wu=24;const Tu={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u22ef":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},Su={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},Pu={40:!0};function Iu(t,e,i,r,n,o){if("fontStack"in e){const r=i[e.fontStack],o=r&&r[t];return o?o.metrics.advance*e.scale+n:0}{const t=r[e.imageName];return t?t.displaySize[0]*e.scale*wu/o+n:0}}function Mu(t,e,i,r){const n=Math.pow(t-e,2);return r?t<e?n/2:2*n:n+Math.abs(i)*i}function Eu(t,e,i){let r=0;return 10===t&&(r-=1e4),i&&(r+=150),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function Cu(t,e,i,r,n,o){let a=null,s=Mu(e,i,n,o);for(const l of r){const t=Mu(e-l.x,i,n,o)+l.badness;t<=s&&(a=l,s=t)}return{index:t,x:e,priorBreak:a,badness:s}}function Au(t){return t?Au(t.priorBreak).concat(t.index):[]}class Du{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];this.text=t,this.sections=e,this.sectionIndex=i,this.imageSectionID=null}static fromFeature(t,e){const i=new Du;for(let r=0;r<t.sections.length;r++){const n=t.sections[r];n.image?i.addImageSection(n):i.addTextSection(n,e)}return i}length(){return[...this.text].length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}verticalizePunctuation(){this.text=function(t){let e="",i={premature:!0,value:void 0};const r=t[Symbol.iterator]();let n=r.next();const o=t[Symbol.iterator]();o.next();let a=o.next();for(;!n.done;)e+=!a.done&&Ao(a.value.codePointAt(0))&&!Tu[a.value]||!i.premature&&Ao(i.value.codePointAt(0))&&!Tu[i.value]||!Tu[n.value]?n.value:Tu[n.value],i={value:n.value,premature:!1},n=r.next(),a=o.next();return e}(this.text)}hasZeroWidthSpaces(){return this.text.includes("\u200b")}trim(){const t=this.text.match(/^\s*/),e=t?t[0].length:0,i=this.text.match(/\S\s*$/),r=i?i[0].length-1:0;this.text=this.text.substring(e,this.text.length-r),this.sectionIndex=this.sectionIndex.slice(e,this.sectionIndex.length-r)}substring(t,e){const i=[...this.text].slice(t,e).join(""),r=this.sectionIndex.slice(t,e);return new Du(i,this.sections,r)}toCodeUnitIndex(t){return[...this.text].slice(0,t).join("").length}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((t,e)=>Math.max(t,this.sections[e].scale)),0)}getMaxImageSize(t){let e=0,i=0;for(let r=0;r<this.length();r++){const n=this.getSection(r);if("imageName"in n){const r=t[n.imageName];if(!r)continue;const o=r.displaySize;e=Math.max(e,o[0]),i=Math.max(i,o[1])}}return{maxImageWidth:e,maxImageHeight:i}}addTextSection(t,e){this.text+=t.text,this.sections.push({scale:t.scale||1,verticalAlign:t.verticalAlign||"bottom",fontStack:t.fontStack||e});const i=this.sections.length-1;this.sectionIndex.push(...[...t.text].map((()=>i)))}addImageSection(t){const e=t.image?t.image.name:"";if(0===e.length)return void W("Can't add FormattedSection with an empty image.");const i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push({scale:1,verticalAlign:t.verticalAlign||"bottom",imageName:e}),this.sectionIndex.push(this.sections.length-1)):W("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}determineLineBreaks(t,e,i,r,n){const o=[],a=this.determineAverageLineWidth(t,e,i,r,n),s=this.hasZeroWidthSpaces();let l=0,c=0;const h=this.text[Symbol.iterator]();let u=h.next();const d=this.text[Symbol.iterator]();d.next();let p=d.next();const f=this.text[Symbol.iterator]();f.next(),f.next();let m=f.next();for(;!u.done;){const e=this.getSection(c),g=u.value.codePointAt(0);if(So(g)||(l+=Iu(g,e,i,r,t,n)),!p.done){const t=wo(g),i=p.value.codePointAt(0);(Su[g]||t||"imageName"in e||!m.done&&Pu[i])&&o.push(Cu(c+1,l,a,o,Eu(g,i,t&&s),!1))}c++,u=h.next(),p=d.next(),m=f.next()}
1return Au(Cu(this.length(),l,a,o,0,!0))}determineAverageLineWidth(t,e,i,r,n){let o=0,a=0;for(const s of this.text){const e=this.getSection(a);o+=Iu(s.codePointAt(0),e,i,r,t,n),a++}return o/Math.max(1,Math.ceil(o/e))}}const zu=4294967296,ku=1/zu,Ru="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class Fu{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array(16);this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.length;for(;this.pos<i;){const i=this.readVarint(),r=i>>3,n=this.pos;this.type=7&i,t(r,e,this),this.pos===n&&this.skip(i)}return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*zu;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*zu;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const e=this.buf;let i,r;return r=e[this.pos++],i=127&r,r<128?i:(r=e[this.pos++],i|=(127&r)<<7,r<128?i:(r=e[this.pos++],i|=(127&r)<<14,r<128?i:(r=e[this.pos++],i|=(127&r)<<21,r<128?i:(r=e[this.pos],i|=(15&r)<<28,function(t,e,i){const r=i.buf;let n,o;if(o=r[i.pos++],n=(112&o)>>4,o<128)return Lu(t,n,e);if(o=r[i.pos++],n|=(127&o)<<3,o<128)return Lu(t,n,e);if(o=r[i.pos++],n|=(127&o)<<10,o<128)return Lu(t,n,e);if(o=r[i.pos++],n|=(127&o)<<17,o<128)return Lu(t,n,e);if(o=r[i.pos++],n|=(127&o)<<24,o<128)return Lu(t,n,e);if(o=r[i.pos++],n|=(1&o)<<31,o<128)return Lu(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(i,t,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return Boolean(this.readVarint())}readString(){const t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ru?Ru.decode(this.buf.subarray(e,t)):function(t,e,i){let r="",n=e;for(;n<i;){const e=t[n];let o,a,s,l=null,c=e>239?4:e>223?3:e>191?2:1;if(n+c>i)break;1===c?e<128&&(l=e):2===c?(o=t[n+1],128==(192&o)&&(l=(31&e)<<6|63&o,l<=127&&(l=null))):3===c?(o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&(l=(15&e)<<12|(63&o)<<6|63&a,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&e)<<18|(63&o)<<12|(63&a)<<6|63&s,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),n+=c}return r}(this.buf,e,t)}readBytes(){const t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1?arguments[1]:void 0;const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readVarint(e));return t}readPackedSVarint(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSVarint());return t}readPackedBoolean(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readBoolean());return t}readPackedFloat(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFloat());return t}readPackedDouble(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readDouble());return t}readPackedFixed32(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed32());return t}readPackedSFixed32(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed32());return t}readPackedFixed64(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed64());return t}readPackedSFixed64(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed64());return t}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}skip(t){const e=7&t;if(0===e)for(;this.buf[this.pos++]>127;);else if(2===e)this.pos=this.readVarint()+this.pos;else if(5===e)this.pos+=4;else{if(1!==e)throw new Error("Unimplemented type: ".concat(e));this.pos+=8}}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e<this.pos+t;)e*=2;if(e!==this.length){const t=new Uint8Array(e);t.set(this.buf),this.buf=t,this.dataView=new DataView(t.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}
vendor: 4,416 bytes, line 1
1writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*ku),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*ku),!0),this.pos+=8}writeVarint(t){(t=+t||0)>268435455||t<0?function(t,e){let i,r;if(t>=0?(i=t%4294967296|0,r=t/4294967296|0):(i=~(-t%4294967296),r=~(-t/4294967296),4294967295^i?i=i+1|0:(i=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){const i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;const e=this.pos;this.pos=function(t,e,i){for(let r,n,o=0;o<e.length;o++){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!n){r>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);const i=this.pos-e;i>=128&&Bu(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const e=t.length;this.writeVarint(e),this.realloc(e);for(let i=0;i<e;i++)this.buf[this.pos++]=t[i]}writeRawMessage(t,e){this.pos++;const i=this.pos;t(e,this);const r=this.pos-i;r>=128&&Bu(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r}writeMessage(t,e,i){this.writeTag(t,2),this.writeRawMessage(e,i)}writePackedVarint(t,e){e.length&&this.writeMessage(t,Ou,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,Vu,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,Uu,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,ju,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,Nu,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,Gu,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,Zu,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,qu,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,Wu,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}}function Lu(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Bu(t,e,i){const r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(let n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function Ou(t,e){for(let i=0;i<t.length;i++)e.writeVarint(t[i])}function Vu(t,e){for(let i=0;i<t.length;i++)e.writeSVarint(t[i])}function ju(t,e){for(let i=0;i<t.length;i++)e.writeFloat(t[i])}function Nu(t,e){for(let i=0;i<t.length;i++)e.writeDouble(t[i])}function Uu(t,e){for(let i=0;i<t.length;i++)e.writeBoolean(t[i])}function Gu(t,e){for(let i=0;i<t.length;i++)e.writeFixed32(t[i])}function Zu(t,e){for(let i=0;i<t.length;i++)e.writeSFixed32(t[i])}function qu(t,e){for(let i=0;i<t.length;
1i++)e.writeFixed64(t[i])}function Wu(t,e){for(let i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Xu(t,e,i){1===t&&i.readMessage(Hu,e)}function Hu(t,e,i){if(3===t){const{id:t,bitmap:r,width:n,height:o,left:a,top:s,advance:l}=i.readMessage(Yu,{});e.push({id:t,bitmap:new Sl({width:n+6,height:o+6},r),metrics:{width:n,height:o,left:a,top:s,advance:l}})}}function Yu(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function Ku(t){let e=0,i=0;for(const a of t)e+=a.w*a.h,i=Math.max(i,a.w);t.sort(((t,e)=>e.h-t.h));const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let n=0,o=0;for(const a of t)for(let t=r.length-1;t>=0;t--){const e=r[t];if(!(a.w>e.w||a.h>e.h)){if(a.x=e.x,a.y=e.y,o=Math.max(o,a.y+a.h),n=Math.max(n,a.x+a.w),a.w===e.w&&a.h===e.h){const e=r.pop();e&&t<r.length&&(r[t]=e)}else a.h===e.h?(e.x+=a.w,e.w-=a.w):a.w===e.w?(e.y+=a.h,e.h-=a.h):(r.push({x:e.x+a.w,y:e.y,w:e.w-a.w,h:a.h}),e.y+=a.h,e.h-=a.h);break}}return{w:n,h:o,fill:e/(n*o)||0}}class Ju{constructor(t,e){let{pixelRatio:i,version:r,stretchX:n,stretchY:o,content:a,textFitWidth:s,textFitHeight:l}=e;this.paddedRect=t,this.pixelRatio=i,this.stretchX=n,this.stretchY=o,this.content=a,this.version=r,this.textFitWidth=s,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Qu{constructor(t,e){const i={},r={};this.haveRenderCallbacks=[];const n=[];this.addImages(t,i,n),this.addImages(e,r,n);const{w:o,h:a}=Ku(n),s=new Pl({width:o||1,height:a||1});for(const l in t){const e=t[l],r=i[l].paddedRect;Pl.copy(e.data,s,{x:0,y:0},{x:r.x+1,y:r.y+1},e.data)}for(const l in e){const t=e[l],i=r[l].paddedRect,n=i.x+1,o=i.y+1,a=t.data.width,c=t.data.height;Pl.copy(t.data,s,{x:0,y:0},{x:n,y:o},t.data),Pl.copy(t.data,s,{x:0,y:c-1},{x:n,y:o-1},{width:a,height:1}),Pl.copy(t.data,s,{x:0,y:0},{x:n,y:o+c},{width:a,height:1}),Pl.copy(t.data,s,{x:a-1,y:0},{x:n-1,y:o},{width:1,height:c}),Pl.copy(t.data,s,{x:0,y:0},{x:n+a,y:o},{width:1,height:c})}this.image=s,this.iconPositions=i,this.patternPositions=r}addImages(t,e,i){for(const r in t){const n=t[r],o={x:0,y:0,w:n.data.width+2,h:n.data.height+2};i.push(o),e[r]=new Ju(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(t,e){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const i in t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)}patchUpdatedImage(t,e,i){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[r,n]=t.tl;i.update(e.data,void 0,{x:r,y:n})}}var $u;function td(e,i,r,n,o,a,s,l,c,h,u,d,p,f,m){const g=Du.fromFeature(e,o);let _;d===t.aw.vertical&&g.verticalizePunctuation();let y=g.determineLineBreaks(h,a,i,n,f);const{processBidirectionalText:v,processStyledBidirectionalText:x}=Fo;if(v&&1===g.sections.length){_=[],y=y.map((t=>g.toCodeUnitIndex(t)));const t=v(g.toString(),y);for(const e of t){const t=[...e].map((()=>0));_.push(new Du(e,g.sections,t))}}else if(x){_=[],y=y.map((t=>g.toCodeUnitIndex(t)));let t=0;const e=[];for(const r of g.text)e.push(...Array(r.length).fill(g.sectionIndex[t])),t++;const i=x(g.text,e,y);for(const r of i){const t=[];let e="";for(const i of r[0])t.push(r[1][e.length]),e+=i;_.push(new Du(r[0],g.sections,t))}}else _=function(t,e){const i=[];let r=0;for(const n of e)i.push(t.substring(r,n)),r=n;return r<t.length()&&i.push(t.substring(r,t.length())),i}(g,y);const b=[],w={positionedLines:b,text:g.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:d,iconsInText:!1,verticalizable:!1};return function(t,e,i,r,n,o,a,s,l,c,h,u){let d=0,p=0,f=0,m=0;const g="right"===s?1:"left"===s?0:.5,_=wu/u;let y=0;for(const b of n){b.trim();const n=b.getMaxScale(),a={positionedGlyphs:[],lineOffset:0};t.positionedLines[y]=a;const s=a.positionedGlyphs;let u=0;if(!b.length()){p+=o,++y;continue}const v=id(r,b,_);let x=0;for(const o of b.text){const a=b.getSection(x),f=o.codePointAt(0),m=nd(l,h,f),g={glyph:f,imageName:null,x:d,y:p+-17,vertical:m,scale:1,fontStack:"",sectionIndex:b.getSectionIndex(x),metrics:null,rect:null};let y;if("fontStack"in a){if(y=od(a,f,m,v,e,i),!y)continue;g.fontStack=a.fontStack}
vendor: 17,410 bytes, line 1
1else{if(t.iconsInText=!0,a.scale*=_,y=ad(a,m,n,v,r),!y)continue;u=Math.max(u,y.imageOffset),g.imageName=a.imageName}const{rect:w,metrics:T,baselineOffset:S}=y;g.y+=S,g.scale=a.scale,g.metrics=T,g.rect=w,s.push(g),m?(t.verticalizable=!0,d+=("imageName"in a?T.advance:wu)*a.scale+c):d+=T.advance*a.scale+c,x++}0!==s.length&&(f=Math.max(d-c,f),sd(s,0,s.length-1,g)),d=0,a.lineOffset=Math.max(u,(n-1)*wu);const w=o*n+u;p+=w,m=Math.max(w,m),++y}const{horizontalAlign:v,verticalAlign:x}=ed(a);(function(t,e,i,r,n,o,a,s,l){const c=(e-i)*n;let h=0;h=o!==a?-s*r- -17:-r*l*a+.5*a;for(const u of t)for(const t of u.positionedGlyphs)t.x+=c,t.y+=h})(t.positionedLines,g,v,x,f,m,o,p,n.length),t.top+=-x*p,t.bottom=t.top+p,t.left+=-v*f,t.right=t.left+f}(w,i,r,n,_,s,l,c,d,h,p,m),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(b)&&w}function ed(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function id(t,e,i){const r=e.getMaxScale()*wu,{maxImageWidth:n,maxImageHeight:o}=e.getMaxImageSize(t),a=Math.max(r,o*i);return{verticalLineContentWidth:Math.max(r,n*i),horizontalLineContentHeight:a}}function rd(t){switch(t){case"top":return 0;case"center":return.5;default:return 1}}function nd(e,i,r){return!(e===t.aw.horizontal||!i&&!To(r)||i&&(So(r)||(n=r,/(?:[\u0600-\u0604\u0606-\u060B\u060D-\u061A\u061C-\u061E\u0620-\u063F\u0641-\u064A\u0656-\u066F\u0671-\u06DC\u06DE-\u06FF\u0750-\u077F\u0870-\u088E\u0890\u0891\u0897-\u08E1\u08E3-\u08FF\uFB50-\uFBC2\uFBD3-\uFD3D\uFD40-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFDFF\uFE70-\uFE74\uFE76-\uFEFC]|\uD803[\uDE60-\uDE7E\uDEC2-\uDEC4\uDEFC-\uDEFF]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB\uDEF0\uDEF1])/.test(String.fromCodePoint(n)))));var n}function od(t,e,i,r,n,o){const a=o[t.fontStack],s=function(t,e,i,r){if(t&&t.rect)return t;const n=e[i.fontStack],o=n&&n[r];return o?{rect:null,metrics:o.metrics}:null}(a&&a[e],n,t,e);if(null===s)return null;let l;if(i)l=r.verticalLineContentWidth-t.scale*wu;else{const e=rd(t.verticalAlign);l=(r.horizontalLineContentHeight-t.scale*wu)*e}return{rect:s.rect,metrics:s.metrics,baselineOffset:l}}function ad(t,e,i,r,n){const o=n[t.imageName];if(!o)return null;const a=o.paddedRect,s=o.displaySize,l={width:s[0],height:s[1],left:1,top:-3,advance:e?s[1]:s[0]};let c;if(e)c=r.verticalLineContentWidth-s[1]*t.scale;else{const e=rd(t.verticalAlign);c=(r.horizontalLineContentHeight-s[1]*t.scale)*e}return{rect:a,metrics:l,baselineOffset:c,imageOffset:(e?s[0]:s[1])*t.scale-wu*i}}function sd(t,e,i,r){if(0===r)return;const n=t[i],o=(t[i].x+n.metrics.advance*n.scale)*r;for(let a=e;a<=i;a++)t[a].x-=o}function ld(t,e,i){const{horizontalAlign:r,verticalAlign:n}=ed(i),o=e[0]-t.displaySize[0]*r,a=e[1]-t.displaySize[1]*n;return{image:t,top:a,bottom:a+t.displaySize[1],left:o,right:o+t.displaySize[0]}}function cd(t){var e,i;let r=t.left,n=t.top,o=t.right-r,a=t.bottom-n;const s=null!==(e=t.image.textFitWidth)&&void 0!==e?e:"stretchOrShrink",l=null!==(i=t.image.textFitHeight)&&void 0!==i?i:"stretchOrShrink",c=(t.image.content[2]-t.image.content[0])/(t.image.content[3]-t.image.content[1]);if("proportional"===l){if("stretchOnly"===s&&o/a<c||"proportional"===s){const t=Math.ceil(a*c);r*=t/o,o=t}}else if("proportional"===s&&"stretchOnly"===l&&0!==c&&o/a>c){const t=Math.ceil(o/c);n*=t/a,a=t}return{x1:r,y1:n,x2:r+o,y2:n+a}}function hd(t,e,i,r,n,o){const a=t.image;let s;if(a.content){const t=a.content,e=a.pixelRatio||1;s=[t[0]/e,t[1]/e,a.displaySize[0]-t[2]/e,a.displaySize[1]-t[3]/e]}const l=e.left*o,c=e.right*o;let h,u,d,p;"width"===i||"both"===i?(p=n[0]+l-r[3],u=n[0]+c+r[1]):(p=n[0]+(l+c-a.displaySize[0])/2,u=p+a.displaySize[0]);const f=e.top*o,m=e.bottom*o;return"height"===i||"both"===i?(h=n[1]+f-r[0],d=n[1]+m+r[2]):(h=n[1]+(f+m-a.displaySize[1])/2,d=h+a.displaySize[1]),{image:a,top:h,right:u,bottom:d,left:p,collisionPadding:s}}mo("ImagePosition",Ju),mo("ImageAtlas",Qu),t.aw=void 0,($u=t.aw||(t.aw={}))[$u.none=0]="none",$u[$u.horizontal=1]="horizontal",$u[$u.vertical=2]="vertical",$u[$u.horizontalOnly=3]="horizontalOnly";const ud=128,dd=32640;function pd(t,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new Lo(t+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:r}=i;let n=0;for(;n<e.length&&e[n]<=t;)n++;n=Math.max(0,n-1);let o=n;for(;o<e.length&&e[o]<t+1;)o++;o=Math.min(e.length-1,o);const a=e[n],s=e[o];return"composite"===i.kind?{kind:"composite",minZoom:a,maxZoom:s,interpolationType:r}:{kind:"camera",minZoom:a,maxZoom:s,minSize:i.evaluate(new Lo(a)),maxSize:i.evaluate(new Lo(s)),interpolationType:r}}}function fd(t,e,i){let r="never";const n=t.get(e);return n?r=n:t.get(i)&&(r="always"),r}const md=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function gd(t,e,i,r,n,o,a,s,l,c,h,u,d){const p=s?Math.min(dd,Math.round(s[0])):0,f=s?Math.min(dd,Math.round(s[1])):0;t.emplaceBack(e,i,Math.round(32*r),Math.round(32*n),o,a,(p<<1)+(l?1:0),f,16*c,16*h,256*u,256*d)}function _d(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function yd(t){for(const e of t.sections)if(Ro(e.text))return!0;return!1}class vd{constructor(t){this.layoutVertexArray=new Qa,this.indexArray=new rs,this.programConfigurations=t,this.segments=new ss,this.dynamicLayoutVertexArray=new $a,this.opacityVertexArray=new ts,this.hasVisibleVertices=!1,this.placedSymbolArray=new Fa}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,gu.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,_u.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,md,!0),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}mo("SymbolBuffers",vd);class xd{constructor(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new ss,this.collisionVertexArray=new is}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,yu.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}mo("CollisionBuffers",xd);class bd{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((t=>t.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=pd(this.zoom,i["text-size"]),this.iconSizeData=pd(this.zoom,i["icon-size"]);const r=this.layers[0].layout,n=r.get("symbol-sort-key"),o=r.get("symbol-z-order");this.canOverlap="never"!==fd(r,"text-overlap","text-allow-overlap")||"never"!==fd(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==o&&!n.isConstant(),this.sortFeaturesByY=("viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((e=>t.aw[e]))),this.stateDependentLayerIds=this.layers.filter((t=>t.isStateDependent())).map((t=>t.id)),this.sourceID=e.sourceID}createArrays(){this.text=new vd(new Bs(this.layers,this.zoom,(t=>/^text/.test(t)))),this.icon=new vd(new Bs(this.layers,this.zoom,(t=>/^icon/.test(t)))),this.glyphOffsetArray=new Oa,this.lineVertexArray=new Va,this.symbolInstances=new Ba,this.textAnchorOffsets=new Na}calculateGlyphDependencies(t,e,i,r,n){for(const o of t)if(e[o.codePointAt(0)]=!0,(i||r)&&n){const t=Tu[o];t&&(e[t.codePointAt(0)]=!0)}}populate(e,i,r){const n=this.layers[0],o=n.layout,a=o.get("text-font"),s=o.get("text-field"),l=o.get("icon-image"),c=("constant"!==s.value.kind||s.value.value instanceof ke&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),h="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,u=o.get("symbol-sort-key");if(this.features=[],!c&&!h)return;const d=i.iconDependencies,p=i.glyphDependencies,f=i.availableImages,m=new Lo(this.zoom);for(const{feature:g,id:_,index:y,sourceLayerIndex:v}of e){const e=n._featureFilter.needGeometry,i=Gs(g,e);if(!n._featureFilter.filter(m,i,r))continue;let s,l;if(e||(i.geometry=Us(g)),c){const t=n.getValueAndResolveTokens("text-field",i,r,f),e=ke.factory(t),o=this.hasRTLText=this.hasRTLText||yd(e);(!o||"unavailable"===Fo.getRTLTextPluginStatus()||o&&Fo.isParsed())&&(s=bu(e,n,i))}if(h){const t=n.getValueAndResolveTokens("icon-image",i,r,f);l=t instanceof je?t:je.fromString(t)}if(!s&&!l)continue;const x=this.sortFeaturesByKey?u.evaluate(i,{},r):void 0;if(this.features.push({id:_,text:s,icon:l,index:y,sourceLayerIndex:v,geometry:i.geometry,properties:g.properties,type:kc.types[g.type],sortKey:x}),l&&(d[l.name]=!0),s){const e=a.evaluate(i,{},r).join(","),n="viewport"!==o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.aw.vertical)>=0;for(const t of s.sections)if(t.image)d[t.image.name]=!0;else{const i=Po(s.toString()),r=t.fontStack||e,o=p[r]=p[r]||{};this.calculateGlyphDependencies(t.text,o,n,this.allowVerticalPlacement,i)}}}"line"===o.get("symbol-placement")&&(this.features=function(t){const e={},i={},r=[];let n=0;function o(e){r.push(t[e]),n++}function a(t,e,n){const o=i[t];return delete i[t],i[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(n[0]),o}function s(t,i,n){const o=e[i];return delete e[i],e[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=n[0].concat(r[o].geometry[0]),o}function l(t,e,i){const r=i?e[0][e[0].length-1]:e[0][0];return"".concat(t,":").concat(r.x,":").concat(r.y)}for(let c=0;c<t.length;c++){const h=t[c],u=h.geometry,d=h.text?h.text.toString():null;if(!d){o(c);continue}const p=l(d,u),f=l(d,u,!0);if(p in i&&f in e&&i[p]!==e[f]){const t=s(p,f,u),n=a(p,f,r[t].geometry);delete e[p],delete i[f],i[l(d,r[n].geometry,!0)]=n,r[t].geometry=null}else p in i?a(p,f,u):f in e?s(p,f,u):(o(c),e[p]=n-1,i[f]=n-1)}return r.filter((t=>t.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((t,e)=>t.sortKey-e.sortKey))}update(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:i}),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,{imagePositions:i}))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,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(t,e){const i=this.lineVertexArray.length;if(void 0!==t.segment){let i=t.dist(e[t.segment+1]),r=t.dist(e[t.segment]);const n={};for(let o=t.segment+1;o<e.length;o++)n[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:i},o<e.length-1&&(i+=e[o+1].dist(e[o]));for(let o=t.segment||0;o>=0;o--)n[o]={x:e[o].x,y:e[o].y,tileUnitDistanceFromAnchor:r},o>0&&(r+=e[o-1].dist(e[o]));for(let t=0;t<e.length;t++){const e=n[t];this.lineVertexArray.emplaceBack(e.x,e.y,e.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,i,r,n,o,a,s,l,c,h,u,d){const p=e.indexArray,f=e.layoutVertexArray,m=e.segments.prepareSegment(4*i.length,f,p,this.canOverlap?a.sortKey:void 0),g=this.glyphOffsetArray.length,_=m.vertexLength,y=this.allowVerticalPlacement&&s===t.aw.vertical?Math.PI/2:0,v=a.text&&a.text.sections;for(let t=0;t<i.length;t++){const{tl:n,tr:o,bl:s,br:c,tex:h,pixelOffsetTL:u,pixelOffsetBR:g,minFontScaleX:_,minFontScaleY:x,glyphOffset:b,isSDF:w,sectionIndex:T}=i[t],S=m.vertexLength,P=b[1];gd(f,l.x,l.y,n.x,P+n.y,h.x,h.y,r,w,u.x,u.y,_,x),gd(f,l.x,l.y,o.x,P+o.y,h.x+h.w,h.y,r,w,g.x,u.y,_,x),gd(f,l.x,l.y,s.x,P+s.y,h.x,h.y+h.h,r,w,u.x,g.y,_,x),gd(f,l.x,l.y,c.x,P+c.y,h.x+h.w,h.y+h.h,r,w,g.x,g.y,_,x),_d(e.dynamicLayoutVertexArray,l,y),p.emplaceBack(S,S+2,S+1),p.emplaceBack(S+1,S+2,S+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(b[0]),t!==i.length-1&&T===i[t+1].sectionIndex||e.programConfigurations.populatePaintArrays(f.length,a,a.index,{imagePositions:{},canonical:d,formattedSection:v&&v[T]})}e.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,_,c,h,l.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],s,0,!1,0,u)}_addCollisionDebugVertex(t,e,i,r,n,o){return e.emplaceBack(0,0),t.emplaceBack(i.x,i.y,r,n,Math.round(o.x),Math.round(o.y))}addCollisionDebugVertices(t,e,r,n,o,a,s){const l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),c=l.vertexLength,h=o.layoutVertexArray,u=o.collisionVertexArray,d=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(h,u,a,d,p,new i(t,e)),this._addCollisionDebugVertex(h,u,a,d,p,new i(r,e)),this._addCollisionDebugVertex(h,u,a,d,p,new i(r,n)),this._addCollisionDebugVertex(h,u,a,d,p,new i(t,n)),l.vertexLength+=4;const f=o.indexArray;f.emplaceBack(c,c+1),f.emplaceBack(c+1,c+2),f.emplaceBack(c+2,c+3),f.emplaceBack(c+3,c),l.primitiveLength+=4}addDebugCollisionBoxes(t,e,i,r){for(let n=t;n<e;n++){const t=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(t.x1,t.y1,t.x2,t.y2,r?this.textCollisionBox:this.iconCollisionBox,t.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new xd(es,vu.members,ns),this.iconCollisionBox=new xd(es,vu.members,ns);for(let t=0;t<this.symbolInstances.length;t++){const e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,i,r,n,o,a,s,l){const c={};for(let h=e;h<i;h++){const e=t.get(h);c.textBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.textFeatureIndex=e.featureIndex;break}for(let h=r;h<n;h++){const e=t.get(h);c.verticalTextBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.verticalTextFeatureIndex=e.featureIndex;break}for(let h=o;h<a;h++){const e=t.get(h);c.iconBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.iconFeatureIndex=e.featureIndex;break}for(let h=s;h<l;h++){const e=t.get(h);c.verticalIconBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.verticalIconFeatureIndex=e.featureIndex;break}return c}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.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(t,e){const i=t.placedSymbolArray.get(e),r=i.vertexStartIndex+4*i.numGlyphs;for(let n=i.vertexStartIndex;n<r;n+=4)t.indexArray.emplaceBack(n,n+2,n+1),t.indexArray.emplaceBack(n+1,n+2,n+3)}
vendor: 7,281 bytes, line 1
1getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),i=Math.cos(t),r=[],n=[],o=[];for(let a=0;a<this.symbolInstances.length;++a){o.push(a);const t=this.symbolInstances.get(a);r.push(0|Math.round(e*t.anchorX+i*t.anchorY)),n.push(t.featureIndex)}return o.sort(((t,e)=>r[t]-r[e]||n[e]-n[t])),o}addToSortKeyRanges(t,e){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach(((t,e,i)=>{t>=0&&i.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)})),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let wd,Td;mo("SymbolBucket",bd,{omit:["layers","collisionBoxArray","features","compareText"]}),bd.MAX_GLYPHS=65535,bd.addDynamicAttributes=_d;var Sd={get paint(){return Td=Td||new Qo({"icon-opacity":new Ho(bt.paint_symbol["icon-opacity"]),"icon-color":new Ho(bt.paint_symbol["icon-color"]),"icon-halo-color":new Ho(bt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ho(bt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ho(bt.paint_symbol["icon-halo-blur"]),"icon-translate":new Xo(bt.paint_symbol["icon-translate"]),"icon-translate-anchor":new Xo(bt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ho(bt.paint_symbol["text-opacity"]),"text-color":new Ho(bt.paint_symbol["text-color"],{runtimeType:Nt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new Ho(bt.paint_symbol["text-halo-color"]),"text-halo-width":new Ho(bt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ho(bt.paint_symbol["text-halo-blur"]),"text-translate":new Xo(bt.paint_symbol["text-translate"]),"text-translate-anchor":new Xo(bt.paint_symbol["text-translate-anchor"])})},get layout(){return wd=wd||new Qo({"symbol-placement":new Xo(bt.layout_symbol["symbol-placement"]),"symbol-spacing":new Xo(bt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Xo(bt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ho(bt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Xo(bt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Xo(bt.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Xo(bt.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Xo(bt.layout_symbol["icon-ignore-placement"]),"icon-optional":new Xo(bt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Xo(bt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ho(bt.layout_symbol["icon-size"]),"icon-text-fit":new Xo(bt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Xo(bt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ho(bt.layout_symbol["icon-image"]),"icon-rotate":new Ho(bt.layout_symbol["icon-rotate"]),"icon-padding":new Ho(bt.layout_symbol["icon-padding"]),"icon-keep-upright":new Xo(bt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ho(bt.layout_symbol["icon-offset"]),"icon-anchor":new Ho(bt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Xo(bt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Xo(bt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Xo(bt.layout_symbol["text-rotation-alignment"]),"text-field":new Ho(bt.layout_symbol["text-field"]),"text-font":new Ho(bt.layout_symbol["text-font"]),"text-size":new Ho(bt.layout_symbol["text-size"]),"text-max-width":new Ho(bt.layout_symbol["text-max-width"]),"text-line-height":new Xo(bt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ho(bt.layout_symbol["text-letter-spacing"]),"text-justify":new Ho(bt.layout_symbol["text-justify"]),"text-radial-offset":new Ho(bt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Xo(bt.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ho(bt.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ho(bt.layout_symbol["text-anchor"]),"text-max-angle":new Xo(bt.layout_symbol["text-max-angle"]),"text-writing-mode":new Xo(bt.layout_symbol["text-writing-mode"]),"text-rotate":new Ho(bt.layout_symbol["text-rotate"]),"text-padding":new Xo(bt.layout_symbol["text-padding"]),"text-keep-upright":new Xo(bt.layout_symbol["text-keep-upright"]),"text-transform":new Ho(bt.layout_symbol["text-transform"]),"text-offset":new Ho(bt.layout_symbol["text-offset"]),"text-allow-overlap":new Xo(bt.layout_symbol["text-allow-overlap"]),"text-overlap":new Xo(bt.layout_symbol["text-overlap"]),"text-ignore-placement":new Xo(bt.layout_symbol["text-ignore-placement"]),"text-optional":new Xo(bt.layout_symbol["text-optional"])})}};class Pd{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:Bt,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}mo("FormatSectionOverride",Pd,{omit:["defaultValue"]});class Id extends $o{constructor(t,e){super(t,Sd,e)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode");if(t){const e=[];for(const i of t)e.indexOf(i)<0&&e.push(i);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}
1getValueAndResolveTokens(t,e,i,r){const n=this.layout.get(t).evaluate(e,{},i,r),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||nn(o.value)||!n?n:function(t,e){return e.replace(/{([^{}]+)}/g,((e,i)=>t&&i in t?String(t[i]):""))}(e.properties,n)}createBucket(t){return new bd(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Sd.paint.overridableProperties){if(!Id.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),i=new Pd(e),r=new rn(i,e.property.specification);let n=null;n="constant"===e.value.kind||"source"===e.value.kind?new an("source",r):new sn("composite",r,e.value.zoomStops),this.paint._values[t]=new qo(e.property,n,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,i){return!(!this.layout||e.isDataDriven()||i.isDataDriven())&&Id.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const i=t.get("text-field"),r=Sd.paint.properties[e];let n=!1;const o=t=>{for(const e of t)if(r.overrides&&r.overrides.hasOverride(e))return void(n=!0)};if("constant"===i.value.kind&&i.value.value instanceof ke)o(i.value.value.sections);else if("source"===i.value.kind||"composite"===i.value.kind){const t=e=>{n||(e instanceof We&&Ze(e.value)===Wt?o(e.value.sections):e instanceof Ai?o(e.sections):e.eachChild(t))},e=i.value;e._styleExpression&&t(e._styleExpression.expression)}return n}}let Md;var Ed={get paint(){return Md=Md||new Qo({"background-color":new Xo(bt.paint_background["background-color"]),"background-pattern":new Ko(bt.paint_background["background-pattern"]),"background-opacity":new Xo(bt.paint_background["background-opacity"])})}};class Cd extends $o{constructor(t,e){super(t,Ed,e)}}class Ad extends $o{constructor(t,e){super(t,{},e),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Dd{constructor(t){this._methodToThrottle=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const zd={once:!0},kd=6371008.8;class Rd{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: (".concat(t,", ").concat(e,")"));if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Rd(V(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}distanceTo(t){const e=Math.PI/180,i=this.lat*e,r=t.lat*e,n=Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return kd*Math.acos(Math.min(n,1))}static convert(t){if(t instanceof Rd)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Rd(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Rd(Number("lng"in t?t.lng:t.lon),Number(t.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 Fd=2*Math.PI*kd;function Ld(t){return Fd*Math.cos(t*Math.PI/180)}function Bd(t){return(180+t)/360}function Od(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Vd(t,e){return t/Ld(e)}function jd(t){return 360*t-180}function Nd(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Ud(t,e){return t*Ld(Nd(e))}class Gd{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.x=+t,this.y=+e,this.z=+i}static fromLngLat(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=Rd.convert(t);return new Gd(Bd(i.lng),Od(i.lat),Vd(e,i.lat))}toLngLat(){return new Rd(jd(this.x),Nd(this.y))}toAltitude(){return Ud(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Fd*(t=Nd(this.y),1/Math.cos(t*Math.PI/180)
1);var t}}function Zd(t,e,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}class qd{constructor(t,e,i){if(!function(t,e,i){return!(t<0||t>25||i<0||i>=Math.pow(2,t)||e<0||e>=Math.pow(2,t))}(t,e,i))throw new Error("x=".concat(e,", y=").concat(i,", z=").concat(t," outside of bounds. 0<=x<").concat(Math.pow(2,t),", 0<=y<").concat(Math.pow(2,t)," 0<=z<=25 "));this.z=t,this.x=e,this.y=i,this.key=Hd(0,t,t,e,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,i){const r=(o=this.y,a=this.z,s=Zd(256*(n=this.x),256*(o=Math.pow(2,a)-o-1),a),l=Zd(256*(n+1),256*(o+1),a),s[0]+","+s[1]+","+l[0]+","+l[1]);var n,o,a,s,l;const c=function(t,e,i){let r,n="";for(let o=t;o>0;o--)r=1<<o-1,n+=(e&r?1:0)+(i&r?2:0);return n}(this.z,this.x,this.y);return t[(this.x+this.y)%t.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("tms"===i?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,r)}isChildOf(t){const e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){const e=Math.pow(2,this.z);return new i((t.x*e-this.x)*D,(t.y*e-this.y)*D)}toString(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}}class Wd{constructor(t,e){this.wrap=t,this.canonical=e,this.key=Hd(t,e.z,e.z,e.x,e.y)}}class Xd{constructor(t,e,i,r,n){if(this.terrainRttPosMatrix32f=null,t<i)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(t,"; z = ").concat(i));this.overscaledZ=t,this.wrap=e,this.canonical=new qd(i,+r,+n),this.key=Hd(e,t,i,r,n)}clone(){return new Xd(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(t,"; overscaledZ = ").concat(this.overscaledZ));const e=this.canonical.z-t;return t>this.canonical.z?new Xd(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Xd(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(t,e){if(t>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(t,"; overscaledZ = ").concat(this.overscaledZ));const i=this.canonical.z-t;return t>this.canonical.z?Hd(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Hd(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(t){if(t.wrap!==this.wrap)return!1;if(this.overscaledZ-t.overscaledZ<=0)return!1;if(0===t.overscaledZ)return this.overscaledZ>0;const e=this.canonical.z-t.canonical.z;return!(e<0)&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new Xd(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new Xd(e,this.wrap,e,i,r),new Xd(e,this.wrap,e,i+1,r),new Xd(e,this.wrap,e,i,r+1),new Xd(e,this.wrap,e,i+1,r+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new Xd(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new Xd(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Wd(this.wrap,this.canonical)}toString(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}getTilePoint(t){return this.canonical.getTilePoint(new Gd(t.x-this.wrap,t.y))}normalizeCoordinates(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8192;if(t>=0&&t<i&&e>=0&&e<i)return{tileID:this,x:t,y:e};const r=Math.floor(t/i),n=Math.floor(e/i),o=t-r*i,a=e-n*i,s=this.canonical.z,l=1<<s,c=this.canonical.y+n;if(c<0||c>=l)return null;let h=this.canonical.x+r,u=this.wrap;return h<0?(u-=Math.ceil(-h/l),h=(h%l+l)%l):h>=l&&(u+=Math.floor(h/l),h%=l),{tileID:new Xd(this.overscaledZ,u,s,h,c),x:o,y:a}}}function Hd(t,e,i,r,n){(t*=2)<0&&(t=-1*t-1);const o=1<<i;return(o*o*t+o*n+r).toString(36)+i.toString(36)+e.toString(36)}mo("CanonicalTileID",qd),mo("OverscaledTileID",Xd,{omit:["terrainRttPosMatrix32f"]});class Yd{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(t){return this.minX=Math.min(this.minX,t.x),this.minY=Math.min(this.minY,t.y),this.maxX=Math.max(this.maxX,t.x),this.maxY=Math.max(this.maxY,t.y),this}expandBy(t){return this.minX-=t,this.minY-=t,this.maxX+=t,this.maxY+=t,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(t){return this.expandBy(-t)}map(t){const e=new Yd;return e.extend(t(new i(this.minX,this.minY))),e.extend(t(new i(this.maxX,this.minY))),e.extend(t(new i(this.minX,this.maxY))),e.extend(t(new i(this.maxX,this.maxY))),e}static fromPoints(t){const e=new Yd;for(const i of t)e.extend(i);return e}contains(t){return t.x>=this.minX&&t.x<=this.maxX&&t.y>=this.minY&&t.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(t){return!this.empty()&&!t.empty()&&t.minX>=this.minX&&t.maxX<=this.maxX&&t.minY>=this.minY&&t.maxY<=this.maxY}intersects(t){return!this.empty()&&!t.empty()&&t.minX<=this.maxX&&t.maxX>=this.minX&&t.minY<=this.maxY&&t.maxY>=this.minY}}class Kd{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error("Out of bounds. Index requested n=".concat(t," can't be >= this._numberToString.length ").concat(this._numberToString.length));return this._numberToString[t]}}class Jd{constructor(t,e,i,r,n){this.type="Feature",this._vectorTileFeature=t,this._x=i,this._y=r,this._z=e,this.properties=t.properties,this.id=n}projectPoint(t,e,i,r){return[360*(t.x+e)/r-180,360/Math.PI*Math.atan(Math.exp((1-2*(t.y+i)/r)*Math.PI))-90]}projectLine(t,e,i,r){return t.map((t=>this.projectPoint(t,e,i,r)))}get geometry(){if(this._geometry)return this._geometry;const t=this._vectorTileFeature,e=t.extent*Math.pow(2,this._z),i=t.extent*this._x,r=t.extent*this._y,n=t.loadGeometry();switch(t.type){case 1:{const t=[];for(const e of n)t.push(e[0]);const o=this.projectLine(t,i,r,e);this._geometry=1===t.length?{type:"Point",coordinates:o[0]}:{type:"MultiPoint",coordinates:o};break}case 2:{const t=n.map((t=>this.projectLine(t,i,r,e)));this._geometry=1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t};break}case 3:{const t=Fc(n),o=[];for(const n of t)o.push(n.map((t=>this.projectLine(t,i,r,e))));this._geometry=1===o.length?{type:"Polygon",coordinates:o[0]}:{type:"MultiPolygon",coordinates:o};break}default:throw new Error("unknown feature type: ".concat(t.type))}return this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"_x"!==e&&"_y"!==e&&"_z"!==e&&(t[e]=this[e]);return t}}class Qd{constructor(t,e,i){r(this,"_name",void 0),r(this,"dataBuffer",void 0),r(this,"nullabilityBuffer",void 0),r(this,"_size",void 0),this._name=t,this.dataBuffer=e,"number"==typeof i?this._size=i:(this.nullabilityBuffer=i,this._size=i.size())}getValue(t){return this.nullabilityBuffer&&!this.nullabilityBuffer.get(t)?null:this.getValueFromBuffer(t)}has(t){var e;return(null===(e=this.nullabilityBuffer)||void 0===e?void 0:e.get(t))||!this.nullabilityBuffer}get name(){return this._name}get size(){return this._size}}class $d extends Qd{}class tp extends $d{getValueFromBuffer(t){return this.dataBuffer[t]}}class ep extends $d{getValueFromBuffer(t){return this.dataBuffer[t]}}class ip extends Qd{constructor(t,e,i,n){super(t,e,n),r(this,"delta",void 0),this.delta=i}}class rp extends ip{constructor(t,e,i,r){super(t,Int32Array.of(e),i,r)}getValueFromBuffer(t){return this.dataBuffer[0]+t*this.delta}}class np extends Qd{constructor(t,e,i){super(t,Int32Array.of(e),i)}getValueFromBuffer(t){return this.dataBuffer[0]}}class op{constructor(t,e,i,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4096;r(this,"_name",void 0),r(this,"_geometryVector",void 0),r(this,"_idVector",void 0),r(this,"_propertyVectors",void 0),r(this,"_extent",void 0),r(this,"propertyVectorsMap",void 0),this._name=t,this._geometryVector=e,this._idVector=i,this._propertyVectors=n,this._extent=o}get name(){return this._name}get idVector(){return this._idVector}get geometryVector(){return this._geometryVector}get propertyVectors(){return this._propertyVectors}getPropertyVector(t){return this.propertyVectorsMap||(this.propertyVectorsMap=new Map(this._propertyVectors.map((t=>[t.name,t])))),this.propertyVectorsMap.get(t)}get numFeatures(){return this.geometryVector.numGeometries}get extent(){return this._extent}getFeatures(){const t=[],e=this.geometryVector.getGeometries();for(let i=0;i<this.numFeatures;i++){let r;if(this.idVector){const t=this.idVector.getValue(i);r=this.containsMaxSaveIntegerValues(this.idVector)&&null!==t?Number(t):t}const n={coordinates:e[i],type:this.geometryVector.geometryType(i)},o={};
1for(const t of this.propertyVectors){if(!t)continue;const e=t.name,r=t.getValue(i);null!==r&&(o[e]=r)}t.push({id:r,geometry:n,properties:o})}return t}containsMaxSaveIntegerValues(t){return t instanceof tp||t instanceof np&&t instanceof rp||t instanceof ep}}class ap{constructor(t){r(this,"value",void 0),this.value=t}get(){return this.value}set(t){this.value=t}increment(){return this.value++}add(t){this.value+=t}}var sp,lp;!function(t){t.NONE="NONE",t.DELTA="DELTA",t.COMPONENTWISE_DELTA="COMPONENTWISE_DELTA",t.RLE="RLE",t.MORTON="MORTON",t.PDE="PDE"}(sp||(sp={})),function(t){t.NONE="NONE",t.FAST_PFOR="FAST_PFOR",t.VARINT="VARINT",t.ALP="ALP"}(lp||(lp={}));const cp=new Uint32Array(33);cp[0]=0;for(let r=1;r<=32;r++)cp[r]=32===r?4294967295:4294967295>>>32-r;const hp=cp,up=256;function dp(t,e){return t-t%e}function pp(t){const e=t>>>0;return((255&e)<<24|(65280&e)<<8|e>>>8&65280|e>>>24&255)>>>0}const fp=function(){if(!Number.isFinite(65536))return 65536;const t=dp(Math.floor(65536),up);return 0===t?up:t}(),mp=3*fp/up+fp|0;function gp(){const t=new Uint8Array(mp);return{dataToBePacked:new Array(33),dataPointers:new Int32Array(33),byteContainer:t,byteContainerI32:new Int32Array(t.buffer,t.byteOffset,t.byteLength>>>2),exceptionSizes:new Int32Array(33)}}function _p(t,e,i,r,n){switch(n){case 1:!function(t,e,i,r){let n=r,o=e;for(let a=0;a<8;a++){const e=t[o++]>>>0;i[n++]=e>>>0&1,i[n++]=e>>>1&1,i[n++]=e>>>2&1,i[n++]=e>>>3&1,i[n++]=e>>>4&1,i[n++]=e>>>5&1,i[n++]=e>>>6&1,i[n++]=e>>>7&1,i[n++]=e>>>8&1,i[n++]=e>>>9&1,i[n++]=e>>>10&1,i[n++]=e>>>11&1,i[n++]=e>>>12&1,i[n++]=e>>>13&1,i[n++]=e>>>14&1,i[n++]=e>>>15&1,i[n++]=e>>>16&1,i[n++]=e>>>17&1,i[n++]=e>>>18&1,i[n++]=e>>>19&1,i[n++]=e>>>20&1,i[n++]=e>>>21&1,i[n++]=e>>>22&1,i[n++]=e>>>23&1,i[n++]=e>>>24&1,i[n++]=e>>>25&1,i[n++]=e>>>26&1,i[n++]=e>>>27&1,i[n++]=e>>>28&1,i[n++]=e>>>29&1,i[n++]=e>>>30&1,i[n++]=e>>>31&1}}(t,e,i,r);break;case 2:!function(t,e,i,r){let n=r,o=e;for(let a=0;a<8;a++){const e=t[o++]>>>0,r=t[o++]>>>0;i[n++]=e>>>0&3,i[n++]=e>>>2&3,i[n++]=e>>>4&3,i[n++]=e>>>6&3,i[n++]=e>>>8&3,i[n++]=e>>>10&3,i[n++]=e>>>12&3,i[n++]=e>>>14&3,i[n++]=e>>>16&3,i[n++]=e>>>18&3,i[n++]=e>>>20&3,i[n++]=e>>>22&3,i[n++]=e>>>24&3,i[n++]=e>>>26&3,i[n++]=e>>>28&3,i[n++]=e>>>30&3,i[n++]=r>>>0&3,i[n++]=r>>>2&3,i[n++]=r>>>4&3,i[n++]=r>>>6&3,i[n++]=r>>>8&3,i[n++]=r>>>10&3,i[n++]=r>>>12&3,i[n++]=r>>>14&3,i[n++]=r>>>16&3,i[n++]=r>>>18&3,i[n++]=r>>>20&3,i[n++]=r>>>22&3,i[n++]=r>>>24&3,i[n++]=r>>>26&3,i[n++]=r>>>28&3,i[n++]=r>>>30&3}}(t,e,i,r);break;case 3:!function(t,e,i,r){let n=r,o=e;for(let a=0;a<8;a++){const e=t[o++]>>>0,r=t[o++]>>>0,a=t[o++]>>>0;i[n++]=e>>>0&7,i[n++]=e>>>3&7,i[n++]=e>>>6&7,i[n++]=e>>>9&7,i[n++]=e>>>12&7,i[n++]=e>>>15&7,i[n++]=e>>>18&7,i[n++]=e>>>21&7,i[n++]=e>>>24&7,i[n++]=e>>>27&7,i[n++]=7&(e>>>30|(1&r)<<2),i[n++]=r>>>1&7,i[n++]=r>>>4&7,i[n++]=r>>>7&7,i[n++]=r>>>10&7,i[n++]=r>>>13&7,i[n++]=r>>>16&7,i[n++]=r>>>19&7,i[n++]=r>>>22&7,i[n++]=r>>>25&7,i[n++]=r>>>28&7,i[n++]=7&(r>>>31|(3&a)<<1),i[n++]=a>>>2&7,i[n++]=a>>>5&7,i[n++]=a>>>8&7,i[n++]=a>>>11&7,i[n++]=a>>>14&7,i[n++]=a>>>17&7,i[n++]=a>>>20&7,i[n++]=a>>>23&7,i[n++]=a>>>26&7,i[n++]=a>>>29&7}}(t,e,i,r);break;case 4:!function(t,e,i,r){let n=r,o=e;for(let a=0;a<8;a++){const e=t[o++]>>>0,r=t[o++]>>>0,a=t[o++]>>>0,s=t[o++]>>>0;i[n++]=e>>>0&15,i[n++]=e>>>4&15,i[n++]=e>>>8&15,i[n++]=e>>>12&15,i[n++]=e>>>16&15,i[n++]=e>>>20&15,i[n++]=e>>>24&15,i[n++]=e>>>28&15,i[n++]=r>>>0&15,i[n++]=r>>>4&15,i[n++]=r>>>8&15,i[n++]=r>>>12&15,i[n++]=r>>>16&15,i[n++]=r>>>20&15,i[n++]=r>>>24&15,i[n++]=r>>>28&15,i[n++]=a>>>0&15,i[n++]=a>>>4&15,i[n++]=a>>>8&15,i[n++]=a>>>12&15,i[n++]=a>>>16&15,i[n++]=a>>>20&15,i[n++]=a>>>24&15,i[n++]=a>>>28&15,i[n++]=s>>>0&15,i[n++]=s>>>4&15,i[n++]=s>>>8&15,i[n++]=s>>>12&15,i[n++]=s>>>16&15,i[n++]=s>>>20&15,i[n++]=s>>>24&15,i[n++]=s>>>28&15}}(t,e,i,r);break;case 5:!function(t,e,i,r){let n=r,o=e;for(let a=0;a<8;a++){const e=t[o++]>>>0,r=t[o++]>>>0,a=t[o++]>>>0,s=t[o++]>>>0,l=t[o++]>>>0;i[n++]=e>>>0&31,i[n++]=e>>>5&31,i[n++]=e>>>10&31,i[n++]=e>>>15&31,i[n++]=e>>>20&31,i[n++]=e>>>25&31,i[n++]=31&(e>>>30|(7&r)<<2),i[n++]=r>>>3&31,i[n++]=r>>>8&31,i[n++]=r>>>13&31,i[n++]=r>>>18&31,i[n++]=r>>>23&31,i[n++]=31&(r>>>28|(1&a)<<4),i[n++]=a>>>1&31,i[n++]=a>>>6&31,i[n++]=a>>>11&31,i[n++]=a>>>16&31,i[n++]=a>>>21&31,i[n++]=a>>>
126&31,i[n++]=31&(a>>>31|(15&s)<<1),i[n++]=s>>>4&31,i[n++]=s>>>9&31,i[n++]=s>>>14&31,i[n++]=s>>>19&31,i[n++]=s>>>24&31,i[n++]=31&(s>>>29|(3&l)<<3),i[n++]=l>>>2&31,i[n++]=l>>>7&31,i[n++]=l>>>12&31,i[n++]=l>>>17&31,i[n++]=l>>>22&31,i[n++]=l>>>27&31}}(t,e,i,r);break;case 6:!function(t,e,i,r){let n=r,o=e;for(let a=0;a<8;a++){const e=t[o++]>>>0,r=t[o++]>>>0,a=t[o++]>>>0,s=t[o++]>>>0,l=t[o++]>>>0,c=t[o++]>>>0;i[n++]=e>>>0&63,i[n++]=e>>>6&63,i[n++]=e>>>12&63,i[n++]=e>>>18&63,i[n++]=e>>>24&63,i[n++]=63&(e>>>30|(15&r)<<2),i[n++]=r>>>4&63,i[n++]=r>>>10&63,i[n++]=r>>>16&63,i[n++]=r>>>22&63,i[n++]=63&(r>>>28|(3&a)<<4),i[n++]=a>>>2&63,i[n++]=a>>>8&63,i[n++]=a>>>14&63,i[n++]=a>>>20&63,i[n++]=a>>>26&63,i[n++]=s>>>0&63,i[n++]=s>>>6&63,i[n++]=s>>>12&63,i[n++]=s>>>18&63,i[n++]=s>>>24&63,i[n++]=63&(s>>>30|(15&l)<<2),i[n++]=l>>>4&63,i[n++]=l>>>10&63,i[n++]=l>>>16&63,i[n++]=l>>>22&63,i[n++]=63&(l>>>28|(3&c)<<4),i[n++]=c>>>2&63,i[n++]=c>>>8&63,i[n++]=c>>>14&63,i[n++]=c>>>20&63,i[n++]=c>>>26&63}}(t,e,i,r);break;case 7:!function(t,e,i,r){let n=r,o=e;for(let a=0;a<8;a++){const e=t[o++]>>>0,r=t[o++]>>>0,a=t[o++]>>>0,s=t[o++]>>>0,l=t[o++]>>>0,c=t[o++]>>>0,h=t[o++]>>>0;i[n++]=e>>>0&127,i[n++]=e>>>7&127,i[n++]=e>>>14&127,i[n++]=e>>>21&127,i[n++]=127&(e>>>28|(7&r)<<4),i[n++]=r>>>3&127,i[n++]=r>>>10&127,i[n++]=r>>>17&127,i[n++]=r>>>24&127,i[n++]=127&(r>>>31|(63&a)<<1),i[n++]=a>>>6&127,i[n++]=a>>>13&127,i[n++]=a>>>20&127,i[n++]=127&(a>>>27|(3&s)<<5),i[n++]=s>>>2&127,i[n++]=s>>>9&127,i[n++]=s>>>16&127,i[n++]=s>>>23&127,i[n++]=127&(s>>>30|(31&l)<<2),i[n++]=l>>>5&127,i[n++]=l>>>12&127,i[n++]=l>>>19&127,i[n++]=127&(l>>>26|(1&c)<<6),i[n++]=c>>>1&127,i[n++]=c>>>8&127,i[n++]=c>>>15&127,i[n++]=c>>>22&127,i[n++]=127&(c>>>29|(15&h)<<3),i[n++]=h>>>4&127,i[n++]=h>>>11&127,i[n++]=h>>>18&127,i[n++]=h>>>25&127}}(t,e,i,r);break;case 8:!function(t,e,i,r){let n=r,o=e;for(let a=0;a<8;a++){const e=t[o++]>>>0,r=t[o++]>>>0,a=t[o++]>>>0,s=t[o++]>>>0,l=t[o++]>>>0,c=t[o++]>>>0,h=t[o++]>>>0,u=t[o++]>>>0;i[n++]=e>>>0&255,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=r>>>0&255,i[n++]=r>>>8&255,i[n++]=r>>>16&255,i[n++]=r>>>24&255,i[n++]=a>>>0&255,i[n++]=a>>>8&255,i[n++]=a>>>16&255,i[n++]=a>>>24&255,i[n++]=s>>>0&255,i[n++]=s>>>8&255,i[n++]=s>>>16&255,i[n++]=s>>>24&255,i[n++]=l>>>0&255,i[n++]=l>>>8&255,i[n++]=l>>>16&255,i[n++]=l>>>24&255,i[n++]=c>>>0&255,i[n++]=c>>>8&255,i[n++]=c>>>16&255,i[n++]=c>>>24&255,i[n++]=h>>>0&255,i[n++]=h>>>8&255,i[n++]=h>>>16&255,i[n++]=h>>>24&255,i[n++]=u>>>0&255,i[n++]=u>>>8&255,i[n++]=u>>>16&255,i[n++]=u>>>24&255}}(t,e,i,r);break;case 16:!function(t,e,i,r){let n=r,o=e;for(let a=0;a<128;a++){const e=t[o++]>>>0;i[n++]=65535&e,i[n++]=e>>>16&65535}}(t,e,i,r);break;default:!function(t,e,i,r,n){const o=hp[n]>>>0;let a=e,s=0,l=t[a]>>>0,c=r;for(let h=0;h<8;h++){for(let e=0;e<32;e++)if(s+n<=32)i[c+e]=l>>>s&o,s+=n,32===s&&(s=0,a++,31!==e&&(l=t[a]>>>0));else{const r=32-s,h=l>>>s;a++,l=t[a]>>>0;const u=n-r;i[c+e]=(h|(l&-1>>>32-u>>>0)<<r)&o,s=u}c+=32,s=0,h<7&&(l=t[a]>>>0)}}(t,e,i,r,n)}return e+(n<<3)|0}function yp(t,e,i,r){if(i+2>e)throw new Error("FastPFOR decode: byteContainer underflow at block=".concat(r," (need 2 bytes for [bitWidth, exceptionCount], bytePos=").concat(i,", byteSize=").concat(e,")"));const n=t[i++],o=t[i++];if(n>32)throw new Error("FastPFOR decode: invalid bitWidth=".concat(n," at block=").concat(r," (expected 0..32). This likely indicates corrupted or truncated input."));return{bitWidth:n,exceptionCount:o,bytePosIn:i}}function vp(t,e,i,r,n,o,a,s,l){const{maxBits:c,exceptionBitWidth:h,bytePosIn:u}=function(t,e,i,r,n,o){if(i+1>e)throw new Error("FastPFOR decode: exception header underflow at block=".concat(o," (need 1 byte for maxBits, bytePos=").concat(i,", byteSize=").concat(e,")"));const a=t[i++];if(a<r||a>32)throw new Error("FastPFOR decode: invalid maxBits=".concat(a," at block=").concat(o," (bitWidth=").concat(r,", expected ").concat(r,"..32)"));const s=a-r|0;if(s<1||s>32)throw new Error("FastPFOR decode: invalid exceptionBitWidth=".concat(s," at block=").concat(o," (bitWidth=").concat(r,", maxBits=").concat(a,")"));if(i+n>e)throw new Error("FastPFOR decode: exception positions underflow at block=".concat(o," (need=").concat(n,", have=").concat(e-i,")"));return{maxBits:a,exceptionBitWidth:s,bytePosIn:i}}(n,o,a,i,r,l);if(a=u,1===h){const o=1<<i;for(let i=0;i<r;i=i+1|0)t[n[a++]+e|0]|=o;return a}const d=s.dataToBePacked[h];if(!d)throw new Error("FastPFOR decode: missing exception stream for exceptionBitWidth=".concat(h," (bitWidth=").concat(i,", maxBits=").concat(c,") at block ").concat(l));const p=s.dataPointers;let f=0|p[h];const m=0|s.exceptionSizes[h];if(f+r>m)throw new Error("FastPFOR decode: exception stream overflow for exceptionBitWidth=".concat(h," (ptr=").concat(f,", need ").concat(r,", size=").concat(m,") at block ").concat(l));for(let g=0;g<r;g=g+1|0){const r=n[a++],o=0|d[f++];t[r+e|0]|=o<<i}return p[h]=f,a}function xp(t,e,i,r,n,o){const a=0|i,s=0|t[a];if(s<=0||a+s>t.length-1)throw new Error("FastPFOR decode: invalid whereMeta=".concat(s," at pageStart=").concat(a," (expected > 0 and pageStart+whereMeta < encoded.length=").concat(t.length,")"));const l=a+1|0,c=a+s|0,h=t[c]>>>0,u=h+3>>>2,d=c+1,p=d+u;if(p>=t.length)throw new Error("FastPFOR decode: invalid byteSize=".concat(h," (metaInts=").concat(u,", pageStart=").concat(a,", packedEnd=").concat(c,", byteContainerStart=").concat(d,") causes bitmapPos=").concat(p," out of bounds (encoded.length=").concat(t.length,")"));
1const f=function(t,e,i,r){r.byteContainer.length<i&&(r.byteContainer=new Uint8Array(2*i),r.byteContainerI32=void 0);const n=r.byteContainer,o=i>>>2;if(3&n.byteOffset)for(let s=0;s<o;s=s+1|0){const i=0|t[e+s|0],r=s<<2;n[r]=255&i,n[r+1|0]=i>>>8&255,n[r+2|0]=i>>>16&255,n[r+3|0]=i>>>24&255}else{let i=r.byteContainerI32;(!i||i.buffer!==n.buffer||i.byteOffset!==n.byteOffset||i.length<o)&&(i=r.byteContainerI32=new Int32Array(n.buffer,n.byteOffset,n.byteLength>>>2)),i.set(t.subarray(e,e+o))}const a=3&i;if(a>0){const i=0|t[e+o|0],r=o<<2;for(let t=0;t<a;t=t+1|0)n[r+t|0]=i>>>(t<<3)&255}return n}(t,d,h,o),m=h,g=function(t,e,i){const r=0|t[e++],n=i.dataToBePacked;for(let o=2;o<=32;o=o+1|0){if(!(r>>>o-1&1))continue;if(e>=t.length)throw new Error("FastPFOR decode: truncated exception stream header (bitWidth=".concat(o,", streamWordIndex=").concat(e,", needWords=1, availableWords=").concat(t.length-e,", encodedWords=").concat(t.length,")"));const a=t[e++]>>>0,s=dp(a+31,32),l=a*o+31>>>5;if(e+l>t.length)throw new Error("FastPFOR decode: truncated exception stream (bitWidth=".concat(o,", size=").concat(a,", streamWordIndex=").concat(e,", needWords=").concat(l,", availableWords=").concat(t.length-e,", encodedWords=").concat(t.length,")"));let c=n[o];(!c||c.length<s)&&(c=n[o]=new Int32Array(s));let h=0;for(;h<a;h=h+32|0)bp(t,e,c,h,o),e=e+o|0;e=e-((h-a|0)*o>>>5)|0,i.exceptionSizes[o]=a}return e}(t,p,o);return o.dataPointers.fill(0),function(t,e,i,r,n,o,a,s,l,c){let h=0|i,u=0;for(let d=0;d<a;d=d+1|0){const e=yp(s,l,u,d);u=e.bytePosIn;const i=e.bitWidth,r=e.exceptionCount,a=o+d*up|0;switch(i){case 0:n.fill(0,a,a+up);break;case 32:for(let e=0;e<up;e=e+1|0)n[a+e|0]=0|t[h+e|0];h=h+up|0;break;default:h=_p(t,h,n,a,i)}r>0&&(u=vp(n,a,i,r,s,l,u,c,d))}if(h!==r)throw new Error("FastPFOR decode: packed region mismatch (pageStart=".concat(e,", packedStart=").concat(i,", consumedPackedEnd=").concat(h,", expectedPackedEnd=").concat(r,", packedWords=").concat(r-i,", encoded.length=").concat(t.length,")"))}(t,a,l,c,e,0|r,n/up|0,f,m,o),g}function bp(t,e,i,r,n){switch(n){case 2:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0;i[n++]=o>>>0&3,i[n++]=o>>>2&3,i[n++]=o>>>4&3,i[n++]=o>>>6&3,i[n++]=o>>>8&3,i[n++]=o>>>10&3,i[n++]=o>>>12&3,i[n++]=o>>>14&3,i[n++]=o>>>16&3,i[n++]=o>>>18&3,i[n++]=o>>>20&3,i[n++]=o>>>22&3,i[n++]=o>>>24&3,i[n++]=o>>>26&3,i[n++]=o>>>28&3,i[n++]=o>>>30&3,i[n++]=a>>>0&3,i[n++]=a>>>2&3,i[n++]=a>>>4&3,i[n++]=a>>>6&3,i[n++]=a>>>8&3,i[n++]=a>>>10&3,i[n++]=a>>>12&3,i[n++]=a>>>14&3,i[n++]=a>>>16&3,i[n++]=a>>>18&3,i[n++]=a>>>20&3,i[n++]=a>>>22&3,i[n++]=a>>>24&3,i[n++]=a>>>26&3,i[n++]=a>>>28&3,i[n]=a>>>30&3}(t,e,i,r);case 3:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0;i[n++]=o>>>0&7,i[n++]=o>>>3&7,i[n++]=o>>>6&7,i[n++]=o>>>9&7,i[n++]=o>>>12&7,i[n++]=o>>>15&7,i[n++]=o>>>18&7,i[n++]=o>>>21&7,i[n++]=o>>>24&7,i[n++]=o>>>27&7,i[n++]=7&(o>>>30|(1&a)<<2),i[n++]=a>>>1&7,i[n++]=a>>>4&7,i[n++]=a>>>7&7,i[n++]=a>>>10&7,i[n++]=a>>>13&7,i[n++]=a>>>16&7,i[n++]=a>>>19&7,i[n++]=a>>>22&7,i[n++]=a>>>25&7,i[n++]=a>>>28&7,i[n++]=7&(a>>>31|(3&s)<<1),i[n++]=s>>>2&7,i[n++]=s>>>5&7,i[n++]=s>>>8&7,i[n++]=s>>>11&7,i[n++]=s>>>14&7,i[n++]=s>>>17&7,i[n++]=s>>>20&7,i[n++]=s>>>23&7,i[n++]=s>>>26&7,i[n]=s>>>29&7}(t,e,i,r);case 4:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0;i[n++]=o>>>0&15,i[n++]=o>>>4&15,i[n++]=o>>>8&15,i[n++]=o>>>12&15,i[n++]=o>>>16&15,i[n++]=o>>>20&15,i[n++]=o>>>24&15,i[n++]=o>>>28&15,i[n++]=a>>>0&15,i[n++]=a>>>4&15,i[n++]=a>>>8&15,i[n++]=a>>>12&15,i[n++]=a>>>16&15,i[n++]=a>>>20&15,i[n++]=a>>>24&15,i[n++]=a>>>28&15,i[n++]=s>>>0&15,i[n++]=s>>>4&15,i[n++]=s>>>8&15,i[n++]=s>>>12&15,i[n++]=s>>>16&15,i[n++]=s>>>20&15,i[n++]=s>>>24&15,i[n++]=s>>>28&15,i[n++]=l>>>0&15,i[n++]=l>>>4&15,i[n++]=l>>>8&15,i[n++]=l>>>12&15,i[n++]=l>>>16&15,i[n++]=l>>>20&15,i[n++]=l>>>24&15,i[n]=l>>>28&15}(t,e,i,r);case 5:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0;i[n++]=o>>>0&31,i[n++]=o>>>5&31,i[n++]=o>>>10&31,i[n++]=o>>>15&31,i[n++]=o>>>20&31,i[n++]=o>>>25&31,i[n++]=31&(o>>>30|(7&a)<<2),i[n++]=a>>>3&31,i[n++]=a>>>8&31,i[n++]=a>>>13&31,i[n++]=a>>>18&31,i[n++]=a>>>23&31,i[n++]=31&(a>>>28|(1&s)<<4),i[n++]=s>>>1&31,i[n++]=s>>>6&31,i[n++]=s>>>11&31,i[n++]=s>>>16&31,i[n++]=s>>>21&31,i[n++]=s>>>26&31,i[n++]=31&(s>>>31|(15&l)<<1),i[n++]=l>>>4&31,i[n++]=l>>>9&31,i[n++]=l>>>14&31,i[n++]=l>>>19&31,i[n++]=l>>>24&31,i[n++]=31&(l>>>29|(3&c)<<3),i[n++]=c>>>2&31,i[n++]=c>>>7&31,i[n++]=c>>>12&31,i[n++]=c>>>17&31,i[n++]=c>>>22&31,i[n]=c>>>27&31}(t,e,i,r);
vendor: 4,859 bytes, line 1
1case 6:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0;i[n++]=o>>>0&63,i[n++]=o>>>6&63,i[n++]=o>>>12&63,i[n++]=o>>>18&63,i[n++]=o>>>24&63,i[n++]=63&(o>>>30|(15&a)<<2),i[n++]=a>>>4&63,i[n++]=a>>>10&63,i[n++]=a>>>16&63,i[n++]=a>>>22&63,i[n++]=63&(a>>>28|(3&s)<<4),i[n++]=s>>>2&63,i[n++]=s>>>8&63,i[n++]=s>>>14&63,i[n++]=s>>>20&63,i[n++]=s>>>26&63,i[n++]=l>>>0&63,i[n++]=l>>>6&63,i[n++]=l>>>12&63,i[n++]=l>>>18&63,i[n++]=l>>>24&63,i[n++]=63&(l>>>30|(15&c)<<2),i[n++]=c>>>4&63,i[n++]=c>>>10&63,i[n++]=c>>>16&63,i[n++]=c>>>22&63,i[n++]=63&(c>>>28|(3&h)<<4),i[n++]=h>>>2&63,i[n++]=h>>>8&63,i[n++]=h>>>14&63,i[n++]=h>>>20&63,i[n]=h>>>26&63}(t,e,i,r);case 7:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0;i[n++]=o>>>0&127,i[n++]=o>>>7&127,i[n++]=o>>>14&127,i[n++]=o>>>21&127,i[n++]=127&(o>>>28|(7&a)<<4),i[n++]=a>>>3&127,i[n++]=a>>>10&127,i[n++]=a>>>17&127,i[n++]=a>>>24&127,i[n++]=127&(a>>>31|(63&s)<<1),i[n++]=s>>>6&127,i[n++]=s>>>13&127,i[n++]=s>>>20&127,i[n++]=127&(s>>>27|(3&l)<<5),i[n++]=l>>>2&127,i[n++]=l>>>9&127,i[n++]=l>>>16&127,i[n++]=l>>>23&127,i[n++]=127&(l>>>30|(31&c)<<2),i[n++]=c>>>5&127,i[n++]=c>>>12&127,i[n++]=c>>>19&127,i[n++]=127&(c>>>26|(1&h)<<6),i[n++]=h>>>1&127,i[n++]=h>>>8&127,i[n++]=h>>>15&127,i[n++]=h>>>22&127,i[n++]=127&(h>>>29|(15&u)<<3),i[n++]=u>>>4&127,i[n++]=u>>>11&127,i[n++]=u>>>18&127,i[n]=u>>>25&127}(t,e,i,r);case 8:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0;i[n++]=o>>>0&255,i[n++]=o>>>8&255,i[n++]=o>>>16&255,i[n++]=o>>>24&255,i[n++]=a>>>0&255,i[n++]=a>>>8&255,i[n++]=a>>>16&255,i[n++]=a>>>24&255,i[n++]=s>>>0&255,i[n++]=s>>>8&255,i[n++]=s>>>16&255,i[n++]=s>>>24&255,i[n++]=l>>>0&255,i[n++]=l>>>8&255,i[n++]=l>>>16&255,i[n++]=l>>>24&255,i[n++]=c>>>0&255,i[n++]=c>>>8&255,i[n++]=c>>>16&255,i[n++]=c>>>24&255,i[n++]=h>>>0&255,i[n++]=h>>>8&255,i[n++]=h>>>16&255,i[n++]=h>>>24&255,i[n++]=u>>>0&255,i[n++]=u>>>8&255,i[n++]=u>>>16&255,i[n++]=u>>>24&255,i[n++]=d>>>0&255,i[n++]=d>>>8&255,i[n++]=d>>>16&255,i[n]=d>>>24&255}(t,e,i,r);case 9:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0;i[n++]=o>>>0&511,i[n++]=o>>>9&511,i[n++]=o>>>18&511,i[n++]=511&(o>>>27|(15&a)<<5),i[n++]=a>>>4&511,i[n++]=a>>>13&511,i[n++]=a>>>22&511,i[n++]=511&(a>>>31|(255&s)<<1),i[n++]=s>>>8&511,i[n++]=s>>>17&511,i[n++]=511&(s>>>26|(7&l)<<6),i[n++]=l>>>3&511,i[n++]=l>>>12&511,i[n++]=l>>>21&511,i[n++]=511&(l>>>30|(127&c)<<2),i[n++]=c>>>7&511,i[n++]=c>>>16&511,i[n++]=511&(c>>>25|(3&h)<<7),i[n++]=h>>>2&511,i[n++]=h>>>11&511,i[n++]=h>>>20&511,i[n++]=511&(h>>>29|(63&u)<<3),i[n++]=u>>>6&511,i[n++]=u>>>15&511,i[n++]=511&(u>>>24|(1&d)<<8),i[n++]=d>>>1&511,i[n++]=d>>>10&511,i[n++]=d>>>19&511,i[n++]=511&(d>>>28|(31&p)<<4),i[n++]=p>>>5&511,i[n++]=p>>>14&511,i[n]=p>>>23&511}(t,e,i,r);case 10:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,f=t[e+9]>>>0;i[n++]=o>>>0&1023,i[n++]=o>>>10&1023,i[n++]=o>>>20&1023,i[n++]=1023&(o>>>30|(255&a)<<2),i[n++]=a>>>8&1023,i[n++]=a>>>18&1023,i[n++]=1023&(a>>>28|(63&s)<<4),i[n++]=s>>>6&1023,i[n++]=s>>>16&1023,i[n++]=1023&(s>>>26|(15&l)<<6),i[n++]=l>>>4&1023,i[n++]=l>>>14&1023,i[n++]=1023&(l>>>24|(3&c)<<8),i[n++]=c>>>2&1023,i[n++]=c>>>12&1023,i[n++]=c>>>22&1023,i[n++]=h>>>0&1023,i[n++]=h>>>10&1023,i[n++]=h>>>20&1023,i[n++]=1023&(h>>>30|(255&u)<<2),i[n++]=u>>>8&1023,i[n++]=u>>>18&1023,i[n++]=1023&(u>>>28|(63&d)<<4),i[n++]=d>>>6&1023,i[n++]=d>>>16&1023,i[n++]=1023&(d>>>26|(15&p)<<6),i[n++]=p>>>4&1023,i[n++]=p>>>14&1023,i[n++]=1023&(p>>>24|(3&f)<<8),i[n++]=f>>>2&1023,i[n++]=f>>>12&1023,i[n]=f>>>22&1023}(t,e,i,r);case 11:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,f=t[e+9]>>>0,m=t[e+10]>>>0;i[n++]=o>>>0&2047,i[n++]=o>>>11&2047,i[n++]=2047&(o>>>22|(1&a)<<10),i[n++]=a>>>1&2047,i[n++]=a>>>12&2047,i[n++]=2047&(a>>>23|(3&s)<<9),i[n++]=s>>>2&2047,i[n++]=s>>>13&2047,i[n++]=2047&(s>>>24|(7&l)<<8),i[n++]=l>>>3&2047,i[n++]=l>>>14&2047,i[n++]=2047&(l>>>25|(15&c)<<7),i[n++]=c>>>4&2047,i[n++]=c>>>15&2047,i[n++]=2047&(c>>>26|(31&h)<<6),i[n++]=h>>>5&2047,i[n++]=h>>>16&2047,i[n++]=2047&(h>>>27|(63&u)<<5),i[n++]=u>>>6&2047,i[n++]=u>>>17&2047,i[n++]=2047&(u>>>28|(127&d)<<4),i[n++]=d>>>7&2047,i[n++]=d>>>18&2047,i[n++]=2047&(d>>>29|(255&p)<<3),i[n++]=p>>>8&2047,i[n++]=p>>>19&2047,i[n++]=2047&(p>>>30|(511&f)<<2),i[n++]=f>>>9&2047,i[n++]=f>>>20&2047,i[n++]=2047&(f>>>31|(1023&m)<<1),i[n++]=m>>>10&2047,i[n]=m>>>21&2047}(t,e,i,r);
1case 12:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,f=t[e+9]>>>0,m=t[e+10]>>>0,g=t[e+11]>>>0;i[n++]=o>>>0&4095,i[n++]=o>>>12&4095,i[n++]=4095&(o>>>24|(15&a)<<8),i[n++]=a>>>4&4095,i[n++]=a>>>16&4095,i[n++]=4095&(a>>>28|(255&s)<<4),i[n++]=s>>>8&4095,i[n++]=s>>>20&4095,i[n++]=l>>>0&4095,i[n++]=l>>>12&4095,i[n++]=4095&(l>>>24|(15&c)<<8),i[n++]=c>>>4&4095,i[n++]=c>>>16&4095,i[n++]=4095&(c>>>28|(255&h)<<4),i[n++]=h>>>8&4095,i[n++]=h>>>20&4095,i[n++]=u>>>0&4095,i[n++]=u>>>12&4095,i[n++]=4095&(u>>>24|(15&d)<<8),i[n++]=d>>>4&4095,i[n++]=d>>>16&4095,i[n++]=4095&(d>>>28|(255&p)<<4),i[n++]=p>>>8&4095,i[n++]=p>>>20&4095,i[n++]=f>>>0&4095,i[n++]=f>>>12&4095,i[n++]=4095&(f>>>24|(15&m)<<8),i[n++]=m>>>4&4095,i[n++]=m>>>16&4095,i[n++]=4095&(m>>>28|(255&g)<<4),i[n++]=g>>>8&4095,i[n]=g>>>20&4095}(t,e,i,r);case 16:return void function(t,e,i,r){let n=r;const o=t[e]>>>0,a=t[e+1]>>>0,s=t[e+2]>>>0,l=t[e+3]>>>0,c=t[e+4]>>>0,h=t[e+5]>>>0,u=t[e+6]>>>0,d=t[e+7]>>>0,p=t[e+8]>>>0,f=t[e+9]>>>0,m=t[e+10]>>>0,g=t[e+11]>>>0,_=t[e+12]>>>0,y=t[e+13]>>>0,v=t[e+14]>>>0,x=t[e+15]>>>0;i[n++]=o>>>0&65535,i[n++]=o>>>16&65535,i[n++]=a>>>0&65535,i[n++]=a>>>16&65535,i[n++]=s>>>0&65535,i[n++]=s>>>16&65535,i[n++]=l>>>0&65535,i[n++]=l>>>16&65535,i[n++]=c>>>0&65535,i[n++]=c>>>16&65535,i[n++]=h>>>0&65535,i[n++]=h>>>16&65535,i[n++]=u>>>0&65535,i[n++]=u>>>16&65535,i[n++]=d>>>0&65535,i[n++]=d>>>16&65535,i[n++]=p>>>0&65535,i[n++]=p>>>16&65535,i[n++]=f>>>0&65535,i[n++]=f>>>16&65535,i[n++]=m>>>0&65535,i[n++]=m>>>16&65535,i[n++]=g>>>0&65535,i[n++]=g>>>16&65535,i[n++]=_>>>0&65535,i[n++]=_>>>16&65535,i[n++]=y>>>0&65535,i[n++]=y>>>16&65535,i[n++]=v>>>0&65535,i[n++]=v>>>16&65535,i[n++]=x>>>0&65535,i[n]=x>>>16&65535}(t,e,i,r);case 32:for(let n=0;n<32;n=n+1|0)i[r+n|0]=0|t[e+n|0];return}const o=hp[n]>>>0;let a=e,s=0,l=t[a]>>>0;for(let c=0;c<32;c++)if(s+n<=32)i[r+c]=l>>>s&o,s+=n,32===s&&(s=0,a++,31!==c&&(l=t[a]>>>0));else{const e=32-s,h=l>>>s;a++,l=t[a]>>>0,i[r+c]=(h|(l&hp[n-e]>>>0)<<e)&o,s=n-e}}function wp(t,e,i){const r=new Int32Array(i);let n=0,o=e.get();for(let a=0;a<r.length;a++){let e=t[o++],i=127&e;e<128||(e=t[o++],i|=(127&e)<<7,e<128||(e=t[o++],i|=(127&e)<<14,e<128||(e=t[o++],i|=(127&e)<<21,e<128||(e=t[o++],i|=(15&e)<<28)))),r[n++]=i}return e.set(o),r}function Tp(t,e,i){const r=new BigUint64Array(i);for(let n=0;n<r.length;n++)r[n]=Sp(t,e);return r}function Sp(t,e){let i=0n,r=0,n=e.get();for(;n<t.length;){const e=t[n++];if(i|=BigInt(127&e)<<BigInt(r),!(128&e))break;if(r+=7,r>=64)throw new Error("Varint too long")}return e.set(n),i}function Pp(t,e){let i,r;return r=t[e.get()],e.increment(),i=127&r,r<128?i:(r=t[e.get()],e.increment(),i|=(127&r)<<7,r<128?i:(r=t[e.get()],e.increment(),i|=(127&r)<<14,r<128?i:(r=t[e.get()],e.increment(),i|=(127&r)<<21,r<128?i:(r=t[e.get()],i|=(15&r)<<28,function(t,e,i){let r,n;if(n=e[i.get()],i.increment(),r=(112&n)>>4,n<128)return 4294967296*r+(t>>>0);if(n=e[i.get()],i.increment(),r|=(127&n)<<3,n<128)return 4294967296*r+(t>>>0);if(n=e[i.get()],i.increment(),r|=(127&n)<<10,n<128)return 4294967296*r+(t>>>0);if(n=e[i.get()],i.increment(),r|=(127&n)<<17,n<128)return 4294967296*r+(t>>>0);if(n=e[i.get()],i.increment(),r|=(127&n)<<24,n<128)return 4294967296*r+(t>>>0);if(n=e[i.get()],i.increment(),r|=(1&n)<<31,n<128)return 4294967296*r+(t>>>0);throw new Error("Expected varint not more than 10 bytes")}(i,t,e)))))}function Ip(t){return t>>>1^-(1&t)}function Mp(t){return t>>1n^-(1n&t)}function Ep(t){return t%2==1?(t+1)/-2:t/2}function Cp(t,e,i){if(void 0===i){i=0;for(let r=0;r<e;r++)i+=t[r]}const r=new Int32Array(i);let n=0;for(let o=0;o<e;o++){const i=t[o];r.fill(t[o+e],n,n+i),n+=i}return r}function Ap(t,e,i){if(void 0===i){i=0;for(let r=0;r<e;r++)i+=Number(t[r])}const r=new BigUint64Array(i);let n=0;for(let o=0;o<e;o++){const i=Number(t[o]);r.fill(t[o+e],n,n+i),n+=i}return r}function Dp(t,e,i){const r=new Float64Array(i);let n=0;for(let o=0;o<e;o++){const i=t[o];r.fill(t[o+e],n,n+i),n+=i}return r}function zp(t){const e=new BigInt64Array(t.length);e[0]=Mp(t[0]);const i=t.length/4*4;let r=1;if(i>=4)for(;r<i-4;r+=4){const i=t[r+1],n=t[r+2],o=t[r+3];e[r]=Mp(t[r])+e[r-1],e[r+1]=Mp(i)+e[r],e[r+2]=Mp(n)+e[r+1],e[r+3]=Mp(o)+e[r+2]}for(;r!==e.length;++r)e[r]=Mp(t[r])+e[r-1];return e}function kp(t){const e=t.length/4*4;let i=1;if(e>=4)for(let r=t[0];i<e-4;i+=4)r=t[i]+=r,r=t[i+1]+=r,r=t[i+2]+=r,r=t[i+3]+=r;for(;i!==t.length;)t[i]+=t[i-1],++i}var Rp,Fp,Lp,Bp,Op,Vp,jp,Np;!function(t){t.PRESENT="PRESENT",t.DATA="DATA",t.OFFSET="OFFSET",t.LENGTH="LENGTH"}(Rp||(Rp={}));class Up{constructor(t,e,i){r(this,"_dictionaryType",void 0),r(this,"_offsetType",void 0),r(this,"_lengthType",void 0),this._dictionaryType=t,this._offsetType=e,this._lengthType=i}get dictionaryType(){return this._dictionaryType}get offsetType(){return this._offsetType}get lengthType(){return this._lengthType}}function Gp(t,e){const i=function(t,e){const i=t[e.get()],r=Object.values(Rp)[i>>4];let n=null;switch(r){case Rp.DATA:n=new Up(Object.values(Fp)[15&i]);break;case Rp.OFFSET:n=new Up(null,Object.values(Lp)[15&i]);break;case Rp.LENGTH:n=new Up(null,null,Object.values(Bp)[15&i])}e.increment();const o=t[e.get()],a=Object.values(sp)[o>>5],s=Object.values(sp)[o>>2&7],l=Object.values(lp)[3&o];e.increment();const c=wp(t,e,2),h=c[0];return{physicalStreamType:r,logicalStreamType:n,logicalLevelTechnique1:a,logicalLevelTechnique2:s,physicalLevelTechnique:l,numValues:h,byteLength:c[1],decompressedCount:h}}(t,e);
1return i.logicalLevelTechnique1===sp.MORTON?function(t,e,i){const r=wp(e,i,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:t.decompressedCount,numBits:r[0],coordinateShift:r[1]}}(i,t,e):sp.RLE!==i.logicalLevelTechnique1&&sp.RLE!==i.logicalLevelTechnique2||lp.NONE===i.physicalLevelTechnique?i:function(t,e,i){const r=wp(e,i,2);return{physicalStreamType:t.physicalStreamType,logicalStreamType:t.logicalStreamType,logicalLevelTechnique1:t.logicalLevelTechnique1,logicalLevelTechnique2:t.logicalLevelTechnique2,physicalLevelTechnique:t.physicalLevelTechnique,numValues:t.numValues,byteLength:t.byteLength,decompressedCount:r[1],runs:r[0],numRleValues:r[1]}}(i,t,e)}!function(t){t.NONE="NONE",t.SINGLE="SINGLE",t.SHARED="SHARED",t.VERTEX="VERTEX",t.MORTON="MORTON",t.FSST="FSST"}(Fp||(Fp={})),function(t){t.VERTEX="VERTEX",t.INDEX="INDEX",t.STRING="STRING",t.KEY="KEY"}(Lp||(Lp={})),function(t){t.VAR_BINARY="VAR_BINARY",t.GEOMETRIES="GEOMETRIES",t.PARTS="PARTS",t.RINGS="RINGS",t.TRIANGLES="TRIANGLES",t.SYMBOL="SYMBOL",t.DICTIONARY="DICTIONARY"}(Bp||(Bp={})),function(t){t[t.FLAT=0]="FLAT",t[t.CONST=1]="CONST",t[t.SEQUENCE=2]="SEQUENCE",t[t.DICTIONARY=3]="DICTIONARY",t[t.FSST_DICTIONARY=4]="FSST_DICTIONARY"}(Op||(Op={}));class Zp{constructor(t,e){r(this,"values",void 0),r(this,"_size",void 0),this.values=t,this._size=e}get(t){const e=Math.floor(t/8);return 1==(this.values[e]>>t%8&1)}set(t,e){const i=Math.floor(t/8);this.values[i]=this.values[i]|(e?1:0)<<t%8}getInt(t){const e=Math.floor(t/8);return this.values[e]>>t%8&1}size(){return this._size}getBuffer(){return this.values}}function qp(t,e,i){if(!e)return t;const r=e.size(),n=new(0,t.constructor)(r);let o=0;for(let a=0;a<r;a++)n[a]=e.get(a)?t[o++]:i;return n}function Wp(t,e,i,r,n,o){return function(t,e,i,r,n){switch(e.logicalLevelTechnique1){case sp.DELTA:if(e.logicalLevelTechnique2===sp.RLE){const i=e;if(!n)return function(t,e,i){const r=new Int32Array(i);let n=0,o=0;for(let a=0;a<e;a++){const i=t[a],s=Ip(t[a+e]);for(let t=0;t<i;t++)o+=s,r[n++]=o}return r}(t,i.runs,i.numRleValues);t=Cp(t,i.runs,i.numRleValues)}!function(t){t[0]=Ip(t[0]);const e=t.length/4*4;let i=1;if(e>=4)for(;i<e-4;i+=4){const e=t[i+1],r=t[i+2],n=t[i+3];t[i]=Ip(t[i])+t[i-1],t[i+1]=Ip(e)+t[i],t[i+2]=Ip(r)+t[i+1],t[i+3]=Ip(n)+t[i+2]}for(;i!==t.length;++i)t[i]=Ip(t[i])+t[i-1]}(t);break;case sp.RLE:t=function(t,e,i){return i?function(t,e,i){if(void 0===i){i=0;for(let r=0;r<e;r++)i+=t[r]}const r=new Int32Array(i);let n=0;for(let o=0;o<e;o++){const i=t[o];let a=t[o+e];a=Ip(a),r.fill(a,n,n+i),n+=i}return r}(t,e.runs,e.numRleValues):Cp(t,e.runs,e.numRleValues)}(t,e,i);break;case sp.MORTON:kp(t);break;case sp.COMPONENTWISE_DELTA:!function(t){if(t.length<2)return;t[0]=Ip(t[0]),t[1]=Ip(t[1]);const e=t.length/4*4;let i=2;if(e>=4)for(;i<e-4;i+=4){const e=t[i+1],r=t[i+2],n=t[i+3];t[i]=Ip(t[i])+t[i-2],t[i+1]=Ip(e)+t[i-1],t[i+2]=Ip(r)+t[i],t[i+3]=Ip(n)+t[i+1]}for(;i!==t.length;i+=2)t[i]=Ip(t[i])+t[i-2],t[i+1]=Ip(t[i+1])+t[i-1]}(t);break;case sp.NONE:i&&function(t){for(let e=0;e<t.length;e++)t[e]=Ip(t[e])}(t);break;default:throw new Error("The specified Logical level technique is not supported: ".concat(e.logicalLevelTechnique1))}return n?qp(t,n,0):t}(Hp(t,e,i),i,r,0,o)}function Xp(t,e,i){return function(t,e){if(e.logicalLevelTechnique1===sp.DELTA&&e.logicalLevelTechnique2===sp.NONE)return function(t){const e=new Int32Array(t.length+1);e[0]=0,e[1]=Ip(t[0]);let i=e[1];for(let r=2;r!==e.length;++r)i+=Ip(t[r-1]),e[r]=e[r-1]+i;return new Uint32Array(e)}(t);if(e.logicalLevelTechnique1===sp.RLE&&e.logicalLevelTechnique2===sp.NONE)return function(t,e,i){const r=new Int32Array(i+1);r[0]=0;let n=1,o=r[0];for(let a=0;a<e;a++){const i=t[a],s=t[a+e];for(let t=n;t<n+i;t++)r[t]=s+o,o=r[t];n+=i}return new Uint32Array(r)}(t,e.runs,e.numRleValues);if(e.logicalLevelTechnique1===sp.NONE&&e.logicalLevelTechnique2===sp.NONE){!function(t){let e=0;for(let i=0;i<t.length;i++)t[i]+=e,e=t[i]}(t);const i=new Uint32Array(e.numValues+1);return i[0]=0,i.set(t,1),i}if(e.logicalLevelTechnique1===sp.DELTA&&e.logicalLevelTechnique2===sp.RLE){const i=function(t,e,
1i){const r=new Int32Array(i+1);r[0]=0;let n=1,o=r[0];for(let a=0;a<e;a++){const i=t[a];let s=t[a+e];s=Ip(s);for(let t=n;t<n+i;t++)r[t]=s+o,o=r[t];n+=i}return new Uint32Array(r)}(t,e.runs,e.numRleValues);return kp(i),i}throw new Error("Only delta encoding is supported for transforming length to offset streams yet.")}(Hp(t,e,i),i)}function Hp(t,e,i){const r=i.physicalLevelTechnique;if(r===lp.FAST_PFOR)return function(t,e,i,r){return function(t,e,i,r,n){const o=r.get();if(3&i)throw new Error("FastPFOR: invalid encodedByteLength=".concat(i," at offset=").concat(o," (encodedBytes.length=").concat(t.length,"; expected a multiple of 4 bytes for an int32 big-endian word stream)"));const a=i>>>2,s=function(t,e){if(e<=t.encodedWords.length)return t.encodedWords;const i=new Int32Array(Math.max(16,2*e));return t.encodedWords=i,i}(n,a);!function(t,e,i,r){if(e<0||i<0||e+i>t.length)throw new RangeError("decodeBigEndianInt32sInto: out of bounds (offset=".concat(e,", byteLength=").concat(i,", bytes.length=").concat(t.length,")"));const n=Math.floor(i/4),o=i%4!=0,a=o?n+1:n;if(r.length<a)throw new RangeError("decodeBigEndianInt32sInto: out.length=".concat(r.length," < ").concat(a));if(n>0){const i=t.byteOffset+e;if(3&i)for(let o=0;o<n;o++){const i=e+4*o;r[o]=t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]}else{const e=new Uint32Array(t.buffer,i,n);for(let t=0;t<n;t++)r[t]=0|pp(e[t])}}if(o){const o=e+4*n,a=i-4*n;let s=0;for(let e=0;e<a;e++)s|=t[o+e]<<24-8*e;r[n]=0|s}}(t,o,i,s);const l=function(t,e,i){let r=0,n=0;const o=new Int32Array(e),a=null!==i&&void 0!==i?i:gp();if(t.length>0){const e=0|t[r];if(r=r+1|0,e<0||255&e)throw new Error("FastPFOR decode: invalid alignedLength=".concat(e," (expected >= 0 and multiple of 256)"));if(n+e>o.length)throw new Error("FastPFOR decode: output buffer too small (outPos=".concat(n,", alignedLength=").concat(e,", out.length=").concat(o.length,")"));r=function(t,e,i,r,n,o){const a=r+dp(n,up);let s=r,l=i;for(;s!==a;){const i=Math.min(fp,a-s);l=xp(t,e,l,s,i,o),s=s+i|0}return l}(t,o,r,n,e,a),n=n+e|0}return function(t,e,i,r,n,o){if(0===o)return e;let a=0,s=e;const l=e+i,c=n;let h=n;const u=n+o;let d=0,p=0;for(;s<l&&h<u;){const e=t[s]>>>a&255;if(a+=8,s+=a>>>5,a&=31,d|=(127&e)<<p,128&e)r[h++]=0|d,d=0,p=0;else if(p+=7,p>28)throw new Error("FastPFOR VByte: unterminated value (expected MSB=1 terminator within 5 bytes; shift=".concat(p,", partial=").concat(d,", decoded=").concat(h-c,"/").concat(o,", inPos=").concat(s,", inEnd=").concat(l,")"))}if(h!==u)throw new Error("FastPFOR VByte: truncated stream (decoded=".concat(h-c,", expected=").concat(o,", consumedWords=").concat(s-e,"/").concat(i,", vbyteStart=").concat(e,", vbyteEnd=").concat(l,")"))}(t,r,t.length-r|0,o,n,e-n|0),o}(s.subarray(0,a),e,n.decoderWorkspace);return r.add(i),l}(t,e,i,r,function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;if(t<0)throw new RangeError("initialEncodedWordCapacity must be >= 0, got ".concat(t));const e=Math.max(16,0|t);return{encodedWords:new Int32Array(e),decoderWorkspace:gp()}}(i>>>2))}(t,i.numValues,i.byteLength,e);if(r===lp.VARINT)return wp(t,e,i.numValues);if(r===lp.NONE){const r=e.get();e.add(i.byteLength);const n=t.subarray(r,e.get());return new Int32Array(n)}throw new Error("Specified physicalLevelTechnique is not supported (yet).")}function Yp(t,e,i,r){const n=Hp(t,e,i);if(1===n.length){const t=n[0];return r?Ip(t):t}return r?function(t){return Ip(t[1])}(n):function(t){return t[1]}(n)}function Kp(t,e,i){return function(t){if(2===t.length){const e=Ip(t[1]);return[e,e]}return[Ip(t[2]),Ip(t[3])]}(Hp(t,e,i))}function Jp(t,e,i){return function(t){if(2===t.length){const e=Mp(t[1]);return[e,e]}return[Mp(t[2]),Mp(t[3])]}(Tp(t,e,i.numValues))}function Qp(t,e,i,r,n){return function(t,e,i,r){let n;switch(e.logicalLevelTechnique1){case sp.DELTA:if(e.logicalLevelTechnique2===sp.RLE){const i=e;if(!r)return function(t,e,i){const r=new BigInt64Array(i);let n=0,o=0n;for(let a=0;a<e;a++){const i=Number(t[a]),s=Mp(t[a+e]);for(let t=0;t<i;t++)o+=s,r[n++]=o}return r}(t,i.runs,i.numRleValues);n=zp(t=Ap(t,i.runs,i.numRleValues))}else n=zp(t);break;
1case sp.RLE:n=function(t,e,i){return i?function(t,e,i){if(void 0===i){i=0;for(let r=0;r<e;r++)i+=Number(t[r])}const r=new BigInt64Array(i);let n=0;for(let o=0;o<e;o++){const i=Number(t[o]);let a=t[o+e];a=Mp(a),r.fill(a,n,n+i),n+=i}return r}(t,e.runs,e.numRleValues):new BigInt64Array(Ap(t,e.runs,e.numRleValues))}(t,e,i);break;case sp.NONE:n=i?function(t){const e=new BigInt64Array(t.length);for(let i=0;i<t.length;i++)e[i]=Mp(t[i]);return e}(t):new BigInt64Array(t);break;default:throw new Error("The specified Logical level technique is not supported: ".concat(e.logicalLevelTechnique1))}return r?qp(n,r,0n):n}(Tp(t,e,i.numValues),i,r,n)}function $p(t,e,i,r){const n=Tp(t,e,i.numValues);if(1===n.length){const t=n[0];return r?Mp(t):t}return r?function(t){return Mp(t[1])}(n):function(t){return t[1]}(n)}function tf(t,e,i,r){const n=t.logicalLevelTechnique1;if(n===sp.RLE)return 1===t.runs?Op.CONST:Op.FLAT;if(n!==sp.DELTA||t.logicalLevelTechnique2!==sp.RLE)return 1===t.numValues?Op.CONST:Op.FLAT;const o=e instanceof Zp?e.size():e;if(t.numRleValues!==o)return Op.FLAT;if(1===t.runs)return Op.SEQUENCE;if(2!==t.runs)return 1===t.numValues?Op.CONST:Op.FLAT;const a=r.get();let s;if(t.physicalLevelTechnique===lp.VARINT)s=wp(i,r,4);else{const t=r.get();s=new Int32Array(i.buffer,i.byteOffset+t,4)}return r.set(a),2===s[2]&&2===s[3]?Op.SEQUENCE:1===t.numValues?Op.CONST:Op.FLAT}class ef extends $d{getValueFromBuffer(t){return this.dataBuffer[t]}}class rf extends ip{constructor(t,e,i,r){super(t,BigInt64Array.of(e),i,r)}getValueFromBuffer(t){return this.dataBuffer[0]+BigInt(t)*this.delta}}function nf(t,e,i){return{x:of(t,e)-i,y:of(t>>1,e)-i}}function of(t,e){let i=0;for(let r=0;r<e;r++)i|=(t&1<<2*r)>>r;return i}function af(t,e,r,n,o,a,s){return t===Np.MORTON?function(t,e,r,n,o,a){const s=new Array(o?n+1:n);for(let l=0;l<n;l++){const n=nf(t[e[r+l]],a.numBits,a.coordinateShift);s[l]=new i(n.x,n.y)}return o&&(s[s.length-1]=s[0]),s}(e,r,n,o,a,s):function(t,e,r,n,o){const a=new Array(o?n+1:n);for(let s=0;s<2*n;s+=2){const n=2*e[r+s/2];a[s/2]=new i(t[n],t[n+1])}return o&&(a[a.length-1]=a[0]),a}(e,r,n,o,a)}function sf(t,e,r,n){const o=new Array(n?r+1:r);for(let a=0;a<2*r;a+=2)o[a/2]=new i(t[e+a],t[e+a+1]);return n&&(o[o.length-1]=o[0]),o}!function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON",t[t.MULTIPOINT=3]="MULTIPOINT",t[t.MULTILINESTRING=4]="MULTILINESTRING",t[t.MULTIPOLYGON=5]="MULTIPOLYGON"}(Vp||(Vp={})),function(t){t[t.POINT=0]="POINT",t[t.LINESTRING=1]="LINESTRING",t[t.POLYGON=2]="POLYGON"}(jp||(jp={})),function(t){t[t.MORTON=0]="MORTON",t[t.VEC_2=1]="VEC_2",t[t.VEC_3=2]="VEC_3"}(Np||(Np={}));class lf{constructor(t,e,i,n,o){r(this,"_vertexBufferType",void 0),r(this,"_topologyVector",void 0),r(this,"_vertexOffsets",void 0),r(this,"_vertexBuffer",void 0),r(this,"_mortonSettings",void 0),this._vertexBufferType=t,this._topologyVector=e,this._vertexOffsets=i,this._vertexBuffer=n,this._mortonSettings=o}get vertexBufferType(){return this._vertexBufferType}get topologyVector(){return this._topologyVector}get vertexOffsets(){return this._vertexOffsets}get vertexBuffer(){return this._vertexBuffer}getSimpleEncodedVertex(t){const e=this.vertexOffsets?2*this.vertexOffsets[t]:2*t;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getVertex(t){if(this.vertexOffsets&&this.mortonSettings){const e=nf(this.vertexBuffer[this.vertexOffsets[t]],this.mortonSettings.numBits,this.mortonSettings.coordinateShift);return[e.x,e.y]}const e=this.vertexOffsets?2*this.vertexOffsets[t]:2*t;return[this.vertexBuffer[e],this.vertexBuffer[e+1]]}getGeometries(){return function(t){const e=new Array(t.numGeometries);let r=1,n=1,o=1,a=0,s=0,l=0;const c=t.mortonSettings,h=t.topologyVector,u=h.geometryOffsets,d=h.partOffsets,p=h.ringOffsets,f=t.vertexOffsets,m=!f||0===f.length,g=t.containsPolygonGeometry(),_=t.vertexBuffer;for(let y=0;y<t.numGeometries;y++)switch(t.geometryType(y)){case Vp.POINT:{let h,g;if(m)h=_[s++],g=_[s++];else if(t.vertexBufferType===Np.MORTON){const t=nf(_[f[l++]],c.numBits,c.coordinateShift);h=t.x,g=t.y}else{const t=2*f[l++];h=_[t],g=_[t+1]}e[a++]=[[new i(h,g)]],u&&o++,d&&r++,p&&n++}
1break;case Vp.MULTIPOINT:{const t=u[o]-u[o-1];o++;const c=new Array(t);if(m)for(let e=0;e<t;e++){const t=_[s++],r=_[s++];c[e]=new i(t,r)}else for(let e=0;e<t;e++){const t=2*f[l++];c[e]=new i(_[t],_[t+1])}e[a++]=c.map((t=>[t])),r+=t,n+=t}break;case Vp.LINESTRING:{let i,h;g?(i=p[n]-p[n-1],n++):i=d[r]-d[r-1],r++,m?(h=sf(_,s,i,!1),s+=2*i):(h=af(t.vertexBufferType,_,f,l,i,!1,c),l+=i),e[a++]=[h],u&&o++}break;case Vp.POLYGON:{const i=d[r]-d[r-1];r++;const h=new Array(i-1);let g,y=p[n]-p[n-1];if(n++,m){g=sf(_,s,y,!0),s+=2*y;for(let t=0;t<h.length;t++)y=p[n]-p[n-1],n++,h[t]=sf(_,s,y,!0),s+=2*y}else{g=af(t.vertexBufferType,_,f,l,y,!0,c),l+=y;for(let e=0;e<h.length;e++)y=p[n]-p[n-1],n++,h[e]=af(t.vertexBufferType,_,f,l,y,!0,c),l+=y}e[a++]=[g].concat(h),u&&o++}break;case Vp.MULTILINESTRING:{const i=u[o]-u[o-1];o++;const h=new Array(i);for(let e=0;e<i;e++){let i;if(g?(i=p[n]-p[n-1],n++):i=d[r]-d[r-1],r++,m)h[e]=sf(_,s,i,!1),s+=2*i;else{const r=af(t.vertexBufferType,_,f,l,i,!1,c);h[e]=r,l+=i}}e[a++]=h}break;case Vp.MULTIPOLYGON:{const i=u[o]-u[o-1];o++;const h=new Array(i);for(let e=0;e<i;e++){const i=d[r]-d[r-1];let o;r++;const a=new Array(i-1),u=p[n]-p[n-1];n++,m?(o=sf(_,s,u,!0),s+=2*u):(o=af(t.vertexBufferType,_,f,l,u,!0,c),l+=u);for(let e=0;e<a.length;e++){const i=p[n]-p[n-1];n++,m?(a[e]=sf(_,s,i,!0),s+=2*i):(a[e]=af(t.vertexBufferType,_,f,l,i,!0,c),l+=i)}h[e]=[o].concat(a)}e[a++]=h.flat()}break;default:throw new Error("The specified geometry type is currently not supported.")}return e}(this)}get mortonSettings(){return this._mortonSettings}}class cf extends lf{constructor(t,e,i,n,o,a,s){super(i,n,o,a,s),r(this,"_numGeometries",void 0),r(this,"_geometryType",void 0),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsPolygonGeometry(){return this._geometryType===Vp.POLYGON||this._geometryType===Vp.MULTIPOLYGON}containsSingleGeometryType(){return!0}}class hf extends lf{constructor(t,e,i,n,o,a){super(t,i,n,o,a),r(this,"_geometryTypes",void 0),this._geometryTypes=e}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsPolygonGeometry(){for(let t=0;t<this.numGeometries;t++)if(this.geometryType(t)===Vp.POLYGON||this.geometryType(t)===Vp.MULTIPOLYGON)return!0;return!1}containsSingleGeometryType(){return!1}}class uf{constructor(t,e,i,n){r(this,"_triangleOffsets",void 0),r(this,"_indexBuffer",void 0),r(this,"_vertexBuffer",void 0),r(this,"_topologyVector",void 0),this._triangleOffsets=t,this._indexBuffer=e,this._vertexBuffer=i,this._topologyVector=n}get triangleOffsets(){return this._triangleOffsets}get indexBuffer(){return this._indexBuffer}get vertexBuffer(){return this._vertexBuffer}get topologyVector(){return this._topologyVector}getGeometries(){if(!this._topologyVector)throw new Error("Cannot convert GpuVector to coordinates without topology information");const t=new Array(this.numGeometries),e=this._topologyVector,r=e.partOffsets,n=e.ringOffsets,o=e.geometryOffsets;let a=0,s=1,l=1,c=1;for(let h=0;h<this.numGeometries;h++)switch(this.geometryType(h)){case Vp.POLYGON:{const e=r[s]-r[s-1];s++;const u=[];for(let t=0;t<e;t++){const t=n[l]-n[l-1];l++;const e=[];for(let r=0;r<t;r++){const t=this._vertexBuffer[a++],r=this._vertexBuffer[a++];e.push(new i(t,r))}e.length>0&&e.push(e[0]),u.push(e)}t[h]=u,o&&c++}break;case Vp.MULTIPOLYGON:{const e=o[c]-o[c-1];c++;const u=[];for(let t=0;t<e;t++){const t=r[s]-r[s-1];s++;for(let e=0;e<t;e++){const t=n[l]-n[l-1];l++;const e=[];for(let r=0;r<t;r++){const t=this._vertexBuffer[a++],r=this._vertexBuffer[a++];e.push(new i(t,r))}e.length>0&&e.push(e[0]),u.push(e)}}t[h]=u}}return t}[Symbol.iterator](){return null}}function df(t,e,i,r,n,o){return new pf(t,e,i,r,n,o)}class pf extends uf{constructor(t,e,i,n,o,a){super(i,n,o,a),r(this,"_numGeometries",void 0),r(this,"_geometryType",void 0),this._numGeometries=t,this._geometryType=e}geometryType(t){return this._geometryType}get numGeometries(){return this._numGeometries}containsSingleGeometryType(){return!0}}function ff(t,e,i,r,n){return new mf(t,e,i,r,n)}class mf extends uf{constructor(t,e,i,n,o){super(e,i,n,o),r(this,"_geometryTypes",void 0),this._geometryTypes=t}geometryType(t){return this._geometryTypes[t]}get numGeometries(){return this._geometryTypes.length}containsSingleGeometryType(){return!1}}function gf(t,e,i,r,n){const o=Gp(t,i);let a=null,s=null,l=null,c=null;if(tf(o,r,t,i)===Op.CONST){const n=Yp(t,i,o,!1);let h=null,u=null,d=null,p=null;for(let r=0;r<e-1;r++){const e=Gp(t,i);switch(e.physicalStreamType){case Rp.LENGTH:switch(e.logicalStreamType.lengthType){case Bp.GEOMETRIES:h=Xp(t,i,e);break;case Bp.PARTS:u=Xp(t,i,e);break;case Bp.RINGS:d=Xp(t,i,e);break;case Bp.TRIANGLES:p=Xp(t,i,e)}break;case Rp.OFFSET:switch(e.logicalStreamType.offsetType){case Lp.VERTEX:a=Wp(t,i,e,!1);break;case Lp.INDEX:c=Wp(t,i,e,!1)}break;case Rp.DATA:Fp.VERTEX===e.logicalStreamType.dictionaryType?s=Wp(t,i,e,!0):(l={numBits:e.numBits,coordinateShift:e.coordinateShift},s=Wp(t,i,e,!1))}}return null!==c?null!=h||null!=u?df(r,n,p,c,s,{geometryOffsets:h,partOffsets:u,ringOffsets:d}
1):df(r,n,p,c,s):null===l?function(t,e,i,r,n){return new cf(t,e,Np.VEC_2,i,r,n)}(r,n,{geometryOffsets:h,partOffsets:u,ringOffsets:d},a,s):function(t,e,i,r,n,o){return new cf(t,e,Np.MORTON,i,r,n,o)}(r,n,{geometryOffsets:h,partOffsets:u,ringOffsets:d},a,s,l)}const h=Wp(t,i,o,!1);let u=null,d=null,p=null,f=null;for(let y=0;y<e-1;y++){const e=Gp(t,i);switch(e.physicalStreamType){case Rp.LENGTH:switch(e.logicalStreamType.lengthType){case Bp.GEOMETRIES:u=Wp(t,i,e,!1);break;case Bp.PARTS:d=Wp(t,i,e,!1);break;case Bp.RINGS:p=Wp(t,i,e,!1);break;case Bp.TRIANGLES:f=Xp(t,i,e)}break;case Rp.OFFSET:switch(e.logicalStreamType.offsetType){case Lp.VERTEX:a=Wp(t,i,e,!1);break;case Lp.INDEX:c=Wp(t,i,e,!1)}break;case Rp.DATA:Fp.VERTEX===e.logicalStreamType.dictionaryType?s=Wp(t,i,e,!0):(l={numBits:e.numBits,coordinateShift:e.coordinateShift},s=Wp(t,i,e,!1))}}let m=null,g=null,_=null;return null!==u?(m=_f(h,u,2),null!==d&&null!==p?(g=yf(h,m,d,!1),_=function(t,e,i,r){const n=new Uint32Array(i[i.length-1]+1);let o=0;n[0]=o;let a=1,s=1,l=0;for(let c=0;c<t.length;c++){const h=t[c],u=e[c+1]-e[c];if(0!==h&&3!==h)for(let t=0;t<u;t++){const t=i[a]-i[a-1];a++;for(let e=0;e<t;e++)o=n[s++]=o+r[l++]}else for(let t=0;t<u;t++)n[s++]=++o,a++}return n}(h,m,g,p)):null!==d&&(g=function(t,e,i){const r=new Uint32Array(e[e.length-1]+1);let n=0;r[0]=n;let o=1,a=0;for(let s=0;s<t.length;s++){const l=t[s],c=e[s+1]-e[s];if(4===l||1===l)for(let t=0;t<c;t++)n=r[o++]=n+i[a++];else for(let t=0;t<c;t++)r[o++]=++n}return r}(h,m,d))):null!==d&&null!==p?(g=_f(h,d,1),_=yf(h,g,p,!0)):null!==d&&(g=_f(h,d,0)),null!==c&&null===g?ff(h,f,c,s):null!==c?ff(h,f,c,s,{geometryOffsets:m,partOffsets:g,ringOffsets:_}):null===l?function(t,e,i,r){return new hf(Np.VEC_2,t,e,i,r)}(h,{geometryOffsets:m,partOffsets:g,ringOffsets:_},a,s):function(t,e,i,r,n){return new hf(Np.MORTON,t,e,i,r,n)}(h,{geometryOffsets:m,partOffsets:g,ringOffsets:_},a,s,l)}function _f(t,e,i){const r=new Uint32Array(t.length+1);let n=0;r[0]=n;let o=0;for(let a=0;a<t.length;a++)n=r[a+1]=n+(t[a]>i?e[o++]:1);return r}function yf(t,e,i,r){const n=new Uint32Array(e[e.length-1]+1);let o=0;n[0]=o;let a=1,s=0;for(let l=0;l<t.length;l++){const c=t[l],h=e[l+1]-e[l];if(5===c||2===c||r&&(4===c||1===c))for(let t=0;t<h;t++)o=n[a++]=o+i[s++];else for(let t=0;t<h;t++)n[a++]=++o}return n}class vf extends Qd{constructor(t,e,i){super(t,e.getBuffer(),i),r(this,"dataVector",void 0),this.dataVector=e}getValueFromBuffer(t){return this.dataVector.get(t)}}class xf extends $d{getValueFromBuffer(t){return this.dataBuffer[t]}}class bf extends Qd{constructor(t,e,i){super(t,BigInt64Array.of(e),i)}getValueFromBuffer(t){return this.dataBuffer[0]}}function wf(t,e,i,r,n){const o=function(t,e,i,r){const n=new Uint8Array(e);let o=0;const a=r.get()+i;for(;o<e&&!(r.get()>=a);){const i=t[r.increment()];if(i<=127){const a=i+3,s=t[r.increment()],l=Math.min(o+a,e);n.fill(s,o,l),o=l}else{const a=256-i;for(let i=0;i<a&&o<e;i++)n[o++]=t[r.increment()]}}return r.set(a),n}(t,Math.ceil(e/8),i,r);return n?function(t,e,i){if(!i)return t;const r=i.size(),n=new Zp(t,e),o=new Zp(new Uint8Array(Math.ceil(r/8)),r);let a=0;for(let s=0;s<r;s++){const t=!!i.get(s)&&n.get(a++);o.set(s,t)}return o.getBuffer()}(o,e,n):o}const Tf=new TextDecoder;function Sf(t,e,i){return i-e>=12?Tf.decode(t.subarray(e,i)):function(t,e,i){let r="",n=e;for(;n<i;){const e=t[n];let o,a,s,l=null,c=e>239?4:e>223?3:e>191?2:1;if(n+c>i)break;1===c?e<128&&(l=e):2===c?(o=t[n+1],128==(192&o)&&(l=(31&e)<<6|63&o,l<=127&&(l=null))):3===c?(o=t[n+1],a=t[n+2],128==(192&o)&&128==(192&a)&&(l=(15&e)<<12|(63&o)<<6|63&a,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(o=t[n+1],a=t[n+2],s=t[n+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&e)<<18|(63&o)<<12|(63&a)<<6|63&s,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),r+=String.fromCharCode(l),n+=c}return r}(t,e,i)}class Pf extends Qd{constructor(t,e,i,n){super(t,i,n),r(this,"offsetBuffer",void 0),this.offsetBuffer=e}}class If extends Pf{constructor(t,e,i,r){super(t,e,i,null!==r&&void 0!==r?r:e.length-1)}getValueFromBuffer(t){return Sf(this.dataBuffer,this.offsetBuffer[t],this.offsetBuffer[t+1])}}class Mf extends Pf{constructor(t,e,i,n,o){super(t,i,n,null!==o&&void 0!==o?o:e.length),r(this,"indexBuffer",void 0),this.indexBuffer=e,this.indexBuffer=e}getValueFromBuffer(t){const e=this.indexBuffer[t];return Sf(this.dataBuffer,this.offsetBuffer[e],this.offsetBuffer[e+1])}}class Ef extends Pf{constructor(t,e,i,n,o,a,s){super(t,i,n,s),r(this,"indexBuffer",void 0),r(this,"symbolOffsetBuffer",void 0),r(this,"symbolTableBuffer",void 0),r(this,"symbolLengthBuffer",void 0),r(this,"decodedDictionary",void 0),this.indexBuffer=e,this.symbolOffsetBuffer=o,this.symbolTableBuffer=a}getValueFromBuffer(t){null==this.decodedDictionary&&(null==this.symbolLengthBuffer&&(this.symbolLengthBuffer=this.offsetToLengthBuffer(this.symbolOffsetBuffer)),this.decodedDictionary=function(t,e,
1i){const r=[],n=new Array(e.length).fill(0);for(let o=1;o<e.length;o++)n[o]=n[o-1]+e[o-1];for(let o=0;o<i.length;o++)if(255===i[o])r.push(i[++o]);else{const a=e[i[o]],s=n[i[o]];for(let e=0;e<a;e++)r.push(t[s+e])}return new Uint8Array(r)}(this.symbolTableBuffer,this.symbolLengthBuffer,this.dataBuffer));const e=this.indexBuffer[t];return Sf(this.decodedDictionary,this.offsetBuffer[e],this.offsetBuffer[e+1])}offsetToLengthBuffer(t){const e=new Uint32Array(t.length-1);let i=t[0];for(let r=1;r<t.length;r++){const n=t[r];e[r-1]=n-i,i=n}return e}}function Cf(t,e,i,r,n,o){return"scalarType"===i.type?function(t,e,i,r,n,o,a){let s=null;if(0===t)return null;if(o.nullable){const t=Gp(e,i),r=t.numValues,n=i.get(),o=wf(e,r,t.byteLength,i);i.set(n+t.byteLength),s=new Zp(o,t.numValues)}const l=null!==(a=s)&&void 0!==a?a:r;switch(n.physicalType){case 4:case 3:return function(t,e,i,r,n){const o=Gp(t,e),a=tf(o,n,t,e),s=3===r.physicalType;if(a===Op.FLAT){const r=Wp(t,e,o,s,0,Af(n)?n:void 0);return new tp(i.name,r,n)}if(a===Op.SEQUENCE){const r=Kp(t,e,o);return new rp(i.name,r[0],r[1],o.numRleValues)}const l=Yp(t,e,o,s);return new np(i.name,l,n)}(e,i,o,n,l);case 9:return function(t,e,i,r,n,o,a){let s=null,l=null,c=null,h=null,u=null,d=null,p=null,f=null;for(let m=0;m<r;m++){const t=Gp(e,i);switch(t.physicalStreamType){case Rp.PRESENT:{const r=wf(e,t.numValues,t.byteLength,i);d=new Zp(r,t.numValues);break}case Rp.OFFSET:l=Wp(e,i,t,!1,0,null!=n||null!=d?null!==n&&void 0!==n?n:d:void 0);break;case Rp.LENGTH:{const r=Xp(e,i,t);Bp.DICTIONARY===t.logicalStreamType.lengthType?s=r:Bp.SYMBOL===t.logicalStreamType.lengthType?h=r:p=r;break}case Rp.DATA:{const r=e.subarray(i.get(),i.get()+t.byteLength);i.add(t.byteLength);const n=t.logicalStreamType.dictionaryType;Fp.FSST===n?u=r:Fp.SINGLE===n||Fp.SHARED===n?c=r:Fp.NONE===n&&(f=r);break}}}return null!==(o=null!==(a=function(t,e,i,r,n,o,a){return e?new Ef(t,i,r,n,o,e,a):null}(t,u,l,s,c,h,null!==n&&void 0!==n?n:d))&&void 0!==a?a:function(t,e,i,r,n){return e?n?new Mf(t,i,r,e,n):new Mf(t,i,r,e):null}(t,c,l,s,null!==n&&void 0!==n?n:d))&&void 0!==o?o:function(t,e,i,r,n){if(!e||!i)return null;if(r)return n?new Mf(t,r,e,i,n):new Mf(t,r,e,i);if(n&&n.size()!==e.length-1){const r=new Int32Array(n.size());let o=0;for(let t=0;t<n.size();t++)r[t]=n.get(t)?o++:0;return new Mf(t,r,e,i,n)}return n?new If(t,e,i,n):new If(t,e,i)}(t,p,f,l,null!==n&&void 0!==n?n:d)}(o.name,e,i,o.nullable?t-1:t,s);case 0:return function(t,e,i,r,n){const o=Gp(t,e),a=o.numValues,s=e.get(),l=Af(n)?n:void 0,c=wf(t,a,o.byteLength,e,l);e.set(s+o.byteLength);const h=new Zp(c,a);return new vf(i.name,h,n)}(e,i,o,0,l);case 6:case 5:return function(t,e,i,r,n){const o=Gp(t,e),a=tf(o,r,t,e),s=5===n.physicalType;if(a===Op.FLAT){const n=Qp(t,e,o,s,Af(r)?r:void 0);return new ef(i.name,n,r)}if(a===Op.SEQUENCE){const r=Jp(t,e,o);return new rf(i.name,r[0],r[1],o.numRleValues)}const l=$p(t,e,o,s);return new bf(i.name,l,r)}(e,i,o,l,n);case 7:return function(t,e,i,r){const n=Gp(t,e),o=Af(r)?r:void 0,a=function(t,e,i,r){const n=e.get(),o=n+i*Float32Array.BYTES_PER_ELEMENT,a=new Uint8Array(t.subarray(n,o)).buffer,s=new Float32Array(a);return e.set(o),r?qp(s,r,0):s}(t,e,n.numValues,o);return new xf(i.name,a,r)}(e,i,o,l);case 8:return function(t,e,i,r){const n=Gp(t,e),o=Af(r)?r:void 0,a=function(t,e,i,r){const n=e.get(),o=n+i*Float64Array.BYTES_PER_ELEMENT,a=new Uint8Array(t.subarray(n,o)).buffer,s=new Float64Array(a);return e.set(o),r?qp(s,r,0):s}(t,e,n.numValues,o);return new ep(i.name,a,r)}(e,i,o,l);default:throw new Error("The specified data type for the field is currently not supported: ".concat(n))}}(r,t,e,n,i.scalarType,i):0===r?null:function(t,e,i,r){let n=null,o=null,a=null,s=null,l=!1;for(;!l;){const i=Gp(t,e);switch(i.physicalStreamType){case Rp.LENGTH:Bp.DICTIONARY===i.logicalStreamType.lengthType?n=Xp(t,e,i):a=Xp(t,e,i);break;case Rp.DATA:Fp.SINGLE===i.logicalStreamType.dictionaryType||Fp.SHARED===i.logicalStreamType.dictionaryType?(o=t.subarray(e.get(),e.get()+i.byteLength),l=!0):s=t.subarray(e.get(),e.get()+i.byteLength),e.add(i.byteLength)}}const c=i.complexType.children,h=[];let u=0;for(const d of c){const l=wp(t,e,1)[0];if(0===l)continue;const c=d.name?"".concat(i.name).concat(d.name):i.name;if(2!==l||"scalarField"!==d.type||9!==d.scalarField.physicalType)throw new Error("Currently only optional string fields are implemented for a struct.");const p=Gp(t,e),f=wf(t,p.numValues,p.byteLength,e),m=Gp(t,e),g=Wp(t,e,m,!1,0,m.decompressedCount!==r?new Zp(f,p.numValues):void 0);h[u++]=s?new Ef(c,g,n,o,a,s,new Zp(f,p.numValues)):new Mf(c,g,n,o,new Zp(f,p.numValues))}return h}(t,e,i,n)}function Af(t){return t instanceof Zp}function Df(t){switch(t){case 0:case 1:case 2:case 3:{const e={};e.nullable=!!(1&t),e.columnScope=0;const i={type:"logicalType",logicalType:0};return i.longID=!!(2&t),e.scalarType=i,e.type="scalarType",e}
1case 4:{const t={nullable:!1,columnScope:0},e={type:"physicalType",physicalType:0};return t.type="complexType",t.complexType=e,t}case 30:{const t={nullable:!1,columnScope:0},e={type:"physicalType",physicalType:1};return t.type="complexType",t.complexType=e,t}default:return function(t){let e;switch(t){case 10:case 11:e=0;break;case 12:case 13:e=1;break;case 14:case 15:e=2;break;case 16:case 17:e=3;break;case 18:case 19:e=4;break;case 20:case 21:e=5;break;case 22:case 23:e=6;break;case 24:case 25:e=7;break;case 26:case 27:e=8;break;case 28:case 29:e=9;break;default:return null}const i={};i.nullable=!!(1&t),i.columnScope=0;const r={type:"physicalType"};return r.physicalType=e,i.type="scalarType",i.scalarType=r,i}(t)}}function zf(t){return t>=10}function kf(t){return 30===t}function Rf(t){if("scalarType"===t.type){const e=t.scalarType;if("physicalType"===e.type)switch(e.physicalType){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:default:return!1;case 9:return!0}if("logicalType"===e.type)return!1}else if("complexType"===t.type){const e=t.complexType;if("physicalType"===e.type)switch(e.physicalType){case 0:case 1:return!0;default:return!1}}return console.warn("Unexpected column type in hasStreamCount",t),!1}function Ff(t){var e;return"complexType"===t.type&&"physicalType"===(null===(e=t.complexType)||void 0===e?void 0:e.type)&&0===t.complexType.physicalType}const Lf=new TextDecoder;function Bf(t,e){const i=wp(t,e,1)[0];if(0===i)return"";const r=e.get(),n=t.subarray(r,r+i);return e.add(i),Lf.decode(n)}function Of(t,e){const i=wp(t,e,1)[0]>>>0;if(i<10||i>30)throw new Error("Unsupported field type code ".concat(i,". Supported: 10-29(scalars), 30(STRUCT)"));const r=Df(i);if(zf(i)&&(r.name=Bf(t,e)),kf(i)){const i=wp(t,e,1)[0]>>>0;r.complexType.children=new Array(i);for(let n=0;n<i;n++)r.complexType.children[n]=Of(t,e)}return function(t){return{name:t.name,nullable:t.nullable,scalarField:t.scalarType,complexField:t.complexType,type:"scalarType"===t.type?"scalarField":"complexField"}}(r)}function Vf(t,e){const i=wp(t,e,1)[0]>>>0,r=Df(i);if(!r)throw new Error("Unsupported column type code ".concat(i,". Supported: 0-3(ID), 4(GEOMETRY), 10-29(scalars), 30(STRUCT)"));if(zf(i)?r.name=Bf(t,e):i>=0&&i<=3?r.name="id":4===i&&(r.name="geometry"),kf(i)){const i=wp(t,e,1)[0]>>>0,n=r.complexType;n.children=new Array(i);for(let r=0;r<i;r++)n.children[r]=Of(t,e)}return r}function jf(t,e){const i={featureTables:[]},r={};r.name=Bf(t,e);const n=wp(t,e,1)[0]>>>0,o=wp(t,e,1)[0]>>>0;r.columns=new Array(o);for(let a=0;a<o;a++)r.columns[a]=Vf(t,e);return i.featureTables.push(r),[i,n]}function Nf(t,e,i,r,n,o){let a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];const s=e.scalarType;if(!s||"logicalType"!==s.type||0!==s.logicalType)throw new Error("ID column must be a logical ID scalar type: ".concat(r));const l=s.longID?6:4,c=tf(n,o,t,i);if(4===l)switch(c){case Op.FLAT:{const e=Wp(t,i,n,!1,0,"number"!=typeof o?o:void 0);return new tp(r,e,o)}case Op.SEQUENCE:{const e=Kp(t,i,n);return new rp(r,e[0],e[1],n.numRleValues)}case Op.CONST:{const e=Yp(t,i,n,!1);return new np(r,e,o)}}switch(c){case Op.FLAT:{if(a){const e=function(t,e,i){const r=function(t,e,i){const r=new Float64Array(i);for(let n=0;n<i;n++)r[n]=Pp(t,e);return r}(t,e,i.numValues);return function(t,e){switch(e.logicalLevelTechnique1){case sp.DELTA:return e.logicalLevelTechnique2===sp.RLE&&(t=Dp(t,e.runs,e.numRleValues)),function(t){t[0]=Ep(t[0]);const e=t.length/4*4;let i=1;if(e>=4)for(;i<e-4;i+=4){const e=t[i+1],r=t[i+2],n=t[i+3];t[i]=Ep(t[i])+t[i-1],t[i+1]=Ep(e)+t[i],t[i+2]=Ep(r)+t[i+1],t[i+3]=Ep(n)+t[i+2]}for(;i!==t.length;++i)t[i]=Ep(t[i])+t[i-1]}(t),t;case sp.RLE:return function(t,e){return Dp(t,e.runs,e.numRleValues)}(t,e);case sp.NONE:return t;default:throw new Error("The specified Logical level technique is not supported: ".concat(e.logicalLevelTechnique1))}}(r,i)}(t,i,n);return new ep(r,e,o)}const e=Qp(t,i,n,!1,"number"!=typeof o?o:void 0);return new ef(r,e,o)}case Op.SEQUENCE:{const e=Jp(t,i,n);return new rf(r,e[0],e[1],n.numRleValues)}case Op.CONST:{const e=$p(t,i,n,!1);return new bf(r,e,o)}}throw new Error("Vector type not supported for id column.")}class Uf{constructor(t,e){var i;switch(this._featureData=t,this.properties=this._featureData.properties||{},null===(i=this._featureData.geometry)||void 0===i?void 0:i.type){case Vp.POINT:case Vp.MULTIPOINT:this.t
1ype=1;break;case Vp.LINESTRING:case Vp.MULTILINESTRING:this.type=2;break;case Vp.POLYGON:case Vp.MULTIPOLYGON:this.type=3;break;default:this.type=0}this.extent=e,this.id=Number(this._featureData.id)}loadGeometry(){const t=[];for(const e of this._featureData.geometry.coordinates){const r=[];for(const t of e)r.push(new i(t.x,t.y));t.push(r)}return t}}class Gf{constructor(t){this.features=[],this.featureTable=t,this.name=t.name,this.extent=t.extent,this.version=2,this.features=t.getFeatures(),this.length=this.features.length}feature(t){return new Uf(this.features[t],this.extent)}}class Zf{constructor(t){this.layers={};const e=function(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=new ap(0),n=[];for(;r.get()<t.length;){const e=wp(t,r,1)[0]>>>0,l=r.get()+e;if(l>t.length)throw new Error("Block overruns tile: ".concat(l," > ").concat(t.length));if(1!=wp(t,r,1)[0]>>>0){r.set(l);continue}const c=jf(t,r),h=c[1],u=c[0].featureTables[0];let d=null,p=null;const f=[];let m=0;for(const n of u.columns){var o;const e=n.name;if("scalarType"===(s=n).type&&"logicalType"===(null===(o=s.scalarType)||void 0===o?void 0:o.type)&&0===s.scalarType.logicalType){var a;let o=null;if(n.nullable){const e=Gp(t,r),i=r.get(),n=wf(t,e.numValues,e.byteLength,r);r.set(i+e.byteLength),o=new Zp(n,e.numValues)}const s=Gp(t,r);m=o?o.size():s.decompressedCount,d=Nf(t,n,r,e,s,null!==(a=o)&&void 0!==a?a:m,i)}else if(Ff(n)){const e=wp(t,r,1)[0];if(0===m){const e=r.get();m=Gp(t,r).decompressedCount,r.set(e)}p=gf(t,e,r,m)}else{const e=Rf(n)?wp(t,r,1)[0]:1;if(0===e)continue;const i=Cf(t,r,n,e,m);if(i)if(Array.isArray(i))for(const t of i)f.push(t);else f.push(i)}}const g=new op(u.name,p,d,f,h);n.push(g),r.set(l)}var s;return n}(new Uint8Array(t));this.layers=e.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e.name]:new Gf(e)})),{})}}class qf{constructor(t,e){this.feature=t,this.type=t.type,this.properties=t.tags?t.tags:{},this.extent=e,"id"in t&&("string"==typeof t.id?this.id=parseInt(t.id,10):"number"!=typeof t.id||isNaN(t.id)||(this.id=t.id))}loadGeometry(){const t=[],e=1===this.feature.type?[this.feature.geometry]:this.feature.geometry;for(const r of e){const e=[];for(const t of r)e.push(new i(t[0],t[1]));t.push(e)}return t}}const Wf="_geojsonTileLayer";function Xf(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);const r={jsonPrefix:i,keys:[],values:[],keycache:{},valuecache:{}};for(let a=0;a<t.length;a++)r.feature=t.feature(a),e.writeMessage(2,Hf,r);const n=r.keys;for(const a of n)e.writeStringField(3,a);const o=r.values;for(const a of o)e.writeMessage(4,$f,a)}function Hf(t,e){if(!t.feature)return;const i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,Yf,t),e.writeVarintField(3,i.type),e.writeMessage(4,Qf,i)}function Yf(t,e){for(const r in null===(i=t.feature)||void 0===i?void 0:i.properties){var i;let n=t.feature.properties[r],o=t.keycache[r];if(null==n)continue;void 0===o&&(t.keys.push(r),o=t.keys.length-1,t.keycache[r]=o),e.writeVarint(o),"string"!=typeof n&&"boolean"!=typeof n&&"number"!=typeof n&&(n=t.jsonPrefix+JSON.stringify(n));const a=typeof n+":"+n;let s=t.valuecache[a];void 0===s&&(t.values.push(n),s=t.values.length-1,t.valuecache[a]=s),e.writeVarint(s)}}function Kf(t,e){return(e<<3)+(7&t)}function Jf(t){return t<<1^t>>31}function Qf(t,e){const i=t.loadGeometry(),r=t.type;let n=0,o=0;for(const a of i){let i=1;1===r&&(i=a.length),e.writeVarint(Kf(1,i));const s=3===r?a.length-1:a.length;for(let t=0;t<s;t++){1===t&&1!==r&&e.writeVarint(Kf(2,s-1));const i=a[t].x-n,l=a[t].y-o;e.writeVarint(Jf(i)),e.writeVarint(Jf(l)),n+=i,o+=l}3===t.type&&e.writeVarint(Kf(7,1))}}function $f(t,e){const i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}class tm{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new po(D,16,0),this.grid3D=new po(D,16,0),this.featureIndexArray=new Ga,this.promoteId=e}insert(t,e,i,r,n,o){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,n);const s=o?this.grid3D:this.grid;for(let l=0;l<e.length;l++){const t=e[l],i=[1/0,1/0,-1/0,-1/0];for(let e=0;e<t.length;e++){const r=t[e];i[0]=Math.min(i[0],r.x),i[1]=Math.min(i[1],r.y),i[2]=Math.max(i[2],r.x),i[3]=Math.max(i[3],r.y)}i[0]<D&&i[1]<D&&i[2]>=0&&i[3]>=0&&s.insert(a,i[0],i[1],i[2],i[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers="mlt"!==this.encoding?new Vc(new Fu(this.rawTileData)).layers:new Zf(this.rawTileData).layers,this.sourceLayerCoder=new Kd(this.vtLayers?Object.keys(this.vtLayers).sort():[Wf])),this.vtLayers}query(t,e,r,n){this.loadVTLayers();const o=t.params,a=D/t.tileSize/t.scale,s=mn(o.filter,o.globalState),l=t.queryGeometry,c=t.queryPadding*a,h=Yd.fromPoints(l),u=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),d=Yd.fromPoints(t.cameraQueryGeometry).expandBy(c),p=this.grid3D.query(d.minX,d.minY,d.maxX,d.maxY,((e,r,n,o)=>function(t,e,r,n,o){for(const i of t)if(e<=i.x&&r<=i.y&&n>=i.x&&o>=i.y)return!0;const a=[new i(e,r),new i(e,o),new i(n,o),new i(n,r)];if(t.length>2)for(const i of a)if(il(t,i))return!0;for(let i=0;i<t.length-1;i++)if(rl(t[i],t[i+1],a))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,n+c,o+c)));for(const i of p)u.push(i);u.sort(im);const f={};let m;
1for(let i=0;i<u.length;i++){const c=u[i];if(c===m)continue;m=c;const h=this.featureIndexArray.get(c);let d=null;this.loadMatchingFeature(f,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,s,o.layers,o.availableImages,e,r,n,((e,i,r)=>(d||(d=Us(e)),i.queryIntersectsFeature({queryGeometry:l,feature:e,featureState:r,geometry:d,zoom:this.z,transform:t.transform,pixelsToTileUnits:a,pixelPosMatrix:t.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:t.getElevation}))))}return f}loadMatchingFeature(t,e,i,r,n,o,a,s,l,c,h){const u=this.bucketLayerIDs[e];if(o&&!u.some((t=>o.has(t))))return;const d=this.sourceLayerCoder.decode(i),p=this.vtLayers[d].feature(r);if(n.needGeometry){const t=Gs(p,!0);if(!n.filter(new Lo(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!n.filter(new Lo(this.tileID.overscaledZ),p))return;const f=this.getId(p,d);for(let m=0;m<u.length;m++){const e=u[m];if(o&&!o.has(e))continue;const i=s[e];if(!i)continue;let n={};f&&c&&(n=c.getState(i.sourceLayer||Wf,f));const d=j({},l[e]);d.paint=em(d.paint,i.paint,p,n,a),d.layout=em(d.layout,i.layout,p,n,a);const g=!h||h(p,i,n);if(!g)continue;const _=new Jd(p,this.z,this.x,this.y,f);_.layer=d;let y=t[e];void 0===y&&(y=t[e]=[]),y.push({featureIndex:r,feature:_,intersectionZ:g})}}lookupSymbolFeatures(t,e,i,r,n,o,a,s){const l={};this.loadVTLayers();const c=mn(n.filterSpec,n.globalState);for(const h of t)this.loadMatchingFeature(l,i,r,h,c,o,a,s,e);return l}hasLayer(t){for(const e of this.bucketLayerIDs)for(const i of e)if(t===i)return!0;return!1}getId(t,e){var i;let r=t.id;return this.promoteId&&(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]],"boolean"==typeof r&&(r=Number(r)),void 0===r&&(null===(i=t.properties)||void 0===i?void 0:i.cluster)&&this.promoteId&&(r=Number(t.properties.cluster_id))),r}}function em(t,e,i,r,n){return U(t,((t,o)=>{const a=e instanceof Wo?e.get(o):null;return a&&a.evaluate?a.evaluate(i,r,n):a}))}function im(t,e){return e-t}function rm(t,e,r,n,o){const a=[];for(let s=0;s<t.length;s++){const l=t[s];let c;for(let t=0;t<l.length-1;t++){let s=l[t],h=l[t+1];s.x<e&&h.x<e||(s.x<e?s=new i(e,s.y+(e-s.x)/(h.x-s.x)*(h.y-s.y))._round():h.x<e&&(h=new i(e,s.y+(e-s.x)/(h.x-s.x)*(h.y-s.y))._round()),s.y<r&&h.y<r||(s.y<r?s=new i(s.x+(r-s.y)/(h.y-s.y)*(h.x-s.x),r)._round():h.y<r&&(h=new i(s.x+(r-s.y)/(h.y-s.y)*(h.x-s.x),r)._round()),s.x>=n&&h.x>=n||(s.x>=n?s=new i(n,s.y+(n-s.x)/(h.x-s.x)*(h.y-s.y))._round():h.x>=n&&(h=new i(n,s.y+(n-s.x)/(h.x-s.x)*(h.y-s.y))._round()),s.y>=o&&h.y>=o||(s.y>=o?s=new i(s.x+(o-s.y)/(h.y-s.y)*(h.x-s.x),o)._round():h.y>=o&&(h=new i(s.x+(o-s.y)/(h.y-s.y)*(h.x-s.x),o)._round()),c&&s.equals(c[c.length-1])||(c=[s],a.push(c)),c.push(h)))))}}return a}function nm(t,e,i,r,n){switch(e){case 1:return function(t,e,i,r){const n=[];for(const o of t)for(const t of o){const o=0===r?t.x:t.y;o>=e&&o<=i&&n.push([t])}return n}(t,i,r,n);case 2:return am(t,i,r,n,!1);case 3:return am(t,i,r,n,!0)}return[]}function om(t,e,r,n,o){const a=0===n?sm:lm;let s=[];const l=[];for(let i=0;i<t.length-1;i++){const c=t[i],h=t[i+1],u=0===n?c.x:c.y,d=0===n?h.x:h.y;let p=!1;u<e?d>e&&s.push(a(c,h,e)):u>r?d<r&&s.push(a(c,h,r)):s.push(c),d<e&&u>=e&&(s.push(a(c,h,e)),p=!0),d>r&&u<=r&&(s.push(a(c,h,r)),p=!0),!o&&p&&(l.push(s),s=[])}const c=t.length-1,h=0===n?t[c].x:t[c].y;return h>=e&&h<=r&&s.push(t[c]),o&&s.length>0&&!s[0].equals(s[s.length-1])&&s.push(new i(s[0].x,s[0].y)),s.length>0&&l.push(s),l}function am(t,e,i,r,n){const o=[];for(const a of t){const t=om(a,e,i,r,n);t.length>0&&o.push(...t)}return o}function sm(t,e,r){return new i(r,t.y+(r-t.x)/(e.x-t.x)*(e.y-t.y))}function lm(t,e,r){return new i(t.x+(r-t.y)/(e.y-t.y)*(e.x-t.x),r)}mo("FeatureIndex",tm,{omit:["rawTileData","sourceLayerCoder"]});class cm extends i{constructor(t,e,i,r){super(t,e),this.angle=i,void 0!==r&&(this.segment=r)}clone(){return new cm(this.x,this.y,this.angle,this.segment)}}function hm(t,e,i,r,n){if(void 0===e.segment||0===i)return!0;let o=e,a=e.segment+1,s=0;for(;s>-i/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;const l=[];let c=0;for(;s<i/2;){const e=t[a],i=t[a+1];if(!i)return!1;let o=t[a-1].angleTo(e)-e.angleTo(i);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:o}),c+=o;s-l[0].distance>r;)c-=l.shift().angleDelta;if(c>n)return!1;a++,s+=e.dist(i)}return!0}function um(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function dm(t,e,i){return t?.6*e*i:0}function pm(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function fm(t,e,i,r,n,o){const a=dm(i,n,o),s=pm(i,r)*o;let l=0;const c=um(t)/2;for(let h=0;h<t.length-1;h++){const i=t[h],r=t[h+1],n=i.dist(r);if(l+n>
vendor: 6,059 bytes, line 1
1c){const o=(c-l)/n,u=_i.number(i.x,r.x,o),d=_i.number(i.y,r.y,o),p=new cm(u,d,r.angleTo(i),h);return p._round(),!a||hm(t,p,s,a,e)?p:void 0}l+=n}}function mm(t,e,i,r,n,o,a,s,l){const c=dm(r,o,a),h=pm(r,n),u=h*a,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-u<e/4&&(e=u+e/4),gm(t,d?e/2*s%e:(h/2+2*o)*a*s%e,e,c,i,u,d,!1,l)}function gm(t,e,i,r,n,o,a,s,l){const c=o/2,h=um(t);let u=0,d=e-i,p=[];for(let f=0;f<t.length-1;f++){const e=t[f],a=t[f+1],s=e.dist(a),m=a.angleTo(e);for(;d+i<u+s;){d+=i;const g=(d-u)/s,_=_i.number(e.x,a.x,g),y=_i.number(e.y,a.y,g);if(_>=0&&_<l&&y>=0&&y<l&&d-c>=0&&d+c<=h){const e=new cm(_,y,m,f);e._round(),r&&!hm(t,e,o,r,n)||p.push(e)}}u+=s}return s||p.length||a||(p=gm(t,u/2,i,r,n,o,a,!0,l)),p}function _m(t,e,r,n){const o=[],a=t.image,s=a.pixelRatio,l=a.paddedRect.w-2,c=a.paddedRect.h-2;let h={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom};const u=a.stretchX||[[0,l]],d=a.stretchY||[[0,c]],p=(t,e)=>t+e[1]-e[0],f=u.reduce(p,0),m=d.reduce(p,0),g=l-f,_=c-m;let y=0,v=f,x=0,b=m,w=0,T=g,S=0,P=_;if(a.content&&n){const e=a.content,i=e[2]-e[0],r=e[3]-e[1];(a.textFitWidth||a.textFitHeight)&&(h=cd(t)),y=ym(u,0,e[0]),x=ym(d,0,e[1]),v=ym(u,e[0],e[2]),b=ym(d,e[1],e[3]),w=e[0]-y,S=e[1]-x,T=i-v,P=r-b}const I=h.x1,M=h.y1,E=h.x2-I,C=h.y2-M,A=(t,n,o,l)=>{const c=xm(t.stretch-y,v,E,I),h=bm(t.fixed-w,T,t.stretch,f),u=xm(n.stretch-x,b,C,M),d=bm(n.fixed-S,P,n.stretch,m),p=xm(o.stretch-y,v,E,I),g=bm(o.fixed-w,T,o.stretch,f),_=xm(l.stretch-x,b,C,M),A=bm(l.fixed-S,P,l.stretch,m),D=new i(c,u),z=new i(p,u),k=new i(p,_),R=new i(c,_),F=new i(h/s,d/s),L=new i(g/s,A/s),B=e*Math.PI/180;if(B){const t=Math.sin(B),e=Math.cos(B),i=[e,-t,t,e];D._matMult(i),z._matMult(i),R._matMult(i),k._matMult(i)}const O=t.stretch+t.fixed,V=n.stretch+n.fixed;return{tl:D,tr:z,bl:R,br:k,tex:{x:a.paddedRect.x+1+O,y:a.paddedRect.y+1+V,w:o.stretch+o.fixed-O,h:l.stretch+l.fixed-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:F,pixelOffsetBR:L,minFontScaleX:T/s/E,minFontScaleY:P/s/C,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){const t=vm(u,g,f),e=vm(d,_,m);for(let i=0;i<t.length-1;i++){const r=t[i],n=t[i+1];for(let t=0;t<e.length-1;t++)o.push(A(r,e[t],n,e[t+1]))}}else o.push(A({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return o}function ym(t,e,i){let r=0;for(const n of t)r+=Math.max(e,Math.min(i,n[1]))-Math.max(e,Math.min(i,n[0]));return r}function vm(t,e,i){const r=[{fixed:-1,stretch:0}];for(const[n,o]of t){const t=r[r.length-1];r.push({fixed:n-t.stretch,stretch:t.stretch}),r.push({fixed:n-t.stretch,stretch:t.stretch+(o-n)})}return r.push({fixed:e+1,stretch:i}),r}function xm(t,e,i,r){return t/e*i+r}function bm(t,e,i,r){return t-e*i/r}mo("Anchor",cm);class wm{constructor(t,e,r,n,o,a,s,l,c,h){var u;if(this.boxStartIndex=t.length,c){let t=a.top,e=a.bottom;const i=a.collisionPadding;i&&(t-=i[1],e+=i[3]);let r=e-t;r>0&&(r=Math.max(10,r),this.circleDiameter=r)}else{const c=(null===(u=a.image)||void 0===u?void 0:u.content)&&(a.image.textFitWidth||a.image.textFitHeight)?cd(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*s-l[0],c.y2=c.y2*s+l[2],c.x1=c.x1*s-l[3],c.x2=c.x2*s+l[1];const d=a.collisionPadding;if(d&&(c.x1-=d[0]*s,c.y1-=d[1]*s,c.x2+=d[2]*s,c.y2+=d[3]*s),h){const t=new i(c.x1,c.y1),e=new i(c.x2,c.y1),r=new i(c.x1,c.y2),n=new i(c.x2,c.y2),o=h*Math.PI/180;t._rotate(o),e._rotate(o),r._rotate(o),n._rotate(o),c.x1=Math.min(t.x,e.x,r.x,n.x),c.x2=Math.max(t.x,e.x,r.x,n.x),c.y1=Math.min(t.y,e.y,r.y,n.y),c.y2=Math.max(t.y,e.y,r.y,n.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,r,n,o)}this.boxEndIndex=t.length}}class Tm{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e)=>t<e?-1:t>e?1:0;if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let i=(this.length>>1)-1;i>=0;i--)this._down(i)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const n=t-1>>1,o=e[n];if(i(r,o)>=0)break;e[t]=o,t=n}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,n=e[t];for(;t<r;){let r=1+(t<<1);const o=r+1;if(o<this.length&&i(e[o],e[r])<0&&(r=o),i(e[r],n)>=0)break;e[t]=e[r],t=r}e[t]=n}}function Sm(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=Yd.fromPoints(t[0]),o=Math.min(n.width(),n.height());let a=o/2;const s=new Tm([],Pm),{minX:l,minY:c,maxX:h,maxY:u}=n;if(0===o)return new i(l,c);for(let i=l;i<h;i+=o)for(let e=c;e<u;e+=o)s.push(new Im(i+a,e+a,a,t));let d=function(t){let e=0,i=0,r=0;const n=t[0];for(let o=0,a=n.length,s=a-1;o<a;s=o++){const t=n[o],a=n[s],l=t.x*a.y-a.x*t.y;i+=(t.x+a.x)*l,r+=(t.y+a.y)*l,e+=3*l}return new Im(i/e,r/e,0,t)}(t),p=s.length;for(;s.length;){const i=s.pop();(i.d>d.d||!d.d)&&(d=i,r&&console.log("found best %d after %d probes",Math.round(1e4*i.d)/1e4,p)),i.max-d.d<=e||(a=i.h/2,s.push(new Im(i.p.x-a,i.p.y-a,a,t)),s.push(new Im(i.p.x+a,i.p.y-a,a,t)),s.push(new Im(i.p.x-a,i.p.y+a,a,t)),s.push(new Im(i.p.x+a,i.p.y+a,a,t)),p+=4)}return r&&(console.log("num probes: ".concat(p)),console.log("best distance: ".concat(d.d))),d.p}function Pm(t,e){return e.max-t.max}function Im(t,e,r,n){this.p=new i(t,e),this.h=r,this.d=function(t,e){let i=!1,r=1/0;for(let n=0;n<e.length;n++){const o=e[n];for(let e=0,n=o.length,a=n-1;e<n;a=e++){const n=o[e],s=o[a];n.y>t.y!=s.y>t.y&&t.x<(s.x-n.x)*(t.y-n.y)/(s.y-n.y)+n.x&&(i=!i),r=Math.min(r,tl(t,n,s))}}return(i?1:-1)*Math.sqrt(r)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var Mm;t.aM=void 0,(Mm=t.aM||(t.aM={}))[Mm.center=1]="center",Mm[Mm.left=2]="left",Mm[Mm.right=3]="right",Mm[Mm.top=4]="top",Mm[Mm.bottom=5]="bottom",Mm[Mm["top-left"]=6]="top-left",Mm[Mm["top-right"]=7]="top-right",Mm[Mm["bottom-left"]=8]="bottom-left",Mm[Mm["bottom-right"]=9]="bottom-right";const Em=Number.POSITIVE_INFINITY;
vendor: 4,520 bytes, line 1
1function Cm(t,e){return e[1]!==Em?function(t,e,i){let r=0,n=0;switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":n=i-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-i}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}return[r,n]}(t,e[0],e[1]):function(t,e){let i=0,r=0;e<0&&(e=0);const n=e/Math.SQRT2;switch(t){case"top-right":case"top-left":r=n-7;break;case"bottom-right":case"bottom-left":r=7-n;break;case"bottom":r=7-e;break;case"top":r=e-7}switch(t){case"top-right":case"bottom-right":i=-n;break;case"top-left":case"bottom-left":i=n;break;case"left":i=e;break;case"right":i=-e}return[i,r]}(t,e[0])}function Am(t,e,i){var r;const n=t.layout,o=null===(r=n.get("text-variable-anchor-offset"))||void 0===r?void 0:r.evaluate(e,{},i);if(o){const t=o.values,e=[];for(let i=0;i<t.length;i+=2){const r=e[i]=t[i],n=t[i+1].map((t=>t*wu));r.startsWith("top")?n[1]-=7:r.startsWith("bottom")&&(n[1]+=7),e[i+1]=n}return new Ve(e)}const a=n.get("text-variable-anchor");if(a){let r;r=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[n.get("text-radial-offset").evaluate(e,{},i)*wu,Em]:n.get("text-offset").evaluate(e,{},i).map((t=>t*wu));const o=[];for(const t of a)o.push(t,Cm(t,r));return new Ve(o)}return null}function Dm(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function zm(e,i,r,n,o,a,s,l,c,h,u,d){let p=a.textMaxSize.evaluate(i,{});void 0===p&&(p=s);const f=e.layers[0].layout,m=f.get("icon-offset").evaluate(i,{},u),g=Rm(r.horizontal),_=s/24,y=e.tilePixelRatio*_,v=e.tilePixelRatio*p/24,x=e.tilePixelRatio*l,b=e.tilePixelRatio*f.get("symbol-spacing"),w=f.get("text-padding")*e.tilePixelRatio,T=function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const n=t.get("icon-padding").evaluate(e,{},i),o=n&&n.values;return[o[0]*r,o[1]*r,o[2]*r,o[3]*r]}(f,i,u,e.tilePixelRatio),S=f.get("text-max-angle")/180*Math.PI,P="viewport"!==f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),I="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),M=f.get("symbol-placement"),E=b/2,C=f.get("icon-text-fit");let A;n&&"none"!==C&&(e.allowVerticalPlacement&&r.vertical&&(A=hd(n,r.vertical,C,f.get("icon-text-fit-padding"),m,_)),g&&(n=hd(n,g,C,f.get("icon-text-fit-padding"),m,_)));const z=u?d.line.getGranularityForZoomLevel(u.z):1,k=(l,d)=>{d.x<0||d.x>=D||d.y<0||d.y>=D||function(e,i,r,n,o,a,s,l,c,h,u,d,p,f,m,g,_,y,v,x,b,w,T,S,P){const I=e.addToLineVertexArray(i,r);let M,E,C,A,D=0,z=0,k=0,R=0,F=-1,L=-1;const B={};let O=ys("");if(e.allowVerticalPlacement&&n.vertical){const t=l.layout.get("text-rotate").evaluate(b,{},S)+90;C=new wm(c,i,h,u,d,n.vertical,p,f,m,t),s&&(A=new wm(c,i,h,u,d,s,_,y,m,t))}if(o){const r=l.layout.get("icon-rotate").evaluate(b,{}),n="none"!==l.layout.get("icon-text-fit"),a=_m(o,r,T,n),p=s?_m(s,r,T,n):void 0;E=new wm(c,i,h,u,d,o,_,y,!1,r),D=4*a.length;const f=e.iconSizeData;let m=null;"source"===f.kind?(m=[ud*l.layout.get("icon-size").evaluate(b,{})],m[0]>dd&&W("".concat(e.layerIds[0],': Value for "icon-size" is >= 255. Reduce your "icon-size".'))):"composite"===f.kind&&(m=[ud*w.compositeIconSizes[0].evaluate(b,{},S),ud*w.compositeIconSizes[1].evaluate(b,{},S)],(m[0]>dd||m[1]>dd)&&W("".concat(e.layerIds[0],': Value for "icon-size" is >= 255. Reduce your "icon-size".'))),e.addSymbols(e.icon,a,m,x,v,b,t.aw.none,i,I.lineStartIndex,I.lineLength,-1,S),F=e.icon.placedSymbolArray.length-1,p&&(z=4*p.length,e.addSymbols(e.icon,p,m,x,v,b,t.aw.vertical,i,I.lineStartIndex,I.lineLength,-1,S),L=e.icon.placedSymbolArray.length-1)}const V=Object.keys(n.horizontal);for(const W of V){const r=n.horizontal[W];if(!M){O=ys(r.text);const t=l.layout.get("text-rotate").evaluate(b,{},S);M=new wm(c,i,h,u,d,r,p,f,m,t)}const o=1===r.positionedLines.length;if(k+=km(e,i,r,a,l,m,b,g,I,n.vertical?t.aw.horizontal:t.aw.horizontalOnly,o?V:[W],B,F,w,S),o)break}n.vertical&&(R+=km(e,i,n.vertical,a,l,m,b,g,I,t.aw.vertical,["vertical"],B,L,w,S));const j=M?M.boxStartIndex:e.collisionBoxArray.length,N=M?M.boxEndIndex:e.collisionBoxArray.length,U=C?C.boxStartIndex:e.collisionBoxArray.length,G=C?C.boxEndIndex:e.collisionBoxArray.length,Z=E?E.boxStartIndex:e.collisionBoxArray.length,q=E?E.boxEndIndex:e.collisionBoxArray.length,X=A?A.boxStartIndex:e.collisionBoxArray.length,H=A?A.boxEndIndex:e.collisionBoxArray.length;let Y=-1;const K=(t,e)=>
1t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;Y=K(M,Y),Y=K(C,Y),Y=K(E,Y),Y=K(A,Y);const J=Y>-1?1:0;J&&(Y*=P/wu),e.glyphOffsetArray.length>=bd.MAX_GLYPHS&&W("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);const Q=Am(l,b,S),[$,tt]=function(e,i){const r=e.length,n=null==i?void 0:i.values;if((null==n?void 0:n.length)>0)for(let o=0;o<n.length;o+=2){const i=n[o+1];e.emplaceBack(t.aM[n[o]],i[0],i[1])}return[r,e.length]}(e.textAnchorOffsets,Q);e.symbolInstances.emplaceBack(i.x,i.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,F,L,O,j,N,U,G,Z,q,X,H,h,k,R,D,z,J,0,p,Y,$,tt)}(e,d,l,r,n,o,A,e.layers[0],e.collisionBoxArray,i.index,i.sourceLayerIndex,e.index,y,[w,w,w,w],P,c,x,T,I,m,i,a,h,u,s)};if("line"===M)for(const t of rm(i.geometry,0,0,D,D)){const i=bc(t,z),o=mm(i,b,S,r.vertical||g,n,24,v,e.overscaling,D);for(const t of o)g&&Fm(e,g.text,E,t)||k(i,t)}else if("line-center"===M){for(const t of i.geometry)if(t.length>1){const e=bc(t,z),i=fm(e,S,r.vertical||g,n,24,v);i&&k(e,i)}}else if("Polygon"===i.type)for(const t of ir(i.geometry,0)){const e=Sm(t,16);k(bc(t[0],z,!0),new cm(e.x,e.y,0))}else if("LineString"===i.type)for(const t of i.geometry){const e=bc(t,z);k(e,new cm(e[0].x,e[0].y,0))}else if("Point"===i.type)for(const t of i.geometry)for(const e of t)k([e],new cm(e.x,e.y,0))}function km(t,e,r,n,o,a,s,l,c,h,u,d,p,f,m){const g=function(t,e,r,n,o,a,s,l){const c=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,h=[];for(const u of e.positionedLines)for(const t of u.positionedGlyphs){if(!t.rect)continue;const n=t.rect||{};let a=4,d=!0,p=1,f=0;const m=(o||l)&&t.vertical,g=t.metrics.advance*t.scale/2;if(l&&e.verticalizable&&(f=u.lineOffset/2-(t.imageName?-(wu-t.metrics.width*t.scale)/2:(t.scale-1)*wu)),t.imageName){const e=s[t.imageName];d=e.sdf,p=e.pixelRatio,a=1/p}const _=o?[t.x+g,t.y]:[0,0];let y=o?[0,0]:[t.x+g+r[0],t.y+r[1]-f],v=[0,0];m&&(v=y,y=[0,0]);const x=t.metrics.isDoubleResolution?2:1,b=(t.metrics.left-a)*t.scale-g+y[0],w=(-t.metrics.top-a)*t.scale+y[1],T=b+n.w/x*t.scale/p,S=w+n.h/x*t.scale/p,P=new i(b,w),I=new i(T,w),M=new i(b,S),E=new i(T,S);if(m){const e=new i(-g,g- -17),r=-Math.PI/2,n=12-g,o=new i(22-n,-(t.imageName?n:0)),a=new i(...v);P._rotateAround(r,e)._add(o)._add(a),I._rotateAround(r,e)._add(o)._add(a),M._rotateAround(r,e)._add(o)._add(a),E._rotateAround(r,e)._add(o)._add(a)}if(c){const t=Math.sin(c),e=Math.cos(c),i=[e,-t,t,e];P._matMult(i),I._matMult(i),M._matMult(i),E._matMult(i)}const C=new i(0,0),A=new i(0,0);h.push({tl:P,tr:I,bl:M,br:E,tex:n,writingMode:e.writingMode,glyphOffset:_,sectionIndex:t.sectionIndex,isSDF:d,pixelOffsetTL:C,pixelOffsetBR:A,minFontScaleX:0,minFontScaleY:0})}return h}(0,r,l,o,a,s,n,t.allowVerticalPlacement),_=t.textSizeData;let y=null;"source"===_.kind?(y=[ud*o.layout.get("text-size").evaluate(s,{})],y[0]>dd&&W("".concat(t.layerIds[0],': Value for "text-size" is >= 255. Reduce your "text-size".'))):"composite"===_.kind&&(y=[ud*f.compositeTextSizes[0].evaluate(s,{},m),ud*f.compositeTextSizes[1].evaluate(s,{},m)],(y[0]>dd||y[1]>dd)&&W("".concat(t.layerIds[0],': Value for "text-size" is >= 255. Reduce your "text-size".'))),t.addSymbols(t.text,g,y,l,a,s,h,e,c.lineStartIndex,c.lineLength,p,m);for(const i of u)d[i]=t.text.placedSymbolArray.length-1;return 4*g.length}function Rm(t){for(const e in t)return t[e];return null}function Fm(t,e,i,r){const n=t.compareText;if(e in n){const t=n[e];for(let e=t.length-1;e>=0;e--)if(r.dist(t[e])<i)return!0}else n[e]=[];return n[e].push(r),!1}var Lm;t.cF=void 0,(Lm=t.cF||(t.cF={})).create="create",Lm.load="load",Lm.fullLoad="fullLoad";let Bm=null,Om=[];const Vm=1e3/60,jm="loadTime",Nm="fullLoadTime",Um={mark(t){performance.mark(t)},recordStartOfFrameAt(t){null!=Bm&&Om.push(t-Bm),Bm=t},resetRuntimeMetrics(){Bm=null,Om=[]},clearInitializationMetrics(){performance.clearMeasures(jm),performance.clearMeasures(Nm);for(const e in t.cF)performance.clearMarks(t.cF[e])},remove(){this.resetRuntimeMetrics(),this.clearInitializationMetrics()},getPerformanceMetrics(){performance.measure(jm,t.cF.create,t.cF.load),performance.measure(Nm,t.cF.create,t.cF.fullLoad);const e=performance.getEntriesByName(jm)[0].duration,i=performance.getEntriesByName(Nm)[0].duration,r=Om.length;return{loadTimeMs:e,fullLoadTimeMs:i,averageFramesPerSecond:1/(Om.reduce(((t,e)=>t+e),0)/r/1e3),virtualDroppedFramesCount:Om.filter((t=>t>Vm)).reduce(((t,e)=>t+(e-Vm)/Vm),0),totalFramesCount:r}}};t.$=d,t.A=m,t.B=uo,t.C=ao,t.D=Xo,t.E=xt,t.F=function(t){let[e,i,r]=t;return i+=90,i*=Math.PI/180,r*=Math.PI/180,{x:e*Math.cos(i)*Math.sin(r),y:e*Math.sin(i)*Math.sin(r),z:e*Math.cos(r)}
vendor: 4,565 bytes, line 1
1},t.G=_i,t.H=Lo,t.I=Ju,t.J=lo,t.K=function(t){if(null==Y){const e=t.navigator?t.navigator.userAgent:null;Y=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return Y},t.L=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Dd((()=>this.process())),this.subscription=et(this.target,"message",(t=>this.receive(t)),!1),this.globalScope=H(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}unregisterMessageHandler(t){delete this.messageHandlers[t]}sendAsync(t,e){return new Promise(((i,r)=>{const n=Math.round(1e18*Math.random()).toString(36).substring(0,10),o=e?et(e.signal,"abort",(()=>{null==o||o.unsubscribe(),delete this.resolveRejects[n];const e={id:n,type:"<cancel>",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(e)}),zd):null;this.resolveRejects[n]={resolve:t=>{null==o||o.unsubscribe(),i(t)},reject:t=>{null==o||o.unsubscribe(),r(t)}};const a=[],s=Object.assign(Object.assign({},t),{id:n,sourceMapId:this.mapId,origin:location.origin,data:vo(t.data,a)});this.target.postMessage(s,{transfer:a})}))}receive(t){const e=t.data,i=e.id,r=["file://","resource://android","null"],n=[e.origin,location.origin],o=e.origin===location.origin,a=n.some((t=>r.includes(t)));if((o||a)&&(!e.targetMapId||this.mapId===e.targetMapId)){if("<cancel>"===e.type){delete this.tasks[i];const t=this.abortControllers[i];return delete this.abortControllers[i],void(t&&t.abort())}if(H(self)||e.mustQueue)return this.tasks[i]=e,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,e)}}process(){if(0===this.taskQueue.length)return;const t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,i){return e(this,void 0,void 0,(function*(){if("<response>"===i.type){const e=this.resolveRejects[t];if(delete this.resolveRejects[t],!e)return;return void(i.error?e.reject(xo(i.error)):e.resolve(xo(i.data)))}if(!this.messageHandlers[i.type])return void this.completeTask(t,new Error("Could not find a registered handler for ".concat(i.type,", map ID: ").concat(this.mapId,", available handlers: ").concat(Object.keys(this.messageHandlers).join(", "))));const e=xo(i.data),r=new AbortController;this.abortControllers[t]=r;try{const n=yield this.messageHandlers[i.type](i.sourceMapId,e,r);this.completeTask(t,null,n)}catch(e){this.completeTask(t,e)}}))}completeTask(t,e,i){const r=[];delete this.abortControllers[t];const n={id:t,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?vo(e):null,data:vo(i,r)};this.target.postMessage(n,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.M=ut,t.N=function(){var t=new m(16);return m!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.O=function(t,e,i){var r,n,o,a,s,l,c,h,u,d,p,f,m=i[0],g=i[1],_=i[2];return e===t?(t[12]=e[0]*m+e[4]*g+e[8]*_+e[12],t[13]=e[1]*m+e[5]*g+e[9]*_+e[13],t[14]=e[2]*m+e[6]*g+e[10]*_+e[14],t[15]=e[3]*m+e[7]*g+e[11]*_+e[15]):(n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=e[9],p=e[10],f=e[11],t[0]=r=e[0],t[1]=n,t[2]=o,t[3]=a,t[4]=s,t[5]=l,t[6]=c,t[7]=h,t[8]=u,t[9]=d,t[10]=p,t[11]=f,t[12]=r*m+s*g+u*_+e[12],t[13]=n*m+l*g+d*_+e[13],t[14]=o*m+c*g+p*_+e[14],t[15]=a*m+h*g+f*_+e[15]),t},t.P=i,t.Q=function(t,e,i){var r=i[0],n=i[1],o=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.R=Pl,t.S=function(t,e,i){var r=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],_=e[14],y=e[15],v=i[0],x=i[1],b=i[2],w=i[3];return t[0]=v*r+x*s+b*u+w*m,t[1]=v*n+x*l+b*d+w*g,t[2]=v*o+x*c+b*p+w*_,t[3]=v*a+x*h+b*f+w*y,t[4]=(v=i[4])*r+(x=i[5])*s+(b=i[6])*u+(w=i[7])*m,t[5]=v*n+x*l+b*d+w*g,t[6]=v*o+x*c+b*p+w*_,t[7]=v*a+x*h+b*f+w*y,t[8]=(v=i[8])*r+(x=i[9])*s+(b=i[10])*u+(w=i[11])*m,t[9]=v*n+x*l+b*d+w*g,t[10]=v*o+x*c+b*p+w*_,t[11]=v*a+x*h+b*f+w*y,t[12]=(v=i[12])*r+(x=i[13])*s+(b=i[14])*u+(w=i[15])*m,t[13]=v*n+x*l+b*d+w*g,t[14]=v*o+x*c+b*p+w*_,t[15]=v*a+x*h+b*f+w*y,t},t.T=Ll,t.U=function(t,e){const i={};for(let r=0;r<e.length;r++){const n=e[r];n in t&&(i[n]=t[n])}return i},t.V=Rd,t.W=V,t.X=Od,t.Y=Bd,t.Z=lt,t._=e,t.a=st,t.a$=function(t,e,
1i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t},t.a0=p,t.a1=Q,t.a2=Xd,t.a3=jd,t.a4=Nd,t.a5=D,t.a6=Gd,t.a7=Yd,t.a8=25,t.a9=qd,t.aA=function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)},t.aB=function(t){return t[0]=0,t[1]=0,t},t.aC=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t},t.aD=_d,t.aE=I,t.aF=function(t,e,r,n){const o=e.y-t.y,a=e.x-t.x,s=n.y-r.y,l=n.x-r.x,c=s*a-l*o;if(0===c)return null;const h=(l*(t.y-r.y)-s*(t.x-r.x))/c;return new i(t.x+h*a,t.y+h*o)},t.aG=rm,t.aH=Xs,t.aI=function(t){let e=1/0,i=1/0,r=-1/0,n=-1/0;for(const o of t)e=Math.min(e,o.x),i=Math.min(i,o.y),r=Math.max(r,o.x),n=Math.max(n,o.y);return[e,i,r,n]},t.aJ=wu,t.aK=z,t.aL=function(t,e,i,r){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!i[0]&&!i[1])return[0,0];const o=n?"map"===r?-t.bearingInRadians:0:"viewport"===r?t.bearingInRadians:0;if(o){const t=Math.sin(o),e=Math.cos(o);i=[i[0]*e-i[1]*t,i[0]*t+i[1]*e]}return[n?i[0]:z(e,i[0],t.zoom),n?i[1]:z(e,i[1],t.zoom)]},t.aN=fd,t.aO=Dm,t.aP=ed,t.aQ=$c,t.aR=aa,t.aS=gc,t.aT=Za,t.aU=ss,t.aV=rs,t.aW=rt,t.aX=Ud,t.aY=w,t.aZ=b,t.a_=function(t){var e=new m(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.aa=t=>{const e=window.document.createElement("video");return e.muted=!0,new Promise((i=>{e.onloadstart=()=>{i(e)};for(const r of t){const t=window.document.createElement("source");mt(r)||(e.crossOrigin="Anonymous"),t.src=r,e.appendChild(t)}}))},t.ab=kt,t.ac=function(){return N++},t.ad=ka,t.ae=bd,t.af=Wf,t.ag=mn,t.ah=Gs,t.ai=Jd,t.aj=function(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((t,i,r,n)=>{const o=r||n;return e[i]=!o||o.toLowerCase(),""})),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ak=O,t.al=85.051129,t.am=it,t.an=function(t){return Math.pow(2,t)},t.ao=_,t.ap=Vd,t.aq=function(t){return Math.log(t)/Math.LN2},t.ar=function(t){var e=t[0],i=t[1];return e*e+i*i},t.as=function(t){if(!t.length)return new Set;const e=Math.max(...t.map((t=>t.canonical.z)));let i=1/0,r=-1/0,n=1/0,o=-1/0;const a=[];for(const l of t){const{x:t,y:s,z:c}=l.canonical,h=Math.pow(2,e-c),u=t*h,d=s*h;a.push({id:l,x:u,y:d}),u<i&&(i=u),u>r&&(r=u),d<n&&(n=d),d>o&&(o=d)}const s=new Set;for(const l of a)l.x!==i&&l.x!==r&&l.y!==n&&l.y!==o||s.add(l.id);return s},t.at=function(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x},t.au=class{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(const t in this.data)for(const e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,i){const r=t.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);const n={value:e,timeout:void 0};if(void 0!==i&&(n.timeout=setTimeout((()=>{this.remove(t,n)}),i)),this.data[r].push(n),this.order.push(r),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}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 e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),n=this.data[i][r];return this.data[i].splice(r,1),n.timeout&&clearTimeout(n.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(n.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const i in this.data)for(const r of this.data[i])t(r.value)||e.push(r);for(const i of e)this.remove(i.value.tileID,i)}},t.av=function(t,e){let i=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){const{interpolationType:n,minZoom:o,maxZoom:a}=t,s=n?O(mi.interpolationFactor(n,e,o,a),0,1):0;"camera"===t.kind?r=_i.number(t.minSize,t.maxSize,s):i=s}return{uSizeT:i,uSize:r}}
1,t.ax=function(t,e,i){let{uSize:r,uSizeT:n}=e,{lowerSize:o,upperSize:a}=i;return"source"===t.kind?o/ud:"composite"===t.kind?_i.number(o/ud,a/ud,n):r},t.ay=function(t,e){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],_=e[15],y=i*s-r*a,v=i*l-n*a,x=i*c-o*a,b=r*l-n*s,w=r*c-o*s,T=n*c-o*l,S=h*m-u*f,P=h*g-d*f,I=h*_-p*f,M=u*g-d*m,E=u*_-p*m,C=d*_-p*g,A=y*C-v*E+x*M+b*I-w*P+T*S;return A?(t[0]=(s*C-l*E+c*M)*(A=1/A),t[1]=(n*E-r*C-o*M)*A,t[2]=(m*T-g*w+_*b)*A,t[3]=(d*w-u*T-p*b)*A,t[4]=(l*I-a*C-c*P)*A,t[5]=(i*C-n*I+o*P)*A,t[6]=(g*x-f*T-_*v)*A,t[7]=(h*T-d*x+p*v)*A,t[8]=(a*E-s*I+c*S)*A,t[9]=(r*I-i*E-o*S)*A,t[10]=(f*w-m*x+_*y)*A,t[11]=(u*x-h*w-p*y)*A,t[12]=(s*P-a*M-l*S)*A,t[13]=(i*M-r*P+n*S)*A,t[14]=(m*v-f*b-g*y)*A,t[15]=(h*b-u*v+d*y)*A,t):null},t.az=C,t.b=K,t.b$=class extends Ts{constructor(t,e){super(t,e),this.current=[0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},t.b0=function(t,e){var i=e[0],r=e[1],n=e[2],o=i*i+r*r+n*n;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.b1=T,t.b2=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.b3=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t},t.b4=v,t.b5=function(t,e,i){const r=e[0]*i[0]+e[1]*i[1]+e[2]*i[2];return 0===r?null:(-(t[0]*i[0]+t[1]*i[1]+t[2]*i[2])-i[3])/r},t.b6=P,t.b7=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},t.b8=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]},t.b9=Wd,t.bA=function(t,e,i){const r=(n=[t[0],t[1],t[2],e[0],e[1],e[2],i[0],i[1],i[2]])[0]*((h=n[8])*(a=n[4])-(s=n[5])*(c=n[7]))+n[1]*(-h*(o=n[3])+s*(l=n[6]))+n[2]*(c*o-a*l);var n,o,a,s,l,c,h;if(0===r)return null;const u=T([],[e[0],e[1],e[2]],[i[0],i[1],i[2]]),d=T([],[i[0],i[1],i[2]],[t[0],t[1],t[2]]),p=T([],[t[0],t[1],t[2]],[e[0],e[1],e[2]]),f=w([],u,-t[3]);return b(f,f,w([],d,-e[3])),b(f,f,w([],p,-i[3])),w(f,f,1/r),f},t.bB=kd,t.bC=function(){return new Float64Array(4)},t.bD=function(t,e,i,r){var n=[],o=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],o[0]=n[0]*Math.cos(r)-n[1]*Math.sin(r),o[1]=n[0]*Math.sin(r)+n[1]*Math.cos(r),o[2]=n[2],t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},t.bE=function(t,e,i,r){var n=[],o=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],o[0]=n[0],o[1]=n[1]*Math.cos(r)-n[2]*Math.sin(r),o[2]=n[1]*Math.sin(r)+n[2]*Math.cos(r),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},t.bF=function(t,e,i,r){var n=[],o=[];return n[0]=e[0]-i[0],n[1]=e[1]-i[1],n[2]=e[2]-i[2],o[0]=n[2]*Math.sin(r)+n[0]*Math.cos(r),o[1]=n[1],o[2]=n[2]*Math.cos(r)-n[0]*Math.sin(r),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t},t.bG=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),o=e[0],a=e[1],s=e[2],l=e[3],c=e[8],h=e[9],u=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*n-c*r,t[1]=a*n-h*r,t[2]=s*n-u*r,t[3]=l*n-d*r,t[8]=o*r+c*n,t[9]=a*r+h*n,t[10]=s*r+u*n,t[11]=l*r+d*n,t},t.bH=function(t,e){const i=k(t,360),r=k(e,360),n=r-i,o=r>i?n-360:n+360;return Math.abs(n)<Math.abs(o)?n:o},t.bI=function(t){return t[0]=0,t[1]=0,t[2]=0,t},t.bJ=function(t,e,i,r){const n=Math.sqrt(t*t+e*e),o=Math.sqrt(i*i+r*r);t/=n,e/=n,i/=o,r/=o;const a=Math.acos(t*i+e*r);return-e*i+t*r>0?a:-a},t.bK=function(t,e){const i=k(t,2*Math.PI),r=k(e,2*Math.PI);return Math.min(Math.abs(i-r),Math.abs(i-r+2*Math.PI),Math.abs(i-r-2*Math.PI))},t.bL=function(){const t={},e=bt.$version;for(const i in bt.$root){const r=bt.$root[i];if(r.required){let n=null;n="version"===i?e:"array"===r.type?[]:{},null!=n&&(t[i]=n)}}return t},t.bM=pt,t.bN=bo,t.bO=function t(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(let r=0;r<e.length;r++)if(!t(e[r],i[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==i){if("object"!=typeof i)return!1;if(Object.keys(e).length!==Object.keys(i).length)return!1;for(const r in e)if(!t(e[r],i[r]))return!1;return!0}return e===i},t.bP=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=Tt(t[i],e[t[i].ref]));return t},t.bQ=function(t,e){if("custom"===t.type)return new Ad(t,e);switch(t.type){case"background":return new Cd(t,e);case"circle":return new _l(t,e);case"color-relief":return new Vl(t,e);case"fill":return new Cc(t,e);case"fill-extrusion":return new Yc(t,e);case"heatmap":return new Cl(t,e);case"hillshade":return new zl(t,e);case"line":return new fu(t,e);case"raster":return new ia(t,e);case"symbol":return new Id(t,e)}},t.bR=t=>"raster"===t.type,t.bS=Z,t.bT=function(t,e){if(!t)return[{command:"setStyle",args:[e]}];let i=[];try{if(!St(t.version,e.version))return[{command:"setStyle",args:[e]}];St(t.center,e.center)||i.push({command:"setCenter",args:[e.center]}),St(t.state,e.state)||i.push({command:"setGlobalState",args:[e.state]}),St(t.centerAltitude,e.centerAltitude)||i.push({command:"setCenterAltitude",args:[e.centerAltitude]}),St(t.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),St(t.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),St(t.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}),St(t.roll,e.roll)||i.push({command:"setRoll",args:[e.roll]}),St(t.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),St(t.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),St(t.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),St(t.light,e.light)||i.push({command:"setLight",args:[e.light]}),St(t.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),St(t.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),St(t.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});const r={},n=[];
vendor: 4,084 bytes, line 1
1!function(t,e,i,r){let n;for(n in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,n)&&(Object.prototype.hasOwnProperty.call(e,n)||Mt(n,i,r));for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Object.prototype.hasOwnProperty.call(t,n)?St(t[n],e[n])||("geojson"===t[n].type&&"geojson"===e[n].type&&Ct(t,e,n)?Pt(i,{command:"setGeoJSONSourceData",args:[n,e[n].data]}):Et(n,e,i,r)):It(n,e,i))}(t.sources,e.sources,n,r);const o=[];t.layers&&t.layers.forEach((t=>{"source"in t&&r[t.source]?i.push({command:"removeLayer",args:[t.id]}):o.push(t)})),i=i.concat(n),function(t,e,i){e=e||[];const r=(t=t||[]).map(Dt),n=e.map(Dt),o=t.reduce(zt,{}),a=e.reduce(zt,{}),s=r.slice(),l=Object.create(null);let c,h,u,d,p;for(let f=0,m=0;f<r.length;f++)c=r[f],Object.prototype.hasOwnProperty.call(a,c)?m++:(Pt(i,{command:"removeLayer",args:[c]}),s.splice(s.indexOf(c,m),1));for(let f=0,m=0;f<n.length;f++)c=n[n.length-1-f],s[s.length-1-f]!==c&&(Object.prototype.hasOwnProperty.call(o,c)?(Pt(i,{command:"removeLayer",args:[c]}),s.splice(s.lastIndexOf(c,s.length-m),1)):m++,d=s[s.length-f],Pt(i,{command:"addLayer",args:[a[c],d]}),s.splice(s.length-f,0,c),l[c]=!0);for(let f=0;f<n.length;f++)if(c=n[f],h=o[c],u=a[c],!l[c]&&!St(h,u))if(St(h.source,u.source)&&St(h["source-layer"],u["source-layer"])&&St(h.type,u.type)){for(p in At(h.layout,u.layout,i,c,null,"setLayoutProperty"),At(h.paint,u.paint,i,c,null,"setPaintProperty"),St(h.filter,u.filter)||Pt(i,{command:"setFilter",args:[c,u.filter]}),St(h.minzoom,u.minzoom)&&St(h.maxzoom,u.maxzoom)||Pt(i,{command:"setLayerZoomRange",args:[c,u.minzoom,u.maxzoom]}),h)Object.prototype.hasOwnProperty.call(h,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?At(h[p],u[p],i,c,p.slice(6),"setPaintProperty"):St(h[p],u[p])||Pt(i,{command:"setLayerProperty",args:[c,p,u[p]]}));for(p in u)Object.prototype.hasOwnProperty.call(u,p)&&!Object.prototype.hasOwnProperty.call(h,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?At(h[p],u[p],i,c,p.slice(6),"setPaintProperty"):St(h[p],u[p])||Pt(i,{command:"setLayerProperty",args:[c,p,u[p]]}))}else Pt(i,{command:"removeLayer",args:[c]}),d=s[s.lastIndexOf(c)+1],Pt(i,{command:"addLayer",args:[u,d]})}(o,e.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:"setStyle",args:[e]}]}return i},t.bU=function(t){const e=[],i=t.id;return void 0===i&&e.push({message:"layers.".concat(i,': missing required property "id"')}),void 0===t.render&&e.push({message:"layers.".concat(i,': missing required method "render"')}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers.".concat(i,': property "renderingMode" must be either "2d" or "3d"')}),e},t.bV=U,t.bW=G,t.bX=class extends Ts{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.bY=Is,t.bZ=class extends Ts{constructor(t,e){super(t,e),this.current=Ms}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}},t.b_=Ps,t.ba=Hd,t.bb=function(t,e,i,r,n){var o=1/Math.tan(e/2);if(t[0]=o/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0){var a=1/(r-n);t[10]=(n+r)*a,t[14]=2*n*r*a}else t[10]=-1,t[14]=-2*r;return t},t.bc=function(t){var e=new m(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.bd=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),o=e[0],a=e[1],s=e[2],l=e[3],c=e[4],h=e[5],u=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*n+c*r,t[1]=a*n+h*r,t[2]=s*n+u*r,t[3]=l*n+d*r,t[4]=c*n-o*r,t[5]=h*n-a*r,t[6]=u*n-s*r,t[7]=d*n-l*r,t}
vendor: 4,062 bytes, line 1
1,t.be=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*n+c*r,t[5]=a*n+h*r,t[6]=s*n+u*r,t[7]=l*n+d*r,t[8]=c*n-o*r,t[9]=h*n-a*r,t[10]=u*n-s*r,t[11]=d*n-l*r,t},t.bf=function(){const t=new Float32Array(16);return _(t),t},t.bg=function(){const t=new Float64Array(16);return _(t),t},t.bh=function(){return new Float64Array(16)},t.bi=function(t,e,i){const r=new Float64Array(4);return E(r,t,e-90,i),r},t.bj=function(t,e,i,r){var n,o,a,s,l,c=e[0],h=e[1],u=e[2],d=e[3],p=i[0],m=i[1],g=i[2],_=i[3];return(o=c*p+h*m+u*g+d*_)<0&&(o=-o,p=-p,m=-m,g=-g,_=-_),1-o>f?(n=Math.acos(o),a=Math.sin(n),s=Math.sin((1-r)*n)/a,l=Math.sin(r*n)/a):(s=1-r,l=r),t[0]=s*c+l*p,t[1]=s*h+l*m,t[2]=s*u+l*g,t[3]=s*d+l*_,t},t.bk=function(t){const e=new Float64Array(9);var i,r,n,o,a,s,l,c,h,u,d,p,f,m,g,_,y,v;u=(n=(r=t)[0])*(l=n+n),d=(o=r[1])*l,f=(a=r[2])*l,m=a*(c=o+o),_=(s=r[3])*l,y=s*c,v=s*(h=a+a),(i=e)[0]=1-(p=o*c)-(g=a*h),i[3]=d-v,i[6]=f+y,i[1]=d+v,i[4]=1-u-g,i[7]=m-_,i[2]=f-y,i[5]=m+_,i[8]=1-u-p;const x=rt(-Math.asin(O(e[2],-1,1)));let b,w;return Math.hypot(e[5],e[8])<.001?(b=0,w=-rt(Math.atan2(e[3],e[4]))):(b=rt(0===e[5]&&0===e[8]?0:Math.atan2(e[5],e[8])),w=rt(0===e[1]&&0===e[0]?0:Math.atan2(e[1],e[0]))),{roll:b,pitch:x+90,bearing:w}},t.bl=function(t,e){return t.roll==e.roll&&t.pitch==e.pitch&&t.bearing==e.bearing},t.bm=Ce,t.bn=Ss,t.bo=_c,t.bp=yc,t.bq=mc,t.br=R,t.bs=F,t.bt=Ne,t.bu=function(t,e,i,r,n){return R(r,n,O((t-e)/(i-e),0,1))},t.bv=function(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t[2]=e[2]+i[2]*r,t},t.bw=k,t.bx=function(){return new Float64Array(3)},t.by=E,t.bz=function(t,e,i){var r=i[0],n=i[1],o=i[2],a=i[3],s=e[0],l=e[1],c=e[2],h=n*c-o*l,u=o*s-r*c,d=r*l-n*s;return t[0]=s+a*(h+=h)+n*(d+=d)-o*(u+=u),t[1]=l+a*u+o*h-r*d,t[2]=c+a*d+r*u-n*h,t},t.c=ct,t.c$=class{constructor(t,e){this.layers={[Wf]:this},this.name=Wf,this.version=e?e.version:1,this.extent=e?e.extent:4096,this.length=t.length,this.features=t}feature(t){return new qf(this.features[t],this.extent)}},t.c0=class extends Ts{constructor(t,e){super(t,e),this.current=[0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},t.c1=g,t.c2=function(t,e){var i=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.c3=function(t,e,i){var r=e[0],n=e[1],o=e[2];return t[0]=r*i[0]+n*i[3]+o*i[6],t[1]=r*i[1]+n*i[4]+o*i[7],t[2]=r*i[2]+n*i[5]+o*i[8],t},t.c4=function(t,e,i,r,n,o,a){var s=1/(e-i),l=1/(r-n),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*s,t[13]=(n+r)*l,t[14]=(a+o)*c,t[15]=1,t},t.c5=class extends Ts{constructor(t,e){super(t,e),this.current=new Array}set(t){if(t!=this.current){this.current=t;const e=new Float32Array(4*t.length);for(let i=0;i<t.length;i++)e[4*i]=t[i].r,e[4*i+1]=t[i].g,e[4*i+2]=t[i].b,e[4*i+3]=t[i].a;this.gl.uniform4fv(this.location,e)}}},t.c6=class extends Ts{constructor(t,e){super(t,e),this.current=new Array}set(t){if(t!=this.current){this.current=t;const e=new Float32Array(t);this.gl.uniform1fv(this.location,e)}}},t.c7=class extends ba{},t.c8=xu,t.c9=class extends Ta{},t.cA=function(t,e,i){var r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t},t.cB=function(t,e){const{x:i,y:r}=Gd.fromLngLat(e);return!(t<0||t>25||r<0||r>=1||i<0||i>=1)},t.cC=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.cD=class extends ca{},t.cE=Um,t.cG=dt,t.cH=function(t,e){ct.REGISTERED_PROTOCOLS[t]=e},t.cI=function(t){delete ct.REGISTERED_PROTOCOLS[t]},t.cJ=function(t,e){const i={};for(let n=0;n<t.length;n++){const r=e&&e[t[n].id]||Sn(t[n]);e&&(e[t[n].id]=r);let o=i[r];o||(o=i[r]=[]),o.push(t[n])}const r=[];for(const n in i)r.push(i[n]);return r},t.cK=mo,t.cL=Kd,t.cM=tm,t.cN=Qu,t.cO=function(e){var i;
1e.bucket.createArrays(),e.bucket.tilePixelRatio=D/(512*e.bucket.overscaling),e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;const r=e.bucket.layers[0],n=r.layout,o=r._unevaluatedLayout._values,a={layoutIconSize:o["icon-size"].possiblyEvaluate(new Lo(e.bucket.zoom+1),e.canonical),layoutTextSize:o["text-size"].possiblyEvaluate(new Lo(e.bucket.zoom+1),e.canonical),textMaxSize:o["text-size"].possiblyEvaluate(new Lo(18))};if("composite"===e.bucket.textSizeData.kind){const{minZoom:t,maxZoom:i}=e.bucket.textSizeData;a.compositeTextSizes=[o["text-size"].possiblyEvaluate(new Lo(t),e.canonical),o["text-size"].possiblyEvaluate(new Lo(i),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){const{minZoom:t,maxZoom:i}=e.bucket.iconSizeData;a.compositeIconSizes=[o["icon-size"].possiblyEvaluate(new Lo(t),e.canonical),o["icon-size"].possiblyEvaluate(new Lo(i),e.canonical)]}const s=n.get("text-line-height")*wu,l="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),c=n.get("text-keep-upright"),h=n.get("text-size");for(const u of e.bucket.features){const o=n.get("text-font").evaluate(u,{},e.canonical).join(","),d=h.evaluate(u,{},e.canonical),p=a.layoutTextSize.evaluate(u,{},e.canonical),f=a.layoutIconSize.evaluate(u,{},e.canonical),m={horizontal:{},vertical:void 0},g=u.text;let _,y=[0,0];if(g){const i=g.toString(),a=n.get("text-letter-spacing").evaluate(u,{},e.canonical)*wu,h=Io(i)?a:0,f=n.get("text-anchor").evaluate(u,{},e.canonical),_=Am(r,u,e.canonical);if(!_){const t=n.get("text-radial-offset").evaluate(u,{},e.canonical);y=t?Cm(f,[t*wu,Em]):n.get("text-offset").evaluate(u,{},e.canonical).map((t=>t*wu))}let v=l?"center":n.get("text-justify").evaluate(u,{},e.canonical);const x="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(u,{},e.canonical)*wu:1/0,b=()=>{e.bucket.allowVerticalPlacement&&Po(i)&&(m.vertical=td(g,e.glyphMap,e.glyphPositions,e.imagePositions,o,x,s,f,"left",h,y,t.aw.vertical,!0,p,d))};if(!l&&_){const i=new Set;if("auto"===v)for(let t=0;t<_.values.length;t+=2)i.add(Dm(_.values[t]));else i.add(v);let r=!1;for(const n of i)if(!m.horizontal[n])if(r)m.horizontal[n]=m.horizontal[0];else{const i=td(g,e.glyphMap,e.glyphPositions,e.imagePositions,o,x,s,"center",n,h,y,t.aw.horizontal,!1,p,d);i&&(m.horizontal[n]=i,r=1===i.positionedLines.length)}b()}else{"auto"===v&&(v=Dm(f));const r=td(g,e.glyphMap,e.glyphPositions,e.imagePositions,o,x,s,f,v,h,y,t.aw.horizontal,!1,p,d);r&&(m.horizontal[v]=r),b(),Po(i)&&l&&c&&(m.vertical=td(g,e.glyphMap,e.glyphPositions,e.imagePositions,o,x,s,f,v,h,y,t.aw.vertical,!1,p,d))}}let v=!1;if(u.icon&&u.icon.name){const t=e.imageMap[u.icon.name];t&&(_=ld(e.imagePositions[u.icon.name],n.get("icon-offset").evaluate(u,{},e.canonical),n.get("icon-anchor").evaluate(u,{},e.canonical)),v=!!t.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=v:e.bucket.sdfIcons!==v&&W("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.bucket.pixelRatio||0!==n.get("icon-rotate").constantOr(1))&&(e.bucket.iconsNeedLinear=!0))}const x=Rm(m.horizontal)||m.vertical;(i=e.bucket).iconsInText||(i.iconsInText=!!x&&x.iconsInText),(x||_)&&zm(e.bucket,u,m,_,e.imageMap,a,p,f,y,v,e.canonical,e.subdivisionGranularity)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()},t.cP=Pc,t.cQ=Gc,t.cR=lu,t.cS=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=new Fu;return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";for(const r in t.layers)e.writeMessage(3,((t,e)=>Xf(t,e,i)),t.layers[r])}(t,i,e),i.finish()},t.cT=function(t,e,i,r,n,o){let a=nm(t,e,i,n,0);return a=nm(a,e,r,o,1),a},t.cU=class{constructor(t){this.maxEntries=t,this.map=new Map}get(t){const e=this.map.get(t);return void 0!==e&&(this.map.delete(t),this.map.set(t,e)),e}set(t,e){if(this.map.has(t))this.map.delete(t);else if(this.map.size>=this.maxEntries){const t=this.map.keys().next().value;this.map.delete(t)}this.map.set(t,e)}clear(){this.map.clear()}},t.cV=Vc,t.cW=Fu,t.cX=Zf,t.cY=class{constructor(t){this.start="".concat(t,"#start"),this.end="".concat(t,"#end"),this.measure=t,performance.mark(this.start)}finish(){performance.mark(this.end);let t=performance.getEntriesByName(this.measure);return 0===t.length&&(performance.measure(this.measure,this.start,this.end),t=performance.getEntriesByName(this.measure),performance.clearMarks(this.start),performance.clearMarks(this.end),performance.clearMeasures(this.measure)),t}},t.cZ=function(t,i,r,n,o){return e(this,void 0,void 0,(function*(){if(p())try{return yield Q(t,i,r,n,o)}catch(t){}
1return function(t,e,i,r,n){const o=t.width,a=t.height;$&&tt||($=new OffscreenCanvas(o,a),tt=$.getContext("2d",{willReadFrequently:!0})),$.width=o,$.height=a,tt.drawImage(t,0,0,o,a);const s=tt.getImageData(e,i,r,n);return tt.clearRect(0,0,o,a),s.data}(t,i,r,n,o)}))},t.c_=Bl,t.ca=El,t.cb=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.cc=Ml,t.cd=function(t,e,i){var r=e[0],n=e[1],o=e[2],a=i[3]*r+i[7]*n+i[11]*o+i[15];return t[0]=(i[0]*r+i[4]*n+i[8]*o+i[12])/(a=a||1),t[1]=(i[1]*r+i[5]*n+i[9]*o+i[13])/a,t[2]=(i[2]*r+i[6]*n+i[10]*o+i[14])/a,t},t.ce=class extends ha{},t.cf=class extends Aa{},t.cg=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},t.ch=function(t,e){var i=t[0],r=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],p=t[11],m=t[12],g=t[13],_=t[14],y=t[15],v=e[0],x=e[1],b=e[2],w=e[3],T=e[4],S=e[5],P=e[6],I=e[7],M=e[8],E=e[9],C=e[10],A=e[11],D=e[12],z=e[13],k=e[14],R=e[15];return Math.abs(i-v)<=f*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(r-x)<=f*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(n-b)<=f*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(o-w)<=f*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-T)<=f*Math.max(1,Math.abs(a),Math.abs(T))&&Math.abs(s-S)<=f*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(l-P)<=f*Math.max(1,Math.abs(l),Math.abs(P))&&Math.abs(c-I)<=f*Math.max(1,Math.abs(c),Math.abs(I))&&Math.abs(h-M)<=f*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(u-E)<=f*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(d-C)<=f*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(p-A)<=f*Math.max(1,Math.abs(p),Math.abs(A))&&Math.abs(m-D)<=f*Math.max(1,Math.abs(m),Math.abs(D))&&Math.abs(g-z)<=f*Math.max(1,Math.abs(g),Math.abs(z))&&Math.abs(_-k)<=f*Math.max(1,Math.abs(_),Math.abs(k))&&Math.abs(y-R)<=f*Math.max(1,Math.abs(y),Math.abs(R))},t.ci=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.cj=t=>"symbol"===t.type,t.ck=t=>"circle"===t.type,t.cl=t=>"heatmap"===t.type,t.cm=t=>"line"===t.type,t.cn=t=>"fill"===t.type,t.co=t=>"fill-extrusion"===t.type,t.cp=t=>"hillshade"===t.type,t.cq=t=>"color-relief"===t.type,t.cr=t=>"background"===t.type,t.cs=t=>"custom"===t.type,t.ct=L,t.cu=function(t,e,i){if(e<=0)return t;const r=1/e;return void 0===i||Math.abs(i)<1e-10?Math.round(t*r)/r:(i>0?Math.ceil(t*r-1e-9):Math.floor(t*r+1e-10))/r},t.cv=function(t,e,i){const r=A(e.x-i.x,e.y-i.y),n=A(t.x-i.x,t.y-i.y);var o,a;return rt(Math.atan2(r[0]*n[1]-r[1]*n[0],(o=r)[0]*(a=n)[0]+o[1]*a[1]))},t.cw=B,t.cx=function(t,e){var i;if(!ot[e])return!1;const r=null==t?void 0:t.target,n=(null===(i=null==r?void 0:r.ownerDocument)||void 0===i?void 0:i.defaultView)||window;return t instanceof n.MouseEvent||t instanceof n.WheelEvent},t.cy=function(t,e){return nt[e]&&"touches"in t},t.cz=function(t){return nt[t]||ot[t]},t.d=mt,t.d0=on,t.d1=class{get tiles(){var t,e;return null!==(t=null===(e=this.tileIndex)||void 0===e?void 0:e.tiles)&&void 0!==t?t:{}}get stats(){return this.tileIndex.stats}get total(){return this.tileIndex.total}constructor(t,e){r(this,"options",void 0),r(this,"source",void 0),r(this,"tileIndex",void 0);const i=(e=this.options=Object.assign({},eu,e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=ch(t,e);i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles")),n=Rh(n,e),e.updateable&&(this.source=n),this.initializeIndex(n,e)}initializeIndex(t,e){this.tileIndex=e.cluster?new jh(e.clusterOptions):new $h(e),t.length&&this.tileIndex.initialize(t)}getTile(t,e,i){return e=+e,i=+i,(t=+t)<0||t>24?null:this.tileIndex.getTile(t,e,i)}updateData(t,e){const i=this.options;if(!i.updateable)throw new Error("to update tile geojson `updateable` option must be set to true");let{affected:r,source:n}
1=function(t,e,i){const r=function(t,e,i){return t?{removeAll:t.removeAll,remove:new Set(t.remove||[]),add:new Map(null===(e=t.add)||void 0===e?void 0:e.map((t=>[t.id,t]))),update:new Map(null===(i=t.update)||void 0===i?void 0:i.map((t=>[t.id,t])))}:{remove:new Set,add:new Map,update:new Map}}(e);let n=[];if(r.removeAll&&(n=t,t=[]),r.remove.size||r.add.size){const e=[];for(const i of t){const{id:t}=i;(r.remove.has(t)||r.add.has(t))&&e.push(i)}if(e.length){n.push(...e);const i=new Set(e.map((t=>t.id)));t=t.filter((t=>!i.has(t.id)))}if(r.add.size){let e=ch({type:"FeatureCollection",features:Array.from(r.add.values())},i);e=Rh(e,i),n.push(...e),t.push(...e)}}if(r.update.size)for(const[o,a]of r.update){const e=t.findIndex((t=>t.id===o));if(-1===e)continue;const r=t[e],s=Bh(r,a,i);s&&(n.push(r,s),t[e]=s)}return{affected:n,source:t}}(this.source,t,i);e&&({affected:r,source:n}=this.filterUpdate(n,r,e)),r.length&&(this.source=n,this.tileIndex.updateIndex(n,r,i))}filterUpdate(t,e,i){const r=new Set;for(const n of t)null!=n.id&&(i(mh(n))||(e.push(n),r.add(n.id)));return{affected:e,source:t=t.filter((t=>!r.has(t.id)))}}getData(){if(!this.options.updateable)throw new Error("to retrieve data the `updateable` option must be set to true");return{type:"FeatureCollection",features:this.source.map((t=>mh(t)))}}updateClusterOptions(t,e){const i=this.options.cluster;this.options.cluster=t,this.options.clusterOptions=e,i!=t?this.initializeIndex(this.source,this.options):this.tileIndex.updateIndex(this.source,[],this.options)}getClusterExpansionZoom(t){return this.tileIndex.getClusterExpansionZoom(t)}getClusterChildren(t){return this.tileIndex.getChildren(t)}getClusterLeaves(t,e,i){return this.tileIndex.getLeaves(t,e,i)}},t.d2=Fo,t.e=j,t.f=t=>e(void 0,void 0,void 0,(function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(t){throw new Error("Could not load image because of ".concat(t.message,". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}})),t.g=ht,t.h=t=>new Promise(((e,i)=>{const r=new Image;r.onload=()=>{e(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame((()=>{r.src=J}))},r.onerror=()=>i(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 n=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=t.byteLength?URL.createObjectURL(n):J})),t.i=H,t.j=(t,e)=>ft(j(t,{type:"json"}),e),t.k=vt,t.l=yt,t.m=ft,t.n=(t,e)=>ft(j(t,{type:"arrayBuffer"}),e),t.o=function(t){return new Fu(t).readFields(Xu,[])},t.p=Ku,t.q=function(t){return/[\u02EA\u02EB\u1100-\u11FF\u2E80-\u2FDF\u3000-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFE10-\uFE1F\uFE30-\uFE4F\uFF00-\uFFEF]|\uD81B[\uDFE0-\uDFFF]|[\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFFF]|\uD82C[\uDC00-\uDEFB]|\uD83C[\uDE00-\uDEFF]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79]/gim.test(String.fromCodePoint(t))},t.r=Sl,t.s=et,t.t=Qo,t.u=bt,t.v=oo,t.w=W,t.x=No,t.y=so,t.z=Oo})),i("worker",["./shared"],(function(t){class e{constructor(t,e){this.keyCache={},t&&this.replace(t,e)}replace(t,e){this._layerConfigs={},this._layers={},this.update(t,[],e)}update(e,i,r){for(const o of e){this._layerConfigs[o.id]=o;const e=this._layers[o.id]=t.bQ(o,r);e._featureFilter=t.ag(e.filter,r),this.keyCache[o.id]&&delete this.keyCache[o.id]}for(const t of i)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const n=t.cJ(Object.values(this._layerConfigs),this.keyCache);for(const o of n){const e=o.map((t=>this._layers[t.id])),i=e[0];if(i.isHidden())continue;const r=i.source||"";let n=this.familiesBySource[r];n||(n=this.familiesBySource[r]={});const a=i.sourceLayer||t.af;let s=n[a];s||(s=n[a]=[]),s.push(e)}}}class i{constructor(e){const i={},r=[];for(const t in e){const n=e[t],o=i[t]={};for(const t in n){const e=n[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;
1const i={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};r.push(i),o[t]={rect:i,metrics:e.metrics}}}const{w:n,h:o}=t.p(r),a=new t.r({width:n||1,height:o||1});for(const s in e){const r=e[s];for(const e in r){const n=r[+e];if(!n||0===n.bitmap.width||0===n.bitmap.height)continue;const o=i[s][e].rect;t.r.copy(n.bitmap,a,{x:0,y:0},{x:o.x+1,y:o.y+1},n.bitmap)}}this.image=a,this.positions=i}}t.cK("GlyphAtlas",i);class r{constructor(e){this.tileID=new t.a2(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}parse(e,r,o,a,s){return t._(this,void 0,void 0,(function*(){this.status="parsing",this.data=e,this.collisionBoxArray=new t.ad;const l=new t.cL(Object.keys(e.layers).sort()),c=new t.cM(this.tileID,this.promoteId);c.bucketLayerIDs=[];const h={},u={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:o,subdivisionGranularity:s},d=r.familiesBySource[this.source];for(const i in d){const r=e.layers[i];if(!r)continue;1===r.version&&t.w('Vector tile source "'.concat(this.source,'" layer "').concat(i,'" does not use vector tile spec v2 and therefore may have some rendering errors.'));const a=l.encode(i),s=[];for(let t=0;t<r.length;t++){const e=r.feature(t),n=c.getId(e,i);s.push({feature:e,id:n,index:t,sourceLayerIndex:a})}for(const e of d[i]){const i=e[0];i.source!==this.source&&t.w("layer.source = ".concat(i.source," does not equal this.source = ").concat(this.source)),i.isHidden(this.zoom,!0)||(n(e,this.zoom,o),(h[i.id]=i.createBucket({index:c.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:a,sourceID:this.source})).populate(s,u,this.tileID.canonical),c.bucketLayerIDs.push(e.map((t=>t.id))))}}const p=t.bV(u.glyphDependencies,(t=>Object.keys(t).map(Number)));this.inFlightDependencies.forEach((t=>null==t?void 0:t.abort())),this.inFlightDependencies=[];let f=Promise.resolve({});if(Object.keys(p).length){const t=new AbortController;this.inFlightDependencies.push(t),f=a.sendAsync({type:"GG",data:{stacks:p,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}const m=Object.keys(u.iconDependencies);let g=Promise.resolve({});if(m.length){const t=new AbortController;this.inFlightDependencies.push(t),g=a.sendAsync({type:"GI",data:{icons:m,source:this.source,tileID:this.tileID,type:"icons"}},t)}const _=Object.keys(u.patternDependencies);let y=Promise.resolve({});if(_.length){const t=new AbortController;this.inFlightDependencies.push(t),y=a.sendAsync({type:"GI",data:{icons:_,source:this.source,tileID:this.tileID,type:"patterns"}},t)}const v=u.dashDependencies;let x=Promise.resolve({});if(Object.keys(v).length){const t=new AbortController;this.inFlightDependencies.push(t),x=a.sendAsync({type:"GDA",data:{dashes:v}},t)}const[b,w,T,S]=yield Promise.all([f,g,y,x]),P=new i(b),I=new t.cN(w,T);for(const e in h){const i=h[e];
1i instanceof t.ae?(n(i.layers,this.zoom,o),t.cO({bucket:i,glyphMap:b,glyphPositions:P.positions,imageMap:w,imagePositions:I.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:u.subdivisionGranularity})):i.hasDependencies&&(i instanceof t.cP||i instanceof t.cQ||i instanceof t.cR)&&(n(i.layers,this.zoom,o),i.addFeatures(u,this.tileID.canonical,I.patternPositions,S))}return this.status="done",{buckets:Object.values(h).filter((t=>!t.isEmpty())),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:P.image,imageAtlas:I,dashPositions:S,glyphMap:this.returnDependencies?b:null,iconMap:this.returnDependencies?w:null,glyphPositions:this.returnDependencies?P.positions:null}}))}}function n(e,i,r){const n=new t.H(i);for(const t of e)t.recalculate(n,r)}class o{constructor(){this.loading={},this.loaded={},this.parsing={}}startLoading(t,e){this.loading[t]=e}finishLoading(t){delete this.loading[t]}abort(t){const e=this.loading[t];(null==e?void 0:e.abort)&&(e.abort.abort(),delete this.loading[t])}setParsing(t,e){this.parsing[t]=e}consumeParsing(t){const e=this.parsing[t];if(e)return delete this.parsing[t],e}clearParsing(t){delete this.parsing[t]}markLoaded(t,e){this.loaded[t]=e}getLoaded(t){const e=this.loaded[t];if(e)return e}removeLoaded(t){delete this.loaded[t]}clearLoaded(){this.loaded={}}}class a{constructor(t,e,i,r,n){this.type=t,this.properties=i||{},this.extent=n,this.pointsArray=e,this.id=r}loadGeometry(){return this.pointsArray.map((e=>e.map((e=>new t.P(e.x,e.y)))))}}class s{constructor(t,e,i){this.version=2,this._myFeatures=t,this.name=e,this.length=t.length,this.extent=i}feature(t){return this._myFeatures[t]}}class l{constructor(){this.layers={}}addLayer(t){this.layers[t.name]=t}}function c(e){let i=t.cS(e);return 0===i.byteOffset&&i.byteLength===i.buffer.byteLength||(i=new Uint8Array(i)),{vectorTile:e,rawData:i.buffer}}function h(e,i,r){const{extent:n}=e,o=Math.pow(2,r.z-i.z),l=(r.x-i.x*o)*n,c=(r.y-i.y*o)*n,h=[];for(let s=0;s<e.length;s++){const i=e.feature(s);let r=i.loadGeometry();for(const t of r)for(const e of t)e.x=e.x*o-l,e.y=e.y*o-c;const u=128;r=t.cT(r,i.type,-u,-u,n+u,n+u),0!==r.length&&h.push(new a(i.type,r,i.properties,i.id,n))}return new s(h,e.name,n)}class u{constructor(e,i,r){this.actor=e,this.layerIndex=i,this.availableImages=r,this.tileState=new o,this.overzoomedTileResultCache=new t.cU(1e3)}loadVectorTile(e,i){try{return{vectorTile:"mlt"!==e.encoding?new t.cV(new t.cW(i)):new t.cX(i),rawData:i}}catch(t){const n=new Uint8Array(i);let o="Unable to parse the tile at ".concat(e.request.url,", ");throw o+=31===n[0]&&139===n[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":"got error: ".concat(t.message),new Error(o)}}loadTile(e){return t._(this,void 0,void 0,(function*(){const{uid:i,overzoomParameters:n}=e;n&&(e.request=n.overzoomRequest);const o=this._startRequestTiming(e),a=new r(e);this.tileState.startLoading(i,a);const s=new AbortController;a.abort=s;try{const r=yield t.n(e.request,s);if(e.etag&&e.etag===r.etag)return this.tileState.finishLoading(i),this._getEtagUnmodifiedResult(r,o);const l=this.loadVectorTile(e,r.data);if(this.tileState.finishLoading(i),!l)return null;let{vectorTile:c,rawData:h}=l;n&&({vectorTile:c,rawData:h}=this._getOverzoomTile(e,c));const u=this._getExpiryData(r),d=this._finishRequestTiming(o);a.vectorTile=c,this.tileState.markLoaded(i,a);const p={rawData:h,cacheControl:u,resourceTiming:d};this.tileState.setParsing(i,p);try{return yield this._parseWorkerTile(a,e,p)}finally{this.tileState.clearParsing(i)}}catch(t){throw this.tileState.finishLoading(i),a.status="done",this.tileState.markLoaded(i,a),t}}))}_getEtagUnmodifiedResult(e,i){const r=this._getExpiryData(e),n=this._finishRequestTiming(i);return t.e({etagUnmodified:!0},r,n)}_parseWorkerTile(e,i,r){return t._(this,void 0,void 0,(function*(){let n=yield e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.actor,i.subdivisionGranularity);if(r){const{rawData:e,cacheControl:o,resourceTiming:a}=r;n=t.e({rawTileData:e.slice(0),encoding:i.encoding},n,o,a)}return n}))}
1_getExpiryData(t){let{expires:e,cacheControl:i,etag:r}=t;const n={};return e&&(n.expires=e),i&&(n.cacheControl=i),r&&(n.etag=r),n}_startRequestTiming(e){var i;if(null===(i=e.request)||void 0===i?void 0:i.collectResourceTiming)return new t.cY(e.request.url)}_finishRequestTiming(t){const e=null==t?void 0:t.finish();return e?{resourceTiming:JSON.parse(JSON.stringify(e))}:{}}_getOverzoomTile(t,e){const{tileID:i,source:r,overzoomParameters:n}=t,{maxZoomTileID:o}=n,a="".concat(o.key,"_").concat(i.key),s=this.overzoomedTileResultCache.get(a);if(s)return s;const u=new l,d=this.layerIndex.familiesBySource[r];for(const l in d){const t=e.layers[l];if(!t)continue;const r=h(t,o,i.canonical);r.length>0&&u.addLayer(r)}const p=c(u);return this.overzoomedTileResultCache.set(a,p),p}reloadTile(e){return t._(this,void 0,void 0,(function*(){const t=e.uid,i=this.tileState.getLoaded(t);if(!i)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(i.showCollisionBoxes=e.showCollisionBoxes,"parsing"===i.status){const r=this.tileState.consumeParsing(t);return yield this._parseWorkerTile(i,e,r)}if("done"===i.status&&i.vectorTile)return yield this._parseWorkerTile(i,e)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){this.tileState.abort(e.uid)}))}removeTile(e){return t._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(e.uid)}))}}class d{constructor(){this.loaded={}}loadTile(e){return t._(this,void 0,void 0,(function*(){const{uid:i,encoding:r,rawImageData:n,redFactor:o,greenFactor:a,blueFactor:s,baseShift:l}=e,c=n.width+2,h=n.height+2,u=t.b(n)?new t.R({width:c,height:h},yield t.cZ(n,-1,-1,c,h)):n,d=new t.c_(i,u,r,o,a,s,l);return this.loaded=this.loaded||{},this.loaded[i]=d,d}))}removeTile(t){const e=this.loaded,i=t.uid;e&&e[i]&&delete e[i]}}class p{constructor(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:f;this.actor=t,this.layerIndex=e,this.availableImages=i,this.tileState=new o,this._createGeoJSONIndex=r}loadVectorTile(e){if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const{z:i,x:r,y:n}=e.tileID.canonical,o=this._geoJSONIndex.getTile(i,r,n);return o?c(new t.c$(o.features,{version:2,extent:t.a5})):null}loadTile(e){return t._(this,void 0,void 0,(function*(){const{uid:t}=e,i=new r(e);i.abort=new AbortController;try{const r=this.loadVectorTile(e);if(!r)return null;const{vectorTile:n,rawData:o}=r;i.vectorTile=n,this.tileState.markLoaded(t,i);const a={rawData:o};this.tileState.setParsing(t,a);try{return yield this._parseWorkerTile(i,e,a)}finally{this.tileState.clearParsing(t)}}catch(e){throw i.status="done",this.tileState.markLoaded(t,i),e}}))}_reloadLoadedTile(e){return t._(this,void 0,void 0,(function*(){const t=e.uid,i=this.tileState.getLoaded(t);if(!i)throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");if(i.showCollisionBoxes=e.showCollisionBoxes,"parsing"===i.status){const r=this.tileState.consumeParsing(t);return yield this._parseWorkerTile(i,e,r)}if("done"===i.status&&i.vectorTile)return yield this._parseWorkerTile(i,e)}))}_parseWorkerTile(e,i,r){return t._(this,void 0,void 0,(function*(){let n=yield e.parse(e.vectorTile,this.layerIndex,this.availableImages,this.actor,i.subdivisionGranularity);if(r){const{rawData:e}=r;n=t.e({rawTileData:e.slice(0),encoding:"mvt"},n)}return n}))}abortTile(e){return t._(this,void 0,void 0,(function*(){this.tileState.abort(e.uid)}))}removeTile(e){return t._(this,void 0,void 0,(function*(){this.tileState.removeLoaded(e.uid)}))}loadData(e){return t._(this,void 0,void 0,(function*(){var i;null===(i=this._pendingRequest)||void 0===i||i.abort();const r=this._startRequestTiming(e);this._pendingRequest=new AbortController;try{yield this.loadAndProcessGeoJSON(e,this._pendingRequest),delete this._pendingRequest,this.tileState.clearLoaded();const t={};return e.request&&(t.data=e.data),this._finishRequestTiming(r,e,t),t}catch(e){if(delete this._pendingRequest,!t.Z(e))throw e;return{abandoned:!0}}}))}_startRequestTiming(e){var i;if(null===(i=e.request)||void 0===i?void 0:i.collectResourceTiming)return new t.cY(e.request.url)}_finishRequestTiming(t,e,i){const r=null==t?void 0:t.finish();r&&(i.resourceTiming={[e.source]:JSON.parse(JSON.stringify(r))})}reloadTile(t){return this.tileState.getLoaded(t.uid)?this._reloadLoadedTile(t):this.loadTile(t)}loadAndProcessGeoJSON(e,i){return t._(this,void 0,void 0,(function*(){var r;if(e.request&&(e.data=(yield t.j(e.request,i)).data),e.data)return e.data=this._filterGeoJSON(e.data,e.filter),void(this._geoJSONIndex=this._createGeoJSONIndex(e.data,e));if(e.dataDiff)return null!==(r=this._geoJSONIndex)&&void 0!==r||(this._geoJSONIndex=this._createGeoJSONIndex({type:"FeatureCollection",features:[]},e)),void this._geoJSONIndex.updateData(e.dataDiff,this._getFilterPredicate(e.filter));if(e.updateCluster&&this._geoJSONIndex.updateClusterOptions(e.cluster,m(e)),null==this._geoJSONIndex)throw new Error("Input data given to '".concat(e.source,"' is not a valid GeoJSON object."))}))}_filterGeoJSON(t,e){if("FeatureCollection"!==t.type)return t;const i=this._getFilterPredicate(e);return i?{type:"FeatureCollection",features:t.features.filter((t=>i(t)))}:t}_getFilterPredicate(e){if("boolean"!=typeof e&&!(null==e?void 0:e.length))return;const i=t.d0(e,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===i.result)throw new Error(i.value.map((t=>"".concat(t.key,": ").concat(t.message))).join(", "));return t=>i.value.evaluate({zoom:0},t)}removeSource(e){return t._(this,void 0,void 0,(function*(){var t;
1null===(t=this._pendingRequest)||void 0===t||t.abort()}))}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getClusterChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getClusterLeaves(t.clusterId,t.limit,t.offset)}}function f(e,i){const r=t.e(i.geojsonVtOptions||{},{updateable:!0,cluster:i.cluster,clusterOptions:m(i)});return new t.d1(e,r)}function m(e){let{superclusterOptions:i,clusterProperties:r}=e;if(!r||!i)return i;const n={},o={},a={accumulated:null,zoom:0},s={properties:null},l=Object.keys(r);for(const c of l){const[e,i]=r[c],a=t.d0(i),s=t.d0("string"==typeof e?[e,["accumulated"],["get",c]]:e);n[c]=a.value,o[c]=s.value}return i.map=t=>{s.properties=t;const e={};for(const i of l)e[i]=n[i].evaluate(a,s);return e},i.reduce=(t,e)=>{s.properties=e;for(const i of l)a.accumulated=t[i],t[i]=o[i].evaluate(a,s)},i}class g{constructor(e){this.self=e,this.actor=new t.L(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(t,e)=>{if(this.externalWorkerSourceTypes[t])throw new Error('Worker source with name "'.concat(t,'" already registered.'));this.externalWorkerSourceTypes[t]=e},this.self.addProtocol=t.cH,this.self.removeProtocol=t.cI,this.self.registerRTLTextPlugin=e=>{t.d2.setMethods(e)},this.actor.registerMessageHandler("LDT",((t,e)=>this._getDEMWorkerSource(t,e.source).loadTile(e))),this.actor.registerMessageHandler("RDT",((e,i)=>t._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(e,i.source).removeTile(i)})))),this.actor.registerMessageHandler("GCEZ",((e,i)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,i.type,i.source).getClusterExpansionZoom(i)})))),this.actor.registerMessageHandler("GCC",((e,i)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,i.type,i.source).getClusterChildren(i)})))),this.actor.registerMessageHandler("GCL",((e,i)=>t._(this,void 0,void 0,(function*(){return this._getWorkerSource(e,i.type,i.source).getClusterLeaves(i)})))),this.actor.registerMessageHandler("LD",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadData(e))),this.actor.registerMessageHandler("LT",((t,e)=>this._getWorkerSource(t,e.type,e.source).loadTile(e))),this.actor.registerMessageHandler("RT",((t,e)=>this._getWorkerSource(t,e.type,e.source).reloadTile(e))),this.actor.registerMessageHandler("AT",((t,e)=>this._getWorkerSource(t,e.type,e.source).abortTile(e))),this.actor.registerMessageHandler("RMT",((t,e)=>this._getWorkerSource(t,e.type,e.source).removeTile(e))),this.actor.registerMessageHandler("RS",((e,i)=>t._(this,void 0,void 0,(function*(){if(!this.workerSources[e]||!this.workerSources[e][i.type]||!this.workerSources[e][i.type][i.source])return;const t=this.workerSources[e][i.type][i.source];delete this.workerSources[e][i.type][i.source],void 0!==t.removeSource&&t.removeSource(i)})))),this.actor.registerMessageHandler("RM",(e=>t._(this,void 0,void 0,(function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],this.globalStates.delete(e)})))),this.actor.registerMessageHandler("SR",((e,i)=>t._(this,void 0,void 0,(function*(){this.referrer=i})))),this.actor.registerMessageHandler("SRPS",((t,e)=>this._syncRTLPluginState(t,e))),this.actor.registerMessageHandler("IS",((e,i)=>t._(this,void 0,void 0,(function*(){this.self.importScripts(i)})))),this.actor.registerMessageHandler("SI",((t,e)=>this._setImages(t,e))),this.actor.registerMessageHandler("UL",((e,i)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).update(i.layers,i.removedIds,this._getGlobalState(e))})))),this.actor.registerMessageHandler("UGS",((e,i)=>t._(this,void 0,void 0,(function*(){const t=this._getGlobalState(e);for(const e in i)t[e]=i[e]})))),this.actor.registerMessageHandler("SL",((e,i)=>t._(this,void 0,void 0,(function*(){this._getLayerIndex(e).replace(i,this._getGlobalState(e))}))))}_getGlobalState(t){let e=this.globalStates.get(t);return e||(e={},this.globalStates.set(t,e)),e}_setImages(e,i){return t._(this,void 0,void 0,(function*(){this.availableImages[e]=i;for(const t in this.workerSources[e]){const r=this.workerSources[e][t];for(const t in r)r[t].availableImages=i}}))}_syncRTLPluginState(e,i){return t._(this,void 0,void 0,(function*(){return yield t.d2.syncState(i,this.self.importScripts)}))}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let i=this.layerIndexes[t];
1return i||(i=this.layerIndexes[t]=new e),i}_getWorkerSource(t,e,i){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][i]){const r={sendAsync:(e,i)=>(e.targetMapId=t,this.actor.sendAsync(e,i))};switch(e){case"vector":this.workerSources[t][e][i]=new u(r,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][i]=new p(r,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][i]=new this.externalWorkerSourceTypes[e](r,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][i]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new d),this.demWorkerSources[t][e]}}return t.i(self)&&(self.worker=new g(self)),g})),i("index",["exports","./shared"],(function(t,e){var i="5.20.1";function r(){var t=new e.A(4);return e.A!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}let n,o,a;const s={frame(t,i,r,n){const o=n||window,a=o.requestAnimationFrame((t=>{s(),i(t)})),{unsubscribe:s}=e.s(t.signal,"abort",(()=>{s(),o.cancelAnimationFrame(a),r(new e.a(t.signal.reason))}),!1)},frameAsync(t,e){return new Promise(((i,r)=>{this.frame(t,i,r,e)}))},getImageData(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){const e=window.document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0,t.width,t.height),i},resolveURL:t=>(n||(n=document.createElement("a")),n.href=t,n.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return void 0!==a?a:!!matchMedia&&(null==o&&(o=matchMedia("(prefers-reduced-motion: reduce)")),o.matches)},set prefersReducedMotion(t){a=t}},l=new class{constructor(){this._realTime="undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),this._frozenAt=null}getCurrentTime(){return null!==this._frozenAt?this._frozenAt:this._realTime()}setNow(t){this._frozenAt=t}restoreNow(){this._frozenAt=null}isFrozen(){return null!==this._frozenAt}};function c(){return l.getCurrentTime()}class h{static testProp(t){if(!h.docStyle)return t[0];for(let e=0;e<t.length;e++)if(t[e]in h.docStyle)return t[e];return t[0]}static create(t,e,i){const r=window.document.createElement(t);return void 0!==e&&(r.className=e),i&&i.appendChild(r),r}static createNS(t,e){return window.document.createElementNS(t,e)}static disableDrag(){h.docStyle&&h.selectProp&&(h.userSelect=h.docStyle[h.selectProp],h.docStyle[h.selectProp]="none")}static enableDrag(){h.docStyle&&h.selectProp&&(h.docStyle[h.selectProp]=h.userSelect)}static setTransform(t,e){t.style[h.transformProp]=e}static addEventListener(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.addEventListener(e,i,"passive"in r?r:r.capture)}static removeEventListener(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.removeEventListener(e,i,"passive"in r?r:r.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",h.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",h.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",h.suppressClickInternal,!0)}),0)}static getScale(t){const e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}static getPoint(t,i,r){const n=i.boundingClientRect;return new e.P((r.clientX-n.left)/i.x-t.clientLeft,(r.clientY-n.top)/i.y-t.clientTop)}static mousePos(t,e){const i=h.getScale(t);return h.getPoint(t,i,e)}static touchPos(t,e){const i=[],r=h.getScale(t);for(let n=0;n<e.length;n++)i.push(h.getPoint(t,r,e[n]));return i}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}static sanitize(t){const e=(new DOMParser).parseFromString(t,"text/html").body||document.createElement("body"),i=e.querySelectorAll("script");for(const r of i)r.remove();return h.clean(e),e.innerHTML}static isPossiblyDangerous(t,e){const i=e.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(t)||!i.includes("javascript:")&&!i.includes("data:"))||!!t.startsWith("on")||void 0}static clean(t){const e=t.children;for(const i of e)h.removeAttributes(i),h.clean(i)}static removeAttributes(t){for(const{name:e,value:i}of t.attributes)h.isPossiblyDangerous(e,i)&&t.removeAttribute(e)}}h.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,h.selectProp=h.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),h.transformProp=h.testProp(["transform","WebkitTransform"]);const u={supported:!1,testSupport:function(t){!f&&p&&(m?g(t):d=t)}};let d,p,f=!1,m=!1;function g(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,p),t.isContextLost())return;u.supported=!0}
1catch(t){}t.deleteTexture(e),f=!0}var _;"undefined"!=typeof document&&(p=document.createElement("img"),p.onload=()=>{d&&g(d),d=null,m=!0},p.onerror=()=>{f=!0,d=null},p.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(t){let i,r,n,o;t.resetRequestQueue=()=>{i=[],r=0,n=0,o={}},t.addThrottleControl=t=>{const e=n++;return o[e]=t,e},t.removeThrottleControl=t=>{delete o[t],s()},t.getImage=function(t,r){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new Promise(((o,a)=>{u.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),e.e(t,{type:"image"}),i.push({abortController:r,requestParameters:t,supportImageRefresh:n,state:"queued",onError:t=>{a(t)},onSuccess:t=>{o(t)}}),s()}))};const a=t=>e._(this,void 0,void 0,(function*(){t.state="running";const{requestParameters:i,supportImageRefresh:n,onError:o,onSuccess:a,abortController:c}=t,h=!1===n&&!e.i(self)&&!e.g(i.url)&&(!i.headers||Object.keys(i.headers).reduce(((t,e)=>t&&"accept"===e),!0));r++;const u=h?l(i,c):e.m(i,c);try{const i=yield u;delete t.abortController,t.state="completed",i.data instanceof HTMLImageElement||e.b(i.data)?a(i):i.data&&a({data:yield(d=i.data,"function"==typeof createImageBitmap?e.f(d):e.h(d)),cacheControl:i.cacheControl,expires:i.expires})}catch(e){delete t.abortController,o(e)}finally{r--,s()}var d})),s=()=>{const t=(()=>{for(const t of Object.keys(o))if(o[t]())return!0;return!1})()?e.c.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.c.MAX_PARALLEL_IMAGE_REQUESTS;for(let e=r;e<t&&i.length>0;e++){const t=i.shift();t.abortController.signal.aborted?e--:a(t)}},l=(t,i)=>new Promise(((r,n)=>{const o=new Image,a=t.url,s=t.credentials;s&&"include"===s?o.crossOrigin="use-credentials":(s&&"same-origin"===s||!e.d(a))&&(o.crossOrigin="anonymous"),i.signal.addEventListener("abort",(()=>{o.src="",n(new e.a(i.signal.reason))})),o.fetchPriority="high",o.onload=()=>{o.onerror=o.onload=null,r({data:o})},o.onerror=()=>{o.onerror=o.onload=null,i.signal.aborted||n(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},o.src=a}))}(_||(_={})),_.resetRequestQueue();class y{constructor(t){this._transformRequestFn=null!=t?t:null}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function v(t){const e=[];if("string"==typeof t)e.push({id:"default",url:t});else if(t&&t.length>0){const i=[];for(const{id:r,url:n}of t){const t="".concat(r).concat(n);-1===i.indexOf(t)&&(i.push(t),e.push({id:r,url:n}))}}return e}function x(t,e,i){try{const r=new URL(t);return r.pathname+="".concat(e).concat(i),r.toString()}catch(e){throw new Error('Invalid sprite URL "'.concat(t,'", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically'))}}function b(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class w extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}destroy(){this.atlasTexture&&(this.atlasTexture.destroy(),this.atlasTexture=null);for(const t of Object.keys(this.images))this.removeImage(t);this.patterns={},this.atlasImage=new e.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:t,promiseResolve:e}of this.requestors)e(this._getImagesForIds(t));this.requestors=[]}}getImage(t){const i=this.images[t];if(i&&!i.data&&i.spriteData){const t=i.spriteData;i.data=new e.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),i.spriteData=null}return i}addImage(t,e){if(this.images[t])throw new Error("Image id ".concat(t," already exist, use updateImage instead"));this._validate(t,e)&&(this.images[t]=e)}_validate(t,i){let r=!0;const n=i.data||i.spriteData;
vendor: 4,771 bytes, line 1
1return this._validateStretch(i.stretchX,n&&n.width)||(this.fire(new e.k(new Error('Image "'.concat(t,'" has invalid "stretchX" value')))),r=!1),this._validateStretch(i.stretchY,n&&n.height)||(this.fire(new e.k(new Error('Image "'.concat(t,'" has invalid "stretchY" value')))),r=!1),this._validateContent(i.content,i)||(this.fire(new e.k(new Error('Image "'.concat(t,'" has invalid "content" value')))),r=!1),r}_validateStretch(t,e){if(!t)return!0;let i=0;for(const r of t){if(r[0]<i||r[1]<r[0]||e<r[1])return!1;i=r[1]}return!0}_validateContent(t,e){if(!t)return!0;if(4!==t.length)return!1;const i=e.spriteData,r=i&&i.width||e.data.width,n=i&&i.height||e.data.height;return!(t[0]<0||r<t[0]||t[1]<0||n<t[1]||t[2]<0||r<t[2]||t[3]<0||n<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=this.getImage(t);if(i&&(r.data.width!==e.data.width||r.data.height!==e.data.height))throw new Error("size mismatch between old image (".concat(r.data.width,"x").concat(r.data.height,") and new image (").concat(e.data.width,"x").concat(e.data.height,")."));e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=!0}removeImage(t){const e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise(((e,i)=>{let r=!0;if(!this.isLoaded())for(const n of t)this.images[n]||(r=!1);this.isLoaded()||r?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})}))}_getImagesForIds(t){const i={};for(const r of t){let t=this.getImage(r);t||(this.fire(new e.l("styleimagemissing",{id:r})),t=this.getImage(r)),t?i[r]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.w('Image "'.concat(r,'" 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.'))}return i}getPixelSize(){const{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(t){const i=this.patterns[t],r=this.getImage(t);if(!r)return null;if(i&&i.position.version===r.version)return i.position;if(i)i.position.version=r.version;else{const i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},n=new e.I(i,r);this.patterns[t]={bin:i,position:n}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const i=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.T(t,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:i,h:r}=e.p(t),n=this.atlasImage;n.resize({width:i||1,height:r||1});for(const o in this.patterns){const{bin:t}=this.patterns[o],i=t.x+1,r=t.y+1,a=this.getImage(o).data,s=a.width,l=a.height;e.R.copy(a,n,{x:0,y:0},{x:i,y:r},{width:s,height:l}),e.R.copy(a,n,{x:0,y:l-1},{x:i,y:r-1},{width:s,height:1}),e.R.copy(a,n,{x:0,y:0},{x:i,y:r+l},{width:s,height:1}),e.R.copy(a,n,{x:s-1,y:0},{x:i-1,y:r},{width:1,height:l}),e.R.copy(a,n,{x:0,y:0},{x:i+s,y:r},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const i of t){if(this.callbackDispatchedThisFrame[i])continue;this.callbackDispatchedThisFrame[i]=!0;const t=this.getImage(i);t||e.w('Image with ID: "'.concat(i,'" was not found')),b(t)&&this.updateImage(i,t)}}cloneImages(){const t={};for(const e in this.images){const i=this.images[e];t[e]=Object.assign(Object.assign({},i),{data:i.data?i.data.clone():null})}return t}}const T=1e20;function S(t,e,i,r,n,o,a,s,l){for(let c=e;c<e+r;c++)P(t,i*o+c,o,n,a,s,l);for(let c=i;c<i+n;c++)P(t,c*o+e,1,r,a,s,l)}function P(t,e,i,r,n,o,a){o[0]=0,a[0]=-T,a[1]=T,n[0]=t[e];for(let s=1,l=0,c=0;s<r;s++){n[s]=t[e+s*i];const r=s*s;do{const t=o[l];c=(n[s]-n[t]+r-t*t)/(s-t)/2}while(c<=a[l]&&--l>-1);l++,o[l]=s,a[l]=c,a[l+1]=T}for(let s=0,l=0;s<r;s++){for(;a[l+1]<s;)l++;const r=o[l],c=s-r;t[e+s*i]=n[r]+c*c}}const I=e.v.layout_symbol["text-font"].default.join(",");class M{constructor(t,e,i){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={},this.lang=i}setURL(t){this.url=t}getGlyphs(t){return e._(this,void 0,void 0,(function*(){const e=[];for(const n in t)for(const i of t[n])e.push(this._getAndCacheGlyphsPromise(n,i));const i=yield Promise.all(e),r={};for(const{stack:t,id:n,glyph:o}of i)r[t]||(r[t]={}),r[t][n]=o&&{id:o.id,bitmap:o.bitmap.clone(),metrics:o.metrics};return r}))}
1_getAndCacheGlyphsPromise(t,i){return e._(this,void 0,void 0,(function*(){let e=this.entries[t];e||(e=this.entries[t]={glyphs:{},requests:{},ranges:{}});let r=e.glyphs[i];return void 0!==r?{stack:t,id:i,glyph:r}:!this.url||this._charUsesLocalIdeographFontFamily(i)?(r=e.glyphs[i]=this._drawGlyph(e,t,i),{stack:t,id:i,glyph:r}):yield this._downloadAndCacheRangePromise(t,i)}))}_downloadAndCacheRangePromise(t,i){return e._(this,void 0,void 0,(function*(){const e=this.entries[t],r=Math.floor(i/256);if(e.ranges[r])return{stack:t,id:i,glyph:null};if(!e.requests[r]){const i=M.loadGlyphRange(t,r,this.url,this.requestManager);e.requests[r]=i}try{const n=yield e.requests[r];for(const t in n)e.glyphs[+t]=n[+t];return e.ranges[r]=!0,{stack:t,id:i,glyph:n[i]||null}}catch(n){const a=e.glyphs[i]=this._drawGlyph(e,t,i);return this._warnOnMissingGlyphRange(a,r,i,n),{stack:t,id:i,glyph:a}}}))}_warnOnMissingGlyphRange(t,i,r,n){const o=256*i,a=o+255,s=r.toString(16).padStart(4,"0").toUpperCase();e.w("Unable to load glyph range ".concat(i,", ").concat(o,"-").concat(a,". Rendering codepoint U+").concat(s," locally instead. ").concat(n))}_charUsesLocalIdeographFontFamily(t){return!!this.localIdeographFontFamily&&e.q(t)}_drawGlyph(t,i,r){const n=i===I&&""!==this.localIdeographFontFamily&&this._charUsesLocalIdeographFontFamily(r),o=n?"ideographTinySDF":"tinySDF";t[o]||(t[o]=this._createTinySDF(n?this.localIdeographFontFamily:i));const a=t[o].draw(String.fromCodePoint(r)),s=/^(?:[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F])+$/.test(String.fromCodePoint(r));return{id:r,bitmap:new e.r({width:a.width||60,height:a.height||60},a.data),metrics:{width:s?0:a.glyphWidth/2||24,height:a.glyphHeight/2||24,left:a.glyphLeft/2+.5||0,top:a.glyphTop/2-27.5||-8,advance:s?0:a.glyphAdvance/2||24,isDoubleResolution:!0}}}_createTinySDF(t){const e=t?t.split(","):[];e.push("sans-serif");const i=e.map((t=>/[-\w]+/.test(t)?t:"'".concat(CSS.escape(t),"'"))).join(",");return new M.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:this._fontWeight(e[0]),fontStyle:this._fontStyle(e[0]),lang:this.lang})}_fontStyle(t){return/italic/i.test(t)?"italic":/oblique/i.test(t)?"oblique":"normal"}_fontWeight(t){const e={thin:100,hairline:100,"extra light":200,"ultra light":200,light:300,normal:400,regular:400,medium:500,semibold:600,demibold:600,bold:700,"extra bold":800,"ultra bold":800,black:900,heavy:900,"extra black":950,"ultra black":950};let i;for(const[r,n]of Object.entries(e))new RegExp("\\b".concat(r,"\\b"),"i").test(t)&&(i="".concat(n));return i}destroy(){for(const t in this.entries){const e=this.entries[t];e.tinySDF&&(e.tinySDF=null),e.ideographTinySDF&&(e.ideographTinySDF=null),e.glyphs={},e.requests={},e.ranges={}}this.entries={}}}M.loadGlyphRange=function(t,i,r,n){return e._(this,void 0,void 0,(function*(){const o=256*i,a=o+255,s=n.transformRequest(r.replace("{fontstack}",t).replace("{range}","".concat(o,"-").concat(a)),"Glyphs"),l=yield e.n(s,new AbortController);if(!l||!l.data)throw new Error("Could not load glyph range. range: ".concat(i,", ").concat(o,"-").concat(a));const c={};for(const t of e.o(l.data))c[t.id]=t;return c}))},M.TinySDF=class{constructor(){let{fontSize:t=24,buffer:e=3,radius:i=8,cutoff:r=.25,fontFamily:n="sans-serif",fontWeight:o="normal",fontStyle:a="normal",lang:s=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.buffer=e,this.cutoff=r,this.radius=i,this.lang=s;const l=this.size=t+4*e,c=this._createCanvas(l),h=this.ctx=c.getContext("2d",{willReadFrequently:!0});h.font="".concat(a," ").concat(o," ").concat(t,"px ").concat(n),h.textBaseline="alphabetic",h.textAlign="left",h.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:n,actualBoundingBoxRight:o}=this.ctx.measureText(t),a=Math.ceil(i),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-n))
vendor: 4,373 bytes, line 1
1),l=Math.min(this.size-this.buffer,a+Math.ceil(r)),c=s+2*this.buffer,h=l+2*this.buffer,u=Math.max(c*h,0),d=new Uint8ClampedArray(u),p={data:d,width:c,height:h,glyphWidth:s,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:e};if(0===s||0===l)return p;const{ctx:f,buffer:m,gridInner:g,gridOuter:_}=this;this.lang&&(f.lang=this.lang),f.clearRect(m,m,s,l),f.fillText(t,m,m+a);const y=f.getImageData(m,m,s,l);_.fill(T,0,u),g.fill(0,0,u);for(let v=0;v<l;v++)for(let t=0;t<s;t++){const e=y.data[4*(v*s+t)+3]/255;if(0===e)continue;const i=(v+m)*c+t+m;if(1===e)_[i]=0,g[i]=T;else{const t=.5-e;_[i]=t>0?t*t:0,g[i]=t<0?t*t:0}}S(_,0,0,c,h,c,this.f,this.v,this.z),S(g,m,m,s,l,c,this.f,this.v,this.z);for(let v=0;v<u;v++){const t=Math.sqrt(_[v])-Math.sqrt(g[v]);d[v]=Math.round(255-255*(t/this.radius+this.cutoff))}return p}};class E{constructor(){this.specification=e.u.light.position}possiblyEvaluate(t,i){return e.F(t.expression.evaluate(i))}interpolate(t,i,r){return{x:e.G.number(t.x,i.x,r),y:e.G.number(t.y,i.y,r),z:e.G.number(t.z,i.z,r)}}}let C;class A extends e.E{constructor(t){super(),C=C||new e.t({anchor:new e.D(e.u.light.anchor),position:new E,color:new e.D(e.u.light.color),intensity:new e.D(e.u.light.intensity)}),this._transitionable=new e.x(C,void 0),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(e.y,t,i))for(const r in t){const i=t[r];r.endsWith(e.z)?this._transitionable.setTransition(r.slice(0,-e.z.length),i):this._transitionable.setValue(r,i)}}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,i,r){return(!r||!1!==r.validate)&&e.B(this,t.call(e.C,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.u}))}}const D=new e.t({"sky-color":new e.D(e.u.sky["sky-color"]),"horizon-color":new e.D(e.u.sky["horizon-color"]),"fog-color":new e.D(e.u.sky["fog-color"]),"fog-ground-blend":new e.D(e.u.sky["fog-ground-blend"]),"horizon-fog-blend":new e.D(e.u.sky["horizon-fog-blend"]),"sky-horizon-blend":new e.D(e.u.sky["sky-horizon-blend"]),"atmosphere-blend":new e.D(e.u.sky["atmosphere-blend"])});class z extends e.E{constructor(t){super(),this._transitionable=new e.x(D,void 0),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.H(0))}setSky(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(e.J,t,i)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const i in t){const r=t[i];i.endsWith(e.z)?this._transitionable.setTransition(i.slice(0,-e.z.length),r):this._transitionable.setValue(i,r)}}}getSky(){return this._transitionable.serialize()}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,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!1!==(null==r?void 0:r.validate)&&e.B(this,t.call(e.C,e.e({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.u})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class k{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,e){const i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]}getDashRanges(t,e,i){const r=[];let n=t.length%2==1?-t[t.length-1]*i:0,o=t[0]*i,a=!0;r.push({left:n,right:o,isDash:a,zeroLength:0===t[0]});let s=t[0];for(let l=1;l<t.length;l++){a=!a;const e=t[l];n=s*i,s+=e,o=s*i,r.push({left:n,right:o,isDash:a,zeroLength:0===e})}return r}addRoundDash(t,e,i){const r=e/2;for(let n=-i;n<=i;n++){const e=this.width*(this.nextRow+i+n);let o=0,a=t[o];for(let s=0;s<this.width;s++){s/a.right>1&&(a=t[++o]);const l=Math.abs(s-a.left),c=Math.abs(s-a.right),h=Math.min(l,c);let u;const d=n/i*(r+1);if(a.isDash){const t=r-Math.abs(d);u=Math.sqrt(h*h+t*t)}else u=r-Math.sqrt(h*h+d*d);this.data[e+s]=Math.max(0,Math.min(255,u+128))}}}
vendor: 4,771 bytes, line 1
1addRegularDash(t){for(let a=t.length-1;a>=0;--a){const e=t[a],i=t[a+1];e.zeroLength?t.splice(a,1):i&&i.isDash===e.isDash&&(i.left=e.left,t.splice(a,1))}const e=t[0],i=t[t.length-1];e.isDash===i.isDash&&(e.left=i.left-this.width,i.right=e.right+this.width);const r=this.width*this.nextRow;let n=0,o=t[n];for(let a=0;a<this.width;a++){a/o.right>1&&(o=t[++n]);const e=Math.abs(a-o.left),i=Math.abs(a-o.right),s=Math.min(e,i);this.data[r+a]=Math.max(0,Math.min(255,(o.isDash?s:-s)+128))}}addDash(t,i){const r=i?7:0,n=2*r+1;if(this.nextRow+n>this.height)return e.w("LineAtlas out of space"),null;let o=0;for(let e=0;e<t.length;e++)o+=t[e];if(0!==o){const e=this.width/o,n=this.getDashRanges(t,this.width,e);i?this.addRoundDash(n,e,r):this.addRegularDash(n)}const a={y:this.nextRow+r,height:2*r,width:o};return this.nextRow+=n,this.dirty=!0,a}bind(t){const e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))}}const R="maplibre_preloaded_worker_pool";class F{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<F.workerCount;)this.workers.push(new Worker(e.c.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((t=>{t.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[R]}numActive(){return Object.keys(this.active).length}}const L=Math.floor(s.hardwareConcurrency/2);let B,O;function V(){return B||(B=new F),B}F.workerCount=e.K(globalThis)?Math.max(Math.min(L,3),1):1;class j{constructor(t,i){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=i;const r=this.workerPool.acquire(i);for(let n=0;n<r.length;n++){const t=new e.L(r[n],i);t.name="Worker ".concat(n),this.actors.push(t)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,e){const i=[];for(const r of this.actors)i.push(r.sendAsync({type:t,data:e}));return Promise.all(i)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.actors.forEach((t=>{t.remove()})),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,e){for(const i of this.actors)i.registerMessageHandler(t,e)}unregisterMessageHandler(t){for(const e of this.actors)e.unregisterMessageHandler(t)}}function N(){return O||(O=new j(V(),e.M),O.registerMessageHandler("GR",((t,i,r)=>e.m(i,r)))),O}function U(t,i){const r=e.N();return e.O(r,r,[1,1,0]),e.Q(r,r,[.5*t.width,.5*t.height,1]),t.calculatePosMatrix?e.S(r,r,t.calculatePosMatrix(i.toUnwrapped())):r}function G(t,e,i,r,n,o,a){var s;const l=function(t,e,i){if(t)for(const r of t){const t=e[r];if(t&&t.source===i&&"fill-extrusion"===t.type)return!0}else for(const r in e){const t=e[r];if(t.source===i&&"fill-extrusion"===t.type)return!0}return!1}(null!==(s=null==n?void 0:n.layers)&&void 0!==s?s:null,e,t.id),c=o.maxPitchScaleFactor(),h=t.tilesIn(r,c,l);h.sort(Z);const u=[];for(const d of h)u.push({wrappedTileID:d.tileID.wrapped().key,queryResults:d.tile.queryRenderedFeatures(e,i,t.getState(),d.queryGeometry,d.cameraQueryGeometry,d.scale,n,o,c,U(o,d.tileID),a?(t,e)=>a(d.tileID,t,e):void 0)});return function(t,e){for(const i in t)for(const r of t[i])q(r,e);return t}(function(t){const e={},i={};for(const r of t){const t=r.queryResults,n=r.wrappedTileID,o=i[n]=i[n]||{};for(const i in t){const r=t[i],n=o[i]=o[i]||{},a=e[i]=e[i]||[];for(const t of r)n[t.featureIndex]||(n[t.featureIndex]=!0,a.push(t))}}return e}(u),t)}function Z(t,e){const i=t.tileID,r=e.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}function q(t,e){const i=t.feature,r=e.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r}function W(t,i,r,n){return e._(this,void 0,void 0,(function*(){let o=t;if(t.url?o=(yield e.j(i.transformRequest(t.url,"Source"),r)).data:yield s.frameAsync(r,n),!o)return null;const a=e.U(e.e(o,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in o&&o.vector_layers&&(a.vectorLayerIds=o.vector_layers.map((t=>t.id))),a}))}
1class X{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):Array.isArray(t)&&(4===t.length?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 e.V?new e.V(t.lng,t.lat):e.V.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.V?new e.V(t.lng,t.lat):e.V.convert(t),this}extend(t){const i=this._sw,r=this._ne;let n,o;if(t instanceof e.V)n=t,o=t;else{if(!(t instanceof X))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(X.convert(t)):this.extend(e.V.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.V.convert(t)):this;if(n=t._sw,o=t._ne,!n||!o)return this}return i||r?(i.lng=Math.min(n.lng,i.lng),i.lat=Math.min(n.lat,i.lat),r.lng=Math.max(o.lng,r.lng),r.lat=Math.max(o.lat,r.lat)):(this._sw=new e.V(n.lng,n.lat),this._ne=new e.V(o.lng,o.lat)),this}getCenter(){return new e.V((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 e.V(this.getWest(),this.getNorth())}getSouthEast(){return new e.V(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(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:i,lat:r}=e.V.convert(t);let n=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n}intersects(t){if(!((t=X.convert(t)).getNorth()>=this.getSouth()&&t.getSouth()<=this.getNorth()))return!1;const i=Math.abs(this.getEast()-this.getWest()),r=Math.abs(t.getEast()-t.getWest());if(i>=360||r>=360)return!0;const n=e.W(this.getWest(),-180,180),o=e.W(this.getEast(),-180,180),a=e.W(t.getWest(),-180,180),s=e.W(t.getEast(),-180,180),l=n>o,c=a>s;return!(!l||!c)||(l?s>=n||a<=o:c?o>=a||n<=s:a<=o&&s>=n)}static convert(t){return t instanceof X?t:t?new X(t):t}static fromLngLat(t){const i=360*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)/40075017,r=i/Math.cos(Math.PI/180*t.lat);return new X(new e.V(t.lng-r,t.lat-i),new e.V(t.lng+r,t.lat+i))}adjustAntiMeridian(){const t=new e.V(this._sw.lng,this._sw.lat),i=new e.V(this._ne.lng,this._ne.lat);return new X(t,t.lng>i.lng?new e.V(i.lng+360,i.lat):i)}}class H{constructor(t,e,i){this.bounds=X.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24}validateBounds(t){return Array.isArray(t)&&4===t.length?[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 i=Math.pow(2,t.z),r=Math.floor(e.Y(this.bounds.getWest())*i),n=Math.floor(e.X(this.bounds.getNorth())*i),o=Math.ceil(e.Y(this.bounds.getEast())*i),a=Math.ceil(e.X(this.bounds.getSouth())*i);return t.x>=r&&t.x<o&&t.y>=n&&t.y<a}}class Y extends e.E{constructor(t,i,r,n){if(super(),this.id=t,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.e(this,e.U(i,["url","scheme","tileSize","promoteId","encoding"])),this._options=e.e({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}load(){return e._(this,arguments,void 0,(function(){var t=this;let i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function*(){t._loaded=!1,t.fire(new e.l("dataloading",{dataType:"source"})),t._tileJSONRequest=new AbortController;try{const r=yield W(t._options,t.map._requestManager,t._tileJSONRequest,t.map._ownerWindow);t._tileJSONRequest=null,t._loaded=!0,r&&(e.e(t,r),r.bounds&&(t.tileBounds=new H(r.bounds,t.minzoom,t.maxzoom)),t.fire(new e.l("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new e.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:i})))}catch(i){t._tileJSONRequest=null,t._loaded=!0,e.Z(i)||t.fire(new e.k(i))}}()}))}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.abort(),t(),this.load(!0)}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.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i={request:this.map._requestManager.transformRequest(e,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
1ype,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity,encoding:this.encoding,overzoomParameters:this._getOverzoomParameters(t),etag:t.etag};i.request.collectResourceTiming=this._collectResourceTiming;let r="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise(((e,i)=>{t.reloadPromise={resolve:e,reject:i}}))}else t.actor=this.dispatcher.getActor(),r="LT";t.abortController=new AbortController;try{const e=yield t.actor.sendAsync({type:r,data:i},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,e);const n={};return(null==e?void 0:e.etagUnmodified)&&(n.unmodified=!0),n}catch(e){if(delete t.abortController,t.aborted)return;if(e&&404!==e.status)throw e;this._afterTileLoadWorkerResponse(t,null)}}))}_getOverzoomParameters(t){if(t.tileID.canonical.z<=this.maxzoom)return;if(void 0===this.map._zoomLevelsToOverscale)return;const e=t.tileID.scaledTo(this.maxzoom).canonical,i=e.url(this.tiles,this.map.getPixelRatio(),this.scheme);return{maxZoomTileID:e,overzoomRequest:this.map._requestManager.transformRequest(i,"Tile")}}_afterTileLoadWorkerResponse(t,e){if((null==e?void 0:e.resourceTiming)&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.etag=null==e?void 0:e.etag,t.loadVectorData(e,this.map.painter),t.reloadPromise){const e=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(e.resolve).catch(e.reject)}}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.t
1ype,source:this.id}}))}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class K extends e.E{constructor(t,i,r,n){super(),this.id=t,this.dispatcher=r,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},i),e.e(this,e.U(i,["url","scheme","tileSize"]))}load(){return e._(this,arguments,void 0,(function(){var t=this;let i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function*(){t._loaded=!1,t.fire(new e.l("dataloading",{dataType:"source"})),t._tileJSONRequest=new AbortController;try{const r=yield W(t._options,t.map._requestManager,t._tileJSONRequest,t.map._ownerWindow);t._tileJSONRequest=null,t._loaded=!0,r&&(e.e(t,r),r.bounds&&(t.tileBounds=new H(r.bounds,t.minzoom,t.maxzoom)),t.fire(new e.l("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new e.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:i})))}catch(i){t._tileJSONRequest=null,t._loaded=!0,e.Z(i)||t.fire(new e.k(i))}}()}))}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load(!0)}setTiles(t){return this.setSourceProperty((()=>{this._options.tiles=t})),this}setUrl(t){return this.setSourceProperty((()=>{this.url=t,this._options.url=t})),this}serialize(){return e.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return e._(this,void 0,void 0,(function*(){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const r=yield _.getImage(this.map._requestManager.transformRequest(i,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&(r.cacheControl||r.expires)&&t.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const i=this.map.painter.context,n=i.gl,o=r.data;t.texture=this.map.painter.getTileTexture(o.width),t.texture?t.texture.update(o,{useMipmap:!0}):(t.texture=new e.T(i,o,n.RGBA,{useMipmap:!0}),t.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)}))}hasTransition(){return!1}}class J extends K{constructor(t,i,r,n){super(t,i,r,n),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox",this.redFactor=i.redFactor,this.greenFactor=i.greenFactor,this.blueFactor=i.blueFactor,this.baseShift=i.baseShift}loadTile(t){return e._(this,void 0,void 0,(function*(){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r=this.map._requestManager.transformRequest(i,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const i=yield _.getImage(r,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(i&&i.data){const r=i.data;this.map._refreshExpiredTiles&&(i.cacheControl||i.expires)&&t.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});const n=e.b(r)&&e.$()?r:yield this.readImageNow(r),o={type:this.type,uid:t.uid,source:this.id,rawImageData:n,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||"expired"===t.state){t.actor=this.dispatcher.getActor();const e=yield t.actor.sendAsync({type:"LDT",data:o});t.dem=e,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}
1catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}}))}readImageNow(t){return e._(this,void 0,void 0,(function*(){if("undefined"!=typeof VideoFrame&&e.a0()){const i=t.width+2,r=t.height+2;try{return new e.R({width:i,height:r},yield e.a1(t,-1,-1,i,r))}catch(t){}}return s.getImageData(t,1)}))}_getNeighboringTiles(t){const i=t.canonical,r=Math.pow(2,i.z),n=(i.x-1+r)%r,o=0===i.x?t.wrap-1:t.wrap,a=(i.x+1+r)%r,s=i.x+1===r?t.wrap+1:t.wrap,l={};return l[new e.a2(t.overscaledZ,o,i.z,n,i.y).key]={backfilled:!1},l[new e.a2(t.overscaledZ,s,i.z,a,i.y).key]={backfilled:!1},i.y>0&&(l[new e.a2(t.overscaledZ,o,i.z,n,i.y-1).key]={backfilled:!1},l[new e.a2(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new e.a2(t.overscaledZ,s,i.z,a,i.y-1).key]={backfilled:!1}),i.y+1<r&&(l[new e.a2(t.overscaledZ,o,i.z,n,i.y+1).key]={backfilled:!1},l[new e.a2(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new e.a2(t.overscaledZ,s,i.z,a,i.y+1).key]={backfilled:!1}),l}unloadTile(t){return e._(this,void 0,void 0,(function*(){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&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))}))}}function Q(t,e){return e?t.properties[e]:t.id}function $(t,e){const i={id:t.id};if(e.removeAllProperties&&(delete t.removeProperties,delete t.addOrUpdateProperties,delete e.removeProperties),e.removeProperties)for(const r of e.removeProperties){const e=t.addOrUpdateProperties.findIndex((t=>t.key===r));e>-1&&t.addOrUpdateProperties.splice(e,1)}return(t.removeAllProperties||e.removeAllProperties)&&(i.removeAllProperties=!0),(t.removeProperties||e.removeProperties)&&(i.removeProperties=[...t.removeProperties||[],...e.removeProperties||[]]),(t.addOrUpdateProperties||e.addOrUpdateProperties)&&(i.addOrUpdateProperties=[...t.addOrUpdateProperties||[],...e.addOrUpdateProperties||[]]),(t.newGeometry||e.newGeometry)&&(i.newGeometry=e.newGeometry||t.newGeometry),i}function tt(t){var e,i;if(!t)return{};const r={};return r.removeAll=t.removeAll,r.remove=new Set(t.remove||[]),r.add=new Map(null===(e=t.add)||void 0===e?void 0:e.map((t=>[t.id,t]))),r.update=new Map(null===(i=t.update)||void 0===i?void 0:i.map((t=>[t.id,t]))),r}function et(t){return t&&0!==t.length?"number"==typeof t[0]?[t]:t.flatMap((t=>et(t))):[]}function it(t){return"GeometryCollection"===t.type?t.geometries.flatMap((t=>it(t))):et(t.coordinates)}function rt(t){const e=new X;let i;switch(t.type){case"FeatureCollection":i=t.features.flatMap((t=>it(t.geometry)));break;case"Feature":i=it(t.geometry);break;default:i=it(t)}if(0===i.length)return e;for(let r=0;r<i.length;r++){const[t,n]=i[r];e.extend([t,n])}return e}class nt extends e.E{constructor(t,i,r,n){super(),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._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:i.data},this.actor=r.getActor(),this.setEventedParent(n),this._data="string"==typeof i.data?{url:i.data}:{geojson:i.data},this._options=e.e({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId,void 0!==i.clusterMaxZoom&&this.maxzoom<=i.clusterMaxZoom&&e.w('The maxzoom value "'.concat(this.maxzoom,'" is expected to be greater than the clusterMaxZoom value "').concat(i.clusterMaxZoom,'".')),this.workerOptions=e.e({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(void 0!==i.buffer?i.buffer:128),tolerance:this._pixelsToTileUnits(void 0!==i.tolerance?i.tolerance:.375),extent:e.a5,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(i.clusterMaxZoom),minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.a5,radius:this._pixelsToTileUnits(i.clusterRadius||50),log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}
1_hasPendingWorkerUpdate(){return void 0!==this._pendingWorkerUpdate.data||void 0!==this._pendingWorkerUpdate.diff||this._pendingWorkerUpdate.updateCluster}_pixelsToTileUnits(t){return t*(e.a5/this.tileSize)}_getClusterMaxZoom(t){const i=t?Math.round(t):this.maxzoom-1;return Number.isInteger(t)||void 0===t||e.w("Integer expected for option 'clusterMaxZoom': provided value \"".concat(t,'" rounded to "').concat(i,'"')),i}load(){return e._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(t){this.map=t,this.load()}setData(t,e){this._data="string"==typeof t?{url:t}:{geojson:t},this._pendingWorkerUpdate={data:t};const i=this._updateWorkerData();return e?i:this}updateData(t,e){this._pendingWorkerUpdate.diff=function(t,e){if(!t)return e||{};if(!e)return t||{};const i=tt(t),r=tt(e);!function(t,e){e.removeAll&&(t.add.clear(),t.update.clear(),t.remove.clear(),e.remove.clear());for(const i of e.remove)t.add.delete(i),t.update.delete(i);for(const[i,r]of e.update){const n=t.update.get(i);n&&(e.update.set(i,$(n,r)),t.update.delete(i))}}(i,r);const n={};if((i.removeAll||r.removeAll)&&(n.removeAll=!0),n.remove=new Set([...i.remove,...r.remove]),n.add=new Map([...i.add,...r.add]),n.update=new Map([...i.update,...r.update]),n.remove.size&&n.add.size)for(const o of n.add.keys())n.remove.delete(o);return function(t){const e={};return t.removeAll&&(e.removeAll=t.removeAll),t.remove&&(e.remove=Array.from(t.remove)),t.add&&(e.add=Array.from(t.add.values())),t.update&&(e.update=Array.from(t.update.values())
1),e}(n)}(this._pendingWorkerUpdate.diff,t);const i=this._updateWorkerData();return e?i:this}getData(){return e._(this,void 0,void 0,(function*(){return this._data.url&&(yield this.once("data")),this._data.geojson?this._data.geojson:{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}}))}getBounds(){return e._(this,void 0,void 0,(function*(){return rt(yield this.getData())}))}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,void 0!==t.clusterRadius&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(t.clusterRadius)),void 0!==t.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(t.clusterMaxZoom)),this._pendingWorkerUpdate.updateCluster=!0,this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,e,i){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:e,offset:i}})}_updateWorkerData(){return e._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;if(!this._hasPendingWorkerUpdate())return void e.w("No pending worker updates for GeoJSONSource ".concat(this.id,"."));const{data:t,diff:i,updateCluster:r}=this._pendingWorkerUpdate,n=this._getLoadGeoJSONParameters(t,i,r);void 0!==t?this._pendingWorkerUpdate.data=void 0:i?this._pendingWorkerUpdate.diff=void 0:r&&(this._pendingWorkerUpdate.updateCluster=void 0),yield this._dispatchWorkerUpdate(n)}))}_getLoadGeoJSONParameters(t,i,r){const n=e.e({type:this.type},this.workerOptions);return"string"==typeof t?(n.request=this.map._requestManager.transformRequest(s.resolveURL(t),"Source"),n.request.collectResourceTiming=this._collectResourceTiming,n):void 0!==t?(n.data=t,n):i?(n.dataDiff=i,n):r?(n.updateCluster=!0,n):void 0}_dispatchWorkerUpdate(t){return e._(this,void 0,void 0,(function*(){this._isUpdatingWorker=!0,this.fire(new e.l("dataloading",{dataType:"source"}));try{const i=yield this.actor.sendAsync({type:"LD",data:t});if(this._isUpdatingWorker=!1,this._removed||i.abandoned)return void this.fire(new e.l("dataabort",{dataType:"source"}));i.data&&(this._data={geojson:i.data});const r=this._applyDiffToSource(t.dataDiff),n=this._getShouldReloadTileOptions(r),o={dataType:"source"};this._applyResourceTiming(o,i),this.fire(new e.l("data",Object.assign(Object.assign({},o),{sourceDataType:"metadata"}))),this.fire(new e.l("data",Object.assign(Object.assign({},o),{sourceDataType:"content",shouldReloadTileOptions:n})))}catch(t){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new e.l("dataabort",{dataType:"source"}));this.fire(new e.k(t))}finally{this._hasPendingWorkerUpdate()&&this._updateWorkerData()}}))}_applyResourceTiming(t,i){var r;if(!this._collectResourceTiming)return;const n=null===(r=i.resourceTiming)||void 0===r?void 0:r[this.id];if(!n)return;const o=n.slice(0);(null==o?void 0:o.length)&&e.e(t,{resourceTiming:o})}_applyDiffToSource(t){if(!t)return;const e="string"==typeof this.promoteId?this.promoteId:void 0;if(!this._data.url&&!this._data.updateable){const t=function(t,e){const i=new Map;if(null==t)return i;if(null==t.type)return i;if("Feature"===t.type){const r=Q(t,e);if(null==r)return;return i.set(r,t),i}if("FeatureCollection"===t.type){const r=new Set;for(const n of t.features){const t=Q(n,e);if(null==t)return;if(r.has(t))return;r.add(t),i.set(t,n)}return i}}(this._data.geojson,e);if(!t)throw new Error('GeoJSONSource "'.concat(this.id,'": GeoJSON data is not compatible with updateData'));this._data={updateable:t}}if(!this._data.updateable)return;const i=function(t,e,i){var r,n;const o=[];if(e.removeAll)t.clear();else if(e.remove)for(const a of e.remove){const e=t.get(a);e&&(o.push(e.geometry),t.delete(a))}if(e.add)for(const a of e.add){const e=Q(a,i);if(null==e)continue;const r=t.get(e);r&&o.push(r.geometry),o.push(a.geometry),t.set(e,a)}if(e.update)for(const a of e.update){const e=t.get(a.id);if(!e)continue;const i=!!a.newGeometry,s=a.removeAllProperties||(null===(r=a.removeProperties)||void 0===r?void 0:r.length)>0||(null===(n=a.addOrUpdateProperties)||void 0===n?void 0:n.length)>0;if(!i&&!s)continue;o.push(e.geometry);const l=Object.assign({},e);if(t.set(a.id,l),i&&(o.push(a.newGeometry),l.geometry=a.newGeometry),s){if(l.properties=a.removeAllProperties?{}:Object.assign({},l.properties||{}),a.removeProperties)for(const t of a.removeProperties)delete l.properties[t];
1if(a.addOrUpdateProperties)for(const{key:t,value:e}of a.addOrUpdateProperties)l.properties[t]=e}}return o}(this._data.updateable,t,e);return t.removeAll||this._options.cluster?void 0:i}_getShouldReloadTileOptions(t){if(t)return{affectedBounds:t.filter(Boolean).map((t=>rt(t)))}}shouldReloadTile(t,i){let{affectedBounds:r}=i;if("loading"===t.state)return!0;if("unloaded"===t.state)return!1;const{buffer:n,extent:o}=this.workerOptions.geojsonVtOptions,a=function(t){let{x:i,y:r,z:n}=t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const a=e.a3((i-o)/Math.pow(2,n)),s=e.a4((r+1+o)/Math.pow(2,n)),l=e.a3((i+1+o)/Math.pow(2,n)),c=e.a4((r-o)/Math.pow(2,n));return new X([a,s],[l,c])}(t.tileID.canonical,n/o);for(const e of r)if(a.intersects(e))return!0;return!1}loaded(){return!this._isUpdatingWorker&&!this._hasPendingWorkerUpdate()}loadTile(t){return e._(this,void 0,void 0,(function*(){const e=t.actor?"RT":"LT";t.actor=this.actor;const i={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,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};t.abortController=new AbortController;const r=yield this.actor.sendAsync({type:e,data:i},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(r,this.map.painter,"RT"===e)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0}))}unloadTile(t){return e._(this,void 0,void 0,(function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.t
1ype,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this._options,{type:this.type,data:this._data.updateable?{type:"FeatureCollection",features:Array.from(this._data.updateable.values())}:this._data.url||this._data.geojson})}hasTransition(){return!1}}class ot extends e.E{constructor(t,e,i,r){super(),this.flippedWindingOrder=!1,this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=e}load(t){return e._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new e.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const e=yield _.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this._finishLoading())}catch(t){this._request=null,this._loaded=!0,e.Z(t)||this.fire(new e.k(t))}}))}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const i=t.map(e.a6.fromLngLat);var r;return this.tileID=function(t){const i=e.a7.fromPoints(t),r=i.width(),n=i.height(),o=Math.max(r,n),a=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),s=Math.pow(2,a);return new e.a9(a,Math.floor((i.minX+i.maxX)/2*s),Math.floor((i.minY+i.maxY)/2*s))}(i),this.terrainTileRanges=this._getOverlappingTileRanges(i),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=i.map((t=>this.tileID.getTilePoint(t)._round())),this.flippedWindingOrder=((r=this.tileCoords)[1].x-r[0].x)*(r[2].y-r[0].y)-(r[1].y-r[0].y)*(r[2].x-r[0].x)<0,this.fire(new e.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,i=t.gl;this.texture||(this.texture=new e.T(t,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,r=!0)}r&&this.fire(new e.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return e._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(t){const{minX:i,minY:r,maxX:n,maxY:o}=e.a7.fromPoints(t),a={};for(let s=0;s<=e.a8;s++){const t=Math.pow(2,s),e=Math.floor(i*t),l=Math.floor(r*t),c=Math.floor(n*t),h=Math.floor(o*t),u=(e%t+t)%t,d=c%t,p=Math.floor(e/t),f=Math.floor(c/t);a[s]={minWrap:p,maxWrap:f,minTileXWrapped:u,maxTileXWrapped:d,minTileY:l,maxTileY:h}}return a}}class at extends ot{constructor(t,e,i,r){super(t,e,i,r),this.roundZoom=!0,this.type="video",this.options=e}load(){return e._(this,void 0,void 0,(function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,"Source").url);try{const t=yield e.aa(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new e.k(t))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new e.k(new e.ab("sources.".concat(this.id),null,"Playback for this video can be set only between the ".concat(i.start(0)," and ").concat(i.end(0),"-second mark.")))):this.video.currentTime=t}}getVideo(){return this.video}
1onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,i=t.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new e.T(t,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,r=!0)}r&&this.fire(new e.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class st extends ot{constructor(t,i,r,n){super(t,i,r,n),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((t=>!Array.isArray(t)||2!==t.length||t.some((t=>"number"!=typeof t))))||this.fire(new e.k(new e.ab("sources.".concat(t),null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.k(new e.ab("sources.".concat(t),null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.k(new e.ab("sources.".concat(t),null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.k(new e.ab("sources.".concat(t),null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.k(new e.ab("sources.".concat(t),null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){return e._(this,void 0,void 0,(function*(){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 e.k(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context,r=i.gl;this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):(this.texture=new e.T(i,this.canvas,r.RGBA,{premultiply:!0}),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,n=!0)}n&&this.fire(new e.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",animate:this.animate,canvas:this.options.canvas,coordinates:this.coordinates}}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 lt={},ct=t=>{switch(t){case"geojson":return nt;case"image":return ot;case"raster":return K;case"raster-dem":return J;case"vector":return Y;case"video":return at;case"canvas":return st}return lt[t]},ht="RTLPluginLoaded";class ut extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=N()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url}).catch((t=>{throw this.status="error",t}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return e._(this,arguments,void 0,(function(t){var e=this;let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){if(e.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(e.url=s.resolveURL(t),!e.url)throw new Error("requested url ".concat(t," is invali
1d"));if("unavailable"===e.status){if(!i)return e._requestImport();e.status="deferred",e._syncState(e.status)}else if("requested"===e.status)return e._requestImport()}()}))}_requestImport(){return e._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.l(ht))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let dt=null;function pt(){return dt||(dt=new ut),dt}var ft,mt;!function(t){t[t.Base=0]="Base",t[t.Parent=1]="Parent"}(ft||(ft={})),function(t){t[t.Departing=0]="Departing",t[t.Incoming=1]="Incoming"}(mt||(mt={}));class gt{constructor(t,i){this.timeAdded=0,this.fadeEndTime=0,this.fadeOpacity=1,this.tileID=t,this.uid=e.ac(),this.uses=0,this.tileSize=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttFingerprint={},this.expiredRequestCount=0,this.state="loading"}isRenderable(t){return this.hasData()&&(!this.fadeEndTime||this.fadeOpacity>0)&&(t||!this.holdingForSymbolFade())}setCrossFadeLogic(t){let{fadingRole:e,fadingDirection:i,fadingParentID:r,fadeEndTime:n}=t;this.resetFadeLogic(),this.fadingRole=e,this.fadingDirection=i,this.fadingParentID=r,this.fadeEndTime=n}setSelfFadeLogic(t){this.resetFadeLogic(),this.selfFading=!0,this.fadeEndTime=t}resetFadeLogic(){this.fadingRole=null,this.fadingDirection=null,this.fadingParentID=null,this.selfFading=!1,this.timeAdded=c(),this.fadeEndTime=0,this.fadeOpacity=1}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,i,r){if(!0!==(null==t?void 0:t.etagUnmodified))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.latestFeatureIndex.encoding=t.encoding):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData,this.latestFeatureIndex.encoding=this.latestEncoding)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){const i={};if(!e)return i;for(const r of t){const t=r.layerIds.map((t=>e.getLayer(t))).filter(Boolean);if(0!==t.length){r.layers=t,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map((e=>t.filter((t=>t.id===e))[0])));for(const e of t)i[e.id]=r}}return i}(t.buckets,null==i?void 0:i.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.ae){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.ae&&i.hasRTLText){this.hasRTLText=!0,pt().lazyLoad();break}}this.queryPadding=0;for(const t in this.buckets){const e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(t).queryRadius(e))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage),this.dashPositions=t.dashPositions}else this.collisionBoxArray=new e.ad;else this.state="loaded"}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.dashPositions&&(this.dashPositions=null),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t)}const i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new e.T(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new e.T(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,i,r,n,o,a,s,l,c,h){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:n,scale:o,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:a,queryPadding:this.queryPadding*l,getElevation:h},t,e,i):{}}querySourceFeatures(t,i){const r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;const n=r.loadVTLayers(),o=i&&i.sourceLayer?i.sourceLayer:"",a=n[e.af]||n[o];if(!a)return;const s=e.ag(null==i?void 0:i.filter,null==i?void 0:i.globalState),{z:l,x:c,y:h}=this.tileID.canonical,u={z:l,x:c,y:h};for(let d=0;d<a.length;d++){const i=a.feature(d);if(s.needGeometry){const t=e.ah(i,!0);
1if(!s.filter(new e.H(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!s.filter(new e.H(this.tileID.overscaledZ),i))continue;const n=r.getId(i,o),p=new e.ai(i,l,c,h,n);p.tile=u,t.push(p)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const i=this.expirationTime;if(t.cacheControl){const i=e.aj(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const t=Date.now();let e=!1;if(this.expirationTime>t)e=!1;else if(i)if(this.expirationTime<i)e=!0;else{const r=this.expirationTime-i;r?this.expirationTime=t+Math.max(r,3e4):e=!0}else e=!0;e?(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,i){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;const r=this.latestFeatureIndex.loadVTLayers();for(const n in this.buckets){if(!i.style.hasLayer(n))continue;const o=this.buckets[n],a=o.layers[0].sourceLayer||e.af,s=r[a],l=t[a];if(!s||!l||0===Object.keys(l).length)continue;o.update(l,s,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});const c=i&&i.style&&i.style.getLayer(n);c&&(this.queryPadding=Math.max(this.queryPadding,c.queryRadius(o)))}}holdingForSymbolFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<c()}clearSymbolFadeHold(){this.symbolFadeHoldUntil=void 0}setSymbolHoldDuration(t){this.symbolFadeHoldUntil=c()+t}setDependencies(t,e){const i={};for(const r of e)i[r]=!0;this.dependencies[t]=i}hasDependency(t,e){for(const i of t){const t=this.dependencies[i];if(t)for(const i of e)if(t[i])return!0}return!1}}class _t{constructor(){this.state={},this.stateChanges={},this.deletedStates={},this.revision=0}updateState(t,i,r){const n=String(i);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},e.e(this.stateChanges[t][n],r),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==n&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][n]){this.deletedStates[t][n]={};for(const e in this.state[t][n])r[e]||(this.deletedStates[t][n][e]=null)}else for(const e in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][e]&&delete this.deletedStates[t][n][e]}removeFeatureState(t,e,i){if(null===this.deletedStates[t])return;const r=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][r])for(i in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][i]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}getState(t,i){const r=String(i),n=e.e({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const e=this.deletedStates[t][i];if(null===e)return{};for(const t in e)delete n[t]}return n}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,i){const r={};for(const n in this.stateChanges){this.state[n]=this.state[n]||{};const t={};for(const i in this.stateChanges[n])this.state[n][i]||(this.state[n][i]={}),e.e(this.state[n][i],this.stateChanges[n][i]),t[i]=this.state[n][i];r[n]=t}for(const n in this.deletedStates){this.state[n]=this.state[n]||{};const t={};if(null===this.deletedStates[n])for(const e in this.state[n])t[e]={},this.state[n][e]={};else for(const e in this.deletedStates[n]){if(null===this.deletedStates[n][e])this.state[n][e]={};else for(const t of Object.keys(this.deletedStates[n][e]))delete this.state[n][e][t];t[e]=this.state[n][e]}r[n]=r[n]||{},e.e(r[n],t)}this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length&&(this.revision++,t.setFeatureState(r,i))}}const yt=89.25;function vt(t,i){const r=e.ak(i.lat,-e.al,e.al);return new e.P(e.Y(i.lng)*t,e.X(r)*t)}function xt(t,i){return new e.a6(i.x/t,i.y/t).toLngLat()}function bt(t){return t.cameraToCenterDistance*Math.min(.85*Math.tan(e.am(90-t.pitch)),Math.tan(e.am(yt-t.pitch)))}function wt(t,i){const r=t.canonical,n=i/e.an(r.z),o=r.x+Math.pow(2,r.z)*t.wrap,a=e.ao(new Float64Array(16));return e.O(a,a,[o*n,r.y*n,0]),e.Q(a,a,[n/e.a5,n/e.a5,1]),a}function Tt(t,i,r,n,o){const a=e.a6.fromLngLat(t,i),s=o*e.ap(1,t.lat),{x:l,y:c,z:h}=St(r,n);return new e.a6(a.x+s*-l,a.y+s*-c,a.z+s*-h)}function St(t,i){const r=e.am(t),n=e.am(i),o=Math.cos(-r),a=Math.sin(r);return{x:a*Math.sin(n),y:-a*Math.cos(n),z:o}}function Pt(t,e,i){const r=e.intersectsFrustum(t);if(!i||0===r)return r;const n=e.intersectsPlane(i);return 0===n?0:2===r&&2===n?2:1}function It(t,e,i){let r=0;const n=(i-e)/10;for(let o=0;o<10;o++)r+=n*Math.pow(Math.cos(e+(o+.5)/10*(i-e)),t);return r}function Mt(t,i){return function(r,n,o,a,s){const l=2*((t-1)/e.aq(Math.cos(e.am(yt-s))/Math.cos(e.am(yt)))-1),c=Math.acos(o/a),h=2*It(l-1,0,e.am(s/2)),u=Math.min(e.am(yt),c+e.am(s/2)),d=It(l-1,Math.min(u,c-e.am(s/2)),u),p=Math.atan(n/o),f=Math.hypot(n,o);let m=r;return m+=e.aq(a/f/Math.max(.5,Math.cos(e.am(s/2)))),m+=l*e.aq(Math.cos(p))/2,m-=e.aq(Math.max(1,d/h/i))/2,m}}const Et=Mt(9.314,3);function Ct(t,i){const r=(i.roundZoom?Math.round:Math.floor)(t.zoom+e.aq(t.tileSize/i.tileSize));return Math.max(0,r)}function At(t,i){const r=t.getCameraFrustum(),n=t.getClippingPlane(),o=t.screenPointToMercatorCoordinate(t.getCameraPoint()),a=e.a6.fromLngLat(t.center,t.elevation);o.z=a.z+Math.cos(t.pitchInRadians)*t.cameraToCenterDistance/t.worldSize;const s=t.getCoveringTilesDetailsProvider(),l=s.allowVariableZoom(t,i),c=Ct(t,i),h=i.minzoom||0,u=void 0!==i.maxzoom?i.maxzoom:t.maxZoom,d=Math.min(Math.max(0,c),u),p=Math.pow(2,d),f=[p*o.x,p*o.y,0],m=[p*a.x,p*a.y,0],g=Math.hypot(a.x-o.x,a.y-o.y),_=Math.abs(a.z-o.z),y=Math.hypot(g,_),v=t=>({zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),x=[],b=[];if(t.renderWorldCopies&&s.allowWorldCopies())for(let e=1;e<=3;e++)x.push(v(-e)),x.push(v(e));for(x.push(v(0));x.length>0;){const p=x.pop(),g=p.x,v=p.y;let w=p.fullyVisible;const T={x:g,y:v,z:p.zoom},S=s.getTileBoundingVolume(T,p.wrap,t.elevation,i);if(!w){const t=Pt(r,S,n);if(0===t)continue;w=2===t}const P=s.distanceToTile2d(o.x,o.y,T,S);let I=c;l&&(I=(i.calculateTileZoom||Et)(t.zoom+e.aq(t.tileSize/i.tileSize),P,_,y,t.fov)),I=(i.roundZoom?Math.round:Math.floor)(I),I=Math.max(0,I);const M=Math.min(I,u);if(p.wrap=s.getWrap(a,T,p.wrap),p.zoom>
1=M){if(p.zoom<h)continue;const t=d-p.zoom,r=f[0]-.5-(g<<t),n=f[1]-.5-(v<<t),o=i.reparseOverscaled?Math.max(p.zoom,I):p.zoom;b.push({tileID:new e.a2(p.zoom===u?o:p.zoom,p.wrap,p.zoom,g,v),distanceSq:e.ar([m[0]-.5-g,m[1]-.5-v]),tileDistanceToCamera:Math.sqrt(r*r+n*n)})}else for(let t=0;t<4;t++)x.push({zoom:p.zoom+1,x:(g<<1)+t%2,y:(v<<1)+(t>>1),wrap:p.wrap,fullyVisible:w})}return b.sort(((t,e)=>t.distanceSq-e.distanceSq)).map((t=>t.tileID))}const Dt=e.a7.fromPoints([new e.P(0,0),new e.P(e.a5,e.a5)]);function zt(t){return"raster"===t||"image"===t||"video"===t}function kt(t,e,i,r,n,o,a){if(!e.hasData())return!1;const{tileID:s,fadingRole:l,fadingDirection:c,fadingParentID:h}=e;if(l===ft.Base&&c===mt.Incoming&&h)return i[h.key]=h,!0;const u=Math.max(s.overscaledZ-n,o);for(let d=s.overscaledZ-1;d>=u;d--){const n=s.scaledTo(d),o=t.getLoadedTile(n);if(o)return e.setCrossFadeLogic({fadingRole:ft.Base,fadingDirection:mt.Incoming,fadingParentID:o.tileID,fadeEndTime:r+a}),o.setCrossFadeLogic({fadingRole:ft.Parent,fadingDirection:mt.Departing,fadeEndTime:r+a}),i[n.key]=n,!0}return!1}function Rt(t,e,i,r,n,o){if(!e.hasData())return!1;const a=e.tileID.children(n);let s=Ft(t,e,a,i,r,n,o);if(s)return!0;for(const l of a)Ft(t,e,l.children(n),i,r,n,o)&&(s=!0);return s}function Ft(t,e,i,r,n,o,a){if(i[0].overscaledZ>=o)return!1;let s=!1;for(const l of i){const i=t.getLoadedTile(l);
1if(!i)continue;const{fadingRole:o,fadingDirection:c,fadingParentID:h}=i;o===ft.Base&&c===mt.Departing&&h||(i.setCrossFadeLogic({fadingRole:ft.Base,fadingDirection:mt.Departing,fadingParentID:e.tileID,fadeEndTime:n+a}),e.setCrossFadeLogic({fadingRole:ft.Parent,fadingDirection:mt.Incoming,fadeEndTime:n+a})),r[l.key]=l,s=!0}return s}function Lt(t,e,i,r){const n=t.tileID;return!!t.selfFading||!t.hasData()&&!!e.has(n)&&(t.setSelfFadeLogic(i+r),!0)}function Bt(t,e){var i;t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0;let r=e.tileID.canonical.x-t.tileID.canonical.x;const n=e.tileID.canonical.y-t.tileID.canonical.y,o=Math.pow(2,t.tileID.canonical.z),a=e.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+o)?r+=o:1===Math.abs(r-o)&&(r-=o)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,n),(null===(i=t.neighboringTiles)||void 0===i?void 0:i[a])&&(t.neighboringTiles[a].backfilled=!0)))}class Ot{constructor(){this._tiles={}}handleWrapJump(t){const e={};for(const i in this._tiles){const r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),e[r.tileID.key]=r}this._tiles=e}setFeatureState(t,e){for(const i in this._tiles)this._tiles[i].setFeatureState(t,e)}getAllTiles(){return Object.values(this._tiles)}getAllIds(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?Object.values(this._tiles).map((t=>t.tileID)).sort(e.at).map((t=>t.key)):Object.keys(this._tiles)}getTileById(t){return this._tiles[t]}setTile(t,e){this._tiles[t]=e}deleteTileById(t){delete this._tiles[t]}getLoadedTile(t){const e=this.getTileById(t.key);return(null==e?void 0:e.hasData())?e:null}isIdRenderable(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var i;return null===(i=this.getTileById(t))||void 0===i?void 0:i.isRenderable(e)}getRenderableIds(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1?arguments[1]:void 0;const r=[];for(const e of this.getAllIds())this.isIdRenderable(e,i)&&r.push(this.getTileById(e));return i?r.sort(((i,r)=>{const n=i.tileID,o=r.tileID,a=new e.P(n.canonical.x,n.canonical.y)._rotate(-t),s=new e.P(o.canonical.x,o.canonical.y)._rotate(-t);return n.overscaledZ-o.overscaledZ||s.y-a.y||s.x-a.x})).map((t=>t.tileID.key)):r.map((t=>t.tileID)).sort(e.at).map((t=>t.key))}}class Vt extends e.E{constructor(t,i,r){super(),this.id=t,this.dispatcher=r,this.on("data",(t=>this._dataHandler(t))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((t,e,i,r)=>{const n=new(ct(e.type))(t,e,i,r);if(n.id!==t)throw new Error("Expected Source id to be ".concat(t," instead of ").concat(n.id));return n})(t,i,r,this),this._inViewTiles=new Ot,this._outOfViewCache=new e.au(0,(t=>this._unloadTile(t))),this._timers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._rasterFadeDuration=0,this._maxFadingAncestorLevels=5,this._state=new _t,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){for(const e of this._inViewTiles.getAllTiles())e.unloadVectorData();this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t),this._inViewTiles=new Ot}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t of this._inViewTiles.getAllTiles())if("loaded"!==t.state&&"errored"!==t.state)return!1;return!0}getSource(){return this._source}getState(){return this._state}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,i,r){return e._(this,void 0,void 0,(function*(){try{const e=yield this._source.loadTile(t);this._tileLoaded(t,i,r,e)}catch(i){t.state="errored",404!==i.status?this._source.fire(new e.k(i,{tile:t})):this.update(this.transform,this.terrain)}}))}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new e.l("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._inViewTiles,this.map?this.map.painter:null);for(const e of this._inViewTiles.getAllTiles())e.upload(t),e.prepare(this.map.style.imageManager)}getIds(){return this._inViewTiles.getAllIds(!0)}getRenderableIds(t){var e;return this._inViewTiles.getRenderableIds(null===(e=this.transform)||void 0===e?void 0:e.bearingInRadians,t)}hasRenderableParent(t){const e=t.overscaledZ-1;if(e>=this._source.minzoom){const i=this.getLoadedTile(t.scaledTo(e));if(i)return this._inViewTiles.isIdRenderable(i.tileID.key)}return!1}reload(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(this._paused)this._shouldReloadOnResume=!0;else{this._outOfViewCache.reset();for(const i of this._inViewTiles.getAllIds()){const r=this._inViewTiles.getTileById(i);e&&!this._source.shouldReloadTile(r,e)||(t?this._reloadTile(i,"expired"):"errored"!==r.state&&this._reloadTile(i,"reloading"))}}}_reloadTile(t,i){return e._(this,void 0,void 0,(function*(){const e=this._inViewTiles.getTileById(t);e&&("loading"!==e.state&&(e.state=i),yield this._loadTile(e,t,i))}))}_tileLoaded(t,i,r,n){t.timeAdded=c(),t.selfFading&&(t.fadeEndTime=t.timeAdded+this._rasterFadeDuration),"expired"===r&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),(null==n?void 0:n.unmodified)||("raster-dem"===this.getSource().type&&t.dem&&function(t,e){var i,r;const n=e.getRenderableIds();for(const o of n){if(!t.neighboringTiles||!t.neighboringTiles[o])continue;const n=e.getTileById(o);t.neighboringTiles[o].backfilled||Bt(t,n),(null===(r=null===(i=n.neighboringTiles)||void 0===i?void 0:i[t.tileID.key])||void 0===r?void 0:r.backfilled)||Bt(n,t)}}(t,this._inViewTiles),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.l("data",{dataType:"source",tile:t,coord:t.tileID})))}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._inViewTiles.getTileById(t)}_retainLoadedChildren(t,e){const i=this._getLoadedDescendents(e),r=new Set;for(const n of e){const e=i[n.key];if(!(null==e?void 0:e.length)){r.add(n);continue}const o=n.overscaledZ+Vt.maxOverzooming,a=e.filter((t=>t.tileID.overscaledZ<=o));if(!a.length){r.add(n);continue}const s=Math.min(...a.map((t=>
1t.tileID.overscaledZ))),l=a.filter((t=>t.tileID.overscaledZ===s)).map((t=>t.tileID));for(const i of l)t[i.key]=i;this._areDescendentsComplete(l,s,n.overscaledZ)||r.add(n)}return r}_getLoadedDescendents(t){var e;const i={};for(const r of this._inViewTiles.getAllTiles().filter((t=>t.hasData())))for(const n of t)r.tileID.isChildOf(n)&&(i[e=n.key]||(i[e]=[])).push(r);return i}_areDescendentsComplete(t,e,i){return 1===t.length&&t[0].isOverscaled()?t[0].overscaledZ===e:Math.pow(4,e-i)===t.length}getLoadedTile(t){return this._inViewTiles.getLoadedTile(t)}updateCacheSize(t){const i=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(i*r*(null===this._maxTileCacheZoomLevels?e.c.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),o="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._outOfViewCache.setMaxSize(o)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);this._prevLng=t,e&&(this._inViewTiles.handleWrapJump(e),this._resetTileReloadTimers())}update(t,i){if(!this._sourceLoaded||this._paused)return;let r;this.transform=t,this.terrain=i,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this.used||this.usedForTerrain?this._source.tileID?r=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.a2(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(r=At(t,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:"vector"===this._source.type&&void 0!==this.map._zoomLevelsToOverscale?t.maxZoom-this.map._zoomLevelsToOverscale:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:i,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(r=r.filter((t=>this._source.hasTile(t))))):r=[],this.usedForTerrain&&(r=this._addTerrainIdealTiles(r));const n=0===r.length&&!this._updated&&this._didEmitContent;this._updated=!0,n&&this.fire(new e.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const o=Ct(t,this._source),a=this._updateRetainedTiles(r,o),s=zt(this._source.type);s&&this._rasterFadeDuration>0&&!i&&function(t,i,r,n,o,a,s){const l=c(),h=e.as(i);for(const e of i){const i=t.getTileById(e.key);i.fadingDirection!==mt.Departing&&0!==i.fadeOpacity||i.resetFadeLogic(),kt(t,i,r,l,n,o,s)||Rt(t,i,r,l,a,s)||Lt(i,h,l,s)||i.resetFadeLogic()}}(this._inViewTiles,r,a,this._maxFadingAncestorLevels,this._source.minzoom,this._source.maxzoom,this._rasterFadeDuration),s?this._cleanUpRasterTiles(a):this._cleanUpVectorTiles(a)}_cleanUpRasterTiles(t){for(const e of this._inViewTiles.getAllIds())t[e]||this._removeTile(e)}_cleanUpVectorTiles(t){for(const e of this._inViewTiles.getAllIds()){const i=this._inViewTiles.getTileById(e);t[e]?i.clearSymbolFadeHold():i.hasSymbolBuckets?i.holdingForSymbolFade()?i.symbolFadeFinished()&&this._removeTile(e):i.setSymbolHoldDuration(this.map._fadeDuration):this._removeTile(e)}}_addTerrainIdealTiles(t){const e=[];for(const i of t)if(i.canonical.z>this._source.minzoom){const t=i.scaledTo(i.canonical.z-1);e.push(t);const r=i.scaledTo(Math.max(this._source.minzoom,Math.min(i.canonical.z,5)));e.push(r)}return t.concat(e)}releaseSymbolFadeTiles(){for(const t of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(t).holdingForSymbolFade()&&this._removeTile(t)}_updateRetainedTiles(t,e){var i;const r=new Set;for(const l of t)this._addTile(l).hasData()||r.add(l);const n=t.reduce(((t,e)=>(t[e.key]=e,t)),{}),o=this._retainLoadedChildren(n,r),a={},s=Math.max(e-Vt.maxUnderzooming,this._source.minzoom);for(const l of o){let t=this._inViewTiles.getTileById(l.key),e=null==t?void 0:t.wasRequested();for(let r=l.overscaledZ-1;r>=s;--r){const o=l.scaledTo(r);if(a[o.key])break;if(a[o.key]=!0,t=this.getTile(o),!t&&e&&(t=this._addTile(o)),t){const r=t.hasData();if((r||!(null===(i=this.map)||void 0===i?void 0:i.cancelPendingTileRequestsWhileZooming)||e)&&(n[o.key]=o),e=t.wasRequested(),r)break}}}return n}_addTile(t){let i=this._inViewTiles.getTileById(t.key);if(i)return i;i=this._outOfViewCache.getAndRemove(t),i&&(i.resetFadeLogic(),this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null));const r=i;
1return i||(i=new gt(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(i,t.key,i.state)),i.uses++,this._inViewTiles.setTile(t.key,i),r||this._source.fire(new e.l("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(t,e){this._clearTileReloadTimer(t);const i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout((()=>{this._reloadTile(t,"expired"),delete this._timers[t]}),i))}_clearTileReloadTimer(t){const e=this._timers[t];e&&(clearTimeout(e),delete this._timers[t])}_resetTileReloadTimers(){for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t of this._inViewTiles.getAllIds()){const e=this._inViewTiles.getTileById(t);this._setTileReloadTimer(t,e)}}refreshTiles(t){for(const e of this._inViewTiles.getAllIds()){const i=this._inViewTiles.getTileById(e);(this._inViewTiles.isIdRenderable(e)||"errored"==i.state)&&t.some((t=>t.equals(i.tileID.canonical)))&&this._reloadTile(e,"expired")}}_removeTile(t){const e=this._inViewTiles.getTileById(t);e&&(e.uses--,this._inViewTiles.deleteTileById(t),this._clearTileReloadTimer(t),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._outOfViewCache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}_dataHandler(t){"source"===t.dataType&&("metadata"!==t.sourceDataType?"content"===t.sourceDataType&&this._sourceLoaded&&!this._paused&&(this.reload(t.sourceDataChanged,t.shouldReloadTileOptions),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0):this._sourceLoaded=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t of this._inViewTiles.getAllIds())this._removeTile(t);this._outOfViewCache.reset()}tilesIn(t,i,r){const n=[],o=this.transform;if(!o)return n;const a=o.getCoveringTilesDetailsProvider().allowWorldCopies(),s=r?o.getCameraQueryGeometry(t):t,l=t=>o.screenPointToMercatorCoordinate(t,this.terrain),c=this.transformBbox(t,l,!a),h=this.transformBbox(s,l,!a),u=this.getIds(),d=e.a7.fromPoints(h);for(let p=0;p<u.length;p++){const t=this._inViewTiles.getTileById(u[p]);if(t.holdingForSymbolFade())continue;const r=a?[t.tileID]:[t.tileID.unwrapTo(-1),t.tileID.unwrapTo(0)],s=Math.pow(2,o.zoom-t.tileID.overscaledZ),l=i*t.queryPadding*e.a5/t.tileSize/s;for(const i of r){const r=d.map((t=>i.getTilePoint(new e.a6(t.x,t.y))));if(r.expandBy(l),r.intersects(Dt)){const e=c.map((t=>i.getTilePoint(t))),r=h.map((t=>i.getTilePoint(t)));n.push({tile:t,tileID:a?i:i.unwrapTo(0),queryGeometry:e,cameraQueryGeometry:r,scale:s})}}}return n}transformBbox(t,i,r){let n=t.map(i);if(r){const r=e.a7.fromPoints(t);r.shrinkBy(.001*Math.min(r.width(),r.height()));const o=r.map(i);e.a7.fromPoints(n).covers(o)||(n=n.map((t=>t.x>.5?new e.a6(t.x-1,t.y,t.z):t)))}return n}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map((t=>this._inViewTiles.getTileById(t).tileID));return this.transform&&this.transform.populateCache(e),e}hasTransition(){return!!this._source.hasTransition()||!(!zt(this._source.type)||!function(t,e){if(e<=0)return!1;const i=c();for(const r of t.getAllTiles())if(r.fadeEndTime>=i)return!0;return!1}(this._inViewTiles,this._rasterFadeDuration))}setRasterFadeDuration(t){this._rasterFadeDuration=t}setFeatureState(t,i,r){this._state.updateState(t=t||e.af,i,r)}removeFeatureState(t,i,r){this._state.removeFeatureState(t=t||e.af,i,r)}getFeatureState(t,i){return this._state.getState(t=t||e.af,i)}setDependencies(t,e,i){const r=this._inViewTiles.getTileById(t);r&&r.setDependencies(e,i)}reloadTilesForDependencies(t,e){for(const i of this._inViewTiles.getAllIds())this._inViewTiles.getTileById(i).hasDependency(t,e)&&this._reloadTile(i,"reloading");this._outOfViewCache.filter((i=>!i.hasDependency(t,e)))}areTilesLoaded(){for(const t of this._inViewTiles.getAllTiles())if("loaded"!==t.state&&"errored"!==t.state)return!1;return!0}}Vt.maxUnderzooming=10,Vt.maxOverzooming=3;class jt{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let i=1;i<this.points.length;i++)this._distances[i]=this._distances[i-1]+this.points[i].dist(this.points[i-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.ak(t,0,1);let i=1,r=this._distances[i];const n=t*this.paddedLength+this.padding;
vendor: 2,140 bytes, line 1
1for(;r<n&&i<this._distances.length;)r=this._distances[++i];const o=i-1,a=this._distances[o],s=r-a,l=s>0?(n-a)/s:0;return this.points[o].mult(1-l).add(this.points[i].mult(l))}}function Nt(t,e){let i=!0;return"always"===t||"never"!==t&&"never"!==e||(i=!1),i}class Ut{constructor(t,e,i){const r=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let o=0;o<this.xCellCount*this.yCellCount;o++)r.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)}insertCircle(t,e,i,r){this._forEachCell(e-r,i-r,e+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(r)}_insertBoxCell(t,e,i,r,n,o){this.boxCells[n].push(o)}_insertCircleCell(t,e,i,r,n,o){this.circleCells[n].push(o)}_query(t,e,i,r,n,o,a){if(i<0||t>this.width||r<0||e>this.height)return[];const s=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(n)return[{key:null,x1:t,y1:e,x2:i,y2:r}];for(let t=0;t<this.boxKeys.length;t++)s.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){const e=this.circles[3*t],i=this.circles[3*t+1],r=this.circles[3*t+2];s.push({key:this.circleKeys[t],x1:e-r,y1:i-r,x2:e+r,y2:i+r})}}else this._forEachCell(t,e,i,r,this._queryCell,s,{hitTest:n,overlapMode:o,seenUids:{box:{},circle:{}}},a);return s}query(t,e,i,r){return this._query(t,e,i,r,!1,null)}hitTest(t,e,i,r,n,o){return this._query(t,e,i,r,!0,n,o).length>0}hitTestCircle(t,e,i,r,n){const o=t-i,a=t+i,s=e-i,l=e+i;if(a<0||o>this.width||l<0||s>this.height)return!1;const c=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:r,circle:{x:t,y:e,radiu
vendor: 4,259 bytes, line 1
1s:i},seenUids:{box:{},circle:{}}},n),c.length>0}_queryCell(t,e,i,r,n,o,a,s){const{seenUids:l,hitTest:c,overlapMode:h}=a,u=this.boxCells[n];if(null!==u){const n=this.bboxes;for(const a of u)if(!l.box[a]){l.box[a]=!0;const u=4*a,d=this.boxKeys[a];if(t<=n[u+2]&&e<=n[u+3]&&i>=n[u+0]&&r>=n[u+1]&&(!s||s(d))&&(!c||!Nt(h,d.overlapMode))&&(o.push({key:d,x1:n[u],y1:n[u+1],x2:n[u+2],y2:n[u+3]}),c))return!0}}const d=this.circleCells[n];if(null!==d){const n=this.circles;for(const a of d)if(!l.circle[a]){l.circle[a]=!0;const u=3*a,d=this.circleKeys[a];if(this._circleAndRectCollide(n[u],n[u+1],n[u+2],t,e,i,r)&&(!s||s(d))&&(!c||!Nt(h,d.overlapMode))){const t=n[u],e=n[u+1],i=n[u+2];if(o.push({key:d,x1:t-i,y1:e-i,x2:t+i,y2:e+i}),c)return!0}}}return!1}_queryCellCircle(t,e,i,r,n,o,a,s){const{circle:l,seenUids:c,overlapMode:h}=a,u=this.boxCells[n];if(null!==u){const t=this.bboxes;for(const e of u)if(!c.box[e]){c.box[e]=!0;const i=4*e,r=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!s||s(r))&&!Nt(h,r.overlapMode))return o.push(!0),!0}}const d=this.circleCells[n];if(null!==d){const t=this.circles;for(const e of d)if(!c.circle[e]){c.circle[e]=!0;const i=3*e,r=this.circleKeys[e];if(this._circlesCollide(t[i],t[i+1],t[i+2],l.x,l.y,l.radius)&&(!s||s(r))&&!Nt(h,r.overlapMode))return o.push(!0),!0}}}_forEachCell(t,e,i,r,n,o,a,s){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),u=this._convertToYCellCoord(r);for(let d=l;d<=h;d++)for(let l=c;l<=u;l++)if(n.call(this,t,e,i,r,this.xCellCount*l+d,o,a,s))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,e,i,r,n,o){const a=r-t,s=n-e,l=i+o;return l*l>a*a+s*s}_circleAndRectCollide(t,e,i,r,n,o,a){const s=(o-r)/2,l=Math.abs(t-(r+s));if(l>s+i)return!1;const c=(a-n)/2,h=Math.abs(e-(n+c));if(h>c+i)return!1;if(l<=s||h<=c)return!0;const u=l-s,d=h-c;return u*u+d*d<=i*i}}function Gt(t,i,n){const o=e.N();if(!t){const{vecSouth:t,vecEast:e}=qt(i),n=r();n[0]=e[0],n[1]=e[1],n[2]=t[0],n[3]=t[1],a=n,(d=(l=(s=n)[0])*(u=s[3])-(h=s[2])*(c=s[1]))&&(a[0]=u*(d=1/d),a[1]=-c*d,a[2]=-h*d,a[3]=l*d),o[0]=n[0],o[1]=n[1],o[4]=n[2],o[5]=n[3]}var a,s,l,c,h,u,d;return e.Q(o,o,[1/n,1/n,1]),o}function Zt(t,i,r,n){if(t){const t=e.N();if(!i){const{vecSouth:e,vecEast:i}=qt(r);t[0]=i[0],t[1]=i[1],t[4]=e[0],t[5]=e[1]}return e.Q(t,t,[n,n,1]),t}return r.pixelsToClipSpaceMatrix}function qt(t){const i=Math.cos(t.rollInRadians),r=Math.sin(t.rollInRadians),n=Math.cos(t.pitchInRadians),o=Math.cos(t.bearingInRadians),a=Math.sin(t.bearingInRadians),s=e.az();s[0]=-o*n*r-a*i,s[1]=-a*n*r+o*i;const l=e.aA(s);l<1e-9?e.aB(s):e.aC(s,s,1/l);const c=e.az();c[0]=o*n*i-a*r,c[1]=a*n*i+o*r;const h=e.aA(c);return h<1e-9?e.aB(c):e.aC(c,c,1/h),{vecEast:c,vecSouth:s}}function Wt(t,i,r,n){let o;n?(o=[t,i,n(t,i),1],e.aE(o,o,r)):(o=[t,i,0,1],ce(o,o,r));const a=o[3];return{point:new e.P(o[0]/a,o[1]/a),signedDistanceFromCamera:a,isOccluded:!1}}function Xt(t,e){return.5+t/e*.5}function Ht(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function Yt(t,i,r,n,o,a,s,l,c,h,u,d,p){const f=r?t.textSizeData:t.iconSizeData,m=e.av(f,i.transform.zoom),g=[256/i.width*2+1,256/i.height*2+1],_=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;_.clear();const y=t.lineVertexArray,v=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,x=i.transform.width/i.transform.height;let b=!1;for(let w=0;w<v.length;w++){const r=v.get(w);if(r.hidden||r.writingMode===e.aw.vertical&&!b){le(r.numGlyphs,_);continue}b=!1;const T=new e.P(r.anchorX,r.anchorY),S={getElevation:p,pitchedLabelPlaneMatrix:n,lineVertexArray:y,pitchWithMap:a,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:i.transform,tileAnchorPoint:T,unwrappedTileID:c,width:h,height:u,translation:d},P=re(r.anchorX,r.anchorY,S);if(!Ht(P.point,g)){le(r.numGlyphs,_);continue}const I=Xt(i.transform.cameraToCenterDistance,P.signedDistanceFromCamera),M=e.ax(f,m,r),E=a?M*i.transform.getPitchedTextCorrection(r.anchorX,r.anchorY,c)/I:M*I,C=Qt({projectionContext:S,pitchedLabelPlaneMatr
vendor: 4,101 bytes, line 1
1ixInverse:o,symbol:r,fontSize:E,flip:!1,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:x,rotateToLine:l});b=C.useVertical,(C.notEnoughRoom||b||C.needsFlipping&&Qt({projectionContext:S,pitchedLabelPlaneMatrixInverse:o,symbol:r,fontSize:E,flip:!0,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:x,rotateToLine:l}).notEnoughRoom)&&le(r.numGlyphs,_)}r?t.text.dynamicLayoutVertexBuffer.updateData(_):t.icon.dynamicLayoutVertexBuffer.updateData(_)}function Kt(t,e,i,r,n,o,a,s){const l=o.glyphStartIndex+o.numGlyphs,c=o.lineStartIndex,h=o.lineStartIndex+o.lineLength,u=e.getoffsetX(o.glyphStartIndex),d=e.getoffsetX(l-1),p=ae(t*u,i,r,n,o.segment,c,h,s,a);if(!p)return null;const f=ae(t*d,i,r,n,o.segment,c,h,s,a);return f?s.projectionCache.anyProjectionOccluded?null:{first:p,last:f}:null}function Jt(t,i,r,n){return t===e.aw.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*n?{useVertical:!0}:(t===e.aw.vertical?i.y<r.y:i.x>r.x)?{needsFlipping:!0}:null}function Qt(t){const{projectionContext:i,pitchedLabelPlaneMatrixInverse:r,symbol:n,fontSize:o,flip:a,keepUpright:s,glyphOffsetArray:l,dynamicLayoutVertexArray:c,aspectRatio:h,rotateToLine:u}=t,d=o/24,p=n.lineOffsetX*d,f=n.lineOffsetY*d;let m;if(n.numGlyphs>1){const t=n.glyphStartIndex+n.numGlyphs,e=n.lineStartIndex,o=n.lineStartIndex+n.lineLength,c=Kt(d,l,p,f,a,n,u,i);if(!c)return{notEnoughRoom:!0};const g=ie(c.first.point.x,c.first.point.y,i,r),_=ie(c.last.point.x,c.last.point.y,i,r);if(s&&!a){const t=Jt(n.writingMode,g,_,h);if(t)return t}m=[c.first];for(let r=n.glyphStartIndex+1;r<t-1;r++){const t=ae(d*l.getoffsetX(r),p,f,a,n.segment,e,o,i,u);if(!t)return{notEnoughRoom:!0};m.push(t)}m.push(c.last)}else{if(s&&!a){const t=ee(i.tileAnchorPoint.x,i.tileAnchorPoint.y,i).point,o=n.lineStartIndex+n.segment+1,a=new e.P(i.lineVertexArray.getx(o),i.lineVertexArray.gety(o)),s=ee(a.x,a.y,i),l=s.signedDistanceFromCamera>0?s.point:$t(i.tileAnchorPoint,a,t,1,i),c=ie(t.x,t.y,i,r),u=ie(l.x,l.y,i,r),d=Jt(n.writingMode,c,u,h);if(d)return d}const t=ae(d*l.getoffsetX(n.glyphStartIndex),p,f,a,n.segment,n.lineStartIndex,n.lineStartIndex+n.lineLength,i,u);if(!t||i.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};m=[t]}for(const g of m)e.aD(c,g.point,g.angle);return{}}function $t(t,e,i,r,n){const o=t.add(t.sub(e)._unit()),a=ee(o.x,o.y,n).point,s=i.sub(a);return i.add(s._mult(r/s.mag()))}function te(t,i,r){const n=i.projectionCache;if(n.projections[t])return n.projections[t];const o=new e.P(i.lineVertexArray.getx(t),i.lineVertexArray.gety(t)),a=ee(o.x,o.y,i);if(a.signedDistanceFromCamera>0)return n.projections[t]=a.point,n.anyProjectionOccluded=n.anyProjectionOccluded||a.isOccluded,a.point;const s=t-r.direction;return $t(0===r.distanceFromAnchor?i.tileAnchorPoint:new e.P(i.lineVertexArray.getx(s),i.lineVertexArray.gety(s)),o,r.previousVertex,r.absOffsetX-r.distanceFromAnchor+1,i)}function ee(t,e,i){const r=t+i.translation[0],n=e+i.translation[1];let o;return i.pitchWithMap?(o=Wt(r,n,i.pitchedLabelPlaneMatrix,i.getElevation),o.isOccluded=!1):(o=i.transform.projectTileCoordinates(r,n,i.unwrappedTileID,i.getElevation),o.point.x=(.5*o.point.x+.5)*i.width,o.point.y=(.5*-o.point.y+.5)*i.height),o}function ie(t,i,r,n){if(r.pitchWithMap){const o=[t,i,0,1];return e.aE(o,o,n),r.transform.projectTileCoordinates(o[0]/o[3],o[1]/o[3],r.unwrappedTileID,r.getElevation).point}return{x:t/r.width*2-1,y:1-i/r.height*2}}function re(t,e,i){return i.transform.projectTileCoordinates(t,e,i.unwrappedTileID,i.getElevation)}function ne(t,e,i){return t._unit()._perp()._mult(e*i)}function oe(t,i,r,n,o,a,s,l,c){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];const h=r.add(i);if(t+c.direction<n||t+c.direction>=o)return l.projectionCache.offsets[t]=h,h;const u=te(t+c.direction,l,c),d=ne(u.sub(r),s,c.direction),p=r.add(d),f=u.add(d);return l.projectionCache.offsets[t]=e.aF(a,h,p,f)||h,l.projectionCache.offsets[t]}function ae(t,e,i,r,n,o,a,s,l){const c=r?t-e:t+e;let h=c>0?1:-1,u=0;r&&(h*=-1,u=Math.PI),h<0&&(u+=Math.PI);let d,p=h>0?o+n:o+n+1;
vendor: 31,995 bytes, line 1
1s.projectionCache.cachedAnchorPoint?d=s.projectionCache.cachedAnchorPoint:(d=ee(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=d);let f,m,g=d,_=d,y=0,v=0;const x=Math.abs(c),b=[];let w;for(;y+v<=x;){if(p+=h,p<o||p>=a)return null;y+=v,_=g,m=f;const t={absOffsetX:x,direction:h,distanceFromAnchor:y,previousVertex:_};if(g=te(p,s,t),0===i)b.push(_),w=g.sub(_);else{let e;const r=g.sub(_);e=0===r.mag()?ne(te(p+h,s,t).sub(g),i,h):ne(r,i,h),m||(m=_.add(e)),f=oe(p,e,g,o,a,m,i,s,t),b.push(m),w=f.sub(m)}v=w.mag()}const T=w._mult((x-y)/v)._add(m||_),S=u+Math.atan2(g.y-_.y,g.x-_.x);return b.push(T),{point:T,angle:l?S:0,path:b}}const se=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function le(t,e){for(let i=0;i<t;i++){const t=e.length;e.resize(t+4),e.float32.set(se,3*t)}}function ce(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t[3]=i[3]*r+i[7]*n+i[15],t}const he=100;class ue{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ut(t.width+200,t.height+200,25),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Ut(t.width+200,t.height+200,25);this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchFactor=Math.cos(t.pitch*Math.PI/180)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+he,this.screenBottomBoundary=t.height+he,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,e,i,r,n,o,a,s,l,c,h,u){const d=this.projectAndGetPerspectiveRatio(t.anchorPointX+s[0],t.anchorPointY+s[1],n,c,u),p=i*d.perspectiveRatio;let f;if(o||a)f=this._projectCollisionBox(t,p,r,n,o,a,s,d,c,h,u);else{const e=d.x+(h?h.x*p:0),i=d.y+(h?h.y*p:0);f={allPointsOccluded:!1,box:[e+t.x1*p,i+t.y1*p,e+t.x2*p,i+t.y2*p]}}const[m,g,_,y]=f.box,v=o?f.allPointsOccluded:d.isOccluded;let x=v;return x||(x=d.perspectiveRatio<this.perspectiveRatioCutoff),x||(x=!this.isInsideGrid(m,g,_,y)),x||"always"!==e&&this.grid.hitTest(m,g,_,y,e,l)?{box:[m,g,_,y],placeable:!1,offscreen:!1,occluded:v}:{box:[m,g,_,y],placeable:!0,offscreen:this.isOffscreen(m,g,_,y),occluded:v}}placeCollisionCircles(t,i,r,n,o,a,s,l,c,h,u,d,p,f){const m=[],g=new e.P(i.anchorX,i.anchorY),_=this.getPerspectiveRatio(g.x,g.y,a,f),y=(c?o*this.transform.getPitchedTextCorrection(i.anchorX,i.anchorY,a)/_:o*_)/e.aJ,v={getElevation:f,pitchedLabelPlaneMatrix:s,lineVertexArray:r,pitchWithMap:c,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:g,unwrappedTileID:a,width:this.transform.width,height:this.transform.height,translation:p},x=Kt(y,n,i.lineOffsetX*y,i.lineOffsetY*y,!1,i,!1,v);let b=!1,w=!1,T=!0;if(x){const i=.5*u*_+d,r=new e.P(-100,-100),n=new e.P(this.screenRightBoundary,this.screenBottomBoundary),o=new jt,a=x.first,s=x.last;let p=[];for(let t=a.path.length-1;t>=1;t--)p.push(a.path[t]);for(let t=1;t<s.path.length;t++)p.push(s.path[t]);const f=2.5*i;if(c){const t=this.projectPathToScreenSpace(p,v);p=t.some((t=>t.signedDistanceFromCamera<=0))?[]:t.map((t=>t.point))}let g=[];if(p.length>0){const t=p[0].clone(),i=p[0].clone();for(let e=1;e<p.length;e++)t.x=Math.min(t.x,p[e].x),t.y=Math.min(t.y,p[e].y),i.x=Math.max(i.x,p[e].x),i.y=Math.max(i.y,p[e].y);g=t.x>=r.x&&i.x<=n.x&&t.y>=r.y&&i.y<=n.y?[p]:i.x<r.x||t.x>n.x||i.y<r.y||t.y>n.y?[]:e.aG([p],r.x,r.y,n.x,n.y)}for(const e of g){o.reset(e,.25*i);let r=0;r=o.length<=.5*i?1:Math.ceil(o.paddedLength/f)+1;for(let e=0;e<r;e++){const n=e/Math.max(r-1,1),a=o.lerp(n),s=a.x+he,c=a.y+he;m.push(s,c,i,0);const u=s-i,d=c-i,p=s+i,f=c+i;if(T=T&&this.isOffscreen(u,d,p,f),w=w||this.isInsideGrid(u,d,p,f),"always"!==t&&this.grid.hitTestCircle(s,c,i,t,h)&&(b=!0,!l))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!l&&b||!w||_<this.perspectiveRatioCutoff?[]:m,offscreen:T,collisionDetected:b}}projectPathToScreenSpace(t,i){const r=function(t,i){const r=e.N();return e.ay(r,i.pitchedLabelPlaneMatrix),t.map((t=>{const e=Wt(t.x,t.y,r,i.getElevation),n=i.transform.projectTileCoordinates(e.point.x,e.point.y,i.unwrappedTileID,i.getElevation);return n.point.x=(.5*n.point.x+.5)*i.width,n.point.y=(.5*-n.point.y+.5)*i.height,n}))}(t,i);return function(t){let e=0,i=0,r=0,n=0;for(let o=0;o<t.length;o++)t[o].isOccluded?(r=o+1,n=0):(n++,n>i&&(i=n,e=r));return t.slice(e,e+i)}(r)}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const i=[],r=new e.a7;for(const u of t){const t=new e.P(u.x+he,u.y+he);r.extend(t),i.push(t)}const{minX:n,minY:o,maxX:a,maxY:s}=r,l=this.grid.query(n,o,a,s).concat(this.ignoredGrid.query(n,o,a,s)),c={},h={};for(const u of l){const t=u.key;if(void 0===c[t.bucketInstanceId]&&(c[t.bucketInstanceId]={}),c[t.bucketInstanceId][t.featureIndex])continue;const r=[new e.P(u.x1,u.y1),new e.P(u.x2,u.y1),new e.P(u.x2,u.y2),new e.P(u.x1,u.y2)];e.aH(i,r)&&(c[t.bucketInstanceId][t.featureIndex]=!0,void 0===h[t.bucketInstanceId]&&(h[t.bucketInstanceId]=[]),h[t.bucketInstanceId].push(t.featureIndex))}return h}insertCollisionBox(t,e,i,r,n,o){(i?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:n,collisionGroupID:o,overlapMode:e},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,i,r,n,o){const a=i?this.ignoredGrid:this.grid,s={bucketInstanceId:r,featureIndex:n,collisionGroupID:o,overlapMode:e};for(let l=0;l<t.length;l+=4)a.insertCircle(s,t[l],t[l+1],t[l+2])}projectAndGetPerspectiveRatio(t,i,r,n,o){if(o){let r;n?(r=[t,i,n(t,i),1],e.aE(r,r,o)):(r=[t,i,0,1],ce(r,r,o));const a=r[3];return{x:(r[0]/a+1)/2*this.transform.width+he,y:(-r[1]/a+1)/2*this.transform.height+he,perspectiveRatio:.5+this.transform.cameraToCenterDistance/a*.5,isOccluded:!1,signedDistanceFromCamera:a}}{const e=this.transform.projectTileCoordinates(t,i,r,n);return{x:(e.point.x+1)/2*this.transform.width+he,y:(1-e.point.y)/2*this.transform.height+he,perspectiveRatio:.5+this.transform.cameraToCenterDistance/e.signedDistanceFromCamera*.5,isOccluded:e.isOccluded,signedDistanceFromCamera:e.signedDistanceFromCamera}}}getPerspectiveRatio(t,e,i,r){const n=this.transform.projectTileCoordinates(t,e,i,r);return.5+this.transform.cameraToCenterDistance/n.signedDistanceFromCamera*.5}isOffscreen(t,e,i,r){return i<he||t>=this.screenRightBoundary||r<he||e>this.screenBottomBoundary}isInsideGrid(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary}getViewportMatrix(){const t=e.ao([]);return e.O(t,t,[-100,-100,0]),t}_projectCollisionBox(t,i,r,n,o,a,s,l,c,h,u){let d=1,p=0,f=0,m=1;const g=t.anchorPointX+s[0],_=t.anchorPointY+s[1];if(a&&!o){const t=this.projectAndGetPerspectiveRatio(g+1,_,n,c,u),e=t.x-l.x,i=Math.atan((t.y-l.y)/e)+(e<0?Math.PI:0),r=Math.sin(i),o=Math.cos(i);d=o,p=r,f=-r,m=o}else if(!a&&o){const t=qt(this.transform);d=t.vecEast[0],p=t.vecEast[1],f=t.vecSouth[0],m=t.vecSouth[1]}let y=l.x,v=l.y,x=i;o&&(y=g,v=_,x=Math.pow(2,-(this.transform.zoom-r.overscaledZ)),x*=this.transform.getPitchedTextCorrection(g,_,n),h||(x*=e.ak(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),h&&(y+=d*h.x*x+f*h.y*x,v+=p*h.x*x+m*h.y*x);const b=t.x1*x,w=t.x2*x,T=(b+w)/2,S=t.y1*x,P=t.y2*x,I=(S+P)/2,M=[{offsetX:b,offsetY:S},{offsetX:T,offsetY:S},{offsetX:w,offsetY:S},{offsetX:w,offsetY:I},{offsetX:w,offsetY:P},{offsetX:T,offsetY:P},{offsetX:b,offsetY:P},{offsetX:b,offsetY:I}];let E=[];for(const{offsetX:A,offsetY:D}of M)E.push(new e.P(y+d*A+f*D,v+p*A+m*D));let C=!1;if(o){const t=E.map((t=>this.projectAndGetPerspectiveRatio(t.x,t.y,n,c,u)));C=t.some((t=>!t.isOccluded)),E=t.map((t=>new e.P(t.x,t.y)))}else C=!0;return{box:e.aI(E),allPointsOccluded:!C}}}class de{constructor(t,e,i,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class pe{constructor(t,e,i,r,n){this.text=new de(t?t.text:null,e,i,n),this.icon=new de(t?t.icon:null,e,r,n)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class fe{constructor(t,e,i){this.text=t,this.icon=e,this.skipFade=i}}class me{constructor(t,e,i,r,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=n}}class ge{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 e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function _e(t,i,r,n,o){const{horizontalAlign:a,verticalAlign:s}=e.aP(t);return new e.P(-(a-.5)*i+n[0]*o,-(s-.5)*r+n[1]*o)}class ye{constructor(t,e,i,r,n){this.transform=t.clone(),this.terrain=e,this.collisionIndex=new ue(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=i,this.retainedQueryData={},this.collisionGroups=new ge(r),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const e=this.terrain;return e?(i,r)=>e.getElevation(t,i,r):null}getBucketParts(t,i,r,n){const o=r.getBucket(i),a=r.latestFeatureIndex;if(!o||!a||i.id!==o.layerIds[0])return;const s=r.collisionBoxArray,l=o.layers[0].layout,c=o.layers[0].paint,h=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),u=r.tileSize/e.a5,d=r.tileID.toUnwrapped(),p="map"===l.get("text-rotation-alignment"),f=e.aK(r,1,this.transform.zoom),m=e.aL(this.collisionIndex.transform,r,c.get("text-translate"),c.get("text-translate-anchor")),g=e.aL(this.collisionIndex.transform,r,c.get("icon-translate"),c.get("icon-translate-anchor")),_=Gt(p,this.transform,f);this.retainedQueryData[o.bucketInstanceId]=new me(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,r.tileID);const y={bucket:o,layout:l,translationText:m,translationIcon:g,unwrappedTileID:d,pitchedLabelPlaneMatrix:_,scale:h,textPixelRatio:u,holdingForFade:r.holdingForSymbolFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.av(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(n)for(const e of o.sortKeyRanges){const{sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:n}=e;t.push({sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:n,parameters:y})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:y})}attemptAnchorPlacement(t,i,r,n,o,a,s,l,c,h,u,d,p,f,m,g,_,y,v,x){const b=e.aM[t.textAnchor],w=[t.textOffset0,t.textOffset1],T=_e(b,r,n,w,o),S=this.collisionIndex.placeCollisionBox(i,d,l,c,h,s,a,g,u.predicate,v,T,x);if((!y||this.collisionIndex.placeCollisionBox(y,d,l,c,h,s,a,_,u.predicate,v,T,x).placeable)&&S.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(t=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:w,width:r,height:n,anchor:b,textBoxScale:o,prevAnchor:t},this.markUsedJustification(f,b,p,m),f.allowVerticalPlacement&&(this.markUsedOrientation(f,m,p),this.placedOrientations[p.crossTileID]=m),{shift:T,placedGlyphBoxes:S}}}placeLayerBucketPart(t,i,r){const{bucket:n,layout:o,translationText:a,translationIcon:s,unwrappedTileID:l,pitchedLabelPlaneMatrix:c,textPixelRatio:h,holdingForFade:u,collisionBoxArray:d,partiallyEvaluatedTextSize:p,collisionGroup:f}=t.parameters,m=o.get("text-optional"),g=o.get("icon-optional"),_=e.aN(o,"text-overlap","text-allow-overlap"),y="always"===_,v=e.aN(o,"icon-overlap","icon-allow-overlap"),x="always"===v,b="map"===o.get("text-rotation-alignment"),w="map"===o.get("text-pitch-alignment"),T="none"!==o.get("icon-text-fit"),S="viewport-y"===o.get("symbol-z-order"),P=y&&(x||!n.hasIconData()||g),I=x&&(y||!n.hasTextData()||m);!n.collisionArrays&&d&&n.deserializeCollisionBoxes(d);const M=this.retainedQueryData[n.bucketInstanceId].tileID,E=this._getTerrainElevationFunc(M),C=this.transform.getFastPathSimpleProjectionMatrix(M),A=(t,d,x)=>{var S,A;if(i[t.crossTileID])return;if(u)return void(this.placements[t.crossTileID]=new fe(!1,!1,!1));let D=!1,z=!1,k=!0,R=null,F={box:null,placeable:!1,offscreen:null,occluded:!1},L={placeable:!1},B=null,O=null,V=null,j=0,N=0,U=0;d.textFeatureIndex?j=d.textFeatureIndex:t.useRuntimeCollisionCircles&&(j=t.featureIndex),d.verticalTextFeatureIndex&&(N=d.verticalTextFeatureIndex);const G=d.textBox;if(G){const i=i=>{let r=e.aw.horizontal;if(n.allowVerticalPlacement&&!i&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,r=e,this.markUsedOrientation(n,r,t))}return r},o=(i,r)=>{if(n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&d.verticalTextBox){for(const t of n.writingModes)if(t===e.aw.vertical?(F=r(),L=F):F=i(),F&&F.placeable)break}else F=i()},c=t.textAnchorOffsetStartIndex,u=t.textAnchorOffsetEndIndex;if(u===c){const r=(e,i)=>{const r=this.collisionIndex.placeCollisionBox(e,_,h,M,l,w,b,a,f.predicate,E,void 0,C);return r&&r.placeable&&(this.markUsedOrientation(n,i,t),this.placedOrientations[t.crossTileID]=i),r};o((()=>r(G,e.aw.horizontal)),(()=>{const i=d.verticalTextBox;return n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&i?r(i,e.aw.vertical):{box:null,offscreen:null}})),i(F&&F.placeable)}else{let p=e.aM[null===(A=null===(S=this.prevPlacement)||void 0===S?void 0:S.variableOffsets[t.crossTileID])||void 0===A?void 0:A.anchor];const m=(e,i,o)=>{const d=e.x2-e.x1,m=e.y2-e.y1,g=t.textBoxScale,y=T&&"never"===v?i:null;let x=null,S="never"===_?1:2,P="never";p&&S++;for(let r=0;r<S;r++){for(let i=c;i<u;i++){const r=n.textAnchorOffsets.get(i);if(p&&r.textAnchor!==p)continue;const c=this.attemptAnchorPlacement(r,e,d,m,g,b,w,h,M,l,f,P,t,n,o,a,s,y,E);if(c&&(x=c.placedGlyphBoxes,x&&x.placeable))return D=!0,R=c.shift,x}p?p=null:P=_}return r&&!x&&(x={box:this.collisionIndex.placeCollisionBox(G,"always",h,M,l,w,b,a,f.predicate,E,void 0,C).box,offscreen:!1,placeable:!1,occluded:!1}),x};o((()=>m(G,d.iconBox,e.aw.horizontal)),(()=>{const i=d.verticalTextBox;return n.allowVerticalPlacement&&(!F||!F.placeable)&&t.numVerticalGlyphVertices>0&&i?m(i,d.verticalIconBox,e.aw.vertical):{box:null,occluded:!0,offscreen:null}})),F&&(D=F.placeable,k=F.offscreen);const g=i(F&&F.placeable);if(!D&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(n,e.anchor,t,g))}}}if(B=F,D=B&&B.placeable,k=B&&B.offscreen,t.useRuntimeCollisionCircles&&t.centerJustifiedTextSymbolIndex>=0){const i=n.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),s=e.ax(n.textSizeData,p,i),h=o.get("text-padding");O=this.collisionIndex.placeCollisionCircles(_,i,n.lineVertexArray,n.glyphOffsetArray,s,l,c,r,w,f.predicate,t.collisionCircleDiameter,h,a,E),O.circles.length&&O.collisionDetected&&!r&&e.w("Collisions detected, but collision boxes are not shown"),D=y||O.circles.length>0&&!O.collisionDetected,k=k&&O.offscreen}if(d.iconFeatureIndex&&(U=d.iconFeatureIndex),d.iconBox){const t=t=>this.collisionIndex.placeCollisionBox(t,v,h,M,l,w,b,s,f.predicate,E,T&&R?R:void 0,C);L&&L.placeable&&d.verticalIconBox?(V=t(d.verticalIconBox),z=V.placeable):(V=t(d.iconBox),z=V.placeable),k=k&&V.offscreen}const Z=m||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,q=g||0===t.numIconVertices;Z||q?q?Z||(z=z&&D):D=z&&D:z=D=z&&D;const W=z&&V.placeable;if(D&&B.placeable&&this.collisionIndex.insertCollisionBox(B.box,_,o.get("text-ignore-placement"),n.bucketInstanceId,L&&L.placeable&&N?N:j,f.ID),W&&this.collisionIndex.insertCollisionBox(V.box,v,o.get("icon-ignore-placement"),n.bucketInstanceId,U,f.ID),O&&D&&this.collisionIndex.insertCollisionCircles(O.circles,_,o.get("text-ignore-placement"),n.bucketInstanceId,j,f.ID),r&&this.storeCollisionData(n.bucketInstanceId,x,d,B,V,O),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===n.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new fe((D||P)&&!(null==B?void 0:B.occluded),(z||I)&&!(null==V?void 0:V.occluded),k||n.justReloaded),i[t.crossTileID]=!0};if(S){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const e=n.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let t=e.length-1;t>=0;--t){const i=e[t];A(n.symbolInstances.get(i),n.collisionArrays[i],i)}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)A(n.symbolInstances.get(e),n.collisionArrays[e],e);n.justReloaded=!1}storeCollisionData(t,e,i,r,n,o){if(i.textBox||i.iconBox){let o,a;this.collisionBoxArrays.has(t)?o=this.collisionBoxArrays.get(t):(o=new Map,this.collisionBoxArrays.set(t,o)),o.has(e)?a=o.get(e):(a={text:null,icon:null},o.set(e,a)),i.textBox&&(a.text=r.box),i.iconBox&&(a.icon=n.box)}if(o){let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=[]);for(let t=0;t<o.circles.length;t+=4)e.push(o.circles[t+0]-he),e.push(o.circles[t+1]-he),e.push(o.circles[t+2]),e.push(o.collisionDetected?1:0)}}markUsedJustification(t,i,r,n){let o;o=n===e.aw.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[e.aO(i)];const a=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];for(const e of a)e>=0&&(t.text.placedSymbolArray.get(e).crossTileID=o>=0&&e!==o?0:r.crossTileID)}markUsedOrientation(t,i,r){const n=i===e.aw.horizontal||i===e.aw.horizontalOnly?i:0,o=i===e.aw.vertical?i:0,a=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];for(const e of a)t.text.placedSymbolArray.get(e).placedOrientation=n;r.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=o)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const r=e?e.symbolFadeChange(t):1,n=e?e.opacities:{},o=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(const s in this.placements){const t=this.placements[s],e=n[s];e?(this.opacities[s]=new pe(e,r,t.text,t.icon),i=i||t.text!==e.text.placed||t.icon!==e.icon.placed):(this.opacities[s]=new pe(null,r,t.text,t.icon,t.skipFade),i=i||t.text||t.icon)}for(const s in n){const t=n[s];if(!this.opacities[s]){const e=new pe(t,r,!1,!1);e.isHidden()||(this.opacities[s]=e,i=i||t.text.placed||t.icon.placed)}}for(const s in o)this.variableOffsets[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.variableOffsets[s]=o[s]);for(const s in a)this.placedOrientations[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.placedOrientations[s]=a[s]);if(e&&void 0===e.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const i={};for(const r of e){const e=r.getBucket(t);e&&r.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,r.tileID,i,r.collisionBoxArray)}}updateBucketOpacities(t,i,r,n){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 o=t.layers[0],a=o.layout,s=new pe(null,0,!1,!1,!0),l=a.get("text-allow-overlap"),c=a.get("icon-allow-overlap"),h=o._unevaluatedLayout.hasValue("text-variable-anchor")||o._unevaluatedLayout.hasValue("text-variable-anchor-offset"),u="map"===a.get("text-rotation-alignment"),d="map"===a.get("text-pitch-alignment"),p="none"!==a.get("icon-text-fit"),f=new pe(null,0,l&&(c||!t.hasIconData()||a.get("icon-optional")),c&&(l||!t.hasTextData()||a.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);const m=(t,e,i)=>{for(let r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(i);t.hasVisibleVertices=t.hasVisibleVertices||i!==Ee},g=this.collisionBoxArrays.get(t.bucketInstanceId);for(let _=0;_<t.symbolInstances.length;_++){const i=t.symbolInstances.get(_),{numHorizontalGlyphVertices:n,numVerticalGlyphVertices:o,crossTileID:a}=i;let l=this.opacities[a];r[a]?l=s:l||(l=f,this.opacities[a]=l),r[a]=!0;const c=i.numIconVertices>0,y=this.placedOrientations[i.crossTileID],v=y===e.aw.vertical,x=y===e.aw.horizontal||y===e.aw.horizontalOnly;if(n>0||o>0){const e=Me(l.text);m(t.text,n,v?Ee:e),m(t.text,o,x?Ee:e);const r=l.text.isHidden();[i.rightJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.leftJustifiedTextSymbolIndex].forEach((e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=r||v?1:0)})),i.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).hidden=r||x?1:0);const a=this.variableOffsets[i.crossTileID];a&&this.markUsedJustification(t,a.anchor,i,y);const s=this.placedOrientations[i.crossTileID];s&&(this.markUsedJustification(t,"left",i,s),this.markUsedOrientation(t,s,i))}if(c){const e=Me(l.icon),r=!(p&&i.verticalPlacedIconSymbolIndex&&v);i.placedIconSymbolIndex>=0&&(m(t.icon,i.numIconVertices,r?e:Ee),t.icon.placedSymbolArray.get(i.placedIconSymbolIndex).hidden=l.icon.isHidden()),i.verticalPlacedIconSymbolIndex>=0&&(m(t.icon,i.numVerticalIconVertices,r?Ee:e),t.icon.placedSymbolArray.get(i.verticalPlacedIconSymbolIndex).hidden=l.icon.isHidden())}const b=g&&g.has(_)?g.get(_):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const i=t.collisionArrays[_];if(i){let r=new e.P(0,0);if(i.textBox||i.verticalTextBox){let e=!0;if(h){const t=this.variableOffsets[a];t?(r=_e(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),u&&r._rotate(d?-this.transform.bearingInRadians:this.transform.bearingInRadians)):e=!1}if(i.textBox||i.verticalTextBox){let n;i.textBox&&(n=v),i.verticalTextBox&&(n=x),ve(t.textCollisionBox.collisionVertexArray,l.text.placed,!e||n,b.text,r.x,r.y)}}if(i.iconBox||i.verticalIconBox){const e=Boolean(!x&&i.verticalIconBox);let n;i.iconBox&&(n=e),i.verticalIconBox&&(n=!e),ve(t.iconCollisionBox.collisionVertexArray,l.icon.placed,n,b.icon,p?r.x:0,p?r.y:0)}}}}if(t.sortFeatures(-this.transform.bearingInRadians),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 (= ".concat(t.text.opacityVertexArray.length,") !== bucket.text.layoutVertexArray.length (= ").concat(t.text.layoutVertexArray.length,") / 4"));if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error("bucket.icon.opacityVertexArray.length (= ".concat(t.icon.opacityVertexArray.length,") !== bucket.icon.layoutVertexArray.length (= ").concat(t.icon.layoutVertexArray.length,") / 4"));t.bucketInstanceId in this.collisionCircleArrays&&(t.collisionCircleArray=this.collisionCircleArrays[t.bucketInstanceId],delete this.collisionCircleArrays[t.bucketInstanceId])}symbolFadeChange(t){return 0===this.fadeDuration?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,e){const i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=!0}}function ve(t,e,i,r,n,o){r&&0!==r.length||(r=[0,0,0,0]);const a=r[0]-he,s=r[1]-he,l=r[2]-he,c=r[3]-he;t.emplaceBack(e?1:0,i?1:0,n||0,o||0,a,s),t.emplaceBack(e?1:0,i?1:0,n||0,o||0,l,s),t.emplaceBack(e?1:0,i?1:0,n||0,o||0,l,c),t.emplaceBack(e?1:0,i?1:0,n||0,o||0,a,c)}const xe=Math.pow(2,25),be=Math.pow(2,24),we=Math.pow(2,17),Te=Math.pow(2,16),Se=Math.pow(2,9),Pe=Math.pow(2,8),Ie=Math.pow(2,1);function Me(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*xe+e*be+i*we+e*Te+i*Se+e*Pe+i*Ie+e}const Ee=0;class Ce{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,i,r,n){const o=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(o,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort(((t,e)=>t.sortKey-e.sortKey)));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,n())return!0;return!1}}class Ae{constructor(t,e,i,r,n,o,a,s){this.placement=new ye(t,e,o,a,s),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(t,e,i){const r=c(),n=()=>!this._forceFullPlacement&&c()-r>2;for(;this._currentPlacementIndex>=0;){const r=e[t[this._currentPlacementIndex]],o=this.placement.collisionIndex.transform.zoom;if("symbol"===r.type&&(!r.minzoom||r.minzoom<=o)&&(!r.maxzoom||r.maxzoom>o)){if(this._inProgressLayer||(this._inProgressLayer=new Ce(r)),this._inProgressLayer.continuePlacement(i[r.source],this.placement,this._showCollisionBoxes,r,n))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const De=512/e.a5/2;class ze{constructor(t,i,r){this.tileID=t,this.bucketInstanceId=r,this._symbolsByKey={};const n=new Map;for(let e=0;e<i.length;e++){const t=i.get(e),r=t.key,o=n.get(r);o?o.push(t):n.set(r,[t])}for(const[o,a]of n){const t={positions:a.map((t=>({x:Math.floor(t.anchorX*De),y:Math.floor(t.anchorY*De)}))),crossTileIDs:a.map((t=>t.crossTileID))};if(t.positions.length>128){const i=new e.aQ(t.positions.length,16,Uint16Array);for(const{x:e,y:r}of t.positions)i.add(e,r);i.finish(),delete t.positions,t.index=i}this._symbolsByKey[o]=t}}getScaledCoordinates(t,i){const{x:r,y:n,z:o}=this.tileID.canonical,{x:a,y:s,z:l}=i.canonical,c=De/Math.pow(2,l-o),h=(s*e.a5+t.anchorY)*c,u=n*e.a5*De;return{x:Math.floor((a*e.a5+t.anchorX)*c-r*e.a5*De),y:Math.floor(h-u)}}findMatches(t,e,i){const r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z);for(let n=0;n<t.length;n++){const o=t.get(n);if(o.crossTileID)continue;const a=this._symbolsByKey[o.key];if(!a)continue;const s=this.getScaledCoordinates(o,e);if(a.index){const t=a.index.range(s.x-r,s.y-r,s.x+r,s.y+r).sort();for(const e of t){const t=a.crossTileIDs[e];if(!i[t]){i[t]=!0,o.crossTileID=t;break}}}else if(a.positions)for(let t=0;t<a.positions.length;t++){const e=a.positions[t],n=a.crossTileIDs[t];if(Math.abs(e.x-s.x)<=r&&Math.abs(e.y-s.y)<=r&&!i[n]){i[n]=!0,o.crossTileID=n;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((t=>{let{crossTileIDs:e}=t;return e}))}}class ke{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Re{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const i in this.indexes){const t=this.indexes[i],r={};for(const i in t){const n=t[i];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),r[n.tileID.key]=n}this.indexes[i]=r}this.lng=t}addBucket(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const r=this.usedCrossTileIDs[t.overscaledZ];for(const n in this.indexes){const i=this.indexes[n];if(Number(n)>t.overscaledZ)for(const n in i){const o=i[n];o.tileID.isChildOf(t)&&o.findMatches(e.symbolInstances,t,r)}else{const o=i[t.scaledTo(Number(n)).key];o&&o.findMatches(e.symbolInstances,t,r)}}for(let n=0;n<e.symbolInstances.length;n++){const t=e.symbolInstances.get(n);t.crossTileID||(t.crossTileID=i.generate(),r[t.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new ze(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(const i of e.getCrossTileIDsLists())for(const e of i)delete this.usedCrossTileIDs[t][e]}removeStaleBuckets(t){let e=!1;for(const i in this.indexes){const r=this.indexes[i];for(const n in r)t[r[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[n]),delete r[n],e=!0)}return e}}class Fe{constructor(){this.layerIndexes={},this.crossTileIDs=new ke,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,i){let r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new Re);let n=!1;const o={};r.handleWrapJump(i);for(const a of e){const e=a.getBucket(t);e&&t.id===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(a.tileID,e,this.crossTileIDs)&&(n=!0),o[e.bucketInstanceId]=!0)}return r.removeStaleBuckets(o)&&(n=!0),n}pruneUnusedLayers(t){const e={};t.forEach((t=>{e[t]=!0}));for(const i in this.layerIndexes)e[i]||delete this.layerIndexes[i]}}var Le="void main() {fragColor=vec4(1.0);}";const Be={prelude:Oe("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nout highp vec4 fragColor;","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);
1return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+      c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+    c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+    c\n);}\n#ifdef TERRAIN3D\nuniform 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;\n#endif\nconst 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) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 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;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\n#ifdef GLOBE\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\n#endif\nvec2 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;\n#else\nreturn 0.0;\n#endif\n}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;"),projectionMercator:Oe("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:Oe("","#define GLOBE_RADIUS 6371008.8\nuniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos\n);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); \nif (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len\n);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}"),background:Oe("uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:Oe("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;
1uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);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:Oe("in vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;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));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {\n#ifdef GLOBE\nvec3 center_vector=projectToSphere(circle_center);\n#endif\nfloat angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {\n#ifdef GLOBE\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\n#else\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\n#endif\ncorner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}\n#ifdef GLOBE\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\n#else\ngl_Position=projectTileWithElevation(corner_position,ele);\n#endif\n} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}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;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:Oe(Le,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:Oe("uniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0);\n#ifdef GLOBE\nvec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);\n#else\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\n#endif\n}"),heatmapTexture:Oe("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out 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:Oe("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:Oe("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;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);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {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;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:Oe("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else\n{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:Oe("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:Oe(Le,"in vec2 a_pos;void main() {\n#ifdef GLOBE\ngl_Position=projectTileFor3D(a_pos,0.0);\n#else\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\n#endif\n}"),fill:Oe("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nfragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_fill_translate;in vec2 a_pos;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);}"),fillOutline:Oe("in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillOutlinePattern:Oe("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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=texture(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=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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=projectTile(a_pos+u_fill_translate,a_pos);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;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}
1"),fillPattern:Oe("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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=texture(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=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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=projectTile(a_pos+u_fill_translate,a_pos);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:Oe("in vec4 v_color;void main() {fragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\nout vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nfloat colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);\n#ifdef GLOBE\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\n#endif\ndirectional=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:Oe("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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=texture(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=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","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 vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\n#ifdef GLOBE\nout vec3 v_sphere_pos;\n#endif\nout vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,elevation*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:Oe("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;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))*tileSize/p
1ow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out 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:Oe("uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];\n#define PI 3.141592653589793\n#define STANDARD 0\n#define COMBINED 1\n#define IGOR 2\n#define MULTIDIRECTIONAL 3\n#define BASIC 4\nfloat get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else\n{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else\n{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:Oe("uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;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);
1float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:Oe("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:Oe("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 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(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;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);
1float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:Oe("uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
1float sdfgamma=(u_lineatlas_width/256.0/u_device_pixel_ratio)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}"),lineGradientSDF:Oe("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform sampler2D u_image_dash;uniform float u_mix;uniform lowp float u_lineatlas_width;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);float sdfdist_a=texture(u_image_dash,v_tex_a).a;float sdfdist_b=texture(u_image_dash,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);
1float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);float dash_alpha=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*dash_alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;out vec2 v_tex_a;out vec2 v_tex_b;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;float texel_height=1.0/u_image_height;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);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}"),raster:Oe("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in 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=texture(u_image0,v_pos0);vec4 color1=texture(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);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;\n#ifdef GLOBE\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\n#endif\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Oe("uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;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:Oe("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float 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=texture(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);}fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in 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_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;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_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy/16.0;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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;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:Oe("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
1fragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in 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_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;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_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;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(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=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);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;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;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:Oe("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);
1float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Oe("in 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() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:Oe("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:Oe("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:Oe("#ifdef GL_ES\nprecision highp float;\n#endif\nin vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758\n);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}","in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:Oe("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};
1function Oe(t,e){const i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/in ([\w]+) ([\w]+)/g),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(n):n,s={};return{fragmentSource:t=t.replace(i,((t,e,i,r,n)=>(s[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\nin ").concat(i," ").concat(r," ").concat(n,";\n#else\nuniform ").concat(i," ").concat(r," u_").concat(n,";\n#endif\n"):"\n#ifdef HAS_UNIFORM_u_".concat(n,"\n    ").concat(i," ").concat(r," ").concat(n," = u_").concat(n,";\n#endif\n")))),vertexSource:e=e.replace(i,((t,e,i,r,n)=>{const o="float"===r?"vec2":"vec4",a=n.match(/color/)?"color":o;return s[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\nuniform lowp float u_").concat(n,"_t;\nin ").concat(i," ").concat(o," a_").concat(n,";\nout ").concat(i," ").concat(r," ").concat(n,";\n#else\nuniform ").concat(i," ").concat(r," u_").concat(n,";\n#endif\n"):"vec4"===a?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\n    ").concat(n," = a_").concat(n,";\n#else\n    ").concat(i," ").concat(r," ").concat(n," = u_").concat(n,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(n,"\n    ").concat(n," = unpack_mix_").concat(a,"(a_").concat(n,", u_").concat(n,"_t);\n#else\n    ").concat(i," ").concat(r," ").concat(n," = u_").concat(n,";\n#endif\n"):"define"===e?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\nuniform lowp float u_").concat(n,"_t;\nin ").concat(i," ").concat(o," a_").concat(n,";\n#else\nuniform ").concat(i," ").concat(r," u_").concat(n,";\n#endif\n"):"vec4"===a?"\n#ifndef HAS_UNIFORM_u_".concat(n,"\n    ").concat(i," ").concat(r," ").concat(n," = a_").concat(n,";\n#else\n    ").concat(i," ").concat(r," ").concat(n," = u_").concat(n,";\n#endif\n"):"\n#ifndef HAS_UNIFORM_u_".concat(n,"\n    ").concat(i," ").concat(r," ").concat(n," = unpack_mix_").concat(a,"(a_").concat(n,", u_").concat(n,"_t);\n#else\n    ").concat(i," ").concat(r," ").concat(n," = u_").concat(n,";\n#endif\n")})),staticAttributes:r,staticUniforms:a}}class Ve{constructor(t,e,i){this.vertexBuffer=t,this.indexBuffer=e,this.segments=i}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var je=e.aR([{name:"a_pos",type:"Int16",components:2}]);const Ne="#define PROJECTION_MERCATOR",Ue="mercator";class Ge{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Ue}get shaderDefine(){return Ne}get shaderPreludeCode(){return Be.projectionMercator}get vertexShaderPreludeCode(){return Be.projectionMercator.vertexSource}get subdivisionGranularity(){return e.aS.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,i,r,n,o){if(this._cachedMesh)return this._cachedMesh;const a=new e.aT;a.emplaceBack(0,0),a.emplaceBack(e.a5,0),a.emplaceBack(0,e.a5),a.emplaceBack(e.a5,e.a5);const s=t.createVertexBuffer(a,je.members),l=e.aU.simpleSegment(0,0,4,2),c=new e.aV;c.emplaceBack(1,0,2),c.emplaceBack(1,2,3);const h=t.createIndexBuffer(c);return this._cachedMesh=new Ve(s,h,l),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class Ze{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;
1if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=r}interpolate(t,i,r){return null!=i.top&&null!=t.top&&(this.top=e.G.number(t.top,i.top,r)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.G.number(t.bottom,i.bottom,r)),null!=i.left&&null!=t.left&&(this.left=e.G.number(t.left,i.left,r)),null!=i.right&&null!=t.right&&(this.right=e.G.number(t.right,i.right,r)),this}getCenter(t,i){const r=e.ak((this.left+t-this.right)/2,0,t),n=e.ak((this.top+i-this.bottom)/2,0,i);return new e.P(r,n)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new Ze(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function qe(t,e){if(!t.renderWorldCopies||t.lngRange)return;const i=e.lng-t.center.lng;e.lng+=i>180?-360:i<-180?360:0}function We(t){return Math.max(0,Math.floor(t))}class Xe{constructor(t,i){var r;this.applyConstrain=(t,e)=>null!==this._constrainOverride?this._constrainOverride(t,e):this._callbacks.defaultConstrain(t,e),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=void 0===(null==i?void 0:i.renderWorldCopies)||!!(null==i?void 0:i.renderWorldCopies),this._minZoom=(null==i?void 0:i.minZoom)||0,this._maxZoom=(null==i?void 0:i.maxZoom)||22,this._minPitch=null==(null==i?void 0:i.minPitch)?0:null==i?void 0:i.minPitch,this._maxPitch=null==(null==i?void 0:i.maxPitch)?60:null==i?void 0:i.maxPitch,this._constrainOverride=null!==(r=null==i?void 0:i.constrainOverride)&&void 0!==r?r:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new e.V(0,0),this._elevation=0,this._zoom=0,this._tileZoom=We(this._zoom),this._scale=e.an(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Ze,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,i,r){this._constrainOverride=t.constrainOverride,this._latRange=t.latRange,this._lngRange=t.lngRange,this._width=t.width,this._height=t.height,this._center=t.center,this._elevation=t.elevation,this._minElevationForCurrentTile=t.minElevationForCurrentTile,this._zoom=t.zoom,this._tileZoom=We(this._zoom),this._scale=e.an(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new Ze(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=!r&&t.autoCalculateNearFarZ,i&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(t){this._minZoom!==t&&(this._minZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(t){this._minPitch!==t&&(this._minPitch=t,this.setPitch(Math.max(this.pitch,t)))}get maxPitch(){return this._maxPitch}setMaxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.setPitch(Math.min(this.pitch,t)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get constrainOverride(){return this._constrainOverride}setConstrainOverride(t){void 0===t&&(t=null),this._constrainOverride!==t&&(this._constrainOverride=t,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){const i=e.W(t,-180,180)*Math.PI/180;var n,o,a,s,l,c,h,u,d;this._bearingInRadians!==i&&(this._unmodified=!1,this._bearingInRadians=i,this._calcMatrices(),this._rotationMatrix=r(),n=this._rotationMatrix,a=-this._bearingInRadians,s=(o=this._rotationMatrix)[0],l=o[1],c=o[2],h=o[3],u=Math.sin(a),d=Math.cos(a),n[0]=s*d+c*u,n[1]=l*d+h*u,n[2]=s*-u+c*d,n[3]=l*-u+h*d)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){const i=e.ak(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==i&&(this._unmodified=!1,this._pitchInRadians=i,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){const e=t/180*Math.PI;this._rollInRadians!==e&&(this._unmodified=!1,this._rollInRadians=e,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return e.aW(this._fovInRadians)}setFov(t){t=e.ak(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=e.am(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){const i=this.applyConstrain(this._center,t).zoom;this._zoom!==i&&(this._unmodified=!1,this._zoom=i,this._tileZoom=Math.max(0,Math.floor(i)),this._scale=e.an(i),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(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)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(t,e){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=e,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this.constrainInternal(),this._calcMatrices()}resize(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this._width=t,this._height=e,i&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange&&2===this._latRange.length&&this._lngRange&&2===this._lngRange.length?new X([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-e.al,e.al])}getCameraQueryGeometry(t,i){if(1===i.length)return[i[0],t];{const{minX:r,minY:n,maxX:o,maxY:a}=e.a7.fromPoints(i).extend(t);return[new e.P(r,n),new e.P(o,n),new e.P(o,a),new e.P(r,a),new e.P(r,n)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:e,zoom:i}=this.applyConstrain(this.center,this.zoom);this.setCenter(e),this.setZoom(i),this._unmodified=t,this._constraining=!1}
1_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=e.ao(new Float64Array(16));e.Q(t,t,[this._width/2,-this._height/2,1]),e.O(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=e.ao(new Float64Array(16)),e.Q(t,t,[1,-1,1]),e.O(t,t,[-1,-1,0]),e.Q(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,i,r,n){const o=void 0!==r?r:this.bearing,a=n=void 0!==n?n:this.pitch,{distanceToCenter:s,clampedElevation:l}=this._distanceToCenterFromAltElevationPitch(i,this.elevation,a),{x:c,y:h}=St(a,o),u=e.a6.fromLngLat(t,i);let d,p,f=e.aX(1,u.y),m=0;do{if(m+=1,m>10)break;p=s/f,d=new e.a6(u.x+c*p,u.y+h*p),f=1/d.meterInMercatorCoordinateUnits()}while(Math.abs(s-p*f)>1e-12);return{center:d.toLngLat(),elevation:l,zoom:e.aq(this.height/2/Math.tan(this.fovInRadians/2)/p/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;const i=1/this.worldSize,r=e.ap(1,this.center.lat)*this.worldSize,n=e.a6.fromLngLat(this.center,this.elevation),o=n.x/i,a=n.y/i,s=n.z/i,l=this.pitch,c=this.bearing,{x:h,y:u,z:d}=St(l,c),p=this.cameraToCenterDistance,f=o+p*-h,m=a+p*-u,g=s+p*d,{distanceToCenter:_,clampedElevation:y}=this._distanceToCenterFromAltElevationPitch(g/r,t,l),v=_*r,x=new e.a6((f+h*v)*i,(m+u*v)*i,0).toLngLat(),b=e.ap(1,x.lat),w=e.aq(this.height/2/Math.tan(this.fovInRadians/2)/_/b/this.tileSize);this._elevation=y,this._center=x,this.setZoom(w)}_distanceToCenterFromAltElevationPitch(t,i,r){const n=-Math.cos(e.am(r)),o=t-i;let a,s=i;return n*o>=0||Math.abs(n)<.1?(a=1e4,s=t+a*n):a=-o/n,{distanceToCenter:a,clampedElevation:s}}getCameraPoint(){const t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){const t=e.ap(1,this.center.lat)*this.worldSize;return Tt(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/t).toLngLat()}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];const i=t.canonical.z>=0?1<<t.canonical.z:Math.pow(2,t.canonical.z);return[t.canonical.x/i,t.canonical.y/i,1/i/e.a5,1/i/e.a5]}}class He{constructor(t,i){this.min=t,this.max=i,this.center=e.aY([],e.aZ([],this.min,this.max),.5)}quadrant(t){const i=[t%2==0,t<2],r=e.a_(this.min),n=e.a_(this.max);for(let e=0;e<i.length;e++)r[e]=i[e]?this.min[e]:this.center[e],n[e]=i[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new He(r,n)}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]}intersectsFrustum(t){let e=!0;for(let i=0;i<t.planes.length;i++){const r=this.intersectsPlane(t.planes[i]);if(0===r)return 0;1===r&&(e=!1)}return e?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let e=t[3],i=t[3];for(let r=0;r<3;r++)t[r]>0?(e+=t[r]*this.min[r],i+=t[r]*this.max[r]):(i+=t[r]*this.min[r],e+=t[r]*this.max[r]);return e>=0?2:i<0?0:1}}class Ye{distanceToTile2d(t,e,i,r){const n=r.distanceX([t,e]),o=r.distanceY([t,e]);return Math.hypot(n,o)}getWrap(t,e,i){return i}getTileBoundingVolume(t,i,r,n){var o,a;let s=0,l=0;if(null==n?void 0:n.terrain){const c=new e.a2(t.z,i,t.z,t.x,t.y),h=n.terrain.getMinMaxElevation(c);s=null!==(o=h.minElevation)&&void 0!==o?o:Math.min(0,r),l=null!==(a=h.maxElevation)&&void 0!==a?a:Math.max(0,r)}const c=1<<t.z;return new He([i+t.x/c,t.y/c,s],[i+(t.x+1)/c,(t.y+1)/c,l])}allowVariableZoom(t,i){const r=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,n=e.ak(78.5-r/2,0,60);return!!i.terrain||t.pitch>n}allowWorldCopies(){return!0}prepareNextFrame(){}}class Ke{constructor(t,e,i){this.points=t,this.planes=e,this.aabb=i}static fromInvProjectionMatrix(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;const a=o?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],s=Math.pow(2,r),l=[[-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((r=>function(t,i,r,n){const o=e.aE([],t,i),a=1/o[3]/r*n;return e.b3(o,o,[a,a,1/o[3],a])}(r,t,i,s)));n&&function(t,i,r,n){const o=n?4:0,a=n?0:4;let s=0;const l=[],c=[];for(let d=0;d<4;d++){const i=e.a$([],t[d+a],t[d+o]),r=e.b4(i);e.aY(i,i,1/r),l.push(r),c.push(i)}for(let d=0;d<4;d++){const i=e.b5(t[d+o],c[d],r);s=null!==i&&i>=0?Math.max(s,i):Math.max(s,l[d])}const h=function(t,i){const r=e.a$([],t[i[0]],t[i[1]]),n=e.a$([],t[i[2]],t[i[1]]),o=[0,0,0,0];return e.b0(o,e.b1([],r,n)),o[3]=-e.b2(o,t[i[0]]),o}(t,i),u=function(t,i){const r=e.b6(t),n=e.b7([],t,1/r),o=e.a$([],i,e.aY([],n,e.b2(i,n))),a=e.b6(o);if(a>0){const t=Math.sqrt(1-n[3]*n[3]),r=e.aY([],n,-n[3]),s=e.aZ([],r,e.aY([],o,t/a));return e.b8(i,s)}return null}(r,h);if(null!==u){const t=u/e.b2(c[0],h);s=Math.min(s,t)}for(let e=0;e<4;e++){const i=Math.min(s,l[e]);t[e+a]=[t[e+o][0]+c[e][0]*i,t[e+o][1]+c[e][1]*i,t[e+o][2]+c[e][2]*i,1]}}(l,a[0],n,o);const c=a.map((t=>{const i=e.a$([],l[t[0]],l[t[1]]),r=e.a$([],l[t[2]],l[t[1]]),n=e.b0([],e.b1([],i,r)),o=-e.b2(n,l[t[1]]);return n.concat(o)})),h=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],u=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(const e of l)for(let t=0;t<3;t++)h[t]=Math.min(h[t],e[t]),u[t]=Math.max(u[t],e[t]);return new Ke(l,c,new He(h,u))}}
vendor: 4,074 bytes, line 1
1class Je{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,e,i){return this._helper.interpolatePadding(t,e,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this._helper.resize(t,e,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,e){this._helper.overrideNearFarZ(t,e)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t,e){}constructor(t){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(t,i)=>{i=e.ak(+i,this.minZoom,this.maxZoom);const r={center:new e.V(t.lng,t.lat),zoom:i};let n=this._helper._lngRange;if(!this._helper._renderWorldCopies&&null===n){const t=180-1e-10;n=[-t,t]}const o=this.tileSize*e.an(r.zoom);let a=0,s=o,l=0,c=o,h=0,u=0;const{x:d,y:p}=this.size;if(this._helper._latRange){const t=this._helper._latRange;a=e.X(t[1])*o,s=e.X(t[0])*o,s-a<p&&(h=p/(s-a))}n&&(l=e.W(e.Y(n[0])*o,0,o),c=e.W(e.Y(n[1])*o,0,o),c<l&&(c+=o),c-l<d&&(u=d/(c-l)));const{x:f,y:m}=vt(o,t);let g,_;const y=Math.max(u||0,h||0);if(y){const t=new e.P(u?(c+l)/2:f,h?(s+a)/2:m);return r.center=xt(o,t).wrap(),r.zoom+=e.aq(y),r}if(this._helper._latRange){const t=p/2;m-t<a&&(_=a+t),m+t>s&&(_=s-t)}if(n){const t=(l+c)/2;let i=f;
vendor: 4,838 bytes, line 1
1this._helper._renderWorldCopies&&(i=e.W(f,t-o/2,t+o/2));const r=d/2;i-r<l&&(g=l+r),i+r>c&&(g=c-r)}if(void 0!==g||void 0!==_){const t=new e.P(null!=g?g:f,null!=_?_:m);r.center=xt(o,t).wrap()}return r},this.applyConstrain=(t,e)=>this._helper.applyConstrain(t,e),this._helper=new Xe({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,e)=>this.defaultConstrain(t,e)},t),this._coveringTilesDetailsProvider=new Ye}clone(){const t=new Je;return t.apply(this,!1),t}apply(t,e,i){this._helper.apply(t,e,i)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(t){const i=[new e.b9(0,t)];if(this._helper._renderWorldCopies){const r=this.screenPointToMercatorCoordinate(new e.P(0,0)),n=this.screenPointToMercatorCoordinate(new e.P(this._helper._width,0)),o=this.screenPointToMercatorCoordinate(new e.P(this._helper._width,this._helper._height)),a=this.screenPointToMercatorCoordinate(new e.P(0,this._helper._height)),s=Math.floor(Math.min(r.x,n.x,o.x,a.x)),l=Math.floor(Math.max(r.x,n.x,o.x,a.x)),c=1;for(let h=s-c;h<=l+c;h++)0!==h&&i.push(new e.b9(h,t))}return i}getCameraFrustum(){return Ke.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){const e=this.screenPointToLocation(this.centerPoint,t),i=t?t.getElevationForLngLatZoom(e,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(i)}setLocationAtPoint(t,i){const r=e.ap(this.elevation,this.center.lat),n=this.screenPointToMercatorCoordinateAtZ(i,r),o=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,r),a=e.a6.fromLngLat(t),s=new e.a6(a.x-(n.x-o.x),a.y-(n.y-o.y));this.setCenter(null==s?void 0:s.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,i){return i?this.coordinatePoint(e.a6.fromLngLat(t),i.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(e.a6.fromLngLat(t))}screenPointToLocation(t,e){var i;return null===(i=this.screenPointToMercatorCoordinate(t,e))||void 0===i?void 0:i.toLngLat()}screenPointToMercatorCoordinate(t,e){if(e){const i=e.pointCoordinate(t);if(null!=i)return i}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,i){const r=i||0,n=[t.x,t.y,0,1],o=[t.x,t.y,1,1];e.aE(n,n,this._pixelMatrixInverse),e.aE(o,o,this._pixelMatrixInverse);const a=n[3],s=o[3],l=n[1]/a,c=o[1]/s,h=n[2]/a,u=o[2]/s,d=h===u?0:(r-h)/(u-h);return new e.a6(e.G.number(n[0]/a,o[0]/s,d)/this.worldSize,e.G.number(l,c,d)/this.worldSize,r)}coordinatePoint(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this._pixelMatrix;const n=[t.x*this.worldSize,t.y*this.worldSize,i,1];return e.aE(n,n,r),new e.P(n[0]/n[3],n[1]/n[3])}getBounds(){const t=Math.max(0,this._helper._height/2-bt(this));return(new X).extend(this.screenPointToLocation(new e.P(0,t))).extend(this.screenPointToLocation(new e.P(this._helper._width,t))).extend(this.screenPointToLocation(new e.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new e.P(0,this._helper._height)))}isPointOnMapSurface(t,e){return e?null!=e.pointCoordinate(t):t.y>this.height/2-bt(this)}calculatePosMatrix(t){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0;var n;const o=null!==(n=t.key)&&void 0!==n?n:e.ba(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),a=i?this._alignedPosMatrixCache:this._posMatrixCache;if(a.has(o)){const t=a.get(o);return r?t.f32:t.f64}const s=wt(t,this.worldSize);e.S(s,i?this._alignedProjMatrix:this._viewProjMatrix,s);const l={f64:s,f32:new Float32Array(s)};return a.set(o,l),r?l.f32:l.f64}calculateFogMatrix(t){const i=t.key,r=this._fogMatrixCacheF32;if(r.has(i))return r.get(i);const n=wt(t,this.worldSize);return e.S(n,this._fogMatrix,n),r.set(i,new Float32Array(n)),r.get(i)}calculateCenterFromCameraLngLatAlt(t,e,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,e,i,r)}_calculateNearFarZIfNeeded(t,i,r){if(!this._helper.autoCalculateNearFarZ)return;const n=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),o=t-n*this._helper._pixelPerMeter/Math.cos(i),a=n<0?o:t,s=Math.PI/2+this.pitchInRadians,l=e.am(this.fov)*(Math.abs(Math.cos(e.am(this.roll)))*this.height+Math.abs(Math.sin(e.am(this.roll)))*this.width)/this.height*(.5+r.y/this.height),c=Math.sin(l)*a/Math.sin(e.ak(Math.PI-s-l,.01,Math.PI-.01)),h=bt(this),u=Math.atan(h/this._helper.cameraToCenterDistance),d=e.am(.75
vendor: 5,937 bytes, line 1
1),p=u>d?2*u*(.5+r.y/(2*h)):d,f=Math.sin(p)*a/Math.sin(e.ak(Math.PI-s-p,.01,Math.PI-.01)),m=Math.min(c,f);this._helper._farZ=1.01*(Math.cos(Math.PI/2-i)*m+a),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;const t=this.centerOffset,i=vt(this.worldSize,this.center),r=i.x,n=i.y;this._helper._pixelPerMeter=e.ap(1,this.center.lat)*this.worldSize;const o=e.am(Math.min(this.pitch,yt)),a=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(o));let s;this._calculateNearFarZIfNeeded(a,o,t),s=new Float64Array(16),e.bb(s,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),e.ay(this._invProjMatrix,s),s[8]=2*-t.x/this._helper._width,s[9]=2*t.y/this._helper._height,this._projectionMatrix=e.bc(s),e.Q(s,s,[1,-1,1]),e.O(s,s,[0,0,-this._helper.cameraToCenterDistance]),e.bd(s,s,-this.rollInRadians),e.be(s,s,this.pitchInRadians),e.bd(s,s,-this.bearingInRadians),e.O(s,s,[-r,-n,0]),this._mercatorMatrix=e.Q([],s,[this.worldSize,this.worldSize,this.worldSize]),e.Q(s,s,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=e.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,s),e.O(s,s,[0,0,-this.elevation]),this._viewProjMatrix=s,this._invViewProjMatrix=e.ay([],s);const l=[0,0,-1,1];e.aE(l,l,this._invViewProjMatrix),this._cameraPosition=[l[0]/l[3],l[1]/l[3],l[2]/l[3]],this._fogMatrix=new Float64Array(16),e.bb(this._fogMatrix,this.fovInRadians,this.width/this.height,a,this._helper._farZ),this._fogMatrix[8]=2*-t.x/this.width,this._fogMatrix[9]=2*t.y/this.height,e.Q(this._fogMatrix,this._fogMatrix,[1,-1,1]),e.O(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),e.bd(this._fogMatrix,this._fogMatrix,-this.rollInRadians),e.be(this._fogMatrix,this._fogMatrix,this.pitchInRadians),e.bd(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),e.O(this._fogMatrix,this._fogMatrix,[-r,-n,0]),e.Q(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),e.O(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=e.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,s);const c=this._helper._width%2/2,h=this._helper._height%2/2,u=Math.cos(this.bearingInRadians),d=Math.sin(-this.bearingInRadians),p=r-Math.round(r)+u*c+d*h,f=n-Math.round(n)+u*h+d*c,m=new Float64Array(s);if(e.O(m,m,[p>.5?p-1:p,f>.5?f-1:f,0]),this._alignedProjMatrix=m,s=e.ay(new Float64Array(16),this._pixelMatrix),!s)throw new Error("failed to invert matrix");this._pixelMatrixInverse=s,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;const t=this.screenPointToMercatorCoordinate(new e.P(0,0)),i=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.aE(i,i,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){const t=e.ap(1,this.center.lat)*this.worldSize;return Tt(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,i){const r=e.a6.fromLngLat(t),n=[r.x*this.worldSize,r.y*this.worldSize,i,1];return e.aE(n,n,this._viewProjMatrix),n[2]/n[3]}getProjectionData(t){const{overscaledTileID:i,aligned:r,applyTerrainMatrix:n}=t,o=this._helper.getMercatorTileCoordinates(i),a=i?this.calculatePosMatrix(i,r,!0):null;let s;return s=i&&i.terrainRttPosMatrix32f&&n?i.terrainRttPosMatrix32f:a||e.bf(),{mainMatrix:s,tileMercatorCoords:o,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:s}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,e,i){return 1}transformLightDirection(t){return e.a_(t)}getRayDirectionFromPixel(t){throw new Error("Not implemented.")}projectTileCoordinates(t,i,r,n){const o=this.calculatePosMatrix(r);let a;n?(a=[t,i,n(t,i),1],e.aE(a,a,o)):(a=[t,i,0,1],ce(a,a,o));const s=a[3];return{point:new e.P(a[0]/s,a[1]/s),signedDistanceFromCamera:s,isOccluded:!1}}populateCache(t){for(const e of t)this.calculatePosMatrix(e)}getMatrixForModel(t,i){const r=e.a6.fromLngLat(t,i),n=r.meterInMercatorCoordinateUnits(),o=e.bg();return e.O(o,o,[r.x,r.y,r.z]),e.bd(o,o,Math.PI),e.be(o,o,Math.PI/2),e.Q(o,o,[-n,n,n]),o}getProjectionDataForCustomLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const i=new e.a2(0,0,0,0,0),r=this.getProjectionData({overscaledTileID:i,applyGlobeMatrix:t}),n=wt(i,this.worldSize);e.S(n,this._viewProjMatrix,n),r.tileMercatorCoords=[0,0,1,1];const o=[e.a5,e.a5,this.worldSize/this._helper.pixelsPerMeter],a=e.bh();return e.Q(a,n,o),r.fallbackMatrix=a,r.mainMatrix=a,r}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function Qe(){e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function $e(t){if(t.useSlerp)if(t.k<1){const i=e.bi(t.startEulerAngles.roll,t.startEulerAngles.pitch,t.startEulerAngles.bearing),r=e.bi(t.endEulerAngles.roll,t.endEulerAngles.pitch,t.endEulerAngles.bearing),n=new Float64Array(4);e.bj(n,i,r,t.k);const o=e.bk(n);t.tr.setRoll(o.roll),t.tr.setPitch(o.pitch),t.tr.setBearing(o.bearing)}else t.tr.setRoll(t.endEulerAngles.roll),t.tr.setPitch(t.endEulerAngles.pitch),t.tr.setBearing(t.endEulerAngles.bearing);else t.tr.setRoll(e.G.number(t.startEulerAngles.roll,t.endEulerAngles.roll,t.k)),t.tr.setPitch(e.G.number(t.startEulerAngles.pitch,t.endEulerAngles.pitch,t.k)),t.tr.setBearing(e.G.number(t.startEulerAngles.bearing,t.endEulerAngles.bearing,t.k))}function ti(t,i,r,n,o){const a=o.padding,s=vt(o.worldSize,r.getNorthWest()),l=vt(o.worldSize,r.getNorthEast()),c=vt(o.worldSize,r.getSouthEast()),h=vt(o.worldSize,r.getSouthWest
vendor: 6,250 bytes, line 1
1()),u=e.am(-n),d=s.rotate(u),p=l.rotate(u),f=c.rotate(u),m=h.rotate(u),g=new e.P(Math.max(d.x,p.x,m.x,f.x),Math.max(d.y,p.y,m.y,f.y)),_=new e.P(Math.min(d.x,p.x,m.x,f.x),Math.min(d.y,p.y,m.y,f.y)),y=g.sub(_),v=(o.width-(a.left+a.right+i.left+i.right))/y.x,x=(o.height-(a.top+a.bottom+i.top+i.bottom))/y.y;if(x<0||v<0)return void Qe();const b=Math.min(e.aq(o.scale*Math.min(v,x)),t.maxZoom),w=e.P.convert(t.offset),T=new e.P((i.left-i.right)/2,(i.top-i.bottom)/2).rotate(e.am(n)),S=w.add(T).mult(o.scale/e.an(b));return{center:xt(o.worldSize,s.add(c).div(2).sub(S)),zoom:b,bearing:n}}class ei{get useGlobeControls(){return!1}handlePanInertia(t,e){const i=t.mag(),r=Math.abs(bt(e));return{easingOffset:t.mult(Math.min(.75*r/i,1)),easingCenter:e.center}}handleMapControlsRollPitchBearingZoom(t,e){t.bearingDelta&&e.setBearing(e.bearing+t.bearingDelta),t.pitchDelta&&e.setPitch(e.pitch+t.pitchDelta),t.rollDelta&&e.setRoll(e.roll+t.rollDelta),t.zoomDelta&&e.setZoom(e.zoom+t.zoomDelta)}handleMapControlsPan(t,e,i){t.around.distSqr(e.centerPoint)<.01||e.setLocationAtPoint(i,t.around)}cameraForBoxAndBearing(t,e,i,r,n){return ti(t,e,i,r,n)}handleJumpToCenterZoom(t,i){t.zoom!==(void 0!==i.zoom?+i.zoom:t.zoom)&&t.setZoom(+i.zoom),void 0!==i.center&&t.setCenter(e.V.convert(i.center))}handleEaseTo(t,i){const r=t.zoom,n=t.padding,o={roll:t.roll,pitch:t.pitch,bearing:t.bearing},a={roll:void 0===i.roll?t.roll:i.roll,pitch:void 0===i.pitch?t.pitch:i.pitch,bearing:void 0===i.bearing?t.bearing:i.bearing},s=void 0!==i.zoom,l=!t.isPaddingEqual(i.padding);let c=!1;const h=s?+i.zoom:t.zoom;let u=t.centerPoint.add(i.offsetAsPoint);const d=t.screenPointToLocation(u),{center:p,zoom:f}=t.applyConstrain(e.V.convert(i.center||d),null!=h?h:r);qe(t,p);const m=vt(t.worldSize,d),g=vt(t.worldSize,p).sub(m),_=e.an(f-r);return c=f!==r,{easeFunc:s=>{if(c&&t.setZoom(e.G.number(r,f,s)),e.bl(o,a)||$e({startEulerAngles:o,endEulerAngles:a,tr:t,k:s,useSlerp:o.roll!=a.roll}),l&&(t.interpolatePadding(n,i.padding,s),u=t.centerPoint.add(i.offsetAsPoint)),i.around)t.setLocationAtPoint(i.around,i.aroundPoint);else{const i=e.an(t.zoom-r),n=f>r?Math.min(2,_):Math.max(.5,_),o=Math.pow(n,1-s),a=xt(t.worldSize,m.add(g.mult(s*o)).mult(i));t.setLocationAtPoint(t.renderWorldCopies?a.wrap():a,u)}},isZooming:c,elevationCenter:p}}handleFlyTo(t,i){const r=void 0!==i.zoom,n=t.zoom,o=t.applyConstrain(e.V.convert(i.center||i.locationAtOffset),r?+i.zoom:n),a=o.center,s=o.zoom;qe(t,a);const l=vt(t.worldSize,i.locationAtOffset),c=vt(t.worldSize,a).sub(l),h=c.mag(),u=e.an(s-n);let d;if(void 0!==i.minZoom){const r=Math.min(+i.minZoom,n,s),o=t.applyConstrain(a,r).zoom;d=e.an(o-n)}return{easeFunc:(i,r,o,h)=>{t.setZoom(1===i?s:n+e.aq(r));const u=1===i?a:xt(t.worldSize,l.add(c.mult(o)).mult(r));t.setLocationAtPoint(t.renderWorldCopies?u.wrap():u,h)},scaleOfZoom:u,targetCenter:a,scaleOfMinZoom:d,pixelPathLength:h}}}class ii{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}}ii.Replace=[1,0],ii.disabled=new ii(ii.Replace,e.bm.transparent,[!1,!1,!1,!1]),ii.unblended=new ii(ii.Replace,e.bm.transparent,[!0,!0,!0,!0]),ii.alphaBlended=new ii([1,771],e.bm.transparent,[!0,!0,!0,!0]);const ri=2305;class ni{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}}ni.disabled=new ni(!1,1029,ri),ni.backCCW=new ni(!0,1029,ri),ni.frontCCW=new ni(!0,1028,ri);class oi{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}}oi.ReadOnly=!1,oi.ReadWrite=!0,oi.disabled=new oi(519,oi.ReadOnly,[0,1]);const ai=7680;class si{constructor(t,e,i,r,n,o){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=n,this.pass=o}}si.disabled=new si({func:519,mask:0},0,0,ai,ai,ai);const li=new WeakMap;function ci(t){var e;if(li.has(t))return li.get(t);{const i=null===(e=t.getParameter(t.VERSION))||void 0===e?void 0:e.startsWith("WebGL 2.0");return li.set(t,i),i}}class hi{get awaitingQuery(){return!!this._readbackQueue}constructor(t){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=t;const i=t.context,r=i.gl;this._texFormat=r.RGBA,this._texType=r.UNSIGNED_BYTE;const n=new e.aT;n.emplaceBack(-1,-1),n.emplaceBack(2,-1),n.emplaceBack(-1,2);const o=new e.aV;o.emplaceBack(0,1,2),this._fullscreenTriangle=new Ve(i.createVertexBuffer(n,je.members),i.createIndexBuffer(o),e.aU.simpleSegment(0,0,n.length,o.length)),this._resultBuffer=new Uint8Array(4),i.activeTexture.set(r.TEXTURE1);const a=r.createTexture();r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texImage2D(r.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=i.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(a),ci(r)&&(this._pbo=r.createBuffer(),r.bindBuffer(r.PIXEL_PACK_BUFFER,this._pbo),r.bufferData(r.PIXEL_PACK_BUFFER,4,r.STREAM_READ),r.bindBuffer(r.PIXEL_PACK_BUFFER,null))}destroy(){const t=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),t.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(t,e){const i=this._updateCount;return this._readbackQueue?i>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():i>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(t,e),this._updateCount++,this._measuredError}_bindFramebuffer(){const t=this._cachedRenderContext.context,e=t.gl;t.activeTexture.set(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,this._fbo.colorAttachment.get()),t.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(t,i){const r=this._cachedRenderContext.context,n=r.gl;if(this._bindFramebuffer(),r.viewport.set([0,0,this._texWidth,this._texHeight]),r.clear({color:e.bm.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(r,n.TRIANGLES,oi.disabled,si.disabled,ii.unblended,ni.disabled,((t,e)=>
vendor: 10,045 bytes, line 1
1({u_input:t,u_output_expected:e}))(t,i),null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&ci(n)){n.bindBuffer(n.PIXEL_PACK_BUFFER,this._pbo),n.readBuffer(n.COLOR_ATTACHMENT0),n.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),n.bindBuffer(n.PIXEL_PACK_BUFFER,null);const t=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);n.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:t}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){const t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&ci(t)){const i=t.clientWaitSync(this._readbackQueue.sync,0,0);if(i===t.WAIT_FAILED)return e.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(i===t.TIMEOUT_EXPIRED)return;t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pbo),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),t.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=hi._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(t){let e=0;return e+=t[0]/256,e+=t[1]/65536,e+=t[2]/16777216,t[3]<127&&(e=-e),e/128}}const ui=e.a5/128;function di(t,i){const r=void 0!==t.granularity?Math.max(t.granularity,1):1,n=r+(t.generateBorders?2:0),o=r+(t.extendToNorthPole||t.generateBorders?1:0)+(t.extendToSouthPole||t.generateBorders?1:0),a=n+1,s=o+1,l=t.generateBorders?-1:0,c=t.generateBorders||t.extendToNorthPole?-1:0,h=r+(t.generateBorders?1:0),u=r+(t.generateBorders||t.extendToSouthPole?1:0),d=a*s,p=n*o*6,f=a*s>65536;if(f&&"16bit"===i)throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");const m=f||"32bit"===i,g=new Int16Array(2*d);let _=0;for(let x=c;x<=u;x++)for(let i=l;i<=h;i++){let n=i/r*e.a5;-1===i&&(n=-ui),i===r+1&&(n=e.a5+ui);let o=x/r*e.a5;-1===x&&(o=t.extendToNorthPole?e.bo:-ui),x===r+1&&(o=t.extendToSouthPole?e.bp:e.a5+ui),g[_++]=n,g[_++]=o}const y=m?new Uint32Array(p):new Uint16Array(p);let v=0;for(let e=0;e<o;e++)for(let t=0;t<n;t++){const i=t+1+e*a,r=t+(e+1)*a,n=t+1+(e+1)*a;y[v++]=t+e*a,y[v++]=r,y[v++]=i,y[v++]=i,y[v++]=r,y[v++]=n}return{vertices:g.buffer.slice(0),indices:y.buffer.slice(0),uses32bitIndices:m}}const pi=new e.aS({fill:new e.bq(128,2),line:new e.bq(512,0),tile:new e.bq(128,32),stencil:new e.bq(128,1),circle:3});class fi{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return Be.projectionGlobe}get vertexShaderPreludeCode(){return Be.projectionMercator.vertexSource}get subdivisionGranularity(){return pi}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new hi(t));const i=e.X(this._errorQueryLatitudeDegrees),r=2*Math.atan(Math.exp(Math.PI-i*Math.PI*2))-.5*Math.PI,n=this._errorMeasurement.updateErrorLoop(i,r),o=c();n!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=n,this._errorMeasurementLastChangeTime=o);const a=Math.min(Math.max((o-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=e.br(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,e.bs(a))}_getMeshKey(t){return"".concat(t.granularity.toString(36),"_").concat(t.generateBorders?"b":"").concat(t.extendToNorthPole?"n":"").concat(t.extendToSouthPole?"s":"")}getMeshFromTileID(t,e,i,r,n){const o=("stencil"===n?pi.stencil:pi.tile).getGranularityForZoomLevel(e.z);return this._getMesh(t,{granularity:o,generateBorders:i,extendToNorthPole:0===e.y&&r,extendToSouthPole:e.y===(1<<e.z)-1&&r})}_getMesh(t,i){const r=this._getMeshKey(i);if(r in this._tileMeshCache)return this._tileMeshCache[r];const n=function(t,i){const r=di(i,"16bit"),n=e.aT.deserialize({arrayBuffer:r.vertices,length:r.vertices.byteLength/2/2}),o=e.aV.deserialize({arrayBuffer:r.indices,length:r.indices.byteLength/2/3});return new Ve(t.createVertexBuffer(n,je.members),t.createIndexBuffer(o),e.aU.simpleSegment(0,0,n.length,o.length))}(t,i);return this._tileMeshCache[r]=n,n}recalculate(t){}hasTransition(){const t=c();let e=!1;return e=e||(t-this._errorMeasurementLastChangeTime)/1e3<.7,e=e||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,e}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}const mi=new e.t({type:new e.D(e.u.projection.type)});class gi extends e.E{constructor(t){super(),this._transitionable=new e.x(mi,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.H(0)),this._mercatorProjection=new Ge,this._verticalPerspectiveProjection=new fi}get transitionState(){const t=this.properties.get("type");if("string"==typeof t&&"mercator"===t)return 0;if("string"==typeof t&&"vertical-perspective"===t)return 1;if(t instanceof e.bt){if("vertical-perspective"===t.from&&"mercator"===t.to)return 1-t.transition;if("mercator"===t.from&&"vertical-perspective"===t.to)return t.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(t){this._mercatorProjection.updateGPUdependent(t),this._verticalPerspectiveProjection.updateGPUdependent(t)}getMeshFromTileID(t,e,i,r,n){return this.currentProjection.getMeshFromTileID(t,e,i,r,n)}setProjection(t){this._transitionable.setValue("type",(null==t?void 0:t.type)||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}setErrorQueryLatitudeDegrees(t){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(t),this._mercatorProjection.setErrorQueryLatitudeDegrees(t)}}function _i(t){const e=xi(t.worldSize,t.center.lat);return 2*Math.PI*e}function yi(t,i,r,n,o){const a=1/(1<<o),s=i/e.a5*a+n*a,l=e.bw((t/e.a5*a+r*a)*Math.PI*2+Math.PI,2*Math.PI),c=2*Math.atan(Math.exp(Math.PI-s*Math.PI*2))-.5*Math.PI,h=Math.cos(c),u=new Float64Array(3);return u[0]=Math.sin(l)*h,u[1]=Math.sin(c),u[2]=Math.cos(l)*h,u}function vi(t){return function(t,e){const i=Math.cos(e),r=new Float64Array(3);return r[0]=Math.sin(t)*i,r[1]=Math.sin(e),r[2]=Math.cos(t)*i,r}(t.lng*Math.PI/180,t.lat*Math.PI/180)}function xi(t,e){return t/(2*Math.PI)/Math.cos(e*Math.PI/180)}function bi(t){const i=Math.asin(t[1])/Math.PI*180,r=Math.sqrt(t[0]*t[0]+t[2]*t[2]);if(r>1e-6){const n=t[0]/r,o=Math.acos(t[2]/r),a=(n>0?o:-o)/Math.PI*180;return new e.V(e.W(a,-180,180),i)}return new e.V(0,i)}function wi(t){return Math.cos(t*Math.PI/180)}function Ti(t,i){const r=wi(t),n=wi(i);return e.aq(n/r)}function Si(t,i){const r=t.rotate(i.bearingInRadians),n=i.zoom+Ti(i.center.lat,0),o=e.br(1/wi(i.center.lat),1/wi(Math.min(Math.abs(i.center.lat),60)),e.bu(n,7,3,0,1)),a=360/_i({worldSize:i.worldSize,center:{lat:i.center.lat}});return new e.V(i.center.lng-r.x*a*o,e.ak(i.center.lat+r.y*a,-e.al,e.al))}function Pi(t){const e=.5*t,i=Math.sin(e),r=Math.cos(e);return Math.log(i+r)-Math.log(r-i)}function Ii(t,i,r,n){const o=t.lat+r*n;if(Math.abs(r)>1){const a=(Math.sign(t.lat+r)!==Math.sign(t.lat)?-Math.abs(t.lat):Math.abs(t.lat))*Math.PI/180,s=Math.abs(t.lat+r)*Math.PI/180,l=Pi(a+n*(s-a)),c=Pi(a),h=Pi(s);return new e.V(t.lng+i*((l-c)/(h-c)),o)}return new e.V(t.lng+i*n,o)}class Mi{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;const t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,e,i,r){const n="".concat(t.z,"_").concat(t.x,"_").concat(t.y,"_").concat((null==r?void 0:r.terrain)?"t":""),o=this._cache.get(n);if(o)return o;const a=this._cachePrevious.get(n);if(a)return this._cache.set(n,a),a;const s=this._boundingVolumeFactory(t,e,i,r);return this._cache.set(n,s),this._hadAnyChanges=!0,s}}class Ei{constructor(t,e,i,r){this.min=i,this.max=r,this.points=t,this.planes=e}static fromAabb(t,e){const i=[];for(let r=0;r<8;r++)i.push([1&~r?t[0]:e[0],1==(r>>1&1)?e[1]:t[1],1==(r>>2&1)?e[2]:t[2]]);return new Ei(i,[[-1,0,0,e[0]],[1,0,0,-t[0]],[0,-1,0,e[1]],[0,1,0,-t[1]],[0,0,-1,e[2]],[0,0,1,-t[2]]],t,e)}static fromCenterSizeAngles(t,i,r){const n=e.by([],r[0],r[1],r[2]),o=e.bz([],[i[0],0,0],n),a=e.bz([],[0,i[1],0],n),s=e.bz([],[0,0,i[2]],n),l=[...t],c=[...t];for(let e=0;e<8;e++)for(let i=0;i<3;i++){const r=t[i]+o[i]*(1&~e?-1:1)+a[i]*(1==(e>>1&1)?1:-1)+s[i]*(1==(e>>
12&1)?1:-1);l[i]=Math.min(l[i],r),c[i]=Math.max(c[i],r)}const h=[];for(let u=0;u<8;u++){const i=[...t];e.aZ(i,i,e.aY([],o,1&~u?-1:1)),e.aZ(i,i,e.aY([],a,1==(u>>1&1)?1:-1)),e.aZ(i,i,e.aY([],s,1==(u>>2&1)?1:-1)),h.push(i)}return new Ei(h,[[...o,-e.b2(o,h[0])],[...a,-e.b2(a,h[0])],[...s,-e.b2(s,h[0])],[-o[0],-o[1],-o[2],-e.b2(o,h[7])],[-a[0],-a[1],-a[2],-e.b2(a,h[7])],[-s[0],-s[1],-s[2],-e.b2(s,h[7])]],l,c)}intersectsFrustum(t){let e=!0;const i=this.points.length,r=this.planes.length,n=t.planes.length,o=t.points.length;for(let a=0;a<n;a++){const r=t.planes[a];let n=0;for(let t=0;t<i;t++){const e=this.points[t];r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]>=0&&n++}if(0===n)return 0;n<i&&(e=!1)}if(e)return 2;for(let a=0;a<r;a++){const e=this.planes[a];let i=0;for(let r=0;r<o;r++){const n=t.points[r];e[0]*n[0]+e[1]*n[1]+e[2]*n[2]+e[3]>=0&&i++}if(0===i)return 0}return 1}intersectsPlane(t){const e=this.points.length;let i=0;for(let r=0;r<e;r++){const e=this.points[r];t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]>=0&&i++}return i===e?2:0===i?0:1}}function Ci(t,e,i){const r=t-e;return r<0?-r:Math.max(0,r-i)}function Ai(t,e,i,r,n){const o=t-i;let a;return a=o<0?Math.min(-o,1+o-n):o>n?Math.min(Math.max(o-n,0),1-o):0,Math.max(a,Ci(e,r,n))}class Di{constructor(){this._boundingVolumeCache=new Mi(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,e,i,r){const n=1<<i.z,o=1/n,a=i.x/n,s=i.y/n;let l=2;return l=Math.min(l,Ai(t,e,a,s,o)),l=Math.min(l,Ai(t,e,a+.5,-s-o,o)),l=Math.min(l,Ai(t,e,a+.5,2-s-o,o)),l}getWrap(t,e,i){const r=1<<e.z,n=1/r,o=e.x/r,a=Ci(t.x,o,n),s=Ci(t.x,o-1,n),l=Ci(t.x,o+1,n),c=Math.min(a,s,l);return c===l?1:c===s?-1:0}allowVariableZoom(t,e){return Ct(t,e)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,e,i,r){return this._boundingVolumeCache.getTileBoundingVolume(t,e,i,r)}_computeTileBoundingVolume(t,i,r,n){var o,a;let s=0,l=0;if(null==n?void 0:n.terrain){const c=new e.a2(t.z,i,t.z,t.x,t.y),h=n.terrain.getMinMaxElevation(c);s=null!==(o=h.minElevation)&&void 0!==o?o:Math.min(0,r),l=null!==(a=h.maxElevation)&&void 0!==a?a:Math.max(0,r)}if(s/=e.bB,l/=e.bB,s+=1,l+=1,t.z<=0)return Ei.fromAabb([-l,-l,-l],[l,l,l]);if(1===t.z)return Ei.fromAabb([0===t.x?-l:0,0===t.y?0:-l,-l],[0===t.x?0:l,0===t.y?l:0,l]);{const i=[yi(0,0,t.x,t.y,t.z),yi(e.a5,0,t.x,t.y,t.z),yi(e.a5,e.a5,t.x,t.y,t.z),yi(0,e.a5,t.x,t.y,t.z)],r=[];for(const t of i)r.push(e.aY([],t,l));if(l!==s)for(const t of i)r.push(e.aY([],t,s));0===t.y&&r.push([0,1,0]),t.y===(1<<t.z)-1&&r.push([0,-1,0]);const n=[1,1,1],o=[-1,-1,-1];for(const t of r)for(let e=0;e<3;e++)n[e]=Math.min(n[e],t[e]),o[e]=Math.max(o[e],t[e]);const a=yi(e.a5/2,e.a5/2,t.x,t.y,t.z),c=e.b1([],[0,1,0],a);e.b0(c,c);const h=e.b1([],a,c);e.b0(h,h);const u=e.b1([],i[2],i[1]);e.b0(u,u);const d=e.b1([],i[0],i[3]);e.b0(d,d),r.push(e.aY([],a,l)),t.y>=(1<<t.z)/2&&r.push(e.aY([],yi(e.a5/2,0,t.x,t.y,t.z),l)),t.y<(1<<t.z)/2&&r.push(e.aY([],yi(e.a5/2,e.a5,t.x,t.y,t.z),l));const p=zi(a,r),f=zi(h,r),m=[-a[0],-a[1],-a[2],p.max],g=[a[0],a[1],a[2],-p.min],_=[-h[0],-h[1],-h[2],f.max],y=[h[0],h[1],h[2],-f.min],v=[...u,0],x=[...d,0],b=[];return 0===t.y?b.push(e.bA(x,v,m),e.bA(x,v,g)):b.push(e.bA(_,v,m),e.bA(_,v,g),e.bA(_,x,m),e.bA(_,x,g)),t.y===(1<<t.z)-1?b.push(e.bA(x,v,m),e.bA(x,v,g)):b.push(e.bA(y,v,m),e.bA(y,v,g),e.bA(y,x,m),e.bA(y,x,g)),new Ei(b,[m,g,_,y,v,x],n,o)}}}function zi(t,i){let r=1/0,n=-1/0;for(const o of i){const i=e.b2(t,o);r=Math.min(r,i),n=Math.max(n,i)}return{min:r,max:n}}class ki{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}
vendor: 5,107 bytes, line 1
1interpolatePadding(t,e,i){return this._helper.interpolatePadding(t,e,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,e){this._helper.resize(t,e)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,e){this._helper.overrideNearFarZ(t,e)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(t){this._cachedClippingPlane=e.bC(),this._projectionMatrix=e.bg(),this._globeViewProjMatrix32f=e.bf(),this._globeViewProjMatrixNoCorrection=e.bg(),this._globeViewProjMatrixNoCorrectionInverted=e.bg(),this._globeProjMatrixInverted=e.bg(),this._cameraPosition=e.bx(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(t,i)=>{const r=e.ak(t.lat,-e.al,e.al),n=e.ak(+i,this.minZoom+Ti(0,r),this.maxZoom);return{center:new e.V(t.lng,r),zoom:n}},this.applyConstrain=(t,e)=>this._helper.applyConstrain(t,e),this._helper=new Xe({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,e)=>this.defaultConstrain(t,e)},t),this._coveringTilesDetailsProvider=new Di}clone(){const t=new ki;return t.apply(this,!1),t}apply(t,e,i){this._globeLatitudeErrorCorrectionRadians=i||0,this._helper.apply(t,e)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){const t=e.bx();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){const{overscaledTileID:e,applyGlobeMatrix:i}=t,r=this._helper.getMercatorTileCoordinates(e);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:r,clippingPlane:this._cachedClippingPlane,projectionTransition:i?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){const i=this.pitchInRadians,r=this.cameraToCenterDistance/t,n=Math.sin(i)*r,o=Math.cos(i)*r+1,a=1/Math.sqrt(n*n+o*o)*1;let s=-n,l=o;const c=Math.sqrt(s*s+l*l);s/=c,l/=c;const h=[0,s,l];e.bD(h,h,[0,0,0],-this.bearingInRadians),e.bE(h,h,[0,0,0],-1*this.center.lat*Math.PI/180),e.bF(h,h,[0,0,0],this.center.lng*Math.PI/180);const u=1/e.b4(h);return e.aY(h,h,u),[...h,-a*u]}isLocationOccluded(t){return!this.isSurfacePointVisible(vi(t))}transformLightDirection(t){const i=this._helper._center.lng*Math.PI/180,r=this._helper._center.lat*Math.PI/180,n=Math.cos(r),o=[Math.sin(i)*n,Math.sin(r),Math.cos(i)*n],a=[o[2],0,-o[0]],s=[0,0,0];e.b1(s,a,o),e.b0(a,a),e.b0(s,s);const l=[0,0,0];return e.b0(l,[a[0]*t[0]+s[0]*t[1]+o[0]*t[2],a[1]*t[0]+s[1]*t[1]+o[1]*t[2],a[2]*t[0]+s[2]*t[1]+o[2]*t[2]]),l}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,i,r){const n=function(t,i,r){const n=1/(1<<r.z);return new e.a6(t/e.a5*n+r.x*n,i/e.a5*n+r.y*n)}(t,i,r.canonical),o=(a=n.y,[e.bw(n.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-a*Math.PI*2))-.5*Math.PI]);var a;return this.getCircleRadiusCorrection()/Math.cos(o[1])}projectTileCoordinates(t,i,r,n){const o=r.canonical,a=yi(t,i,o.x,o.y,o.z),s=1+(n?n(t,i):0)/e.bB,l=[a[0]*s,a[1]*s,a[2]*s,1];e.aE(l,l,this._globeViewProjMatrixNoCorrection);const c=this._cachedClippingPlane,h=c[0]*a[0]+c[1]*a[1]+c[2]*a[2]+c[3]<0;return{point:new e.P(l[0]/l[3],l[1]/l[3]),signedDistanceFromCamera:l[3],isOccluded:
vendor: 4,950 bytes, line 1
1h}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;const t=xi(this.worldSize,this.center.lat),i=e.bh(),r=e.bh();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),e.bb(i,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);const n=this.centerOffset;i[8]=2*-n.x/this._helper._width,i[9]=2*n.y/this._helper._height,this._projectionMatrix=e.bc(i),this._globeProjMatrixInverted=e.bh(),e.ay(this._globeProjMatrixInverted,i),e.O(i,i,[0,0,-this.cameraToCenterDistance]),e.bd(i,i,this.rollInRadians),e.be(i,i,-this.pitchInRadians),e.bd(i,i,this.bearingInRadians),e.O(i,i,[0,0,-t]);const o=e.bx();o[0]=t,o[1]=t,o[2]=t,e.be(r,i,this.center.lat*Math.PI/180),e.bG(r,r,-this.center.lng*Math.PI/180),e.Q(r,r,o),this._globeViewProjMatrixNoCorrection=r,e.be(i,i,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),e.bG(i,i,-this.center.lng*Math.PI/180),e.Q(i,i,o),this._globeViewProjMatrix32f=new Float32Array(i),this._globeViewProjMatrixNoCorrectionInverted=e.bh(),e.ay(this._globeViewProjMatrixNoCorrectionInverted,r);const a=e.bx();this._cameraPosition=e.bx(),this._cameraPosition[2]=this.cameraToCenterDistance/t,e.bD(this._cameraPosition,this._cameraPosition,a,-this.rollInRadians),e.bE(this._cameraPosition,this._cameraPosition,a,this.pitchInRadians),e.bD(this._cameraPosition,this._cameraPosition,a,-this.bearingInRadians),e.aZ(this._cameraPosition,this._cameraPosition,[0,0,1]),e.bE(this._cameraPosition,this._cameraPosition,a,-this.center.lat*Math.PI/180),e.bF(this._cameraPosition,this._cameraPosition,a,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);const s=e.bc(this._globeViewProjMatrixNoCorrectionInverted);e.Q(s,s,[1,1,-1]),this._cachedFrustum=Ke.fromInvProjectionMatrix(s,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){e.w("calculateFogMatrix is not supported on globe projection.");const i=e.bh();return e.ao(i),i}getVisibleUnwrappedCoordinates(t){return[new e.b9(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&e.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,i){if(!this._globeViewProjMatrixNoCorrection)return 1;const r=vi(t);e.aY(r,r,1+i/e.bB);const n=e.bC();return e.aE(n,[r[0],r[1],r[2],1],this._globeViewProjMatrixNoCorrection),n[2]/n[3]}populateCache(t){}getBounds(){const t=.5*this.width,i=.5*this.height,r=[new e.P(0,0),new e.P(t,0),new e.P(this.width,0),new e.P(this.width,i),new e.P(this.width,this.height),new e.P(t,this.height),new e.P(0,this.height),new e.P(0,i)],n=[];for(const e of r)n.push(this.unprojectScreenPoint(e));let o=0,a=0,s=0,l=0;const c=this.center;for(const u of n){const t=e.bH(c.lng,u.lng),i=e.bH(c.lat,u.lat);t<a&&(a=t),t>o&&(o=t),i<l&&(l=i),i>s&&(s=i)}const h=[c.lng+a,c.lat+l,c.lng+o,c.lat+s];return this.isSurfacePointOnScreen([0,1,0])&&(h[3]=90,h[0]=-180,h[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(h[1]=-90,h[0]=-180,h[2]=180),new X(h)}calculateCenterFromCameraLngLatAlt(t,e,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,e,i,r)}setLocationAtPoint(t,i){const r=vi(this.unprojectScreenPoint(i)),n=vi(t),o=e.bx();e.bI(o);const a=e.bx();e.bF(a,r,o,-this.center.lng*Math.PI/180),e.bE(a,a,o,this.center.lat*Math.PI/180);const s=n[0]*n[0]+n[2]*n[2],l=a[0]*a[0];if(s<l)return;const c=Math.sqrt(s-l),h=-c,u=e.bJ(n[0],n[2],a[0],c),d=e.bJ(n[0],n[2],a[0],h),p=e.bx();e.bF(p,n,o,-u);const f=e.bJ(p[1],p[2],a[1],a[2]),m=e.bx();e.bF(m,n,o,-d);const g=e.bJ(m[1],m[2],a[1],a[2]),_=.5*Math.PI,y=f>=-_&&f<=_,v=g>=-_&&g<=_;let x,b;if(y&&v){const t=this.center.lng*Math.PI/180,i=this.center.lat*Math.PI/180;e.bK(u,t)+e.bK(f,i)<e.bK(d,t)+e.bK(g,i)?(x=u,b=f):(x=d,b=g)}else if(y)x=u,b=f;else{if(!v)return;x=d,b=g}const w=x/Math.PI*180,T=b/Math.PI*180,S=this.center.lat;this.setCenter(new e.V(w,e.ak(T,-90,90))),this.setZoom(this.zoom+Ti(S,this.center.lat))}locationToScreenPoint(t,i){const r=vi(t);if(i){const n=i.getElevationForLngLatZoom(t,this._helper._tileZoom);e.aY(r,r,1+n/e.bB)}return this._projectSurfacePointToScreen(r)}_projectSurfacePointToScreen(t){const i=e.bC();return e.aE(i,[...t,1],this._globeViewProjMatrixNoCorrection),i[0]/=i[3],i[1]/=i[3],new e.P((.5*i[0]+.5)*this.width,(.5*-i[1]+.5)*this.height)}screenPointToMercatorCoordinate(t,i){if(i){const e=i.pointCoordinate(t);if(e)return e}return e.a6.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,e){var i;return null===(i=this.screenPointToMercatorCoordinate(t,e))||void 0===i?void 0:i.toLngLat()}
vendor: 10,202 bytes, line 1
1isPointOnMapSurface(t,e){const i=this._cameraPosition,r=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(i,r)}getRayDirectionFromPixel(t){const i=e.bC();i[0]=t.x/this.width*2-1,i[1]=-1*(t.y/this.height*2-1),i[2]=1,i[3]=1,e.aE(i,i,this._globeViewProjMatrixNoCorrectionInverted),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3];const r=e.bx();r[0]=i[0]-this._cameraPosition[0],r[1]=i[1]-this._cameraPosition[1],r[2]=i[2]-this._cameraPosition[2];const n=e.bx();return e.b0(n,r),n}isSurfacePointVisible(t){const e=this._cachedClippingPlane;return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;const i=e.bC();return e.aE(i,[...t,1],this._globeViewProjMatrixNoCorrection),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3],i[0]>-1&&i[0]<1&&i[1]>-1&&i[1]<1&&i[2]>-1&&i[2]<1}rayPlanetIntersection(t,i){const r=e.b2(t,i),n=e.bx(),o=e.bx();e.aY(o,i,r),e.a$(n,t,o);const a=1-e.b2(n,n);if(a<0)return null;const s=e.b2(t,t)-1,l=-r+(r<0?1:-1)*Math.sqrt(a),c=s/l,h=l;return{tMin:Math.min(c,h),tMax:Math.max(c,h)}}unprojectScreenPoint(t){const i=this._cameraPosition,r=this.getRayDirectionFromPixel(t),n=this.rayPlanetIntersection(i,r);if(n){const t=e.bx();e.aZ(t,i,[r[0]*n.tMin,r[1]*n.tMin,r[2]*n.tMin]);const o=e.bx();return e.b0(o,t),bi(o)}const o=this._cachedClippingPlane,a=o[0]*r[0]+o[1]*r[1]+o[2]*r[2],s=-e.b8(o,i)/a,l=e.bx();if(s>0)e.aZ(l,i,[r[0]*s,r[1]*s,r[2]*s]);else{const t=e.bx();e.aZ(t,i,[2*r[0],2*r[1],2*r[2]]);const n=e.b8(this._cachedClippingPlane,t);e.a$(l,t,[this._cachedClippingPlane[0]*n,this._cachedClippingPlane[1]*n,this._cachedClippingPlane[2]*n])}const c=function(t){const i=e.bx();return i[0]=t[0]*-t[3],i[1]=t[1]*-t[3],i[2]=t[2]*-t[3],{center:i,radius:Math.sqrt(1-t[3]*t[3])}}(o);return bi(function(t,i,r){const n=e.bx();e.a$(n,r,t);const o=e.bx();return e.bv(o,t,n,i/e.b6(n)),o}(c.center,c.radius,l))}getMatrixForModel(t,i){const r=e.V.convert(t),n=1/e.bB,o=e.bg();return e.bG(o,o,r.lng/180*Math.PI),e.be(o,o,-r.lat/180*Math.PI),e.O(o,o,[0,0,1+i/e.bB]),e.be(o,o,.5*Math.PI),e.Q(o,o,[n,n,n]),o}getProjectionDataForCustomLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const i=this.getProjectionData({overscaledTileID:new e.a2(0,0,0,0,0),applyGlobeMatrix:t});return i.tileMercatorCoords=[0,0,1,1],i}getFastPathSimpleProjectionMatrix(t){}}class Ri{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,e,i){return this._helper.interpolatePadding(t,e,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this._helper.resize(t,e,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,e){this._helper.overrideNearFarZ(t,e)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(t,e){this._globeness=t,this._globeLatitudeErrorCorrectionRadians=e,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(t){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this.defaultConstrain=(t,e)=>this.currentTransform.defaultConstrain(t,e),this.applyConstrain=(t,e)=>this._helper.applyConstrain(t,e),this._helper=new Xe({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,e)=>this.defaultConstrain(t,e)},t),this._globeness=1,this._mercatorTransform=new Je,this._verticalPerspectiveTransform=new ki}clone(){const t=new Ri;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this,!1),t}apply(t,e){this._helper.apply(t,e),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(t){const e=this._mercatorTransform.getProjectionData(t),i=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?i.mainMatrix:e.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:e.fallbackMatrix}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return e.br(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return e.br(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,i,r){const n=this._mercatorTransform.getPitchedTextCorrection(t,i,r),o=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,i,r);return e.br(n,o,this._globeness)}projectTileCoordinates(t,e,i,r){return this.currentTransform.projectTileCoordinates(t,e,i,r)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,!1,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this._mercatorTransform.recalculateZoomAndCenter(t),this._verticalPerspectiveTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,e){return this.currentTransform.lngLatToCameraDepth(t,e)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,e,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,e,i,r)}setLocationAtPoint(t,e){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(t,e),void this.apply(this._mercatorTransform,!1);this._verticalPerspectiveTransform.setLocationAtPoint(t,e),this.apply(this._verticalPerspectiveTransform,!1)}locationToScreenPoint(t,e){return this.currentTransform.locationToScreenPoint(t,e)}screenPointToMercatorCoordinate(t,e){return this.currentTransform.screenPointToMercatorCoordinate(t,e)}screenPointToLocation(t,e){return this.currentTransform.screenPointToLocation(t,e)}
vendor: 8,280 bytes, line 1
1isPointOnMapSurface(t,e){return this.currentTransform.isPointOnMapSurface(t,e)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getMatrixForModel(t,e){return this.currentTransform.getMatrixForModel(t,e)}getProjectionDataForCustomLayer(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return e;const i=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return i.fallbackMatrix=e.mainMatrix,i}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class Fi{get useGlobeControls(){return!0}handlePanInertia(t,i){const r=Si(t,i);return Math.abs(r.lng-i.center.lng)>180&&(r.lng=i.center.lng+179.5*Math.sign(r.lng-i.center.lng)),{easingCenter:r,easingOffset:new e.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,i){const r=t.around,n=i.screenPointToLocation(r);t.bearingDelta&&i.setBearing(i.bearing+t.bearingDelta),t.pitchDelta&&i.setPitch(i.pitch+t.pitchDelta),t.rollDelta&&i.setRoll(i.roll+t.rollDelta);const o=i.zoom;t.zoomDelta&&i.setZoom(i.zoom+t.zoomDelta);const a=i.zoom-o;if(0===a)return;const s=e.bH(i.center.lng,n.lng),l=s/(Math.abs(s/180)+1),c=e.bH(i.center.lat,n.lat),h=i.getRayDirectionFromPixel(r),u=i.cameraPosition,d=-1*e.b2(u,h),p=e.bx();e.aZ(p,u,[h[0]*d,h[1]*d,h[2]*d]);const f=e.b4(p)-1,m=Math.exp(.5*-Math.max(f-.3,0)),g=xi(i.worldSize,i.center.lat)/Math.min(i.width,i.height),_=e.bu(g,.9,.5,1,.25),y=(1-e.an(-a))*Math.min(m,_),v=i.center.lat,x=i.zoom,b=new e.V(i.center.lng+l*y,e.ak(i.center.lat+c*y,-e.al,e.al));i.setLocationAtPoint(n,r);const w=i.center,T=e.bu(Math.abs(s),45,85,0,1),S=e.bu(g,.75,.35,0,1),P=Math.pow(Math.max(T,S),.25),I=e.bH(w.lng,b.lng),M=e.bH(w.lat,b.lat);i.setCenter(new e.V(w.lng+I*P,w.lat+M*P).wrap()),i.setZoom(x+Ti(v,i.center.lat))}handleMapControlsPan(t,e,i){if(!t.panDelta)return;const r=e.center.lat,n=e.zoom;e.setCenter(Si(t.panDelta,e).wrap()),e.setZoom(n+Ti(r,e.center.lat))}cameraForBoxAndBearing(t,i,r,n,o){const a=ti(t,i,r,n,o),s=i.left/o.width*2-1,l=(o.width-i.right)/o.width*2-1,c=i.top/o.height*-2+1,h=(o.height-i.bottom)/o.height*-2+1,u=e.bH(r.getWest(),r.getEast())<0,d=u?r.getEast():r.getWest(),p=u?r.getWest():r.getEast(),f=Math.max(r.getNorth(),r.getSouth()),m=Math.min(r.getNorth(),r.getSouth()),g=d+.5*e.bH(d,p),_=f+.5*e.bH(f,m),y=o.clone();y.setCenter(a.center),y.setBearing(a.bearing),y.setPitch(0),y.setRoll(0),y.setZoom(a.zoom);const v=y.modelViewProjectionMatrix,x=[vi(r.getNorthWest()),vi(r.getNorthEast()),vi(r.getSouthWest()),vi(r.getSouthEast()),vi(new e.V(p,_)),vi(new e.V(d,_)),vi(new e.V(g,f)),vi(new e.V(g,m))],b=vi(a.center);let w=Number.POSITIVE_INFINITY;for(const e of x)s<0&&(w=Fi.getLesserNonNegativeNonNull(w,Fi.solveVectorScale(e,b,v,"x",s))),l>0&&(w=Fi.getLesserNonNegativeNonNull(w,Fi.solveVectorScale(e,b,v,"x",l))),c>0&&(w=Fi.getLesserNonNegativeNonNull(w,Fi.solveVectorScale(e,b,v,"y",c))),h<0&&(w=Fi.getLesserNonNegativeNonNull(w,Fi.solveVectorScale(e,b,v,"y",h)));if(Number.isFinite(w)&&0!==w)return a.zoom=y.zoom+e.aq(w),a;Qe()}handleJumpToCenterZoom(t,i){const r=t.center.lat,n=t.applyConstrain(i.center?e.V.convert(i.center):t.center,t.zoom).center;t.setCenter(n.wrap());const o=void 0!==i.zoom?+i.zoom:t.zoom+Ti(r,n.lat);t.zoom!==o&&t.setZoom(o)}handleEaseTo(t,i){const r=t.zoom,n=t.center,o=t.padding,a={roll:t.roll,pitch:t.pitch,bearing:t.bearing},s={roll:void 0===i.roll?t.roll:i.roll,pitch:void 0===i.pitch?t.pitch:i.pitch,bearing:void 0===i.bearing?t.bearing:i.bearing},l=void 0!==i.zoom,c=!t.isPaddingEqual(i.padding);let h=!1;const u=i.center?e.V.convert(i.center):n,d=t.applyConstrain(u,r).center;qe(t,d);const p=t.clone();p.setCenter(d),p.setZoom(l?+i.zoom:r+Ti(n.lat,u.lat)),p.setBearing(i.bearing);const f=new e.P(e.ak(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),e.ak(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));p.setLocationAtPoint(d,f);const m=(i.offset&&i.offsetAsPoint.mag())>0?p.center:d,g=l?+i.zoom:r+Ti(n.lat,m.lat),_=r+Ti(n.lat,0),y=g+Ti(m.lat,0),v=e.bH(n.lng,m.lng),x=e.bH(n.lat,m.lat),b=e.an(y-_);return h=g!==r,{easeFunc:r=>{if(e.bl(a,s)||$e({startEulerAngles:a,endEulerAngles:s,tr:t,k:r,useSlerp:a.roll!=s.roll}),c&&t.interpolatePadding(o,i.padding,r),i.around)e.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(i.around,i.aroundPoint);else{const e=y>_?Math.min(2,b):Math.max(.5,b),i=Math.pow(e,1-r),o=Ii(n,v,x,r*i);t.setCenter(o.wrap())}if(h){const i=e.G.number(_,y,r)+Ti(0,t.center.lat);t.setZoom(i)}},isZooming:h,elevationCenter:m}}handleFlyTo(t,i){const r=void 0!==i.zoom,n=t.center,o=t.zoom,a=t.padding,s=!t.isPaddingEqual(i.padding),l=t.applyConstrain(e.V.convert(i.center||i.locationAtOffset),o).center,c=r?+i.zoom:t.zoom+Ti(t.center.lat,l.lat),h=t.clone();h.setCenter(l),h.setZoom(c),h.setBearing(i.bearing);const u=new e.P(e.ak(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),e.ak(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));h.setLocationAtPoint(l,u);const d=h.center;qe(t,d);const p=function(t,i,r){const n=vi(i),o=vi(r),a=e.b2(n,o),s=Math.acos(a),l=_i(t);return s/(2*Math.PI)*l}(t,n,d),f=o+Ti(n.lat,0),m=c+Ti(d.lat,0),g=e.an(m-f);let _;if("number"==typeof i.minZoom){const r=+i.minZoom+Ti(d.lat,0),n=Math.min(r,f,m)+Ti(0,d.lat),o=t.applyConstrain(d,n).zoom+Ti(d.lat,0);_=e.an(o-f)}const y=e.bH(n.lng,d.lng),v=e.bH(n.lat,d.lat);return{easeFunc:(r,o,l,h)=>{const u=Ii(n,y,v,l);s&&t.interpolatePadding(a,i.padding,r);const p=1===r?d:u;t.setCenter(p.wrap());const m=f+e.aq(o);t.setZoom(1===r?c:m+Ti(0,p.lat))},scaleOfZoom:g,targetCenter:d,scaleOfMinZoom:_,pixelPathLength:p}}static solveVectorScale(t,e,i,r,n){const o="x"===r?[i[0],i[4],i[8],i[12]]:[i[1],i[5],i[9],i[13]],a=[i[3],i[7],i[11],i[15]],s=t[0]*o[0]+t[1]*o[1]+t[2]*o[2],l=t[0]*a[0]+t[1]*a[1]+t[2]*a[2],c=e[0]*o[0]+e[1]*o[1]+e[2]*o[2],h=e[0]*a[0]+e[1]*a[1]+e[2]*a[2];return c+n*l===s+n*h||a[3]*(s-c)+o[3]*(h-l)+s*h==c*l?null:(c+o[3]-n*h-n*a[3])/(c-s-n*h+n*l)}static getLesserNonNegativeNonNull(t,e){return null!==e&&e>=0&&e<t?e:t}}class Li{constructor(t){this._globe=t,this._mercatorCameraHelper=new ei,this._verticalPerspectiveCameraHelper=new Fi}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,e){return this.currentHelper.handlePanInertia(t,e)}handleMapControlsRollPitchBearingZoom(t,e){return this.currentHelper.handleMapControlsRollPitchBearingZoom(t,e)}handleMapControlsPan(t,e,i){this.currentHelper.handleMapControlsPan(t,e,i)}cameraForBoxAndBearing(t,e,i,r,n){return this.currentHelper.cameraForBoxAndBearing(t,e,i,r,n)}handleJumpToCenterZoom(t,e){this.currentHelper.handleJumpToCenterZoom(t,e)}handleEaseTo(t,e){return this.currentHelper.handleEaseTo(t,e)}handleFlyTo(t,e){return this.currentHelper.handleFlyTo(t,e)}}const Bi=(t,i)=>e.B(t,i&&i.filter((t=>"source.canvas"!==t.identifier))),Oi=e.bL();class Vi extends e.E{constructor(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r,n;super(),this._rtlPluginLoaded=()=>{for(const t in this.tileManagers){const e=this.tileManagers[t].getSource().type;"vector"!==e&&"geojson"!==e||this.tileManagers[t].reload()}},this.map=t,this.dispatcher=new j(V(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",((t,e)=>this.getGlyphs(t,e))),this.dispatcher.registerMessageHandler("GI",((t,e)=>this.getImages(t,e))),this.dispatcher.registerMessageHandler("GDA",((t,e)=>this.getDashes(t,e))),this.imageManager=new w,this.imageManager.setEventedParent(this);const o=(null===(r=t._container)||void 0===r?void 0:r.lang)||"undefined"!=typeof document&&(null===(n=document.documentElement)||void 0===n?void 0:n.lang)||void 0;this.glyphManager=new M(t._requestManager,i.localIdeographFontFamily,o),this.lineAtlas=new k(256,512),this.crossTileSymbolIndex=new Fe,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",e.bM()),pt().on(ht,this._rtlPluginLoaded),this.on("data",(t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.tileManagers[t.sourceId];if(!e)return;const i=e.getSource();if(i&&i.vectorLayerIds)for(const r in this._layers){const t=this._layers[r];
1t.source===i.id&&this._validateLayer(t)}}))}_setInitialValues(){var t;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new e.bN,this._availableImages=[],this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new((null===(t=this.crossTileSymbolIndex)||void 0===t?void 0:t.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(t,i){var r,n,o;this._checkLoaded();const a=null===i?null!==(o=null===(n=null===(r=this.stylesheet.state)||void 0===r?void 0:r[t])||void 0===n?void 0:n.default)&&void 0!==o?o:null:i;if(e.bO(a,this._globalState[t]))return this;this._globalState[t]=a,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();const i=[];for(const r in t)!e.bO(this._globalState[r],t[r].default)&&(i.push(r),this._globalState[r]=t[r].default);this._applyGlobalStateChanges(i)}_applyGlobalStateChanges(t){if(0===t.length)return;const e=new Set,i={};for(const r of t){i[r]=this._globalState[r];for(const t in this._layers){const i=this._layers[t],n=i.getLayoutAffectingGlobalStateRefs(),o=i.getPaintAffectingGlobalStateRefs(),a=i.getVisibilityAffectingGlobalStateRefs();if(n.has(r)&&e.add(i.source),o.has(r))for(const{name:t,value:e}of o.get(r))this._updatePaintProperty(i,t,e);(null==a?void 0:a.has(r))&&(i.recalculateVisibility(),this._updateLayer(i))}}this.dispatcher.broadcast("UGS",i);for(const r in this.tileManagers)e.has(r)&&(this._reloadSource(r),this._changed=!0)}loadURL(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;this.fire(new e.l("dataloading",{dataType:"style"})),i.validate="boolean"!=typeof i.validate||i.validate;const n=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;const o=this._loadStyleRequest;e.j(n,this._loadStyleRequest).then((t=>{this._loadStyleRequest=null,this._load(t.data,i,r)})).catch((t=>{this._loadStyleRequest=null,t&&!o.signal.aborted&&this.fire(new e.k(t))}))}loadJSON(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;this.fire(new e.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,s.frameAsync(this._frameRequest,this.map._ownerWindow).then((()=>{this._frameRequest=null,i.validate=!1!==i.validate,this._load(t,i,r)})).catch((()=>{}))}loadEmpty(){this.fire(new e.l("dataloading",{dataType:"style"})),this._load(Oi,{validate:!1})}_load(t,i,r){var n,o;let a=i.transformStyle?i.transformStyle(r,t):t;if(!i.validate||!Bi(this,e.C(a))){a=Object.assign({},a),this._loaded=!0,this.stylesheet=a;for(const t in a.sources)this.addSource(t,a.sources[t],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new A(this.stylesheet.light),this._setProjectionInternal((null===(n=this.stylesheet.projection)||void 0===n?void 0:n.type)||"mercator"),this.sky=new z(this.stylesheet.sky),this.map.setTerrain(null!==(o=this.stylesheet.terrain)&&void 0!==o?o:null),this.fire(new e.l("data",{dataType:"style"})),this.fire(new e.l("style.load"))}}_createLayers(){var t,i,r;const n=e.bP(this.stylesheet.layers);this.setGlobalState(null!==(t=this.stylesheet.state)&&void 0!==t?t:null),this.dispatcher.broadcast("SL",n),this._order=n.map((t=>t.id)),this._layers={},this._serializedLayers=null;for(const o of n){const t=e.bQ(o,this._globalState);if(t.setEventedParent(this,{layer:{id:o.id}}),this._layers[o.id]=t,e.bR(t)&&this.tileManagers[t.source]){const e=null!==(r=null===(i=o.paint)||void 0===i?void 0:i["raster-fade-duration"])&&void 0!==r?r:t.paint.get("raster-fade-duration");this.tileManagers[t.source].setRasterFadeDuration(e)}}}_loadSprite(t){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.imageManager.setLoaded(!1);const n=new AbortController;let o;this._spriteRequest=n,function(t,i,r,n){return e._(this,void 0,void 0,(function*(){const o=v(t),a=r>1?"@2x":"",l={},c={};for(const{id:t,url:r}of o){const o=i.transformRequest(x(r,a,".json"),"SpriteJSON");l[t]=e.j(o,n);const s=i.transformRequest(x(r,a,".png"),"SpriteImage");c[t]=_.getImage(s,n)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(t,i){return e._(this,void 0,void 0,(function*(){const e={};for(const r in t){e[r]={};const n=s.getImageCanvasContext((yield i[r]).data),o=(yield t[r]).data;for(const t in o){const{width:i,height:a,x:s,y:l,sdf:c,pixelRatio:h,stretchX:u,stretchY:d,content:p,textFitWidth:f,textFitHeight:m}=o[t];e[r][t]={data:null,pixelRatio:h,sdf:c,stretchX:u,stretchY:d,content:p,textFitWidth:f,textFitHeight:m,spriteData:{width:i,height:a,x:s,y:l,context:n}}}}return e}))}(l,c)}))}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((t=>{if(this._spriteRequest=null,t)for(const e in t){this._spritesImagesIds[e]=[];const r=this._spritesImagesIds[e]?this._spritesImagesIds[e].filter((e=>!(e in t))):[];for(const t of r)this.imageManager.removeImage(t),this._changedImages[t]=!0;for(const n in t[e]){const r="default"===e?n:"".concat(e,":").concat(n);this._spritesImagesIds[e].push(r),r in this.imageManager.images?this.imageManager.updateImage(r,t[e][n],!1):this.imageManager.addImage(r,t[e][n]),i&&(this._changedImages[r]=!0)}}})).catch((t=>{this._spriteRequest=null,o=t,n.signal.aborted||this.fire(new e.k(o))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),i&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"})),r&&r(o)}))}_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("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"}))}_validateLayer(t){const i=this.tileManagers[t.source];if(!i)return;const r=t.sourceLayer;if(!r)return;const n=i.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(r))&&this.fire(new e.k(new Error('Source layer "'.concat(r,'" does not exist on source "').concat(n.id,'" as specified by style layer "').concat(t.id,'".'))))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=this._serializedAllLayers();if(!t||0===t.length)return Object.values(i?e.bS(r):r);const n=[];for(const o of t)if(r[o]){const t=i?e.bS(r[o]):r[o];n.push(t)}return n}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const e=Object.keys(this._layers);for(const i of e){const e=this._layers[i];"custom"!==e.type&&(t[i]=e.serialize())}return t}hasTransitions(){var t,e,i;if(null===(t=this.light)||void 0===t?void 0:t.hasTransition())return!0;
1if(null===(e=this.sky)||void 0===e?void 0:e.hasTransition())return!0;if(null===(i=this.projection)||void 0===i?void 0:i.hasTransition())return!0;for(const r in this.tileManagers)if(this.tileManagers[r].hasTransition())return!0;for(const r in this._layers)if(this._layers[r].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const i=this._changed;if(i){const e=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(e.length||i.length)&&this._updateWorkerLayers(e,i);for(const t in this._updatedSources){const e=this._updatedSources[t];if("reload"===e)this._reloadSource(t);else{if("clear"!==e)throw new Error("Invalid action ".concat(e));this._clearSource(t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const r in this._updatedPaintProps)this._layers[r].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const r={};for(const e in this.tileManagers){const t=this.tileManagers[e];r[e]=t.used,t.used=!1}for(const e of this._order){const i=this._layers[e];i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)&&i.source&&(this.tileManagers[i.source].used=!0)}for(const n in r){const t=this.tileManagers[n];!!r[n]!=!!t.used&&t.fire(new e.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:n}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,i&&this.fire(new e.l("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this.tileManagers)this.tileManagers[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var r;this._checkLoaded();const n=this.serialize();if(t=i.transformStyle?i.transformStyle(n,t):t,(null===(r=i.validate)||void 0===r||r)&&Bi(this,e.C(t)))return!1;(t=e.bS(t)).layers=e.bP(t.layers);const o=e.bT(n,t),a=this._getOperationsToPerform(o);if(a.unimplemented.length>0)throw new Error("Unimplemented: ".concat(a.unimplemented.join(", "),"."));if(0===a.operations.length)return!1;for(const e of a.operations)e();return this.stylesheet=t,this._serializedLayers=null,this.fire(new e.l("style.load",{style:this})),!0}_getOperationsToPerform(t){const e=[],i=[];for(const r of t)switch(r.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":e.push((()=>this.addLayer.apply(this,r.args)));break;case"removeLayer":e.push((()=>this.removeLayer.apply(this,r.args)));break;case"setPaintProperty":e.push((()=>this.setPaintProperty.apply(this,r.args)));break;case"setLayoutProperty":e.push((()=>this.setLayoutProperty.apply(this,r.args)));break;case"setFilter":e.push((()=>this.setFilter.apply(this,r.args)));break;case"addSource":e.push((()=>this.addSource.apply(this,r.args)));break;case"removeSource":e.push((()=>this.removeSource.apply(this,r.args)));break;case"setLayerZoomRange":e.push((()=>this.setLayerZoomRange.apply(this,r.args)));break;case"setLight":e.push((()=>this.setLight.apply(this,r.args)));break;case"setGeoJSONSourceData":e.push((()=>this.setGeoJSONSourceData.apply(this,r.args)));break;case"setGlyphs":e.push((()=>this.setGlyphs.apply(this,r.args)));break;case"setSprite":e.push((()=>this.setSprite.apply(this,r.args)));break;case"setTerrain":e.push((()=>this.map.setTerrain.apply(this,r.args)));break;case"setSky":e.push((()=>this.setSky.apply(this,r.args)));break;case"setProjection":this.setProjection.apply(this,r.args);break;case"setGlobalState":e.push((()=>this.setGlobalState.apply(this,r.args)));break;case"setTransition":e.push((()=>{}));break;default:i.push(r.command)}return{operations:e,unimplemented:i}}addImage(t,i){if(this.getImage(t))return this.fire(new e.k(new Error('An image named "'.concat(t,'" already exists.'))));this.imageManager.addImage(t,i),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new e.k(new Error('An image named "'.concat(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("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._checkLoaded(),void 0!==this.tileManagers[t])throw new Error('Source "'.concat(t,'" already exists.'));if(!i.type)throw new Error("The type property must be defined, but only the following properties were given: ".concat(Object.keys(i).join(", "),"."));if(["vector","raster","geojson","video","image"].indexOf(i.type)>
1=0&&this._validate(e.C.source,"sources.".concat(t),i,null,r))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const n=this.tileManagers[t]=new Vt(t,i,this.dispatcher);n.style=this,n.setEventedParent(this,(()=>({isSourceLoaded:n.loaded(),source:n.serialize(),sourceId:t}))),n.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.tileManagers[t])throw new Error("There is no source with this ID=".concat(t));for(const r in this._layers)if(this._layers[r].source===t)return this.fire(new e.k(new Error('Source "'.concat(t,'" cannot be removed while layer "').concat(r,'" is using it.'))));const i=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],i.fire(new e.l("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){if(this._checkLoaded(),void 0===this.tileManagers[t])throw new Error("There is no source with this ID=".concat(t));const i=this.tileManagers[t].getSource();if("geojson"!==i.type)throw new Error("geojsonSource.type is ".concat(i.type,", which is !== 'geojson"));i.setData(e),this._changed=!0}getSource(t){return this.tileManagers[t]&&this.tileManagers[t].getSource()}addLayer(t,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const n=t.id;if(this.getLayer(n))return void this.fire(new e.k(new Error('Layer "'.concat(n,'" already exists on this map.'))));let o;if("custom"===t.type){if(Bi(this,e.bU(t)))return;o=e.bQ(t,this._globalState)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(n,t.source),t=e.bS(t),t=e.e(t,{source:n})),this._validate(e.C.layer,"layers.".concat(n),t,{arrayIndex:-1},r))return;o=e.bQ(t,this._globalState),this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}})}const a=i?this._order.indexOf(i):this._order.length;if(i&&-1===a)this.fire(new e.k(new Error('Cannot add layer "'.concat(n,'" before non-existing layer "').concat(i,'".'))));else{if(this._order.splice(a,0,n),this._layerOrderChanged=!0,this._layers[n]=o,this._removedLayers[n]&&o.source&&"custom"!==o.type){const t=this._removedLayers[n];delete this._removedLayers[n],t.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.tileManagers[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}moveLayer(t,i){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.k(new Error("The layer '".concat(t,"' does not exist in the map's style and cannot be moved."))));if(t===i)return;const r=this._order.indexOf(t);this._order.splice(r,1);const n=i?this._order.indexOf(i):this._order.length;i&&-1===n?this.fire(new e.k(new Error('Cannot move layer "'.concat(t,'" before non-existing layer "').concat(i,'".')))):(this._order.splice(n,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const i=this._layers[t];if(!i)return void this.fire(new e.k(new Error('Cannot remove non-existing layer "'.concat(t,'".'))));i.setEventedParent(null);const r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=i,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],i.onRemove&&i.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,i,r){this._checkLoaded();const n=this.getLayer(t);n?n.minzoom===i&&n.maxzoom===r||(null!=i&&(n.minzoom=i),null!=r&&(n.maxzoom=r),this._updateLayer(n)):this.fire(new e.k(new Error('Cannot set the zoom range of non-existing layer "'.concat(t,'".'))))}setFilter(t,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const n=this.getLayer(t);if(n){if(!e.bO(n.filter,i))return null==i?(n.setFilter(void 0),void this._updateLayer(n)):void(this._validate(e.C.filter,"layers.".concat(n.id,".filter"),i,null,r)||(n.setFilter(e.bS(i)),this._updateLayer(n)))}else this.fire(new e.k(new Error('Cannot filter non-existing layer "'.concat(t,'".'))))}getFilter(t){return e.bS(this.getLayer(t).filter)}setLayoutProperty(t,i,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const o=this.getLayer(t);o?e.bO(o.getLayoutProperty(i),r)||(o.setLayoutProperty(i,r,n),this._updateLayer(o)):this.fire(new e.k(new Error('Cannot style non-existing layer "'.concat(t,'".'))))}getLayoutProperty(t,i){const r=this.getLayer(t);if(r)return r.getLayoutProperty(i);this.fire(new e.k(new Error('Cannot get style of non-existing layer "'.concat(t,'".'))))}setPaintProperty(t,i,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const o=this.getLayer(t);o?e.bO(o.getPaintProperty(i),r)||this._updatePaintProperty(o,i,r,n):this.fire(new e.k(new Error('Cannot style non-existing layer "'.concat(t,'".'))))}_updatePaintProperty(t,i,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};t.setPaintProperty(i,r,n)&&this._updateLayer(t),e.bR(t)&&"raster-fade-duration"===i&&this.tileManagers[t.source].setRasterFadeDuration(r),this._changed=!0,this._updatedPaintProps[t.id]=!0,this._serializedLayers=null}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,i){this._checkLoaded();const r=t.source,n=t.sourceLayer,o=this.tileManagers[r];if(void 0===o)return void this.fire(new e.k(new Error("The source '".concat(r,"' does not exist in the map's style."))));const a=o.getSource().type;"geojson"===a&&n?this.fire(new e.k(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||n?(void 0===t.id&&this.fire(new e.k(new Error("The feature id parameter must be provided."))),o.setFeatureState(n,t.id,i)):this.fire(new e.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,i){this._checkLoaded();const r=t.source,n=this.tileManagers[r];if(void 0===n)return void this.fire(new e.k(new Error("The source '".concat(r,"' does not exist in the map's style."))));
vendor: 4,258 bytes, line 1
1const o=n.getSource().type,a="vector"===o?t.sourceLayer:void 0;"vector"!==o||a?i&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.k(new Error("A feature id is required to remove its specific state property."))):n.removeFeatureState(a,t.id,i):this.fire(new e.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const i=t.source,r=t.sourceLayer,n=this.tileManagers[i];if(void 0!==n)return"vector"!==n.getSource().type||r?(void 0===t.id&&this.fire(new e.k(new Error("The feature id parameter must be provided."))),n.getFeatureState(r,t.id)):void this.fire(new e.k(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.k(new Error("The source '".concat(i,"' does not exist in the map's style."))))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=e.bV(this.tileManagers,(t=>t.serialize())),i=this._serializeByIds(this._order,!0),r=this.map.getTerrain()||void 0,n=this.stylesheet;return e.bW({version:n.version,name:n.name,metadata:n.metadata,light:n.light,sky:n.sky,center:n.center,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,sprite:n.sprite,glyphs:n.glyphs,transition:n.transition,projection:n.projection,sources:t,layers:i,terrain:r},(t=>void 0!==t))}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.tileManagers[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.tileManagers[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,i={},r=[];for(let o=this._order.length-1;o>=0;o--){const n=this._order[o];if(e(n)){i[n]=o;for(const e of t){const t=e[n];if(t)for(const e of t)r.push(e)}}}r.sort(((t,e)=>e.intersectionZ-t.intersectionZ));const n=[];for(let o=this._order.length-1;o>=0;o--){const a=this._order[o];if(e(a))for(let t=r.length-1;t>=0;t--){const e=r[t].feature;if(i[e.layer.id]<o)break;n.push(e),r.pop()}else for(const e of t){const t=e[a];if(t)for(const e of t)n.push(e.feature)}}return n}queryRenderedFeatures(t,i,r){i&&i.filter&&this._validate(e.C.filter,"queryRenderedFeatures.filter",i.filter,null,i);const n={};if(i&&i.layers){if(!(Array.isArray(i.layers)||i.layers instanceof Set))return this.fire(new e.k(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(const t of i.layers){const i=this._layers[t];if(!i)return this.fire(new e.k(new Error("The layer '".concat(t,"' does not exist in the map's style and cannot be queried for features.")))),[];n[i.source]=!0}}const o=[];i.availableImages=this._availableImages;const a=this._serializedAllLayers(),s=i.layers instanceof Set?i.layers:Array.isArray(i.layers)?new Set(i.layers):null,l=Object.assign(Object.assign({},i),{layers:s,globalState:this._globalState});for(const e in this.tileManagers)i.layers&&!n[e]||o.push(G(this.tileManagers[e],this._layers,a,t,l,r,this.map.terrain?(t,e,i)=>this.map.terrain.getElevation(t,e,i):void 0));return this.placement&&o.push(function(t,e,i,r,n,o,a){const s={},l=o.queryRenderedSymbols(r),c=[];for(const h of Object.keys(l).map(Number))c.push(a[h]);c.sort(Z);for(const h of c){const i=h.featureIndex.lookupSymbolFeatures(l[h.bucketInstanceId],e,h.bucketIndex,h.sourceLayerIndex,{filterSpec:n.filter,globalState:n.globalState},n.layers,n.availableImages,t);for(const t in i){const e=s[t]=s[t]||[],r=i[t];r.sort(((t,e)=>{const i=h.featureSortOrder;if(i){const r=i.indexOf(t.featureIndex);return i.indexOf(e.featureIndex)-r}return e.featureIndex-t.featureIndex}));for(const t of r)e.push(t)}}return function(t,e,i){for(const r in t)for(const n of t[r])q(n,i[e[r].source]);return t}(s,t,i)}(this._layers,a,this.tileManagers,t,l,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(t,i){(null==i?void 0:i.filter)&&this._validate(e.C.filter,"querySourceFeatures.filter",i.filter,null,i);const r=this.tileManagers[t];return r?function(t,e){const i=t.getRenderableIds().map((e=>t.getTileByID(e))),r=[],n={};for(let o=0;o<i.length;o++){const t=i[o],a=t.tileID.canonical.key;
1n[a]||(n[a]=!0,t.querySourceFeatures(r,e))}return r}(r,i?Object.assign(Object.assign({},i),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded();const r=this.light.getLight();let n=!1;for(const a in t)if(!e.bO(t[a],r[a])){n=!0;break}if(!n)return;const o={now:c(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,i),this.light.updateTransitions(o)}getProjection(){var t;return null===(t=this.stylesheet)||void 0===t?void 0:t.projection}setProjection(t){if(this._checkLoaded(),this.stylesheet.projection=t,this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}this._setProjectionInternal(t.type)}getSky(){var t;return null===(t=this.stylesheet)||void 0===t?void 0:t.sky}setSky(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded();const r=this.getSky();let n=!1;if(!t&&!r)return;if(t&&!r)n=!0;else if(!t&&r)n=!0;else for(const a in t)if(!e.bO(t[a],r[a])){n=!0;break}if(!n)return;const o={now:c(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,i),this.sky.updateTransitions(o)}_setProjectionInternal(t){const i=function(t,i){const r={constrainOverride:i};if(Array.isArray(t)){const e=new gi({type:t});return{projection:e,transform:new Ri(r),cameraHelper:new Li(e)}}switch(t){case"mercator":return{projection:new Ge,transform:new Je(r),cameraHelper:new ei};case"globe":{const t=new gi({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:t,transform:new Ri(r),cameraHelper:new Li(t)}}case"vertical-perspective":return{projection:new fi,transform:new ki(r),cameraHelper:new Fi};default:return e.w("Unknown projection name: ".concat(t,". Falling back to mercator projection.")),{projection:new Ge,transform:new Je(r),cameraHelper:new ei}}}(t,this.map.transformConstrain);this.projection=i.projection,this.map.migrateProjection(i.transform,i.cameraHelper);for(const e in this.tileManagers)this.tileManagers[e].reload()}_validate(t,i,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!o||!1!==o.validate)&&Bi(this,t.call(e.C,e.e({key:i,style:this.serialize(),value:r,styleSpec:e.u},n)))}_remove(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),pt().off(ht,this._rtlPluginLoaded);for(const e in this._layers)this._layers[e].setEventedParent(null);for(const e in this.tileManagers){const t=this.tileManagers[e];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.tileManagers[t].clearTiles()}_reloadSource(t){this.tileManagers[t].resume(),this.tileManagers[t].reload()}_updateSources(t){for(const e in this.tileManagers)this.tileManagers[e].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.tileManagers)this._reloadSource(t)}_updatePlacement(t,e,i,r){let n=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=!1,a=!1;const s={};for(const l of this._order){const e=this._layers[l];if("symbol"!==e.type)continue;if(!s[e.source]){const t=this.tileManagers[e.source];s[e.source]=t.getRenderableIds(!0).map((e=>t.getTileByID(e))).sort(((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)))}const i=this.crossTileSymbolIndex.addLayer(e,s[e.source],t.center.lng);o=o||i}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((n=n||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(c(),t.zoom))&&(this.pauseablePlacement=new Ae(t,this.map.terrain,this._order,n,e,i,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,s),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(c()),a=!0),o&&this.pauseablePlacement.placement.setStale()),a||o)for(const l of this._order){const t=this._layers[l];"symbol"===t.type&&this.placement.updateLayerOpacities(t,s[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(c())}_releaseSymbolFadeTiles(){for(const t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,i){return e._(this,void 0,void 0,(function*(){const t=yield this.imageManager.getImages(i.icons);this._updateTilesForChangedImages();const e=this.tileManagers[i.source];return e&&e.setDependencies(i.tileID.key,i.type,i.icons),t}))}getGlyphs(t,i){return e._(this,void 0,void 0,(function*(){const t=yield this.glyphManager.getGlyphs(i.stacks),e=this.tileManagers[i.source];return e&&e.setDependencies(i.tileID.key,i.type,[""]),t}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};
vendor: 14,840 bytes, line 1
1this._checkLoaded(),t&&this._validate(e.C.glyphs,"glyphs",t,null,i)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getDashes(t,i){return e._(this,void 0,void 0,(function*(){const t={};for(const[e,r]of Object.entries(i.dashes))t[e]=this.lineAtlas.getDash(r.dasharray,r.round);return t}))}addSprite(t,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;this._checkLoaded();const o=[{id:t,url:i}],a=[...v(this.stylesheet.sprite),...o];this._validate(e.C.sprite,"sprite",a,null,r)||(this.stylesheet.sprite=a,this._loadSprite(o,!0,n))}removeSprite(t){this._checkLoaded();const i=v(this.stylesheet.sprite);if(i.find((e=>e.id===t))){if(this._spritesImagesIds[t])for(const e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=!0;i.splice(i.findIndex((e=>e.id===t)),1),this.stylesheet.sprite=i.length>0?i:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.l("data",{dataType:"style"}))}else this.fire(new e.k(new Error('Sprite "'.concat(t,"\" doesn't exists on this map."))))}getSprite(){return v(this.stylesheet.sprite)}setSprite(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;this._checkLoaded(),t&&this._validate(e.C.sprite,"sprite",t,null,i)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,r):(this._unloadSprite(),r&&r(null)))}destroy(){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null);for(const t in this.tileManagers){const e=this.tileManagers[t];e.setEventedParent(null),e.onRemove(this.map)}this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy();for(const t in this._layers){const e=this._layers[t];e.setEventedParent(null),e.onRemove&&e.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}}var ji=e.aR([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Ni{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,i,r,n,o,a,s,l){this.context=t;let c=this.boundPaintVertexBuffers.length!==r.length;for(let h=0;!c&&h<r.length;h++)this.boundPaintVertexBuffers[h]!==r[h]&&(c=!0);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||c||this.boundIndexBuffer!==n||this.boundVertexOffset!==o||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(e,i,r,n,o,a,s,l):(t.bindVertexArray.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind(),l&&l.bind())}freshBind(t,e,i,r,n,o,a,s){const l=t.numAttributes,c=this.context,h=c.gl;this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a,this.boundDynamicVertexBuffer3=s,e.enableAttributes(h,t);for(const u of i)u.enableAttributes(h,t);o&&o.enableAttributes(h,t),a&&a.enableAttributes(h,t),s&&s.enableAttributes(h,t),e.bind(),e.setVertexAttribPointers(h,t,n);for(const u of i)u.bind(),u.setVertexAttribPointers(h,t,n);o&&(o.bind(),o.setVertexAttribPointers(h,t,n)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(h,t,n)),s&&(s.bind(),s.setVertexAttribPointers(h,t,n)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const Ui=(t,i,r,n,o)=>({u_texture:0,u_ele_delta:t,u_fog_matrix:i,u_fog_color:r?r.properties.get("fog-color"):e.bm.white,u_fog_ground_blend:r?r.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:o?0:r?r.calculateFogBlendOpacity(n):0,u_horizon_color:r?r.properties.get("horizon-color"):e.bm.white,u_horizon_fog_blend:r?r.properties.get("horizon-fog-blend"):1,u_is_globe_mode:o?1:0}),Gi={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function Zi(t){const e=[];for(let i=0;i<t.length;i++){if(null===t[i])continue;const r=t[i].split(" ");e.push(r.pop())}return e}class qi{constructor(t,i,r,n,o,a,s,l){let c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:[];const h=t.gl;this.program=h.createProgram();const u=Zi(i.staticAttributes),d=r?r.getBinderAttributes():[],p=u.concat(d),f=Be.prelude.staticUniforms?Zi(Be.prelude.staticUniforms):[],m=s.staticUniforms?Zi(s.staticUniforms):[],g=i.staticUniforms?Zi(i.staticUniforms):[],_=r?r.getBinderUniforms():[],y=f.concat(m).concat(g).concat(_),v=[];for(const e of y)v.indexOf(e)<0&&v.push(e);const x=r?r.defines():[];ci(h)&&x.unshift("#version 300 es"),o&&x.push("#define OVERDRAW_INSPECTOR;"),a&&x.push("#define TERRAIN3D;"),l&&x.push(l),c&&x.push(...c);let b=x.concat(Be.prelude.fragmentSource,s.fragmentSource,i.fragmentSource).join("\n"),w=x.concat(Be.prelude.vertexSource,s.vertexSource,i.vertexSource).join("\n");ci(h)||(b=function(t){return t.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")}(b),w=function(t){return t.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")}(w));const T=h.createShader(h.FRAGMENT_SHADER);if(h.isContextLost())return void(this.failedToCreate=!0);if(h.shaderSource(T,b),h.compileShader(T),!h.getShaderParameter(T,h.COMPILE_STATUS))throw new Error("Could not compile fragment shader: ".concat(h.getShaderInfoLog(T)));h.attachShader(this.program,T);const S=h.createShader(h.VERTEX_SHADER);if(h.isContextLost())return void(this.failedToCreate=!0);if(h.shaderSource(S,w),h.compileShader(S),!h.getShaderParameter(S,h.COMPILE_STATUS))throw new Error("Could not compile vertex shader: ".concat(h.getShaderInfoLog(S)));h.attachShader(this.program,S),this.attributes={};const P={};this.numAttributes=p.length;for(let e=0;e<this.numAttributes;e++)p[e]&&(h.bindAttribLocation(this.program,e,p[e]),this.attributes[p[e]]=e);if(h.linkProgram(this.program),!h.getProgramParameter(this.program,h.LINK_STATUS))throw new Error("Program failed to link: ".concat(h.getProgramInfoLog(this.program)));h.deleteShader(S),h.deleteShader(T);for(let e=0;e<v.length;e++){const t=v[e];if(t&&!P[t]){const e=h.getUniformLocation(this.program,t);e&&(P[t]=e)}}this.fixedUniforms=n(t,P),this.terrainUniforms=((t,i)=>({u_depth:new e.bX(t,i.u_depth),u_terrain:new e.bX(t,i.u_terrain),u_terrain_dim:new e.bn(t,i.u_terrain_dim),u_terrain_matrix:new e.bZ(t,i.u_terrain_matrix),u_terrain_unpack:new e.b_(t,i.u_terrain_unpack),u_terrain_exaggeration:new e.bn(t,i.u_terrain_exaggeration)}))(t,P),this.projectionUniforms=((t,i)=>({u_projection_matrix:new e.bZ(t,i.u_projection_matrix),u_projection_tile_mercator_coords:new e.b_(t,i.u_projection_tile_mercator_coords),u_projection_clipping_plane:new e.b_(t,i.u_projection_clipping_plane),u_projection_transition:new e.bn(t,i.u_projection_transition),u_projection_fallback_matrix:new e.bZ(t,i.u_projection_fallback_matrix)}))(t,P),this.binderUniforms=r?r.getUniforms(t,P):[]}draw(t,e,i,r,n,o,a,s,l,c,h,u,d,p,f,m,g,_,y){const v=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(n),t.setCullFace(o),s){t.activeTexture.set(v.TEXTURE2),v.bindTexture(v.TEXTURE_2D,s.depthTexture),t.activeTexture.set(v.TEXTURE3),v.bindTexture(v.TEXTURE_2D,s.texture);for(const t in this.terrainUniforms)this.terrainUniforms[t].set(s[t])}if(l)for(const b in l)this.projectionUniforms[Gi[b]].set(l[b]);if(a)for(const b in this.fixedUniforms)this.fixedUniforms[b].set(a[b]);m&&m.setUniforms(t,this.binderUniforms,p,{zoom:f});let x=0;switch(e){case v.LINES:x=2;break;case v.TRIANGLES:x=3;break;case v.LINE_STRIP:x=1}for(const b of d.get()){const i=b.vaos||(b.vaos={});(i[c]||(i[c]=new Ni)).bind(t,this,h,m?m.getPaintVertexBuffers():[],u,b.vertexOffset,g,_,y),v.drawElements(e,b.primitiveLength*x,v.UNSIGNED_SHORT,b.primitiveOffset*x*2)}}}function Wi(t,i,r){const n=1/e.aK(r,1,i.transform.tileZoom),o=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,i.transform.tileZoom)/o,s=a*(r.tileID.canonical.x+r.tileID.wrap*o),l=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}const Xi=(t,i,r,n)=>{const o=t.style.light,a=o.properties.get("position"),s=[a.x,a.y,a.z],l=e.c1();"viewport"===o.properties.get("anchor")&&e.c2(l,t.transform.bearingInRadians),e.c3(s,s,l);const c=t.transform.transformLightDirection(s),h=o.properties.get("color");return{u_lightpos:s,u_lightpos_globe:c,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[h.r,h.g,h.b],u_vertical_gradient:+i,u_opacity:r,u_fill_translate:n}},Hi=(t,i,r,n,o,a,s)=>e.e(Xi(t,i,r,n),Wi(a,t,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8}),Yi=(t,i,r,n)=>e.e(Wi(i,t,r),{u_fill_translate:n}),Ki=(t,e)=>({u_world:t,u_fill_translate:e}),Ji=(t,i,r,n,o)=>e.e(Yi(t,i,r,o),{u_world:n}),Qi=(t,i,r,n,o)=>{const a=t.transform;let s,l,c=0;if("map"===r.paint.get("circle-pitch-alignment")){const t=e.aK(i,1,a.zoom);s=!0,l=[t,t],c=t/(e.a5*Math.pow(2,i.tileID.overscaledZ))*2*Math.PI*o}else s=!1,l=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_pitch_with_map:+s,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:l,u_globe_extrude_scale:c,u_translate:n}},$i=t=>({u_pixel_extrude_scale:[1/t.width,1/t.height]}),tr=t=>({u_viewport_size:[t.width,t.height]}),er=function(t){return{u_color:t,u_overlay:0,u_overlay_scale:arguments.length>1&&void 0!==arguments[1]?arguments[1]:1}},ir=(t,i,r,n)=>{const o=e.aK(t,1,i)/(e.a5*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*n;return{u_extrude_scale:e.aK(t,1,i),u_intensity:r,u_globe_extrude_scale:o}},rr=(t,i,r,n)=>{const o=e.N();e.c4(o,0,t.width,t.height,0,0,1);const a=t.context.gl;return{u_matrix:o,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:r,u_color_ramp:n,u_opacity:i.paint.get("heatmap-opacity")}},nr=(t,e,i)=>{const r=i.paint.get("hillshade-accent-color");let n;switch(i.paint.get("hillshade-method")){case"basic":n=4;break;case"combined":n=1;break;case"igor":n=2;break;case"multidirectional":n=3;break;default:n=0}const o=i.getIlluminationProperties();for(let a=0;a<o.directionRadians.length;a++)"viewport"===i.paint.get("hillshade-illumination-anchor")&&(o.directionRadians[a]+=t.transform.bearingInRadians);return{u_image:0,u_latrange:ar(0,e.tileID),u_exaggeration:i.paint.get("hillshade-exaggeration"),u_altitudes:o.altitudeRadians,u_azimuths:o.directionRadians,u_accent:r,u_method:n,u_highlights:o.highlightColor,u_shadows:o.shadowColor}},or=(t,i)=>{const r=i.stride,n=e.N();return e.c4(n,0,e.a5,-e.a5,0,0,1),e.O(n,n,[0,-e.a5,0]),{u_matrix:n,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:i.getUnpackVector()}};function ar(t,i){const r=Math.pow(2,i.canonical.z),n=i.canonical.y;return[new e.a6(0,n/r).toLngLat().lat,new e.a6(0,(n+1)/r).toLngLat().lat]}const sr=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{u_image:0,u_unpack:e.getUnpackVector(),u_dimension:[e.stride,e.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:i,u_opacity:t.paint.get("color-relief-opacity")}},lr=(t,i,r,n)=>{const o=t.transform;return{u_translation:fr(t,i,r),u_ratio:n/e.aK(i,1,o.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},cr=(t,i,r,n,o)=>e.e(lr(t,i,r,n),{u_image:0,u_image_height:o}),hr=(t,i,r,n,o)=>{const a=t.transform,s=pr(i,a);return{u_translation:fr(t,i,r),u_texsize:i.imageAtlasTexture.size,u_ratio:n/e.aK(i,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[s,o.fromScale,o.toScale],u_fade:o.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},ur=(t,i,r,n,o)=>{const a=pr(i,t.transform);return e.e(lr(t,i,r,n),{u_tileratio:a,u_crossfade_from:o.fromScale,u_crossfade_to:o.toScale,u_image:0,u_mix:o.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})},dr=(t,i,r,n,o,a)=>{const s=pr(i,t.transform);return e.e(lr(t,i,r,n),{u_image:0,u_image_height:a,u_tileratio:s,u_crossfade_from:o.fromScale,u_crossfade_to:o.toScale,u_image_dash:1,u_mix:o.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})};function pr(t,i){return 1/e.aK(t,1,i.tileZoom)}function fr(t,i,r){return e.aL(t.transform,i,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const mr=(t,e,i,r,n)=>{return{u_tl_parent:t,u_scale_parent:e,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(a=r.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=r.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:gr(r.paint.get("raster-hue-rotate")),u_coords_top:[n[0].x,n[0].y,n[1].x,n[1].y],u_coords_bottom:[n[3].x,n[3].y,n[2].x,n[2].y]};var o,a};function gr(t){t*=Math.PI/180;const e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}const _r=(t,e,i,r,n,o,a,s,l,c,h,u,d)=>{const p=a.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:p.cameraToCenterDistance,u_pitch:p.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:p.width/p.height,u_fade_change:a.options.fadeDuration?a.symbolFadeChange:1,u_label_plane_matrix:s,u_coord_matrix:l,u_is_text:+h,u_pitch_with_map:+r,u_is_along_line:n,u_is_variable_anchor:o,u_texsize:u,u_texture:0,u_translation:c,u_pitched_scale:d}},yr=(t,i,r,n,o,a,s,l,c,h,u,d,p,f)=>{const m=s.transform;return e.e(_r(t,i,r,n,o,a,s,l,c,h,u,d,f),{u_gamma_scale:n?Math.cos(m.pitch
vendor: 1,053 bytes, line 1
1*Math.PI/180)*m.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:1})},vr=(t,i,r,n,o,a,s,l,c,h,u,d,p)=>e.e(yr(t,i,r,n,o,a,s,l,c,h,!0,u,0,p),{u_texsize_icon:d,u_texture_icon:1}),xr=(t,e)=>({u_opacity:t,u_color:e}),br=(t,i,r,n,o)=>e.e(function(t,i,r,n){const o=r.imageManager.getPattern(t.from.toString()),a=r.imageManager.getPattern(t.to.toString()),{width:s,height:l}=r.imageManager.getPixelSize(),c=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,u=h*(n.tileID.canonical.x+n.tileID.wrap*c),d=h*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:o.tl,u_pattern_br_a:o.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:i.t,u_pattern_size_a:o.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:i.fromScale,u_scale_b:i.toScale,u_tile_units_to_pixels:1/e.aK(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,d>>16],u_pixel_coord_lower:[65535&u,65535&d]}}(r,o,i,n),{u_opacity:t}),wr=(t,e)=>{},Tr={fillExtrusion:(t,i)=>({u_lightpos:new e.b$(t,i.u_lightpos),u_lightpos_globe:new e.b$(t,
1i.u_lightpos_globe),u_lightintensity:new e.bn(t,i.u_lightintensity),u_lightcolor:new e.b$(t,i.u_lightcolor),u_vertical_gradient:new e.bn(t,i.u_vertical_gradient),u_opacity:new e.bn(t,i.u_opacity),u_fill_translate:new e.c0(t,i.u_fill_translate)}),fillExtrusionPattern:(t,i)=>({u_lightpos:new e.b$(t,i.u_lightpos),u_lightpos_globe:new e.b$(t,i.u_lightpos_globe),u_lightintensity:new e.bn(t,i.u_lightintensity),u_lightcolor:new e.b$(t,i.u_lightcolor),u_vertical_gradient:new e.bn(t,i.u_vertical_gradient),u_height_factor:new e.bn(t,i.u_height_factor),u_opacity:new e.bn(t,i.u_opacity),u_fill_translate:new e.c0(t,i.u_fill_translate),u_image:new e.bX(t,i.u_image),u_texsize:new e.c0(t,i.u_texsize),u_pixel_coord_upper:new e.c0(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.c0(t,i.u_pixel_coord_lower),u_scale:new e.b$(t,i.u_scale),u_fade:new e.bn(t,i.u_fade)}),fill:(t,i)=>({u_fill_translate:new e.c0(t,i.u_fill_translate)}),fillPattern:(t,i)=>({u_image:new e.bX(t,i.u_image),u_texsize:new e.c0(t,i.u_texsize),u_pixel_coord_upper:new e.c0(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.c0(t,i.u_pixel_coord_lower),u_scale:new e.b$(t,
1i.u_scale),u_fade:new e.bn(t,i.u_fade),u_fill_translate:new e.c0(t,i.u_fill_translate)}),fillOutline:(t,i)=>({u_world:new e.c0(t,i.u_world),u_fill_translate:new e.c0(t,i.u_fill_translate)}),fillOutlinePattern:(t,i)=>({u_world:new e.c0(t,i.u_world),u_image:new e.bX(t,i.u_image),u_texsize:new e.c0(t,i.u_texsize),u_pixel_coord_upper:new e.c0(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.c0(t,i.u_pixel_coord_lower),u_scale:new e.b$(t,i.u_scale),u_fade:new e.bn(t,i.u_fade),u_fill_translate:new e.c0(t,i.u_fill_translate)}),circle:(t,i)=>({u_camera_to_center_distance:new e.bn(t,i.u_camera_to_center_distance),u_scale_with_map:new e.bX(t,i.u_scale_with_map),u_pitch_with_map:new e.bX(t,i.u_pitch_with_map),u_extrude_scale:new e.c0(t,i.u_extrude_scale),u_device_pixel_ratio:new e.bn(t,i.u_device_pixel_ratio),u_globe_extrude_scale:new e.bn(t,i.u_globe_extrude_scale),u_translate:new e.c0(t,i.u_translate)}),collisionBox:(t,i)=>({u_pixel_extrude_scale:new e.c0(t,i.u_pixel_extrude_scale)}),collisionCircle:(t,i)=>({u_viewport_size:new e.c0(t,i.u_viewport_size)}),debug:(t,i)=>({u_color:new e.bY(t,i.u_color),u_overlay:new e.bX(t,i.u_overlay),u_overlay_scale:new e.bn(t,i.u_overlay_scale)}),depth:wr,clippingMask:wr,heatmap:(t,i)=>({u_extrude_scale:new e.bn(t,i.u_extrude_scale),u_intensity:new e.bn(t,i.u_intensity),u_globe_extrude_scale:new e.bn(t,i.u_globe_extrude_scale)}),heatmapTexture:(t,i)=>({u_matrix:new e.bZ(t,i.u_matrix),u_world:new e.c0(t,i.u_world),u_image:new e.bX(t,i.u_image),u_color_ramp:new e.bX(t,i.u_color_ramp),u_opacity:new e.bn(t,i.u_opacity)}),hillshade:(t,i)=>({u_image:new e.bX(t,i.u_image),u_latrange:new e.c0(t,i.u_latrange),u_exaggeration:new e.bn(t,i.u_exaggeration),u_altitudes:new e.c6(t,i.u_altitudes),u_azimuths:new e.c6(t,i.u_azimuths),u_accent:new e.bY(t,i.u_accent),u_method:new e.bX(t,i.u_method),u_shadows:new e.c5(t,i.u_shadows),u_highlights:new e.c5(t,i.u_highlights)}),hillshadePrepare:(t,i)=>({u_matrix:new e.bZ(t,i.u_matrix),u_image:new e.bX(t,i.u_image),u_dimension:new e.c0(t,i.u_dimension),u_zoom:new e.bn(t,i.u_zoom),u_unpack:new e.b_(t,i.u_unpack)}),colorRelief:(t,i)=>({u_image:new e.bX(t,i.u_image),u_unpack:new e.b_(t,i.u_unpack),u_dimension:new e.c0(t,i.u_dimension),u_elevation_stops:new e.bX(t,i.u_elevation_stops),u_color_stops:new e.bX(t,i.u_color_stops),u_color_ramp_size:new e.bX(t,i.u_color_ramp_size),u_opacity:new e.bn(t,i.u_opacity)}),line:(t,i)=>({u_translation:new e.c0(t,i.u_translation),u_ratio:new e.bn(t,i.u_ratio),u_device_pixel_ratio:new e.bn(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.c0(t,i.u_units_to_pixels)}),lineGradient:(t,i)=>({u_translation:new e.c0(t,i.u_translation),u_ratio:new e.bn(t,i.u_ratio),u_device_pixel_ratio:new e.bn(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.c0(t,i.u_units_to_pixels),u_image:new e.bX(t,i.u_image),u_image_height:new e.bn(t,i.u_image_height)}),linePattern:(t,i)=>({u_translation:new e.c0(t,i.u_translation),u_texsize:new e.c0(t,i.u_texsize),u_ratio:new e.bn(t,i.u_ratio),u_device_pixel_ratio:new e.bn(t,i.u_device_pixel_ratio),u_image:new e.bX(t,i.u_image),u_units_to_pixels:new e.c0(t,i.u_units_to_pixels),u_scale:new e.b$(t,
1i.u_scale),u_fade:new e.bn(t,i.u_fade)}),lineSDF:(t,i)=>({u_translation:new e.c0(t,i.u_translation),u_ratio:new e.bn(t,i.u_ratio),u_device_pixel_ratio:new e.bn(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.c0(t,i.u_units_to_pixels),u_image:new e.bX(t,i.u_image),u_mix:new e.bn(t,i.u_mix),u_tileratio:new e.bn(t,i.u_tileratio),u_crossfade_from:new e.bn(t,i.u_crossfade_from),u_crossfade_to:new e.bn(t,i.u_crossfade_to),u_lineatlas_width:new e.bn(t,i.u_lineatlas_width),u_lineatlas_height:new e.bn(t,i.u_lineatlas_height)}),lineGradientSDF:(t,i)=>({u_translation:new e.c0(t,i.u_translation),u_ratio:new e.bn(t,i.u_ratio),u_device_pixel_ratio:new e.bn(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.c0(t,i.u_units_to_pixels),u_image:new e.bX(t,i.u_image),u_image_height:new e.bn(t,i.u_image_height),u_tileratio:new e.bn(t,i.u_tileratio),u_crossfade_from:new e.bn(t,i.u_crossfade_from),u_crossfade_to:new e.bn(t,i.u_crossfade_to),u_image_dash:new e.bX(t,i.u_image_dash),u_mix:new e.bn(t,i.u_mix),u_lineatlas_width:new e.bn(t,i.u_lineatlas_width),u_lineatlas_height:new e.bn(t,i.u_lineatlas_height)}),raster:(t,i)=>({u_tl_parent:new e.c0(t,i.u_tl_parent),u_scale_parent:new e.bn(t,i.u_scale_parent),u_buffer_scale:new e.bn(t,i.u_buffer_scale),u_fade_t:new e.bn(t,i.u_fade_t),u_opacity:new e.bn(t,i.u_opacity),u_image0:new e.bX(t,i.u_image0),u_image1:new e.bX(t,i.u_image1),u_brightness_low:new e.bn(t,i.u_brightness_low),u_brightness_high:new e.bn(t,i.u_brightness_high),u_saturation_factor:new e.bn(t,i.u_saturation_factor),u_contrast_factor:new e.bn(t,i.u_contrast_factor),u_spin_weights:new e.b$(t,i.u_spin_weights),u_coords_top:new e.b_(t,i.u_coords_top),u_coords_bottom:new e.b_(t,i.u_coords_bottom)}),symbolIcon:(t,i)=>({u_is_size_zoom_constant:new e.bX(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.bX(t,i.u_is_size_feature_constant),u_size_t:new e.bn(t,i.u_size_t),u_size:new e.bn(t,i.u_size),u_camera_to_center_distance:new e.bn(t,i.u_camera_to_center_distance),u_pitch:new e.bn(t,i.u_pitch),u_rotate_symbol:new e.bX(t,i.u_rotate_symbol),u_aspect_ratio:new e.bn(t,i.u_aspect_ratio),u_fade_change:new e.bn(t,i.u_fade_change),u_label_plane_matrix:new e.bZ(t,i.u_label_plane_matrix),u_coord_matrix:new e.bZ(t,i.u_coord_matrix),u_is_text:new e.bX(t,i.u_is_text),u_pitch_with_map:new e.bX(t,i.u_pitch_with_map),u_is_along_line:new e.bX(t,i.u_is_along_line),u_is_variable_anchor:new e.bX(t,i.u_is_variable_anchor),u_texsize:new e.c0(t,i.u_texsize),u_texture:new e.bX(t,i.u_texture),u_translation:new e.c0(t,i.u_translation),u_pitched_scale:new e.bn(t,i.u_pitched_scale)}),symbolSDF:(t,i)=>({u_is_size_zoom_constant:new e.bX(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.bX(t,i.u_is_size_feature_constant),u_size_t:new e.bn(t,i.u_size_t),u_size:new e.bn(t,i.u_size),u_camera_to_center_distance:new e.bn(t,i.u_camera_to_center_distance),u_pitch:new e.bn(t,i.u_pitch),u_rotate_symbol:new e.bX(t,i.u_rotate_symbol),u_aspect_ratio:new e.bn(t,i.u_aspect_ratio),u_fade_change:new e.bn(t,i.u_fade_change),u_label_plane_matrix:new e.bZ(t,i.u_label_plane_matrix),u_coord_matrix:new e.bZ(t,i.u_coord_matrix),u_is_text:new e.bX(t,i.u_is_text),u_pitch_with_map:new e.bX(t,i.u_pitch_with_map),u_is_along_line:new e.bX(t,i.u_is_along_line),u_is_variable_anchor:new e.bX(t,i.u_is_variable_anchor),u_texsize:new e.c0(t,i.u_texsize),u_texture:new e.bX(t,i.u_texture),u_gamma_scale:new e.bn(t,i.u_gamma_scale),u_device_pixel_ratio:new e.bn(t,i.u_device_pixel_ratio),u_is_halo:new e.bX(t,i.u_is_halo),u_translation:new e.c0(t,i.u_translation),u_pitched_scale:new e.bn(t,i.u_pitched_scale)}),symbolTextAndIcon:(t,i)=>({u_is_size_zoom_constant:new e.bX(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.bX(t,i.u_is_size_feature_constant),u_size_t:new e.bn(t,i.u_size_t),u_size:new e.bn(t,i.u_size),u_camera_to_center_distance:new e.bn(t,i.u_camera_to_center_distance),u_pitch:new e.bn(t,i.u_pitch),u_rotate_symbol:new e.bX(t,i.u_rotate_symbol),u_aspect_ratio:new e.bn(t,i.u_aspect_ratio),u_fade_change:new e.bn(t,i.u_fade_change),u_label_plane_matrix:new e.bZ(t,i.u_label_plane_matrix
vendor: 4,095 bytes, line 1
1),u_coord_matrix:new e.bZ(t,i.u_coord_matrix),u_is_text:new e.bX(t,i.u_is_text),u_pitch_with_map:new e.bX(t,i.u_pitch_with_map),u_is_along_line:new e.bX(t,i.u_is_along_line),u_is_variable_anchor:new e.bX(t,i.u_is_variable_anchor),u_texsize:new e.c0(t,i.u_texsize),u_texsize_icon:new e.c0(t,i.u_texsize_icon),u_texture:new e.bX(t,i.u_texture),u_texture_icon:new e.bX(t,i.u_texture_icon),u_gamma_scale:new e.bn(t,i.u_gamma_scale),u_device_pixel_ratio:new e.bn(t,i.u_device_pixel_ratio),u_is_halo:new e.bX(t,i.u_is_halo),u_translation:new e.c0(t,i.u_translation),u_pitched_scale:new e.bn(t,i.u_pitched_scale)}),background:(t,i)=>({u_opacity:new e.bn(t,i.u_opacity),u_color:new e.bY(t,i.u_color)}),backgroundPattern:(t,i)=>({u_opacity:new e.bn(t,i.u_opacity),u_image:new e.bX(t,i.u_image),u_pattern_tl_a:new e.c0(t,i.u_pattern_tl_a),u_pattern_br_a:new e.c0(t,i.u_pattern_br_a),u_pattern_tl_b:new e.c0(t,i.u_pattern_tl_b),u_pattern_br_b:new e.c0(t,i.u_pattern_br_b),u_texsize:new e.c0(t,i.u_texsize),u_mix:new e.bn(t,i.u_mix),u_pattern_size_a:new e.c0(t,i.u_pattern_size_a),u_pattern_size_b:new e.c0(t,i.u_pattern_size_b),u_scale_a:new e.bn(t,i.u_scale_a),u_scale_b:new e.bn(t,i.u_scale_b),u_pixel_coord_upper:new e.c0(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.c0(t,i.u_pixel_coord_lower),u_tile_units_to_pixels:new e.bn(t,i.u_tile_units_to_pixels)}),terrain:(t,i)=>({u_texture:new e.bX(t,i.u_texture),u_ele_delta:new e.bn(t,i.u_ele_delta),u_fog_matrix:new e.bZ(t,i.u_fog_matrix),u_fog_color:new e.bY(t,i.u_fog_color),u_fog_ground_blend:new e.bn(t,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.bn(t,i.u_fog_ground_blend_opacity),u_horizon_color:new e.bY(t,i.u_horizon_color),u_horizon_fog_blend:new e.bn(t,i.u_horizon_fog_blend),u_is_globe_mode:new e.bn(t,i.u_is_globe_mode)}),terrainDepth:(t,i)=>({u_ele_delta:new e.bn(t,i.u_ele_delta)}),terrainCoords:(t,i)=>({u_texture:new e.bX(t,i.u_texture),u_terrain_coords_id:new e.bn(t,i.u_terrain_coords_id),u_ele_delta:new e.bn(t,i.u_ele_delta)}),projectionErrorMeasurement:(t,i)=>({u_input:new e.bn(t,i.u_input),u_output_expected:new e.bn(t,i.u_output_expected)}),atmosphere:(t,i)=>({u_sun_pos:new e.b$(t,i.u_sun_pos),u_atmosphere_blend:new e.bn(t,i.u_atmosphere_blend),u_globe_position:new e.b$(t,i.u_globe_position),u_globe_radius:new e.bn(t,i.u_globe_radius),u_inv_proj_matrix:new e.bZ(t,i.u_inv_proj_matrix)}),sky:(t,i)=>({u_sky_color:new e.bY(t,i.u_sky_color),u_horizon_color:new e.bY(t,i.u_horizon_color),u_horizon:new e.c0(t,i.u_horizon),u_horizon_normal:new e.c0(t,i.u_horizon_normal),u_sky_horizon_blend:new e.bn(t,i.u_sky_horizon_blend),u_sky_blend:new e.bn(t,i.u_sky_blend)})};class Sr{constructor(t,e,i){this.context=t;const r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Pr={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ir{constructor(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;const n=t.gl;this.buffer=n.createBuffer(),t.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error("Length of new data is ".concat(t.length,", which doesn't match current length of ").concat(this.length));const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}
vendor: 19,109 bytes, line 1
1enableAttributes(t,e){for(let i=0;i<this.attributes.length;i++){const r=e.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r)}}setVertexAttribPointers(t,e,i){for(let r=0;r<this.attributes.length;r++){const n=this.attributes[r],o=e.attributes[n.name];void 0!==o&&t.vertexAttribPointer(o,n.components,t[Pr[n.type]],!1,this.itemSize,n.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Mr{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 Er extends Mr{getDefault(){return e.bm.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Cr extends Mr{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class Ar extends Mr{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class Dr extends Mr{getDefault(){return[!0,!0,!0,!0]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class zr extends Mr{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class kr extends Mr{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class Rr extends Mr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class Fr extends Mr{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class Lr extends Mr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class Br extends Mr{getDefault(){return[0,1]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class Or extends Mr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class Vr extends Mr{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class jr extends Mr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class Nr extends Mr{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class Ur extends Mr{getDefault(){return e.bm.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class Gr extends Mr{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class Zr extends Mr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class qr extends Mr{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class Wr extends Mr{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class Xr extends Mr{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class Hr extends Mr{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class Yr extends Mr{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class Kr extends Mr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Jr extends Mr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Qr extends Mr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class $r extends Mr{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class tn extends Mr{getDefault(){return null}set(t){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class en extends Mr{getDefault(){return null}set(t){var e;if(t===this.current&&!this.dirty)return;const i=this.gl;ci(i)?i.bindVertexArray(t):null===(e=i.getExtension("OES_vertex_array_object"))||void 0===e||e.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class rn extends Mr{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class nn extends Mr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class on extends Mr{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class an extends Mr{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class sn extends an{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class ln extends an{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class cn extends an{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}const hn="Framebuffer is not complete";class un{constructor(t,e,i,r,n){this.context=t,this.width=e,this.height=i;const o=t.gl,a=this.framebuffer=o.createFramebuffer();if(this.colorAttachment=new sn(t,a),r)this.depthAttachment=n?new cn(t,a):new ln(t,a);else if(n)throw new Error("Stencil cannot be set without depth");if(o.checkFramebufferStatus(o.FRAMEBUFFER)!==o.FRAMEBUFFER_COMPLETE)throw new Error(hn)}destroy(){const t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){const e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class dn{constructor(t){var e,i;if(this.gl=t,this.clearColor=new Er(this),this.clearDepth=new Cr(this),this.clearStencil=new Ar(this),this.colorMask=new Dr(this),this.depthMask=new zr(this),this.stencilMask=new kr(this),this.stencilFunc=new Rr(this),this.stencilOp=new Fr(this),this.stencilTest=new Lr(this),this.depthRange=new Br(this),this.depthTest=new Or(this),this.depthFunc=new Vr(this),this.blend=new jr(this),this.blendFunc=new Nr(this),this.blendColor=new Ur(this),this.blendEquation=new Gr(this),this.cullFace=new Zr(this),this.cullFaceSide=new qr(this),this.frontFace=new Wr(this),this.program=new Xr(this),this.activeTexture=new Hr(this),this.viewport=new Yr(this),this.bindFramebuffer=new Kr(this),this.bindRenderbuffer=new Jr(this),this.bindTexture=new Qr(this),this.bindVertexBuffer=new $r(this),this.bindElementBuffer=new tn(this),this.bindVertexArray=new en(this),this.pixelStoreUnpack=new rn(this),this.pixelStoreUnpackPremultiplyAlpha=new nn(this),this.pixelStoreUnpackFlipY=new on(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),ci(t)){this.HALF_FLOAT=t.HALF_FLOAT;const r=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(e=t.RGBA16F)&&void 0!==e?e:null==r?void 0:r.RGBA16F_EXT,this.RGB16F=null!==(i=t.RGB16F)&&void 0!==i?i:null==r?void 0:r.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const e=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==e?void 0:e.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,e){return new Sr(this,t,e)}createVertexBuffer(t,e,i){return new Ir(this,t,e,i)}createRenderbuffer(t,e,i){const r=this.gl,n=r.createRenderbuffer();return this.bindRenderbuffer.set(n),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),n}createFramebuffer(t,e,i,r){return new un(this,t,e,i,r)}clear(t){let{color:e,depth:i,stencil:r}=t;const n=this.gl;let o=0;e&&(o|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(o|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),void 0!==r&&(o|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(r),this.stencilMask.set(255)),n.clear(o)}setCullFace(t){!1===t.enable?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){e.bO(t.blendFunction,ii.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 ci(this.gl)?this.gl.createVertexArray():null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var e;return ci(this.gl)?this.gl.deleteVertexArray(t):null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}let pn;function fn(t,i,r,n,o){const a=t.context,s=t.transform,l=a.gl,c=t.useProgram("collisionBox"),h=[];let u=0,d=0;for(let e=0;e<n.length;e++){const p=n[e],f=i.getTile(p).getBucket(r);if(!f)continue;const m=o?f.textCollisionBox:f.iconCollisionBox,g=f.collisionCircleArray;g.length>0&&(h.push({circleArray:g,circleOffset:d,coord:p}),u+=g.length/4,d=u),m&&c.draw(a,l.LINES,oi.disabled,si.disabled,t.colorModeForRenderPass(),ni.disabled,$i(t.transform),t.style.map.terrain&&t.style.map.terrain.getTerrainData(p),s.getProjectionData({overscaledTileID:p,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),r.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,t.transform.zoom,null,null,m.collisionVertexBuffer)}if(!o||!h.length)return;const p=t.useProgram("collisionCircle"),f=new e.c7;f.resize(4*u),f._trim();let m=0;for(const e of h)for(let t=0;t<e.circleArray.length/4;t++){const i=4*t,r=e.circleArray[i+0],n=e.circleArray[i+1],o=e.circleArray[i+2],a=e.circleArray[i+3];f.emplace(m++,r,n,o,a,0),f.emplace(m++,r,n,o,a,1),f.emplace(m++,r,n,o,a,2),f.emplace(m++,r,n,o,a,3)}(!pn||pn.length<2*u)&&(pn=function(t){const i=2*t,r=new e.c9;r.resize(i),r._trim();for(let e=0;e<i;e++){const t=6*e;r.uint16[t+0]=4*e+0,r.uint16[t+1]=4*e+1,r.uint16[t+2]=4*e+2,r.uint16[t+3]=4*e+2,r.uint16[t+4]=4*e+3,r.uint16[t+5]=4*e+0}return r}(u));const g=a.createIndexBuffer(pn,!0),_=a.createVertexBuffer(f,e.c8.members,!0);for(const y of h){const i=tr(t.transform);p.draw(a,l.TRIANGLES,oi.disabled,si.disabled,t.colorModeForRenderPass(),ni.disabled,i,t.style.map.terrain&&t.style.map.terrain.getTerrainData(y.coord),null,r.id,_,g,e.aU.simpleSegment(0,2*y.circleOffset,y.circleArray.length,y.circleArray.length/2),null,t.transform.zoom,null,null,null)}_.destroy(),g.destroy()}const mn=e.ao(new Float32Array(16));function gn(t,i,r,n,o,a){const{horizontalAlign:s,verticalAlign:l}=e.aP(t);return new e.P((-(s-.5)*i/o+n[0])*a,(-(l-.5)*r/o+n[1])*a)}function _n(t,i,r,n,o,a){const s=i.tileAnchorPoint.add(new e.P(i.translation[0],i.translation[1]));if(i.pitchWithMap){let t=n.mult(a);r||(t=t.rotate(-o));const e=s.add(t);return Wt(e.x,e.y,i.pitchedLabelPlaneMatrix,i.getElevation).point}if(r){const e=ee(i.tileAnchorPoint.x+1,i.tileAnchorPoint.y,i).point.sub(t),r=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0);return t.add(n.rotate(r))}return t.add(n)}function yn(t,i,r,n,o,a,s,l,c,h,u,d){const p=t.text.placedSymbolArray,f=t.text.dynamicLayoutVertexArray,m=t.icon.dynamicLayoutVertexArray,g={};f.clear();for(let _=0;_<p.length;_++){const m=p.get(_),y=m.hidden||!m.crossTileID||t.allowVerticalPlacement&&!m.placedOrientation?null:n[m.crossTileID];if(y){const n=new e.P(m.anchorX,m.anchorY),p={getElevation:d,width:o.width,height:o.height,pitchedLabelPlaneMatrix:a,pitchWithMap:r,transform:o,tileAnchorPoint:n,translation:h,unwrappedTileID:u},_=r?re(n.x,n.y,p):ee(n.x,n.y,p),v=Xt(o.cameraToCenterDistance,_.signedDistanceFromCamera);let x=e.ax(t.textSizeData,l,m)*v/e.aJ;r&&(x*=t.tilePixelRatio/s);const{width:b,height:w,anchor:T,textOffset:S,textBoxScale:P}=y,I=gn(T,b,w,S,P,x),M=o.getPitchedTextCorrection(n.x+h[0],n.y+h[1],u),E=_n(_.point,p,i,I,-o.bearingInRadians,M),C=t.allowVerticalPlacement&&m.placedOrientation===e.aw.vertical?Math.PI/2:0;for(let t=0;t<m.numGlyphs;t++)e.aD(f,E,C);c&&m.associatedIconIndex>=0&&(g[m.associatedIconIndex]={shiftedAnchor:E,angle:C})}else le(m.numGlyphs,f)}if(c){m.clear();const i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){const r=i.get(t);if(r.hidden)le(r.numGlyphs,m);else{const i=g[t];if(i)for(let t=0;t<r.numGlyphs;t++)e.aD(m,i.shiftedAnchor,i.angle);else le(r.numGlyphs,m)}}t.icon.dynamicLayoutVertexBuffer.updateData(m)}t.text.dynamicLayoutVertexBuffer.updateData(f)}function vn(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function xn(t,i,r,n,o,a,s,l,c,h,u,d,p){const f=t.context,m=f.gl,g=t.transform,_="map"===l,y="map"===c,v="viewport"!==l&&"point"!==r.layout.get("symbol-placement"),x=_&&!y&&!v,b=!r.layout.get("symbol-sort-key").isConstant();let w=!1;const T=t.getDepthModeForSublayer(0,oi.ReadOnly),S=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),P=[],I=g.getCircleRadiusCorrection();for(const M of n){const n=i.getTile(M),l=n.getBucket(r);if(!l)continue;const c=o?l.text:l.icon;if(!c||!c.segments.get().length||!c.hasVisibleVertices)continue;const u=c.programConfigurations.get(r.id),d=o||l.sdfIcons,f=o?l.textSizeData:l.iconSizeData,T=y||0!==g.pitch,E=t.useProgram(vn(d,o,l),u),C=e.av(f,g.zoom),A=t.style.map.terrain&&t.style.map.terrain.getTerrainData(M);let D,z,k,R,F=[0,0],L=null;if(o)z=n.glyphAtlasTexture,k=m.LINEAR,D=n.glyphAtlasTexture.size,l.iconsInText&&(F=n.imageAtlasTexture.size,L=n.imageAtlasTexture,R=T||t.options.rotating||t.options.zooming||"composite"===f.kind||"camera"===f.kind?m.LINEAR:m.NEAREST);else{const e=1!==r.layout.get("icon-size").constantOr(0)||l.iconsNeedLinear;z=n.imageAtlasTexture,k=d||t.options.rotating||t.options.zooming||e||T?m.LINEAR:m.NEAREST,D=n.imageAtlasTexture.size}const B=e.aK(n,1,t.transform.zoom),O=Gt(_,t.transform,B),V=e.N();e.ay(V,O);const j=Zt(y,_,t.transform,B),N=e.aL(g,n,a,s),U=g.getProjectionData({overscaledTileID:M,applyGlobeMatrix:!p,applyTerrainMatrix:!0}),G=S&&l.hasTextData(),Z="none"!==r.layout.get("icon-text-fit")&&G&&l.hasIconData();if(v){const e=t.style.map.terrain?(e,i)=>t.style.map.terrain.getElevation(M,e,i):null,i="map"===r.layout.get("text-rotation-alignment");Yt(l,t,o,O,V,y,h,i,M.toUnwrapped(),g.width,g.height,N,e)}const q=o&&S||Z,W=v||q?mn:y?O:t.transform.clipSpaceToPixelsMatrix,X=d&&0!==r.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let H;H=d?l.iconsInText?vr(f.kind,C,x,y,v,q,t,W,j,N,D,F,I):yr(f.kind,C,x,y,v,q,t,W,j,N,o,D,0,I):_r(f.kind,C,x,y,v,q,t,W,j,N,o,D,I);const Y={program:E,buffers:c,uniformValues:H,projectionData:U,atlasTexture:z,atlasTextureIcon:L,atlasInterpolation:k,atlasInterpolationIcon:R,isSDF:d,hasHalo:X};if(b&&l.canOverlap){w=!0;const t=c.segments.get();for(const i of t)P.push({segments:new e.aU([i]),sortKey:i.sortKey,state:Y,terrainData:A})}
vendor: 5,009 bytes, line 1
1else P.push({segments:c.segments,sortKey:0,state:Y,terrainData:A})}w&&P.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of P){const i=e.state;if(f.activeTexture.set(m.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,m.CLAMP_TO_EDGE),i.atlasTextureIcon&&(f.activeTexture.set(m.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),i.isSDF){const n=i.uniformValues;i.hasHalo&&(n.u_is_halo=1,bn(i.buffers,e.segments,r,t,i.program,T,u,d,n,i.projectionData,e.terrainData)),n.u_is_halo=0}bn(i.buffers,e.segments,r,t,i.program,T,u,d,i.uniformValues,i.projectionData,e.terrainData)}}function bn(t,e,i,r,n,o,a,s,l,c,h){const u=r.context;n.draw(u,u.gl.TRIANGLES,o,a,s,ni.backCCW,l,h,c,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function wn(t,i,r,n,o){const a=t.context,s=a.gl,l=si.disabled,c=new ii([s.ONE,s.ONE],e.bm.transparent,[!0,!0,!0,!0]),h=i.getBucket(r);if(!h)return;const u=n.key;let d=r.heatmapFbos.get(u);d||(d=Sn(a,i.tileSize,i.tileSize),r.heatmapFbos.set(u,d)),a.bindFramebuffer.set(d.framebuffer),a.viewport.set([0,0,i.tileSize,i.tileSize]),a.clear({color:e.bm.transparent});const p=h.programConfigurations.get(r.id),f=t.useProgram("heatmap",p,!o),m=t.transform.getProjectionData({overscaledTileID:i.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),g=t.style.map.terrain.getTerrainData(n);f.draw(a,s.TRIANGLES,oi.disabled,l,c,ni.disabled,ir(i,t.transform.zoom,r.paint.get("heatmap-intensity"),1),g,m,r.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,r.paint,t.transform.zoom,p)}function Tn(t,e,i,r,n){const o=t.context,a=o.gl,s=t.transform;o.setColorMode(t.colorModeForRenderPass());const l=Pn(o,e),c=i.key,h=e.heatmapFbos.get(c);if(!h)return;o.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,h.colorAttachment.get()),o.activeTexture.set(a.TEXTURE1),l.bind(a.LINEAR,a.CLAMP_TO_EDGE);const u=s.getProjectionData({overscaledTileID:i,applyTerrainMatrix:n,applyGlobeMatrix:!r});t.useProgram("heatmapTexture").draw(o,a.TRIANGLES,oi.disabled,si.disabled,t.colorModeForRenderPass(),ni.disabled,rr(t,e,0,1),null,u,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,s.zoom),h.destroy(),e.heatmapFbos.delete(c)}function Sn(t,e,i){var r,n;const o=t.gl,a=o.createTexture();o.bindTexture(o.TEXTURE_2D,a),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR);const s=null!==(r=t.HALF_FLOAT)&&void 0!==r?r:o.UNSIGNED_BYTE,l=null!==(n=t.RGBA16F)&&void 0!==n?n:o.RGBA;o.texImage2D(o.TEXTURE_2D,0,l,e,i,0,o.RGBA,s,null);const c=t.createFramebuffer(e,i,!1,!1);return c.colorAttachment.set(a),c}function Pn(t,i){return i.colorRampTexture||(i.colorRampTexture=new e.T(t,i.colorRamp,t.gl.RGBA)),i.colorRampTexture}function In(t,i,r,n,o,a,s,l){let c=256;if(o.stepInterpolant){const n=i.getSource().maxzoom,o=s.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-s.canonical.z):1;c=e.ak(e.cb(a.maxLineLength/e.a5*1024*o),256,r.maxTextureSize)}return l.gradient=e.cc({expression:o.gradientExpression(),evaluationKey:"lineProgress",resolution:c,image:l.gradient||void 0,clips:a.lineClipsArray}),l.texture?l.texture.update(l.gradient):l.texture=new e.T(r,l.gradient,n.RGBA),l.version=o.gradientVersion,l.texture}function Mn(t,e,i,r,n){t.activeTexture.set(e.TEXTURE0),i.imageAtlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE),r.updatePaintBuffers(n)}function En(t,e,i,r,n,o){(n||t.lineAtlas.dirty)&&(e.activeTexture.set(i.TEXTURE0),t.lineAtlas.bind(e)),r.updatePaintBuffers(o)}function Cn(t,e,i,r,n,o,a){const s=o.gradients[n.id];let l=s.texture;n.gradientVersion!==s.version&&(l=In(t,e,i,r,n,o,a,s)),i.activeTexture.set(r.TEXTURE0),l.bind(n.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}function An(t,e,i,r,n,o,a,s,l){const c=o.gradients[n.id];let h=c.texture;n.gradientVersion!==c.version&&(h=In(t,e,i,r,n,o,a,c)),i.activeTexture.set(r.TEXTURE0),h.bind(n.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE),i.activeTexture.set(r.TEXTURE1),t.lineAtlas.bind(i),s.updatePaintBuffers(l)}function Dn(t,e,i,r,n){if(!i||!r||!r.imageAtlas)return;const o=r.imageAtlas.patternPositions;let a=o[i.to.toString()],s=o[i.from.toString()];if(!a&&s&&(a=s),!s&&a&&(s=a),!a||!s){const t=n.getPaintProperty(e);a=o[t],s=o[t]}a&&s&&t.setConstantPatternPositions(a,s)}function zn(t,i,r,n,o,a,s,l){const c=t.context.gl,h="fill-pattern",u=r.paint.get(h),d=u&&u.constantOr(1),p=r.getCrossfadeParameters();let f,m,g,_,y;const v=t.transform,x=r.paint.get("fill-translate"),b=r.paint.get("fill-translate-anchor");s?(m=d&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",f=c.LINES):(m=d?"fillPattern":"fill",f=c.TRIANGLES);const w=u.constantOr(null);for(const T of n){const n=i.getTile(T);if(d&&!n.patternsLoaded())continue;const u=n.getBucket(r);
1if(!u)continue;const S=u.programConfigurations.get(r.id),P=t.useProgram(m,S),I=t.style.map.terrain&&t.style.map.terrain.getTerrainData(T);d&&(t.context.activeTexture.set(c.TEXTURE0),n.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),S.updatePaintBuffers(p)),Dn(S,h,w,n,r);const M=v.getProjectionData({overscaledTileID:T,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),E=e.aL(v,n,x,b);if(s){_=u.indexBuffer2,y=u.segments2;const e=[c.drawingBufferWidth,c.drawingBufferHeight];g="fillOutlinePattern"===m&&d?Ji(t,p,n,e,E):Ki(e,E)}else _=u.indexBuffer,y=u.segments,g=d?Yi(t,p,n,E):{u_fill_translate:E};const C=t.stencilModeForClipping(T);P.draw(t.context,f,o,C,a,ni.backCCW,g,I,M,r.id,u.layoutVertexBuffer,_,y,r.paint,t.transform.zoom,S)}}function kn(t,i,r,n,o,a,s,l){const c=t.context,h=c.gl,u="fill-extrusion-pattern",d=r.paint.get(u),p=d.constantOr(1),f=r.getCrossfadeParameters(),m=r.paint.get("fill-extrusion-opacity"),g=d.constantOr(null),_=t.transform;for(const y of n){const n=i.getTile(y),d=n.getBucket(r);if(!d)continue;const v=t.style.map.terrain&&t.style.map.terrain.getTerrainData(y),x=d.programConfigurations.get(r.id),b=t.useProgram(p?"fillExtrusionPattern":"fillExtrusion",x);p&&(t.context.activeTexture.set(h.TEXTURE0),n.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),x.updatePaintBuffers(f));const w=_.getProjectionData({overscaledTileID:y,applyGlobeMatrix:!l,applyTerrainMatrix:!0});Dn(x,u,g,n,r);const T=e.aL(_,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),S=r.paint.get("fill-extrusion-vertical-gradient"),P=p?Hi(t,S,m,T,y,f,n):Xi(t,S,m,T);b.draw(c,c.gl.TRIANGLES,o,a,s,ni.backCCW,P,v,w,r.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,r.paint,t.transform.zoom,x,t.style.map.terrain&&d.centroidVertexBuffer)}}function Rn(t,e,i,r,n,o,a,s,l){var c;const h=t.style.projection,u=t.context,d=t.transform,p=u.gl,f=["#define NUM_ILLUMINATION_SOURCES ".concat(i.paint.get("hillshade-highlight-color").values.length)],m=t.useProgram("hillshade",null,!1,f),g=!t.options.moving;for(const _ of r){const r=e.getTile(_),f=r.fbo;if(!f)continue;const y=h.getMeshFromTileID(u,_.canonical,s,!0,"raster"),v=null===(c=t.style.map.terrain)||void 0===c?void 0:c.getTerrainData(_);u.activeTexture.set(p.TEXTURE0),p.bindTexture(p.TEXTURE_2D,f.colorAttachment.get());const x=d.getProjectionData({overscaledTileID:_,aligned:g,applyGlobeMatrix:!l,applyTerrainMatrix:!0});m.draw(u,p.TRIANGLES,o,n[_.overscaledZ],a,ni.backCCW,nr(t,r,i),v,x,i.id,y.vertexBuffer,y.indexBuffer,y.segments)}}function Fn(t,i,r,n,o,a,s,l,c){var h;const u=t.style.projection,d=t.context,p=t.transform,f=d.gl,m=t.useProgram("colorRelief"),g=!t.options.moving,_="nearest"===r.paint.get("resampling")?f.NEAREST:f.LINEAR;let y=!0,v=0;for(const x of n){const n=i.getTile(x),b=n.dem;if(y){const t=f.getParameter(f.MAX_TEXTURE_SIZE),{elevationTexture:e,colorTexture:i}=r.getColorRampTextures(d,t,b.getUnpackVector());d.activeTexture.set(f.TEXTURE1),e.bind(f.NEAREST,f.CLAMP_TO_EDGE),d.activeTexture.set(f.TEXTURE4),i.bind(f.LINEAR,f.CLAMP_TO_EDGE),y=!1,v=e.size[0]}if(!b||!b.data)continue;const w=b.stride,T=b.getPixels();if(d.activeTexture.set(f.TEXTURE0),d.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||t.getTileTexture(w),n.demTexture){const t=n.demTexture;t.update(T,{premultiply:!1}),t.bind(_,f.CLAMP_TO_EDGE)}else n.demTexture=new e.T(d,T,f.RGBA,{premultiply:!1}),n.demTexture.bind(_,f.CLAMP_TO_EDGE);const S=u.getMeshFromTileID(d,x.canonical,l,!0,"raster"),P=null===(h=t.style.map.terrain)||void 0===h?void 0:h.getTerrainData(x),I=p.getProjectionData({overscaledTileID:x,aligned:g,applyGlobeMatrix:!c,applyTerrainMatrix:!0});m.draw(d,f.TRIANGLES,a,o[x.overscaledZ],s,ni.backCCW,sr(r,n.dem,v),P,I,r.id,S.vertexBuffer,S.indexBuffer,S.segments)}}const Ln=[new e.P(0,0),new e.P(e.a5,0),new e.P(e.a5,e.a5),new e.P(0,e.a5)];function Bn(t,e,i,r,n,o,a,s){let l=arguments.length>8&&void 0!==arguments[8]&&arguments[8],c=arguments.length>9&&void 0!==arguments[9]&&arguments[9];const h=r[r.length-1].overscaledZ,u=t.context,d=u.gl,p=t.useProgram("raster"),f=t.transform,m=t.style.projection,g=t.colorModeForRenderPass(),_=!t.options.moving,y=i.paint.get("raster-opacity"),v="nearest"===i.paint.get("resampling")||"nearest"===i.paint.get("raster-resampling")?d.NEAREST:d.LINEAR,x=i.paint.get("raster-fade-duration"),b=!!t.style.map.terrain;for(const w of r){const r=t.getDepthModeForSublayer(w.overscaledZ-h,1===y?oi.ReadWrite:oi.ReadOnly,d.LESS),T=e.getTile(w);u.activeTexture.set(d.TEXTURE0),T.texture.bind(v,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST),u.activeTexture.set(d.TEXTURE1);const{parentTile:S,parentScaleBy:P,parentTopLeft:I,fadeValues:M}=On(T,e,x,b);T.fadeOpacity=M.tileOpacity,S?(S.fadeOpacity=M.parentTileOpacity,S.texture.bind(v,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST)):T.texture.bind(v,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST),T.texture.useMipmap&&u.extTextureFilterAnisotropic&&t.transform.pitch>t.options.anisotropicFilterPitch&&d.texParameterf(d.TEXTURE_2D,u.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,u.extTextureFilterAnisotropicMax);const E=t.style.map.terrain&&t.style.map.terrain.getTerrainData(w),C=f.getProjectionData({overscaledTileID:w,aligned:_,applyGlobeMatrix:!c,applyTerrainMatrix:!0}),A=mr(I,P,M.fadeMix,i,s),D=m.getMeshFromTileID(u,w.canonical,o,a,"raster");p.draw(u,d.TRIANGLES,r,n?n[w.overscaledZ]:si.disabled,g,l?ni.frontCCW:ni.backCCW,A,E,C,i.id,D.vertexBuffer,D.indexBuffer,D.segments)}}function On(t,i,r,n){const o={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(0===r||n)return o;if(t.fadingParentID){const n=i.getLoadedTile(t.fadingParentID);if(!n)return o;
vendor: 4,848 bytes, line 1
1const a=Math.pow(2,n.tileID.overscaledZ-t.tileID.overscaledZ),s=[t.tileID.canonical.x*a%1,t.tileID.canonical.y*a%1],l=function(t,i,r){const n=c(),o=(n-i.timeAdded)/r,a=t.fadingDirection===mt.Incoming,s=e.ak((n-t.timeAdded)/r,0,1),l=e.ak(1-o,0,1),h=a?s:l;return{tileOpacity:h,parentTileOpacity:a?l:s,fadeMix:{opacity:1,mix:1-h}}}(t,n,r);return{parentTile:n,parentScaleBy:a,parentTopLeft:s,fadeValues:l}}if(t.selfFading){const i=function(t,i){const r=(c()-t.timeAdded)/i,n=e.ak(r,0,1);return{tileOpacity:n,fadeMix:{opacity:n,mix:0}}}(t,r);return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:i}}return o}const Vn=new e.bm(1,0,0,1),jn=new e.bm(0,1,0,1),Nn=new e.bm(0,0,1,1),Un=new e.bm(1,0,1,1),Gn=new e.bm(0,1,1,1);function Zn(t,e,i,r){Wn(t,0,e+i/2,t.transform.width,i,r)}function qn(t,e,i,r){Wn(t,e-i/2,0,i,t.transform.height,r)}function Wn(t,e,i,r,n,o){const a=t.context,s=a.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*t.pixelRatio,i*t.pixelRatio,r*t.pixelRatio,n*t.pixelRatio),a.clear({color:o}),s.disable(s.SCISSOR_TEST)}function Xn(t,i,r){const n=t.context,o=n.gl,a=t.useProgram("debug"),s=oi.disabled,l=si.disabled,c=t.colorModeForRenderPass(),h="$debug",u=t.style.map.terrain&&t.style.map.terrain.getTerrainData(r);n.activeTexture.set(o.TEXTURE0);const d=i.getTileByID(r.key).latestRawTileData,p=Math.floor((d&&d.byteLength||0)/1024),f=i.getTile(r).tileSize,m=512/Math.min(f,512)*(r.overscaledZ/t.transform.zoom)*.5;let g=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(g+=" => ".concat(r.overscaledZ)),function(t,e){t.initDebugOverlayCanvas();const i=t.debugOverlayCanvas,r=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,i.width,i.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,"".concat(g," ").concat(p,"kB"));const _=t.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});a.draw(n,o.TRIANGLES,s,l,ii.alphaBlended,ni.disabled,er(e.bm.transparent,m),null,_,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),a.draw(n,o.LINE_STRIP,s,l,c,ni.disabled,er(e.bm.red),u,_,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function Hn(t,e,i,r){const{isRenderingGlobe:n}=r,o=t.context,a=o.gl,s=t.transform,l=t.colorModeForRenderPass(),c=t.getDepthModeFor3D(),h=t.useProgram("terrain");o.bindFramebuffer.set(null),o.viewport.set([0,0,t.width,t.height]);for(const u of i){const i=e.getTerrainMesh(u.tileID),r=t.renderToTexture.getTexture(u),d=e.getTerrainData(u.tileID);o.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r.texture);const p=e.getMeshFrameDelta(s.zoom),f=s.calculateFogMatrix(u.tileID.toUnwrapped()),m=Ui(p,f,t.style.sky,s.pitch,n),g=s.getProjectionData({overscaledTileID:u.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});h.draw(o,a.TRIANGLES,c,si.disabled,l,ni.backCCW,m,d,g,"terrain",i.vertexBuffer,i.indexBuffer,i.segments)}}function Yn(t,i){if(!i.mesh){const r=new e.aT;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);const n=new e.aV;n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),i.mesh=new Ve(t.createVertexBuffer(r,je.members),t.createIndexBuffer(n),e.aU.simpleSegment(0,0,r.length,n.length))}return i.mesh}class Kn{constructor(t,i){this.context=new dn(t),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.ao(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=Vt.maxOverzooming+Vt.maxUnderzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Fe}resize(t,e,i){if(this.width=Math.floor(t*i),this.height=Math.floor(e*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const r of this.style._order)this.style._layers[r].resize()}setup(){const t=this.context,i=new e.aT;i.emplaceBack(0,0),i.emplaceBack(e.a5,0),i.emplaceBack(0,e.a5),i.emplaceBack(e.a5,e.a5),this.tileExtentBuffer=t.createVertexBuffer(i,je.members),this.tileExtentSegments=e.aU.simpleSegment(0,0,4,2);const r=new e.aT;r.emplaceBack(0,0),r.emplaceBack(e.a5,0),r.emplaceBack(0,e.a5),r.emplaceBack(e.a5,e.a5),this.debugBuffer=t.createVertexBuffer(r,je.members),this.debugSegments=e.aU.simpleSegment(0,0,4,5);const n=new e.ce;n.emplaceBack(0,0,0,0),n.emplaceBack(e.a5,0,e.a5,0),n.emplaceBack(0,e.a5,0,e.a5),n.emplaceBack(e.a5,e.a5,e.a5,e.a5),this.rasterBoundsBuffer=t.createVertexBuffer(n,ji.members),this.rasterBoundsSegments=e.aU.simpleSegment(0,0,4,2);const o=new e.aT;o.emplaceBack(0,0),o.emplaceBack(e.a5,0),o.emplaceBack(0,e.a5),o.emplaceBack(e.a5,e.a5),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(o,je.members),this.rasterBoundsSegmentsPosOnly=e.aU.simpleSegment(0,0,4,5);const a=new e.aT;
vendor: 17,112 bytes, line 1
1a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,je.members),this.viewportSegments=e.aU.simpleSegment(0,0,4,2);const s=new e.cf;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(s);const l=new e.aV;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(l);const c=this.context.gl;this.stencilClearMode=new si({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO),this.tileExtentMesh=new Ve(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const r=e.N();e.c4(r,0,this.width,this.height,0,0,1),e.Q(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]);const n={mainMatrix:r,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r};this.useProgram("clippingMask",null,!0).draw(t,i.TRIANGLES,oi.disabled,this.stencilClearMode,ii.disabled,ni.disabled,null,null,n,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e,i){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source,this.nextStencilID+e.length>256&&this.clearStencil();const r=this.context;r.setColorMode(ii.disabled),r.setDepthMode(oi.disabled);const n={};for(const o of e)n[o.key]=this.nextStencilID++;this._renderTileMasks(n,e,i,!0),this._renderTileMasks(n,e,i,!1),this._tileClippingMaskIDs=n}_renderTileMasks(t,e,i,r){const n=this.context,o=n.gl,a=this.style.projection,s=this.transform,l=this.useProgram("clippingMask");for(const c of e){const e=t[c.key],h=this.style.map.terrain&&this.style.map.terrain.getTerrainData(c),u=a.getMeshFromTileID(this.context,c.canonical,r,!0,"stencil"),d=s.getProjectionData({overscaledTileID:c,applyGlobeMatrix:!i,applyTerrainMatrix:!0});l.draw(n,o.TRIANGLES,oi.disabled,new si({func:o.ALWAYS,mask:0},e,255,o.KEEP,o.KEEP,o.REPLACE),ii.disabled,i?ni.disabled:ni.backCCW,null,h,d,"$clipping",u.vertexBuffer,u.indexBuffer,u.segments)}}_renderTilesDepthBuffer(){const t=this.context,e=t.gl,i=this.style.projection,r=this.transform,n=this.useProgram("depth"),o=this.getDepthModeFor3D(),a=At(r,{tileSize:r.tileSize});for(const s of a){const a=this.style.map.terrain&&this.style.map.terrain.getTerrainData(s),l=i.getMeshFromTileID(this.context,s.canonical,!0,!0,"raster"),c=r.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});n.draw(t,e.TRIANGLES,o,si.disabled,ii.disabled,ni.backCCW,null,a,c,"$clipping",l.vertexBuffer,l.indexBuffer,l.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,e=this.context.gl;return new si({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){const e=this.context.gl;return new si({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){const e=this.context.gl,i=t.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),r=i[i.length-1].overscaledZ,n=i[0].overscaledZ-r+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();const t={};for(let i=0;i<n;i++)t[i+r]=new si({func:e.GEQUAL,mask:255},i+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=n,[t,i]}return[{[r]:si.disabled},i]}stencilConfigForOverlapTwoPass(t){const e=this.context.gl,i=t.sort(((t,e)=>e.overscaledZ-t.overscaledZ)),r=i[i.length-1].overscaledZ,n=i[0].overscaledZ-r+1;if(this.clearStencil(),n>1){const t={},o={};for(let i=0;i<n;i++)t[i+r]=new si({func:e.GREATER,mask:255},n+1+i,255,e.KEEP,e.KEEP,e.REPLACE),o[i+r]=new si({func:e.GREATER,mask:255},1+i,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID=2*n+1,[t,o,i]}return this.nextStencilID=3,[{[r]:new si({func:e.GREATER,mask:255},2,255,e.KEEP,e.KEEP,e.REPLACE)},{[r]:new si({func:e.GREATER,mask:255},1,255,e.KEEP,e.KEEP,e.REPLACE)},i]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new ii([t.CONSTANT_COLOR,t.ONE],new e.bm(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?ii.unblended:ii.alphaBlended}getDepthModeForSublayer(t,e,i){if(!this.opaquePassEnabledForLayer())return oi.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new oi(i||this.context.gl.LEQUAL,e,[r,r])}getDepthModeFor3D(){return new oi(this.context.gl.LEQUAL,oi.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){var r,n;this.style=t,this.options=i,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(c()),this.imageManager.beginFrame();const o=this.style._order,a=this.style.tileManagers,s={},l={},h={},u={isRenderingToTexture:!1,isRenderingGlobe:(null===(r=t.projection)||void 0===r?void 0:r.transitionState)>0};for(const e in a){const t=a[e];t.used&&t.prepare(this.context),s[e]=t.getVisibleCoordinates(!1),l[e]=s[e].slice().reverse(),h[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<o.length;e++)if(this.style._layers[o[e]].is3D()){this.opaquePassCutoff=e;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const e of o){const t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;const i=l[t.source];("custom"===t.type||i.length)&&this.renderLayer(this,a[t.source],t,i,u)}if(null===(n=this.style.projection)||void 0===n||n.updateGPUdependent({context:this.context,useProgram:t=>this.useProgram(t)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?e.bm.black:e.bm.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(t,e){const i=t.context,r=i.gl,n=((t,e,i)=>{const r=Math.cos(e.rollInRadians),n=Math.sin(e.rollInRadians),o=bt(e),a=e.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:t.properties.get("sky-color"),u_horizon_color:t.properties.get("horizon-color"),u_horizon:[(e.width/2-o*n)*i,(e.height/2+o*r)*i],u_horizon_normal:[-n,r],u_sky_horizon_blend:t.properties.get("sky-horizon-blend")*e.height/2*i,u_sky_blend:a}})(e,t.style.map.transform,t.pixelRatio),o=new oi(r.LEQUAL,oi.ReadWrite,[0,1]),a=si.disabled,s=t.colorModeForRenderPass(),l=t.useProgram("sky"),c=Yn(i,e);l.draw(i,r.TRIANGLES,o,a,s,ni.disabled,n,null,void 0,"sky",c.vertexBuffer,c.indexBuffer,c.segments)}(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=o.length-1;this.currentLayer>=0;this.currentLayer--){const t=this.style._layers[o[this.currentLayer]],e=a[t.source],i=s[t.source];this._renderTileClippingMasks(t,i,!1),this.renderLayer(this,e,t,i,u)}this.renderPass="translucent";let d=!1;for(this.currentLayer=0;this.currentLayer<o.length;this.currentLayer++){const t=this.style._layers[o[this.currentLayer]],e=a[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t,u))continue;this.opaquePassEnabledForLayer()||d||(d=!0,u.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const i=("symbol"===t.type?h:l)[t.source];this._renderTileClippingMasks(t,s[t.source],!!this.renderToTexture),this.renderLayer(this,e,t,i,u)}if(u.isRenderingGlobe&&function(t,i,r){const n=t.context,o=n.gl,a=t.useProgram("atmosphere"),s=new oi(o.LEQUAL,oi.ReadOnly,[0,1]),l=t.transform,c=function(t,i){const r=t.properties.get("position"),n=[-r.x,-r.y,-r.z],o=e.ao(new Float64Array(16));return"map"===t.properties.get("anchor")&&(e.bd(o,o,i.rollInRadians),e.be(o,o,-i.pitchInRadians),e.bd(o,o,i.bearingInRadians),e.be(o,o,i.center.lat*Math.PI/180),e.bG(o,o,-i.center.lng*Math.PI/180)),e.cd(n,n,o),n}(r,t.transform),h=l.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),u=i.properties.get("atmosphere-blend")*h.projectionTransition;if(0===u)return;const d=xi(l.worldSize,l.center.lat),p=l.inverseProjectionMatrix,f=new Float64Array(4);f[3]=1,e.aE(f,f,l.modelViewProjectionMatrix),f[0]/=f[3],f[1]/=f[3],f[2]/=f[3],f[3]=1,e.aE(f,f,p),f[0]/=f[3],f[1]/=f[3],f[2]/=f[3],f[3]=1;const m=((t,e,i,r,n)=>({u_sun_pos:t,u_atmosphere_blend:e,u_globe_position:i,u_globe_radius:r,u_inv_proj_matrix:n}))(c,u,[f[0],f[1],f[2]],d,p),g=Yn(n,i);a.draw(n,o.TRIANGLES,s,si.disabled,ii.alphaBlended,ni.disabled,m,null,null,"atmosphere",g.vertexBuffer,g.indexBuffer,g.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const t=function(t,e){let i=null;const r=Object.values(t._layers).flatMap((i=>i.source&&!i.isHidden(e)?[t.tileManagers[i.source]]:[])),n=r.filter((t=>"vector"===t.getSource().type)),o=r.filter((t=>"vector"!==t.getSource().type)),a=t=>{(!i||i.getSource().maxzoom<t.getSource().maxzoom)&&(i=t)};return n.forEach((t=>a(t))),i||o.forEach((t=>a(t))),i}(this.style,this.transform.zoom);t&&function(t,e,i){for(let r=0;r<i.length;r++)Xn(t,e,i[r])}(this,t,t.getVisibleCoordinates())}this.options.showPadding&&function(t){const e=t.transform.padding;Zn(t,t.transform.height-(e.top||0),3,Vn),Zn(t,e.bottom||0,3,jn),qn(t,e.left||0,3,Nn),qn(t,t.transform.width-(e.right||0),3,Un);const i=t.transform.centerPoint;!function(t,e,i,r){Wn(t,e-1,i-10,2,20,r),Wn(t,e-10,i-1,20,2,r)}(t,i.x,t.transform.height-i.y,Gn)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;const i=this.terrainFacilitator.matrix,r=this.transform.modelViewProjectionMatrix;let n=this.terrainFacilitator.dirty;n||(n=t?!e.cg(i,r):!e.ch(i,r)),n||(n=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),n&&(e.ci(i,r),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,i){const r=t.context,n=r.gl,o=t.transform,a=ii.unblended,s=new oi(n.LEQUAL,oi.ReadWrite,[0,1]),l=i.tileManager.getRenderableTiles(),c=t.useProgram("terrainDepth");r.bindFramebuffer.set(i.getFramebuffer("depth").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:e.bm.transparent,depth:1});for(const e of l){const t=i.getTerrainMesh(e.tileID),l=i.getTerrainData(e.tileID),h=o.getProjectionData({overscaledTileID:e.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),u={u_ele_delta:i.getMeshFrameDelta(o.zoom)};c.draw(r,n.TRIANGLES,s,si.disabled,a,ni.backCCW,u,l,h,"terrain",t.vertexBuffer,t.indexBuffer,t.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,i){const r=t.context,n=r.gl,o=t.transform,a=ii.unblended,s=new oi(n.LEQUAL,oi.ReadWrite,[0,1]),l=i.getCoordsTexture(),c=i.tileManager.getRenderableTiles(),h=t.useProgram("terrainCoords");r.bindFramebuffer.set(i.getFramebuffer("coords").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:e.bm.transparent,depth:1}),i.coordsIndex=[];for(const e of c){const t=i.getTerrainMesh(e.tileID),c=i.getTerrainData(e.tileID);r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,l.texture);const u={u_terrain_coords_id:(255-i.coordsIndex.length)/255,u_texture:0,u_ele_delta:i.getMeshFrameDelta(o.zoom)},d=o.getProjectionData({overscaledTileID:e.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});h.draw(r,n.TRIANGLES,s,si.disabled,a,ni.backCCW,u,c,d,"terrain",t.vertexBuffer,t.indexBuffer,t.segments),i.coordsIndex.push(e.tileID.key)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,i,r,n,o){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||(n||[]).length)&&(this.id=r.id,e.cj(r)?function(t,i,r,n,o,a){if("translucent"!==t.renderPass)return;const{isRenderingToTexture:s}=a,l=si.disabled,c=t.colorModeForRenderPass();(r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,i,r,n,o,a,s,l,c){const h=i.transform,u=i.style.map.terrain,d="map"===o,p="map"===a;for(const f of t){const t=n.getTile(f),o=t.getBucket(r);if(!o||!o.text||!o.text.segments.get().length)continue;const a=e.av(o.textSizeData,h.zoom),m=e.aK(t,1,i.transform.zoom),g=Gt(d,i.transform,m),_="none"!==r.layout.get("icon-text-fit")&&o.hasIconData();if(a){const i=Math.pow(2,h.zoom-t.tileID.overscaledZ),r=u?(t,e)=>u.getElevation(f,t,e):null;yn(o,d,p,c,h,g,i,a,_,e.aL(h,t,s,l),f.toUnwrapped(),r)}}}(n,t,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),o),0!==r.paint.get("icon-opacity").constantOr(1)&&xn(t,i,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),l,c,s),0!==r.paint.get("text-opacity").constantOr(1)&&xn(t,i,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),l,c,s),i.map.showCollisionBoxes&&(fn(t,i,r,n,!0),fn(t,i,r,n,!1))}(t,i,r,n,this.style.placement.variableOffsets,o):e.ck(r)?function(t,i,r,n,o){if("translucent"!==t.renderPass)return;const{isRenderingToTexture:a}=o,s=r.paint.get("circle-opacity"),l=r.paint.get("circle-stroke-width"),c=r.paint.get("circle-stroke-opacity"),h=!r.layout.get("circle-sort-key").isConstant();if(0===s.constantOr(1)&&(0===l.constantOr(1)||0===c.constantOr(1)))return;const u=t.context,d=u.gl,p=t.transform,f=t.getDepthModeForSublayer(0,oi.ReadOnly),m=si.disabled,g=t.colorModeForRenderPass(),_=[],y=p.getCircleRadiusCorrection();for(let v=0;v<n.length;v++){const o=n[v],s=i.getTile(o),l=s.getBucket(r);if(!l)continue;const c=r.paint.get("circle-translate"),u=r.paint.get("circle-translate-anchor"),d=e.aL(p,s,c,u),f=l.programConfigurations.get(r.id),m=t.useProgram("circle",f),g=l.layoutVertexBuffer,x=l.indexBuffer,b=t.style.map.terrain&&t.style.map.terrain.getTerrainData(o),w={programConfiguration:f,program:m,layoutVertexBuffer:g,indexBuffer:x,uniformValues:Qi(t,s,r,d,y),terrainData:b,projectionData:p.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!a,applyTerrainMatrix:!0})};if(h){const t=l.segments.get();for(const i of t)_.push({segments:new e.aU([i]),sortKey:i.sortKey,state:w})}else _.push({segments:l.segments,sortKey:0,state:w})}h&&_.sort(((t,e)=>t.sortKey-e.sortKey));for(const e of _){const{programConfiguration:i,program:n,layoutVertexBuffer:o,indexBuffer:a,uniformValues:s,terrainData:l,projectionData:c}=e.state;n.draw(u,d.TRIANGLES,f,m,g,ni.backCCW,s,l,c,r.id,o,a,e.segments,r.paint,t.transform.zoom,i)}}(t,i,r,n,o):e.cl(r)?function(t,i,r,n,o){if(0===r.paint.get("heatmap-opacity"))return;const a=t.context,{isRenderingToTexture:s,isRenderingGlobe:l}=o;if(t.style.map.terrain){for(const e of n){const n=i.getTile(e);i.hasRenderableParent(e)||("offscreen"===t.renderPass?wn(t,n,r,e,l):"translucent"===t.renderPass&&Tn(t,r,e,s,l))}a.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,i,r,n){const o=t.context,a=o.gl,s=t.transform,l=si.disabled,c=new ii([a.ONE,a.ONE],e.bm.transparent,[!0,!0,!0,!0]);(function(t,i,r){const n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,i.width/4,i.height/4]);let o=r.heatmapFbos.get(e.ca);o?(n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer)):(o=Sn(t,i.width/4,i.height/4),r.heatmapFbos.set(e.ca,o))})(o,t,r),o.clear({color:e.bm.transparent});for(let e=0;e<n.length;e++){const h=n[e];if(i.hasRenderableParent(h))continue;const u=i.getTile(h),d=u.getBucket(r);if(!d)continue;const p=d.programConfigurations.get(r.id),f=t.useProgram("heatmap",p),m=s.getProjectionData({overscaledTileID:h,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),g=s.getCircleRadiusCorrection();f.draw(o,a.TRIANGLES,oi.disabled,l,c,ni.backCCW,ir(u,s.zoom,r.paint.get("heatmap-intensity"),g),null,m,r.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,r.paint,s.zoom,p)}o.viewport.set([0,0,t.width,t.height])}(t,i,r,n):"translucent"===t.renderPass&&function(t,i){const r=t.context,n=r.gl;r.setColorMode(t.colorModeForRenderPass());const o=i.heatmapFbos.get(e.ca);o&&(r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),r.activeTexture.set(n.TEXTURE1),Pn(r,i).bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,n.TRIANGLES,oi.disabled,si.disabled,t.colorModeForRenderPass(),ni.disabled,rr(t,i,0,1),null,null,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom))}(t,r)}
1(t,i,r,n,o):e.cm(r)?function(t,e,i,r,n){if("translucent"!==t.renderPass)return;const{isRenderingToTexture:o}=n,a=i.paint.get("line-opacity"),s=i.paint.get("line-width");if(0===a.constantOr(1)||0===s.constantOr(1))return;const l=t.getDepthModeForSublayer(0,oi.ReadOnly),c=t.colorModeForRenderPass(),h=i.paint.get("line-dasharray"),u=h.constantOr(1),d=i.paint.get("line-pattern"),p=d.constantOr(1),f=i.paint.get("line-gradient"),m=i.getCrossfadeParameters();let g;g=p?"linePattern":u&&f?"lineGradientSDF":u?"lineSDF":f?"lineGradient":"line";const _=t.context,y=_.gl,v=t.transform;let x=!0;for(const b of r){const r=e.getTile(b);if(p&&!r.patternsLoaded())continue;const n=r.getBucket(i);if(!n)continue;const a=n.programConfigurations.get(i.id),s=t.context.program.get(),w=t.useProgram(g,a),T=x||w.program!==s,S=t.style.map.terrain&&t.style.map.terrain.getTerrainData(b),P=d.constantOr(null),I=h&&h.constantOr(null);if(P&&r.imageAtlas){const t=r.imageAtlas,e=t.patternPositions[P.to.toString()],i=t.patternPositions[P.from.toString()];e&&i&&a.setConstantPatternPositions(e,i)}else if(I){const e="round"===i.layout.get("line-cap"),r=t.lineAtlas.getDash(I.to,e),n=t.lineAtlas.getDash(I.from,e);a.setConstantDashPositions(r,n)}const M=v.getProjectionData({overscaledTileID:b,applyGlobeMatrix:!o,applyTerrainMatrix:!0}),E=v.getPixelScale();let C;p?(C=hr(t,r,i,E,m),Mn(_,y,r,a,m)):u&&f?(C=dr(t,r,i,E,m,n.lineClipsArray.length),An(t,e,_,y,i,n,b,a,m)):u?(C=ur(t,r,i,E,m),En(t,_,y,a,T,m)):f?(C=cr(t,r,i,E,n.lineClipsArray.length),Cn(t,e,_,y,i,n,b)):C=lr(t,r,i,E);const A=t.stencilModeForClipping(b);w.draw(_,y.TRIANGLES,l,A,c,ni.disabled,C,S,M,i.id,n.layoutVertexBuffer,n.indexBuffer,n.segments,i.paint,t.transform.zoom,a,n.layoutVertexBuffer2),x=!1}}(t,i,r,n,o):e.cn(r)?function(t,i,r,n,o){const a=r.paint.get("fill-color"),s=r.paint.get("fill-opacity");if(0===s.constantOr(1))return;const{isRenderingToTexture:l}=o,c=t.colorModeForRenderPass(),h=r.paint.get("fill-pattern"),u=t.opaquePassEnabledForLayer()&&!h.constantOr(1)&&1===a.constantOr(e.bm.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(t.renderPass===u){const e=t.getDepthModeForSublayer(1,"opaque"===t.renderPass?oi.ReadWrite:oi.ReadOnly);zn(t,i,r,n,e,c,!1,l)}if("translucent"===t.renderPass&&r.paint.get("fill-antialias")){const e=t.getDepthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,oi.ReadOnly);zn(t,i,r,n,e,c,!0,l)}}(t,i,r,n,o):e.co(r)?function(t,e,i,r,n){const o=i.paint.get("fill-extrusion-opacity");if(0===o)return;const{isRenderingToTexture:a}=n;if("translucent"===t.renderPass){const n=new oi(t.context.gl.LEQUAL,oi.ReadWrite,t.depthRangeFor3D);if(1!==o||i.paint.get("fill-extrusion-pattern").constantOr(1))kn(t,e,i,r,n,si.disabled,ii.disabled,a),kn(t,e,i,r,n,t.stencilModeFor3D(),t.colorModeForRenderPass(),a);else{const o=t.colorModeForRenderPass();kn(t,e,i,r,n,si.disabled,o,a)}}}(t,i,r,n,o):e.cp(r)?function(t,i,r,n,o){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;const{isRenderingToTexture:a}=o,s=t.context,l=t.style.projection.useSubdivision,c=t.getDepthModeForSublayer(0,oi.ReadOnly),h=t.colorModeForRenderPass();if("offscreen"===t.renderPass)!function(t,i,r,n,o,a,s){const l=t.context,c=l.gl,h="nearest"===n.paint.get("resampling")?c.NEAREST:c.LINEAR;for(const u of r){const r=i.getTile(u),d=r.dem;if(!d||!d.data)continue;if(!r.needsHillshadePrepare)continue;
1const p=d.dim,f=d.stride,m=d.getPixels();if(l.activeTexture.set(c.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(f),r.demTexture){const t=r.demTexture;t.update(m,{premultiply:!1}),t.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else r.demTexture=new e.T(l,m,c.RGBA,{premultiply:!1}),r.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);l.activeTexture.set(c.TEXTURE0);let g=r.fbo;if(!g){const t=new e.T(l,{width:p,height:p,data:null},c.RGBA);t.bind(h,c.CLAMP_TO_EDGE),g=r.fbo=l.createFramebuffer(p,p,!0,!1),g.colorAttachment.set(t.texture)}l.bindFramebuffer.set(g.framebuffer),l.viewport.set([0,0,p,p]),t.useProgram("hillshadePrepare").draw(l,c.TRIANGLES,o,a,s,ni.disabled,or(r.tileID,d),null,null,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}(t,i,n,r,c,si.disabled,h),s.viewport.set([0,0,t.width,t.height]);else if("translucent"===t.renderPass)if(l){const[e,o,s]=t.stencilConfigForOverlapTwoPass(n);Rn(t,i,r,s,e,c,h,!1,a),Rn(t,i,r,s,o,c,h,!0,a)}else{const[e,o]=t.getStencilConfigForOverlapAndUpdateStencilID(n);Rn(t,i,r,o,e,c,h,!1,a)}}(t,i,r,n,o):e.cq(r)?function(t,e,i,r,n){if("translucent"!==t.renderPass)return;if(!r.length)return;const{isRenderingToTexture:o}=n,a=t.style.projection.useSubdivision,s=t.getDepthModeForSublayer(0,oi.ReadOnly),l=t.colorModeForRenderPass();if(a){const[n,a,c]=t.stencilConfigForOverlapTwoPass(r);Fn(t,e,i,c,n,s,l,!1,o),Fn(t,e,i,c,a,s,l,!0,o)}else{const[n,a]=t.getStencilConfigForOverlapAndUpdateStencilID(r);Fn(t,e,i,a,n,s,l,!1,o)}}(t,i,r,n,o):e.bR(r)?function(t,e,i,r,n){if("translucent"!==t.renderPass)return;if(0===i.paint.get("raster-opacity"))return;if(!r.length)return;const{isRenderingToTexture:o}=n,a=e.getSource(),s=t.style.projection.useSubdivision;if(a instanceof ot)Bn(t,e,i,r,null,!1,!1,a.tileCoords,a.flippedWindingOrder,o);else if(s){const[n,a,s]=t.stencilConfigForOverlapTwoPass(r);Bn(t,e,i,s,n,!1,!0,Ln,!1,o),Bn(t,e,i,s,a,!0,!0,Ln,!1,o)}else{const[n,a]=t.getStencilConfigForOverlapAndUpdateStencilID(r);Bn(t,e,i,a,n,!1,!0,Ln,!1,o)}}(t,i,r,n,o):e.cr(r)?function(t,e,i,r,n){const o=i.paint.get("background-color"),a=i.paint.get("background-opacity");if(0===a)return;const{isRenderingToTexture:s}=n,l=t.context,c=l.gl,h=t.style.projection,u=t.transform,d=u.tileSize,p=i.paint.get("background-pattern");if(t.isPatternMissing(p))return;const f=!p&&1===o.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==f)return;const m=si.disabled,g=t.getDepthModeForSublayer(0,"opaque"===f?oi.ReadWrite:oi.ReadOnly),_=t.colorModeForRenderPass(),y=t.useProgram(p?"backgroundPattern":"background"),v=r||At(u,{tileSize:d,terrain:t.style.map.terrain});p&&(l.activeTexture.set(c.TEXTURE0),t.imageManager.bind(t.context));const x=i.getCrossfadeParameters();for(const b of v){const e=u.getProjectionData({overscaledTileID:b,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),r=p?br(a,t,p,{tileID:b,tileSize:d},x):xr(a,o),n=t.style.map.terrain&&t.style.map.terrain.getTerrainData(b),f=h.getMeshFromTileID(l,b.canonical,!1,!0,"raster");y.draw(l,c.TRIANGLES,g,m,_,ni.backCCW,r,n,e,i.id,f.vertexBuffer,f.indexBuffer,f.segments)}}(t,0,r,n,o):e.cs(r)&&function(t,e,i,r){const{isRenderingGlobe:n}=r,o=t.context,a=i.implementation,s=t.style.projection,l=t.transform,c=l.getProjectionDataForCustomLayer(n),h={farZ:l.farZ,nearZ:l.nearZ,fov:l.fov*Math.PI/180,modelViewProjectionMatrix:l.modelViewProjectionMatrix,projectionMatrix:l.projectionMatrix,shaderData:{variantName:s.shaderVariantName,vertexShaderPrelude:"const float PI = 3.141592653589793;\nuniform mat4 u_projection_matrix;\n".concat(s.shaderPreludeCode.vertexSource),define:s.shaderDefine},defaultProjectionData:c},u=a.renderingMode?a.renderingMode:"2d";if("offscreen"===t.renderPass){const e=a.prerender;e&&(t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),e.call(a,o.gl,h),o.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),o.setStencilMode(si.disabled);const e="3d"===u?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,oi.ReadOnly);o.setDepthMode(e),a.render(o.gl,h),o.setDirty(),t.setBaseState(),o.bindFramebuffer.set(null)}}(t,0,r,o))}saveTileTexture(t){const e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i}useProgram(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];this.cache=this.cache||{};const n=!!this.style.map.terrain,o=this.style.projection,a=i?Be.projectionMercator:o.shaderPreludeCode,s=i?Ne:o.shaderDefine,l=t+(e?e.cacheKey:"")+"/".concat(i?Ue:o.shaderVariantName)+(this._showOverdrawInspector?"/overdraw":"")+(n?"/terrain":"")+(r?"/".concat(r.join("/")):"");return this.cache[l]||(this.cache[l]=new qi(this.context,Be[t],e,Tr[t],this._showOverdrawInspector,n,a,s,r)),this.cache[l]}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(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,e;if(this._tileTextures){for(const t in this._tileTextures){const e=this._tileTextures[t];if(e)for(const t of e)t.destroy()}this._tileTextures={}}if(this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&(null===(t=this.tileExtentMesh.vertexBuffer)||void 0===t||t.destroy()),this.tileExtentMesh&&(null===(e=this.tileExtentMesh.indexBuffer)||void 0===e||e.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(const t in this.cache){const e=this.cache[t];e&&e.program&&this.context.gl.deleteProgram(e.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}function Jn(t,e){var i=this;let r,n=!1,o=null,a=null;const s=()=>{o=null,n&&(t.apply(a,r),o=setTimeout(s,e),n=!1)};return function(){for(var t=arguments.length,e=new Array(t),l=0;l<t;l++)e[l]=arguments[l];return n=!0,a=i,r=e,o||s(),o}}class Qn{constructor(t){this._getCurrentHash=()=>{const t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map((t=>
vendor: 16,384 bytes, line 1
1t.split("="))).forEach((t=>{t[0]===this._hashName&&(e=t)})),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{const t=this._getCurrentHash();if(!this._isValidHash(t))return!1;const e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{const t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{const t=this._getCurrentHash();if(0===t.length)return;const e=t.join("/");let i=e;i.split("&").length>0&&(i=i.split("&")[0]),this._hashName&&(i="".concat(this._hashName,"=").concat(e));let r=window.location.hash.replace(i,"");r.startsWith("#&")?r=r.slice(0,1)+r.slice(2):"#"===r&&(r="");let n=window.location.href.replace(/(#.+)?$/,r);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=Jn(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()),this._removeHash(),delete this._map,this}getHashString(t){const e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,r),o=Math.round(e.lng*n)/n,a=Math.round(e.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=t?"/".concat(o,"/").concat(a,"/").concat(i):"".concat(i,"/").concat(a,"/").concat(o),(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+="/".concat(Math.round(l))),this._hashName){const t=this._hashName;let e=!1;const i=window.location.hash.slice(1).split("&").map((i=>{const r=i.split("=")[0];return r===t?(e=!0,"".concat(r,"=").concat(c)):i})).filter((t=>t));return e||i.push("".concat(t,"=").concat(c)),"#".concat(i.join("&"))}return"#".concat(c)}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new e.V(+t[2],+t[1])}catch(t){return!1}const i=+t[0],r=+(t[3]||0),n=+(t[4]||0);return i>=this._map.getMinZoom()&&i<=this._map.getMaxZoom()&&r>=-180&&r<=180&&n>=this._map.getMinPitch()&&n<=this._map.getMaxPitch()}}const $n={linearity:.3,easing:e.ct(0,0,.3,1)},to=e.e({deceleration:2500,maxSpeed:1400},$n),eo=e.e({deceleration:20,maxSpeed:1400},$n),io=e.e({deceleration:1e3,maxSpeed:360},$n),ro=e.e({deceleration:1e3,maxSpeed:90},$n),no=e.e({deceleration:1e3,maxSpeed:360},$n);class oo{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:c(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,e=c();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,roll:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)i.zoom+=e.zoomDelta||0,i.bearing+=e.bearingDelta||0,i.pitch+=e.pitchDelta||0,i.roll+=e.rollDelta||0,e.panDelta&&i.pan._add(e.panDelta),e.around&&(i.around=e.around),e.pinchAround&&(i.pinchAround=e.pinchAround);const r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,n={};if(i.pan.mag()){const o=so(i.pan.mag(),r,e.e({},to,t||{})),a=i.pan.mult(o.amount/i.pan.mag()),s=this._map.cameraHelper.handlePanInertia(a,this._map.transform);n.center=s.easingCenter,n.offset=s.easingOffset,ao(n,o)}if(i.zoom){const t=so(i.zoom,r,eo),o=e.cu(this._map.transform.zoom+t.amount,this._map.getZoomSnap(),t.amount);n.zoom=o,ao(n,t)}if(i.bearing){const t=so(i.bearing,r,io);n.bearing=this._map.transform.bearing+e.ak(t.amount,-179,179),ao(n,t)}if(i.pitch){const t=so(i.pitch,r,ro);n.pitch=this._map.transform.pitch+t.amount,ao(n,t)}if(i.roll){const t=so(i.roll,r,no);n.roll=this._map.transform.roll+e.ak(t.amount,-179,179),ao(n,t)}if(n.zoom||n.bearing){const t=void 0===i.pinchAround?i.around:i.pinchAround;n.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(n,{noMoveStart:!0})}}function ao(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function so(t,i,r){const{maxSpeed:n,linearity:o,deceleration:a}=r,s=e.ak(t*o/(i/1e3),-n,n),l=Math.abs(s)/(a*o);return{easing:r.easing,duration:1e3*l,amount:s*(l/2)}}class lo extends e.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};r=r instanceof MouseEvent?r:new MouseEvent(t,r);const o=h.mousePos(i.getCanvas(),r),a=i.unproject(o);super(t,e.e({point:o,lngLat:a,originalEvent:r},n)),this._defaultPrevented=!1,this.target=i}}class co extends e.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r){const n="touchend"===t?r.changedTouches:r.touches,o=h.touchPos(i.getCanvasContainer(),n),a=o.map((t=>i.unproject(t))),s=o.reduce(((t,e,i,r)=>t.add(e.div(r.length))),new e.P(0,0));super(t,{points:o,point:s,lngLats:a,lngLat:i.unproject(s),originalEvent:r}),this._defaultPrevented=!1}}class ho extends e.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class uo{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new ho(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new lo(t.type,this._map,t))}mouseup(t){this._map.fire(new lo(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new lo(t.type,this._map,t))}dblclick(t){return this._firePreventable(new lo(t.type,this._map,t))}mouseover(t){this._map.fire(new lo(t.type,this._map,t))}mouseout(t){this._map.fire(new lo(t.type,this._map,t))}touchstart(t){return this._firePreventable(new co(t.type,this._map,t))}touchmove(t){this._map.fire(new co(t.type,this._map,t))}touchend(t){this._map.fire(new co(t.type,this._map,t))}touchcancel(t){this._map.fire(new co(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class po{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new lo(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new lo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new lo(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class fo{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.screenPointToLocation(e.P.convert(t),this._map.terrain)}}class mo{constructor(t,e){this._map=t,this._tr=new fo(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1,e.boxZoom&&"object"==typeof e.boxZoom&&(this._boxZoomEnd=e.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(h.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const i=e;if(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)return;const r=this._startPos;this._lastPos=i,this._box||(this._box=h.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const n=Math.min(r.x,i.x),o=Math.max(r.x,i.x),a=Math.min(r.y,i.y),s=Math.max(r.y,i.y);h.setTransform(this._box,"translate(".concat(n,"px,").concat(a,"px)")),this._box.style.width=o-n+"px",this._box.style.height=s-a+"px"}mouseupWindow(t,i){if(!this._active)return;if(0!==t.button)return;const r=this._startPos,n=i;if(this.reset(),h.suppressClick(),r.x!==n.x||r.y!==n.y)return this._map.fire(new e.l("boxzoomend",{originalEvent:t})),this._boxZoomEnd?void this._boxZoomEnd(this._map,r,n,t):{cameraAnimation:t=>t.fitScreenCoordinates(r,n,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(h.remove(this._box),this._box=null),h.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.l(t,{originalEvent:i}))}}function go(t,e){if(t.length!==e.length)throw new Error("The number of touches and points are not equal - touches ".concat(t.length,", points ").concat(e.length));const i={};for(let r=0;r<t.length;r++)i[t[r].identifier]=e[r];return i}class _o{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,i,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){const i=new e.P(0,0);for(const e of t)i._add(e);return i.div(t.length)}(i),this.touches=go(r,i)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;const r=go(i,e);for(const n in this.touches){const t=r[n];(!t||t.dist(this.touches[n])>30)&&(this.aborted=!0)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class yo{constructor(t){this.singleTap=new _o(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){const r=this.singleTap.touchend(t,e,i);if(r){const e=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(r)<30;if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class vo{constructor(t){this._tr=new fo(t),this._zoomIn=new yo({numTouches:1,numTaps:2}),this._zoomOut=new yo({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,i,r){const n=this._zoomIn.touchend(t,i,r),o=this._zoomOut.touchend(t,i,r),a=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:e.cu(a.zoom+1,i.getZoomSnap()),around:a.unproject(n)},{originalEvent:t})}):o?(this._active=!0,t.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:e.cu(a.zoom-1,i.getZoomSnap()),around:a.unproject(o)},{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 xo{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(){const t=this._moveFunction(...arguments);if(t.bearingDelta||t.pitchDelta||t.rollDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(e)?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;const i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const r=Array.isArray(e)?e[0]:e;return!this._moved&&r.dist(i)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=r,this._move(i,r))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&h.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 bo=0,wo=2,To={[bo]:1,[wo]:2};class So{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const e=h.mouseButton(t);this._eventButton=e}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,e){const i=To[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton)}isValidEndEvent(t){return h.mouseButton(t)===this._eventButton}}class Po{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_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)}}class Io{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new So({checkCorrectEvent:()=>!0}),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Po;this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=e}_executeRelevantHandler(t,e,i){return t instanceof MouseEvent?e(t):"undefined"!=typeof TouchEvent&&t instanceof TouchEvent?i(t):void 0}startMove(t){this._executeRelevantHandler(t,(t=>this.mouseMoveStateManager.startMove(t)),(t=>this.oneFingerTouchMoveStateManager.startMove(t)))}endMove(t){this._executeRelevantHandler(t,(t=>this.mouseMoveStateManager.endMove(t)),(t=>this.oneFingerTouchMoveStateManager.endMove(t)))}isValidStartEvent(t){return this._executeRelevantHandler(t,(t=>this.mouseMoveStateManager.isValidStartEvent(t)),(t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t)))}isValidMoveEvent(t){return this._executeRelevantHandler(t,(t=>this.mouseMoveStateManager.isValidMoveEvent(t)),(t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t)))}isValidEndEvent(t){return this._executeRelevantHandler(t,(t=>this.mouseMoveStateManager.isValidEndEvent(t)),(t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t)))}}const Mo=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};class Eo{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(t,e,i){if(this._active){if(!this._shouldBePrevented(i.length))return t.preventDefault(),this._calculateTransform(t,e,i);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,r){r.length>0&&(this._active=!0);const n=go(r,i),o=new e.P(0,0),a=new e.P(0,0);let s=0;for(const e in n){const t=n[e],i=this._touches[e];i&&(o._add(t),a._add(t.sub(i)),s++,n[e]=t)}if(this
vendor: 4,544 bytes, line 1
1._touches=n,this._shouldBePrevented(s)||!a.mag())return;const l=a.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Co{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){if(!this._firstTwoTouches)return;t.preventDefault();const[r,n]=this._firstTwoTouches,o=Ao(i,e,r),a=Ao(i,e,n);if(!o||!a)return;const s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;const[r,n]=this._firstTwoTouches,o=Ao(i,e,r),a=Ao(i,e,n);o&&a||(this._active&&h.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Ao(t,e,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return e[r]}function Do(t,e){return Math.log(t/e)/Math.LN2}class zo extends Co{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){const i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Do(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Do(this._distance,i),pinchAround:e}}}function ko(t,e){return 180*t.angleWith(e)/Math.PI}class Ro extends Co{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,e,i){const r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ko(this._vector,r),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const e=25/(Math.PI*this._minDiameter)*360,i=ko(t,this._startVector);return Math.abs(i)<e}}function Fo(t){return Math.abs(t.y)>Math.abs(t.x)}class Lo extends Co{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,i){super.touchstart(t,e,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,Fo(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const r=t[0].sub(this._lastPoints[0]),n=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(r,n,i.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+n.y)/2*-.5}):void 0}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;const r=t.mag()>=2,n=e.mag()>=2;if(!r&&!n)return;if(!r||!n)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const o=t.y>0==e.y>0;return Fo(t)&&Fo(e)&&o}}const Bo={panStep:100,bearingStep:15,pitchStep:10};class Oo{constructor(t){this._tr=new fo(t);const e=Bo;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let i=0,r=0,n=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:s=>{const l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:Vo,zoom:i?e.cu(l.zoom+i*(t.shiftKey?2:1),s.getZoomSnap()):l.zoom,bearing:l.bearing+r*this._bearingStep,pitch:l.pitch+n*this._pitchStep,offset:[-o*this._panStep,-a*this._panStep],center:l.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 Vo(t){return t*(2-t)}const jo=4.000244140625,No=1/450;class Uo{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)}
vendor: 9,992 bytes, line 1
1,this._map=t,this._tr=new fo(t),this._triggerRenderFrame=e,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=No}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const i=c(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==e&&e%jo==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,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 i=h.mousePos(this._map.getCanvas(),t),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(e.V.convert(r.center)):i,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._tr.transform;if("number"==typeof this._lastExpectedZoom){const e=t.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=e),"number"==typeof this._targetZoom&&(this._targetZoom+=e)}if(0!==this._delta){const i="wheel"===this._type&&Math.abs(this._delta)>jo?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);const n="number"!=typeof this._targetZoom?t.scale:e.an(this._targetZoom),o=t.applyConstrain(t.getCameraLngLat(),e.aq(n*r)).zoom,a=this._map.getZoomSnap();if("wheel"===this._type&&a>0){const i=e.cu(t.zoom,a);this._targetZoom=e.cu(o,a,o-i)}else this._targetZoom=o;"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const i="number"!=typeof this._targetZoom?t.zoom:this._targetZoom,r=this._startZoom,n=this._easing;let o,a=!1;if("wheel"===this._type&&r&&n){const t=c()-this._lastWheelEventTime,s=Math.min((t+5)/200,1),l=n(s);o=e.G.number(r,i,l),s<1?this._frameId||(this._frameId=!0):a=!0}else o=i,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=o,{noInertia:!0,needsRenderFrame:!a,zoomDelta:o-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.cw;if(this._prevEase){const t=this._prevEase,r=(c()-t.start)/t.duration,n=t.easing(r+.01)-t.easing(r),o=.27/Math.sqrt(n*n+1e-4)*.01,a=Math.sqrt(.0729-o*o);i=e.ct(o,a,.25,1)}return this._prevEase={start:c(),duration:t,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Go{constructor(t,e){this._clickZoom=t,this._tapZoom=e}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 Zo{constructor(t){this._tr=new fo(t),this.reset()}reset(){this._active=!1}dblclick(t,i){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:e.cu(this._tr.zoom+(t.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.unproject(i)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class qo{constructor(){this._tap=new yo({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,e,i){if(!this._swipePoint)if(this._tapTime){const r=e[0],n=t.timeStamp-this._tapTime<500,o=this._tapPoint.dist(r)<30;n&&o?i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,e,i)}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const r=e[0],n=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{const r=this._tap.touchend(t,e,i);r&&(this._tapTime=t.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Wo{constructor(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i}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 Xo{constructor(t,e,i,r){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=e,this._mousePitch=i,this._mouseRoll=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class Ho{constructor(t,e,i,r){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=r,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()}}class Yo{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=h.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=e,this._container.appendChild(r);const n=document.createElement("div");n.className="maplibregl-mobile-message",n.textContent=i,this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(h.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,i){this._enabled&&(this._map.fire(new e.l("cooperativegestureprevented",{gestureType:t,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const Ko=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;class Jo extends e.l{}function Qo(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}class $o{get _ownerDocument(){var t;return(null===(t=this._el)||void 0===t?void 0:t.ownerDocument)||document}get _ownerWindow(){var t,e;return(null===(e=null===(t=this._el)||void 0===t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView)||window}constructor(t,i){this.handleWindowEvent=t=>{this.handleEvent(t,"".concat(t.type,"Window"))},this.handleEvent=(t,i)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;const r="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},o={},a={};for(const{handlerName:c,handler:u,allowed:d}of this._handlers){if(!u.isEnabled())continue;let s;if(this._blockedByActive(a,d,c))u.reset();else if(u[i||t.type]){if(e.cx(t,i||t.type)){const e=h.mousePos(this._map.getCanvas(),t);s=u[i||t.type](t,e)}else if(e.cy(t,i||t.type)){const e=this._getMapTouches(t.touches),r=h.touchPos(this._map.getCanvas(),e);s=u[i||t.type](t,r,e)}
1else e.cz(i||t.type)||(s=u[i||t.type](t));this.mergeHandlerResult(n,o,s,c,r),s&&s.needsRenderFrame&&this._triggerRenderFrame()}(s||u.isActive())&&(a[c]=u)}const s={};for(const e in this._previousActiveHandlers)a[e]||(s[e]=r);this._previousActiveHandlers=a,(Object.keys(s).length||Qo(n))&&(this._changes.push([n,o,s]),this._triggerRenderFrame()),(Object.keys(a).length||Qo(n))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:l}=n;l&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],l(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new oo(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(const[e,n,o]of this._listeners)h.addEventListener(e,n,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,o)}destroy(){for(const[t,e,i]of this._listeners)h.removeEventListener(t,e,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){const i=this._map,r=i.getCanvasContainer();this._add("mapEvent",new uo(i,t));const n=i.boxZoom=new mo(i,t);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();const o=i.cooperativeGestures=new Yo(i,t.cooperativeGestures);this._add("cooperativeGestures",o),t.cooperativeGestures&&o.enable();const a=new vo(i),s=new Zo(i);i.doubleClickZoom=new Go(s,a),this._add("tapZoom",a),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&i.doubleClickZoom.enable();const l=new qo;this._add("tapDragZoom",l);const c=i.touchPitch=new Lo(i);this._add("touchPitch",c),t.interactive&&t.touchPitch&&i.touchPitch.enable(t.touchPitch);const u=()=>i.project(i.getCenter()),d=function(t,i){let{enable:r,clickTolerance:n,aroundCenter:o=!0,minPixelCenterThreshold:a=100,rotateDegreesPerPixelMoved:s=.8}=t;const l=new So({checkCorrectEvent:t=>0===h.mouseButton(t)&&t.ctrlKey||2===h.mouseButton(t)&&!t.ctrlKey});return new xo({clickTolerance:n,move:(t,r)=>{const n=i();if(o&&Math.abs(n.y-t.y)>a)return{bearingDelta:e.cv(new e.P(t.x,r.y),r,n)};let l=(r.x-t.x)*s;return o&&r.y<n.y&&(l=-l),{bearingDelta:l}},moveStateManager:l,enable:r,assignEvents:Mo})}(t,u),p=function(t){let{enable:e,clickTolerance:i,pitchDegreesPerPixelMoved:r=-.5}=t;const n=new So({checkCorrectEvent:t=>0===h.mouseButton(t)&&t.ctrlKey||2===h.mouseButton(t)});return new xo({clickTolerance:i,move:(t,e)=>({pitchDelta:(e.y-t.y)*r}),moveStateManager:n,enable:e,assignEvents:Mo})}(t),f=function(t,e){let{enable:i,clickTolerance:r,rollDegreesPerPixelMoved:n=.3}=t;const o=new So({checkCorrectEvent:t=>2===h.mouseButton(t)&&t.ctrlKey});return new xo({clickTolerance:r,move:(t,i)=>{const r=e();let o=(i.x-t.x)*n;return i.y<r.y&&(o=-o),{rollDelta:o}},moveStateManager:o,enable:i,assignEvents:Mo})}(t,u);i.dragRotate=new Xo(t,d,p,f),this._add("mouseRotate",d,["mousePitch"]),this._add("mousePitch",p,["mouseRotate","mouseRoll"]),this._add("mouseRoll",f,["mousePitch"]),t.interactive&&t.dragRotate&&i.dragRotate.enable();const m=function(t){let{enable:e,clickTolerance:i}=t;const r=new So({checkCorrectEvent:t=>0===h.mouseButton(t)&&!t.ctrlKey});return new xo({clickTolerance:i,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:r,enable:e,assignEvents:Mo})}(t),g=new Eo(t,i);i.dragPan=new Wo(r,m,g),this._add("mousePan",m),this._add("touchPan",g,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&i.dragPan.enable(t.dragPan);const _=new Ro,y=new zo;i.touchZoomRotate=new Ho(r,y,_,l),this._add("touchRotate",_,["touchPan","touchZoom"]),this._add("touchZoom",y,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&i.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new po(i));const v=i.scrollZoom=new Uo(i,(()=>
1this._triggerRenderFrame()));this._add("scrollZoom",v,["mousePan"]),t.interactive&&t.scrollZoom&&i.scrollZoom.enable(t.scrollZoom);const x=i.keyboard=new Oo(i);this._add("keyboard",x),t.interactive&&t.keyboard&&i.keyboard.enable()}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.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 Boolean(Ko(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,e,i){for(const r in t)if(r!==i&&(!e||e.indexOf(r)<0))return!0;return!1}_getMapTouches(t){const e=[];for(const i of t)this._el.contains(i.target)&&e.push(i);return e}mergeHandlerResult(t,i,r,n,o){if(!r)return;e.e(t,r);const a={handlerName:n,originalEvent:r.originalEvent||o};void 0!==r.zoomDelta&&(i.zoom=a),void 0!==r.panDelta&&(i.drag=a),void 0!==r.rollDelta&&(i.roll=a),void 0!==r.pitchDelta&&(i.pitch=a),void 0!==r.bearingDelta&&(i.rotate=a)}_applyChanges(){const t={},i={},r={};for(const[n,o,a]of this._changes)n.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(n.panDelta)),n.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+n.pitchDelta),n.rollDelta&&(t.rollDelta=(t.rollDelta||0)+n.rollDelta),void 0!==n.around&&(t.around=n.around),void 0!==n.pinchAround&&(t.pinchAround=n.pinchAround),n.noInertia&&(t.noInertia=n.noInertia),e.e(i,o),e.e(r,a);this._updateMapTransform(t,i,r),this._changes=[]}_updateMapTransform(t,e,i){const r=this._map,n=r._getTransformForUpdate(),o=r.terrain;if(!(Qo(t)||o&&this._terrainMovement))return this._fireEvents(e,i,!0);r._stop(!0);let{panDelta:a,zoomDelta:s,bearingDelta:l,pitchDelta:c,rollDelta:h,around:u,pinchAround:d}=t;void 0!==d&&(u=d),u=u||r.transform.centerPoint,o&&!n.isPointOnMapSurface(u)&&(u=n.centerPoint);const p={panDelta:a,zoomDelta:s,rollDelta:h,pitchDelta:c,bearingDelta:l,around:u};this._map.cameraHelper.useGlobeControls&&!n.isPointOnMapSurface(u)&&(u=n.centerPoint);const f=u.distSqr(n.centerPoint)<.01?n.center:n.screenPointToLocation(a?u.sub(a):u);this._handleMapControls({terrain:o,tr:n,deltasForHelper:p,preZoomAroundLoc:f,combinedEventsInProgress:e,panDelta:a}),r._applyUpdatedTransform(n),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,!0)}_handleMapControls(t){let{terrain:e,tr:i,deltasForHelper:r,preZoomAroundLoc:n,combinedEventsInProgress:o,panDelta:a}=t;const s=this._map.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(r,i),e)return s.useGlobeControls?(this._terrainMovement||!o.drag&&!o.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void s.handleMapControlsPan(r,i,n)):this._terrainMovement||!o.drag&&!o.zoom?void(o.drag&&this._terrainMovement&&a?i.setCenter(i.screenPointToLocation(i.centerPoint.sub(a))):s.handleMapControlsPan(r,i,n)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void s.handleMapControlsPan(r,i,n));s.handleMapControlsPan(r,i,n)}_fireEvents(t,i,r){const n=Ko(this._eventsInProgress),o=Ko(t),a={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(a["".concat(e,"start")]=i),this._eventsInProgress[e]=t[e]}!n&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in a)this._fireEvent(e,a[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i)}const l={};let c;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:r}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],c=i[t]||r,l["".concat(e,"end")]=c)}for(const e in l)this._fireEvent(e,l[e]);const h=Ko(this._eventsInProgress),u=(n||o)&&!h;if(u&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const t=this._map._getTransformForUpdate();
vendor: 18,264 bytes, line 1
1this._map.getCenterClampedToGround()&&t.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(t)}if(r&&u){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;!t||!t.essential&&s.prefersReducedMotion?(this._map.fire(new e.l("moveend",{originalEvent:c})),i(this._map.getBearing())&&this._map.resetNorth()):(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:c})),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new e.l(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((t=>{delete this._frameId,this.handleEvent(new Jo("renderFrame",{timeStamp:t})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class ta extends e.E{constructor(t,e,i){super(),this._renderFrameCallback=()=>{const t=Math.min((c()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=i.bearingSnap,this._zoomSnap=i.zoomSnap,this.cameraHelper=e,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(t,e){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=e}getCenter(){return new e.V(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,e){return this.jumpTo({elevation:t},e),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,i,r){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},i),r)}panTo(t,i,r){return this.easeTo(e.e({center:t},i),r)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,i,r){return this.easeTo(e.e({zoom:t},i),r)}zoomIn(t,i){return this.zoomTo(e.cu(this.getZoom()+1,this._zoomSnap),t,i),this}zoomOut(t,i){return this.zoomTo(e.cu(this.getZoom()-1,this._zoomSnap),t,i),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,i){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new e.l("movestart",i)).fire(new e.l("move",i)).fire(new e.l("moveend",i))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,i,r){return this.easeTo(e.e({bearing:t},i),r)}resetNorth(t,i){return this.rotateTo(0,e.e({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(e.e({bearing:0,pitch:0,roll:0,duration:1e3},t),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}getRoll(){return this.transform.roll}setRoll(t,e){return this.jumpTo({roll:t},e),this}cameraForBounds(t,e){t=X.convert(t).adjustAntiMeridian();const i=e&&e.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,e)}_cameraForBoxAndBearing(t,i,r,n){const o={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=e.e({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){const t=n.padding;n.padding={top:t,bottom:t,right:t,left:t}}const a=e.e(o,n.padding);n.padding=a;const s=this.transform,l=new X(t,i);return this.cameraHelper.cameraForBoxAndBearing(n,a,l,r,s)}fitBounds(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)}fitScreenCoordinates(t,i,r,n,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(e.P.convert(t)),this.transform.screenPointToLocation(e.P.convert(i)),r,n),n,o)}_fitInternal(t,i,r){return t?(delete(i=e.e(t,i)).padding,i.linear?this.easeTo(i,r):this.flyTo(i,r)):this}jumpTo(t,i){this.stop();const r=this._getTransformForUpdate();let n=!1,o=!1,a=!1;const s=r.zoom;this.cameraHelper.handleJumpToCenterZoom(r,t);const l=r.zoom!==s;return"elevation"in t&&r.elevation!==+t.elevation&&r.setElevation(+t.elevation),"bearing"in t&&r.bearing!==+t.bearing&&(n=!0,r.setBearing(+t.bearing)),"pitch"in t&&r.pitch!==+t.pitch&&(o=!0,r.setPitch(+t.pitch)),"roll"in t&&r.roll!==+t.roll&&(a=!0,r.setRoll(+t.roll)),null==t.padding||r.isPaddingEqual(t.padding)||r.setPadding(t.padding),this._applyUpdatedTransform(r),this.fire(new e.l("movestart",i)).fire(new e.l("move",i)),l&&this.fire(new e.l("zoomstart",i)).fire(new e.l("zoom",i)).fire(new e.l("zoomend",i)),n&&this.fire(new e.l("rotatestart",i)).fire(new e.l("rotate",i)).fire(new e.l("rotateend",i)),o&&this.fire(new e.l("pitchstart",i)).fire(new e.l("pitch",i)).fire(new e.l("pitchend",i)),a&&this.fire(new e.l("rollstart",i)).fire(new e.l("roll",i)).fire(new e.l("rollend",i)),this.fire(new e.l("moveend",i))}calculateCameraOptionsFromTo(t,i,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const o=e.a6.fromLngLat(t,i),a=e.a6.fromLngLat(r,n),s=a.x-o.x,l=a.y-o.y,c=a.z-o.z,h=Math.hypot(s,l,c);if(0===h)throw new Error("Can't calculate camera options with same From and To");const u=Math.hypot(s,l),d=e.aq(this.transform.cameraToCenterDistance/h/this.transform.tileSize),p=180*Math.atan2(s,-l)/Math.PI;let f=180*Math.acos(u/h)/Math.PI;return f=c<0?90-f:90+f,{center:a.toLngLat(),elevation:n,zoom:d,pitch:f,bearing:p}}calculateCameraOptionsFromCameraLngLatAltRotation(t,e,i,r,n){const o=this.transform.calculateCenterFromCameraLngLatAlt(t,e,i,r);return{center:o.center,elevation:o.elevation,zoom:o.zoom,bearing:i,pitch:r,roll:n}}easeTo(t,i){this._stop(!1,t.easeId),(!1===(t=e.e({offset:[0,0],duration:500,easing:e.cw},t)).animate||!t.essential&&s.prefersReducedMotion)&&(t.duration=0);const r=this._getTransformForUpdate(),n=this.getBearing(),o=r.pitch,a=r.roll,l="bearing"in t?this._normalizeBearing(t.bearing,n):n,c="pitch"in t?+t.pitch:o,h="roll"in t?this._normalizeBearing(t.roll,a):a,u="padding"in t?t.padding:r.padding,d=e.P.convert(t.offset);let p,f;t.around&&(p=e.V.convert(t.around),f=r.locationToScreenPoint(p));const m={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},g=this.cameraHelper.handleEaseTo(r,{bearing:l,pitch:c,roll:h,padding:u,around:p,aroundPoint:f,offsetAsPoint:d,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating=this._rotating||n!==l,this._pitching=this._pitching||c!==o,this._rolling=this._rolling||h!==a,this._padding=!r.isPaddingEqual(u),this._zooming=this._zooming||g.isZooming,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,m),this.terrain&&this._prepareElevation(g.elevationCenter),this._ease((e=>{g.easeFunc(e),this.terrain&&!t.freezeElevation&&this._updateElevation(e),this._applyUpdatedTransform(r),this._fireMoveEvents(i)}),(e=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i,e)}),t),this}_prepareEase(t,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._moving=!0,i||r.moving||this.fire(new e.l("movestart",t)),this._zooming&&!r.zooming&&this.fire(new e.l("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new e.l("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new e.l("pitchstart",t)),this._rolling&&!r.rolling&&this.fire(new e.l("rollstart",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){void 0!==this._elevationStart&&void 0!==this._elevationCenter||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&i!==this._elevationTarget){const e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(i-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=i}this.transform.setElevation(e.G.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};const e=t.getCameraLngLat(),i=t.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(e,t.zoom):0;if(i<r){const i=this.calculateCameraOptionsFromTo(e,r,t.center,t.elevation);return{pitch:i.pitch,zoom:i.zoom}}return{}}_applyUpdatedTransform(t){const e=[];if(e.push((t=>this._elevateCameraIfInsideTerrain(t))),this.transformCameraUpdate&&e.push((t=>this.transformCameraUpdate(t))),!e.length)return;const i=t.clone();for(const r of e){const t=i.clone(),{center:e,zoom:n,roll:o,pitch:a,bearing:s,elevation:l}=r(t);e&&t.setCenter(e),void 0!==l&&t.setElevation(l),void 0!==n&&t.setZoom(n),void 0!==o&&t.setRoll(o),void 0!==a&&t.setPitch(a),void 0!==s&&t.setBearing(s),i.apply(t,!1)}this.transform.apply(i,!1)}_fireMoveEvents(t){this.fire(new e.l("move",t)),this._zooming&&this.fire(new e.l("zoom",t)),this._rotating&&this.fire(new e.l("rotate",t)),this._pitching&&this.fire(new e.l("pitch",t)),this._rolling&&this.fire(new e.l("roll",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;const r=this._zooming,n=this._rotating,o=this._pitching,a=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,r&&this.fire(new e.l("zoomend",t)),n&&this.fire(new e.l("rotateend",t)),o&&this.fire(new e.l("pitchend",t)),a&&this.fire(new e.l("rollend",t)),this.fire(new e.l("moveend",t))}flyTo(t,i){if(!t.essential&&s.prefersReducedMotion){const r=e.U(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(r,i)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.cw},t);const r=this._getTransformForUpdate(),n=r.bearing,o=r.pitch,a=r.roll,l=r.padding,c="bearing"in t?this._normalizeBearing(t.bearing,n):n,h="pitch"in t?+t.pitch:o,u="roll"in t?this._normalizeBearing(t.roll,a):a,d="padding"in t?t.padding:r.padding,p=e.P.convert(t.offset);let f=r.centerPoint.add(p);const m=r.screenPointToLocation(f),g=this.cameraHelper.handleFlyTo(r,{bearing:c,pitch:h,roll:u,padding:d,locationAtOffset:m,offsetAsPoint:p,center:t.center,minZoom:t.minZoom,zoom:t.zoom});let _=t.curve;const y=Math.max(r.width,r.height),v=y/g.scaleOfZoom,x=g.pixelPathLength;"number"==typeof g.scaleOfMinZoom&&(_=Math.sqrt(y/g.scaleOfMinZoom/x*2));const b=_*_;function w(t){const e=(v*v-y*y+(t?-1:1)*b*b*x*x)/(2*(t?v:y)*b*x);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function S(t){return(Math.exp(t)+Math.exp(-t))/2}const P=w(!1);let I=function(t){return S(P)/S(P+_*t)},M=function(t){return y*((S(P)*(T(e=P+_*t)/S(e))-T(P))/b)/x;var e},E=(w(!0)-P)/_;if(Math.abs(x)<2e-6||!isFinite(E)){if(Math.abs(y-v)<1e-6)return this.easeTo(t,i);const e=v<y?-1:1;E=Math.abs(Math.log(v/y))/_,M=()=>0,I=t=>Math.exp(e*_*t)}return t.duration="duration"in t?+t.duration:1e3*E/("screenSpeed"in t?+t.screenSpeed/_:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=n!==c,this._pitching=h!==o,this._rolling=u!==a,this._padding=!r.isPaddingEqual(d),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(g.targetCenter),this._ease((s=>{const m=s*E,_=1/I(m),y=M(m);this._rotating&&r.setBearing(e.G.number(n,c,s)),this._pitching&&r.setPitch(e.G.number(o,h,s)),this._rolling&&r.setRoll(e.G.number(a,u,s)),this._padding&&(r.interpolatePadding(l,d,s),f=r.centerPoint.add(p)),g.easeFunc(s,_,y,f),this.terrain&&!t.freezeElevation&&this._updateElevation(s),this._applyUpdatedTransform(r),this._fireMoveEvents(i)}),(()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i)}),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){var i;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}return t||null===(i=this.handlers)||void 0===i||i.stop(!1),this}_ease(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this._easeStart=c(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){t=e.W(t,-180,180);const r=Math.abs(t-i);return Math.abs(t-360-i)<r&&(t-=360),Math.abs(t+360-i)<r&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(e.V.convert(t),this.transform):null}}const ea={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class ia{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ea;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=t=>{!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType&&"terrain"!==t.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?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.compact,this._container=h.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=h.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=h.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(){h.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,e){const i=this._map._getUIString("AttributionControl.".concat(e));t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((t=>"string"!=typeof t?"":t))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style.tileManagers;for(const r in e){const i=e[r];if(i.used||i.usedForTerrain){const e=i.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t=t.filter((t=>String(t).trim())),t.sort(((t,e)=>t.length-e.length)),t=t.filter(((e,i)=>{for(let r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return!1;return!0}));const i=t.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=h.sanitize(i),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class ra{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._updateCompact=()=>{const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.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=h.create("div","maplibregl-ctrl");const e=h.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){h.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class na{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,i=e?this._queue.concat(e):this._queue;
1for(const r of i)if(r.id===t)return void(r.cancelled=!0)}run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const e=this._currentlyRunning=this._queue;this._queue=[];for(const i of e)if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var oa=e.aR([{name:"a_pos3d",type:"Int16",components:3}]);class aa extends e.E{constructor(t){super(),this._lastTilesetChange=c(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(t,i){this.tileManager.update(t,i),this._renderableTilesKeys=[];const r={};for(const n of At(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i,calculateTileZoom:this.tileManager._source.calculateTileZoom}))r[n.key]=!0,this._renderableTilesKeys.push(n.key),this._tiles[n.key]||(n.terrainRttPosMatrix32f=new Float64Array(16),e.c4(n.terrainRttPosMatrix32f,0,e.a5,e.a5,0,0,1),this._tiles[n.key]=new gt(n,this.tileSize),this._lastTilesetChange=c());for(const e in this._tiles)r[e]||delete this._tiles[e]}freeRtt(t){for(const e in this._tiles){const i=this._tiles[e];(!t||i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&(i.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((t=>this.getTileByID(t)))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,e){return e?this._getTerrainCoordsForTileRanges(t,e):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){const i={};for(const r of this._renderableTilesKeys){const n=this._tiles[r].tileID,o=t.clone(),a=e.bh();if(n.canonical.equals(t.canonical))e.c4(a,0,e.a5,e.a5,0,0,1);else if(n.canonical.isChildOf(t.canonical)){const i=n.canonical.z-t.canonical.z,r=n.canonical.x-(n.canonical.x>>i<<i),o=n.canonical.y-(n.canonical.y>>i<<i),s=e.a5>>i;e.c4(a,0,s,s,0,0,1),e.O(a,a,[-r*s,-o*s,0])}else{if(!t.canonical.isChildOf(n.canonical))continue;{const i=t.canonical.z-n.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i),o=t.canonical.y-(t.canonical.y>>i<<i),s=e.a5>>i;e.c4(a,0,e.a5,e.a5,0,0,1),e.O(a,a,[r*s,o*s,0]),e.Q(a,a,[1/2**i,1/2**i,0])}}o.terrainRttPosMatrix32f=new Float32Array(a),i[r]=o}return i}_getTerrainCoordsForTileRanges(t,i){const r={};for(const n of this._renderableTilesKeys){const o=this._tiles[n].tileID;if(!this._isWithinTileRanges(o,i))continue;const a=t.clone(),s=e.bh();if(o.canonical.z===t.canonical.z){const i=t.canonical.x-o.canonical.x+t.wrap*(1<<t.canonical.z),r=t.canonical.y-o.canonical.y;e.c4(s,0,e.a5,e.a5,0,0,1),e.O(s,s,[i*e.a5,r*e.a5,0])}else if(o.canonical.z>t.canonical.z){const i=o.canonical.z-t.canonical.z,r=o.canonical.x-(o.canonical.x>>i<<i)+t.wrap*(1<<o.canonical.z),n=o.canonical.y-(o.canonical.y>>i<<i),a=t.canonical.x-(o.canonical.x>>i),l=t.canonical.y-(o.canonical.y>>i),c=e.a5>>i;e.c4(s,0,c,c,0,0,1),e.O(s,s,[-r*c+a*e.a5,-n*c+l*e.a5,0])}else{const i=t.canonical.z-o.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i)+t.wrap*(1<<t.canonical.z),n=t.canonical.y-(t.canonical.y>>i<<i),a=(t.canonical.x>>i)-o.canonical.x,l=(t.canonical.y>>i)-o.canonical.y,c=e.a5<<i;e.c4(s,0,c,c,0,0,1),e.O(s,s,[r*e.a5+a*c,n*e.a5+l*c,0])}a.terrainRttPosMatrix32f=new Float32Array(s),r[n]=a}return r}getSourceTile(t,e){const i=this.tileManager._source;let r=t.overscaledZ-this.deltaZoom;if(r>i.maxzoom&&(r=i.maxzoom),r<i.minzoom)return;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(r).key);let n=this.findTileInCaches(this._sourceTileCache[t.key]);if(!(null==n?void 0:n.dem)&&e)for(;r>=i.minzoom&&!(null==n?void 0:n.dem);)n=this.findTileInCaches(t.scaledTo(r--).key);return n}findTileInCaches(t){let e=this.tileManager.getTileByID(t);return e||(e=this.tileManager._outOfViewCache.getByKey(t),e)}anyTilesAfterTime(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return this._lastTilesetChange>=t}_isWithinTileRanges(t,e){const i=e[t.canonical.z];return!!i&&(t.wrap>i.minWrap||t.wrap<i.maxWrap||t.canonical.x>=i.minTileXWrapped&&t.canonical.x<=i.maxTileXWrapped&&t.canonical.y>=i.minTileY&&t.canonical.y<=i.maxTileY)}}class sa{constructor(t,e,i){this._meshCache={},this.painter=t,this.tileManager=new aa(e),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qual
vendor: 6,795 bytes, line 1
1ityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,i,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.a5;var o;const a=t.normalizeCoordinates(i,r,n);if(!a)return 0;const s=this.getTerrainData(a.tileID),l=null===(o=s.tile)||void 0===o?void 0:o.dem;if(!l)return 0;const c=e.cA([],[a.x/n*e.a5,a.y/n*e.a5],s.u_terrain_matrix),h=[c[0]*l.dim,c[1]*l.dim],u=Math.floor(h[0]),d=Math.floor(h[1]),p=h[0]-u,f=h[1]-d;return l.get(u,d)*(1-p)*(1-f)+l.get(u+1,d)*p*(1-f)+l.get(u,d+1)*(1-p)*f+l.get(u+1,d+1)*p*f}getElevationForLngLatZoom(t,i){if(!e.cB(i,t.wrap()))return 0;const{tileID:r,mercatorX:n,mercatorY:o}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(r,n%e.a5,o%e.a5,e.a5)}getElevationForLngLat(t,e){const i=At(e,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this});let r=0;for(const n of i)n.canonical.z>r&&(r=Math.min(n.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,r)}getElevation(t,i,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.a5;return this.getDEMElevation(t,i,r,n)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const t=this.painter.context,i=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new e.T(t,i,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new e.T(t,new e.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.ao([])}const i=this.tileManager.getSourceTile(t,!0);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){const t=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new e.T(t,i.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),i.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}const r=i&&i.toString()+i.tileID.key+t.key;if(r&&!this._demMatrixCache[r]){const r=this.tileManager.getSource().maxzoom;let n=t.canonical.z-i.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=r?n=t.canonical.z-r:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const o=t.canonical.x-(t.canonical.x>>n<<n),a=t.canonical.y-(t.canonical.y>>n<<n),s=e.cC(new Float64Array(16),[1/(e.a5<<n),1/(e.a5<<n),0]);e.O(s,s,[o*e.a5,a*e.a5,0]),this._demMatrixCache[t.key]={matrix:s,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:r?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(t){const i=this.painter,r=i.width/devicePixelRatio,n=i.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===n||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new e.T(i.context,{width:r,height:n,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new e.T(i.context,{width:r,height:n,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=i.context.createFramebuffer(r,n,!0,!1),this._fbo.depthAttachment.set(i.context.createRenderbuffer(i.context.gl.DEPTH_COMPONENT16,r,n))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let e=0,o=0;e<this._coordsTextureSize;e++)for(let t=0;t<this._coordsTextureSize;t++,o+=4)i[o+0]=255&t,i[o+1]=255&e,i[o+2]=t>>8<<4|e>>8,i[o+3]=0;const r=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),n=new e.T(t,r,t.gl.RGBA,{premultiply:!1});return n.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=n,n}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);const i=new Uint8Array(4),r=this.painter.context,n=r.gl,o=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),a=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);r.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),n.readPixels(o,s-a-1,1,1,n.RGBA,n.UNSIGNED_BYTE,i),r.bindFramebuffer.set(null);const l=i[0]+(i[2]>>4<<8),c=i[1]+((15&i[2])<<8),h=this.coordsIndex[255-i[3]],u=h&&this.tileManager.getTileByID(h);if(!u)return null;const d=this._coordsTextureSize,p=(1<<u.tileID.canonical.z)*d;return new e.a6((u.tileID.canonical.x*d+l)/p+u.tileID.wrap,(u.tileID.canonical.y*d+c)/p,this.getElevation(u.tileID,l,c,d))}depthAtPoint(t){const e=new Uint8Array(4),i=this.painter.context,r=i.gl;return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),r.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,e),i.bindFramebuffer.set(null),(e[0]/16777216+e[1]/65536+e[2]/256+e[3])/256}getTerrainMesh(t){var i;const r=(null===(i=this.painter.style.projection)||void 0===i?void 0:i.transitionState)>0,n=r&&0===t.canonical.y,o=r&&t.canonical.y===(1<<t.canonical.z)-1,a="m_".concat(n?"n":"","_").concat(o?"s":"");if(this._meshCache[a])return this._meshCache[a];const s=this.painter.context,l=new e.cD,c=new e.aV,h=this.meshSize,u=e.a5/h,d=h*h;for(let e=0;e<=h;e++)for(let t=0;t<=h;t++)l.emplaceBack(t*u,e*u,0);for(let e=0;e<d;e+=h+1)for(let t=0;t<h;t++)c.emplaceBack(t+e,h+t+e+1,h+t+e+2),c.emplaceBack(t+e,h+t+e+2,t+e+1);const p=l.length,f=p+(h+1),m=(h+1)*h,g=n?e.bo:0,_=n?0:1,y=o?e.bp:e.a5,v=o?0:1;for(let e=0;e<=h;e++)l.emplaceBack(e*u,g,_);for(let e=0;e<=h;e++)l.emplaceBack(e*u,y,v);for(let e=0;e<h;e++)c.emplaceBack(m+e,f+e,f+e+1),c.emplaceBack(m+e,f+e+1,m+e+1),c.emplaceBack(0+e,p+e+1,p+e),c.emplaceBack(0+e,0+e+1,p+e+1);const x=l.length,b=x+2*(h+1);for(const T of[0,1])for(let t=0;t<=h;t++)for(const i of[0,1])l.emplaceBack(T*e.a5,t*u,i);for(let e=0;e<2*h;e+=2)c.emplaceBack(x+e,x+e+1,x+e+3),c.emplaceBack(x+e,x+e+3,x+e+2),c.emplaceBack(b+e,b+e+3,b+e+1),c.emplaceBack(b+e,b+e+2,b+e+3);const w=new Ve(s.createVertexBuffer(l,oa.members),s.createIndexBuffer(c),e.aU.simpleSegment(0,0,l.length,c.length));return this._meshCache[a]=w,w}getMeshFrameDelta(t){return 2*Math.PI*e.bB/Math.pow(2,Math.max(t,0))
1/5}getMinTileElevationForLngLatZoom(t,i){var r;if(!e.cB(i,t.wrap()))return 0;const{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(t,i);return null!==(r=this.getMinMaxElevation(n).minElevation)&&void 0!==r?r:0}getMinMaxElevation(t){const e=this.getTerrainData(t).tile,i={minElevation:null,maxElevation:null};return e&&e.dem&&(i.minElevation=e.dem.min*this.exaggeration,i.maxElevation=e.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(t,i){const r=e.a6.fromLngLat(t.wrap()),n=(1<<i)*e.a5,o=r.x*n,a=r.y*n,s=Math.floor(o/e.a5),l=Math.floor(a/e.a5);return{tileID:new e.a2(i,0,i,s,l),mercatorX:o,mercatorY:a}}}class la{constructor(t,e,i){this._context=t,this._size=e,this._tileSize=i,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const i=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),r=new e.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return r.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),i.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),i.colorAttachment.set(r.texture),{id:t,fbo:i,texture:r,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((e=>t.id!==e)),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const e of this._recentlyUsed)if(!this._objects[e].inUse)return this._objects[e];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)&&!1===this._objects.some((t=>!t.inUse))}}const ca={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class ha{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new la(t.context,30,e.tileManager.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){var i,r;this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter((i=>!t._layers[i].isHidden(e))),this._coordsAscending={};for(const n in t.tileManagers){this._coordsAscending[n]={};const e=t.tileManagers[n].getVisibleCoordinates(),i=t.tileManagers[n].getSource(),r=i instanceof ot?i.terrainTileRanges:null;for(const t of e){const e=this.terrain.tileManager.getTerrainCoords(t,r);for(const t in e)this._coordsAscending[n][t]||(this._coordsAscending[n][t]=[]),this._coordsAscending[n][t].push(e[t])}}this._rttFingerprints={};for(const n of t._order){const e=t._layers[n],o=e.source;if(ca[e.type]&&!this._rttFingerprints[o]){this._rttFingerprints[o]={};const e=null!==(r=null===(i=t.tileManagers[o])||void 0===i?void 0:i.getState().revision)&&void 0!==r?r:0;for(const t in this._coordsAscending[o])this._rttFingerprints[o][t]="".concat(this._coordsAscending[o][t].map((t=>t.key)).sort().join(),"#").concat(e)}}for(const n of this._renderableTiles)for(const t in this._rttFingerprints){const e=this._rttFingerprints[t][n.tileID.key];e&&e!==n.rttFingerprint[t]&&(n.rtt=[])}}renderLayer(t,i){if(t.isHidden(this.painter.transform.zoom))return!1;const r=Object.assign(Object.assign({},i),{isRenderingToTexture:!0}),n=t.type,o=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(ca[n]&&(this._prevType&&ca[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(t.id),!a))return!0;if(ca[this._prevType]||ca[n]&&a){this._prevType=n;const t=this._stacks.length-1,i=this._stacks[t]||[];
1for(const n of this._renderableTiles){if(this.pool.isFull()&&(Hn(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(n),n.rtt[t]){const e=this.pool.getObjectForId(n.rtt[t].id);if(e.stamp===n.rtt[t].stamp){this.pool.useObject(e);continue}}const a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),n.rtt[t]={id:a.id,stamp:a.stamp},o.context.bindFramebuffer.set(a.fbo.framebuffer),o.context.clear({color:e.bm.transparent,stencil:0}),o.currentStencilSource=void 0;for(let t=0;t<i.length;t++){const e=o.style._layers[i[t]],s=e.source?this._coordsAscending[e.source][n.tileID.key]:[n.tileID];o.context.viewport.set([0,0,a.fbo.width,a.fbo.height]),o._renderTileClippingMasks(e,s,!0),o.renderLayer(o,o.style.tileManagers[e.source],e,s,r),e.source&&(n.rttFingerprint[e.source]=this._rttFingerprints[e.source][n.tileID.key])}}return Hn(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects(),ca[n]}return!1}}const ua={"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":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Drag to rotate map, click to reset north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},da=i,pa={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:ea,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:e.c.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,experimentalZoomLevelsToOverscale:void 0,anisotropicFilterPitch:20};let fa=class extends ta{get _ownerWindow(){var t,e;return(null===(e=null===(t=this._container)||void 0===t?void 0:t.ownerDocument)||void 0===e?void 0:e.defaultView)||window}constructor(t){var i,r;e.cE.mark(e.cF.create);const n=Object.assign(Object.assign(Object.assign({},pa),t),{canvasContextAttributes:Object.assign(Object.assign({},pa.canvasContextAttributes),t.canvasContextAttributes)});if(null!=n.minZoom&&null!=n.maxZoom&&n.minZoom>n.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=n.minPitch&&null!=n.maxPitch&&n.minPitch>n.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=n.minPitch&&n.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=n.maxPitch&&n.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const o=new Je,a=new ei;void 0!==n.minZoom&&o.setMinZoom(n.minZoom),void 0!==n.maxZoom&&o.setMaxZoom(n.maxZoom),void 0!==n.minPitch&&o.setMinPitch(n.minPitch),void 0!==n.maxPitch&&o.setMaxPitch(n.maxPitch),void 0!==n.renderWorldCopies&&o.setRenderWorldCopies(n.renderWorldCopies),null!==n.transformConstrain&&o.setConstrainOverride(n.transformConstrain),super(o,a,{bearingSnap:n.bearingSnap,zoomSnap:n.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new na,this._controls=[],this._mapId=e.ac(),this._lostContextStyle={style:null,images:null},this._contextLost=t=>{if(t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(const t of Object.values(this.style._layers))if("custom"===t.type&&console.warn("Custom layer with i
1d '".concat(t.id,"' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.")),t._listeners)for(const[e]of Object.entries(t._listeners))console.warn("Custom layer with id '".concat(t.id,"' had event listeners for event '").concat(e,"' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration."));this.style.destroy(),this.style=null,this.fire(new e.l("webglcontextlost",{originalEvent:t}))}else this.fire(new e.l("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&(this.style.imageManager.images=this._lostContextStyle.images),this._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),this.fire(new e.l("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=n.interactive,this._maxTileCacheSize=n.maxTileCacheSize,this._maxTileCacheZoomLevels=n.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},n.canvasContextAttributes),this._trackResize=!0===n.trackResize,this._bearingSnap=n.bearingSnap,this._zoomSnap=n.zoomSnap,this._centerClampedToGround=n.centerClampedToGround,this._refreshExpiredTiles=!0===n.refreshExpiredTiles,this._fadeDuration=n.fadeDuration,this._crossSourceCollisions=!0===n.crossSourceCollisions,this._collectResourceTiming=!0===n.collectResourceTiming,this._locale=Object.assign(Object.assign({},ua),n.locale),this._clickTolerance=n.clickTolerance,this._overridePixelRatio=n.pixelRatio,this._maxCanvasSize=n.maxCanvasSize,this._zoomLevelsToOverscale=n.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=n.transformCameraUpdate,this.transformConstrain=n.transformConstrain,this.cancelPendingTileRequestsWhileZooming=!0===n.cancelPendingTileRequestsWhileZooming,this.setAnisotropicFilterPitch(n.anisotropicFilterPitch),void 0!==n.reduceMotion&&(s.prefersReducedMotion=n.reduceMotion),this._imageQueueHandle=_.addThrottleControl((()=>this.isMoving())),this._requestManager=new y(n.transformRequest),this._container=this._resolveContainer(n.container),n.maxBounds&&this.setMaxBounds(n.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})),"undefined"!=typeof window&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new $o(this,n),this._hash=n.hash&&new Qn("string"==typeof n.hash&&n.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:n.center,elevation:n.elevation,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,roll:n.roll}),n.bounds&&(this.resize(),this.fitBounds(n.bounds,e.e({},n.fitBoundsOptions,{duration:0}))));const l="string"==typeof n.style||!("globe"===(null===(r=null===(i=n.style)||void 0===i?void 0:i.projection)||void 0===r?void 0:r.type));this.resize(null,l),this._localIdeographFontFamily=n.localIdeographFontFamily,this._validateStyle=n.validateStyle,n.style&&this.setStyle(n.style,{localIdeographFontFamily:n.localIdeographFontFamily}),n.attributionControl&&this.addControl(new ia("boolean"==typeof n.attributionControl?void 0:n.attributionControl)),n.maplibreLogo&&this.addControl(new ra,n.logoPosition),this.on("style.load",(()=>{if(l||this._resizeTransform(),this.transform.unmodified){const t=e.U(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(t)}})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.l("".concat(t.dataType,"data"),t))})),this.on("dataloading",(t=>{this.fire(new e.l("".concat(t.dataType,"dataloading"),t))})),this.on("dataabort",(t=>{this.fire(new e.l("sourcedataabort",t))}))}_getMapId(){return this._mapId}setGlobalStateProperty(t,e){return this.style.setGlobalStateProperty(t,e),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=t.onAdd(this);this._controls.push(t);const n=this._controlPositions[i];
1return-1!==i.indexOf("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}coveringTiles(t){return At(this.transform,t)}calculateCameraOptionsFromTo(t,e,i,r){return null==r&&this.terrain&&(r=this.terrain.getElevationForLngLat(i,this.transform)),super.calculateCameraOptionsFromTo(t,e,i,r)}resize(t){let i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(null!==this._lostContextStyle.style)return this;this._resizeInternal(i);const r=!this._moving;return r&&(this.stop(),this.fire(new e.l("movestart",t)).fire(new e.l("move",t))),this.fire(new e.l("resize",t)),r&&this.fire(new e.l("moveend",t)),this}_resizeInternal(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const[e,i]=this._containerDimensions(),r=this._getClampedPixelRatio(e,i);if(this._resizeCanvas(e,i,r),this.painter.resize(e,i,r),this.painter.overLimit()){const t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];const r=this._getClampedPixelRatio(e,i);this._resizeCanvas(e,i,r),this.painter.resize(e,i,r)}this._resizeTransform(t)}_resizeTransform(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];var e;const[i,r]=this._containerDimensions();this.transform.resize(i,r,t),null===(e=this._requestedCameraState)||void 0===e||e.resize(i,r,t)}_getClampedPixelRatio(t,e){const{0:i,1:r}=this._maxCanvasSize,n=this.getPixelRatio(),o=t*n,a=e*n;return Math.min(o>i?i/o:1,a>r?r/a:1)*n}getPixelRatio(){var t;return null!==(t=this._overridePixelRatio)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(X.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom){const i=this.transform.zoom,r=this._getTransformForUpdate();return r.setMinZoom(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.zoom&&this.fire(new e.l("zoomstart")).fire(new e.l("zoom")).fire(new e.l("zoomend")).fire(new e.l("movestart")).fire(new e.l("move")).fire(new e.l("moveend")),this}throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom){const i=this.transform.zoom,r=this._getTransformForUpdate();return r.setMaxZoom(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.zoom&&this.fire(new e.l("zoomstart")).fire(new e.l("zoom")).fire(new e.l("zoomend")).fire(new e.l("movestart")).fire(new e.l("move")).fire(new e.l("moveend")),this}throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch){const i=this.transform.pitch,r=this._getTransformForUpdate();return r.setMinPitch(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.pitch&&this.fire(new e.l("pitchstart")).fire(new e.l("pitch")).fire(new e.l("pitchend")).fire(new e.l("movestart")).fire(new e.l("move")).fire(new e.l("moveend")),this}throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>180)throw new Error("maxPitch must be less than or equal to 180");if(t>=this.transform.minPitch){const i=this.transform.pitch,r=this._getTransformForUpdate();return r.setMaxPitch(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.pitch&&this.fire(new e.l("pitchstart")).fire(new e.l("pitch")).fire(new e.l("pitchend")).fire(new e.l("movestart")).fire(new e.l("move")).fire(new e.l("moveend")),this}throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(t){if((t=null==t?20:t)>180)throw new Error("anisotropicFilterPitch must be less than or equal to 180");if(t<0)throw new Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=t,this._update()}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.setRenderWorldCopies(t),this._update()}setTransformConstrain(t){return this.transform.setConstrainOverride(t),this._update()}project(t){return this.transform.locationToScreenPoint(e.V.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.screenPointToLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}
vendor: 2,755 bytes, line 1
1_createDelegatedListener(t,e,i){if("mouseenter"===t||"mouseover"===t){let r=!1;const n=n=>{const o=e.filter((t=>this.getLayer(t))),a=0!==o.length?this.queryRenderedFeatures(n.point,{layers:o}):[];a.length?r||(r=!0,i.call(this,new lo(t,this,n.originalEvent,{features:a}))):r=!1};return{layers:e,listener:i,delegates:{mousemove:n,mouseout:()=>{r=!1}}}}if("mouseleave"===t||"mouseout"===t){let r=!1;const n=n=>{const o=e.filter((t=>this.getLayer(t)));(0!==o.length?this.queryRenderedFeatures(n.point,{layers:o}):[]).length?r=!0:r&&(r=!1,i.call(this,new lo(t,this,n.originalEvent)))},o=e=>{r&&(r=!1,i.call(this,new lo(t,this,e.originalEvent)))};return{layers:e,listener:i,delegates:{mousemove:n,mouseout:o}}}{const r=t=>{const r=e.filter((t=>this.getLayer(t))),n=0!==r.length?this.queryRenderedFeatures(t.point,{layers:r}):[];n.length&&(t.features=n,i.call(this,t),delete t.features)};return{layers:e,listener:i,delegates:{[t]:r}}}}_saveDelegatedListener(t,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,i){if(!this._delegatedListeners||!this._delegatedListeners[t])return;const r=this._delegatedListeners[t];for(let n=0;n<r.length;n++){const t=r[n];if(t.listener===i&&t.layers.length===e.length&&t.layers.every((t=>e.includes(t)))){for(const e in t.delegates)this.off(e,t.delegates[e]);return void r.splice(n,1)}}}on(t,e,i){if(void 0===i)return super.on(t,e);const r="string"==typeof e?[e]:e,n=this._createDelegatedListener(t,r,i);this._saveDelegatedListener(t,n);for(const o in n.delegates)this.on(o,n.delegates[o]);return{unsubscribe:()=>{this._removeDelegatedListener(t,r,i)}}}once(t,e,i){var r=this;if(void 0===i)return super.once(t,e);const n="string"==typeof e?[e]:e,o=this._createDelegatedListener(t,n,i);for(const a in o.delegates){const e=o.delegates[a];o.delegates[a]=function(){r._removeDelegatedListener(t,n,i),e(...arguments)}}this._saveDelegatedListener(t,o);for(const a in o.delegates)this.once(a,o.delegates[a]);return this}off(t,e,i){return void 0===i?super.off(t,e):(this._removeDelegatedListener(t,"string"==typeof e?[e]:e,i),this)}queryRenderedFeatures(t,i){if(!this.style)return[];let r;const n=t instanceof e.P||Array.isArray(t),o=n?t:[[0,0],[this.transform.width,this.transform.height]];if(i=i||(n?{}:t)||{},o instanceof e.P||"number"==typeof o[0])r=[e.P.convert(o)];else{const t=e.P.convert(o[0]),i=e.P.convert(o[1]);r=[t,new e.P(i.x,t.y),i,new e.P(t.x,i.y),t]}return this.style.queryRenderedFeatures(r,i,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,i){return!1!==(i=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._val
1idateStyle},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error("Missing UI string '".concat(t,"'"));return e}_updateStyle(t,e){var i,r;if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(t,e)));const n=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new Vi(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,n):this.style.loadJSON(t,e,n),this):(null===(r=null===(i=this.style)||void 0===i?void 0:i.projection)||void 0===r||r.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Vi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,i){if("string"==typeof t){const r=this._requestManager.transformRequest(t,"Style");e.j(r,new AbortController).then((t=>{this._updateDiff(t.data,i)})).catch((t=>{t&&this.fire(new e.k(t))}))}else"object"==typeof t&&this._updateDiff(t,i)}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(r){e.w("Unable to perform style diff: ".concat(r.message||r.error||r,".  Rebuilding the style from scratch.")),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){const i=this.style&&this.style.tileManagers[t];if(void 0!==i)return i.loaded();this.fire(new e.k(new Error("There is no tile manager with ID '".concat(t,"'"))))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){const i=this.style.tileManagers[t.source];if(!i)throw new Error("cannot load terrain, because there exists no source with ID: ".concat(t.source));null===this.terrain&&i.reload();for(const r in this.style._layers){const i=this.style._layers[r];"hillshade"===i.type&&i.source===t.source&&e.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."),"color-relief"===i.type&&i.source===t.source&&e.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new sa(this.painter,i,t),this.painter.renderToTexture=new ha(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=e=>{var i;"style"===e.dataType?this.terrain.tileManager.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),"image"===(null===(i=e.source)||void 0===i?void 0:i.type)?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(e.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.tileManager.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGroun
1d&&this.transform.setElevation(0);return this.fire(new e.l("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!==(e=null===(t=this.terrain)||void 0===t?void 0:t.options)&&void 0!==e?e:null}areTilesLoaded(){const t=this.style&&this.style.tileManagers;for(const e of Object.values(t))if(!e.areTilesLoaded())return!1;return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}setSourceTileLodParams(t,e,i){if(i){const r=this.getSource(i);if(!r)throw new Error('There is no source with ID "'.concat(i,'", cannot set LOD parameters'));r.calculateTileZoom=Mt(Math.max(1,t),Math.max(1,e))}else for(const r in this.style.tileManagers)this.style.tileManagers[r].getSource().calculateTileZoom=Mt(Math.max(1,t),Math.max(1,e));return this._update(!0),this}refreshTiles(t,i){const r=this.style.tileManagers[t];if(!r)throw new Error('There is no tile manager with ID "'.concat(t,'", cannot refresh tile'));void 0===i?r.reload(!0):r.refreshTiles(i.map((t=>new e.a9(t.z,t.x,t.y))))}addImage(t,i){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{pixelRatio:n=1,sdf:o=!1,stretchX:a,stretchY:l,content:c,textFitWidth:h,textFitHeight:u}=r;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||e.b(i))){if(void 0===i.width||void 0===i.height)return this.fire(new e.k(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:r,height:s,data:d}=i,p=i;return this.style.addImage(t,{data:new e.R({width:r,height:s},new Uint8Array(d)),pixelRatio:n,stretchX:a,stretchY:l,content:c,textFitWidth:h,textFitHeight:u,sdf:o,version:0,userImage:p}),p.onAdd&&p.onAdd(this,t),this}}{const{width:r,height:d,data:p}=s.getImageData(i);this.style.addImage(t,{data:new e.R({width:r,height:d},p),pixelRatio:n,stretchX:a,stretchY:l,content:c,textFitWidth:h,textFitHeight:u,sdf:o,version:0})}}updateImage(t,i){const r=this.style.getImage(t);if(!r)return this.fire(new e.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const n=i instanceof HTMLImageElement||e.b(i)?s.getImageData(i):i,{width:o,height:a,data:l}=n;if(void 0===o||void 0===a)return this.fire(new e.k(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(o!==r.data.width||a!==r.data.height)return this.fire(new e.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const c=!(i instanceof HTMLImageElement||e.b(i));return r.data.replace(l,c),this.style.updateImage(t,r),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.k(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return _.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)}setFilter(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.style.setFilter(t,e,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setPaintProperty(t,e,i,r),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setLayoutProperty(t,e,i,r),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,i,(t=>{t||this._update(!0)})),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,(t=>{t||this._update(!0)})),this}setLight(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setSky(t,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupResizeObserver(){var t;let e=!1;const i=Jn((t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())}),50),r=null!==(t=this._ownerWindow.ResizeObserver)&&void 0!==t?t:ResizeObserver;this._resizeObserver=new r((t=>{e?i(t):e=!0})),this._resizeObserver.observe(this._container)}
1_resolveContainer(t){if("string"==typeof t){const e=document.getElementById(t);if(!e)throw new Error("Container '".concat(t,"' not found."));return e}if(t instanceof HTMLElement)return t;if(t&&"object"==typeof t&&1===t.nodeType)return t;throw new Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){const t=this._container;t.classList.add("maplibregl-map");const e=this._canvasContainer=h.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=h.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const i=this._containerDimensions(),r=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],r);const n=this._controlContainer=h.create("div","maplibregl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((t=>{o[t]=h.create("div","maplibregl-ctrl-".concat(t," "),n)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*e),this._canvas.style.width="".concat(t,"px"),this._canvas.style.height="".concat(e,"px")}_setupPainter(){const t=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let e=null;this._canvas.addEventListener("webglcontextcreationerror",(i=>{e={requestedAttributes:t},i&&(e.statusMessage=i.statusMessage,e.type=i.type)}),{once:!0});let i=null;if(i=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,t):this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t),!i){const t="Failed to initialize WebGL";throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new Kn(i,this.transform),u.testSupport(i)}migrateProjection(t,i){super.migrateProjection(t,i),this.painter.transform=t,this.fire(new e.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){var i,r,n,o,a;const s=this._idleTriggered?this._fadeDuration:0,l=(null===(i=this.style.projection)||void 0===i?void 0:i.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let h=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,i=c();this.style.zoomHistory.update(t,i);const r=new e.H(t,{now:i,fadeDuration:s,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),n=r.crossFadingFactor();1===n&&n===this._crossFadingFactor||(h=!0,this._crossFadingFactor=n),this.style.update(r)}const u=(null===(r=this.style.projection)||void 0===r?void 0:r.transitionState)>0!==l;null===(n=this.style.projection)||void 0===n||n.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState(null===(o=this.style.projection)||void 0===o?void 0:o.transitionState,null===(a=this.style.projection)||void 0===a?void 0:a.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||u)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.tileManager.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGroun
vendor: 6,275 bytes, line 1
1d&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,s,this._crossSourceCollisions,u),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new e.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.cE.mark(e.cF.load),this.fire(new e.l("load"))),this.style&&(this.style.hasTransitions()||h)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const d=this._sourcesDirty||this._styleDirty||this._placementDirty;return d||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.l("idle")),!this._loaded||this._fullyLoaded||d||(this._fullyLoaded=!0,e.cE.mark(e.cF.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;this._hash&&this._hash.remove();for(const e of this._controls)e.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),_.removeThrottleControl(this._imageQueueHandle),null===(t=this._resizeObserver)||void 0===t||t.disconnect();const i=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==i?void 0:i.loseContext)&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),h.remove(this._canvasContainer),h.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),e.cE.remove(),this._removed=!0,this.fire(new e.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,s.frame(this._frameRequest,(t=>{e.cE.recordStartOfFrameAt(t),this._frameRequest=null;try{this._render(t)}catch(t){if(!e.Z(t)&&!function(t){return t.message===hn}(t))throw t}}),(()=>{}),this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return da}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(!0)}};const ma={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class ga{constructor(t,i){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.mousedown=t=>{this.startMove(t,h.mousePos(this.element,t)),h.addEventListener(window,"mousemove",this.mousemove),h.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.move(t,h.mousePos(this.element,t))},this.mouseup=t=>{this._rotatePitchHandler.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=h.touchPos(this.element,t.targetTouches)[0],this.startMove(t,this._startPos),h.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=h.touchPos(this.element,t.targetTouches)[0],this.move(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&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._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=i;const n=new Io;this._rotatePitchHandler=new xo({clickTolerance:3,move:(t,n)=>{const o=i.getBoundingClientRect(),a=new e.P((o.bottom-o.top)/2,(o.right-o.left)/2);return{bearingDelta:e.cv(new e.P(t.x,n.y),n,a),pitchDelta:r?-.5*(n.y-t.y):void 0}},moveStateManager:n,enable:!0,assignEvents:()=>{}}),this.map=t,h.addEventListener(i,"mousedown",this.mousedown),h.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),h.addEventListener(i,"touchcancel",this.reset)}startMove(t,e){this._rotatePitchHandler.dragStart(t,e),h.disableDrag()}move(t,e){const i=this.map,{bearingDelta:r,pitchDelta:n}=this._rotatePitchHandler.dragMove(t,e)||{};r&&i.setBearing(i.getBearing()+r),n&&i.setPitch(i.getPitch()+n)}off(){const t=this.element;h.removeEventListener(t,"mousedown",this.mousedown),h.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),h.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.removeEventListener(window,"touchend",this.touchend),h.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){h.enableDrag(),h.removeEventListener(window,"mousemove",this.mousemove),h.removeEventListener(window,"mouseup",this.mouseup),h.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.removeEventListener(window,"touchend",this.touchend)}}let _a;function ya(t,i,r){if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return null==t?void 0:t.wrap();const n=new e.V(t.lng,t.lat);
1if(t=new e.V(t.lng,t.lat),i){const n=new e.V(t.lng-360,t.lat),o=new e.V(t.lng+360,t.lat),a=r.locationToScreenPoint(t).distSqr(i);r.locationToScreenPoint(n).distSqr(i)<a?t=n:r.locationToScreenPoint(o).distSqr(i)<a&&(t=o)}for(;Math.abs(t.lng-r.center.lng)>180;){const e=r.locationToScreenPoint(t);if(e.x>=0&&e.y>=0&&e.x<=r.width&&e.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t.lng!==n.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(t))?t:n}const va={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 xa(t,e,i){const r=t.classList;for(const n in va)r.remove("maplibregl-".concat(i,"-anchor-").concat(n));r.add("maplibregl-".concat(i,"-anchor-").concat(e))}class ba extends e.E{constructor(t){if(super(),this._onClick=t=>{this.fire(new e.l("click",{originalEvent:t}))},this._onKeyPress=t=>{const e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()},this._onMapClick=t=>{const e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},this._update=t=>{if(!this._map)return;const e=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!e)&&this._map.once("render",this._update),this._lngLat=ya(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i="rotateZ(".concat(this._rotation,"deg)"):"map"===this._rotationAlignment&&(i="rotateZ(".concat(this._rotation-this._map.getBearing(),"deg)"));let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r="rotateX(".concat(this._map.getPitch(),"deg)")),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),h.setTransform(this._element,"".concat(va[this._anchor]," translate(").concat(this._pos.x,"px, ").concat(this._pos.y,"px) ").concat(r," ").concat(i)),s.frameAsync(new AbortController,this._map._ownerWindow).then((()=>{this._updateOpacity(t&&"moveend"===t.type)})).catch((()=>{}))},this._onMove=t=>{if(!this._isDragging){const e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.l("dragstart"))),this.fire(new e.l("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),"active"===this._state&&this.fire(new e.l("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=h.create("div");const i=h.createNS("http://www.w3.org/2000/svg","svg"),r=41,n=27;i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height","".concat(r,"px")),i.setAttributeNS(null,"width","".concat(n,"px")),i.setAttributeNS(null,"viewBox","0 0 ".concat(n," ").concat(r));const o=h.createNS("http://www.w3.org/2000/svg","g");
vendor: 5,295 bytes, line 1
1o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");const a=h.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");const s=h.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"transform","translate(3.0, 29.0)"),s.setAttributeNS(null,"fill","#000000");const l=[{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 t of l){const e=h.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),s.appendChild(e)}const c=h.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"fill",this._color);const u=h.createNS("http://www.w3.org/2000/svg","path");u.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"),c.appendChild(u);const d=h.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"opacity","0.25"),d.setAttributeNS(null,"fill","#000000");const p=h.createNS("http://www.w3.org/2000/svg","path");p.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"),d.appendChild(p);const f=h.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(6.0, 7.0)"),f.setAttributeNS(null,"fill","#FFFFFF");const m=h.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const g=h.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");const _=h.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#FFFFFF"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(_),a.appendChild(s),a.appendChild(c),a.appendChild(d),a.appendChild(f),a.appendChild(m),i.appendChild(a),i.setAttributeNS(null,"height",r*this._scale+"px"),i.setAttributeNS(null,"width",n*this._scale+"px"),this._element.appendChild(i),this._offset=e.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(t=>{t.preventDefault()})),this._element.addEventListener("mousedown",(t=>{t.preventDefault()})),xa(this._element,this._anchor,"marker"),this._element.addEventListener("click",this._onClick),t&&t.className)for(const e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",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("terrain",this._update),this._map.off("projectiontransition",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),h.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.V.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 e=38.1,i=13.5,r=Math.abs(i)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[
10,-e],"bottom-left":[r,-1*(e-i+r)],"bottom-right":[-r,-1*(e-i+r)],left:[i,-1*(e-i)],right:[-i,-1*(e-i)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var i,r;const n=null===(i=this._map)||void 0===i?void 0:i.terrain,o=this._map.transform.isLocationOccluded(this._lngLat);if(!n||o){const t=o?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==t&&(this._element.style.opacity=t))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const a=this._map,s=a.terrain.depthAtPoint(this._pos),l=a.terrain.getElevationForLngLat(this._lngLat,a.transform);if(a.transform.lngLatToCameraDepth(this._lngLat,l)-s<.006)return void(this._element.style.opacity=this._opacity);const c=-this._offset.y/a.transform.pixelsPerMeter,h=Math.sin(a.getPitch()*Math.PI/180)*c,u=a.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),d=a.transform.lngLatToCameraDepth(this._lngLat,l+h)-u>.006;(null===(r=this._popup)||void 0===r?void 0:r.isOpen())&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.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&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,e){return(void 0===this._opacity||void 0===t&&void 0===e)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}const wa={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Ta=0,Sa=!1;const Pa={maxWidth:100,unit:"metric"};function Ia(t,e,i){const r=i&&i.maxWidth||100,n=t._container.clientHeight/2,o=t._container.clientWidth/2,a=t.unproject([o-r/2,n]),s=t.unproject([o+r/2,n]),l=Math.round(t.project(s).x-t.project(a).x),c=Math.min(r,l,t._container.clientWidth),h=a.distanceTo(s);if(i&&"imperial"===i.unit){const i=3.2808*h;i>5280?Ma(e,c,i/5280,t._getUIString("ScaleControl.Miles")):Ma(e,c,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?Ma(e,c,h/1852,t._getUIString("ScaleControl.NauticalMiles")):h>=1e3?Ma(e,c,h/1e3,t._getUIString("ScaleControl.Kilometers")):Ma(e,c,h,t._getUIString("ScaleControl.Meters"))}function Ma(t,e,i,r){const n=function(t){const e=Math.pow(10,"".concat(Math.floor(t)).length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i),e*i}(i);t.style.width=e*(n/i)+"px",t.innerHTML="".concat(n,"&nbsp;").concat(r)}const Ea={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0}
vendor: 5,035 bytes, line 1
1,Ca=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Aa(t){if(t){if("number"==typeof t){const i=Math.round(Math.abs(t)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,t),"top-left":new e.P(i,i),"top-right":new e.P(-i,i),bottom:new e.P(0,-t),"bottom-left":new e.P(i,-i),"bottom-right":new e.P(-i,-i),left:new e.P(t,0),right:new e.P(-t,0)}}if(t instanceof e.P||Array.isArray(t)){const i=e.P.convert(t);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.P.convert(t.center||[0,0]),top:e.P.convert(t.top||[0,0]),"top-left":e.P.convert(t["top-left"]||[0,0]),"top-right":e.P.convert(t["top-right"]||[0,0]),bottom:e.P.convert(t.bottom||[0,0]),"bottom-left":e.P.convert(t["bottom-left"]||[0,0]),"bottom-right":e.P.convert(t["bottom-right"]||[0,0]),left:e.P.convert(t.left||[0,0]),right:e.P.convert(t.right||[0,0])}}return Aa(new e.P(0,0))}const Da=i;t.AJAXError=e.cG,t.EXTENT=e.a5,t.Event=e.l,t.Evented=e.E,t.LngLat=e.V,t.MercatorCoordinate=e.a6,t.Point=e.P,t.addProtocol=e.cH,t.config=e.c,t.removeProtocol=e.cI,t.AttributionControl=ia,t.BoxZoomHandler=mo,t.CanvasSource=st,t.CooperativeGesturesHandler=Yo,t.DoubleClickZoomHandler=Go,t.DragPanHandler=Wo,t.DragRotateHandler=Xo,t.EdgeInsets=Ze,t.FullscreenControl=class extends e.E{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var i;super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=null!==(i=t.pseudo)&&void 0!==i&&i,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.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(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){h.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const t=this._fullscreenButton=h.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);h.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_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 e.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=nt,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.l("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_E
1RROR":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 ".concat(this._watchState))}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.l("geolocate",t)),this._finish()}},this._updateCamera=t=>{const i=new e.V(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,n=this._map.getBearing(),o=e.e({bearing:n},this.options.fitBoundsOptions),a=X.fromLngLat(i,r);this._map.fitBounds(a,o,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const i=new e.V(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(1===t.code){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 t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Sa)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.l("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(t=>t.preventDefault())),this._geolocateButton=h.create("button","maplibregl-ctrl-geolocate",this._container),h.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=h.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new ba({element:this._dotElement}),this._circleElement=h.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new ba({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(t=>{const i=(null==t?void 0:t[0])instanceof ResizeObserverEntry;t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||i||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.l("trackuserlocationend")),this.fire(new e.l("userlocationlostfocus")))}))}},this.options=e.e({},wa,t)}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,(function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function*(){if(void 0!==_a&&!t)return _a;if(void 0===window.navigator.permissions)return _a=!!window.navigator.geolocation,_a;try{const t=yield window.navigator.permissions.query({name:"geolocation"});_a="denied"!==t.state}catch(t){_a=!!window.navigator.geolocation}return _a}()}))}().then((t=>this._finishSetupUI(t))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),h.remove(this._container),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,Ta=0,Sa=!1}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
1RROR",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":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw new Error("Unexpected watchState ".concat(this._watchState))}}_updateCircleRadiusIfNeeded(){const t=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&t))return;const e=this._map.project(t),i=this._map.unproject([e.x+100,e.y]),r=t.distanceTo(i)/100,n=2*this._accuracy/r;this._circleElement.style.width="".concat(n.toFixed(2),"px"),this._circleElement.style.height="".concat(n.toFixed(2),"px")}trigger(){if(!this._setup)return e.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 e.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ta--,Sa=!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 e.l("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 e.l("trackuserlocationstart")),this.fire(new e.l("userlocationfocus"));break;default:throw new Error("Unexpected watchState ".concat(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 ".concat(this._watchState))}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ta++,Ta>1?(t={maximumAge:6e5,timeout:0},Sa=!0):(t=this.options.positionOptions,Sa=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}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","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.GlobeControl=class{constructor(){this._toggleProjection=()=>{var t;const e=null===(t=this._map.getProjection())||void 0===t?void 0:t.type;this._map.setProjection("mercator"!==e&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var t;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),"globe"===(null===(t=this._map.getProjection())||void 0===t?void 0:t.type)?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=h.create("button","maplibregl-ctrl-globe",this._container),h.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){h.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},t.Hash=Qn,t.ImageSource=ot,t.KeyboardHandler=Oo,t.LngLatBounds=X,t.LogoControl
1=ra,t.Map=fa,t.MapLibreMap=fa,t.MapMouseEvent=lo,t.MapTouchEvent=co,t.MapWheelEvent=ho,t.Marker=ba,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{const t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?"scale(".concat(1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5),") rotateZ(").concat(-this._map.transform.roll,"deg) rotateX(").concat(this._map.transform.pitch,"deg) rotateZ(").concat(-this._map.transform.bearing,"deg)"):this.options.visualizePitch?"scale(".concat(1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5),") rotateX(").concat(this._map.transform.pitch,"deg) rotateZ(").concat(-this._map.transform.bearing,"deg)"):this.options.visualizeRoll?"rotate(".concat(-this._map.transform.bearing-this._map.transform.roll,"deg)"):"rotate(".concat(-this._map.transform.bearing,"deg)")},this._setButtonTitle=(t,e)=>{const i=this._map._getUIString("NavigationControl.".concat(e));t.title=i,t.setAttribute("aria-label",i)},this.options=e.e({},ma,t),this._container=h.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}))),h.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}))),h.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=h.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,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.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new ga(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){h.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.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){const i=h.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}},t.Popup=class extends e.E{constructor(t){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?"".concat(this.options.locationOccludedOpacity):"")},this.remove=()=>(this._content&&h.remove(this._content),this._container&&(h.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),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.l("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=h.create("div","maplibregl-popup",this._map.getContainer()),this._tip=h.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),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._lngLat=ya(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!t)return;const e=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationToScreenPoint(this._lngLat));let i=this.options.anchor;const r=Aa(this.options.offset);if(!i){const t=this._container.offsetWidth,n=this._container.offsetHeight,o=function(t){var e,i,r,n;return t?{top:null!==(e=t.top)&&void 0!==e?e:0,right:null!==(i=t.right)&&void 0!==i?i:0,bottom:null!==(r=t.bottom)&&void 0!==r?r:0,left:null!==(n=t.left)&&void 0!==n?n:0}:{top:0,right:0,bottom:0,left:0}}(this.options.padding);let a;a=e.y+r.bottom.y<n+o.top?["top"]:e.y>this._map.transform.height-n-o.bottom?["bottom"]:[],e.x<t/2+o.left?a.push("left"):e.x>this._map.transform.width-t/2-o.right&&a.push("right"),i=0===a.length?"bottom":a.join("-")}let n=e.add(r[i]);this.options.subpixelPositioning||(n=n.round()),h.setTransform(this._container,"".concat(va[i]," translate(").concat(n.x,"px,").concat(n.y,"px)")),xa(this._container,i,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(Ea),t)}addTo(t){return this._map&&this.remove(),this._map=t,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 e.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.V.convert(t),this._pos=null,this._flatPos=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._flatPos=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(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){const e=document.createDocumentFragment(),i=document.createElement("body");let r;for(i.innerHTML=t;r=i.firstChild,r;)e.appendChild(r);return this.setDOMContent(e)}getMaxWidth(){var t;return null===(t=this._container)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=h.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}setPadding(t){this.options.padding=t,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=h.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const t=this._container.querySelector(Ca);t&&t.focus()}},t.RasterDEMTileSource=J,t.RasterTileSource=K,t.ScaleControl=class{constructor(t){this._onMove=()=>{Ia(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Ia(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Pa),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){h.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}}
1,t.ScrollZoomHandler=Uo,t.Style=Vi,t.TerrainControl=class{constructor(t){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.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=h.create("button","maplibregl-ctrl-terrain",this._container),h.create("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(){h.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=Lo,t.TwoFingersTouchRotateHandler=Ro,t.TwoFingersTouchZoomHandler=zo,t.TwoFingersTouchZoomRotateHandler=Ho,t.VectorTileSource=Y,t.VideoSource=at,t.addSourceType=(t,i)=>e._(void 0,void 0,void 0,(function*(){if(ct(t))throw new Error('A source type called "'.concat(t,'" already exists.'));((t,e)=>{lt[t]=e})(t,i)})),t.clearPrewarmedResources=function(){const t=B;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(R),B=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()"))},t.createTileMesh=di,t.getMaxParallelImageRequests=function(){return e.c.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return pt().getRTLTextPluginStatus()},t.getVersion=function(){return Da},t.getWorkerCount=function(){return F.workerCount},t.getWorkerUrl=function(){return e.c.WORKER_URL},t.importScriptInWorkers=function(t){return N().broadcast("IS",t)},t.isTimeFrozen=function(){return l.isFrozen()},t.now=c,t.prewarm=function(){V().acquire(R)},t.restoreNow=function(){l.restoreNow()},t.setMaxParallelImageRequests=function(t){e.c.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setNow=function(t){l.setNow(t)},t.setRTLTextPlugin=function(t,e){return pt().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){F.workerCount=t},t.setWorkerUrl=function(t){e.c.WORKER_URL=t}})),t}()}}]);

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.