@maptalks/vt 0.70.0 → 0.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/maptalks.vt.js +1307 -1284
- package/dist/maptalks.vt.mjs +318 -318
- package/package.json +3 -3
package/dist/maptalks.vt.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/vt v0.
|
|
2
|
+
* @maptalks/vt v0.71.0
|
|
3
3
|
* LICENSE : undefined
|
|
4
4
|
* (c) 2016-2022 maptalks.org
|
|
5
5
|
*/
|
|
@@ -11,7 +11,7 @@ import { reshader as i, vec3 as n, mat4 as r, GroundPainter as o, createREGL as
|
|
|
11
11
|
|
|
12
12
|
import { loadFunctionTypes as f, isFunctionDefinition as p, interpolated as m, piecewiseConstant as y } from "@maptalks/function-type";
|
|
13
13
|
|
|
14
|
-
import { IconRequestor as g, GlyphRequestor as v, PointPack as b, VectorPack as x, StyledPoint as w, LinePack as A, StyledVector as _, SYMBOLS_NEED_REBUILD_IN_VECTOR as k, PolygonPack as S, StyleUtil as T, SYMBOLS_NEED_REBUILD_IN_VT as M, PackUtil as
|
|
14
|
+
import { IconRequestor as g, GlyphRequestor as v, PointPack as b, VectorPack as x, StyledPoint as w, LinePack as A, StyledVector as _, SYMBOLS_NEED_REBUILD_IN_VECTOR as k, PolygonPack as S, StyleUtil as T, SYMBOLS_NEED_REBUILD_IN_VT as M, PackUtil as I, TextUtil as P } from "@maptalks/vector-packer";
|
|
15
15
|
|
|
16
16
|
export { FilterUtil, PackUtil, SYMBOLS_NEED_REBUILD_IN_VECTOR, SYMBOLS_NEED_REBUILD_IN_VT } from "@maptalks/vector-packer";
|
|
17
17
|
|
|
@@ -25,7 +25,7 @@ import { createFilter as F } from "@maptalks/feature-filter";
|
|
|
25
25
|
|
|
26
26
|
import z from "@maptalks/vt-plugin";
|
|
27
27
|
|
|
28
|
-
const j = 'function(t){function e(t,e){for(let i=0;i<t.stops.length;i++)if(e===t.stops[i][0])return t.stops[i][1];return t.default}function i(t,e){for(var i=0;i<t.stops.length&&!(e<t.stops[i][0]);i++);return t.stops[Math.max(i-1,0)][1]}function n(t,e){for(var i=void 0!==t.base?t.base:1,n=0;!(n>=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:function t(e,i,n,r,s,a){return"function"==typeof s?function(){var o=s.apply(void 0,arguments),l=a.apply(void 0,arguments);return t(e,i,n,r,o,l)}:s.length?function(t,e,i,n,r,s){var a=[];for(let l=0;l<r.length;l++)a[l]=o(t,e,i,n,r[l],s[l]);return a}(e,i,n,r,s,a):o(e,i,n,r,s,a)}(e,i,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function r(t,e){return function(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:null}(e,t.default)}function o(t,e,i,n,r,o){var s,a=n-i,l=t-i;return r*(1-(s=1===e?l/a:(Math.pow(e,l)-1)/(Math.pow(e,a)-1)))+o*s}function s(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type)}function a(t){return c(t,"exponential")}function l(t){return c(t,"interval")}function u(t,e){if(!t)return null;var i=!1;if(Array.isArray(t)){var n,r=[];for(let o=0;o<t.length;o++)(n=u(t[o],e))?(r.push(n),i=!0):r.push(t[o]);return i?r:t}var o,l={__fn_types_loaded:!0},c=[];for(o in t)t.hasOwnProperty(o)&&c.push(o);const h=function(t){Object.defineProperty(l,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=a(this["_"+t])),this["__fn_"+t].apply(this,e())},set:function(e){this["_"+t]=e},configurable:!0,enumerable:!0})};for(let e=0,n=c.length;e<n;e++)s(t[o=c[e]])?(i=!0,l["_"+o]=t[o],h(o)):l[o]=t[o];return i?l:t}function c(t,o){if(!s(t))return function(){return t};let a=!0,l=!0;const u=(t=JSON.parse(JSON.stringify(t))).stops;if(u)for(let t=0;t<u.length;t++)if(s(u[t][1])){const e=c(u[t][1],o);a=a&&e.isZoomConstant,l=l&&e.isFeatureConstant,u[t]=[u[t][0],e]}const h=function t(o,a){var l,u,c;if(s(o)){var h,d=o.stops&&"object"==typeof o.stops[0][0],f=d||void 0!==o.property,p=d||!f,m=o.type||a||"exponential";if("exponential"===m)h=n;else if("interval"===m)h=i;else if("categorical"===m)h=e;else{if("identity"!==m)throw new Error(\'Unknown function type "\'+m+\'"\');h=r}if(d){var y={},g=[];for(let t=0;t<o.stops.length;t++){var b=o.stops[t];void 0===y[b[0].zoom]&&(y[b[0].zoom]={zoom:b[0].zoom,type:o.type,property:o.property,default:o.default,stops:[]}),y[b[0].zoom].stops.push([b[0].value,b[1]])}for(let e in y)g.push([y[e].zoom,t(y[e])]);l=function(t,e){const i=n({stops:g,base:o.base},t)(t,e);return"function"==typeof i?i(t,e):i},u=!1,c=!1}else p?(l=function(t){const e=h(o,t);return"function"==typeof e?e(t):e},u=!0,c=!1):(l=function(t,e){const i=h(o,e?e[o.property]:null);return"function"==typeof i?i(t,e):i},u=!1,c=!0)}else l=function(){return o},u=!0,c=!0;return l.isZoomConstant=c,l.isFeatureConstant=u,l}(t,o);return h.isZoomConstant=a&&h.isZoomConstant,h.isFeatureConstant=l&&h.isFeatureConstant,h}let h=0;const d="function"==typeof Object.assign;function f(t,...e){if(d)return Object.assign(t,...e),t;for(let i=0;i<e.length;i++){const n=e[i];for(const e in n)t[e]=n[e]}return t}function p(t){return!b(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function m(t){return"number"==typeof t&&!isNaN(t)}function y(t){return!b(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function g(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function b(t){return null==t}function v(t){for(let e=1;e<arguments.length;e++){const i=arguments[e];if(i)for(let e=0,n=i.length;e<n;e++)t.push(i[e])}return t.length}function w(t){return t<65536?Uint16Array:Uint32Array}function x(t){return t<256?Uint8Array:t<65536?Uint16Array:Uint32Array}function k(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function M(t){return s(t)&&t.property}const j="function"==typeof fetch&&"function"==typeof AbortController,A={jsonp:function(t,e){const i="_maptalks_jsonp_"+h++;t.match(/\\?/)?t+="&callback="+i:t+="?callback="+i;let n=document.createElement("script");return n.type="text/javascript",n.src=t,window[i]=function(t){e(null,t),document.getElementsByTagName("head")[0].removeChild(n),n=null,delete window[i]},document.getElementsByTagName("head")[0].appendChild(n),this},get:function(t,e,i){if(y(e)){const t=i;i=e,e=t}(e=e||{}).method&&(e.method=e.method.toUpperCase());const n="POST"===e.method;if(j){const r=new AbortController,o={signal:r.signal,method:e.method||"GET",referrerPolicy:"origin"};return n&&(b(e.body)||(o.body=JSON.stringify(e.body))),b(e.headers)||(o.headers=e.headers),b(e.credentials)||(o.credentials=e.credentials),fetch(t,o).then(n=>{const r=this.t(n,e.returnJSON,e.responseType);r.message?(r.url=t,i(r)):r.then(t=>{"arraybuffer"===e.responseType?i(null,{data:t,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires"),contentType:n.headers.get("Content-Type")}):i(null,t)}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),i(t))})}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),i(t))}),r}{const r=A.o(i);if(r.open(e.method||"GET",t,!0),e){for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);r.withCredentials="include"===e.credentials,e.responseType&&(r.responseType=e.responseType)}return r.send(n?e.body:null),r}},t:(t,e,i)=>200!==t.status?{status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`}:"arraybuffer"===i?t.arrayBuffer():e?t.json():t.text(),s:function(t,e){return function(){if(4===t.readyState)if(200===t.status)if("arraybuffer"===t.responseType){0===t.response.byteLength?e({status:200,statusText:t.statusText,message:"http status 200 returned without content."}):e(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")})}else e(null,t.responseText);else e({status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`})}},o:function(t){let e;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}return e.onreadystatechange=A.s(e,t),e},getArrayBuffer(t,e,i){if(y(e)){const t=i;i=e,e=t}return e||(e={}),e.responseType="arraybuffer",A.get(t,e,i)}};function F(t,e,i,n,r,o){let s=r-i,a=o-n;if(0!==s||0!==a){const l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return s=t-i,a=e-n,s*s+a*a}function T(t,e,i,n,r,o){const s={id:null==t?null:t,type:e,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};r&&(s.layer=r);return function(t,e){const i=t.geometry,n=t.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)z(t,i,e);else if("Polygon"===n)z(t,i[0],e);else if("MultiLineString"===n)for(const n of i)z(t,n,e);else if("MultiPolygon"===n)for(const n of i)z(t,n[0],e)}(s,o?4:3),s}function z(t,e,i){for(let n=0;n<e.length;n+=i)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}function S(t,e,i,n){if(n.layer=e,"FeatureCollection"===i.type)for(let e=0;e<i.features.length;e++)_(t,i.features[e],n,e);else"Feature"===i.type?_(t,i,n):_(t,{geometry:i},n)}function _(t,e,i,n){if(!e.geometry)return;const r=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);let a=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=n||0),"Point"===o)P(r,a,i.hasAltitude);else if("MultiPoint"===o)for(const t of r)P(t,a,i.hasAltitude);else if("LineString"===o)I(r,a,s,!1,i.hasAltitude);else if("MultiLineString"===o){if(i.lineMetrics){for(const n of r)a=[],I(n,a,s,!1,i.hasAltitude),t.push(T(l,"LineString",a,e.properties,i.layer,i.hasAltitude));return}O(r,a,s,!1,i.hasAltitude)}else if("Polygon"===o)O(r,a,s,!0,i.hasAltitude);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const r of e.geometry.geometries)_(t,{id:l,geometry:r,properties:e.properties},i,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of r){const e=[];O(t,e,s,!0,i.hasAltitude),a.push(e)}}t.push(T(l,o,a,e.properties,i.layer,i.hasAltitude))}function P(t,e,i){e.push(q(t[0]),E(t[1]),0),i&&(t.length>2?e.push(t[2]):e.push(0))}function I(t,e,i,n,r){let o,s,a=0;for(let i=0;i<t.length;i++){const l=q(t[i][0]),u=E(t[i][1]);e.push(l,u,0),r&&(t[i].length>2?e.push(t[i][2]):e.push(0)),i>0&&(a+=n?(o*u-l*s)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-s,2))),o=l,s=u}const l=r?4:3,u=e.length-l;e[2]=1,function t(e,i,n,r,o=3){let s=r;const a=n-i>>1;let l,u=n-i;const c=e[i],h=e[i+1],d=e[n],f=e[n+1];for(let t=i+o;t<n;t+=o){const i=F(e[t],e[t+1],c,h,d,f);if(i>s)l=t,s=i;else if(i===s){const e=Math.abs(t-a);e<u&&(l=t,u=e)}}s>r&&(l-i>o&&t(e,i,l,r,o),e[l+2]=s,n-l>o&&t(e,l,n,r,o))}(e,0,u,i,l),e[u+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function O(t,e,i,n,r){for(let o=0;o<t.length;o++){const s=[];I(t[o],s,i,n,r),e.push(s)}}function q(t){return t/360+.5}function E(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 R(t,e,i,n,r,o,s,a){if(n/=e,o>=(i/=e)&&s<n)return t;if(s<i||o>=n)return null;const l=[];for(const e of t){const t=e.geometry;let o=e.type;const s=0===r?e.minX:e.minY,u=0===r?e.maxX:e.maxY;if(s>=i&&u<n){l.push(e);continue}if(u<i||s>=n)continue;let c=[];if("Point"===o||"MultiPoint"===o)C(t,c,i,n,r,a.hasAltitude);else if("LineString"===o)N(t,c,i,n,r,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===o)D(t,c,i,n,r,!1,a.hasAltitude);else if("Polygon"===o)D(t,c,i,n,r,!0,a.hasAltitude);else if("MultiPolygon"===o)for(const e of t){const t=[];D(e,t,i,n,r,!0,a.hasAltitude),t.length&&c.push(t)}if(c.length){if(a.lineMetrics&&"LineString"===o){for(const t of c)l.push(T(e.id,o,t,e.tags,e.layer,a.hasAltitude));continue}"LineString"!==o&&"MultiLineString"!==o||(1===c.length?(o="LineString",c=c[0]):o="MultiLineString"),"Point"!==o&&"MultiPoint"!==o||(o=3===c.length?"Point":"MultiPoint"),l.push(T(e.id,o,c,e.tags,e.layer,a.hasAltitude))}}return l.length?l:null}function C(t,e,i,n,r,o){const s=o?4:3;for(let a=0;a<t.length;a+=s){const s=t[a+r];s>=i&&s<=n&&(U(e,t[a],t[a+1],t[a+2]),o&&e.push(t[a+3]))}}function N(t,e,i,n,r,o,s,a){let l=L(t);const u=0===r?$:W;let c,h,d=t.start;const f=a?4:3;for(let p=0;p<t.length-f;p+=f){const m=t[p],y=t[p+1],g=t[p+2],b=t[p+f],v=t[p+f+1];let w,x;a&&(w=t[p+3],x=t[p+f+3]);const k=0===r?m:y,M=0===r?b:v;let j=!1;s&&(c=Math.sqrt(Math.pow(m-b,2)+Math.pow(y-v,2))),k<i?M>i&&(h=u(l,m,y,b,v,i),a&&l.push(J(w,x,h)),s&&(l.start=d+c*h)):k>n?M<n&&(h=u(l,m,y,b,v,n),a&&l.push(J(w,x,h)),s&&(l.start=d+c*h)):(U(l,m,y,g),a&&l.push(w)),M<i&&k>=i&&(h=u(l,m,y,b,v,i),a&&l.push(J(w,x,h)),j=!0),M>n&&k<=n&&(h=u(l,m,y,b,v,n),a&&l.push(J(w,x,h)),j=!0),!o&&j&&(s&&(l.end=d+c*h),e.push(l),l=L(t)),s&&(d+=c)}let p=t.length-f;const m=t[p],y=t[p+1],g=t[p+2],b=0===r?m:y;if(b>=i&&b<=n&&U(l,m,y,g),b>=i&&b<=n&&a){const e=t[p+3];l.push(e)}p=l.length-f,o&&p>=f&&(l[p]!==l[0]||l[p+1]!==l[1])&&(U(l,l[0],l[1],l[2]),a&&l.push(l[3])),l.length&&e.push(l)}function L(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function D(t,e,i,n,r,o,s){for(const a of t)N(a,e,i,n,r,o,!1,s)}function U(t,e,i,n){t.push(e,i,n)}function $(t,e,i,n,r,o){const s=(o-e)/(n-e);return U(t,o,i+(r-i)*s,1),s}function W(t,e,i,n,r,o){const s=(o-i)/(r-i);return U(t,e+(n-e)*s,o,1),s}function J(t,e,i){return t+(e-t)*i}function H(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=t[r],s=o.type;let a;if("Point"===s||"MultiPoint"===s||"LineString"===s)a=G(o.geometry,e,i);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const t of o.geometry)a.push(G(t,e,i))}else if("MultiPolygon"===s){a=[];for(const t of o.geometry){const n=[];for(const r of t)n.push(G(r,e,i));a.push(n)}}n.push(T(o.id,s,a,o.tags,o.layer,i))}return n}function G(t,e,i){const n=[];n.size=t.size,void 0!==t.start&&(n.start=t.start,n.end=t.end);const r=i?4:3;for(let o=0;o<t.length;o+=r)n.push(t[o]+e,t[o+1],t[o+2]),i&&n.push(t[o+3]);return n}function V(t,e,i){if(t.transformed)return t;const n=1<<t.z,r=t.x,o=t.y,s=i?3:2;for(const a of t.features){const t=a.geometry,l=a.type;if(a.geometry=[],1===l)for(let l=0;l<t.length;l+=s)a.geometry.push(B(t[l],t[l+1],e,n,r,o)),i&&a.geometry[a.geometry.length-1].push(t[l+2]);else for(let l=0;l<t.length;l++){const u=[];for(let a=0;a<t[l].length;a+=s)u.push(B(t[l][a],t[l][a+1],e,n,r,o)),i&&u[u.length-1].push(t[l][a+2]);a.geometry.push(u)}}return t.transformed=!0,t}function B(t,e,i,n,r,o){return[Math.round(i*(t*n-r)),Math.round(i*(e*n-o))]}function X(t,e,i,n,r){const o=e===r.maxZoom?0:r.tolerance/((1<<e)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:i,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const e of t)Z(s,e,o,r);return s}function Z(t,e,i,n){const r=e.geometry,o=e.type,s=[],a=n.hasAltitude?4:3;if(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),"Point"===o||"MultiPoint"===o)for(let e=0;e<r.length;e+=a)s.push(r[e],r[e+1]),n.hasAltitude&&s.push(r[e+3]),t.numPoints++,t.numSimplified++;else if("LineString"===o)Y(s,r,t,i,!1,!1,n);else if("MultiLineString"===o||"Polygon"===o)for(let e=0;e<r.length;e++)Y(s,r[e],t,i,"Polygon"===o,0===e,n);else if("MultiPolygon"===o)for(let e=0;e<r.length;e++){const o=r[e];for(let e=0;e<o.length;e++)Y(s,o[e],t,i,!0,0===e,n)}if(s.length){let i=e.tags||null;if("LineString"===o&&n.lineMetrics){i={};for(const t in e.tags)i[t]=e.tags[t];i.mapbox_clip_start=r.start/r.size,i.mapbox_clip_end=r.end/r.size}const a={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:i};e.layer&&(a.layer=e.layer),null!==e.id&&(a.id=e.id),t.features.push(a)}}function Y(t,e,i,n,r,o,s){const a=n*n,{hasAltitude:l,disableFilter:u}=s,c=l?4:3;if(!u&&n>0&&e.size<(r?a:n))return void(i.numPoints+=e.length/c);const h=[];for(let t=0;t<e.length;t+=c)(0===n||e[t+2]>a)&&(i.numSimplified++,h.push(e[t],e[t+1]),l&&h.push(e[t+3])),i.numPoints++;r&&function(t,e,i){const n=i?3:2;let r=0;for(let e=0,i=t.length,o=i-n;e<i;o=e,e+=n)r+=(t[e]-t[o])*(t[e+1]+t[o+1]);if(r>0===e){const e=n,r=n-1,o=n-2;for(let s=0,a=t.length;s<a/2;s+=n){const n=t[s],l=t[s+1];let u;i&&(u=t[s+2]),t[s]=t[a-e-s],t[s+1]=t[a-r-s],i&&(t[s+2]=t[a-o-s]),t[a-e-s]=n,t[a-r-s]=l,i&&(t[a-o-s]=u)}}}(h,o,l),t.push(h)}A.getJSON=function(t,e,i){if(y(e)){const t=i;i=e,e=t}const n=function(t,e){const n="string"==typeof e?JSON.parse(e):e||null;i(t,n)};return e&&e.jsonp?A.jsonp(t,n):((e=e||{}).returnJSON=!0,A.get(t,e,n))};const K={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,hasAltitude:!1,disableFilter:!1,debug:0};class Q{constructor(t,e){const i=(e=this.options=function(t,e){for(const i in e)t[i]=e[i];return t}(Object.create(K),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=function(t,e){const i=[];if(Array.isArray(t)){for(let n=0;n<t.length;n++)S(i,t[n].layer,t[n].data,e);return i}if("FeatureCollection"===t.type)for(let n=0;n<t.features.length;n++)_(i,t.features[n],e,n);else"Feature"===t.type?_(i,t,e):_(i,{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(t,e){const i=e.buffer/e.extent;let n=t;const r=R(t,1,-1-i,i,0,-1,2,e),o=R(t,1,1-i,2+i,0,-1,2,e);return(r||o)&&(n=R(t,1,-i,1+i,0,-1,2,e)||[],r&&(n=H(r,1,e.hasAltitude).concat(n)),o&&(n=n.concat(H(o,-1,e.hasAltitude)))),n}(n,e),n.length&&this.splitTile(n,0,0,0),i&&(n.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)))}splitTile(t,e,i,n,r,o,s){const a=[t,e,i,n],l=this.options,u=l.debug;for(;a.length;){n=a.pop(),i=a.pop(),e=a.pop(),t=a.pop();const c=1<<e,h=tt(e,i,n);let d=this.tiles[h];if(!d&&(u>1&&console.time("creation"),d=this.tiles[h]=X(t,e,i,n,l),this.tileCoords.push({z:e,x:i,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const t="z"+e;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(d.source=t,null==r){if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===r)continue;if(null!=r){const t=r-e;if(i!==o>>t||n!==s>>t)continue}}if(d.source=null,0===t.length)continue;u>1&&console.time("clipping");const f=.5*l.buffer/l.extent,p=.5-f,m=.5+f,y=1+f;let g=null,b=null,v=null,w=null,x=R(t,c,i-f,i+m,0,d.minX,d.maxX,l),k=R(t,c,i+p,i+y,0,d.minX,d.maxX,l);t=null,x&&(g=R(x,c,n-f,n+m,1,d.minY,d.maxY,l),b=R(x,c,n+p,n+y,1,d.minY,d.maxY,l),x=null),k&&(v=R(k,c,n-f,n+m,1,d.minY,d.maxY,l),w=R(k,c,n+p,n+y,1,d.minY,d.maxY,l),k=null),u>1&&console.timeEnd("clipping"),a.push(g||[],e+1,2*i,2*n),a.push(b||[],e+1,2*i,2*n+1),a.push(v||[],e+1,2*i+1,2*n),a.push(w||[],e+1,2*i+1,2*n+1)}}getTile(t,e,i){t=+t,e=+e,i=+i;const n=this.options,{extent:r,debug:o}=n,{hasAltitude:s}=n;if(t<0||t>24)return null;const a=1<<t,l=tt(t,e=e+a&a-1,i);if(this.tiles[l])return V(this.tiles[l],r,s);o>1&&console.log("drilling down to z%d-%d-%d",t,e,i);let u,c=t,h=e,d=i;for(;!u&&c>0;)c--,h>>=1,d>>=1,u=this.tiles[tt(c,h,d)];return u&&u.source?(o>1&&(console.log("found parent tile z%d-%d-%d",c,h,d),console.time("drilling down")),this.splitTile(u.source,c,h,d,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[l]?V(this.tiles[l],r,s):null):null}}function tt(t,e,i){return 32*((1<<t)*i+e)+t}function et(t,e,i,n,r,o){const s=i&&Array.isArray(i[0]);for(let a=0,l=i.length;a<l;a++){t[e]=Math.round((s?i[a][0]:i[a].x)*n),t[e+1]=Math.round((s?i[a][1]:i[a].y)*n);let u=r||0;Array.isArray(r)&&(u=r[a]),u=u?Math.round(n*u):0,t[e+2]=u,e+=3,o&&0!==a&&a!==l-1&&(t[e]=t[e-3],t[e+1]=t[e-2],t[e+2]=t[e-1],e+=3)}return e}function it(t,e,i,n){const r=t[3*e],o=t[3*e+1],s=t[3*i],a=t[3*i+1];return r===s&&(r<0||r>n)||o===a&&(o<0||o>n)}class nt{constructor(t,e){this.x=t,this.y=e}clone(){return new nt(this.x,this.y)}normalize(){const t=this.length();this.x/=t,this.y/=t}negate(){this.x=-this.x,this.y=-this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}diff(t){return new nt(this.x-t.x,this.y-t.y)}distance(t){const e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)}dot(t){return this.x*t.x+this.y*t.y}equals(t){return this.x===t.x&&this.y===t.y}orthogonal(){return new nt(this.y,-this.x)}}function rt(t,e,i){const n=(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x);return n>1e-5?1:n<-1e-5?2:0}function ot(t,e,i,n){const r=e.x*n.y-e.y*n.x,o=i.x-t.x,s=i.y-t.y,a=(o*n.y-s*n.x)/r;return new nt(t.x+a*e.x,t.y+a*e.y)}const st=[];function at(t,e,i){let n=0;const r=[];for(let o=e;o<i;o+=3)st[n]?(st[n].x=t[o],st[n].y=t[o+1]):st[n]=new nt(t[o],t[o+1]),r.push(st[n]),n++;const o=function(t){let e;this.UpdateOmbb=function(t,i,n,r,o,s,a,l){const u=ot(t,i,o,s),c=ot(n,r,o,s),h=ot(a,l,t,i),d=ot(a,l,n,r),f=u.distance(c)*u.distance(h);f<this.BestObbArea&&(e=[u,h,d,c],this.BestObbArea=f)},this.BestObbArea=Number.MAX_VALUE;const i=[];for(let e=0;e<t.length;e++)i.push(t[(e+1)%t.length].diff(t[e])),i[e].normalize();const n=new nt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new nt(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);let o,s,a,l;for(let e=0;e<t.length;e++){const i=t[e];i.x<n.x&&(n.x=i.x,o=e),i.x>r.x&&(r.x=i.x,s=e),i.y<n.y&&(n.y=i.y,l=e),i.y>r.y&&(r.y=i.y,a=e)}let u=new nt(0,-1),c=new nt(0,1),h=new nt(-1,0),d=new nt(1,0);for(let e=0;e<t.length;e++){const e=[Math.acos(u.dot(i[o])),Math.acos(c.dot(i[s])),Math.acos(h.dot(i[a])),Math.acos(d.dot(i[l]))];switch(e.indexOf(Math.min.apply(Math,e))){case 0:u=i[o].clone(),c=u.clone(),c.negate(),h=u.orthogonal(),d=h.clone(),d.negate(),o=(o+1)%t.length;break;case 1:c=i[s].clone(),u=c.clone(),u.negate(),h=u.orthogonal(),d=h.clone(),d.negate(),s=(s+1)%t.length;break;case 2:h=i[a].clone(),d=h.clone(),d.negate(),u=d.orthogonal(),c=u.clone(),c.negate(),a=(a+1)%t.length;break;case 3:d=i[l].clone(),h=d.clone(),h.negate(),u=d.orthogonal(),c=u.clone(),c.negate(),l=(l+1)%t.length}this.UpdateOmbb(t[o],u,t[s],c,t[a],h,t[l],d)}return e}(function(t){if(t.length<3)return t;let e=t[0];const i=[];for(let i=1;i<t.length;i++)(t[i].x<e.x||Math.abs(t[i].x-e.x)<1e-5&&t[i].y<e.y)&&(e=t[i]);let n=t[0];do{i.unshift(e.clone());for(let i=1;i<t.length;i++){const r=rt(e,n,t[i]);(n.equals(e)||1===r||0===r&&e.distance(t[i])>e.distance(n))&&(n=t[i])}e=n}while(!n.equals(i[i.length-1]));return i}(r)),s=o[0].distance(o[1]),a=o[1].distance(o[2]),l=o.map(t=>[t.x,t.y]);return l.push(+(a>s)),l}var lt="undefined"!=typeof Float32Array?Float32Array:Array;function ut(){var t=new lt(3);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ct(t,e,i){var n=new lt(3);return n[0]=t,n[1]=e,n[2]=i,n}function ht(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function dt(t,e,i,n){return t[0]=e,t[1]=i,t[2]=n,t}function ft(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function pt(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t}function mt(t,e){var i=e[0],n=e[1],r=e[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function yt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function gt(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2];return t[0]=r*l-o*a,t[1]=o*s-n*l,t[2]=n*a-r*s,t}var bt=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t};function vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function wt(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t}function xt(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}function kt(){var t=new lt(4);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Mt(t,e){var i=e[0]+e[4]+e[8],n=void 0;if(i>0)n=Math.sqrt(i+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var o=(r+1)%3,s=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*s+s]+1),t[r]=.5*n,n=.5/n,t[3]=(e[3*o+s]-e[3*s+o])*n,t[o]=(e[3*o+r]+e[3*r+o])*n,t[s]=(e[3*s+r]+e[3*r+s])*n}return t}ut(),function(){var t,e=(t=new lt(4),lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var jt,At=xt,Ft=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*i+n*n+r*r+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=i*s,t[1]=n*s,t[2]=r*s,t[3]=o*s),t};function Tt(t,e){var i=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(i*i+n*n)}ut(),ct(1,0,0),ct(0,1,0),kt(),kt(),jt=new lt(9),lt!=Float32Array&&(jt[1]=0,jt[2]=0,jt[3]=0,jt[5]=0,jt[6]=0,jt[7]=0),jt[0]=1,jt[4]=1,jt[8]=1;var zt=function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)};function St(t,e,i,n,r,o,s,a,l,u){0===t?function(t,e,i,n,r,o,s,a,l){const u=[0,0];for(let r=t;r<e;r+=3){const t=r/3*2,e=n[r],c=n[r+1];i[t]=u[0]+e*o*s/a,i[t+1]=u[1]-c*o*s/l}}(e,i,n,r,0,s,a,l,u):1===t&&function(t,e,i,n){const r=at(n,t,e),o=r[4],s=r[o],a=r[o+1],l=r[o+2],u=(a[1]-s[1])/(a[0]-s[0]),c=(l[1]-a[1])/(l[0]-a[0]),h=Tt(s,a),d=Tt(a,l);for(let r=t;r<e;r+=3){const t=r/3*2,e=n[r],o=n[r+1];i[t]=Pt(e,o,s,u,h),i[t+1]=-Pt(e,o,a,c,d)}}(e,i,n,r)}!function(){var t=function(){var t=new lt(2);return lt!=Float32Array&&(t[0]=0,t[1]=0),t}()}();const _t=[];function Pt(t,e,i,n,r){return _t[0]=(n*n*i[0]+n*(e-i[1])+t)/(n*n+1),_t[1]=n*(_t[0]-i[0])+i[1],Tt(i,_t)/r}function It(t,e,i,n,r){const o=3*e[i-1],s=3*e[i-1]+1,a=t[o],l=t[s];return u=n,c=r,h=a,d=l,Math.sqrt((h-u)*(h-u)+(d-c)*(d-c));var u,c,h,d}"undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self&&self;var Ot=qt;function qt(t,e){this.x=t,this.y=e}function Et(t,e,i){i=i||{},this.w=t||64,this.h=e||64,this.autoResize=!!i.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function Rt(t,e,i){this.x=0,this.y=t,this.w=this.free=e,this.h=i}function Ct(t,e,i,n,r,o,s){this.id=t,this.x=e,this.y=i,this.w=n,this.h=r,this.maxw=o||n,this.maxh=s||r,this.refcount=0}\n/*!\n Feature Filter by\n\n (c) mapbox 2016 and maptalks 2018\n www.mapbox.com | www.maptalks.org\n License: MIT, header required.\n */qt.prototype={clone:function(){return new qt(this.x,this.y)},add:function(t){return this.clone().u(t)},sub:function(t){return this.clone().m(t)},multByPoint:function(t){return this.clone().v(t)},divByPoint:function(t){return this.clone().k(t)},mult:function(t){return this.clone().M(t)},div:function(t){return this.clone().j(t)},rotate:function(t){return this.clone().A(t)},rotateAround:function(t,e){return this.clone().F(t,e)},matMult:function(t){return this.clone().T(t)},unit:function(){return this.clone().S()},perp:function(){return this.clone()._()},round:function(){return this.clone().P()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},T:function(t){var e=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=i,this},u:function(t){return this.x+=t.x,this.y+=t.y,this},m:function(t){return this.x-=t.x,this.y-=t.y,this},M:function(t){return this.x*=t,this.y*=t,this},j:function(t){return this.x/=t,this.y/=t,this},v:function(t){return this.x*=t.x,this.y*=t.y,this},k:function(t){return this.x/=t.x,this.y/=t.y,this},S:function(){return this.j(this.mag()),this},_:function(){var t=this.y;return this.y=this.x,this.x=-t,this},A:function(t){var e=Math.cos(t),i=Math.sin(t),n=e*this.x-i*this.y,r=i*this.x+e*this.y;return this.x=n,this.y=r,this},F:function(t,e){var i=Math.cos(t),n=Math.sin(t),r=e.x+i*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=r,this.y=o,this},P:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},qt.convert=function(t){return t instanceof qt?t:Array.isArray(t)?new qt(t[0],t[1]):t},Et.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var i,n,r,o,s=[],a=0;a<t.length;a++)if(i=t[a].w||t[a].width,n=t[a].h||t[a].height,r=t[a].id,i&&n){if(!(o=this.packOne(i,n,r)))continue;e.inPlace&&(t[a].x=o.x,t[a].y=o.y,t[a].id=o.id),s.push(o)}return this.shrink(),s},Et.prototype.packOne=function(t,e,i){var n,r,o,s,a,l,u,c,h={freebin:-1,shelf:-1,waste:1/0},d=0;if("string"==typeof i||"number"==typeof i){if(n=this.getBin(i))return this.ref(n),n;"number"==typeof i&&(this.maxId=Math.max(i,this.maxId))}else i=++this.maxId;for(s=0;s<this.freebins.length;s++){if(e===(n=this.freebins[s]).maxh&&t===n.maxw)return this.allocFreebin(s,t,e,i);e>n.maxh||t>n.maxw||e<=n.maxh&&t<=n.maxw&&(o=n.maxw*n.maxh-t*e)<h.waste&&(h.waste=o,h.freebin=s)}for(s=0;s<this.shelves.length;s++)if(d+=(r=this.shelves[s]).h,!(t>r.free)){if(e===r.h)return this.allocShelf(s,t,e,i);e>r.h||e<r.h&&(o=(r.h-e)*t)<h.waste&&(h.freebin=-1,h.waste=o,h.shelf=s)}return-1!==h.freebin?this.allocFreebin(h.freebin,t,e,i):-1!==h.shelf?this.allocShelf(h.shelf,t,e,i):e<=this.h-d&&t<=this.w?(r=new Rt(d,this.w,e),this.allocShelf(this.shelves.push(r)-1,t,e,i)):this.autoResize?(a=l=this.h,((u=c=this.w)<=a||t>u)&&(c=2*Math.max(t,u)),(a<u||e>a)&&(l=2*Math.max(e,a)),this.resize(c,l),this.packOne(t,e,i)):null},Et.prototype.allocFreebin=function(t,e,i,n){var r=this.freebins.splice(t,1)[0];return r.id=n,r.w=e,r.h=i,r.refcount=0,this.bins[n]=r,this.ref(r),r},Et.prototype.allocShelf=function(t,e,i,n){var r=this.shelves[t].alloc(e,i,n);return this.bins[n]=r,this.ref(r),r},Et.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,i=0;i<this.shelves.length;i++){var n=this.shelves[i];e+=n.h,t=Math.max(n.w-n.free,t)}this.resize(t,e)}},Et.prototype.getBin=function(t){return this.bins[t]},Et.prototype.ref=function(t){if(1==++t.refcount){var e=t.h;this.stats[e]=1+(0|this.stats[e])}return t.refcount},Et.prototype.unref=function(t){return 0===t.refcount?0:(0==--t.refcount&&(this.stats[t.h]--,delete this.bins[t.id],this.freebins.push(t)),t.refcount)},Et.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},Et.prototype.resize=function(t,e){this.w=t,this.h=e;for(var i=0;i<this.shelves.length;i++)this.shelves[i].resize(t);return!0},Rt.prototype.alloc=function(t,e,i){if(t>this.free||e>this.h)return null;var n=this.x;return this.x+=t,this.free-=t,new Ct(i,n,this.y,t,e,t,this.h)},Rt.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0};const Nt=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function Lt(t){return new Function("f","var p = (f && f.properties || {}); return "+Dt(t))}function Dt(t){if(!t)return"true";const e=t[0];if(t.length<=1)return"any"===e?"false":"true";return`(${"=="===e?$t(t[1],t[2],"===",!1):"!="===e?$t(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?$t(t[1],t[2],e,!0):"any"===e?Wt(t.slice(1),"||"):"all"===e?Wt(t.slice(1),"&&"):"none"===e?Gt(Wt(t.slice(1),"||")):"in"===e?Jt(t[1],t.slice(2)):"!in"===e?Gt(Jt(t[1],t.slice(2))):"has"===e?Ht(t[1]):"!has"===e?Gt(Ht(t[1])):"true"})`}function Ut(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function $t(t,e,i,n){const r=Ut(t),o="$type"===t?Nt.indexOf(e):JSON.stringify(e);return(n?`typeof ${r}=== typeof ${o}&&`:"")+r+i+o}function Wt(t,e){return t.map(Dt).join(e)}function Jt(t,e){"$type"===t&&(e=e.map(t=>Nt.indexOf(t)));const i=JSON.stringify(e.sort(Vt)),n=Ut(t);return e.length<=200?`${i}.indexOf(${n}) !== -1`:`function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(${n}, ${i},0,${e.length-1})`}function Ht(t){return"$id"===t?\'"id" in f\':JSON.stringify(t)+" in p"}function Gt(t){return`!(${t})`}function Vt(t,e){return t<e?-1:t>e?1:0}var Bt={exports:{}};Bt.exports=function(){function t(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function e(t,e){return t<e?-1:t>e?1:0}return function(i,n,r,o,s){!function e(i,n,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,l=n-r+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1),d=Math.max(r,Math.floor(n-l*c/a+h)),f=Math.min(o,Math.floor(n+(a-l)*c/a+h));e(i,n,d,f,s)}var p=i[n],m=r,y=o;for(t(i,r,n),s(i[o],p)>0&&t(i,r,o);m<y;){for(t(i,m,y),m++,y--;s(i[m],p)<0;)m++;for(;s(i[y],p)>0;)y--}0===s(i[r],p)?t(i,r,y):(y++,t(i,y,o)),y<=n&&(r=y+1),n<=y&&(o=y-1)}}(i,n,r||0,o||i.length-1,s||e)}}();var Xt=Bt.exports,Zt={exports:{}};function Yt(t,e){if(!(this instanceof Yt))return new Yt(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||Kt,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this.I(i)}function Kt(t,e){return t<e?-1:t>e?1:0}Zt.exports=Yt,Zt.exports.default=Yt,Yt.prototype={push:function(t){this.data.push(t),this.length++,this.O(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this.I(0)),this.data.pop(),t}},peek:function(){return this.data[0]},O:function(t){for(var e=this.data,i=this.compare,n=e[t];t>0;){var r=t-1>>1,o=e[r];if(i(n,o)>=0)break;e[t]=o,t=r}e[t]=n},I:function(t){for(var e=this.data,i=this.compare,n=this.length>>1,r=e[t];t<n;){var o=1+(t<<1),s=o+1,a=e[o];if(s<this.length&&i(e[s],a)<0&&(o=s,a=e[s]),i(a,r)>=0)break;e[t]=a,t=o}e[t]=r}};var Qt=Zt.exports,te={exports:{}},ee={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]},ie={exports:{}},ne=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},re=Array.prototype.concat,oe=Array.prototype.slice,se=ie.exports=function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];ne(r)?e=re.call(e,oe.call(r)):e.push(r)}return e};se.wrap=function(t){return function(){return t(se(arguments))}};var ae=ee,le=ie.exports,ue=Object.hasOwnProperty,ce={};for(var he in ae)ue.call(ae,he)&&(ce[ae[he]]=he);var de=te.exports={to:{},get:{}};function fe(t,e,i){return Math.min(Math.max(e,t),i)}function pe(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}de.get=function(t){var e,i;switch(t.substring(0,3).toLowerCase()){case"hsl":e=de.get.hsl(t),i="hsl";break;case"hwb":e=de.get.hwb(t),i="hwb";break;default:e=de.get.rgb(t),i="rgb"}return e?{model:i,value:e}:null},de.get.rgb=function(t){if(!t)return null;var e,i,n,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(n=e[2],e=e[1],i=0;i<3;i++){var o=2*i;r[i]=parseInt(e.slice(o,o+2),16)}n&&(r[3]=parseInt(n,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(n=(e=e[1])[3],i=0;i<3;i++)r[i]=parseInt(e[i]+e[i],16);n&&(r[3]=parseInt(n+n,16)/255)}else if(e=t.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)){for(i=0;i<3;i++)r[i]=parseInt(e[i+1],0);e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)))return(e=t.match(/^(\\w+)$/))?"transparent"===e[1]?[0,0,0,0]:ue.call(ae,e[1])?((r=ae[e[1]])[3]=1,r):null:null;for(i=0;i<3;i++)r[i]=Math.round(2.55*parseFloat(e[i+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(i=0;i<3;i++)r[i]=fe(r[i],0,255);return r[3]=fe(r[3],0,1),r},de.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);if(e){var i=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,fe(parseFloat(e[2]),0,100),fe(parseFloat(e[3]),0,100),fe(isNaN(i)?1:i,0,1)]}return null},de.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);if(e){var i=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,fe(parseFloat(e[2]),0,100),fe(parseFloat(e[3]),0,100),fe(isNaN(i)?1:i,0,1)]}return null},de.to.hex=function(){var t=le(arguments);return"#"+pe(t[0])+pe(t[1])+pe(t[2])+(t[3]<1?pe(Math.round(255*t[3])):"")},de.to.rgb=function(){var t=le(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},de.to.rgb.percent=function(){var t=le(arguments),e=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+i+"%, "+n+"%)":"rgba("+e+"%, "+i+"%, "+n+"%, "+t[3]+")"},de.to.hsl=function(){var t=le(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},de.to.hwb=function(){var t=le(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},de.to.keyword=function(t){return ce[t.slice(0,3)]};var me={exports:{}},ye=ee,ge={};for(var be in ye)ye.hasOwnProperty(be)&&(ge[ye[be]]=be);var ve=me.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var we in ve)if(ve.hasOwnProperty(we)){if(!("channels"in ve[we]))throw new Error("missing channels property: "+we);if(!("labels"in ve[we]))throw new Error("missing channel labels property: "+we);if(ve[we].labels.length!==ve[we].channels)throw new Error("channel and label counts mismatch: "+we);var xe=ve[we].channels,ke=ve[we].labels;delete ve[we].channels,delete ve[we].labels,Object.defineProperty(ve[we],"channels",{value:xe}),Object.defineProperty(ve[we],"labels",{value:ke})}function Me(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}ve.rgb.hsl=function(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s;return a===s?e=0:n===a?e=(r-o)/l:r===a?e=2+(o-n)/l:o===a&&(e=4+(n-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(s+a)/2,[e,100*(a===s?0:i<=.5?l/(a+s):l/(2-a-s)),100*i]},ve.rgb.hsv=function(t){var e,i,n,r,o,s=t[0]/255,a=t[1]/255,l=t[2]/255,u=Math.max(s,a,l),c=u-Math.min(s,a,l),h=function(t){return(u-t)/6/c+.5};return 0===c?r=o=0:(o=c/u,e=h(s),i=h(a),n=h(l),s===u?r=n-i:a===u?r=1/3+e-n:l===u&&(r=2/3+i-e),r<0?r+=1:r>1&&(r-=1)),[360*r,100*o,100*u]},ve.rgb.hwb=function(t){var e=t[0],i=t[1],n=t[2];return[ve.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(i,n))),100*(n=1-1/255*Math.max(e,Math.max(i,n)))]},ve.rgb.cmyk=function(t){var e,i=t[0]/255,n=t[1]/255,r=t[2]/255;return[100*((1-i-(e=Math.min(1-i,1-n,1-r)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-r-e)/(1-e)||0),100*e]},ve.rgb.keyword=function(t){var e=ge[t];if(e)return e;var i,n=1/0;for(var r in ye)if(ye.hasOwnProperty(r)){var o=Me(t,ye[r]);o<n&&(n=o,i=r)}return i},ve.keyword.rgb=function(t){return ye[t]},ve.rgb.xyz=function(t){var e=t[0]/255,i=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*i+.0722*n),100*(.0193*e+.1192*i+.9505*n)]},ve.rgb.lab=function(t){var e=ve.rgb.xyz(t),i=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(i-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},ve.hsl.rgb=function(t){var e,i,n,r,o,s=t[0]/360,a=t[1]/100,l=t[2]/100;if(0===a)return[o=255*l,o,o];e=2*l-(i=l<.5?l*(1+a):l+a-l*a),r=[0,0,0];for(var u=0;u<3;u++)(n=s+1/3*-(u-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,r[u]=255*o;return r},ve.hsl.hsv=function(t){var e=t[0],i=t[1]/100,n=t[2]/100,r=i,o=Math.max(n,.01);return i*=(n*=2)<=1?n:2-n,r*=o<=1?o:2-o,[e,100*(0===n?2*r/(o+r):2*i/(n+i)),100*((n+i)/2)]},ve.hsv.rgb=function(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,r=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-i),a=255*n*(1-i*o),l=255*n*(1-i*(1-o));switch(n*=255,r){case 0:return[n,l,s];case 1:return[a,n,s];case 2:return[s,n,l];case 3:return[s,a,n];case 4:return[l,s,n];case 5:return[n,s,a]}},ve.hsv.hsl=function(t){var e,i,n,r=t[0],o=t[1]/100,s=t[2]/100,a=Math.max(s,.01);return n=(2-o)*s,i=o*a,[r,100*(i=(i/=(e=(2-o)*a)<=1?e:2-e)||0),100*(n/=2)]},ve.hwb.rgb=function(t){var e,i,n,r,o,s,a,l=t[0]/360,u=t[1]/100,c=t[2]/100,h=u+c;switch(h>1&&(u/=h,c/=h),n=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(n=1-n),r=u+n*((i=1-c)-u),e){default:case 6:case 0:o=i,s=r,a=u;break;case 1:o=r,s=i,a=u;break;case 2:o=u,s=i,a=r;break;case 3:o=u,s=r,a=i;break;case 4:o=r,s=u,a=i;break;case 5:o=i,s=u,a=r}return[255*o,255*s,255*a]},ve.cmyk.rgb=function(t){var e=t[0]/100,i=t[1]/100,n=t[2]/100,r=t[3]/100;return[255*(1-Math.min(1,e*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r))]},ve.xyz.rgb=function(t){var e,i,n,r=t[0]/100,o=t[1]/100,s=t[2]/100;return i=-.9689*r+1.8758*o+.0415*s,n=.0557*r+-.204*o+1.057*s,e=(e=3.2406*r+-1.5372*o+-.4986*s)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1))]},ve.xyz.lab=function(t){var e=t[0],i=t[1],n=t[2];return i/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(e-i),200*(i-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},ve.lab.xyz=function(t){var e,i,n,r=t[0];e=t[1]/500+(i=(r+16)/116),n=i-t[2]/200;var o=Math.pow(i,3),s=Math.pow(e,3),a=Math.pow(n,3);return i=o>.008856?o:(i-16/116)/7.787,e=s>.008856?s:(e-16/116)/7.787,n=a>.008856?a:(n-16/116)/7.787,[e*=95.047,i*=100,n*=108.883]},ve.lab.lch=function(t){var e,i=t[0],n=t[1],r=t[2];return(e=360*Math.atan2(r,n)/2/Math.PI)<0&&(e+=360),[i,Math.sqrt(n*n+r*r),e]},ve.lch.lab=function(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]},ve.rgb.ansi16=function(t){var e=t[0],i=t[1],n=t[2],r=1 in arguments?arguments[1]:ve.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},ve.hsv.ansi16=function(t){return ve.rgb.ansi16(ve.hsv.rgb(t),t[2])},ve.rgb.ansi256=function(t){var e=t[0],i=t[1],n=t[2];return e===i&&i===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5)},ve.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var i=.5*(1+~~(t>50));return[(1&e)*i*255,(e>>1&1)*i*255,(e>>2&1)*i*255]},ve.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var i;return t-=16,[Math.floor(t/36)/5*255,Math.floor((i=t%36)/6)/5*255,i%6/5*255]},ve.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},ve.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var i=e[0];3===e[0].length&&(i=i.split("").map((function(t){return t+t})).join(""));var n=parseInt(i,16);return[n>>16&255,n>>8&255,255&n]},ve.rgb.hcg=function(t){var e,i=t[0]/255,n=t[1]/255,r=t[2]/255,o=Math.max(Math.max(i,n),r),s=Math.min(Math.min(i,n),r),a=o-s;return e=a<=0?0:o===i?(n-r)/a%6:o===n?2+(r-i)/a:4+(i-n)/a+4,e/=6,[360*(e%=1),100*a,100*(a<1?s/(1-a):0)]},ve.hsl.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=1,r=0;return(n=i<.5?2*e*i:2*e*(1-i))<1&&(r=(i-.5*n)/(1-n)),[t[0],100*n,100*r]},ve.hsv.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=e*i,r=0;return n<1&&(r=(i-n)/(1-n)),[t[0],100*n,100*r]},ve.hcg.rgb=function(t){var e=t[0]/360,i=t[1]/100,n=t[2]/100;if(0===i)return[255*n,255*n,255*n];var r,o=[0,0,0],s=e%1*6,a=s%1,l=1-a;switch(Math.floor(s)){case 0:o[0]=1,o[1]=a,o[2]=0;break;case 1:o[0]=l,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=a;break;case 3:o[0]=0,o[1]=l,o[2]=1;break;case 4:o[0]=a,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=l}return r=(1-i)*n,[255*(i*o[0]+r),255*(i*o[1]+r),255*(i*o[2]+r)]},ve.hcg.hsv=function(t){var e=t[1]/100,i=e+t[2]/100*(1-e),n=0;return i>0&&(n=e/i),[t[0],100*n,100*i]},ve.hcg.hsl=function(t){var e=t[1]/100,i=t[2]/100*(1-e)+.5*e,n=0;return i>0&&i<.5?n=e/(2*i):i>=.5&&i<1&&(n=e/(2*(1-i))),[t[0],100*n,100*i]},ve.hcg.hwb=function(t){var e=t[1]/100,i=e+t[2]/100*(1-e);return[t[0],100*(i-e),100*(1-i)]},ve.hwb.hcg=function(t){var e=t[1]/100,i=1-t[2]/100,n=i-e,r=0;return n<1&&(r=(i-n)/(1-n)),[t[0],100*n,100*r]},ve.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},ve.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},ve.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},ve.gray.hsl=ve.gray.hsv=function(t){return[0,0,t[0]]},ve.gray.hwb=function(t){return[0,100,t[0]]},ve.gray.cmyk=function(t){return[0,0,0,t[0]]},ve.gray.lab=function(t){return[t[0],0,0]},ve.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i},ve.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};var je=me.exports;function Ae(t){var e=function(){for(var t={},e=Object.keys(je),i=e.length,n=0;n<i;n++)t[e[n]]={distance:-1,parent:null};return t}(),i=[t];for(e[t].distance=0;i.length;)for(var n=i.pop(),r=Object.keys(je[n]),o=r.length,s=0;s<o;s++){var a=r[s],l=e[a];-1===l.distance&&(l.distance=e[n].distance+1,l.parent=n,i.unshift(a))}return e}function Fe(t,e){return function(i){return e(t(i))}}function Te(t,e){for(var i=[e[t].parent,t],n=je[e[t].parent][t],r=e[t].parent;e[r].parent;)i.unshift(e[r].parent),n=Fe(je[e[r].parent][r],n),r=e[r].parent;return n.conversion=i,n}var ze=me.exports,Se=function(t){for(var e=Ae(t),i={},n=Object.keys(e),r=n.length,o=0;o<r;o++){var s=n[o];null!==e[s].parent&&(i[s]=Te(s,e))}return i},_e={};Object.keys(ze).forEach((function(t){_e[t]={},Object.defineProperty(_e[t],"channels",{value:ze[t].channels}),Object.defineProperty(_e[t],"labels",{value:ze[t].labels});var e=Se(t);Object.keys(e).forEach((function(i){var n=e[i];_e[t][i]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var i=t(e);if("object"==typeof i)for(var n=i.length,r=0;r<n;r++)i[r]=Math.round(i[r]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}(n),_e[t][i].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(n)}))}));var Pe=_e,Ie=te.exports,Oe=Pe,qe=[].slice,Ee=["keyword","gray","hex"],Re={};Object.keys(Oe).forEach((function(t){Re[qe.call(Oe[t].labels).sort().join("")]=t}));var Ce={};function Ne(t,e){if(!(this instanceof Ne))return new Ne(t,e);if(e&&e in Ee&&(e=null),e&&!(e in Oe))throw new Error("Unknown model: "+e);var i,n;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof Ne)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var r=Ie.get(t);if(null===r)throw new Error("Unable to parse color from string: "+t);this.model=r.model,n=Oe[this.model].channels,this.color=r.value.slice(0,n),this.valpha="number"==typeof r.value[n]?r.value[n]:1}else if(t.length){this.model=e||"rgb",n=Oe[this.model].channels;var o=qe.call(t,0,n);this.color=$e(o,n),this.valpha="number"==typeof t[n]?t[n]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var s=Object.keys(t);"alpha"in t&&(s.splice(s.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var a=s.sort().join("");if(!(a in Re))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Re[a];var l=Oe[this.model].labels,u=[];for(i=0;i<l.length;i++)u.push(t[l[i]]);this.color=$e(u)}if(Ce[this.model])for(n=Oe[this.model].channels,i=0;i<n;i++){var c=Ce[this.model][i];c&&(this.color[i]=c(this.color[i]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function Le(t,e,i){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(Ce[t]||(Ce[t]=[]))[e]=i})),t=t[0],function(n){var r;return arguments.length?(i&&(n=i(n)),(r=this[t]()).color[e]=n,r):(r=this[t]().color[e],i&&(r=i(r)),r)}}function De(t){return function(e){return Math.max(0,Math.min(t,e))}}function Ue(t){return Array.isArray(t)?t:[t]}function $e(t,e){for(var i=0;i<e;i++)"number"!=typeof t[i]&&(t[i]=0);return t}Ne.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in Ie.to?this:this.rgb(),i=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return Ie.to[e.model](i)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),i=1===e.valpha?e.color:e.color.concat(this.valpha);return Ie.to.rgb.percent(i)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=Oe[this.model].channels,i=Oe[this.model].labels,n=0;n<e;n++)t[i[n]]=this.color[n];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new Ne(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new Ne(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:Le("rgb",0,De(255)),green:Le("rgb",1,De(255)),blue:Le("rgb",2,De(255)),hue:Le(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:Le("hsl",1,De(100)),lightness:Le("hsl",2,De(100)),saturationv:Le("hsv",1,De(100)),value:Le("hsv",2,De(100)),chroma:Le("hcg",1,De(100)),gray:Le("hcg",2,De(100)),white:Le("hwb",1,De(100)),wblack:Le("hwb",2,De(100)),cyan:Le("cmyk",0,De(100)),magenta:Le("cmyk",1,De(100)),yellow:Le("cmyk",2,De(100)),black:Le("cmyk",3,De(100)),x:Le("xyz",0,De(100)),y:Le("xyz",1,De(100)),z:Le("xyz",2,De(100)),l:Le("lab",0,De(100)),a:Le("lab",1),b:Le("lab",2),keyword:function(t){return arguments.length?new Ne(t):Oe[this.model].keyword(this.color)},hex:function(t){return arguments.length?new Ne(t):Ie.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,e=[],i=0;i<t.length;i++){var n=t[i]/255;e[i]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(e+.05)/(i+.05):(i+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return Ne.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),i=e.color[0];return i=(i=(i+t)%360)<0?360+i:i,e.color[0]=i,e},mix:function(t,e){if(!t||!t.rgb)throw new Error(\'Argument to "mix" was not a Color instance, but rather an instance of \'+typeof t);var i=t.rgb(),n=this.rgb(),r=void 0===e?.5:e,o=2*r-1,s=i.alpha()-n.alpha(),a=((o*s==-1?o:(o+s)/(1+o*s))+1)/2,l=1-a;return Ne.rgb(a*i.red()+l*n.red(),a*i.green()+l*n.green(),a*i.blue()+l*n.blue(),i.alpha()*r+n.alpha()*(1-r))}},Object.keys(Oe).forEach((function(t){if(-1===Ee.indexOf(t)){var e=Oe[t].channels;Ne.prototype[t]=function(){if(this.model===t)return new Ne(this);if(arguments.length)return new Ne(arguments,t);var i="number"==typeof arguments[e]?e:this.valpha;return new Ne(Ue(Oe[this.model][t].raw(this.color)).concat(i),t)},Ne[t]=function(i){return"number"==typeof i&&(i=$e(qe.call(arguments),e)),new Ne(i,t)}}}));var We=Ne;class Je{constructor(t,e){this.position=t,this.index=e,this.faces=[],this.neighbors=[]}addUniqueNeighbor(t){-1===this.neighbors.indexOf(t)&&this.neighbors.push(t)}}class He{constructor(t,e,i,n){this.a=n.a,this.b=n.b,this.c=n.c,this.v1=t,this.v2=e,this.v3=i,this.normal=[],this.computeNormal(),t.faces.push(this),t.addUniqueNeighbor(e),t.addUniqueNeighbor(i),e.faces.push(this),e.addUniqueNeighbor(t),e.addUniqueNeighbor(i),i.faces.push(this),i.addUniqueNeighbor(t),i.addUniqueNeighbor(e)}computeNormal(){const t=this.v1.position,e=this.v2.position,i=this.v3.position,n=gt([],bt([],i,e),bt([],t,e));mt(this.normal,n)}hasVertex(t){return t===this.v1||t===this.v2||t===this.v3}}\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */const Ge=[],Ve=[],Be=[],Xe=[];function Ze(t,e,i){const n=gt(Ve,e,i);t=Mt(t,function(t,e,i,n,r,o,s,a,l,u){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t}(Ge,i[0],i[1],i[2],...n,...e));if((t=function(t){return t[3]<0?At(t,t,-1):t}(t=Ft(t,t)))[3]<1/32767){t[3]=1/32767;const e=Math.sqrt(.9999999990686206);t[0]*=e,t[1]*=e,t[2]*=e}const r=i[3]>0?gt(Be,i,e):gt(Be,e,i);return yt(gt(Xe,i,e),r)<0&&At(t,t,-1),t}function Ye(t,e){const i=[],n=[];let r=0;for(r=0;r<t.length;r+=3){const e=new Je([t[r],t[r+1],t[r+2]],r/3);i.push(e)}if(!e.length){const t=e;e=[];for(let i=0;i<t;i++)e.push(i)}for(r=0;r<e.length/3;r++){const t={a:e[3*r],b:e[3*r+1],c:e[3*r+2]};new He(i[t.a],i[t.b],i[t.c],t)}const o=[],s=[0,0,0];for(r=0;r<i.length;r++){const t=i[r],e=t.index;dt(s,0,0,0);let a=t.faces.length;for(let e=0;e<a;e++)ft(s,s,t.faces[e].normal);a=a||1,dt(o,a,a,a),pt(s,s,o),n[3*e]=s[0],n[3*e+1]=s[1],n[3*e+2]=s[2]}return n}\n/*!\n * Contains code from THREE.JS\n * https://github.com/mrdoob/three.js/\n * License MIT\n * \n * Generate tangents per vertex.\n */function Ke(t,e,i){return t[0]=e[i],t[1]=e[i+1],t[2]=e[i+2],t}function Qe(t,e,i){return t[0]=e[i],t[1]=e[i+1],t}var ti={exports:{}};function ei(t,e,i){i=i||2;var n,r,o,s,a,l,u,c=e&&e.length,h=c?e[0]*i:t.length,d=ii(t,0,h,i,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(t,e,i,n){var r,o,s,a,l,u=[];for(r=0,o=e.length;r<o;r++)s=e[r]*n,a=r<o-1?e[r+1]*n:t.length,(l=ii(t,s,a,n,!1))===l.next&&(l.steiner=!0),u.push(fi(l));for(u.sort(ui),r=0;r<u.length;r++)i=ci(u[r],i);return i}(t,e,d,i)),t.length>80*i){n=o=t[0],r=s=t[1];for(var p=i;p<h;p+=i)(a=t[p])<n&&(n=a),(l=t[p+1])<r&&(r=l),a>o&&(o=a),l>s&&(s=l);u=0!==(u=Math.max(o-n,s-r))?32767/u:0}return ri(d,f,i,n,r,u,0),f}function ii(t,e,i,n,r){var o,s;if(r===Fi(t,e,i,n)>0)for(o=e;o<i;o+=n)s=Mi(o,t[o],t[o+1],s);else for(o=i-n;o>=e;o-=n)s=Mi(o,t[o],t[o+1],s);return s&&gi(s,s.next)&&(ji(s),s=s.next),s}function ni(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!gi(n,n.next)&&0!==yi(n.prev,n,n.next))n=n.next;else{if(ji(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function ri(t,e,i,n,r,o,s){if(t){!s&&o&&function(t,e,i,n){var r=t;do{0===r.z&&(r.z=di(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,o,s,a,l,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,n=i,a=0,e=0;e<u&&(a++,n=n.nextZ);e++);for(l=u;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,u*=2}while(s>1)}(r)}(t,n,r,o);for(var a,l,u=t;t.prev!==t.next;)if(a=t.prev,l=t.next,o?si(t,n,r,o):oi(t))e.push(a.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),ji(t),t=l.next,u=l.next;else if((t=l)===u){s?1===s?ri(t=ai(ni(t),e,i),e,i,n,r,o,2):2===s&&li(t,e,i,n,r,o):ri(ni(t),e,i,n,r,o,1);break}}}function oi(t){var e=t.prev,i=t,n=t.next;if(yi(e,i,n)>=0)return!1;for(var r=e.x,o=i.x,s=n.x,a=e.y,l=i.y,u=n.y,c=r<o?r<s?r:s:o<s?o:s,h=a<l?a<u?a:u:l<u?l:u,d=r>o?r>s?r:s:o>s?o:s,f=a>l?a>u?a:u:l>u?l:u,p=n.next;p!==e;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&pi(r,a,o,l,s,u,p.x,p.y)&&yi(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function si(t,e,i,n){var r=t.prev,o=t,s=t.next;if(yi(r,o,s)>=0)return!1;for(var a=r.x,l=o.x,u=s.x,c=r.y,h=o.y,d=s.y,f=a<l?a<u?a:u:l<u?l:u,p=c<h?c<d?c:d:h<d?h:d,m=a>l?a>u?a:u:l>u?l:u,y=c>h?c>d?c:d:h>d?h:d,g=di(f,p,e,i,n),b=di(m,y,e,i,n),v=t.prevZ,w=t.nextZ;v&&v.z>=g&&w&&w.z<=b;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=y&&v!==r&&v!==s&&pi(a,c,l,h,u,d,v.x,v.y)&&yi(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,w.x>=f&&w.x<=m&&w.y>=p&&w.y<=y&&w!==r&&w!==s&&pi(a,c,l,h,u,d,w.x,w.y)&&yi(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;v&&v.z>=g;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=y&&v!==r&&v!==s&&pi(a,c,l,h,u,d,v.x,v.y)&&yi(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;w&&w.z<=b;){if(w.x>=f&&w.x<=m&&w.y>=p&&w.y<=y&&w!==r&&w!==s&&pi(a,c,l,h,u,d,w.x,w.y)&&yi(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function ai(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!gi(r,o)&&bi(r,n,n.next,o)&&xi(r,o)&&xi(o,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(o.i/i|0),ji(n),ji(n.next),n=t=o),n=n.next}while(n!==t);return ni(n)}function li(t,e,i,n,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&mi(s,a)){var l=ki(s,a);return s=ni(s,s.next),l=ni(l,l.next),ri(s,e,i,n,r,o,0),void ri(l,e,i,n,r,o,0)}a=a.next}s=s.next}while(s!==t)}function ui(t,e){return t.x-e.x}function ci(t,e){var i=function(t,e){var i,n=e,r=t.x,o=t.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>s&&(s=a,i=n.x<n.next.x?n:n.next,a===r))return i}n=n.next}while(n!==e);if(!i)return null;var l,u=i,c=i.x,h=i.y,d=1/0;n=i;do{r>=n.x&&n.x>=c&&r!==n.x&&pi(o<h?r:s,o,c,h,o<h?s:r,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(r-n.x),xi(n,t)&&(l<d||l===d&&(n.x>i.x||n.x===i.x&&hi(i,n)))&&(i=n,d=l)),n=n.next}while(n!==u);return i}(t,e);if(!i)return e;var n=ki(i,t);return ni(n,n.next),ni(i,i.next)}function hi(t,e){return yi(t.prev,t,e.prev)<0&&yi(e.next,t,t.next)<0}function di(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function fi(t){var 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 pi(t,e,i,n,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(n-a)>=(i-s)*(e-a)&&(i-s)*(o-a)>=(r-s)*(n-a)}function mi(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&bi(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(xi(t,e)&&xi(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(yi(t.prev,t,e.prev)||yi(t,e.prev,e))||gi(t,e)&&yi(t.prev,t,t.next)>0&&yi(e.prev,e,e.next)>0)}function yi(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function gi(t,e){return t.x===e.x&&t.y===e.y}function bi(t,e,i,n){var r=wi(yi(t,e,i)),o=wi(yi(t,e,n)),s=wi(yi(i,n,t)),a=wi(yi(i,n,e));return r!==o&&s!==a||(!(0!==r||!vi(t,i,e))||(!(0!==o||!vi(t,n,e))||(!(0!==s||!vi(i,t,n))||!(0!==a||!vi(i,e,n)))))}function vi(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 wi(t){return t>0?1:t<0?-1:0}function xi(t,e){return yi(t.prev,t,t.next)<0?yi(t,e,t.next)>=0&&yi(t,t.prev,e)>=0:yi(t,e,t.prev)<0||yi(t,t.next,e)<0}function ki(t,e){var i=new Ai(t.i,t.x,t.y),n=new Ai(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function Mi(t,e,i,n){var r=new Ai(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function ji(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 Ai(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Fi(t,e,i,n){for(var r=0,o=e,s=i-n;o<i;o+=n)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}ti.exports=ei,ti.exports.default=ei,ei.deviation=function(t,e,i,n){var r=e&&e.length,o=r?e[0]*i:t.length,s=Math.abs(Fi(t,0,o,i));if(r)for(var a=0,l=e.length;a<l;a++){var u=e[a]*i,c=a<l-1?e[a+1]*i:t.length;s-=Math.abs(Fi(t,u,c,i))}var h=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,f=n[a+1]*i,p=n[a+2]*i;h+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},ei.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)i.vertices.push(t[r][o][s]);r>0&&(n+=t[r-1].length,i.holes.push(n))}return i};var Ti=ti.exports;\n/*!\n * @maptalks/vector-packer v0.70.0\n * LICENSE : UNLICENSED\n * (c) 2016-2022 maptalks.com\n */const zi={Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6};function Si(t,e={}){var i=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)_i(i,t.features[n],e,n);else _i(i,"Feature"===t.type?t:{geometry:t},e);return i}function _i(t,e,i,n){if(e.geometry&&e.geometry.geometry){var r=e.geometry.coordinates,o=e.geometry.type,s=[],a=e.id;if(i.promoteId?a=e.properties[i.promoteId]:i.generateId&&(a=n||0),"Point"===o)Pi(r,s);else if("MultiPoint"===o)for(var l=0;l<r.length;l++)Pi(r[l],s);else if("LineString"===o)Oi([r],s);else if("MultiLineString"===o){if(i.lineMetrics){for(l=0;l<r.length;l++)Ii(r[l],s=[]),t.push(qi(a,"LineString",s,e.properties));return}Oi(r,s)}else if("Polygon"===o)Oi(r,s);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)_i(t,{id:a,geometry:e.geometry.geometries[l],properties:e.properties},i,n);return}return void console.warn(`Input data type(${o}) is not a valid GeoJSON geometry type.`)}for(l=0;l<r.length;l++){var u=[];Oi(r[l],u),s.push(u)}}t.push(qi(a,o,s,e.properties))}}function Pi(t,e){const i=new Ot(t[0],t[1]);i.z=100*(t[2]||0),e.push([i])}function Ii(t,e){for(let i=0;i<t.length;i++){const n=new Ot(t[i][0],t[i][1]);n.z=100*(t[i][2]||0),e.push(n)}}function Oi(t,e,i,n){for(var r=0;r<t.length;r++){var o=[];Ii(t[r],o),e.push(o)}}function qi(t,e,i,n){return{id:void 0===t?null:t,type:zi[e],geometry:i,properties:n}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */function Ei(t,{width:e,height:i},n,r){if(r){if(r.length!==e*i*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(e*i*n);return t.width=e,t.height=i,t.data=r,t}function Ri(t,{width:e,height:i},n){if(e===t.width&&i===t.height)return;const r=Ei({},{width:e,height:i},n);Ci(t,r,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},n),t.width=e,t.height=i,t.data=r.data}function Ci(t,e,i,n,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||n.x>e.width-r.width||n.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");const s=t.data,a=e.data;if(s===a)return e;for(let l=0;l<r.height;l++){const u=((i.y+l)*t.width+i.x)*o,c=((n.y+l)*e.width+n.x)*o;for(let t=0;t<r.width*o;t++)a[c+t]=s[u+t]}return e}class Ni{constructor(t,e){Ei(this,t,1,e)}resize(t){Ri(this,t,1)}clone(){return new Ni({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,n,r){Ci(t,e,i,n,r,1)}}class Li{constructor(t,e){Ei(this,t,4,e)}resize(t){Ri(this,t,4)}clone(){return new Li({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,n,r){Ci(t,e,i,n,r,4)}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */class Di{constructor(t,{pixelRatio:e}){this.paddedRect=t,this.pixelRatio=e||1}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Ui{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,e={},i=new Et(0,0,{autoResize:!0}),n=[];for(const i in t){const r=t[i],o={x:0,y:0,w:r.data.width+2,h:r.data.height+2};n.push(o),e[i]=new Di(o,r)}if(i.pack(n,{inPlace:!0}),!$i(i.w)||!$i(i.h)){const t=Wi(i.w),e=Wi(i.h);i.resize(t,e)}const r=new Li({width:i.w,height:i.h});for(const i in t){const n=t[i],o=e[i].paddedRect;Li.copy(n.data,r,{x:0,y:0},{x:o.x+1,y:o.y+1},n.data)}this.image=r,this.positions=e}}function $i(t){return 0==(t&t-1)&&0!==t}function Wi(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n * TODO 升级为potpack\n */class Ji{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,e={},i=new Et(0,0,{autoResize:!0}),n=[];for(const i in t){const r=t[i],o=e[i]={};for(const t in r){const e=r[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const i={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};n.push(i),o[t]={rect:i,metrics:e.metrics}}}i.pack(n,{inPlace:!0});const r=new Ni({width:i.w,height:i.h});for(const i in t){const n=t[i];for(const t in n){const o=n[+t];if(!o||0===o.bitmap.width||0===o.bitmap.height)continue;const s=e[i][t].rect;Ni.copy(o.bitmap,r,{x:0,y:0},{x:s.x+1,y:s.y+1},o.bitmap)}}this.image=r,this.positions=e}}function Hi(t){return t<65536?Uint16Array:Uint32Array}function Gi(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function Vi(t){return t<256?Uint8Array:t<65536?Uint16Array:Float32Array}function Bi(t){const e=t.type,i=[];if(1===e||4===e)for(let e=0;e<t.geometry.length;e++)Pi(t.geometry[e],i);else if(2===e)Oi(t.geometry,i);else if(3===e)Oi(t.geometry,i);else if(5===e)Oi(t.geometry,i);else if(6===e)for(let e=0;e<t.geometry.length;e++){const n=[];Oi(t.geometry[e],n),i.push(n)}return t.geometry=i,t}function Xi(t){for(let e=1;e<arguments.length;e++){const i=arguments[e];for(const e in i)t[e]=i[e]}return t}function Zi(t){return null==t}function Yi(t){return"number"==typeof t&&!isNaN(t)}function Ki(t){return"object"==typeof t&&!!t}function Qi(t){return!Zi(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function tn(t){return!Zi(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}const en=Object.prototype.hasOwnProperty;function nn(t,e){return en.call(t,e)}const rn=Math.PI/180;function on(t){return t&&s(t)&&t.property}function sn(t){const{pointAtTileRes:e,tileRatio:i}=t;return e*i}function an(t){return"centimeter"===t||"cm"===t?1:"millimeter"===t||"mm"===t?.1:100}function ln(t){let e=0;for(let i,n,r=0,o=t.length,s=o-1;r<o;s=r++)i=t[r],n=t[s],e+=void 0!==i.x?(n.x-i.x)*(i.y+n.y):(n[0]-i[0])*(i[1]+n[1]);return e}function un(t,e,i,n,r){const o=t[e*n],s=t[e*n+1],a=t[i*n],l=t[i*n+1];return o===a&&(o<0||o>r)&&s!==l||s===l&&(s<0||s>r)&&o!==a}function cn(t,e,i){let n=i;return e&&t&&(n=t[e]),void 0===n&&(n=i),100*(n||0)}function hn(t,e,i,n,r,o,s){e||0===e||(e=1);const a=cn(t.properties,i,n),l=a*e;let u=a;return r?u=cn(t.properties,r,o):s&&(u=a-cn(t.properties,s,0)),u*=e,{altitude:l,height:u}}function dn(t,e){return e<1/0&&(t.x<0||t.x>e||t.y<0||t.y>e)}function fn(t){return null==t}function pn(t,e,i){if(t===i||t===e)return t;const n=i-e;return((t-e)%n+n)%n+e}Object.freeze({__proto__:null,now:function(){return Date.now()},extend:Xi,isNil:Zi,isNumber:Yi,isInteger:function(t){return(0|t)===t},isObject:Ki,isString:Qi,isFunction:tn,hasOwn:nn,join:function(t,e){return t.join?t.join(e||","):Array.prototype.join.call(t,e||",")},toRadian:function(t){return t*rn},toDegree:function(t){return t/rn},evaluate:function(t,e,i){return tn(t)?t(void 0!==i?i:null,e):t},isFnTypeSymbol:on,getAltitudeToLocal:sn,getTubeSizeScale:an});class mn{constructor(t,e,i,n){this.feature=t,this.symbol=e,this.fnTypes=i,this.options=n}getPolygonResource(){let t=this.symbol.polygonPatternFile;const{polygonPatternFileFn:e}=this.fnTypes;return this.q(t,e)}getLineResource(){let t=this.symbol.linePatternFile;const{linePatternFileFn:e}=this.fnTypes;return this.q(t,e)}q(t,e){return e&&(t=e(this.options.zoom,this.feature.properties)),t}}function yn(t,e,i,n){const r=Math.abs(n)>>15,o=r>>1,s=r%2;let a=n%Math.pow(2,15);const l=e+(o<<14)*Math.sign(e),u=i+(s<<14)*Math.sign(i);return t[0]=l,t[1]=u,a=Math.round(a),t[2]=0===a?n<0?-1:0:a,t}const gn=Math.pow(2,14),bn=Math.pow(2,15);var vn={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:\'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style\'s `transition` property.",example:{duration:300,delay:0}},projection:{type:"projection",doc:"The projection the map should be rendered in. Supported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\\n * `cluster` Is `true` if the point is a cluster \\n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\\n * `point_count` Number of original points grouped into this cluster\\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:\'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\\n\\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\\n\\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`\'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:\'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.\'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don\'t have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},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",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol\'s anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text\'s language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text\'s language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol\'s orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single \'vertical\' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either [\'horizontal\', \'vertical\'] or [\'vertical\', \'horizontal\'], the order doesn\'t affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_symbol:{type:"boolean",doc:\'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:\'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:\'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:\'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:\'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:\'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{doc:\'`["==", key, value]` equality: `feature[key] = value`\'},"!=":{doc:\'`["!=", key, value]` inequality: `feature[key] ≠ value`\'},">":{doc:\'`[">", key, value]` greater than: `feature[key] > value`\'},">=":{doc:\'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`\'},"<":{doc:\'`["<", key, value]` less than: `feature[key] < value`\'},"<=":{doc:\'`["<=", key, value]` less than or equal: `feature[key] ≤ value`\'},in:{doc:\'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`\'},"!in":{doc:\'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`\'},all:{doc:\'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`\'},any:{doc:\'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`\'},none:{doc:\'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`\'},has:{doc:\'`["has", key]` `feature[key]` exists\'},"!has":{doc:\'`["!has", key]` `feature[key]` does not exist\'},within:{doc:\'`["within", object]` feature geometry is within object geometry\'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn\'t otherwise available. It is used in the following circumstances:\\n* In categorical functions, when the feature value does not match any of the stop domain values.\\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\\nIf no default is provided, the style property\'s default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:\'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].\',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:\'References variable bound using "let".\',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:\'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\\n - a single literal value; or\\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\\n\\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\\nIf the input type does not match the type of the labels, the result will be the fallback value.\',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`\'image\'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:\'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.\',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:\'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\\n\\nInterpolation types:\\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.\',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:\'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.\',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:\'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.\',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:\'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\\\'image\\\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\\n- `"text-font"`: Overrides the font stack specified by the root layout property.\\n- `"text-color"`: Overrides the color specified by the root paint property.\\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.\',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`\'format\'`](#types-format) expression. A [`\'coalesce\'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `\'image\'` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:\'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\\\'image\\\'`](#types-image) expression, `\\\'to-string\\\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.\',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:\'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.\',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color\'s red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature\'s properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature\'s properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:\'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.\',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature\'s state. Returns `null` if the requested property is not present on the feature\'s state. A feature\'s state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\\"feature-state\\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Returns the feature\'s geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Returns the feature\'s id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:\'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.\',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:\'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.\',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"distance-from-center":{doc:\'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.\',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:\'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.\',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line\'s endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color\'s opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.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,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion\'s surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},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",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line\'s actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line\'s offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won\'t render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:\'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.\',transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle\'s stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle\'s stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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"],doc:\'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.\',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the icon\'s halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the icon\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the text\'s halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The halo\'s fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the text\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},wn="undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self?self:{};function xn(t){var e={exports:{}};return t(e,e.exports),e.exports}function kn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}\n/*! https://mths.be/punycode v1.3.2 by @mathias */xn((function(t,e){!function(i){var n=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="object"==typeof wn&&wn;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,l=2147483647,u=/^xn--/,c=/[^\\x20-\\x7E]/,h=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function m(t){throw RangeError(d[t])}function y(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function g(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+y((t=t.replace(h,".")).split("."),e).join(".")}function b(t){for(var e,i,n=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function v(t){return y(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,i){var n=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;n+=36)t=f(t/35);return f(n+36*t/(t+38))}function k(t){var e,i,n,r,o,s,a,u,c,h,d,p=[],y=t.length,g=0,b=128,w=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&m("not-basic"),p.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<y;){for(o=g,s=1,a=36;r>=y&&m("invalid-input"),((u=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||u>f((l-g)/s))&&m("overflow"),g+=u*s,!(u<(c=a<=w?1:a>=w+26?26:a-w));a+=36)s>f(l/(h=36-c))&&m("overflow"),s*=h;w=x(g-o,e=p.length+1,0==o),f(g/e)>l-b&&m("overflow"),b+=f(g/e),g%=e,p.splice(g++,0,b)}return v(p)}function M(t){var e,i,n,r,o,s,a,u,c,h,d,y,g,v,k,M=[];for(y=(t=b(t)).length,e=128,i=0,o=72,s=0;s<y;++s)(d=t[s])<128&&M.push(p(d));for(n=r=M.length,r&&M.push("-");n<y;){for(a=l,s=0;s<y;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((l-i)/(g=n+1))&&m("overflow"),i+=(a-e)*g,e=a,s=0;s<y;++s)if((d=t[s])<e&&++i>l&&m("overflow"),d==e){for(u=i,c=36;!(u<(h=c<=o?1:c>=o+26?26:c-o));c+=36)M.push(p(w(h+(k=u-h)%(v=36-h),0))),u=f(k/v);M.push(p(w(u,0))),o=x(i,g,n==r),i=0,++n}++i,++e}return M.join("")}if(s={version:"1.3.2",ucs2:{decode:b,encode:v},decode:k,encode:M,toASCII:function(t){return g(t,(function(t){return c.test(t)?"xn--"+M(t):t}))},toUnicode:function(t){return g(t,(function(t){return u.test(t)?k(t.slice(4).toLowerCase()):t}))}},n&&r)if(t.exports==n)r.exports=s;else for(a in s)s.hasOwnProperty(a)&&(n[a]=s[a]);else i.punycode=s}(wn)}));var Mn=function(t,e,i,n){i=i||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\\+/g;t=t.split(e=e||"&");var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,c,h,d,f=t[l].replace(o,"%20"),p=f.indexOf(i);p>=0?(u=f.substr(0,p),c=f.substr(p+1)):(u=f,c=""),h=decodeURIComponent(u),d=decodeURIComponent(c),kn(r,h)?Array.isArray(r[h])?r[h].push(d):r[h]=[r[h],d]:r[h]=d}return r},jn=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},An=function(t,e,i,n){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){var r=encodeURIComponent(jn(n))+i;return Array.isArray(t[n])?t[n].map((function(t){return r+encodeURIComponent(jn(t))})).join(e):r+encodeURIComponent(jn(t[n]))})).join(e):n?encodeURIComponent(jn(n))+i+encodeURIComponent(jn(t)):""};function Fn(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}xn((function(t,e){e.decode=e.parse=Mn,e.encode=e.stringify=An}));class Tn extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class zn{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,i]of e)this.bindings[t]=i}concat(t){return new zn(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Sn={kind:"null"},_n={kind:"number"},Pn={kind:"string"},In={kind:"boolean"},On={kind:"color"},qn={kind:"object"},En={kind:"value"},Rn={kind:"collator"},Cn={kind:"formatted"},Nn={kind:"resolvedImage"};function Ln(t,e){return{kind:"array",itemType:t,N:e}}function Dn(t){if("array"===t.kind){const e=Dn(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Un=[Sn,_n,Pn,In,On,Cn,qn,Ln(En),Nn];function $n(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!$n(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 Un)if(!$n(t,e))return null}return`Expected ${Dn(t)} but found ${Dn(e)} instead.`}function Wn(t,e){return e.some(e=>e.kind===t.kind)}function Jn(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)}var Hn=xn((function(t,e){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return function(t){return t<0?0:t>1?1:t}("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in i)return i[a].slice();if("#"===a[0])return 4===a.length?(e=parseInt(a.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===a.length&&(e=parseInt(a.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=a.indexOf("("),u=a.indexOf(")");if(-1!==l&&u+1===a.length){var c=a.substr(0,l),h=a.substr(l+1,u-(l+1)).split(","),d=1;switch(c){case"rgba":if(4!==h.length)return null;d=o(h.pop());case"rgb":return 3!==h.length?null:[r(h[0]),r(h[1]),r(h[2]),d];case"hsla":if(4!==h.length)return null;d=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,p=o(h[1]),m=o(h[2]),y=m<=.5?m*(p+1):m+p-m*p,g=2*m-y;return[n(255*s(g,y,f+1/3)),n(255*s(g,y,f)),n(255*s(g,y,f-1/3)),d];default:return null}}return null}}catch(t){}}));class Gn{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof Gn)return t;if("string"!=typeof t)return;const e=Hn.parseCSSColor(t);return e?new Gn(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}}Gn.black=new Gn(0,0,0,1),Gn.white=new Gn(1,1,1,1),Gn.transparent=new Gn(0,0,0,0),Gn.red=new Gn(1,0,0,1),Gn.blue=new Gn(0,0,1,1);class Vn{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}}class Bn{constructor(t,e,i,n,r){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class Xn{constructor(t){this.sections=t}static fromString(t){return new Xn([new Bn(t,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 Xn?t:Xn.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class Zn{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Zn({name:t,available:!1}):null}serialize(){return["image",this.name]}}function Yn(t,e,i,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function Kn(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Gn)return!0;if(t instanceof Vn)return!0;if(t instanceof Xn)return!0;if(t instanceof Zn)return!0;if(Array.isArray(t)){for(const e of t)if(!Kn(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Kn(t[e]))return!1;return!0}return!1}function Qn(t){if(null===t)return Sn;if("string"==typeof t)return Pn;if("boolean"==typeof t)return In;if("number"==typeof t)return _n;if(t instanceof Gn)return On;if(t instanceof Vn)return Rn;if(t instanceof Xn)return Cn;if(t instanceof Zn)return Nn;if(Array.isArray(t)){const e=t.length;let i;for(const e of t){const t=Qn(e);if(i){if(i===t)continue;i=En;break}i=t}return Ln(i||En,e)}return qn}function tr(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Gn||t instanceof Xn||t instanceof Zn?t.toString():JSON.stringify(t)}class er{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 ${t.length-1} instead.`);if(!Kn(t[1]))return e.error("invalid value");const i=t[1];let n=Qn(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new er(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Gn?["rgba"].concat(this.value.toArray()):this.value instanceof Xn?this.value.serialize():this.value}}class ir{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const nr={string:Pn,number:_n,boolean:In,object:qn};class rr{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,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in nr)||"object"===i)return e.error(\'The item type argument of "array" must be one of string, number, boolean\',1);r=nr[i],n++}else r=En;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],n++}i=Ln(r,o)}else i=nr[r];const o=[];for(;n<t.length;n++){const i=e.parse(t[n],n,En);if(!i)return null;o.push(i)}return new rr(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!$n(this.type,Qn(i)))return i;if(e===this.args.length-1)throw new ir(`Expected value to be of type ${Dn(this.type)}, but found ${Dn(Qn(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map(t=>t.serialize()))}}class or{constructor(t){this.type=Cn,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 n=[];let r=!1;for(let i=1;i<=t.length-1;++i){const o=t[i];if(r&&"object"==typeof o&&!Array.isArray(o)){r=!1;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,_n),!t))return null;let i=null;if(o["text-font"]&&(i=e.parse(o["text-font"],1,Ln(Pn)),!i))return null;let s=null;if(o["text-color"]&&(s=e.parse(o["text-color"],1,On),!s))return null;const a=n[n.length-1];a.scale=t,a.font=i,a.textColor=s}else{const o=e.parse(t[i],1,En);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return e.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");r=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new or(n)}evaluate(t){return new Xn(this.sections.map(e=>{const i=e.content.evaluate(t);return Qn(i)===Nn?new Bn("",i,null,null,null):new Bn(tr(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.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)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class sr{constructor(t){this.type=Nn,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Pn);return i?new sr(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=Zn.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const ar={"to-boolean":In,"to-color":On,"to-number":_n,"to-string":Pn};class lr{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(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=ar[i],r=[];for(let i=1;i<t.length;i++){const n=e.parse(t[i],i,En);if(!n)return null;r.push(n)}return new lr(n,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof Gn)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 rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Yn(e[0],e[1],e[2],e[3]),!i))return new Gn(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ir(i||`Could not parse color from value \'${"string"==typeof e?e:String(JSON.stringify(e))}\'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new ir(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?Xn.fromString(tr(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Zn.fromString(tr(this.args[0].evaluate(t))):tr(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if("formatted"===this.type.kind)return new or([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new sr(this.args[0]).serialize();const t=["to-"+this.type.kind];return this.eachChild(e=>{t.push(e.serialize())}),t}}const ur=["Unknown","Point","LineString","Polygon"];class cr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this.R={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature&&this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ur[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(n*e-t[1])}return 0}parseColor(t){let e=this.R[t];return e||(e=this.R[t]=Gn.parse(t)),e}}class hr{constructor(t,e,i,n){this.name=t,this.type=e,this.C=i,this.args=n}evaluate(t){return this.C(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,e){const i=t[0],n=hr.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1);let a=null;for(const[n,o]of s){a=new Or(e.registry,e.path,null,e.scope);const s=[];let l=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(n)?n[e-1]:n.type,o=a.parse(i,1+s.length,r);if(!o){l=!0;break}s.push(o)}if(!l)if(Array.isArray(n)&&n.length!==s.length)a.error(`Expected ${n.length} arguments, but found ${s.length} instead.`);else{for(let t=0;t<s.length;t++){const e=Array.isArray(n)?n[t]:n.type,i=s[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new hr(i,r,o,s)}}if(1===s.length)e.errors.push(...a.errors);else{const i=(s.length?s:o).map(([t])=>{return e=t,Array.isArray(e)?`(${e.map(Dn).join(", ")})`:`(${Dn(e.type)}...)`;var e}).join(" | "),n=[];for(let i=1;i<t.length;i++){const r=e.parse(t[i],1+n.length);if(!r)return null;n.push(Dn(r.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){hr.definitions=e;for(const i in e)t[i]=hr}}class dr{constructor(t,e,i){this.type=Rn,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 n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,In);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,In);if(!r)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Pn),!o)?null:new dr(n,r,o)}evaluate(t){return new Vn(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}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function fr(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 pr(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function mr(t,e){const i=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,r=Math.pow(2,e.z);return[Math.round(i*r*8192),Math.round(n*r*8192)]}function yr(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],s=t[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function gr(t,e){let i=!1;for(let s=0,a=e.length;s<a;s++){const a=e[s];for(let e=0,s=a.length;e<s-1;e++){if(yr(t,a[e],a[e+1]))return!1;(r=a[e])[1]>(n=t)[1]!=(o=a[e+1])[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function br(t,e){for(let i=0;i<e.length;i++)if(gr(t,e[i]))return!0;return!1}function vr(t,e,i,n){const r=n[0]-i[0],o=n[1]-i[1],s=(t[0]-i[0])*o-r*(t[1]-i[1]),a=(e[0]-i[0])*o-r*(e[1]-i[1]);return s>0&&a<0||s<0&&a>0}function wr(t,e,i){for(const u of i)for(let i=0;i<u.length-1;++i)if(void 0,void 0,0!=(a=[(s=u[i+1])[0]-(o=u[i])[0],s[1]-o[1]])[0]*(l=[(r=e)[0]-(n=t)[0],r[1]-n[1]])[1]-a[1]*l[0]&&vr(n,r,o,s)&&vr(o,s,n,r))return!0;var n,r,o,s,a,l;return!1}function xr(t,e){for(let i=0;i<t.length;++i)if(!gr(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(wr(t[i],t[i+1],e))return!1;return!0}function kr(t,e){for(let i=0;i<e.length;i++)if(xr(t,e[i]))return!0;return!1}function Mr(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=[];for(let n=0;n<t[r].length;n++){const s=mr(t[r][n],i);fr(e,s),o.push(s)}n.push(o)}return n}function jr(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=Mr(t[r],e,i);n.push(o)}return n}function Ar(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}fr(e,t)}function Fr(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];if(!t)return s;for(const n of t)for(const t of n){const n=[t.x+o[0],t.y+o[1]];Ar(n,e,i,r),s.push(n)}return s}function Tr(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];if(!t)return s;for(const i of t){const t=[];for(const n of i){const i=[n.x+o[0],n.y+o[1]];fr(e,i),t.push(i)}s.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of s)for(const n of t)Ar(n,e,i,r)}var a;return s}class zr{constructor(t,e){this.type=In,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 ${t.length-1} instead.`);if(Kn(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new zr(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new zr(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new zr(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],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const o=Mr(e.coordinates,n,r),s=Fr(t.geometry(),i,n,r);if(!pr(i,n))return!1;for(const t of s)if(!gr(t,o))return!1}if("MultiPolygon"===e.type){const o=jr(e.coordinates,n,r),s=Fr(t.geometry(),i,n,r);if(!pr(i,n))return!1;for(const t of s)if(!br(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],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const o=Mr(e.coordinates,n,r),s=Tr(t.geometry(),i,n,r);if(!pr(i,n))return!1;for(const t of s)if(!xr(t,o))return!1}if("MultiPolygon"===e.type){const o=jr(e.coordinates,n,r),s=Tr(t.geometry(),i,n,r);if(!pr(i,n))return!1;for(const t of s)if(!kr(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Sr(t){if(t instanceof hr){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 zr)return!1;let e=!0;return t.eachChild(t=>{e&&!Sr(t)&&(e=!1)}),e}function _r(t){if(t instanceof hr&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(t=>{e&&!_r(t)&&(e=!1)}),e}function Pr(t,e){if(t instanceof hr&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(t=>{i&&!Pr(t,e)&&(i=!1)}),i}class Ir{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 Ir(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Or{constructor(t,e=[],i,n=new zn,r=[]){this.registry=t,this.path=e,this.key=e.map(t=>`[${t}]`).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n).L(t,r):this.L(t,r)}L(t,e){function i(t,e,i){return"assert"===i?new rr(e,[t]):"coerce"===i?new lr(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 n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const r=this.registry[n];if(r){let n=r.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,r=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==r.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==r.kind&&"string"!==r.kind){if(this.checkSubtype(t,r))return null}else n=i(n,t,e.typeAnnotation||"coerce");else n=i(n,t,e.typeAnnotation||"assert")}if(!(n instanceof er)&&"resolvedImage"!==n.type.kind&&function t(e){if(e instanceof Ir)return t(e.boundExpression);if(e instanceof hr&&"error"===e.name)return!1;if(e instanceof dr)return!1;if(e instanceof zr)return!1;const i=e instanceof lr||e instanceof rr;let n=!0;return e.eachChild(e=>{n=i?n&&t(e):n&&e instanceof er}),!!n&&(Sr(e)&&Pr(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}(n)){const e=new cr;try{n=new er(n.type,n.evaluate(e))}catch(t){return this.error(t.message),null}}return n}return this.error(`Unknown expression "${n}". 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 ${typeof t} instead.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Or(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map(t=>`[${t}]`).join("")}`;this.errors.push(new Tn(i,t))}checkSubtype(t,e){const i=$n(t,e);return i&&this.error(i),i}}function qr(t,e){const i=t.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;o=a+1}else{if(!(n>e))throw new ir("Input is not a number.");s=a-1}return 0}class Er{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${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,_n);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let i=1;i<t.length;i+=2){const o=1===i?-1/0:t[i],s=t[i+1],a=i,l=i+1;if("number"!=typeof o)return e.error(\'Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',a);if(n.length&&n[n.length-1][0]>=o)return e.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',a);const u=e.parse(s,l,r);if(!u)return null;r=r||u.type,n.push([o,u])}return new Er(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;return n>=e[r-1]?i[r-1].evaluate(t):i[qr(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var Rr=Cr;function Cr(t,e,i,n){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*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=n}function Nr(t,e,i){return t*(1-i)+e*i}Cr.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Cr.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Cr.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Cr.prototype.solveCurveX=function(t,e){var i,n,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},Cr.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Lr=Object.freeze({__proto__:null,number:Nr,color:function(t,e,i){return new Gn(Nr(t.r,e.r,i),Nr(t.g,e.g,i),Nr(t.b,e.b,i),Nr(t.a,e.a,i))},array:function(t,e,i){return t.map((t,n)=>Nr(t,e[n],i))}});const Dr=6/29*3*(6/29),Ur=Math.PI/180,$r=180/Math.PI;function Wr(t){return t>.008856451679035631?Math.pow(t,1/3):t/Dr+4/29}function Jr(t){return t>6/29?t*t*t:Dr*(t-4/29)}function Hr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Gr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Vr(t){const e=Gr(t.r),i=Gr(t.g),n=Gr(t.b),r=Wr((.4124564*e+.3575761*i+.1804375*n)/.95047),o=Wr((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Wr((.0193339*e+.119192*i+.9503041*n)/1.08883)),alpha:t.a}}function Br(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Jr(e),i=.95047*Jr(i),n=1.08883*Jr(n),new Gn(Hr(3.2404542*i-1.5371385*e-.4985314*n),Hr(-.969266*i+1.8760108*e+.041556*n),Hr(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function Xr(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const Zr={forward:Vr,reverse:Br,interpolate:function(t,e,i){return{l:Nr(t.l,e.l,i),a:Nr(t.a,e.a,i),b:Nr(t.b,e.b,i),alpha:Nr(t.alpha,e.alpha,i)}}},Yr={forward:function(t){const{l:e,a:i,b:n}=Vr(t),r=Math.atan2(n,i)*$r;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Ur,i=t.c;return Br({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Xr(t.h,e.h,i),c:Nr(t.c,e.c,i),l:Nr(t.l,e.l,i),alpha:Nr(t.alpha,e.alpha,i)}}};var Kr=Object.freeze({__proto__:null,lab:Zr,hcl:Yr});class Qr{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,i,n){let r=0;if("exponential"===t.name)r=to(e,t.base,i,n);else if("linear"===t.name)r=to(e,1,i,n);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new Rr(o[0],o[1],o[2],o[3]).solve(to(e,1,i,n))}return r}static parse(t,e){let[i,n,r,...o]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);{const t=n.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);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(r=e.parse(r,2,_n),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=On:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t<o.length;t+=2){const i=o[t],n=o[t+1],r=t+3,l=t+4;if("number"!=typeof i)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(s.length&&s[s.length-1][0]>=i)return e.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',r);const u=e.parse(n,l,a);if(!u)return null;a=a||u.type,s.push([i,u])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Qr(a,i,n,r,s):e.error(`Type ${Dn(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=qr(e,n),s=Qr.interpolationFactor(this.interpolation,n,e[o],e[o+1]),a=i[o].evaluate(t),l=i[o+1].evaluate(t);return"interpolate"===this.operator?Lr[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?Yr.reverse(Yr.interpolate(Yr.forward(a),Yr.forward(l),s)):Zr.reverse(Zr.interpolate(Zr.forward(a),Zr.forward(l),s))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)e.push(this.labels[t],this.outputs[t].serialize());return e}}function to(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}class eo{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const n of t.slice(1)){const t=e.parse(n,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const o=n&&r.some(t=>$n(n,t.type));return new eo(o?En:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args){if(n++,i=r.evaluate(t),i&&i instanceof Zn&&!i.available&&(e||(e=i),i=null,n===this.args.length))return e;if(null!==i)break}return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(e=>{t.push(e.serialize())}),t}}class io{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 ${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 ${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 n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new io(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class no{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 ${t.length-1} instead.`);const i=e.parse(t[1],1,_n),n=e.parse(t[2],2,Ln(e.expectedType||En));return i&&n?new no(n.type.itemType,i,n):null}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new ir(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new ir(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new ir(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class ro{constructor(t,e){this.type=In,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,En),n=e.parse(t[2],2,En);return i&&n?Wn(i.type,[In,Pn,_n,Sn,En])?new ro(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==i)return!1;if(!Jn(e,["boolean","string","number","null"]))throw new ir(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(Qn(e))} instead.`);if(!Jn(i,["string","array"]))throw new ir(`Expected second argument to be of type array or string, but found ${Dn(Qn(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class oo{constructor(t,e,i){this.type=_n,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,En),n=e.parse(t[2],2,En);if(!i||!n)return null;if(!Wn(i.type,[In,Pn,_n,Sn,En]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,_n);return r?new oo(i,n,r):null}return new oo(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Jn(e,["boolean","string","number","null"]))throw new ir(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(Qn(e))} instead.`);if(!Jn(i,["string","array"]))throw new ir(`Expected second argument to be of type array or string, but found ${Dn(Qn(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class so{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let s=2;s<t.length-1;s+=2){let a=t[s];const l=t[s+1];Array.isArray(a)||(a=[a]);const u=e.concat(s);if(0===a.length)return u.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,Qn(t)))return null}else i=Qn(t);if(void 0!==r[String(t)])return u.error("Branch labels must be unique.");r[String(t)]=o.length}const c=e.parse(l,s,n);if(!c)return null;n=n||c.type,o.push(c)}const s=e.parse(t[1],1,En);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(i,s.type)?null:new so(i,n,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(Qn(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()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const t of e){const e=n[this.cases[t]];void 0===e?(n[this.cases[t]]=i.length,i.push([this.cases[t],[t]])):i[e][1].push(t)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,n]of i)t.push(1===n.length?r(n[0]):n.map(r)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}class ao{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 ${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 n=[];for(let r=1;r<t.length-1;r+=2){const o=e.parse(t[r],r,In);if(!o)return null;const s=e.parse(t[r+1],r+1,i);if(!s)return null;n.push([o,s]),i=i||s.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new ao(i,n,r):null}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,e])=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(e=>{t.push(e.serialize())}),t}}class lo{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,En),n=e.parse(t[2],2,_n);if(!i||!n)return null;if(!Wn(i.type,[Ln(En),Pn,En]))return e.error(`Expected first argument to be of type array or string, but found ${Dn(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,_n);return r?new lo(i.type,i,n,r):null}return new lo(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Jn(e,["string","array"]))throw new ir(`Expected first argument to be of type array or string, but found ${Dn(Qn(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function uo(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 co(t,e,i,n){return 0===n.compare(e,i)}function ho(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=In,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,En);if(!o)return null;if(!uo(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type \'${Dn(o.type)}\'.`);let s=e.parse(t[2],2,En);if(!s)return null;if(!uo(i,s.type))return e.concat(2).error(`"${i}" comparisons are not supported for type \'${Dn(s.type)}\'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types \'${Dn(o.type)}\' and \'${Dn(s.type)}\'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new rr(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new rr(o.type,[s])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Rn),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=Qn(o),i=Qn(s);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new ir(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=Qn(o),i=Qn(s);if("string"!==t.kind||"string"!==i.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild(t=>{e.push(t.serialize())}),e}}}const fo=ho("==",(function(t,e,i){return e===i}),co),po=ho("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!co(0,e,i,n)})),mo=ho("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),yo=ho(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),go=ho("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),bo=ho(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class vo{constructor(t,e,i,n,r){this.type=Pn,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,_n);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,Pn),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,Pn),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=e.parse(n["min-fraction-digits"],1,_n),!s))return null;let a=null;return n["max-fraction-digits"]&&(a=e.parse(n["max-fraction-digits"],1,_n),!a)?null:new vo(i,r,o,s,a)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class wo{constructor(t){this.type=_n,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${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 ${Dn(i.type)} instead.`):new wo(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 ir(`Expected value to be of type string or array, but found ${Dn(Qn(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(e=>{t.push(e.serialize())}),t}}const xo={"==":fo,"!=":po,">":yo,"<":mo,">=":bo,"<=":go,array:rr,at:no,boolean:rr,case:ao,coalesce:eo,collator:dr,format:or,image:sr,in:ro,"index-of":oo,interpolate:Qr,"interpolate-hcl":Qr,"interpolate-lab":Qr,length:wo,let:io,literal:er,match:so,number:rr,"number-format":vo,object:rr,slice:lo,step:Er,string:rr,"to-boolean":lr,"to-color":lr,"to-number":lr,"to-string":lr,var:Ir,within:zr};function ko(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,s=Yn(e,i,n,o);if(s)throw new ir(s);return new Gn(e/255*o,i/255*o,n/255*o,o)}function Mo(t,e){return t in e}function jo(t,e){const i=e[t];return void 0===i?null:i}function Ao(t){return{type:t}}function Fo(t){return{result:"success",value:t}}function To(t){return{result:"error",value:t}}function zo(t){return!!t.expression&&t.expression.interpolated}function So(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function _o(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Po(t){return t}function Io(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Oo(t,e,i,n,r){return Io(typeof i===r?n[i]:void 0,t.default,e.default)}function qo(t,e,i){if("number"!==So(i))return Io(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 r=qr(t.stops.map(t=>t[0]),i);return t.stops[r][1]}function Eo(t,e,i){const n=void 0!==t.base?t.base:1;if("number"!==So(i))return Io(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 o=qr(t.stops.map(t=>t[0]),i),s=function(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(i,n,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1];let u=Lr[e.type]||Po;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=Kr[t.colorSpace];u=(t,i)=>e.reverse(e.interpolate(e.forward(t),e.forward(i),s))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==i)return u(e,i,s)}}:u(a,l,s)}function Ro(t,e,i){return"color"===e.type?i=Gn.parse(i):"formatted"===e.type?i=Xn.fromString(i.toString()):"resolvedImage"===e.type?i=Zn.fromString(i.toString()):So(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),Io(i,t.default,e.default)}hr.register(xo,{error:[{kind:"error"},[Pn],(t,[e])=>{throw new ir(e.evaluate(t))}],typeof:[Pn,[En],(t,[e])=>Dn(Qn(e.evaluate(t)))],"to-rgba":[Ln(_n,4),[On],(t,[e])=>e.evaluate(t).toArray()],rgb:[On,[_n,_n,_n],ko],rgba:[On,[_n,_n,_n,_n],ko],has:{type:In,overloads:[[[Pn],(t,[e])=>Mo(e.evaluate(t),t.properties())],[[Pn,qn],(t,[e,i])=>Mo(e.evaluate(t),i.evaluate(t))]]},get:{type:En,overloads:[[[Pn],(t,[e])=>jo(e.evaluate(t),t.properties())],[[Pn,qn],(t,[e,i])=>jo(e.evaluate(t),i.evaluate(t))]]},"feature-state":[En,[Pn],(t,[e])=>jo(e.evaluate(t),t.featureState||{})],properties:[qn,[],t=>t.properties()],"geometry-type":[Pn,[],t=>t.geometryType()],id:[En,[],t=>t.id()],zoom:[_n,[],t=>t.globals.zoom],pitch:[_n,[],t=>t.globals.pitch||0],"distance-from-center":[_n,[],t=>t.distanceFromCenter()],"heatmap-density":[_n,[],t=>t.globals.heatmapDensity||0],"line-progress":[_n,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[_n,[],t=>t.globals.skyRadialProgress||0],accumulated:[En,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[_n,Ao(_n),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[_n,Ao(_n),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:_n,overloads:[[[_n,_n],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[_n],(t,[e])=>-e.evaluate(t)]]},"/":[_n,[_n,_n],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[_n,[_n,_n],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[_n,[],()=>Math.LN2],pi:[_n,[],()=>Math.PI],e:[_n,[],()=>Math.E],"^":[_n,[_n,_n],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[_n,[_n],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[_n,[_n],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[_n,[_n],(t,[e])=>Math.log(e.evaluate(t))],log2:[_n,[_n],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[_n,[_n],(t,[e])=>Math.sin(e.evaluate(t))],cos:[_n,[_n],(t,[e])=>Math.cos(e.evaluate(t))],tan:[_n,[_n],(t,[e])=>Math.tan(e.evaluate(t))],asin:[_n,[_n],(t,[e])=>Math.asin(e.evaluate(t))],acos:[_n,[_n],(t,[e])=>Math.acos(e.evaluate(t))],atan:[_n,[_n],(t,[e])=>Math.atan(e.evaluate(t))],min:[_n,Ao(_n),(t,e)=>Math.min(...e.map(e=>e.evaluate(t)))],max:[_n,Ao(_n),(t,e)=>Math.max(...e.map(e=>e.evaluate(t)))],abs:[_n,[_n],(t,[e])=>Math.abs(e.evaluate(t))],round:[_n,[_n],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[_n,[_n],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[_n,[_n],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[In,[Pn,En],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[In,[En],(t,[e])=>t.id()===e.value],"filter-type-==":[In,[Pn],(t,[e])=>t.geometryType()===e.value],"filter-<":[In,[Pn,En],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[In,[En],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[In,[Pn,En],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[In,[En],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[In,[Pn,En],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[In,[En],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[In,[Pn,En],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[In,[En],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[In,[En],(t,[e])=>e.value in t.properties()],"filter-has-id":[In,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[In,[Ln(Pn)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[In,[Ln(En)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[In,[Pn,Ln(En)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[In,[Pn,Ln(En)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:In,overloads:[[[In,In],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Ao(In),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:In,overloads:[[[In,In],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Ao(In),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[In,[In],(t,[e])=>!e.evaluate(t)],"is-supported-script":[In,[Pn],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Pn,[Pn],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Pn,[Pn],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Pn,Ao(En),(t,e)=>e.map(e=>tr(e.evaluate(t))).join("")],"resolved-locale":[Pn,[Rn],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Co{constructor(t,e){var i;this.expression=t,this.D={},this.U=new cr,this.W=e?"color"===(i=e).type&&_o(i.default)?new Gn(0,0,0,0):"color"===i.type?Gn.parse(i.default)||null:void 0===i.default?null:i.default:null,this.J=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o,s,a){return this.U.globals=t,this.U.feature=e,this.U.featureState=i,this.U.canonical=n||null,this.U.availableImages=r||null,this.U.formattedSection=o,this.U.featureTileCoord=s||null,this.U.featureDistanceData=a||null,this.expression.evaluate(this.U)}evaluate(t,e,i,n,r,o,s,a){this.U.globals=t,this.U.feature=e||null,this.U.featureState=i||null,this.U.canonical=n||null,this.U.availableImages=r||null,this.U.formattedSection=o||null,this.U.featureTileCoord=s||null,this.U.featureDistanceData=a||null;try{const t=this.expression.evaluate(this.U);if(null==t||"number"==typeof t&&t!=t)return this.W;if(this.J&&!(t in this.J))throw new ir(`Expected value to be one of ${Object.keys(this.J).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this.D[t.message]||(this.D[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this.W}}}function No(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in xo}function Lo(t,e){const i=new Or(xo,[],e?function(t){const e={color:On,string:Pn,number:_n,enum:Pn,boolean:In,formatted:Cn,resolvedImage:Nn};return"array"===t.type?Ln(e[t.value]||En,t.length):e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Fo(new Co(n,e)):To(i.errors)}class Do{constructor(t,e){this.kind=t,this.H=e,this.isStateDependent="constant"!==t&&!_r(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this.H.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this.H.evaluate(t,e,i,n,r,o)}}class Uo{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this.H=e,this.isStateDependent="camera"!==t&&!_r(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this.H.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this.H.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?Qr.interpolationFactor(this.interpolationType,t,e,i):0}}function $o(t,e){if("error"===(t=Lo(t,e)).result)return t;const i=t.value.expression,n=Sr(i);if(!n&&"data-driven"!==(r=e)["property-type"]&&"cross-faded-data-driven"!==r["property-type"])return To([new Tn("","data expressions not supported")]);var r;const o=Pr(i,["zoom","pitch","distance-from-center"]);if(!o&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return To([new Tn("","zoom expressions not supported")]);const s=function t(e){let i=null;if(e instanceof io)i=t(e.result);else if(e instanceof eo){for(const n of e.args)if(i=t(n),i)break}else(e instanceof Er||e instanceof Qr)&&e.input instanceof hr&&"zoom"===e.input.name&&(i=e);return i instanceof Tn||e.eachChild(e=>{const n=t(e);n instanceof Tn?i=n:!i&&n?i=new Tn("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):i&&n&&i!==n&&(i=new Tn("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),i}(i);if(!s&&!o)return To([new Tn("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(s instanceof Tn)return To([s]);if(s instanceof Qr&&!zo(e))return To([new Tn("",\'"interpolate" expressions cannot be used with this property\')]);if(!s)return Fo(new Do(n?"constant":"source",t.value));const a=s instanceof Qr?s.interpolation:void 0;return Fo(new Uo(n?"camera":"composite",t.value,s.labels,a))}class Wo{constructor(t,e){this.G=t,this.V=e,Fn(this,function t(e,i){const n="color"===i.type,r=e.stops&&"object"==typeof e.stops[0][0],o=r||!(r||void 0!==e.property),s=e.type||(zo(i)?"exponential":"interval");if(n&&((e=Fn({},e)).stops&&(e.stops=e.stops.map(t=>[t[0],Gn.parse(t[1])])),e.default=Gn.parse(e.default?e.default:i.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Kr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);let a,l,u;if("exponential"===s)a=Eo;else if("interval"===s)a=qo;else if("categorical"===s){a=Oo,l=Object.create(null);for(const t of e.stops)l[t[0]]=t[1];u=typeof e.stops[0][0]}else{if("identity"!==s)throw new Error(`Unknown function type "${s}"`);a=Ro}if(r){const n={},r=[];for(let t=0;t<e.stops.length;t++){const i=e.stops[t],o=i[0].zoom;void 0===n[o]&&(n[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},r.push(o)),n[o].stops.push([i[0].value,i[1]])}const o=[];for(const e of r)o.push([n[e].zoom,t(n[e],i)]);const s={name:"linear"};return{kind:"composite",interpolationType:s,interpolationFactor:Qr.interpolationFactor.bind(void 0,s),zoomStops:o.map(t=>t[0]),evaluate:({zoom:t},n)=>Eo({stops:o,base:e.base},i,t).evaluate(t,n)}}if(o){const t="exponential"===s?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:t,interpolationFactor:Qr.interpolationFactor.bind(void 0,t),zoomStops:e.stops.map(t=>t[0]),evaluate:({zoom:t})=>a(e,i,t,l,u)}}return{kind:"source",evaluate(t,n){const r=n&&n.properties?n.properties[e.property]:void 0;return void 0===r?Io(e.default,i.default):a(e,i,r,l,u)}}}(this.G,this.V))}static deserialize(t){return new Wo(t.G,t.V)}static serialize(t){return{G:t.G,V:t.V}}}function Jo(t){if(Array.isArray(t))return t.map(Jo);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Jo(t[i]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function Ho(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(!Ho(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function Go(t){if(!Array.isArray(t))return!1;if(function(t){return"pitch"===t||"distance-from-center"===t}(t[0]))return!0;for(let e=1;e<t.length;e++)if(Go(t[e]))return!0;return!1}const Vo=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Bo(t,e){return t<e?-1:t>e?1:0}function Xo(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?Zo(t[1],t[2],"=="):"!="===e?Qo(Zo(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Zo(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(Xo))):"all"===e?["all"].concat(t.slice(1).map(Xo)):"none"===e?["all"].concat(t.slice(1).map(Xo).map(Qo)):"in"===e?Yo(t[1],t.slice(2)):"!in"===e?Qo(Yo(t[1],t.slice(2))):"has"===e?Ko(t[1]):"!has"===e?Qo(Ko(t[1])):"within"!==e||t;var i}function Zo(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function Yo(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(Bo)]]:["filter-in-small",t,["literal",e]]}}function Ko(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Qo(t){return["!",t]}xn((function(t,e){var i=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,12],i=[1,13],n=[1,9],r=[1,10],o=[1,11],s=[1,14],a=[1,15],l=[14,18,22,24],u=[18,22],c=[22,24],h={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,n,r,o,s){var a=o.length-1;switch(r){case 1:this.$=new String(t.replace(/\\\\(\\\\|")/g,"$1").replace(/\\\\n/g,"\\n").replace(/\\\\r/g,"\\r").replace(/\\\\t/g,"\\t").replace(/\\\\v/g,"\\v").replace(/\\\\f/g,"\\f").replace(/\\\\b/g,"\\b")),this.$.B=this.X.first_line;break;case 2:this.$=new Number(t),this.$.B=this.X.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.B=this.X.first_line;break;case 5:this.$=new Boolean(!1),this.$.B=this.X.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"B",{value:this.X.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"B",{value:this.X.first_line,enumerable:!1});break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"B",{value:this.X.first_line,enumerable:!1});break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,12:1,13:2,15:7,16:8,17:s,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:23,15:7,16:8,17:s,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(c,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:30,15:7,16:8,17:s,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:31,15:7,16:8,17:s,23:a},t(u,[2,17]),t(u,[2,15]),t(c,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],n=[null],r=[],o=this.table,s="",a=0,l=0,u=2,c=1,h=r.slice.call(arguments,1),d=Object.create(this.lexer),f={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(f.yy[p]=this.yy[p]);d.setInput(t,f.yy),f.yy.lexer=d,f.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var m=d.yylloc;r.push(m);var y=d.options&&d.options.ranges;function g(){var t;return"number"!=typeof(t=d.lex()||c)&&(t=e.symbols_[t]||t),t}this.parseError="function"==typeof f.yy.parseError?f.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,v,w,x,k,M,j,A={};;){if(this.defaultActions[v=i[i.length-1]]?w=this.defaultActions[v]:(null==b&&(b=g()),w=o[v]&&o[v][b]),void 0===w||!w.length||!w[0]){var F="";for(k in j=[],o[v])this.terminals_[k]&&k>u&&j.push("\'"+this.terminals_[k]+"\'");F=d.showPosition?"Parse error on line "+(a+1)+":\\n"+d.showPosition()+"\\nExpecting "+j.join(", ")+", got \'"+(this.terminals_[b]||b)+"\'":"Parse error on line "+(a+1)+": Unexpected "+(b==c?"end of input":"\'"+(this.terminals_[b]||b)+"\'"),this.parseError(F,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:m,expected:j})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+b);switch(w[0]){case 1:i.push(b),n.push(d.yytext),r.push(d.yylloc),i.push(w[1]),b=null,l=d.yyleng,s=d.yytext,a=d.yylineno,m=d.yylloc;break;case 2:if(A.$=n[n.length-(M=this.productions_[w[1]][1])],A.X={first_line:r[r.length-(M||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(M||1)].first_column,last_column:r[r.length-1].last_column},y&&(A.X.range=[r[r.length-(M||1)].range[0],r[r.length-1].range[1]]),void 0!==(x=this.performAction.apply(A,[s,l,a,f.yy,w[1],n,r].concat(h))))return x;M&&(i=i.slice(0,-1*M*2),n=n.slice(0,-1*M),r=r.slice(0,-1*M)),i.push(this.productions_[w[1]][0]),n.push(A.$),r.push(A.X),i.push(o[i[i.length-2]][i[i.length-1]]);break;case 3:return!0}}return!0}};function d(){this.yy={}}return h.lexer={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this.Z=t,this.Y=this.K=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this.Z[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\\r\\n?|\\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this.Z=this.Z.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\\r\\n?|\\n)/g);this.Z=t+this.Z,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\\r\\n?|\\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this.Y=!0,this},reject:function(){return this.options.backtrack_lexer?(this.K=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this.Z.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\\n"+e+"^"},test_match:function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,Y:this.Y,Z:this.Z,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\\r\\n?|\\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\\r?\\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this.Y=!1,this.K=!1,this.Z=this.Z.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this.Z&&(this.done=!1),i)return i;if(this.K){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this.Z||(this.done=!0),this.Y||(this.yytext="",this.match="");for(var r=this.tt(),o=0;o<r.length;o++)if((i=this.Z.match(this.rules[r[o]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[o])))return t;if(this.K){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this.Z?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},tt:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,n){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\\.[0-9]+)?([eE][-+]?[0-9]+)?\\b)/,/^(?:"(?:\\\\[\\\\"bfnrt/]|\\\\u[a-fA-F0-9]{4}|[^\\\\\\0-\\x09\\x0a-\\x1f"])*")/,/^(?:\\{)/,/^(?:\\})/,/^(?:\\[)/,/^(?:\\])/,/^(?:,)/,/^(?::)/,/^(?:true\\b)/,/^(?:false\\b)/,/^(?:null\\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}},d.prototype=h,h.Parser=d,new d}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const ts={StyleExpression:Co,isExpression:No,isExpressionFilter:Ho,createExpression:Lo,createPropertyExpression:$o,normalizePropertyExpression:function(t,e){if(_o(t))return new Wo(t,e);if(No(t)){const i=$o(t,e);if("error"===i.result)throw new Error(i.value.map(t=>`${t.key}: ${t.message}`).join(", "));return i.value}{let i=t;return"string"==typeof t&&"color"===e.type&&(i=Gn.parse(t)),{kind:"constant",evaluate:()=>i}}},ZoomConstantExpression:Do,ZoomDependentExpression:Uo,StylePropertyFunction:Wo},{isExpressionFilter:es}=ts,is={};function ns(t){if(!0===t)return function(){return!0};if(t&&t.condition){if("any"===t.type){const e=t.condition,i=[];for(let t=0;t<e.length;t++)i.push(ns(e[t]));return t=>{for(let e=0;e<i.length;e++)if(i[e](t))return!0;return!1}}const e=ns(t.condition);if(Zi(t.layer))return e;const i=e=>e.layer===t.layer;return t=>i(t)&&e(t)}if(es(t)){let e=function(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Ho(t)||(t=Xo(t));const i=t;let n=!0;try{n=function(t){if(!Go(t))return t;let e=Jo(t);return function t(e){let i=!1;const n=[];if("case"===e[0]){for(let t=1;t<e.length-1;t+=2)i=i||Go(e[t]),n.push(e[t+1]);n.push(e[e.length-1])}else if("match"===e[0]){i=i||Go(e[1]);for(let t=2;t<e.length-1;t+=2)n.push(e[t+1]);n.push(e[e.length-1])}else if("step"===e[0]){i=i||Go(e[1]);for(let t=1;t<e.length-1;t+=2)n.push(e[t+1])}i&&(e.length=0,e.push("any",...n));for(let i=1;i<e.length;i++)t(e[i])}(e),e=function t(e){if(!Array.isArray(e))return e;const i=function(t){if(Vo.has(t[0]))for(let e=1;e<t.length;e++)if(Go(t[e]))return!0;return t}(e);return!0===i?i:i.map(e=>t(e))}(e),e}(i)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\\nand paste the contents of this message in the report.\\nThank you!\\nFilter Expression:\\n${JSON.stringify(i,null,2)}\\n `)}const r=vn["filter_"+e],o=Lo(n,r);let s=null;if("error"===o.result)throw new Error(o.value.map(t=>`${t.key}: ${t.message}`).join(", "));s=(t,e,i)=>o.value.evaluate(t,e,{},i);let a=null,l=null;if(n!==i){const t=Lo(i,r);if("error"===t.result)throw new Error(t.value.map(t=>`${t.key}: ${t.message}`).join(", "));a=(e,i,n,r,o)=>t.value.evaluate(e,i,{},n,void 0,void 0,r,o),l=!Sr(t.value.expression)}return s=s,{filter:s,dynamicFilter:a||void 0,needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let i=1;i<e.length;i++)if(t(e[i]))return!0;return!1}(n),needFeature:!!l}}(t);return e=e&&e.filter,t=>e&&e(is,t)}return Lt(t)}var rs=Object.freeze({__proto__:null,compileStyle:function(t){return function t(e){if(!Array.isArray(e))return t([e]);const i=[];for(let t=0;t<e.length;t++){let n;n=!0===e[t].filter?function(){return!0}:ns(e[t].filter),i.push(Xi({},e[t],{filter:n}))}return i}(t=t.map(t=>{const e=Xi({},t);return e.filter&&e.filter.value&&(e.filter=e.filter.value),e}))},compileFilter:ns});const os={lineWidth:1,lineStrokeWidth:1,lineDx:1,lineDy:1,lineOpacity:1,linePatternAnimSpeed:1,markerWidth:1,markerHeight:1,markerDx:1,markerDy:1,markerSpacing:1,markerOpacity:1,markerRotation:1,textWrapWidth:1,textSpacing:1,textSize:1,textHaloRadius:1,textHaloOpacity:1,textDx:1,textDy:1,textOpacity:1,textRotation:1,polygonOpacity:1},ss=[];class as{static isAtlasLoaded(t,e={}){const{iconAtlas:i}=e;return!!(!t||i&&i.positions[t])}static genFnTypes(t){const e={};for(const i in t)if(on(t[i])){const n=(i+"_Fn_0").trim(),r=(i+"Fn").trim();os[i]?(e[n]=a(t[i]),e[r]=(t,i)=>{const r=e[n](t,i);return on(r)?a(r)(t,i):r}):(e[n]=l(t[i]),e[r]=(t,i)=>{const r=e[n](t,i);return on(r)?l(r)(t,i):r})}return e}constructor(t,e,i){this.options=i,this.symbolDef=e,this.symbol=u(e,()=>[i.zoom]),this.styledVectors=[],this.properties={},this.et=as.genFnTypes(this.symbolDef),on(this.symbolDef.visible)&&(this.it=a(this.symbolDef.visible)),i.atlas&&(this.iconAtlas=i.atlas.iconAtlas,this.glyphAtlas=i.atlas.glyphAtlas),this.features=this.nt(t)}needAltitudeAttribute(){return this.options.forceAltitudeAttribute||this.maxPosZ>=Math.pow(2,17)||this.options.positionType===Float32Array}getPositionFormat(){return this.needAltitudeAttribute()?[{type:Int16Array,width:2,name:"aPosition"},{type:Float32Array,width:1,name:"aAltitude"}]:[{type:Int16Array,width:3,name:"aPosition"}]}fillPosition(t,e,i,n){this.needAltitudeAttribute()?(t.aPosition.push(e,i),t.aAltitude.push(n)):(yn(ss,e,i,n),t.aPosition.push(...ss))}nt(t){if(!t.length)return t;const e="__fea_idx".trim();let i,n=0,r=t[n];for(;!r.geometry;)n++,r=t[n];if(Array.isArray(r.geometry)&&r.properties){let e=r.geometry[0];for(;Array.isArray(e);)e=e[0];e instanceof Ot&&(i=t)}if(!i)if(i=[],Array.isArray(r.geometry))for(let e=0;e<t.length;e++){const n=Xi({},t[e]);i.push(Bi(n))}else for(let n=0;n<t.length;n++){const r=t[n],o=Si(r);for(let t=0;t<o.length;t++){const n=o[t];n[e]=r[e],i.push(n)}}if(this.maxPosZ=0,!this.options.forceAltitudeAttribute){const t="line"===this.symbolDef.textPlacement;let e=0,n=!1;const{textPitchAlignmentFn:r}=this.et;!r&&t&&"map"===this.symbolDef.textPitchAlignment&&(n=!0);for(let o=0;o<i.length;o++){const s=us(i[o]&&i[o].geometry);if(s>e&&(e=s),t&&!n&&r&&i[o].properties){const t=r(null,i[o].properties);"map"===t&&(n=t)}}this.hasMapPitchAlign=n,this.maxPosZ=e}const o=this.options.order;if(o){const t=[];for(let e=0;e<o.length;e++)o[e]&&t.push(ns(o[e]));i=i.sort((e,i)=>{const n=t.length;let r=n,o=n;for(let s=0;s<n&&(t[s](e)&&(r=s),t[s](i)&&(o=s),!(r<n&&o<n));s++);return r-o})}return i}load(t=1){const e="__fea_idx".trim(),i="_debug_info".trim(),n=this.et,r=this.styledVectors;this.count=0;const o=this.features;if(!o||!o.length)return Promise.resolve(null);const s={},a={},l={zoom:this.options.zoom},c=u(this.symbolDef,()=>[l.zoom]);let h=0,d=o.length;const f=this.options.debugIndex;try{for(;h<d;h++){const t=o[h];if(!t||!t.geometry)continue;if(void 0!==f&&t[i].index!==f)continue;t.properties||(t.properties={}),t.properties.$layer=t.layer,t.properties.$type=t.type;const u=this.createStyledVector(t,c,n,l,s,a);u&&u.feature.geometry&&(u.featureIdx=void 0===t[e]?h:t[e],this.count++,r.push(u))}}catch(t){return Promise.reject(t)}return this.options.atlas?Promise.resolve(this.pack(t)):this.loadAtlas(s,a).then(()=>this.pack(t))}loadAtlas(t,e){return new Promise((i,n)=>{this.fetchAtlas(t,e,(t,e)=>{if(t)n(t);else{if(e){const{icons:t,glyphs:i}=e;if(t&&Object.keys(t).length){for(const e in t){const i=t[e],{width:n,height:r,data:o}=i.data;i.data=new Li({width:n,height:r},o)}this.iconAtlas=new Ui(t)}if(i&&Object.keys(i).length){for(const t in i){const e=i[t];for(const t in e){const i=e[t],{width:n,height:r,data:o}=i.bitmap;i.bitmap=new Ni({width:n,height:r},o)}}this.glyphAtlas=new Ji(i)}}i({glyphAtlas:this.glyphAtlas,iconAtlas:this.iconAtlas})}})})}fetchAtlas(t,e,i){Object.keys(t).length>0||Object.keys(e).length>0?this.options.requestor(t,e,i):i()}pack(t){if(!this.count)return null;if(null==t)throw new Error("layout scale is undefined");const e=this.createDataPack(this.styledVectors,t);if(!e)return null;e.properties=this.properties,this.empty&&(e.empty=!0);const i=e.buffers;delete e.buffers;const n={data:e,buffers:i};if(this.iconAtlas){const t=n.data.iconAtlas=ls(this.iconAtlas);if(t.glyphMap)for(const e in t.glyphMap)i.push(t.glyphMap[e].data.data.buffer);i.push(n.data.iconAtlas.image.data.buffer)}return this.glyphAtlas&&(n.data.glyphAtlas=ls(this.glyphAtlas),i.push(n.data.glyphAtlas.image.data.buffer)),n}createStyledVector(t,e,i,n){return new mn(t,e,i,n)}createDataPack(t,e){if(!t||!t.length)return null;this.maxIndex=0,this.maxPos=0,this.maxAltitude=0;const i=this.data={};let n=this.elements=[];const r=this.getFormat(Array.isArray(t[0])?t[0][0].symbol:t[0].symbol),o=this.needAltitudeAttribute()?2:3;for(let t=0;t<r.length;t++)i[r[t].name]=[];let s=[],a=0;const l=[];let u=0,c=!1;for(let n=0,r=t.length;n<r;n++){if(!t[n].feature.geometry)continue;const r=Array.isArray(t[n])?t[n][0].feature.id:t[n].feature.id;Yi(r)&&(Math.abs(r)>u&&(u=Math.abs(r)),r<0&&(c=!0));const h=this.data.aPosition.length;if(Array.isArray(t[n]))for(let i=0;i<t[n].length;i++)this.rt(t[n][i],e);else this.rt(t[n],e);const d=(i.aPosition.length-h)/o;for(let e=0;e<d;e++)s.push(t[n].featureIdx),Yi(r)&&l.push(r);a=Math.max(a,t[n].featureIdx)}if(this.hasElements()&&!n.length)return null;s=new(Vi(a))(s),r[0].type=this.options.positionType?this.options.positionType:Gi(this.maxPos);const h=this.options.center;if(h&&(h[0]||h[1])){const t=i.aPosition;for(let e=0;e<t.length;e+=o)t[e]-=h[0],t[e+1]-=h[1]}const d=function(t,e){const i={};for(let n=0;n<t.length;n++){const r=t[n],o=r.type,s=r.name;i[s]=o===Array?e[s]:new o(e[s])}return i}(r,i);d.aPickingId=s;const f=[];for(const t in d)f.push(d[t].buffer);n=new(Hi(this.maxIndex))(n),f.push(n.buffer);const p={data:d,indices:this.hasElements()?n:null,positionSize:o,buffers:f,symbolIndex:this.symbolDef.index||{index:0}};if(l.length){const t=c?Gi(u):Vi(u);p.featureIds=new t(l),f.push(p.featureIds.buffer)}else p.featureIds=[];return p}rt(t,e){this.it&&this.it.isZoomConstant&&!this.it(null,t.feature.properties)||this.placeVector(t,e,this.formatWidth)}addElements(...t){this.maxIndex=Math.max(this.maxIndex,...t),this.elements.push(...t)}hasElements(){return!0}getAltitude(t){const{altitudeProperty:e,defaultAltitude:i,altitudeScale:n}=this.options;let r=cn(t,e,i);return n&&(r*=n),this.maxAltitude=Math.max(this.maxAltitude,Math.abs(r)),r}getIconAtlasMaxValue(){const t=this.iconAtlas.positions;let e=0;for(const i in t)if(nn(t,i)){const{tl:n,displaySize:r}=t[i],o=Math.max(n[0],n[1],r[0]-1,r[1]-1);o>e&&(e=o)}return e}}function ls(t){let e=t.positions,i=t.image&&t.image.format||"alpha";if(t instanceof Ui){e={};for(const i in t.positions){const n=t.positions[i];e[i]={paddedRect:n.paddedRect,pixelRatio:n.pixelRatio,tl:n.tl,br:n.br,displaySize:n.displaySize}}i="rgba"}const n=t.image;return{image:{width:n.width,height:n.height,data:n.data,format:i},glyphMap:t.glyphMap,positions:e}}function us(t){if(!t)return 0;let e=0;if(Array.isArray(t))for(let i=0;i<t.length;i++)if(Array.isArray(t[i])){const n=us(t[i]);n>e&&(e=n)}else{const n=Math.abs(t[i].z||0);n>e&&(e=n)}else{const i=Math.abs(t.z||0);i>e&&(e=i)}return e}function cs(t,e,i,n){const r="__fn_textSize".trim();let o=t.textSize;if(Zi(e.textSize))return[16,16];t[r]&&(o=t[r]);const s=[];return s[0]=tn(o)?o(n,i):o,s[1]=s[0],s}function hs(t){const e=t.stops;let i=-1/0;for(let t=0;t<e.length;t++){let n=e[t][1];Ki(e[t][1])&&(n=hs(e[t][1])),n>i&&(i=n)}return i}function ds(t,e,i){return[e||"normal",i||"normal","24px",t||"monospace"].join(" ")}const fs=/\\{[\\w-]+(?:\\|[\\w-]+)*\\}/g;function ps(t,e){return Qi(t)?t.replace(fs,(function(t){if(!e)return"";if((t=t.substring(1,t.length-1)).indexOf("|")>0){const i=t.split("|");for(let t=0;t<i.length;t++){const n=e[i[t]];if(!Zi(n))return n}return""}const i=e[t];return Zi(i)?"":Array.isArray(i)?i.join():i})):t}Object.freeze({__proto__:null,getSDFFont:ds,resolveText:ps});const ms=t=>t>=11904&&t<=12031,ys=t=>t>=12032&&t<=12255,gs=t=>t>=12272&&t<=12287,bs=t=>t>=12288&&t<=12351,vs=t=>t>=12352&&t<=12447,ws=t=>t>=12448&&t<=12543,xs=t=>t>=12544&&t<=12591,ks=t=>t>=12704&&t<=12735,Ms=t=>t>=12736&&t<=12783,js=t=>t>=12784&&t<=12799,As=t=>t>=12800&&t<=13055,Fs=t=>t>=13056&&t<=13311,Ts=t=>t>=13312&&t<=19903,zs=t=>t>=19968&&t<=40959,Ss=t=>t>=40960&&t<=42127,_s=t=>t>=42128&&t<=42191,Ps=t=>t>=63744&&t<=64255,Is=t=>t>=64336&&t<=65023,Os=t=>t>=65040&&t<=65055,qs=t=>t>=65072&&t<=65103,Es=t=>t>=65104&&t<=65135,Rs=t=>t>=65136&&t<=65279,Cs=t=>t>=65280&&t<=65519;function Ns(t){return!((t=>t>=1536&&t<=1791)(t)||(t=>t>=1872&&t<=1919)(t)||(t=>t>=2208&&t<=2303)(t)||Is(t)||Rs(t))}function Ls(t){return!!(746===t||747===t||!(t<4352)&&(ks(t)||xs(t)||qs(t)&&!(t>=65097&&t<=65103)||Ps(t)||Fs(t)||ms(t)||Ms(t)||!(!bs(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Ts(t)||zs(t)||As(t)||(t=>t>=12592&&t<=12687)(t)||(t=>t>=43360&&t<=43391)(t)||(t=>t>=55216&&t<=55295)(t)||(t=>t>=4352&&t<=4607)(t)||(t=>t>=44032&&t<=55215)(t)||vs(t)||gs(t)||(t=>t>=12688&&t<=12703)(t)||ys(t)||js(t)||ws(t)&&12540!==t||!(!Cs(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Es(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(t=>t>=5120&&t<=5759)(t)||(t=>t>=6320&&t<=6399)(t)||Os(t)||(t=>t>=19904&&t<=19967)(t)||Ss(t)||_s(t)))}function Ds(t){return!(Ls(t)||function(t){return!!((t=>t>=128&&t<=255)(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||(t=>t>=8192&&t<=8303)(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||(t=>t>=8448&&t<=8527)(t)||(t=>t>=8528&&t<=8591)(t)||(t=>t>=8960&&t<=9215)(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||(t=>t>=9216&&t<=9279)(t)&&9251!==t||(t=>t>=9280&&t<=9311)(t)||(t=>t>=9312&&t<=9471)(t)||(t=>t>=9632&&t<=9727)(t)||(t=>t>=9728&&t<=9983)(t)&&!(t>=9754&&t<=9759)||(t=>t>=11008&&t<=11263)(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||bs(t)||ws(t)||(t=>t>=57344&&t<=63743)(t)||qs(t)||Es(t)||Cs(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Us(t){return t>=1424&&t<=2303||Is(t)||Rs(t)}const $s=[[9,9],[32,32],[5760,5760],[8192,8198],[8200,8202],[8287,12288],[6158,6158],[8203,8205]];function Ws(t){for(const e of $s)if(t>=e[0]&&t<=e[1])return!0;return!1}const Js={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\\\":"\","]":"﹈","^":"^",ot:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Hs(t,e,i,n,r,o,s,a,l,u){let c=t.trim();2===u&&(c=function(t){let e="";for(let i=0;i<t.length;i++){const n=t.charCodeAt(i+1)||null,r=t.charCodeAt(i-1)||null;e+=n&&Ds(n)&&!Js[t[i+1]]||r&&Ds(r)&&!Js[t[i-1]]||!Js[t[i]]?t[i]:Js[t[i]]}return e}(c));const h=[],d={positionedGlyphs:h,text:c,top:a[1],bottom:a[1],left:a[0],right:a[0],writingMode:u};let f;return f=function(t,e){const i=[];let n=0;for(let r=0;r<e.length;r++){const o=e[r];i.push(t.substring(n,o)),n=o}return n<t.length&&i.push(t.substring(n,t.length)),i}(c,function(t,e,i,n){if(!i)return[];if(!t)return[];const r=[],o=function(t,e,i,n){let r=0;for(let i=0;i<t.length;i++){const o=n[t.charCodeAt(i)];o&&(r+=o.metrics.advance+e)}return r/Math.max(1,Math.ceil(r/i))}(t,e,i,n);let s=0;for(let i=0;i<t.length;i++){const l=t.charCodeAt(i),u=n[l];u&&!Gs[l]&&(s+=u.metrics.advance+e),i<t.length-1&&(Vs[l]||!((a=l)<11904)&&(ks(a)||xs(a)||qs(a)||Ps(a)||Fs(a)||ms(a)||Ms(a)||bs(a)||Ts(a)||zs(a)||As(a)||Cs(a)||vs(a)||gs(a)||ys(a)||js(a)||ws(a)||Os(a)||_s(a)||Ss(a)))&&r.push(Zs(i+1,s,o,r,Xs(l,t.charCodeAt(i+1)),!1))}var a;return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Zs(t.length,s,o,r,0,!0))}(c,s,i,e)),function(t,e,i,n,r,o,s,a,l){let u=0,c=8,h=0;const d=t.positionedGlyphs,f="right"===o?1:"left"===o?0:.5;for(let t=0;t<i.length;t++){let r=i[t];if(r=r.trim(),!r.length){c-=n;continue}const o=d.length;for(let t=0;t<r.length;t++){const i=r.charCodeAt(t),n=e[i];n&&(Ls(i)&&1!==s?(32!==i&&d.push({glyph:i,x:u,y:0,vertical:!0}),u+=l+a):(32!==i&&d.push({glyph:i,x:u,y:c,vertical:!1}),u+=n.metrics.advance+a))}d.length!==o&&(h=Math.max(u-a,h),Ks(d,e,o,d.length-1,f)),u=0,c-=n}const{horizontalAlign:p,verticalAlign:m}=Ys(r);!function(t,e,i,n,r,o,s){const a=(e-i)*r,l=-(-n*s+.5)*o;if(a||l)for(let e=0;e<t.length;e++)t[e].x+=a,t[e].y+=l}(d,f,p,m,h,n,i.length);const y=i.length*n;t.top+=-m*y,t.bottom=t.top+y,t.left+=-p*h,t.right=t.left+h}(d,e,f,n,r,o,u,s,l),!!h.length&&d}const Gs={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Vs={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Bs(t,e,i,n){const r=Math.pow(t-e,2);return n?t<e?r/2:2*r:r+Math.abs(i)*i}function Xs(t,e){let i=0;return 10===t&&(i-=1e4),40!==t&&65288!==t||(i+=50),41!==e&&65289!==e||(i+=50),i}function Zs(t,e,i,n,r,o){let s=null,a=Bs(e,i,r,o);for(let t=0;t<n.length;t++){const l=n[t],u=Bs(e-l.x,i,r,o)+l.badness;u<=a&&(s=l,a=u)}return{index:t,x:e,priorBreak:s,badness:a}}function Ys(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 Ks(t,e,i,n,r){if(!r)return;const o=e[t[n].glyph];if(o){const e=(t[n].x+o.metrics.advance)*r;if(!e)return;for(let r=i;r<=n;r++)t[r].x-=e}}function Qs(t){if(!function(t){for(const e of t)if(Us(e.charCodeAt(0)))return!0;return!1}(t))return t;const e=[],i=[],n=[];let r=0,o=0,s=1,a=1;for(const l of t){const t=l.codePointAt(0);Ws(t)?(n.push(l),r++):(s=Us(t)?-1:1,a!==s?(o=r,i.length&&(a>0&&i.reverse(),e.push(...i)),n.length&&(e.splice(o,0,...n),n.length=0),a=s,i.length=0):n.length&&(i.push(...n),n.length=0),i.push(l),r++)}return n.length&&i.push(...n),i.length&&(a>0&&i.reverse(),e.push(...i)),e.reverse().join("")}const ta=/\\{ *([\\w_]+) *\\}/g;class ea{constructor(t,e,i,n,r){this.feature=t,this.symbolDef=e,this.symbol=i,this.options=r,this.st=this.lt.bind(this),this.et=n}lt(t,e){return this.feature.properties[e]||"default"}getShape(t,e){if(this.ut)return this.ut;const{textHorizontalAlignmentFn:i,textVerticalAlignmentFn:n,markerHorizontalAlignmentFn:r,markerVerticalAlignmentFn:o,textWrapWidthFn:s}=this.et;let a;const l=this.symbol,u=this.getIconAndGlyph(),c=this.feature.properties;if(u&&u.glyph){const{font:t,text:r}=u.glyph;if(""===r)return null;const o=this.size[0]/24,h=24,d=l.textKeepUpright,f="map"===l.textRotationAlignment&&"line"===l.textPlacement&&!l.isIconText,p=e.glyphMap[t],m=ia(i?i(null,c):l.textHorizontalAlignment,n?n(null,c):l.textVerticalAlignment),y=1.2*h,g=function(t){for(let e=0;e<t.length;e++)if(!Ns(t.charAt(e).charCodeAt(0)))return!1;return!0}(r),b=g&&l.textLetterSpacing/o||0,v=[l.textDx/o||0,l.textDy/o||0],w=((s?s(null,c):l.textWrapWidth)||10*h)/o;a={},a.horizontal=Hs(r,p,w,y,m,"center",b,v,h,1),g&&f&&d&&(a.vertical=Hs(r,p,w,y,m,"center",b,v,h,2))}else if(u&&u.icon){if(!t.positions[u.icon.url])return null;const e=ia(r?r(null,c):l.markerHorizontalAlignment,o?o(null,c):l.markerVerticalAlignment);a=function(t,e){const{horizontalAlign:i,verticalAlign:n}=Ys(e),r=-24*i,o=-24*n;return{image:t,top:o,bottom:o+24,left:r,right:r+24}}(t.positions[u.icon.url],e),this.size||(this.size=a.image.displaySize)}return this.ut=a,a}getIconAndGlyph(){if(this.iconGlyph)return this.iconGlyph;const{markerFileFn:t,markerTypeFn:e,markerPathFn:i,markerWidthFn:n,markerHeightFn:r,markerFillFn:o,markerFillPatternFileFn:l,markerFillOpacityFn:u,markerTextFitFn:c,markerTextFitPaddingFn:h,markerLineColorFn:d,markerLineWidthFn:f,markerLineOpacityFn:p,markerLineDasharrayFn:m,markerLinePatternFileFn:y,markerPathWidthFn:g,markerPathHeightFn:b,textNameFn:v,textFaceNameFn:w,textStyleFn:x,textWeightFn:k}=this.et,{zoom:M}=this.options,j={},A=this.symbol,F=this.feature.properties,T=t?t(null,F):A.markerFile,z=e?e(null,F):A.markerType,S=T||z||A.markerPath,_=!Zi(this.symbolDef.textName);let P;if(S){P=function(t,e,i,n,r,o){if(Zi(e.markerWidth)&&Zi(e.markerHeight))return null;const s="__fn_markerWidth".trim(),a="__fn_markerHeight".trim();let l=e.markerWidth||0,u=e.markerHeight||0;return Ki(l)&&("identity"!==l.type?l=hs(l):(l=t.markerWidth,t[s]&&(l=t[s](n,i)),Ki(l)&&(l="identity"===l.type?r(n,i):hs(l)))),Ki(u)&&("identity"!==u.type?u=hs(u):(u=t.markerHeight,t[a]&&(u=t[a](n,i)),Ki(u)&&(u="identity"===u.type?o(n,i):hs(u)))),[l,u]}(A,this.symbolDef,F,M,n,r)||[0,0];let t=A.markerTextFit;if(c&&(t=c(M,F)),t&&A.text&&"none"!==t){const e=A.text.textSize;let i=A.text.textName;s(i)&&(i=a(i)(M,F));const n=ps(i,F);if(n){const i="__fn_textSize".trim(),r="__fn_textSize_0".trim();s(e)&&!A.text[i]&&(A.text[r]=a(e),A.text[i]=(t,e)=>{const i=A.text[r](t,e);return s(i)?a(i)(t,e):i});const o=cs(A.text,A.text,F,M);if("width"!==t&&"both"!==t||(P[0]=o[0]*n.length),"height"!==t&&"both"!==t||(P[1]=o[1]),o[0]&&o[1]){let t=A.markerTextFitPadding||[0,0,0,0];h&&(t=h(M,F)),P[0]+=t[1]+t[3],P[1]+=t[0]+t[2]}}else P[0]=P[1]=-1}}if(_&&(P=cs(A,this.symbolDef,F,M)),!P)return j;if(P[0]=Math.ceil(P[0]),P[1]=Math.ceil(P[1]),this.size=P,S&&P[0]>=0&&P[1]>=0){let t;if(z){const e={};if(e.markerType=z,"path"===z&&(e.markerPath=i?i(null,F):A.markerPath,e.markerPathWidth=g?g(null,F):A.markerPathWidth,e.markerPathHeight=b?b(null,F):A.markerPathHeight),n){const t=n(null,F);Zi(t)||(e.markerWidth=t)}else A.markerWidth>=0&&(e.markerWidth=A.markerWidth);if(r){const t=r(null,F);Zi(t)||(e.markerHeight=t)}else A.markerHeight>=0&&(e.markerHeight=A.markerHeight);if(o){const t=o(null,F);Zi(t)||(e.markerFill=t)}else A.markerFill&&(e.markerFill=A.markerFill);if(l){const t=l(null,F);Zi(t)||(e.markerFillPatternFile=t)}else A.markerFillPatternFile&&(e.markerFillPatternFile=A.markerFillPatternFile);if(u){const t=u(null,F);Zi(t)||(e.markerFillOpacity=t)}else A.markerFillOpacity>=0&&(e.markerFillOpacity=A.markerFillOpacity);if(d){const t=d(null,F);Zi(t)||(e.markerLineColor=t)}else A.markerLineColor&&(e.markerLineColor=A.markerLineColor);if(f){const t=f(null,F);Zi(t)||(e.markerLineWidth=t)}else A.markerLineWidth>=0&&(e.markerLineWidth=A.markerLineWidth);if(p){const t=p(null,F);Zi(t)||(e.markerLineOpacity=t)}else A.markerLineOpacity>=0&&(e.markerLineOpacity=A.markerLineOpacity);if(m){const t=m(null,F);Zi(t)||(e.markerLineDasharray=t)}else A.markerLineDasharray&&(e.markerLineDasharray=A.markerLineDasharray);if(y){const t=y(null,F);Zi(t)||(e.markerLinePatternFile=t)}else A.markerLinePatternFile&&(e.markerLinePatternFile=A.markerLinePatternFile);t="vector://"+JSON.stringify(e)}else t=T?T.replace(ta,this.st):A.markerPath?function(t,e,i){if(!t.markerPath)return null;let n=1;const r=function(t){const e={stroke:{stroke:t.markerLineColor,"stroke-width":t.markerLineWidth,"stroke-opacity":t.markerLineOpacity,"stroke-dasharray":null,"stroke-linecap":"butt","stroke-linejoin":"round"},fill:{fill:t.markerFill,"fill-opacity":t.markerFillOpacity}};return 0===e.stroke["stroke-width"]&&(e.stroke["stroke-opacity"]=0),e}(t);Yi(t.markerOpacity)&&(n=t.markerOpacity),Yi(t.opacity)&&(n*=t.opacity);const o={};if(r){for(const t in r.stroke)nn(r.stroke,t)&&(Zi(r.stroke[t])||(o[t]=r.stroke[t]));for(const t in r.fill)nn(r.fill,t)&&(Zi(r.fill[t])||(o[t]=r.fill[t]))}const s=Array.isArray(t.markerPath)?t.markerPath:[t.markerPath];let a;const l=[];for(let t=0;t<s.length;t++)a=Qi(s[t])?{path:s[t]}:s[t],a=Xi({},a,o),a.d=a.path,delete a.path,l.push(a);const u=[\'<svg version="1.1"\',\'xmlns="http://www.w3.org/2000/svg"\'];n<1&&u.push(\'opacity="\'+n+\'"\'),t.markerPathWidth&&t.markerPathHeight&&u.push(\'viewBox="0 0 \'+t.markerPathWidth+" "+t.markerPathHeight+\'"\'),u.push(\'preserveAspectRatio="none"\'),e&&u.push(\'width="\'+e+\'"\'),i&&u.push(\'height="\'+i+\'"\'),u.push("><defs></defs>");for(let t=0;t<l.length;t++){let e="<path ";for(const i in l[t])nn(l[t],i)&&(e+=" "+i+\'="\'+l[t][i]+\'"\');e+="></path>",u.push(e)}return u.push("</svg>"),"data:image/svg+xml;base64,"+btoa(u.join(" "))}(A,P[0],P[1]):null;j.icon={url:t,size:P}}if(_){const t=v?v(null,F):A.textName;if(t||0===t){const e=ds(w?w(null,F):A.textFaceName,x?x(null,F):A.textStyle,k?k(null,F):A.textWeight);let i=ps(t,F);i&&i.length&&(i=Qs(i),j.glyph={font:e,text:i})}}return this.iconGlyph=j,j}}function ia(t,e){e&&"middle"!==e||(e="center"),t&&"middle"!==t||(t="center");let i="center"!==e?e:"";return i+="center"!==t?(i.length?"-":"")+t:"",i\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */}function na(t,e,i,n,r){const o=[];let s;for(let a=0;a<t.length;a++){const l=t[a];let u,c=!1;for(let t=0;t<l.length-1;t++){let a=l[t],h=l[t+1];a.x<e&&h.x<e||(a.x<e?(s=a,a=new Ot(e,a.y+(e-a.x)/(h.x-a.x)*(h.y-a.y)).P(),a.z=s.z+(e-s.x)/(h.x-s.x)*(h.z-s.z),c=!0):h.x<e&&(s=h,h=new Ot(e,a.y+(e-a.x)/(h.x-a.x)*(h.y-a.y)).P(),h.z=a.z+(e-a.x)/(s.x-a.x)*(s.z-a.z),c=!0),a.y<i&&h.y<i||(a.y<i?(s=a,a=new Ot(a.x+(i-a.y)/(h.y-a.y)*(h.x-a.x),i).P(),a.z=s.z+(i-s.y)/(h.y-s.y)*(h.z-s.z),c=!0):h.y<i&&(s=h,h=new Ot(a.x+(i-a.y)/(h.y-a.y)*(h.x-a.x),i).P(),h.z=a.z+(i-a.y)/(s.y-a.y)*(s.z-a.z),c=!0),a.x>=n&&h.x>=n||(a.x>=n?(s=a,a=new Ot(n,a.y+(n-a.x)/(h.x-a.x)*(h.y-a.y)).P(),a.z=s.z+(n-s.x)/(h.x-s.x)*(h.z-s.z),c=!0):h.x>=n&&(s=h,h=new Ot(n,a.y+(n-a.x)/(h.x-a.x)*(h.y-a.y)).P(),h.z=a.z+(n-a.x)/(s.x-a.x)*(s.z-a.z),c=!0),a.y>=r&&h.y>=r||(a.y>=r?(s=a,a=new Ot(a.x+(r-a.y)/(h.y-a.y)*(h.x-a.x),r).P(),a.z=s.z+(r-s.y)/(h.y-s.y)*(h.z-s.z),c=!0):h.y>=r&&(s=h,h=new Ot(a.x+(r-a.y)/(h.y-a.y)*(h.x-a.x),r).P(),h.z=a.z+(r-a.y)/(s.y-a.y)*(s.z-a.z),c=!0),u&&a.equals(u[u.length-1])||(u=[a],o.push(u)),c&&(u.clipped=!0),u.push(h)))))}}return o}class ra extends Ot{constructor(t,e,i,n){super(t,e),this.angle=i,void 0!==n&&(this.segment=n)}clone(){return new ra(this.x,this.y,this.angle,this.segment)}}\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */function oa(t,e,i,n,r){if(void 0===e.segment)return!0;let o=e,s=e.segment+1,a=0;for(;a>-i/2;){if(s--,s<0)return!1;a-=t[s].dist(o),o=t[s]}a+=t[s].dist(t[s+1]),s++;const l=[];let u=0;for(;a<i/2;){const e=t[s],i=t[s+1];if(!i)return!1;let o=t[s-1].angleTo(e)-e.angleTo(i);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:o}),u+=o;a-l[0].distance>n;)u-=l.shift().angleDelta;if(u>r)return!1;s++,a+=e.dist(i)}return!0}function sa(t,e,i,n,r,o,s,a,l,u,c){const h=function(t,e,i){return t?.6*e*i:0}(n,o,s),d=function(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}(n,r),f=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-d*s<e/4&&(e=d*s+e/4),function t(e,i,n,r,o,s,a,l,u,c,h){const d=s/2,f=function(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}(e);let p=0,m=i-n,y=[];for(let t=0;t<e.length-1;t++){const i=e[t],a=e[t+1],l=i.dist(a),g=a.angleTo(i);for(;m+n<p+l;){m+=n;const b=(m-p)/l,v=aa(i.x,a.x,b),w=aa(i.y,a.y,b),x=aa(i.z||0,a.z||0,b);if(v>=0&&v<u&&w>=0&&w<u&&m-d>=0&&m+d<=f){const n=new ra(v,w,g,t);n.z=x,c&&(n.axis=[i.y-w,v-i.x],n.angleR=x===(i.z||0)?0:Math.atan(.9*(x-(i.z||0))*h/i.dist(n))),n.line=e,n.P(),r&&!oa(e,n,s,r,o)||y.push(n)}}p+=l}return l||y.length||a||(y=t(e,p/2,n,r,o,s,a,!0,u,c,h)),y}(t,f?e/2*a%e:(d/2+2*o)*s*a%e,e,h,i,d*s,f,!1,l,u,c)}function aa(t,e,i){return t*(1-i)+e*i}function la(t,e){const i=t.length;if(i<=1)return[t];const n=[];let r,o;for(let e=0;e<i;e++){const i=ln(t[e]);0!==i&&(t[e].area=Math.abs(i),void 0===o&&(o=i<0),o===i<0?(r&&n.push(r),r=[t[e]]):r.push(t[e]))}if(r&&n.push(r),e>1)for(let t=0;t<n.length;t++)n[t].length<=e||(Xt(n[t],e,1,n[t].length-1,ua),n[t]=n[t].slice(0,e));return n}function ua(t,e){return e.area-t.area}function ca(t,e,i){const n=e.distSqr(i);if(0===n)return t.distSqr(e);const r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return t.distSqr(r<0?e:r>1?i:i.sub(e).M(r).u(e))}function ha(t,e=1,i=!1){let n=1/0,r=1/0,o=-1/0,s=-1/0;const a=t[0];for(let t=0;t<a.length;t++){const e=a[t];(!t||e.x<n)&&(n=e.x),(!t||e.y<r)&&(r=e.y),(!t||e.x>o)&&(o=e.x),(!t||e.y>s)&&(s=e.y)}const l=Math.min(o-n,s-r);let u=l/2;const c=new Qt(null,da);if(0===l)return new Ot(n,r);for(let e=n;e<o;e+=l)for(let i=r;i<s;i+=l)c.push(new fa(e+u,i+u,u,t));let h=function(t){let e=0,i=0,n=0;const r=t[0];for(let t=0,o=r.length,s=o-1;t<o;s=t++){const o=r[t],a=r[s],l=o.x*a.y-a.x*o.y;i+=(o.x+a.x)*l,n+=(o.y+a.y)*l,e+=3*l}return new fa(i/e,n/e,0,t)}(t),d=c.length;for(;c.length;){const n=c.pop();(n.d>h.d||!h.d)&&(h=n,i&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,d)),n.max-h.d<=e||(u=n.h/2,c.push(new fa(n.p.x-u,n.p.y-u,u,t)),c.push(new fa(n.p.x+u,n.p.y-u,u,t)),c.push(new fa(n.p.x-u,n.p.y+u,u,t)),c.push(new fa(n.p.x+u,n.p.y+u,u,t)),d+=4)}return i&&(console.log("num probes: "+d),console.log("best distance: "+h.d)),h.p}function da(t,e){return e.max-t.max}function fa(t,e,i,n){this.p=new Ot(t,e),this.h=i,this.d=function(t,e){let i=!1,n=1/0;for(let r=0;r<e.length;r++){const o=e[r];for(let e=0,r=o.length,s=r-1;e<r;s=e++){const r=o[e],a=o[s];r.y>t.y!=a.y>t.y&&t.x<(a.x-r.x)*(t.y-r.y)/(a.y-r.y)+r.x&&(i=!i),n=Math.min(n,ca(t,r,a))}}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}const pa=45*Math.PI/100;function ma(t,e,i,n,r,o,s,a,l){const{feature:u,size:c,symbol:h}=t,d=c?24:0,f=n*(c?c[0]/d:1),p=[];if("line"===o){let t=u.geometry;r&&(t=na(u.geometry,0,0,r,r));for(let n=0;n<t.length;n++){const o=sa(t[n],s,pa,h.isIconText?null:i.vertical||i.horizontal||i,null,d,h.isIconText?1:f,1,r||1/0,a,l);if(h.textPlacement&&!h.isIconText)for(let t=0;t<o.length;t++)o[t].startIndex=e.length/3;if(p.push.apply(p,o),h.textPlacement&&!h.isIconText)for(let i=0;i<t[n].length;i++)e.push(t[n][i].x,t[n][i].y,t[n][i].z||0)}}else if(3===u.type){const t=la(u.geometry,0);for(let e=0;e<t.length;e++){const i=t[e];if("vertex"===o)for(let t=0;t<i.length;t++){const e=i[t];for(let t=0;t<e.length;t++)dn(e[t],r)||p.push(e[t])}else{const t=ha(i,16);dn(t,r)||p.push(t)}}}else if(2===u.type)for(let t=0;t<u.geometry.length;t++){const e=u.geometry[t];if("vertex"===o)for(let t=0;t<e.length;t++)dn(e[t],r)||p.push(e[t]);else dn(e[0],r)||p.push(e[0])}else if(1===u.type)for(let t=0;t<u.geometry.length;t++){const e=u.geometry[t];for(let t=0;t<e.length;t++){const i=e[t];dn(i,r)||p.push(i)}}return p}function ya(t,e){const i={},n={},r=[];let o=0;function s(e){r.push(t[e]),o++}function a(t,e,i){const o=n[t];return delete n[t],n[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(i[0]),o}function l(t,e,n){const o=i[e];return delete i[e],i[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=n[0].concat(r[o].geometry[0]),o}function u(t,e,i){const n=i?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;c<t.length;c++){const h=t[c],d=h.geometry;if(!d)continue;const f=h.properties[e]?h.properties[e].toString():null;if(!f){s(c);continue}const p=u(f,d),m=u(f,d,!0);if(p in n&&m in i&&n[p]!==i[m]){const t=l(p,m,d),e=a(p,m,r[t].geometry);delete i[p],delete n[m],n[u(f,r[e].geometry,!0)]=e,r[t].geometry=null}else p in n?a(p,m,d):m in i?l(p,m,d):(s(c),i[p]=o-1,n[m]=o-1)}return r.filter(t=>t.geometry)}class ga extends as{static needMerge(t){return!!t&&t.mergeOnProperty&&("line"===t.textPlacement||"line"===t.markerPlacement)}static mergeLineFeatures(t,e,i){const n="__index".trim(),r=function(t,e,i){const n="__index".trim(),r=as.genFnTypes(e),{mergeOnPropertyFn:o}=r;if(!e.mergeOnProperty||"line"!==e.textPlacement&&"line"!==e.markerPlacement)return[];if(!(fn(s=e.mergeOnProperty)||"string"!=typeof s&&(null===s.constructor||s.constructor!==String)||"line"!==e.textPlacement&&"line"!==e.markerPlacement))return[{features:t,property:e.mergeOnProperty}];var s;const a=[],l={},u=[];for(let r=0;r<t.length;r++){t[r][n]=r;const s=t[r].properties=t[r].properties||{};s.$layer=t[r].layer,s.$type=t[r].type;let c=e.markerPlacement;"line"!==c&&(c=e.textPlacement);const h=o?o(i,s):e.mergeOnProperty;"line"!==c||fn(h)?u.push(t[r]):(void 0===l[h]&&(l[h]=a.length,a.push({features:[],property:h})),a[l[h]].features.push(t[r]))}return u.length&&a.push({features:u}),a}(t,e,i);if(r.length){const e=[];for(let i=0;i<r.length;i++)e.push(r[i].property?ya(r[i].features,r[i].property):t);if(1===e.length)return e[0];{let t=[];for(let i=0;i<e.length;i++)t=t.concat(e[i]);return t.sort((t,e)=>t[n]-e[n]),t}}}static splitPointSymbol(t,e=0){const i=[];if(Array.isArray(t)){const e=t;for(let t=0;t<e.length;t++)e[t]&&i.push(...ga.splitPointSymbol(e[t],t));return i}let n=null,r=null;for(const e in t)0===e.indexOf("marker")?(n=n||{},n[e]=t[e]):0===e.indexOf("text")&&(r=r||{},r[e]=t[e]);return n&&(n.isIconText=!0,t.mergeOnProperty&&(n.mergeOnProperty=t.mergeOnProperty),i.push(n)),r&&(n&&(r.textPlacement=n.markerPlacement,r.textSpacing=n.markerSpacing,r.isIconText=!0),t.mergeOnProperty&&(r.mergeOnProperty=t.mergeOnProperty),i.push(r)),void 0!==t.visible&&(n&&(n.visible=t.visible),r&&(r.visible=t.visible)),n&&(n.markerTextFit&&r&&(n.text={},n.text.textName=r.textName,n.text.textSize=r.textSize),n.index={index:e,type:0}),r&&(r.index={index:e,type:1}),i}static isAtlasLoaded(t,e){const{icon:i,glyph:n}=t,{iconAtlas:r,glyphAtlas:o}=e;if(i&&(!r||!r.positions[i.url]))return!1;if(n){if(!o||!o.positions[n.font])return!1;const t=o.positions[n.font],{text:e}=n;for(let i=0;i<e.length;i++)if(!t[e.charCodeAt(i)])return!1}return!0}constructor(t,e,i){super(t,e,i)}createStyledVector(t,e,i,n,r,o){const s=new ea(t,this.symbolDef,e,i,n),a=s.getIconAndGlyph();if(a.icon&&!this.options.atlas){const{url:t,size:e}=a.icon;r[t]||(r[t]=a.icon.size),r[t][0]<e[0]&&(r[t][0]=e[0]),r[t][1]<e[1]&&(r[t][1]=e[1])}if(a.glyph&&!this.options.atlas){const{font:t,text:i}=a.glyph,n=o[t]=o[t]||{};for(let t=0;t<i.length;t++)n[i.charCodeAt(t)]=1;"line"===e.textPlacement&&(o.options={isCharsCompact:!1})}return this.options.allowEmptyPack||a.icon||a.glyph?s:null}getFormat(t){const e=void 0!==t.textName,i=e?this.getPackSDFFormat(t):this.getPackMarkerFormat();e?i.push(...this.ct()):i.push(...this.ht());const{markerOpacityFn:n,textOpacityFn:r,markerPitchAlignmentFn:o,textPitchAlignmentFn:s,markerRotationAlignmentFn:a,textRotationAlignmentFn:l,markerRotationFn:u,textRotationFn:c,markerAllowOverlapFn:h,textAllowOverlapFn:d,markerIgnorePlacementFn:f,textIgnorePlacementFn:p}=this.et;return(n||r)&&i.push({type:Uint8Array,width:1,name:"aColorOpacity"}),(o||s)&&i.push({type:Uint8Array,width:1,name:"aPitchAlign"}),(a||l)&&i.push({type:Uint8Array,width:1,name:"aRotationAlign"}),(u||c)&&i.push({type:Uint16Array,width:1,name:"aRotation"}),(h||d||f||p)&&i.push({type:Uint8Array,width:1,name:"aOverlap"}),i}dt(){return this.hasMapPitchAlign}ct(){const{textFillFn:t,textSizeFn:e,textHaloFillFn:i,textHaloRadiusFn:n,textHaloOpacityFn:r,textDxFn:o,textDyFn:s}=this.et,a=[];return t&&a.push({type:Uint8Array,width:4,name:"aTextFill"}),e&&a.push({type:Uint8Array,width:1,name:"aTextSize"}),i&&a.push({type:Uint8Array,width:4,name:"aTextHaloFill"}),n&&a.push({type:Uint8Array,width:1,name:"aTextHaloRadius"}),r&&a.push({type:Uint8Array,width:1,name:"aTextHaloOpacity"}),o&&a.push({type:Int8Array,width:1,name:"aTextDx"}),s&&a.push({type:Int8Array,width:1,name:"aTextDy"}),a}ht(){const{markerWidthFn:t,markerHeightFn:e,markerDxFn:i,markerDyFn:n}=this.et,r=[];return t&&r.push({type:Uint8Array,width:1,name:"aMarkerWidth"}),e&&r.push({type:Uint8Array,width:1,name:"aMarkerHeight"}),i&&r.push({type:Int8Array,width:1,name:"aMarkerDx"}),n&&r.push({type:Int8Array,width:1,name:"aMarkerDy"}),r}createDataPack(){if(!this.iconAtlas&&!this.glyphAtlas){if(!this.options.allowEmptyPack)return null;this.empty=!0}this.lineVertex=[];const t=super.createDataPack.apply(this,arguments);return t?(t.lineVertex=new Int16Array(this.lineVertex),t.buffers.push(t.lineVertex.buffer),t):null}placeVector(t,e){const i=t.getShape(this.iconAtlas,this.glyphAtlas);if(!this.options.allowEmptyPack&&!i)return;const n=this.ft(t,i,e);if(0===n.length)return;const r=this.data,o=this.needAltitudeAttribute()?2:3;let a=this.data.aPosition.length/o;const l=t.symbol,u=t.feature.properties,c="line"===l.textPlacement&&!l.isIconText,h=void 0!==l.textName,d=h&&c&&function(t){let e=0;for(let i=0;i<t.length;i++)if(Ls(t.charAt(i).charCodeAt(0)))e=0;else if(e++,e>=1)return!1;return!0}(t.getIconAndGlyph().glyph.text)?1:0,{textFillFn:f,textSizeFn:p,textHaloFillFn:m,textHaloRadiusFn:y,textHaloOpacityFn:g,textDxFn:b,textDyFn:v,textPitchAlignmentFn:w,textRotationAlignmentFn:x,textRotationFn:k,textAllowOverlapFn:M,textIgnorePlacementFn:j,textOpacityFn:A,markerWidthFn:F,markerHeightFn:T,markerDxFn:z,markerDyFn:S,markerPitchAlignmentFn:_,markerRotationAlignmentFn:P,markerRotationFn:I,markerAllowOverlapFn:O,markerIgnorePlacementFn:q,markerOpacityFn:E}=this.et;let R,C,N,L,D,U,$,W,J,H,G,V,B,X,Z,Y,K;if(h){const e=t.getIconAndGlyph().glyph.font;R=function(t,e,i){const n=t.positionedGlyphs,r=[];for(let o=0;o<n.length;o++){const s=n[o],a=i[s.glyph];if(!a)continue;const l=a.rect;if(!l)continue;const u=4,c=a.metrics.advance/2,h=a.metrics.height/2,d=e?[s.x+c,0]:[0,0],f=e?[0,s.y-h]:[s.x+c,s.y-h],p=a.metrics.left-u-c+f[0],m=a.metrics.top-u+f[1],y=p+l.w,g=m+l.h,b=new Ot(p,m),v=new Ot(y,m),w=new Ot(p,g),x=new Ot(y,g);if(e&&s.vertical){const t=new Ot(-c,c),e=-Math.PI/2,i=new Ot(5,0);b.F(e,t).u(i),v.F(e,t).u(i),w.F(e,t).u(i),x.F(e,t).u(i)}r.push({tl:b,tr:v,bl:w,br:x,tex:l,writingMode:t.writingMode,glyphOffset:d})}return r}(i.horizontal,c,this.glyphAtlas.positions[e]),f&&(C=f(null,u),s(C)?C=[0,0,0,0]:(C=Array.isArray(C)?C.map(t=>255*t):We(C).array(),3===C.length&&C.push(255))),p&&(N=p(this.options.zoom,u),fn(N)&&(N=14)),m&&(L=m(null,u),L=Array.isArray(L)?L.map(t=>255*t):We(L).array(),3===L.length&&L.push(255)),y&&(D=y(null,u)),g&&(U=255*g(null,u)),b&&($=b(null,u)||0),v&&(W=v(null,u)||0),w&&(B=+("map"===w(null,u))),x&&(X=+("map"===x(null,u))),k&&(Z=pn(k(null,u),0,360)*Math.PI/180)}else R=i?function(t){const e=t.image,i=t.top-1/e.pixelRatio,n=t.left-1/e.pixelRatio,r=t.bottom+1/e.pixelRatio,o=t.right+1/e.pixelRatio;let s,a,l,u;return s=new Ot(n,i),a=new Ot(o,i),l=new Ot(o,r),u=new Ot(n,r),[{tl:s,tr:a,bl:u,br:l,tex:{x:e.tl[0],y:e.tl[1],w:e.displaySize[0],h:e.displaySize[1]},writingMode:void 0,glyphOffset:[0,0]}]}(i):function(){const t=new Ot(0,0),e=new Ot(0,0),i=new Ot(0,0);return[{tl:t,tr:e,bl:new Ot(0,0),br:i,tex:{x:0,y:0,w:0,h:0},writingMode:void 0,glyphOffset:[0,0]}]}(),F&&(J=F(null,u)),T&&(H=T(null,u)),z&&(G=z(null,u)),S&&(V=S(null,u)),_&&(B=+("map"===_(null,u))),P&&(X=+("map"===P(null,u))),I&&(Z=pn(I(null,u),0,360)*Math.PI/180);const Q=O||M;Q&&(Y=Q(null,u)||0);const tt=q||j;let et;tt&&(K=tt(null,u)||0);const it=A||E;it&&(et=255*it(this.options.zoom,u));const nt=this.options.EXTENT,rt=R.length;for(let t=0;t<n.length;t++){const e=n[t],i=e.z||0;if(nt!==1/0&&dn(e,nt))continue;const o=e.x,s=e.y,l=R.length;for(let t=0;t<l;t++){const n=R[t],{tl:l,tr:u,bl:f,br:p,tex:m}=n;this.pt(r,o,s,i,10*l.x,10*l.y,m.x,m.y+m.h),h&&this.yt(r,c,rt,n.glyphOffset,e,d,e.axis,e.angleR),this.gt(r,C,N,L,D,U,$,W,J,H,G,V,et,B,X,Z,Y,K),this.pt(r,o,s,i,10*u.x,10*u.y,m.x+m.w,m.y+m.h),h&&this.yt(r,c,rt,n.glyphOffset,e,d,e.axis,e.angleR),this.gt(r,C,N,L,D,U,$,W,J,H,G,V,et,B,X,Z,Y,K),this.pt(r,o,s,i,10*f.x,10*f.y,m.x,m.y),h&&this.yt(r,c,rt,n.glyphOffset,e,d,e.axis,e.angleR),this.gt(r,C,N,L,D,U,$,W,J,H,G,V,et,B,X,Z,Y,K),this.pt(r,o,s,i,10*p.x,10*p.y,m.x+m.w,m.y),h&&this.yt(r,c,rt,n.glyphOffset,e,d,e.axis,e.angleR),this.gt(r,C,N,L,D,U,$,W,J,H,G,V,et,B,X,Z,Y,K),this.addElements(a,a+1,a+2),this.addElements(a+1,a+2,a+3),a+=4;const y=Math.max(Math.abs(o),Math.abs(s),Math.abs(i));y>this.maxPos&&(this.maxPos=y)}}}pt(t,e,i,n,r,o,s,a){this.fillPosition(t,e,i,n),t.aShape.push(r,o),t.aTexCoord.push(s,a)}yt(t,e,i,n,r,o,s,a){if(t.aCount.push(i),e){t.aGlyphOffset.push(n[0],n[1]),this.dt()&&t.aPitchRotation.push(s[0],s[1],a);const e=r.startIndex;t.aSegment.push(r.segment+e,e,r.line.length),t.aVertical.push(o)}}gt(t,e,i,n,r,o,s,a,l,u,c,h,d,f,p,m,y,g){const{textFillFn:b,textSizeFn:v,textHaloFillFn:w,textHaloRadiusFn:x,textHaloOpacityFn:k,textDxFn:M,textDyFn:j,textPitchAlignmentFn:A,textRotationAlignmentFn:F,textRotationFn:T,textAllowOverlapFn:z,textIgnorePlacementFn:S,textOpacityFn:_,markerWidthFn:P,markerHeightFn:I,markerDxFn:O,markerDyFn:q,markerPitchAlignmentFn:E,markerRotationAlignmentFn:R,markerRotationFn:C,markerAllowOverlapFn:N,markerIgnorePlacementFn:L,markerOpacityFn:D}=this.et;b&&t.aTextFill.push(...e),v&&t.aTextSize.push(i),w&&t.aTextHaloFill.push(...n),x&&t.aTextHaloRadius.push(r),k&&t.aTextHaloOpacity.push(o),M&&t.aTextDx.push(s),j&&t.aTextDy.push(a),P&&t.aMarkerWidth.push(l),I&&t.aMarkerHeight.push(u),O&&t.aMarkerDx.push(c),q&&t.aMarkerDy.push(h),(D||_)&&t.aColorOpacity.push(d),(A||E)&&t.aPitchAlign.push(f),(R||F)&&t.aRotationAlign.push(p),(C||T)&&t.aRotation.push(9362*m);const U=N||z,$=L||S;(U||$)&&t.aOverlap.push((U?8:0)+4*y+(($?2:0)+g)),r>0&&(this.properties.hasHalo=1)}ft(t,e,i){const{feature:n,symbol:r}=t,o=this.bt(t,r),s=n.properties,{markerSpacingFn:a,textSpacingFn:l}=this.et,u=((a?a(null,s):r.markerSpacing)||(l?l(null,s):r.textSpacing)||250)*i,c=this.options.altitudeToTileScale;return ma(t,this.lineVertex,e,i,this.options.EXTENT,o,u,this.dt(),c)}bt(t,e){return this.et.markerPlacementFn?this.et.markerPlacementFn(this.options.zoom,t.feature.properties):e.markerPlacement||e.textPlacement}getPackSDFFormat(t){if("line"!==t.textPlacement||t.isIconText)return[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"},{type:Uint8Array,width:1,name:"aCount"}];{const t=[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"},{type:Uint8Array,width:1,name:"aCount"},{type:Int16Array,width:2,name:"aGlyphOffset"},{type:Uint16Array,width:3,name:"aSegment"},{type:Uint8Array,width:1,name:"aVertical"}];return this.dt()&&t.push({type:Float32Array,width:3,name:"aPitchRotation"}),t}}getPackMarkerFormat(){return[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"}]}}class ba{constructor(t){this.x=t.x,this.y=t.y,this.z=t.z||0}clone(){return new ba(this)}S(){return this.j(this.mag()),this}j(t){return this.x/=t,this.y/=t,this.z/=t,this}_(){var t=this.y;return this.y=this.x,this.x=-t,this}mag(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}add(t){return this.clone().u(t)}sub(t){return this.clone().m(t)}u(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}m(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}equals(t){return this.x===t.x&&this.y===t.y&&this.z===t.z}mult(t){return this.clone().M(t)}M(t){return this.x*=t,this.y*=t,this.z*=t,this}dist(t){return Math.sqrt(this.distSqr(t))}distSqr(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z;return e*e+i*i+n*n}P(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)}}const va=Math.cos(Math.PI/180*37.5),wa=Math.pow(2,16)/1,xa=new Ot,ka=new Ot,Ma=new Ot;class ja extends as{constructor(t,e,i){super(t,e,i);let n=!1;const{lineDasharrayFn:r,lineDashColorFn:o}=this.et;this.hasGradient=this.symbol.lineGradientProperty,r&&(n=function(t,e,i){for(let n=0;n<t.length;n++)if(i(e,t[n].properties))return!0;return!1}(t,this.options.zoom,r),n&&(this.dasharrayFn=r)),this.hasDasharray=Ta(this.symbol.lineDasharray)||n,this.hasDasharray&&o&&(this.dashColorFn=o)}createStyledVector(t,e,i,n,r){const o=new mn(t,e,i,n),s=o.getLineResource();return!this.options.atlas&&s&&(r[s]=[0,0]),o}getFormat(){const{lineWidthFn:t,lineStrokeWidthFn:e,lineStrokeColorFn:i,lineColorFn:n,lineOpacityFn:r,lineDxFn:o,lineDyFn:s,linePatternAnimSpeedFn:a,linePatternGapFn:l}=this.et,u=[...this.getPositionFormat()];if(u.push(this.iconAtlas||this.hasDasharray?{type:Int8Array,width:3,name:"aExtrude"}:{type:Int8Array,width:2,name:"aExtrude"}),u.push({type:this.options.positionType||Uint16Array,width:1,name:"aLinesofar"}),t&&u.push({type:Uint8Array,width:1,name:"aLineWidth"}),e&&u.push({type:Uint8Array,width:1,name:"aLineStrokeWidth"}),n&&u.push({type:Uint8Array,width:4,name:"aColor"}),i&&u.push({type:Uint8Array,width:4,name:"aStrokeColor"}),r&&u.push({type:Uint8Array,width:1,name:"aOpacity"}),this.dasharrayFn&&u.push({type:Uint8Array,width:4,name:"aDasharray"}),this.dashColorFn&&u.push({type:Uint8Array,width:4,name:"aDashColor"}),this.iconAtlas){const t=this.getIconAtlasMaxValue();u.push({type:t>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return(o||s)&&u.push({type:Int8Array,width:2,name:"aLineDxDy"}),(a||l)&&u.push({type:Int8Array,width:2,name:"aLinePattern"}),u}placeVector(t){const{lineJoinFn:e,lineCapFn:i,lineWidthFn:n,lineHeightFn:r,lineStrokeWidthFn:o,lineStrokeColorFn:a,lineColorFn:l,lineOpacityFn:u,lineDxFn:c,lineDyFn:h,linePatternAnimSpeedFn:d,linePatternGapFn:f}=this.et,p=this.symbol,m=t.feature,y=m.properties;let g=p.lineJoin||"miter",b=p.lineCap||"butt";if(e&&(g=e(this.options.zoom,y)||"miter"),i&&(b=i(this.options.zoom,y)||"butt"),n){let t=n(this.options.zoom,y);Zi(t)&&(t=4),this.feaLineWidth=+t}else this.feaLineWidth=+p.lineWidth;if(r){let t=r(this.options.zoom,y);Zi(t)&&(t=this.feaLineWidth),this.feaLineHeight=+t}else this.feaLineHeight=+p.lineHeight||this.feaLineWidth;if(o){let t=o(this.options.zoom,y);Zi(t)&&(t=0),this.feaLineStrokeWidth=t}else this.feaLineStrokeWidth=p.lineStrokeWidth||0;if(l&&(this.feaColor=l(this.options.zoom,y)||[255,255,255,255],s(this.feaColor)?this.feaColor=[0,0,0,0]:(this.feaColor=Array.isArray(this.feaColor)?this.feaColor.map(t=>255*t):We(this.feaColor).array(),3===this.feaColor.length&&this.feaColor.push(255))),a&&(this.feaStrokeColor=a(this.options.zoom,y)||[0,0,0,255],s(this.feaStrokeColor)?this.feaStrokeColor=[0,0,0,0]:(this.feaStrokeColor=Array.isArray(this.feaStrokeColor)?this.feaStrokeColor.map(t=>255*t):We(this.feaStrokeColor).array(),3===this.feaStrokeColor.length&&this.feaStrokeColor.push(255))),u){let t=u(this.options.zoom,y);Zi(t)&&(t=1),this.feaOpacity=255*t}if(this.dasharrayFn){let t=this.dasharrayFn(this.options.zoom,y)||[0,0,0,0];if(t.length<4){const e=t;1===t.length?t=[e[0],e[0],e[0],e[0]]:2===t.length?t=[e[0],e[1],e[0],e[1]]:3===t.length&&(t=[e[0],e[1],e[2],e[2]])}this.feaDash=t}if(this.dashColorFn){let t=(this.dashColorFn?this.dashColorFn(this.options.zoom,y):this.symbol.lineDashColor)||[0,0,0,0];t=Array.isArray(t)?t.map(t=>255*t):We(t).array(),3===t.length&&t.push(255),this.feaDashColor=t}if(this.iconAtlas){const e=t.getLineResource(),i=this.iconAtlas.glyphMap[e];if(this.feaTexInfo=this.feaTexInfo||[0,0,0,0],i){const{tl:t,displaySize:i}=this.iconAtlas.positions[e];this.feaTexInfo[0]=t[0]+1,this.feaTexInfo[1]=t[1]+1,this.feaTexInfo[2]=i[0]-3,this.feaTexInfo[3]=i[1]-3}else this.feaTexInfo[0]=this.feaTexInfo[1]=this.feaTexInfo[2]=this.feaTexInfo[3]=0}if(c){let t=c(this.options.zoom,y);Zi(t)&&(t=0),this.feaLineDx=t}if(h){let t=h(this.options.zoom,y);Zi(t)&&(t=0),this.feaLineDy=t}if(d){let t=d(this.options.zoom,y);Zi(t)&&(t=0),0!==t&&(this.properties.hasPatternAnim=1),this.feaPatternAnimSpeed=t}if(f){let t=f(this.options.zoom,y);Zi(t)&&(t=0),this.feaLinePatternGap=t}const v=this.options.EXTENT;let w=m.geometry;if(v!==1/0){w=[];const t=[];for(let e=0;e<m.geometry.length;e++){t[0]=m.geometry[e];const i=na(t,-1,-1,v+1,v+1);if(3===m.type&&i.length>1){const t=i[0],e=i[i.length-1];t[0].equals(e[e.length-1])&&(i[0]=e.concat(t.slice(1)),i.length=i.length-1)}w.push(...i)}}const x=this.needAltitudeAttribute()?2:3;for(let t=0;t<w.length;t++)this.offset=this.data.aPosition.length/x,this.vt(w[t],m,g,b,2,1.05)}wt(){return this.iconAtlas&&this.feaTexInfo[2]&&this.feaTexInfo[3]}vt(t,e,i,n,r,o){const s=this.wt()||Ta(this.feaDash)||Ta(this.symbol.lineDasharray),a=this.options.isTube;a&&(t=t.map(t=>new ba(t))),this.overscaling=1;const l=this.options.EXTENT;if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.prevVertex=null,this.symbol.lineGradientProperty&&e.properties&&nn(e.properties,"mapbox_clip_start")&&nn(e.properties,"mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance()}const u=3===e.type&&!t.clipped;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<(u?3:2))return;"bevel"===i&&(r=1.05);const d=this.overscaling<=16?15*l/(512*this.overscaling):0,f={vertexLength:0,primitiveLength:0,currentNormal:null};let p,m,y,g,b;this.e1=this.e2=-1,u&&(p=t[c-2],b=t[h].sub(p).S()._());for(let e=h;e<c;e++){if(y=e===c-1?u?t[h+1]:void 0:t[e+1],y&&t[e].equals(y))continue;b&&(g=b),p&&(m=p),p=t[e],b=y?y.sub(p).S()._():g,f.dir=m?p.sub(m).S():y.sub(p).S(),g=g||b,f.currentNormal=g;let l=g.add(b);0===l.x&&0===l.y||l.S();const v=g.x*b.x+g.y*b.y,w=l.x*b.x+l.y*b.y,x=0!==w?1/w:1/0,k=2*Math.sqrt(2-2*w),M=w<va&&m&&y,j=g.x*b.y-g.y*b.x>0;if(!a&&M&&e>h){const t=p.dist(m);if(t>2*d){const e=p.sub(p.sub(m).M(d/t).P());e.z=p.z,this.updateDistance(m,e),this.addCurrentVertex(e,g,0,0,f),m=e}}const A=m&&y;f.middleVertex=A;let F=A?i:u?"butt":n;if(A&&"round"===F&&(x<o?F="miter":x<=2&&(F="fakeround")),"miter"===F&&x>r&&!a&&(F="bevel"),"bevel"===F&&(x>2&&(F="flipbevel"),x<r&&(F="miter")),m&&this.updateDistance(m,p),"miter"===F)a?(this.addCurrentVertex(p,g,0,0,f),f.dir=y.sub(p).S(),this.addCurrentVertex(p,b,0,0,f)):(l.M(x),this.addCurrentVertex(p,l,0,0,f),s&&(f.currentNormal=b,this.addCurrentVertex(p,l,0,0,f)));else if("flipbevel"===F){if(x>100)l=b.mult(-1);else{const t=x*g.add(b).mag()/g.sub(b).mag();l._().M(t*(j?-1:1))}this.addCurrentVertex(p,l,0,0,f),this.addCurrentVertex(p,l.mult(-1),0,0,f)}else if("bevel"===F||"fakeround"===F){const t=-Math.sqrt(x*x-1),e=j?t:0,i=j?0:t;if(m&&this.addCurrentVertex(p,g,e,i,f),"fakeround"===F){const t=Math.round(180*k/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+v*(v*(3.55645-1.43519*v)-3.2452))*t*t+(.848013+v*(.215638*v-1.06021)))}const n=b.sub(g).M(i).u(g).S().M(j?-1:1);this.addHalfVertex(p,n.x,n.y,!1,j,0,f)}}y&&(f.currentNormal=b,this.addCurrentVertex(p,b,-e,-i,f))}else if("butt"===F)this.addCurrentVertex(p,l,0,0,f);else if("square"===F){const t=m?1:-1;this.addCurrentVertex(p,l,t,t,f)}else"round"===F&&(m&&(this.addCurrentVertex(p,g,0,0,f),this.addCurrentVertex(p,g,1,1,f,!0)),y&&(this.addCurrentVertex(p,b,-1,-1,f,!0),this.addCurrentVertex(p,b,0,0,f)));if(!a&&M&&e<c-1){const t=p.dist(y);if(t>2*d){const e=p.add(y.sub(p).M(d/t).P());e.z=p.z,this.updateDistance(p,e),this.addCurrentVertex(e,b,0,0,f),p=e}}}}addCurrentVertex(t,e,i,n,r,o=!1){const s=e.x+e.y*i,a=e.y-e.x*i,l=e.y*n-e.x,u=-e.y-e.x*n;let c=0,h=0;if(r.middleVertex){xa.x=s,xa.y=a,ka.x=l,ka.y=u;const t=r.currentNormal;if(c=_a(t,xa),0===i&&0===n)h=-c;else{const e=Ma;e.x=t.x,e.y=t.y,e.M(-1),h=_a(e,ka)}}this.addHalfVertex(t,s,a,o,!1,i,r,c),this.addHalfVertex(t,l,u,o,!0,-n,r,h),this.prevVertex&&t.equals(this.prevVertex)||(this.prevVertex=t),this.distance>wa/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,i,n,r,o))}addHalfVertex({x:t,y:e,z:i},n,r,o,s,a,l,u){this.fillData(this.data,t,e,i||0,n,r,o,s,1*this.scaledDistance,u);const c=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.addElements(this.e1,this.e2,c),l.primitiveLength++),s?this.e2=c:this.e1=c}fillData(t,e,i,n,r,o,s,a,l,u){const{lineWidthFn:c,lineStrokeWidthFn:h,lineStrokeColorFn:d,lineColorFn:f,lineOpacityFn:p,lineDxFn:m,lineDyFn:y,linePatternAnimSpeedFn:g,linePatternGapFn:b}=this.et;this.fillPosition(t,e,i,n);let v=63*r;v=(Math.sign(v)||1)*((Math.floor(Math.abs(v))>>1<<1)+ +s);let w=63*o;w=(Math.sign(w)||1)*((Math.floor(Math.abs(w))>>1<<1)+ +a),t.aExtrude.push(v,w),(this.iconAtlas||this.hasDasharray)&&t.aExtrude.push(63*u),t.aLinesofar.push(l),c&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),h&&t.aLineStrokeWidth.push(Math.round(2*this.feaLineStrokeWidth)),f&&t.aColor.push(...this.feaColor),d&&t.aStrokeColor.push(...this.feaStrokeColor),p&&t.aOpacity.push(this.feaOpacity),this.dasharrayFn&&t.aDasharray.push(...this.feaDash),this.dashColorFn&&t.aDashColor.push(...this.feaDashColor),this.iconAtlas&&t.aTexInfo.push(...this.feaTexInfo),(m||y)&&t.aLineDxDy.push(this.feaLineDx||0,this.feaLineDy||0),(g||b)&&t.aLinePattern.push(127*(this.feaPatternAnimSpeed||0),10*(this.feaLinePatternGap||0)),this.maxPos=Math.max(this.maxPos,Math.abs(e)+1,Math.abs(i)+1)}addElements(t,e,i){super.addElements(this.offset+t,this.offset+e,this.offset+i)}xt(t){const e=this.options.EXTENT,i=this.elements;for(let n=0;n<i.length;n+=3)e!==1/0&&(Fa(this.data.aPosition,i[n],i[n+1],3,e)||Fa(this.data.aPosition,i[n+1],i[n+2],3,e))||t.push(i[n],i[n+1],i[n+2])}kt(t){if(t.length<=1)return t;const e=[],i=this.options.EXTENT;let n,r=!0;for(n=0;n<t.length-1;n++){const o=Aa(t[n],t[n+1],i);o&&r||(e.push(t[n]),r=o)}return r||e.push(t[n]),e}updateDistance(t,e){if(this.options.isTube){const i=t.dist(e),n=sn(this.options)*(e.z-t.z);this.distance+=Math.sqrt(i*i+n*n)}else this.distance+=t.dist(e);this.updateScaledDistance()}updateScaledDistance(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(wa-1):this.distance}}function Aa(t,e,i){return i!==1/0&&(t.x<0&&e.x<0||t.x>i&&e.x>i||t.y<0&&e.y<0||t.y>i&&e.y>i)}function Fa(t,e,i,n,r){if(r===1/0)return!1;const o=Math.floor(.5*t[e*n]),s=Math.floor(.5*t[e*n+1]),a=Math.floor(.5*t[i*n]),l=Math.floor(.5*t[i*n+1]);return o===a&&(o<0||o>r)&&s!==l||s===l&&(s<0||s>r)&&o!==a}function Ta(t){if(!Array.isArray(t))return!1;for(let e=0;e<t.length;e++)if(t[e])return!0;return!1}const za=new Ot(0,0),Sa=new Ot(0,0);function _a(t,e){const i=t.mag(),n=e.mag();za.x=e.x,za.y=e.y;const r=t.angleTo(Sa),o=e.angleTo(Sa);return Math.sign(o-r)*Math.sqrt(n*n-i*i)}class Pa extends ja{constructor(t,e,i){super(t,e,i),this.Mt=i.altitudeProperty}getFormat(){const{lineColorFn:t,lineWidthFn:e}=this.et,i=[{type:this.maxPosZ>=Math.pow(2,15)?Float32Array:Int16Array,width:3,name:"aPosition"},{type:Uint16Array,width:1,name:"aLinesofar"},{type:Uint8Array,width:1,name:"aUp"},{type:Int16Array,width:3,name:"aExtrudedPosition"},{type:Int8Array,width:2,name:"aExtrude"}];return t&&i.push({type:Uint8Array,width:4,name:"aColor"}),e&&i.push({type:Uint8Array,width:1,name:"aLineWidth"}),this.Mt&&i.push({type:Array,width:1,name:"aLineHeight"}),i}placeVector(t){const e=t.feature;if(this.Mt){const{altitudeScale:t,altitudeProperty:i,defaultAltitude:n,heightProperty:r,defaultHeight:o,minHeightProperty:s}=this.options,{altitude:a,height:l}=hn(e,t,i,n,r,o,s);this.feaAltitude=a,this.feaMinHeight=(a-l)/a*32767,a>this.maxAltitude&&(this.maxAltitude=a)}return super.placeVector(t)}needAltitudeAttribute(){return!1}vt(t,e,i,n,r,o){const s=this.data.aPosition.length/3;super.vt(t,e,i,n,r,o);const a=this.data.aPosition.length/3,l=this.data.aPosition.length/3-this.offset;if(3!==e.type&&l>0&&!1!==this.options.side){const t=!1!==this.options.top?1:0,e=t+4;let i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],n=e.length/i;for(let t=0;t<n;t++)e.push(e[s*n+3*n+t])}i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/i;for(let t=0;t<r;t++)n.push(n[s*r+r*e+t])}i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/i;for(let t=0;t<r;t++)n.push(n[s*r+r*(e+3)+t])}super.addElements(t+1,l+1,l),super.addElements(l,l+1,l+2);const n=this.data.aPosition.length/3-this.offset;i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],n=e.length/i;for(let t=0;t<n;t++)e.push(e[a*n-n+t])}i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/i;for(let t=0;t<r;t++)n.push(n[a*r-e*r-r+t])}i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/i;for(let t=0;t<r;t++)n.push(n[a*r-e*r-3*r+t])}super.addElements(n,l-3,n+1),super.addElements(l-3,n+2,n+1)}}fillData(t,e,i,n,r,o,s,a,l){const u=!1!==this.options.top,c=!1!==this.options.side,h=this.feaLineWidth||this.symbol.lineWidth/2*(this.options.EXTENT/this.options.tileSize),d=63*r,f=63*o,p=h*r+e,m=h*o+i;this.jt(t,e,i,r,o,s,a,l,p,m,d,f),c&&(u&&this.jt(t,e,i,r,o,s,a,l,p,m,d,f),this.jt(t,e,i,r,o,s,a,l,p,m,d,f),this.At(t,e,i,r,o,s,a,l,p,m,d,f),this.At(t,e,i,r,o,s,a,l,p,m,d,f)),this.maxPos=Math.max(this.maxPos,Math.abs(e),Math.abs(i))}jt(t,e,i,n,r,o,s,a,l,u,c,h){const{lineColorFn:d,lineWidthFn:f}=this.et;t.aPosition.push(e,i,32767),t.aLinesofar.push(a),t.aUp.push(+s),t.aExtrudedPosition.push(l,u,1),t.aExtrude.push(c,h),d&&t.aColor.push(...this.feaColor),f&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.Mt&&t.aLineHeight.push(this.feaAltitude)}At(t,e,i,n,r,o,s,a,l,u,c,h){const{lineColorFn:d,lineWidthFn:f}=this.et;t.aPosition.push(e,i,this.feaMinHeight||0),t.aLinesofar.push(a),t.aUp.push(+s),t.aExtrudedPosition.push(l,u,1),t.aExtrude.push(c,h),d&&t.aColor.push(...this.feaColor),f&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.Mt&&t.aLineHeight.push(this.feaAltitude)}addElements(t,e,i){const n=!1!==this.options.top,r=!1!==this.options.side,o=(n?1:0)+(r?4:0);if(t*=o,e*=o,this.data.aUp[this.offset+(i*=o)+4]){if(n&&super.addElements(e,t,i),r){const t=n?1:0;super.addElements(e+t,i+t,i+t+2),super.addElements(e+t+1,i+t+1+2,e+t+1+2)}}else if(n&&super.addElements(t,i,e),r){const e=n?1:0;super.addElements(t+e,t+e+2,i+e),super.addElements(t+e+1+2,i+e+1+2,i+e+1)}}createDataPack(t,e){this.maxAltitude=0;const i=super.createDataPack(t,e);if(!i)return i;const{data:n,indices:r}=i;this.getFormat().reduce((t,e)=>(t[e.name]={size:e.width},t),{}).aPickingId={size:1};const{aExtrudedPosition:o,aPosition:s,aLinesofar:a,aUp:l,aExtrude:u,aColor:c,aLineHeight:h,aLineWidth:d}=n,f={},p=Ye(o,r);let m,y=!0;for(let t=0;t<p.length;t++)p[t]=-p[t],p[t]%1!=0&&(y=!1);if(!1!==this.options.top&&this.symbol.material&&function(t){for(const e in t)if(e.indexOf("Texture")>=0&&t[e])return!0;return!1}(this.symbol.material)&&(m=function(t,e,i){const n=[];for(let r=0;r<t.length;r+=3){const t=e[r/3];n.push(t/256,i[r/3]?1:0)}return n}(o,a,l)),f.aPosition=s,m&&(f.aTexCoord0=new Float32Array(m)),f.aNormal=y?new Int8Array(p):new Float32Array(p),f.aPickingId=n.aPickingId,f.aExtrude=u,c&&(f.aColor=c),d&&(f.aLineWidth=d),h){const t=Gi(this.maxAltitude);f.aLineHeight=new t(h)}const g=[];for(const t in f)g.push(f[t].buffer);return i.data=f,i.buffers=g,i}}const Ia=Math.pow(2,16)/1;class Oa extends as{getFormat(){return[...this.getPositionFormat()]}placeVector(t){const e=t.feature,i=3===e.type,n=e.geometry,r=this.elements;i&&(this.elements=[]);const o=this.needAltitudeAttribute()?2:3;for(let t=0;t<n.length;t++)this.offset=this.data.aPosition.length/o,this.vt(n[t],e),i&&(this.xt(r),this.elements=[]);i&&(this.elements=r)}vt(t,e){const i=3===e.type;let n=t.length;for(;n>=2&&t[n-1].equals(t[n-2]);)n--;let r,o,s,a=0;for(;a<n-1&&t[a].equals(t[a+1]);)a++;if(!(n<(i?3:2))){this.distance=0,this.vertexLength=0,this.primitiveLength=0,this.e1=this.e2=this.e3=-1,i&&(r=t[n-2]);for(let e=a;e<n;e++)s=i&&e===n-1?t[a+1]:t[e+1],s&&t[e].equals(s)||(r&&(o=r),r=t[e],o&&(this.distance+=r.dist(o)),this.addCurrentVertex(r,this.distance))}}addCurrentVertex(t,e){const i=this.vertexLength++;this.addLineVertex(this.data,t,e),i>=1&&this.addElements(i-1,i),e>Ia&&(this.distance=0,this.addCurrentVertex(t,this.distance))}addLineVertex(t,e){this.fillPosition(t,e.x,e.y,e.z||0),this.maxPos=Math.max(this.maxPos,Math.abs(e.x),Math.abs(e.y))}addElements(t,e){super.addElements(this.offset+t,this.offset+e)}xt(t){const e=this.options.EXTENT,i=this.elements;for(let n=0;n<i.length;n+=2)un(this.data.aPosition,i[n],i[n+1],3,e)||t.push(i[n],i[n+1])}}const qa=45*Math.PI/100;class Ea extends as{getFormat(){return[...this.getPositionFormat()]}placeVector(t){const e=this.ft(t,this.symbol.markerSpacing||250,this.symbol.markerPlacement||"point");for(let t=0;t<e.length;t++){const i=e[t];this.fillPosition(this.data,i.x,i.y,i.z);const n=Math.max(Math.abs(i.x),Math.abs(i.y));n>this.maxPos&&(this.maxPos=n)}}ft(t,e,i){const n=t.feature,r=t.feature.type,o=this.options.EXTENT,s=[];if("line"===i){let t=n.geometry;o&&(t=na(n.geometry,0,0,o,o));for(let i=0;i<t.length;i++){const n=sa(t[i],e,qa,null,null,24,1,1,o||1/0);s.push.apply(s,n)}}else if(3===r){const t=la(n.geometry,0);for(let e=0;e<t.length;e++){const i=ha(t[e],16);dn(i,o)||s.push(i)}}else if(2===n.type)for(let t=0;t<n.geometry.length;t++){const e=n.geometry[t];dn(e[0],o)||s.push(e[0])}else if(1===n.type)for(let t=0;t<n.geometry.length;t++){const e=n.geometry[t];for(let t=0;t<e.length;t++){const i=e[t];dn(i,o)||s.push(i)}}return s}hasElements(){return!1}}\n/*!\n * from @turf/bboxClip\n * https://github.com/Turfjs/turf\n * MIT LICENSE\n */const Ra=[],Ca=[];function Na(t,e){var i,n,r,o,s,a,l;for(n=1;n<=8;n*=2){for(i=[],o=!(Da(r=t[t.length-1],e)&n),s=0;s<t.length;s++){if((l=!(Da(a=t[s],e)&n))!==o){const t=La(r,a,n,e);i.push(void 0!==a.x?new Ot(t[0],t[1]):t)}l&&i.push(a),r=a,o=l}if(!(t=i).length)break}return i}function La(t,e,i,n){return Ra[0]=void 0===t.x?t[0]:t.x,Ra[1]=void 0===t.y?t[1]:t.y,t=Ra,Ca[0]=void 0===e.x?e[0]:e.x,Ca[1]=void 0===e.y?e[1]:e.y,e=Ca,8&i?[t[0]+(e[0]-t[0])*(n[3]-t[1])/(e[1]-t[1]),n[3]]:4&i?[t[0]+(e[0]-t[0])*(n[1]-t[1])/(e[1]-t[1]),n[1]]:2&i?[n[2],t[1]+(e[1]-t[1])*(n[2]-t[0])/(e[0]-t[0])]:1&i?[n[0],t[1]+(e[1]-t[1])*(n[0]-t[0])/(e[0]-t[0])]:null}function Da(t,e){Ra[0]=void 0===t.x?t[0]:t.x,Ra[1]=void 0===t.y?t[1]:t.y;var i=0;return(t=Ra)[0]<e[0]?i|=1:t[0]>e[2]&&(i|=2),t[1]<e[1]?i|=4:t[1]>e[3]&&(i|=8),i}class Ua extends as{constructor(...t){super(...t),this.lineElements=[]}createStyledVector(t,e,i,n,r){const o=new mn(t,e,i,n),s=o.getPolygonResource();return!this.options.atlas&&s&&(r[s]=[0,0]),o}getFormat(){const t=[...this.getPositionFormat()],{polygonFillFn:e,polygonOpacityFn:i,uvScaleFn:n,uvOffsetFn:r}=this.et;if(this.iconAtlas){const e=this.getIconAtlasMaxValue();t.push({type:e>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return e&&t.push({type:Uint8Array,width:4,name:"aColor"}),i&&t.push({type:Uint8Array,width:1,name:"aOpacity"}),n&&t.push({type:Uint16Array,width:2,name:"aUVScale"}),r&&t.push({type:Uint8Array,width:2,name:"aUVOffset"}),t}createDataPack(...t){this.maxLineIndex=0,this.lineElements=[];const e=super.createDataPack(...t);if(!e)return e;let i=this.lineElements;return i=new(Hi(this.maxLineIndex))(this.lineElements),e.lineIndices=i,e.buffers.push(i.buffer),e}placeVector(t,e){const i=t.feature;this.Ft(i.geometry,i,e)}Ft(t,e){let i,n,r,o;const{polygonFillFn:a,polygonOpacityFn:l,uvScaleFn:u,uvOffsetFn:c}=this.et,h=e.properties;a&&(i=a(this.options.zoom,h)||[255,255,255,255],s(i)?i=[0,0,0,0]:(i=Array.isArray(i)?i.map(t=>255*t):We(i).array(),3===i.length&&i.push(255))),l&&(n=l(this.options.zoom,h),Zi(n)&&(n=1),n*=255),u&&(r=u(this.options.zoom,h),Zi(r)&&(r=[1,1]),r=[255*r[0],255*r[1]]),c&&(o=c(this.options.zoom,h),Zi(o)&&(o=[0,0]),o=[255*o[0],255*o[1]]);const d=!!this.iconAtlas,f=la(t,500),p=[0,0],m=[0,0];if(d){const{polygonPatternFileFn:t}=this.et,e=t?t(null,h):this.symbol.polygonPatternFile;if(this.iconAtlas.glyphMap[e]){const t=this.iconAtlas.positions[e];p[0]=t.tl[0]+1,p[1]=t.tl[1]+1,m[0]=t.displaySize[0]-3,m[1]=t.displaySize[1]-3}}const y=this.needAltitudeAttribute()?2:3,g=[-1,-1,e.extent+1,e.extent+1];for(let t=0;t<f.length;t++){const e=f[t],s=this.data.aPosition.length/y,a=[],l=[];for(let t=0;t<e.length;t++){let s=e[t];if(this.options.EXTENT!==1/0&&0===this.maxPosZ&&(s=Na(s,g)),0===s.length)continue;0!==t&&l.push(a.length/3);const u=this.lineElements.length;this.fillPosition(this.data,s[0].x,s[0].y,s[0].z||0),d&&this.data.aTexInfo.push(...p,...m),void 0!==i&&this.data.aColor.push(...i),void 0!==n&&this.data.aOpacity.push(n),void 0!==r&&this.data.aUVScale.push(...r),void 0!==o&&this.data.aUVOffset.push(...o),this.maxPos=Math.max(this.maxPos,Math.abs(s[0].x),Math.abs(s[0].y)),this.addLineElements(u+s.length-1,u),a.push(s[0].x),a.push(s[0].y),a.push(s[0].z||0);for(let t=1;t<s.length;t++)this.fillPosition(this.data,s[t].x,s[t].y,s[t].z||0),d&&this.data.aTexInfo.push(...p,...m),void 0!==i&&this.data.aColor.push(...i),void 0!==n&&this.data.aOpacity.push(n),void 0!==r&&this.data.aUVScale.push(...r),void 0!==o&&this.data.aUVOffset.push(...o),this.maxPos=Math.max(this.maxPos,Math.abs(s[t].x),Math.abs(s[t].y)),this.addLineElements(u+t-1,u+t),a.push(s[t].x),a.push(s[t].y),a.push(s[t].z||0)}const u=Ti(a,l,3);for(let t=0;t<u.length;t+=3)this.addElements(s+u[t],s+u[t+1],s+u[t+2])}}addLineElements(...t){this.maxLineIndex=Math.max(this.maxLineIndex,...t),this.lineElements.push(...t)}}const $a=[{type:Int16Array,width:3,name:"aPosition"}];class Wa extends as{getFormat(){return $a}placeVector(t,e){const i=this.ft(t,e);if(0===i.length)return;const n=this.data,r=this.getAltitude(t.feature.properties);let o=n.aPosition.length/$a[0].width;for(let t=0;t<i.length;t++){const e=i[t];n.aPosition.push(2*e.x+0,2*e.y+0,r),n.aPosition.push(2*e.x+1,2*e.y+0,r),n.aPosition.push(2*e.x+1,2*e.y+1,r),n.aPosition.push(2*e.x+0,2*e.y+1,r),this.addElements(o,o+1,o+2),this.addElements(o,o+2,o+3),o+=4;const s=Math.max(Math.abs(2*e.x+1),Math.abs(2*e.y+1));s>this.maxPos&&(this.maxPos=s)}}ft(t,e){const{feature:i,symbol:n}=t,r=this.bt(n),o=i.properties,{markerSpacingFn:s}=this.et,a=((s?s(null,o):n.markerSpacing)||250)*e;return ma(t,null,null,e,this.options.EXTENT,r,a)}bt(t){return t.markerPlacement}}class Ja extends ja{constructor(t,e,i){(e=Xi({},e)).lineJoin="miter",e.lineCap="butt",super(t,e,i),this.options.radialSegments%2==1&&this.options.radialSegments--}getFormat(){const{lineWidthFn:t,lineColorFn:e,lineOpacityFn:i,linePatternAnimSpeedFn:n,linePatternGapFn:r}=this.et,o=[...this.getPositionFormat(),{type:Int8Array,size:4,name:"aTubeNormal"},{type:this.options.positionType||Uint16Array,width:1,name:"aLinesofar"}];if(this.iconAtlas){o.push({type:Int8Array,width:1,name:"aNormalDistance"});const t=this.getIconAtlasMaxValue();o.push({type:t>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return t&&o.push({type:Uint16Array,width:1,name:"aLineWidth"}),e&&o.push({type:Uint8Array,width:4,name:"aColor"}),i&&o.push({type:Uint8Array,width:1,name:"aOpacity"}),n&&o.push({type:Int8Array,width:1,name:"aLinePatternAnimSpeed"}),r&&o.push({type:Int8Array,width:1,name:"aLinePatternGap"}),o}addHalfVertex(t,e,i,n,r,o,s,a){const{x:l,y:u,z:c}=t,h=1*this.scaledDistance,d=this.options.radialSegments/2,{x:f,y:p,z:m}=s.dir,y=function(t,e,i,n,r,o,s,a){dt(Ha,i,n,r),dt(Ga,o,s,0),gt(Va,Ha,Ga),mt(Ga,Ga),mt(Va,Va),Ba[e]||(Ba[e]=[]);const l=Ba[e];for(var u=0;u<e;u++){const t=Math.PI*u/e,i=1-Math.abs(t-0)/(Math.PI/2);l[u]=l[u]||[],Xa(Ga,Va,l[u],1,t,i*(a?-1:1))}return l}(0,d,f,p,m,e,i,r);this.prevVertex&&this.fillTubeElements(r),this.fillData(this.data,l,u,c||0,y,r,h,a)}fillTubeElements(t){const e=this.options.radialSegments/2,i=this.needAltitudeAttribute()?2:3,n=this.data.aPosition.length/i;for(let i=0;i<e;i++){const r=i+n-2*e;let o,s;i===e-1&&t?(o=i+n-2*e+1,s=i+n-2*e-2*e+1):(o=i+n+1,s=i+n+1-2*e),super.addElements(i+n-this.offset,o-this.offset,r-this.offset),super.addElements(r-this.offset,o-this.offset,s-this.offset)}}fillData(t,e,i,n,r,o,s,a){const{lineWidthFn:l,lineColorFn:u,lineOpacityFn:c,linePatternAnimSpeedFn:h,linePatternGapFn:d}=this.et,f=r.length;for(let o=0;o<f;o++){if(this.fillPosition(t,e,i,n),xt(r[o],r[o],63),t.aTubeNormal.push(...r[o]),t.aLinesofar.push(s),this.iconAtlas&&(t.aNormalDistance.push(63*a),t.aTexInfo.push(...this.feaTexInfo)),l){const e=an(this.options.metric);let i=this.feaLineWidth*e;isNaN(i)&&(i=0),t.aLineWidth.push(Math.round(i))}u&&t.aColor.push(...this.feaColor),c&&t.aOpacity.push(this.feaOpacity),h&&t.aLinePatternAnimSpeed.push(127*(this.feaPatternAnimSpeed||0)),d&&t.aLinePatternGap.push(10*(this.feaLinePatternGap||0))}this.maxPos=Math.max(this.maxPos,Math.abs(e)+1,Math.abs(i)+1)}}const Ha=[],Ga=[],Va=[],Ba={};function Xa(t,e,i,n,r,o){return wt(i,n*(Math.cos(r)*t[0]+Math.sin(r)*e[0]),n*(Math.cos(r)*t[1]+Math.sin(r)*e[1]),n*(Math.cos(r)*t[2]+Math.sin(r)*e[2]),o),i}class Za extends Ja{addHalfVertex(t,e,i,n,r,o,s,a){const{x:l,y:u,z:c}=t,h=1*this.scaledDistance,{x:d,y:f,z:p}=s.dir,m=function(t,e,i,n,r,o,s,a){dt(Ka,i,n,r),dt(Qa,o,s,0),gt(tl,Ka,Qa),mt(Qa,Qa),mt(tl,tl),function(t,e,i){t[0]=e,t[1]=i}(Ya,t,e);const l=zt(Ya)/t,u=Math.atan(e/t);let c=Math.PI/2+(Math.PI/2-u);return el[0]||(el[0]=[]),Xa(Qa,tl,el[0],l,c,a?1:-1),c+=2*u,el[1]||(el[1]=[]),Xa(Qa,tl,el[1],l,c,a?1:-1),el}(this.feaLineWidth,this.feaLineHeight,d,f,p,e,i,r);this.prevVertex&&this.fillTubeElements(r),this.fillData(this.data,l,u,c||0,m,r,h,a)}}const Ya=[],Ka=[],Qa=[],tl=[],el=[];var il=Object.freeze({__proto__:null,clipPolygon:Na,calculateSignedArea:ln,getFeaAltitudeAndHeight:hn,convertRTLText:Qs,packPosition:yn,unpackPosition:function(t,e,i,n){const r=(Math.sign(e)||1)*(Math.abs(e)%gn),o=(Math.sign(i)||1)*(Math.abs(i)%gn),s=Math.floor(Math.abs(e)/gn),a=Math.floor(Math.abs(i)/gn);return t[0]=r,t[1]=o,t[2]=Math.sign(n+1e-5)*(2*s+a)*bn+n,t}});const nl={polygonPatternFile:1,markerFile:1,markerPlacement:1,markerSpacing:1,textName:1,textStyle:1,textFaceName:1,textWeight:1,textPlacement:1,textSpacing:1,lineJoin:1,lineCap:1,linePatternFile:1};Object.assign({visible:1,textHorizontalAlignment:1,textVerticalAlignment:1,textWrapWidth:1,markerHorizontalAlignment:1,markerVerticalAlignment:1},nl),Object.assign({lineDasharray:1},nl);function rl(t,e,i,n,r,o,s,a,l,u,c,h,d,f,p){const m=e.length,y=r/3;for(let i=2,n=m;i<n;i+=3)t[r+i-2]=e[i-2],t[r+i-1]=e[i-1],t[r+i-0]=e[i]-o;r+=m;for(let i=2,n=m;i<n;i+=3)t[r+i-2]=e[i-2],t[r+i-1]=e[i-1],t[r+i-0]=e[i]-s;r+=m;for(let i=2,n=m;i<n;i+=3)t[r+i-2]=e[i-2],t[r+i-1]=e[i-1],t[r+i-0]=e[i]-o;r+=m;for(let i=2,n=m;i<n;i+=3)t[r+i-2]=e[i-2],t[r+i-1]=e[i-1],t[r+i-0]=e[i]-s;r+=m,(i=i||[]).push(m/3);for(let e=0;e<i.length;e++){ol(y+(i[e-1]||0),y+i[e],t,m/3,a,n,l,u,c,h,d,f,p)}return r}function ol(t,e,i,n,r,o,s,a,l,u,c,h,d){const f=o.length;let p,m;for(let s=t,a=e;s<a-1;s++)p=s,m=s+1,it(i,p,m,r)||((s-t)%2==1&&(p+=2*n,m+=2*n),o.push(p+n,p,m),o.push(m,m+n,p+n));s&&function(t,e,i,n,r,o,s,a,l){let u,c=0,h=0,d=0,f=0;for(let p=n.length-1;p>=0;p--){const m=3*n[p],y=3*n[p]+1,g=3*n[p]+2,b=i[m],v=i[y],w=i[g];c||h||(c=Math.max(i[g],i[3*n[p-2]+2]),h=Math.min(i[g],i[3*n[p-2]+2]),u=c-h);let x=d;const k=p%6;0===t?(5===k&&(f=It(i,n,p,b,v)),x=2===k||3===k||4===k?d:d+f):1===t&&(2===k||3===k||4===k?x=0:5===k?(f=It(i,n,p,b,v),x=f):x=f);const M=x*s*a/r,j=w===c?0:u*l/o;e[m/3*2]=M,e[m/3*2+1]=-j,0===k&&(d+=f)}}(a,l,i,o.slice(f,o.length),u[0],u[1],c,h,d)}function sl(t,e,i,n,r,o,s,u,c,h){void 0===e.top&&(e.top=!0),void 0===e.side&&(e.side=!0);const{altitudeScale:d,altitudeProperty:f,defaultAltitude:p,heightProperty:y,minHeightProperty:g,defaultHeight:b,tangent:j,uv:A,uvScale:F,topUVMode:T,sideUVMode:z,top:S,side:_,topThickness:P}=e,I=function(t,e,{altitudeScale:i,altitudeProperty:n,defaultAltitude:r,heightProperty:o,minHeightProperty:s,defaultHeight:a},{side:l,top:u,topThickness:c,uvOrigin:h,uv:d,uvSize:f,topUVMode:p,sideUVMode:y,glScale:g,localScale:b,vScale:w},M){const j=e/t[0].extent,A=[],F=[],T=[],z=[],S=[],_=[],P=!!d,I=!!u,O=!!l,q=P?[]:null;function E(t,i,n,r){if(I){const r=Ti(z,n,3);if(0===r.length)return i;let o;v(S,z),i+=z.length;for(let e=2,i=r.length;e<i;e+=3)o=r[e-1],r[e-1]=r[e]+t/3,r[e]=o+t/3,r[e-2]+=t/3;v(_,r),P&&St(p||0,t,i,q,S,0,g,b,f[0],f[1]),c>0&&!O&&(i=rl(S,z,n,_,i,0,c,e,P,y||0,q,f,g,b,w))}return O&&(I&&(c=0),i=rl(S,z,n,_,i,c,r,e,P,y||0,q,f,g,b,w)),i}let R=0,C=0;const N=[-1,-1,e+1,e+1];let L=0,D=t.length;void 0!==M&&(L=M,D=M+1);let U=0,$=!1;for(;L<D;L++){const l=t[L],u=l.id;m(u)&&(Math.abs(u)>U&&(U=Math.abs(u)),u<0&&($=!0));const c=l.geometry,{altitude:h,height:d}=il.getFeaAltitudeAndHeight(l,i,n,r,o,a,s);R=Math.max(Math.abs(h),R);const f=S.length;let p=C,y=[];z.length=0;for(let t=0,i=c.length;t<i;t++){const n=il.calculateSignedArea(c[t])<0;!n&&t>0&&(C=E(p,C,y,d*j),z.length=0,y=[],p=C);let r=c[t];if(e!==1/0&&(r=il.clipPolygon(r,N)),!r.length){t===i-1&&(C=E(p,C,y,d*j));continue}const o=r.length;Array.isArray(r[0])?r[0][0]===r[o-1][0]&&r[0][1]===r[o-1][1]||r.push([r[0][0],r[0][1]]):r[0].x===r[o-1].x&&r[0].y===r[o-1].y||r.push(r[0]),n&&y.push(z.length/3),et(z,z.length,r,j,h),t===i-1&&(C=E(p,C,y,d*j))}const g=S.length-f,b="__fea_idx".trim();for(let t=0;t<g/3;t++)F.push(void 0===l[b]?L:l[b]),A.push(L),m(u)&&T.push(u)}const W=x(F.length?F[F.length-1]:0),J={maxAltitude:R,vertices:new(k(Math.max(512,R)))(S),indices:_,pickingIds:new W(F),featureIndexes:A};if(T.length){const t=$?k(U):x(U);J.featureIds=new t(T)}else J.featureIds=[];return q&&(q.length=S.length/3*2,J.uvs=q),J}(t,i,{altitudeScale:d,altitudeProperty:f,defaultAltitude:p||0,heightProperty:y,minHeightProperty:g,defaultHeight:b||0},{top:S,side:_,topThickness:10*P||0,uv:A||j,uvSize:F?[.5*F[0],.5*F[1]]:[.5,.5],uvOrigin:n,topUVMode:T,sideUVMode:z,glScale:r,localScale:s,vScale:o},h),O=[],q=new(w(I.vertices.length/3))(I.indices);delete I.indices,O.push(q.buffer,I.vertices.buffer,I.pickingIds.buffer);const E=Ye(I.vertices,q);let R=!0;for(let t=0;t<E.length;t++)E[t]=-E[t],E[t]%1!=0&&(R=!1);if(I.normals=E,j){let t=function(t,e,i,n){const r=t.length/3,o=new Array(4*r),s=[],a=[];for(let t=0;t<r;t++)s[t]=[0,0,0],a[t]=[0,0,0];const l=[0,0,0],u=[0,0,0],c=[0,0,0],h=[0,0],d=[0,0],f=[0,0],p=[0,0,0],m=[0,0,0];function y(e,n,r){Ke(l,t,3*e),Ke(u,t,3*n),Ke(c,t,3*r),Qe(h,i,2*e),Qe(d,i,2*n),Qe(f,i,2*r);const o=u[0]-l[0],y=c[0]-l[0],g=u[1]-l[1],b=c[1]-l[1],v=u[2]-l[2],w=c[2]-l[2],x=d[0]-h[0],k=f[0]-h[0],M=d[1]-h[1],j=f[1]-h[1],A=1/(x*j-k*M);dt(p,(j*o-M*y)*A,(j*g-M*b)*A,(j*v-M*w)*A),dt(m,(x*y-k*o)*A,(x*b-k*g)*A,(x*w-k*v)*A),ft(s[e],s[e],p),ft(s[n],s[n],p),ft(s[r],s[r],p),ft(a[e],a[e],m),ft(a[n],a[n],m),ft(a[r],a[r],m)}for(let t=0,e=n.length;t<e;t+=3)y(n[t+0],n[t+1],n[t+2]);const g=[],b=[],v=[],w=[];let x,k,M;function j(t){Ke(v,e,3*t),ht(w,v),k=s[t],ht(g,k),bt(g,g,function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}(v,v,yt(v,k))),mt(g,g),gt(b,w,k),M=yt(b,a[t]),x=M<0?-1:1,o[4*t]=g[0],o[4*t+1]=g[1],o[4*t+2]=g[2],o[4*t+3]=x}for(let t=0,e=n.length;t<e;t+=3)j(n[t+0]),j(n[t+1]),j(n[t+2]);return o}(I.vertices,I.normals,I.uvs,q);t=function(t,e){const i=new Float32Array(e.length),n=[],r=[],o=[];for(let s=0;s<e.length;s+=4){const a=s/4*3;dt(r,t[a]||0,t[a+1]||0,t[a+2]||0),wt(n,e[s]||0,e[s+1]||0,e[s+2]||0,e[s+3]||0),Ze(o,r,n),vt(i.subarray(s,s+4),o)}return i}(I.normals,t),I.tangents=t,O.push(t.buffer),delete I.normals}if(I.normals&&(I.normals=R?new Int8Array(I.normals):new Float32Array(I.normals),O.push(I.normals.buffer)),I.uvs){const t=I.uvs;I.uvs=new Float32Array(t),O.push(I.uvs.buffer)}const C=function(t,e,i,n){const r={};if(M(e.polygonFill)){const o={},s=l(e.polygonFill),a=new Uint8Array(4*n.length);for(let e=0;e<n.length;e++){const r=t[n[e]],l=r.properties||{};l.$layer=r.layer,l.$type=r.type;let u=s(i,l);if(delete l.$layer,delete l.$type,Array.isArray(u)||(u=o[u]=o[u]||We(u).array()),Array.isArray(u)){for(let t=0;t<u.length;t++)al[t]=255*u[t];3===u.length&&(al[3]=255)}a[4*e]=al[0],a[4*e+1]=al[1],a[4*e+2]=al[2],a[4*e+3]=al[3]}r.aColor=a}if(M(e.polygonOpacity)){const o=a(e.polygonOpacity),s=new Uint8Array(n.length);for(let e=0;e<n.length;e++){const r=t[n[e]],a=r.properties||{};a.$layer=r.layer,a.$type=r.type;const l=o(i,a);delete a.$layer,delete a.$type,s[e]=255*l}r.aOpacity=s}return r}(t,u,c,I.featureIndexes),N={data:{data:{aPosition:I.vertices,aNormal:I.normals,aTexCoord0:I.uvs,aTangent:I.tangents,aPickingId:I.pickingIds},indices:q,properties:{maxAltitude:I.maxAltitude}},buffers:O};return I.featureIds.length?(N.data.featureIds=I.featureIds,O.push(N.data.featureIds.buffer)):N.data.featureIds=[],C.aColor&&(N.data.data.aColor=C.aColor,N.buffers.push(C.aColor.buffer)),C.aOpacity&&(N.data.data.aOpacity=C.aOpacity,N.buffers.push(C.aOpacity.buffer)),N}const al=[];function ll(t,e,{altitudeScale:i,altitudeProperty:n,defaultAltitude:r,heightProperty:o,minHeightProperty:s,defaultHeight:a,bottom:l}){const u=l,c=e/t[0].extent,h=2*function(t,e){let i=0;for(let n=0,r=t.length;n<r;n++){const r=t[n];if(m(r.geometry[0][0])){const t=3*r.geometry.length;i+=e?2*t-6:t}else for(let t=0,n=r.geometry.length;t<n;t++){let n=3*r.geometry[t].length;3===r.type&&(n-=3),i+=e?2*n-6:n}}return i}(t)+3*t.length*2,d=[],f=new Int16Array(h),p=[];function y(t,i,n){const r=i-t,o=f.subarray(t,i),s=f.subarray(i,i+r);s.set(o);for(let t=2,e=s.length;t<e;t+=3)s[t]=o[t]-n;const a=t/3,l=r/3;let c,h;for(let t=a,i=l+a;t<i;t++)t<i-1?(c=t,h=t+1):(c=t,h=a),it(f,c,h,e)||(p.push(c,h),u&&p.push(c+l,h+l),ul(f,c,e)||p.push(c,c+l));return i+r}let g=0,b=0;const v="__fea_idx".trim();for(let e=0,l=t.length;e<l;e++){const l=t[e],u=l.geometry,{altitude:h,height:m}=il.getFeaAltitudeAndHeight(l,i,n,r,o,a,s);b=Math.max(Math.abs(h),b);let w=g;for(let t=0,e=u.length;t<e;t++){let e=u[t];const i=e.length;e[0][0]===e[i-1][0]&&e[0][1]===e[i-1][1]&&(e=e.slice(0,i-1)),g=et(f,w,e,c,h),g=y(w,g,m*c),w=g}const x=p.length-d.length;for(let t=0;t<x;t++)d.push(l[v])}const M=new(w(p.reduce((t,e)=>Math.max(t,e),0)))(p),j=x(t.length);return{aPosition:new(k(Math.max(512,b)))(f),indices:M,aPickingId:new j(d)}}function ul(t,e,i){const n=t[3*e],r=t[3*e+1];return n<0||n>i||r<0||r>i}function cl(t,e,i){const n=ll(t,i,e),r=[n.aPosition.buffer,n.indices.buffer,n.aPickingId.buffer],o=n.indices;return delete n.indices,{data:{data:n,indices:o},buffers:r}}class hl{constructor(t,e,i,n,r){this.id=t,this.options=e,this.upload=i,this.Tt(e.style),this.requests={},this.zt=0,this.St=n,this.loadings=r}updateStyle(t,e){this.options.style=t,this.Tt(t),this.zt++,e()}updateOptions(t,e){this.options=f(this.options,t),e()}loadTile(t,e){const i=this.loadings,n=t.tileInfo.url,r=this.options.debugTile;if(r){const{x:i,y:n,z:o}=t.tileInfo;if(o!==r.z||i!==r.x||n!==r.y)return void e()}if(this.St.has(n)){const{features:r,layers:o}=this.St.get(n),s=i[n];if(delete i[n],!r||!r.length)return this._t(s),void e();if(s)for(let e=0;e<s.length;e++)this.Pt.call(s[e].ref,t,s[e].callback,n,o,r);this.Pt(t,e,n,o,r)}else i[n]?i[n].push({callback:e,ref:this}):(i[n]=[{callback:e,ref:this}],this.requests[n]=this.getTileFeatures(t.tileInfo,(e,r,o,s)=>{const a=i[n];if(delete i[n],this.checkIfCanceled(n))return delete this.requests[n],void this._t(a,null,{canceled:!0});if(delete this.requests[n],this.options.debug&&r)for(let e=0;e<r.length;e++)r[e]._debug_info={index:e,tileId:t.tileInfo.id};if(e)return e.loading||this.St.add(n,{features:[],layers:[]}),void this._t(a,e);if(!r||!r.length)return this.St.add(n,{features:[],layers:[]}),void this._t(a);if(this.St.add(n,{features:r,layers:o}),a)for(let e=0;e<a.length;e++)this.Pt.call(a[e].ref,t,a[e].callback,n,o,r,s)}))}Pt(t,e,i,n,r,o){this.It(n,r,t).then(t=>{t.canceled?e(null,{canceled:!0}):(t.data.style=this.zt,o&&f(t.data,o),e(null,t.data,t.buffers))}).catch(t=>{e(t)})}abortTile(t,e){delete this.requests[t],this.Ot(t),e()}Ot(t){const e=this.loadings[t];if(e)for(let t=0;t<e.length;t++)e[t].callback(null,{canceled:!0});delete this.loadings[t]}_t(t,e,i){if(t)for(let n=0;n<t.length;n++)t[n].callback(e,i)}checkIfCanceled(t){return!this.requests[t]}fetchIconGlyphs(t,e,i){this.upload("fetchIconGlyphs",{icons:t,glyphs:e},null,i)}It(t,e,i){if(!e.length)return Promise.resolve({data:null,buffers:[]});const{glScale:n,tileInfo:r}=i,o=!this.options.style.style.length&&!this.options.style.featureStyle.length;let s=this.pluginConfig.slice(0);o&&(s=this.qt(t)),this.featurePlugins&&v(s,this.featurePlugins);const a=e[0].extent,l=r.z,u={x:r.extent2d.xmin*n,y:r.extent2d.ymax*n},c=[],h=[],d=[],p=this.options,m=[],y={},g=[Promise.resolve(this.zt)];let b=0,x=-1;for(let t=0;t<s.length;t++){x++;const n=s[t];n.type!==b&&(x=0,b=n.type);const r=0===n.type?c:h;if(n.symbol&&!1===n.symbol.visible){r[x]=null;continue}const{tileFeatures:f,tileFeaIndexes:p}=this.Et(n.type,n.filter,e,y,t);if(!f.length){r[x]=null;continue}const v=w(p[p.length-1]);r[x]={styledFeatures:new v(p)},d.push({idx:t,typeIdx:x}),m.push(r[x].styledFeatures.buffer);let k=this.Rt(f,n,{extent:a,zoom:l,tilePoint:u,...i});o&&(k=k.then(t=>{if(!t)return null;if(t.data)t.data.layer=f[0].layer;else if(Array.isArray(t))for(let e=0;e<t.length;e++)t[e]&&t[e].data&&(t[e].data.layer=f[0].layer);return t})),g.push(k)}return Promise.all(g).then(([i,...n])=>{function r(t,e){if(void 0===t.data.ref&&(t.data.type=s[d[e].idx].renderPlugin.dataConfig.type,t.data.filter=s[d[e].idx].filter.def,t.buffers&&t.buffers.length))for(let e=0;e<t.buffers.length;e++)m.push(t.buffers[e])}if(i!==this.zt)return{canceled:!0};for(let t=0;t<n.length;t++){if(!n[t])continue;const e=n[t],i=0===s[d[t].idx].type?c:h;if(Array.isArray(e)){const n=[];for(let i=0;i<e.length;i++)e[i]&&(r(e[i],t),(void 0===e[i].data.ref||e[e[i].data.ref])&&n.push(e[i].data));n.length&&(i[d[t].typeIdx].data=n)}else r(e,t),i[d[t].typeIdx].data=e.data}const o={},l=t;if(p.features||p.schema){let t;for(let i=0,n=e.length;i<n;i++)if(t=e[i],l[t.layer].properties||(l[t.layer].properties=pl(t.properties)),p.features&&t&&y[i])if("id"===p.features)o[i]=t.id;else{const e=f({},t);p.pickingGeometry||delete e.geometry,delete e.extent,delete e.properties.$layer,delete e.properties.$type,delete e.__index,o[i]=e}}return{data:{schema:l,data:c,featureData:h,extent:a,features:o},buffers:m}}).catch(t=>{console.error(t)})}Rt(t,e,i){let n=function(t,e){const i=e.customProperties;if(i)for(let t=0;t<i.length;t++)i[t].fn=rs.compileFilter(i[t].filter);for(let e=0;e<t.length;e++)if(t[e]=f({},t[e]),i)for(let n=0;n<i.length;n++)if(i[n].fn(t[e])){t[e].geojson&&(t[e].properties=f({},t[e].properties)),f(t[e].properties,i[n].properties);break}return t}(t,e);const r=e.renderPlugin.dataConfig,o=e.symbol,s=this.options.tileSize[0],{extent:a,glScale:l,zScale:u,zoom:c,tilePoint:h,pointAtTileRes:d}=i,p=a/s,m=r.type,y=this.options.debugTile&&this.options.debugTile.index;if("3d-extrusion"===m){const t=ml(o);return t&&(r.uv=1,2===t&&(r.tangent=1)),Promise.all([Promise.resolve(sl(n,r,a,h,l,u,this.options.tileSize[1]/a,o,c,y))])}if("3d-wireframe"===m)return Promise.all([Promise.resolve(cl(n,r,a))]);if("point"===m){const t=f({},r,{EXTENT:a,requestor:this.fetchIconGlyphs.bind(this),zoom:c,debugIndex:y,altitudeToTileScale:u*a/this.options.tileSize[1]/l}),e=ga.splitPointSymbol(o);return ga.needMerge(e[0])&&(n=ga.mergeLineFeatures(n,e[0],c)),Promise.all(e.map(e=>new ga(n,e,t).load(p)))}if("native-point"===m){const t=f({},r,{EXTENT:a,zoom:c,debugIndex:y});return yl(n,o,t,Ea,a/s)}if("line"===m){const t=f({},r,{EXTENT:a,requestor:this.fetchIconGlyphs.bind(this),tileRatio:p,zoom:c,debugIndex:y});return yl(n,o,t,ja)}if("native-line"===m){const t=f({},r,{EXTENT:a,zoom:c,debugIndex:y});return yl(n,o,t,Oa)}if("fill"===m){const t=f({},r,{EXTENT:a,requestor:this.fetchIconGlyphs.bind(this),zoom:c,debugIndex:y});return yl(n,o,t,Ua)}if("line-extrusion"===m){delete o.lineGradientProperty,o.lineJoin="miter",o.lineCap="butt";const t=ml(o);t&&(r.uv=1,2===t&&(r.tangent=1));const e=f({},r,{EXTENT:a,tileSize:s,zScale:u,glScale:l,zoom:c,debugIndex:y});if(t){const t=[];if(!1!==r.top){const i=f({},e);i.side=!1,t.push(new Pa(n,o,i))}return!1!==r.side&&(e.side=!0,e.top=!1,t.push(new Pa(n,o,e))),Promise.all(t.map(t=>t.load()))}return Promise.all([new Pa(n,o,e).load()])}if("circle"===m){const t=f({},r,{EXTENT:a,zoom:c,debugIndex:y});return yl(n,o,t,Wa)}if("round-tube"===m||"square-tube"===m){const t="round-tube"===m?Ja:Za,e=f({},r,{EXTENT:a,requestor:this.fetchIconGlyphs.bind(this),zoom:c,debugIndex:y,radialSegments:"round-tube"===m?r.radialSegments||8:4,pointAtTileRes:d,tileRatio:p,isTube:!0});return yl(n,o,e,t)}return Promise.resolve([])}Et(t,e,i,n){const r="__fea_idx".trim(),o=[],s=[],a=i.length;for(let l=0;l<a;l++)if((1===t||void 0===i[l].id||!this.styledFeatures[i[l].id])&&((!e.def||"default"===e.def)&&!n[l]||!0===e.def||e.def&&(void 0!==e.def.condition||Array.isArray(e.def))&&e(i[l]))){n[l]=1;const e=f({},i[l]);if(e[r]=l,s.push(e),o.push(l),1===t)break}return{tileFeatures:s,tileFeaIndexes:o}}Tt(t){const{style:e,featureStyle:i}=t,n={};i.forEach(t=>{Array.isArray(t.id)?(t.id.forEach(t=>{n[t]=1}),t.filter=["in","$id",...t.id]):(n[t.id]=1,t.filter=["==","$id",t.id])});const r=rs.compileStyle(e);for(let t=0;t<e.length;t++)r[t].filter&&(r[t].filter.def=e[t].filter?e[t].filter.value||e[t].filter:void 0),r[t].type=0;const o=[],s=rs.compileStyle(i);for(let t=0;t<i.length;t++)s[t].type=1,s[t].filter.def=i[t].filter?i[t].filter.value||i[t].filter:void 0,s[t].renderPlugin&&o.push(s[t]);this.pluginConfig=r,this.featurePlugins=o,this.styledFeatures=n}qt(t){let e=this.Ct;this.Ct||(e=this.Ct={});const i=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],n=[];for(const r in t){const o=r;if(!e[r]){const n=[];for(let e=0;e<t[r].types.length;e++){const s=t[r].types[e],a=["all",["==","$layer",o],["==","$type",i[s]]],l={filter:Lt(a),renderPlugin:dl(s),symbol:fl(s)};l.filter.def=a,l.type=0,n.push(l)}e[o]=n}n.push(...e[o])}return n}}function dl(t){switch(t){case 1:return{type:"native-point",dataConfig:{type:"native-point",only2D:!0}};case 2:return{type:"native-line",dataConfig:{type:"native-line",only2D:!0}};case 3:return{type:"fill",dataConfig:{type:"fill",only2D:!0}}}return null}function fl(t){switch(t){case 1:return{markerFill:"#f00",markerSize:10};case 2:return{lineColor:"#fff"};case 3:return{polygonFill:"#00f",polygonOpacity:.4}}return null}function pl(t){if(Array.isArray(t)||!g(t))return{};const e={};for(const i in t){const n=t[i];p(n)?e[i]="string":m(n)?e[i]="number":!0===n||!1===n?e[i]="boolean":Array.isArray(n)?e[i]="array":e[i]="object"}return e}function ml(t){if(!t)return 0;let e=0;for(const i in t){if(("normalTexture"===i||"bumpTexture"===i)&&t[i])return 2;if(i.indexOf("Texture")>0&&t[i])e=1;else if(g(t[i])){const n=ml(t[i]);if(2===n)return n;1===n&&(e=1)}}return e}function yl(t,e,i,n,r){const o={},s=Array.isArray(e)?e:[e];let a=-1;for(let t=0;t<s.length;t++)o[t]=gl(s[t]),!o[t]&&s[t]&&-1===a&&(a=t);const l=[];for(let e=0;e<s.length;e++)s[e]&&(s[e].index={index:e},o[e]||e===a?l.push(new n(t,s[e],i).load(r)):l.push({data:{ref:a,symbolIndex:{index:e}}}));return Promise.all(l)}function gl(t){if(!t)return 0;for(const e in t)if(M(t[e]))return 1;return 0}function bl(t,e){vl(t.geometry,e)}function vl(t,e){if(t)switch(t.type){case"Point":wl(t.coordinates,e);break;case"MultiPoint":case"LineString":xl(t.coordinates,e);break;case"MultiLineString":case"Polygon":kl(t.coordinates,e);break;case"MultiPolygon":!function(t,e){for(let i=0;i<t.length;i++)kl(t[i],e)}(t.coordinates,e);break;case"GeometryCollection":for(let i=0;i<t.geometries.length;i++)vl(t.geometries[i],e)}}function wl(t,e){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function xl(t,e){for(let i=0;i<t.length;i++)wl(t[i],e)}function kl(t,e){for(let i=0;i<t.length;i++)xl(t[i],e)}class Ml extends hl{constructor(t,e,i,n,r,o){super(t,e,i,n,r),(e=e||{}).extent||(e.extent=8192),this.zoomOffset=0,e.tileSize&&(this.zoomOffset=-function(t){if(Math.log2)return Math.log2(t);const e=Math.log(t)*Math.LOG2E,i=Math.round(e);return Math.abs(i-e)<1e-14?i:e}(e.tileSize[0]/256)),this.setData(e.data,o)}setData(t,e){if(delete this.index,!t)return void e();const i={maxZoom:24,tolerance:this.options.simplifyTolerance,extent:this.options.extent,buffer:this.options.tileBuffer||64,hasAltitude:!!this.options.hasAltitude,debug:0,lineMetrics:!0,indexMaxZoom:5,indexMaxPoints:1e5,disableFilter:!0};if(p(t)&&"{"!=t.substring(0,1)||t.url)A.getJSON(t.url?t.url:t,t.url?t:{},(t,n)=>{if(t&&e(t),!n)return void e(null,{extent:null,idMap:{}});const r=n,{first1000:o,idMap:s}=this.Nt(r);this.Lt(o,s,r,i,e)});else{"string"==typeof t&&(t=JSON.parse(t));const n=Array.isArray(t)?t:t.features;let r=n;n&&n.length>1e3&&(r=n.slice(0,1e3)),this.Lt(r,null,t,i,e)}}Lt(t,e,i,n,r){try{const o=t&&t.length?function(t){let e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];switch(t.type){case"FeatureCollection":for(let i=0;i<t.features.length;i++)bl(t.features[i],e);break;case"Feature":bl(t,e);break;default:vl(t,e)}return e}({type:"FeatureCollection",features:t}):null;this.index=function(t,e){return new Q(t,e)}(i,this.options.geojsonvt||n),r(null,{extent:o,idMap:e})}catch(t){console.warn(t),r({error:t.message})}}Nt(t){const e=[],i={};let n=0;function r(t){t&&("Feature"!==t.type||t.geometry)&&(void 0!==t.id&&null!==t.id||(t.id=n++),i[t.id]=f({},t),t.geometry?(i[t.id].geometry=f({},t.geometry),i[t.id].geometry.coordinates=null):t.coordinates&&(i[t.id].coordinates=null),e.length<1e3&&e.push(t))}return Array.isArray(t)?t.forEach(t=>{r(t)}):t.features&&t.features.forEach(t=>{r(t)}),{first1000:e,idMap:i}}getTileFeatures(t,e){const i=[];if(!this.index)return setTimeout((function(){e({loading:!0})}),1),1;const n=this.index.getTile(t.z+this.zoomOffset,t.x,t.y);if(!n||0===n.features.length)return setTimeout((function(){e(null,i,[])}),1),1;const r=[];for(let t=0,e=n.features.length;t<e;t++){const e=n.features[t];let o=e.layer;void 0===o&&(o="0"),r[o]={types:{}};r[o].types[e.type]=1,e.tags=e.tags||{},i.push({type:e.type,layer:o,id:e.id,geometry:e.geometry,properties:e.tags,extent:this.options.extent,geojson:!0})}for(const t in r)r[t].types=Object.keys(r[t].types).map(t=>+t);return setTimeout((function(){e(null,i,r)}),1),1}onRemove(){delete this.index}}var jl={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=i?r-1:0,d=i?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=u}return(f?-1:1)*s*Math.pow(2,o-n)},write:function(t,e,i,n,r,o){var s,a,l,u=8*o-r-1,c=(1<<u)-1,h=c>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+f]=255&a,f+=p,a/=256,r-=8);for(s=s<<r|a,u+=r;u>0;t[i+f]=255&s,f+=p,s/=256,u-=8);t[i+f-p]|=128*m}},Al=Tl,Fl=jl;function Tl(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Tl.Varint=0,Tl.Fixed64=1,Tl.Bytes=2,Tl.Fixed32=5;var zl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Sl(t){return t.type===Tl.Bytes?t.readVarint()+t.pos:t.pos+1}function _l(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Pl(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function Il(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Ol(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function ql(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function El(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Rl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Nl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Ll(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Dl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Ul(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function $l(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Wl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Tl.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,o=this.pos;this.type=7&n,t(r,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Ul(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Wl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Ul(this.buf,this.pos)+4294967296*Ul(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Ul(this.buf,this.pos)+4294967296*Wl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Fl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Fl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(r=o[i.pos++],n=(112&r)>>4,r<128)return _l(t,n,e);if(r=o[i.pos++],n|=(127&r)<<3,r<128)return _l(t,n,e);if(r=o[i.pos++],n|=(127&r)<<10,r<128)return _l(t,n,e);if(r=o[i.pos++],n|=(127&r)<<17,r<128)return _l(t,n,e);if(r=o[i.pos++],n|=(127&r)<<24,r<128)return _l(t,n,e);if(r=o[i.pos++],n|=(1&r)<<31,r<128)return _l(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&zl?function(t,e,i){return zl.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var n="",r=e;for(;r<i;){var o,s,a,l=t[r],u=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>i)break;1===c?l<128&&(u=l):2===c?128==(192&(o=t[r+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===c?(o=t[r+1],s=t[r+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(o=t[r+1],s=t[r+2],a=t[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),r+=c}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Tl.Bytes)return t.push(this.readVarint(e));var i=Sl(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Tl.Bytes)return t.push(this.readSVarint());var e=Sl(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Tl.Bytes)return t.push(this.readBoolean());var e=Sl(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Tl.Bytes)return t.push(this.readFloat());var e=Sl(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Tl.Bytes)return t.push(this.readDouble());var e=Sl(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Tl.Bytes)return t.push(this.readFixed32());var e=Sl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Tl.Bytes)return t.push(this.readSFixed32());var e=Sl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Tl.Bytes)return t.push(this.readFixed64());var e=Sl(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Tl.Bytes)return t.push(this.readSFixed64());var e=Sl(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Tl.Varint)for(;this.buf[this.pos++]>127;);else if(e===Tl.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Tl.Fixed32)this.pos+=4;else{if(e!==Tl.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),$l(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),$l(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),$l(this.buf,-1&t,this.pos),$l(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),$l(this.buf,-1&t,this.pos),$l(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+1|0));if(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,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,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:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var n,r,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Pl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Fl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Fl.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Pl(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,Tl.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Il,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Ol,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Rl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,ql,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,El,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Nl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Ll,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Dl,e)},writeBytesField:function(t,e){this.writeTag(t,Tl.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Tl.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Tl.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Tl.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Tl.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Tl.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Tl.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Tl.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Tl.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Tl.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Jl=Ot,Hl=Gl;function Gl(t,e,i,n,r){this.properties={},this.extent=i,this.type=0,this.Dt=t,this.Ut=-1,this.$t=n,this.Wt=r,t.readFields(Vl,this,e)}function Vl(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){var i=t.readVarint()+t.pos;for(;t.pos<i;){var n=e.$t[t.readVarint()],r=e.Wt[t.readVarint()];e.properties[n]=r}}(i,e):3==t?e.type=i.readVarint():4==t&&(e.Ut=i.pos)}function Bl(t){for(var e,i,n=0,r=0,o=t.length,s=o-1;r<o;s=r++)e=t[r],n+=((i=t[s]).x-e.x)*(e.y+i.y);return n}Gl.types=["Unknown","Point","LineString","Polygon"],Gl.prototype.loadGeometry=function(){var t=this.Dt;t.pos=this.Ut;for(var e,i=t.readVarint()+t.pos,n=1,r=0,o=0,s=0,a=[];t.pos<i;){if(r<=0){var l=t.readVarint();n=7&l,r=l>>3}if(r--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&a.push(e),e=[]),e.push(new Jl(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&a.push(e),a},Gl.prototype.bbox=function(){var t=this.Dt;t.pos=this.Ut;for(var e=t.readVarint()+t.pos,i=1,n=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();i=7&c,n=c>>3}if(n--,1===i||2===i)(r+=t.readSVarint())<s&&(s=r),r>a&&(a=r),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==i)throw new Error("unknown command "+i)}return[s,l,a,u]},Gl.prototype.toGeoJSON=function(t,e,i){var n,r,o=this.extent*Math.pow(2,i),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),u=Gl.types[this.type];function c(t){for(var e=0;e<t.length;e++){var i=t[e],n=180-360*(i.y+a)/o;t[e]=[360*(i.x+s)/o-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];c(l=h);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,n,r=[],o=0;o<e;o++){var s=Bl(t[o]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i.push(t[o]))}i&&r.push(i);return r}(l),n=0;n<l.length;n++)for(r=0;r<l[n].length;r++)c(l[n][r])}1===l.length?l=l[0]:u="Multi"+u;var d={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var Xl=Hl,Zl=Yl;function Yl(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this.Dt=t,this.$t=[],this.Wt=[],this.Jt=[],t.readFields(Kl,this,e),this.length=this.Jt.length}function Kl(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e.Jt.push(i.pos):3===t?e.$t.push(i.readString()):4===t&&e.Wt.push(function(t){var e=null,i=t.readVarint()+t.pos;for(;t.pos<i;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(i))}Yl.prototype.feature=function(t){if(t<0||t>=this.Jt.length)throw new Error("feature index out of bounds");this.Dt.pos=this.Jt[t];var e=this.Dt.readVarint()+this.Dt.pos;return new Xl(this.Dt,e,this.extent,this.$t,this.Wt)};var Ql=Zl;function tu(t,e,i){if(3===t){var n=new Ql(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}var eu=function(t,e){this.layers=t.readFields(tu,{},e)};class iu extends hl{constructor(t,e,i,n,r,o){super(t,e,i,n,r),e=e||{},o()}getTileFeatures(t,e){const i=t.url;return A.getArrayBuffer(i,(t,i)=>{if(t)return void e(t);let n;try{n=new eu(new Al(i.data))}catch(t){return void e(t.message,[],[])}const r=[];if(!n.layers)return void e(null,r,[]);const o={};let s;for(const e in n.layers)if(a=n.layers,l=e,Object.prototype.hasOwnProperty.call(a,l)){o[e]={types:{}};const i=o[e].types;for(let o=0,a=n.layers[e].length;o<a;o++)try{s=n.layers[e].feature(o),i[s.type]=1,r.push({type:s.type,layer:e,geometry:s.loadGeometry(),properties:s.properties,extent:s.extent})}catch(t){console.warn("error when load vt geometry:",t)}}var a,l;for(const t in o)o[t].types=Object.keys(o[t].types).map(t=>+t);e(null,r,o,{byteLength:i.data.byteLength})})}abortTile(t,e){const i=this.requests[t];delete this.requests[t],i&&i.abort&&i.abort(),this.Ot(t),e()}onRemove(){for(const t in this.requests)this.requests[t].abort();this.requests={}}}let nu=0;const ru=new class{constructor(t){this.max=t,this.reset()}reset(){return this.data={},this.order=[],this}clear(){this.reset()}add(t,e){return this.has(t)?(this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t)):(this.data[t]=e,this.order.push(t),this.order.length>this.max&&this.getAndRemove(this.order[0])),this}has(t){return t in this.data}keys(){return this.order}getAndRemove(t){if(!this.has(t))return null;const e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e}get(t){return this.has(t)?this.data[t]:null}remove(t){return this.has(t)?(delete this.data[t],this.order.splice(this.order.indexOf(t),1),this):this}setMaxSize(t){for(this.max=t;this.order.length>this.max;)this.getAndRemove(this.order[0]);return this}}(128),ou={};class su{constructor(t){this.Ht={},this.Gt={},this.workerId=t}addLayer({actorId:t,mapId:e,layerId:i,params:n},r){if(this.Vt(e,i))return;const o=this.Bt(e,i),s=n.type,a=n.options,l=this.send.bind(this,t);this.Ht[o]="GeoJSONVectorTileLayer"===s?new Ml(i,a,l,ru,ou,r):new iu(i,a,l,ru,ou,r)}removeLayer({mapId:t,layerId:e},i){const n=this.Vt(t,e),r=this.Bt(t,e);delete this.Ht[r],n&&(n.onRemove(i),this.Xt())}loadTile({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&r.loadTile(i,n)}abortTile({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&r.abortTile&&r.abortTile(i.url,n)}removeTile({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&r.removeTile(i,n)}updateStyle({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&(r.updateStyle(i,n),this.Xt())}updateOptions({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&(r.updateOptions(i,n),this.Xt())}setData({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&(r.setData(i.data,n),this.Xt())}receive(t){const e=t.callback,i=this.Gt[e];delete this.Gt[e],i&&t.error?i(new Error(t.error)):i&&i(null,t.data)}send(t,e,i,n,r){const o=r?`${t}-${nu++}`:null;r&&(this.Gt[o]=r),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:e,params:i,callback:String(o)},n||[])}Bt(t,e){return`${t}-${e}`}Vt(t,e){const i=this.Bt(t,e);return this.Ht[i]}Xt(){const t=Object.keys(ou);for(let e=0;e<t.length;e++)delete ou[t[e]];ru.reset()}}t.initialize=function(){},t.onmessage=function(t,e){const i=t.data;if(this.dispatcher||(this.dispatcher=new su(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const n=i.command;this.dispatcher[n]({actorId:t.actorId,mapId:i.mapId,layerId:i.layerId,params:i.params},(t,i,r)=>{t&&404!==t.status&&console.error(n,t),e(t,i,r)})}},Object.defineProperty(t,"Zt",{value:!0})}';
|
|
28
|
+
const j = 'function(t){function e(t,e){for(let i=0;i<t.stops.length;i++)if(e===t.stops[i][0])return t.stops[i][1];return t.default}function i(t,e){for(var i=0;i<t.stops.length&&!(e<t.stops[i][0]);i++);return t.stops[Math.max(i-1,0)][1]}function n(t,e){for(var i=void 0!==t.base?t.base:1,n=0;!(n>=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:function t(e,i,n,r,s,a){return"function"==typeof s?function(){var o=s.apply(void 0,arguments),l=a.apply(void 0,arguments);return t(e,i,n,r,o,l)}:s.length?function(t,e,i,n,r,s){var a=[];for(let l=0;l<r.length;l++)a[l]=o(t,e,i,n,r[l],s[l]);return a}(e,i,n,r,s,a):o(e,i,n,r,s,a)}(e,i,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function r(t,e){return function(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:null}(e,t.default)}function o(t,e,i,n,r,o){var s,a=n-i,l=t-i;return r*(1-(s=1===e?l/a:(Math.pow(e,l)-1)/(Math.pow(e,a)-1)))+o*s}function s(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type)}function a(t){return c(t,"exponential")}function l(t){return c(t,"interval")}function u(t,e){if(!t)return null;var i=!1;if(Array.isArray(t)){var n,r=[];for(let o=0;o<t.length;o++)(n=u(t[o],e))?(r.push(n),i=!0):r.push(t[o]);return i?r:t}var o,l={__fn_types_loaded:!0},c=[];for(o in t)t.hasOwnProperty(o)&&c.push(o);const h=function(t){Object.defineProperty(l,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=a(this["_"+t])),this["__fn_"+t].apply(this,e())},set:function(e){this["_"+t]=e},configurable:!0,enumerable:!0})};for(let e=0,n=c.length;e<n;e++)s(t[o=c[e]])?(i=!0,l["_"+o]=t[o],h(o)):l[o]=t[o];return i?l:t}function c(t,o){if(!s(t))return function(){return t};let a=!0,l=!0;const u=(t=JSON.parse(JSON.stringify(t))).stops;if(u)for(let t=0;t<u.length;t++)if(s(u[t][1])){const e=c(u[t][1],o);a=a&&e.isZoomConstant,l=l&&e.isFeatureConstant,u[t]=[u[t][0],e]}const h=function t(o,a){var l,u,c;if(s(o)){var h,d=o.stops&&"object"==typeof o.stops[0][0],f=d||void 0!==o.property,p=d||!f,m=o.type||a||"exponential";if("exponential"===m)h=n;else if("interval"===m)h=i;else if("categorical"===m)h=e;else{if("identity"!==m)throw new Error(\'Unknown function type "\'+m+\'"\');h=r}if(d){var y={},g=[];for(let t=0;t<o.stops.length;t++){var b=o.stops[t];void 0===y[b[0].zoom]&&(y[b[0].zoom]={zoom:b[0].zoom,type:o.type,property:o.property,default:o.default,stops:[]}),y[b[0].zoom].stops.push([b[0].value,b[1]])}for(let e in y)g.push([y[e].zoom,t(y[e])]);l=function(t,e){const i=n({stops:g,base:o.base},t)(t,e);return"function"==typeof i?i(t,e):i},u=!1,c=!1}else p?(l=function(t){const e=h(o,t);return"function"==typeof e?e(t):e},u=!0,c=!1):(l=function(t,e){const i=h(o,e?e[o.property]:null);return"function"==typeof i?i(t,e):i},u=!1,c=!0)}else l=function(){return o},u=!0,c=!0;return l.isZoomConstant=c,l.isFeatureConstant=u,l}(t,o);return h.isZoomConstant=a&&h.isZoomConstant,h.isFeatureConstant=l&&h.isFeatureConstant,h}let h=0;const d="function"==typeof Object.assign;function f(t,...e){if(d)return Object.assign(t,...e),t;for(let i=0;i<e.length;i++){const n=e[i];for(const e in n)t[e]=n[e]}return t}function p(t){return!b(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function m(t){return"number"==typeof t&&!isNaN(t)}function y(t){return!b(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function g(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function b(t){return null==t}function v(t){for(let e=1;e<arguments.length;e++){const i=arguments[e];if(i)for(let e=0,n=i.length;e<n;e++)t.push(i[e])}return t.length}function w(t){return t<65536?Uint16Array:Uint32Array}function x(t){return t<256?Uint8Array:t<65536?Uint16Array:Uint32Array}function k(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function M(t){return s(t)&&t.property}const j="function"==typeof fetch&&"function"==typeof AbortController,A={jsonp:function(t,e){const i="_maptalks_jsonp_"+h++;t.match(/\\?/)?t+="&callback="+i:t+="?callback="+i;let n=document.createElement("script");return n.type="text/javascript",n.src=t,window[i]=function(t){e(null,t),document.getElementsByTagName("head")[0].removeChild(n),n=null,delete window[i]},document.getElementsByTagName("head")[0].appendChild(n),this},get:function(t,e,i){if(y(e)){const t=i;i=e,e=t}(e=e||{}).method&&(e.method=e.method.toUpperCase());const n="POST"===e.method;if(j){const r=new AbortController,o={signal:r.signal,method:e.method||"GET",referrerPolicy:"origin"};return n&&(b(e.body)||(o.body=JSON.stringify(e.body))),b(e.headers)||(o.headers=e.headers),b(e.credentials)||(o.credentials=e.credentials),fetch(t,o).then(n=>{const r=this.t(n,e.returnJSON,e.responseType);r.message?(r.url=t,i(r)):r.then(t=>{"arraybuffer"===e.responseType?i(null,{data:t,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires"),contentType:n.headers.get("Content-Type")}):i(null,t)}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),i(t))})}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),i(t))}),r}{const r=A.o(i);if(r.open(e.method||"GET",t,!0),e){for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);r.withCredentials="include"===e.credentials,e.responseType&&(r.responseType=e.responseType)}return r.send(n?e.body:null),r}},t:(t,e,i)=>200!==t.status?{status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`}:"arraybuffer"===i?t.arrayBuffer():e?t.json():t.text(),s:function(t,e){return function(){if(4===t.readyState)if(200===t.status)if("arraybuffer"===t.responseType){0===t.response.byteLength?e({status:200,statusText:t.statusText,message:"http status 200 returned without content."}):e(null,{data:t.response,cacheControl:t.getResponseHeader("Cache-Control"),expires:t.getResponseHeader("Expires"),contentType:t.getResponseHeader("Content-Type")})}else e(null,t.responseText);else e({status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`})}},o:function(t){let e;try{e=new XMLHttpRequest}catch(t){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}}return e.onreadystatechange=A.s(e,t),e},getArrayBuffer(t,e,i){if(y(e)){const t=i;i=e,e=t}return e||(e={}),e.responseType="arraybuffer",A.get(t,e,i)}};function F(t,e,i,n,r,o){let s=r-i,a=o-n;if(0!==s||0!==a){const l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return s=t-i,a=e-n,s*s+a*a}function T(t,e,i,n,r,o){const s={id:null==t?null:t,type:e,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};r&&(s.layer=r);return function(t,e){const i=t.geometry,n=t.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)z(t,i,e);else if("Polygon"===n)z(t,i[0],e);else if("MultiLineString"===n)for(const n of i)z(t,n,e);else if("MultiPolygon"===n)for(const n of i)z(t,n[0],e)}(s,o?4:3),s}function z(t,e,i){for(let n=0;n<e.length;n+=i)t.minX=Math.min(t.minX,e[n]),t.minY=Math.min(t.minY,e[n+1]),t.maxX=Math.max(t.maxX,e[n]),t.maxY=Math.max(t.maxY,e[n+1])}function S(t,e,i,n){if(n.layer=e,"FeatureCollection"===i.type)for(let e=0;e<i.features.length;e++)_(t,i.features[e],n,e);else"Feature"===i.type?_(t,i,n):_(t,{geometry:i},n)}function _(t,e,i,n){if(!e.geometry)return;const r=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);let a=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=n||0),"Point"===o)P(r,a,i.hasAltitude);else if("MultiPoint"===o)for(const t of r)P(t,a,i.hasAltitude);else if("LineString"===o)I(r,a,s,!1,i.hasAltitude);else if("MultiLineString"===o){if(i.lineMetrics){for(const n of r)a=[],I(n,a,s,!1,i.hasAltitude),t.push(T(l,"LineString",a,e.properties,i.layer,i.hasAltitude));return}O(r,a,s,!1,i.hasAltitude)}else if("Polygon"===o)O(r,a,s,!0,i.hasAltitude);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const r of e.geometry.geometries)_(t,{id:l,geometry:r,properties:e.properties},i,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of r){const e=[];O(t,e,s,!0,i.hasAltitude),a.push(e)}}t.push(T(l,o,a,e.properties,i.layer,i.hasAltitude))}function P(t,e,i){e.push(E(t[0]),q(t[1]),0),i&&(t.length>2?e.push(t[2]):e.push(0))}function I(t,e,i,n,r){let o,s,a=0;for(let i=0;i<t.length;i++){const l=E(t[i][0]),u=q(t[i][1]);e.push(l,u,0),r&&(t[i].length>2?e.push(t[i][2]):e.push(0)),i>0&&(a+=n?(o*u-l*s)/2:Math.sqrt(Math.pow(l-o,2)+Math.pow(u-s,2))),o=l,s=u}const l=r?4:3,u=e.length-l;e[2]=1,function t(e,i,n,r,o=3){let s=r;const a=n-i>>1;let l,u=n-i;const c=e[i],h=e[i+1],d=e[n],f=e[n+1];for(let t=i+o;t<n;t+=o){const i=F(e[t],e[t+1],c,h,d,f);if(i>s)l=t,s=i;else if(i===s){const e=Math.abs(t-a);e<u&&(l=t,u=e)}}s>r&&(l-i>o&&t(e,i,l,r,o),e[l+2]=s,n-l>o&&t(e,l,n,r,o))}(e,0,u,i,l),e[u+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function O(t,e,i,n,r){for(let o=0;o<t.length;o++){const s=[];I(t[o],s,i,n,r),e.push(s)}}function E(t){return t/360+.5}function q(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 R(t,e,i,n,r,o,s,a){if(n/=e,o>=(i/=e)&&s<n)return t;if(s<i||o>=n)return null;const l=[];for(const e of t){const t=e.geometry;let o=e.type;const s=0===r?e.minX:e.minY,u=0===r?e.maxX:e.maxY;if(s>=i&&u<n){l.push(e);continue}if(u<i||s>=n)continue;let c=[];if("Point"===o||"MultiPoint"===o)C(t,c,i,n,r,a.hasAltitude);else if("LineString"===o)N(t,c,i,n,r,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===o)D(t,c,i,n,r,!1,a.hasAltitude);else if("Polygon"===o)D(t,c,i,n,r,!0,a.hasAltitude);else if("MultiPolygon"===o)for(const e of t){const t=[];D(e,t,i,n,r,!0,a.hasAltitude),t.length&&c.push(t)}if(c.length){if(a.lineMetrics&&"LineString"===o){for(const t of c)l.push(T(e.id,o,t,e.tags,e.layer,a.hasAltitude));continue}"LineString"!==o&&"MultiLineString"!==o||(1===c.length?(o="LineString",c=c[0]):o="MultiLineString"),"Point"!==o&&"MultiPoint"!==o||(o=3===c.length?"Point":"MultiPoint"),l.push(T(e.id,o,c,e.tags,e.layer,a.hasAltitude))}}return l.length?l:null}function C(t,e,i,n,r,o){const s=o?4:3;for(let a=0;a<t.length;a+=s){const s=t[a+r];s>=i&&s<=n&&(U(e,t[a],t[a+1],t[a+2]),o&&e.push(t[a+3]))}}function N(t,e,i,n,r,o,s,a){let l=L(t);const u=0===r?$:W;let c,h,d=t.start;const f=a?4:3;for(let p=0;p<t.length-f;p+=f){const m=t[p],y=t[p+1],g=t[p+2],b=t[p+f],v=t[p+f+1];let w,x;a&&(w=t[p+3],x=t[p+f+3]);const k=0===r?m:y,M=0===r?b:v;let j=!1;s&&(c=Math.sqrt(Math.pow(m-b,2)+Math.pow(y-v,2))),k<i?M>i&&(h=u(l,m,y,b,v,i),a&&l.push(J(w,x,h)),s&&(l.start=d+c*h)):k>n?M<n&&(h=u(l,m,y,b,v,n),a&&l.push(J(w,x,h)),s&&(l.start=d+c*h)):(U(l,m,y,g),a&&l.push(w)),M<i&&k>=i&&(h=u(l,m,y,b,v,i),a&&l.push(J(w,x,h)),j=!0),M>n&&k<=n&&(h=u(l,m,y,b,v,n),a&&l.push(J(w,x,h)),j=!0),!o&&j&&(s&&(l.end=d+c*h),e.push(l),l=L(t)),s&&(d+=c)}let p=t.length-f;const m=t[p],y=t[p+1],g=t[p+2],b=0===r?m:y;if(b>=i&&b<=n&&U(l,m,y,g),b>=i&&b<=n&&a){const e=t[p+3];l.push(e)}p=l.length-f,o&&p>=f&&(l[p]!==l[0]||l[p+1]!==l[1])&&(U(l,l[0],l[1],l[2]),a&&l.push(l[3])),l.length&&e.push(l)}function L(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function D(t,e,i,n,r,o,s){for(const a of t)N(a,e,i,n,r,o,!1,s)}function U(t,e,i,n){t.push(e,i,n)}function $(t,e,i,n,r,o){const s=(o-e)/(n-e);return U(t,o,i+(r-i)*s,1),s}function W(t,e,i,n,r,o){const s=(o-i)/(r-i);return U(t,e+(n-e)*s,o,1),s}function J(t,e,i){return t+(e-t)*i}function H(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=t[r],s=o.type;let a;if("Point"===s||"MultiPoint"===s||"LineString"===s)a=G(o.geometry,e,i);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const t of o.geometry)a.push(G(t,e,i))}else if("MultiPolygon"===s){a=[];for(const t of o.geometry){const n=[];for(const r of t)n.push(G(r,e,i));a.push(n)}}n.push(T(o.id,s,a,o.tags,o.layer,i))}return n}function G(t,e,i){const n=[];n.size=t.size,void 0!==t.start&&(n.start=t.start,n.end=t.end);const r=i?4:3;for(let o=0;o<t.length;o+=r)n.push(t[o]+e,t[o+1],t[o+2]),i&&n.push(t[o+3]);return n}function V(t,e,i){if(t.transformed)return t;const n=1<<t.z,r=t.x,o=t.y,s=i?3:2;for(const a of t.features){const t=a.geometry,l=a.type;if(a.geometry=[],1===l)for(let l=0;l<t.length;l+=s)a.geometry.push(B(t[l],t[l+1],e,n,r,o)),i&&a.geometry[a.geometry.length-1].push(t[l+2]);else for(let l=0;l<t.length;l++){const u=[];for(let a=0;a<t[l].length;a+=s)u.push(B(t[l][a],t[l][a+1],e,n,r,o)),i&&u[u.length-1].push(t[l][a+2]);a.geometry.push(u)}}return t.transformed=!0,t}function B(t,e,i,n,r,o){return[Math.round(i*(t*n-r)),Math.round(i*(e*n-o))]}function X(t,e,i,n,r){const o=e===r.maxZoom?0:r.tolerance/((1<<e)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:i,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const e of t)Z(s,e,o,r);return s}function Z(t,e,i,n){const r=e.geometry,o=e.type,s=[],a=n.hasAltitude?4:3;if(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),"Point"===o||"MultiPoint"===o)for(let e=0;e<r.length;e+=a)s.push(r[e],r[e+1]),n.hasAltitude&&s.push(r[e+3]),t.numPoints++,t.numSimplified++;else if("LineString"===o)Y(s,r,t,i,!1,!1,n);else if("MultiLineString"===o||"Polygon"===o)for(let e=0;e<r.length;e++)Y(s,r[e],t,i,"Polygon"===o,0===e,n);else if("MultiPolygon"===o)for(let e=0;e<r.length;e++){const o=r[e];for(let e=0;e<o.length;e++)Y(s,o[e],t,i,!0,0===e,n)}if(s.length){let i=e.tags||null;if("LineString"===o&&n.lineMetrics){i={};for(const t in e.tags)i[t]=e.tags[t];i.mapbox_clip_start=r.start/r.size,i.mapbox_clip_end=r.end/r.size}const a={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:i};e.layer&&(a.layer=e.layer),null!==e.id&&(a.id=e.id),t.features.push(a)}}function Y(t,e,i,n,r,o,s){const a=n*n,{hasAltitude:l,disableFilter:u}=s,c=l?4:3;if(!u&&n>0&&e.size<(r?a:n))return void(i.numPoints+=e.length/c);const h=[];for(let t=0;t<e.length;t+=c)(0===n||e[t+2]>a)&&(i.numSimplified++,h.push(e[t],e[t+1]),l&&h.push(e[t+3])),i.numPoints++;r&&function(t,e,i){const n=i?3:2;let r=0;for(let e=0,i=t.length,o=i-n;e<i;o=e,e+=n)r+=(t[e]-t[o])*(t[e+1]+t[o+1]);if(r>0===e){const e=n,r=n-1,o=n-2;for(let s=0,a=t.length;s<a/2;s+=n){const n=t[s],l=t[s+1];let u;i&&(u=t[s+2]),t[s]=t[a-e-s],t[s+1]=t[a-r-s],i&&(t[s+2]=t[a-o-s]),t[a-e-s]=n,t[a-r-s]=l,i&&(t[a-o-s]=u)}}}(h,o,l),t.push(h)}A.getJSON=function(t,e,i){if(y(e)){const t=i;i=e,e=t}const n=function(t,e){const n="string"==typeof e?JSON.parse(e):e||null;i(t,n)};return e&&e.jsonp?A.jsonp(t,n):((e=e||{}).returnJSON=!0,A.get(t,e,n))};const K={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,hasAltitude:!1,disableFilter:!1,debug:0};class Q{constructor(t,e){const i=(e=this.options=function(t,e){for(const i in e)t[i]=e[i];return t}(Object.create(K),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=function(t,e){const i=[];if(Array.isArray(t)){for(let n=0;n<t.length;n++)S(i,t[n].layer,t[n].data,e);return i}if("FeatureCollection"===t.type)for(let n=0;n<t.features.length;n++)_(i,t.features[n],e,n);else"Feature"===t.type?_(i,t,e):_(i,{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(t,e){const i=e.buffer/e.extent;let n=t;const r=R(t,1,-1-i,i,0,-1,2,e),o=R(t,1,1-i,2+i,0,-1,2,e);return(r||o)&&(n=R(t,1,-i,1+i,0,-1,2,e)||[],r&&(n=H(r,1,e.hasAltitude).concat(n)),o&&(n=n.concat(H(o,-1,e.hasAltitude)))),n}(n,e),n.length&&this.splitTile(n,0,0,0),i&&(n.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)))}splitTile(t,e,i,n,r,o,s){const a=[t,e,i,n],l=this.options,u=l.debug;for(;a.length;){n=a.pop(),i=a.pop(),e=a.pop(),t=a.pop();const c=1<<e,h=tt(e,i,n);let d=this.tiles[h];if(!d&&(u>1&&console.time("creation"),d=this.tiles[h]=X(t,e,i,n,l),this.tileCoords.push({z:e,x:i,y:n}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const t="z"+e;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(d.source=t,null==r){if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===r)continue;if(null!=r){const t=r-e;if(i!==o>>t||n!==s>>t)continue}}if(d.source=null,0===t.length)continue;u>1&&console.time("clipping");const f=.5*l.buffer/l.extent,p=.5-f,m=.5+f,y=1+f;let g=null,b=null,v=null,w=null,x=R(t,c,i-f,i+m,0,d.minX,d.maxX,l),k=R(t,c,i+p,i+y,0,d.minX,d.maxX,l);t=null,x&&(g=R(x,c,n-f,n+m,1,d.minY,d.maxY,l),b=R(x,c,n+p,n+y,1,d.minY,d.maxY,l),x=null),k&&(v=R(k,c,n-f,n+m,1,d.minY,d.maxY,l),w=R(k,c,n+p,n+y,1,d.minY,d.maxY,l),k=null),u>1&&console.timeEnd("clipping"),a.push(g||[],e+1,2*i,2*n),a.push(b||[],e+1,2*i,2*n+1),a.push(v||[],e+1,2*i+1,2*n),a.push(w||[],e+1,2*i+1,2*n+1)}}getTile(t,e,i){t=+t,e=+e,i=+i;const n=this.options,{extent:r,debug:o}=n,{hasAltitude:s}=n;if(t<0||t>24)return null;const a=1<<t,l=tt(t,e=e+a&a-1,i);if(this.tiles[l])return V(this.tiles[l],r,s);o>1&&console.log("drilling down to z%d-%d-%d",t,e,i);let u,c=t,h=e,d=i;for(;!u&&c>0;)c--,h>>=1,d>>=1,u=this.tiles[tt(c,h,d)];return u&&u.source?(o>1&&(console.log("found parent tile z%d-%d-%d",c,h,d),console.time("drilling down")),this.splitTile(u.source,c,h,d,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[l]?V(this.tiles[l],r,s):null):null}}function tt(t,e,i){return 32*((1<<t)*i+e)+t}function et(t,e,i,n,r,o){const s=i&&Array.isArray(i[0]);for(let a=0,l=i.length;a<l;a++){t[e]=Math.round((s?i[a][0]:i[a].x)*n),t[e+1]=Math.round((s?i[a][1]:i[a].y)*n);let u=r||0;Array.isArray(r)&&(u=r[a]),u=u?Math.round(n*u):0,t[e+2]=u,e+=3,o&&0!==a&&a!==l-1&&(t[e]=t[e-3],t[e+1]=t[e-2],t[e+2]=t[e-1],e+=3)}return e}function it(t,e,i,n){const r=t[3*e],o=t[3*e+1],s=t[3*i],a=t[3*i+1];return r===s&&(r<0||r>n)||o===a&&(o<0||o>n)}class nt{constructor(t,e){this.x=t,this.y=e}clone(){return new nt(this.x,this.y)}normalize(){const t=this.length();this.x/=t,this.y/=t}negate(){this.x=-this.x,this.y=-this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}diff(t){return new nt(this.x-t.x,this.y-t.y)}distance(t){const e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)}dot(t){return this.x*t.x+this.y*t.y}equals(t){return this.x===t.x&&this.y===t.y}orthogonal(){return new nt(this.y,-this.x)}}function rt(t,e,i){const n=(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x);return n>1e-5?1:n<-1e-5?2:0}function ot(t,e,i,n){const r=e.x*n.y-e.y*n.x,o=i.x-t.x,s=i.y-t.y,a=(o*n.y-s*n.x)/r;return new nt(t.x+a*e.x,t.y+a*e.y)}const st=[];function at(t,e,i){let n=0;const r=[];for(let o=e;o<i;o+=3)st[n]?(st[n].x=t[o],st[n].y=t[o+1]):st[n]=new nt(t[o],t[o+1]),r.push(st[n]),n++;const o=function(t){let e;this.UpdateOmbb=function(t,i,n,r,o,s,a,l){const u=ot(t,i,o,s),c=ot(n,r,o,s),h=ot(a,l,t,i),d=ot(a,l,n,r),f=u.distance(c)*u.distance(h);f<this.BestObbArea&&(e=[u,h,d,c],this.BestObbArea=f)},this.BestObbArea=Number.MAX_VALUE;const i=[];for(let e=0;e<t.length;e++)i.push(t[(e+1)%t.length].diff(t[e])),i[e].normalize();const n=new nt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new nt(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);let o,s,a,l;for(let e=0;e<t.length;e++){const i=t[e];i.x<n.x&&(n.x=i.x,o=e),i.x>r.x&&(r.x=i.x,s=e),i.y<n.y&&(n.y=i.y,l=e),i.y>r.y&&(r.y=i.y,a=e)}let u=new nt(0,-1),c=new nt(0,1),h=new nt(-1,0),d=new nt(1,0);for(let e=0;e<t.length;e++){const e=[Math.acos(u.dot(i[o])),Math.acos(c.dot(i[s])),Math.acos(h.dot(i[a])),Math.acos(d.dot(i[l]))];switch(e.indexOf(Math.min.apply(Math,e))){case 0:u=i[o].clone(),c=u.clone(),c.negate(),h=u.orthogonal(),d=h.clone(),d.negate(),o=(o+1)%t.length;break;case 1:c=i[s].clone(),u=c.clone(),u.negate(),h=u.orthogonal(),d=h.clone(),d.negate(),s=(s+1)%t.length;break;case 2:h=i[a].clone(),d=h.clone(),d.negate(),u=d.orthogonal(),c=u.clone(),c.negate(),a=(a+1)%t.length;break;case 3:d=i[l].clone(),h=d.clone(),h.negate(),u=d.orthogonal(),c=u.clone(),c.negate(),l=(l+1)%t.length}this.UpdateOmbb(t[o],u,t[s],c,t[a],h,t[l],d)}return e}(function(t){if(t.length<3)return t;let e=t[0];const i=[];for(let i=1;i<t.length;i++)(t[i].x<e.x||Math.abs(t[i].x-e.x)<1e-5&&t[i].y<e.y)&&(e=t[i]);let n=t[0];do{i.unshift(e.clone());for(let i=1;i<t.length;i++){const r=rt(e,n,t[i]);(n.equals(e)||1===r||0===r&&e.distance(t[i])>e.distance(n))&&(n=t[i])}e=n}while(!n.equals(i[i.length-1]));return i}(r)),s=o[0].distance(o[1]),a=o[1].distance(o[2]),l=o.map(t=>[t.x,t.y]);return l.push(+(a>s)),l}var lt="undefined"!=typeof Float32Array?Float32Array:Array;function ut(){var t=new lt(3);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ct(t,e,i){var n=new lt(3);return n[0]=t,n[1]=e,n[2]=i,n}function ht(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function dt(t,e,i,n){return t[0]=e,t[1]=i,t[2]=n,t}function ft(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function pt(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t}function mt(t,e){var i=e[0],n=e[1],r=e[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o),t}function yt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function gt(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2];return t[0]=r*l-o*a,t[1]=o*s-n*l,t[2]=n*a-r*s,t}var bt=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t};function vt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function wt(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t}function xt(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}function kt(){var t=new lt(4);return lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Mt(t,e){var i=e[0]+e[4]+e[8],n=void 0;if(i>0)n=Math.sqrt(i+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var o=(r+1)%3,s=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*s+s]+1),t[r]=.5*n,n=.5/n,t[3]=(e[3*o+s]-e[3*s+o])*n,t[o]=(e[3*o+r]+e[3*r+o])*n,t[s]=(e[3*s+r]+e[3*r+s])*n}return t}ut(),function(){var t,e=(t=new lt(4),lt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var jt,At=xt,Ft=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*i+n*n+r*r+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=i*s,t[1]=n*s,t[2]=r*s,t[3]=o*s),t};function Tt(t,e){var i=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(i*i+n*n)}ut(),ct(1,0,0),ct(0,1,0),kt(),kt(),jt=new lt(9),lt!=Float32Array&&(jt[1]=0,jt[2]=0,jt[3]=0,jt[5]=0,jt[6]=0,jt[7]=0),jt[0]=1,jt[4]=1,jt[8]=1;var zt=function(t){var e=t[0],i=t[1];return Math.sqrt(e*e+i*i)};function St(t,e,i,n,r,o,s,a,l,u){0===t?function(t,e,i,n,r,o,s,a,l){const u=[0,0];for(let r=t;r<e;r+=3){const t=r/3*2,e=n[r],c=n[r+1];i[t]=u[0]+e*o*s/a,i[t+1]=u[1]-c*o*s/l}}(e,i,n,r,0,s,a,l,u):1===t&&function(t,e,i,n){const r=at(n,t,e),o=r[4],s=r[o],a=r[o+1],l=r[o+2],u=(a[1]-s[1])/(a[0]-s[0]),c=(l[1]-a[1])/(l[0]-a[0]),h=Tt(s,a),d=Tt(a,l);for(let r=t;r<e;r+=3){const t=r/3*2,e=n[r],o=n[r+1];i[t]=Pt(e,o,s,u,h),i[t+1]=-Pt(e,o,a,c,d)}}(e,i,n,r)}!function(){var t=function(){var t=new lt(2);return lt!=Float32Array&&(t[0]=0,t[1]=0),t}()}();const _t=[];function Pt(t,e,i,n,r){return _t[0]=(n*n*i[0]+n*(e-i[1])+t)/(n*n+1),_t[1]=n*(_t[0]-i[0])+i[1],Tt(i,_t)/r}function It(t,e,i,n,r){const o=3*e[i-1],s=3*e[i-1]+1,a=t[o],l=t[s];return u=n,c=r,h=a,d=l,Math.sqrt((h-u)*(h-u)+(d-c)*(d-c));var u,c,h,d}"undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self&&self;var Ot=Et;function Et(t,e){this.x=t,this.y=e}function qt(t,e,i){i=i||{},this.w=t||64,this.h=e||64,this.autoResize=!!i.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function Rt(t,e,i){this.x=0,this.y=t,this.w=this.free=e,this.h=i}function Ct(t,e,i,n,r,o,s){this.id=t,this.x=e,this.y=i,this.w=n,this.h=r,this.maxw=o||n,this.maxh=s||r,this.refcount=0}\n/*!\n Feature Filter by\n\n (c) mapbox 2016 and maptalks 2018\n www.mapbox.com | www.maptalks.org\n License: MIT, header required.\n */Et.prototype={clone:function(){return new Et(this.x,this.y)},add:function(t){return this.clone().u(t)},sub:function(t){return this.clone().m(t)},multByPoint:function(t){return this.clone().v(t)},divByPoint:function(t){return this.clone().k(t)},mult:function(t){return this.clone().M(t)},div:function(t){return this.clone().j(t)},rotate:function(t){return this.clone().A(t)},rotateAround:function(t,e){return this.clone().F(t,e)},matMult:function(t){return this.clone().T(t)},unit:function(){return this.clone().S()},perp:function(){return this.clone()._()},round:function(){return this.clone().P()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},T:function(t){var e=t[0]*this.x+t[1]*this.y,i=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=i,this},u:function(t){return this.x+=t.x,this.y+=t.y,this},m:function(t){return this.x-=t.x,this.y-=t.y,this},M:function(t){return this.x*=t,this.y*=t,this},j:function(t){return this.x/=t,this.y/=t,this},v:function(t){return this.x*=t.x,this.y*=t.y,this},k:function(t){return this.x/=t.x,this.y/=t.y,this},S:function(){return this.j(this.mag()),this},_:function(){var t=this.y;return this.y=this.x,this.x=-t,this},A:function(t){var e=Math.cos(t),i=Math.sin(t),n=e*this.x-i*this.y,r=i*this.x+e*this.y;return this.x=n,this.y=r,this},F:function(t,e){var i=Math.cos(t),n=Math.sin(t),r=e.x+i*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=r,this.y=o,this},P:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Et.convert=function(t){return t instanceof Et?t:Array.isArray(t)?new Et(t[0],t[1]):t},qt.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var i,n,r,o,s=[],a=0;a<t.length;a++)if(i=t[a].w||t[a].width,n=t[a].h||t[a].height,r=t[a].id,i&&n){if(!(o=this.packOne(i,n,r)))continue;e.inPlace&&(t[a].x=o.x,t[a].y=o.y,t[a].id=o.id),s.push(o)}return this.shrink(),s},qt.prototype.packOne=function(t,e,i){var n,r,o,s,a,l,u,c,h={freebin:-1,shelf:-1,waste:1/0},d=0;if("string"==typeof i||"number"==typeof i){if(n=this.getBin(i))return this.ref(n),n;"number"==typeof i&&(this.maxId=Math.max(i,this.maxId))}else i=++this.maxId;for(s=0;s<this.freebins.length;s++){if(e===(n=this.freebins[s]).maxh&&t===n.maxw)return this.allocFreebin(s,t,e,i);e>n.maxh||t>n.maxw||e<=n.maxh&&t<=n.maxw&&(o=n.maxw*n.maxh-t*e)<h.waste&&(h.waste=o,h.freebin=s)}for(s=0;s<this.shelves.length;s++)if(d+=(r=this.shelves[s]).h,!(t>r.free)){if(e===r.h)return this.allocShelf(s,t,e,i);e>r.h||e<r.h&&(o=(r.h-e)*t)<h.waste&&(h.freebin=-1,h.waste=o,h.shelf=s)}return-1!==h.freebin?this.allocFreebin(h.freebin,t,e,i):-1!==h.shelf?this.allocShelf(h.shelf,t,e,i):e<=this.h-d&&t<=this.w?(r=new Rt(d,this.w,e),this.allocShelf(this.shelves.push(r)-1,t,e,i)):this.autoResize?(a=l=this.h,((u=c=this.w)<=a||t>u)&&(c=2*Math.max(t,u)),(a<u||e>a)&&(l=2*Math.max(e,a)),this.resize(c,l),this.packOne(t,e,i)):null},qt.prototype.allocFreebin=function(t,e,i,n){var r=this.freebins.splice(t,1)[0];return r.id=n,r.w=e,r.h=i,r.refcount=0,this.bins[n]=r,this.ref(r),r},qt.prototype.allocShelf=function(t,e,i,n){var r=this.shelves[t].alloc(e,i,n);return this.bins[n]=r,this.ref(r),r},qt.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,i=0;i<this.shelves.length;i++){var n=this.shelves[i];e+=n.h,t=Math.max(n.w-n.free,t)}this.resize(t,e)}},qt.prototype.getBin=function(t){return this.bins[t]},qt.prototype.ref=function(t){if(1==++t.refcount){var e=t.h;this.stats[e]=1+(0|this.stats[e])}return t.refcount},qt.prototype.unref=function(t){return 0===t.refcount?0:(0==--t.refcount&&(this.stats[t.h]--,delete this.bins[t.id],this.freebins.push(t)),t.refcount)},qt.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},qt.prototype.resize=function(t,e){this.w=t,this.h=e;for(var i=0;i<this.shelves.length;i++)this.shelves[i].resize(t);return!0},Rt.prototype.alloc=function(t,e,i){if(t>this.free||e>this.h)return null;var n=this.x;return this.x+=t,this.free-=t,new Ct(i,n,this.y,t,e,t,this.h)},Rt.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0};const Nt=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function Lt(t){return new Function("f","var p = (f && f.properties || {}); return "+Dt(t))}function Dt(t){if(!t)return"true";const e=t[0];if(t.length<=1)return"any"===e?"false":"true";return`(${"=="===e?$t(t[1],t[2],"===",!1):"!="===e?$t(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?$t(t[1],t[2],e,!0):"any"===e?Wt(t.slice(1),"||"):"all"===e?Wt(t.slice(1),"&&"):"none"===e?Gt(Wt(t.slice(1),"||")):"in"===e?Jt(t[1],t.slice(2)):"!in"===e?Gt(Jt(t[1],t.slice(2))):"has"===e?Ht(t[1]):"!has"===e?Gt(Ht(t[1])):"true"})`}function Ut(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function $t(t,e,i,n){const r=Ut(t),o="$type"===t?Nt.indexOf(e):JSON.stringify(e);return(n?`typeof ${r}=== typeof ${o}&&`:"")+r+i+o}function Wt(t,e){return t.map(Dt).join(e)}function Jt(t,e){"$type"===t&&(e=e.map(t=>Nt.indexOf(t)));const i=JSON.stringify(e.sort(Vt)),n=Ut(t);return e.length<=200?`${i}.indexOf(${n}) !== -1`:`function(v, a, i, j) {\\n while (i <= j) { var m = (i + j) >> 1;\\n if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;\\n }\\n return false; }(${n}, ${i},0,${e.length-1})`}function Ht(t){return"$id"===t?\'"id" in f\':JSON.stringify(t)+" in p"}function Gt(t){return`!(${t})`}function Vt(t,e){return t<e?-1:t>e?1:0}var Bt={exports:{}};Bt.exports=function(){function t(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function e(t,e){return t<e?-1:t>e?1:0}return function(i,n,r,o,s){!function e(i,n,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,l=n-r+1,u=Math.log(a),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(a-c)/a)*(l-a/2<0?-1:1),d=Math.max(r,Math.floor(n-l*c/a+h)),f=Math.min(o,Math.floor(n+(a-l)*c/a+h));e(i,n,d,f,s)}var p=i[n],m=r,y=o;for(t(i,r,n),s(i[o],p)>0&&t(i,r,o);m<y;){for(t(i,m,y),m++,y--;s(i[m],p)<0;)m++;for(;s(i[y],p)>0;)y--}0===s(i[r],p)?t(i,r,y):(y++,t(i,y,o)),y<=n&&(r=y+1),n<=y&&(o=y-1)}}(i,n,r||0,o||i.length-1,s||e)}}();var Xt=Bt.exports,Zt={exports:{}};function Yt(t,e){if(!(this instanceof Yt))return new Yt(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||Kt,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this.I(i)}function Kt(t,e){return t<e?-1:t>e?1:0}Zt.exports=Yt,Zt.exports.default=Yt,Yt.prototype={push:function(t){this.data.push(t),this.length++,this.O(this.length-1)},pop:function(){if(0!==this.length){var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this.I(0)),this.data.pop(),t}},peek:function(){return this.data[0]},O:function(t){for(var e=this.data,i=this.compare,n=e[t];t>0;){var r=t-1>>1,o=e[r];if(i(n,o)>=0)break;e[t]=o,t=r}e[t]=n},I:function(t){for(var e=this.data,i=this.compare,n=this.length>>1,r=e[t];t<n;){var o=1+(t<<1),s=o+1,a=e[o];if(s<this.length&&i(e[s],a)<0&&(o=s,a=e[s]),i(a,r)>=0)break;e[t]=a,t=o}e[t]=r}};var Qt=Zt.exports,te={exports:{}},ee={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]},ie={exports:{}},ne=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},re=Array.prototype.concat,oe=Array.prototype.slice,se=ie.exports=function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];ne(r)?e=re.call(e,oe.call(r)):e.push(r)}return e};se.wrap=function(t){return function(){return t(se(arguments))}};var ae=ee,le=ie.exports,ue=Object.hasOwnProperty,ce={};for(var he in ae)ue.call(ae,he)&&(ce[ae[he]]=he);var de=te.exports={to:{},get:{}};function fe(t,e,i){return Math.min(Math.max(e,t),i)}function pe(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}de.get=function(t){var e,i;switch(t.substring(0,3).toLowerCase()){case"hsl":e=de.get.hsl(t),i="hsl";break;case"hwb":e=de.get.hwb(t),i="hwb";break;default:e=de.get.rgb(t),i="rgb"}return e?{model:i,value:e}:null},de.get.rgb=function(t){if(!t)return null;var e,i,n,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(n=e[2],e=e[1],i=0;i<3;i++){var o=2*i;r[i]=parseInt(e.slice(o,o+2),16)}n&&(r[3]=parseInt(n,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(n=(e=e[1])[3],i=0;i<3;i++)r[i]=parseInt(e[i]+e[i],16);n&&(r[3]=parseInt(n+n,16)/255)}else if(e=t.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)){for(i=0;i<3;i++)r[i]=parseInt(e[i+1],0);e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)))return(e=t.match(/^(\\w+)$/))?"transparent"===e[1]?[0,0,0,0]:ue.call(ae,e[1])?((r=ae[e[1]])[3]=1,r):null:null;for(i=0;i<3;i++)r[i]=Math.round(2.55*parseFloat(e[i+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(i=0;i<3;i++)r[i]=fe(r[i],0,255);return r[3]=fe(r[3],0,1),r},de.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*,?\\s*([+-]?[\\d\\.]+)%\\s*(?:[,|\\/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);if(e){var i=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,fe(parseFloat(e[2]),0,100),fe(parseFloat(e[3]),0,100),fe(isNaN(i)?1:i,0,1)]}return null},de.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d\\.]+)%\\s*,\\s*([+-]?[\\d\\.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/);if(e){var i=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,fe(parseFloat(e[2]),0,100),fe(parseFloat(e[3]),0,100),fe(isNaN(i)?1:i,0,1)]}return null},de.to.hex=function(){var t=le(arguments);return"#"+pe(t[0])+pe(t[1])+pe(t[2])+(t[3]<1?pe(Math.round(255*t[3])):"")},de.to.rgb=function(){var t=le(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},de.to.rgb.percent=function(){var t=le(arguments),e=Math.round(t[0]/255*100),i=Math.round(t[1]/255*100),n=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+i+"%, "+n+"%)":"rgba("+e+"%, "+i+"%, "+n+"%, "+t[3]+")"},de.to.hsl=function(){var t=le(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},de.to.hwb=function(){var t=le(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},de.to.keyword=function(t){return ce[t.slice(0,3)]};var me={exports:{}},ye=ee,ge={};for(var be in ye)ye.hasOwnProperty(be)&&(ge[ye[be]]=be);var ve=me.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var we in ve)if(ve.hasOwnProperty(we)){if(!("channels"in ve[we]))throw new Error("missing channels property: "+we);if(!("labels"in ve[we]))throw new Error("missing channel labels property: "+we);if(ve[we].labels.length!==ve[we].channels)throw new Error("channel and label counts mismatch: "+we);var xe=ve[we].channels,ke=ve[we].labels;delete ve[we].channels,delete ve[we].labels,Object.defineProperty(ve[we],"channels",{value:xe}),Object.defineProperty(ve[we],"labels",{value:ke})}function Me(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}ve.rgb.hsl=function(t){var e,i,n=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(n,r,o),a=Math.max(n,r,o),l=a-s;return a===s?e=0:n===a?e=(r-o)/l:r===a?e=2+(o-n)/l:o===a&&(e=4+(n-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(s+a)/2,[e,100*(a===s?0:i<=.5?l/(a+s):l/(2-a-s)),100*i]},ve.rgb.hsv=function(t){var e,i,n,r,o,s=t[0]/255,a=t[1]/255,l=t[2]/255,u=Math.max(s,a,l),c=u-Math.min(s,a,l),h=function(t){return(u-t)/6/c+.5};return 0===c?r=o=0:(o=c/u,e=h(s),i=h(a),n=h(l),s===u?r=n-i:a===u?r=1/3+e-n:l===u&&(r=2/3+i-e),r<0?r+=1:r>1&&(r-=1)),[360*r,100*o,100*u]},ve.rgb.hwb=function(t){var e=t[0],i=t[1],n=t[2];return[ve.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(i,n))),100*(n=1-1/255*Math.max(e,Math.max(i,n)))]},ve.rgb.cmyk=function(t){var e,i=t[0]/255,n=t[1]/255,r=t[2]/255;return[100*((1-i-(e=Math.min(1-i,1-n,1-r)))/(1-e)||0),100*((1-n-e)/(1-e)||0),100*((1-r-e)/(1-e)||0),100*e]},ve.rgb.keyword=function(t){var e=ge[t];if(e)return e;var i,n=1/0;for(var r in ye)if(ye.hasOwnProperty(r)){var o=Me(t,ye[r]);o<n&&(n=o,i=r)}return i},ve.keyword.rgb=function(t){return ye[t]},ve.rgb.xyz=function(t){var e=t[0]/255,i=t[1]/255,n=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.1805*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)),100*(.2126*e+.7152*i+.0722*n),100*(.0193*e+.1192*i+.9505*n)]},ve.rgb.lab=function(t){var e=ve.rgb.xyz(t),i=e[0],n=e[1],r=e[2];return n/=100,r/=108.883,i=(i/=95.047)>.008856?Math.pow(i,1/3):7.787*i+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(i-n),200*(n-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},ve.hsl.rgb=function(t){var e,i,n,r,o,s=t[0]/360,a=t[1]/100,l=t[2]/100;if(0===a)return[o=255*l,o,o];e=2*l-(i=l<.5?l*(1+a):l+a-l*a),r=[0,0,0];for(var u=0;u<3;u++)(n=s+1/3*-(u-1))<0&&n++,n>1&&n--,o=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,r[u]=255*o;return r},ve.hsl.hsv=function(t){var e=t[0],i=t[1]/100,n=t[2]/100,r=i,o=Math.max(n,.01);return i*=(n*=2)<=1?n:2-n,r*=o<=1?o:2-o,[e,100*(0===n?2*r/(o+r):2*i/(n+i)),100*((n+i)/2)]},ve.hsv.rgb=function(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,r=Math.floor(e)%6,o=e-Math.floor(e),s=255*n*(1-i),a=255*n*(1-i*o),l=255*n*(1-i*(1-o));switch(n*=255,r){case 0:return[n,l,s];case 1:return[a,n,s];case 2:return[s,n,l];case 3:return[s,a,n];case 4:return[l,s,n];case 5:return[n,s,a]}},ve.hsv.hsl=function(t){var e,i,n,r=t[0],o=t[1]/100,s=t[2]/100,a=Math.max(s,.01);return n=(2-o)*s,i=o*a,[r,100*(i=(i/=(e=(2-o)*a)<=1?e:2-e)||0),100*(n/=2)]},ve.hwb.rgb=function(t){var e,i,n,r,o,s,a,l=t[0]/360,u=t[1]/100,c=t[2]/100,h=u+c;switch(h>1&&(u/=h,c/=h),n=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(n=1-n),r=u+n*((i=1-c)-u),e){default:case 6:case 0:o=i,s=r,a=u;break;case 1:o=r,s=i,a=u;break;case 2:o=u,s=i,a=r;break;case 3:o=u,s=r,a=i;break;case 4:o=r,s=u,a=i;break;case 5:o=i,s=u,a=r}return[255*o,255*s,255*a]},ve.cmyk.rgb=function(t){var e=t[0]/100,i=t[1]/100,n=t[2]/100,r=t[3]/100;return[255*(1-Math.min(1,e*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r))]},ve.xyz.rgb=function(t){var e,i,n,r=t[0]/100,o=t[1]/100,s=t[2]/100;return i=-.9689*r+1.8758*o+.0415*s,n=.0557*r+-.204*o+1.057*s,e=(e=3.2406*r+-1.5372*o+-.4986*s)>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,[255*(e=Math.min(Math.max(0,e),1)),255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1))]},ve.xyz.lab=function(t){var e=t[0],i=t[1],n=t[2];return i/=100,n/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(e-i),200*(i-(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116))]},ve.lab.xyz=function(t){var e,i,n,r=t[0];e=t[1]/500+(i=(r+16)/116),n=i-t[2]/200;var o=Math.pow(i,3),s=Math.pow(e,3),a=Math.pow(n,3);return i=o>.008856?o:(i-16/116)/7.787,e=s>.008856?s:(e-16/116)/7.787,n=a>.008856?a:(n-16/116)/7.787,[e*=95.047,i*=100,n*=108.883]},ve.lab.lch=function(t){var e,i=t[0],n=t[1],r=t[2];return(e=360*Math.atan2(r,n)/2/Math.PI)<0&&(e+=360),[i,Math.sqrt(n*n+r*r),e]},ve.lch.lab=function(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]},ve.rgb.ansi16=function(t){var e=t[0],i=t[1],n=t[2],r=1 in arguments?arguments[1]:ve.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},ve.hsv.ansi16=function(t){return ve.rgb.ansi16(ve.hsv.rgb(t),t[2])},ve.rgb.ansi256=function(t){var e=t[0],i=t[1],n=t[2];return e===i&&i===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5)},ve.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),[e=e/10.5*255,e,e];var i=.5*(1+~~(t>50));return[(1&e)*i*255,(e>>1&1)*i*255,(e>>2&1)*i*255]},ve.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var i;return t-=16,[Math.floor(t/36)/5*255,Math.floor((i=t%36)/6)/5*255,i%6/5*255]},ve.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},ve.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var i=e[0];3===e[0].length&&(i=i.split("").map((function(t){return t+t})).join(""));var n=parseInt(i,16);return[n>>16&255,n>>8&255,255&n]},ve.rgb.hcg=function(t){var e,i=t[0]/255,n=t[1]/255,r=t[2]/255,o=Math.max(Math.max(i,n),r),s=Math.min(Math.min(i,n),r),a=o-s;return e=a<=0?0:o===i?(n-r)/a%6:o===n?2+(r-i)/a:4+(i-n)/a+4,e/=6,[360*(e%=1),100*a,100*(a<1?s/(1-a):0)]},ve.hsl.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=1,r=0;return(n=i<.5?2*e*i:2*e*(1-i))<1&&(r=(i-.5*n)/(1-n)),[t[0],100*n,100*r]},ve.hsv.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=e*i,r=0;return n<1&&(r=(i-n)/(1-n)),[t[0],100*n,100*r]},ve.hcg.rgb=function(t){var e=t[0]/360,i=t[1]/100,n=t[2]/100;if(0===i)return[255*n,255*n,255*n];var r,o=[0,0,0],s=e%1*6,a=s%1,l=1-a;switch(Math.floor(s)){case 0:o[0]=1,o[1]=a,o[2]=0;break;case 1:o[0]=l,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=a;break;case 3:o[0]=0,o[1]=l,o[2]=1;break;case 4:o[0]=a,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=l}return r=(1-i)*n,[255*(i*o[0]+r),255*(i*o[1]+r),255*(i*o[2]+r)]},ve.hcg.hsv=function(t){var e=t[1]/100,i=e+t[2]/100*(1-e),n=0;return i>0&&(n=e/i),[t[0],100*n,100*i]},ve.hcg.hsl=function(t){var e=t[1]/100,i=t[2]/100*(1-e)+.5*e,n=0;return i>0&&i<.5?n=e/(2*i):i>=.5&&i<1&&(n=e/(2*(1-i))),[t[0],100*n,100*i]},ve.hcg.hwb=function(t){var e=t[1]/100,i=e+t[2]/100*(1-e);return[t[0],100*(i-e),100*(1-i)]},ve.hwb.hcg=function(t){var e=t[1]/100,i=1-t[2]/100,n=i-e,r=0;return n<1&&(r=(i-n)/(1-n)),[t[0],100*n,100*r]},ve.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},ve.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},ve.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},ve.gray.hsl=ve.gray.hsv=function(t){return[0,0,t[0]]},ve.gray.hwb=function(t){return[0,100,t[0]]},ve.gray.cmyk=function(t){return[0,0,0,t[0]]},ve.gray.lab=function(t){return[t[0],0,0]},ve.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i},ve.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};var je=me.exports;function Ae(t){var e=function(){for(var t={},e=Object.keys(je),i=e.length,n=0;n<i;n++)t[e[n]]={distance:-1,parent:null};return t}(),i=[t];for(e[t].distance=0;i.length;)for(var n=i.pop(),r=Object.keys(je[n]),o=r.length,s=0;s<o;s++){var a=r[s],l=e[a];-1===l.distance&&(l.distance=e[n].distance+1,l.parent=n,i.unshift(a))}return e}function Fe(t,e){return function(i){return e(t(i))}}function Te(t,e){for(var i=[e[t].parent,t],n=je[e[t].parent][t],r=e[t].parent;e[r].parent;)i.unshift(e[r].parent),n=Fe(je[e[r].parent][r],n),r=e[r].parent;return n.conversion=i,n}var ze=me.exports,Se=function(t){for(var e=Ae(t),i={},n=Object.keys(e),r=n.length,o=0;o<r;o++){var s=n[o];null!==e[s].parent&&(i[s]=Te(s,e))}return i},_e={};Object.keys(ze).forEach((function(t){_e[t]={},Object.defineProperty(_e[t],"channels",{value:ze[t].channels}),Object.defineProperty(_e[t],"labels",{value:ze[t].labels});var e=Se(t);Object.keys(e).forEach((function(i){var n=e[i];_e[t][i]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var i=t(e);if("object"==typeof i)for(var n=i.length,r=0;r<n;r++)i[r]=Math.round(i[r]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}(n),_e[t][i].raw=function(t){var e=function(e){return null==e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(n)}))}));var Pe=_e,Ie=te.exports,Oe=Pe,Ee=[].slice,qe=["keyword","gray","hex"],Re={};Object.keys(Oe).forEach((function(t){Re[Ee.call(Oe[t].labels).sort().join("")]=t}));var Ce={};function Ne(t,e){if(!(this instanceof Ne))return new Ne(t,e);if(e&&e in qe&&(e=null),e&&!(e in Oe))throw new Error("Unknown model: "+e);var i,n;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof Ne)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var r=Ie.get(t);if(null===r)throw new Error("Unable to parse color from string: "+t);this.model=r.model,n=Oe[this.model].channels,this.color=r.value.slice(0,n),this.valpha="number"==typeof r.value[n]?r.value[n]:1}else if(t.length){this.model=e||"rgb",n=Oe[this.model].channels;var o=Ee.call(t,0,n);this.color=$e(o,n),this.valpha="number"==typeof t[n]?t[n]:1}else if("number"==typeof t)t&=16777215,this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;var s=Object.keys(t);"alpha"in t&&(s.splice(s.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);var a=s.sort().join("");if(!(a in Re))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Re[a];var l=Oe[this.model].labels,u=[];for(i=0;i<l.length;i++)u.push(t[l[i]]);this.color=$e(u)}if(Ce[this.model])for(n=Oe[this.model].channels,i=0;i<n;i++){var c=Ce[this.model][i];c&&(this.color[i]=c(this.color[i]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function Le(t,e,i){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(Ce[t]||(Ce[t]=[]))[e]=i})),t=t[0],function(n){var r;return arguments.length?(i&&(n=i(n)),(r=this[t]()).color[e]=n,r):(r=this[t]().color[e],i&&(r=i(r)),r)}}function De(t){return function(e){return Math.max(0,Math.min(t,e))}}function Ue(t){return Array.isArray(t)?t:[t]}function $e(t,e){for(var i=0;i<e;i++)"number"!=typeof t[i]&&(t[i]=0);return t}Ne.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in Ie.to?this:this.rgb(),i=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return Ie.to[e.model](i)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),i=1===e.valpha?e.color:e.color.concat(this.valpha);return Ie.to.rgb.percent(i)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=Oe[this.model].channels,i=Oe[this.model].labels,n=0;n<e;n++)t[i[n]]=this.color[n];return 1!==this.valpha&&(t.alpha=this.valpha),t},unitArray:function(){var t=this.rgb().color;return t[0]/=255,t[1]/=255,t[2]/=255,1!==this.valpha&&t.push(this.valpha),t},unitObject:function(){var t=this.rgb().object();return t.r/=255,t.g/=255,t.b/=255,1!==this.valpha&&(t.alpha=this.valpha),t},round:function(t){return t=Math.max(t||0,0),new Ne(this.color.map(function(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}(t)).concat(this.valpha),this.model)},alpha:function(t){return arguments.length?new Ne(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:Le("rgb",0,De(255)),green:Le("rgb",1,De(255)),blue:Le("rgb",2,De(255)),hue:Le(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:Le("hsl",1,De(100)),lightness:Le("hsl",2,De(100)),saturationv:Le("hsv",1,De(100)),value:Le("hsv",2,De(100)),chroma:Le("hcg",1,De(100)),gray:Le("hcg",2,De(100)),white:Le("hwb",1,De(100)),wblack:Le("hwb",2,De(100)),cyan:Le("cmyk",0,De(100)),magenta:Le("cmyk",1,De(100)),yellow:Le("cmyk",2,De(100)),black:Le("cmyk",3,De(100)),x:Le("xyz",0,De(100)),y:Le("xyz",1,De(100)),z:Le("xyz",2,De(100)),l:Le("lab",0,De(100)),a:Le("lab",1),b:Le("lab",2),keyword:function(t){return arguments.length?new Ne(t):Oe[this.model].keyword(this.color)},hex:function(t){return arguments.length?new Ne(t):Ie.to.hex(this.rgb().round().color)},rgbNumber:function(){var t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity:function(){for(var t=this.rgb().color,e=[],i=0;i<t.length;i++){var n=t[i]/255;e[i]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(e+.05)/(i+.05):(i+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},isDark:function(){var t=this.rgb().color;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},isLight:function(){return!this.isDark()},negate:function(){for(var t=this.rgb(),e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten:function(t){var e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken:function(t){var e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate:function(t){var e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate:function(t){var e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten:function(t){var e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken:function(t){var e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale:function(){var t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return Ne.rgb(e,e,e)},fade:function(t){return this.alpha(this.valpha-this.valpha*t)},opaquer:function(t){return this.alpha(this.valpha+this.valpha*t)},rotate:function(t){var e=this.hsl(),i=e.color[0];return i=(i=(i+t)%360)<0?360+i:i,e.color[0]=i,e},mix:function(t,e){if(!t||!t.rgb)throw new Error(\'Argument to "mix" was not a Color instance, but rather an instance of \'+typeof t);var i=t.rgb(),n=this.rgb(),r=void 0===e?.5:e,o=2*r-1,s=i.alpha()-n.alpha(),a=((o*s==-1?o:(o+s)/(1+o*s))+1)/2,l=1-a;return Ne.rgb(a*i.red()+l*n.red(),a*i.green()+l*n.green(),a*i.blue()+l*n.blue(),i.alpha()*r+n.alpha()*(1-r))}},Object.keys(Oe).forEach((function(t){if(-1===qe.indexOf(t)){var e=Oe[t].channels;Ne.prototype[t]=function(){if(this.model===t)return new Ne(this);if(arguments.length)return new Ne(arguments,t);var i="number"==typeof arguments[e]?e:this.valpha;return new Ne(Ue(Oe[this.model][t].raw(this.color)).concat(i),t)},Ne[t]=function(i){return"number"==typeof i&&(i=$e(Ee.call(arguments),e)),new Ne(i,t)}}}));var We=Ne;class Je{constructor(t,e){this.position=t,this.index=e,this.faces=[],this.neighbors=[]}addUniqueNeighbor(t){-1===this.neighbors.indexOf(t)&&this.neighbors.push(t)}}class He{constructor(t,e,i,n){this.a=n.a,this.b=n.b,this.c=n.c,this.v1=t,this.v2=e,this.v3=i,this.normal=[],this.computeNormal(),t.faces.push(this),t.addUniqueNeighbor(e),t.addUniqueNeighbor(i),e.faces.push(this),e.addUniqueNeighbor(t),e.addUniqueNeighbor(i),i.faces.push(this),i.addUniqueNeighbor(t),i.addUniqueNeighbor(e)}computeNormal(){const t=this.v1.position,e=this.v2.position,i=this.v3.position,n=gt([],bt([],i,e),bt([],t,e));mt(this.normal,n)}hasVertex(t){return t===this.v1||t===this.v2||t===this.v3}}\n/*!\n * Contains code from google filament\n * https://github.com/google/filament/\n * License Apache-2.0\n */const Ge=[],Ve=[],Be=[],Xe=[];function Ze(t,e,i){const n=gt(Ve,e,i);t=Mt(t,function(t,e,i,n,r,o,s,a,l,u){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t}(Ge,i[0],i[1],i[2],...n,...e));if((t=function(t){return t[3]<0?At(t,t,-1):t}(t=Ft(t,t)))[3]<1/32767){t[3]=1/32767;const e=Math.sqrt(.9999999990686206);t[0]*=e,t[1]*=e,t[2]*=e}const r=i[3]>0?gt(Be,i,e):gt(Be,e,i);return yt(gt(Xe,i,e),r)<0&&At(t,t,-1),t}function Ye(t,e){const i=[],n=[];let r=0;for(r=0;r<t.length;r+=3){const e=new Je([t[r],t[r+1],t[r+2]],r/3);i.push(e)}if(!e.length){const t=e;e=[];for(let i=0;i<t;i++)e.push(i)}for(r=0;r<e.length/3;r++){const t={a:e[3*r],b:e[3*r+1],c:e[3*r+2]};new He(i[t.a],i[t.b],i[t.c],t)}const o=[],s=[0,0,0];for(r=0;r<i.length;r++){const t=i[r],e=t.index;dt(s,0,0,0);let a=t.faces.length;for(let e=0;e<a;e++)ft(s,s,t.faces[e].normal);a=a||1,dt(o,a,a,a),pt(s,s,o),n[3*e]=s[0],n[3*e+1]=s[1],n[3*e+2]=s[2]}return n}\n/*!\n * Contains code from THREE.JS\n * https://github.com/mrdoob/three.js/\n * License MIT\n * \n * Generate tangents per vertex.\n */function Ke(t,e,i){return t[0]=e[i],t[1]=e[i+1],t[2]=e[i+2],t}function Qe(t,e,i){return t[0]=e[i],t[1]=e[i+1],t}var ti={exports:{}};function ei(t,e,i){i=i||2;var n,r,o,s,a,l,u,c=e&&e.length,h=c?e[0]*i:t.length,d=ii(t,0,h,i,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(t,e,i,n){var r,o,s,a,l,u=[];for(r=0,o=e.length;r<o;r++)s=e[r]*n,a=r<o-1?e[r+1]*n:t.length,(l=ii(t,s,a,n,!1))===l.next&&(l.steiner=!0),u.push(fi(l));for(u.sort(ui),r=0;r<u.length;r++)i=ci(u[r],i);return i}(t,e,d,i)),t.length>80*i){n=o=t[0],r=s=t[1];for(var p=i;p<h;p+=i)(a=t[p])<n&&(n=a),(l=t[p+1])<r&&(r=l),a>o&&(o=a),l>s&&(s=l);u=0!==(u=Math.max(o-n,s-r))?32767/u:0}return ri(d,f,i,n,r,u,0),f}function ii(t,e,i,n,r){var o,s;if(r===Fi(t,e,i,n)>0)for(o=e;o<i;o+=n)s=Mi(o,t[o],t[o+1],s);else for(o=i-n;o>=e;o-=n)s=Mi(o,t[o],t[o+1],s);return s&&gi(s,s.next)&&(ji(s),s=s.next),s}function ni(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!gi(n,n.next)&&0!==yi(n.prev,n,n.next))n=n.next;else{if(ji(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function ri(t,e,i,n,r,o,s){if(t){!s&&o&&function(t,e,i,n){var r=t;do{0===r.z&&(r.z=di(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,o,s,a,l,u=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,n=i,a=0,e=0;e<u&&(a++,n=n.nextZ);e++);for(l=u;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,u*=2}while(s>1)}(r)}(t,n,r,o);for(var a,l,u=t;t.prev!==t.next;)if(a=t.prev,l=t.next,o?si(t,n,r,o):oi(t))e.push(a.i/i|0),e.push(t.i/i|0),e.push(l.i/i|0),ji(t),t=l.next,u=l.next;else if((t=l)===u){s?1===s?ri(t=ai(ni(t),e,i),e,i,n,r,o,2):2===s&&li(t,e,i,n,r,o):ri(ni(t),e,i,n,r,o,1);break}}}function oi(t){var e=t.prev,i=t,n=t.next;if(yi(e,i,n)>=0)return!1;for(var r=e.x,o=i.x,s=n.x,a=e.y,l=i.y,u=n.y,c=r<o?r<s?r:s:o<s?o:s,h=a<l?a<u?a:u:l<u?l:u,d=r>o?r>s?r:s:o>s?o:s,f=a>l?a>u?a:u:l>u?l:u,p=n.next;p!==e;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&pi(r,a,o,l,s,u,p.x,p.y)&&yi(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function si(t,e,i,n){var r=t.prev,o=t,s=t.next;if(yi(r,o,s)>=0)return!1;for(var a=r.x,l=o.x,u=s.x,c=r.y,h=o.y,d=s.y,f=a<l?a<u?a:u:l<u?l:u,p=c<h?c<d?c:d:h<d?h:d,m=a>l?a>u?a:u:l>u?l:u,y=c>h?c>d?c:d:h>d?h:d,g=di(f,p,e,i,n),b=di(m,y,e,i,n),v=t.prevZ,w=t.nextZ;v&&v.z>=g&&w&&w.z<=b;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=y&&v!==r&&v!==s&&pi(a,c,l,h,u,d,v.x,v.y)&&yi(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,w.x>=f&&w.x<=m&&w.y>=p&&w.y<=y&&w!==r&&w!==s&&pi(a,c,l,h,u,d,w.x,w.y)&&yi(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;v&&v.z>=g;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=y&&v!==r&&v!==s&&pi(a,c,l,h,u,d,v.x,v.y)&&yi(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;w&&w.z<=b;){if(w.x>=f&&w.x<=m&&w.y>=p&&w.y<=y&&w!==r&&w!==s&&pi(a,c,l,h,u,d,w.x,w.y)&&yi(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function ai(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!gi(r,o)&&bi(r,n,n.next,o)&&xi(r,o)&&xi(o,r)&&(e.push(r.i/i|0),e.push(n.i/i|0),e.push(o.i/i|0),ji(n),ji(n.next),n=t=o),n=n.next}while(n!==t);return ni(n)}function li(t,e,i,n,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&mi(s,a)){var l=ki(s,a);return s=ni(s,s.next),l=ni(l,l.next),ri(s,e,i,n,r,o,0),void ri(l,e,i,n,r,o,0)}a=a.next}s=s.next}while(s!==t)}function ui(t,e){return t.x-e.x}function ci(t,e){var i=function(t,e){var i,n=e,r=t.x,o=t.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>s&&(s=a,i=n.x<n.next.x?n:n.next,a===r))return i}n=n.next}while(n!==e);if(!i)return null;var l,u=i,c=i.x,h=i.y,d=1/0;n=i;do{r>=n.x&&n.x>=c&&r!==n.x&&pi(o<h?r:s,o,c,h,o<h?s:r,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(r-n.x),xi(n,t)&&(l<d||l===d&&(n.x>i.x||n.x===i.x&&hi(i,n)))&&(i=n,d=l)),n=n.next}while(n!==u);return i}(t,e);if(!i)return e;var n=ki(i,t);return ni(n,n.next),ni(i,i.next)}function hi(t,e){return yi(t.prev,t,e.prev)<0&&yi(e.next,t,t.next)<0}function di(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function fi(t){var 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 pi(t,e,i,n,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(n-a)>=(i-s)*(e-a)&&(i-s)*(o-a)>=(r-s)*(n-a)}function mi(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&bi(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(xi(t,e)&&xi(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(yi(t.prev,t,e.prev)||yi(t,e.prev,e))||gi(t,e)&&yi(t.prev,t,t.next)>0&&yi(e.prev,e,e.next)>0)}function yi(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function gi(t,e){return t.x===e.x&&t.y===e.y}function bi(t,e,i,n){var r=wi(yi(t,e,i)),o=wi(yi(t,e,n)),s=wi(yi(i,n,t)),a=wi(yi(i,n,e));return r!==o&&s!==a||(!(0!==r||!vi(t,i,e))||(!(0!==o||!vi(t,n,e))||(!(0!==s||!vi(i,t,n))||!(0!==a||!vi(i,e,n)))))}function vi(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 wi(t){return t>0?1:t<0?-1:0}function xi(t,e){return yi(t.prev,t,t.next)<0?yi(t,e,t.next)>=0&&yi(t,t.prev,e)>=0:yi(t,e,t.prev)<0||yi(t,t.next,e)<0}function ki(t,e){var i=new Ai(t.i,t.x,t.y),n=new Ai(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function Mi(t,e,i,n){var r=new Ai(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function ji(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 Ai(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Fi(t,e,i,n){for(var r=0,o=e,s=i-n;o<i;o+=n)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}ti.exports=ei,ti.exports.default=ei,ei.deviation=function(t,e,i,n){var r=e&&e.length,o=r?e[0]*i:t.length,s=Math.abs(Fi(t,0,o,i));if(r)for(var a=0,l=e.length;a<l;a++){var u=e[a]*i,c=a<l-1?e[a+1]*i:t.length;s-=Math.abs(Fi(t,u,c,i))}var h=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,f=n[a+1]*i,p=n[a+2]*i;h+=Math.abs((t[d]-t[p])*(t[f+1]-t[d+1])-(t[d]-t[f])*(t[p+1]-t[d+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},ei.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)i.vertices.push(t[r][o][s]);r>0&&(n+=t[r-1].length,i.holes.push(n))}return i};var Ti=ti.exports;\n/*!\n * @maptalks/vector-packer v0.71.0\n * LICENSE : UNLICENSED\n * (c) 2016-2022 maptalks.com\n */const zi={Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6};function Si(t,e={}){var i=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)_i(i,t.features[n],e,n);else _i(i,"Feature"===t.type?t:{geometry:t},e);return i}function _i(t,e,i,n){if(e.geometry&&e.geometry.geometry){var r=e.geometry.coordinates,o=e.geometry.type,s=[],a=e.id;if(i.promoteId?a=e.properties[i.promoteId]:i.generateId&&(a=n||0),"Point"===o)Pi(r,s);else if("MultiPoint"===o)for(var l=0;l<r.length;l++)Pi(r[l],s);else if("LineString"===o)Oi([r],s);else if("MultiLineString"===o){if(i.lineMetrics){for(l=0;l<r.length;l++)Ii(r[l],s=[]),t.push(Ei(a,"LineString",s,e.properties));return}Oi(r,s)}else if("Polygon"===o)Oi(r,s);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)_i(t,{id:a,geometry:e.geometry.geometries[l],properties:e.properties},i,n);return}return void console.warn(`Input data type(${o}) is not a valid GeoJSON geometry type.`)}for(l=0;l<r.length;l++){var u=[];Oi(r[l],u),s.push(u)}}t.push(Ei(a,o,s,e.properties))}}function Pi(t,e){const i=new Ot(t[0],t[1]);i.z=100*(t[2]||0),e.push([i])}function Ii(t,e){for(let i=0;i<t.length;i++){const n=new Ot(t[i][0],t[i][1]);n.z=100*(t[i][2]||0),e.push(n)}}function Oi(t,e,i,n){for(var r=0;r<t.length;r++){var o=[];Ii(t[r],o),e.push(o)}}function Ei(t,e,i,n){return{id:void 0===t?null:t,type:zi[e],geometry:i,properties:n}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */function qi(t,{width:e,height:i},n,r){if(r){if(r.length!==e*i*n)throw new RangeError("mismatched image size")}else r=new Uint8Array(e*i*n);return t.width=e,t.height=i,t.data=r,t}function Ri(t,{width:e,height:i},n){if(e===t.width&&i===t.height)return;const r=qi({},{width:e,height:i},n);Ci(t,r,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},n),t.width=e,t.height=i,t.data=r.data}function Ci(t,e,i,n,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||n.x>e.width-r.width||n.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");const s=t.data,a=e.data;if(s===a)return e;for(let l=0;l<r.height;l++){const u=((i.y+l)*t.width+i.x)*o,c=((n.y+l)*e.width+n.x)*o;for(let t=0;t<r.width*o;t++)a[c+t]=s[u+t]}return e}class Ni{constructor(t,e){qi(this,t,1,e)}resize(t){Ri(this,t,1)}clone(){return new Ni({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,n,r){Ci(t,e,i,n,r,1)}}class Li{constructor(t,e){qi(this,t,4,e)}resize(t){Ri(this,t,4)}clone(){return new Li({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,n,r){Ci(t,e,i,n,r,4)}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */class Di{constructor(t,{pixelRatio:e}){this.paddedRect=t,this.pixelRatio=e||1}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Ui{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,e={},i=new qt(0,0,{autoResize:!0}),n=[];for(const i in t){const r=t[i],o={x:0,y:0,w:r.data.width+2,h:r.data.height+2};n.push(o),e[i]=new Di(o,r)}if(i.pack(n,{inPlace:!0}),!$i(i.w)||!$i(i.h)){const t=Wi(i.w),e=Wi(i.h);i.resize(t,e)}const r=new Li({width:i.w,height:i.h});for(const i in t){const n=t[i],o=e[i].paddedRect;Li.copy(n.data,r,{x:0,y:0},{x:o.x+1,y:o.y+1},n.data)}this.image=r,this.positions=e}}function $i(t){return 0==(t&t-1)&&0!==t}function Wi(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n * TODO 升级为potpack\n */class Ji{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,e={},i=new qt(0,0,{autoResize:!0}),n=[];for(const i in t){const r=t[i],o=e[i]={};for(const t in r){const e=r[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const i={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};n.push(i),o[t]={rect:i,metrics:e.metrics}}}i.pack(n,{inPlace:!0});const r=new Ni({width:i.w,height:i.h});for(const i in t){const n=t[i];for(const t in n){const o=n[+t];if(!o||0===o.bitmap.width||0===o.bitmap.height)continue;const s=e[i][t].rect;Ni.copy(o.bitmap,r,{x:0,y:0},{x:s.x+1,y:s.y+1},o.bitmap)}}this.image=r,this.positions=e}}function Hi(t){return t<65536?Uint16Array:Uint32Array}function Gi(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function Vi(t){return t<256?Uint8Array:t<65536?Uint16Array:Float32Array}function Bi(t){const e=t.type,i=[];if(1===e||4===e)for(let e=0;e<t.geometry.length;e++)Pi(t.geometry[e],i);else if(2===e)Oi(t.geometry,i);else if(3===e)Oi(t.geometry,i);else if(5===e)Oi(t.geometry,i);else if(6===e)for(let e=0;e<t.geometry.length;e++){const n=[];Oi(t.geometry[e],n),i.push(n)}return t.geometry=i,t}function Xi(t){for(let e=1;e<arguments.length;e++){const i=arguments[e];for(const e in i)t[e]=i[e]}return t}function Zi(t){return null==t}function Yi(t){return"number"==typeof t&&!isNaN(t)}function Ki(t){return"object"==typeof t&&!!t}function Qi(t){return!Zi(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function tn(t){return!Zi(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}const en=Object.prototype.hasOwnProperty;function nn(t,e){return en.call(t,e)}const rn=Math.PI/180;function on(t){return t&&s(t)&&t.property}function sn(t){const{pointAtTileRes:e,tileRatio:i}=t;return e*i}function an(t){return"centimeter"===t||"cm"===t?1:"millimeter"===t||"mm"===t?.1:100}function ln(t){let e=0;for(let i,n,r=0,o=t.length,s=o-1;r<o;s=r++)i=t[r],n=t[s],e+=void 0!==i.x?(n.x-i.x)*(i.y+n.y):(n[0]-i[0])*(i[1]+n[1]);return e}function un(t,e,i,n,r){const o=t[e*n],s=t[e*n+1],a=t[i*n],l=t[i*n+1];return o===a&&(o<0||o>r)&&s!==l||s===l&&(s<0||s>r)&&o!==a}function cn(t,e,i){let n=i;return e&&t&&(n=t[e]),void 0===n&&(n=i),100*(n||0)}function hn(t,e,i,n,r,o,s){e||0===e||(e=1);const a=cn(t.properties,i,n),l=a*e;let u=a;return r?u=cn(t.properties,r,o):s&&(u=a-cn(t.properties,s,0)),u*=e,{altitude:l,height:u}}function dn(t,e){return e<1/0&&(t.x<0||t.x>e||t.y<0||t.y>e)}function fn(t){return null==t}function pn(t,e,i){if(t===i||t===e)return t;const n=i-e;return((t-e)%n+n)%n+e}Object.freeze({__proto__:null,now:function(){return Date.now()},extend:Xi,isNil:Zi,isNumber:Yi,isInteger:function(t){return(0|t)===t},isObject:Ki,isString:Qi,isFunction:tn,hasOwn:nn,join:function(t,e){return t.join?t.join(e||","):Array.prototype.join.call(t,e||",")},toRadian:function(t){return t*rn},toDegree:function(t){return t/rn},evaluate:function(t,e,i){return tn(t)?t(void 0!==i?i:null,e):t},isFnTypeSymbol:on,getAltitudeToLocal:sn,getTubeSizeScale:an});class mn{constructor(t,e,i,n){this.feature=t,this.symbol=e,this.fnTypes=i,this.options=n}getPolygonResource(){let t=this.symbol.polygonPatternFile;const{polygonPatternFileFn:e}=this.fnTypes;return this.q(t,e)}getLineResource(){let t=this.symbol.linePatternFile;const{linePatternFileFn:e}=this.fnTypes;return this.q(t,e)}q(t,e){return e&&(t=e(this.options.zoom,this.feature.properties)),t}}function yn(t,e,i,n){const r=Math.abs(n)>>15,o=r>>1,s=r%2;let a=n%Math.pow(2,15);const l=e+(o<<14)*Math.sign(e),u=i+(s<<14)*Math.sign(i);return t[0]=l,t[1]=u,a=Math.round(a),t[2]=0===a?n<0?-1:0:a,t}const gn=Math.pow(2,14),bn=Math.pow(2,15);var vn={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:\'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).\',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"A global modifier that elevates layers and markers based on a DEM data source."},fog:{type:"fog",doc:"A global effect that fades layers and markers based on their distance to the camera. The fog can be used to approximate the effect of atmosphere on distant objects and enhance the depth perception of the map when used with terrain or 3D features."},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"mapbox-streets":{type:"vector",url:"mapbox://mapbox.mapbox-streets-v6"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style\'s `transition` property.",example:{duration:300,delay:0}},projection:{type:"projection",doc:"The projection the map should be rendered in. Supported projections are Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Mercator, Natural Earth, and Winkel Tripel. Terrain, fog, sky and CustomLayerInterface are not supported for projections other than mercator.",example:{name:"albers",center:[-154,50],parallels:[55,65]}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source\'s bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by Mapbox GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source\'s tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\\n * `cluster` Is `true` if the point is a cluster \\n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\\n * `point_count` Number of original points grouped into this cluster\\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:\'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\\n\\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\\n\\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`\'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},sky:{doc:"A spherical dome around the map that is always rendered behind all other layers.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like \'mapbox:\'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:\'An expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `["feature-state", ...]` expression is not supported in filter expressions. The `["pitch"]` and `["distance-from-center"]` expressions are supported only for filter expressions on the symbol layer.\'},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background","layout_sky"],layout_background:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_sky:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line\'s width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line\'s width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don\'t have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},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",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the icon bounding box used for detecting symbol collisions.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options. SDF images are not supported in formatted text and will be ignored.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol\'s anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text\'s language supports horizontal writing mode, symbols would be laid out horizontally."},vertical:{doc:"If a text\'s language supports vertical writing mode, symbols would be laid out vertically."}},doc:"The property allows control over a symbol\'s orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single \'vertical\' enum value. For symbol with point placement, the order of elements in an array define priority order for the placement of an orientation variant. For symbol with line placement, the default text writing mode is either [\'horizontal\', \'vertical\'] or [\'vertical\', \'horizontal\'], the order doesn\'t affect the placement.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_symbol:{type:"boolean",doc:\'Expression which determines whether or not to display a symbol. Symbols support dynamic filtering, meaning this expression can use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature","pitch","distance-from-center"]}},filter_fill:{type:"boolean",doc:\'Expression which determines whether or not to display a polygon. Fill layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_line:{type:"boolean",doc:\'Expression which determines whether or not to display a Polygon or LineString. Line layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_circle:{type:"boolean",doc:\'Expression which determines whether or not to display a circle. Circle layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},"filter_fill-extrusion":{type:"boolean",doc:\'Expression which determines whether or not to display a Polygon. Fill-extrusion layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_heatmap:{type:"boolean",doc:\'Expression used to determine whether a point is being displayed or not. Heatmap layer does NOT support dynamic filtering, meaning this expression can NOT use the `["pitch"]` and `["distance-from-center"]` expressions to reference the current state of the view.\',default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}},filter_operator:{type:"enum",values:{"==":{doc:\'`["==", key, value]` equality: `feature[key] = value`\'},"!=":{doc:\'`["!=", key, value]` inequality: `feature[key] ≠ value`\'},">":{doc:\'`[">", key, value]` greater than: `feature[key] > value`\'},">=":{doc:\'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`\'},"<":{doc:\'`["<", key, value]` less than: `feature[key] < value`\'},"<=":{doc:\'`["<=", key, value]` less than or equal: `feature[key] ≤ value`\'},in:{doc:\'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`\'},"!in":{doc:\'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`\'},all:{doc:\'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`\'},any:{doc:\'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`\'},none:{doc:\'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`\'},has:{doc:\'`["has", key]` `feature[key]` exists\'},"!has":{doc:\'`["!has", key]` `feature[key]` does not exist\'},within:{doc:\'`["within", object]` feature geometry is within object geometry\'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn\'t otherwise available. It is used in the following circumstances:\\n* In categorical functions, when the feature value does not match any of the stop domain values.\\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\\nIf no default is provided, the style property\'s default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:\'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].\',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:\'References variable bound using "let".\',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string. In the specific case when the second and third arguments are string literals, you must wrap at least one of them in a [`literal`](#types-literal) expression to hint correct interpretation to the [type system](#type-system).",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:\'Selects the output for which the label value matches the input value, or the fallback value if no match is found. The input can be any expression (for example, `["get", "building_type"]`). Each label must be unique, and must be either:\\n - a single literal value; or\\n - an array of literal values, the values of which must be all strings or all numbers (for example `[100, 101]` or `["c", "b"]`).\\n\\nThe input matches if any of the values in the array matches using strict equality, similar to the `"in"` operator.\\nIf the input type does not match the type of the labels, the result will be the fallback value.\',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first valid value is obtained. Invalid values are `null` and [`\'image\'`](#types-image) expressions that are unavailable in the style. If all values are invalid, `coalesce` returns the first value listed.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:\'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.\',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:\'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\\n\\nInterpolation types:\\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.\',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:\'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.\',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:\'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.\',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:\'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\\\'image\\\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\\n- `"text-font"`: Overrides the font stack specified by the root layout property.\\n- `"text-color"`: Overrides the color specified by the root paint property.\\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.\',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns a [`ResolvedImage`](/mapbox-gl-js/style-spec/types/#resolvedimage) for use in [`icon-image`](/mapbox-gl-js/style-spec/layers/#layout-symbol-icon-image), `*-pattern` entries, and as a section in the [`\'format\'`](#types-format) expression. A [`\'coalesce\'`](#coalesce) expression containing `image` expressions will evaluate to the first listed image that is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `\'image\'` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0",android:"8.4.0",ios:"5.4.0",macos:"0.15.0"}}},"to-string":{doc:\'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a [`boolean`](#types-boolean), the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a [`color`](#color), it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. If the input is an [`\\\'image\\\'`](#types-image) expression, `\\\'to-string\\\'` returns the image name. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.\',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:\'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.\',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color\'s red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature\'s properties, or from another object if a second argument is provided. Returns `null` if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature\'s properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Returns the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:\'Returns the feature properties object. Note that in some cases, it may be more efficient to use `["get", "property_name"]` directly.\',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature\'s state. Returns `null` if the requested property is not present on the feature\'s state. A feature\'s state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. Features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. Note that [\\"feature-state\\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Returns the feature\'s geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`. `Multi*` feature types are only returned in GeoJSON sources. When working with vector tile sources, use the singular forms.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Returns the feature\'s id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:\'Returns the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.\',group:"Camera","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pitch:{doc:\'Returns the current pitch in degrees. `["pitch"]` may only be used in the `filter` expression for a `symbol` layer.\',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"distance-from-center":{doc:\'Returns the distance of a `symbol` instance from the center of the map. The distance is measured in pixels divided by the height of the map container. It measures 0 at the center, decreases towards the camera and increase away from the camera. For example, if the height of the map is 1000px, a value of -1 means 1000px away from the center towards the camera, and a value of 1 means a distance of 1000px away from the camera from the center. `["distance-from-center"]` may only be used in the `filter` expression for a `symbol` layer.\',group:"Camera","sdk-support":{"basic functionality":{js:"2.6.0"}}},"heatmap-density":{doc:"Returns the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Returns the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},"sky-radial-progress":{doc:"Returns the distance of a point on the sky from the sun position. Returns 0 at sun position and 1 when the distance reaches `sky-gradient-radius`. Can only be used in the `sky-gradient` property.",group:"sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},accumulated:{doc:"Returns the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0",android:"8.4.0",ios:"5.5.0",macos:"0.15.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:\'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.\',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line\'s endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in Mapbox GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},fog:{range:{type:"array",default:[.5,10],minimum:-20,maximum:20,length:2,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"The start and end distance range in which fog fades from fully transparent to fully opaque. The distance to the point at the center of the map is defined as zero, so that negative range values are closer to the camera, and positive values are farther away.",example:[.5,10],"sdk-support":{"basic functionality":{js:"2.3.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the fog. Using opacity is recommended only for smoothly transitioning fog on/off as anything less than 100% opacity results in more tiles loaded and drawn.","sdk-support":{"basic functionality":{js:"2.3.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:.1,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the fog to the color of the sky. A value of zero leaves a sharp transition from fog to sky. Increasing the value blends the color of fog into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0"}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},projection:{name:{type:"enum",values:{albers:{doc:"An Albers equal-area projection centered on the continental United States. You can configure the projection for a different region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},equalEarth:{doc:"An Equal Earth projection."},equirectangular:{doc:"An Equirectangular projection. This projection is very similar to the Plate Carrée projection."},lambertConformalConic:{doc:"A Lambert conformal conic projection. You can configure the projection for a region by setting `center` and `parallels` properties. You may want to set max bounds to constrain the map to the relevant region."},mercator:{doc:"The Mercator projection is the default projection."},naturalEarth:{doc:"A Natural Earth projection."},winkelTripel:{doc:"A Winkel Tripel projection."}},default:"mercator",doc:"The name of the projection to be used for rendering the map.",required:!0,"sdk-support":{"basic functionality":{js:"2.6.0"}}},center:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The reference longitude and latitude of the projection. `center` takes the form of [lng, lat]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic). All other projections are centered on [0, 0].",example:[-96,37.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}},parallels:{type:"array",length:2,value:"number","property-type":"data-constant",transition:!1,doc:"The standard parallels of the projection, denoting the desired latitude range with minimal distortion. `parallels` takes the form of [lat0, lat1]. This property is only configurable for conic projections (Albers and Lambert Conformal Conic).",example:[29.5,45.5],requires:[{name:["albers","lambertConformalConic"]}],"sdk-support":{"basic functionality":{js:"2.6.0"}}}},terrain:{source:{type:"string",doc:"Name of a source of `raster_dem` type to be used for terrain elevation.",required:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}},exaggeration:{type:"number","property-type":"data-constant",default:1,minimum:0,maximum:1e3,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Exaggerates the elevation of the terrain by multiplying the data from the DEM with this value.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background","paint_sky"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color\'s opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.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,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion\'s surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},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",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",android:"7.0.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line\'s actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line\'s offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won\'t render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.3.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:\'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.\',transition:!1,requires:[{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry\'s offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle\'s stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle\'s stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed. `queryRenderedFeatures` on heatmap layers will return points within this radius.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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"],doc:\'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.\',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the icon\'s halo. Icon halos can only be used with [SDF icons](/help/troubleshooting/using-recolorable-images-in-mapbox-maps/).",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the icon\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the text\'s halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The halo\'s fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the text\'s anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_sky:{"sky-type":{type:"enum",values:{gradient:{doc:"Renders the sky with a gradient that can be configured with `sky-gradient-radius` and `sky-gradient`."},atmosphere:{doc:"Renders the sky with a simulated atmospheric scattering algorithm, the sun direction can be attached to the light position or explicitly set through `sky-atmosphere-sun`."}},default:"atmosphere",doc:"The type of the sky","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{type:"array",value:"number",length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the sun center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the sun relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the sun, where 0° is directly above, at zenith, and 90° at the horizon. When this property is ommitted, the sun center is directly inherited from the light position.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},requires:[{"sky-type":"atmosphere"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{type:"number",requires:[{"sky-type":"atmosphere"}],default:10,minimum:0,maximum:100,transition:!1,doc:"Intensity of the sun as a light source in the atmosphere (on a scale from 0 to a 100). Setting higher values will brighten up the sky.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-gradient-center":{type:"array",requires:[{"sky-type":"gradient"}],value:"number",default:[0,0],length:2,units:"degrees",minimum:[0,0],maximum:[360,180],transition:!1,doc:"Position of the gradient center [a azimuthal angle, p polar angle]. The azimuthal angle indicates the position of the gradient center relative to 0° north, where degrees proceed clockwise. The polar angle indicates the height of the gradient center, where 0° is directly above, at zenith, and 90° at the horizon.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{type:"number",requires:[{"sky-type":"gradient"}],default:90,minimum:0,maximum:180,transition:!1,doc:"The angular distance (measured in degrees) from `sky-gradient-center` up to which the gradient extends. A value of 180 causes the gradient to wrap around to the opposite direction from `sky-gradient-center`.","sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"sky-gradient":{type:"color",default:["interpolate",["linear"],["sky-radial-progress"],.8,"#87ceeb",1,"white"],doc:"Defines a radial color gradient with which to color the sky. The color values can be interpolated with an expression using `sky-radial-progress`. The range [0, 1] for the interpolant covers a radial distance (in degrees) of [0, `sky-gradient-radius`] centered at the position specified by `sky-gradient-center`.",transition:!1,requires:[{"sky-type":"gradient"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{type:"color",default:"white",doc:"A color applied to the atmosphere sun halo. The alpha channel describes how strongly the sun halo is represented in an atmosphere sky layer.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-atmosphere-color":{type:"color",default:"white",doc:"A color used to tweak the main atmospheric scattering coefficients. Using white applies the default coefficients giving the natural blue color to the atmosphere. This color affects how heavily the corresponding wavelength is represented during scattering. The alpha channel describes the density of the atmosphere, with 1 maximum density and 0 no density.",transition:!1,requires:[{"sky-type":"atmosphere"}],"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},"property-type":"data-constant"},"sky-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire sky layer.",transition:!0,"sdk-support":{"basic functionality":{js:"2.0.0",ios:"10.0.0",android:"10.0.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},wn="undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self?self:{};function xn(t){var e={exports:{}};return t(e,e.exports),e.exports}function kn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}\n/*! https://mths.be/punycode v1.3.2 by @mathias */xn((function(t,e){!function(i){var n=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="object"==typeof wn&&wn;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var s,a,l=2147483647,u=/^xn--/,c=/[^\\x20-\\x7E]/,h=/[\\x2E\\u3002\\uFF0E\\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function m(t){throw RangeError(d[t])}function y(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function g(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+y((t=t.replace(h,".")).split("."),e).join(".")}function b(t){for(var e,i,n=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function v(t){return y(t,(function(t){var e="";return t>65535&&(e+=p((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+p(t)})).join("")}function w(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function x(t,e,i){var n=0;for(t=i?f(t/700):t>>1,t+=f(t/e);t>455;n+=36)t=f(t/35);return f(n+36*t/(t+38))}function k(t){var e,i,n,r,o,s,a,u,c,h,d,p=[],y=t.length,g=0,b=128,w=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&m("not-basic"),p.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<y;){for(o=g,s=1,a=36;r>=y&&m("invalid-input"),((u=(d=t.charCodeAt(r++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:36)>=36||u>f((l-g)/s))&&m("overflow"),g+=u*s,!(u<(c=a<=w?1:a>=w+26?26:a-w));a+=36)s>f(l/(h=36-c))&&m("overflow"),s*=h;w=x(g-o,e=p.length+1,0==o),f(g/e)>l-b&&m("overflow"),b+=f(g/e),g%=e,p.splice(g++,0,b)}return v(p)}function M(t){var e,i,n,r,o,s,a,u,c,h,d,y,g,v,k,M=[];for(y=(t=b(t)).length,e=128,i=0,o=72,s=0;s<y;++s)(d=t[s])<128&&M.push(p(d));for(n=r=M.length,r&&M.push("-");n<y;){for(a=l,s=0;s<y;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((l-i)/(g=n+1))&&m("overflow"),i+=(a-e)*g,e=a,s=0;s<y;++s)if((d=t[s])<e&&++i>l&&m("overflow"),d==e){for(u=i,c=36;!(u<(h=c<=o?1:c>=o+26?26:c-o));c+=36)M.push(p(w(h+(k=u-h)%(v=36-h),0))),u=f(k/v);M.push(p(w(u,0))),o=x(i,g,n==r),i=0,++n}++i,++e}return M.join("")}if(s={version:"1.3.2",ucs2:{decode:b,encode:v},decode:k,encode:M,toASCII:function(t){return g(t,(function(t){return c.test(t)?"xn--"+M(t):t}))},toUnicode:function(t){return g(t,(function(t){return u.test(t)?k(t.slice(4).toLowerCase()):t}))}},n&&r)if(t.exports==n)r.exports=s;else for(a in s)s.hasOwnProperty(a)&&(n[a]=s[a]);else i.punycode=s}(wn)}));var Mn=function(t,e,i,n){i=i||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\\+/g;t=t.split(e=e||"&");var s=1e3;n&&"number"==typeof n.maxKeys&&(s=n.maxKeys);var a=t.length;s>0&&a>s&&(a=s);for(var l=0;l<a;++l){var u,c,h,d,f=t[l].replace(o,"%20"),p=f.indexOf(i);p>=0?(u=f.substr(0,p),c=f.substr(p+1)):(u=f,c=""),h=decodeURIComponent(u),d=decodeURIComponent(c),kn(r,h)?Array.isArray(r[h])?r[h].push(d):r[h]=[r[h],d]:r[h]=d}return r},jn=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},An=function(t,e,i,n){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(n){var r=encodeURIComponent(jn(n))+i;return Array.isArray(t[n])?t[n].map((function(t){return r+encodeURIComponent(jn(t))})).join(e):r+encodeURIComponent(jn(t[n]))})).join(e):n?encodeURIComponent(jn(n))+i+encodeURIComponent(jn(t)):""};function Fn(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}xn((function(t,e){e.decode=e.parse=Mn,e.encode=e.stringify=An}));class Tn extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class zn{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,i]of e)this.bindings[t]=i}concat(t){return new zn(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const Sn={kind:"null"},_n={kind:"number"},Pn={kind:"string"},In={kind:"boolean"},On={kind:"color"},En={kind:"object"},qn={kind:"value"},Rn={kind:"collator"},Cn={kind:"formatted"},Nn={kind:"resolvedImage"};function Ln(t,e){return{kind:"array",itemType:t,N:e}}function Dn(t){if("array"===t.kind){const e=Dn(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const Un=[Sn,_n,Pn,In,On,Cn,En,Ln(qn),Nn];function $n(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!$n(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 Un)if(!$n(t,e))return null}return`Expected ${Dn(t)} but found ${Dn(e)} instead.`}function Wn(t,e){return e.some(e=>e.kind===t.kind)}function Jn(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)}var Hn=xn((function(t,e){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return function(t){return t<0?0:t>1?1:t}("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in i)return i[a].slice();if("#"===a[0])return 4===a.length?(e=parseInt(a.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===a.length&&(e=parseInt(a.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=a.indexOf("("),u=a.indexOf(")");if(-1!==l&&u+1===a.length){var c=a.substr(0,l),h=a.substr(l+1,u-(l+1)).split(","),d=1;switch(c){case"rgba":if(4!==h.length)return null;d=o(h.pop());case"rgb":return 3!==h.length?null:[r(h[0]),r(h[1]),r(h[2]),d];case"hsla":if(4!==h.length)return null;d=o(h.pop());case"hsl":if(3!==h.length)return null;var f=(parseFloat(h[0])%360+360)%360/360,p=o(h[1]),m=o(h[2]),y=m<=.5?m*(p+1):m+p-m*p,g=2*m-y;return[n(255*s(g,y,f+1/3)),n(255*s(g,y,f)),n(255*s(g,y,f-1/3)),d];default:return null}}return null}}catch(t){}}));class Gn{constructor(t,e,i,n=1){this.r=t,this.g=e,this.b=i,this.a=n}static parse(t){if(!t)return;if(t instanceof Gn)return t;if("string"!=typeof t)return;const e=Hn.parseCSSColor(t);return e?new Gn(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,i,n]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(i)},${n})`}toArray(){const{r:t,g:e,b:i,a:n}=this;return 0===n?[0,0,0,0]:[255*t/n,255*e/n,255*i/n,n]}}Gn.black=new Gn(0,0,0,1),Gn.white=new Gn(1,1,1,1),Gn.transparent=new Gn(0,0,0,0),Gn.red=new Gn(1,0,0,1),Gn.blue=new Gn(0,0,1,1);class Vn{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}}class Bn{constructor(t,e,i,n,r){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r}}class Xn{constructor(t){this.sections=t}static fromString(t){return new Xn([new Bn(t,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 Xn?t:Xn.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}serialize(){const t=["format"];for(const e of this.sections){if(e.image){t.push(["image",e.image.name]);continue}t.push(e.text);const i={};e.fontStack&&(i["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(i["font-scale"]=e.scale),e.textColor&&(i["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(i)}return t}}class Zn{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Zn({name:t,available:!1}):null}serialize(){return["image",this.name]}}function Yn(t,e,i,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,i,n].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function Kn(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof Gn)return!0;if(t instanceof Vn)return!0;if(t instanceof Xn)return!0;if(t instanceof Zn)return!0;if(Array.isArray(t)){for(const e of t)if(!Kn(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!Kn(t[e]))return!1;return!0}return!1}function Qn(t){if(null===t)return Sn;if("string"==typeof t)return Pn;if("boolean"==typeof t)return In;if("number"==typeof t)return _n;if(t instanceof Gn)return On;if(t instanceof Vn)return Rn;if(t instanceof Xn)return Cn;if(t instanceof Zn)return Nn;if(Array.isArray(t)){const e=t.length;let i;for(const e of t){const t=Qn(e);if(i){if(i===t)continue;i=qn;break}i=t}return Ln(i||qn,e)}return En}function tr(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Gn||t instanceof Xn||t instanceof Zn?t.toString():JSON.stringify(t)}class er{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 ${t.length-1} instead.`);if(!Kn(t[1]))return e.error("invalid value");const i=t[1];let n=Qn(i);const r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new er(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof Gn?["rgba"].concat(this.value.toArray()):this.value instanceof Xn?this.value.serialize():this.value}}class ir{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const nr={string:Pn,number:_n,boolean:In,object:En};class rr{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,n=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in nr)||"object"===i)return e.error(\'The item type argument of "array" must be one of string, number, boolean\',1);r=nr[i],n++}else r=qn;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],n++}i=Ln(r,o)}else i=nr[r];const o=[];for(;n<t.length;n++){const i=e.parse(t[n],n,qn);if(!i)return null;o.push(i)}return new rr(i,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!$n(this.type,Qn(i)))return i;if(e===this.args.length-1)throw new ir(`Expected value to be of type ${Dn(this.type)}, but found ${Dn(Qn(i))} instead.`)}return null}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=this.type,e=[t.kind];if("array"===t.kind){const i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);const n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map(t=>t.serialize()))}}class or{constructor(t){this.type=Cn,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 n=[];let r=!1;for(let i=1;i<=t.length-1;++i){const o=t[i];if(r&&"object"==typeof o&&!Array.isArray(o)){r=!1;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,_n),!t))return null;let i=null;if(o["text-font"]&&(i=e.parse(o["text-font"],1,Ln(Pn)),!i))return null;let s=null;if(o["text-color"]&&(s=e.parse(o["text-color"],1,On),!s))return null;const a=n[n.length-1];a.scale=t,a.font=i,a.textColor=s}else{const o=e.parse(t[i],1,qn);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return e.error("Formatted text type must be \'string\', \'value\', \'image\' or \'null\'.");r=!0,n.push({content:o,scale:null,font:null,textColor:null})}}return new or(n)}evaluate(t){return new Xn(this.sections.map(e=>{const i=e.content.evaluate(t);return Qn(i)===Nn?new Bn("",i,null,null,null):new Bn(tr(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.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)}outputDefined(){return!1}serialize(){const t=["format"];for(const e of this.sections){t.push(e.content.serialize());const i={};e.scale&&(i["font-scale"]=e.scale.serialize()),e.font&&(i["text-font"]=e.font.serialize()),e.textColor&&(i["text-color"]=e.textColor.serialize()),t.push(i)}return t}}class sr{constructor(t){this.type=Nn,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,Pn);return i?new sr(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=Zn.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const ar={"to-boolean":In,"to-color":On,"to-number":_n,"to-string":Pn};class lr{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(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const n=ar[i],r=[];for(let i=1;i<t.length;i++){const n=e.parse(t[i],i,qn);if(!n)return null;r.push(n)}return new lr(n,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,i;for(const n of this.args){if(e=n.evaluate(t),i=null,e instanceof Gn)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 rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Yn(e[0],e[1],e[2],e[3]),!i))return new Gn(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ir(i||`Could not parse color from value \'${"string"==typeof e?e:String(JSON.stringify(e))}\'`)}if("number"===this.type.kind){let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const n=Number(e);if(!isNaN(n))return n}throw new ir(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?Xn.fromString(tr(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?Zn.fromString(tr(this.args[0].evaluate(t))):tr(this.args[0].evaluate(t))}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){if("formatted"===this.type.kind)return new or([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new sr(this.args[0]).serialize();const t=["to-"+this.type.kind];return this.eachChild(e=>{t.push(e.serialize())}),t}}const ur=["Unknown","Point","LineString","Polygon"];class cr{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this.R={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature&&this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ur[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const t=this.featureDistanceData.center,e=this.featureDistanceData.scale,{x:i,y:n}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*e-t[0])+this.featureDistanceData.bearing[1]*(n*e-t[1])}return 0}parseColor(t){let e=this.R[t];return e||(e=this.R[t]=Gn.parse(t)),e}}class hr{constructor(t,e,i,n){this.name=t,this.type=e,this.C=i,this.args=n}evaluate(t){return this.C(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(t=>t.serialize()))}static parse(t,e){const i=t[0],n=hr.definitions[i];if(!n)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(n)?n[0]:n.type,o=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,s=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1);let a=null;for(const[n,o]of s){a=new Or(e.registry,e.path,null,e.scope);const s=[];let l=!1;for(let e=1;e<t.length;e++){const i=t[e],r=Array.isArray(n)?n[e-1]:n.type,o=a.parse(i,1+s.length,r);if(!o){l=!0;break}s.push(o)}if(!l)if(Array.isArray(n)&&n.length!==s.length)a.error(`Expected ${n.length} arguments, but found ${s.length} instead.`);else{for(let t=0;t<s.length;t++){const e=Array.isArray(n)?n[t]:n.type,i=s[t];a.concat(t+1).checkSubtype(e,i.type)}if(0===a.errors.length)return new hr(i,r,o,s)}}if(1===s.length)e.errors.push(...a.errors);else{const i=(s.length?s:o).map(([t])=>{return e=t,Array.isArray(e)?`(${e.map(Dn).join(", ")})`:`(${Dn(e.type)}...)`;var e}).join(" | "),n=[];for(let i=1;i<t.length;i++){const r=e.parse(t[i],1+n.length);if(!r)return null;n.push(Dn(r.type))}e.error(`Expected arguments of type ${i}, but found (${n.join(", ")}) instead.`)}return null}static register(t,e){hr.definitions=e;for(const i in e)t[i]=hr}}class dr{constructor(t,e,i){this.type=Rn,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 n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,In);if(!n)return null;const r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,In);if(!r)return null;let o=null;return i.locale&&(o=e.parse(i.locale,1,Pn),!o)?null:new dr(n,r,o)}evaluate(t){return new Vn(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}serialize(){const t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]}}function fr(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 pr(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function mr(t,e){const i=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,r=Math.pow(2,e.z);return[Math.round(i*r*8192),Math.round(n*r*8192)]}function yr(t,e,i){const n=t[0]-e[0],r=t[1]-e[1],o=t[0]-i[0],s=t[1]-i[1];return n*s-o*r==0&&n*o<=0&&r*s<=0}function gr(t,e){let i=!1;for(let s=0,a=e.length;s<a;s++){const a=e[s];for(let e=0,s=a.length;e<s-1;e++){if(yr(t,a[e],a[e+1]))return!1;(r=a[e])[1]>(n=t)[1]!=(o=a[e+1])[1]>n[1]&&n[0]<(o[0]-r[0])*(n[1]-r[1])/(o[1]-r[1])+r[0]&&(i=!i)}}var n,r,o;return i}function br(t,e){for(let i=0;i<e.length;i++)if(gr(t,e[i]))return!0;return!1}function vr(t,e,i,n){const r=n[0]-i[0],o=n[1]-i[1],s=(t[0]-i[0])*o-r*(t[1]-i[1]),a=(e[0]-i[0])*o-r*(e[1]-i[1]);return s>0&&a<0||s<0&&a>0}function wr(t,e,i){for(const u of i)for(let i=0;i<u.length-1;++i)if(void 0,void 0,0!=(a=[(s=u[i+1])[0]-(o=u[i])[0],s[1]-o[1]])[0]*(l=[(r=e)[0]-(n=t)[0],r[1]-n[1]])[1]-a[1]*l[0]&&vr(n,r,o,s)&&vr(o,s,n,r))return!0;var n,r,o,s,a,l;return!1}function xr(t,e){for(let i=0;i<t.length;++i)if(!gr(t[i],e))return!1;for(let i=0;i<t.length-1;++i)if(wr(t[i],t[i+1],e))return!1;return!0}function kr(t,e){for(let i=0;i<e.length;i++)if(xr(t,e[i]))return!0;return!1}function Mr(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=[];for(let n=0;n<t[r].length;n++){const s=mr(t[r][n],i);fr(e,s),o.push(s)}n.push(o)}return n}function jr(t,e,i){const n=[];for(let r=0;r<t.length;r++){const o=Mr(t[r],e,i);n.push(o)}return n}function Ar(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){const e=.5*n;let r=t[0]-i[0]>e?-n:i[0]-t[0]>e?n:0;0===r&&(r=t[0]-i[2]>e?-n:i[2]-t[0]>e?n:0),t[0]+=r}fr(e,t)}function Fr(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];if(!t)return s;for(const n of t)for(const t of n){const n=[t.x+o[0],t.y+o[1]];Ar(n,e,i,r),s.push(n)}return s}function Tr(t,e,i,n){const r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[];if(!t)return s;for(const i of t){const t=[];for(const n of i){const i=[n.x+o[0],n.y+o[1]];fr(e,i),t.push(i)}s.push(t)}if(e[2]-e[0]<=r/2){(a=e)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const t of s)for(const n of t)Ar(n,e,i,r)}var a;return s}class zr{constructor(t,e){this.type=In,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 ${t.length-1} instead.`);if(Kn(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const i=e.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new zr(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new zr(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new zr(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],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const o=Mr(e.coordinates,n,r),s=Fr(t.geometry(),i,n,r);if(!pr(i,n))return!1;for(const t of s)if(!gr(t,o))return!1}if("MultiPolygon"===e.type){const o=jr(e.coordinates,n,r),s=Fr(t.geometry(),i,n,r);if(!pr(i,n))return!1;for(const t of s)if(!br(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],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const o=Mr(e.coordinates,n,r),s=Tr(t.geometry(),i,n,r);if(!pr(i,n))return!1;for(const t of s)if(!xr(t,o))return!1}if("MultiPolygon"===e.type){const o=jr(e.coordinates,n,r),s=Tr(t.geometry(),i,n,r);if(!pr(i,n))return!1;for(const t of s)if(!kr(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}function Sr(t){if(t instanceof hr){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 zr)return!1;let e=!0;return t.eachChild(t=>{e&&!Sr(t)&&(e=!1)}),e}function _r(t){if(t instanceof hr&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(t=>{e&&!_r(t)&&(e=!1)}),e}function Pr(t,e){if(t instanceof hr&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(t=>{i&&!Pr(t,e)&&(i=!1)}),i}class Ir{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 Ir(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Or{constructor(t,e=[],i,n=new zn,r=[]){this.registry=t,this.path=e,this.key=e.map(t=>`[${t}]`).join(""),this.scope=n,this.errors=r,this.expectedType=i}parse(t,e,i,n,r={}){return e?this.concat(e,i,n).L(t,r):this.L(t,r)}L(t,e){function i(t,e,i){return"assert"===i?new rr(e,[t]):"coerce"===i?new lr(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 n=t[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const r=this.registry[n];if(r){let n=r.parse(t,this);if(!n)return null;if(this.expectedType){const t=this.expectedType,r=n.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==r.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==r.kind&&"string"!==r.kind){if(this.checkSubtype(t,r))return null}else n=i(n,t,e.typeAnnotation||"coerce");else n=i(n,t,e.typeAnnotation||"assert")}if(!(n instanceof er)&&"resolvedImage"!==n.type.kind&&function t(e){if(e instanceof Ir)return t(e.boundExpression);if(e instanceof hr&&"error"===e.name)return!1;if(e instanceof dr)return!1;if(e instanceof zr)return!1;const i=e instanceof lr||e instanceof rr;let n=!0;return e.eachChild(e=>{n=i?n&&t(e):n&&e instanceof er}),!!n&&(Sr(e)&&Pr(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}(n)){const e=new cr;try{n=new er(n.type,n.evaluate(e))}catch(t){return this.error(t.message),null}}return n}return this.error(`Unknown expression "${n}". 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 ${typeof t} instead.`)}concat(t,e,i){const n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Or(this.registry,n,e||null,r,this.errors)}error(t,...e){const i=`${this.key}${e.map(t=>`[${t}]`).join("")}`;this.errors.push(new Tn(i,t))}checkSubtype(t,e){const i=$n(t,e);return i&&this.error(i),i}}function Er(t,e){const i=t.length-1;let n,r,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),n=t[a],r=t[a+1],n<=e){if(a===i||e<r)return a;o=a+1}else{if(!(n>e))throw new ir("Input is not a number.");s=a-1}return 0}class qr{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${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,_n);if(!i)return null;const n=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let i=1;i<t.length;i+=2){const o=1===i?-1/0:t[i],s=t[i+1],a=i,l=i+1;if("number"!=typeof o)return e.error(\'Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.\',a);if(n.length&&n[n.length-1][0]>=o)return e.error(\'Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.\',a);const u=e.parse(s,l,r);if(!u)return null;r=r||u.type,n.push([o,u])}return new qr(r,i,n)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;return n>=e[r-1]?i[r-1].evaluate(t):i[Er(e,n)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){const t=["step",this.input.serialize()];for(let e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t}}var Rr=Cr;function Cr(t,e,i,n){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*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=n}function Nr(t,e,i){return t*(1-i)+e*i}Cr.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},Cr.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},Cr.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},Cr.prototype.solveCurveX=function(t,e){var i,n,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},Cr.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var Lr=Object.freeze({__proto__:null,number:Nr,color:function(t,e,i){return new Gn(Nr(t.r,e.r,i),Nr(t.g,e.g,i),Nr(t.b,e.b,i),Nr(t.a,e.a,i))},array:function(t,e,i){return t.map((t,n)=>Nr(t,e[n],i))}});const Dr=6/29*3*(6/29),Ur=Math.PI/180,$r=180/Math.PI;function Wr(t){return t>.008856451679035631?Math.pow(t,1/3):t/Dr+4/29}function Jr(t){return t>6/29?t*t*t:Dr*(t-4/29)}function Hr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Gr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Vr(t){const e=Gr(t.r),i=Gr(t.g),n=Gr(t.b),r=Wr((.4124564*e+.3575761*i+.1804375*n)/.95047),o=Wr((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-Wr((.0193339*e+.119192*i+.9503041*n)/1.08883)),alpha:t.a}}function Br(t){let e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Jr(e),i=.95047*Jr(i),n=1.08883*Jr(n),new Gn(Hr(3.2404542*i-1.5371385*e-.4985314*n),Hr(-.969266*i+1.8760108*e+.041556*n),Hr(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function Xr(t,e,i){const n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}const Zr={forward:Vr,reverse:Br,interpolate:function(t,e,i){return{l:Nr(t.l,e.l,i),a:Nr(t.a,e.a,i),b:Nr(t.b,e.b,i),alpha:Nr(t.alpha,e.alpha,i)}}},Yr={forward:function(t){const{l:e,a:i,b:n}=Vr(t),r=Math.atan2(n,i)*$r;return{h:r<0?r+360:r,c:Math.sqrt(i*i+n*n),l:e,alpha:t.a}},reverse:function(t){const e=t.h*Ur,i=t.c;return Br({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:Xr(t.h,e.h,i),c:Nr(t.c,e.c,i),l:Nr(t.l,e.l,i),alpha:Nr(t.alpha,e.alpha,i)}}};var Kr=Object.freeze({__proto__:null,lab:Zr,hcl:Yr});class Qr{constructor(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,i,n){let r=0;if("exponential"===t.name)r=to(e,t.base,i,n);else if("linear"===t.name)r=to(e,1,i,n);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new Rr(o[0],o[1],o[2],o[3]).solve(to(e,1,i,n))}return r}static parse(t,e){let[i,n,r,...o]=t;if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const t=n[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:t}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);{const t=n.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);n={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(r=e.parse(r,2,_n),!r)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=On:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t<o.length;t+=2){const i=o[t],n=o[t+1],r=t+3,l=t+4;if("number"!=typeof i)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(s.length&&s[s.length-1][0]>=i)return e.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',r);const u=e.parse(n,l,a);if(!u)return null;a=a||u.type,s.push([i,u])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new Qr(a,i,n,r,s):e.error(`Type ${Dn(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);const r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);const o=Er(e,n),s=Qr.interpolationFactor(this.interpolation,n,e[o],e[o+1]),a=i[o].evaluate(t),l=i[o+1].evaluate(t);return"interpolate"===this.operator?Lr[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?Yr.reverse(Yr.interpolate(Yr.forward(a),Yr.forward(l),s)):Zr.reverse(Zr.interpolate(Zr.forward(a),Zr.forward(l),s))}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}serialize(){let t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const e=[this.operator,t,this.input.serialize()];for(let t=0;t<this.labels.length;t++)e.push(this.labels[t],this.outputs[t].serialize());return e}}function to(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}class eo{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const n=e.expectedType;n&&"value"!==n.kind&&(i=n);const r=[];for(const n of t.slice(1)){const t=e.parse(n,1+r.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,r.push(t)}const o=n&&r.some(t=>$n(n,t.type));return new eo(o?qn:i,r)}evaluate(t){let e,i=null,n=0;for(const r of this.args){if(n++,i=r.evaluate(t),i&&i instanceof Zn&&!i.available&&(e||(e=i),i=null,n===this.args.length))return e;if(null!==i)break}return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}serialize(){const t=["coalesce"];return this.eachChild(e=>{t.push(e.serialize())}),t}}class io{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 ${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 ${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 n=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return n?new io(i,n):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,i]of this.bindings)t.push(e,i.serialize());return t.push(this.result.serialize()),t}}class no{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 ${t.length-1} instead.`);const i=e.parse(t[1],1,_n),n=e.parse(t[2],2,Ln(e.expectedType||qn));return i&&n?new no(n.type.itemType,i,n):null}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new ir(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new ir(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new ir(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class ro{constructor(t,e){this.type=In,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,qn),n=e.parse(t[2],2,qn);return i&&n?Wn(i.type,[In,Pn,_n,Sn,qn])?new ro(i,n):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(null==i)return!1;if(!Jn(e,["boolean","string","number","null"]))throw new ir(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(Qn(e))} instead.`);if(!Jn(i,["string","array"]))throw new ir(`Expected second argument to be of type array or string, but found ${Dn(Qn(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class oo{constructor(t,e,i){this.type=_n,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,qn),n=e.parse(t[2],2,qn);if(!i||!n)return null;if(!Wn(i.type,[In,Pn,_n,Sn,qn]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,_n);return r?new oo(i,n,r):null}return new oo(i,n)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Jn(e,["boolean","string","number","null"]))throw new ir(`Expected first argument to be of type boolean, string, number or null, but found ${Dn(Qn(e))} instead.`);if(!Jn(i,["string","array"]))throw new ir(`Expected second argument to be of type array or string, but found ${Dn(Qn(i))} instead.`);if(this.fromIndex){const n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class so{constructor(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const r={},o=[];for(let s=2;s<t.length-1;s+=2){let a=t[s];const l=t[s+1];Array.isArray(a)||(a=[a]);const u=e.concat(s);if(0===a.length)return u.error("Expected at least one branch label.");for(const t of a){if("number"!=typeof t&&"string"!=typeof t)return u.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,Qn(t)))return null}else i=Qn(t);if(void 0!==r[String(t)])return u.error("Branch labels must be unique.");r[String(t)]=o.length}const c=e.parse(l,s,n);if(!c)return null;n=n||c.type,o.push(c)}const s=e.parse(t[1],1,qn);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,n);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(i,s.type)?null:new so(i,n,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(Qn(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()}serialize(){const t=["match",this.input.serialize()],e=Object.keys(this.cases).sort(),i=[],n={};for(const t of e){const e=n[this.cases[t]];void 0===e?(n[this.cases[t]]=i.length,i.push([this.cases[t],[t]])):i[e][1].push(t)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,n]of i)t.push(1===n.length?r(n[0]):n.map(r)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}class ao{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 ${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 n=[];for(let r=1;r<t.length-1;r+=2){const o=e.parse(t[r],r,In);if(!o)return null;const s=e.parse(t[r+1],r+1,i);if(!s)return null;n.push([o,s]),i=i||s.type}const r=e.parse(t[t.length-1],t.length-1,i);return r?new ao(i,n,r):null}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,e])=>e.outputDefined())&&this.otherwise.outputDefined()}serialize(){const t=["case"];return this.eachChild(e=>{t.push(e.serialize())}),t}}class lo{constructor(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,qn),n=e.parse(t[2],2,_n);if(!i||!n)return null;if(!Wn(i.type,[Ln(qn),Pn,qn]))return e.error(`Expected first argument to be of type array or string, but found ${Dn(i.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,_n);return r?new lo(i.type,i,n,r):null}return new lo(i.type,i,n)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Jn(e,["string","array"]))throw new ir(`Expected first argument to be of type array or string, but found ${Dn(Qn(e))} instead.`);if(this.endIndex){const n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function uo(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 co(t,e,i,n){return 0===n.compare(e,i)}function ho(t,e,i){const n="=="!==t&&"!="!==t;return class r{constructor(t,e,i){this.type=In,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,qn);if(!o)return null;if(!uo(i,o.type))return e.concat(1).error(`"${i}" comparisons are not supported for type \'${Dn(o.type)}\'.`);let s=e.parse(t[2],2,qn);if(!s)return null;if(!uo(i,s.type))return e.concat(2).error(`"${i}" comparisons are not supported for type \'${Dn(s.type)}\'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types \'${Dn(o.type)}\' and \'${Dn(s.type)}\'.`);n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new rr(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new rr(o.type,[s])));let a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,Rn),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){const e=Qn(o),i=Qn(s);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new ir(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const t=Qn(o),i=Qn(s);if("string"!==t.kind||"string"!==i.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}serialize(){const e=[t];return this.eachChild(t=>{e.push(t.serialize())}),e}}}const fo=ho("==",(function(t,e,i){return e===i}),co),po=ho("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!co(0,e,i,n)})),mo=ho("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),yo=ho(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),go=ho("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),bo=ho(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0}));class vo{constructor(t,e,i,n,r){this.type=Pn,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,_n);if(!i)return null;const n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");let r=null;if(n.locale&&(r=e.parse(n.locale,1,Pn),!r))return null;let o=null;if(n.currency&&(o=e.parse(n.currency,1,Pn),!o))return null;let s=null;if(n["min-fraction-digits"]&&(s=e.parse(n["min-fraction-digits"],1,_n),!s))return null;let a=null;return n["max-fraction-digits"]&&(a=e.parse(n["max-fraction-digits"],1,_n),!a)?null:new vo(i,r,o,s,a)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]}}class wo{constructor(t){this.type=_n,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${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 ${Dn(i.type)} instead.`):new wo(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 ir(`Expected value to be of type string or array, but found ${Dn(Qn(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(e=>{t.push(e.serialize())}),t}}const xo={"==":fo,"!=":po,">":yo,"<":mo,">=":bo,"<=":go,array:rr,at:no,boolean:rr,case:ao,coalesce:eo,collator:dr,format:or,image:sr,in:ro,"index-of":oo,interpolate:Qr,"interpolate-hcl":Qr,"interpolate-lab":Qr,length:wo,let:io,literal:er,match:so,number:rr,"number-format":vo,object:rr,slice:lo,step:qr,string:rr,"to-boolean":lr,"to-color":lr,"to-number":lr,"to-string":lr,var:Ir,within:zr};function ko(t,[e,i,n,r]){e=e.evaluate(t),i=i.evaluate(t),n=n.evaluate(t);const o=r?r.evaluate(t):1,s=Yn(e,i,n,o);if(s)throw new ir(s);return new Gn(e/255*o,i/255*o,n/255*o,o)}function Mo(t,e){return t in e}function jo(t,e){const i=e[t];return void 0===i?null:i}function Ao(t){return{type:t}}function Fo(t){return{result:"success",value:t}}function To(t){return{result:"error",value:t}}function zo(t){return!!t.expression&&t.expression.interpolated}function So(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function _o(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Po(t){return t}function Io(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Oo(t,e,i,n,r){return Io(typeof i===r?n[i]:void 0,t.default,e.default)}function Eo(t,e,i){if("number"!==So(i))return Io(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 r=Er(t.stops.map(t=>t[0]),i);return t.stops[r][1]}function qo(t,e,i){const n=void 0!==t.base?t.base:1;if("number"!==So(i))return Io(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 o=Er(t.stops.map(t=>t[0]),i),s=function(t,e,i,n){const r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(i,n,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1];let u=Lr[e.type]||Po;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=Kr[t.colorSpace];u=(t,i)=>e.reverse(e.interpolate(e.forward(t),e.forward(i),s))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==i)return u(e,i,s)}}:u(a,l,s)}function Ro(t,e,i){return"color"===e.type?i=Gn.parse(i):"formatted"===e.type?i=Xn.fromString(i.toString()):"resolvedImage"===e.type?i=Zn.fromString(i.toString()):So(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),Io(i,t.default,e.default)}hr.register(xo,{error:[{kind:"error"},[Pn],(t,[e])=>{throw new ir(e.evaluate(t))}],typeof:[Pn,[qn],(t,[e])=>Dn(Qn(e.evaluate(t)))],"to-rgba":[Ln(_n,4),[On],(t,[e])=>e.evaluate(t).toArray()],rgb:[On,[_n,_n,_n],ko],rgba:[On,[_n,_n,_n,_n],ko],has:{type:In,overloads:[[[Pn],(t,[e])=>Mo(e.evaluate(t),t.properties())],[[Pn,En],(t,[e,i])=>Mo(e.evaluate(t),i.evaluate(t))]]},get:{type:qn,overloads:[[[Pn],(t,[e])=>jo(e.evaluate(t),t.properties())],[[Pn,En],(t,[e,i])=>jo(e.evaluate(t),i.evaluate(t))]]},"feature-state":[qn,[Pn],(t,[e])=>jo(e.evaluate(t),t.featureState||{})],properties:[En,[],t=>t.properties()],"geometry-type":[Pn,[],t=>t.geometryType()],id:[qn,[],t=>t.id()],zoom:[_n,[],t=>t.globals.zoom],pitch:[_n,[],t=>t.globals.pitch||0],"distance-from-center":[_n,[],t=>t.distanceFromCenter()],"heatmap-density":[_n,[],t=>t.globals.heatmapDensity||0],"line-progress":[_n,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[_n,[],t=>t.globals.skyRadialProgress||0],accumulated:[qn,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[_n,Ao(_n),(t,e)=>{let i=0;for(const n of e)i+=n.evaluate(t);return i}],"*":[_n,Ao(_n),(t,e)=>{let i=1;for(const n of e)i*=n.evaluate(t);return i}],"-":{type:_n,overloads:[[[_n,_n],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[_n],(t,[e])=>-e.evaluate(t)]]},"/":[_n,[_n,_n],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[_n,[_n,_n],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[_n,[],()=>Math.LN2],pi:[_n,[],()=>Math.PI],e:[_n,[],()=>Math.E],"^":[_n,[_n,_n],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[_n,[_n],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[_n,[_n],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[_n,[_n],(t,[e])=>Math.log(e.evaluate(t))],log2:[_n,[_n],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[_n,[_n],(t,[e])=>Math.sin(e.evaluate(t))],cos:[_n,[_n],(t,[e])=>Math.cos(e.evaluate(t))],tan:[_n,[_n],(t,[e])=>Math.tan(e.evaluate(t))],asin:[_n,[_n],(t,[e])=>Math.asin(e.evaluate(t))],acos:[_n,[_n],(t,[e])=>Math.acos(e.evaluate(t))],atan:[_n,[_n],(t,[e])=>Math.atan(e.evaluate(t))],min:[_n,Ao(_n),(t,e)=>Math.min(...e.map(e=>e.evaluate(t)))],max:[_n,Ao(_n),(t,e)=>Math.max(...e.map(e=>e.evaluate(t)))],abs:[_n,[_n],(t,[e])=>Math.abs(e.evaluate(t))],round:[_n,[_n],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[_n,[_n],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[_n,[_n],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[In,[Pn,qn],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[In,[qn],(t,[e])=>t.id()===e.value],"filter-type-==":[In,[Pn],(t,[e])=>t.geometryType()===e.value],"filter-<":[In,[Pn,qn],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<r}],"filter-id-<":[In,[qn],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<n}],"filter->":[In,[Pn,qn],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>r}],"filter-id->":[In,[qn],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>n}],"filter-<=":[In,[Pn,qn],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n<=r}],"filter-id-<=":[In,[qn],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i<=n}],"filter->=":[In,[Pn,qn],(t,[e,i])=>{const n=t.properties()[e.value],r=i.value;return typeof n==typeof r&&n>=r}],"filter-id->=":[In,[qn],(t,[e])=>{const i=t.id(),n=e.value;return typeof i==typeof n&&i>=n}],"filter-has":[In,[qn],(t,[e])=>e.value in t.properties()],"filter-has-id":[In,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[In,[Ln(Pn)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[In,[Ln(qn)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[In,[Pn,Ln(qn)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[In,[Pn,Ln(qn)],(t,[e,i])=>function(t,e,i,n){for(;i<=n;){const r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:In,overloads:[[[In,In],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Ao(In),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:In,overloads:[[[In,In],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Ao(In),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[In,[In],(t,[e])=>!e.evaluate(t)],"is-supported-script":[In,[Pn],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[Pn,[Pn],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Pn,[Pn],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Pn,Ao(qn),(t,e)=>e.map(e=>tr(e.evaluate(t))).join("")],"resolved-locale":[Pn,[Rn],(t,[e])=>e.evaluate(t).resolvedLocale()]});class Co{constructor(t,e){this.expression=t,this.D={},this.U=new cr,this.W=e?function(t){return"color"===t.type&&_o(t.default)?new Gn(0,0,0,0):"color"===t.type?Gn.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this.J=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,n,r,o,s,a){return this.U.globals=t,this.U.feature=e,this.U.featureState=i,this.U.canonical=n||null,this.U.availableImages=r||null,this.U.formattedSection=o,this.U.featureTileCoord=s||null,this.U.featureDistanceData=a||null,this.expression.evaluate(this.U)}evaluate(t,e,i,n,r,o,s,a){this.U.globals=t,this.U.feature=e||null,this.U.featureState=i||null,this.U.canonical=n||null,this.U.availableImages=r||null,this.U.formattedSection=o||null,this.U.featureTileCoord=s||null,this.U.featureDistanceData=a||null;try{const t=this.expression.evaluate(this.U);if(null==t||"number"==typeof t&&t!=t)return this.W;if(this.J&&!(t in this.J))throw new ir(`Expected value to be one of ${Object.keys(this.J).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this.D[t.message]||(this.D[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this.W}}}function No(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in xo}function Lo(t,e){const i=new Or(xo,[],e?function(t){const e={color:On,string:Pn,number:_n,enum:Pn,boolean:In,formatted:Cn,resolvedImage:Nn};return"array"===t.type?Ln(e[t.value]||qn,t.length):e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Fo(new Co(n,e)):To(i.errors)}class Do{constructor(t,e){this.kind=t,this.H=e,this.isStateDependent="constant"!==t&&!_r(e.expression)}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this.H.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this.H.evaluate(t,e,i,n,r,o)}}class Uo{constructor(t,e,i,n){this.kind=t,this.zoomStops=i,this.H=e,this.isStateDependent="camera"!==t&&!_r(e.expression),this.interpolationType=n}evaluateWithoutErrorHandling(t,e,i,n,r,o){return this.H.evaluateWithoutErrorHandling(t,e,i,n,r,o)}evaluate(t,e,i,n,r,o){return this.H.evaluate(t,e,i,n,r,o)}interpolationFactor(t,e,i){return this.interpolationType?Qr.interpolationFactor(this.interpolationType,t,e,i):0}}function $o(t,e){if("error"===(t=Lo(t,e)).result)return t;const i=t.value.expression,n=Sr(i);if(!n&&!function(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}(e))return To([new Tn("","data expressions not supported")]);const r=Pr(i,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return To([new Tn("","zoom expressions not supported")]);const o=function t(e){let i=null;if(e instanceof io)i=t(e.result);else if(e instanceof eo){for(const n of e.args)if(i=t(n),i)break}else(e instanceof qr||e instanceof Qr)&&e.input instanceof hr&&"zoom"===e.input.name&&(i=e);return i instanceof Tn||e.eachChild(e=>{const n=t(e);n instanceof Tn?i=n:!i&&n?i=new Tn("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):i&&n&&i!==n&&(i=new Tn("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),i}(i);if(!o&&!r)return To([new Tn("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(o instanceof Tn)return To([o]);if(o instanceof Qr&&!zo(e))return To([new Tn("",\'"interpolate" expressions cannot be used with this property\')]);if(!o)return Fo(new Do(n?"constant":"source",t.value));const s=o instanceof Qr?o.interpolation:void 0;return Fo(new Uo(n?"camera":"composite",t.value,o.labels,s))}class Wo{constructor(t,e){this.G=t,this.V=e,Fn(this,function t(e,i){const n="color"===i.type,r=e.stops&&"object"==typeof e.stops[0][0],o=r||!(r||void 0!==e.property),s=e.type||(zo(i)?"exponential":"interval");if(n&&((e=Fn({},e)).stops&&(e.stops=e.stops.map(t=>[t[0],Gn.parse(t[1])])),e.default=Gn.parse(e.default?e.default:i.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!Kr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);let a,l,u;if("exponential"===s)a=qo;else if("interval"===s)a=Eo;else if("categorical"===s){a=Oo,l=Object.create(null);for(const t of e.stops)l[t[0]]=t[1];u=typeof e.stops[0][0]}else{if("identity"!==s)throw new Error(`Unknown function type "${s}"`);a=Ro}if(r){const n={},r=[];for(let t=0;t<e.stops.length;t++){const i=e.stops[t],o=i[0].zoom;void 0===n[o]&&(n[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},r.push(o)),n[o].stops.push([i[0].value,i[1]])}const o=[];for(const e of r)o.push([n[e].zoom,t(n[e],i)]);const s={name:"linear"};return{kind:"composite",interpolationType:s,interpolationFactor:Qr.interpolationFactor.bind(void 0,s),zoomStops:o.map(t=>t[0]),evaluate:({zoom:t},n)=>qo({stops:o,base:e.base},i,t).evaluate(t,n)}}if(o){const t="exponential"===s?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:t,interpolationFactor:Qr.interpolationFactor.bind(void 0,t),zoomStops:e.stops.map(t=>t[0]),evaluate:({zoom:t})=>a(e,i,t,l,u)}}return{kind:"source",evaluate(t,n){const r=n&&n.properties?n.properties[e.property]:void 0;return void 0===r?Io(e.default,i.default):a(e,i,r,l,u)}}}(this.G,this.V))}static deserialize(t){return new Wo(t.G,t.V)}static serialize(t){return{G:t.G,V:t.V}}}function Jo(t){if(Array.isArray(t))return t.map(Jo);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Jo(t[i]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function Ho(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(!Ho(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function Go(t){if(!Array.isArray(t))return!1;if(function(t){return"pitch"===t||"distance-from-center"===t}(t[0]))return!0;for(let e=1;e<t.length;e++)if(Go(t[e]))return!0;return!1}const Vo=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Bo(t,e){return t<e?-1:t>e?1:0}function Xo(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?Zo(t[1],t[2],"=="):"!="===e?Qo(Zo(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Zo(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(Xo))):"all"===e?["all"].concat(t.slice(1).map(Xo)):"none"===e?["all"].concat(t.slice(1).map(Xo).map(Qo)):"in"===e?Yo(t[1],t.slice(2)):"!in"===e?Qo(Yo(t[1],t.slice(2))):"has"===e?Ko(t[1]):"!has"===e?Qo(Ko(t[1])):"within"!==e||t;var i}function Zo(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function Yo(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(Bo)]]:["filter-in-small",t,["literal",e]]}}function Ko(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Qo(t){return["!",t]}xn((function(t,e){var i=function(){var t=function(t,e,i,n){for(i=i||{},n=t.length;n--;i[t[n]]=e);return i},e=[1,12],i=[1,13],n=[1,9],r=[1,10],o=[1,11],s=[1,14],a=[1,15],l=[14,18,22,24],u=[18,22],c=[22,24],h={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(t,e,i,n,r,o,s){var a=o.length-1;switch(r){case 1:this.$=new String(t.replace(/\\\\(\\\\|")/g,"$1").replace(/\\\\n/g,"\\n").replace(/\\\\r/g,"\\r").replace(/\\\\t/g,"\\t").replace(/\\\\v/g,"\\v").replace(/\\\\f/g,"\\f").replace(/\\\\b/g,"\\b")),this.$.B=this.X.first_line;break;case 2:this.$=new Number(t),this.$.B=this.X.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.B=this.X.first_line;break;case 5:this.$=new Boolean(!1),this.$.B=this.X.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"B",{value:this.X.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"B",{value:this.X.first_line,enumerable:!1});break;case 15:this.$=[o[a-2],o[a]];break;case 16:this.$={},this.$[o[a][0]]=o[a][1];break;case 17:this.$=o[a-2],o[a-2][o[a][0]]=o[a][1];break;case 18:this.$=[],Object.defineProperty(this.$,"B",{value:this.X.first_line,enumerable:!1});break;case 20:this.$=[o[a]];break;case 21:this.$=o[a-2],o[a-2].push(o[a])}},table:[{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,12:1,13:2,15:7,16:8,17:s,23:a},{1:[3]},{14:[1,16]},t(l,[2,7]),t(l,[2,8]),t(l,[2,9]),t(l,[2,10]),t(l,[2,11]),t(l,[2,12]),t(l,[2,3]),t(l,[2,4]),t(l,[2,5]),t([14,18,21,22,24],[2,1]),t(l,[2,2]),{3:20,4:e,18:[1,17],19:18,20:19},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:23,15:7,16:8,17:s,23:a,24:[1,21],25:22},{1:[2,6]},t(l,[2,13]),{18:[1,24],22:[1,25]},t(u,[2,16]),{21:[1,26]},t(l,[2,18]),{22:[1,28],24:[1,27]},t(c,[2,20]),t(l,[2,14]),{3:20,4:e,20:29},{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:30,15:7,16:8,17:s,23:a},t(l,[2,19]),{3:5,4:e,5:6,6:i,7:3,8:n,9:4,10:r,11:o,13:31,15:7,16:8,17:s,23:a},t(u,[2,17]),t(u,[2,15]),t(c,[2,21])],defaultActions:{16:[2,6]},parseError:function(t,e){if(!e.recoverable)throw new Error(t);this.trace(t)},parse:function(t){var e=this,i=[0],n=[null],r=[],o=this.table,s="",a=0,l=0,u=2,c=1,h=r.slice.call(arguments,1),d=Object.create(this.lexer),f={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(f.yy[p]=this.yy[p]);d.setInput(t,f.yy),f.yy.lexer=d,f.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var m=d.yylloc;r.push(m);var y=d.options&&d.options.ranges;function g(){var t;return"number"!=typeof(t=d.lex()||c)&&(t=e.symbols_[t]||t),t}this.parseError="function"==typeof f.yy.parseError?f.yy.parseError:Object.getPrototypeOf(this).parseError;for(var b,v,w,x,k,M,j,A={};;){if(this.defaultActions[v=i[i.length-1]]?w=this.defaultActions[v]:(null==b&&(b=g()),w=o[v]&&o[v][b]),void 0===w||!w.length||!w[0]){var F="";for(k in j=[],o[v])this.terminals_[k]&&k>u&&j.push("\'"+this.terminals_[k]+"\'");F=d.showPosition?"Parse error on line "+(a+1)+":\\n"+d.showPosition()+"\\nExpecting "+j.join(", ")+", got \'"+(this.terminals_[b]||b)+"\'":"Parse error on line "+(a+1)+": Unexpected "+(b==c?"end of input":"\'"+(this.terminals_[b]||b)+"\'"),this.parseError(F,{text:d.match,token:this.terminals_[b]||b,line:d.yylineno,loc:m,expected:j})}if(w[0]instanceof Array&&w.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+b);switch(w[0]){case 1:i.push(b),n.push(d.yytext),r.push(d.yylloc),i.push(w[1]),b=null,l=d.yyleng,s=d.yytext,a=d.yylineno,m=d.yylloc;break;case 2:if(A.$=n[n.length-(M=this.productions_[w[1]][1])],A.X={first_line:r[r.length-(M||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(M||1)].first_column,last_column:r[r.length-1].last_column},y&&(A.X.range=[r[r.length-(M||1)].range[0],r[r.length-1].range[1]]),void 0!==(x=this.performAction.apply(A,[s,l,a,f.yy,w[1],n,r].concat(h))))return x;M&&(i=i.slice(0,-1*M*2),n=n.slice(0,-1*M),r=r.slice(0,-1*M)),i.push(this.productions_[w[1]][0]),n.push(A.$),r.push(A.X),i.push(o[i[i.length-2]][i[i.length-1]]);break;case 3:return!0}}return!0}};function d(){this.yy={}}return h.lexer={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this.Z=t,this.Y=this.K=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this.Z[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\\r\\n?|\\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this.Z=this.Z.slice(1),t},unput:function(t){var e=t.length,i=t.split(/(?:\\r\\n?|\\n)/g);this.Z=t+this.Z,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\\r\\n?|\\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this.Y=!0,this},reject:function(){return this.options.backtrack_lexer?(this.K=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this.Z.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\\n"+e+"^"},test_match:function(t,e){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,Y:this.Y,Z:this.Z,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(n=t[0].match(/(?:\\r\\n?|\\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\\r?\\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this.Y=!1,this.K=!1,this.Z=this.Z.slice(t[0].length),this.matched+=t[0],i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this.Z&&(this.done=!1),i)return i;if(this.K){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,i,n;this.Z||(this.done=!0),this.Y||(this.yytext="",this.match="");for(var r=this.tt(),o=0;o<r.length;o++)if((i=this.Z.match(this.rules[r[o]]))&&(!e||i[0].length>e[0].length)){if(e=i,n=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(i,r[o])))return t;if(this.K){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[n]))&&t:""===this.Z?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},tt:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,i,n){switch(i){case 0:break;case 1:return 6;case 2:return e.yytext=e.yytext.substr(1,e.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\\.[0-9]+)?([eE][-+]?[0-9]+)?\\b)/,/^(?:"(?:\\\\[\\\\"bfnrt/]|\\\\u[a-fA-F0-9]{4}|[^\\\\\\0-\\x09\\x0a-\\x1f"])*")/,/^(?:\\{)/,/^(?:\\})/,/^(?:\\[)/,/^(?:\\])/,/^(?:,)/,/^(?::)/,/^(?:true\\b)/,/^(?:false\\b)/,/^(?:null\\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}},d.prototype=h,h.Parser=d,new d}();e.parser=i,e.Parser=i.Parser,e.parse=function(){return i.parse.apply(i,arguments)}}));const ts={StyleExpression:Co,isExpression:No,isExpressionFilter:Ho,createExpression:Lo,createPropertyExpression:$o,normalizePropertyExpression:function(t,e){if(_o(t))return new Wo(t,e);if(No(t)){const i=$o(t,e);if("error"===i.result)throw new Error(i.value.map(t=>`${t.key}: ${t.message}`).join(", "));return i.value}{let i=t;return"string"==typeof t&&"color"===e.type&&(i=Gn.parse(t)),{kind:"constant",evaluate:()=>i}}},ZoomConstantExpression:Do,ZoomDependentExpression:Uo,StylePropertyFunction:Wo},{isExpressionFilter:es,isExpression:is,createExpression:ns}=ts,rs={};function os(t){if(!0===t)return function(){return!0};if(t&&t.condition){if("any"===t.type){const e=t.condition,i=[];for(let t=0;t<e.length;t++)i.push(os(e[t]));return t=>{for(let e=0;e<i.length;e++)if(i[e](t))return!0;return!1}}const e=os(t.condition);if(Zi(t.layer))return e;const i=e=>e.layer===t.layer;return t=>i(t)&&e(t)}if(es(t)){let e=function(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Ho(t)||(t=Xo(t));const i=t;let n=!0;try{n=function(t){if(!Go(t))return t;let e=Jo(t);return function t(e){let i=!1;const n=[];if("case"===e[0]){for(let t=1;t<e.length-1;t+=2)i=i||Go(e[t]),n.push(e[t+1]);n.push(e[e.length-1])}else if("match"===e[0]){i=i||Go(e[1]);for(let t=2;t<e.length-1;t+=2)n.push(e[t+1]);n.push(e[e.length-1])}else if("step"===e[0]){i=i||Go(e[1]);for(let t=1;t<e.length-1;t+=2)n.push(e[t+1])}i&&(e.length=0,e.push("any",...n));for(let i=1;i<e.length;i++)t(e[i])}(e),e=function t(e){if(!Array.isArray(e))return e;const i=function(t){if(Vo.has(t[0]))for(let e=1;e<t.length;e++)if(Go(t[e]))return!0;return t}(e);return!0===i?i:i.map(e=>t(e))}(e),e}(i)}catch(t){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\\nand paste the contents of this message in the report.\\nThank you!\\nFilter Expression:\\n${JSON.stringify(i,null,2)}\\n `)}const r=vn["filter_"+e],o=Lo(n,r);let s=null;if("error"===o.result)throw new Error(o.value.map(t=>`${t.key}: ${t.message}`).join(", "));s=(t,e,i)=>o.value.evaluate(t,e,{},i);let a=null,l=null;if(n!==i){const t=Lo(i,r);if("error"===t.result)throw new Error(t.value.map(t=>`${t.key}: ${t.message}`).join(", "));a=(e,i,n,r,o)=>t.value.evaluate(e,i,{},n,void 0,void 0,r,o),l=!Sr(t.value.expression)}return s=s,{filter:s,dynamicFilter:a||void 0,needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let i=1;i<e.length;i++)if(t(e[i]))return!0;return!1}(n),needFeature:!!l}}(t);return e=e&&e.filter,t=>e&&e(rs,t)}return Lt(t)}const ss={type:"string","property-type":"data-driven",expression:{parameters:["zoom","feature"]}};function as(t){const e=ns(t,ss);if("success"!==e.result)throw new Error(`Invalid maplibre spec expression: ${JSON.stringify(t)} (${e.value})`);return e.value}function ls(t){return is(t)}var us=Object.freeze({__proto__:null,compileStyle:function(t){return function t(e){if(!Array.isArray(e))return t([e]);const i=[];for(let t=0;t<e.length;t++){let n;n=!0===e[t].filter?function(){return!0}:os(e[t].filter),i.push(Xi({},e[t],{filter:n}))}return i}(t=t.map(t=>{const e=Xi({},t);return e.filter&&e.filter.value&&(e.filter=e.filter.value),e}))},compileFilter:os,createExpression:as,isExpression:ls});const cs={lineWidth:1,lineStrokeWidth:1,lineDx:1,lineDy:1,lineOpacity:1,linePatternAnimSpeed:1,markerWidth:1,markerHeight:1,markerDx:1,markerDy:1,markerSpacing:1,markerOpacity:1,markerRotation:1,textWrapWidth:1,textSpacing:1,textSize:1,textHaloRadius:1,textHaloOpacity:1,textDx:1,textDy:1,textOpacity:1,textRotation:1,polygonOpacity:1},hs=[];class ds{static isAtlasLoaded(t,e={}){const{iconAtlas:i}=e;return!!(!t||i&&i.positions[t])}static genFnTypes(t){const e={};for(const i in t)if(ls(t[i])){const n=(i+"_Fn_0").trim(),r=(i+"Fn").trim();e[n]=as(t[i]);const o={},s={},a={},l=null,u=[];e[r]=(t,i)=>(o.zoom=t,s.properties=i,e[n].evaluateWithoutErrorHandling(o,s,a,l,u))}else if(on(t[i])){const n=(i+"_Fn_0").trim(),r=(i+"Fn").trim();cs[i]?(e[n]=a(t[i]),e[r]=(t,i)=>{const r=e[n](t,i);return on(r)?a(r)(t,i):r}):(e[n]=l(t[i]),e[r]=(t,i)=>{const r=e[n](t,i);return on(r)?l(r)(t,i):r})}return e}constructor(t,e,i){this.options=i,this.symbolDef=e,this.symbol=u(e,()=>[i.zoom]),this.styledVectors=[],this.properties={},this.et=ds.genFnTypes(this.symbolDef),on(this.symbolDef.visible)&&(this.it=a(this.symbolDef.visible)),i.atlas&&(this.iconAtlas=i.atlas.iconAtlas,this.glyphAtlas=i.atlas.glyphAtlas),this.features=this.nt(t)}needAltitudeAttribute(){return this.options.forceAltitudeAttribute||this.maxPosZ>=Math.pow(2,17)||this.options.positionType===Float32Array}getPositionFormat(){return this.needAltitudeAttribute()?[{type:Int16Array,width:2,name:"aPosition"},{type:Float32Array,width:1,name:"aAltitude"}]:[{type:Int16Array,width:3,name:"aPosition"}]}fillPosition(t,e,i,n){this.needAltitudeAttribute()?(t.aPosition.push(e,i),t.aAltitude.push(n)):(yn(hs,e,i,n),t.aPosition.push(...hs))}nt(t){if(!t.length)return t;const e="__fea_idx".trim();let i,n=0,r=t[n];for(;!r.geometry;)n++,r=t[n];if(Array.isArray(r.geometry)&&r.properties){let e=r.geometry[0];for(;Array.isArray(e);)e=e[0];e instanceof Ot&&(i=t)}if(!i)if(i=[],Array.isArray(r.geometry))for(let e=0;e<t.length;e++){const n=Xi({},t[e]);i.push(Bi(n))}else for(let n=0;n<t.length;n++){const r=t[n],o=Si(r);for(let t=0;t<o.length;t++){const n=o[t];n[e]=r[e],i.push(n)}}if(this.maxPosZ=0,!this.options.forceAltitudeAttribute){const t="line"===this.symbolDef.textPlacement;let e=0,n=!1;const{textPitchAlignmentFn:r}=this.et;!r&&t&&"map"===this.symbolDef.textPitchAlignment&&(n=!0);for(let o=0;o<i.length;o++){const s=ps(i[o]&&i[o].geometry);if(s>e&&(e=s),t&&!n&&r&&i[o].properties){const t=r(null,i[o].properties);"map"===t&&(n=t)}}this.hasMapPitchAlign=n,this.maxPosZ=e}const o=this.options.order;if(o){const t=[];for(let e=0;e<o.length;e++)o[e]&&t.push(os(o[e]));i=i.sort((e,i)=>{const n=t.length;let r=n,o=n;for(let s=0;s<n&&(t[s](e)&&(r=s),t[s](i)&&(o=s),!(r<n&&o<n));s++);return r-o})}return i}load(t=1){const e="__fea_idx".trim(),i="_debug_info".trim(),n=this.et,r=this.styledVectors;this.count=0;const o=this.features;if(!o||!o.length)return Promise.resolve(null);const s={},a={},l={zoom:this.options.zoom},c=u(this.symbolDef,()=>[l.zoom]);let h=0,d=o.length;const f=this.options.debugIndex;try{for(;h<d;h++){const t=o[h];if(!t||!t.geometry)continue;if(void 0!==f&&t[i].index!==f)continue;t.properties||(t.properties={}),t.properties.$layer=t.layer,t.properties.$type=t.type;const u=this.createStyledVector(t,c,n,l,s,a);u&&u.feature.geometry&&(u.featureIdx=void 0===t[e]?h:t[e],this.count++,r.push(u))}}catch(t){return Promise.reject(t)}return this.options.atlas?Promise.resolve(this.pack(t)):this.loadAtlas(s,a).then(()=>this.pack(t))}loadAtlas(t,e){return new Promise((i,n)=>{this.fetchAtlas(t,e,(t,e)=>{if(t)n(t);else{if(e){const{icons:t,glyphs:i}=e;if(t&&Object.keys(t).length){for(const e in t){const i=t[e],{width:n,height:r,data:o}=i.data;i.data=new Li({width:n,height:r},o)}this.iconAtlas=new Ui(t)}if(i&&Object.keys(i).length){for(const t in i){const e=i[t];for(const t in e){const i=e[t],{width:n,height:r,data:o}=i.bitmap;i.bitmap=new Ni({width:n,height:r},o)}}this.glyphAtlas=new Ji(i)}}i({glyphAtlas:this.glyphAtlas,iconAtlas:this.iconAtlas})}})})}fetchAtlas(t,e,i){Object.keys(t).length>0||Object.keys(e).length>0?this.options.requestor(t,e,i):i()}pack(t){if(!this.count)return null;if(null==t)throw new Error("layout scale is undefined");const e=this.createDataPack(this.styledVectors,t);if(!e)return null;e.properties=this.properties,this.empty&&(e.empty=!0);const i=e.buffers;delete e.buffers;const n={data:e,buffers:i};if(this.iconAtlas){const t=n.data.iconAtlas=fs(this.iconAtlas);if(t.glyphMap)for(const e in t.glyphMap)i.push(t.glyphMap[e].data.data.buffer);i.push(n.data.iconAtlas.image.data.buffer)}return this.glyphAtlas&&(n.data.glyphAtlas=fs(this.glyphAtlas),i.push(n.data.glyphAtlas.image.data.buffer)),n}createStyledVector(t,e,i,n){return new mn(t,e,i,n)}createDataPack(t,e){if(!t||!t.length)return null;this.maxIndex=0,this.maxPos=0,this.maxAltitude=0;const i=this.data={};let n=this.elements=[];const r=this.getFormat(Array.isArray(t[0])?t[0][0].symbol:t[0].symbol),o=this.needAltitudeAttribute()?2:3;for(let t=0;t<r.length;t++)i[r[t].name]=[];let s=[],a=0;const l=[];let u=0,c=!1;for(let n=0,r=t.length;n<r;n++){if(!t[n].feature.geometry)continue;const r=Array.isArray(t[n])?t[n][0].feature.id:t[n].feature.id;Yi(r)&&(Math.abs(r)>u&&(u=Math.abs(r)),r<0&&(c=!0));const h=this.data.aPosition.length;if(Array.isArray(t[n]))for(let i=0;i<t[n].length;i++)this.rt(t[n][i],e);else this.rt(t[n],e);const d=(i.aPosition.length-h)/o;for(let e=0;e<d;e++)s.push(t[n].featureIdx),Yi(r)&&l.push(r);a=Math.max(a,t[n].featureIdx)}if(this.hasElements()&&!n.length)return null;s=new(Vi(a))(s),r[0].type=this.options.positionType?this.options.positionType:Gi(this.maxPos);const h=this.options.center;if(h&&(h[0]||h[1])){const t=i.aPosition;for(let e=0;e<t.length;e+=o)t[e]-=h[0],t[e+1]-=h[1]}const d=function(t,e){const i={};for(let n=0;n<t.length;n++){const r=t[n],o=r.type,s=r.name;i[s]=o===Array?e[s]:new o(e[s])}return i}(r,i);d.aPickingId=s;const f=[];for(const t in d)f.push(d[t].buffer);n=new(Hi(this.maxIndex))(n),f.push(n.buffer);const p={data:d,indices:this.hasElements()?n:null,positionSize:o,buffers:f,symbolIndex:this.symbolDef.index||{index:0}};if(l.length){const t=c?Gi(u):Vi(u);p.featureIds=new t(l),f.push(p.featureIds.buffer)}else p.featureIds=[];return p}rt(t,e){this.it&&this.it.isZoomConstant&&!this.it(null,t.feature.properties)||this.placeVector(t,e,this.formatWidth)}addElements(...t){this.maxIndex=Math.max(this.maxIndex,...t),this.elements.push(...t)}hasElements(){return!0}getAltitude(t){const{altitudeProperty:e,defaultAltitude:i,altitudeScale:n}=this.options;let r=cn(t,e,i);return n&&(r*=n),this.maxAltitude=Math.max(this.maxAltitude,Math.abs(r)),r}getIconAtlasMaxValue(){const t=this.iconAtlas.positions;let e=0;for(const i in t)if(nn(t,i)){const{tl:n,displaySize:r}=t[i],o=Math.max(n[0],n[1],r[0]-1,r[1]-1);o>e&&(e=o)}return e}}function fs(t){let e=t.positions,i=t.image&&t.image.format||"alpha";if(t instanceof Ui){e={};for(const i in t.positions){const n=t.positions[i];e[i]={paddedRect:n.paddedRect,pixelRatio:n.pixelRatio,tl:n.tl,br:n.br,displaySize:n.displaySize}}i="rgba"}const n=t.image;return{image:{width:n.width,height:n.height,data:n.data,format:i},glyphMap:t.glyphMap,positions:e}}function ps(t){if(!t)return 0;let e=0;if(Array.isArray(t))for(let i=0;i<t.length;i++)if(Array.isArray(t[i])){const n=ps(t[i]);n>e&&(e=n)}else{const n=Math.abs(t[i].z||0);n>e&&(e=n)}else{const i=Math.abs(t.z||0);i>e&&(e=i)}return e}function ms(t,e,i,n){const r="__fn_textSize".trim();let o=t.textSize;if(Zi(e.textSize))return[16,16];t[r]&&(o=t[r]);const s=[];return s[0]=tn(o)?o(n,i):o,s[1]=s[0],s}function ys(t){const e=t.stops;let i=-1/0;for(let t=0;t<e.length;t++){let n=e[t][1];Ki(e[t][1])&&(n=ys(e[t][1])),n>i&&(i=n)}return i}function gs(t,e,i){return[e||"normal",i||"normal","24px",t||"monospace"].join(" ")}const bs=/\\{[\\w-]+(?:\\|[\\w-]+)*\\}/g;function vs(t,e){return Qi(t)?t.replace(bs,(function(t){if(!e)return"";if((t=t.substring(1,t.length-1)).indexOf("|")>0){const i=t.split("|");for(let t=0;t<i.length;t++){const n=e[i[t]];if(!Zi(n))return n}return""}const i=e[t];return Zi(i)?"":Array.isArray(i)?i.join():i})):t}Object.freeze({__proto__:null,getSDFFont:gs,resolveText:vs});const ws=t=>t>=11904&&t<=12031,xs=t=>t>=12032&&t<=12255,ks=t=>t>=12272&&t<=12287,Ms=t=>t>=12288&&t<=12351,js=t=>t>=12352&&t<=12447,As=t=>t>=12448&&t<=12543,Fs=t=>t>=12544&&t<=12591,Ts=t=>t>=12704&&t<=12735,zs=t=>t>=12736&&t<=12783,Ss=t=>t>=12784&&t<=12799,_s=t=>t>=12800&&t<=13055,Ps=t=>t>=13056&&t<=13311,Is=t=>t>=13312&&t<=19903,Os=t=>t>=19968&&t<=40959,Es=t=>t>=40960&&t<=42127,qs=t=>t>=42128&&t<=42191,Rs=t=>t>=63744&&t<=64255,Cs=t=>t>=64336&&t<=65023,Ns=t=>t>=65040&&t<=65055,Ls=t=>t>=65072&&t<=65103,Ds=t=>t>=65104&&t<=65135,Us=t=>t>=65136&&t<=65279,$s=t=>t>=65280&&t<=65519;function Ws(t){return!((t=>t>=1536&&t<=1791)(t)||(t=>t>=1872&&t<=1919)(t)||(t=>t>=2208&&t<=2303)(t)||Cs(t)||Us(t))}function Js(t){return!!(746===t||747===t||!(t<4352)&&(Ts(t)||Fs(t)||Ls(t)&&!(t>=65097&&t<=65103)||Rs(t)||Ps(t)||ws(t)||zs(t)||!(!Ms(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Is(t)||Os(t)||_s(t)||(t=>t>=12592&&t<=12687)(t)||(t=>t>=43360&&t<=43391)(t)||(t=>t>=55216&&t<=55295)(t)||(t=>t>=4352&&t<=4607)(t)||(t=>t>=44032&&t<=55215)(t)||js(t)||ks(t)||(t=>t>=12688&&t<=12703)(t)||xs(t)||Ss(t)||As(t)&&12540!==t||!(!$s(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Ds(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(t=>t>=5120&&t<=5759)(t)||(t=>t>=6320&&t<=6399)(t)||Ns(t)||(t=>t>=19904&&t<=19967)(t)||Es(t)||qs(t)))}function Hs(t){return!(Js(t)||function(t){return!!((t=>t>=128&&t<=255)(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||(t=>t>=8192&&t<=8303)(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||(t=>t>=8448&&t<=8527)(t)||(t=>t>=8528&&t<=8591)(t)||(t=>t>=8960&&t<=9215)(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||(t=>t>=9216&&t<=9279)(t)&&9251!==t||(t=>t>=9280&&t<=9311)(t)||(t=>t>=9312&&t<=9471)(t)||(t=>t>=9632&&t<=9727)(t)||(t=>t>=9728&&t<=9983)(t)&&!(t>=9754&&t<=9759)||(t=>t>=11008&&t<=11263)(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Ms(t)||As(t)||(t=>t>=57344&&t<=63743)(t)||Ls(t)||Ds(t)||$s(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Gs(t){return t>=1424&&t<=2303||Cs(t)||Us(t)}const Vs=[[9,9],[32,32],[5760,5760],[8192,8198],[8200,8202],[8287,12288],[6158,6158],[8203,8205]];function Bs(t){for(const e of Vs)if(t>=e[0]&&t<=e[1])return!0;return!1}const Xs={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\\\":"\","]":"﹈","^":"^",ot:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Zs(t,e,i,n,r,o,s,a,l,u){let c=t.trim();2===u&&(c=function(t){let e="";for(let i=0;i<t.length;i++){const n=t.charCodeAt(i+1)||null,r=t.charCodeAt(i-1)||null;e+=n&&Hs(n)&&!Xs[t[i+1]]||r&&Hs(r)&&!Xs[t[i-1]]||!Xs[t[i]]?t[i]:Xs[t[i]]}return e}(c));const h=[],d={positionedGlyphs:h,text:c,top:a[1],bottom:a[1],left:a[0],right:a[0],writingMode:u};let f;return f=function(t,e){const i=[];let n=0;for(let r=0;r<e.length;r++){const o=e[r];i.push(t.substring(n,o)),n=o}return n<t.length&&i.push(t.substring(n,t.length)),i}(c,function(t,e,i,n){if(!i)return[];if(!t)return[];const r=[],o=function(t,e,i,n){let r=0;for(let i=0;i<t.length;i++){const o=n[t.charCodeAt(i)];o&&(r+=o.metrics.advance+e)}return r/Math.max(1,Math.ceil(r/i))}(t,e,i,n);let s=0;for(let i=0;i<t.length;i++){const l=t.charCodeAt(i),u=n[l];u&&!Ys[l]&&(s+=u.metrics.advance+e),i<t.length-1&&(Ks[l]||!((a=l)<11904)&&(Ts(a)||Fs(a)||Ls(a)||Rs(a)||Ps(a)||ws(a)||zs(a)||Ms(a)||Is(a)||Os(a)||_s(a)||$s(a)||js(a)||ks(a)||xs(a)||Ss(a)||As(a)||Ns(a)||qs(a)||Es(a)))&&r.push(ea(i+1,s,o,r,ta(l,t.charCodeAt(i+1)),!1))}var a;return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(ea(t.length,s,o,r,0,!0))}(c,s,i,e)),function(t,e,i,n,r,o,s,a,l){let u=0,c=8,h=0;const d=t.positionedGlyphs,f="right"===o?1:"left"===o?0:.5;for(let t=0;t<i.length;t++){let r=i[t];if(r=r.trim(),!r.length){c-=n;continue}const o=d.length;for(let t=0;t<r.length;t++){const i=r.charCodeAt(t),n=e[i];n&&(Js(i)&&1!==s?(32!==i&&d.push({glyph:i,x:u,y:0,vertical:!0}),u+=l+a):(32!==i&&d.push({glyph:i,x:u,y:c,vertical:!1}),u+=n.metrics.advance+a))}d.length!==o&&(h=Math.max(u-a,h),na(d,e,o,d.length-1,f)),u=0,c-=n}const{horizontalAlign:p,verticalAlign:m}=ia(r);!function(t,e,i,n,r,o,s){const a=(e-i)*r,l=-(-n*s+.5)*o;if(a||l)for(let e=0;e<t.length;e++)t[e].x+=a,t[e].y+=l}(d,f,p,m,h,n,i.length);const y=i.length*n;t.top+=-m*y,t.bottom=t.top+y,t.left+=-p*h,t.right=t.left+h}(d,e,f,n,r,o,u,s,l),!!h.length&&d}const Ys={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ks={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Qs(t,e,i,n){const r=Math.pow(t-e,2);return n?t<e?r/2:2*r:r+Math.abs(i)*i}function ta(t,e){let i=0;return 10===t&&(i-=1e4),40!==t&&65288!==t||(i+=50),41!==e&&65289!==e||(i+=50),i}function ea(t,e,i,n,r,o){let s=null,a=Qs(e,i,r,o);for(let t=0;t<n.length;t++){const l=n[t],u=Qs(e-l.x,i,r,o)+l.badness;u<=a&&(s=l,a=u)}return{index:t,x:e,priorBreak:s,badness:a}}function ia(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 na(t,e,i,n,r){if(!r)return;const o=e[t[n].glyph];if(o){const e=(t[n].x+o.metrics.advance)*r;if(!e)return;for(let r=i;r<=n;r++)t[r].x-=e}}function ra(t){if(!function(t){for(const e of t)if(Gs(e.charCodeAt(0)))return!0;return!1}(t))return t;const e=[],i=[],n=[];let r=0,o=0,s=1,a=1;for(const l of t){const t=l.codePointAt(0);Bs(t)?(n.push(l),r++):(s=Gs(t)?-1:1,a!==s?(o=r,i.length&&(a>0&&i.reverse(),e.push(...i)),n.length&&(e.splice(o,0,...n),n.length=0),a=s,i.length=0):n.length&&(i.push(...n),n.length=0),i.push(l),r++)}return n.length&&i.push(...n),i.length&&(a>0&&i.reverse(),e.push(...i)),e.reverse().join("")}const oa=/\\{ *([\\w_]+) *\\}/g;class sa{constructor(t,e,i,n,r){this.feature=t,this.symbolDef=e,this.symbol=i,this.options=r,this.st=this.lt.bind(this),this.et=n}lt(t,e){return this.feature.properties[e]||"default"}getShape(t,e){if(this.ut)return this.ut;const{textHorizontalAlignmentFn:i,textVerticalAlignmentFn:n,markerHorizontalAlignmentFn:r,markerVerticalAlignmentFn:o,textWrapWidthFn:s}=this.et;let a;const l=this.symbol,u=this.getIconAndGlyph(),c=this.feature.properties;if(u&&u.glyph){const{font:t,text:r}=u.glyph;if(""===r)return null;const o=this.size[0]/24,h=24,d=l.textKeepUpright,f="map"===l.textRotationAlignment&&"line"===l.textPlacement&&!l.isIconText,p=e.glyphMap[t],m=aa(i?i(null,c):l.textHorizontalAlignment,n?n(null,c):l.textVerticalAlignment),y=1.2*h,g=function(t){for(let e=0;e<t.length;e++)if(!Ws(t.charAt(e).charCodeAt(0)))return!1;return!0}(r),b=g&&l.textLetterSpacing/o||0,v=[l.textDx/o||0,l.textDy/o||0],w=((s?s(null,c):l.textWrapWidth)||10*h)/o;a={},a.horizontal=Zs(r,p,w,y,m,"center",b,v,h,1),g&&f&&d&&(a.vertical=Zs(r,p,w,y,m,"center",b,v,h,2))}else if(u&&u.icon){if(!t.positions[u.icon.url])return null;const e=aa(r?r(null,c):l.markerHorizontalAlignment,o?o(null,c):l.markerVerticalAlignment);a=function(t,e){const{horizontalAlign:i,verticalAlign:n}=ia(e),r=-24*i,o=-24*n;return{image:t,top:o,bottom:o+24,left:r,right:r+24}}(t.positions[u.icon.url],e),this.size||(this.size=a.image.displaySize)}return this.ut=a,a}getIconAndGlyph(){if(this.iconGlyph)return this.iconGlyph;const{markerFileFn:t,markerTypeFn:e,markerPathFn:i,markerWidthFn:n,markerHeightFn:r,markerFillFn:o,markerFillPatternFileFn:l,markerFillOpacityFn:u,markerTextFitFn:c,markerTextFitPaddingFn:h,markerLineColorFn:d,markerLineWidthFn:f,markerLineOpacityFn:p,markerLineDasharrayFn:m,markerLinePatternFileFn:y,markerPathWidthFn:g,markerPathHeightFn:b,textNameFn:v,textFaceNameFn:w,textStyleFn:x,textWeightFn:k}=this.et,{zoom:M}=this.options,j={},A=this.symbol,F=this.feature.properties,T=t?t(null,F):A.markerFile,z=e?e(null,F):A.markerType,S=T||z||A.markerPath,_=!Zi(this.symbolDef.textName);let P;if(S){P=function(t,e,i,n,r,o){if(Zi(e.markerWidth)&&Zi(e.markerHeight))return null;const s="__fn_markerWidth".trim(),a="__fn_markerHeight".trim();let l=e.markerWidth||0,u=e.markerHeight||0;return Ki(l)&&("identity"!==l.type?l=ys(l):(l=t.markerWidth,t[s]&&(l=t[s](n,i)),Ki(l)&&(l="identity"===l.type?r(n,i):ys(l)))),Ki(u)&&("identity"!==u.type?u=ys(u):(u=t.markerHeight,t[a]&&(u=t[a](n,i)),Ki(u)&&(u="identity"===u.type?o(n,i):ys(u)))),[l,u]}(A,this.symbolDef,F,M,n,r)||[0,0];let t=A.markerTextFit;if(c&&(t=c(M,F)),t&&A.text&&"none"!==t){const e=A.text.textSize;let i=A.text.textName;s(i)&&(i=a(i)(M,F));const n=vs(i,F);if(n){const i="__fn_textSize".trim(),r="__fn_textSize_0".trim();s(e)&&!A.text[i]&&(A.text[r]=a(e),A.text[i]=(t,e)=>{const i=A.text[r](t,e);return s(i)?a(i)(t,e):i});const o=ms(A.text,A.text,F,M);if("width"!==t&&"both"!==t||(P[0]=o[0]*n.length),"height"!==t&&"both"!==t||(P[1]=o[1]),o[0]&&o[1]){let t=A.markerTextFitPadding||[0,0,0,0];h&&(t=h(M,F)),P[0]+=t[1]+t[3],P[1]+=t[0]+t[2]}}else P[0]=P[1]=-1}}if(_&&(P=ms(A,this.symbolDef,F,M)),!P)return j;if(P[0]=Math.ceil(P[0]),P[1]=Math.ceil(P[1]),this.size=P,S&&P[0]>=0&&P[1]>=0){let t;if(z){const e={};if(e.markerType=z,"path"===z&&(e.markerPath=i?i(null,F):A.markerPath,e.markerPathWidth=g?g(null,F):A.markerPathWidth,e.markerPathHeight=b?b(null,F):A.markerPathHeight),n){const t=n(null,F);Zi(t)||(e.markerWidth=t)}else A.markerWidth>=0&&(e.markerWidth=A.markerWidth);if(r){const t=r(null,F);Zi(t)||(e.markerHeight=t)}else A.markerHeight>=0&&(e.markerHeight=A.markerHeight);if(o){const t=o(null,F);Zi(t)||(e.markerFill=t)}else A.markerFill&&(e.markerFill=A.markerFill);if(l){const t=l(null,F);Zi(t)||(e.markerFillPatternFile=t)}else A.markerFillPatternFile&&(e.markerFillPatternFile=A.markerFillPatternFile);if(u){const t=u(null,F);Zi(t)||(e.markerFillOpacity=t)}else A.markerFillOpacity>=0&&(e.markerFillOpacity=A.markerFillOpacity);if(d){const t=d(null,F);Zi(t)||(e.markerLineColor=t)}else A.markerLineColor&&(e.markerLineColor=A.markerLineColor);if(f){const t=f(null,F);Zi(t)||(e.markerLineWidth=t)}else A.markerLineWidth>=0&&(e.markerLineWidth=A.markerLineWidth);if(p){const t=p(null,F);Zi(t)||(e.markerLineOpacity=t)}else A.markerLineOpacity>=0&&(e.markerLineOpacity=A.markerLineOpacity);if(m){const t=m(null,F);Zi(t)||(e.markerLineDasharray=t)}else A.markerLineDasharray&&(e.markerLineDasharray=A.markerLineDasharray);if(y){const t=y(null,F);Zi(t)||(e.markerLinePatternFile=t)}else A.markerLinePatternFile&&(e.markerLinePatternFile=A.markerLinePatternFile);t="vector://"+JSON.stringify(e)}else t=T?T.replace(oa,this.st):A.markerPath?function(t,e,i){if(!t.markerPath)return null;let n=1;const r=function(t){const e={stroke:{stroke:t.markerLineColor,"stroke-width":t.markerLineWidth,"stroke-opacity":t.markerLineOpacity,"stroke-dasharray":null,"stroke-linecap":"butt","stroke-linejoin":"round"},fill:{fill:t.markerFill,"fill-opacity":t.markerFillOpacity}};return 0===e.stroke["stroke-width"]&&(e.stroke["stroke-opacity"]=0),e}(t);Yi(t.markerOpacity)&&(n=t.markerOpacity),Yi(t.opacity)&&(n*=t.opacity);const o={};if(r){for(const t in r.stroke)nn(r.stroke,t)&&(Zi(r.stroke[t])||(o[t]=r.stroke[t]));for(const t in r.fill)nn(r.fill,t)&&(Zi(r.fill[t])||(o[t]=r.fill[t]))}const s=Array.isArray(t.markerPath)?t.markerPath:[t.markerPath];let a;const l=[];for(let t=0;t<s.length;t++)a=Qi(s[t])?{path:s[t]}:s[t],a=Xi({},a,o),a.d=a.path,delete a.path,l.push(a);const u=[\'<svg version="1.1"\',\'xmlns="http://www.w3.org/2000/svg"\'];n<1&&u.push(\'opacity="\'+n+\'"\'),t.markerPathWidth&&t.markerPathHeight&&u.push(\'viewBox="0 0 \'+t.markerPathWidth+" "+t.markerPathHeight+\'"\'),u.push(\'preserveAspectRatio="none"\'),e&&u.push(\'width="\'+e+\'"\'),i&&u.push(\'height="\'+i+\'"\'),u.push("><defs></defs>");for(let t=0;t<l.length;t++){let e="<path ";for(const i in l[t])nn(l[t],i)&&(e+=" "+i+\'="\'+l[t][i]+\'"\');e+="></path>",u.push(e)}return u.push("</svg>"),"data:image/svg+xml;base64,"+btoa(u.join(" "))}(A,P[0],P[1]):null;j.icon={url:t,size:P}}if(_){const t=v?v(this.options.zoom,F):A.textName;if(t||0===t){const e=gs(w?w(null,F):A.textFaceName,x?x(null,F):A.textStyle,k?k(null,F):A.textWeight);let i=vs(t,F);i&&i.length&&(i=ra(i),j.glyph={font:e,text:i})}}return this.iconGlyph=j,j}}function aa(t,e){e&&"middle"!==e||(e="center"),t&&"middle"!==t||(t="center");let i="center"!==e?e:"";return i+="center"!==t?(i.length?"-":"")+t:"",i\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */}function la(t,e,i,n,r){const o=[];let s;for(let a=0;a<t.length;a++){const l=t[a];let u,c=!1;for(let t=0;t<l.length-1;t++){let a=l[t],h=l[t+1];a.x<e&&h.x<e||(a.x<e?(s=a,a=new Ot(e,a.y+(e-a.x)/(h.x-a.x)*(h.y-a.y)).P(),a.z=s.z+(e-s.x)/(h.x-s.x)*(h.z-s.z),c=!0):h.x<e&&(s=h,h=new Ot(e,a.y+(e-a.x)/(h.x-a.x)*(h.y-a.y)).P(),h.z=a.z+(e-a.x)/(s.x-a.x)*(s.z-a.z),c=!0),a.y<i&&h.y<i||(a.y<i?(s=a,a=new Ot(a.x+(i-a.y)/(h.y-a.y)*(h.x-a.x),i).P(),a.z=s.z+(i-s.y)/(h.y-s.y)*(h.z-s.z),c=!0):h.y<i&&(s=h,h=new Ot(a.x+(i-a.y)/(h.y-a.y)*(h.x-a.x),i).P(),h.z=a.z+(i-a.y)/(s.y-a.y)*(s.z-a.z),c=!0),a.x>=n&&h.x>=n||(a.x>=n?(s=a,a=new Ot(n,a.y+(n-a.x)/(h.x-a.x)*(h.y-a.y)).P(),a.z=s.z+(n-s.x)/(h.x-s.x)*(h.z-s.z),c=!0):h.x>=n&&(s=h,h=new Ot(n,a.y+(n-a.x)/(h.x-a.x)*(h.y-a.y)).P(),h.z=a.z+(n-a.x)/(s.x-a.x)*(s.z-a.z),c=!0),a.y>=r&&h.y>=r||(a.y>=r?(s=a,a=new Ot(a.x+(r-a.y)/(h.y-a.y)*(h.x-a.x),r).P(),a.z=s.z+(r-s.y)/(h.y-s.y)*(h.z-s.z),c=!0):h.y>=r&&(s=h,h=new Ot(a.x+(r-a.y)/(h.y-a.y)*(h.x-a.x),r).P(),h.z=a.z+(r-a.y)/(s.y-a.y)*(s.z-a.z),c=!0),u&&a.equals(u[u.length-1])||(u=[a],o.push(u)),c&&(u.clipped=!0),u.push(h)))))}}return o}class ua extends Ot{constructor(t,e,i,n){super(t,e),this.angle=i,void 0!==n&&(this.segment=n)}clone(){return new ua(this.x,this.y,this.angle,this.segment)}}\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */function ca(t,e,i,n,r){if(void 0===e.segment)return!0;let o=e,s=e.segment+1,a=0;for(;a>-i/2;){if(s--,s<0)return!1;a-=t[s].dist(o),o=t[s]}a+=t[s].dist(t[s+1]),s++;const l=[];let u=0;for(;a<i/2;){const e=t[s],i=t[s+1];if(!i)return!1;let o=t[s-1].angleTo(e)-e.angleTo(i);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:o}),u+=o;a-l[0].distance>n;)u-=l.shift().angleDelta;if(u>r)return!1;s++,a+=e.dist(i)}return!0}function ha(t,e,i,n,r,o,s,a,l,u,c){const h=function(t,e,i){return t?.6*e*i:0}(n,o,s),d=function(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}(n,r),f=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-d*s<e/4&&(e=d*s+e/4),function t(e,i,n,r,o,s,a,l,u,c,h){const d=s/2,f=function(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}(e);let p=0,m=i-n,y=[];for(let t=0;t<e.length-1;t++){const i=e[t],a=e[t+1],l=i.dist(a),g=a.angleTo(i);for(;m+n<p+l;){m+=n;const b=(m-p)/l,v=da(i.x,a.x,b),w=da(i.y,a.y,b),x=da(i.z||0,a.z||0,b);if(v>=0&&v<u&&w>=0&&w<u&&m-d>=0&&m+d<=f){const n=new ua(v,w,g,t);n.z=x,c&&(n.axis=[i.y-w,v-i.x],n.angleR=x===(i.z||0)?0:Math.atan(.9*(x-(i.z||0))*h/i.dist(n))),n.line=e,n.P(),r&&!ca(e,n,s,r,o)||y.push(n)}}p+=l}return l||y.length||a||(y=t(e,p/2,n,r,o,s,a,!0,u,c,h)),y}(t,f?e/2*a%e:(d/2+2*o)*s*a%e,e,h,i,d*s,f,!1,l,u,c)}function da(t,e,i){return t*(1-i)+e*i}function fa(t,e){const i=t.length;if(i<=1)return[t];const n=[];let r,o;for(let e=0;e<i;e++){const i=ln(t[e]);0!==i&&(t[e].area=Math.abs(i),void 0===o&&(o=i<0),o===i<0?(r&&n.push(r),r=[t[e]]):r.push(t[e]))}if(r&&n.push(r),e>1)for(let t=0;t<n.length;t++)n[t].length<=e||(Xt(n[t],e,1,n[t].length-1,pa),n[t]=n[t].slice(0,e));return n}function pa(t,e){return e.area-t.area}function ma(t,e,i){const n=e.distSqr(i);if(0===n)return t.distSqr(e);const r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return t.distSqr(r<0?e:r>1?i:i.sub(e).M(r).u(e))}function ya(t,e=1,i=!1){let n=1/0,r=1/0,o=-1/0,s=-1/0;const a=t[0];for(let t=0;t<a.length;t++){const e=a[t];(!t||e.x<n)&&(n=e.x),(!t||e.y<r)&&(r=e.y),(!t||e.x>o)&&(o=e.x),(!t||e.y>s)&&(s=e.y)}const l=Math.min(o-n,s-r);let u=l/2;const c=new Qt(null,ga);if(0===l)return new Ot(n,r);for(let e=n;e<o;e+=l)for(let i=r;i<s;i+=l)c.push(new ba(e+u,i+u,u,t));let h=function(t){let e=0,i=0,n=0;const r=t[0];for(let t=0,o=r.length,s=o-1;t<o;s=t++){const o=r[t],a=r[s],l=o.x*a.y-a.x*o.y;i+=(o.x+a.x)*l,n+=(o.y+a.y)*l,e+=3*l}return new ba(i/e,n/e,0,t)}(t),d=c.length;for(;c.length;){const n=c.pop();(n.d>h.d||!h.d)&&(h=n,i&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,d)),n.max-h.d<=e||(u=n.h/2,c.push(new ba(n.p.x-u,n.p.y-u,u,t)),c.push(new ba(n.p.x+u,n.p.y-u,u,t)),c.push(new ba(n.p.x-u,n.p.y+u,u,t)),c.push(new ba(n.p.x+u,n.p.y+u,u,t)),d+=4)}return i&&(console.log("num probes: "+d),console.log("best distance: "+h.d)),h.p}function ga(t,e){return e.max-t.max}function ba(t,e,i,n){this.p=new Ot(t,e),this.h=i,this.d=function(t,e){let i=!1,n=1/0;for(let r=0;r<e.length;r++){const o=e[r];for(let e=0,r=o.length,s=r-1;e<r;s=e++){const r=o[e],a=o[s];r.y>t.y!=a.y>t.y&&t.x<(a.x-r.x)*(t.y-r.y)/(a.y-r.y)+r.x&&(i=!i),n=Math.min(n,ma(t,r,a))}}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}const va=45*Math.PI/100;function wa(t,e,i,n,r,o,s,a,l){const{feature:u,size:c,symbol:h}=t,d=c?24:0,f=n*(c?c[0]/d:1),p=[];if("line"===o){let t=u.geometry;r&&(t=la(u.geometry,0,0,r,r));for(let n=0;n<t.length;n++){const o=ha(t[n],s,va,h.isIconText?null:i.vertical||i.horizontal||i,null,d,h.isIconText?1:f,1,r||1/0,a,l);if(h.textPlacement&&!h.isIconText)for(let t=0;t<o.length;t++)o[t].startIndex=e.length/3;if(p.push.apply(p,o),h.textPlacement&&!h.isIconText)for(let i=0;i<t[n].length;i++)e.push(t[n][i].x,t[n][i].y,t[n][i].z||0)}}else if(3===u.type){const t=fa(u.geometry,0);for(let e=0;e<t.length;e++){const i=t[e];if("vertex"===o)for(let t=0;t<i.length;t++){const e=i[t];for(let t=0;t<e.length;t++)dn(e[t],r)||p.push(e[t])}else{const t=ya(i,16);dn(t,r)||p.push(t)}}}else if(2===u.type)for(let t=0;t<u.geometry.length;t++){const e=u.geometry[t];if("vertex"===o)for(let t=0;t<e.length;t++)dn(e[t],r)||p.push(e[t]);else dn(e[0],r)||p.push(e[0])}else if(1===u.type)for(let t=0;t<u.geometry.length;t++){const e=u.geometry[t];for(let t=0;t<e.length;t++){const i=e[t];dn(i,r)||p.push(i)}}return p}function xa(t,e){const i={},n={},r=[];let o=0;function s(e){r.push(t[e]),o++}function a(t,e,i){const o=n[t];return delete n[t],n[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(i[0]),o}function l(t,e,n){const o=i[e];return delete i[e],i[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=n[0].concat(r[o].geometry[0]),o}function u(t,e,i){const n=i?e[0][e[0].length-1]:e[0][0];return`${t}:${n.x}:${n.y}`}for(let c=0;c<t.length;c++){const h=t[c],d=h.geometry;if(!d)continue;const f=h.properties[e]?h.properties[e].toString():null;if(!f){s(c);continue}const p=u(f,d),m=u(f,d,!0);if(p in n&&m in i&&n[p]!==i[m]){const t=l(p,m,d),e=a(p,m,r[t].geometry);delete i[p],delete n[m],n[u(f,r[e].geometry,!0)]=e,r[t].geometry=null}else p in n?a(p,m,d):m in i?l(p,m,d):(s(c),i[p]=o-1,n[m]=o-1)}return r.filter(t=>t.geometry)}class ka extends ds{static needMerge(t){return!!t&&t.mergeOnProperty&&("line"===t.textPlacement||"line"===t.markerPlacement)}static mergeLineFeatures(t,e,i){const n="__index".trim(),r=function(t,e,i){const n="__index".trim(),r=ds.genFnTypes(e),{mergeOnPropertyFn:o}=r;if(!e.mergeOnProperty||"line"!==e.textPlacement&&"line"!==e.markerPlacement)return[];if(!(fn(s=e.mergeOnProperty)||"string"!=typeof s&&(null===s.constructor||s.constructor!==String)||"line"!==e.textPlacement&&"line"!==e.markerPlacement))return[{features:t,property:e.mergeOnProperty}];var s;const a=[],l={},u=[];for(let r=0;r<t.length;r++){t[r][n]=r;const s=t[r].properties=t[r].properties||{};s.$layer=t[r].layer,s.$type=t[r].type;let c=e.markerPlacement;"line"!==c&&(c=e.textPlacement);const h=o?o(i,s):e.mergeOnProperty;"line"!==c||fn(h)?u.push(t[r]):(void 0===l[h]&&(l[h]=a.length,a.push({features:[],property:h})),a[l[h]].features.push(t[r]))}return u.length&&a.push({features:u}),a}(t,e,i);if(r.length){const e=[];for(let i=0;i<r.length;i++)e.push(r[i].property?xa(r[i].features,r[i].property):t);if(1===e.length)return e[0];{let t=[];for(let i=0;i<e.length;i++)t=t.concat(e[i]);return t.sort((t,e)=>t[n]-e[n]),t}}}static splitPointSymbol(t,e=0){const i=[];if(Array.isArray(t)){const e=t;for(let t=0;t<e.length;t++)e[t]&&i.push(...ka.splitPointSymbol(e[t],t));return i}let n=null,r=null;for(const e in t)0===e.indexOf("marker")?(n=n||{},n[e]=t[e]):0===e.indexOf("text")&&(r=r||{},r[e]=t[e]);return n&&(n.isIconText=!0,t.mergeOnProperty&&(n.mergeOnProperty=t.mergeOnProperty),i.push(n)),r&&(n&&(r.textPlacement=n.markerPlacement,r.textSpacing=n.markerSpacing,r.isIconText=!0),t.mergeOnProperty&&(r.mergeOnProperty=t.mergeOnProperty),i.push(r)),void 0!==t.visible&&(n&&(n.visible=t.visible),r&&(r.visible=t.visible)),n&&(n.markerTextFit&&r&&(n.text={},n.text.textName=r.textName,n.text.textSize=r.textSize),n.index={index:e,type:0}),r&&(r.index={index:e,type:1}),i}static isAtlasLoaded(t,e){const{icon:i,glyph:n}=t,{iconAtlas:r,glyphAtlas:o}=e;if(i&&(!r||!r.positions[i.url]))return!1;if(n){if(!o||!o.positions[n.font])return!1;const t=o.positions[n.font],{text:e}=n;for(let i=0;i<e.length;i++)if(!t[e.charCodeAt(i)])return!1}return!0}constructor(t,e,i){super(t,e,i)}createStyledVector(t,e,i,n,r,o){const s=new sa(t,this.symbolDef,e,i,n),a=s.getIconAndGlyph();if(a.icon&&!this.options.atlas){const{url:t,size:e}=a.icon;r[t]||(r[t]=a.icon.size),r[t][0]<e[0]&&(r[t][0]=e[0]),r[t][1]<e[1]&&(r[t][1]=e[1])}if(a.glyph&&!this.options.atlas){const{font:t,text:i}=a.glyph,n=o[t]=o[t]||{};for(let t=0;t<i.length;t++)n[i.charCodeAt(t)]=1;"line"===e.textPlacement&&(o.options={isCharsCompact:!1})}return this.options.allowEmptyPack||a.icon||a.glyph?s:null}getFormat(t){const e=void 0!==t.textName,i=e?this.getPackSDFFormat(t):this.getPackMarkerFormat();e?i.push(...this.ct()):i.push(...this.ht());const{markerOpacityFn:n,textOpacityFn:r,markerPitchAlignmentFn:o,textPitchAlignmentFn:s,markerRotationAlignmentFn:a,textRotationAlignmentFn:l,markerRotationFn:u,textRotationFn:c,markerAllowOverlapFn:h,textAllowOverlapFn:d,markerIgnorePlacementFn:f,textIgnorePlacementFn:p}=this.et;return(n||r)&&i.push({type:Uint8Array,width:1,name:"aColorOpacity"}),(o||s)&&i.push({type:Uint8Array,width:1,name:"aPitchAlign"}),(a||l)&&i.push({type:Uint8Array,width:1,name:"aRotationAlign"}),(u||c)&&i.push({type:Uint16Array,width:1,name:"aRotation"}),(h||d||f||p)&&i.push({type:Uint8Array,width:1,name:"aOverlap"}),i}dt(){return this.hasMapPitchAlign}ct(){const{textFillFn:t,textSizeFn:e,textHaloFillFn:i,textHaloRadiusFn:n,textHaloOpacityFn:r,textDxFn:o,textDyFn:s}=this.et,a=[];return t&&a.push({type:Uint8Array,width:4,name:"aTextFill"}),e&&a.push({type:Uint8Array,width:1,name:"aTextSize"}),i&&a.push({type:Uint8Array,width:4,name:"aTextHaloFill"}),n&&a.push({type:Uint8Array,width:1,name:"aTextHaloRadius"}),r&&a.push({type:Uint8Array,width:1,name:"aTextHaloOpacity"}),o&&a.push({type:Int8Array,width:1,name:"aTextDx"}),s&&a.push({type:Int8Array,width:1,name:"aTextDy"}),a}ht(){const{markerWidthFn:t,markerHeightFn:e,markerDxFn:i,markerDyFn:n}=this.et,r=[];return t&&r.push({type:Uint8Array,width:1,name:"aMarkerWidth"}),e&&r.push({type:Uint8Array,width:1,name:"aMarkerHeight"}),i&&r.push({type:Int8Array,width:1,name:"aMarkerDx"}),n&&r.push({type:Int8Array,width:1,name:"aMarkerDy"}),r}createDataPack(){if(!this.iconAtlas&&!this.glyphAtlas){if(!this.options.allowEmptyPack)return null;this.empty=!0}this.lineVertex=[];const t=super.createDataPack.apply(this,arguments);return t?(t.lineVertex=new Int16Array(this.lineVertex),t.buffers.push(t.lineVertex.buffer),t):null}placeVector(t,e){const i=t.getShape(this.iconAtlas,this.glyphAtlas);if(!this.options.allowEmptyPack&&!i)return;const n=this.ft(t,i,e);if(0===n.length)return;const r=this.data,o=this.needAltitudeAttribute()?2:3;let a=this.data.aPosition.length/o;const l=t.symbol,u=t.feature.properties,c="line"===l.textPlacement&&!l.isIconText,h=void 0!==l.textName,d=h&&c&&function(t){let e=0;for(let i=0;i<t.length;i++)if(Js(t.charAt(i).charCodeAt(0)))e=0;else if(e++,e>=1)return!1;return!0}(t.getIconAndGlyph().glyph.text)?1:0,{textFillFn:f,textSizeFn:p,textHaloFillFn:m,textHaloRadiusFn:y,textHaloOpacityFn:g,textDxFn:b,textDyFn:v,textPitchAlignmentFn:w,textRotationAlignmentFn:x,textRotationFn:k,textAllowOverlapFn:M,textIgnorePlacementFn:j,textOpacityFn:A,markerWidthFn:F,markerHeightFn:T,markerDxFn:z,markerDyFn:S,markerPitchAlignmentFn:_,markerRotationAlignmentFn:P,markerRotationFn:I,markerAllowOverlapFn:O,markerIgnorePlacementFn:E,markerOpacityFn:q}=this.et;let R,C,N,L,D,U,$,W,J,H,G,V,B,X,Z,Y,K;if(h){const e=t.getIconAndGlyph().glyph.font;R=function(t,e,i){const n=t.positionedGlyphs,r=[];for(let o=0;o<n.length;o++){const s=n[o],a=i[s.glyph];if(!a)continue;const l=a.rect;if(!l)continue;const u=4,c=a.metrics.advance/2,h=a.metrics.height/2,d=e?[s.x+c,0]:[0,0],f=e?[0,s.y-h]:[s.x+c,s.y-h],p=a.metrics.left-u-c+f[0],m=a.metrics.top-u+f[1],y=p+l.w,g=m+l.h,b=new Ot(p,m),v=new Ot(y,m),w=new Ot(p,g),x=new Ot(y,g);if(e&&s.vertical){const t=new Ot(-c,c),e=-Math.PI/2,i=new Ot(5,0);b.F(e,t).u(i),v.F(e,t).u(i),w.F(e,t).u(i),x.F(e,t).u(i)}r.push({tl:b,tr:v,bl:w,br:x,tex:l,writingMode:t.writingMode,glyphOffset:d})}return r}(i.horizontal,c,this.glyphAtlas.positions[e]),f&&(C=f(null,u),s(C)?C=[0,0,0,0]:(C=Array.isArray(C)?C.map(t=>255*t):We(C).array(),3===C.length&&C.push(255))),p&&(N=p(this.options.zoom,u),fn(N)&&(N=14)),m&&(L=m(null,u),L=Array.isArray(L)?L.map(t=>255*t):We(L).array(),3===L.length&&L.push(255)),y&&(D=y(null,u)),g&&(U=255*g(null,u)),b&&($=b(null,u)||0),v&&(W=v(null,u)||0),w&&(B=+("map"===w(null,u))),x&&(X=+("map"===x(null,u))),k&&(Z=pn(k(null,u),0,360)*Math.PI/180)}else R=i?function(t){const e=t.image,i=t.top-1/e.pixelRatio,n=t.left-1/e.pixelRatio,r=t.bottom+1/e.pixelRatio,o=t.right+1/e.pixelRatio;let s,a,l,u;return s=new Ot(n,i),a=new Ot(o,i),l=new Ot(o,r),u=new Ot(n,r),[{tl:s,tr:a,bl:u,br:l,tex:{x:e.tl[0],y:e.tl[1],w:e.displaySize[0],h:e.displaySize[1]},writingMode:void 0,glyphOffset:[0,0]}]}(i):function(){const t=new Ot(0,0),e=new Ot(0,0),i=new Ot(0,0);return[{tl:t,tr:e,bl:new Ot(0,0),br:i,tex:{x:0,y:0,w:0,h:0},writingMode:void 0,glyphOffset:[0,0]}]}(),F&&(J=F(null,u)),T&&(H=T(null,u)),z&&(G=z(null,u)),S&&(V=S(null,u)),_&&(B=+("map"===_(null,u))),P&&(X=+("map"===P(null,u))),I&&(Z=pn(I(null,u),0,360)*Math.PI/180);const Q=O||M;Q&&(Y=Q(null,u)||0);const tt=E||j;let et;tt&&(K=tt(null,u)||0);const it=A||q;it&&(et=255*it(this.options.zoom,u));const nt=this.options.EXTENT,rt=R.length;for(let t=0;t<n.length;t++){const e=n[t],i=e.z||0;if(nt!==1/0&&dn(e,nt))continue;const o=e.x,s=e.y,l=R.length;for(let t=0;t<l;t++){const n=R[t],{tl:l,tr:u,bl:f,br:p,tex:m}=n;this.pt(r,o,s,i,10*l.x,10*l.y,m.x,m.y+m.h),h&&this.yt(r,c,rt,n.glyphOffset,e,d,e.axis,e.angleR),this.gt(r,C,N,L,D,U,$,W,J,H,G,V,et,B,X,Z,Y,K),this.pt(r,o,s,i,10*u.x,10*u.y,m.x+m.w,m.y+m.h),h&&this.yt(r,c,rt,n.glyphOffset,e,d,e.axis,e.angleR),this.gt(r,C,N,L,D,U,$,W,J,H,G,V,et,B,X,Z,Y,K),this.pt(r,o,s,i,10*f.x,10*f.y,m.x,m.y),h&&this.yt(r,c,rt,n.glyphOffset,e,d,e.axis,e.angleR),this.gt(r,C,N,L,D,U,$,W,J,H,G,V,et,B,X,Z,Y,K),this.pt(r,o,s,i,10*p.x,10*p.y,m.x+m.w,m.y),h&&this.yt(r,c,rt,n.glyphOffset,e,d,e.axis,e.angleR),this.gt(r,C,N,L,D,U,$,W,J,H,G,V,et,B,X,Z,Y,K),this.addElements(a,a+1,a+2),this.addElements(a+1,a+2,a+3),a+=4;const y=Math.max(Math.abs(o),Math.abs(s),Math.abs(i));y>this.maxPos&&(this.maxPos=y)}}}pt(t,e,i,n,r,o,s,a){this.fillPosition(t,e,i,n),t.aShape.push(r,o),t.aTexCoord.push(s,a)}yt(t,e,i,n,r,o,s,a){if(t.aCount.push(i),e){t.aGlyphOffset.push(n[0],n[1]),this.dt()&&t.aPitchRotation.push(s[0],s[1],a);const e=r.startIndex;t.aSegment.push(r.segment+e,e,r.line.length),t.aVertical.push(o)}}gt(t,e,i,n,r,o,s,a,l,u,c,h,d,f,p,m,y,g){const{textFillFn:b,textSizeFn:v,textHaloFillFn:w,textHaloRadiusFn:x,textHaloOpacityFn:k,textDxFn:M,textDyFn:j,textPitchAlignmentFn:A,textRotationAlignmentFn:F,textRotationFn:T,textAllowOverlapFn:z,textIgnorePlacementFn:S,textOpacityFn:_,markerWidthFn:P,markerHeightFn:I,markerDxFn:O,markerDyFn:E,markerPitchAlignmentFn:q,markerRotationAlignmentFn:R,markerRotationFn:C,markerAllowOverlapFn:N,markerIgnorePlacementFn:L,markerOpacityFn:D}=this.et;b&&t.aTextFill.push(...e),v&&t.aTextSize.push(i),w&&t.aTextHaloFill.push(...n),x&&t.aTextHaloRadius.push(r),k&&t.aTextHaloOpacity.push(o),M&&t.aTextDx.push(s),j&&t.aTextDy.push(a),P&&t.aMarkerWidth.push(l),I&&t.aMarkerHeight.push(u),O&&t.aMarkerDx.push(c),E&&t.aMarkerDy.push(h),(D||_)&&t.aColorOpacity.push(d),(A||q)&&t.aPitchAlign.push(f),(R||F)&&t.aRotationAlign.push(p),(C||T)&&t.aRotation.push(9362*m);const U=N||z,$=L||S;(U||$)&&t.aOverlap.push((U?8:0)+4*y+(($?2:0)+g)),r>0&&(this.properties.hasHalo=1)}ft(t,e,i){const{feature:n,symbol:r}=t,o=this.bt(t,r),s=n.properties,{markerSpacingFn:a,textSpacingFn:l}=this.et,u=((a?a(null,s):r.markerSpacing)||(l?l(null,s):r.textSpacing)||250)*i,c=this.options.altitudeToTileScale;return wa(t,this.lineVertex,e,i,this.options.EXTENT,o,u,this.dt(),c)}bt(t,e){return this.et.markerPlacementFn?this.et.markerPlacementFn(this.options.zoom,t.feature.properties):e.markerPlacement||e.textPlacement}getPackSDFFormat(t){if("line"!==t.textPlacement||t.isIconText)return[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"},{type:Uint8Array,width:1,name:"aCount"}];{const t=[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"},{type:Uint8Array,width:1,name:"aCount"},{type:Int16Array,width:2,name:"aGlyphOffset"},{type:Uint16Array,width:3,name:"aSegment"},{type:Uint8Array,width:1,name:"aVertical"}];return this.dt()&&t.push({type:Float32Array,width:3,name:"aPitchRotation"}),t}}getPackMarkerFormat(){return[...this.getPositionFormat(),{type:Int16Array,width:2,name:"aShape"},{type:Uint16Array,width:2,name:"aTexCoord"}]}}class Ma{constructor(t){this.x=t.x,this.y=t.y,this.z=t.z||0}clone(){return new Ma(this)}S(){return this.j(this.mag()),this}j(t){return this.x/=t,this.y/=t,this.z/=t,this}_(){var t=this.y;return this.y=this.x,this.x=-t,this}mag(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}add(t){return this.clone().u(t)}sub(t){return this.clone().m(t)}u(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}m(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this}equals(t){return this.x===t.x&&this.y===t.y&&this.z===t.z}mult(t){return this.clone().M(t)}M(t){return this.x*=t,this.y*=t,this.z*=t,this}dist(t){return Math.sqrt(this.distSqr(t))}distSqr(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z;return e*e+i*i+n*n}P(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}angleTo(t){return Math.atan2(this.y-t.y,this.x-t.x)}}const ja=Math.cos(Math.PI/180*37.5),Aa=Math.pow(2,16)/1,Fa=new Ot,Ta=new Ot,za=new Ot;class Sa extends ds{constructor(t,e,i){super(t,e,i);let n=!1;const{lineDasharrayFn:r,lineDashColorFn:o}=this.et;this.hasGradient=this.symbol.lineGradientProperty,r&&(n=function(t,e,i){for(let n=0;n<t.length;n++)if(i(e,t[n].properties))return!0;return!1}(t,this.options.zoom,r),n&&(this.dasharrayFn=r)),this.hasDasharray=Ia(this.symbol.lineDasharray)||n,this.hasDasharray&&o&&(this.dashColorFn=o)}createStyledVector(t,e,i,n,r){const o=new mn(t,e,i,n),s=o.getLineResource();return!this.options.atlas&&s&&(r[s]=[0,0]),o}getFormat(){const{lineWidthFn:t,lineStrokeWidthFn:e,lineStrokeColorFn:i,lineColorFn:n,lineOpacityFn:r,lineDxFn:o,lineDyFn:s,linePatternAnimSpeedFn:a,linePatternGapFn:l}=this.et,u=[...this.getPositionFormat()];if(u.push(this.iconAtlas||this.hasDasharray?{type:Int8Array,width:3,name:"aExtrude"}:{type:Int8Array,width:2,name:"aExtrude"}),u.push({type:this.options.positionType||Uint16Array,width:1,name:"aLinesofar"}),t&&u.push({type:Uint8Array,width:1,name:"aLineWidth"}),e&&u.push({type:Uint8Array,width:1,name:"aLineStrokeWidth"}),n&&u.push({type:Uint8Array,width:4,name:"aColor"}),i&&u.push({type:Uint8Array,width:4,name:"aStrokeColor"}),r&&u.push({type:Uint8Array,width:1,name:"aOpacity"}),this.dasharrayFn&&u.push({type:Uint8Array,width:4,name:"aDasharray"}),this.dashColorFn&&u.push({type:Uint8Array,width:4,name:"aDashColor"}),this.iconAtlas){const t=this.getIconAtlasMaxValue();u.push({type:t>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return(o||s)&&u.push({type:Int8Array,width:2,name:"aLineDxDy"}),(a||l)&&u.push({type:Int8Array,width:2,name:"aLinePattern"}),u}placeVector(t){const{lineJoinFn:e,lineCapFn:i,lineWidthFn:n,lineHeightFn:r,lineStrokeWidthFn:o,lineStrokeColorFn:a,lineColorFn:l,lineOpacityFn:u,lineDxFn:c,lineDyFn:h,linePatternAnimSpeedFn:d,linePatternGapFn:f}=this.et,p=this.symbol,m=t.feature,y=m.properties;let g=p.lineJoin||"miter",b=p.lineCap||"butt";if(e&&(g=e(this.options.zoom,y)||"miter"),i&&(b=i(this.options.zoom,y)||"butt"),n){let t=n(this.options.zoom,y);Zi(t)&&(t=4),this.feaLineWidth=+t}else this.feaLineWidth=+p.lineWidth;if(r){let t=r(this.options.zoom,y);Zi(t)&&(t=this.feaLineWidth),this.feaLineHeight=+t}else this.feaLineHeight=+p.lineHeight||this.feaLineWidth;if(o){let t=o(this.options.zoom,y);Zi(t)&&(t=0),this.feaLineStrokeWidth=t}else this.feaLineStrokeWidth=p.lineStrokeWidth||0;if(l&&(this.feaColor=l(this.options.zoom,y)||[255,255,255,255],s(this.feaColor)?this.feaColor=[0,0,0,0]:(this.feaColor=Array.isArray(this.feaColor)?this.feaColor.map(t=>255*t):We(this.feaColor).array(),3===this.feaColor.length&&this.feaColor.push(255))),a&&(this.feaStrokeColor=a(this.options.zoom,y)||[0,0,0,255],s(this.feaStrokeColor)?this.feaStrokeColor=[0,0,0,0]:(this.feaStrokeColor=Array.isArray(this.feaStrokeColor)?this.feaStrokeColor.map(t=>255*t):We(this.feaStrokeColor).array(),3===this.feaStrokeColor.length&&this.feaStrokeColor.push(255))),u){let t=u(this.options.zoom,y);Zi(t)&&(t=1),this.feaOpacity=255*t}if(this.dasharrayFn){let t=this.dasharrayFn(this.options.zoom,y)||[0,0,0,0];if(t.length<4){const e=t;1===t.length?t=[e[0],e[0],e[0],e[0]]:2===t.length?t=[e[0],e[1],e[0],e[1]]:3===t.length&&(t=[e[0],e[1],e[2],e[2]])}this.feaDash=t}if(this.dashColorFn){let t=(this.dashColorFn?this.dashColorFn(this.options.zoom,y):this.symbol.lineDashColor)||[0,0,0,0];t=Array.isArray(t)?t.map(t=>255*t):We(t).array(),3===t.length&&t.push(255),this.feaDashColor=t}if(this.iconAtlas){const e=t.getLineResource(),i=this.iconAtlas.glyphMap[e];if(this.feaTexInfo=this.feaTexInfo||[0,0,0,0],i){const{tl:t,displaySize:i}=this.iconAtlas.positions[e];this.feaTexInfo[0]=t[0]+1,this.feaTexInfo[1]=t[1]+1,this.feaTexInfo[2]=i[0]-3,this.feaTexInfo[3]=i[1]-3}else this.feaTexInfo[0]=this.feaTexInfo[1]=this.feaTexInfo[2]=this.feaTexInfo[3]=0}if(c){let t=c(this.options.zoom,y);Zi(t)&&(t=0),this.feaLineDx=t}if(h){let t=h(this.options.zoom,y);Zi(t)&&(t=0),this.feaLineDy=t}if(d){let t=d(this.options.zoom,y);Zi(t)&&(t=0),0!==t&&(this.properties.hasPatternAnim=1),this.feaPatternAnimSpeed=t}if(f){let t=f(this.options.zoom,y);Zi(t)&&(t=0),this.feaLinePatternGap=t}const v=this.options.EXTENT;let w=m.geometry;if(v!==1/0){w=[];const t=[];for(let e=0;e<m.geometry.length;e++){t[0]=m.geometry[e];const i=la(t,-1,-1,v+1,v+1);if(3===m.type&&i.length>1){const t=i[0],e=i[i.length-1];t[0].equals(e[e.length-1])&&(i[0]=e.concat(t.slice(1)),i.length=i.length-1)}w.push(...i)}}const x=this.needAltitudeAttribute()?2:3;for(let t=0;t<w.length;t++)this.offset=this.data.aPosition.length/x,this.vt(w[t],m,g,b,2,1.05)}wt(){return this.iconAtlas&&this.feaTexInfo[2]&&this.feaTexInfo[3]}vt(t,e,i,n,r,o){const s=this.wt()||Ia(this.feaDash)||Ia(this.symbol.lineDasharray),a=this.options.isTube;a&&(t=t.map(t=>new Ma(t))),this.overscaling=1;const l=this.options.EXTENT;if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.prevVertex=null,this.symbol.lineGradientProperty&&e.properties&&nn(e.properties,"mapbox_clip_start")&&nn(e.properties,"mapbox_clip_end")){this.clipStart=+e.properties.mapbox_clip_start,this.clipEnd=+e.properties.mapbox_clip_end;for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance()}const u=3===e.type&&!t.clipped;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<(u?3:2))return;"bevel"===i&&(r=1.05);const d=this.overscaling<=16?15*l/(512*this.overscaling):0,f={vertexLength:0,primitiveLength:0,currentNormal:null};let p,m,y,g,b;this.e1=this.e2=-1,u&&(p=t[c-2],b=t[h].sub(p).S()._());for(let e=h;e<c;e++){if(y=e===c-1?u?t[h+1]:void 0:t[e+1],y&&t[e].equals(y))continue;b&&(g=b),p&&(m=p),p=t[e],b=y?y.sub(p).S()._():g,f.dir=m?p.sub(m).S():y.sub(p).S(),g=g||b,f.currentNormal=g;let l=g.add(b);0===l.x&&0===l.y||l.S();const v=g.x*b.x+g.y*b.y,w=l.x*b.x+l.y*b.y,x=0!==w?1/w:1/0,k=2*Math.sqrt(2-2*w),M=w<ja&&m&&y,j=g.x*b.y-g.y*b.x>0;if(!a&&M&&e>h){const t=p.dist(m);if(t>2*d){const e=p.sub(p.sub(m).M(d/t).P());e.z=p.z,this.updateDistance(m,e),this.addCurrentVertex(e,g,0,0,f),m=e}}const A=m&&y;f.middleVertex=A;let F=A?i:u?"butt":n;if(A&&"round"===F&&(x<o?F="miter":x<=2&&(F="fakeround")),"miter"===F&&x>r&&!a&&(F="bevel"),"bevel"===F&&(x>2&&(F="flipbevel"),x<r&&(F="miter")),m&&this.updateDistance(m,p),"miter"===F)a?(this.addCurrentVertex(p,g,0,0,f),f.dir=y.sub(p).S(),this.addCurrentVertex(p,b,0,0,f)):(l.M(x),this.addCurrentVertex(p,l,0,0,f),s&&(f.currentNormal=b,this.addCurrentVertex(p,l,0,0,f)));else if("flipbevel"===F){if(x>100)l=b.mult(-1);else{const t=x*g.add(b).mag()/g.sub(b).mag();l._().M(t*(j?-1:1))}this.addCurrentVertex(p,l,0,0,f),this.addCurrentVertex(p,l.mult(-1),0,0,f)}else if("bevel"===F||"fakeround"===F){const t=-Math.sqrt(x*x-1),e=j?t:0,i=j?0:t;if(m&&this.addCurrentVertex(p,g,e,i,f),"fakeround"===F){const t=Math.round(180*k/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+v*(v*(3.55645-1.43519*v)-3.2452))*t*t+(.848013+v*(.215638*v-1.06021)))}const n=b.sub(g).M(i).u(g).S().M(j?-1:1);this.addHalfVertex(p,n.x,n.y,!1,j,0,f)}}y&&(f.currentNormal=b,this.addCurrentVertex(p,b,-e,-i,f))}else if("butt"===F)this.addCurrentVertex(p,l,0,0,f);else if("square"===F){const t=m?1:-1;this.addCurrentVertex(p,l,t,t,f)}else"round"===F&&(m&&(this.addCurrentVertex(p,g,0,0,f),this.addCurrentVertex(p,g,1,1,f,!0)),y&&(this.addCurrentVertex(p,b,-1,-1,f,!0),this.addCurrentVertex(p,b,0,0,f)));if(!a&&M&&e<c-1){const t=p.dist(y);if(t>2*d){const e=p.add(y.sub(p).M(d/t).P());e.z=p.z,this.updateDistance(p,e),this.addCurrentVertex(e,b,0,0,f),p=e}}}}addCurrentVertex(t,e,i,n,r,o=!1){const s=e.x+e.y*i,a=e.y-e.x*i,l=e.y*n-e.x,u=-e.y-e.x*n;let c=0,h=0;if(r.middleVertex){Fa.x=s,Fa.y=a,Ta.x=l,Ta.y=u;const t=r.currentNormal;if(c=qa(t,Fa),0===i&&0===n)h=-c;else{const e=za;e.x=t.x,e.y=t.y,e.M(-1),h=qa(e,Ta)}}this.addHalfVertex(t,s,a,o,!1,i,r,c),this.addHalfVertex(t,l,u,o,!0,-n,r,h),this.prevVertex&&t.equals(this.prevVertex)||(this.prevVertex=t),this.distance>Aa/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,i,n,r,o))}addHalfVertex({x:t,y:e,z:i},n,r,o,s,a,l,u){this.fillData(this.data,t,e,i||0,n,r,o,s,1*this.scaledDistance,u);const c=l.vertexLength++;this.e1>=0&&this.e2>=0&&(this.addElements(this.e1,this.e2,c),l.primitiveLength++),s?this.e2=c:this.e1=c}fillData(t,e,i,n,r,o,s,a,l,u){const{lineWidthFn:c,lineStrokeWidthFn:h,lineStrokeColorFn:d,lineColorFn:f,lineOpacityFn:p,lineDxFn:m,lineDyFn:y,linePatternAnimSpeedFn:g,linePatternGapFn:b}=this.et;this.fillPosition(t,e,i,n);let v=63*r;v=(Math.sign(v)||1)*((Math.floor(Math.abs(v))>>1<<1)+ +s);let w=63*o;w=(Math.sign(w)||1)*((Math.floor(Math.abs(w))>>1<<1)+ +a),t.aExtrude.push(v,w),(this.iconAtlas||this.hasDasharray)&&t.aExtrude.push(63*u),t.aLinesofar.push(l),c&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),h&&t.aLineStrokeWidth.push(Math.round(2*this.feaLineStrokeWidth)),f&&t.aColor.push(...this.feaColor),d&&t.aStrokeColor.push(...this.feaStrokeColor),p&&t.aOpacity.push(this.feaOpacity),this.dasharrayFn&&t.aDasharray.push(...this.feaDash),this.dashColorFn&&t.aDashColor.push(...this.feaDashColor),this.iconAtlas&&t.aTexInfo.push(...this.feaTexInfo),(m||y)&&t.aLineDxDy.push(this.feaLineDx||0,this.feaLineDy||0),(g||b)&&t.aLinePattern.push(127*(this.feaPatternAnimSpeed||0),10*(this.feaLinePatternGap||0)),this.maxPos=Math.max(this.maxPos,Math.abs(e)+1,Math.abs(i)+1)}addElements(t,e,i){super.addElements(this.offset+t,this.offset+e,this.offset+i)}xt(t){const e=this.options.EXTENT,i=this.elements;for(let n=0;n<i.length;n+=3)e!==1/0&&(Pa(this.data.aPosition,i[n],i[n+1],3,e)||Pa(this.data.aPosition,i[n+1],i[n+2],3,e))||t.push(i[n],i[n+1],i[n+2])}kt(t){if(t.length<=1)return t;const e=[],i=this.options.EXTENT;let n,r=!0;for(n=0;n<t.length-1;n++){const o=_a(t[n],t[n+1],i);o&&r||(e.push(t[n]),r=o)}return r||e.push(t[n]),e}updateDistance(t,e){if(this.options.isTube){const i=t.dist(e),n=sn(this.options)*(e.z-t.z);this.distance+=Math.sqrt(i*i+n*n)}else this.distance+=t.dist(e);this.updateScaledDistance()}updateScaledDistance(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(Aa-1):this.distance}}function _a(t,e,i){return i!==1/0&&(t.x<0&&e.x<0||t.x>i&&e.x>i||t.y<0&&e.y<0||t.y>i&&e.y>i)}function Pa(t,e,i,n,r){if(r===1/0)return!1;const o=Math.floor(.5*t[e*n]),s=Math.floor(.5*t[e*n+1]),a=Math.floor(.5*t[i*n]),l=Math.floor(.5*t[i*n+1]);return o===a&&(o<0||o>r)&&s!==l||s===l&&(s<0||s>r)&&o!==a}function Ia(t){if(!Array.isArray(t))return!1;for(let e=0;e<t.length;e++)if(t[e])return!0;return!1}const Oa=new Ot(0,0),Ea=new Ot(0,0);function qa(t,e){const i=t.mag(),n=e.mag();Oa.x=e.x,Oa.y=e.y;const r=t.angleTo(Ea),o=e.angleTo(Ea);return Math.sign(o-r)*Math.sqrt(n*n-i*i)}class Ra extends Sa{constructor(t,e,i){super(t,e,i),this.Mt=i.altitudeProperty}getFormat(){const{lineColorFn:t,lineWidthFn:e}=this.et,i=[{type:this.maxPosZ>=Math.pow(2,15)?Float32Array:Int16Array,width:3,name:"aPosition"},{type:Uint16Array,width:1,name:"aLinesofar"},{type:Uint8Array,width:1,name:"aUp"},{type:Int16Array,width:3,name:"aExtrudedPosition"},{type:Int8Array,width:2,name:"aExtrude"}];return t&&i.push({type:Uint8Array,width:4,name:"aColor"}),e&&i.push({type:Uint8Array,width:1,name:"aLineWidth"}),this.Mt&&i.push({type:Array,width:1,name:"aLineHeight"}),i}placeVector(t){const e=t.feature;if(this.Mt){const{altitudeScale:t,altitudeProperty:i,defaultAltitude:n,heightProperty:r,defaultHeight:o,minHeightProperty:s}=this.options,{altitude:a,height:l}=hn(e,t,i,n,r,o,s);this.feaAltitude=a,this.feaMinHeight=(a-l)/a*32767,a>this.maxAltitude&&(this.maxAltitude=a)}return super.placeVector(t)}needAltitudeAttribute(){return!1}vt(t,e,i,n,r,o){const s=this.data.aPosition.length/3;super.vt(t,e,i,n,r,o);const a=this.data.aPosition.length/3,l=this.data.aPosition.length/3-this.offset;if(3!==e.type&&l>0&&!1!==this.options.side){const t=!1!==this.options.top?1:0,e=t+4;let i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],n=e.length/i;for(let t=0;t<n;t++)e.push(e[s*n+3*n+t])}i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/i;for(let t=0;t<r;t++)n.push(n[s*r+r*e+t])}i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/i;for(let t=0;t<r;t++)n.push(n[s*r+r*(e+3)+t])}super.addElements(t+1,l+1,l),super.addElements(l,l+1,l+2);const n=this.data.aPosition.length/3-this.offset;i=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],n=e.length/i;for(let t=0;t<n;t++)e.push(e[a*n-n+t])}i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/i;for(let t=0;t<r;t++)n.push(n[a*r-e*r-r+t])}i=this.data.aPosition.length/3;for(const t in this.data){const n=this.data[t],r=n.length/i;for(let t=0;t<r;t++)n.push(n[a*r-e*r-3*r+t])}super.addElements(n,l-3,n+1),super.addElements(l-3,n+2,n+1)}}fillData(t,e,i,n,r,o,s,a,l){const u=!1!==this.options.top,c=!1!==this.options.side,h=this.feaLineWidth||this.symbol.lineWidth/2*(this.options.EXTENT/this.options.tileSize),d=63*r,f=63*o,p=h*r+e,m=h*o+i;this.jt(t,e,i,r,o,s,a,l,p,m,d,f),c&&(u&&this.jt(t,e,i,r,o,s,a,l,p,m,d,f),this.jt(t,e,i,r,o,s,a,l,p,m,d,f),this.At(t,e,i,r,o,s,a,l,p,m,d,f),this.At(t,e,i,r,o,s,a,l,p,m,d,f)),this.maxPos=Math.max(this.maxPos,Math.abs(e),Math.abs(i))}jt(t,e,i,n,r,o,s,a,l,u,c,h){const{lineColorFn:d,lineWidthFn:f}=this.et;t.aPosition.push(e,i,32767),t.aLinesofar.push(a),t.aUp.push(+s),t.aExtrudedPosition.push(l,u,1),t.aExtrude.push(c,h),d&&t.aColor.push(...this.feaColor),f&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.Mt&&t.aLineHeight.push(this.feaAltitude)}At(t,e,i,n,r,o,s,a,l,u,c,h){const{lineColorFn:d,lineWidthFn:f}=this.et;t.aPosition.push(e,i,this.feaMinHeight||0),t.aLinesofar.push(a),t.aUp.push(+s),t.aExtrudedPosition.push(l,u,1),t.aExtrude.push(c,h),d&&t.aColor.push(...this.feaColor),f&&t.aLineWidth.push(Math.round(2*this.feaLineWidth)),this.Mt&&t.aLineHeight.push(this.feaAltitude)}addElements(t,e,i){const n=!1!==this.options.top,r=!1!==this.options.side,o=(n?1:0)+(r?4:0);if(t*=o,e*=o,this.data.aUp[this.offset+(i*=o)+4]){if(n&&super.addElements(e,t,i),r){const t=n?1:0;super.addElements(e+t,i+t,i+t+2),super.addElements(e+t+1,i+t+1+2,e+t+1+2)}}else if(n&&super.addElements(t,i,e),r){const e=n?1:0;super.addElements(t+e,t+e+2,i+e),super.addElements(t+e+1+2,i+e+1+2,i+e+1)}}createDataPack(t,e){this.maxAltitude=0;const i=super.createDataPack(t,e);if(!i)return i;const{data:n,indices:r}=i;this.getFormat().reduce((t,e)=>(t[e.name]={size:e.width},t),{}).aPickingId={size:1};const{aExtrudedPosition:o,aPosition:s,aLinesofar:a,aUp:l,aExtrude:u,aColor:c,aLineHeight:h,aLineWidth:d}=n,f={},p=Ye(o,r);let m,y=!0;for(let t=0;t<p.length;t++)p[t]=-p[t],p[t]%1!=0&&(y=!1);if(!1!==this.options.top&&this.symbol.material&&function(t){for(const e in t)if(e.indexOf("Texture")>=0&&t[e])return!0;return!1}(this.symbol.material)&&(m=function(t,e,i){const n=[];for(let r=0;r<t.length;r+=3){const t=e[r/3];n.push(t/256,i[r/3]?1:0)}return n}(o,a,l)),f.aPosition=s,m&&(f.aTexCoord0=new Float32Array(m)),f.aNormal=y?new Int8Array(p):new Float32Array(p),f.aPickingId=n.aPickingId,f.aExtrude=u,c&&(f.aColor=c),d&&(f.aLineWidth=d),h){const t=Gi(this.maxAltitude);f.aLineHeight=new t(h)}const g=[];for(const t in f)g.push(f[t].buffer);return i.data=f,i.buffers=g,i}}const Ca=Math.pow(2,16)/1;class Na extends ds{getFormat(){return[...this.getPositionFormat()]}placeVector(t){const e=t.feature,i=3===e.type,n=e.geometry,r=this.elements;i&&(this.elements=[]);const o=this.needAltitudeAttribute()?2:3;for(let t=0;t<n.length;t++)this.offset=this.data.aPosition.length/o,this.vt(n[t],e),i&&(this.xt(r),this.elements=[]);i&&(this.elements=r)}vt(t,e){const i=3===e.type;let n=t.length;for(;n>=2&&t[n-1].equals(t[n-2]);)n--;let r,o,s,a=0;for(;a<n-1&&t[a].equals(t[a+1]);)a++;if(!(n<(i?3:2))){this.distance=0,this.vertexLength=0,this.primitiveLength=0,this.e1=this.e2=this.e3=-1,i&&(r=t[n-2]);for(let e=a;e<n;e++)s=i&&e===n-1?t[a+1]:t[e+1],s&&t[e].equals(s)||(r&&(o=r),r=t[e],o&&(this.distance+=r.dist(o)),this.addCurrentVertex(r,this.distance))}}addCurrentVertex(t,e){const i=this.vertexLength++;this.addLineVertex(this.data,t,e),i>=1&&this.addElements(i-1,i),e>Ca&&(this.distance=0,this.addCurrentVertex(t,this.distance))}addLineVertex(t,e){this.fillPosition(t,e.x,e.y,e.z||0),this.maxPos=Math.max(this.maxPos,Math.abs(e.x),Math.abs(e.y))}addElements(t,e){super.addElements(this.offset+t,this.offset+e)}xt(t){const e=this.options.EXTENT,i=this.elements;for(let n=0;n<i.length;n+=2)un(this.data.aPosition,i[n],i[n+1],3,e)||t.push(i[n],i[n+1])}}const La=45*Math.PI/100;class Da extends ds{getFormat(){return[...this.getPositionFormat()]}placeVector(t){const e=this.ft(t,this.symbol.markerSpacing||250,this.symbol.markerPlacement||"point");for(let t=0;t<e.length;t++){const i=e[t];this.fillPosition(this.data,i.x,i.y,i.z);const n=Math.max(Math.abs(i.x),Math.abs(i.y));n>this.maxPos&&(this.maxPos=n)}}ft(t,e,i){const n=t.feature,r=t.feature.type,o=this.options.EXTENT,s=[];if("line"===i){let t=n.geometry;o&&(t=la(n.geometry,0,0,o,o));for(let i=0;i<t.length;i++){const n=ha(t[i],e,La,null,null,24,1,1,o||1/0);s.push.apply(s,n)}}else if(3===r){const t=fa(n.geometry,0);for(let e=0;e<t.length;e++){const i=ya(t[e],16);dn(i,o)||s.push(i)}}else if(2===n.type)for(let t=0;t<n.geometry.length;t++){const e=n.geometry[t];dn(e[0],o)||s.push(e[0])}else if(1===n.type)for(let t=0;t<n.geometry.length;t++){const e=n.geometry[t];for(let t=0;t<e.length;t++){const i=e[t];dn(i,o)||s.push(i)}}return s}hasElements(){return!1}}\n/*!\n * from @turf/bboxClip\n * https://github.com/Turfjs/turf\n * MIT LICENSE\n */const Ua=[],$a=[];function Wa(t,e){var i,n,r,o,s,a,l;for(n=1;n<=8;n*=2){for(i=[],o=!(Ha(r=t[t.length-1],e)&n),s=0;s<t.length;s++){if((l=!(Ha(a=t[s],e)&n))!==o){const t=Ja(r,a,n,e);i.push(void 0!==a.x?new Ot(t[0],t[1]):t)}l&&i.push(a),r=a,o=l}if(!(t=i).length)break}return i}function Ja(t,e,i,n){return Ua[0]=void 0===t.x?t[0]:t.x,Ua[1]=void 0===t.y?t[1]:t.y,t=Ua,$a[0]=void 0===e.x?e[0]:e.x,$a[1]=void 0===e.y?e[1]:e.y,e=$a,8&i?[t[0]+(e[0]-t[0])*(n[3]-t[1])/(e[1]-t[1]),n[3]]:4&i?[t[0]+(e[0]-t[0])*(n[1]-t[1])/(e[1]-t[1]),n[1]]:2&i?[n[2],t[1]+(e[1]-t[1])*(n[2]-t[0])/(e[0]-t[0])]:1&i?[n[0],t[1]+(e[1]-t[1])*(n[0]-t[0])/(e[0]-t[0])]:null}function Ha(t,e){Ua[0]=void 0===t.x?t[0]:t.x,Ua[1]=void 0===t.y?t[1]:t.y;var i=0;return(t=Ua)[0]<e[0]?i|=1:t[0]>e[2]&&(i|=2),t[1]<e[1]?i|=4:t[1]>e[3]&&(i|=8),i}class Ga extends ds{constructor(...t){super(...t),this.lineElements=[]}createStyledVector(t,e,i,n,r){const o=new mn(t,e,i,n),s=o.getPolygonResource();return!this.options.atlas&&s&&(r[s]=[0,0]),o}getFormat(){const t=[...this.getPositionFormat()],{polygonFillFn:e,polygonOpacityFn:i,uvScaleFn:n,uvOffsetFn:r}=this.et;if(this.iconAtlas){const e=this.getIconAtlasMaxValue();t.push({type:e>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return e&&t.push({type:Uint8Array,width:4,name:"aColor"}),i&&t.push({type:Uint8Array,width:1,name:"aOpacity"}),n&&t.push({type:Uint16Array,width:2,name:"aUVScale"}),r&&t.push({type:Uint8Array,width:2,name:"aUVOffset"}),t}createDataPack(...t){this.maxLineIndex=0,this.lineElements=[];const e=super.createDataPack(...t);if(!e)return e;let i=this.lineElements;return i=new(Hi(this.maxLineIndex))(this.lineElements),e.lineIndices=i,e.buffers.push(i.buffer),e}placeVector(t,e){const i=t.feature;this.Ft(i.geometry,i,e)}Ft(t,e){let i,n,r,o;const{polygonFillFn:a,polygonOpacityFn:l,uvScaleFn:u,uvOffsetFn:c}=this.et,h=e.properties;a&&(i=a(this.options.zoom,h)||[255,255,255,255],s(i)?i=[0,0,0,0]:(i=Array.isArray(i)?i.map(t=>255*t):We(i).array(),3===i.length&&i.push(255))),l&&(n=l(this.options.zoom,h),Zi(n)&&(n=1),n*=255),u&&(r=u(this.options.zoom,h),Zi(r)&&(r=[1,1]),r=[255*r[0],255*r[1]]),c&&(o=c(this.options.zoom,h),Zi(o)&&(o=[0,0]),o=[255*o[0],255*o[1]]);const d=!!this.iconAtlas,f=fa(t,500),p=[0,0],m=[0,0];if(d){const{polygonPatternFileFn:t}=this.et,e=t?t(null,h):this.symbol.polygonPatternFile;if(this.iconAtlas.glyphMap[e]){const t=this.iconAtlas.positions[e];p[0]=t.tl[0]+1,p[1]=t.tl[1]+1,m[0]=t.displaySize[0]-3,m[1]=t.displaySize[1]-3}}const y=this.needAltitudeAttribute()?2:3,g=[-1,-1,e.extent+1,e.extent+1];for(let t=0;t<f.length;t++){const e=f[t],s=this.data.aPosition.length/y,a=[],l=[];for(let t=0;t<e.length;t++){let s=e[t];if(this.options.EXTENT!==1/0&&0===this.maxPosZ&&(s=Wa(s,g)),0===s.length)continue;0!==t&&l.push(a.length/3);const u=this.lineElements.length;this.fillPosition(this.data,s[0].x,s[0].y,s[0].z||0),d&&this.data.aTexInfo.push(...p,...m),void 0!==i&&this.data.aColor.push(...i),void 0!==n&&this.data.aOpacity.push(n),void 0!==r&&this.data.aUVScale.push(...r),void 0!==o&&this.data.aUVOffset.push(...o),this.maxPos=Math.max(this.maxPos,Math.abs(s[0].x),Math.abs(s[0].y)),this.addLineElements(u+s.length-1,u),a.push(s[0].x),a.push(s[0].y),a.push(s[0].z||0);for(let t=1;t<s.length;t++)this.fillPosition(this.data,s[t].x,s[t].y,s[t].z||0),d&&this.data.aTexInfo.push(...p,...m),void 0!==i&&this.data.aColor.push(...i),void 0!==n&&this.data.aOpacity.push(n),void 0!==r&&this.data.aUVScale.push(...r),void 0!==o&&this.data.aUVOffset.push(...o),this.maxPos=Math.max(this.maxPos,Math.abs(s[t].x),Math.abs(s[t].y)),this.addLineElements(u+t-1,u+t),a.push(s[t].x),a.push(s[t].y),a.push(s[t].z||0)}const u=Ti(a,l,3);for(let t=0;t<u.length;t+=3)this.addElements(s+u[t],s+u[t+1],s+u[t+2])}}addLineElements(...t){this.maxLineIndex=Math.max(this.maxLineIndex,...t),this.lineElements.push(...t)}}const Va=[{type:Int16Array,width:3,name:"aPosition"}];class Ba extends ds{getFormat(){return Va}placeVector(t,e){const i=this.ft(t,e);if(0===i.length)return;const n=this.data,r=this.getAltitude(t.feature.properties);let o=n.aPosition.length/Va[0].width;for(let t=0;t<i.length;t++){const e=i[t];n.aPosition.push(2*e.x+0,2*e.y+0,r),n.aPosition.push(2*e.x+1,2*e.y+0,r),n.aPosition.push(2*e.x+1,2*e.y+1,r),n.aPosition.push(2*e.x+0,2*e.y+1,r),this.addElements(o,o+1,o+2),this.addElements(o,o+2,o+3),o+=4;const s=Math.max(Math.abs(2*e.x+1),Math.abs(2*e.y+1));s>this.maxPos&&(this.maxPos=s)}}ft(t,e){const{feature:i,symbol:n}=t,r=this.bt(n),o=i.properties,{markerSpacingFn:s}=this.et,a=((s?s(null,o):n.markerSpacing)||250)*e;return wa(t,null,null,e,this.options.EXTENT,r,a)}bt(t){return t.markerPlacement}}class Xa extends Sa{constructor(t,e,i){(e=Xi({},e)).lineJoin="miter",e.lineCap="butt",super(t,e,i),this.options.radialSegments%2==1&&this.options.radialSegments--}getFormat(){const{lineWidthFn:t,lineColorFn:e,lineOpacityFn:i,linePatternAnimSpeedFn:n,linePatternGapFn:r}=this.et,o=[...this.getPositionFormat(),{type:Int8Array,size:4,name:"aTubeNormal"},{type:this.options.positionType||Uint16Array,width:1,name:"aLinesofar"}];if(this.iconAtlas){o.push({type:Int8Array,width:1,name:"aNormalDistance"});const t=this.getIconAtlasMaxValue();o.push({type:t>255?Uint16Array:Uint8Array,width:4,name:"aTexInfo"})}return t&&o.push({type:Uint16Array,width:1,name:"aLineWidth"}),e&&o.push({type:Uint8Array,width:4,name:"aColor"}),i&&o.push({type:Uint8Array,width:1,name:"aOpacity"}),n&&o.push({type:Int8Array,width:1,name:"aLinePatternAnimSpeed"}),r&&o.push({type:Int8Array,width:1,name:"aLinePatternGap"}),o}addHalfVertex(t,e,i,n,r,o,s,a){const{x:l,y:u,z:c}=t,h=1*this.scaledDistance,d=this.options.radialSegments/2,{x:f,y:p,z:m}=s.dir,y=function(t,e,i,n,r,o,s,a){dt(Za,i,n,r),dt(Ya,o,s,0),gt(Ka,Za,Ya),mt(Ya,Ya),mt(Ka,Ka),Qa[e]||(Qa[e]=[]);const l=Qa[e];for(var u=0;u<e;u++){const t=Math.PI*u/e,i=1-Math.abs(t-0)/(Math.PI/2);l[u]=l[u]||[],tl(Ya,Ka,l[u],1,t,i*(a?-1:1))}return l}(0,d,f,p,m,e,i,r);this.prevVertex&&this.fillTubeElements(r),this.fillData(this.data,l,u,c||0,y,r,h,a)}fillTubeElements(t){const e=this.options.radialSegments/2,i=this.needAltitudeAttribute()?2:3,n=this.data.aPosition.length/i;for(let i=0;i<e;i++){const r=i+n-2*e;let o,s;i===e-1&&t?(o=i+n-2*e+1,s=i+n-2*e-2*e+1):(o=i+n+1,s=i+n+1-2*e),super.addElements(i+n-this.offset,o-this.offset,r-this.offset),super.addElements(r-this.offset,o-this.offset,s-this.offset)}}fillData(t,e,i,n,r,o,s,a){const{lineWidthFn:l,lineColorFn:u,lineOpacityFn:c,linePatternAnimSpeedFn:h,linePatternGapFn:d}=this.et,f=r.length;for(let o=0;o<f;o++){if(this.fillPosition(t,e,i,n),xt(r[o],r[o],63),t.aTubeNormal.push(...r[o]),t.aLinesofar.push(s),this.iconAtlas&&(t.aNormalDistance.push(63*a),t.aTexInfo.push(...this.feaTexInfo)),l){const e=an(this.options.metric);let i=this.feaLineWidth*e;isNaN(i)&&(i=0),t.aLineWidth.push(Math.round(i))}u&&t.aColor.push(...this.feaColor),c&&t.aOpacity.push(this.feaOpacity),h&&t.aLinePatternAnimSpeed.push(127*(this.feaPatternAnimSpeed||0)),d&&t.aLinePatternGap.push(10*(this.feaLinePatternGap||0))}this.maxPos=Math.max(this.maxPos,Math.abs(e)+1,Math.abs(i)+1)}}const Za=[],Ya=[],Ka=[],Qa={};function tl(t,e,i,n,r,o){return wt(i,n*(Math.cos(r)*t[0]+Math.sin(r)*e[0]),n*(Math.cos(r)*t[1]+Math.sin(r)*e[1]),n*(Math.cos(r)*t[2]+Math.sin(r)*e[2]),o),i}class el extends Xa{addHalfVertex(t,e,i,n,r,o,s,a){const{x:l,y:u,z:c}=t,h=1*this.scaledDistance,{x:d,y:f,z:p}=s.dir,m=function(t,e,i,n,r,o,s,a){dt(nl,i,n,r),dt(rl,o,s,0),gt(ol,nl,rl),mt(rl,rl),mt(ol,ol),function(t,e,i){t[0]=e,t[1]=i}(il,t,e);const l=zt(il)/t,u=Math.atan(e/t);let c=Math.PI/2+(Math.PI/2-u);return sl[0]||(sl[0]=[]),tl(rl,ol,sl[0],l,c,a?1:-1),c+=2*u,sl[1]||(sl[1]=[]),tl(rl,ol,sl[1],l,c,a?1:-1),sl}(this.feaLineWidth,this.feaLineHeight,d,f,p,e,i,r);this.prevVertex&&this.fillTubeElements(r),this.fillData(this.data,l,u,c||0,m,r,h,a)}}const il=[],nl=[],rl=[],ol=[],sl=[];var al=Object.freeze({__proto__:null,clipPolygon:Wa,calculateSignedArea:ln,getFeaAltitudeAndHeight:hn,convertRTLText:ra,packPosition:yn,unpackPosition:function(t,e,i,n){const r=(Math.sign(e)||1)*(Math.abs(e)%gn),o=(Math.sign(i)||1)*(Math.abs(i)%gn),s=Math.floor(Math.abs(e)/gn),a=Math.floor(Math.abs(i)/gn);return t[0]=r,t[1]=o,t[2]=Math.sign(n+1e-5)*(2*s+a)*bn+n,t}});const ll={polygonPatternFile:1,markerFile:1,markerPlacement:1,markerSpacing:1,textName:1,textStyle:1,textFaceName:1,textWeight:1,textPlacement:1,textSpacing:1,lineJoin:1,lineCap:1,linePatternFile:1};Object.assign({visible:1,textHorizontalAlignment:1,textVerticalAlignment:1,textWrapWidth:1,markerHorizontalAlignment:1,markerVerticalAlignment:1},ll),Object.assign({lineDasharray:1},ll);function ul(t,e,i,n,r,o,s,a,l,u,c,h,d,f,p){const m=e.length,y=r/3;for(let i=2,n=m;i<n;i+=3)t[r+i-2]=e[i-2],t[r+i-1]=e[i-1],t[r+i-0]=e[i]-o;r+=m;for(let i=2,n=m;i<n;i+=3)t[r+i-2]=e[i-2],t[r+i-1]=e[i-1],t[r+i-0]=e[i]-s;r+=m;for(let i=2,n=m;i<n;i+=3)t[r+i-2]=e[i-2],t[r+i-1]=e[i-1],t[r+i-0]=e[i]-o;r+=m;for(let i=2,n=m;i<n;i+=3)t[r+i-2]=e[i-2],t[r+i-1]=e[i-1],t[r+i-0]=e[i]-s;r+=m,(i=i||[]).push(m/3);for(let e=0;e<i.length;e++){cl(y+(i[e-1]||0),y+i[e],t,m/3,a,n,l,u,c,h,d,f,p)}return r}function cl(t,e,i,n,r,o,s,a,l,u,c,h,d){const f=o.length;let p,m;for(let s=t,a=e;s<a-1;s++)p=s,m=s+1,it(i,p,m,r)||((s-t)%2==1&&(p+=2*n,m+=2*n),o.push(p+n,p,m),o.push(m,m+n,p+n));s&&function(t,e,i,n,r,o,s,a,l){let u,c=0,h=0,d=0,f=0;for(let p=n.length-1;p>=0;p--){const m=3*n[p],y=3*n[p]+1,g=3*n[p]+2,b=i[m],v=i[y],w=i[g];c||h||(c=Math.max(i[g],i[3*n[p-2]+2]),h=Math.min(i[g],i[3*n[p-2]+2]),u=c-h);let x=d;const k=p%6;0===t?(5===k&&(f=It(i,n,p,b,v)),x=2===k||3===k||4===k?d:d+f):1===t&&(2===k||3===k||4===k?x=0:5===k?(f=It(i,n,p,b,v),x=f):x=f);const M=x*s*a/r,j=w===c?0:u*l/o;e[m/3*2]=M,e[m/3*2+1]=-j,0===k&&(d+=f)}}(a,l,i,o.slice(f,o.length),u[0],u[1],c,h,d)}function hl(t,e,i,n,r,o,s,u,c,h){void 0===e.top&&(e.top=!0),void 0===e.side&&(e.side=!0);const{altitudeScale:d,altitudeProperty:f,defaultAltitude:p,heightProperty:y,minHeightProperty:g,defaultHeight:b,tangent:j,uv:A,uvScale:F,topUVMode:T,sideUVMode:z,top:S,side:_,topThickness:P}=e,I=function(t,e,{altitudeScale:i,altitudeProperty:n,defaultAltitude:r,heightProperty:o,minHeightProperty:s,defaultHeight:a},{side:l,top:u,topThickness:c,uvOrigin:h,uv:d,uvSize:f,topUVMode:p,sideUVMode:y,glScale:g,localScale:b,vScale:w},M){const j=e/t[0].extent,A=[],F=[],T=[],z=[],S=[],_=[],P=!!d,I=!!u,O=!!l,E=P?[]:null;function q(t,i,n,r){if(I){const r=Ti(z,n,3);if(0===r.length)return i;let o;v(S,z),i+=z.length;for(let e=2,i=r.length;e<i;e+=3)o=r[e-1],r[e-1]=r[e]+t/3,r[e]=o+t/3,r[e-2]+=t/3;v(_,r),P&&St(p||0,t,i,E,S,0,g,b,f[0],f[1]),c>0&&!O&&(i=ul(S,z,n,_,i,0,c,e,P,y||0,E,f,g,b,w))}return O&&(I&&(c=0),i=ul(S,z,n,_,i,c,r,e,P,y||0,E,f,g,b,w)),i}let R=0,C=0;const N=[-1,-1,e+1,e+1];let L=0,D=t.length;void 0!==M&&(L=M,D=M+1);let U=0,$=!1;for(;L<D;L++){const l=t[L],u=l.id;m(u)&&(Math.abs(u)>U&&(U=Math.abs(u)),u<0&&($=!0));const c=l.geometry,{altitude:h,height:d}=al.getFeaAltitudeAndHeight(l,i,n,r,o,a,s);R=Math.max(Math.abs(h),R);const f=S.length;let p=C,y=[];z.length=0;for(let t=0,i=c.length;t<i;t++){const n=al.calculateSignedArea(c[t])<0;!n&&t>0&&(C=q(p,C,y,d*j),z.length=0,y=[],p=C);let r=c[t];if(e!==1/0&&(r=al.clipPolygon(r,N)),!r.length){t===i-1&&(C=q(p,C,y,d*j));continue}const o=r.length;Array.isArray(r[0])?r[0][0]===r[o-1][0]&&r[0][1]===r[o-1][1]||r.push([r[0][0],r[0][1]]):r[0].x===r[o-1].x&&r[0].y===r[o-1].y||r.push(r[0]),n&&y.push(z.length/3),et(z,z.length,r,j,h),t===i-1&&(C=q(p,C,y,d*j))}const g=S.length-f,b="__fea_idx".trim();for(let t=0;t<g/3;t++)F.push(void 0===l[b]?L:l[b]),A.push(L),m(u)&&T.push(u)}const W=x(F.length?F[F.length-1]:0),J={maxAltitude:R,vertices:new(k(Math.max(512,R)))(S),indices:_,pickingIds:new W(F),featureIndexes:A};if(T.length){const t=$?k(U):x(U);J.featureIds=new t(T)}else J.featureIds=[];return E&&(E.length=S.length/3*2,J.uvs=E),J}(t,i,{altitudeScale:d,altitudeProperty:f,defaultAltitude:p||0,heightProperty:y,minHeightProperty:g,defaultHeight:b||0},{top:S,side:_,topThickness:10*P||0,uv:A||j,uvSize:F?[.5*F[0],.5*F[1]]:[.5,.5],uvOrigin:n,topUVMode:T,sideUVMode:z,glScale:r,localScale:s,vScale:o},h),O=[],E=new(w(I.vertices.length/3))(I.indices);delete I.indices,O.push(E.buffer,I.vertices.buffer,I.pickingIds.buffer);const q=Ye(I.vertices,E);let R=!0;for(let t=0;t<q.length;t++)q[t]=-q[t],q[t]%1!=0&&(R=!1);if(I.normals=q,j){let t=function(t,e,i,n){const r=t.length/3,o=new Array(4*r),s=[],a=[];for(let t=0;t<r;t++)s[t]=[0,0,0],a[t]=[0,0,0];const l=[0,0,0],u=[0,0,0],c=[0,0,0],h=[0,0],d=[0,0],f=[0,0],p=[0,0,0],m=[0,0,0];function y(e,n,r){Ke(l,t,3*e),Ke(u,t,3*n),Ke(c,t,3*r),Qe(h,i,2*e),Qe(d,i,2*n),Qe(f,i,2*r);const o=u[0]-l[0],y=c[0]-l[0],g=u[1]-l[1],b=c[1]-l[1],v=u[2]-l[2],w=c[2]-l[2],x=d[0]-h[0],k=f[0]-h[0],M=d[1]-h[1],j=f[1]-h[1],A=1/(x*j-k*M);dt(p,(j*o-M*y)*A,(j*g-M*b)*A,(j*v-M*w)*A),dt(m,(x*y-k*o)*A,(x*b-k*g)*A,(x*w-k*v)*A),ft(s[e],s[e],p),ft(s[n],s[n],p),ft(s[r],s[r],p),ft(a[e],a[e],m),ft(a[n],a[n],m),ft(a[r],a[r],m)}for(let t=0,e=n.length;t<e;t+=3)y(n[t+0],n[t+1],n[t+2]);const g=[],b=[],v=[],w=[];let x,k,M;function j(t){Ke(v,e,3*t),ht(w,v),k=s[t],ht(g,k),bt(g,g,function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}(v,v,yt(v,k))),mt(g,g),gt(b,w,k),M=yt(b,a[t]),x=M<0?-1:1,o[4*t]=g[0],o[4*t+1]=g[1],o[4*t+2]=g[2],o[4*t+3]=x}for(let t=0,e=n.length;t<e;t+=3)j(n[t+0]),j(n[t+1]),j(n[t+2]);return o}(I.vertices,I.normals,I.uvs,E);t=function(t,e){const i=new Float32Array(e.length),n=[],r=[],o=[];for(let s=0;s<e.length;s+=4){const a=s/4*3;dt(r,t[a]||0,t[a+1]||0,t[a+2]||0),wt(n,e[s]||0,e[s+1]||0,e[s+2]||0,e[s+3]||0),Ze(o,r,n),vt(i.subarray(s,s+4),o)}return i}(I.normals,t),I.tangents=t,O.push(t.buffer),delete I.normals}if(I.normals&&(I.normals=R?new Int8Array(I.normals):new Float32Array(I.normals),O.push(I.normals.buffer)),I.uvs){const t=I.uvs;I.uvs=new Float32Array(t),O.push(I.uvs.buffer)}const C=function(t,e,i,n){const r={};if(M(e.polygonFill)){const o={},s=l(e.polygonFill),a=new Uint8Array(4*n.length);for(let e=0;e<n.length;e++){const r=t[n[e]],l=r.properties||{};l.$layer=r.layer,l.$type=r.type;let u=s(i,l);if(delete l.$layer,delete l.$type,Array.isArray(u)||(u=o[u]=o[u]||We(u).array()),Array.isArray(u)){for(let t=0;t<u.length;t++)dl[t]=255*u[t];3===u.length&&(dl[3]=255)}a[4*e]=dl[0],a[4*e+1]=dl[1],a[4*e+2]=dl[2],a[4*e+3]=dl[3]}r.aColor=a}if(M(e.polygonOpacity)){const o=a(e.polygonOpacity),s=new Uint8Array(n.length);for(let e=0;e<n.length;e++){const r=t[n[e]],a=r.properties||{};a.$layer=r.layer,a.$type=r.type;const l=o(i,a);delete a.$layer,delete a.$type,s[e]=255*l}r.aOpacity=s}return r}(t,u,c,I.featureIndexes),N={data:{data:{aPosition:I.vertices,aNormal:I.normals,aTexCoord0:I.uvs,aTangent:I.tangents,aPickingId:I.pickingIds},indices:E,properties:{maxAltitude:I.maxAltitude}},buffers:O};return I.featureIds.length?(N.data.featureIds=I.featureIds,O.push(N.data.featureIds.buffer)):N.data.featureIds=[],C.aColor&&(N.data.data.aColor=C.aColor,N.buffers.push(C.aColor.buffer)),C.aOpacity&&(N.data.data.aOpacity=C.aOpacity,N.buffers.push(C.aOpacity.buffer)),N}const dl=[];function fl(t,e,{altitudeScale:i,altitudeProperty:n,defaultAltitude:r,heightProperty:o,minHeightProperty:s,defaultHeight:a,bottom:l}){const u=l,c=e/t[0].extent,h=2*function(t,e){let i=0;for(let n=0,r=t.length;n<r;n++){const r=t[n];if(m(r.geometry[0][0])){const t=3*r.geometry.length;i+=e?2*t-6:t}else for(let t=0,n=r.geometry.length;t<n;t++){let n=3*r.geometry[t].length;3===r.type&&(n-=3),i+=e?2*n-6:n}}return i}(t)+3*t.length*2,d=[],f=new Int16Array(h),p=[];function y(t,i,n){const r=i-t,o=f.subarray(t,i),s=f.subarray(i,i+r);s.set(o);for(let t=2,e=s.length;t<e;t+=3)s[t]=o[t]-n;const a=t/3,l=r/3;let c,h;for(let t=a,i=l+a;t<i;t++)t<i-1?(c=t,h=t+1):(c=t,h=a),it(f,c,h,e)||(p.push(c,h),u&&p.push(c+l,h+l),pl(f,c,e)||p.push(c,c+l));return i+r}let g=0,b=0;const v="__fea_idx".trim();for(let e=0,l=t.length;e<l;e++){const l=t[e],u=l.geometry,{altitude:h,height:m}=al.getFeaAltitudeAndHeight(l,i,n,r,o,a,s);b=Math.max(Math.abs(h),b);let w=g;for(let t=0,e=u.length;t<e;t++){let e=u[t];const i=e.length;e[0][0]===e[i-1][0]&&e[0][1]===e[i-1][1]&&(e=e.slice(0,i-1)),g=et(f,w,e,c,h),g=y(w,g,m*c),w=g}const x=p.length-d.length;for(let t=0;t<x;t++)d.push(l[v])}const M=new(w(p.reduce((t,e)=>Math.max(t,e),0)))(p),j=x(t.length);return{aPosition:new(k(Math.max(512,b)))(f),indices:M,aPickingId:new j(d)}}function pl(t,e,i){const n=t[3*e],r=t[3*e+1];return n<0||n>i||r<0||r>i}function ml(t,e,i){const n=fl(t,i,e),r=[n.aPosition.buffer,n.indices.buffer,n.aPickingId.buffer],o=n.indices;return delete n.indices,{data:{data:n,indices:o},buffers:r}}class yl{constructor(t,e,i,n,r){this.id=t,this.options=e,this.upload=i,this.Tt(e.style),this.requests={},this.zt=0,this.St=n,this.loadings=r}updateStyle(t,e){this.options.style=t,this.Tt(t),this.zt++,e()}updateOptions(t,e){this.options=f(this.options,t),e()}loadTile(t,e){const i=this.loadings,n=t.tileInfo.url,r=this.options.debugTile;if(r){const{x:i,y:n,z:o}=t.tileInfo;if(o!==r.z||i!==r.x||n!==r.y)return void e()}if(this.St.has(n)){const{features:r,layers:o}=this.St.get(n),s=i[n];if(delete i[n],!r||!r.length)return this._t(s),void e();if(s)for(let e=0;e<s.length;e++)this.Pt.call(s[e].ref,t,s[e].callback,n,o,r);this.Pt(t,e,n,o,r)}else i[n]?i[n].push({callback:e,ref:this}):(i[n]=[{callback:e,ref:this}],this.requests[n]=this.getTileFeatures(t.tileInfo,(e,r,o,s)=>{const a=i[n];if(delete i[n],this.checkIfCanceled(n))return delete this.requests[n],void this._t(a,null,{canceled:!0});if(delete this.requests[n],this.options.debug&&r)for(let e=0;e<r.length;e++)r[e]._debug_info={index:e,tileId:t.tileInfo.id};if(e)return e.loading||this.St.add(n,{features:[],layers:[]}),void this._t(a,e);if(!r||!r.length)return this.St.add(n,{features:[],layers:[]}),void this._t(a);if(this.St.add(n,{features:r,layers:o}),a)for(let e=0;e<a.length;e++)this.Pt.call(a[e].ref,t,a[e].callback,n,o,r,s)}))}Pt(t,e,i,n,r,o){this.It(n,r,t).then(t=>{t.canceled?e(null,{canceled:!0}):(t.data.style=this.zt,o&&f(t.data,o),e(null,t.data,t.buffers))}).catch(t=>{e(t)})}abortTile(t,e){delete this.requests[t],this.Ot(t),e()}Ot(t){const e=this.loadings[t];if(e)for(let t=0;t<e.length;t++)e[t].callback(null,{canceled:!0});delete this.loadings[t]}_t(t,e,i){if(t)for(let n=0;n<t.length;n++)t[n].callback(e,i)}checkIfCanceled(t){return!this.requests[t]}fetchIconGlyphs(t,e,i){this.upload("fetchIconGlyphs",{icons:t,glyphs:e},null,i)}It(t,e,i){if(!e.length)return Promise.resolve({data:null,buffers:[]});const{glScale:n,tileInfo:r}=i,o=!this.options.style.style.length&&!this.options.style.featureStyle.length;let s=this.pluginConfig.slice(0);o&&(s=this.Et(t)),this.featurePlugins&&v(s,this.featurePlugins);const a=e[0].extent,l=r.z,u={x:r.extent2d.xmin*n,y:r.extent2d.ymax*n},c=[],h=[],d=[],p=this.options,m=[],y={},g=[Promise.resolve(this.zt)];let b=0,x=-1;for(let t=0;t<s.length;t++){x++;const n=s[t];n.type!==b&&(x=0,b=n.type);const r=0===n.type?c:h;if(n.symbol&&!1===n.symbol.visible){r[x]=null;continue}const{tileFeatures:f,tileFeaIndexes:p}=this.qt(n.type,n.filter,e,y,t);if(!f.length){r[x]=null;continue}const v=w(p[p.length-1]);r[x]={styledFeatures:new v(p)},d.push({idx:t,typeIdx:x}),m.push(r[x].styledFeatures.buffer);let k=this.Rt(f,n,{extent:a,zoom:l,tilePoint:u,...i});o&&(k=k.then(t=>{if(!t)return null;if(t.data)t.data.layer=f[0].layer;else if(Array.isArray(t))for(let e=0;e<t.length;e++)t[e]&&t[e].data&&(t[e].data.layer=f[0].layer);return t})),g.push(k)}return Promise.all(g).then(([i,...n])=>{function r(t,e){if(void 0===t.data.ref&&(t.data.type=s[d[e].idx].renderPlugin.dataConfig.type,t.data.filter=s[d[e].idx].filter.def,t.buffers&&t.buffers.length))for(let e=0;e<t.buffers.length;e++)m.push(t.buffers[e])}if(i!==this.zt)return{canceled:!0};for(let t=0;t<n.length;t++){if(!n[t])continue;const e=n[t],i=0===s[d[t].idx].type?c:h;if(Array.isArray(e)){const n=[];for(let i=0;i<e.length;i++)e[i]&&(r(e[i],t),(void 0===e[i].data.ref||e[e[i].data.ref])&&n.push(e[i].data));n.length&&(i[d[t].typeIdx].data=n)}else r(e,t),i[d[t].typeIdx].data=e.data}const o={},l=t;if(p.features||p.schema){let t;for(let i=0,n=e.length;i<n;i++)if(t=e[i],l[t.layer].properties||(l[t.layer].properties=vl(t.properties)),p.features&&t&&y[i])if("id"===p.features)o[i]=t.id;else{const e=f({},t);p.pickingGeometry||delete e.geometry,delete e.extent,delete e.properties.$layer,delete e.properties.$type,delete e.__index,o[i]=e}}return{data:{schema:l,data:c,featureData:h,extent:a,features:o},buffers:m}}).catch(t=>{console.error(t)})}Rt(t,e,i){let n=function(t,e){const i=e.customProperties;if(i)for(let t=0;t<i.length;t++)i[t].fn=us.compileFilter(i[t].filter);for(let e=0;e<t.length;e++)if(t[e]=f({},t[e]),i)for(let n=0;n<i.length;n++)if(i[n].fn(t[e])){t[e].geojson&&(t[e].properties=f({},t[e].properties)),f(t[e].properties,i[n].properties);break}return t}(t,e);const r=e.renderPlugin.dataConfig,o=e.symbol,s=this.options.tileSize[0],{extent:a,glScale:l,zScale:u,zoom:c,tilePoint:h,pointAtTileRes:d}=i,p=a/s,m=r.type,y=this.options.debugTile&&this.options.debugTile.index;if("3d-extrusion"===m){const t=wl(o);return t&&(r.uv=1,2===t&&(r.tangent=1)),Promise.all([Promise.resolve(hl(n,r,a,h,l,u,this.options.tileSize[1]/a,o,c,y))])}if("3d-wireframe"===m)return Promise.all([Promise.resolve(ml(n,r,a))]);if("point"===m){const t=f({},r,{EXTENT:a,requestor:this.fetchIconGlyphs.bind(this),zoom:c,debugIndex:y,altitudeToTileScale:u*a/this.options.tileSize[1]/l}),e=ka.splitPointSymbol(o);return ka.needMerge(e[0])&&(n=ka.mergeLineFeatures(n,e[0],c)),Promise.all(e.map(e=>new ka(n,e,t).load(p)))}if("native-point"===m){const t=f({},r,{EXTENT:a,zoom:c,debugIndex:y});return xl(n,o,t,Da,a/s)}if("line"===m){const t=f({},r,{EXTENT:a,requestor:this.fetchIconGlyphs.bind(this),tileRatio:p,zoom:c,debugIndex:y});return xl(n,o,t,Sa)}if("native-line"===m){const t=f({},r,{EXTENT:a,zoom:c,debugIndex:y});return xl(n,o,t,Na)}if("fill"===m){const t=f({},r,{EXTENT:a,requestor:this.fetchIconGlyphs.bind(this),zoom:c,debugIndex:y});return xl(n,o,t,Ga)}if("line-extrusion"===m){delete o.lineGradientProperty,o.lineJoin="miter",o.lineCap="butt";const t=wl(o);t&&(r.uv=1,2===t&&(r.tangent=1));const e=f({},r,{EXTENT:a,tileSize:s,zScale:u,glScale:l,zoom:c,debugIndex:y});if(t){const t=[];if(!1!==r.top){const i=f({},e);i.side=!1,t.push(new Ra(n,o,i))}return!1!==r.side&&(e.side=!0,e.top=!1,t.push(new Ra(n,o,e))),Promise.all(t.map(t=>t.load()))}return Promise.all([new Ra(n,o,e).load()])}if("circle"===m){const t=f({},r,{EXTENT:a,zoom:c,debugIndex:y});return xl(n,o,t,Ba)}if("round-tube"===m||"square-tube"===m){const t="round-tube"===m?Xa:el,e=f({},r,{EXTENT:a,requestor:this.fetchIconGlyphs.bind(this),zoom:c,debugIndex:y,radialSegments:"round-tube"===m?r.radialSegments||8:4,pointAtTileRes:d,tileRatio:p,isTube:!0});return xl(n,o,e,t)}return Promise.resolve([])}qt(t,e,i,n){const r="__fea_idx".trim(),o=[],s=[],a=i.length;for(let l=0;l<a;l++)if((1===t||void 0===i[l].id||!this.styledFeatures[i[l].id])&&((!e.def||"default"===e.def)&&!n[l]||!0===e.def||e.def&&(void 0!==e.def.condition||Array.isArray(e.def))&&e(i[l]))){n[l]=1;const e=f({},i[l]);if(e[r]=l,s.push(e),o.push(l),1===t)break}return{tileFeatures:s,tileFeaIndexes:o}}Tt(t){const{style:e,featureStyle:i}=t,n={};i.forEach(t=>{Array.isArray(t.id)?(t.id.forEach(t=>{n[t]=1}),t.filter=["in","$id",...t.id]):(n[t.id]=1,t.filter=["==","$id",t.id])});const r=us.compileStyle(e);for(let t=0;t<e.length;t++)r[t].filter&&(r[t].filter.def=e[t].filter?e[t].filter.value||e[t].filter:void 0),r[t].type=0;const o=[],s=us.compileStyle(i);for(let t=0;t<i.length;t++)s[t].type=1,s[t].filter.def=i[t].filter?i[t].filter.value||i[t].filter:void 0,s[t].renderPlugin&&o.push(s[t]);this.pluginConfig=r,this.featurePlugins=o,this.styledFeatures=n}Et(t){let e=this.Ct;this.Ct||(e=this.Ct={});const i=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],n=[];for(const r in t){const o=r;if(!e[r]){const n=[];for(let e=0;e<t[r].types.length;e++){const s=t[r].types[e],a=["all",["==","$layer",o],["==","$type",i[s]]],l={filter:Lt(a),renderPlugin:gl(s),symbol:bl(s)};l.filter.def=a,l.type=0,n.push(l)}e[o]=n}n.push(...e[o])}return n}}function gl(t){switch(t){case 1:return{type:"native-point",dataConfig:{type:"native-point",only2D:!0}};case 2:return{type:"native-line",dataConfig:{type:"native-line",only2D:!0}};case 3:return{type:"fill",dataConfig:{type:"fill",only2D:!0}}}return null}function bl(t){switch(t){case 1:return{markerFill:"#f00",markerSize:10};case 2:return{lineColor:"#fff"};case 3:return{polygonFill:"#00f",polygonOpacity:.4}}return null}function vl(t){if(Array.isArray(t)||!g(t))return{};const e={};for(const i in t){const n=t[i];p(n)?e[i]="string":m(n)?e[i]="number":!0===n||!1===n?e[i]="boolean":Array.isArray(n)?e[i]="array":e[i]="object"}return e}function wl(t){if(!t)return 0;let e=0;for(const i in t){if(("normalTexture"===i||"bumpTexture"===i)&&t[i])return 2;if(i.indexOf("Texture")>0&&t[i])e=1;else if(g(t[i])){const n=wl(t[i]);if(2===n)return n;1===n&&(e=1)}}return e}function xl(t,e,i,n,r){const o={},s=Array.isArray(e)?e:[e];let a=-1;for(let t=0;t<s.length;t++)o[t]=kl(s[t]),!o[t]&&s[t]&&-1===a&&(a=t);const l=[];for(let e=0;e<s.length;e++)s[e]&&(s[e].index={index:e},o[e]||e===a?l.push(new n(t,s[e],i).load(r)):l.push({data:{ref:a,symbolIndex:{index:e}}}));return Promise.all(l)}function kl(t){if(!t)return 0;for(const e in t)if(M(t[e]))return 1;return 0}function Ml(t,e){jl(t.geometry,e)}function jl(t,e){if(t)switch(t.type){case"Point":Al(t.coordinates,e);break;case"MultiPoint":case"LineString":Fl(t.coordinates,e);break;case"MultiLineString":case"Polygon":Tl(t.coordinates,e);break;case"MultiPolygon":!function(t,e){for(let i=0;i<t.length;i++)Tl(t[i],e)}(t.coordinates,e);break;case"GeometryCollection":for(let i=0;i<t.geometries.length;i++)jl(t.geometries[i],e)}}function Al(t,e){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Fl(t,e){for(let i=0;i<t.length;i++)Al(t[i],e)}function Tl(t,e){for(let i=0;i<t.length;i++)Fl(t[i],e)}class zl extends yl{constructor(t,e,i,n,r,o){super(t,e,i,n,r),(e=e||{}).extent||(e.extent=8192),this.zoomOffset=0,e.tileSize&&(this.zoomOffset=-function(t){if(Math.log2)return Math.log2(t);const e=Math.log(t)*Math.LOG2E,i=Math.round(e);return Math.abs(i-e)<1e-14?i:e}(e.tileSize[0]/256)),this.setData(e.data,o)}setData(t,e){if(delete this.index,!t)return void e();const i={maxZoom:24,tolerance:this.options.simplifyTolerance,extent:this.options.extent,buffer:this.options.tileBuffer||64,hasAltitude:!!this.options.hasAltitude,debug:0,lineMetrics:!0,indexMaxZoom:5,indexMaxPoints:1e5,disableFilter:!0};if(p(t)&&"{"!=t.substring(0,1)||t.url)A.getJSON(t.url?t.url:t,t.url?t:{},(t,n)=>{if(t&&e(t),!n)return void e(null,{extent:null,idMap:{}});const r=n,{first1000:o,idMap:s}=this.Nt(r);this.Lt(o,s,r,i,e)});else{"string"==typeof t&&(t=JSON.parse(t));const n=Array.isArray(t)?t:t.features;let r=n;n&&n.length>1e3&&(r=n.slice(0,1e3)),this.Lt(r,null,t,i,e)}}Lt(t,e,i,n,r){try{const o=t&&t.length?function(t){let e=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];switch(t.type){case"FeatureCollection":for(let i=0;i<t.features.length;i++)Ml(t.features[i],e);break;case"Feature":Ml(t,e);break;default:jl(t,e)}return e}({type:"FeatureCollection",features:t}):null;this.index=function(t,e){return new Q(t,e)}(i,this.options.geojsonvt||n),r(null,{extent:o,idMap:e})}catch(t){console.warn(t),r({error:t.message})}}Nt(t){const e=[],i={};let n=0;function r(t){t&&("Feature"!==t.type||t.geometry)&&(void 0!==t.id&&null!==t.id||(t.id=n++),i[t.id]=f({},t),t.geometry?(i[t.id].geometry=f({},t.geometry),i[t.id].geometry.coordinates=null):t.coordinates&&(i[t.id].coordinates=null),e.length<1e3&&e.push(t))}return Array.isArray(t)?t.forEach(t=>{r(t)}):t.features&&t.features.forEach(t=>{r(t)}),{first1000:e,idMap:i}}getTileFeatures(t,e){const i=[];if(!this.index)return setTimeout((function(){e({loading:!0})}),1),1;const n=this.index.getTile(t.z+this.zoomOffset,t.x,t.y);if(!n||0===n.features.length)return setTimeout((function(){e(null,i,[])}),1),1;const r=[];for(let t=0,e=n.features.length;t<e;t++){const e=n.features[t];let o=e.layer;void 0===o&&(o="0"),r[o]={types:{}};r[o].types[e.type]=1,e.tags=e.tags||{},i.push({type:e.type,layer:o,id:e.id,geometry:e.geometry,properties:e.tags,extent:this.options.extent,geojson:!0})}for(const t in r)r[t].types=Object.keys(r[t].types).map(t=>+t);return setTimeout((function(){e(null,i,r)}),1),1}onRemove(){delete this.index}}var Sl={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=i?r-1:0,d=i?-1:1,f=t[e+h];for(h+=d,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=d,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+t[e+h],h+=d,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=u}return(f?-1:1)*s*Math.pow(2,o-n)},write:function(t,e,i,n,r,o){var s,a,l,u=8*o-r-1,c=(1<<u)-1,h=c>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+f]=255&a,f+=p,a/=256,r-=8);for(s=s<<r|a,u+=r;u>0;t[i+f]=255&s,f+=p,s/=256,u-=8);t[i+f-p]|=128*m}},_l=Il,Pl=Sl;function Il(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Il.Varint=0,Il.Fixed64=1,Il.Bytes=2,Il.Fixed32=5;var Ol="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function El(t){return t.type===Il.Bytes?t.readVarint()+t.pos:t.pos+1}function ql(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Rl(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function Cl(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Nl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Ll(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function Dl(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Ul(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function $l(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function Wl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Jl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Hl(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Gl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Vl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Bl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Il.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,o=this.pos;this.type=7&n,t(r,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Gl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Bl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Gl(this.buf,this.pos)+4294967296*Gl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Gl(this.buf,this.pos)+4294967296*Bl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Pl.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Pl.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(r=o[i.pos++],n=(112&r)>>4,r<128)return ql(t,n,e);if(r=o[i.pos++],n|=(127&r)<<3,r<128)return ql(t,n,e);if(r=o[i.pos++],n|=(127&r)<<10,r<128)return ql(t,n,e);if(r=o[i.pos++],n|=(127&r)<<17,r<128)return ql(t,n,e);if(r=o[i.pos++],n|=(127&r)<<24,r<128)return ql(t,n,e);if(r=o[i.pos++],n|=(1&r)<<31,r<128)return ql(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ol?function(t,e,i){return Ol.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var n="",r=e;for(;r<i;){var o,s,a,l=t[r],u=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>i)break;1===c?l<128&&(u=l):2===c?128==(192&(o=t[r+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===c?(o=t[r+1],s=t[r+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===c&&(o=t[r+1],s=t[r+2],a=t[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,c=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),r+=c}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Il.Bytes)return t.push(this.readVarint(e));var i=El(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Il.Bytes)return t.push(this.readSVarint());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Il.Bytes)return t.push(this.readBoolean());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Il.Bytes)return t.push(this.readFloat());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Il.Bytes)return t.push(this.readDouble());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Il.Bytes)return t.push(this.readFixed32());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Il.Bytes)return t.push(this.readSFixed32());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Il.Bytes)return t.push(this.readFixed64());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Il.Bytes)return t.push(this.readSFixed64());var e=El(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Il.Varint)for(;this.buf[this.pos++]>127;);else if(e===Il.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Il.Fixed32)this.pos+=4;else{if(e!==Il.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Vl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Vl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Vl(this.buf,-1&t,this.pos),Vl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Vl(this.buf,-1&t,this.pos),Vl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+1|0));if(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,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,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:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var n,r,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Rl(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Pl.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Pl.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&Rl(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,Il.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Cl,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Nl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ul,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ll,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Dl,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,$l,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Wl,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Jl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Hl,e)},writeBytesField:function(t,e){this.writeTag(t,Il.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Il.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Il.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Il.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Il.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Il.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Il.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Il.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Il.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Il.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Xl=Ot,Zl=Yl;function Yl(t,e,i,n,r){this.properties={},this.extent=i,this.type=0,this.Dt=t,this.Ut=-1,this.$t=n,this.Wt=r,t.readFields(Kl,this,e)}function Kl(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){var i=t.readVarint()+t.pos;for(;t.pos<i;){var n=e.$t[t.readVarint()],r=e.Wt[t.readVarint()];e.properties[n]=r}}(i,e):3==t?e.type=i.readVarint():4==t&&(e.Ut=i.pos)}function Ql(t){for(var e,i,n=0,r=0,o=t.length,s=o-1;r<o;s=r++)e=t[r],n+=((i=t[s]).x-e.x)*(e.y+i.y);return n}Yl.types=["Unknown","Point","LineString","Polygon"],Yl.prototype.loadGeometry=function(){var t=this.Dt;t.pos=this.Ut;for(var e,i=t.readVarint()+t.pos,n=1,r=0,o=0,s=0,a=[];t.pos<i;){if(r<=0){var l=t.readVarint();n=7&l,r=l>>3}if(r--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&a.push(e),e=[]),e.push(new Xl(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&a.push(e),a},Yl.prototype.bbox=function(){var t=this.Dt;t.pos=this.Ut;for(var e=t.readVarint()+t.pos,i=1,n=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,u=-1/0;t.pos<e;){if(n<=0){var c=t.readVarint();i=7&c,n=c>>3}if(n--,1===i||2===i)(r+=t.readSVarint())<s&&(s=r),r>a&&(a=r),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==i)throw new Error("unknown command "+i)}return[s,l,a,u]},Yl.prototype.toGeoJSON=function(t,e,i){var n,r,o=this.extent*Math.pow(2,i),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),u=Yl.types[this.type];function c(t){for(var e=0;e<t.length;e++){var i=t[e],n=180-360*(i.y+a)/o;t[e]=[360*(i.x+s)/o-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];c(l=h);break;case 2:for(n=0;n<l.length;n++)c(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,n,r=[],o=0;o<e;o++){var s=Ql(t[o]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i.push(t[o]))}i&&r.push(i);return r}(l),n=0;n<l.length;n++)for(r=0;r<l[n].length;r++)c(l[n][r])}1===l.length?l=l[0]:u="Multi"+u;var d={type:"Feature",geometry:{type:u,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var tu=Zl,eu=iu;function iu(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this.Dt=t,this.$t=[],this.Wt=[],this.Jt=[],t.readFields(nu,this,e),this.length=this.Jt.length}function nu(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e.Jt.push(i.pos):3===t?e.$t.push(i.readString()):4===t&&e.Wt.push(function(t){var e=null,i=t.readVarint()+t.pos;for(;t.pos<i;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(i))}iu.prototype.feature=function(t){if(t<0||t>=this.Jt.length)throw new Error("feature index out of bounds");this.Dt.pos=this.Jt[t];var e=this.Dt.readVarint()+this.Dt.pos;return new tu(this.Dt,e,this.extent,this.$t,this.Wt)};var ru=eu;function ou(t,e,i){if(3===t){var n=new ru(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}var su=function(t,e){this.layers=t.readFields(ou,{},e)};class au extends yl{constructor(t,e,i,n,r,o){super(t,e,i,n,r),e=e||{},o()}getTileFeatures(t,e){const i=t.url;return A.getArrayBuffer(i,(t,i)=>{if(t)return void e(t);let n;try{n=new su(new _l(i.data))}catch(t){return void e(t.message,[],[])}const r=[];if(!n.layers)return void e(null,r,[]);const o={};let s;for(const e in n.layers)if(a=n.layers,l=e,Object.prototype.hasOwnProperty.call(a,l)){o[e]={types:{}};const i=o[e].types;for(let o=0,a=n.layers[e].length;o<a;o++)try{s=n.layers[e].feature(o),i[s.type]=1,r.push({type:s.type,layer:e,geometry:s.loadGeometry(),properties:s.properties,extent:s.extent})}catch(t){console.warn("error when load vt geometry:",t)}}var a,l;for(const t in o)o[t].types=Object.keys(o[t].types).map(t=>+t);e(null,r,o,{byteLength:i.data.byteLength})})}abortTile(t,e){const i=this.requests[t];delete this.requests[t],i&&i.abort&&i.abort(),this.Ot(t),e()}onRemove(){for(const t in this.requests)this.requests[t].abort();this.requests={}}}let lu=0;const uu=new class{constructor(t){this.max=t,this.reset()}reset(){return this.data={},this.order=[],this}clear(){this.reset()}add(t,e){return this.has(t)?(this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t)):(this.data[t]=e,this.order.push(t),this.order.length>this.max&&this.getAndRemove(this.order[0])),this}has(t){return t in this.data}keys(){return this.order}getAndRemove(t){if(!this.has(t))return null;const e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e}get(t){return this.has(t)?this.data[t]:null}remove(t){return this.has(t)?(delete this.data[t],this.order.splice(this.order.indexOf(t),1),this):this}setMaxSize(t){for(this.max=t;this.order.length>this.max;)this.getAndRemove(this.order[0]);return this}}(128),cu={};class hu{constructor(t){this.Ht={},this.Gt={},this.workerId=t}addLayer({actorId:t,mapId:e,layerId:i,params:n},r){if(this.Vt(e,i))return;const o=this.Bt(e,i),s=n.type,a=n.options,l=this.send.bind(this,t);this.Ht[o]="GeoJSONVectorTileLayer"===s?new zl(i,a,l,uu,cu,r):new au(i,a,l,uu,cu,r)}removeLayer({mapId:t,layerId:e},i){const n=this.Vt(t,e),r=this.Bt(t,e);delete this.Ht[r],n&&(n.onRemove(i),this.Xt())}loadTile({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&r.loadTile(i,n)}abortTile({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&r.abortTile&&r.abortTile(i.url,n)}removeTile({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&r.removeTile(i,n)}updateStyle({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&(r.updateStyle(i,n),this.Xt())}updateOptions({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&(r.updateOptions(i,n),this.Xt())}setData({mapId:t,layerId:e,params:i},n){const r=this.Vt(t,e);r&&(r.setData(i.data,n),this.Xt())}receive(t){const e=t.callback,i=this.Gt[e];delete this.Gt[e],i&&t.error?i(new Error(t.error)):i&&i(null,t.data)}send(t,e,i,n,r){const o=r?`${t}-${lu++}`:null;r&&(this.Gt[o]=r),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:e,params:i,callback:String(o)},n||[])}Bt(t,e){return`${t}-${e}`}Vt(t,e){const i=this.Bt(t,e);return this.Ht[i]}Xt(){const t=Object.keys(cu);for(let e=0;e<t.length;e++)delete cu[t[e]];uu.reset()}}t.initialize=function(){},t.onmessage=function(t,e){const i=t.data;if(this.dispatcher||(this.dispatcher=new hu(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const n=i.command;this.dispatcher[n]({actorId:t.actorId,mapId:i.mapId,layerId:i.layerId,params:i.params},(t,i,r)=>{t&&404!==t.status&&console.error(n,t),e(t,i,r)})}},Object.defineProperty(t,"Zt",{value:!0})}';
|
|
29
29
|
|
|
30
30
|
let D = 0;
|
|
31
31
|
|
|
@@ -45,7 +45,7 @@ function L(t, ...e) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
function H(t) {
|
|
48
|
-
return !
|
|
48
|
+
return !q(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
function V(t) {
|
|
@@ -53,14 +53,14 @@ function V(t) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function U(t) {
|
|
56
|
-
return !
|
|
56
|
+
return !q(t) && ("function" == typeof t || null !== t.constructor && t.constructor === Function);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
function
|
|
59
|
+
function q(t) {
|
|
60
60
|
return null == t;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
function
|
|
63
|
+
function G(t) {
|
|
64
64
|
for (let e = 1; e < arguments.length; e++) {
|
|
65
65
|
const i = arguments[e];
|
|
66
66
|
if (i) for (let e = 0, n = i.length; e < n; e++) t.push(i[e]);
|
|
@@ -194,9 +194,9 @@ class X extends t.worker.Actor {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
const
|
|
197
|
+
const Y = {};
|
|
198
198
|
|
|
199
|
-
class
|
|
199
|
+
class J {
|
|
200
200
|
constructor(t, e, i) {
|
|
201
201
|
this.m = t, this.g = e, this.v = i || [ 0, 1, 0 ];
|
|
202
202
|
}
|
|
@@ -216,7 +216,7 @@ class Y {
|
|
|
216
216
|
const t = this.g.getDevicePixelRatio() > 1 ? 2 : 1;
|
|
217
217
|
o = this.M = document.createElement("canvas"), o.width = 512 * t, o.height = 64 * t;
|
|
218
218
|
const e = o.getContext("2d");
|
|
219
|
-
e.font = "36px monospace", e.scale(t, t), this.
|
|
219
|
+
e.font = "36px monospace", e.scale(t, t), this.I = this.m.texture({
|
|
220
220
|
width: o.width,
|
|
221
221
|
height: o.height,
|
|
222
222
|
data: o
|
|
@@ -224,7 +224,7 @@ class Y {
|
|
|
224
224
|
}
|
|
225
225
|
const s = o.getContext("2d");
|
|
226
226
|
s.clearRect(0, 0, o.width, o.height), s.fillStyle = `rgba(${this.v.map(t => 255 * t).join()})`,
|
|
227
|
-
s.fillText(t, 20, 36), this.
|
|
227
|
+
s.fillText(t, 20, 36), this.I({
|
|
228
228
|
width: o.width,
|
|
229
229
|
height: o.height,
|
|
230
230
|
data: o
|
|
@@ -234,7 +234,7 @@ class Y {
|
|
|
234
234
|
debugLine: 1,
|
|
235
235
|
primitive: "lines",
|
|
236
236
|
framebuffer: r || null,
|
|
237
|
-
image: this.
|
|
237
|
+
image: this.I,
|
|
238
238
|
count: 8
|
|
239
239
|
}), this.A({
|
|
240
240
|
transform: e,
|
|
@@ -242,23 +242,23 @@ class Y {
|
|
|
242
242
|
debugLine: 0,
|
|
243
243
|
primitive: "triangle strip",
|
|
244
244
|
framebuffer: r || null,
|
|
245
|
-
image: this.
|
|
245
|
+
image: this.I,
|
|
246
246
|
count: 4
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
249
|
delete() {
|
|
250
|
-
this.
|
|
250
|
+
this.I && (this.I.destroy(), delete this.I), this.P && (this.P.destroy(), delete this.P),
|
|
251
251
|
this.k && (this.k.destroy(), this.S.destroy(), delete this.k, delete this.S), this.A && (this.A.destroy(),
|
|
252
252
|
delete this.A);
|
|
253
253
|
}
|
|
254
254
|
_() {
|
|
255
|
-
this.
|
|
255
|
+
this.P = this.m.buffer(new Uint8Array([ 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1 ])),
|
|
256
256
|
this.A = this.m({
|
|
257
257
|
vert: "\n attribute vec2 aPosition;\n attribute vec2 aTexCoord;\n uniform mat4 transform;\n\n varying vec2 vTexCoord;\n void main()\n {\n gl_Position = transform * vec4(aPosition, 0.0, 1.0);\n vTexCoord = aTexCoord;\n }\n ",
|
|
258
258
|
frag: "\n precision mediump float;\n uniform sampler2D uImage;\n uniform vec3 uColor;\n uniform float uOpacity;\n uniform float uDebugLine;\n\n varying vec2 vTexCoord;\n\n void main()\n {\n if (uDebugLine == 1.) {\n gl_FragColor = vec4(uColor, 1.0) * uOpacity;\n } else {\n gl_FragColor = texture2D(uImage, vTexCoord) * uOpacity;\n }\n gl_FragColor *= gl_FragColor.a;\n }\n ",
|
|
259
259
|
attributes: {
|
|
260
260
|
aPosition: this.m.prop("data"),
|
|
261
|
-
aTexCoord: this.
|
|
261
|
+
aTexCoord: this.P
|
|
262
262
|
},
|
|
263
263
|
uniforms: {
|
|
264
264
|
transform: this.m.prop("transform"),
|
|
@@ -421,16 +421,16 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
421
421
|
return 0;
|
|
422
422
|
}
|
|
423
423
|
getWorkerConnection() {
|
|
424
|
-
return this.
|
|
424
|
+
return this.q;
|
|
425
425
|
}
|
|
426
426
|
setStyle() {
|
|
427
|
-
this.
|
|
427
|
+
this.G && this.G.update(), this.q ? (this.H++, this.q.updateStyle(this.layer.W(), t => {
|
|
428
428
|
if (t) throw new Error(t);
|
|
429
429
|
this.B = !0, this.clear(), this.$(), this.X(), this.setToRedraw(), this.layer.fire("refreshstyle");
|
|
430
430
|
})) : this.X();
|
|
431
431
|
}
|
|
432
432
|
updateOptions(t) {
|
|
433
|
-
this.
|
|
433
|
+
this.q && this.q.updateOptions(this.layer.getWorkerOptions(), e => {
|
|
434
434
|
if (e) throw new Error(e);
|
|
435
435
|
(t.features || t.pickingGeometry || t.altitudeProperty) && (this.clear(), this.$(),
|
|
436
436
|
this.X()), this.setToRedraw();
|
|
@@ -440,7 +440,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
440
440
|
const n = 0 === t ? this.plugins : this.featurePlugins;
|
|
441
441
|
if (!n || !n[e]) return;
|
|
442
442
|
this.B = !0;
|
|
443
|
-
const r = this.layer.W(), o = this.layer.
|
|
443
|
+
const r = this.layer.W(), o = this.layer.Y(t, r);
|
|
444
444
|
n[e].config = o[e].renderPlugin, n[e].updateSceneConfig({
|
|
445
445
|
sceneConfig: i
|
|
446
446
|
}), this.setToRedraw();
|
|
@@ -452,7 +452,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
452
452
|
updateSymbol(t, e, i) {
|
|
453
453
|
const n = 0 === t ? this.plugins : this.featurePlugins;
|
|
454
454
|
if (!n || !n[e]) return !1;
|
|
455
|
-
const r = this.layer.W(), o = this.layer.
|
|
455
|
+
const r = this.layer.W(), o = this.layer.Y(t, r), s = n[e];
|
|
456
456
|
s.style = o[e];
|
|
457
457
|
const a = s.updateSymbol(i, o[e].symbol);
|
|
458
458
|
return this.setToRedraw(), a;
|
|
@@ -461,14 +461,14 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
461
461
|
if (this.U.length) return !0;
|
|
462
462
|
const t = super.needToRedraw();
|
|
463
463
|
if (!t) {
|
|
464
|
-
const t = this.
|
|
464
|
+
const t = this.J();
|
|
465
465
|
for (let e = 0; e < t.length; e++) if (t[e] && t[e].needToRedraw()) return !0;
|
|
466
466
|
}
|
|
467
467
|
return t;
|
|
468
468
|
}
|
|
469
469
|
needRetireFrames() {
|
|
470
470
|
if (this.B) return !0;
|
|
471
|
-
const t = this.
|
|
471
|
+
const t = this.J();
|
|
472
472
|
for (let e = 0; e < t.length; e++) if (t[e] && t[e].needToRetireFrames()) return !0;
|
|
473
473
|
return !1;
|
|
474
474
|
}
|
|
@@ -477,7 +477,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
477
477
|
t ? (this.gl = this.canvas.gl.wrap(), this.regl = this.canvas.gl.regl) : this.Z(),
|
|
478
478
|
t && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)),
|
|
479
479
|
this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
|
|
480
|
-
this.K = new
|
|
480
|
+
this.K = new J(this.regl, this.getMap()), this.tt(), this.G = new o(this.regl, this.layer);
|
|
481
481
|
}
|
|
482
482
|
Z() {
|
|
483
483
|
const t = this.layer, e = t.options.glOptions || {
|
|
@@ -494,8 +494,8 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
tt() {
|
|
497
|
-
this.
|
|
498
|
-
this.
|
|
497
|
+
this.q || (this.q = new X("@maptalks/vt", this.layer));
|
|
498
|
+
this.q.addLayer((t, e) => {
|
|
499
499
|
this.layer && (this.ready = !0, this.layer.onWorkerReady(t, e), this.layer.fire("workerready"),
|
|
500
500
|
this.setToRedraw());
|
|
501
501
|
});
|
|
@@ -525,12 +525,12 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
525
525
|
this.it !== t && this.ut(t), this.dt(t), this.completeRender(), this.it = t) : this.completeRender()) : this.completeRender();
|
|
526
526
|
}
|
|
527
527
|
nt() {
|
|
528
|
-
this.
|
|
528
|
+
this.J().forEach((t, e) => {
|
|
529
529
|
t.renderIndex = e;
|
|
530
530
|
});
|
|
531
531
|
}
|
|
532
532
|
ut() {
|
|
533
|
-
const t = this.
|
|
533
|
+
const t = this.J();
|
|
534
534
|
this.ft = [];
|
|
535
535
|
let e = +!!this.layer.getGroundConfig().enable;
|
|
536
536
|
t.forEach((t, i) => {
|
|
@@ -550,7 +550,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
550
550
|
}
|
|
551
551
|
getShadowMeshes() {
|
|
552
552
|
const t = [];
|
|
553
|
-
return this.
|
|
553
|
+
return this.J().forEach((e, i) => {
|
|
554
554
|
if (!e) return;
|
|
555
555
|
if (!this.vt(i)) return;
|
|
556
556
|
const n = e.getShadowMeshes();
|
|
@@ -573,7 +573,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
573
573
|
this.V[e] = {
|
|
574
574
|
keys: {},
|
|
575
575
|
tiles: [ t ]
|
|
576
|
-
}, this.V[e].keys[t.id] = 1, this.
|
|
576
|
+
}, this.V[e].keys[t.id] = 1, this.q.loadTile({
|
|
577
577
|
tileInfo: t,
|
|
578
578
|
glScale: n,
|
|
579
579
|
zScale: this.ot,
|
|
@@ -597,7 +597,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
597
597
|
if (delete this.V[t], e) {
|
|
598
598
|
if (e.status && 404 === e.status) for (let t = 0; t < o.length; t++) {
|
|
599
599
|
const e = o[t];
|
|
600
|
-
this.onTileError(
|
|
600
|
+
this.onTileError(Y, e);
|
|
601
601
|
}
|
|
602
602
|
return;
|
|
603
603
|
}
|
|
@@ -681,13 +681,13 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
681
681
|
const e = i.layer, n = i.type;
|
|
682
682
|
t[e] || (t[e] = []);
|
|
683
683
|
const s = ("plugin_" + n).trim();
|
|
684
|
-
t[e][s] ? r = t[e][s] : (r = this.
|
|
684
|
+
t[e][s] ? r = t[e][s] : (r = this.It(n), r.filter = i.filter, t[e].push(r), t[e][s] = r,
|
|
685
685
|
o = !0);
|
|
686
686
|
} else {
|
|
687
687
|
const s = n.W();
|
|
688
|
-
if (r = n.
|
|
688
|
+
if (r = n.Y(t, s)[e], !r.renderPlugin) {
|
|
689
689
|
o = !0;
|
|
690
|
-
const {plugin: t, symbol: n, renderPlugin: s} = this.
|
|
690
|
+
const {plugin: t, symbol: n, renderPlugin: s} = this.It(i.type);
|
|
691
691
|
this.plugins[e] = t, r.symbol = n, r.renderPlugin = s;
|
|
692
692
|
}
|
|
693
693
|
}
|
|
@@ -696,17 +696,17 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
696
696
|
isUpdated: o
|
|
697
697
|
};
|
|
698
698
|
}
|
|
699
|
-
|
|
699
|
+
J(t) {
|
|
700
700
|
let e = this.plugins || [];
|
|
701
701
|
return this.layer.isDefaultRender() && this.Mt && (e = [], t ? t.layers && t.layers.forEach(t => {
|
|
702
702
|
const i = ("plugin_" + t.type).trim();
|
|
703
703
|
e.push(this.Mt[t.layer][i].plugin);
|
|
704
704
|
}) : Object.keys(this.Mt).forEach(t => {
|
|
705
705
|
for (let i = 0; i < this.Mt[t].length; i++) e.push(this.Mt[t][i].plugin);
|
|
706
|
-
})), this.featurePlugins && this.featurePlugins.length && (e = e.slice(),
|
|
706
|
+
})), this.featurePlugins && this.featurePlugins.length && (e = e.slice(), G(e, this.featurePlugins)),
|
|
707
707
|
e;
|
|
708
708
|
}
|
|
709
|
-
|
|
709
|
+
Pt() {
|
|
710
710
|
if (this.layer.isDefaultRender() && this.Mt) {
|
|
711
711
|
const t = [];
|
|
712
712
|
return Object.keys(this.Mt).forEach(e => {
|
|
@@ -717,7 +717,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
717
717
|
}
|
|
718
718
|
ht(t) {
|
|
719
719
|
const e = this.layer.isDefaultRender() && this.Mt, i = this.lt;
|
|
720
|
-
this.
|
|
720
|
+
this.J().forEach((n, r) => {
|
|
721
721
|
if (!n) return;
|
|
722
722
|
if (!this.vt(r)) return;
|
|
723
723
|
const o = e ? n.defaultSymbol : n.style && n.style.symbol, s = {
|
|
@@ -734,7 +734,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
734
734
|
});
|
|
735
735
|
}
|
|
736
736
|
dt(t) {
|
|
737
|
-
const e = this.lt, i = e.renderMode, n = e && e.renderTarget && e.renderTarget.fbo, r = this.getMap().cameraPosition, o = this.
|
|
737
|
+
const e = this.lt, i = e.renderMode, n = e && e.renderTarget && e.renderTarget.fbo, r = this.getMap().cameraPosition, o = this.J();
|
|
738
738
|
this.layer.options.collision ? o.forEach(e => {
|
|
739
739
|
if (!ct(e)) return;
|
|
740
740
|
if (i && "default" !== i && !e.supportRenderMode(i)) return;
|
|
@@ -750,7 +750,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
750
750
|
let l = !1;
|
|
751
751
|
if (a) {
|
|
752
752
|
const e = -this.layer.getPolygonOffset(), i = this.Ot(null, e, r, t);
|
|
753
|
-
i.offsetFactor = i.offsetUnits = e, this.
|
|
753
|
+
i.offsetFactor = i.offsetUnits = e, this.G.paint(i);
|
|
754
754
|
}
|
|
755
755
|
o.forEach((e, o) => {
|
|
756
756
|
if (!this.Ct(e)) return;
|
|
@@ -837,8 +837,8 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
837
837
|
drawTile(t, e) {
|
|
838
838
|
if (!e.cache) return;
|
|
839
839
|
const i = e.cache, n = st.set(t.extent2d.xmin, t.extent2d.ymax), r = t.transform = t.transform || this.calculateTileMatrix(n, t.z, t.extent), o = t.tileTranslationMatrix = t.tileTranslationMatrix || this.calculateTileTranslationMatrix(n, t.z), s = [];
|
|
840
|
-
|
|
841
|
-
this.
|
|
840
|
+
G(s, e.data), G(s, e.featureData);
|
|
841
|
+
this.J(e).forEach((n, a) => {
|
|
842
842
|
if (!n) return;
|
|
843
843
|
const l = this.vt(a);
|
|
844
844
|
if (!s[a] || !l) return;
|
|
@@ -868,8 +868,8 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
868
868
|
let i = e.cache;
|
|
869
869
|
i || (i = e.cache = {});
|
|
870
870
|
const n = st.set(t.extent2d.xmin, t.extent2d.ymax), r = t.transform = t.transform || this.calculateTileMatrix(n, t.z, e.extent), o = t.tileTranslationMatrix = t.tileTranslationMatrix || this.calculateTileTranslationMatrix(n, t.z), s = [];
|
|
871
|
-
|
|
872
|
-
this.
|
|
871
|
+
G(s, e.data), G(s, e.featureData);
|
|
872
|
+
this.J(e).forEach((n, a) => {
|
|
873
873
|
if (!n) return;
|
|
874
874
|
const l = this.vt(a);
|
|
875
875
|
if (!s[a] || !l) return;
|
|
@@ -902,7 +902,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
902
902
|
}
|
|
903
903
|
pick(t, e, i) {
|
|
904
904
|
const n = [];
|
|
905
|
-
return this.
|
|
905
|
+
return this.J().forEach((r, o) => {
|
|
906
906
|
if (!r) return;
|
|
907
907
|
if (!this.vt(o)) return;
|
|
908
908
|
const s = r.pick(t, e, i.tolerance);
|
|
@@ -912,7 +912,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
912
912
|
deleteTile(t) {
|
|
913
913
|
if (t) {
|
|
914
914
|
if (t.image && !t.image.At) {
|
|
915
|
-
const e = this.
|
|
915
|
+
const e = this.Pt();
|
|
916
916
|
e && e.forEach((e, i) => {
|
|
917
917
|
e && e.deleteTile({
|
|
918
918
|
pluginIndex: i,
|
|
@@ -929,25 +929,25 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
929
929
|
}
|
|
930
930
|
}
|
|
931
931
|
abortTileLoading(t, e) {
|
|
932
|
-
e && e.url && (this.
|
|
932
|
+
e && e.url && (this.q && this.q.abortTile(e.url), delete this.V[e.url]), super.abortTileLoading(t, e);
|
|
933
933
|
}
|
|
934
934
|
resizeCanvas(t) {
|
|
935
935
|
super.resizeCanvas(t);
|
|
936
936
|
const e = this.canvas;
|
|
937
937
|
e && (!this.pickingFBO || this.pickingFBO.width === e.width && this.pickingFBO.height === e.height || this.pickingFBO.resize(e.width, e.height),
|
|
938
|
-
this.
|
|
938
|
+
this.J().forEach(t => {
|
|
939
939
|
t && t.resize(e.width, e.height);
|
|
940
940
|
}));
|
|
941
941
|
}
|
|
942
942
|
onRemove() {
|
|
943
|
-
this.jt && this.jt.remove(), this.
|
|
943
|
+
this.jt && this.jt.remove(), this.q && (this.q.removeLayer(t => {
|
|
944
944
|
if (t) throw t;
|
|
945
|
-
}), this.
|
|
945
|
+
}), this.q.remove(), delete this.q), this.pickingFBO && (this.canvas.pickingFBO || this.pickingFBO.destroy(),
|
|
946
946
|
delete this.pickingFBO), this.K && this.K.delete(), super.onRemove && super.onRemove(),
|
|
947
947
|
this.$();
|
|
948
948
|
}
|
|
949
949
|
$() {
|
|
950
|
-
this.
|
|
950
|
+
this.J().forEach(t => {
|
|
951
951
|
t.remove();
|
|
952
952
|
}), this.plugins = [];
|
|
953
953
|
}
|
|
@@ -1008,7 +1008,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1008
1008
|
const c = new ImageData(n, r);
|
|
1009
1009
|
c.data.set(s), o.putImageData(c, 0, 0);
|
|
1010
1010
|
}
|
|
1011
|
-
|
|
1011
|
+
It(t) {
|
|
1012
1012
|
let e;
|
|
1013
1013
|
switch (t) {
|
|
1014
1014
|
case "native-line":
|
|
@@ -1107,12 +1107,12 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1107
1107
|
this.gt = !0, this.setToRedraw();
|
|
1108
1108
|
}
|
|
1109
1109
|
paintOutlineAll(t) {
|
|
1110
|
-
const e = this.
|
|
1110
|
+
const e = this.J();
|
|
1111
1111
|
for (let i = 0; i < e.length; i++) e[i].outlineAll(t);
|
|
1112
1112
|
}
|
|
1113
1113
|
paintOutline(t, e, i) {
|
|
1114
|
-
if (!
|
|
1115
|
-
const n = e, r = this.
|
|
1114
|
+
if (!q(e)) {
|
|
1115
|
+
const n = e, r = this.J();
|
|
1116
1116
|
if (!r[n] || r[n].painter && !r[n].painter.isVisible()) return;
|
|
1117
1117
|
return void r[n].outline(t, i);
|
|
1118
1118
|
}
|
|
@@ -1123,7 +1123,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1123
1123
|
}
|
|
1124
1124
|
}
|
|
1125
1125
|
paintBatchOutline(t, e) {
|
|
1126
|
-
const i = this.
|
|
1126
|
+
const i = this.J();
|
|
1127
1127
|
!i[e] || i[e].painter && !i[e].painter.isVisible() || i[e].outlineAll(t);
|
|
1128
1128
|
}
|
|
1129
1129
|
cancelOutline() {
|
|
@@ -1136,7 +1136,7 @@ class at extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1136
1136
|
|
|
1137
1137
|
function lt(t) {
|
|
1138
1138
|
let e;
|
|
1139
|
-
Array.isArray(t.data) ? (e = [],
|
|
1139
|
+
Array.isArray(t.data) ? (e = [], G(e, t.data)) : (e = {}, L(e, t.data));
|
|
1140
1140
|
const i = L({}, t);
|
|
1141
1141
|
return i.data = e, i;
|
|
1142
1142
|
}
|
|
@@ -1203,8 +1203,8 @@ const dt = "function" == typeof fetch && "function" == typeof AbortController, f
|
|
|
1203
1203
|
method: e.method || "GET",
|
|
1204
1204
|
referrerPolicy: "origin"
|
|
1205
1205
|
};
|
|
1206
|
-
return n && (
|
|
1207
|
-
|
|
1206
|
+
return n && (q(e.body) || (o.body = JSON.stringify(e.body))), q(e.headers) || (o.headers = e.headers),
|
|
1207
|
+
q(e.credentials) || (o.credentials = e.credentials), fetch(t, o).then(n => {
|
|
1208
1208
|
const r = this.Ht(n, e.returnJSON, e.responseType);
|
|
1209
1209
|
r.message ? (r.url = t, i(r)) : r.then(t => {
|
|
1210
1210
|
"arraybuffer" === e.responseType ? i(null, {
|
|
@@ -1362,15 +1362,15 @@ class gt extends t.TileLayer {
|
|
|
1362
1362
|
i.style ? (r = i, r.$root || (r.$root = n)) : r = {
|
|
1363
1363
|
$root: n,
|
|
1364
1364
|
style: i
|
|
1365
|
-
}, this.options.style = e, this.
|
|
1365
|
+
}, this.options.style = e, this.qt(r);
|
|
1366
1366
|
}), this;
|
|
1367
1367
|
}
|
|
1368
|
-
return this.options.style = t, this.
|
|
1368
|
+
return this.options.style = t, this.qt(t), this;
|
|
1369
1369
|
}
|
|
1370
|
-
|
|
1371
|
-
if (this.
|
|
1370
|
+
qt(t) {
|
|
1371
|
+
if (this.Gt = null, t && t.$root) {
|
|
1372
1372
|
let e = t.$root;
|
|
1373
|
-
e && "/" === e[e.length - 1] && (e = e.substring(0, e.length - 1)), this.
|
|
1373
|
+
e && "/" === e[e.length - 1] && (e = e.substring(0, e.length - 1)), this.Gt = e,
|
|
1374
1374
|
this.Wt = function(t) {
|
|
1375
1375
|
return "{$root}" === t ? e : null;
|
|
1376
1376
|
};
|
|
@@ -1404,9 +1404,9 @@ class gt extends t.TileLayer {
|
|
|
1404
1404
|
} else e.push(L({}, t[i]));
|
|
1405
1405
|
}
|
|
1406
1406
|
return e;
|
|
1407
|
-
}(t.featureStyle), this.
|
|
1407
|
+
}(t.featureStyle), this.Yt = t.style || [];
|
|
1408
1408
|
const e = t.background || {};
|
|
1409
|
-
this.
|
|
1409
|
+
this.Jt = {
|
|
1410
1410
|
enable: e.enable || !1,
|
|
1411
1411
|
color: bt(e.color) || [ 0, 0, 0, 0 ],
|
|
1412
1412
|
opacity: xt(e.opacity, 1),
|
|
@@ -1453,7 +1453,7 @@ class gt extends t.TileLayer {
|
|
|
1453
1453
|
return t ? (t.cancelOutline(), this) : this;
|
|
1454
1454
|
}
|
|
1455
1455
|
Zt() {
|
|
1456
|
-
t.Util.convertStylePath(this.
|
|
1456
|
+
t.Util.convertStylePath(this.Yt, this.Wt), t.Util.convertStylePath(this.$t, this.Wt);
|
|
1457
1457
|
}
|
|
1458
1458
|
updateSceneConfig(t, e) {
|
|
1459
1459
|
return this.te(0, t, e);
|
|
@@ -1462,7 +1462,7 @@ class gt extends t.TileLayer {
|
|
|
1462
1462
|
return this.te(1, t, i, e);
|
|
1463
1463
|
}
|
|
1464
1464
|
te(t, e, i, n) {
|
|
1465
|
-
const r = this.
|
|
1465
|
+
const r = this.Y(t);
|
|
1466
1466
|
if (!r) return this;
|
|
1467
1467
|
let o, s = e;
|
|
1468
1468
|
if (r[e].renderPlugin.sceneConfig || (r[e].renderPlugin.sceneConfig = {}), L(r[e].renderPlugin.sceneConfig, i),
|
|
@@ -1475,7 +1475,7 @@ class gt extends t.TileLayer {
|
|
|
1475
1475
|
const t = this.options.style[e].renderPlugin;
|
|
1476
1476
|
t.sceneConfig || (t.sceneConfig = {}), L(t.sceneConfig, i);
|
|
1477
1477
|
} else {
|
|
1478
|
-
const r = this.
|
|
1478
|
+
const r = this.Y(t, this.options.style);
|
|
1479
1479
|
let o;
|
|
1480
1480
|
void 0 !== n ? (wt(r, e, n), o = r[e].style[n].renderPlugin) : (At(r, e), o = r[e].renderPlugin),
|
|
1481
1481
|
o.sceneConfig || (o.sceneConfig = {}), L(o.sceneConfig, i);
|
|
@@ -1497,14 +1497,14 @@ class gt extends t.TileLayer {
|
|
|
1497
1497
|
return this.ee(1, t, i, e);
|
|
1498
1498
|
}
|
|
1499
1499
|
ee(t, e, i, n) {
|
|
1500
|
-
const r = this.
|
|
1500
|
+
const r = this.Y(t);
|
|
1501
1501
|
if (!r) return this;
|
|
1502
1502
|
let o, s = e;
|
|
1503
1503
|
void 0 !== n ? (wt(this.Bt, e, n), s = this.Bt[e].style[n].Xt, o = r[s].renderPlugin.dataConfig) : (At(r, e),
|
|
1504
1504
|
o = r[e].renderPlugin.dataConfig);
|
|
1505
1505
|
const a = L({}, o);
|
|
1506
1506
|
if (L(o, i), Array.isArray(this.options.style)) L(this.options.style[e].renderPlugin.dataConfig, i); else {
|
|
1507
|
-
const r = this.
|
|
1507
|
+
const r = this.Y(t, this.options.style);
|
|
1508
1508
|
let o;
|
|
1509
1509
|
void 0 !== n ? (wt(r, e, n), o = r[e].style[n].renderPlugin) : (At(r, e), o = r[e].renderPlugin),
|
|
1510
1510
|
o.dataConfig || (o.dataConfig = {}), L(o.dataConfig, i);
|
|
@@ -1530,7 +1530,7 @@ class gt extends t.TileLayer {
|
|
|
1530
1530
|
return this.ie(1, t, i, e);
|
|
1531
1531
|
}
|
|
1532
1532
|
ie(e, i, n, r) {
|
|
1533
|
-
const o = this.
|
|
1533
|
+
const o = this.Y(e);
|
|
1534
1534
|
if (!o) return this;
|
|
1535
1535
|
let s = i;
|
|
1536
1536
|
void 0 !== r && (wt(this.Bt, i, r), s = this.Bt[i].style[r].Xt);
|
|
@@ -1552,7 +1552,7 @@ class gt extends t.TileLayer {
|
|
|
1552
1552
|
for (const e in n) W(n, e) && (!t.Util.isObject(n[e]) || Array.isArray(n[e]) || n[e].stops ? o[e] = n[e] : (o[e] || (o[e] = {}),
|
|
1553
1553
|
L(o[e], n[e])));
|
|
1554
1554
|
let u = l.options.style;
|
|
1555
|
-
Array.isArray(u) || (u = l.
|
|
1555
|
+
Array.isArray(u) || (u = l.Y(e, l.options.style));
|
|
1556
1556
|
const d = JSON.parse(JSON.stringify(o));
|
|
1557
1557
|
return void 0 !== r ? (wt(u, i, r), void 0 === s ? u[i].style[r].symbol = d : u[i].style[r].symbol[s] = d) : (At(u, i),
|
|
1558
1558
|
void 0 === s ? u[i].symbol = d : u[i].symbol[s] = d), c;
|
|
@@ -1575,19 +1575,19 @@ class gt extends t.TileLayer {
|
|
|
1575
1575
|
symbol: n
|
|
1576
1576
|
}), this;
|
|
1577
1577
|
}
|
|
1578
|
-
|
|
1578
|
+
Y(t, e) {
|
|
1579
1579
|
if (e) {
|
|
1580
1580
|
return 0 === t ? e.style : e.featureStyle;
|
|
1581
1581
|
}
|
|
1582
|
-
return 0 === t ? this.
|
|
1582
|
+
return 0 === t ? this.Yt : this.$t;
|
|
1583
1583
|
}
|
|
1584
1584
|
isDefaultRender() {
|
|
1585
1585
|
return !!this.re && this.options.defaultRendering;
|
|
1586
1586
|
}
|
|
1587
1587
|
validateStyle() {
|
|
1588
1588
|
this.oe = !0, this.re = !1;
|
|
1589
|
-
let t = this.
|
|
1590
|
-
this.options.style || (this.re = !0, t = this.
|
|
1589
|
+
let t = this.Yt;
|
|
1590
|
+
this.options.style || (this.re = !0, t = this.Yt = []), Array.isArray(t) || (t = this.Yt = [ t ]);
|
|
1591
1591
|
for (let e = 0; e < t.length; e++) {
|
|
1592
1592
|
let i = t[e].filter;
|
|
1593
1593
|
if (i && i.value && (i = i.value), void 0 !== i && "default" !== i && !0 !== i && !Array.isArray(i) && void 0 === i.condition) throw new Error(`Invalid filter at ${e} : ${JSON.stringify(i)}`);
|
|
@@ -1598,17 +1598,17 @@ class gt extends t.TileLayer {
|
|
|
1598
1598
|
return this.options.style ? JSON.parse(JSON.stringify(this.options.style)) : null;
|
|
1599
1599
|
}
|
|
1600
1600
|
addRenderStyle(t, e) {
|
|
1601
|
-
let i = this.
|
|
1602
|
-
return i ? t < 0 || t >= i.length ? i.push(e) : i.splice(t, 0, e) : i = [ e ], this.
|
|
1603
|
-
$root: this.
|
|
1601
|
+
let i = this.Yt;
|
|
1602
|
+
return i ? t < 0 || t >= i.length ? i.push(e) : i.splice(t, 0, e) : i = [ e ], this.qt({
|
|
1603
|
+
$root: this.Gt,
|
|
1604
1604
|
style: i,
|
|
1605
1605
|
featureStyle: this.Bt
|
|
1606
1606
|
}), this;
|
|
1607
1607
|
}
|
|
1608
1608
|
updateRenderStyle(t, e) {
|
|
1609
|
-
let i = this.
|
|
1610
|
-
return !i || t < 0 || t >= i.length || (i.splice(t, 1, e), this.
|
|
1611
|
-
$root: this.
|
|
1609
|
+
let i = this.Yt;
|
|
1610
|
+
return !i || t < 0 || t >= i.length || (i.splice(t, 1, e), this.qt({
|
|
1611
|
+
$root: this.Gt,
|
|
1612
1612
|
style: i,
|
|
1613
1613
|
featureStyle: this.Bt
|
|
1614
1614
|
})), this;
|
|
@@ -1618,9 +1618,9 @@ class gt extends t.TileLayer {
|
|
|
1618
1618
|
return this.updateRenderStyle(i, e);
|
|
1619
1619
|
}
|
|
1620
1620
|
removeRenderStyle(t) {
|
|
1621
|
-
let e = this.
|
|
1622
|
-
return !e || t < 0 || t >= e.length || (e.splice(t, 1), this.
|
|
1623
|
-
$root: this.
|
|
1621
|
+
let e = this.Yt;
|
|
1622
|
+
return !e || t < 0 || t >= e.length || (e.splice(t, 1), this.qt({
|
|
1623
|
+
$root: this.Gt,
|
|
1624
1624
|
style: e,
|
|
1625
1625
|
featureStyle: this.Bt
|
|
1626
1626
|
})), this;
|
|
@@ -1637,11 +1637,11 @@ class gt extends t.TileLayer {
|
|
|
1637
1637
|
updateFeatureStyleById(t) {
|
|
1638
1638
|
if (!t) return this;
|
|
1639
1639
|
const e = t.id;
|
|
1640
|
-
if (
|
|
1640
|
+
if (q(e)) return this;
|
|
1641
1641
|
const i = this.getFeatureStyleIndex(e), n = this.Bt;
|
|
1642
|
-
return i < 0 ? n.push(t) : n[i] = t, this.
|
|
1643
|
-
$root: this.
|
|
1644
|
-
style: this.
|
|
1642
|
+
return i < 0 ? n.push(t) : n[i] = t, this.qt({
|
|
1643
|
+
$root: this.Gt,
|
|
1644
|
+
style: this.Yt,
|
|
1645
1645
|
featureStyle: t
|
|
1646
1646
|
}), this;
|
|
1647
1647
|
}
|
|
@@ -1649,21 +1649,21 @@ class gt extends t.TileLayer {
|
|
|
1649
1649
|
const e = this.getFeatureStyleIndex(t);
|
|
1650
1650
|
if (e < 0) return this;
|
|
1651
1651
|
const i = this.Bt.splice(e, 1);
|
|
1652
|
-
return this.
|
|
1653
|
-
$root: this.
|
|
1654
|
-
style: this.
|
|
1652
|
+
return this.qt({
|
|
1653
|
+
$root: this.Gt,
|
|
1654
|
+
style: this.Yt,
|
|
1655
1655
|
featureStyle: i
|
|
1656
1656
|
}), this;
|
|
1657
1657
|
}
|
|
1658
1658
|
getFeatureStyleIndex(t) {
|
|
1659
|
-
if (
|
|
1659
|
+
if (q(t)) return -1;
|
|
1660
1660
|
const e = this.Bt;
|
|
1661
1661
|
if (!e) return -1;
|
|
1662
1662
|
for (let i = 0; i < e.length; i++) if (e[i].id === t) return i;
|
|
1663
1663
|
return -1;
|
|
1664
1664
|
}
|
|
1665
1665
|
ne(t) {
|
|
1666
|
-
const e = this.
|
|
1666
|
+
const e = this.Yt;
|
|
1667
1667
|
if (!e) return -1;
|
|
1668
1668
|
for (let i = 0; i < e.length; i++) if (e[i].name === t) return i;
|
|
1669
1669
|
throw new Error("No style defined with name: " + t);
|
|
@@ -1690,8 +1690,8 @@ class gt extends t.TileLayer {
|
|
|
1690
1690
|
}
|
|
1691
1691
|
W() {
|
|
1692
1692
|
return {
|
|
1693
|
-
background: this.
|
|
1694
|
-
style: this.
|
|
1693
|
+
background: this.Jt,
|
|
1694
|
+
style: this.Yt || [],
|
|
1695
1695
|
featureStyle: this.$t || []
|
|
1696
1696
|
};
|
|
1697
1697
|
}
|
|
@@ -1734,7 +1734,7 @@ class gt extends t.TileLayer {
|
|
|
1734
1734
|
return this.he && this.he.clear(), this;
|
|
1735
1735
|
}
|
|
1736
1736
|
getDataSchema(t) {
|
|
1737
|
-
return this.ce || (this.ce = {}),
|
|
1737
|
+
return this.ce || (this.ce = {}), q(t) || this.ce[t] || (this.ce[t] = {}), q(t) ? this.ce : this.ce[t];
|
|
1738
1738
|
}
|
|
1739
1739
|
onRemove() {
|
|
1740
1740
|
super.onRemove();
|
|
@@ -1905,15 +1905,15 @@ St.registerJSONType("GeoJSONVectorTileLayer"), St.mergeOptions({
|
|
|
1905
1905
|
simplifyTolerance: 3
|
|
1906
1906
|
});
|
|
1907
1907
|
|
|
1908
|
-
class
|
|
1908
|
+
class It extends t.OverlayLayer {
|
|
1909
1909
|
static registerPainter(t, e) {
|
|
1910
|
-
|
|
1910
|
+
It.painters || (It.painters = {}), It.painters[t] = e;
|
|
1911
1911
|
}
|
|
1912
1912
|
static get3DPainterClass(t) {
|
|
1913
|
-
return
|
|
1913
|
+
return It.painters[t];
|
|
1914
1914
|
}
|
|
1915
1915
|
constructor(...t) {
|
|
1916
|
-
super(...t), this.options.sceneConfig || (this.options.sceneConfig = {}),
|
|
1916
|
+
super(...t), this.options.sceneConfig || (this.options.sceneConfig = {}), q(this.options.sceneConfig.blendSrc) && (this.options.sceneConfig.blendSrc = "one");
|
|
1917
1917
|
}
|
|
1918
1918
|
updateSymbol(t, e) {
|
|
1919
1919
|
if (!this.options.style) throw new Error("can't call update symbol when style is not set");
|
|
@@ -1978,7 +1978,7 @@ class Pt extends t.OverlayLayer {
|
|
|
1978
1978
|
}
|
|
1979
1979
|
}
|
|
1980
1980
|
|
|
1981
|
-
|
|
1981
|
+
It.mergeOptions({
|
|
1982
1982
|
picking: !0,
|
|
1983
1983
|
renderer: "gl",
|
|
1984
1984
|
collision: !1,
|
|
@@ -1995,7 +1995,7 @@ Pt.mergeOptions({
|
|
|
1995
1995
|
}
|
|
1996
1996
|
});
|
|
1997
1997
|
|
|
1998
|
-
const
|
|
1998
|
+
const Pt = {
|
|
1999
1999
|
markerFile: {
|
|
2000
2000
|
type: "identity",
|
|
2001
2001
|
default: void 0,
|
|
@@ -2406,14 +2406,14 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2406
2406
|
this.we = {}, this.Ae = {}, this._e = {}, this.ke = !0, this.Se = {
|
|
2407
2407
|
id: 0,
|
|
2408
2408
|
pickingId: 0
|
|
2409
|
-
}, this.Te = L({},
|
|
2409
|
+
}, this.Te = L({}, Pt, Ot), this.Me = {};
|
|
2410
2410
|
}
|
|
2411
2411
|
hasNoAARendering() {
|
|
2412
2412
|
return !0;
|
|
2413
2413
|
}
|
|
2414
2414
|
needToRedraw() {
|
|
2415
2415
|
const t = super.needToRedraw();
|
|
2416
|
-
return t || (this.painter && this.painter.needToRedraw() || this.
|
|
2416
|
+
return t || (this.painter && this.painter.needToRedraw() || this.Ie && this.Ie.needToRedraw() || this.Pe && this.Pe.needToRedraw());
|
|
2417
2417
|
}
|
|
2418
2418
|
draw(t, e) {
|
|
2419
2419
|
const i = this.layer;
|
|
@@ -2430,15 +2430,15 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2430
2430
|
this.Re && (this.Le(), this.Re = !1), this.He(), this.rt = t, this.lt = e || {};
|
|
2431
2431
|
const n = this.lt.renderMode, r = !n || "default" === n, o = this.Ve();
|
|
2432
2432
|
let s = 0;
|
|
2433
|
-
0 === this.layer.options.meshRenderOrder && this.Ue(o, s++, n), this.Ne && (r || this.
|
|
2434
|
-
this.
|
|
2433
|
+
0 === this.layer.options.meshRenderOrder && this.Ue(o, s++, n), this.Ne && (r || this.Pe.supportRenderMode(n)) && (this.Pe.startFrame(o),
|
|
2434
|
+
this.Pe.addMesh(this.Ne, null, {
|
|
2435
2435
|
bloom: this.lt.bloom
|
|
2436
|
-
}), this.
|
|
2437
|
-
this.De && (r || this.
|
|
2438
|
-
this.
|
|
2436
|
+
}), this.Pe.prepareRender(o), o.polygonOffsetIndex = s++, this.Pe.render(o)), 1 === this.layer.options.meshRenderOrder && this.Ue(o, s++, n),
|
|
2437
|
+
this.De && (r || this.Ie.supportRenderMode(n)) && (i.options.collision && i.clearCollisionIndex(),
|
|
2438
|
+
this.Ie.startFrame(o), this.Ie.addMesh(this.De, null, {
|
|
2439
2439
|
bloom: this.lt.bloom
|
|
2440
|
-
}), this.
|
|
2441
|
-
this.
|
|
2440
|
+
}), this.Ie.prepareRender(o), i.options.collision && this.Ie.updateCollision(o),
|
|
2441
|
+
this.Ie.render(o)), (r || e && e.isFinalRender) && (this.completeRender(), this.layer.fire("canvasisdirty"));
|
|
2442
2442
|
}
|
|
2443
2443
|
Ue(t, e, i) {
|
|
2444
2444
|
const n = !i || "default" === i;
|
|
@@ -2457,7 +2457,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2457
2457
|
const t = {
|
|
2458
2458
|
regl: this.regl,
|
|
2459
2459
|
layer: this.layer,
|
|
2460
|
-
symbol: this.
|
|
2460
|
+
symbol: this.qe,
|
|
2461
2461
|
gl: this.gl,
|
|
2462
2462
|
sceneConfig: this.layer.options.sceneConfig,
|
|
2463
2463
|
pluginIndex: 0,
|
|
@@ -2472,7 +2472,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2472
2472
|
getFrameTimestamp() {
|
|
2473
2473
|
return this.rt;
|
|
2474
2474
|
}
|
|
2475
|
-
|
|
2475
|
+
Ge(t, e) {
|
|
2476
2476
|
(t = t || e) === e && (e = null);
|
|
2477
2477
|
const i = [], n = [ 0, 0, 0, 0 ];
|
|
2478
2478
|
this.layer._sortGeometries();
|
|
@@ -2493,7 +2493,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2493
2493
|
}
|
|
2494
2494
|
}
|
|
2495
2495
|
return i.length || (this.meshes && this.painter && (this.painter.deleteMesh(this.meshes),
|
|
2496
|
-
delete this.meshes), this.De && (this.
|
|
2496
|
+
delete this.meshes), this.De && (this.Ie.deleteMesh(this.De), delete this.De), this.Ne && (this.Pe.deleteMesh(this.Ne),
|
|
2497
2497
|
delete this.Ne)), n[3] && (n[0] /= n[3], n[1] /= n[3]), {
|
|
2498
2498
|
features: i,
|
|
2499
2499
|
center: n
|
|
@@ -2552,7 +2552,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2552
2552
|
}), i.tileRatio = 1, i.z = 1, i.tileExtent = 1;
|
|
2553
2553
|
}
|
|
2554
2554
|
$e(t) {
|
|
2555
|
-
return "win-intel-gpu-crash" === t && (this.layer.options.workarounds["win-intel-gpu-crash"] &&
|
|
2555
|
+
return "win-intel-gpu-crash" === t && (this.layer.options.workarounds["win-intel-gpu-crash"] && qt(this.gl));
|
|
2556
2556
|
}
|
|
2557
2557
|
prepareRequestors() {
|
|
2558
2558
|
if (this.h) return;
|
|
@@ -2563,7 +2563,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2563
2563
|
const e = !this.$e("win-intel-gpu-crash");
|
|
2564
2564
|
this.u = new v(e => {
|
|
2565
2565
|
t.getMap().getRenderer().callInNextFrame(e);
|
|
2566
|
-
}, t.options.glyphSdfLimitPerFrame, e), this.requestor = this.Xe.bind(this), this.
|
|
2566
|
+
}, t.options.glyphSdfLimitPerFrame, e), this.requestor = this.Xe.bind(this), this.Ye = this.Je.bind(this);
|
|
2567
2567
|
}
|
|
2568
2568
|
Xe(t, e, i) {
|
|
2569
2569
|
const n = [];
|
|
@@ -2574,7 +2574,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2574
2574
|
}, n);
|
|
2575
2575
|
});
|
|
2576
2576
|
}
|
|
2577
|
-
|
|
2577
|
+
Je(t, e, i) {
|
|
2578
2578
|
this.u.getGlyphs(e, (e, n) => {
|
|
2579
2579
|
if (e) throw e;
|
|
2580
2580
|
const r = n.buffers || [];
|
|
@@ -2589,14 +2589,14 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2589
2589
|
}
|
|
2590
2590
|
Oe(t) {
|
|
2591
2591
|
const e = Object.keys(this.we), i = Object.keys(this.Ae);
|
|
2592
|
-
if (!e.length && !i.length) return void (this.De && (this.
|
|
2592
|
+
if (!e.length && !i.length) return void (this.De && (this.Ie.deleteMesh(this.De),
|
|
2593
2593
|
delete this.De));
|
|
2594
|
-
const {features: o, center: s} = this.
|
|
2594
|
+
const {features: o, center: s} = this.Ge(this.we, this.Ae), a = [], l = [];
|
|
2595
2595
|
for (let t = 0; t < o.length; t++) {
|
|
2596
2596
|
const e = o[t][Lt];
|
|
2597
2597
|
this.we[e] && a.push(o[t]), this.Ae[e] && l.push(o[t]);
|
|
2598
2598
|
}
|
|
2599
|
-
if (!a.length && !l.length) return void (this.De && (this.
|
|
2599
|
+
if (!a.length && !l.length) return void (this.De && (this.Ie.deleteMesh(this.De),
|
|
2600
2600
|
delete this.De));
|
|
2601
2601
|
const h = this.Re;
|
|
2602
2602
|
this.Ze = s;
|
|
@@ -2604,14 +2604,14 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2604
2604
|
this.ze = {};
|
|
2605
2605
|
const u = [], d = [];
|
|
2606
2606
|
this.Qe = !0, Promise.all(c).then(t => {
|
|
2607
|
-
if (this.De && (this.
|
|
2608
|
-
const e = this.
|
|
2607
|
+
if (this.De && (this.Ie.deleteMesh(this.De), delete this.De), !t || !t.length) return void this.setToRedraw();
|
|
2608
|
+
const e = this.Ie.createGeometries(t.map(t => t && t.data), this.be);
|
|
2609
2609
|
for (let i = 0; i < e.length; i++) this.Be(e[i].geometry, t[i] && t[i].data);
|
|
2610
2610
|
const i = t[0] && t[0].data.iconAtlas, o = t[0] && t[0].data.glyphAtlas || t[1] && t[1].data.glyphAtlas;
|
|
2611
2611
|
i && (this.ze.iconAtlas = i), o && (this.ze.glyphAtlas = o);
|
|
2612
2612
|
const a = r.identity([]);
|
|
2613
2613
|
r.translate(a, a, n.set(d, s[0], s[1], 0)), r.scale(a, a, n.set(u, 1, 1, this.ot));
|
|
2614
|
-
const l = this.
|
|
2614
|
+
const l = this.Ie.createMeshes(e, a);
|
|
2615
2615
|
for (let t = 0; t < l.length; t++) l[t].geometry.properties.originElements = l[t].geometry.properties.elements.slice(),
|
|
2616
2616
|
l[t].setUniform("level", 0), l[t].material.set("flipY", 1), l[t].properties.meshKey = Nt++;
|
|
2617
2617
|
this.De = l, h && (this.Re = !0), this.Qe = !1, this.setToRedraw();
|
|
@@ -2635,7 +2635,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2635
2635
|
const r = {
|
|
2636
2636
|
zoom: this.getMap().getZoom(),
|
|
2637
2637
|
EXTENT: 1 / 0,
|
|
2638
|
-
requestor: this.
|
|
2638
|
+
requestor: this.Ye,
|
|
2639
2639
|
atlas: i,
|
|
2640
2640
|
center: n,
|
|
2641
2641
|
positionType: Float32Array,
|
|
@@ -2683,7 +2683,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2683
2683
|
}), !0;
|
|
2684
2684
|
}
|
|
2685
2685
|
ri(t) {
|
|
2686
|
-
return this.oi(t, this.Ne, this.je, this.si, this.
|
|
2686
|
+
return this.oi(t, this.Ne, this.je, this.si, this.Pe, A, Ct, this.ai);
|
|
2687
2687
|
}
|
|
2688
2688
|
oi(t, e, i, n, r, o, s, a) {
|
|
2689
2689
|
if (!e) return !1;
|
|
@@ -2739,15 +2739,15 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2739
2739
|
}), !0;
|
|
2740
2740
|
}
|
|
2741
2741
|
Ce(t) {
|
|
2742
|
-
if (!Object.keys(this._e).length) return void (this.Ne && (this.
|
|
2742
|
+
if (!Object.keys(this._e).length) return void (this.Ne && (this.Pe.deleteMesh(this.Ne),
|
|
2743
2743
|
delete this.Ne));
|
|
2744
|
-
const {features: e, center: i} = this.
|
|
2744
|
+
const {features: e, center: i} = this.Ge(this._e);
|
|
2745
2745
|
if (!e.length) return;
|
|
2746
2746
|
const n = this.Re;
|
|
2747
2747
|
this.si = i;
|
|
2748
|
-
const r = this.ai(e), o = L({}, Ct), s = r.map((e, n) => this.createMesh(this.
|
|
2748
|
+
const r = this.ai(e), o = L({}, Ct), s = r.map((e, n) => this.createMesh(this.Pe, A, o, e, t && t[n], i));
|
|
2749
2749
|
this.li = !0, Promise.all(s).then(t => {
|
|
2750
|
-
this.Ne && this.
|
|
2750
|
+
this.Ne && this.Pe.deleteMesh(this.Ne);
|
|
2751
2751
|
const e = [], i = [];
|
|
2752
2752
|
for (let n = 0; n < t.length; n++) {
|
|
2753
2753
|
const r = t[n] && t[n].meshes;
|
|
@@ -2766,7 +2766,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2766
2766
|
const e = (Rt + "lineDasharray").trim(), i = (Rt + "linePatternFile").trim(), n = [], r = [], o = [];
|
|
2767
2767
|
for (let s = 0; s < t.length; s++) {
|
|
2768
2768
|
const a = t[s], l = a.properties && a.properties[e];
|
|
2769
|
-
l &&
|
|
2769
|
+
l && Yt(l) ? o.push(a) : a.properties && a.properties[i] ? r.push(a) : n.push(a);
|
|
2770
2770
|
}
|
|
2771
2771
|
return [ r, o, n ];
|
|
2772
2772
|
}
|
|
@@ -2807,13 +2807,13 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2807
2807
|
const r = {
|
|
2808
2808
|
feature: t[i]
|
|
2809
2809
|
};
|
|
2810
|
-
|
|
2810
|
+
Gt(t[i]) && (this.we[n] = r), Wt(t[i]) && (this.Ae[n] = r), Xt(t[i]) && (this._e[n] = r);
|
|
2811
2811
|
} else {
|
|
2812
2812
|
t[Ft] = e;
|
|
2813
2813
|
const i = {
|
|
2814
2814
|
feature: t
|
|
2815
2815
|
}, n = t[Lt];
|
|
2816
|
-
|
|
2816
|
+
Gt(t) && (this.we[n] = i), Wt(t) && (this.Ae[n] = i), Xt(t) && (this._e[n] = i),
|
|
2817
2817
|
this.be[n] = i;
|
|
2818
2818
|
}
|
|
2819
2819
|
}
|
|
@@ -2829,7 +2829,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2829
2829
|
}
|
|
2830
2830
|
pick(t, e, i) {
|
|
2831
2831
|
const n = [];
|
|
2832
|
-
return [ this.painter, this.
|
|
2832
|
+
return [ this.painter, this.Ie, this.Pe ].forEach(r => {
|
|
2833
2833
|
if (!r) return;
|
|
2834
2834
|
const o = r.pick(t, e, i.tolerance);
|
|
2835
2835
|
if (o && o.data && o.data.feature) {
|
|
@@ -2884,8 +2884,8 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2884
2884
|
return Array.isArray(t) ? !!Array.isArray(e) && t.length === e.length : !Array.isArray(e);
|
|
2885
2885
|
}(r, o)) {
|
|
2886
2886
|
if (Array.isArray(r)) for (let t = 0; t < r.length; t++) {
|
|
2887
|
-
if (!
|
|
2888
|
-
} else if (!
|
|
2887
|
+
if (!Jt(r[t], o[t])) return void this.mi(e);
|
|
2888
|
+
} else if (!Jt(r, o)) return void this.mi(e);
|
|
2889
2889
|
this.onGeometryPositionChange(t);
|
|
2890
2890
|
} else this.mi(e); else this.mi(e);
|
|
2891
2891
|
}
|
|
@@ -2943,13 +2943,13 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
2943
2943
|
t && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)),
|
|
2944
2944
|
this.prepareRequestors(), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
|
|
2945
2945
|
this.painter = this.createPainter();
|
|
2946
|
-
const e =
|
|
2947
|
-
this.vi(i, "markerBloom"), this.vi(i, "textBloom"), this.
|
|
2948
|
-
this.
|
|
2946
|
+
const e = It.get3DPainterClass("icon"), i = L({}, Pt, Ot);
|
|
2947
|
+
this.vi(i, "markerBloom"), this.vi(i, "textBloom"), this.Ie = new e(this.regl, this.layer, i, this.layer.options.sceneConfig, 0),
|
|
2948
|
+
this.Ie.setTextShaderDefines({
|
|
2949
2949
|
REVERSE_MAP_ROTATION_ON_PITCH: 1
|
|
2950
2950
|
});
|
|
2951
|
-
const n =
|
|
2952
|
-
this.vi(r, "lineBloom"), this.
|
|
2951
|
+
const n = It.get3DPainterClass("line"), r = L({}, Ct);
|
|
2952
|
+
this.vi(r, "lineBloom"), this.Pe = new n(this.regl, this.layer, r, this.layer.options.sceneConfig, 0),
|
|
2953
2953
|
this.layer.getGeometries() && this.onGeometryAdd(this.layer.getGeometries());
|
|
2954
2954
|
}
|
|
2955
2955
|
vi(t, e) {
|
|
@@ -3002,13 +3002,13 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
3002
3002
|
this.painter && this.painter.resize(e.width, e.height));
|
|
3003
3003
|
}
|
|
3004
3004
|
onRemove() {
|
|
3005
|
-
super.onRemove(), this.painter && this.painter.delete(), this.
|
|
3006
|
-
this.
|
|
3005
|
+
super.onRemove(), this.painter && this.painter.delete(), this.Ie && this.Ie.delete(),
|
|
3006
|
+
this.Pe && this.Pe.delete();
|
|
3007
3007
|
}
|
|
3008
3008
|
drawOutline(t) {
|
|
3009
|
-
if (this.gt && (this.painter && this.painter.outlineAll(t), this.
|
|
3010
|
-
this.
|
|
3011
|
-
this.
|
|
3009
|
+
if (this.gt && (this.painter && this.painter.outlineAll(t), this.Ie.outlineAll(t),
|
|
3010
|
+
this.Pe.outlineAll(t)), this.bi) for (let e = 0; e < this.bi.length; e++) this.painter && this.painter.outline(t, this.bi[e]),
|
|
3011
|
+
this.Ie.outline(t, this.bi[e]), this.Pe.outline(t, this.bi[e]);
|
|
3012
3012
|
}
|
|
3013
3013
|
outlineAll() {
|
|
3014
3014
|
this.gt = !0, this.setToRedraw();
|
|
@@ -3029,7 +3029,7 @@ class Vt extends t.renderer.CanvasRenderer {
|
|
|
3029
3029
|
delete this.gt, delete this.bi, this.setToRedraw();
|
|
3030
3030
|
}
|
|
3031
3031
|
isEnableWorkAround(t) {
|
|
3032
|
-
return "win-intel-gpu-crash" === t && (this.layer.options.workarounds["win-intel-gpu-crash"] &&
|
|
3032
|
+
return "win-intel-gpu-crash" === t && (this.layer.options.workarounds["win-intel-gpu-crash"] && qt(this.gl));
|
|
3033
3033
|
}
|
|
3034
3034
|
st(t) {
|
|
3035
3035
|
return B(t, this.getMap());
|
|
@@ -3040,7 +3040,7 @@ function Ut(t) {
|
|
|
3040
3040
|
t.setToRedraw();
|
|
3041
3041
|
}
|
|
3042
3042
|
|
|
3043
|
-
function
|
|
3043
|
+
function qt(t) {
|
|
3044
3044
|
const e = t.getExtension("WEBGL_debug_renderer_info");
|
|
3045
3045
|
if (e && "undefined" != typeof navigator) {
|
|
3046
3046
|
const i = t.getParameter(e.UNMASKED_RENDERER_WEBGL), n = "Win32" === navigator.platform || "Win64" === navigator.platform;
|
|
@@ -3049,7 +3049,7 @@ function Gt(t) {
|
|
|
3049
3049
|
return !1;
|
|
3050
3050
|
}
|
|
3051
3051
|
|
|
3052
|
-
function
|
|
3052
|
+
function Gt({properties: t}) {
|
|
3053
3053
|
const e = (Rt + "markerFile").trim(), i = (Rt + "markerType").trim();
|
|
3054
3054
|
return t[e] || t[i];
|
|
3055
3055
|
}
|
|
@@ -3064,14 +3064,14 @@ function Xt(t) {
|
|
|
3064
3064
|
return 2 === t.type && !t.properties[$t] && void 0 !== t.properties[Bt] || 3 === t.type && void 0 !== t.properties[Bt];
|
|
3065
3065
|
}
|
|
3066
3066
|
|
|
3067
|
-
function
|
|
3067
|
+
function Yt(t) {
|
|
3068
3068
|
if (!Array.isArray(t)) return 0;
|
|
3069
3069
|
let e = 0;
|
|
3070
3070
|
for (let i = 0; i < t.length; i++) e += t[i];
|
|
3071
3071
|
return e;
|
|
3072
3072
|
}
|
|
3073
3073
|
|
|
3074
|
-
function
|
|
3074
|
+
function Jt(t, e) {
|
|
3075
3075
|
if (Object.keys(t).sort().join() !== Object.keys(e.properties || {}).filter(t => 0 === t.indexOf(Rt)).map(t => t.substring(Rt.length)).sort().join()) return !1;
|
|
3076
3076
|
for (const i in t) if (W(t, i)) {
|
|
3077
3077
|
const n = (Rt + i).trim();
|
|
@@ -3090,7 +3090,7 @@ function Zt(e, i, n) {
|
|
|
3090
3090
|
return r.addGeometry(s), r;
|
|
3091
3091
|
}
|
|
3092
3092
|
|
|
3093
|
-
class Kt extends
|
|
3093
|
+
class Kt extends It {
|
|
3094
3094
|
static fromJSON(t) {
|
|
3095
3095
|
return Zt(t, "PointLayer", Kt);
|
|
3096
3096
|
}
|
|
@@ -3126,7 +3126,7 @@ Kt.registerRenderer("gl", class extends Vt {
|
|
|
3126
3126
|
}
|
|
3127
3127
|
});
|
|
3128
3128
|
|
|
3129
|
-
class Qt extends
|
|
3129
|
+
class Qt extends It {
|
|
3130
3130
|
static fromJSON(t) {
|
|
3131
3131
|
return Zt(t, "LineStringLayer", Qt);
|
|
3132
3132
|
}
|
|
@@ -3143,14 +3143,14 @@ Qt.registerRenderer("gl", class extends Vt {
|
|
|
3143
3143
|
super(...e), this.GeometryTypes = [ t.LineString, t.MultiLineString ];
|
|
3144
3144
|
}
|
|
3145
3145
|
createPainter() {
|
|
3146
|
-
const t =
|
|
3146
|
+
const t = It.get3DPainterClass("line-gradient");
|
|
3147
3147
|
this.painterSymbol = L({}, {
|
|
3148
3148
|
lineGradientProperty: te
|
|
3149
3149
|
}, Ct), this.vi(this.painterSymbol, "lineBloom");
|
|
3150
3150
|
return new t(this.regl, this.layer, this.painterSymbol, this.layer.options.sceneConfig, 0);
|
|
3151
3151
|
}
|
|
3152
3152
|
buildMesh() {
|
|
3153
|
-
let {features: t, center: e} = this.
|
|
3153
|
+
let {features: t, center: e} = this.Ge();
|
|
3154
3154
|
if (t = t.filter(t => !!t.properties[te]), !t.length) return;
|
|
3155
3155
|
const i = this.Re;
|
|
3156
3156
|
this.xi = e;
|
|
@@ -3167,7 +3167,7 @@ Qt.registerRenderer("gl", class extends Vt {
|
|
|
3167
3167
|
}
|
|
3168
3168
|
}), Qt.registerRenderer("canvas", null);
|
|
3169
3169
|
|
|
3170
|
-
class ee extends
|
|
3170
|
+
class ee extends It {
|
|
3171
3171
|
static fromJSON(t) {
|
|
3172
3172
|
return Zt(t, "PolygonLayer", ee);
|
|
3173
3173
|
}
|
|
@@ -3208,7 +3208,7 @@ ee.registerRenderer("gl", class extends Vt {
|
|
|
3208
3208
|
super(...e), this.PackClass = S, this.GeometryTypes = [ t.Polygon, t.MultiPolygon ];
|
|
3209
3209
|
}
|
|
3210
3210
|
buildMesh(t) {
|
|
3211
|
-
const {features: e, center: i} = this.
|
|
3211
|
+
const {features: e, center: i} = this.Ge();
|
|
3212
3212
|
if (!e.length) return;
|
|
3213
3213
|
const n = this.Re;
|
|
3214
3214
|
this.xi = i;
|
|
@@ -3237,7 +3237,7 @@ ee.registerRenderer("gl", class extends Vt {
|
|
|
3237
3237
|
return [ e, i ];
|
|
3238
3238
|
}
|
|
3239
3239
|
createPainter() {
|
|
3240
|
-
const t =
|
|
3240
|
+
const t = It.get3DPainterClass("fill");
|
|
3241
3241
|
this.painterSymbol = L({}, ie), this.vi(this.painterSymbol, "polygonBloom");
|
|
3242
3242
|
return new t(this.regl, this.layer, this.painterSymbol, this.layer.options.sceneConfig, 0);
|
|
3243
3243
|
}
|
|
@@ -3317,14 +3317,14 @@ function se(t, e) {
|
|
|
3317
3317
|
}
|
|
3318
3318
|
let a = this.N(o);
|
|
3319
3319
|
if (!a) {
|
|
3320
|
-
const {meshes: e, retire: i} = this.
|
|
3320
|
+
const {meshes: e, retire: i} = this.Ii(s, t);
|
|
3321
3321
|
n || (n = i), a = e;
|
|
3322
3322
|
}
|
|
3323
3323
|
return {
|
|
3324
3324
|
retire: n
|
|
3325
3325
|
};
|
|
3326
3326
|
},
|
|
3327
|
-
|
|
3327
|
+
Ii(t, e) {
|
|
3328
3328
|
const {layer: i, tileInfo: n, tileExtent: r, tileTransform: o, tileTranslationMatrix: s, tileZoom: a, sceneConfig: l} = e;
|
|
3329
3329
|
let h = !1;
|
|
3330
3330
|
const c = this.painter, u = [ n.extent2d.xmin, n.extent2d.ymax ], d = c.createMeshes(t, o, {
|
|
@@ -3335,7 +3335,7 @@ function se(t, e) {
|
|
|
3335
3335
|
});
|
|
3336
3336
|
if (d.length) {
|
|
3337
3337
|
const t = i.getRenderer().isEnableTileStencil();
|
|
3338
|
-
for (let i = 0; i < d.length; i++) d[i] && (h = !0, this.
|
|
3338
|
+
for (let i = 0; i < d.length; i++) d[i] && (h = !0, this.Pi(d[i], o, e.timestamp, oe++, t));
|
|
3339
3339
|
l.animation && (d.Oi = e.timestamp);
|
|
3340
3340
|
const n = this.Ti(e);
|
|
3341
3341
|
this.Ai[n] = d;
|
|
@@ -3354,7 +3354,7 @@ function se(t, e) {
|
|
|
3354
3354
|
const l = this.Ti(t);
|
|
3355
3355
|
let h = this.N(l);
|
|
3356
3356
|
if (!h) {
|
|
3357
|
-
const {meshes: e, retire: i} = this.
|
|
3357
|
+
const {meshes: e, retire: i} = this.Ii(s, t);
|
|
3358
3358
|
a || (a = i), h = e;
|
|
3359
3359
|
}
|
|
3360
3360
|
if (!h.length) return ne;
|
|
@@ -3377,7 +3377,7 @@ function se(t, e) {
|
|
|
3377
3377
|
retire: a
|
|
3378
3378
|
};
|
|
3379
3379
|
},
|
|
3380
|
-
|
|
3380
|
+
Pi: function(t, e, i, n, r) {
|
|
3381
3381
|
if (t.properties.tileTransform = e, t.properties.createTime = i, t.properties.meshKey = n,
|
|
3382
3382
|
t.needUpdateShadow = !0, r) {
|
|
3383
3383
|
const e = t.defines || {};
|
|
@@ -3633,7 +3633,7 @@ function Te(t, e, i) {
|
|
|
3633
3633
|
for (let i = 0; i < t.length; i++) if (je(e[t[i]])) return !0;
|
|
3634
3634
|
return !1;
|
|
3635
3635
|
}(l, e) ? (je(e[s]) && Me(t, e, i), c) : (c && c.buffer && c.buffer.destroy && c.buffer.destroy(),
|
|
3636
|
-
delete t.data[o],
|
|
3636
|
+
delete t.data[o], Ie(t, o), null);
|
|
3637
3637
|
}
|
|
3638
3638
|
|
|
3639
3639
|
function Me(t, e, i) {
|
|
@@ -3659,7 +3659,7 @@ function Me(t, e, i) {
|
|
|
3659
3659
|
}
|
|
3660
3660
|
return !1;
|
|
3661
3661
|
}(i, e[r], t);
|
|
3662
|
-
if (!h && !l.length) return void
|
|
3662
|
+
if (!h && !l.length) return void Ie(t, n);
|
|
3663
3663
|
const {features: c, aPickingId: u} = o, d = function(t, e, i, n, r) {
|
|
3664
3664
|
const o = [];
|
|
3665
3665
|
let s = 0, a = e[0];
|
|
@@ -3667,17 +3667,17 @@ function Me(t, e, i) {
|
|
|
3667
3667
|
a = e[l], s = l);
|
|
3668
3668
|
return o;
|
|
3669
3669
|
}(c, u, e[r].property, l, h);
|
|
3670
|
-
if (!d.length) return void
|
|
3670
|
+
if (!d.length) return void Ie(t, n);
|
|
3671
3671
|
const f = t.data[n];
|
|
3672
3672
|
o[s] = d, o[a] = f.BYTES_PER_ELEMENT ? new f.constructor(f) : new i.type(f.length);
|
|
3673
3673
|
}
|
|
3674
3674
|
|
|
3675
|
-
function
|
|
3675
|
+
function Ie(t, e) {
|
|
3676
3676
|
const i = t.properties, n = (_e + e + "Index").trim(), r = (_e + e).trim();
|
|
3677
3677
|
delete i[n], delete i[r];
|
|
3678
3678
|
}
|
|
3679
3679
|
|
|
3680
|
-
function
|
|
3680
|
+
function Pe(t, e, i, n, r) {
|
|
3681
3681
|
if (!n) return;
|
|
3682
3682
|
const o = n.geometry;
|
|
3683
3683
|
if (o) {
|
|
@@ -3772,7 +3772,7 @@ function je(t) {
|
|
|
3772
3772
|
|
|
3773
3773
|
const {loginIBLResOnCanvas: De, logoutIBLResOnCanvas: Ne, getIBLResOnCanvas: Re} = i.pbr.PBRUtils, Le = [], He = [], Ve = t => 0 === t.getUniform("level"), Ue = t => t.getUniform("level") > 0;
|
|
3774
3774
|
|
|
3775
|
-
class
|
|
3775
|
+
class qe {
|
|
3776
3776
|
constructor(t, e, n, r, o, s) {
|
|
3777
3777
|
this.regl = t, this.layer = e, this.canvas = e.getRenderer().canvas, this.sceneConfig = r || {},
|
|
3778
3778
|
this.dataConfig = s || {}, this.pluginIndex = o, this.scene = new i.Scene, this.pickingFBO = e.getRenderer().pickingFBO,
|
|
@@ -3782,7 +3782,7 @@ class Ge {
|
|
|
3782
3782
|
y: 0,
|
|
3783
3783
|
width: () => this.canvas ? this.canvas.width : 1,
|
|
3784
3784
|
height: () => this.canvas ? this.canvas.height : 1
|
|
3785
|
-
}, this.sortByCommandKey =
|
|
3785
|
+
}, this.sortByCommandKey = Ge.bind(this), this.colorCache = {};
|
|
3786
3786
|
}
|
|
3787
3787
|
getMap() {
|
|
3788
3788
|
return this.layer ? this.layer.getMap() : null;
|
|
@@ -3902,7 +3902,7 @@ class Ge {
|
|
|
3902
3902
|
const {symbolIndex: n} = e[t].properties, r = this.getSymbolDef(n);
|
|
3903
3903
|
if (!r) continue;
|
|
3904
3904
|
const o = this.getFnTypeConfig(n);
|
|
3905
|
-
|
|
3905
|
+
Pe(this.regl, r, o, e[t], i);
|
|
3906
3906
|
}
|
|
3907
3907
|
}
|
|
3908
3908
|
paint(t) {
|
|
@@ -4006,9 +4006,9 @@ class Ge {
|
|
|
4006
4006
|
for (let t = 0; t < this.picking.length; t++) this.picking[t].dispose();
|
|
4007
4007
|
delete this.picking;
|
|
4008
4008
|
}
|
|
4009
|
-
if (this.
|
|
4010
|
-
for (let t = 0; t < this.
|
|
4011
|
-
delete this.
|
|
4009
|
+
if (this.qi) {
|
|
4010
|
+
for (let t = 0; t < this.qi.length; t++) this.qi[t].dispose();
|
|
4011
|
+
delete this.qi;
|
|
4012
4012
|
}
|
|
4013
4013
|
this.logoutTextureCache();
|
|
4014
4014
|
}
|
|
@@ -4017,7 +4017,7 @@ class Ge {
|
|
|
4017
4017
|
Array.isArray(t) || (t = [ t ], e = [ e ]);
|
|
4018
4018
|
let n = !1;
|
|
4019
4019
|
for (let i = 0; i < t.length; i++) if (t[i]) {
|
|
4020
|
-
const r = this.
|
|
4020
|
+
const r = this.Gi(i, t[i], e[i]);
|
|
4021
4021
|
r && (n = r);
|
|
4022
4022
|
}
|
|
4023
4023
|
return delete this.Wi, this.setToRedraw(i), n;
|
|
@@ -4026,7 +4026,7 @@ class Ge {
|
|
|
4026
4026
|
for (const i in e) if (we(e, i) && M[i] && !O(e[i], t[i])) return !0;
|
|
4027
4027
|
return !1;
|
|
4028
4028
|
}
|
|
4029
|
-
|
|
4029
|
+
Gi(t, e, i) {
|
|
4030
4030
|
if (!this.$i) return !1;
|
|
4031
4031
|
const n = this.Bi(this.symbolDef[t] || {}, i);
|
|
4032
4032
|
this.symbolDef[t] = de(i);
|
|
@@ -4079,7 +4079,7 @@ class Ge {
|
|
|
4079
4079
|
}), e[t].count++;
|
|
4080
4080
|
}
|
|
4081
4081
|
logoutTextureCache() {
|
|
4082
|
-
const t = "__gl_textures".trim(), e = this.getMap(), i = this.
|
|
4082
|
+
const t = "__gl_textures".trim(), e = this.getMap(), i = this.Yi;
|
|
4083
4083
|
if (i) for (const n in i) we(i, n) && e[t][n] && (e[t][n].count--, e[t][n].count <= 0 && delete e[t][n]);
|
|
4084
4084
|
e[t].count--, e[t].count <= 0 && (e[t] = {});
|
|
4085
4085
|
}
|
|
@@ -4093,13 +4093,13 @@ class Ge {
|
|
|
4093
4093
|
r ? r.data = e : r = n[i][t] = {
|
|
4094
4094
|
data: e,
|
|
4095
4095
|
count: 0
|
|
4096
|
-
}, this.
|
|
4096
|
+
}, this.Yi || (this.Yi = {}), r.data.then || this.Yi[t] || (r.count++, this.Yi[t] = 1);
|
|
4097
4097
|
}
|
|
4098
4098
|
disposeCachedTexture(t) {
|
|
4099
4099
|
let e;
|
|
4100
|
-
if (e = "string" == typeof t ? t : t.url, !this.
|
|
4100
|
+
if (e = "string" == typeof t ? t : t.url, !this.Yi || !this.Yi[e]) return;
|
|
4101
4101
|
const i = "__gl_textures".trim();
|
|
4102
|
-
delete this.
|
|
4102
|
+
delete this.Yi[e];
|
|
4103
4103
|
const n = this.getMap();
|
|
4104
4104
|
n[i][e] && (n[i][e].count--, n[i][e].count <= 0 && delete n[i][e]);
|
|
4105
4105
|
}
|
|
@@ -4112,7 +4112,7 @@ class Ge {
|
|
|
4112
4112
|
supportRenderMode(t) {
|
|
4113
4113
|
return "taa" === t || "fxaa" === t;
|
|
4114
4114
|
}
|
|
4115
|
-
|
|
4115
|
+
Ji(t) {
|
|
4116
4116
|
const e = this.scene.getMeshes();
|
|
4117
4117
|
if (!e.length) return;
|
|
4118
4118
|
const i = e.map(t => ({
|
|
@@ -4139,7 +4139,7 @@ class Ge {
|
|
|
4139
4139
|
}
|
|
4140
4140
|
Qi(t, e) {
|
|
4141
4141
|
if (!this.picking) return;
|
|
4142
|
-
if (this.tn || (this.tn = new i.Scene), !this.
|
|
4142
|
+
if (this.tn || (this.tn = new i.Scene), !this.qi && (this.en(), !this.qi)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
|
|
4143
4143
|
const n = this.getUniformValues(this.getMap(), this.Vi), r = this.in(e);
|
|
4144
4144
|
if (r.length) for (let i = 0; i < r.length; i++) {
|
|
4145
4145
|
const o = r[i].geometry.properties.feaIdPickingMap;
|
|
@@ -4152,7 +4152,7 @@ class Ge {
|
|
|
4152
4152
|
const r = s[i];
|
|
4153
4153
|
if (!e[r]) {
|
|
4154
4154
|
e[r] = 1, n.highlightPickingId = r;
|
|
4155
|
-
for (let e = 0; e < this.
|
|
4155
|
+
for (let e = 0; e < this.qi.length; e++) this.renderer.render(this.qi[e], n, this.tn, t);
|
|
4156
4156
|
}
|
|
4157
4157
|
}
|
|
4158
4158
|
}
|
|
@@ -4169,21 +4169,21 @@ class Ge {
|
|
|
4169
4169
|
}
|
|
4170
4170
|
outlineAll(t) {
|
|
4171
4171
|
if (!this.picking) return;
|
|
4172
|
-
if (!this.
|
|
4172
|
+
if (!this.qi && (this.en(), !this.qi)) return void console.warn(`Plugin at ${this.pluginIndex} doesn't support outline.`);
|
|
4173
4173
|
const e = this.getUniformValues(this.getMap(), this.Vi);
|
|
4174
4174
|
e.highlightPickingId = -1;
|
|
4175
|
-
for (let i = 0; i < this.
|
|
4175
|
+
for (let i = 0; i < this.qi.length; i++) this.renderer.render(this.qi[i], e, this.scene, t);
|
|
4176
4176
|
}
|
|
4177
4177
|
en() {
|
|
4178
4178
|
if (!this.picking) return;
|
|
4179
4179
|
const t = this.layer.getRenderer().canvas;
|
|
4180
|
-
this.
|
|
4180
|
+
this.qi = [];
|
|
4181
4181
|
for (let e = 0; e < this.picking.length; e++) {
|
|
4182
4182
|
const n = this.picking[e].getPickingVert(), r = {
|
|
4183
4183
|
ENABLE_PICKING: 1,
|
|
4184
4184
|
HAS_PICKING_ID: 1
|
|
4185
4185
|
}, o = this.picking[e].getUniformDeclares().slice(0);
|
|
4186
|
-
void 0 !== o.uPickingId && (r.HAS_PICKING_ID = 2), this.
|
|
4186
|
+
void 0 !== o.uPickingId && (r.HAS_PICKING_ID = 2), this.qi[e] = new i.MeshShader({
|
|
4187
4187
|
vert: n,
|
|
4188
4188
|
frag: "precision highp float;\nuniform float highlightPickingId;\nvarying float vPickingId;\nvoid main() {\n if(highlightPickingId < .0 || floor(highlightPickingId + .5) == floor(vPickingId + .5)) {\n gl_FragColor = vec4(1.);\n } else {\n discard;\n }\n}",
|
|
4189
4189
|
uniforms: o,
|
|
@@ -4209,7 +4209,7 @@ class Ge {
|
|
|
4209
4209
|
equation: "add"
|
|
4210
4210
|
}
|
|
4211
4211
|
}
|
|
4212
|
-
}), this.
|
|
4212
|
+
}), this.qi[e].filter = this.picking[e].filter;
|
|
4213
4213
|
}
|
|
4214
4214
|
}
|
|
4215
4215
|
hasIBL() {
|
|
@@ -4250,7 +4250,7 @@ class Ge {
|
|
|
4250
4250
|
}
|
|
4251
4251
|
}
|
|
4252
4252
|
|
|
4253
|
-
function
|
|
4253
|
+
function Ge(t, e) {
|
|
4254
4254
|
const i = t && t.getCommandKey(this.regl) || "", n = e && e.getCommandKey(this.regl) || "";
|
|
4255
4255
|
return i.localeCompare(n);
|
|
4256
4256
|
}
|
|
@@ -4259,7 +4259,7 @@ function We(t, e) {
|
|
|
4259
4259
|
return t.properties.level - e.properties.level;
|
|
4260
4260
|
}
|
|
4261
4261
|
|
|
4262
|
-
class Be extends
|
|
4262
|
+
class Be extends qe {
|
|
4263
4263
|
createGeometry(t, e) {
|
|
4264
4264
|
if (!t.data) return {
|
|
4265
4265
|
geometry: null,
|
|
@@ -4340,14 +4340,14 @@ function Xe(t, e, i) {
|
|
|
4340
4340
|
return t.texture(r);
|
|
4341
4341
|
}
|
|
4342
4342
|
|
|
4343
|
-
const
|
|
4343
|
+
const Ye = {
|
|
4344
4344
|
polygonFill: [ 1, 1, 1, 1 ],
|
|
4345
4345
|
polygonOpacity: 1,
|
|
4346
4346
|
uvScale: [ 1, 1 ],
|
|
4347
4347
|
uvOffset: [ 0, 0 ]
|
|
4348
4348
|
};
|
|
4349
4349
|
|
|
4350
|
-
class
|
|
4350
|
+
class Je extends Be {
|
|
4351
4351
|
prepareSymbol(t) {
|
|
4352
4352
|
const e = t.polygonFill;
|
|
4353
4353
|
Array.isArray(e) && (3 === e.length && e.push(1), t.polygonFill = e.map(t => 255 * t));
|
|
@@ -4366,9 +4366,9 @@ class Ye extends Be {
|
|
|
4366
4366
|
tileExtent: o.properties.tileExtent,
|
|
4367
4367
|
tileRatio: o.properties.tileRatio
|
|
4368
4368
|
}, c = this.getSymbol(s);
|
|
4369
|
-
if (fe(h, "polygonFill", c, "polygonFill",
|
|
4370
|
-
fe(h, "polygonOpacity", c, "polygonOpacity",
|
|
4371
|
-
fe(h, "uvOffset", c, "uvOffset",
|
|
4369
|
+
if (fe(h, "polygonFill", c, "polygonFill", Ye.polygonFill, ye(this.colorCache)),
|
|
4370
|
+
fe(h, "polygonOpacity", c, "polygonOpacity", Ye.polygonOpacity), fe(h, "uvScale", c, "uvScale", Ye.uvScale),
|
|
4371
|
+
fe(h, "uvOffset", c, "uvOffset", Ye.uvOffset), void 0 === a) {
|
|
4372
4372
|
const t = this.getSymbolDef(s), e = this.getFnTypeConfig(s);
|
|
4373
4373
|
Se(o, t, e), o.generateBuffers(this.regl);
|
|
4374
4374
|
}
|
|
@@ -4383,7 +4383,7 @@ class Ye extends Be {
|
|
|
4383
4383
|
}), h.polygonPatternFile = Xe(this.regl, u, !1), h.atlasSize = [ u.width, u.height ],
|
|
4384
4384
|
this.drawDebugAtlas(u);
|
|
4385
4385
|
}
|
|
4386
|
-
const d = new i.Material(h,
|
|
4386
|
+
const d = new i.Material(h, Ye), f = new i.Mesh(o, d, {
|
|
4387
4387
|
disableVAO: !0,
|
|
4388
4388
|
castShadow: !1,
|
|
4389
4389
|
picking: !0
|
|
@@ -4980,7 +4980,7 @@ class ci extends Be {
|
|
|
4980
4980
|
if (h && this.Mn(c, r)) return !1;
|
|
4981
4981
|
const d = i.length;
|
|
4982
4982
|
let f = l[c] && l[c][r];
|
|
4983
|
-
const p = f, m = this.
|
|
4983
|
+
const p = f, m = this.In && f;
|
|
4984
4984
|
if (!(m && 0 !== f.collides) && t) {
|
|
4985
4985
|
const t = m && 0 === f.collides;
|
|
4986
4986
|
if (this.dn || t) if ((this.mn || f && f.z !== a) && (f = null), f) {
|
|
@@ -5007,7 +5007,7 @@ class ci extends Be {
|
|
|
5007
5007
|
}, f.boxes.length = 0, f.z = a;
|
|
5008
5008
|
let t = 0;
|
|
5009
5009
|
for (let e = 0; e < d; e++) {
|
|
5010
|
-
const {mesh: o, allElements: s, boxCount: a, start: l, end: h} = i[e], c = this.
|
|
5010
|
+
const {mesh: o, allElements: s, boxCount: a, start: l, end: h} = i[e], c = this.Pn(o, s, a, l, h, n, r);
|
|
5011
5011
|
c.isAllowOverlap && (f.isAllowOverlap = 1), 0 === t && (t = c.collides), c.boxes && f.boxes.push(...c.boxes);
|
|
5012
5012
|
}
|
|
5013
5013
|
f.collides = t, this.Tn(c, r, f);
|
|
@@ -5065,7 +5065,7 @@ class ci extends Be {
|
|
|
5065
5065
|
ue(n) && (n = ri);
|
|
5066
5066
|
return i - Math.abs(this.On(t)[e]) < n;
|
|
5067
5067
|
}
|
|
5068
|
-
|
|
5068
|
+
Pn(t, e, i, n, r, o, s) {
|
|
5069
5069
|
const a = this.getSymbol(t.properties.symbolIndex), l = this.jn(a, t, e[n]), h = this.Rn(a, t, e[n]);
|
|
5070
5070
|
if (!1 === this.sceneConfig.collision || l && h) return hi;
|
|
5071
5071
|
const c = this.isBoxCollides(t, e, i, n, r, o, s);
|
|
@@ -5143,8 +5143,8 @@ class ci extends Be {
|
|
|
5143
5143
|
}
|
|
5144
5144
|
}
|
|
5145
5145
|
delete(t) {
|
|
5146
|
-
this.Un && (this.Un.geometry.dispose(), this.
|
|
5147
|
-
delete this.
|
|
5146
|
+
this.Un && (this.Un.geometry.dispose(), this.qn.dispose(), this.Un.dispose(), delete this.Un,
|
|
5147
|
+
delete this.qn, delete this.Gn), delete this.gn, super.delete(t);
|
|
5148
5148
|
}
|
|
5149
5149
|
isCollides(t) {
|
|
5150
5150
|
const e = this.layer;
|
|
@@ -5176,9 +5176,9 @@ class ci extends Be {
|
|
|
5176
5176
|
return !1 !== this.sceneConfig.collision || this.kn;
|
|
5177
5177
|
}
|
|
5178
5178
|
updateCollision(t) {
|
|
5179
|
-
super.updateCollision(t), this.wn(), this.Xn(), this.
|
|
5180
|
-
this.
|
|
5181
|
-
(this.getMap().isZooming() || this.
|
|
5179
|
+
super.updateCollision(t), this.wn(), this.Xn(), this.Yn && this.Yn.length && (this.Jn(),
|
|
5180
|
+
this.Yn && (this.setToRedraw(), this.scene.addMesh(this.Yn)));
|
|
5181
|
+
(this.getMap().isZooming() || this.Yn && this.Yn.length) && (this.Zn(), this.Kn(this.scene.getMeshes()));
|
|
5182
5182
|
}
|
|
5183
5183
|
paint(t) {
|
|
5184
5184
|
const e = super.paint(t);
|
|
@@ -5188,25 +5188,25 @@ class ci extends Be {
|
|
|
5188
5188
|
this.callCurrentTileShader(t, e), this.shouldIgnoreBackground() || this.callBackgroundTileShader(t, e);
|
|
5189
5189
|
}
|
|
5190
5190
|
shouldIgnoreBackground() {
|
|
5191
|
-
return !this.getMap().isZooming() && !this.
|
|
5191
|
+
return !this.getMap().isZooming() && !this.Yn;
|
|
5192
5192
|
}
|
|
5193
5193
|
Xn() {
|
|
5194
5194
|
const t = this.getMap(), e = t.isZooming();
|
|
5195
|
-
if (!e && this.
|
|
5195
|
+
if (!e && this.In) {
|
|
5196
5196
|
const t = this.layer.getRenderer();
|
|
5197
|
-
this.
|
|
5198
|
-
} else e && !this.
|
|
5199
|
-
if (e) this.er && (clearTimeout(this.er), delete this.Cn, delete this.er), this.Cn = this.tr && t.getResolution() > this.tr; else if (this.
|
|
5197
|
+
this.Yn = this.scene.getMeshes().filter(e => !t.isForeground(e) && !e.properties.isLinePlacement);
|
|
5198
|
+
} else e && !this.In && (this.tr = t.getResolution());
|
|
5199
|
+
if (e) this.er && (clearTimeout(this.er), delete this.Cn, delete this.er), this.Cn = this.tr && t.getResolution() > this.tr; else if (this.In && !this.er) {
|
|
5200
5200
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
5201
5201
|
ue(t) && (t = si), ue(e) && (e = ri), this.er = setTimeout(() => {
|
|
5202
5202
|
delete this.Cn, delete this.er;
|
|
5203
5203
|
}, t + e + 1);
|
|
5204
5204
|
}
|
|
5205
|
-
this.
|
|
5205
|
+
this.In = e;
|
|
5206
5206
|
}
|
|
5207
5207
|
Qn(t) {
|
|
5208
5208
|
if (!this.Bn || !this.layer.options.debugCollision) return;
|
|
5209
|
-
this.
|
|
5209
|
+
this.Gn || this.ir();
|
|
5210
5210
|
const {aPosition: e, aVisible: n, indices: r} = this.Bn;
|
|
5211
5211
|
if (!this.Un) {
|
|
5212
5212
|
const t = new i.Geometry({
|
|
@@ -5220,20 +5220,20 @@ class ci extends Be {
|
|
|
5220
5220
|
}
|
|
5221
5221
|
const o = this.Un.geometry;
|
|
5222
5222
|
o.updateData("aPosition", new Float32Array(e)), o.updateData("aVisible", new Uint8Array(n)),
|
|
5223
|
-
o.setElements(r), this.
|
|
5223
|
+
o.setElements(r), this.Gn.render(this.qn, {
|
|
5224
5224
|
size: [ this.canvas.width, this.canvas.height ]
|
|
5225
5225
|
}, this.nr, this.getRenderFBO(t)), delete this.Bn;
|
|
5226
5226
|
}
|
|
5227
5227
|
ir() {
|
|
5228
5228
|
const t = this.regl;
|
|
5229
|
-
this.
|
|
5229
|
+
this.Gn = new i.Renderer(t);
|
|
5230
5230
|
const e = this.canvas, n = {
|
|
5231
5231
|
x: 0,
|
|
5232
5232
|
y: 0,
|
|
5233
5233
|
width: () => e ? e.width : 1,
|
|
5234
5234
|
height: () => e ? e.height : 1
|
|
5235
5235
|
};
|
|
5236
|
-
this.
|
|
5236
|
+
this.qn = new i.MeshShader({
|
|
5237
5237
|
vert: "attribute vec2 aPosition;\nattribute float aVisible;\nuniform vec2 size;\nvarying vec4 vColor;\nvoid main() {\n vec2 c = (aPosition / size - .5) * 2. * vec2(1., -1.);\n gl_Position = vec4(c, .0, 1.);\n vColor = mix(vec4(1., .0, .0, 1.5) * .5, vec4(.0, 1., .0, 1.) * .4, aVisible);\n}",
|
|
5238
5238
|
frag: "precision mediump float;\nvarying vec4 vColor;\nvoid main() {\n gl_FragColor = vec4(vColor.rgb, .5);\n}",
|
|
5239
5239
|
uniforms: [ "size" ],
|
|
@@ -5253,17 +5253,17 @@ class ci extends Be {
|
|
|
5253
5253
|
}
|
|
5254
5254
|
});
|
|
5255
5255
|
}
|
|
5256
|
-
|
|
5256
|
+
Jn() {
|
|
5257
5257
|
let {fadeOutDelay: t, fadingDuration: e} = this.sceneConfig;
|
|
5258
5258
|
ue(t) && (t = si), ue(e) && (e = ri);
|
|
5259
5259
|
const i = this.layer.getRenderer(), n = i.getCurrentTileZoom(), r = i.getFrameTimestamp(), o = [];
|
|
5260
|
-
for (let s = 0; s < this.
|
|
5261
|
-
const a = this.
|
|
5260
|
+
for (let s = 0; s < this.Yn.length; s++) {
|
|
5261
|
+
const a = this.Yn[s], l = a.properties.tile;
|
|
5262
5262
|
!a.En && i.isBackTile(l.id) && (a.En = r);
|
|
5263
5263
|
const h = l.z - n > 0 ? 2 * (l.z - n) - 1 : 2 * (n - l.z);
|
|
5264
5264
|
a.properties.level = h, a.setUniform("level", h), i.isForeground(a) || a.En && r - a.En > t + e ? delete a.En : o.push(a);
|
|
5265
5265
|
}
|
|
5266
|
-
delete this.
|
|
5266
|
+
delete this.Yn, o.length && (this.Yn = o);
|
|
5267
5267
|
}
|
|
5268
5268
|
isEnableCollision() {
|
|
5269
5269
|
return this.layer.options.collision && !1 !== this.sceneConfig.collision;
|
|
@@ -5415,7 +5415,7 @@ function ki(t, e, i, n, r) {
|
|
|
5415
5415
|
return l.set(t, s, -o, o, s);
|
|
5416
5416
|
}
|
|
5417
5417
|
|
|
5418
|
-
const Si = [], Ti = [], Mi = [],
|
|
5418
|
+
const Si = [], Ti = [], Mi = [], Ii = [], Pi = [], Oi = [], Ci = [], Ei = [], Fi = [ 1, -1 ], zi = [ 1, 1 ];
|
|
5419
5419
|
|
|
5420
5420
|
function ji(t, e, i, r, o) {
|
|
5421
5421
|
const s = e.material.uniforms, a = o.cameraToCenterDistance, l = e.geometry.properties, c = this.getSymbol(l.symbolIndex), u = e.geometry.desc.positionSize, d = l.aAnchor, f = n.set(Si, d[i * u], d[i * u + 1], 2 === u ? 0 : d[i * u + 2]);
|
|
@@ -5425,8 +5425,8 @@ function ji(t, e, i, r, o) {
|
|
|
5425
5425
|
if (s.markerPerspectiveRatio) {
|
|
5426
5426
|
y = he(.5 + .5 * (1 - (1 - a / m) * s.markerPerspectiveRatio), 0, 4);
|
|
5427
5427
|
}
|
|
5428
|
-
const {aShape: g, aMarkerDx: v, aMarkerDy: b, aMarkerWidth: x, aMarkerHeight: w, aPitchAlign: A, aRotationAlign: _, aRotation: k} = l, S = v ? v[i] : c.markerDx, T = b ? b[i] : c.markerDy, M = A ? A[i] : s.pitchWithMap,
|
|
5429
|
-
let O = h.set(
|
|
5428
|
+
const {aShape: g, aMarkerDx: v, aMarkerDy: b, aMarkerWidth: x, aMarkerHeight: w, aPitchAlign: A, aRotationAlign: _, aRotation: k} = l, S = v ? v[i] : c.markerDx, T = b ? b[i] : c.markerDy, M = A ? A[i] : s.pitchWithMap, I = _ ? _[i] : s.rotateWithMap, P = h.set(Ei, S || 0, -(T || 0));
|
|
5429
|
+
let O = h.set(Ii, g[2 * i] / 10, g[2 * i + 1] / 10), C = h.set(Pi, g[2 * i + 2] / 10, g[2 * i + 3] / 10), E = h.set(Oi, g[2 * i + 4] / 10, g[2 * i + 5] / 10), F = h.set(Ci, g[2 * i + 6] / 10, g[2 * i + 7] / 10);
|
|
5430
5430
|
0 === s.flipY && 1 === M && (h.multiply(O, O, Fi), h.multiply(C, C, Fi), h.multiply(E, E, Fi),
|
|
5431
5431
|
h.multiply(F, F, Fi));
|
|
5432
5432
|
let z = x ? x[i] : c.markerWidth;
|
|
@@ -5437,19 +5437,19 @@ function ji(t, e, i, r, o) {
|
|
|
5437
5437
|
h.mul(O, O, D), h.mul(C, C, D), h.mul(E, E, D), h.mul(F, F, D);
|
|
5438
5438
|
let N = k ? k[i] / 9362 : -(c.markerRotation || 0) * Math.PI / 180;
|
|
5439
5439
|
const R = o.getBearing() * Math.PI / 180;
|
|
5440
|
-
if (R *
|
|
5441
|
-
const t = ki(Mi, N, R,
|
|
5440
|
+
if (R * I || N) {
|
|
5441
|
+
const t = ki(Mi, N, R, I, M);
|
|
5442
5442
|
O = h.transformMat2(O, O, t), C = h.transformMat2(C, C, t), E = h.transformMat2(E, E, t),
|
|
5443
5443
|
F = h.transformMat2(F, F, t);
|
|
5444
5444
|
}
|
|
5445
|
-
return 1 === M ? Ai(t, f, O, C, E, F, r,
|
|
5446
|
-
h.multiply(C, C, Fi), h.multiply(E, E, Fi), h.multiply(F, F, Fi), _i(t, p, O, C, E, F,
|
|
5445
|
+
return 1 === M ? Ai(t, f, O, C, E, F, r, P, s, o, m, y) : (h.multiply(O, O, Fi),
|
|
5446
|
+
h.multiply(C, C, Fi), h.multiply(E, E, Fi), h.multiply(F, F, Fi), _i(t, p, O, C, E, F, P, y)),
|
|
5447
5447
|
t;
|
|
5448
5448
|
}
|
|
5449
5449
|
|
|
5450
5450
|
const Di = [], Ni = [], Ri = [], Li = [], Hi = [], Vi = [], Ui = [ 1, -1 ];
|
|
5451
5451
|
|
|
5452
|
-
function
|
|
5452
|
+
function qi(t, e, i, r, o, s, a, l, c) {
|
|
5453
5453
|
const u = r.material.uniforms, d = c.cameraToCenterDistance, f = r.geometry.properties, p = this.getSymbol(f.symbolIndex), m = "line" === p.textPlacement && !xe(p), y = i[2];
|
|
5454
5454
|
let g = 1;
|
|
5455
5455
|
if (u.textPerspectiveRatio) {
|
|
@@ -5485,9 +5485,9 @@ function Gi(t, e, i, r, o, s, a, l, c) {
|
|
|
5485
5485
|
return s = s || 0, t[0] -= s + 1, t[1] -= s + 1, t[2] += s + 1, t[3] += s + 1, t;
|
|
5486
5486
|
}
|
|
5487
5487
|
|
|
5488
|
-
function
|
|
5488
|
+
function Gi(t, e, i) {
|
|
5489
5489
|
const r = e.geometry.desc.positionSize, {aAnchor: o, aAltitude: s} = e.geometry.properties, a = i * r;
|
|
5490
|
-
return s ? n.set(t, o[a], o[a + 1], s[i]) : 3 === r ?
|
|
5490
|
+
return s ? n.set(t, o[a], o[a + 1], s[i]) : 3 === r ? I.unpackPosition(t, o[a], o[a + 1], o[a + 2]) : n.set(t, o[a], o[a + 1], 0);
|
|
5491
5491
|
}
|
|
5492
5492
|
|
|
5493
5493
|
const Wi = {
|
|
@@ -5647,7 +5647,7 @@ function Xi(t, e, i) {
|
|
|
5647
5647
|
fe(e, "textDy", i, "textDy", Wi.textDy), fe(e, "textRotation", i, "textRotation", Wi.textRotation, t => t * Math.PI / 180);
|
|
5648
5648
|
}
|
|
5649
5649
|
|
|
5650
|
-
function
|
|
5650
|
+
function Yi(t, e) {
|
|
5651
5651
|
const i = t.getRenderer().canvas;
|
|
5652
5652
|
return {
|
|
5653
5653
|
uniforms: [ {
|
|
@@ -5706,7 +5706,7 @@ function Ji(t, e) {
|
|
|
5706
5706
|
};
|
|
5707
5707
|
}
|
|
5708
5708
|
|
|
5709
|
-
function
|
|
5709
|
+
function Ji(t, e) {
|
|
5710
5710
|
const i = m(e.textFill), n = m(e.textSize), r = m(e.textHaloFill), o = m(e.textHaloRadius), s = m(e.textHaloOpacity), a = m(e.textDx), l = m(e.textDy), h = m(e.textOpacity), c = y(e.textPitchAlignment), u = y(e.textRotationAlignment), d = m(e.textRotation), f = y(e.textAllowOverlapFn), g = y(e.textIgnorePlacement), v = {}, b = new Int16Array(1), x = new Uint16Array(1);
|
|
5711
5711
|
return [ {
|
|
5712
5712
|
attrName: "aTextFill",
|
|
@@ -5841,14 +5841,14 @@ function en(t, e, i, n, r, o, s) {
|
|
|
5841
5841
|
const a = this.getMap(), l = e.geometry.properties, h = this.getSymbol(l.symbolIndex), c = "line" === h.textPlacement && !xe(h), {aTextSize: u, aTextHaloRadius: d, aShape: f} = l;
|
|
5842
5842
|
let p = u ? u[i[r]] : e.properties.textSize;
|
|
5843
5843
|
null == p && (p = Wi.textSize);
|
|
5844
|
-
const m = d ? d[i[r]] : e.properties.textHaloRadius, y =
|
|
5844
|
+
const m = d ? d[i[r]] : e.properties.textHaloRadius, y = Gi(Qi, e, i[r]), g = mi(tn, y, s, a.width, a.height), v = n, {boxes: b, collision: x} = this.lr(e, r);
|
|
5845
5845
|
let w = 0;
|
|
5846
5846
|
if (c || 1 === e.material.uniforms.rotateWithMap || h.textRotation) {
|
|
5847
5847
|
let n = 0;
|
|
5848
5848
|
for (let o = r; o < r + 6 * v; o += 6) {
|
|
5849
5849
|
const r = b[w] = b[w] || [];
|
|
5850
5850
|
w++;
|
|
5851
|
-
const l =
|
|
5851
|
+
const l = qi.call(this, r, y, g, e, p, m, i[o], s, a);
|
|
5852
5852
|
if (!t) {
|
|
5853
5853
|
const e = this.isCollides(l);
|
|
5854
5854
|
1 === e ? t = 1 : -1 === e && n++;
|
|
@@ -5860,7 +5860,7 @@ function en(t, e, i, n, r, o, s) {
|
|
|
5860
5860
|
for (let h = r; h < o; h += 6) {
|
|
5861
5861
|
const r = f[2 * i[h] + 1];
|
|
5862
5862
|
if (l !== r || h === o - 6) {
|
|
5863
|
-
const c = i[h === o - 6 ? h : h - 6], u =
|
|
5863
|
+
const c = i[h === o - 6 ? h : h - 6], u = qi.call(this, Zi, y, g, e, p, m, n, s, a), d = qi.call(this, Ki, y, g, e, p, m, c, s, a), f = b[w] = b[w] || [];
|
|
5864
5864
|
w++, f[0] = Math.min(u[0], d[0]), f[1] = Math.min(u[1], d[1]), f[2] = Math.max(u[2], d[2]),
|
|
5865
5865
|
f[3] = Math.max(u[3], d[3]), n = i[h], l = r, !t && this.isCollides(f) && (t = 1);
|
|
5866
5866
|
}
|
|
@@ -5876,7 +5876,7 @@ function nn(t, e) {
|
|
|
5876
5876
|
}(t, e);
|
|
5877
5877
|
return i ? function(t, e, i) {
|
|
5878
5878
|
if (!i) return null;
|
|
5879
|
-
const n = t.localTransform, r =
|
|
5879
|
+
const n = t.localTransform, r = Gi(rn, t, e);
|
|
5880
5880
|
a.set(on, r[0], r[1], r[2], 1);
|
|
5881
5881
|
const o = a.transformMat4(on, on, n);
|
|
5882
5882
|
let s = 0;
|
|
@@ -6174,23 +6174,23 @@ function pn(t, e) {
|
|
|
6174
6174
|
S = (k.textSizeFn = k.textSizeFn || m(S))(c, k);
|
|
6175
6175
|
}
|
|
6176
6176
|
S /= 24;
|
|
6177
|
-
let T, M,
|
|
6178
|
-
if (p(
|
|
6179
|
-
|
|
6177
|
+
let T, M, I = h ? h(c, k) : l;
|
|
6178
|
+
if (p(I)) {
|
|
6179
|
+
I = (k.fitPaddingFn = k.fitPaddingFn || y(I))(c, k);
|
|
6180
6180
|
}
|
|
6181
|
-
if (
|
|
6181
|
+
if (I[0] === I[2] && I[1] === I[3] || (T = r.aPadOffsetX, M = r.aPadOffsetY, T || (T = r.aPadOffsetX = new Int8Array(g.length),
|
|
6182
6182
|
M = r.aPadOffsetY = new Int8Array(g.length))), delete k.$layer, delete k.$type,
|
|
6183
6183
|
g && i) {
|
|
6184
|
-
const e = Math.abs((d - o) / 10 * S) + (
|
|
6184
|
+
const e = Math.abs((d - o) / 10 * S) + (I[1] + I[3] || 0);
|
|
6185
6185
|
if (ln[0] = e, g[t] !== ln[0] && (ve(g, ln[0], t, t + 4), g.dirty = !0), T) {
|
|
6186
|
-
const e = (
|
|
6186
|
+
const e = (I[1] + I[3]) / 2 - I[3];
|
|
6187
6187
|
hn[0] = e, T[t] !== hn[0] && (ve(T, e, t, t + 4), T.dirty = !0);
|
|
6188
6188
|
}
|
|
6189
6189
|
}
|
|
6190
6190
|
if (v && n) {
|
|
6191
|
-
const e = Math.abs((f - u) / 10 * S) + (
|
|
6191
|
+
const e = Math.abs((f - u) / 10 * S) + (I[0] + I[2] || 0);
|
|
6192
6192
|
if (ln[0] = e, v[t] !== ln[0] && (ve(v, ln[0], t, t + 4), v.dirty = !0), M) {
|
|
6193
|
-
const e =
|
|
6193
|
+
const e = I[0] - (I[0] + I[2]) / 2;
|
|
6194
6194
|
hn[0] = e, M[t] !== hn[0] && (ve(M, e, t, t + 4), M.dirty = !0);
|
|
6195
6195
|
}
|
|
6196
6196
|
}
|
|
@@ -6245,7 +6245,7 @@ class wn extends ci {
|
|
|
6245
6245
|
createFnTypeConfig(t, e) {
|
|
6246
6246
|
return {
|
|
6247
6247
|
icon: un.call(this, t, e),
|
|
6248
|
-
text:
|
|
6248
|
+
text: Ji.call(this, t, e)
|
|
6249
6249
|
};
|
|
6250
6250
|
}
|
|
6251
6251
|
startFrame(...t) {
|
|
@@ -6384,7 +6384,7 @@ class wn extends ci {
|
|
|
6384
6384
|
for (let i = 0; i < t.length; i++) {
|
|
6385
6385
|
if (!this.isMeshIterable(t[i])) continue;
|
|
6386
6386
|
const n = t[i].geometry, {symbolIndex: r} = n.properties, o = this.getSymbolDef(r), s = this.getFnTypeConfig(r);
|
|
6387
|
-
|
|
6387
|
+
Pe(this.regl, o, 0 === r.type ? s.icon : s.text, t[i], e);
|
|
6388
6388
|
const {aMarkerWidth: a, aMarkerHeight: l, aPadOffsetX: h, aPadOffsetY: c} = n.properties;
|
|
6389
6389
|
a && a.dirty && (n.updateData("aMarkerWidth", a), a.dirty = !1), l && l.dirty && (n.updateData("aMarkerHeight", l),
|
|
6390
6390
|
l.dirty = !1), h && h.dirty && (n.updateData("aPadOffsetX", h), h.dirty = !1), c && c.dirty && (n.updateData("aPadOffsetY", c),
|
|
@@ -6414,7 +6414,7 @@ class wn extends ci {
|
|
|
6414
6414
|
let t = this.br;
|
|
6415
6415
|
t && t.length && this.Mr(t);
|
|
6416
6416
|
}
|
|
6417
|
-
|
|
6417
|
+
Ir(t, e, i, n) {
|
|
6418
6418
|
return this.updateBoxCollisionFading(!0, t, e, i, n);
|
|
6419
6419
|
}
|
|
6420
6420
|
isEnableUniquePlacement() {
|
|
@@ -6435,7 +6435,7 @@ class wn extends ci {
|
|
|
6435
6435
|
const o = e.isForeground(n.meshes[0]);
|
|
6436
6436
|
if (this.shouldIgnoreBackground() && !o) continue;
|
|
6437
6437
|
const s = n.properties.meshKey;
|
|
6438
|
-
this.startMeshCollision(n), this.
|
|
6438
|
+
this.startMeshCollision(n), this.Pr(n), this.forEachBox(n, this.Ir), this.Or(n),
|
|
6439
6439
|
this.endMeshCollision(s);
|
|
6440
6440
|
for (let t = 0; t < n.meshes.length; t++) this.Cr(n.meshes[t]);
|
|
6441
6441
|
}
|
|
@@ -6483,7 +6483,7 @@ class wn extends ci {
|
|
|
6483
6483
|
if (!h) return !1;
|
|
6484
6484
|
return i.call(this, t, l, a, n.boxIndex++) && this.Fr(t, e), !0;
|
|
6485
6485
|
}
|
|
6486
|
-
|
|
6486
|
+
Pr(t) {
|
|
6487
6487
|
const e = t.meshes;
|
|
6488
6488
|
for (let t = 0; t < e.length; t++) {
|
|
6489
6489
|
const i = e[t], n = i && i.geometry;
|
|
@@ -6583,7 +6583,7 @@ class wn extends ci {
|
|
|
6583
6583
|
} ],
|
|
6584
6584
|
extraCommandProps: n
|
|
6585
6585
|
}), this.shader.version = 300;
|
|
6586
|
-
const {uniforms: o, extraCommandProps: s} =
|
|
6586
|
+
const {uniforms: o, extraCommandProps: s} = Yi.call(this, this.layer, this.sceneConfig), a = this.xr || {};
|
|
6587
6587
|
if (this.Tr = new i.MeshShader({
|
|
6588
6588
|
vert: sn,
|
|
6589
6589
|
frag: an,
|
|
@@ -6690,10 +6690,10 @@ kn.prototype = {
|
|
|
6690
6690
|
return this.clone().Ur(t);
|
|
6691
6691
|
},
|
|
6692
6692
|
unit: function() {
|
|
6693
|
-
return this.clone().
|
|
6693
|
+
return this.clone().qr();
|
|
6694
6694
|
},
|
|
6695
6695
|
perp: function() {
|
|
6696
|
-
return this.clone().
|
|
6696
|
+
return this.clone().Gr();
|
|
6697
6697
|
},
|
|
6698
6698
|
round: function() {
|
|
6699
6699
|
return this.clone().Wr();
|
|
@@ -6745,10 +6745,10 @@ kn.prototype = {
|
|
|
6745
6745
|
Nr: function(t) {
|
|
6746
6746
|
return this.x /= t.x, this.y /= t.y, this;
|
|
6747
6747
|
},
|
|
6748
|
-
|
|
6748
|
+
qr: function() {
|
|
6749
6749
|
return this.Lr(this.mag()), this;
|
|
6750
6750
|
},
|
|
6751
|
-
|
|
6751
|
+
Gr: function() {
|
|
6752
6752
|
var t = this.y;
|
|
6753
6753
|
return this.y = this.x, this.x = -t, this;
|
|
6754
6754
|
},
|
|
@@ -6769,7 +6769,7 @@ kn.prototype = {
|
|
|
6769
6769
|
|
|
6770
6770
|
const Sn = [], Tn = [], Mn = [];
|
|
6771
6771
|
|
|
6772
|
-
function
|
|
6772
|
+
function In(t, e, i, r, o, s, a, l) {
|
|
6773
6773
|
const {aGlyphOffset: c, aSegment: u, aTextDx: d, aTextDy: f, symbolIndex: p} = e.geometry.properties, m = this.getSymbol(p), y = d ? d[o] : m.textDx, g = f ? f[o] : m.textDy, v = h.set(Mn, y || 0, g || 0), b = h.set(Sn, c[2 * o], c[2 * o + 1]), x = n.set(Tn, u[3 * o], u[3 * o + 1], u[3 * o + 2]);
|
|
6774
6774
|
return function(t, e, i, n, r, o, s, a, l, h, c, u) {
|
|
6775
6775
|
const d = n[0] * h, f = c ? d - r : d + r;
|
|
@@ -6782,24 +6782,24 @@ function Pn(t, e, i, r, o, s, a, l) {
|
|
|
6782
6782
|
x.x = b.x, x.y = b.y, b.x = e[3 * v], b.y = e[3 * v + 1], w += A, A = x.dist(b) / u;
|
|
6783
6783
|
}
|
|
6784
6784
|
const _ = (g - w) / A, k = b.sub(x), S = k.mult(_).zr(x);
|
|
6785
|
-
S.zr(k.
|
|
6785
|
+
S.zr(k.qr().Gr().Rr(o * p));
|
|
6786
6786
|
const T = m + Math.atan2(b.y - x.y, b.x - x.x);
|
|
6787
6787
|
return t[0] = (S.x - i[0]) / u, t[1] = (S.y - i[1]) / u, t[2] = T, t;
|
|
6788
6788
|
}(t, r, s, b, v[0], v[1], x[0], x[1], x[2], i / 24, l, a);
|
|
6789
6789
|
}
|
|
6790
6790
|
|
|
6791
|
-
const
|
|
6791
|
+
const Pn = [], On = [];
|
|
6792
6792
|
|
|
6793
6793
|
function Cn(t, e, i, r, o, s, a, l, c, u, d) {
|
|
6794
6794
|
const {aVertical: f} = i.geometry.properties, p = f[s];
|
|
6795
|
-
let m, y, g =
|
|
6795
|
+
let m, y, g = In.call(this, Pn, i, r, o, s, l, c, !1);
|
|
6796
6796
|
if (!g) return null;
|
|
6797
|
-
if (n.copy(t, g), g =
|
|
6798
|
-
if (n.copy(e, g), d && (h.transformMat2(
|
|
6797
|
+
if (n.copy(t, g), g = In.call(this, On, i, r, o, a, l, c, !1), !g) return null;
|
|
6798
|
+
if (n.copy(e, g), d && (h.transformMat2(Pn, Pn, d), h.transformMat2(On, On, d)),
|
|
6799
6799
|
p) {
|
|
6800
|
-
const t = Math.abs(On[1] -
|
|
6801
|
-
y =
|
|
6802
|
-
} else m = 0, y =
|
|
6800
|
+
const t = Math.abs(On[1] - Pn[1]), e = Math.abs(On[0] - Pn[0]) * u;
|
|
6801
|
+
y = Pn[0] > On[0] ? 1 : 0, t > e ? (m = 1, y = Pn[1] < On[1] ? 0 : 1) : m = 0;
|
|
6802
|
+
} else m = 0, y = Pn[0] > On[0] ? 1 : 0;
|
|
6803
6803
|
return 2 * y + m;
|
|
6804
6804
|
}
|
|
6805
6805
|
|
|
@@ -6817,15 +6817,15 @@ const Fn = function(t) {
|
|
|
6817
6817
|
}, Dn = function(t) {
|
|
6818
6818
|
const e = this.layer.getRenderer(), i = this.getSymbol(t.properties.symbolIndex);
|
|
6819
6819
|
return !this.ur(t) && !e.isForeground(t) && "line" === i.textPlacement;
|
|
6820
|
-
}, Nn = [ 0, 0, 3 ], Rn = [], Ln = [], Hn = [], Vn = [], Un = [],
|
|
6820
|
+
}, Nn = [ 0, 0, 3 ], Rn = [], Ln = [], Hn = [], Vn = [], Un = [], qn = [], Gn = [], Wn = [], Bn = [], $n = [ 1, -1 ], Xn = new Int16Array(3), Yn = [], Jn = [], Zn = [], Kn = [], Qn = [], tr = [];
|
|
6821
6821
|
|
|
6822
6822
|
class er extends ci {
|
|
6823
6823
|
constructor(t, e, i, n, r) {
|
|
6824
6824
|
super(t, e, i, n, r), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
|
|
6825
6825
|
this.colorCache = {}, this.Br = Fn.bind(this), this.$r = zn.bind(this), this.Xr = jn.bind(this),
|
|
6826
|
-
this.
|
|
6826
|
+
this.Yr = Dn.bind(this), this.isLabelCollides = en.bind(this), this.Jr();
|
|
6827
6827
|
}
|
|
6828
|
-
|
|
6828
|
+
Jr() {
|
|
6829
6829
|
this.Zr = [];
|
|
6830
6830
|
for (let t = 0; t < this.symbolDef.length; t++) {
|
|
6831
6831
|
const e = this.symbolDef[t];
|
|
@@ -6834,7 +6834,7 @@ class er extends ci {
|
|
|
6834
6834
|
}
|
|
6835
6835
|
updateSymbol(...t) {
|
|
6836
6836
|
const e = super.updateSymbol(...t);
|
|
6837
|
-
return this.
|
|
6837
|
+
return this.Jr(), e;
|
|
6838
6838
|
}
|
|
6839
6839
|
shouldDeleteMeshOnUpdateSymbol(t) {
|
|
6840
6840
|
if (!Array.isArray(t)) return (0 === t.textHaloRadius || 0 === this.symbolDef[0].textHaloRadius) && t.textHaloRadius !== this.symbolDef[0].textHaloRadius;
|
|
@@ -6842,7 +6842,7 @@ class er extends ci {
|
|
|
6842
6842
|
return !1;
|
|
6843
6843
|
}
|
|
6844
6844
|
createFnTypeConfig(t, e) {
|
|
6845
|
-
return
|
|
6845
|
+
return Ji(t, e);
|
|
6846
6846
|
}
|
|
6847
6847
|
isBloom(t) {
|
|
6848
6848
|
return !!this.getSymbol(t.properties.symbolIndex).textBloom;
|
|
@@ -6877,7 +6877,7 @@ class er extends ci {
|
|
|
6877
6877
|
}
|
|
6878
6878
|
callBackgroundTileShader(t, e) {
|
|
6879
6879
|
this.shader.filter = e.sceneFilter ? [ this.$r, e.sceneFilter ] : this.$r, this.renderer.render(this.shader, t, this.scene, this.getRenderFBO(e)),
|
|
6880
|
-
this.io.filter = e.sceneFilter ? [ this.
|
|
6880
|
+
this.io.filter = e.sceneFilter ? [ this.Yr, e.sceneFilter ] : this.Yr, this.renderer.render(this.io, t, this.scene, this.getRenderFBO(e));
|
|
6881
6881
|
}
|
|
6882
6882
|
eo() {
|
|
6883
6883
|
let t = this.scene.getMeshes();
|
|
@@ -6965,7 +6965,7 @@ class er extends ci {
|
|
|
6965
6965
|
if (c && this.isMeshUniquePlaced(t) && r && !r.label) {
|
|
6966
6966
|
const e = r.properties || {};
|
|
6967
6967
|
e.$layer = r.layer, e.$type = r.type;
|
|
6968
|
-
const n = this.Zr[i] ? this.Zr[i](null, e) : this.getSymbol(t.properties.symbolIndex).textName, o =
|
|
6968
|
+
const n = this.Zr[i] ? this.Zr[i](null, e) : this.getSymbol(t.properties.symbolIndex).textName, o = P.resolveText(n, e);
|
|
6969
6969
|
delete e.$layer, delete e.$type, r.label = o;
|
|
6970
6970
|
}
|
|
6971
6971
|
const o = i, y = s[l[p]];
|
|
@@ -6977,34 +6977,34 @@ class er extends ci {
|
|
|
6977
6977
|
oo(t, e, i, o, s, l, u) {
|
|
6978
6978
|
const d = this.$n(), f = this.getMap(), p = t.geometry, m = p.desc.positionSize, {aShape: y, aOffset: g, aAnchor: v, aAltitude: b, aPitchRotation: x} = p.properties, w = p.properties.aTextSize, A = !u, _ = e[i] * m;
|
|
6979
6979
|
let k = Vn;
|
|
6980
|
-
p.data.aAltitude ? n.set(Vn, v[_], v[_ + 1], b[e[i]]) :
|
|
6980
|
+
p.data.aAltitude ? n.set(Vn, v[_], v[_ + 1], b[e[i]]) : I.unpackPosition(Vn, v[_], v[_ + 1], v[_ + 2]);
|
|
6981
6981
|
const S = mi(Un, k, l, f.width, f.height);
|
|
6982
|
-
if (a.set(
|
|
6982
|
+
if (a.set(qn, S[0], S[1], S[0], S[1]), f.isOffscreen(qn)) return d || ir(g, e, i, o),
|
|
6983
6983
|
!1;
|
|
6984
6984
|
A && (k = S);
|
|
6985
6985
|
const T = A ? 1 : p.properties.tileExtent / this.layer.options.tileSize[0];
|
|
6986
6986
|
let M = !0;
|
|
6987
|
-
const
|
|
6987
|
+
const P = e[i], O = e[o - 1], C = w ? w[P] : t.properties.textSize, E = this.so(t, C, s, P, O, k, T, u);
|
|
6988
6988
|
if (null === E) return ir(g, e, i, o), !1;
|
|
6989
|
-
const F = O -
|
|
6989
|
+
const F = O - P <= 3, z = t.material.uniforms, j = 1 === z.pitchWithMap, D = Math.floor(E / 2), N = E % 2;
|
|
6990
6990
|
for (let a = i; a < o; a += 6) {
|
|
6991
6991
|
const l = e[a];
|
|
6992
6992
|
let u;
|
|
6993
|
-
if (u = D || a !== i || F ? D || a !== o - 6 || F ?
|
|
6993
|
+
if (u = D || a !== i || F ? D || a !== o - 6 || F ? In.call(this, Ln, t, C, s, l, k, T, D) : tr : Qn,
|
|
6994
6994
|
!u) {
|
|
6995
6995
|
M = !1, d || ir(g, e, i, o);
|
|
6996
6996
|
break;
|
|
6997
6997
|
}
|
|
6998
6998
|
let f = u[2];
|
|
6999
6999
|
N && (f -= Math.PI / 2);
|
|
7000
|
-
const p = ki(
|
|
7000
|
+
const p = ki(Gn, f, 0, z.rotateWithMap, z.pitchWithMap), m = g.length > y.length;
|
|
7001
7001
|
let v;
|
|
7002
7002
|
if (m) {
|
|
7003
7003
|
n.set(Kn, x[3 * l], x[3 * l + 1], 0);
|
|
7004
7004
|
const t = n.normalize(Kn, Kn), e = -x[3 * l + 2];
|
|
7005
7005
|
if (e) {
|
|
7006
|
-
const i = c.setAxisAngle(
|
|
7007
|
-
r.fromTranslation(
|
|
7006
|
+
const i = c.setAxisAngle(Yn, t, e);
|
|
7007
|
+
r.fromTranslation(Jn, Nn), r.fromQuat(Zn, i), v = r.multiply(Zn, Zn, Jn);
|
|
7008
7008
|
}
|
|
7009
7009
|
}
|
|
7010
7010
|
for (let t = 0; t < 4; t++) {
|
|
@@ -7040,7 +7040,7 @@ class er extends ci {
|
|
|
7040
7040
|
init() {
|
|
7041
7041
|
const t = this.regl;
|
|
7042
7042
|
this.renderer = new i.Renderer(t);
|
|
7043
|
-
const {uniforms: e, extraCommandProps: n} =
|
|
7043
|
+
const {uniforms: e, extraCommandProps: n} = Yi.call(this, this.layer, this.sceneConfig);
|
|
7044
7044
|
this.shader = new i.MeshShader({
|
|
7045
7045
|
vert: sn,
|
|
7046
7046
|
frag: an,
|
|
@@ -7312,7 +7312,7 @@ class lr extends Be {
|
|
|
7312
7312
|
|
|
7313
7313
|
const hr = [ 1, 1, 1 ], cr = [ 1, 1, 1, 1 ], ur = [ 0, 0 ], dr = [];
|
|
7314
7314
|
|
|
7315
|
-
class fr extends
|
|
7315
|
+
class fr extends qe {
|
|
7316
7316
|
supportRenderMode(t) {
|
|
7317
7317
|
return this.isAnimating() ? "fxaa" === t || "fxaaAfterTaa" === t : "taa" === t || "fxaa" === t;
|
|
7318
7318
|
}
|
|
@@ -7614,7 +7614,7 @@ class mr extends fr {
|
|
|
7614
7614
|
|
|
7615
7615
|
const yr = [ 1, 1, 1 ];
|
|
7616
7616
|
|
|
7617
|
-
class gr extends
|
|
7617
|
+
class gr extends qe {
|
|
7618
7618
|
constructor(t, e, i, n, r) {
|
|
7619
7619
|
if (super(t, e, i, n, r), p(this.symbolDef[0].lineColor)) {
|
|
7620
7620
|
const t = e.getMap(), i = y(this.symbolDef.lineColor);
|
|
@@ -8111,15 +8111,15 @@ class Ar extends Be {
|
|
|
8111
8111
|
}
|
|
8112
8112
|
}
|
|
8113
8113
|
|
|
8114
|
-
const _r = [], kr = [], Sr = [ 0, 0, 0 ], Tr = [ 0, 0, 0 ], Mr = [ 1, 1, 1 ],
|
|
8114
|
+
const _r = [], kr = [], Sr = [ 0, 0, 0 ], Tr = [ 0, 0, 0 ], Mr = [ 1, 1, 1 ], Ir = [], Pr = [ 1, 1, 1, 1 ], Or = [], Cr = t => class extends t {
|
|
8115
8115
|
constructor(t, e, n, r, o) {
|
|
8116
8116
|
super(t, e, n, r, o), this.So = !1, this.scene.sortFunction = this.sortByCommandKey,
|
|
8117
|
-
this.To = [], this.Mo = new i.GLTFManager(t), this.
|
|
8117
|
+
this.To = [], this.Mo = new i.GLTFManager(t), this.Io();
|
|
8118
8118
|
}
|
|
8119
8119
|
isAnimating() {
|
|
8120
8120
|
const t = this.getSymbols();
|
|
8121
8121
|
for (let e = 0; e < t.length; e++) {
|
|
8122
|
-
if (t[e] && this.
|
|
8122
|
+
if (t[e] && this.Po[e] && this.Oo(e)) return !0;
|
|
8123
8123
|
}
|
|
8124
8124
|
return !1;
|
|
8125
8125
|
}
|
|
@@ -8136,7 +8136,7 @@ const _r = [], kr = [], Sr = [ 0, 0, 0 ], Tr = [ 0, 0, 0 ], Mr = [ 1, 1, 1 ], Pr
|
|
|
8136
8136
|
};
|
|
8137
8137
|
}
|
|
8138
8138
|
getFnTypeConfig() {
|
|
8139
|
-
return
|
|
8139
|
+
return Ir;
|
|
8140
8140
|
}
|
|
8141
8141
|
createMesh(t, e, {tileTranslationMatrix: o, tileExtent: s}) {
|
|
8142
8142
|
if (!this.So) return null;
|
|
@@ -8177,7 +8177,7 @@ const _r = [], kr = [], Sr = [ 0, 0, 0 ], Tr = [ 0, 0, 0 ], Mr = [ 1, 1, 1 ], Pr
|
|
|
8177
8177
|
m && (_.setUniform("jointTexture", m.jointTexture), _.setUniform("jointTextureSize", m.jointTextureSize),
|
|
8178
8178
|
_.setUniform("numJoints", m.numJoints), _.setUniform("skinAnimation", 0), A.HAS_SKIN = 1),
|
|
8179
8179
|
y && (_.setUniform("morphWeights", y), A.HAS_MORPH = 1), _.setUniform("hasAlpha", b.alphaMode && "BLEND" === b.alphaMode.toUpperCase()),
|
|
8180
|
-
fe(_.uniforms, "polygonFill", e, "polygonFill",
|
|
8180
|
+
fe(_.uniforms, "polygonFill", e, "polygonFill", Pr, ye(this.colorCache)), fe(_.uniforms, "polygonOpacity", e, "polygonOpacity", 1);
|
|
8181
8181
|
const k = r.multiply([], v, h), S = [];
|
|
8182
8182
|
return r.fromTranslation(S, x), r.multiply(k, S, k), _.setPositionMatrix(() => {
|
|
8183
8183
|
if (be(g)) {
|
|
@@ -8223,24 +8223,24 @@ const _r = [], kr = [], Sr = [ 0, 0, 0 ], Tr = [ 0, 0, 0 ], Mr = [ 1, 1, 1 ], Pr
|
|
|
8223
8223
|
let i = !1;
|
|
8224
8224
|
for (let n = 0; n < e.length; n++) {
|
|
8225
8225
|
const r = e[n];
|
|
8226
|
-
if (!r || !this.
|
|
8227
|
-
if (this.Oo(n) && this.
|
|
8226
|
+
if (!r || !this.Po[n]) continue;
|
|
8227
|
+
if (this.Oo(n) && this.Po[n]) {
|
|
8228
8228
|
i || (i = !0);
|
|
8229
8229
|
let e = r.speed;
|
|
8230
8230
|
const o = !!r.loop;
|
|
8231
|
-
ue(e) && (e = 1), this.
|
|
8231
|
+
ue(e) && (e = 1), this.Po[n].updateAnimation(t.timestamp, o, e);
|
|
8232
8232
|
}
|
|
8233
8233
|
}
|
|
8234
8234
|
i && this.setToRedraw(!0), super.prepareRender(t);
|
|
8235
8235
|
}
|
|
8236
8236
|
getShadowMeshes() {
|
|
8237
|
-
if (!this.isVisible()) return
|
|
8237
|
+
if (!this.isVisible()) return Ir;
|
|
8238
8238
|
this.shadowCount = this.scene.getMeshes().length;
|
|
8239
8239
|
return this.scene.getMeshes().filter(t => 0 === t.getUniform("level"));
|
|
8240
8240
|
}
|
|
8241
8241
|
Oo(t) {
|
|
8242
8242
|
const e = this.getSymbols()[t];
|
|
8243
|
-
return e && e.animation && this.
|
|
8243
|
+
return e && e.animation && this.Po[t] && this.Po[t].hasSkinAnimation();
|
|
8244
8244
|
}
|
|
8245
8245
|
Co(t, e, i, o, s, a) {
|
|
8246
8246
|
function l(e, i, n, r) {
|
|
@@ -8258,11 +8258,11 @@ const _r = [], kr = [], Sr = [ 0, 0, 0 ], Tr = [ 0, 0, 0 ], Mr = [ 1, 1, 1 ], Pr
|
|
|
8258
8258
|
return t.positionAttribute = "POSITION", t.normalAttribute = "NORMAL", t;
|
|
8259
8259
|
}
|
|
8260
8260
|
init(t) {
|
|
8261
|
-
super.init(t), this.
|
|
8261
|
+
super.init(t), this.Io();
|
|
8262
8262
|
}
|
|
8263
|
-
|
|
8264
|
-
if (this.
|
|
8265
|
-
this.
|
|
8263
|
+
Io() {
|
|
8264
|
+
if (this.Po) return;
|
|
8265
|
+
this.Po = [];
|
|
8266
8266
|
const t = this.getSymbols();
|
|
8267
8267
|
this.zo = 0;
|
|
8268
8268
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -8272,11 +8272,11 @@ const _r = [], kr = [], Sr = [ 0, 0, 0 ], Tr = [ 0, 0, 0 ], Mr = [ 1, 1, 1 ], Pr
|
|
|
8272
8272
|
if (n.then) n.then(i => {
|
|
8273
8273
|
if (!i.gltfPack) return this.zo++, void (this.zo >= t.length && (this.So = !0, this.setToRedraw(!0)));
|
|
8274
8274
|
const {gltfPack: n} = i;
|
|
8275
|
-
this.
|
|
8275
|
+
this.Po[e] = [ n ], this.To[e] = n.getMeshesInfo(), this.zo++, this.zo >= t.length && (this.So = !0),
|
|
8276
8276
|
this.setToRedraw(!0);
|
|
8277
8277
|
}); else {
|
|
8278
8278
|
const {gltfPack: t} = n;
|
|
8279
|
-
t && (this.
|
|
8279
|
+
t && (this.Po[e] = [ t ], this.To[e] = t.getMeshesInfo(), this.zo++);
|
|
8280
8280
|
}
|
|
8281
8281
|
}
|
|
8282
8282
|
this.zo >= t.length && (this.So = !0);
|
|
@@ -8388,27 +8388,27 @@ class Rr extends Be {
|
|
|
8388
8388
|
const e = this.getSymbol({
|
|
8389
8389
|
index: 0
|
|
8390
8390
|
}), i = e.texWaveNormal, n = this.getCachedTexture(i), r = this;
|
|
8391
|
-
if (n) n.loading || (this.Uo = this.
|
|
8391
|
+
if (n) n.loading || (this.Uo = this.qo(t, n)); else {
|
|
8392
8392
|
const e = new Image;
|
|
8393
8393
|
e.loading = !0, e.onload = function() {
|
|
8394
|
-
delete this.loading, r.Uo = r.
|
|
8394
|
+
delete this.loading, r.Uo = r.qo(t, this), this.Vo = [ this.width, this.height ],
|
|
8395
8395
|
r.setToRedraw();
|
|
8396
8396
|
}, e.onerror = () => {
|
|
8397
8397
|
console.error("invalid water wave normal texture:" + i);
|
|
8398
8398
|
}, this.addCachedTexture(i, e), e.src = i;
|
|
8399
8399
|
}
|
|
8400
8400
|
const o = e.texWavePerturbation, s = this.getCachedTexture(o);
|
|
8401
|
-
if (s) s.loading || (this.
|
|
8401
|
+
if (s) s.loading || (this.Go = this.qo(t, s)); else {
|
|
8402
8402
|
const e = new Image;
|
|
8403
8403
|
e.loading = !0, e.onload = function() {
|
|
8404
|
-
delete this.loading, r.
|
|
8404
|
+
delete this.loading, r.Go = r.qo(t, this), this.Vo = [ this.width, this.height ],
|
|
8405
8405
|
r.setToRedraw();
|
|
8406
8406
|
}, e.onerror = () => {
|
|
8407
8407
|
console.error("invalid water wave perturbation texture:" + o);
|
|
8408
8408
|
}, this.addCachedTexture(o, e), e.src = o;
|
|
8409
8409
|
}
|
|
8410
8410
|
}
|
|
8411
|
-
|
|
8411
|
+
qo(t, e) {
|
|
8412
8412
|
return this.Ho ? t.texture({
|
|
8413
8413
|
width: this.Vo[0],
|
|
8414
8414
|
height: this.Vo[1],
|
|
@@ -8544,7 +8544,7 @@ class Rr extends Be {
|
|
|
8544
8544
|
camPos: t.cameraPosition,
|
|
8545
8545
|
timeElapsed: h.animation ? (this.layer.getRenderer().getFrameTimestamp() || 0) / (1 / (h.waterSpeed || 1) * 1e4) : 0,
|
|
8546
8546
|
normalTexture: this.Uo || this.Ho,
|
|
8547
|
-
heightTexture: this.
|
|
8547
|
+
heightTexture: this.Go || this.Ho,
|
|
8548
8548
|
waveParams: u,
|
|
8549
8549
|
waterDir: Lr(c, h.waterDirection || 0),
|
|
8550
8550
|
waterBaseColor: h.waterBaseColor || [ .1451, .2588, .4863, 1 ],
|
|
@@ -8555,7 +8555,7 @@ class Rr extends Be {
|
|
|
8555
8555
|
}
|
|
8556
8556
|
delete() {
|
|
8557
8557
|
super.delete(), this.Ho && (this.Ho.destroy(), delete this.Ho), this.Uo && this.Uo.destroy(),
|
|
8558
|
-
this.
|
|
8558
|
+
this.Go && this.Go.destroy(), this.shader && this.shader.dispose(), this.Do && this.Do.dispose(),
|
|
8559
8559
|
this.Ro && (this.Ro.geometry.dispose(), this.Ro.material && this.Ro.material.dispose(),
|
|
8560
8560
|
this.Ro.dispose(), delete this.Ro), this.disposeIBLTextures();
|
|
8561
8561
|
}
|
|
@@ -8580,7 +8580,7 @@ function Lr(t, e) {
|
|
|
8580
8580
|
return i = e, e = Math.PI * i / 180, t[0] = Math.sin(e), t[1] = Math.cos(e), t;
|
|
8581
8581
|
}
|
|
8582
8582
|
|
|
8583
|
-
const Hr = se("fill",
|
|
8583
|
+
const Hr = se("fill", Je);
|
|
8584
8584
|
|
|
8585
8585
|
Hr.registerAt(gt);
|
|
8586
8586
|
|
|
@@ -8592,13 +8592,13 @@ const Ur = se("line-gradient", Qe);
|
|
|
8592
8592
|
|
|
8593
8593
|
Ur.registerAt(gt);
|
|
8594
8594
|
|
|
8595
|
-
const
|
|
8595
|
+
const qr = se("icon", wn);
|
|
8596
8596
|
|
|
8597
|
-
|
|
8597
|
+
qr.registerAt(gt);
|
|
8598
8598
|
|
|
8599
|
-
const
|
|
8599
|
+
const Gr = se("text", er);
|
|
8600
8600
|
|
|
8601
|
-
|
|
8601
|
+
Gr.registerAt(gt);
|
|
8602
8602
|
|
|
8603
8603
|
const Wr = se("native-line", lr);
|
|
8604
8604
|
|
|
@@ -8618,13 +8618,13 @@ const Xr = se("lit", br);
|
|
|
8618
8618
|
|
|
8619
8619
|
Xr.registerAt(gt);
|
|
8620
8620
|
|
|
8621
|
-
const
|
|
8621
|
+
const Yr = se("tube", Ar);
|
|
8622
8622
|
|
|
8623
|
-
|
|
8623
|
+
Yr.registerAt(gt);
|
|
8624
8624
|
|
|
8625
|
-
const
|
|
8625
|
+
const Jr = se("gltf-phong", Er);
|
|
8626
8626
|
|
|
8627
|
-
|
|
8627
|
+
Jr.registerAt(gt);
|
|
8628
8628
|
|
|
8629
8629
|
const Zr = se("gltf-lit", Fr);
|
|
8630
8630
|
|
|
@@ -8710,10 +8710,10 @@ Kr.registerAt(gt);
|
|
|
8710
8710
|
|
|
8711
8711
|
const Qr = se("water", Rr);
|
|
8712
8712
|
|
|
8713
|
-
Qr.registerAt(gt),
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
gt.VERSION = "0.
|
|
8713
|
+
Qr.registerAt(gt), It.registerPainter("lit", br), It.registerPainter("icon", wn),
|
|
8714
|
+
It.registerPainter("fill", Je), It.registerPainter("line", Ke), It.registerPainter("line-gradient", Qe),
|
|
8715
|
+
It.registerPainter("water", Rr), It.registerPainter("tube", Ar), i.ShaderLib.register("vt_position_vert", "#ifdef HAS_ALTITUDE\n vec3 unpackVTPosition() {\n return vec3(aPosition, aAltitude);\n }\n#else\n float position_modValue = 16384.0;\n float position_delta = 0.00001;\n vec3 unpackVTPosition() {\n float z = aPosition.z;\n vec2 pos = sign(aPosition.xy + position_delta) * mod(abs(aPosition.xy), position_modValue);\n vec2 highs = floor(abs(aPosition.xy) / position_modValue);\n float altitude = sign(z + position_delta) * (highs.x * 2.0 + highs.y) * pow(2.0, 15.0) + z;\n return vec3(pos, altitude);\n }\n#endif"),
|
|
8716
|
+
gt.VERSION = "0.71.0", It.VERSION = "0.71.0";
|
|
8717
8717
|
|
|
8718
8718
|
if (e.mat4.create(), e.transcoders) {
|
|
8719
8719
|
const i = t.Map.VERSION;
|
|
@@ -8725,6 +8725,6 @@ if (e.mat4.create(), e.transcoders) {
|
|
|
8725
8725
|
}));
|
|
8726
8726
|
} else t.registerWorkerAdapter("@maptalks/vt", j);
|
|
8727
8727
|
|
|
8728
|
-
export {
|
|
8728
|
+
export { Je as FillPainter, Hr as FillPlugin, Jr as GLTFPhongPlugin, Zr as GLTFStandardPlugin, St as GeoJSONVectorTileLayer, Kr as HeatmapPlugin, wn as IconPainter, qr as IconPlugin, Ur as LineGradientPlugin, Ke as LinePainter, Vr as LinePlugin, Qt as LineStringLayer, Xr as LitPlugin, _t as MapboxVectorTileLayer, lr as NativeLinePainter, Wr as NativeLinePlugin, sr as NativePointPainter, mr as PhongPainter, Br as PhongPlugin, Kt as PointLayer, ee as PolygonLayer, er as TextPainter, Gr as TextPlugin, Yr as TubePlugin, It as Vector3DLayer, gt as VectorTileLayer, at as VectorTileLayerRenderer, Qr as WaterPlugin, gr as WireframePainter, $r as WireframePlugin };
|
|
8729
8729
|
|
|
8730
|
-
"undefined" != typeof console && console.log("@maptalks/vt v0.
|
|
8730
|
+
"undefined" != typeof console && console.log("@maptalks/vt v0.71.0");
|