@maptalks/vt 0.78.0 → 0.78.2
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 +1568 -1478
- package/dist/maptalks.vt.mjs +346 -346
- package/package.json +4 -4
package/dist/maptalks.vt.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @maptalks/vt v0.78.
|
|
2
|
+
* @maptalks/vt v0.78.2
|
|
3
3
|
* LICENSE : undefined
|
|
4
4
|
* (c) 2016-2022 maptalks.org
|
|
5
5
|
*/
|
|
@@ -11,11 +11,11 @@ import { reshader as n, vec3 as i, mat4 as r, GroundPainter as o, createREGL as
|
|
|
11
11
|
|
|
12
12
|
import { isFunctionDefinition as p, loadFunctionTypes as m, interpolated as y, piecewiseConstant as g } from "@maptalks/function-type";
|
|
13
13
|
|
|
14
|
-
import { IconRequestor as v, GlyphRequestor as b, FilterUtil as x, PackUtil as w, PointPack as A, VectorPack as k, StyledPoint as _, LinePack as S, StyledVector as T, SYMBOLS_NEED_REBUILD_IN_VECTOR as M, PolygonPack as P, StyleUtil as I, SYMBOLS_NEED_REBUILD_IN_VT as
|
|
14
|
+
import { IconRequestor as v, GlyphRequestor as b, FilterUtil as x, PackUtil as w, PointPack as A, VectorPack as k, StyledPoint as _, LinePack as S, StyledVector as T, SYMBOLS_NEED_REBUILD_IN_VECTOR as M, PolygonPack as P, StyleUtil as I, SYMBOLS_NEED_REBUILD_IN_VT as O, FuncTypeUtil as C, TextUtil as E } 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
|
|
|
18
|
-
import
|
|
18
|
+
import F from "fast-deep-equal";
|
|
19
19
|
|
|
20
20
|
import z from "color";
|
|
21
21
|
|
|
@@ -25,7 +25,7 @@ import { createFilter as D } from "@maptalks/feature-filter";
|
|
|
25
25
|
|
|
26
26
|
import N from "@maptalks/vt-plugin";
|
|
27
27
|
|
|
28
|
-
const R = 'function(t){let e;const n={width:100,height:10};function i(){if(!e){const{width:t,height:i}=n;OffscreenCanvas?e=new OffscreenCanvas(t,i):(e=document.createElement("canvas"),e.width=t,e.height=i)}return e}class r{constructor(t,e={}){if(!Array.isArray(t))return void console.error("colors is not array");if(t.length<2)return void console.error("colors.length should >1");this.colors=t;let i=1/0,r=-1/0;for(let e=0,n=t.length;e<n;e++){const n=t[e][0];i=Math.min(n,i),r=Math.max(n,r)}this.min=i,this.max=r,this.valueOffset=this.max-this.min,this.options=Object.assign({},n,e),this.t()}getImageData(){return this.imgData}t(){const t=i(),{width:e,height:n}=this.options;t.width=e,t.height=n;const r=t.getContext("2d");r.clearRect(0,0,t.width,t.height);const o=r.createLinearGradient(0,0,t.width,0),{colors:s,valueOffset:a}=this;for(let t=0,e=s.length;t<e;t++){const[e,n]=s[t],i=(e-this.min)/a;o.addColorStop(i,n)}r.fillStyle=o,r.fillRect(0,0,t.width,t.height),this.imgData=r.getImageData(0,0,t.width,t.height)}getColor(t){t=Math.max(this.min,t);const e=((t=Math.min(t,this.max))-this.min)/this.valueOffset;let n=Math.round(e*this.imgData.width);n=Math.min(n,this.imgData.width-1);const i=4*n;return[this.imgData.data[i],this.imgData.data[i+1],this.imgData.data[i+2],this.imgData.data[i+3]]}}var o;function s(t,e){for(let n=0;n<t.stops.length;n++)if(e===t.stops[n][0])return t.stops[n][1];return t.default}function a(t,e){for(var n=0;n<t.stops.length&&!(e<t.stops[n][0]);n++);return t.stops[Math.max(n-1,0)][1]}function l(t,e){for(var n=void 0!==t.base?t.base:1,i=0;!(i>=t.stops.length||e<=t.stops[i][0]);)i++;return 0===i?t.stops[i][1]:i===t.stops.length?t.stops[i-1][1]:function t(e,n,i,r,o,s){return"function"==typeof o?function(){var a=o.apply(void 0,arguments),l=s.apply(void 0,arguments);return t(e,n,i,r,a,l)}:o.length?function(t,e,n,i,r,o){var s=[];for(let a=0;a<r.length;a++)s[a]=d(t,e,n,i,r[a],o[a]);return s}(e,n,i,r,o,s):d(e,n,i,r,o,s)}(e,n,t.stops[i-1][0],t.stops[i][0],t.stops[i-1][1],t.stops[i][1])}"function"==typeof Map&&(o=new Map);const u={width:100,height:1};function c(t,e){const n=t.stops;if(n&&n.length>1){let t;if(o){const e=JSON.stringify(n);if(!o.has(e)){const t=new r(n,u);o.set(e,t)}t=o.get(e)}else t=new r(n,u);const[i,s,a,l]=t.getColor(e);return[i/255,s/255,a/255,l/255]}return n&&1===n.length?n[0][1]:null}function h(t,e){return function(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:null}(e,t.default)}function d(t,e,n,i,r,o){var s,a=i-n,l=t-n;return r*(1-(s=1===e?l/a:(Math.pow(e,l)-1)/(Math.pow(e,a)-1)))+o*s}function f(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type)}function p(t){return g(t,"exponential")}function m(t){return g(t,"interval")}function y(t,e){if(!t)return null;var n=!1;if(Array.isArray(t)){var i,r=[];for(let o=0;o<t.length;o++)(i=y(t[o],e))?(r.push(i),n=!0):r.push(t[o]);return n?r:t}var o,s={__fn_types_loaded:!0},a=[];for(o in t)t.hasOwnProperty(o)&&a.push(o);const l=function(t){Object.defineProperty(s,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=p(this["_"+t])),this["__fn_"+t].apply(this,e())},set:function(e){this["_"+t]=e},configurable:!0,enumerable:!0})};for(let e=0,i=a.length;e<i;e++)f(t[o=a[e]])?(n=!0,s["_"+o]=t[o],l(o)):s[o]=t[o];return n?s:t}function g(t,e){if(!f(t))return function(){return t};let n=!0,i=!0;const r=(t=JSON.parse(JSON.stringify(t))).stops;if(r)for(let t=0;t<r.length;t++)if(f(r[t][1])){const o=g(r[t][1],e);n=n&&o.isZoomConstant,i=i&&o.isFeatureConstant,r[t]=[r[t][0],o]}const o=function t(e,n){var i,r,o;if(f(e)){var u,d=e.stops&&"object"==typeof e.stops[0][0],p=d||void 0!==e.property,m=d||!p,y=e.type||n||"exponential";if("exponential"===y)u=l;else if("interval"===y)u=a;else if("categorical"===y)u=s;else if("identity"===y)u=h;else{if("color-interpolate"!==y)throw new Error(\'Unknown function type "\'+y+\'"\');u=c}if(d){var g={},b=[];for(let t=0;t<e.stops.length;t++){var v=e.stops[t];void 0===g[v[0].zoom]&&(g[v[0].zoom]={zoom:v[0].zoom,type:e.type,property:e.property,default:e.default,stops:[]}),g[v[0].zoom].stops.push([v[0].value,v[1]])}for(let e in g)b.push([g[e].zoom,t(g[e])]);i=function(t,n){const i=l({stops:b,base:e.base},t)(t,n);return"function"==typeof i?i(t,n):i},r=!1,o=!1}else m?(i=function(t){const n=u(e,t);return"function"==typeof n?n(t):n},r=!0,o=!1):(i=function(t,n){const i=u(e,n?n[e.property]:null);return"function"==typeof i?i(t,n):i},r=!1,o=!0)}else i=function(){return e},r=!0,o=!0;return i.isZoomConstant=o,i.isFeatureConstant=r,i}(t,e);return o.isZoomConstant=n&&o.isZoomConstant,o.isFeatureConstant=i&&o.isFeatureConstant,o}let b=0;const v="function"==typeof Object.assign;function w(t,...e){if(v)return Object.assign(t,...e),t;for(let n=0;n<e.length;n++){const i=e[n];for(const e in i)t[e]=i[e]}return t}function x(t){return!A(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function k(t){return"number"==typeof t&&!isNaN(t)}function M(t){return!A(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function j(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function A(t){return null==t}function F(t){for(let e=1;e<arguments.length;e++){const n=arguments[e];if(n)for(let e=0,i=n.length;e<i;e++)t.push(n[e])}return t.length}function T(t){return f(t)&&t.property}const z="function"==typeof fetch&&"function"==typeof AbortController,S={jsonp:function(t,e){const n="_maptalks_jsonp_"+b++;t.match(/\\?/)?t+="&callback="+n:t+="?callback="+n;let i=document.createElement("script");return i.type="text/javascript",i.src=t,window[n]=function(t){e(null,t),document.getElementsByTagName("head")[0].removeChild(i),i=null,delete window[n]},document.getElementsByTagName("head")[0].appendChild(i),this},get:function(t,e,n){if(M(e)){const t=n;n=e,e=t}(e=e||{}).method&&(e.method=e.method.toUpperCase());const i="POST"===e.method;if(z){const i=new AbortController,r=e;return r.signal=i.signal,r.referrerPolicy=r.referrerPolicy||"origin",r.method=r.method||"GET",fetch(t,r).then(i=>{const r=this.o(i,e.returnJSON,e.responseType);r.message?(r.url=t,n(r)):r.then(t=>{"arraybuffer"===e.responseType?n(null,{data:t,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),contentType:i.headers.get("Content-Type")}):n(null,t)}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),n(t))})}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),n(t))}),i}{const r=S.s(n);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(i?e.body:null),r}},o:(t,e,n)=>200!==t.status?{status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`}:"arraybuffer"===n?t.arrayBuffer():e?t.json():t.text(),u: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}`})}},s: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=S.u(e,t),e},getArrayBuffer(t,e,n){if(M(e)){const t=n;n=e,e=t}return e||(e={}),e.responseType="arraybuffer",S.get(t,e,n)}};function _(t,e,n,i,r,o){let s=r-n,a=o-i;if(0!==s||0!==a){const l=((t-n)*s+(e-i)*a)/(s*s+a*a);l>1?(n=r,i=o):l>0&&(n+=s*l,i+=a*l)}return s=t-n,a=e-i,s*s+a*a}function P(t,e,n,i,r,o){const s={id:null==t?null:t,type:e,geometry:n,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};r&&(s.layer=r);return function(t,e){const n=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)I(t,n,e);else if("Polygon"===i)I(t,n[0],e);else if("MultiLineString"===i)for(const i of n)I(t,i,e);else if("MultiPolygon"===i)for(const i of n)I(t,i[0],e)}(s,o?4:3),s}function I(t,e,n){for(let i=0;i<e.length;i+=n)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function O(t,e,n,i){if(i.layer=e,"FeatureCollection"===n.type)for(let e=0;e<n.features.length;e++)q(t,n.features[e],i,e);else"Feature"===n.type?q(t,n,i):q(t,{geometry:n},i)}function q(t,e,n,i){if(!e.geometry)return;const r=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2);let a=[],l=e.id;if(n.promoteId?l=e.properties[n.promoteId]:n.generateId&&(l=i||0),"Point"===o)C(r,a,n.hasAltitude);else if("MultiPoint"===o)for(const t of r)C(t,a,n.hasAltitude);else if("LineString"===o)R(r,a,s,!1,n.hasAltitude);else if("MultiLineString"===o){if(n.lineMetrics){for(const i of r)a=[],R(i,a,s,!1,n.hasAltitude),t.push(P(l,"LineString",a,e.properties,n.layer,n.hasAltitude));return}E(r,a,s,!1,n.hasAltitude)}else if("Polygon"===o)E(r,a,s,!0,n.hasAltitude);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const r of e.geometry.geometries)q(t,{id:l,geometry:r,properties:e.properties},n,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of r){const e=[];E(t,e,s,!0,n.hasAltitude),a.push(e)}}t.push(P(l,o,a,e.properties,n.layer,n.hasAltitude))}function C(t,e,n){e.push(N(t[0]),D(t[1]),0),n&&(t.length>2?e.push(t[2]):e.push(0))}function R(t,e,n,i,r){let o,s,a=0;for(let n=0;n<t.length;n++){const l=N(t[n][0]),u=D(t[n][1]);e.push(l,u,0),r&&(t[n].length>2?e.push(t[n][2]):e.push(0)),n>0&&(a+=i?(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,n,i,r,o=3){let s=r;const a=i-n>>1;let l,u=i-n;const c=e[n],h=e[n+1],d=e[i],f=e[i+1];for(let t=n+o;t<i;t+=o){const n=_(e[t],e[t+1],c,h,d,f);if(n>s)l=t,s=n;else if(n===s){const e=Math.abs(t-a);e<u&&(l=t,u=e)}}s>r&&(l-n>o&&t(e,n,l,r,o),e[l+2]=s,i-l>o&&t(e,l,i,r,o))}(e,0,u,n,l),e[u+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function E(t,e,n,i,r){for(let o=0;o<t.length;o++){const s=[];R(t[o],s,n,i,r),e.push(s)}}function N(t){return t/360+.5}function D(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function L(t,e,n,i,r,o,s,a){if(i/=e,o>=(n/=e)&&s<i)return t;if(s<n||o>=i)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>=n&&u<i){l.push(e);continue}if(u<n||s>=i)continue;let c=[];if("Point"===o||"MultiPoint"===o)U(t,c,n,i,r,a.hasAltitude);else if("LineString"===o)$(t,c,n,i,r,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===o)J(t,c,n,i,r,!1,a.hasAltitude);else if("Polygon"===o)J(t,c,n,i,r,!0,a.hasAltitude);else if("MultiPolygon"===o)for(const e of t){const t=[];J(e,t,n,i,r,!0,a.hasAltitude),t.length&&c.push(t)}if(c.length){if(a.lineMetrics&&"LineString"===o){for(const t of c)l.push(P(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(P(e.id,o,c,e.tags,e.layer,a.hasAltitude))}}return l.length?l:null}function U(t,e,n,i,r,o){const s=o?4:3;for(let a=0;a<t.length;a+=s){const s=t[a+r];s>=n&&s<=i&&(H(e,t[a],t[a+1],t[a+2]),o&&e.push(t[a+3]))}}function $(t,e,n,i,r,o,s,a){let l=W(t);const u=0===r?G:V;let c,h,d=t.start;const f=a?4:3,p=o?t.length:t.length-f;for(let m=0;m<p;m+=f){const y=t[m],g=t[m+1],b=t[m+2];let v,w,x,k;o&&m===p-f?(v=t[0],w=t[1]):(v=t[m+f],w=t[m+f+1]),a&&(x=t[m+3],k=o&&m===p-f?t[3]:t[m+f+3]);const M=0===r?y:g,j=0===r?v:w;let A=!1;s&&(c=Math.sqrt(Math.pow(y-v,2)+Math.pow(g-w,2))),M<n?j>n&&(h=u(l,y,g,v,w,n),a&&l.push(B(x,k,h)),s&&(l.start=d+c*h)):M>i?j<i&&(h=u(l,y,g,v,w,i),a&&l.push(B(x,k,h)),s&&(l.start=d+c*h)):(H(l,y,g,b),a&&l.push(x)),j<n&&M>=n&&(h=u(l,y,g,v,w,n),a&&l.push(B(x,k,h)),A=!0),j>i&&M<=i&&(h=u(l,y,g,v,w,i),a&&l.push(B(x,k,h)),A=!0),!o&&A&&(s&&(l.end=d+c*h),e.push(l),l=W(t)),s&&(d+=c)}let m=t.length-f;if(!o){const e=t[m],o=t[m+1],s=t[m+2],u=0===r?e:o;if(u>=n&&u<=i&&H(l,e,o,s),u>=n&&u<=i&&a){const e=t[m+3];l.push(e)}}m=l.length-f,o&&m>=f&&(l[m]!==l[0]||l[m+1]!==l[1])&&(H(l,l[0],l[1],l[2]),a&&l.push(l[3])),l.length&&e.push(l)}function W(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function J(t,e,n,i,r,o,s){for(const a of t)$(a,e,n,i,r,o,!1,s)}function H(t,e,n,i){t.push(e,n,i)}function G(t,e,n,i,r,o){const s=(o-e)/(i-e);return H(t,o,n+(r-n)*s,1),s}function V(t,e,n,i,r,o){const s=(o-n)/(r-n);return H(t,e+(i-e)*s,o,1),s}function B(t,e,n){return t+(e-t)*n}function Z(t,e,n){const i=[];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=Y(o.geometry,e,n);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const t of o.geometry)a.push(Y(t,e,n))}else if("MultiPolygon"===s){a=[];for(const t of o.geometry){const i=[];for(const r of t)i.push(Y(r,e,n));a.push(i)}}i.push(P(o.id,s,a,o.tags,o.layer,n))}return i}function Y(t,e,n){const i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);const r=n?4:3;for(let o=0;o<t.length;o+=r)i.push(t[o]+e,t[o+1],t[o+2]),n&&i.push(t[o+3]);return i}function X(t,e,n){if(t.transformed)return t;const i=1<<t.z,r=t.x,o=t.y,s=n?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(K(t[l],t[l+1],e,i,r,o)),n&&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(K(t[l][a],t[l][a+1],e,i,r,o)),n&&u[u.length-1].push(t[l][a+2]);a.geometry.push(u)}}return t.transformed=!0,t}function K(t,e,n,i,r,o){return[Math.round(n*(t*i-r)),Math.round(n*(e*i-o))]}function Q(t,e,n,i,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:n,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const e of t)tt(s,e,o,r);return s}function tt(t,e,n,i){const r=e.geometry,o=e.type,s=[],a=i.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]),i.hasAltitude&&s.push(r[e+3]),t.numPoints++,t.numSimplified++;else if("LineString"===o)nt(s,r,t,n,!1,!1,i);else if("MultiLineString"===o||"Polygon"===o)for(let e=0;e<r.length;e++)nt(s,r[e],t,n,"Polygon"===o,0===e,i);else if("MultiPolygon"===o)for(let e=0;e<r.length;e++){const o=r[e];for(let e=0;e<o.length;e++)nt(s,o[e],t,n,!0,0===e,i)}if(s.length){let n=e.tags||null;if("LineString"===o&&i.lineMetrics){n={};for(const t in e.tags)n[t]=e.tags[t];n.mapbox_clip_start=r.start/r.size,n.mapbox_clip_end=r.end/r.size}const a={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:n};e.layer&&(a.layer=e.layer),null!==e.id&&(a.id=e.id),t.features.push(a)}}function et(t,e,n){return 0===t[e+2]&&t[e+3]>0&&n}function nt(t,e,n,i,r,o,s){const a=i*i,{hasAltitude:l,disableFilter:u}=s,c=l?4:3;if(!u&&i>0&&e.size<(r?a:i))return void(n.numPoints+=e.length/c);const h=[];for(let t=0;t<e.length;t+=c)(0===i||e[t+2]>a||et(e,t,l))&&(n.numSimplified++,h.push(e[t],e[t+1]),l&&h.push(e[t+3])),n.numPoints++;r&&function(t,e,n){const i=n?3:2;let r=0;for(let e=0,n=t.length,o=n-i;e<n;o=e,e+=i)r+=(t[e]-t[o])*(t[e+1]+t[o+1]);if(r>0===e){const e=i,r=i-1,o=i-2;for(let s=0,a=t.length;s<a/2;s+=i){const i=t[s],l=t[s+1];let u;n&&(u=t[s+2]),t[s]=t[a-e-s],t[s+1]=t[a-r-s],n&&(t[s+2]=t[a-o-s]),t[a-e-s]=i,t[a-r-s]=l,n&&(t[a-o-s]=u)}}}(h,o,l),t.push(h)}S.getJSON=function(t,e,n){if(M(e)){const t=n;n=e,e=t}const i=function(t,e){const i="string"==typeof e?JSON.parse(e):e||null;n(t,i)};return e&&e.jsonp?S.jsonp(t,i):((e=e||{}).returnJSON=!0,S.get(t,e,i))};const it={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 rt{constructor(t,e){const n=(e=this.options=function(t,e){for(const n in e)t[n]=e[n];return t}(Object.create(it),e)).debug;if(n&&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 i=function(t,e){const n=[];if(Array.isArray(t)){for(let i=0;i<t.length;i++)O(n,t[i].layer,t[i].data,e);return n}if("FeatureCollection"===t.type)for(let i=0;i<t.features.length;i++)q(n,t.features[i],e,i);else"Feature"===t.type?q(n,t,e):q(n,{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=function(t,e){const n=e.buffer/e.extent;let i=t;const r=L(t,1,-1-n,n,0,-1,2,e),o=L(t,1,1-n,2+n,0,-1,2,e);return(r||o)&&(i=L(t,1,-n,1+n,0,-1,2,e)||[],r&&(i=Z(r,1,e.hasAltitude).concat(i)),o&&(i=i.concat(Z(o,-1,e.hasAltitude)))),i}(i,e),i.length&&this.splitTile(i,0,0,0),n&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,n,i,r,o,s){const a=[t,e,n,i],l=this.options,u=l.debug;for(;a.length;){i=a.pop(),n=a.pop(),e=a.pop(),t=a.pop();const c=1<<e,h=ot(e,n,i);let d=this.tiles[h];if(!d&&(u>1&&console.time("creation"),d=this.tiles[h]=Q(t,e,n,i,l),this.tileCoords.push({z:e,x:n,y:i}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,i,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(n!==o>>t||i!==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=L(t,c,n-f,n+m,0,d.minX,d.maxX,l),k=L(t,c,n+p,n+y,0,d.minX,d.maxX,l);t=null,x&&(g=L(x,c,i-f,i+m,1,d.minY,d.maxY,l),b=L(x,c,i+p,i+y,1,d.minY,d.maxY,l),x=null),k&&(v=L(k,c,i-f,i+m,1,d.minY,d.maxY,l),w=L(k,c,i+p,i+y,1,d.minY,d.maxY,l),k=null),u>1&&console.timeEnd("clipping"),a.push(g||[],e+1,2*n,2*i),a.push(b||[],e+1,2*n,2*i+1),a.push(v||[],e+1,2*n+1,2*i),a.push(w||[],e+1,2*n+1,2*i+1)}}getTile(t,e,n){t=+t,e=+e,n=+n;const i=this.options,{extent:r,debug:o}=i,{hasAltitude:s}=i;if(t<0||t>24)return null;const a=1<<t,l=ot(t,e=e+a&a-1,n);if(this.tiles[l])return X(this.tiles[l],r,s);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);let u,c=t,h=e,d=n;for(;!u&&c>0;)c--,h>>=1,d>>=1,u=this.tiles[ot(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,n),o>1&&console.timeEnd("drilling down"),this.tiles[l]?X(this.tiles[l],r,s):null):null}}function ot(t,e,n){return 32*((1<<t)*n+e)+t}function st(t,e,n,i,r,o){const s=n&&Array.isArray(n[0]);for(let a=0,l=n.length;a<l;a++){t[e]=Math.round((s?n[a][0]:n[a].x)*i),t[e+1]=Math.round((s?n[a][1]:n[a].y)*i);let u=r||0;Array.isArray(r)&&(u=r[a]),u=u?Math.round(i*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 at(t,e,n,i){const r=t[3*e],o=t[3*e+1],s=t[3*n],a=t[3*n+1];return r===s&&(r<0||r>i)||o===a&&(o<0||o>i)}class lt{constructor(t,e){this.x=t,this.y=e}clone(){return new lt(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 lt(this.x-t.x,this.y-t.y)}distance(t){const e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}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 lt(this.y,-this.x)}}function ut(t,e,n){const i=(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x);return i>1e-5?1:i<-1e-5?2:0}function ct(t,e,n,i){const r=e.x*i.y-e.y*i.x,o=n.x-t.x,s=n.y-t.y,a=(o*i.y-s*i.x)/r;return new lt(t.x+a*e.x,t.y+a*e.y)}const ht=[];function dt(t,e,n){let i=0;const r=[];for(let o=e;o<n;o+=3)ht[i]?(ht[i].x=t[o],ht[i].y=t[o+1]):ht[i]=new lt(t[o],t[o+1]),r.push(ht[i]),i++;const o=function(t){let e;this.UpdateOmbb=function(t,n,i,r,o,s,a,l){const u=ct(t,n,o,s),c=ct(i,r,o,s),h=ct(a,l,t,n),d=ct(a,l,i,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 n=[];for(let e=0;e<t.length;e++)n.push(t[(e+1)%t.length].diff(t[e])),n[e].normalize();const i=new lt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new lt(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);let o,s,a,l;for(let e=0;e<t.length;e++){const n=t[e];n.x<i.x&&(i.x=n.x,o=e),n.x>r.x&&(r.x=n.x,s=e),n.y<i.y&&(i.y=n.y,l=e),n.y>r.y&&(r.y=n.y,a=e)}let u=new lt(0,-1),c=new lt(0,1),h=new lt(-1,0),d=new lt(1,0);for(let e=0;e<t.length;e++){const e=[Math.acos(u.dot(n[o])),Math.acos(c.dot(n[s])),Math.acos(h.dot(n[a])),Math.acos(d.dot(n[l]))];switch(e.indexOf(Math.min.apply(Math,e))){case 0:u=n[o].clone(),c=u.clone(),c.negate(),h=u.orthogonal(),d=h.clone(),d.negate(),o=(o+1)%t.length;break;case 1:c=n[s].clone(),u=c.clone(),u.negate(),h=u.orthogonal(),d=h.clone(),d.negate(),s=(s+1)%t.length;break;case 2:h=n[a].clone(),d=h.clone(),d.negate(),u=d.orthogonal(),c=u.clone(),c.negate(),a=(a+1)%t.length;break;case 3:d=n[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 n=[];for(let n=1;n<t.length;n++)(t[n].x<e.x||Math.abs(t[n].x-e.x)<1e-5&&t[n].y<e.y)&&(e=t[n]);let i=t[0];do{n.unshift(e.clone());for(let n=1;n<t.length;n++){const r=ut(e,i,t[n]);(i.equals(e)||1===r||0===r&&e.distance(t[n])>e.distance(i))&&(i=t[n])}e=i}while(!i.equals(n[n.length-1]));return n}(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 ft="undefined"!=typeof Float32Array?Float32Array:Array;function pt(){var t=new ft(3);return ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function mt(t,e,n){var i=new ft(3);return i[0]=t,i[1]=e,i[2]=n,i}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function gt(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function bt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function vt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function wt(t,e){var n=e[0],i=e[1],r=e[2],o=n*n+i*i+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 xt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function kt(t,e,n){var i=e[0],r=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=r*l-o*a,t[1]=o*s-i*l,t[2]=i*a-r*s,t}var Mt=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t};function jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function At(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function Ft(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function Tt(){var t=new ft(4);return ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function zt(t,e){var n=e[0]+e[4]+e[8],i=void 0;if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;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;i=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*s+s]+1),t[r]=.5*i,i=.5/i,t[3]=(e[3*o+s]-e[3*s+o])*i,t[o]=(e[3*o+r]+e[3*r+o])*i,t[s]=(e[3*s+r]+e[3*r+s])*i}return t}pt(),function(){var t,e=(t=new ft(4),ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var St,_t=Ft,Pt=function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=n*n+i*i+r*r+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=i*s,t[2]=r*s,t[3]=o*s),t};function It(t,e){var n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)}pt(),mt(1,0,0),mt(0,1,0),Tt(),Tt(),St=new ft(9),ft!=Float32Array&&(St[1]=0,St[2]=0,St[3]=0,St[5]=0,St[6]=0,St[7]=0),St[0]=1,St[4]=1,St[8]=1;var Ot=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)};function qt(t,e,n,i,r,o,s,a,l,u){0===t?function(t,e,n,i,r,o,s,a,l){const u=[0,0];for(let r=t;r<e;r+=3){const t=r/3*2,e=i[r],c=i[r+1];n[t]=u[0]+e*o*s/a,n[t+1]=u[1]-c*o*s/l}}(e,n,i,r,0,s,a,l,u):1===t&&function(t,e,n,i){const r=dt(i,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=It(s,a),d=It(a,l);for(let r=t;r<e;r+=3){const t=r/3*2,e=i[r],o=i[r+1];n[t]=Rt(e,o,s,u,h),n[t+1]=-Rt(e,o,a,c,d)}}(e,n,i,r)}!function(){var t=function(){var t=new ft(2);return ft!=Float32Array&&(t[0]=0,t[1]=0),t}()}();const Ct=[];function Rt(t,e,n,i,r){return Ct[0]=(i*i*n[0]+i*(e-n[1])+t)/(i*i+1),Ct[1]=i*(Ct[0]-n[0])+n[1],It(n,Ct)/r}function Et(t,e,n,i,r){const o=3*e[n-1],s=3*e[n-1]+1,a=t[o],l=t[s];return u=i,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 Nt=Dt;function Dt(t,e){this.x=t,this.y=e}function Lt(t,e,n){n=n||{},this.w=t||64,this.h=e||64,this.autoResize=!!n.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function Ut(t,e,n){this.x=0,this.y=t,this.w=this.free=e,this.h=n}function $t(t,e,n,i,r,o,s){this.id=t,this.x=e,this.y=n,this.w=i,this.h=r,this.maxw=o||i,this.maxh=s||r,this.refcount=0}Dt.prototype={clone:function(){return new Dt(this.x,this.y)},add:function(t){return this.clone().m(t)},sub:function(t){return this.clone().v(t)},multByPoint:function(t){return this.clone().k(t)},divByPoint:function(t){return this.clone().M(t)},mult:function(t){return this.clone().j(t)},div:function(t){return this.clone().A(t)},rotate:function(t){return this.clone().F(t)},rotateAround:function(t,e){return this.clone().T(t,e)},matMult:function(t){return this.clone().S(t)},unit:function(){return this.clone()._()},perp:function(){return this.clone().P()},round:function(){return this.clone().I()},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,n=t.y-this.y;return e*e+n*n},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)},S:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},m:function(t){return this.x+=t.x,this.y+=t.y,this},v:function(t){return this.x-=t.x,this.y-=t.y,this},j:function(t){return this.x*=t,this.y*=t,this},A:function(t){return this.x/=t,this.y/=t,this},k: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},_:function(){return this.A(this.mag()),this},P:function(){var t=this.y;return this.y=this.x,this.x=-t,this},F:function(t){var e=Math.cos(t),n=Math.sin(t),i=e*this.x-n*this.y,r=n*this.x+e*this.y;return this.x=i,this.y=r,this},T:function(t,e){var n=Math.cos(t),i=Math.sin(t),r=e.x+n*(this.x-e.x)-i*(this.y-e.y),o=e.y+i*(this.x-e.x)+n*(this.y-e.y);return this.x=r,this.y=o,this},I:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Dt.convert=function(t){return t instanceof Dt?t:Array.isArray(t)?new Dt(t[0],t[1]):t},Lt.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var n,i,r,o,s=[],a=0;a<t.length;a++)if(n=t[a].w||t[a].width,i=t[a].h||t[a].height,r=t[a].id,n&&i){if(!(o=this.packOne(n,i,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},Lt.prototype.packOne=function(t,e,n){var i,r,o,s,a,l,u,c,h={freebin:-1,shelf:-1,waste:1/0},d=0;if("string"==typeof n||"number"==typeof n){if(i=this.getBin(n))return this.ref(i),i;"number"==typeof n&&(this.maxId=Math.max(n,this.maxId))}else n=++this.maxId;for(s=0;s<this.freebins.length;s++){if(e===(i=this.freebins[s]).maxh&&t===i.maxw)return this.allocFreebin(s,t,e,n);e>i.maxh||t>i.maxw||e<=i.maxh&&t<=i.maxw&&(o=i.maxw*i.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,n);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,n):-1!==h.shelf?this.allocShelf(h.shelf,t,e,n):e<=this.h-d&&t<=this.w?(r=new Ut(d,this.w,e),this.allocShelf(this.shelves.push(r)-1,t,e,n)):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,n)):null},Lt.prototype.allocFreebin=function(t,e,n,i){var r=this.freebins.splice(t,1)[0];return r.id=i,r.w=e,r.h=n,r.refcount=0,this.bins[i]=r,this.ref(r),r},Lt.prototype.allocShelf=function(t,e,n,i){var r=this.shelves[t].alloc(e,n,i);return this.bins[i]=r,this.ref(r),r},Lt.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,n=0;n<this.shelves.length;n++){var i=this.shelves[n];e+=i.h,t=Math.max(i.w-i.free,t)}this.resize(t,e)}},Lt.prototype.getBin=function(t){return this.bins[t]},Lt.prototype.ref=function(t){if(1==++t.refcount){var e=t.h;this.stats[e]=1+(0|this.stats[e])}return t.refcount},Lt.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)},Lt.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},Lt.prototype.resize=function(t,e){this.w=t,this.h=e;for(var n=0;n<this.shelves.length;n++)this.shelves[n].resize(t);return!0},Ut.prototype.alloc=function(t,e,n){if(t>this.free||e>this.h)return null;var i=this.x;return this.x+=t,this.free-=t,new $t(n,i,this.y,t,e,t,this.h)},Ut.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0};var Wt={exports:{}},Jt={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]},Ht={exports:{}},Gt=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))},Vt=Array.prototype.concat,Bt=Array.prototype.slice,Zt=Ht.exports=function(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];Gt(r)?e=Vt.call(e,Bt.call(r)):e.push(r)}return e};Zt.wrap=function(t){return function(){return t(Zt(arguments))}};var Yt=Jt,Xt=Ht.exports,Kt=Object.hasOwnProperty,Qt=Object.create(null);for(var te in Yt)Kt.call(Yt,te)&&(Qt[Yt[te]]=te);var ee=Wt.exports={to:{},get:{}};function ne(t,e,n){return Math.min(Math.max(e,t),n)}function ie(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}ee.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=ee.get.hsl(t),n="hsl";break;case"hwb":e=ee.get.hwb(t),n="hwb";break;default:e=ee.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},ee.get.rgb=function(t){if(!t)return null;var e,n,i,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var o=2*n;r[n]=parseInt(e.slice(o,o+2),16)}i&&(r[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);i&&(r[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+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]:Kt.call(Yt,e[1])?((r=Yt[e[1]])[3]=1,r):null:null;for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=ne(r[n],0,255);return r[3]=ne(r[3],0,1),r},ee.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 n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,ne(parseFloat(e[2]),0,100),ne(parseFloat(e[3]),0,100),ne(isNaN(n)?1:n,0,1)]}return null},ee.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 n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,ne(parseFloat(e[2]),0,100),ne(parseFloat(e[3]),0,100),ne(isNaN(n)?1:n,0,1)]}return null},ee.to.hex=function(){var t=Xt(arguments);return"#"+ie(t[0])+ie(t[1])+ie(t[2])+(t[3]<1?ie(Math.round(255*t[3])):"")},ee.to.rgb=function(){var t=Xt(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]+")"},ee.to.rgb.percent=function(){var t=Xt(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+i+"%)":"rgba("+e+"%, "+n+"%, "+i+"%, "+t[3]+")"},ee.to.hsl=function(){var t=Xt(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},ee.to.hwb=function(){var t=Xt(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},ee.to.keyword=function(t){return Qt[t.slice(0,3)]};var re={exports:{}},oe=Jt,se={};for(var ae in oe)oe.hasOwnProperty(ae)&&(se[oe[ae]]=ae);var le=re.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 ue in le)if(le.hasOwnProperty(ue)){if(!("channels"in le[ue]))throw new Error("missing channels property: "+ue);if(!("labels"in le[ue]))throw new Error("missing channel labels property: "+ue);if(le[ue].labels.length!==le[ue].channels)throw new Error("channel and label counts mismatch: "+ue);var ce=le[ue].channels,he=le[ue].labels;delete le[ue].channels,delete le[ue].labels,Object.defineProperty(le[ue],"channels",{value:ce}),Object.defineProperty(le[ue],"labels",{value:he})}function de(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}le.rgb.hsl=function(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(i,r,o),a=Math.max(i,r,o),l=a-s;return a===s?e=0:i===a?e=(r-o)/l:r===a?e=2+(o-i)/l:o===a&&(e=4+(i-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+a)/2,[e,100*(a===s?0:n<=.5?l/(a+s):l/(2-a-s)),100*n]},le.rgb.hsv=function(t){var e,n,i,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),n=h(a),i=h(l),s===u?r=i-n:a===u?r=1/3+e-i:l===u&&(r=2/3+n-e),r<0?r+=1:r>1&&(r-=1)),[360*r,100*o,100*u]},le.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[le.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},le.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,r=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-r)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-r-e)/(1-e)||0),100*e]},le.rgb.keyword=function(t){var e=se[t];if(e)return e;var n,i=1/0;for(var r in oe)if(oe.hasOwnProperty(r)){var o=de(t,oe[r]);o<i&&(i=o,n=r)}return n},le.keyword.rgb=function(t){return oe[t]},le.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},le.rgb.lab=function(t){var e=le.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},le.hsl.rgb=function(t){var e,n,i,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-(n=l<.5?l*(1+a):l+a-l*a),r=[0,0,0];for(var u=0;u<3;u++)(i=s+1/3*-(u-1))<0&&i++,i>1&&i--,o=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,r[u]=255*o;return r},le.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,r=n,o=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,r*=o<=1?o:2-o,[e,100*(0===i?2*r/(o+r):2*n/(i+n)),100*((i+n)/2)]},le.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,r=Math.floor(e)%6,o=e-Math.floor(e),s=255*i*(1-n),a=255*i*(1-n*o),l=255*i*(1-n*(1-o));switch(i*=255,r){case 0:return[i,l,s];case 1:return[a,i,s];case 2:return[s,i,l];case 3:return[s,a,i];case 4:return[l,s,i];case 5:return[i,s,a]}},le.hsv.hsl=function(t){var e,n,i,r=t[0],o=t[1]/100,s=t[2]/100,a=Math.max(s,.01);return i=(2-o)*s,n=o*a,[r,100*(n=(n/=(e=(2-o)*a)<=1?e:2-e)||0),100*(i/=2)]},le.hwb.rgb=function(t){var e,n,i,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),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),r=u+i*((n=1-c)-u),e){default:case 6:case 0:o=n,s=r,a=u;break;case 1:o=r,s=n,a=u;break;case 2:o=u,s=n,a=r;break;case 3:o=u,s=r,a=n;break;case 4:o=r,s=u,a=n;break;case 5:o=n,s=u,a=r}return[255*o,255*s,255*a]},le.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,r=t[3]/100;return[255*(1-Math.min(1,e*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r))]},le.xyz.rgb=function(t){var e,n,i,r=t[0]/100,o=t[1]/100,s=t[2]/100;return n=-.9689*r+1.8758*o+.0415*s,i=.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,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},le.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},le.lab.xyz=function(t){var e,n,i,r=t[0];e=t[1]/500+(n=(r+16)/116),i=n-t[2]/200;var o=Math.pow(n,3),s=Math.pow(e,3),a=Math.pow(i,3);return n=o>.008856?o:(n-16/116)/7.787,e=s>.008856?s:(e-16/116)/7.787,i=a>.008856?a:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},le.lab.lch=function(t){var e,n=t[0],i=t[1],r=t[2];return(e=360*Math.atan2(r,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+r*r),e]},le.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},le.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:le.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},le.hsv.ansi16=function(t){return le.rgb.ansi16(le.hsv.rgb(t),t[2])},le.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},le.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 n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},le.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},le.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},le.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 n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},le.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,r=t[2]/255,o=Math.max(Math.max(n,i),r),s=Math.min(Math.min(n,i),r),a=o-s;return e=a<=0?0:o===n?(i-r)/a%6:o===i?2+(r-n)/a:4+(n-i)/a+4,e/=6,[360*(e%=1),100*a,100*(a<1?s/(1-a):0)]},le.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,r=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(r=(n-.5*i)/(1-i)),[t[0],100*i,100*r]},le.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,r=0;return i<1&&(r=(n-i)/(1-i)),[t[0],100*i,100*r]},le.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];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-n)*i,[255*(n*o[0]+r),255*(n*o[1]+r),255*(n*o[2]+r)]},le.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},le.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},le.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},le.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,r=0;return i<1&&(r=(n-i)/(1-i)),[t[0],100*i,100*r]},le.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},le.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},le.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},le.gray.hsl=le.gray.hsv=function(t){return[0,0,t[0]]},le.gray.hwb=function(t){return[0,100,t[0]]},le.gray.cmyk=function(t){return[0,0,0,t[0]]},le.gray.lab=function(t){return[t[0],0,0]},le.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},le.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};var fe=re.exports;function pe(t){var e=function(){for(var t={},e=Object.keys(fe),n=e.length,i=0;i<n;i++)t[e[i]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;)for(var i=n.pop(),r=Object.keys(fe[i]),o=r.length,s=0;s<o;s++){var a=r[s],l=e[a];-1===l.distance&&(l.distance=e[i].distance+1,l.parent=i,n.unshift(a))}return e}function me(t,e){return function(n){return e(t(n))}}function ye(t,e){for(var n=[e[t].parent,t],i=fe[e[t].parent][t],r=e[t].parent;e[r].parent;)n.unshift(e[r].parent),i=me(fe[e[r].parent][r],i),r=e[r].parent;return i.conversion=n,i}var ge=re.exports,be=function(t){for(var e=pe(t),n={},i=Object.keys(e),r=i.length,o=0;o<r;o++){var s=i[o];null!==e[s].parent&&(n[s]=ye(s,e))}return n},ve={};Object.keys(ge).forEach((function(t){ve[t]={},Object.defineProperty(ve[t],"channels",{value:ge[t].channels}),Object.defineProperty(ve[t],"labels",{value:ge[t].labels});var e=be(t);Object.keys(e).forEach((function(n){var i=e[n];ve[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,r=0;r<i;r++)n[r]=Math.round(n[r]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(i),ve[t][n].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}(i)}))}));var we=ve,xe=Wt.exports,ke=we,Me=[].slice,je=["keyword","gray","hex"],Ae={};Object.keys(ke).forEach((function(t){Ae[Me.call(ke[t].labels).sort().join("")]=t}));var Fe={};function Te(t,e){if(!(this instanceof Te))return new Te(t,e);if(e&&e in je&&(e=null),e&&!(e in ke))throw new Error("Unknown model: "+e);var n,i;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof Te)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var r=xe.get(t);if(null===r)throw new Error("Unable to parse color from string: "+t);this.model=r.model,i=ke[this.model].channels,this.color=r.value.slice(0,i),this.valpha="number"==typeof r.value[i]?r.value[i]:1}else if(t.length){this.model=e||"rgb",i=ke[this.model].channels;var o=Me.call(t,0,i);this.color=Pe(o,i),this.valpha="number"==typeof t[i]?t[i]: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 Ae))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Ae[a];var l=ke[this.model].labels,u=[];for(n=0;n<l.length;n++)u.push(t[l[n]]);this.color=Pe(u)}if(Fe[this.model])for(i=ke[this.model].channels,n=0;n<i;n++){var c=Fe[this.model][n];c&&(this.color[n]=c(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function ze(t,e,n){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(Fe[t]||(Fe[t]=[]))[e]=n})),t=t[0],function(i){var r;return arguments.length?(n&&(i=n(i)),(r=this[t]()).color[e]=i,r):(r=this[t]().color[e],n&&(r=n(r)),r)}}function Se(t){return function(e){return Math.max(0,Math.min(t,e))}}function _e(t){return Array.isArray(t)?t:[t]}function Pe(t,e){for(var n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}Te.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in xe.to?this:this.rgb(),n=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return xe.to[e.model](n)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),n=1===e.valpha?e.color:e.color.concat(this.valpha);return xe.to.rgb.percent(n)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=ke[this.model].channels,n=ke[this.model].labels,i=0;i<e;i++)t[n[i]]=this.color[i];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 Te(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 Te(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:ze("rgb",0,Se(255)),green:ze("rgb",1,Se(255)),blue:ze("rgb",2,Se(255)),hue:ze(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:ze("hsl",1,Se(100)),lightness:ze("hsl",2,Se(100)),saturationv:ze("hsv",1,Se(100)),value:ze("hsv",2,Se(100)),chroma:ze("hcg",1,Se(100)),gray:ze("hcg",2,Se(100)),white:ze("hwb",1,Se(100)),wblack:ze("hwb",2,Se(100)),cyan:ze("cmyk",0,Se(100)),magenta:ze("cmyk",1,Se(100)),yellow:ze("cmyk",2,Se(100)),black:ze("cmyk",3,Se(100)),x:ze("xyz",0,Se(100)),y:ze("xyz",1,Se(100)),z:ze("xyz",2,Se(100)),l:ze("lab",0,Se(100)),a:ze("lab",1),b:ze("lab",2),keyword:function(t){return arguments.length?new Te(t):ke[this.model].keyword(this.color)},hex:function(t){return arguments.length?new Te(t):xe.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=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.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 Te.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(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,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 n=t.rgb(),i=this.rgb(),r=void 0===e?.5:e,o=2*r-1,s=n.alpha()-i.alpha(),a=((o*s==-1?o:(o+s)/(1+o*s))+1)/2,l=1-a;return Te.rgb(a*n.red()+l*i.red(),a*n.green()+l*i.green(),a*n.blue()+l*i.blue(),n.alpha()*r+i.alpha()*(1-r))}},Object.keys(ke).forEach((function(t){if(-1===je.indexOf(t)){var e=ke[t].channels;Te.prototype[t]=function(){if(this.model===t)return new Te(this);if(arguments.length)return new Te(arguments,t);var n="number"==typeof arguments[e]?e:this.valpha;return new Te(_e(ke[this.model][t].raw(this.color)).concat(n),t)},Te[t]=function(n){return"number"==typeof n&&(n=Pe(Me.call(arguments),e)),new Te(n,t)}}}));var Ie=Te;\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 */const Oe=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function qe(t){return new Function("f","var p = (f && f.properties || {}); return "+Ce(t))}function Ce(t){if(!t)return"true";const e=t[0];if(t.length<=1)return"any"===e?"false":"true";return`(${"=="===e?Ee(t[1],t[2],"===",!1):"!="===e?Ee(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?Ee(t[1],t[2],e,!0):"any"===e?Ne(t.slice(1),"||"):"all"===e?Ne(t.slice(1),"&&"):"none"===e?Ue(Ne(t.slice(1),"||")):"in"===e?De(t[1],t.slice(2)):"!in"===e?Ue(De(t[1],t.slice(2))):"has"===e?Le(t[1]):"!has"===e?Ue(Le(t[1])):"contains"===e?function(t,e,n){const i=Re(t);return void 0!==n?`(${i} + \'\').indexOf("${e}") === ${n}`:`(${i} + \'\').indexOf("${e}") >= 0`}(t[1],t[2],t[3]):"true"})`}function Re(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function Ee(t,e,n,i){const r=Re(t),o="$type"===t?Oe.indexOf(e):JSON.stringify(e);return(i?`typeof ${r}=== typeof ${o}&&`:"")+r+n+o}function Ne(t,e){return t.map(Ce).join(e)}function De(t,e){"$type"===t&&(e=e.map(t=>Oe.indexOf(t)));const n=JSON.stringify(e.sort($e)),i=Re(t);return e.length<=200?`${n}.indexOf(${i}) !== -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; }(${i}, ${n},0,${e.length-1})`}function Le(t){return"$id"===t?\'"id" in f\':JSON.stringify(t)+" in p"}function Ue(t){return`!(${t})`}function $e(t,e){return t<e?-1:t>e?1:0}var We={exports:{}};We.exports=function(){function t(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function e(t,e){return t<e?-1:t>e?1:0}return function(n,i,r,o,s){!function e(n,i,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,l=i-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(i-l*c/a+h)),f=Math.min(o,Math.floor(i+(a-l)*c/a+h));e(n,i,d,f,s)}var p=n[i],m=r,y=o;for(t(n,r,i),s(n[o],p)>0&&t(n,r,o);m<y;){for(t(n,m,y),m++,y--;s(n[m],p)<0;)m++;for(;s(n[y],p)>0;)y--}0===s(n[r],p)?t(n,r,y):(y++,t(n,y,o)),y<=i&&(r=y+1),i<=y&&(o=y-1)}}(n,i,r||0,o||n.length-1,s||e)}}();var Je=We.exports,He={exports:{}};function Ge(t,e){if(!(this instanceof Ge))return new Ge(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||Ve,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this.O(n)}function Ve(t,e){return t<e?-1:t>e?1:0}He.exports=Ge,He.exports.default=Ge,Ge.prototype={push:function(t){this.data.push(t),this.length++,this.q(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.O(0)),this.data.pop(),t}},peek:function(){return this.data[0]},q:function(t){for(var e=this.data,n=this.compare,i=e[t];t>0;){var r=t-1>>1,o=e[r];if(n(i,o)>=0)break;e[t]=o,t=r}e[t]=i},O:function(t){for(var e=this.data,n=this.compare,i=this.length>>1,r=e[t];t<i;){var o=1+(t<<1),s=o+1,a=e[o];if(s<this.length&&n(e[s],a)<0&&(o=s,a=e[s]),n(a,r)>=0)break;e[t]=a,t=o}e[t]=r}};var Be=He.exports;class Ze{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 Ye{constructor(t,e,n,i){this.a=i.a,this.b=i.b,this.c=i.c,this.v1=t,this.v2=e,this.v3=n,this.normal=[],this.computeNormal(),t.faces.push(this),t.addUniqueNeighbor(e),t.addUniqueNeighbor(n),e.faces.push(this),e.addUniqueNeighbor(t),e.addUniqueNeighbor(n),n.faces.push(this),n.addUniqueNeighbor(t),n.addUniqueNeighbor(e)}computeNormal(){const t=this.v1.position,e=this.v2.position,n=this.v3.position,i=kt([],Mt([],n,e),Mt([],t,e));wt(this.normal,i)}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 Xe=[],Ke=[],Qe=[],tn=[];function en(t,e,n){const i=kt(Ke,e,n);t=zt(t,function(t,e,n,i,r,o,s,a,l,u){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t}(Xe,n[0],n[1],n[2],...i,...e));if((t=function(t){return t[3]<0?_t(t,t,-1):t}(t=Pt(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=n[3]>0?kt(Qe,n,e):kt(Qe,e,n);return xt(kt(tn,n,e),r)<0&&_t(t,t,-1),t}function nn(t,e){const n=[],i=[];let r=0;for(r=0;r<t.length;r+=3){const e=new Ze([t[r],t[r+1],t[r+2]],r/3);n.push(e)}if(!e.length){const t=e;e=[];for(let n=0;n<t;n++)e.push(n)}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 Ye(n[t.a],n[t.b],n[t.c],t)}const o=[],s=[0,0,0];for(r=0;r<n.length;r++){const t=n[r],e=t.index;gt(s,0,0,0);let a=t.faces.length;for(let e=0;e<a;e++)bt(s,s,t.faces[e].normal);a=a||1,gt(o,a,a,a),vt(s,s,o),i[3*e]=s[0],i[3*e+1]=s[1],i[3*e+2]=s[2]}return i}\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 rn(t,e,n){return t[0]=e[n],t[1]=e[n+1],t[2]=e[n+2],t}function on(t,e,n){return t[0]=e[n],t[1]=e[n+1],t}var sn={exports:{}};function an(t,e,n){n=n||2;var i,r,o,s,a,l,u,c=e&&e.length,h=c?e[0]*n:t.length,d=ln(t,0,h,n,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(t,e,n,i){var r,o,s,a,l,u=[];for(r=0,o=e.length;r<o;r++)s=e[r]*i,a=r<o-1?e[r+1]*i:t.length,(l=ln(t,s,a,i,!1))===l.next&&(l.steiner=!0),u.push(vn(l));for(u.sort(mn),r=0;r<u.length;r++)n=yn(u[r],n);return n}(t,e,d,n)),t.length>80*n){i=o=t[0],r=s=t[1];for(var p=n;p<h;p+=n)(a=t[p])<i&&(i=a),(l=t[p+1])<r&&(r=l),a>o&&(o=a),l>s&&(s=l);u=0!==(u=Math.max(o-i,s-r))?32767/u:0}return cn(d,f,n,i,r,u,0),f}function ln(t,e,n,i,r){var o,s;if(r===In(t,e,n,i)>0)for(o=e;o<n;o+=i)s=Sn(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=Sn(o,t[o],t[o+1],s);return s&&Mn(s,s.next)&&(_n(s),s=s.next),s}function un(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!Mn(i,i.next)&&0!==kn(i.prev,i,i.next))i=i.next;else{if(_n(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function cn(t,e,n,i,r,o,s){if(t){!s&&o&&function(t,e,n,i){var r=t;do{0===r.z&&(r.z=bn(r.x,r.y,e,n,i)),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,n,i,r,o,s,a,l,u=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<u&&(a++,i=i.nextZ);e++);for(l=u;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,u*=2}while(s>1)}(r)}(t,i,r,o);for(var a,l,u=t;t.prev!==t.next;)if(a=t.prev,l=t.next,o?dn(t,i,r,o):hn(t))e.push(a.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),_n(t),t=l.next,u=l.next;else if((t=l)===u){s?1===s?cn(t=fn(un(t),e,n),e,n,i,r,o,2):2===s&&pn(t,e,n,i,r,o):cn(un(t),e,n,i,r,o,1);break}}}function hn(t){var e=t.prev,n=t,i=t.next;if(kn(e,n,i)>=0)return!1;for(var r=e.x,o=n.x,s=i.x,a=e.y,l=n.y,u=i.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=i.next;p!==e;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&wn(r,a,o,l,s,u,p.x,p.y)&&kn(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function dn(t,e,n,i){var r=t.prev,o=t,s=t.next;if(kn(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=bn(f,p,e,n,i),b=bn(m,y,e,n,i),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&&wn(a,c,l,h,u,d,v.x,v.y)&&kn(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&&wn(a,c,l,h,u,d,w.x,w.y)&&kn(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&&wn(a,c,l,h,u,d,v.x,v.y)&&kn(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&&wn(a,c,l,h,u,d,w.x,w.y)&&kn(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function fn(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!Mn(r,o)&&jn(r,i,i.next,o)&&Tn(r,o)&&Tn(o,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(o.i/n|0),_n(i),_n(i.next),i=t=o),i=i.next}while(i!==t);return un(i)}function pn(t,e,n,i,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&xn(s,a)){var l=zn(s,a);return s=un(s,s.next),l=un(l,l.next),cn(s,e,n,i,r,o,0),void cn(l,e,n,i,r,o,0)}a=a.next}s=s.next}while(s!==t)}function mn(t,e){return t.x-e.x}function yn(t,e){var n=function(t,e){var n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s&&(s=a,n=i.x<i.next.x?i:i.next,a===r))return n}i=i.next}while(i!==e);if(!n)return null;var l,u=n,c=n.x,h=n.y,d=1/0;i=n;do{r>=i.x&&i.x>=c&&r!==i.x&&wn(o<h?r:s,o,c,h,o<h?s:r,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(r-i.x),Tn(i,t)&&(l<d||l===d&&(i.x>n.x||i.x===n.x&&gn(n,i)))&&(n=i,d=l)),i=i.next}while(i!==u);return n}(t,e);if(!n)return e;var i=zn(n,t);return un(i,i.next),un(n,n.next)}function gn(t,e){return kn(t.prev,t,e.prev)<0&&kn(e.next,t,t.next)<0}function bn(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function vn(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function wn(t,e,n,i,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(i-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function xn(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&jn(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Tn(t,e)&&Tn(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(kn(t.prev,t,e.prev)||kn(t,e.prev,e))||Mn(t,e)&&kn(t.prev,t,t.next)>0&&kn(e.prev,e,e.next)>0)}function kn(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Mn(t,e){return t.x===e.x&&t.y===e.y}function jn(t,e,n,i){var r=Fn(kn(t,e,n)),o=Fn(kn(t,e,i)),s=Fn(kn(n,i,t)),a=Fn(kn(n,i,e));return r!==o&&s!==a||(!(0!==r||!An(t,n,e))||(!(0!==o||!An(t,i,e))||(!(0!==s||!An(n,t,i))||!(0!==a||!An(n,e,i)))))}function An(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Fn(t){return t>0?1:t<0?-1:0}function Tn(t,e){return kn(t.prev,t,t.next)<0?kn(t,e,t.next)>=0&&kn(t,t.prev,e)>=0:kn(t,e,t.prev)<0||kn(t,t.next,e)<0}function zn(t,e){var n=new Pn(t.i,t.x,t.y),i=new Pn(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Sn(t,e,n,i){var r=new Pn(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function _n(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 Pn(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function In(t,e,n,i){for(var r=0,o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}sn.exports=an,sn.exports.default=an,an.deviation=function(t,e,n,i){var r=e&&e.length,o=r?e[0]*n:t.length,s=Math.abs(In(t,0,o,n));if(r)for(var a=0,l=e.length;a<l;a++){var u=e[a]*n,c=a<l-1?e[a+1]*n:t.length;s-=Math.abs(In(t,u,c,n))}var h=0;for(a=0;a<i.length;a+=3){var d=i[a]*n,f=i[a+1]*n,p=i[a+2]*n;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)},an.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);r>0&&(i+=t[r-1].length,n.holes.push(i))}return n};var On=sn.exports;\n/*!\n * @maptalks/vector-packer v0.78.0\n * LICENSE : UNLICENSED\n * (c) 2016-2022 maptalks.com\n */const qn={Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6};function Cn(t,e={}){var n=[];if("FeatureCollection"===t.type)for(var i=0;i<t.features.length;i++)Rn(n,t.features[i],e,i);else Rn(n,"Feature"===t.type?t:{geometry:t},e);return n}function Rn(t,e,n,i){if(e.geometry&&e.geometry.geometry){var r=e.geometry.coordinates,o=e.geometry.type,s=[],a=e.id;if(n.promoteId?a=e.properties[n.promoteId]:n.generateId&&(a=i||0),"Point"===o)En(r,s);else if("MultiPoint"===o)for(var l=0;l<r.length;l++)En(r[l],s);else if("LineString"===o)Dn([r],s);else if("MultiLineString"===o){if(n.lineMetrics){for(l=0;l<r.length;l++)Nn(r[l],s=[]),t.push(Ln(a,"LineString",s,e.properties));return}Dn(r,s)}else if("Polygon"===o)Dn(r,s);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)Rn(t,{id:a,geometry:e.geometry.geometries[l],properties:e.properties},n,i);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=[];Dn(r[l],u),s.push(u)}}t.push(Ln(a,o,s,e.properties))}}function En(t,e){const n=new Nt(t[0],t[1]);n.z=100*(t[2]||0),e.push([n])}function Nn(t,e){for(let n=0;n<t.length;n++){const i=new Nt(t[n][0],t[n][1]);i.z=100*(t[n][2]||0),e.push(i)}}function Dn(t,e,n,i){for(var r=0;r<t.length;r++){var o=[];Nn(t[r],o),e.push(o)}}function Ln(t,e,n,i){return{id:void 0===t?null:t,type:qn[e],geometry:n,properties:i}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */function Un(t,{width:e,height:n},i,r){if(r){if(r.length!==e*n*i)throw new RangeError("mismatched image size")}else r=new Uint8Array(e*n*i);return t.width=e,t.height=n,t.data=r,t}function $n(t,{width:e,height:n},i){if(e===t.width&&n===t.height)return;const r=Un({},{width:e,height:n},i);Wn(t,r,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,n)},i),t.width=e,t.height=n,t.data=r.data}function Wn(t,e,n,i,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||n.x>t.width-r.width||n.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||i.x>e.width-r.width||i.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=((n.y+l)*t.width+n.x)*o,c=((i.y+l)*e.width+i.x)*o;for(let t=0;t<r.width*o;t++)a[c+t]=s[u+t]}return e}class Jn{constructor(t,e){Un(this,t,1,e)}resize(t){$n(this,t,1)}clone(){return new Jn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,n,i,r){Wn(t,e,n,i,r,1)}}class Hn{constructor(t,e){Un(this,t,4,e)}resize(t){$n(this,t,4)}clone(){return new Hn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,n,i,r){Wn(t,e,n,i,r,4)}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */class Gn{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 Vn{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,e={},n=new Lt(0,0,{autoResize:!0}),i=[];for(const n in t){const r=t[n],o={x:0,y:0,w:r.data.width+2,h:r.data.height+2};i.push(o),e[n]=new Gn(o,r)}if(n.pack(i,{inPlace:!0}),!Bn(n.w)||!Bn(n.h)){const t=Zn(n.w),e=Zn(n.h);n.resize(t,e)}const r=new Hn({width:n.w,height:n.h});for(const n in t){const i=t[n],o=e[n].paddedRect;Hn.copy(i.data,r,{x:0,y:0},{x:o.x+1,y:o.y+1},i.data)}this.image=r,this.positions=e}}function Bn(t){return 0==(t&t-1)&&0!==t}function Zn(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 Yn{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,e={},n=new Lt(0,0,{autoResize:!0}),i=[];for(const n in t){const r=t[n],o=e[n]={};for(const t in r){const e=r[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const n={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};i.push(n),o[t]={rect:n,metrics:e.metrics}}}n.pack(i,{inPlace:!0});const r=new Jn({width:n.w,height:n.h});for(const n in t){const i=t[n];for(const t in i){const o=i[+t];if(!o||0===o.bitmap.width||0===o.bitmap.height)continue;const s=e[n][t].rect;Jn.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 Xn(t){return t<65536?Uint16Array:Uint32Array}function Kn(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function Qn(t){return t<256?Uint8Array:t<65536?Uint16Array:t<Math.pow(2,32)?Uint32Array:Float64Array}function ti(t){const e=t.type,n=[];if(1===e||4===e)for(let e=0;e<t.geometry.length;e++)En(t.geometry[e],n);else if(2===e)Dn(t.geometry,n);else if(3===e)Dn(t.geometry,n);else if(5===e)Dn(t.geometry,n);else if(6===e)for(let e=0;e<t.geometry.length;e++){const i=[];Dn(t.geometry[e],i),n.push(i)}return t.geometry=n,t}function ei(t){for(let e=1;e<arguments.length;e++){const n=arguments[e];for(const e in n)t[e]=n[e]}return t}function ni(t){return null==t}function ii(t){return"number"==typeof t&&!isNaN(t)}function ri(t){return"object"==typeof t&&!!t}function oi(t){return!ni(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function si(t){return!ni(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}const ai=Object.prototype.hasOwnProperty;function li(t,e){return ai.call(t,e)}const ui=Math.PI/180;function ci(t){return t&&f(t)&&t.property}function hi(t){const{pointAtTileRes:e,tileRatio:n}=t;return e*n}function di(t){return"centimeter"===t||"cm"===t?1:"millimeter"===t||"mm"===t?.1:100}const fi={};function pi(t,e){if(Array.isArray(e))for(let n=0;n<e.length;n++)t[n]=255*e[n];else{if(e&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b)return t[0]=255*e.r,t[1]=255*e.g,t[2]=255*e.b,t[3]=void 0!==e.a?255*e.a:255,t;e=fi[e]=fi[e]||Ie(e).array();for(let n=0;n<e.length;n++)t[n]=e[n]}return 3===t.length&&t.push(255),t}const mi={textFill:1,textSize:1,textOpacity:1,markerWidth:1,markerHeight:1,markerOpacity:1,markerDx:1,markerDy:1,lineWidth:1,lineColor:1,lineOpacity:1,polygonFill:1,polygonOpacity:1},yi={textName:1,markerTextFitPadding:1,markerTextFit:1,lineGradientProperty:1};var gi=Object.freeze({__proto__:null,now:function(){return Date.now()},extend:ei,isNil:ni,isNumber:ii,isInteger:function(t){return(0|t)===t},isObject:ri,isString:oi,isFunction:si,hasOwn:li,join:function(t,e){return t.join?t.join(e||","):Array.prototype.join.call(t,e||",")},toRadian:function(t){return t*ui},toDegree:function(t){return t/ui},evaluate:function(t,e,n){return si(t)?t(void 0!==n?n:null,e):t},isFnTypeSymbol:ci,getAltitudeToLocal:hi,getTubeSizeScale:di,normalizeColor:pi,checkIfIdentityZoomDependent:function(t,e,n){if(Array.isArray(n)||(n=Object.values(n)),!n||!n.length)return!1;if(!mi[t])return!1;for(let t=0;t<n.length;t++){const i=n[t]&&(n[t].feature||n[t]);if(!i)continue;const r=i.properties&&i.properties[e];if(r&&f(r)&&!p(r).isZoomConstant)return!0}return!1},checkIfZoomFnTypeSymbol:function(t){return!!mi[t]||!!yi[t]}});function bi(t){let e=0;for(let n,i,r=0,o=t.length,s=o-1;r<o;s=r++)n=t[r],i=t[s],e+=void 0!==n.x?(i.x-n.x)*(n.y+i.y):(i[0]-n[0])*(n[1]+i[1]);return e}function vi(t,e,n,i,r){const o=t[e*i],s=t[e*i+1],a=t[n*i],l=t[n*i+1];return o===a&&(o<0||o>r)&&s!==l||s===l&&(s<0||s>r)&&o!==a}function wi(t,e,n){let i=n;return e&&t&&(i=+t[e]),isNaN(i)&&(i=n||0),100*i}function xi(t,e,n,i,r,o,s){e||0===e||(e=1);const a=wi(t.properties,n,i),l=a*e;let u=(o?100*o:0)||a;return r?u=wi(t.properties,r,o):s&&(u=a-wi(t.properties,s,o)),u*=e,{altitude:l,height:u}}function ki(t,e){return e<1/0&&(t.x<0||t.x>e||t.y<0||t.y>e)}function Mi(t){return null==t}function ji(t,e,n){if(t===n||t===e)return t;const i=n-e;return((t-e)%i+i)%i+e}function Ai(t,e){if(!e)return null;const n=new Map;for(let i=0;i<e.length;i++){const r=e[i],o=t[r];let s=n.get(o);s||(s=[],n.set(o,s)),s.push(r)}return n}class Fi{constructor(t,e,n,i){this.feature=t,this.symbol=e,this.fnTypes=n,this.options=i}getPolygonResource(){let t=this.symbol.polygonPatternFile;const{polygonPatternFileFn:e}=this.fnTypes;return this.C(t,e)}getLineResource(){let t=this.symbol.linePatternFile;const{linePatternFileFn:e}=this.fnTypes;return this.C(t,e)}C(t,e){return e&&(t=e(this.options.zoom,this.feature.properties)),t}}function Ti(t,e,n,i){const r=Math.abs(i)>>15,o=r>>1,s=r%2;let a=i%Math.pow(2,15);const l=e+(o<<14)*Math.sign(e),u=n+(s<<14)*Math.sign(n);return t[0]=l,t[1]=u,a=Math.round(a),t[2]=0===a?i<0?-1:0:a,t}const zi=Math.pow(2,14),Si=Math.pow(2,15);var _i={$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. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."},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 Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of 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",android:"10.6.0",ios:"10.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. 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",android:"10.6.0",ios:"10.6.0"}}},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.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."},globe:{doc:"A globe 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",minimum:[-180,-90],maximum:[180,90],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",minimum:[-90,-90],maximum:[90,90],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.",requires:["source"],"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"},"line-trim-offset":{type:"array",value:"number",doc:"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"2.9.0",android:"10.5.0",ios:"10.5.0",macos:"10.5.0"}},"property-type":"constant"}},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."}}},Pi="undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self?self:{};function Ii(t){var e={exports:{}};return t(e,e.exports),e.exports}function Oi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}\n/*! https://mths.be/punycode v1.3.2 by @mathias */Ii((function(t,e){!function(n){var i=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="object"==typeof Pi&Πo.global!==o&&o.window!==o&&o.self!==o||(n=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 n=t.length,i=[];n--;)i[n]=e(t[n]);return i}function g(t,e){var n=t.split("@"),i="";return n.length>1&&(i=n[0]+"@",t=n[1]),i+y((t=t.replace(h,".")).split("."),e).join(".")}function b(t){for(var e,n,i=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(n=t.charCodeAt(r++)))?i.push(((1023&e)<<10)+(1023&n)+65536):(i.push(e),r--):i.push(e);return i}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,n){var i=0;for(t=n?f(t/700):t>>1,t+=f(t/e);t>455;i+=36)t=f(t/35);return f(i+36*t/(t+38))}function k(t){var e,n,i,r,o,s,a,u,c,h,d,p=[],y=t.length,g=0,b=128,w=72;for((n=t.lastIndexOf("-"))<0&&(n=0),i=0;i<n;++i)t.charCodeAt(i)>=128&&m("not-basic"),p.push(t.charCodeAt(i));for(r=n>0?n+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,n,i,r,o,s,a,u,c,h,d,y,g,v,k,M=[];for(y=(t=b(t)).length,e=128,n=0,o=72,s=0;s<y;++s)(d=t[s])<128&&M.push(p(d));for(i=r=M.length,r&&M.push("-");i<y;){for(a=l,s=0;s<y;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((l-n)/(g=i+1))&&m("overflow"),n+=(a-e)*g,e=a,s=0;s<y;++s)if((d=t[s])<e&&++n>l&&m("overflow"),d==e){for(u=n,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(n,g,i==r),n=0,++i}++n,++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}))}},i&&r)if(t.exports==i)r.exports=s;else for(a in s)s.hasOwnProperty(a)&&(i[a]=s[a]);else n.punycode=s}(Pi)}));var qi=function(t,e,n,i){n=n||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\\+/g;t=t.split(e=e||"&");var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.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(n);p>=0?(u=f.substr(0,p),c=f.substr(p+1)):(u=f,c=""),h=decodeURIComponent(u),d=decodeURIComponent(c),Oi(r,h)?Array.isArray(r[h])?r[h].push(d):r[h]=[r[h],d]:r[h]=d}return r},Ci=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Ri=function(t,e,n,i){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var r=encodeURIComponent(Ci(i))+n;return Array.isArray(t[i])?t[i].map((function(t){return r+encodeURIComponent(Ci(t))})).join(e):r+encodeURIComponent(Ci(t[i]))})).join(e):i?encodeURIComponent(Ci(i))+n+encodeURIComponent(Ci(t)):""};function Ei(t,...e){for(const n of e)for(const e in n)t[e]=n[e];return t}Ii((function(t,e){e.decode=e.parse=qi,e.encode=e.stringify=Ri}));class Ni extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}var Di=Ni;class Li{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,n]of e)this.bindings[t]=n}concat(t){return new Li(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)}}var Ui=Li;const $i={kind:"null"},Wi={kind:"number"},Ji={kind:"string"},Hi={kind:"boolean"},Gi={kind:"color"},Vi={kind:"object"},Bi={kind:"value"},Zi={kind:"collator"},Yi={kind:"formatted"},Xi={kind:"resolvedImage"};function Ki(t,e){return{kind:"array",itemType:t,N:e}}function Qi(t){if("array"===t.kind){const e=Qi(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const tr=[$i,Wi,Ji,Hi,Gi,Yi,Vi,Ki(Bi),Xi];function er(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!er(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 tr)if(!er(t,e))return null}return`Expected ${Qi(t)} but found ${Qi(e)} instead.`}function nr(t,e){return e.some(e=>e.kind===t.kind)}function ir(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 rr=Ii((function(t,e){var n={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 i(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return i("%"===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,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in n)return n[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[i(255*s(g,y,f+1/3)),i(255*s(g,y,f)),i(255*s(g,y,f-1/3)),d];default:return null}}return null}}catch(t){}}));class or{constructor(t,e,n,i=1){this.r=t,this.g=e,this.b=n,this.a=i}static parse(t){if(!t)return;if(t instanceof or)return t;if("string"!=typeof t)return;const e=rr.parseCSSColor(t);return e?new or(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,n,i]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(n)},${i})`}toArray(){const{r:t,g:e,b:n,a:i}=this;return 0===i?[0,0,0,0]:[255*t/i,255*e/i,255*n/i,i]}toArray01(){const{r:t,g:e,b:n,a:i}=this;return 0===i?[0,0,0,0]:[t/i,e/i,n/i,i]}toArray01PremultipliedAlpha(){const{r:t,g:e,b:n,a:i}=this;return[t,e,n,i]}}or.black=new or(0,0,0,1),or.white=new or(1,1,1,1),or.transparent=new or(0,0,0,0),or.red=new or(1,0,0,1),or.blue=new or(0,0,1,1);var sr=or;class ar{constructor(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,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 lr{constructor(t,e,n,i,r){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=n,this.fontStack=i,this.textColor=r}}class ur{constructor(t){this.sections=t}static fromString(t){return new ur([new lr(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 ur?t:ur.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 n={};e.fontStack&&(n["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(n["font-scale"]=e.scale),e.textColor&&(n["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(n)}return t}}class cr{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new cr({name:t,available:!1}):null}serialize(){return["image",this.name]}}function hr(t,e,n,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,n,i].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[t,e,n,i]:[t,e,n]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function dr(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 sr)return!0;if(t instanceof ar)return!0;if(t instanceof ur)return!0;if(t instanceof cr)return!0;if(Array.isArray(t)){for(const e of t)if(!dr(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!dr(t[e]))return!1;return!0}return!1}function fr(t){if(null===t)return $i;if("string"==typeof t)return Ji;if("boolean"==typeof t)return Hi;if("number"==typeof t)return Wi;if(t instanceof sr)return Gi;if(t instanceof ar)return Zi;if(t instanceof ur)return Yi;if(t instanceof cr)return Xi;if(Array.isArray(t)){const e=t.length;let n;for(const e of t){const t=fr(e);if(n){if(n===t)continue;n=Bi;break}n=t}return Ki(n||Bi,e)}return Vi}function pr(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof sr||t instanceof ur||t instanceof cr?t.toString():JSON.stringify(t)}class mr{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(!dr(t[1]))return e.error("invalid value");const n=t[1];let i=fr(n);const r=e.expectedType;return"array"!==i.kind||0!==i.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(i=r),new mr(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof sr?["rgba"].concat(this.value.toArray()):this.value instanceof ur?this.value.serialize():this.value}}var yr=mr,gr=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const br={string:Ji,number:Wi,boolean:Hi,object:Vi};class vr{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 n,i=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const n=t[1];if("string"!=typeof n||!(n in br)||"object"===n)return e.error(\'The item type argument of "array" must be one of string, number, boolean\',1);r=br[n],i++}else r=Bi;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],i++}n=Ki(r,o)}else n=br[r];const o=[];for(;i<t.length;i++){const n=e.parse(t[i],i,Bi);if(!n)return null;o.push(n)}return new vr(n,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const n=this.args[e].evaluate(t);if(!er(this.type,fr(n)))return n;if(e===this.args.length-1)throw new gr(`Expected value to be of type ${Qi(this.type)}, but found ${Qi(fr(n))} 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 n=t.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){e.push(n.kind);const i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map(t=>t.serialize()))}}var wr=vr;class xr{constructor(t){this.type=Yi,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return e.error("First argument must be an image or text section.");const i=[];let r=!1;for(let n=1;n<=t.length-1;++n){const o=t[n];if(r&&"object"==typeof o&&!Array.isArray(o)){r=!1;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,Wi),!t))return null;let n=null;if(o["text-font"]&&(n=e.parse(o["text-font"],1,Ki(Ji)),!n))return null;let s=null;if(o["text-color"]&&(s=e.parse(o["text-color"],1,Gi),!s))return null;const a=i[i.length-1];a.scale=t,a.font=n,a.textColor=s}else{const o=e.parse(t[n],1,Bi);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,i.push({content:o,scale:null,font:null,textColor:null})}}return new xr(i)}evaluate(t){return new ur(this.sections.map(e=>{const n=e.content.evaluate(t);return fr(n)===Xi?new lr("",n,null,null,null):new lr(pr(n),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 n={};e.scale&&(n["font-scale"]=e.scale.serialize()),e.font&&(n["text-font"]=e.font.serialize()),e.textColor&&(n["text-color"]=e.textColor.serialize()),t.push(n)}return t}}class kr{constructor(t){this.type=Xi,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const n=e.parse(t[1],1,Ji);return n?new kr(n):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),n=cr.fromString(e);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(e)>-1),n}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Mr={"to-boolean":Hi,"to-color":Gi,"to-number":Wi,"to-string":Ji};class jr{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 n=t[0];if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");const i=Mr[n],r=[];for(let n=1;n<t.length;n++){const i=e.parse(t[n],n,Bi);if(!i)return null;r.push(i)}return new jr(i,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,n;for(const i of this.args){if(e=i.evaluate(t),n=null,e instanceof sr)return e;if("string"==typeof e){const n=t.parseColor(e);if(n)return n}else if(Array.isArray(e)&&(n=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:hr(e[0],e[1],e[2],e[3]),!n))return new sr(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new gr(n||`Could not parse color from value \'${"string"==typeof e?e:String(JSON.stringify(e))}\'`)}if("number"===this.type.kind){let e=null;for(const n of this.args){if(e=n.evaluate(t),null===e)return 0;const i=Number(e);if(!isNaN(i))return i}throw new gr(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?ur.fromString(pr(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?cr.fromString(pr(this.args[0].evaluate(t))):pr(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 xr([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new kr(this.args[0]).serialize();const t=["to-"+this.type.kind];return this.eachChild(e=>{t.push(e.serialize())}),t}}var Ar=jr;const Fr=["Unknown","Point","LineString","Polygon"];var Tr=class{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?Fr[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:n,y:i}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(n*e-t[0])+this.featureDistanceData.bearing[1]*(i*e-t[1])}return 0}parseColor(t){let e=this.R[t];return e||(e=this.R[t]=sr.parse(t)),e}};class zr{constructor(t,e,n,i){this.name=t,this.type=e,this.D=n,this.args=i}evaluate(t){return this.D(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 n=t[0],i=zr.definitions[n];if(!i)return e.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1);let a=null;for(const[i,o]of s){a=new to(e.registry,e.path,null,e.scope);const s=[];let l=!1;for(let e=1;e<t.length;e++){const n=t[e],r=Array.isArray(i)?i[e-1]:i.type,o=a.parse(n,1+s.length,r);if(!o){l=!0;break}s.push(o)}if(!l)if(Array.isArray(i)&&i.length!==s.length)a.error(`Expected ${i.length} arguments, but found ${s.length} instead.`);else{for(let t=0;t<s.length;t++){const e=Array.isArray(i)?i[t]:i.type,n=s[t];a.concat(t+1).checkSubtype(e,n.type)}if(0===a.errors.length)return new zr(n,r,o,s)}}if(1===s.length)e.errors.push(...a.errors);else{const n=(s.length?s:o).map(([t])=>{return e=t,Array.isArray(e)?`(${e.map(Qi).join(", ")})`:`(${Qi(e.type)}...)`;var e}).join(" | "),i=[];for(let n=1;n<t.length;n++){const r=e.parse(t[n],1+i.length);if(!r)return null;i.push(Qi(r.type))}e.error(`Expected arguments of type ${n}, but found (${i.join(", ")}) instead.`)}return null}static register(t,e){zr.definitions=e;for(const n in e)t[n]=zr}}var Sr=zr;class _r{constructor(t,e,n){this.type=Zi,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const n=t[1];if("object"!=typeof n||Array.isArray(n))return e.error("Collator options argument must be an object.");const i=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,Hi);if(!i)return null;const r=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,Hi);if(!r)return null;let o=null;return n.locale&&(o=e.parse(n.locale,1,Ji),!o)?null:new _r(i,r,o)}evaluate(t){return new ar(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 Pr(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 Ir(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Or(t,e){const n=(180+t[0])/360,i=(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(n*r*8192),Math.round(i*r*8192)]}function qr(t,e,n){const i=t[0]-e[0],r=t[1]-e[1],o=t[0]-n[0],s=t[1]-n[1];return i*s-o*r==0&&i*o<=0&&r*s<=0}function Cr(t,e){let n=!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(qr(t,a[e],a[e+1]))return!1;(r=a[e])[1]>(i=t)[1]!=(o=a[e+1])[1]>i[1]&&i[0]<(o[0]-r[0])*(i[1]-r[1])/(o[1]-r[1])+r[0]&&(n=!n)}}var i,r,o;return n}function Rr(t,e){for(let n=0;n<e.length;n++)if(Cr(t,e[n]))return!0;return!1}function Er(t,e,n,i){const r=i[0]-n[0],o=i[1]-n[1],s=(t[0]-n[0])*o-r*(t[1]-n[1]),a=(e[0]-n[0])*o-r*(e[1]-n[1]);return s>0&&a<0||s<0&&a>0}function Nr(t,e,n){for(const u of n)for(let n=0;n<u.length-1;++n)if(void 0,void 0,0!=(a=[(s=u[n+1])[0]-(o=u[n])[0],s[1]-o[1]])[0]*(l=[(r=e)[0]-(i=t)[0],r[1]-i[1]])[1]-a[1]*l[0]&&Er(i,r,o,s)&&Er(o,s,i,r))return!0;var i,r,o,s,a,l;return!1}function Dr(t,e){for(let n=0;n<t.length;++n)if(!Cr(t[n],e))return!1;for(let n=0;n<t.length-1;++n)if(Nr(t[n],t[n+1],e))return!1;return!0}function Lr(t,e){for(let n=0;n<e.length;n++)if(Dr(t,e[n]))return!0;return!1}function Ur(t,e,n){const i=[];for(let r=0;r<t.length;r++){const o=[];for(let i=0;i<t[r].length;i++){const s=Or(t[r][i],n);Pr(e,s),o.push(s)}i.push(o)}return i}function $r(t,e,n){const i=[];for(let r=0;r<t.length;r++){const o=Ur(t[r],e,n);i.push(o)}return i}function Wr(t,e,n,i){if(t[0]<n[0]||t[0]>n[2]){const e=.5*i;let r=t[0]-n[0]>e?-i:n[0]-t[0]>e?i:0;0===r&&(r=t[0]-n[2]>e?-i:n[2]-t[0]>e?i:0),t[0]+=r}Pr(e,t)}function Jr(t,e,n,i){const r=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],s=[];if(!t)return s;for(const i of t)for(const t of i){const i=[t.x+o[0],t.y+o[1]];Wr(i,e,n,r),s.push(i)}return s}function Hr(t,e,n,i){const r=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],s=[];if(!t)return s;for(const n of t){const t=[];for(const i of n){const n=[i.x+o[0],i.y+o[1]];Pr(e,n),t.push(n)}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 i of t)Wr(i,e,n,r)}var a;return s}class Gr{constructor(t,e){this.type=Hi,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(dr(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const n=e.features[t].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new Gr(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Gr(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Gr(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 n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const o=Ur(e.coordinates,i,r),s=Jr(t.geometry(),n,i,r);if(!Ir(n,i))return!1;for(const t of s)if(!Cr(t,o))return!1}if("MultiPolygon"===e.type){const o=$r(e.coordinates,i,r),s=Jr(t.geometry(),n,i,r);if(!Ir(n,i))return!1;for(const t of s)if(!Rr(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const o=Ur(e.coordinates,i,r),s=Hr(t.geometry(),n,i,r);if(!Ir(n,i))return!1;for(const t of s)if(!Dr(t,o))return!1}if("MultiPolygon"===e.type){const o=$r(e.coordinates,i,r),s=Hr(t.geometry(),n,i,r);if(!Ir(n,i))return!1;for(const t of s)if(!Lr(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var Vr=Gr;function Br(t){if(t instanceof Sr){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 Vr)return!1;let e=!0;return t.eachChild(t=>{e&&!Br(t)&&(e=!1)}),e}function Zr(t){if(t instanceof Sr&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(t=>{e&&!Zr(t)&&(e=!1)}),e}function Yr(t,e){if(t instanceof Sr&&e.indexOf(t.name)>=0)return!1;let n=!0;return t.eachChild(t=>{n&&!Yr(t,e)&&(n=!1)}),n}class Xr{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 n=t[1];return e.scope.has(n)?new Xr(n,e.scope.get(n)):e.error(`Unknown variable "${n}". Make sure "${n}" 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]}}var Kr=Xr;class Qr{constructor(t,e=[],n,i=new Ui,r=[]){this.registry=t,this.path=e,this.key=e.map(t=>`[${t}]`).join(""),this.scope=i,this.errors=r,this.expectedType=n}parse(t,e,n,i,r={}){return e?this.concat(e,n,i).L(t,r):this.L(t,r)}L(t,e){function n(t,e,n){return"assert"===n?new wr(e,[t]):"coerce"===n?new Ar(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 i=t[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const r=this.registry[i];if(r){let i=r.parse(t,this);if(!i)return null;if(this.expectedType){const t=this.expectedType,r=i.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 i=n(i,t,e.typeAnnotation||"coerce");else i=n(i,t,e.typeAnnotation||"assert")}if(!(i instanceof yr)&&"resolvedImage"!==i.type.kind&&function t(e){if(e instanceof Kr)return t(e.boundExpression);if(e instanceof Sr&&"error"===e.name)return!1;if(e instanceof _r)return!1;if(e instanceof Vr)return!1;const n=e instanceof Ar||e instanceof wr;let i=!0;return e.eachChild(e=>{i=n?i&&t(e):i&&e instanceof yr}),!!i&&(Br(e)&&Yr(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}(i)){const e=new Tr;try{i=new yr(i.type,i.evaluate(e))}catch(t){return this.error(t.message),null}}return i}return this.error(`Unknown expression "${i}". 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,n){const i="number"==typeof t?this.path.concat(t):this.path,r=n?this.scope.concat(n):this.scope;return new Qr(this.registry,i,e||null,r,this.errors)}error(t,...e){const n=`${this.key}${e.map(t=>`[${t}]`).join("")}`;this.errors.push(new Di(n,t))}checkSubtype(t,e){const n=er(t,e);return n&&this.error(n),n}}var to=Qr;function eo(t,e){const n=t.length-1;let i,r,o=0,s=n,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),i=t[a],r=t[a+1],i<=e){if(a===n||e<r)return a;o=a+1}else{if(!(i>e))throw new gr("Input is not a number.");s=a-1}return 0}class no{constructor(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of n)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 n=e.parse(t[1],1,Wi);if(!n)return null;const i=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let n=1;n<t.length;n+=2){const o=1===n?-1/0:t[n],s=t[n+1],a=n,l=n+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(i.length&&i[i.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,i.push([o,u])}return new no(r,n,i)}evaluate(t){const e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return n[0].evaluate(t);const r=e.length;return i>=e[r-1]?n[r-1].evaluate(t):n[eo(e,i)].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 io=no,ro=oo;function oo(t,e,n,i){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=n,this.p2y=i}function so(t,e,n){return t*(1-n)+e*n}oo.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},oo.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},oo.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},oo.prototype.solveCurveX=function(t,e){var n,i,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)<(n=0))return n;if(r>(i=1))return i;for(;n<i;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?n=r:i=r,r=.5*(i-n)+n}return r},oo.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var ao=Object.freeze({__proto__:null,number:so,color:function(t,e,n){return new sr(so(t.r,e.r,n),so(t.g,e.g,n),so(t.b,e.b,n),so(t.a,e.a,n))},array:function(t,e,n){return t.map((t,i)=>so(t,e[i],n))}});const lo=6/29*3*(6/29),uo=Math.PI/180,co=180/Math.PI;function ho(t){return t>.008856451679035631?Math.pow(t,1/3):t/lo+4/29}function fo(t){return t>6/29?t*t*t:lo*(t-4/29)}function po(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function mo(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yo(t){const e=mo(t.r),n=mo(t.g),i=mo(t.b),r=ho((.4124564*e+.3575761*n+.1804375*i)/.95047),o=ho((.2126729*e+.7151522*n+.072175*i)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-ho((.0193339*e+.119192*n+.9503041*i)/1.08883)),alpha:t.a}}function go(t){let e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*fo(e),n=.95047*fo(n),i=1.08883*fo(i),new sr(po(3.2404542*n-1.5371385*e-.4985314*i),po(-.969266*n+1.8760108*e+.041556*i),po(.0556434*n-.2040259*e+1.0572252*i),t.alpha)}function bo(t,e,n){const i=e-t;return t+n*(i>180||i<-180?i-360*Math.round(i/360):i)}const vo={forward:yo,reverse:go,interpolate:function(t,e,n){return{l:so(t.l,e.l,n),a:so(t.a,e.a,n),b:so(t.b,e.b,n),alpha:so(t.alpha,e.alpha,n)}}},wo={forward:function(t){const{l:e,a:n,b:i}=yo(t),r=Math.atan2(i,n)*co;return{h:r<0?r+360:r,c:Math.sqrt(n*n+i*i),l:e,alpha:t.a}},reverse:function(t){const e=t.h*uo,n=t.c;return go({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:bo(t.h,e.h,n),c:so(t.c,e.c,n),l:so(t.l,e.l,n),alpha:so(t.alpha,e.alpha,n)}}};var xo=Object.freeze({__proto__:null,lab:vo,hcl:wo});class ko{constructor(t,e,n,i,r){this.type=t,this.operator=e,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,n,i){let r=0;if("exponential"===t.name)r=Mo(e,t.base,n,i);else if("linear"===t.name)r=Mo(e,1,n,i);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new ro(o[0],o[1],o[2],o[3]).solve(Mo(e,1,n,i))}return r}static parse(t,e){let[n,i,r,...o]=t;if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const t=i[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:t}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);{const t=i.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);i={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,Wi),!r)return null;const s=[];let a=null;"interpolate-hcl"===n||"interpolate-lab"===n?a=Gi:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t<o.length;t+=2){const n=o[t],i=o[t+1],r=t+3,l=t+4;if("number"!=typeof n)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]>=n)return e.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',r);const u=e.parse(i,l,a);if(!u)return null;a=a||u.type,s.push([n,u])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new ko(a,n,i,r,s):e.error(`Type ${Qi(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return n[0].evaluate(t);const r=e.length;if(i>=e[r-1])return n[r-1].evaluate(t);const o=eo(e,i),s=ko.interpolationFactor(this.interpolation,i,e[o],e[o+1]),a=n[o].evaluate(t),l=n[o+1].evaluate(t);return"interpolate"===this.operator?ao[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?wo.reverse(wo.interpolate(wo.forward(a),wo.forward(l),s)):vo.reverse(vo.interpolate(vo.forward(a),vo.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 Mo(t,e,n,i){const r=i-n,o=t-n;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}var jo=ko;class Ao{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 n=null;const i=e.expectedType;i&&"value"!==i.kind&&(n=i);const r=[];for(const i of t.slice(1)){const t=e.parse(i,1+r.length,n,void 0,{typeAnnotation:"omit"});if(!t)return null;n=n||t.type,r.push(t)}const o=i&&r.some(t=>er(i,t.type));return new Ao(o?Bi:n,r)}evaluate(t){let e,n=null,i=0;for(const r of this.args){if(i++,n=r.evaluate(t),n&&n instanceof cr&&!n.available&&(e||(e=n),n=null,i===this.args.length))return e;if(null!==n)break}return n}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}}var Fo=Ao;class To{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 n=[];for(let i=1;i<t.length-1;i+=2){const r=t[i];if("string"!=typeof r)return e.error(`Expected string, but found ${typeof r} instead.`,i);if(/[^a-zA-Z0-9_]/.test(r))return e.error("Variable names must contain only alphanumeric characters or \'_\'.",i);const o=e.parse(t[i+1],i+1);if(!o)return null;n.push([r,o])}const i=e.parse(t[t.length-1],t.length-1,e.expectedType,n);return i?new To(n,i):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,n]of this.bindings)t.push(e,n.serialize());return t.push(this.result.serialize()),t}}var zo=To;class So{constructor(t,e,n){this.type=t,this.index=e,this.input=n}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const n=e.parse(t[1],1,Wi),i=e.parse(t[2],2,Ki(e.expectedType||Bi));return n&&i?new So(i.type.itemType,n,i):null}evaluate(t){const e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new gr(`Array index out of bounds: ${e} < 0.`);if(e>=n.length)throw new gr(`Array index out of bounds: ${e} > ${n.length-1}.`);if(e!==Math.floor(e))throw new gr(`Array index must be an integer, but found ${e} instead.`);return n[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var _o=So;class Po{constructor(t,e){this.type=Hi,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 n=e.parse(t[1],1,Bi),i=e.parse(t[2],2,Bi);return n&&i?nr(n.type,[Hi,Ji,Wi,$i,Bi])?new Po(n,i):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Qi(n.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(null==n)return!1;if(!ir(e,["boolean","string","number","null"]))throw new gr(`Expected first argument to be of type boolean, string, number or null, but found ${Qi(fr(e))} instead.`);if(!ir(n,["string","array"]))throw new gr(`Expected second argument to be of type array or string, but found ${Qi(fr(n))} instead.`);return n.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Io=Po;class Oo{constructor(t,e,n){this.type=Wi,this.needle=t,this.haystack=e,this.fromIndex=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 n=e.parse(t[1],1,Bi),i=e.parse(t[2],2,Bi);if(!n||!i)return null;if(!nr(n.type,[Hi,Ji,Wi,$i,Bi]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Qi(n.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Wi);return r?new Oo(n,i,r):null}return new Oo(n,i)}evaluate(t){const e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!ir(e,["boolean","string","number","null"]))throw new gr(`Expected first argument to be of type boolean, string, number or null, but found ${Qi(fr(e))} instead.`);if(!ir(n,["string","array"]))throw new gr(`Expected second argument to be of type array or string, but found ${Qi(fr(n))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(t);return n.indexOf(e,i)}return n.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()]}}var qo=Oo;class Co{constructor(t,e,n,i,r,o){this.inputType=t,this.type=e,this.input=n,this.cases=i,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 n,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=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(n){if(u.checkSubtype(n,fr(t)))return null}else n=fr(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,i);if(!c)return null;i=i||c.type,o.push(c)}const s=e.parse(t[1],1,Bi);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,i);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(n,s.type)?null:new Co(n,i,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(fr(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(),n=[],i={};for(const t of e){const e=i[this.cases[t]];void 0===e?(i[this.cases[t]]=n.length,n.push([this.cases[t],[t]])):n[e][1].push(t)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,i]of n)t.push(1===i.length?r(i[0]):i.map(r)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}var Ro=Co;class Eo{constructor(t,e,n){this.type=t,this.branches=e,this.otherwise=n}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 n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const i=[];for(let r=1;r<t.length-1;r+=2){const o=e.parse(t[r],r,Hi);if(!o)return null;const s=e.parse(t[r+1],r+1,n);if(!s)return null;i.push([o,s]),n=n||s.type}const r=e.parse(t[t.length-1],t.length-1,n);return r?new Eo(n,i,r):null}evaluate(t){for(const[e,n]of this.branches)if(e.evaluate(t))return n.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,n]of this.branches)t(e),t(n);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}}var No=Eo;class Do{constructor(t,e,n,i){this.type=t,this.input=e,this.beginIndex=n,this.endIndex=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 n=e.parse(t[1],1,Bi),i=e.parse(t[2],2,Wi);if(!n||!i)return null;if(!nr(n.type,[Ki(Bi),Ji,Bi]))return e.error(`Expected first argument to be of type array or string, but found ${Qi(n.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Wi);return r?new Do(n.type,n,i,r):null}return new Do(n.type,n,i)}evaluate(t){const e=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(!ir(e,["string","array"]))throw new gr(`Expected first argument to be of type array or string, but found ${Qi(fr(e))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(t);return e.slice(n,i)}return e.slice(n)}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()]}}var Lo=Do;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 $o(t,e,n,i){return 0===i.compare(e,n)}function Wo(t,e,n){const i="=="!==t&&"!="!==t;return class r{constructor(t,e,n){this.type=Hi,this.lhs=t,this.rhs=e,this.collator=n,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 n=t[0];let o=e.parse(t[1],1,Bi);if(!o)return null;if(!Uo(n,o.type))return e.concat(1).error(`"${n}" comparisons are not supported for type \'${Qi(o.type)}\'.`);let s=e.parse(t[2],2,Bi);if(!s)return null;if(!Uo(n,s.type))return e.concat(2).error(`"${n}" comparisons are not supported for type \'${Qi(s.type)}\'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types \'${Qi(o.type)}\' and \'${Qi(s.type)}\'.`);i&&("value"===o.type.kind&&"value"!==s.type.kind?o=new wr(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new wr(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,Zi),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(i&&this.hasUntypedArgument){const e=fr(o),n=fr(s);if(e.kind!==n.kind||"string"!==e.kind&&"number"!==e.kind)throw new gr(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${n.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const t=fr(o),n=fr(s);if("string"!==t.kind||"string"!==n.kind)return e(r,o,s)}return this.collator?n(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 Jo=Wo("==",(function(t,e,n){return e===n}),$o),Ho=Wo("!=",(function(t,e,n){return e!==n}),(function(t,e,n,i){return!$o(0,e,n,i)})),Go=Wo("<",(function(t,e,n){return e<n}),(function(t,e,n,i){return i.compare(e,n)<0})),Vo=Wo(">",(function(t,e,n){return e>n}),(function(t,e,n,i){return i.compare(e,n)>0})),Bo=Wo("<=",(function(t,e,n){return e<=n}),(function(t,e,n,i){return i.compare(e,n)<=0})),Zo=Wo(">=",(function(t,e,n){return e>=n}),(function(t,e,n,i){return i.compare(e,n)>=0}));class Yo{constructor(t,e,n,i,r){this.type=Ji,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const n=e.parse(t[1],1,Wi);if(!n)return null;const i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");let r=null;if(i.locale&&(r=e.parse(i.locale,1,Ji),!r))return null;let o=null;if(i.currency&&(o=e.parse(i.currency,1,Ji),!o))return null;let s=null;if(i["min-fraction-digits"]&&(s=e.parse(i["min-fraction-digits"],1,Wi),!s))return null;let a=null;return i["max-fraction-digits"]&&(a=e.parse(i["max-fraction-digits"],1,Wi),!a)?null:new Yo(n,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 Xo{constructor(t){this.type=Wi,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const n=e.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?e.error(`Expected argument of type string or array, but found ${Qi(n.type)} instead.`):new Xo(n):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 gr(`Expected value to be of type string or array, but found ${Qi(fr(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(e=>{t.push(e.serialize())}),t}}const Ko={"==":Jo,"!=":Ho,">":Vo,"<":Go,">=":Zo,"<=":Bo,array:wr,at:_o,boolean:wr,case:No,coalesce:Fo,collator:_r,format:xr,image:kr,in:Io,"index-of":qo,interpolate:jo,"interpolate-hcl":jo,"interpolate-lab":jo,length:Xo,let:zo,literal:yr,match:Ro,number:wr,"number-format":Yo,object:wr,slice:Lo,step:io,string:wr,"to-boolean":Ar,"to-color":Ar,"to-number":Ar,"to-string":Ar,var:Kr,within:Vr};function Qo(t,[e,n,i,r]){e=e.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);const o=r?r.evaluate(t):1,s=hr(e,n,i,o);if(s)throw new gr(s);return new sr(e/255*o,n/255*o,i/255*o,o)}function ts(t,e){return t in e}function es(t,e){const n=e[t];return void 0===n?null:n}function ns(t){return{type:t}}Sr.register(Ko,{error:[{kind:"error"},[Ji],(t,[e])=>{throw new gr(e.evaluate(t))}],typeof:[Ji,[Bi],(t,[e])=>Qi(fr(e.evaluate(t)))],"to-rgba":[Ki(Wi,4),[Gi],(t,[e])=>e.evaluate(t).toArray()],rgb:[Gi,[Wi,Wi,Wi],Qo],rgba:[Gi,[Wi,Wi,Wi,Wi],Qo],has:{type:Hi,overloads:[[[Ji],(t,[e])=>ts(e.evaluate(t),t.properties())],[[Ji,Vi],(t,[e,n])=>ts(e.evaluate(t),n.evaluate(t))]]},get:{type:Bi,overloads:[[[Ji],(t,[e])=>es(e.evaluate(t),t.properties())],[[Ji,Vi],(t,[e,n])=>es(e.evaluate(t),n.evaluate(t))]]},"feature-state":[Bi,[Ji],(t,[e])=>es(e.evaluate(t),t.featureState||{})],properties:[Vi,[],t=>t.properties()],"geometry-type":[Ji,[],t=>t.geometryType()],id:[Bi,[],t=>t.id()],zoom:[Wi,[],t=>t.globals.zoom],pitch:[Wi,[],t=>t.globals.pitch||0],"distance-from-center":[Wi,[],t=>t.distanceFromCenter()],"heatmap-density":[Wi,[],t=>t.globals.heatmapDensity||0],"line-progress":[Wi,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Wi,[],t=>t.globals.skyRadialProgress||0],accumulated:[Bi,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Wi,ns(Wi),(t,e)=>{let n=0;for(const i of e)n+=i.evaluate(t);return n}],"*":[Wi,ns(Wi),(t,e)=>{let n=1;for(const i of e)n*=i.evaluate(t);return n}],"-":{type:Wi,overloads:[[[Wi,Wi],(t,[e,n])=>e.evaluate(t)-n.evaluate(t)],[[Wi],(t,[e])=>-e.evaluate(t)]]},"/":[Wi,[Wi,Wi],(t,[e,n])=>e.evaluate(t)/n.evaluate(t)],"%":[Wi,[Wi,Wi],(t,[e,n])=>e.evaluate(t)%n.evaluate(t)],ln2:[Wi,[],()=>Math.LN2],pi:[Wi,[],()=>Math.PI],e:[Wi,[],()=>Math.E],"^":[Wi,[Wi,Wi],(t,[e,n])=>Math.pow(e.evaluate(t),n.evaluate(t))],sqrt:[Wi,[Wi],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Wi,[Wi],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Wi,[Wi],(t,[e])=>Math.log(e.evaluate(t))],log2:[Wi,[Wi],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Wi,[Wi],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Wi,[Wi],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Wi,[Wi],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Wi,[Wi],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Wi,[Wi],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Wi,[Wi],(t,[e])=>Math.atan(e.evaluate(t))],min:[Wi,ns(Wi),(t,e)=>Math.min(...e.map(e=>e.evaluate(t)))],max:[Wi,ns(Wi),(t,e)=>Math.max(...e.map(e=>e.evaluate(t)))],abs:[Wi,[Wi],(t,[e])=>Math.abs(e.evaluate(t))],round:[Wi,[Wi],(t,[e])=>{const n=e.evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[Wi,[Wi],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Wi,[Wi],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Hi,[Ji,Bi],(t,[e,n])=>t.properties()[e.value]===n.value],"filter-id-==":[Hi,[Bi],(t,[e])=>t.id()===e.value],"filter-type-==":[Hi,[Ji],(t,[e])=>t.geometryType()===e.value],"filter-<":[Hi,[Ji,Bi],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i<r}],"filter-id-<":[Hi,[Bi],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n<i}],"filter->":[Hi,[Ji,Bi],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i>r}],"filter-id->":[Hi,[Bi],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n>i}],"filter-<=":[Hi,[Ji,Bi],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[Hi,[Bi],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n<=i}],"filter->=":[Hi,[Ji,Bi],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[Hi,[Bi],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n>=i}],"filter-has":[Hi,[Bi],(t,[e])=>e.value in t.properties()],"filter-has-id":[Hi,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Hi,[Ki(Ji)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Hi,[Ki(Bi)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Hi,[Ji,Ki(Bi)],(t,[e,n])=>n.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Hi,[Ji,Ki(Bi)],(t,[e,n])=>function(t,e,n,i){for(;n<=i;){const r=n+i>>1;if(e[r]===t)return!0;e[r]>t?i=r-1:n=r+1}return!1}(t.properties()[e.value],n.value,0,n.value.length-1)],all:{type:Hi,overloads:[[[Hi,Hi],(t,[e,n])=>e.evaluate(t)&&n.evaluate(t)],[ns(Hi),(t,e)=>{for(const n of e)if(!n.evaluate(t))return!1;return!0}]]},any:{type:Hi,overloads:[[[Hi,Hi],(t,[e,n])=>e.evaluate(t)||n.evaluate(t)],[ns(Hi),(t,e)=>{for(const n of e)if(n.evaluate(t))return!0;return!1}]]},"!":[Hi,[Hi],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Hi,[Ji],(t,[e])=>{const n=t.globals&&t.globals.isSupportedScript;return!n||n(e.evaluate(t))}],upcase:[Ji,[Ji],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Ji,[Ji],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Ji,ns(Bi),(t,e)=>e.map(e=>pr(e.evaluate(t))).join("")],"resolved-locale":[Ji,[Zi],(t,[e])=>e.evaluate(t).resolvedLocale()]});var is=Ko;function rs(t){return{result:"success",value:t}}function os(t){return{result:"error",value:t}}function ss(t){return!!t.expression&&t.expression.interpolated}function as(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function ls(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function us(t){return t}function cs(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function hs(t,e,n,i,r){return cs(typeof n===r?i[n]:void 0,t.default,e.default)}function ds(t,e,n){if("number"!==as(n))return cs(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[i-1][0])return t.stops[i-1][1];const r=eo(t.stops.map(t=>t[0]),n);return t.stops[r][1]}function fs(t,e,n){const i=void 0!==t.base?t.base:1;if("number"!==as(n))return cs(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];const o=eo(t.stops.map(t=>t[0]),n),s=function(t,e,n,i){const r=i-n,o=t-n;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(n,i,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1];let u=ao[e.type]||us;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=xo[t.colorSpace];u=(t,n)=>e.reverse(e.interpolate(e.forward(t),e.forward(n),s))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==n)return u(e,n,s)}}:u(a,l,s)}function ps(t,e,n){return"color"===e.type?n=sr.parse(n):"formatted"===e.type?n=ur.fromString(n.toString()):"resolvedImage"===e.type?n=cr.fromString(n.toString()):as(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),cs(n,t.default,e.default)}class ms{constructor(t,e){this.expression=t,this.U={},this.W=new Tr,this.J=e?function(t){return"color"===t.type&&(ls(t.default)||Array.isArray(t.default))?new sr(0,0,0,0):"color"===t.type?sr.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this.H=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,n,i,r,o,s,a){return this.W.globals=t,this.W.feature=e,this.W.featureState=n,this.W.canonical=i||null,this.W.availableImages=r||null,this.W.formattedSection=o,this.W.featureTileCoord=s||null,this.W.featureDistanceData=a||null,this.expression.evaluate(this.W)}evaluate(t,e,n,i,r,o,s,a){this.W.globals=t,this.W.feature=e||null,this.W.featureState=n||null,this.W.canonical=i||null,this.W.availableImages=r||null,this.W.formattedSection=o||null,this.W.featureTileCoord=s||null,this.W.featureDistanceData=a||null;try{const t=this.expression.evaluate(this.W);if(null==t||"number"==typeof t&&t!=t)return this.J;if(this.H&&!(t in this.H))throw new gr(`Expected value to be one of ${Object.keys(this.H).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this.U[t.message]||(this.U[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this.J}}}function ys(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in is}function gs(t,e){const n=new to(is,[],e?function(t){const e={color:Gi,string:Ji,number:Wi,enum:Ji,boolean:Hi,formatted:Yi,resolvedImage:Xi};return"array"===t.type?Ki(e[t.value]||Bi,t.length):e[t.type]}(e):void 0),i=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?rs(new ms(i,e)):os(n.errors)}class bs{constructor(t,e){this.kind=t,this.G=e,this.isStateDependent="constant"!==t&&!Zr(e.expression)}evaluateWithoutErrorHandling(t,e,n,i,r,o){return this.G.evaluateWithoutErrorHandling(t,e,n,i,r,o)}evaluate(t,e,n,i,r,o){return this.G.evaluate(t,e,n,i,r,o)}}class vs{constructor(t,e,n,i){this.kind=t,this.zoomStops=n,this.G=e,this.isStateDependent="camera"!==t&&!Zr(e.expression),this.interpolationType=i}evaluateWithoutErrorHandling(t,e,n,i,r,o){return this.G.evaluateWithoutErrorHandling(t,e,n,i,r,o)}evaluate(t,e,n,i,r,o){return this.G.evaluate(t,e,n,i,r,o)}interpolationFactor(t,e,n){return this.interpolationType?jo.interpolationFactor(this.interpolationType,t,e,n):0}}function ws(t,e){if("error"===(t=gs(t,e)).result)return t;const n=t.value.expression,i=Br(n);if(!i&&!function(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}(e))return os([new Di("","data expressions not supported")]);const r=Yr(n,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return os([new Di("","zoom expressions not supported")]);const o=function t(e){let n=null;if(e instanceof zo)n=t(e.result);else if(e instanceof Fo){for(const i of e.args)if(n=t(i),n)break}else(e instanceof io||e instanceof jo)&&e.input instanceof Sr&&"zoom"===e.input.name&&(n=e);return n instanceof Di||e.eachChild(e=>{const i=t(e);i instanceof Di?n=i:!n&&i?n=new Di("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):n&&i&&n!==i&&(n=new Di("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),n}(n);if(!o&&!r)return os([new Di("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(o instanceof Di)return os([o]);if(o instanceof jo&&!ss(e))return os([new Di("",\'"interpolate" expressions cannot be used with this property\')]);if(!o)return rs(new bs(i?"constant":"source",t.value));const s=o instanceof jo?o.interpolation:void 0;return rs(new vs(i?"camera":"composite",t.value,o.labels,s))}class xs{constructor(t,e){this.V=t,this.B=e,Ei(this,function t(e,n){const i="color"===n.type,r=e.stops&&"object"==typeof e.stops[0][0],o=r||!(r||void 0!==e.property),s=e.type||(ss(n)?"exponential":"interval");if(i&&((e=Ei({},e)).stops&&(e.stops=e.stops.map(t=>[t[0],sr.parse(t[1])])),e.default=sr.parse(e.default?e.default:n.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!xo[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);let a,l,u;if("exponential"===s)a=fs;else if("interval"===s)a=ds;else if("categorical"===s){a=hs,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=ps}if(r){const i={},r=[];for(let t=0;t<e.stops.length;t++){const n=e.stops[t],o=n[0].zoom;void 0===i[o]&&(i[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},r.push(o)),i[o].stops.push([n[0].value,n[1]])}const o=[];for(const e of r)o.push([i[e].zoom,t(i[e],n)]);const s={name:"linear"};return{kind:"composite",interpolationType:s,interpolationFactor:jo.interpolationFactor.bind(void 0,s),zoomStops:o.map(t=>t[0]),evaluate:({zoom:t},i)=>fs({stops:o,base:e.base},n,t).evaluate(t,i)}}if(o){const t="exponential"===s?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:t,interpolationFactor:jo.interpolationFactor.bind(void 0,t),zoomStops:e.stops.map(t=>t[0]),evaluate:({zoom:t})=>a(e,n,t,l,u)}}return{kind:"source",evaluate(t,i){const r=i&&i.properties?i.properties[e.property]:void 0;return void 0===r?cs(e.default,n.default):a(e,n,r,l,u)}}}(this.V,this.B))}static deserialize(t){return new xs(t.V,t.B)}static serialize(t){return{V:t.V,B:t.B}}}function ks(t){if(Array.isArray(t))return t.map(ks);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const n in t)e[n]=ks(t[n]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function Ms(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(!Ms(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function js(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(js(t[e]))return!0;return!1}const As=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Fs(t,e){return t<e?-1:t>e?1:0}function Ts(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?zs(t[1],t[2],"=="):"!="===e?Ps(zs(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?zs(t[1],t[2],e):"any"===e?(n=t.slice(1),["any"].concat(n.map(Ts))):"all"===e?["all"].concat(t.slice(1).map(Ts)):"none"===e?["all"].concat(t.slice(1).map(Ts).map(Ps)):"in"===e?Ss(t[1],t.slice(2)):"!in"===e?Ps(Ss(t[1],t.slice(2))):"has"===e?_s(t[1]):"!has"===e?Ps(_s(t[1])):"within"!==e||t;var n}function zs(t,e,n){switch(t){case"$type":return["filter-type-"+n,e];case"$id":return["filter-id-"+n,e];default:return["filter-"+n,t,e]}}function Ss(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(Fs)]]:["filter-in-small",t,["literal",e]]}}function _s(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ps(t){return["!",t]}Ii((function(t,e){var n=function(){var t=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},e=[1,12],n=[1,13],i=[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,n,i,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.$.Z=this.Y.first_line;break;case 2:this.$=new Number(t),this.$.Z=this.Y.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.Z=this.Y.first_line;break;case 5:this.$=new Boolean(!1),this.$.Z=this.Y.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"Z",{value:this.Y.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"Z",{value:this.Y.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.$,"Z",{value:this.Y.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:n,7:3,8:i,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:n,7:3,8:i,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:n,7:3,8:i,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:n,7:3,8:i,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,n=[0],i=[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=n[n.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:n.push(b),i.push(d.yytext),r.push(d.yylloc),n.push(w[1]),b=null,l=d.yyleng,s=d.yytext,a=d.yylineno,m=d.yylloc;break;case 2:if(A.$=i[i.length-(M=this.productions_[w[1]][1])],A.Y={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.Y.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],i,r].concat(h))))return x;M&&(n=n.slice(0,-1*M*2),i=i.slice(0,-1*M),r=r.slice(0,-1*M)),n.push(this.productions_[w[1]][0]),i.push(A.$),r.push(A.Y),n.push(o[n[n.length-2]][n[n.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.X=t,this.K=this.tt=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.X[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.X=this.X.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\\r\\n?|\\n)/g);this.X=t+this.X,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[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.K=!0,this},reject:function(){return this.options.backtrack_lexer?(this.tt=!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.X.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 n,i,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,K:this.K,X:this.X,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\\r\\n?|\\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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.K=!1,this.tt=!1,this.X=this.X.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this.X&&(this.done=!1),n)return n;if(this.tt){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this.X||(this.done=!0),this.K||(this.yytext="",this.match="");for(var r=this.et(),o=0;o<r.length;o++)if((n=this.X.match(this.rules[r[o]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[o])))return t;if(this.tt){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this.X?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]},et: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,n,i){switch(n){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=n,e.Parser=n.Parser,e.parse=function(){return n.parse.apply(n,arguments)}}));const Is={StyleExpression:ms,isExpression:ys,isExpressionFilter:Ms,createExpression:gs,createPropertyExpression:ws,normalizePropertyExpression:function(t,e){if(ls(t))return new xs(t,e);if(ys(t)){const n=ws(t,e);if("error"===n.result)throw new Error(n.value.map(t=>`${t.key}: ${t.message}`).join(", "));return n.value}{let n=t;return"string"==typeof t&&"color"===e.type&&(n=sr.parse(t)),{kind:"constant",evaluate:()=>n}}},ZoomConstantExpression:bs,ZoomDependentExpression:vs,StylePropertyFunction:xs},{isExpressionFilter:Os,isExpression:qs,createExpression:Cs}=Is,Rs={};function Es(t){if(!0===t)return function(){return!0};if(t&&t.condition){if("any"===t.type){const e=t.condition,n=[];for(let t=0;t<e.length;t++)n.push(Es(e[t]));return(t,e)=>{for(let i=0;i<n.length;i++)if(n[i](t,e))return!0;return!1}}const e=Es(t.condition);if(ni(t.layer))return e;const n=e=>e.layer===t.layer;return(t,i)=>n(t)&&e(t,i)}if(Os(t)){let e=function(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Ms(t)||(t=Ts(t));const n=t;let i=!0;try{i=function(t){if(!js(t))return t;let e=ks(t);return function t(e){let n=!1;const i=[];if("case"===e[0]){for(let t=1;t<e.length-1;t+=2)n=n||js(e[t]),i.push(e[t+1]);i.push(e[e.length-1])}else if("match"===e[0]){n=n||js(e[1]);for(let t=2;t<e.length-1;t+=2)i.push(e[t+1]);i.push(e[e.length-1])}else if("step"===e[0]){n=n||js(e[1]);for(let t=1;t<e.length-1;t+=2)i.push(e[t+1])}n&&(e.length=0,e.push("any",...i));for(let n=1;n<e.length;n++)t(e[n])}(e),e=function t(e){if(!Array.isArray(e))return e;const n=function(t){if(As.has(t[0]))for(let e=1;e<t.length;e++)if(js(t[e]))return!0;return t}(e);return!0===n?n:n.map(e=>t(e))}(e),e}(n)}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(n,null,2)}\\n `)}const r=_i["filter_"+e],o=gs(i,r);let s=null;if("error"===o.result)throw new Error(o.value.map(t=>`${t.key}: ${t.message}`).join(", "));s=(t,e,n)=>o.value.evaluate(t,e,{},n);let a=null,l=null;if(i!==n){const t=gs(n,r);if("error"===t.result)throw new Error(t.value.map(t=>`${t.key}: ${t.message}`).join(", "));a=(e,n,i,r,o)=>t.value.evaluate(e,n,{},i,void 0,void 0,r,o),l=!Br(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 n=1;n<e.length;n++)if(t(e[n]))return!0;return!1}(i),needFeature:!!l}}(t);return e=e&&e.filter,(t,n)=>(Rs.zoom=n,e&&e(Rs,t))}return qe(t)}const Ns={type:"number","property-type":"data-driven",expression:{parameters:["zoom","feature"]}};function Ds(t,e){Ns.type=e||"number";const n=Cs(t,Ns);if("success"!==n.result)throw new Error(`Invalid maplibre spec expression: ${JSON.stringify(t)} (${n.value})`);return n.value}function Ls(t){return qs(t)}const Us={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};function $s(t){return Us[t]}const Ws={markerPlacement:1,markerFile:1,mergeOnProperty:1,markerTextFit:1,markerType:1,markerHorizontalAlignment:1,markerVerticalAlignment:1,markerRotationAlignment:1,markerPitchAlignment:1,markerFillPatternFile:1,markerLinePatternFile:1,textName:1,textPlacement:1,textFaceName:1,textStyle:1,textHorizontalAlignment:1,textVerticalAlignment:1,textRotationAlignment:1,textPitchAlignment:1,lineJoin:1,lineCap:1,linePatternFile:1,polygonPatternFile:1},Js={lineDasharray:1,markerLineDasharray:1,uvScale:1,uvOffset:1};function Hs(t){return Ws[t]?"string":$s(t)?"number":Js[t]?"array":"color"}var Gs=Object.freeze({__proto__:null,compileStyle:function(t=[]){return function t(e){if(!Array.isArray(e))return t([e]);const n=[];for(let t=0;t<e.length;t++){let i;i=!0===e[t].filter?function(){return!0}:Es(e[t].filter),n.push(ei({},e[t],{filter:i}))}return n}(t=t.map(t=>{const e=ei({},t);return e.filter&&e.filter.value&&(e.filter=e.filter.value),e}))},compileFilter:Es,createExpression:Ds,isExpression:Ls,isInterpolated:$s,getExpressionType:Hs});const Vs=[],Bs={},Zs={},Ys={},Xs=[];class Ks{static isAtlasLoaded(t,e={}){const{iconAtlas:n}=e;return!!(!t||n&&n.positions[t])}static genFnTypes(t){const e={};for(const n in t)if(Ls(t[n])){const i=(n+"_Fn_0").trim(),r=(n+"Fn").trim(),o=Hs(n);e[i]=Ds(t[n],o),e[r]=(t,n)=>{let r;Bs.zoom=t,Zs.properties=n;try{r=e[i].evaluateWithoutErrorHandling(Bs,Zs,Ys,null,Xs)}catch(t){return null}return r}}else if(ci(t[n])){const i=(n+"_Fn_0").trim(),r=(n+"Fn").trim();$s(n)?(e[i]=p(t[n]),e[r]=(t,n)=>{const r=e[i](t,n);return ci(r)?p(r)(t,n):r}):(e[i]=m(t[n]),e[r]=(t,n)=>{const r=e[i](t,n);return ci(r)?m(r)(t,n):r})}return e}constructor(t,e,n){this.options=n,this.symbolDef=e,this.symbol=y(e,()=>[n.zoom]),this.styledVectors=[],this.properties={},this.nt=n.fnTypes||Ks.genFnTypes(this.symbolDef),ci(this.symbolDef.visible)&&(this.it=p(this.symbolDef.visible)),n.atlas&&(this.iconAtlas=n.atlas.iconAtlas,this.glyphAtlas=n.atlas.glyphAtlas),this.features=this.rt(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,n,i){this.needAltitudeAttribute()?(t.aPosition.push(e,n),t.aAltitude.push(i)):(Ti(Vs,e,n,i),t.aPosition.push(Vs[0],Vs[1],Vs[2]))}rt(t){if(!t.length)return t;const e="__fea_idx".trim();let n,i=0,r=t[i];for(;!r.geometry;)i++,r=t[i];if(Array.isArray(r.geometry)&&r.properties){let e=r.geometry[0];for(;Array.isArray(e);)e=e[0];e instanceof Nt&&(n=t)}if(!n)if(n=[],Array.isArray(r.geometry))for(let e=0;e<t.length;e++){const i=ei({},t[e]);n.push(ti(i))}else for(let i=0;i<t.length;i++){const r=t[i],o=Cn(r);for(let t=0;t<o.length;t++){const i=o[t];i[e]=r[e],n.push(i)}}if(this.maxPosZ=0,!this.options.forceAltitudeAttribute){const t="line"===this.symbolDef.textPlacement;let e=0,i=!1;const{textPitchAlignmentFn:r}=this.nt;!r&&t&&"map"===this.symbolDef.textPitchAlignment&&(i=!0);for(let o=0;o<n.length;o++){const s=ta(n[o]&&n[o].geometry);if(s>e&&(e=s),t&&!i&&r&&n[o].properties){const t=r(null,n[o].properties);"map"===t&&(i=t)}}this.hasMapPitchAlign=i,this.maxPosZ=e}const o=this.options.order;if(o){const t=[];for(let e=0;e<o.length;e++)o[e]&&t.push(Es(o[e]));n=n.sort((e,n)=>{const i=t.length;let r=-1,o=-1;for(let s=0;s<i&&(t[s](e)&&(r=s),t[s](n)&&(o=s),!(r>=0&&r<i&&o>=0&&o<i));s++);return r-o})}return n}load(t=1){const e="__fea_idx".trim(),n="_debug_info".trim(),i=this.nt,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},u=y(this.symbolDef,()=>[l.zoom]);let c=0,h=o.length;const d=this.options.debugIndex;try{for(;c<h;c++){const t=o[c];if(!t||!t.geometry)continue;if(void 0!==d&&t[n].index!==d)continue;t.properties||(t.properties={}),t.properties.$layer=t.layer,t.properties.$type=t.type;const h=this.createStyledVector(t,u,i,l,s,a);h&&h.feature.geometry&&(h.featureIdx=void 0===t[e]?c:t[e],this.count++,r.push(h))}}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((n,i)=>{this.fetchAtlas(t,e,(t,e)=>{if(t)i(t);else{if(e){const{icons:t,glyphs:n}=e;if(t&&Object.keys(t).length){for(const e in t){const n=t[e],{width:i,height:r,data:o}=n.data;n.data=new Hn({width:i,height:r},o)}this.iconAtlas=new Vn(t)}if(n&&Object.keys(n).length){for(const t in n){const e=n[t];for(const t in e){const n=e[t],{width:i,height:r,data:o}=n.bitmap;n.bitmap=new Jn({width:i,height:r},o)}}this.glyphAtlas=new Yn(n)}}n({glyphAtlas:this.glyphAtlas,iconAtlas:this.iconAtlas})}})})}fetchAtlas(t,e,n){Object.keys(t).length>0||Object.keys(e).length>0?this.options.requestor(t,e,n):n()}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 n=e.buffers;delete e.buffers;const i={data:e,buffers:n};if(this.iconAtlas){const t=i.data.iconAtlas=Qs(this.iconAtlas);if(t.glyphMap)for(const e in t.glyphMap)n.push(t.glyphMap[e].data.data.buffer);n.push(i.data.iconAtlas.image.data.buffer)}return this.glyphAtlas&&(i.data.glyphAtlas=Qs(this.glyphAtlas),n.push(i.data.glyphAtlas.image.data.buffer)),i}createStyledVector(t,e,n,i){return new Fi(t,e,n,i)}createDataPack(t,e){if(!t||!t.length)return null;this.maxIndex=0,this.maxPos=0,this.maxAltitude=0;const n=this.data={};let i=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++)n[r[t].name]=[];let s=[],a=0;const l=[];let u=0,c=!1,h=!0;const d=new Set;for(let i=0,r=t.length;i<r;i++){if(!t[i].feature.geometry)continue;const r=Array.isArray(t[i])?t[i][0].feature.id:t[i].feature.id;h&&(void 0!==Zs.id?d&&(d.has(Zs.id)?h=!1:d.add(Zs.id)):h=!1),ii(r)&&(Math.abs(r)>u&&(u=Math.abs(r)),r<0&&(c=!0));const f=this.data.aPosition.length;if(Array.isArray(t[i]))for(let n=0;n<t[i].length;n++)this.ot(t[i][n],e);else this.ot(t[i],e);const p=(n.aPosition.length-f)/o;for(let e=0;e<p;e++)s.push(t[i].featureIdx),ii(r)&&l.push(r);a=Math.max(a,t[i].featureIdx)}if(this.hasElements()&&!i.length)return null;s=new(Qn(a))(s),r[0].type=this.options.positionType?this.options.positionType:Kn(this.maxPos);const f=this.options.center;if(f&&(f[0]||f[1])){const t=n.aPosition;for(let e=0;e<t.length;e+=o)t[e]-=f[0],t[e+1]-=f[1]}const p=function(t,e){const n={};for(let i=0;i<t.length;i++){const r=t[i],o=r.type,s=r.name;n[s]=o===Array?e[s]:new o(e[s])}return n}(r,n);p.aPickingId=s;const m=[];for(const t in p)m.push(p[t].buffer);i=new(Xn(this.maxIndex))(i),m.push(i.buffer);const y={data:p,isIdUnique:h,is2D:0===this.maxPosZ,indices:this.hasElements()?i:null,positionSize:o,buffers:m,symbolIndex:this.symbolDef.index||{index:0}};if(this.st&&(y.markerPlacement=this.st),this.lt&&(y.textPlacement=this.lt),l.length){const t=c?Kn(u):Qn(u);y.featureIds=new t(l),m.push(y.featureIds.buffer)}else y.featureIds=[];return y.pickingIdIndiceMap=Ai(s,y.indices),y}ot(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:n,altitudeScale:i}=this.options;let r=wi(t,e,n);return i&&(r*=i),this.maxAltitude=Math.max(this.maxAltitude,Math.abs(r)),r}getIconAtlasMaxValue(){const t=this.iconAtlas.positions;let e=0;for(const n in t)if(li(t,n)){const{tl:i,displaySize:r}=t[n],o=Math.max(i[0],i[1],r[0]-1,r[1]-1);o>e&&(e=o)}return e}}function Qs(t){let e=t.positions,n=t.image&&t.image.format||"alpha";if(t instanceof Vn){e={};for(const n in t.positions){const i=t.positions[n];e[n]={paddedRect:i.paddedRect,pixelRatio:i.pixelRatio,tl:i.tl,br:i.br,displaySize:i.displaySize}}n="rgba"}const i=t.image;return{image:{width:i.width,height:i.height,data:i.data,format:n},glyphMap:t.glyphMap,positions:e}}function ta(t){if(!t)return 0;let e=0;if(Array.isArray(t))for(let n=0;n<t.length;n++)if(Array.isArray(t[n])){const i=ta(t[n]);i>e&&(e=i)}else{const i=Math.abs(t[n].z||0);i>e&&(e=i)}else{const n=Math.abs(t.z||0);n>e&&(e=n)}return e}function ea(t,e,n,i){const r="__fn_textSize".trim();let o=t.textSize;if(ni(e.textSize))return[16,16];t[r]&&(o=t[r]);const s=[];return s[0]=si(o)?o(i,n):o,s[1]=s[0],s}function na(t){const e=t.stops;let n=-1/0;for(let t=0;t<e.length;t++){let i=e[t][1];ri(e[t][1])&&(i=na(e[t][1])),i>n&&(n=i)}return n}function ia(t,e,n){return[e||"normal",n||"normal","24px",t||"monospace"].join(" ")}const ra=/\\{[\\w-]+(?:\\|[\\w-]+)*\\}/g;function oa(t,e){return oi(t)?t.replace(ra,(function(t){if(!e)return"";if((t=t.substring(1,t.length-1)).indexOf("|")>0){const n=t.split("|");for(let t=0;t<n.length;t++){const i=e[n[t]];if(!ni(i))return i}return""}const n=e[t];return ni(n)?"":Array.isArray(n)?n.join():n})):t}var sa=Object.freeze({__proto__:null,getSDFFont:ia,resolveText:oa,resolveVarNames:function(t){return t.match(ra)},resolveExpVarNames:function t(e,n){if(2!==n.length||"get"!==n[0])for(let i=0;i<n.length;i++)2===n[i].length&&"get"===n[i][0]?e.push(n[i][1]):Array.isArray(n[i])&&t(e,n[i]);else e.push(n[1])}});const aa=t=>t>=11904&&t<=12031,la=t=>t>=12032&&t<=12255,ua=t=>t>=12272&&t<=12287,ca=t=>t>=12288&&t<=12351,ha=t=>t>=12352&&t<=12447,da=t=>t>=12448&&t<=12543,fa=t=>t>=12544&&t<=12591,pa=t=>t>=12704&&t<=12735,ma=t=>t>=12736&&t<=12783,ya=t=>t>=12784&&t<=12799,ga=t=>t>=12800&&t<=13055,ba=t=>t>=13056&&t<=13311,va=t=>t>=13312&&t<=19903,wa=t=>t>=19968&&t<=40959,xa=t=>t>=40960&&t<=42127,ka=t=>t>=42128&&t<=42191,Ma=t=>t>=63744&&t<=64255,ja=t=>t>=64336&&t<=65023,Aa=t=>t>=65040&&t<=65055,Fa=t=>t>=65072&&t<=65103,Ta=t=>t>=65104&&t<=65135,za=t=>t>=65136&&t<=65279,Sa=t=>t>=65280&&t<=65519;function _a(t){return!((t=>t>=1536&&t<=1791)(t)||(t=>t>=1872&&t<=1919)(t)||(t=>t>=2208&&t<=2303)(t)||ja(t)||za(t))}function Pa(t){return!!(746===t||747===t||!(t<4352)&&(pa(t)||fa(t)||Fa(t)&&!(t>=65097&&t<=65103)||Ma(t)||ba(t)||aa(t)||ma(t)||!(!ca(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||va(t)||wa(t)||ga(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)||ha(t)||ua(t)||(t=>t>=12688&&t<=12703)(t)||la(t)||ya(t)||da(t)&&12540!==t||!(!Sa(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)||!(!Ta(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(t=>t>=5120&&t<=5759)(t)||(t=>t>=6320&&t<=6399)(t)||Aa(t)||(t=>t>=19904&&t<=19967)(t)||xa(t)||ka(t)))}function Ia(t){return!(Pa(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)||ca(t)||da(t)||(t=>t>=57344&&t<=63743)(t)||Fa(t)||Ta(t)||Sa(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Oa(t){return t>=1424&&t<=2303||ja(t)||za(t)}const qa=[[9,9],[32,32],[5760,5760],[8192,8198],[8200,8202],[8287,12288],[6158,6158],[8203,8205]];function Ca(t){for(const e of qa)if(t>=e[0]&&t<=e[1])return!0;return!1}const Ra={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\\\":"\","]":"﹈","^":"^",ut:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Ea(t,e,n,i,r,o,s,a,l,u){let c=t.trim();2===u&&(c=function(t){let e="";for(let n=0;n<t.length;n++){const i=t.charCodeAt(n+1)||null,r=t.charCodeAt(n-1)||null;e+=i&&Ia(i)&&!Ra[t[n+1]]||r&&Ia(r)&&!Ra[t[n-1]]||!Ra[t[n]]?t[n]:Ra[t[n]]}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 n=[];let i=0;for(let r=0;r<e.length;r++){const o=e[r];n.push(t.substring(i,o)),i=o}return i<t.length&&n.push(t.substring(i,t.length)),n}(c,function(t,e,n,i){if(!n)return[];if(!t)return[];const r=[],o=function(t,e,n,i){let r=0;for(let n=0;n<t.length;n++){const o=i[t.charCodeAt(n)];o&&(r+=o.metrics.advance+e)}return r/Math.max(1,Math.ceil(r/n))}(t,e,n,i);let s=0;for(let n=0;n<t.length;n++){const l=t.charCodeAt(n),u=i[l];u&&!Na[l]&&(s+=u.metrics.advance+e),n<t.length-1&&(Da[l]||!((a=l)<11904)&&(pa(a)||fa(a)||Fa(a)||Ma(a)||ba(a)||aa(a)||ma(a)||ca(a)||va(a)||wa(a)||ga(a)||Sa(a)||ha(a)||ua(a)||la(a)||ya(a)||da(a)||Aa(a)||ka(a)||xa(a)))&&r.push($a(n+1,s,o,r,Ua(l,t.charCodeAt(n+1)),!1))}var a;return function t(e){return e?t(e.priorBreak).concat(e.index):[]}($a(t.length,s,o,r,0,!0))}(c,s,n,e)),function(t,e,n,i,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<n.length;t++){let r=n[t];if(r=r.trim(),!r.length){c-=i;continue}const o=d.length;for(let t=0;t<r.length;t++){const n=r.charCodeAt(t),i=e[n];i&&(Pa(n)&&1!==s?(32!==n&&d.push({glyph:n,x:u,y:0,vertical:!0}),u+=l+a):(32!==n&&d.push({glyph:n,x:u,y:c,vertical:!1}),u+=i.metrics.advance+a))}d.length!==o&&(h=Math.max(u-a,h),Ja(d,e,o,d.length-1,f)),u=0,c-=i}const{horizontalAlign:p,verticalAlign:m}=Wa(r);!function(t,e,n,i,r,o,s){const a=(e-n)*r,l=-(-i*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,i,n.length);const y=n.length*i;t.top+=-m*y,t.bottom=t.top+y,t.left+=-p*h,t.right=t.left+h}(d,e,f,i,r,o,u,s,l),!!h.length&&d}const Na={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Da={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 La(t,e,n,i){const r=Math.pow(t-e,2);return i?t<e?r/2:2*r:r+Math.abs(n)*n}function Ua(t,e){let n=0;return 10===t&&(n-=1e4),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function $a(t,e,n,i,r,o){let s=null,a=La(e,n,r,o);for(let t=0;t<i.length;t++){const l=i[t],u=La(e-l.x,n,r,o)+l.badness;u<=a&&(s=l,a=u)}return{index:t,x:e,priorBreak:s,badness:a}}function Wa(t){let e=.5,n=.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":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:e,verticalAlign:n}}function Ja(t,e,n,i,r){if(!r)return;const o=e[t[i].glyph];if(o){const e=(t[i].x+o.metrics.advance)*r;if(!e)return;for(let r=n;r<=i;r++)t[r].x-=e}}function Ha(t){if(!function(t){for(const e of t)if(Oa(e.charCodeAt(0)))return!0;return!1}(t))return t;const e=[],n=[],i=[];let r=0,o=0,s=1,a=1;for(const l of t){const t=l.codePointAt(0);Ca(t)?(i.push(l),r++):(s=Oa(t)?-1:1,a!==s?(o=r,n.length&&(a>0&&n.reverse(),e.push(...n)),i.length&&(e.splice(o,0,...i),i.length=0),a=s,n.length=0):i.length&&(n.push(...i),i.length=0),n.push(l),r++)}return i.length&&n.push(...i),n.length&&(a>0&&n.reverse(),e.push(...n)),e.reverse().join("")}const Ga=/\\{ *([\\w_]+) *\\}/g;class Va{constructor(t,e,n,i,r){this.feature=t,this.symbolDef=e,this.symbol=n,this.options=r,this.ct=this.ht.bind(this),this.nt=i}ht(t,e){return this.feature.properties[e]||"default"}getShape(t,e){if(this.dt)return this.dt;const{textHorizontalAlignmentFn:n,textVerticalAlignmentFn:i,markerHorizontalAlignmentFn:r,markerVerticalAlignmentFn:o,textWrapWidthFn:s}=this.nt;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=Ba(n?n(null,c):l.textHorizontalAlignment,i?i(null,c):l.textVerticalAlignment),y=1.2*h,g=function(t){for(let e=0;e<t.length;e++)if(!_a(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=Ea(r,p,w,y,m,"center",b,v,h,1),g&&f&&d&&(a.vertical=Ea(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=Ba(r?r(null,c):l.markerHorizontalAlignment,o?o(null,c):l.markerVerticalAlignment);a=function(t,e){const{horizontalAlign:n,verticalAlign:i}=Wa(e),r=-2048*n,o=-2048*i;return{image:t,top:o,bottom:o+2048,left:r,right:r+2048}}(t.positions[u.icon.url],e),this.size||(this.size=a.image.displaySize)}return this.dt=a,a}getIconAndGlyph(){if(this.iconGlyph)return this.iconGlyph;const{markerFileFn:t,markerTypeFn:e,markerPathFn:n,markerWidthFn:i,markerHeightFn:r,markerFillFn:o,markerFillPatternFileFn:s,markerFillOpacityFn:a,markerTextFitFn:l,markerTextFitPaddingFn:u,markerLineColorFn:c,markerLineWidthFn:h,markerLineOpacityFn:d,markerLineDasharrayFn:m,markerLinePatternFileFn:y,markerPathWidthFn:g,markerPathHeightFn:b,textNameFn:v,textFaceNameFn:w,textStyleFn:x,textWeightFn:k}=this.nt,{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,_=!ni(this.symbolDef.textName);let P;if(S){P=function(t,e,n,i,r,o){if(ni(e.markerWidth)&&ni(e.markerHeight))return null;const s="__fn_markerWidth".trim(),a="__fn_markerHeight".trim();let l=e.markerWidth||0,u=e.markerHeight||0;return ri(l)&&("identity"!==l.type?l=na(l):(l=t.markerWidth,t[s]&&(l=t[s](i,n)),ri(l)&&(l="identity"===l.type?r(i,n):na(l)))),ri(u)&&("identity"!==u.type?u=na(u):(u=t.markerHeight,t[a]&&(u=t[a](i,n)),ri(u)&&(u="identity"===u.type?o(i,n):na(u)))),[l,u]}(A,this.symbolDef,F,M,i,r)||[0,0];let t=A.markerTextFit;if(l&&(t=l(M,F)),t&&A.text&&"none"!==t){const e=A.text.textSize;let n=A.text.textName;f(n)&&(n=p(n)(M,F));const i=oa(n,F);if(i){const n="__fn_textSize".trim(),r="__fn_textSize_0".trim();f(e)&&!A.text[n]&&(A.text[r]=p(e),A.text[n]=(t,e)=>{const n=A.text[r](t,e);return f(n)?p(n)(t,e):n});const o=ea(A.text,A.text,F,M);if("width"!==t&&"both"!==t||(P[0]=o[0]*i.length),"height"!==t&&"both"!==t||(P[1]=o[1]),o[0]&&o[1]){let t=A.markerTextFitPadding||[0,0,0,0];u&&(t=u(M,F)),P[0]+=t[1]+t[3],P[1]+=t[0]+t[2]}}else P[0]=P[1]=-1}}if(_&&(P=ea(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=n?n(null,F):A.markerPath,e.markerPathWidth=g?g(null,F):A.markerPathWidth,e.markerPathHeight=b?b(null,F):A.markerPathHeight),i){const t=i(null,F);ni(t)||(e.markerWidth=t)}else A.markerWidth>=0&&(e.markerWidth=A.markerWidth);if(r){const t=r(null,F);ni(t)||(e.markerHeight=t)}else A.markerHeight>=0&&(e.markerHeight=A.markerHeight);if(o){const t=o(null,F);ni(t)||(e.markerFill=t)}else A.markerFill&&(e.markerFill=A.markerFill);if(s){const t=s(null,F);ni(t)||(e.markerFillPatternFile=t)}else A.markerFillPatternFile&&(e.markerFillPatternFile=A.markerFillPatternFile);if(a){const t=a(null,F);ni(t)||(e.markerFillOpacity=t)}else A.markerFillOpacity>=0&&(e.markerFillOpacity=A.markerFillOpacity);if(c){const t=c(null,F);ni(t)||(e.markerLineColor=t)}else A.markerLineColor&&(e.markerLineColor=A.markerLineColor);if(h){const t=h(null,F);ni(t)||(e.markerLineWidth=t)}else A.markerLineWidth>=0&&(e.markerLineWidth=A.markerLineWidth);if(d){const t=d(null,F);ni(t)||(e.markerLineOpacity=t)}else A.markerLineOpacity>=0&&(e.markerLineOpacity=A.markerLineOpacity);if(m){const t=m(null,F);ni(t)||(e.markerLineDasharray=t)}else A.markerLineDasharray&&(e.markerLineDasharray=A.markerLineDasharray);if(y){const t=y(null,F);ni(t)||(e.markerLinePatternFile=t)}else A.markerLinePatternFile&&(e.markerLinePatternFile=A.markerLinePatternFile);t="vector://"+JSON.stringify(e)}else t=T?T.replace(Ga,this.ct):A.markerPath?function(t,e,n){if(!t.markerPath)return null;let i=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);ii(t.markerOpacity)&&(i=t.markerOpacity),ii(t.opacity)&&(i*=t.opacity);const o={};if(r){for(const t in r.stroke)li(r.stroke,t)&&(ni(r.stroke[t])||(o[t]=r.stroke[t]));for(const t in r.fill)li(r.fill,t)&&(ni(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=oi(s[t])?{path:s[t]}:s[t],a=ei({},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"\'];i<1&&u.push(\'opacity="\'+i+\'"\'),t.markerPathWidth&&t.markerPathHeight&&u.push(\'viewBox="0 0 \'+t.markerPathWidth+" "+t.markerPathHeight+\'"\'),u.push(\'preserveAspectRatio="none"\'),e&&u.push(\'width="\'+e+\'"\'),n&&u.push(\'height="\'+n+\'"\'),u.push("><defs></defs>");for(let t=0;t<l.length;t++){let e="<path ";for(const n in l[t])li(l[t],n)&&(e+=" "+n+\'="\'+l[t][n]+\'"\');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=ia(w?w(null,F):A.textFaceName,x?x(null,F):A.textStyle,k?k(null,F):A.textWeight);let n=oa(t,F);n&&n.length&&(n=Ha(n),j.glyph={font:e,text:n})}}return this.iconGlyph=j,j}}function Ba(t,e){e&&"middle"!==e||(e="center"),t&&"middle"!==t||(t="center");let n="center"!==e?e:"";return n+="center"!==t?(n.length?"-":"")+t:"",n\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */}function Za(t,e,n,i,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 Nt(e,a.y+(e-a.x)/(h.x-a.x)*(h.y-a.y)).I(),a.z=s.z+(e-s.x)/(h.x-s.x)*(h.z-s.z),c=!0):h.x<e&&(s=h,h=new Nt(e,a.y+(e-a.x)/(h.x-a.x)*(h.y-a.y)).I(),h.z=a.z+(e-a.x)/(s.x-a.x)*(s.z-a.z),c=!0),a.y<n&&h.y<n||(a.y<n?(s=a,a=new Nt(a.x+(n-a.y)/(h.y-a.y)*(h.x-a.x),n).I(),a.z=s.z+(n-s.y)/(h.y-s.y)*(h.z-s.z),c=!0):h.y<n&&(s=h,h=new Nt(a.x+(n-a.y)/(h.y-a.y)*(h.x-a.x),n).I(),h.z=a.z+(n-a.y)/(s.y-a.y)*(s.z-a.z),c=!0),a.x>=i&&h.x>=i||(a.x>=i?(s=a,a=new Nt(i,a.y+(i-a.x)/(h.x-a.x)*(h.y-a.y)).I(),a.z=s.z+(i-s.x)/(h.x-s.x)*(h.z-s.z),c=!0):h.x>=i&&(s=h,h=new Nt(i,a.y+(i-a.x)/(h.x-a.x)*(h.y-a.y)).I(),h.z=a.z+(i-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 Nt(a.x+(r-a.y)/(h.y-a.y)*(h.x-a.x),r).I(),a.z=s.z+(r-s.y)/(h.y-s.y)*(h.z-s.z),c=!0):h.y>=r&&(s=h,h=new Nt(a.x+(r-a.y)/(h.y-a.y)*(h.x-a.x),r).I(),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 Ya extends Nt{constructor(t,e,n,i){super(t,e),this.angle=n,void 0!==i&&(this.segment=i)}clone(){return new Ya(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 Xa(t,e,n,i,r){if(void 0===e.segment)return!0;let o=e,s=e.segment+1,a=0;for(;a>-n/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<n/2;){const e=t[s],n=t[s+1];if(!n)return!1;let o=t[s-1].angleTo(e)-e.angleTo(n);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>i;)u-=l.shift().angleDelta;if(u>r)return!1;s++,a+=e.dist(n)}return!0}function Ka(t,e,n,i,r,o,s,a,l,u,c){const h=function(t,e,n){return t?.6*e*n:0}(i,o,s),d=function(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}(i,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,n,i,r,o,s,a,l,u,c,h){const d=s/2,f=function(t){let e=0;for(let n=0;n<t.length-1;n++)e+=t[n].dist(t[n+1]);return e}(e);let p=0,m=n-i,y=[];for(let t=0;t<e.length-1;t++){const n=e[t],a=e[t+1],l=n.dist(a),g=a.angleTo(n);for(;m+i<p+l;){m+=i;const b=(m-p)/l,v=Qa(n.x,a.x,b),w=Qa(n.y,a.y,b),x=Qa(n.z||0,a.z||0,b);if(v>=0&&v<u&&w>=0&&w<u&&m-d>=0&&m+d<=f){const i=new Ya(v,w,g,t);i.z=x,c&&(i.axis=[n.y-w,v-n.x],i.angleR=x===(n.z||0)?0:Math.atan(.9*(x-(n.z||0))*h/n.dist(i))),i.line=e,i.I(),r&&!Xa(e,i,s,r,o)||y.push(i)}}p+=l}return l||y.length||a||(y=t(e,p/2,i,r,o,s,a,!0,u,c,h)),y}(t,f?e/2*a%e:(d/2+2*o)*s*a%e,e,h,n,d*s,f,!1,l,u,c)}function Qa(t,e,n){return t*(1-n)+e*n}function tl(t,e){const n=t.length;if(n<=1)return[t];const i=[];let r,o;for(let e=0;e<n;e++){const n=bi(t[e]);0!==n&&(t[e].area=Math.abs(n),void 0===o&&(o=n<0),o===n<0?(r&&i.push(r),r=[t[e]]):r.push(t[e]))}if(r&&i.push(r),e>1)for(let t=0;t<i.length;t++)i[t].length<=e||(Je(i[t],e,1,i[t].length-1,el),i[t]=i[t].slice(0,e));return i}function el(t,e){return e.area-t.area}function nl(t,e,n){const i=e.distSqr(n);if(0===i)return t.distSqr(e);const r=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/i;return t.distSqr(r<0?e:r>1?n:n.sub(e).j(r).m(e))}function il(t,e=1,n=!1){let i=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<i)&&(i=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-i,s-r);let u=l/2;const c=new Be(null,rl);if(0===l)return new Nt(i,r);for(let e=i;e<o;e+=l)for(let n=r;n<s;n+=l)c.push(new ol(e+u,n+u,u,t));let h=function(t){let e=0,n=0,i=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;n+=(o.x+a.x)*l,i+=(o.y+a.y)*l,e+=3*l}return new ol(n/e,i/e,0,t)}(t),d=c.length;for(;c.length;){const i=c.pop();(i.d>h.d||!h.d)&&(h=i,n&&console.log("found best %d after %d probes",Math.round(1e4*i.d)/1e4,d)),i.max-h.d<=e||(u=i.h/2,c.push(new ol(i.p.x-u,i.p.y-u,u,t)),c.push(new ol(i.p.x+u,i.p.y-u,u,t)),c.push(new ol(i.p.x-u,i.p.y+u,u,t)),c.push(new ol(i.p.x+u,i.p.y+u,u,t)),d+=4)}return n&&(console.log("num probes: "+d),console.log("best distance: "+h.d)),h.p}function rl(t,e){return e.max-t.max}function ol(t,e,n,i){this.p=new Nt(t,e),this.h=n,this.d=function(t,e){let n=!1,i=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&&(n=!n),i=Math.min(i,nl(t,r,a))}}return(n?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}const sl=45*Math.PI/100;function al(t,e,n,i,r,o,s,a,l){const{feature:u,size:c,symbol:h}=t,d=c?24:0,f=i*(c?c[0]/d:1);if("line"===o){const t=[];let i=u.geometry;r&&(i=Za(u.geometry,0,0,r,r));for(let o=0;o<i.length;o++){const u=Ka(i[o],s,sl,h.isIconText?null:n&&n.vertical||n&&n.horizontal||n,null,d,h.isIconText?1:f,1,r||1/0,a,l);if(h.textPlacement&&!h.isIconText)for(let t=0;t<u.length;t++)u[t].startIndex=e.length/3;if(t.push.apply(t,u),h.textPlacement&&!h.isIconText)for(let t=0;t<i[o].length;t++)e.push(i[o][t].x,i[o][t].y,i[o][t].z||0)}return t}return ll(u,o,r)}function ll(t,e,n){const i=[];if(3===t.type){const r=tl(t.geometry,0);for(let t=0;t<r.length;t++){const o=r[t];if("vertex"===e)for(let t=0;t<o.length;t++){const e=o[t];for(let t=0;t<e.length;t++)ki(e[t],n)||i.push(e[t])}else if("vertex-first"===e){const t=o[0];t&&t[0]&&!ki(t[0],n)&&i.push(t[0])}else if("vertex-last"===e){const t=o[0];t&&t[t.length-1]&&!ki(t[t.length-1],n)&&i.push(t[t.length-1])}else{const t=il(o,16);ki(t,n)||i.push(t)}}}else if(2===t.type)for(let r=0;r<t.geometry.length;r++){const o=t.geometry[r];if("vertex"===e)for(let t=0;t<o.length;t++)ki(o[t],n)||i.push(o[t]);else"vertex-last"===e?o&&o[o.length-1]&&!ki(o[o.length-1],n)&&i.push(o[o.length-1]):ki(o[0],n)||i.push(o[0])}else if(1===t.type)for(let e=0;e<t.geometry.length;e++){const r=t.geometry[e];for(let t=0;t<r.length;t++){const e=r[t];ki(e,n)||i.push(e)}}return i}function ul(t,e){const n={},i={},r=[];let o=0;function s(e){r.push(t[e]),o++}function a(t,e,n){const o=i[t];return delete i[t],i[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(n[0]),o}function l(t,e,i){const o=n[e];return delete n[e],n[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=i[0].concat(r[o].geometry[0]),o}function u(t,e,n){const i=n?e[0][e[0].length-1]:e[0][0];return`${t}:${i.x}:${i.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 i&&m in n&&i[p]!==n[m]){const t=l(p,m,d),e=a(p,m,r[t].geometry);delete n[p],delete i[m],i[u(f,r[e].geometry,!0)]=e,r[t].geometry=null}else p in i?a(p,m,d):m in n?l(p,m,d):(s(c),n[p]=o-1,i[m]=o-1)}return r.filter(t=>t.geometry)}class cl extends Ks{static needMerge(t,e,n){if(!t)return!1;let i="line"===t.textPlacement||"line"===t.markerPlacement;return i||(e.textPlacementFn&&(i="line"===e.textPlacementFn(n)),e.markerPlacementFn&&(i="line"===e.markerPlacementFn(n))),t.mergeOnProperty&&i}static mergeLineFeatures(t,e,n,i){const r="__index".trim();let o=e.textPlacement,s=e.markerPlacement;n.textPlacementFn&&(o=n.textPlacementFn(i)),n.markerPlacementFn&&(s=n.markerPlacementFn(i));const a=function(t,e,n,i,r){const o="__index".trim(),s=Ks.genFnTypes(e),{mergeOnPropertyFn:a}=s;if(!e.mergeOnProperty||"line"!==i&&"line"!==n)return[];if(!(Mi(l=e.mergeOnProperty)||"string"!=typeof l&&(null===l.constructor||l.constructor!==String)||"line"!==i&&"line"!==n))return[{features:t,property:e.mergeOnProperty}];var l;const u=[],c={},h=[];for(let s=0;s<t.length;s++){t[s][o]=s;const l=t[s].properties=t[s].properties||{};l.$layer=t[s].layer,l.$type=t[s].type;let d=n;"line"!==d&&(d=i);const f=a?a(r,l):e.mergeOnProperty;"line"!==d||Mi(f)?h.push(t[s]):(void 0===c[f]&&(c[f]=u.length,u.push({features:[],property:f})),u[c[f]].features.push(t[s]))}return h.length&&u.push({features:h}),u}(t,e,s,o,i);if(a.length){const e=[];for(let n=0;n<a.length;n++)e.push(a[n].property?ul(a[n].features,a[n].property):t);if(1===e.length)return e[0];{let t=[];for(let n=0;n<e.length;n++)t=t.concat(e[n]);return t.sort((t,e)=>t[r]-e[r]),t}}}static splitPointSymbol(t,e=0){const n=[];if(Array.isArray(t)){const e=t;for(let t=0;t<e.length;t++)e[t]&&n.push(...cl.splitPointSymbol(e[t],t));return n}let i=null,r=null;for(const e in t)0===e.indexOf("marker")?(i=i||{},i[e]=t[e]):0===e.indexOf("text")&&(r=r||{},r[e]=t[e]);return i&&(i.isIconText=!0,t.mergeOnProperty&&(i.mergeOnProperty=t.mergeOnProperty),n.push(i)),r&&(i&&(r.textPlacement=i.markerPlacement,r.textSpacing=i.markerSpacing,r.isIconText=!0),t.mergeOnProperty&&(r.mergeOnProperty=t.mergeOnProperty),n.push(r)),void 0!==t.visible&&(i&&(i.visible=t.visible),r&&(r.visible=t.visible)),i&&(i.markerTextFit&&r&&(i.text={},i.text.textName=r.textName,i.text.textSize=r.textSize),i.index={index:e,type:0}),r&&(r.index={index:e,type:1}),n}static isAtlasLoaded(t,e){const{icon:n,glyph:i}=t,{iconAtlas:r,glyphAtlas:o}=e;if(n&&(!r||!r.positions[n.url]))return!1;if(i){if(!o||!o.positions[i.font])return!1;const t=o.positions[i.font],{text:e}=i;for(let n=0;n<e.length;n++)if(!t[e.charCodeAt(n)])return!1}return!0}constructor(t,e,n){super(t,e,n),this.ft=e.textPlacement,this.nt.textPlacementFn&&(this.ft=this.nt.textPlacementFn(this.options.zoom))}createStyledVector(t,e,n,i,r,o){const s=new Va(t,this.symbolDef,e,n,i),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:e}=a.glyph,n=o[t]=o[t]||{};for(let t=0;t<e.length;t++)n[e.charCodeAt(t)]=1;"line"===this.ft&&(o.options={isCharsCompact:!1})}return this.options.allowEmptyPack||a.icon||a.glyph?s:null}getFormat(t){const e=void 0!==t.textName,n=e?this.getPackSDFFormat(t):this.getPackMarkerFormat();e?n.push(...this.pt()):n.push(...this.yt());const{markerOpacityFn:i,textOpacityFn:r,markerPitchAlignmentFn:o,textPitchAlignmentFn:s,markerRotationAlignmentFn:a,textRotationAlignmentFn:l,markerRotationFn:u,textRotationFn:c,markerAllowOverlapFn:h,textAllowOverlapFn:d,markerIgnorePlacementFn:f,textIgnorePlacementFn:p}=this.nt;return(i||r)&&n.push({type:Uint8Array,width:1,name:"aColorOpacity"}),(o||s)&&n.push({type:Uint8Array,width:1,name:"aPitchAlign"}),(a||l)&&n.push({type:Uint8Array,width:1,name:"aRotationAlign"}),(u||c)&&n.push({type:Uint16Array,width:1,name:"aRotation"}),(h||d||f||p)&&n.push({type:Uint8Array,width:1,name:"aOverlap"}),n}gt(){return this.hasMapPitchAlign}pt(){const{textFillFn:t,textSizeFn:e,textHaloFillFn:n,textHaloRadiusFn:i,textHaloOpacityFn:r,textDxFn:o,textDyFn:s}=this.nt,a=[];return t&&a.push({type:Uint8Array,width:4,name:"aTextFill"}),e&&a.push({type:Uint8Array,width:1,name:"aTextSize"}),n&&a.push({type:Uint8Array,width:4,name:"aTextHaloFill"}),i&&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}yt(){const{markerWidthFn:t,markerHeightFn:e,markerDxFn:n,markerDyFn:i}=this.nt,r=[];return t&&r.push({type:this.options.markerWidthType||Uint8Array,width:1,name:"aMarkerWidth"}),e&&r.push({type:this.options.markerHeightType||Uint8Array,width:1,name:"aMarkerHeight"}),n&&r.push({type:Int8Array,width:1,name:"aMarkerDx"}),i&&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 n=t.getShape(this.iconAtlas,this.glyphAtlas);if(!this.options.allowEmptyPack&&!n)return;const i=this.bt(t,n,e);if(0===i.length)return;const r=this.data,o=this.needAltitudeAttribute()?2:3;let s=this.data.aPosition.length/o;const a=t.symbol,l=t.feature.properties,u="line"===this.ft&&!a.isIconText,c=void 0!==a.textName,h=c&&u&&function(t){let e=0;for(let n=0;n<t.length;n++)if(Pa(t.charAt(n).charCodeAt(0)))e=0;else if(e++,e>=1)return!1;return!0}(t.getIconAndGlyph().glyph.text)?1:0,{textFillFn:d,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:C}=this.nt;let R,E,N,D,L,U,$,W,J,H,G,V,B,Z,Y,X,K;if(c){const e=t.getIconAndGlyph().glyph.font;R=function(t,e,n){const i=t.positionedGlyphs,r=[];for(let o=0;o<i.length;o++){const s=i[o],a=n[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 Nt(p,m),v=new Nt(y,m),w=new Nt(p,g),x=new Nt(y,g);if(e&&s.vertical){const t=new Nt(-c,c),e=-Math.PI/2,n=new Nt(5,0);b.T(e,t).m(n),v.T(e,t).m(n),w.T(e,t).m(n),x.T(e,t).m(n)}r.push({tl:b,tr:v,bl:w,br:x,tex:l,writingMode:t.writingMode,glyphOffset:d})}return r}(n.horizontal,u,this.glyphAtlas.positions[e]),d&&(E=d(null,l),E=f(E)?[0,0,0,0]:pi([],E)),p&&(N=p(this.options.zoom,l),Mi(N)&&(N=14)),m&&(D=m(null,l),D=pi([],D)),y&&(L=y(null,l)),g&&(U=255*g(null,l)),b&&($=b(null,l)||0),v&&(W=v(null,l)||0),w&&(B=+("map"===w(null,l))),x&&(Z=+("map"===x(null,l))),k&&(Y=ji(k(null,l),0,360)*Math.PI/180)}else R=n?function(t){const e=t.image,n=t.top-1/e.pixelRatio,i=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 Nt(i,n),a=new Nt(o,n),l=new Nt(o,r),u=new Nt(i,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]}]}(n):function(){const t=new Nt(0,0),e=new Nt(0,0),n=new Nt(0,0);return[{tl:t,tr:e,bl:new Nt(0,0),br:n,tex:{x:0,y:0,w:0,h:0},writingMode:void 0,glyphOffset:[0,0]}]}(),F&&(J=F(null,l)),T&&(H=T(null,l)),z&&(G=z(null,l)),S&&(V=S(null,l)),_&&(B=+("map"===_(null,l))),P&&(Z=+("map"===P(null,l))),I&&(Y=ji(I(null,l),0,360)*Math.PI/180);const Q=O||M;Q&&(X=Q(null,l)||0);const tt=q||j;let et;tt&&(K=tt(null,l)||0);const nt=A||C;nt&&(et=255*nt(this.options.zoom,l));const it=this.options.EXTENT,rt=R.length,{altitudeScale:ot,altitudeProperty:st,defaultAltitude:at}=this.options,{altitude:lt}=xi(t.feature,ot,st,at);for(let t=0;t<i.length;t++){const e=i[t],n=e.z||lt||0;if(it!==1/0&&ki(e,it))continue;const o=e.x,a=e.y,l=R.length;for(let t=0;t<l;t++){const i=R[t],{tl:l,tr:d,bl:f,br:p,tex:m}=i;this.vt(r,o,a,n,10*l.x,10*l.y,m.x,m.y+m.h),c&&this.wt(r,u,rt,i.glyphOffset,e,h,e.axis,e.angleR),this.xt(r,E,N,D,L,U,$,W,J,H,G,V,et,B,Z,Y,X,K),this.vt(r,o,a,n,10*d.x,10*d.y,m.x+m.w,m.y+m.h),c&&this.wt(r,u,rt,i.glyphOffset,e,h,e.axis,e.angleR),this.xt(r,E,N,D,L,U,$,W,J,H,G,V,et,B,Z,Y,X,K),this.vt(r,o,a,n,10*f.x,10*f.y,m.x,m.y),c&&this.wt(r,u,rt,i.glyphOffset,e,h,e.axis,e.angleR),this.xt(r,E,N,D,L,U,$,W,J,H,G,V,et,B,Z,Y,X,K),this.vt(r,o,a,n,10*p.x,10*p.y,m.x+m.w,m.y),c&&this.wt(r,u,rt,i.glyphOffset,e,h,e.axis,e.angleR),this.xt(r,E,N,D,L,U,$,W,J,H,G,V,et,B,Z,Y,X,K),this.addElements(s,s+1,s+2),this.addElements(s+1,s+2,s+3),s+=4;const y=Math.max(Math.abs(o),Math.abs(a),Math.abs(n));y>this.maxPos&&(this.maxPos=y)}}}vt(t,e,n,i,r,o,s,a){this.fillPosition(t,e,n,i),t.aShape.push(r,o),t.aTexCoord.push(s,a)}wt(t,e,n,i,r,o,s,a){if(t.aCount.push(n),e){t.aGlyphOffset.push(i[0],i[1]),this.gt()&&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)}}xt(t,e,n,i,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:C,markerRotationAlignmentFn:R,markerRotationFn:E,markerAllowOverlapFn:N,markerIgnorePlacementFn:D,markerOpacityFn:L}=this.nt;b&&t.aTextFill.push(...e),v&&t.aTextSize.push(n),w&&t.aTextHaloFill.push(...i),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),(L||_)&&t.aColorOpacity.push(d),(A||C)&&t.aPitchAlign.push(f),(R||F)&&t.aRotationAlign.push(p),(E||T)&&t.aRotation.push(9362*m);const U=N||z,$=D||S;(U||$)&&t.aOverlap.push((U?8:0)+4*y+(($?2:0)+g)),r>0&&(this.properties.hasHalo=1)}bt(t,e,n){const{feature:i,symbol:r}=t,o=this.kt(t,r),s=i.properties,{markerSpacingFn:a,textSpacingFn:l}=this.nt,u=((a?a(null,s):r.markerSpacing)||(l?l(null,s):r.textSpacing)||250)*n,c=this.options.altitudeToTileScale;return al(t,this.lineVertex,e,n,this.options.EXTENT,o,u,this.gt(),c)}kt(t,e){let n;return n=this.nt.markerPlacementFn?this.nt.markerPlacementFn(this.options.zoom,t.feature.properties):e.markerPlacement||this.ft,this.st||!e.markerPlacement&&!e.isIconText||(this.st=n),!this.ft||e.isIconText||this.lt||(this.lt=n),n}getPackSDFFormat(t){if("line"!==this.ft||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.gt()&&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 hl{constructor(t){this.x=t.x,this.y=t.y,this.z=t.z||0}clone(){return new hl(this)}_(){return this.A(this.mag()),this}A(t){return this.x/=t,this.y/=t,this.z/=t,this}P(){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().m(t)}sub(t){return this.clone().v(t)}m(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}v(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().j(t)}j(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,n=t.y-this.y,i=t.z-this.z;return e*e+n*n+i*i}I(){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 dl=Math.cos(Math.PI/180*37.5),fl=Math.pow(2,16)/1,pl=new Nt,ml=new Nt,yl=new Nt;class gl extends Ks{constructor(t,e,n){super(t,e,n);let i=!1;const{lineDasharrayFn:r,lineDashColorFn:o}=this.nt;this.hasGradient=this.symbol.lineGradientProperty,r&&(i=function(t,e,n){for(let i=0;i<t.length;i++)if(n(e,t[i].properties))return!0;return!1}(t,this.options.zoom,r),i&&(this.dasharrayFn=r)),this.hasDasharray=wl(this.symbol.lineDasharray)||i,this.hasDasharray&&o&&(this.dashColorFn=o)}createStyledVector(t,e,n,i,r){const o=new Fi(t,e,n,i),s=o.getLineResource();return!this.options.atlas&&s&&(r[s]=[0,0]),o}getFormat(){const{lineWidthFn:t,lineStrokeWidthFn:e,lineStrokeColorFn:n,lineColorFn:i,lineOpacityFn:r,lineDxFn:o,lineDyFn:s,linePatternAnimSpeedFn:a,linePatternGapFn:l}=this.nt,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"}),i&&u.push({type:Uint8Array,width:4,name:"aColor"}),n&&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:n,lineWidthFn:i,lineHeightFn:r,lineStrokeWidthFn:o,lineStrokeColorFn:s,lineColorFn:a,lineOpacityFn:l,lineDxFn:u,lineDyFn:c,linePatternAnimSpeedFn:h,linePatternGapFn:d}=this.nt,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"),n&&(b=n(this.options.zoom,y)||"butt"),i){let t=i(this.options.zoom,y);ni(t)&&(t=4),this.feaLineWidth=+t}else this.feaLineWidth=+p.lineWidth;if(r){let t=r(this.options.zoom,y);ni(t)&&(t=this.feaLineWidth),this.feaLineHeight=+t}else this.feaLineHeight=+p.lineHeight||this.feaLineWidth;if(o){let t=o(this.options.zoom,y);ni(t)&&(t=0),this.feaLineStrokeWidth=t}else this.feaLineStrokeWidth=p.lineStrokeWidth||0;if(a&&(this.feaColor=a(this.options.zoom,y)||[255,255,255,255],this.feaColor=f(this.feaColor)?[0,0,0,0]:pi([],this.feaColor)),s&&(this.feaStrokeColor=s(this.options.zoom,y)||[0,0,0,255],this.feaStrokeColor=f(this.feaStrokeColor)?[0,0,0,0]:pi([],this.feaStrokeColor)),l){let t=l(this.options.zoom,y);ni(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=pi([],t),this.feaDashColor=t}if(this.iconAtlas){const e=t.getLineResource(),n=this.iconAtlas.glyphMap[e];if(this.feaTexInfo=this.feaTexInfo||[0,0,0,0],n){const{tl:t,displaySize:n}=this.iconAtlas.positions[e];this.feaTexInfo[0]=t[0]+1,this.feaTexInfo[1]=t[1]+1,this.feaTexInfo[2]=n[0]-3,this.feaTexInfo[3]=n[1]-3}else this.feaTexInfo[0]=this.feaTexInfo[1]=this.feaTexInfo[2]=this.feaTexInfo[3]=0}if(u){let t=u(this.options.zoom,y);ni(t)&&(t=0),this.feaLineDx=t}if(c){let t=c(this.options.zoom,y);ni(t)&&(t=0),this.feaLineDy=t}if(h){let t=h(this.options.zoom,y);ni(t)&&(t=0),0!==t&&(this.properties.hasPatternAnim=1),this.feaPatternAnimSpeed=t}if(d){let t=d(this.options.zoom,y);ni(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 n=Za(t,-1,-1,v+1,v+1);if(3===m.type&&n.length>1){const t=n[0],e=n[n.length-1];jl(t[0],e[e.length-1])&&(n[0]=e.concat(t.slice(1)),n.length=n.length-1)}w.push(...n)}}const x=this.needAltitudeAttribute()?2:3;for(let t=0;t<w.length;t++)this.offset=this.data.aPosition.length/x,this.Mt(w[t],m,g,b,2,1.05)}jt(){return this.iconAtlas&&this.feaTexInfo[2]&&this.feaTexInfo[3]}Mt(t,e,n,i,r,o){const s=this.jt()||wl(this.feaDash)||wl(this.symbol.lineDasharray),a=this.options.isTube;a&&(t=t.map(t=>new hl(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&&li(e.properties,"mapbox_clip_start")&&li(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&&jl(t[c-1],t[c-2]);)c--;let h=0;for(;h<c-1&&jl(t[h],t[h+1]);)h++;if(c<(u?3:2))return;"bevel"===n&&(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)._().P());for(let e=h;e<c;e++){if(y=e===c-1?u?t[h+1]:void 0:t[e+1],y&&jl(t[e],y))continue;b&&(g=b),p&&(m=p),p=t[e],b=y?y.sub(p)._().P():g,f.dir=m?p.sub(m)._():y.sub(p)._(),g=g||b,f.currentNormal=g;let l=g.add(b);0===l.x&&0===l.y||l._();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<dl&&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).j(d/t).I());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?n:u?"butt":i;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)._(),this.addCurrentVertex(p,b,0,0,f)):(l.j(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.P().j(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,n=j?0:t;if(m&&this.addCurrentVertex(p,g,e,n,f),"fakeround"===F){const t=Math.round(180*k/Math.PI/20);for(let e=1;e<t;e++){let n=e/t;if(.5!==n){const t=n-.5;n+=n*t*(n-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*t*t+(.848013+v*(.215638*v-1.06021)))}const i=b.sub(g).j(n).m(g)._().j(j?-1:1);this.addHalfVertex(p,i.x,i.y,!1,j,0,f)}}y&&(f.currentNormal=b,this.addCurrentVertex(p,b,-e,-n,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).j(d/t).I());e.z=p.z,this.updateDistance(p,e),this.addCurrentVertex(e,b,0,0,f),p=e}}}}addCurrentVertex(t,e,n,i,r,o=!1){const s=e.x+e.y*n,a=e.y-e.x*n,l=e.y*i-e.x,u=-e.y-e.x*i;let c=0,h=0;if(r.middleVertex){pl.x=s,pl.y=a,ml.x=l,ml.y=u;const t=r.currentNormal;if(c=Ml(t,pl),0===n&&0===i)h=-c;else{const e=yl;e.x=t.x,e.y=t.y,e.j(-1),h=Ml(e,ml)}}this.addHalfVertex(t,s,a,o,!1,n,r,c),this.addHalfVertex(t,l,u,o,!0,-i,r,h),this.prevVertex&&jl(t,this.prevVertex)||(this.prevVertex=t),this.distance>fl/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,n,i,r,o))}addHalfVertex({x:t,y:e,z:n},i,r,o,s,a,l,u){this.fillData(this.data,t,e,n||0,i,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,n,i,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.nt;this.fillPosition(t,e,n,i);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(n)+1)}addElements(t,e,n){super.addElements(this.offset+t,this.offset+e,this.offset+n)}At(t){const e=this.options.EXTENT,n=this.elements;for(let i=0;i<n.length;i+=3)e!==1/0&&(vl(this.data.aPosition,n[i],n[i+1],3,e)||vl(this.data.aPosition,n[i+1],n[i+2],3,e))||t.push(n[i],n[i+1],n[i+2])}Ft(t){if(t.length<=1)return t;const e=[],n=this.options.EXTENT;let i,r=!0;for(i=0;i<t.length-1;i++){const o=bl(t[i],t[i+1],n);o&&r||(e.push(t[i]),r=o)}return r||e.push(t[i]),e}updateDistance(t,e){if(this.options.isTube){const n=t.dist(e),i=hi(this.options)*(e.z-t.z);this.distance+=Math.sqrt(n*n+i*i)}else this.distance+=t.dist(e);this.updateScaledDistance()}updateScaledDistance(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(fl-1):this.distance}}function bl(t,e,n){return n!==1/0&&(t.x<0&&e.x<0||t.x>n&&e.x>n||t.y<0&&e.y<0||t.y>n&&e.y>n)}function vl(t,e,n,i,r){if(r===1/0)return!1;const o=Math.floor(.5*t[e*i]),s=Math.floor(.5*t[e*i+1]),a=Math.floor(.5*t[n*i]),l=Math.floor(.5*t[n*i+1]);return o===a&&(o<0||o>r)&&s!==l||s===l&&(s<0||s>r)&&o!==a}function wl(t){if(!Array.isArray(t))return!1;for(let e=0;e<t.length;e++)if(t[e])return!0;return!1}const xl=new Nt(0,0),kl=new Nt(0,0);function Ml(t,e){const n=t.mag(),i=e.mag();xl.x=e.x,xl.y=e.y;const r=t.angleTo(kl),o=e.angleTo(kl);return Math.sign(o-r)*Math.sqrt(i*i-n*n)}function jl(t,e){return t.equals(e)&&t.z===e.z}class Al extends gl{constructor(t,e,n){super(t,e,n),this.Tt=n.altitudeProperty}getFormat(){const{lineColorFn:t,lineWidthFn:e}=this.nt,n=[{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&&n.push({type:Uint8Array,width:4,name:"aColor"}),e&&n.push({type:Uint8Array,width:1,name:"aLineWidth"}),this.Tt&&n.push({type:Array,width:1,name:"aLineHeight"}),n}placeVector(t){const e=t.feature;if(this.Tt){const{altitudeScale:t,altitudeProperty:n,defaultAltitude:i,heightProperty:r,defaultHeight:o,minHeightProperty:s}=this.options,{altitude:a,height:l}=xi(e,t,n,i,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}Mt(t,e,n,i,r,o){const s=this.data.aPosition.length/3;super.Mt(t,e,n,i,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 n=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],i=e.length/n;for(let t=0;t<i;t++)e.push(e[s*i+3*i+t])}n=this.data.aPosition.length/3;for(const t in this.data){const i=this.data[t],r=i.length/n;for(let t=0;t<r;t++)i.push(i[s*r+r*e+t])}n=this.data.aPosition.length/3;for(const t in this.data){const i=this.data[t],r=i.length/n;for(let t=0;t<r;t++)i.push(i[s*r+r*(e+3)+t])}super.addElements(t+1,l+1,l),super.addElements(l,l+1,l+2);const i=this.data.aPosition.length/3-this.offset;n=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],i=e.length/n;for(let t=0;t<i;t++)e.push(e[a*i-i+t])}n=this.data.aPosition.length/3;for(const t in this.data){const i=this.data[t],r=i.length/n;for(let t=0;t<r;t++)i.push(i[a*r-e*r-r+t])}n=this.data.aPosition.length/3;for(const t in this.data){const i=this.data[t],r=i.length/n;for(let t=0;t<r;t++)i.push(i[a*r-e*r-3*r+t])}super.addElements(i,l-3,i+1),super.addElements(l-3,i+2,i+1)}}fillData(t,e,n,i,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+n;this.zt(t,e,n,r,o,s,a,l,p,m,d,f),c&&(u&&this.zt(t,e,n,r,o,s,a,l,p,m,d,f),this.zt(t,e,n,r,o,s,a,l,p,m,d,f),this.St(t,e,n,r,o,s,a,l,p,m,d,f),this.St(t,e,n,r,o,s,a,l,p,m,d,f)),this.maxPos=Math.max(this.maxPos,Math.abs(e),Math.abs(n))}zt(t,e,n,i,r,o,s,a,l,u,c,h){const{lineColorFn:d,lineWidthFn:f}=this.nt;t.aPosition.push(e,n,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.Tt&&t.aLineHeight.push(this.feaAltitude)}St(t,e,n,i,r,o,s,a,l,u,c,h){const{lineColorFn:d,lineWidthFn:f}=this.nt;t.aPosition.push(e,n,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.Tt&&t.aLineHeight.push(this.feaAltitude)}addElements(t,e,n){const i=!1!==this.options.top,r=!1!==this.options.side,o=(i?1:0)+(r?4:0);if(t*=o,e*=o,this.data.aUp[this.offset+(n*=o)+4]){if(i&&super.addElements(e,t,n),r){const t=i?1:0;super.addElements(e+t,n+t,n+t+2),super.addElements(e+t+1,n+t+1+2,e+t+1+2)}}else if(i&&super.addElements(t,n,e),r){const e=i?1:0;super.addElements(t+e,t+e+2,n+e),super.addElements(t+e+1+2,n+e+1+2,n+e+1)}}createDataPack(t,e){this.maxAltitude=0;const n=super.createDataPack(t,e);if(!n)return n;const{data:i,indices:r}=n;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}=i,f={},p=nn(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,n){const i=[];for(let r=0;r<t.length;r+=3){const t=e[r/3];i.push(t/256,n[r/3]?1:0)}return i}(o,a,l)),f.aPosition=s,m&&(f.aTexCoord0=new Float32Array(m)),f.aNormal=y?new Int8Array(p):new Float32Array(p),f.aPickingId=i.aPickingId,f.aExtrude=u,c&&(f.aColor=c),d&&(f.aLineWidth=d),h){const t=Kn(this.maxAltitude);f.aLineHeight=new t(h)}const g=[];for(const t in f)g.push(f[t].buffer);return n.data=f,n.buffers=g,n}}const Fl=Math.pow(2,16)/1;class Tl extends Ks{getFormat(){return[...this.getPositionFormat()]}placeVector(t){const e=t.feature,n=3===e.type,i=e.geometry,r=this.elements;n&&(this.elements=[]);const o=this.needAltitudeAttribute()?2:3;for(let t=0;t<i.length;t++)this.offset=this.data.aPosition.length/o,this.Mt(i[t],e),n&&(this.At(r),this.elements=[]);n&&(this.elements=r)}Mt(t,e){const n=3===e.type;let i=t.length;for(;i>=2&&t[i-1].equals(t[i-2]);)i--;let r,o,s,a=0;for(;a<i-1&&t[a].equals(t[a+1]);)a++;if(!(i<(n?3:2))){this.distance=0,this.vertexLength=0,this.primitiveLength=0,this.e1=this.e2=this.e3=-1,n&&(r=t[i-2]);for(let e=a;e<i;e++)s=n&&e===i-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 n=this.vertexLength++;this.addLineVertex(this.data,t,e),n>=1&&this.addElements(n-1,n),e>Fl&&(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)}At(t){const e=this.options.EXTENT,n=this.elements;for(let i=0;i<n.length;i+=2)vi(this.data.aPosition,n[i],n[i+1],3,e)||t.push(n[i],n[i+1])}}const zl=45*Math.PI/100;class Sl extends Ks{getFormat(){return[...this.getPositionFormat()]}placeVector(t){const e=this.bt(t,this.symbol.markerSpacing||250,this.symbol.markerPlacement||"point");for(let t=0;t<e.length;t++){const n=e[t];this.fillPosition(this.data,n.x,n.y,n.z);const i=Math.max(Math.abs(n.x),Math.abs(n.y));i>this.maxPos&&(this.maxPos=i)}}bt(t,e,n){const i=t.feature,r=this.options.EXTENT;if("line"===n){const t=[];let n=i.geometry;r&&(n=Za(i.geometry,0,0,r,r));for(let i=0;i<n.length;i++){const o=Ka(n[i],e,zl,null,null,24,1,1,r||1/0);t.push.apply(t,o)}return t}return ll(i,n,r)}hasElements(){return!1}}\n/*!\n * from @turf/bboxClip\n * https://github.com/Turfjs/turf\n * MIT LICENSE\n */const _l=[],Pl=[];function Il(t,e){var n,i,r,o,s,a,l;for(i=1;i<=8;i*=2){for(n=[],o=!(ql(r=t[t.length-1],e)&i),s=0;s<t.length;s++){if((l=!(ql(a=t[s],e)&i))!==o){const t=Ol(r,a,i,e);n.push(void 0!==a.x?new Nt(t[0],t[1]):t)}l&&n.push(a),r=a,o=l}if(!(t=n).length)break}return n}function Ol(t,e,n,i){return _l[0]=void 0===t.x?t[0]:t.x,_l[1]=void 0===t.y?t[1]:t.y,t=_l,Pl[0]=void 0===e.x?e[0]:e.x,Pl[1]=void 0===e.y?e[1]:e.y,e=Pl,8&n?[t[0]+(e[0]-t[0])*(i[3]-t[1])/(e[1]-t[1]),i[3]]:4&n?[t[0]+(e[0]-t[0])*(i[1]-t[1])/(e[1]-t[1]),i[1]]:2&n?[i[2],t[1]+(e[1]-t[1])*(i[2]-t[0])/(e[0]-t[0])]:1&n?[i[0],t[1]+(e[1]-t[1])*(i[0]-t[0])/(e[0]-t[0])]:null}function ql(t,e){_l[0]=void 0===t.x?t[0]:t.x,_l[1]=void 0===t.y?t[1]:t.y;var n=0;return(t=_l)[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}const Cl=[0,0,0,0];class Rl extends Ks{constructor(...t){super(...t),this.lineElements=[]}createStyledVector(t,e,n,i,r){const o=new Fi(t,e,n,i),s=o.getPolygonResource();return!this.options.atlas&&s&&(r[s]=[0,0]),o}getFormat(){const t=[...this.getPositionFormat()],{polygonFillFn:e,polygonOpacityFn:n,uvScaleFn:i,uvOffsetFn:r}=this.nt;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"}),n&&t.push({type:Uint8Array,width:1,name:"aOpacity"}),i&&t.push({type:Uint16Array,width:2,name:"aUVScale"}),r&&t.push({type:Uint8Array,width:2,name:"aUVOffset"}),t}placeVector(t,e){const n=t.feature;this._t(n.geometry,n,e)}_t(t,e){let n,i,r,o;const{polygonFillFn:s,polygonOpacityFn:a,uvScaleFn:l,uvOffsetFn:u}=this.nt,c=e.properties;s&&(n=s(this.options.zoom,c)||At([],255,255,255,255),n=f(n)?Cl:pi([],n)),a&&(i=a(this.options.zoom,c),ni(i)&&(i=1),i*=255),l&&(r=l(this.options.zoom,c),ni(r)&&(r=[1,1]),r=[255*r[0],255*r[1]]),u&&(o=u(this.options.zoom,c),ni(o)&&(o=[0,0]),o=[255*o[0],255*o[1]]);const h=!!this.iconAtlas,d=tl(t,500),p=[0,0],m=[0,0];if(h){const{polygonPatternFileFn:t}=this.nt,e=t?t(null,c):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<d.length;t++){const e=d[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=Il(s,g)),0!==s.length){0!==t&&l.push(a.length/3);for(let t=0;t<s.length;t++){const e=s[t].x,l=s[t].y,u=s[t].z||0;this.fillPosition(this.data,e,l,u),h&&this.data.aTexInfo.push(p[0],p[1],m[0],m[1]),void 0!==n&&this.data.aColor.push(n[0],n[1],n[2],n[3]),void 0!==i&&this.data.aOpacity.push(i),void 0!==r&&this.data.aUVScale.push(r[0],r[1]),void 0!==o&&this.data.aUVOffset.push(o[0],o[1]);const c=Math.abs(e),d=Math.abs(l);c>this.maxPos&&(this.maxPos=c),d>this.maxPos&&(this.maxPos=d),a.push(e,l,u)}}}const u=On(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])}}}const El=[{type:Int16Array,width:3,name:"aPosition"}];class Nl extends Ks{getFormat(){return El}placeVector(t,e){const n=this.bt(t,e);if(0===n.length)return;const i=this.data,r=this.getAltitude(t.feature.properties);let o=i.aPosition.length/El[0].width;for(let t=0;t<n.length;t++){const e=n[t];i.aPosition.push(2*e.x+0,2*e.y+0,r),i.aPosition.push(2*e.x+1,2*e.y+0,r),i.aPosition.push(2*e.x+1,2*e.y+1,r),i.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)}}bt(t,e){const{feature:n,symbol:i}=t,r=this.kt(t,i),o=n.properties,{markerSpacingFn:s}=this.nt,a=((s?s(null,o):i.markerSpacing)||250)*e;return al(t,null,null,e,this.options.EXTENT,r,a)}kt(t,e){return this.nt.markerPlacementFn?this.nt.markerPlacementFn(this.options.zoom,t.feature.properties):e.markerPlacement}}class Dl extends gl{constructor(t,e,n){(e=ei({},e)).lineJoin="miter",e.lineCap="butt",super(t,e,n),this.options.radialSegments%2==1&&this.options.radialSegments--}getFormat(){const{lineWidthFn:t,lineColorFn:e,lineOpacityFn:n,linePatternAnimSpeedFn:i,linePatternGapFn:r}=this.nt,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"}),n&&o.push({type:Uint8Array,width:1,name:"aOpacity"}),i&&o.push({type:Int8Array,width:1,name:"aLinePatternAnimSpeed"}),r&&o.push({type:Int8Array,width:1,name:"aLinePatternGap"}),o}addHalfVertex(t,e,n,i,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,n,i,r,o,s,a){gt(Ll,n,i,r),gt(Ul,o,s,0),kt($l,Ll,Ul),wt(Ul,Ul),wt($l,$l),Wl[e]||(Wl[e]=[]);const l=Wl[e];for(var u=0;u<e;u++){const t=Math.PI*u/e,n=1-Math.abs(t-0)/(Math.PI/2);l[u]=l[u]||[],Jl(Ul,$l,l[u],1,t,n*(a?-1:1))}return l}(0,d,f,p,m,e,n,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,n=this.needAltitudeAttribute()?2:3,i=this.data.aPosition.length/n;for(let n=0;n<e;n++){const r=n+i-2*e;let o,s;n===e-1&&t?(o=n+i-2*e+1,s=n+i-2*e-2*e+1):(o=n+i+1,s=n+i+1-2*e),super.addElements(n+i-this.offset,o-this.offset,r-this.offset),super.addElements(r-this.offset,o-this.offset,s-this.offset)}}fillData(t,e,n,i,r,o,s,a){const{lineWidthFn:l,lineColorFn:u,lineOpacityFn:c,linePatternAnimSpeedFn:h,linePatternGapFn:d}=this.nt,f=r.length;for(let o=0;o<f;o++){if(this.fillPosition(t,e,n,i),Ft(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=di(this.options.metric);let n=this.feaLineWidth*e;isNaN(n)&&(n=0),t.aLineWidth.push(Math.round(n))}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(n)+1)}createDataPack(t,e){const n=super.createDataPack(t,e);return n&&(n.is2D=!1),n}}const Ll=[],Ul=[],$l=[],Wl={};function Jl(t,e,n,i,r,o){return At(n,i*(Math.cos(r)*t[0]+Math.sin(r)*e[0]),i*(Math.cos(r)*t[1]+Math.sin(r)*e[1]),i*(Math.cos(r)*t[2]+Math.sin(r)*e[2]),o),n}class Hl extends Dl{addHalfVertex(t,e,n,i,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,n,i,r,o,s,a){gt(Vl,n,i,r),gt(Bl,o,s,0),kt(Zl,Vl,Bl),wt(Bl,Bl),wt(Zl,Zl),function(t,e,n){t[0]=e,t[1]=n}(Gl,t,e);const l=Ot(Gl)/t,u=Math.atan(e/t);let c=Math.PI/2+(Math.PI/2-u);return Yl[0]||(Yl[0]=[]),Jl(Bl,Zl,Yl[0],l,c,a?1:-1),c+=2*u,Yl[1]||(Yl[1]=[]),Jl(Bl,Zl,Yl[1],l,c,a?1:-1),Yl}(this.feaLineWidth,this.feaLineHeight,d,f,p,e,n,r);this.prevVertex&&this.fillTubeElements(r),this.fillData(this.data,l,u,c||0,m,r,h,a)}}const Gl=[],Vl=[],Bl=[],Zl=[],Yl=[];var Xl=Object.freeze({__proto__:null,clipPolygon:Il,calculateSignedArea:bi,getFeaAltitudeAndHeight:xi,generatePickingIndiceIndex:Ai,convertRTLText:Ha,packPosition:Ti,unpackPosition:function(t,e,n,i){const r=(Math.sign(e)||1)*(Math.abs(e)%zi),o=(Math.sign(n)||1)*(Math.abs(n)%zi),s=Math.floor(Math.abs(e)/zi),a=Math.floor(Math.abs(n)/zi);return t[0]=r,t[1]=o,t[2]=Math.sign(i+1e-5)*(2*s+a)*Si+i,t},convertGeometry:ti,getPosArrayType:Kn,getUnsignedArrayType:Qn,getIndexArrayType:Xn});const Kl={},Ql={},tu=[];Object.freeze({__proto__:null,loadSymbolFnTypes:function t(e,n){if(!e)return null;var i=!1;if(Array.isArray(e)){var r,o=[];for(let s=0;s<e.length;s++)(r=t(e[s],n))?(o.push(r),i=!0):o.push(e[s]);return i?o:e}var s={__fn_types_loaded:!0};const a=[];for(const t in e)li(e,t)&&a.push(t);const l=function(t){Object.defineProperty(s,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=p(this["_"+t])),this["__fn_"+t].apply(this,n())},set:function(e){this["_"+t]=e},configurable:!0,enumerable:!0})},u={},c=function(t,e){Object.defineProperty(s,t,{get:function(){this["__fn_"+t]||(this["__fn_"+t]=Ds(this["_"+t],e));const i=n()[0];u.zoom=i;try{return this["__fn_"+t].evaluateWithoutErrorHandling(u,Kl,Ql,null,tu)}catch(t){return null}},set:function(e){this["_"+t]=e},configurable:!0,enumerable:!0})};for(let t=0,n=a.length;t<n;t++){const n=a[t];if(f(e[n]))i=!0,s["_"+n]=e[n],l(n);else if(Ls(e[n])){i=!0;const t=Hs(n);s["_"+n]=e[n],c(n,t)}else s[n]=e[n]}return i?s:e}});const eu={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},eu),Object.assign({lineDasharray:1},eu);function nu(t,e,n,i,r,o,s,a,l,u,c,h,d,f,p,m){const y=e.length,g=r/3;for(let n=2,i=y;n<i;n+=3)t[r+n-2]=e[n-2],t[r+n-1]=e[n-1],t[r+n-0]=e[n]-o;r+=y;for(let n=2,i=y;n<i;n+=3)t[r+n-2]=e[n-2],t[r+n-1]=e[n-1],t[r+n-0]=e[n]-s;r+=y;for(let n=2,i=y;n<i;n+=3)t[r+n-2]=e[n-2],t[r+n-1]=e[n-1],t[r+n-0]=e[n]-o;r+=y;for(let n=2,i=y;n<i;n+=3)t[r+n-2]=e[n-2],t[r+n-1]=e[n-1],t[r+n-0]=e[n]-s;r+=y,(n=n||[]).push(y/3);for(let e=0;e<n.length;e++){iu(g+(n[e-1]||0),g+n[e],t,y/3,a,i,l,u,c,h,d,f,p,m)}return r}function iu(t,e,n,i,r,o,s,a,l,u,c,h,d,f){const p=o.length;let m,y;for(let s=t,a=e;s<a-1;s++)m=s,y=s+1,at(n,m,y,r)||((s-t)%2==1&&(m+=2*i,y+=2*i),o.push(m+i,m,y),o.push(y,y+i,m+i));s&&function(t,e,n,i,r,o,s,a,l,u){let c,h=0,d=0,f=0,p=0;for(let m=r.length-1;m>=0;m--){const y=r[m],g=3*y+1,b=3*y+2,v=i[3*y],w=i[g],x=i[b];h||d||(h=Math.max(i[b],i[3*r[m-2]+2]),d=Math.min(i[b],i[3*r[m-2]+2]),c=h-d);let k=f;const M=m%6;0===t?(5===M&&(p=Et(i,r,m,v,w)),k=2===M||3===M||4===M?f:f+p):1===t&&(2===M||3===M||4===M?k=0:5===M?(p=Et(i,r,m,v,w),k=p):k=p);const j=k*a*l/o;let A;A="bottom"===e?x===h?c*u/s:0:x===h?0:c*u/s,n[2*y]=j,n[2*y+1]=A,0===M&&(f+=p)}}(a,l,u,n,o.slice(p,o.length),c[0],c[1],h,d,f)}function ru(t,e,n,i,r,o,s,a,l,u){void 0===e.top&&(e.top=!0),void 0===e.side&&(e.side=!0);const{altitudeScale:c,altitudeProperty:h,defaultAltitude:d,heightProperty:f,minHeightProperty:y,defaultHeight:g,tangent:b,uv:v,uvScale:w,topUVMode:x,sideUVMode:M,top:j,side:A,textureYOrigin:z,topThickness:S}=e,_=function(t,e,{altitudeScale:n,altitudeProperty:i,defaultAltitude:r,heightProperty:o,minHeightProperty:s,defaultHeight:a},{side:l,top:u,topThickness:c,uvOrigin:h,uv:d,uvSize:f,topUVMode:p,sideUVMode:m,textureYOrigin:y,glScale:g,localScale:b,vScale:v},w){const x=e/t[0].extent,M=[],j=[],A=[],T=[],z=[],S=[],_=!!d,P=!!u,I=!!l,O=_?[]:null;function q(t,n,i,r){if(P){const r=On(T,i,3);if(0===r.length)return n;let o;F(z,T),n+=T.length;for(let e=2,n=r.length;e<n;e+=3)o=r[e-1],r[e-1]=r[e]+t/3,r[e]=o+t/3,r[e-2]+=t/3;F(S,r),_&&qt(p||0,t,n,O,z,0,g,b,f[0],f[1]),c>0&&!I&&(n=nu(z,T,i,S,n,0,c,e,_,m||0,y,O,f,g,b,v))}return I&&(P&&(c=0),n=nu(z,T,i,S,n,c,r,e,_,m||0,y,O,f,g,b,v)),n}let C=0,R=0;const E=[-1,-1,e+1,e+1];let N=0,D=t.length;void 0!==w&&(N=w,D=w+1);let L=0,U=!1;for(;N<D;N++){const l=t[N],u=l.id;k(u)&&(Math.abs(u)>L&&(L=Math.abs(u)),u<0&&(U=!0));const c=l.geometry,{altitude:h,height:d}=Xl.getFeaAltitudeAndHeight(l,n,i,r,o,a,s);C=Math.max(Math.abs(h),C);const f=z.length;let p=R,m=[];T.length=0;for(let t=0,n=c.length;t<n;t++){const i=Xl.calculateSignedArea(c[t])<0;!i&&t>0&&(R=q(p,R,m,d*x),T.length=0,m=[],p=R);let r=c[t];if(e!==1/0&&(r=Xl.clipPolygon(r,E)),!r.length){t===n-1&&(R=q(p,R,m,d*x));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]),i&&m.push(T.length/3),st(T,T.length,r,x,h),t===n-1&&(R=q(p,R,m,d*x))}const y=z.length-f,g="__fea_idx".trim();for(let t=0;t<y/3;t++)j.push(void 0===l[g]?N:l[g]),M.push(N),k(u)&&A.push(u)}const $=Xl.getUnsignedArrayType(j.length?j[j.length-1]:0),W={maxAltitude:C,vertices:new(Xl.getPosArrayType(Math.max(512,C)))(z),indices:S,pickingIds:new $(j),featureIndexes:M};if(A.length){const t=U?Xl.getPosArrayType(L):Xl.getUnsignedArrayType(L);W.featureIds=new t(A)}else W.featureIds=[];return O&&(O.length=z.length/3*2,W.uvs=O),W}(t,n,{altitudeScale:c,altitudeProperty:h,defaultAltitude:d||0,heightProperty:f,minHeightProperty:y,defaultHeight:g||0},{top:j,side:A,topThickness:10*S||0,uv:v||b,uvSize:w?[.5*w[0],.5*w[1]]:[.5,.5],uvOrigin:i,topUVMode:x,sideUVMode:M,textureYOrigin:z,glScale:r,localScale:s,vScale:o},u),P=[],I=new(Xl.getIndexArrayType(_.vertices.length/3))(_.indices);delete _.indices,P.push(I.buffer,_.vertices.buffer,_.pickingIds.buffer);const O=nn(_.vertices,I);let q=!0;for(let t=0;t<O.length;t++)O[t]=-O[t],O[t]%1!=0&&(q=!1);if(_.normals=O,b){let t=function(t,e,n,i){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,i,r){rn(l,t,3*e),rn(u,t,3*i),rn(c,t,3*r),on(h,n,2*e),on(d,n,2*i),on(f,n,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);gt(p,(j*o-M*y)*A,(j*g-M*b)*A,(j*v-M*w)*A),gt(m,(x*y-k*o)*A,(x*b-k*g)*A,(x*w-k*v)*A),bt(s[e],s[e],p),bt(s[i],s[i],p),bt(s[r],s[r],p),bt(a[e],a[e],m),bt(a[i],a[i],m),bt(a[r],a[r],m)}for(let t=0,e=i.length;t<e;t+=3)y(i[t+0],i[t+1],i[t+2]);const g=[],b=[],v=[],w=[];let x,k,M;function j(t){rn(v,e,3*t),yt(w,v),k=s[t],yt(g,k),Mt(g,g,function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}(v,v,xt(v,k))),wt(g,g),kt(b,w,k),M=xt(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=i.length;t<e;t+=3)j(i[t+0]),j(i[t+1]),j(i[t+2]);return o}(_.vertices,_.normals,_.uvs,I);t=function(t,e){const n=new Float32Array(e.length),i=[],r=[],o=[];for(let s=0;s<e.length;s+=4){const a=s/4*3;gt(r,t[a]||0,t[a+1]||0,t[a+2]||0),At(i,e[s]||0,e[s+1]||0,e[s+2]||0,e[s+3]||0),en(o,r,i),jt(n.subarray(s,s+4),o)}return n}(_.normals,t),_.tangents=t,P.push(t.buffer),delete _.normals}if(_.normals&&(_.normals=q?new Int8Array(_.normals):new Float32Array(_.normals),P.push(_.normals.buffer)),_.uvs){const t=_.uvs;_.uvs=new Float32Array(t),P.push(_.uvs.buffer)}const C=function(t,e,n,i){const r={};if(T(e.polygonFill)){const o=m(e.polygonFill),s=new Uint8Array(4*i.length);s.fill(255);for(let e=0;e<i.length;e++){const r=t[i[e]],a=r.properties||{};a.$layer=r.layer,a.$type=r.type;let l=o(n,a);delete a.$layer,delete a.$type,gi.normalizeColor(ou,l),s[4*e]=ou[0],s[4*e+1]=ou[1],s[4*e+2]=ou[2],s[4*e+3]=ou[3]}r.aColor=s}if(T(e.polygonOpacity)){const o=p(e.polygonOpacity),s=new Uint8Array(i.length);s.fill(255);for(let e=0;e<i.length;e++){const r=t[i[e]],a=r.properties||{};a.$layer=r.layer,a.$type=r.type;const l=o(n,a);delete a.$layer,delete a.$type,s[e]=255*l}r.aOpacity=s}return r}(t,a,l,_.featureIndexes),R={data:{data:{aPosition:_.vertices,aNormal:_.normals,aTexCoord0:_.uvs,aTangent:_.tangents,aPickingId:_.pickingIds},indices:I,properties:{maxAltitude:_.maxAltitude}},buffers:P};return _.featureIds.length?(R.data.featureIds=_.featureIds,P.push(R.data.featureIds.buffer)):R.data.featureIds=[],C.aColor&&(R.data.data.aColor=C.aColor,R.buffers.push(C.aColor.buffer)),C.aOpacity&&(R.data.data.aOpacity=C.aOpacity,R.buffers.push(C.aOpacity.buffer)),R.data.pickingIdIndiceMap=Xl.generatePickingIndiceIndex(R.data.data.aPickingId,R.data.indices),R}const ou=[];function su(t,e,n,i,{altitudeScale:r,altitudeProperty:o,defaultAltitude:s,heightProperty:a,minHeightProperty:l,defaultHeight:u,bottom:c}){const h=c,d=e/t[0].extent,p=2*function(t,e){let n=0;for(let i=0,r=t.length;i<r;i++){const r=t[i];if(k(r.geometry[0][0])){const t=3*r.geometry.length;n+=e?2*t-6:t}else for(let t=0,i=r.geometry.length;t<i;t++){let i=3*r.geometry[t].length;3===r.type&&(i-=3),n+=e?2*i-6:i}}return n}(t)+3*t.length*2,m=[],y=new Int16Array(p),g=new Uint8Array(y.length/3*4);f(n)&&(n=Gs.compileFilter(n));const b=[];function v(t,n,i){const r=n-t,o=y.subarray(t,n),s=y.subarray(n,n+r);s.set(o);for(let t=2,e=s.length;t<e;t+=3)s[t]=o[t]-i;const a=t/3,l=r/3;let u,c;for(let t=a,n=l+a;t<n;t++)t<n-1?(u=t,c=t+1):(u=t,c=a),at(y,u,c,e)||(b.push(u,c),h&&b.push(u+l,c+l),au(y,u,e)||b.push(u,u+l));return n+r}let w=0,x=0;const M="__fea_idx".trim(),j=[];for(let e=0,c=t.length;e<c;e++){const c=t[e],h=c.geometry;if(n){let t;t="function"==typeof n?n(c&&c.properties):n,gi.normalizeColor(j,t)}else gt(j,255,255,255);const f=w/3*4,{altitude:p,height:k}=Xl.getFeaAltitudeAndHeight(c,r,o,s,a,u,l);x=Math.max(Math.abs(p),x);let A=w;for(let t=0,e=h.length;t<e;t++){let e=h[t];const n=e.length;e[0][0]===e[n-1][0]&&e[0][1]===e[n-1][1]&&(e=e.slice(0,n-1)),w=st(y,A,e,d,p),w=v(A,w,k*d),A=w}const F=A/3*4;for(let t=f;t<F;t+=4)g[t]=j[0],g[t+1]=j[1],g[t+2]=j[2],g[t+3]=255*(i||1);const T=b.length-m.length;for(let t=0;t<T;t++)m.push(c[M])}const A=b.reduce((t,e)=>Math.max(t,e),0),F=new(Xl.getIndexArrayType(A))(b),T=Xl.getUnsignedArrayType(t.length);return{aPosition:new(Xl.getPosArrayType(Math.max(512,x)))(y),indices:F,aPickingId:new T(m),aColor:g}}function au(t,e,n){const i=t[3*e],r=t[3*e+1];return i<0||i>n||r<0||r>n}function lu(t,e,n,i){const r=su(t,e,n.lineColor,n.lineOpacity,i),o=[r.aPosition.buffer,r.indices.buffer,r.aPickingId.buffer],s=r.indices;return delete r.indices,{data:{data:r,indices:s},buffers:o}}const uu="__original_properties",cu="__fn-type_properties";class hu{constructor(t,e,n,i,r){this.id=t,this.options=e,this.upload=n,this.Pt(e.style),this.requests={},this.It=i,this.Ot=0,this.loadings=r}updateStyle(t,e){this.options.style=t,this.Ot=t.styleCounter,this.Pt(t),e()}updateOptions(t,e){this.options=w(this.options,t),e()}loadTile(t,e){const n=this.loadings,i=t.tileInfo.url,r=this.options.debugTile;if(r){const{x:n,y:i,z:o}=t.tileInfo;let s=!1;for(let t=0;t<r.length;t++)if(n===r[t].x&&i===r[t].y&&o===r[t].z){s=!0;break}if(!s)return void e()}n[i]?n[i].push({context:t,callback:e,ref:this}):(n[i]=[{context:t,callback:e,ref:this}],this.requests[i]=this.getTileFeatures(t,(e,r,o,s)=>{const a=n[i];if(delete n[i],this.checkIfCanceled(i))return delete this.requests[i],void this.qt(a,null,{canceled:!0});if(delete this.requests[i],this.options.debug&&r)for(let e=0;e<r.length;e++)r[e]._debug_info={index:e,id:r[e].id,tileId:t.tileInfo.id};if(e)this.qt(a,e);else if(r&&r.length){if(a)for(let t=0;t<a.length;t++)this.Ct.call(a[t].ref,a[t].context,a[t].callback,i,o,r,s)}else this.qt(a)}))}Ct(t,e,n,i,r,o){this.Rt(i,r,t).then(n=>{n.canceled?e(null,{canceled:!0}):(n.data.style=t.styleCounter,o&&w(n.data,o),e(null,n.data,n.buffers))}).catch(t=>{e(t)})}abortTile(t,e){delete this.requests[t],this.Et(t),e()}Et(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]}qt(t,e,n){if(t)for(let i=0;i<t.length;i++)t[i].callback(e,n)}checkIfCanceled(t){return!this.requests[t]}onRemove(){this.loadings={}}fetchIconGlyphs(t,e,n){this.upload("fetchIconGlyphs",{icons:t,glyphs:e},null,n)}Rt(t,e,n){if(!e.length)return Promise.resolve({data:null,buffers:[]});const{glScale:i,tileInfo:r}=n,o=!this.options.style.style.length&&!this.options.style.featureStyle.length;let s=this.pluginConfig.slice(0);o&&(s=this.Nt(t)),this.featurePlugins&&F(s,this.featurePlugins);const a={};for(let t=0;t<s.length;t++)bu(e,n.tileInfo.z,s[t],a);const l=[],u=[];for(let t=0;t<e.length;t++){const n=e[t],i=a[t];if(i){u.fill(null);let t=0;for(const e in i){let r=0;const o=i[e].values();for(const t of o){let i=u[r];i||(i=ku(n),u[r]=i),i.properties[e]=t,r++}r>t&&(t=r)}for(let e=0;e<t;e++)l.push(u[e])}else l.push(n)}const c=(e=l)[0].extent,h=r.z,d={x:r.extent2d.xmin*i,y:r.extent2d.ymax*i},f=[],p=[],m=[],y=this.options,g=[],b={},v=[Promise.resolve(n.styleCounter)];let x=0,k=-1;const M=[];let j=!1;for(let t=0;t<s.length;t++){k++;const i=s[t];i.type!==x&&(k=0,x=i.type);const a=0===i.type?f:p;if(i.symbol&&!1===i.symbol.visible){a[k]=null;continue}Au(i.symbol,M,t),j=j||M[t]&&M[t].size>0;const{tileFeatures:l,tileFeaIndexes:u}=this.Dt(h,i.type,i.filter,e,b,t);if(!l.length){a[k]=null;continue}const y=u[u.length-1],w=Xl.getIndexArrayType(y);a[k]={styledFeatures:new w(u)},m.push({idx:t,typeIdx:k}),g.push(a[k].styledFeatures.buffer);const A={extent:c,zoom:h,tilePoint:d,...n};if(this.options.debugTile){const t=this.options.debugTile;for(let e=0;e<t.length;e++){const{x:n,y:i,z:o}=t[e];if(r.x===n&&r.y===i&&r.z===o){A.debugIndex=t[e].index;break}}}let F=this.Lt(l,i,A);o&&(F=F.then(t=>{if(!t)return null;if(t.data)t.data.layer=l[0].layer;else if(Array.isArray(t))for(let e=0;e<t.length;e++)t[e]&&t[e].data&&(t[e].data.layer=l[0].layer);return t})),v.push(F)}return Promise.all(v).then(([n,...i])=>{function r(t,e){if(void 0===t.data.ref&&(t.data.type=s[m[e].idx].renderPlugin.dataConfig.type,t.data.filter=s[m[e].idx].filter.def,t.buffers&&t.buffers.length))for(let e=0;e<t.buffers.length;e++)g.push(t.buffers[e])}if(n!==this.Ot)return{canceled:!0};for(let t=0;t<i.length;t++){if(!i[t])continue;const e=i[t],n=0===s[m[t].idx].type?f:p;if(Array.isArray(e)){const i=[];for(let n=0;n<e.length;n++)e[n]&&(r(e[n],t),(void 0===e[n].data.ref||e[e[n].data.ref])&&i.push(e[n].data));i.length&&(n[m[t].typeIdx].data=i)}else r(e,t),n[m[t].typeIdx].data=e.data}const o={},a=t;if(y.features||y.schema||j){let t,n=!1;for(let i=0,r=e.length;i<r;i++)if(t=e[i],a[t.layer].properties||(a[t.layer].properties=pu(t.properties)),t&&(y.features||j&&b[i]))if("id"===y.features)o[i]=t.id;else{y.pickingGeometry||delete t.geometry,delete t.extent,delete t.properties.$layer,delete t.properties.$type,delete t.__index;const e=t.originalFeature;if(e){const e=t.properties,n=w({},t.originalFeature);delete e[uu],n.customProps=w({},e),t=n}const r=w({},t);if(!y.features){const r=b[i];for(let i=0;i<r.length;i++){const r=M[i];r&&r.forEach(i=>{const r=e?e.properties:t.properties;r[cu]||(r[cu]=new Set),r[cu].add(i),n=!0})}}o[i]=r}if(n)for(const t in o){const e=o[t];if(e.properties[cu]){const t=e.properties[cu];delete e.properties[cu];for(const n in e.properties)t.has(n)||delete e.properties[n]}}}return{data:{schema:a,data:f,featureData:p,extent:c,features:o},buffers:g}}).catch(t=>{console.error(t)})}Lt(t,e,n){let i=t;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}=n,f=a/s,p=r.type,m=n.debugIndex;let y=w({},r,{EXTENT:a,zoom:c,debugIndex:m,features:this.options.features});if("3d-extrusion"===p){const t=mu(o);return t&&(r.uv=1,2===t&&(r.tangent=1)),Promise.all([Promise.resolve(ru(i,r,a,h,l,u,this.options.tileSize[1]/a,o,c,m))])}if("3d-wireframe"===p)return Promise.all([Promise.resolve(lu(i,a,o,r))]);if("point"===p){y=w(y,{requestor:this.fetchIconGlyphs.bind(this),altitudeToTileScale:u*a/this.options.tileSize[1]/l});const t=cl.splitPointSymbol(o),e=Ks.genFnTypes(t[0]);return cl.needMerge(t[0],e,c)&&(i=cl.mergeLineFeatures(i,t[0],e,c)),Promise.all(t.map((t,n)=>(0===n?y.fnTypes=e:delete y.fnTypes,new cl(i,t,y).load(f))))}if("native-point"===p)return yu(i,o,y,Sl,a/s);if("line"===p)return y=w(y,{requestor:this.fetchIconGlyphs.bind(this),tileRatio:f}),yu(i,o,y,gl);if("native-line"===p)return yu(i,o,y,Tl);if("fill"===p)return y=w(y,{requestor:this.fetchIconGlyphs.bind(this)}),yu(i,o,y,Rl);if("line-extrusion"===p){delete o.lineGradientProperty,o.lineJoin="miter",o.lineCap="butt";const t=mu(o);if(t&&(r.uv=1,2===t&&(r.tangent=1)),y=w(y,{tileSize:s,zScale:u,glScale:l}),t){const t=[];if(!1!==r.top){const e=w({},y);e.side=!1,t.push(new Al(i,o,e))}return!1!==r.side&&(y.side=!0,y.top=!1,t.push(new Al(i,o,y))),Promise.all(t.map(t=>t.load()))}return Promise.all([new Al(i,o,y).load()])}if("circle"===p)return yu(i,o,y,Nl);if("round-tube"===p||"square-tube"===p){const t="round-tube"===p?Dl:Hl;return y=w(y,{requestor:this.fetchIconGlyphs.bind(this),radialSegments:"round-tube"===p?r.radialSegments||8:4,pointAtTileRes:d,tileRatio:f,isTube:!0}),yu(i,o,y,t)}return Promise.resolve([])}Dt(t,e,n,i,r,o){const s="__fea_idx".trim(),a=[],l=[],u=i.length;for(let c=0;c<u;c++)if((1===e||void 0===i[c].id||!this.styledFeatures[i[c].id])&&((!n.def||"default"===n.def)&&!r[c]||!0===n.def||n.def&&(void 0!==n.def.condition||Array.isArray(n.def))&&n(i[c],t))){const t=i[c];if(void 0===t[s]&&(t[s]=c),r[c]||(r[c]=[]),r[c].push(o),l.push(t),a.push(c),1===e)break}return{tileFeatures:l,tileFeaIndexes:a}}Pt(t){const{style:e,featureStyle:n}=t,i={};n.forEach(t=>{Array.isArray(t.id)?(t.id.forEach(t=>{i[t]=1}),t.filter=["in","$id",...t.id]):(i[t.id]=1,t.filter=["==","$id",t.id])});const r=Gs.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=Gs.compileStyle(n);for(let t=0;t<n.length;t++)s[t].type=1,s[t].filter.def=n[t].filter?n[t].filter.value||n[t].filter:void 0,s[t].renderPlugin&&o.push(s[t]);this.pluginConfig=r,this.featurePlugins=o,this.styledFeatures=i}Nt(t){let e=this.Ut;this.Ut||(e=this.Ut={});const n=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],i=[];for(const r in t){const o=r;if(!e[r]){const i=[];for(let e=0;e<t[r].types.length;e++){const s=t[r].types[e],a=["all",["==","$layer",o],["==","$type",n[s]]],l={filter:qe(a),renderPlugin:du(s),symbol:fu(s)};l.filter.def=a,l.type=0,i.push(l)}e[o]=i}i.push(...e[o])}return i}}function du(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 fu(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 pu(t){if(Array.isArray(t)||!j(t))return{};const e={};for(const n in t){const i=t[n];x(i)?e[n]="string":k(i)?e[n]="number":!0===i||!1===i?e[n]="boolean":Array.isArray(i)?e[n]="array":e[n]="object"}return e}function mu(t){if(!t)return 0;let e=0;for(const n in t){if(("normalTexture"===n||"bumpTexture"===n)&&t[n])return 2;if(n.indexOf("Texture")>0&&t[n])e=1;else if(j(t[n])){const i=mu(t[n]);if(2===i)return i;1===i&&(e=1)}}return e}function yu(t,e,n,i,r){const o={},s=Array.isArray(e)?e:[e];let a=-1;for(let t=0;t<s.length;t++)o[t]=gu(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 i(t,s[e],n).load(r)):l.push({data:{ref:a,symbolIndex:{index:e}}}));return Promise.all(l)}function gu(t){if(!t)return 0;for(const e in t)if(T(t[e]))return 1;return 0}function bu(t,e,n,i){const r=n.customProperties;if(!r)return t;if(r)for(let t=0;t<r.length;t++)r[t].fn=Gs.compileFilter(r[t].filter);for(let n=0;n<r.length;n++)for(let o=0,s=t.length;o<s;o++)if(r[n].fn(t[o],e))for(const t in r[n].properties){const e=r[n].properties[t];A(e)||(i[o]||(i[o]={}),i[o][t]||(i[o][t]=new Set),i[o][t].add(e))}}const vu={get:(t,e)=>e in t?t[e]:t.originalFeature[e],has:(t,e)=>e in t||e in t.originalFeature},wu={get:function(t,e){return e in t?t[e]:t[uu][e]},has:(t,e)=>e in t||e in t[uu]},xu={};function ku(t){const e={};e.originalFeature=t;const n=new Proxy(e,vu);return n.properties=new Proxy({},wu),n.properties[uu]=t.properties||xu,n}function Mu(t,e,n){t[e]||(t[e]=new Set),t[e].add(n)}const ju=[];function Au(t,e,n){if(!t)return ju;for(const i in t){if(!t[i]||!gi.checkIfZoomFnTypeSymbol(i))continue;if(T(t[i]))Mu(e,n,t[i].property);else{if("lineGradientProperty"===i){Mu(e,n,t[i]);continue}if("textName"===i)if(x(t[i])){const r=sa.resolveVarNames(t[i]);if(r)for(let t=0;t<r.length;t++)Mu(e,n,r[t])}else if(Gs.isExpression(t[i])){const r=[];sa.resolveExpVarNames(r,t[i]);for(let t=0;t<r.length;t++)Mu(e,n,r[t])}}const r=t[i].stops;if(r&&r.length)for(let t=0;t<r.length;t++)T(r[t][1])&&Mu(e,t,r[t][1].property)}return e[n]}function Fu(t,e){Tu(t.geometry,e)}function Tu(t,e){if(t)switch(t.type){case"Point":zu(t.coordinates,e);break;case"MultiPoint":case"LineString":Su(t.coordinates,e);break;case"MultiLineString":!function(t,e){for(let n=0,i=t.length;n<i;n++)Su(t[n],e)}(t.coordinates,e);break;case"Polygon":_u(t.coordinates,e);break;case"MultiPolygon":!function(t,e){for(let n=0,i=t.length;n<i;n++)_u(t[n],e)}(t.coordinates,e);break;case"GeometryCollection":const n=t.geometries.length;for(let i=0;i<n;i++)Tu(t.geometries[i],e)}}function zu(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 Su(t,e){for(let n=0,i=t.length;n<i;n++)zu(t[n],e)}function _u(t,e){t.length&&Su(t[0],e)}class Pu extends hu{constructor(t,e,n,i,r,o){super(t,e,n,i,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,n=Math.round(e);return Math.abs(n-e)<1e-14?n:e}(e.tileSize[0]/256)),this.setData(e.data,o)}setData(t,e){if(delete this.index,!t)return void e();const n={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(x(t)&&"{"!=t.substring(0,1)||t.url)S.getJSON(t.url?t.url:t,t.url?t:{},(t,i)=>{if(t&&e(t),!i)return void e(null,{extent:null,idMap:{}});const r=i,{first1000:o,idMap:s}=this.$t(r);this.Wt(o,s,r,n,e)});else{"string"==typeof t&&(t=JSON.parse(t));const i=Array.isArray(t)?t:t.features;let r=i;i&&i.length>1e3&&(r=i.slice(0,1e3)),this.Wt(r,null,t,n,e)}}Wt(t,e,n,i,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":const n=t.features.length;for(let i=0;i<n;i++)Fu(t.features[i],e);break;case"Feature":Fu(t,e);break;default:Tu(t,e)}return e}({type:"FeatureCollection",features:t}):null;this.index=function(t,e){return new rt(t,e)}(n,this.options.geojsonvt||i),r(null,{extent:o,idMap:e})}catch(t){console.warn(t),r({error:t.message})}}$t(t){const e=[],n={};let i=0;function r(t){t&&("Feature"!==t.type||t.geometry)&&(void 0!==t.id&&null!==t.id||(t.id=i++),n[t.id]=w({},t),t.geometry?(n[t.id].geometry=w({},t.geometry),n[t.id].geometry.coordinates=null):t.coordinates&&(n[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:n}}getTileFeatures(t,e){const n=t.tileInfo,i=[];if(!this.index)return setTimeout((function(){e({loading:!0})}),1),1;const r=this.index.getTile(n.z+this.zoomOffset,n.x,n.y);if(!r||0===r.features.length)return setTimeout((function(){e(null,i,[])}),1),1;const o=[];for(let t=0,e=r.features.length;t<e;t++){const e=r.features[t];let n=e.layer;void 0===n&&(n="0"),o[n]={types:{}};o[n].types[e.type]=1,e.tags=e.tags||{},e.geometry.converted||(Xl.convertGeometry(e),e.geometry.converted=1),i.push({type:e.type,layer:n,id:e.id,geometry:e.geometry,properties:e.tags,extent:this.options.extent})}for(const t in o)o[t].types=Object.keys(o[t].types).map(t=>+t);return setTimeout((function(){e(null,i,o)}),1),1}onRemove(){super.onRemove(),delete this.index}}var Iu={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,e,n,i,r){var o,s,a=8*r-i-1,l=(1<<a)-1,u=l>>1,c=-7,h=n?r-1:0,d=n?-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+=i;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,i),o-=u}return(f?-1:1)*s*Math.pow(2,o-i)},write:function(t,e,n,i,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=i?0:o-1,p=i?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[n+f]=255&a,f+=p,a/=256,r-=8);for(s=s<<r|a,u+=r;u>0;t[n+f]=255&s,f+=p,s/=256,u-=8);t[n+f-p]|=128*m}},Ou=Cu,qu=Iu;function Cu(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Cu.Varint=0,Cu.Fixed64=1,Cu.Bytes=2,Cu.Fixed32=5;var Ru="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Eu(t){return t.type===Cu.Bytes?t.readVarint()+t.pos:t.pos+1}function Nu(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Du(t,e,n){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(i);for(var r=n.pos-1;r>=t;r--)n.buf[r+i]=n.buf[r]}function Lu(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function Uu(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function $u(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function Wu(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function Ju(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function Hu(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function Gu(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Vu(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function Bu(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function Zu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Yu(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function Xu(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Cu.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var i=this.readVarint(),r=i>>3,o=this.pos;this.type=7&i,t(r,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Zu(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Xu(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Zu(this.buf,this.pos)+4294967296*Zu(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=Zu(this.buf,this.pos)+4294967296*Xu(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=qu.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=qu.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,i=this.buf;return e=127&(n=i[this.pos++]),n<128?e:(e|=(127&(n=i[this.pos++]))<<7,n<128?e:(e|=(127&(n=i[this.pos++]))<<14,n<128?e:(e|=(127&(n=i[this.pos++]))<<21,n<128?e:function(t,e,n){var i,r,o=n.buf;if(r=o[n.pos++],i=(112&r)>>4,r<128)return Nu(t,i,e);if(r=o[n.pos++],i|=(127&r)<<3,r<128)return Nu(t,i,e);if(r=o[n.pos++],i|=(127&r)<<10,r<128)return Nu(t,i,e);if(r=o[n.pos++],i|=(127&r)<<17,r<128)return Nu(t,i,e);if(r=o[n.pos++],i|=(127&r)<<24,r<128)return Nu(t,i,e);if(r=o[n.pos++],i|=(1&r)<<31,r<128)return Nu(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=i[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&&Ru?function(t,e,n){return Ru.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var i="",r=e;for(;r<n;){var o,s,a,l=t[r],u=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>n)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,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),r+=c}return i}(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!==Cu.Bytes)return t.push(this.readVarint(e));var n=Eu(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Cu.Bytes)return t.push(this.readSVarint());var e=Eu(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Cu.Bytes)return t.push(this.readBoolean());var e=Eu(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Cu.Bytes)return t.push(this.readFloat());var e=Eu(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Cu.Bytes)return t.push(this.readDouble());var e=Eu(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Cu.Bytes)return t.push(this.readFixed32());var e=Eu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Cu.Bytes)return t.push(this.readSFixed32());var e=Eu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Cu.Bytes)return t.push(this.readFixed64());var e=Eu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Cu.Bytes)return t.push(this.readSFixed64());var e=Eu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Cu.Varint)for(;this.buf[this.pos++]>127;);else if(e===Cu.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Cu.Fixed32)this.pos+=4;else{if(e!==Cu.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 n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Yu(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Yu(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Yu(this.buf,-1&t,this.pos),Yu(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Yu(this.buf,-1&t,this.pos),Yu(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 n,i;t>=0?(n=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,i=i+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((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}(i,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,n){for(var i,r,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){i>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):r=i;continue}if(i<56320){t[n++]=239,t[n++]=191,t[n++]=189,r=i;continue}i=r-55296<<10|i-56320|65536,r=null}else r&&(t[n++]=239,t[n++]=191,t[n++]=189,r=null);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:(i<65536?t[n++]=i>>12|224:(t[n++]=i>>18|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128),t[n++]=63&i|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&Du(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),qu.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),qu.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 n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var i=this.pos-n;i>=128&&Du(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,n){this.writeTag(t,Cu.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Lu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Uu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ju,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,$u,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Wu,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Hu,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Gu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Vu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Bu,e)},writeBytesField:function(t,e){this.writeTag(t,Cu.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Cu.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Cu.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Cu.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Cu.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Cu.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Cu.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Cu.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Cu.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Cu.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ku=Nt,Qu=tc;function tc(t,e,n,i,r){this.properties={},this.extent=n,this.type=0,this.Jt=t,this.Ht=-1,this.Gt=i,this.Vt=r,t.readFields(ec,this,e)}function ec(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var i=e.Gt[t.readVarint()],r=e.Vt[t.readVarint()];e.properties[i]=r}}(n,e):3==t?e.type=n.readVarint():4==t&&(e.Ht=n.pos)}function nc(t){for(var e,n,i=0,r=0,o=t.length,s=o-1;r<o;s=r++)e=t[r],i+=((n=t[s]).x-e.x)*(e.y+n.y);return i}tc.types=["Unknown","Point","LineString","Polygon"],tc.prototype.loadGeometry=function(){var t=this.Jt;t.pos=this.Ht;for(var e,n=t.readVarint()+t.pos,i=1,r=0,o=0,s=0,a=[];t.pos<n;){if(r<=0){var l=t.readVarint();i=7&l,r=l>>3}if(r--,1===i||2===i)o+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&a.push(e),e=[]),e.push(new Ku(o,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&a.push(e),a},tc.prototype.bbox=function(){var t=this.Jt;t.pos=this.Ht;for(var e=t.readVarint()+t.pos,n=1,i=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,u=-1/0;t.pos<e;){if(i<=0){var c=t.readVarint();n=7&c,i=c>>3}if(i--,1===n||2===n)(r+=t.readSVarint())<s&&(s=r),r>a&&(a=r),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==n)throw new Error("unknown command "+n)}return[s,l,a,u]},tc.prototype.toGeoJSON=function(t,e,n){var i,r,o=this.extent*Math.pow(2,n),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),u=tc.types[this.type];function c(t){for(var e=0;e<t.length;e++){var n=t[e],i=180-360*(n.y+a)/o;t[e]=[360*(n.x+s)/o-180,360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];c(l=h);break;case 2:for(i=0;i<l.length;i++)c(l[i]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var n,i,r=[],o=0;o<e;o++){var s=nc(t[o]);0!==s&&(void 0===i&&(i=s<0),i===s<0?(n&&r.push(n),n=[t[o]]):n.push(t[o]))}n&&r.push(n);return r}(l),i=0;i<l.length;i++)for(r=0;r<l[i].length;r++)c(l[i][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 ic=Qu,rc=oc;function oc(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this.Jt=t,this.Gt=[],this.Vt=[],this.Bt=[],t.readFields(sc,this,e),this.length=this.Bt.length}function sc(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e.Bt.push(n.pos):3===t?e.Gt.push(n.readString()):4===t&&e.Vt.push(function(t){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(n))}oc.prototype.feature=function(t){if(t<0||t>=this.Bt.length)throw new Error("feature index out of bounds");this.Jt.pos=this.Bt[t];var e=this.Jt.readVarint()+this.Jt.pos;return new ic(this.Jt,e,this.extent,this.Gt,this.Vt)};var ac=rc;function lc(t,e,n){if(3===t){var i=new ac(n,n.readVarint()+n.pos);i.length&&(e[i.name]=i)}}var uc=function(t,e){this.layers=t.readFields(lc,{},e)};class cc extends hu{constructor(t,e,n,i,r,o){super(t,e,n,i,r),e=e||{},o()}getTileFeatures(t,e){const n=t.tileInfo.url,i=t.fetchOptions;if(this.It.has(n)){const{err:t,data:i}=this.It.get(n);return setTimeout(()=>{this.Zt(n,t,i,e)},1)}return S.getArrayBuffer(n,i,(t,i)=>{t?t.loading||this.It.add(n,{err:t,data:i&&i.data}):i&&i.data&&this.It.add(n,{err:null,data:i.data}),this.Zt(n,t,i&&i.data,e)})}Zt(t,e,n,i){if(e)return void i(e);let r;try{r=new uc(new Ou(n))}catch(e){return void i(e.message,[],[])}const o=[];if(!r.layers)return void i(null,o,[]);const s={};let a;for(const t in r.layers)if(l=r.layers,u=t,Object.prototype.hasOwnProperty.call(l,u)){s[t]={types:{}};const n=s[t].types;for(let i=0,s=r.layers[t].length;i<s;i++)try{a=r.layers[t].feature(i),n[a.type]=1;const e={type:a.type,layer:t,geometry:a.loadGeometry(),properties:a.properties,extent:a.extent};void 0!==a.id&&(e.id=a.id),o.push(e)}catch(e){console.warn("error when load vt geometry:",e)}}var l,u;for(const t in s)s[t].types=Object.keys(s[t].types).map(t=>+t);i(null,o,s,{byteLength:n.byteLength})}abortTile(t,e){const n=this.requests[t];delete this.requests[t],n&&n.abort&&n.abort(),this.Et(t),e()}onRemove(){super.onRemove();for(const t in this.requests){const e=this.requests[t];e&&e.abort&&e.abort()}this.requests={}}}let hc=0;const dc=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}}(32);class fc{constructor(t){this.Yt={},this.Xt={},this.workerId=t}addLayer({actorId:t,mapId:e,layerId:n,params:i},r){if(this.Kt(e,n))return;const o=this.Qt(e,n),s=i.type,a=i.options,l=this.send.bind(this,t);this.Yt[o]="GeoJSONVectorTileLayer"===s?new Pu(n,a,l,dc,{},r):new cc(n,a,l,dc,{},r)}removeLayer({mapId:t,layerId:e},n){const i=this.Kt(t,e),r=this.Qt(t,e);delete this.Yt[r],i&&i.onRemove(n)}loadTile({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.loadTile(n,i)}abortTile({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.abortTile&&r.abortTile(n.url,i)}removeTile({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.removeTile(n,i)}updateStyle({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.updateStyle(n,i)}updateOptions({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.updateOptions(n,i)}setData({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.setData(n.data,i)}receive(t){const e=t.callback,n=this.Xt[e];delete this.Xt[e],n&&t.error?n(new Error(t.error)):n&&n(null,t.data)}send(t,e,n,i,r){const o=r?`${t}-${hc++}`:null;r&&(this.Xt[o]=r),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:e,params:n,callback:String(o)},i||[])}Qt(t,e){return`${t}-${e}`}Kt(t,e){const n=this.Qt(t,e);return this.Yt[n]}te(){dc.reset()}}t.initialize=function(){},t.onmessage=function(t,e){const n=t.data;if(this.dispatcher||(this.dispatcher=new fc(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const i=n.command;this.dispatcher[i]({actorId:t.actorId,mapId:n.mapId,layerId:n.layerId,params:n.params},(t,n,r)=>{t&&404!==t.status&&console.error(i,t),e(t,n,r)})}},Object.defineProperty(t,"ee",{value:!0})}';
|
|
28
|
+
const R = 'function(t){let e;const n={width:100,height:10};function i(){if(!e){const{width:t,height:i}=n;OffscreenCanvas?e=new OffscreenCanvas(t,i):(e=document.createElement("canvas"),e.width=t,e.height=i)}return e}class r{constructor(t,e={}){if(!Array.isArray(t))return void console.error("colors is not array");if(t.length<2)return void console.error("colors.length should >1");this.colors=t;let i=1/0,r=-1/0;for(let e=0,n=t.length;e<n;e++){const n=t[e][0];i=Math.min(n,i),r=Math.max(n,r)}this.min=i,this.max=r,this.valueOffset=this.max-this.min,this.options=Object.assign({},n,e),this.t()}getImageData(){return this.imgData}t(){const t=i(),{width:e,height:n}=this.options;t.width=e,t.height=n;const r=t.getContext("2d");r.clearRect(0,0,t.width,t.height);const o=r.createLinearGradient(0,0,t.width,0),{colors:s,valueOffset:a}=this;for(let t=0,e=s.length;t<e;t++){const[e,n]=s[t],i=(e-this.min)/a;o.addColorStop(i,n)}r.fillStyle=o,r.fillRect(0,0,t.width,t.height),this.imgData=r.getImageData(0,0,t.width,t.height)}getColor(t){t=Math.max(this.min,t);const e=((t=Math.min(t,this.max))-this.min)/this.valueOffset;let n=Math.round(e*this.imgData.width);n=Math.min(n,this.imgData.width-1);const i=4*n;return[this.imgData.data[i],this.imgData.data[i+1],this.imgData.data[i+2],this.imgData.data[i+3]]}}var o;function s(t,e){for(let n=0;n<t.stops.length;n++)if(e===t.stops[n][0])return t.stops[n][1];return t.default}function a(t,e){for(var n=0;n<t.stops.length&&!(e<t.stops[n][0]);n++);return t.stops[Math.max(n-1,0)][1]}function l(t,e){for(var n=void 0!==t.base?t.base:1,i=0;!(i>=t.stops.length||e<=t.stops[i][0]);)i++;return 0===i?t.stops[i][1]:i===t.stops.length?t.stops[i-1][1]:function t(e,n,i,r,o,s){return"function"==typeof o?function(){var a=o.apply(void 0,arguments),l=s.apply(void 0,arguments);return t(e,n,i,r,a,l)}:o.length?function(t,e,n,i,r,o){var s=[];for(let a=0;a<r.length;a++)s[a]=d(t,e,n,i,r[a],o[a]);return s}(e,n,i,r,o,s):d(e,n,i,r,o,s)}(e,n,t.stops[i-1][0],t.stops[i][0],t.stops[i-1][1],t.stops[i][1])}"function"==typeof Map&&(o=new Map);const u={width:100,height:1};function c(t,e){const n=t.stops;if(n&&n.length>1){let t;if(o){const e=JSON.stringify(n);if(!o.has(e)){const t=new r(n,u);o.set(e,t)}t=o.get(e)}else t=new r(n,u);const[i,s,a,l]=t.getColor(e);return[i/255,s/255,a/255,l/255]}return n&&1===n.length?n[0][1]:null}function h(t,e){return function(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:null}(e,t.default)}function d(t,e,n,i,r,o){var s,a=i-n,l=t-n;return r*(1-(s=1===e?l/a:(Math.pow(e,l)-1)/(Math.pow(e,a)-1)))+o*s}function f(t){return t&&"object"==typeof t&&(t.stops||t.property&&"identity"===t.type)}function p(t){return g(t,"exponential")}function m(t){return g(t,"interval")}function y(t,e){if(!t)return null;var n=!1;if(Array.isArray(t)){var i,r=[];for(let o=0;o<t.length;o++)(i=y(t[o],e))?(r.push(i),n=!0):r.push(t[o]);return n?r:t}var o,s={__fn_types_loaded:!0},a=[];for(o in t)t.hasOwnProperty(o)&&a.push(o);const l=function(t){Object.defineProperty(s,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=p(this["_"+t])),this["__fn_"+t].apply(this,e())},set:function(e){this["_"+t]=e},configurable:!0,enumerable:!0})};for(let e=0,i=a.length;e<i;e++)f(t[o=a[e]])?(n=!0,s["_"+o]=t[o],l(o)):s[o]=t[o];return n?s:t}function g(t,e){if(!f(t))return function(){return t};let n=!0,i=!0;const r=(t=JSON.parse(JSON.stringify(t))).stops;if(r)for(let t=0;t<r.length;t++)if(f(r[t][1])){const o=g(r[t][1],e);n=n&&o.isZoomConstant,i=i&&o.isFeatureConstant,r[t]=[r[t][0],o]}const o=function t(e,n){var i,r,o;if(f(e)){var u,d=e.stops&&"object"==typeof e.stops[0][0],p=d||void 0!==e.property,m=d||!p,y=e.type||n||"exponential";if("exponential"===y)u=l;else if("interval"===y)u=a;else if("categorical"===y)u=s;else if("identity"===y)u=h;else{if("color-interpolate"!==y)throw new Error(\'Unknown function type "\'+y+\'"\');u=c}if(d){var g={},b=[];for(let t=0;t<e.stops.length;t++){var v=e.stops[t];void 0===g[v[0].zoom]&&(g[v[0].zoom]={zoom:v[0].zoom,type:e.type,property:e.property,default:e.default,stops:[]}),g[v[0].zoom].stops.push([v[0].value,v[1]])}for(let e in g)b.push([g[e].zoom,t(g[e])]);i=function(t,n){const i=l({stops:b,base:e.base},t)(t,n);return"function"==typeof i?i(t,n):i},r=!1,o=!1}else m?(i=function(t){const n=u(e,t);return"function"==typeof n?n(t):n},r=!0,o=!1):(i=function(t,n){const i=u(e,n?n[e.property]:null);return"function"==typeof i?i(t,n):i},r=!1,o=!0)}else i=function(){return e},r=!0,o=!0;return i.isZoomConstant=o,i.isFeatureConstant=r,i}(t,e);return o.isZoomConstant=n&&o.isZoomConstant,o.isFeatureConstant=i&&o.isFeatureConstant,o}let b=0;const v="function"==typeof Object.assign;function w(t,...e){if(v)return Object.assign(t,...e),t;for(let n=0;n<e.length;n++){const i=e[n];for(const e in i)t[e]=i[e]}return t}function x(t){return!A(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function k(t){return"number"==typeof t&&!isNaN(t)}function M(t){return!A(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}function j(t){return!Array.isArray(t)&&"object"==typeof t&&!!t}function A(t){return null==t}function F(t){for(let e=1;e<arguments.length;e++){const n=arguments[e];if(n)for(let e=0,i=n.length;e<i;e++)t.push(n[e])}return t.length}function T(t){return f(t)&&t.property}const z="function"==typeof fetch&&"function"==typeof AbortController,S={jsonp:function(t,e){const n="_maptalks_jsonp_"+b++;t.match(/\\?/)?t+="&callback="+n:t+="?callback="+n;let i=document.createElement("script");return i.type="text/javascript",i.src=t,window[n]=function(t){e(null,t),document.getElementsByTagName("head")[0].removeChild(i),i=null,delete window[n]},document.getElementsByTagName("head")[0].appendChild(i),this},get:function(t,e,n){if(M(e)){const t=n;n=e,e=t}(e=e||{}).method&&(e.method=e.method.toUpperCase());const i="POST"===e.method;if(z){const i=new AbortController,r=e;return r.signal=i.signal,r.referrerPolicy=r.referrerPolicy||"origin",r.method=r.method||"GET",fetch(t,r).then(i=>{const r=this.o(i,e.returnJSON,e.responseType);r.message?(r.url=t,n(r)):r.then(t=>{"arraybuffer"===e.responseType?n(null,{data:t,cacheControl:i.headers.get("Cache-Control"),expires:i.headers.get("Expires"),contentType:i.headers.get("Content-Type")}):n(null,t)}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),n(t))})}).catch(t=>{t.code&&t.code===DOMException.ABORT_ERR||(console.error(t),n(t))}),i}{const r=S.s(n);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(i?e.body:null),r}},o:(t,e,n)=>200!==t.status?{status:t.status,statusText:t.statusText,message:`incorrect http request with status code(${t.status}): ${t.statusText}`}:"arraybuffer"===n?t.arrayBuffer():e?t.json():t.text(),u: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}`})}},s: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=S.u(e,t),e},getArrayBuffer(t,e,n){if(M(e)){const t=n;n=e,e=t}return e||(e={}),e.responseType="arraybuffer",S.get(t,e,n)}};function _(t,e,n,i,r,o){let s=r-n,a=o-i;if(0!==s||0!==a){const l=((t-n)*s+(e-i)*a)/(s*s+a*a);l>1?(n=r,i=o):l>0&&(n+=s*l,i+=a*l)}return s=t-n,a=e-i,s*s+a*a}function P(t,e,n,i,r,o){const s={id:null==t?null:t,type:e,geometry:n,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};r&&(s.layer=r);return function(t,e){const n=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)I(t,n,e);else if("Polygon"===i)I(t,n[0],e);else if("MultiLineString"===i)for(const i of n)I(t,i,e);else if("MultiPolygon"===i)for(const i of n)I(t,i[0],e)}(s,o?4:3),s}function I(t,e,n){for(let i=0;i<e.length;i+=n)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function O(t,e,n,i){if(i.layer=e,"FeatureCollection"===n.type)for(let e=0;e<n.features.length;e++)q(t,n.features[e],i,e);else"Feature"===n.type?q(t,n,i):q(t,{geometry:n},i)}function q(t,e,n,i){if(!e.geometry)return;const r=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(n.tolerance/((1<<n.maxZoom)*n.extent),2);let a=[],l=e.id;if(n.promoteId?l=e.properties[n.promoteId]:n.generateId&&(l=i||0),"Point"===o)C(r,a,n.hasAltitude);else if("MultiPoint"===o)for(const t of r)C(t,a,n.hasAltitude);else if("LineString"===o)N(r,a,s,!1,n.hasAltitude);else if("MultiLineString"===o){if(n.lineMetrics){for(const i of r)a=[],N(i,a,s,!1,n.hasAltitude),t.push(P(l,"LineString",a,e.properties,n.layer,n.hasAltitude));return}R(r,a,s,!1,n.hasAltitude)}else if("Polygon"===o)R(r,a,s,!0,n.hasAltitude);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(const r of e.geometry.geometries)q(t,{id:l,geometry:r,properties:e.properties},n,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of r){const e=[];R(t,e,s,!0,n.hasAltitude),a.push(e)}}t.push(P(l,o,a,e.properties,n.layer,n.hasAltitude))}function C(t,e,n){e.push(E(t[0]),L(t[1]),0),n&&(t.length>2?e.push(t[2]):e.push(0))}function N(t,e,n,i,r){let o,s,a=0;for(let n=0;n<t.length;n++){const l=E(t[n][0]),u=L(t[n][1]);e.push(l,u,0),r&&(t[n].length>2?e.push(t[n][2]):e.push(0)),n>0&&(a+=i?(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,n,i,r,o=3){let s=r;const a=i-n>>1;let l,u=i-n;const c=e[n],h=e[n+1],d=e[i],f=e[i+1];for(let t=n+o;t<i;t+=o){const n=_(e[t],e[t+1],c,h,d,f);if(n>s)l=t,s=n;else if(n===s){const e=Math.abs(t-a);e<u&&(l=t,u=e)}}s>r&&(l-n>o&&t(e,n,l,r,o),e[l+2]=s,i-l>o&&t(e,l,i,r,o))}(e,0,u,n,l),e[u+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function R(t,e,n,i,r){for(let o=0;o<t.length;o++){const s=[];N(t[o],s,n,i,r),e.push(s)}}function E(t){return t/360+.5}function L(t){const e=Math.sin(t*Math.PI/180),n=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return n<0?0:n>1?1:n}function D(t,e,n,i,r,o,s,a){if(i/=e,o>=(n/=e)&&s<i)return t;if(s<n||o>=i)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>=n&&u<i){l.push(e);continue}if(u<n||s>=i)continue;let c=[];if("Point"===o||"MultiPoint"===o)$(t,c,n,i,r,a.hasAltitude);else if("LineString"===o)U(t,c,n,i,r,!1,a.lineMetrics,a.hasAltitude);else if("MultiLineString"===o)J(t,c,n,i,r,!1,a.hasAltitude);else if("Polygon"===o)J(t,c,n,i,r,!0,a.hasAltitude);else if("MultiPolygon"===o)for(const e of t){const t=[];J(e,t,n,i,r,!0,a.hasAltitude),t.length&&c.push(t)}if(c.length){if(a.lineMetrics&&"LineString"===o){for(const t of c)l.push(P(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(P(e.id,o,c,e.tags,e.layer,a.hasAltitude))}}return l.length?l:null}function $(t,e,n,i,r,o){const s=o?4:3;for(let a=0;a<t.length;a+=s){const s=t[a+r];s>=n&&s<=i&&(H(e,t[a],t[a+1],t[a+2]),o&&e.push(t[a+3]))}}function U(t,e,n,i,r,o,s,a){let l=W(t);const u=0===r?G:V;let c,h,d=t.start;const f=a?4:3,p=o?t.length:t.length-f;for(let m=0;m<p;m+=f){const y=t[m],g=t[m+1],b=t[m+2];let v,w,x,k;o&&m===p-f?(v=t[0],w=t[1]):(v=t[m+f],w=t[m+f+1]),a&&(x=t[m+3],k=o&&m===p-f?t[3]:t[m+f+3]);const M=0===r?y:g,j=0===r?v:w;let A=!1;s&&(c=Math.sqrt(Math.pow(y-v,2)+Math.pow(g-w,2))),M<n?j>n&&(h=u(l,y,g,v,w,n),a&&l.push(B(x,k,h)),s&&(l.start=d+c*h)):M>i?j<i&&(h=u(l,y,g,v,w,i),a&&l.push(B(x,k,h)),s&&(l.start=d+c*h)):(H(l,y,g,b),a&&l.push(x)),j<n&&M>=n&&(h=u(l,y,g,v,w,n),a&&l.push(B(x,k,h)),A=!0),j>i&&M<=i&&(h=u(l,y,g,v,w,i),a&&l.push(B(x,k,h)),A=!0),!o&&A&&(s&&(l.end=d+c*h),e.push(l),l=W(t)),s&&(d+=c)}let m=t.length-f;if(!o){const e=t[m],o=t[m+1],s=t[m+2],u=0===r?e:o;if(u>=n&&u<=i&&H(l,e,o,s),u>=n&&u<=i&&a){const e=t[m+3];l.push(e)}}m=l.length-f,o&&m>=f&&(l[m]!==l[0]||l[m+1]!==l[1])&&(H(l,l[0],l[1],l[2]),a&&l.push(l[3])),l.length&&e.push(l)}function W(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function J(t,e,n,i,r,o,s){for(const a of t)U(a,e,n,i,r,o,!1,s)}function H(t,e,n,i){t.push(e,n,i)}function G(t,e,n,i,r,o){const s=(o-e)/(i-e);return H(t,o,n+(r-n)*s,1),s}function V(t,e,n,i,r,o){const s=(o-n)/(r-n);return H(t,e+(i-e)*s,o,1),s}function B(t,e,n){return t+(e-t)*n}function Z(t,e,n){const i=[];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=Y(o.geometry,e,n);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const t of o.geometry)a.push(Y(t,e,n))}else if("MultiPolygon"===s){a=[];for(const t of o.geometry){const i=[];for(const r of t)i.push(Y(r,e,n));a.push(i)}}i.push(P(o.id,s,a,o.tags,o.layer,n))}return i}function Y(t,e,n){const i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);const r=n?4:3;for(let o=0;o<t.length;o+=r)i.push(t[o]+e,t[o+1],t[o+2]),n&&i.push(t[o+3]);return i}function X(t,e,n){if(t.transformed)return t;const i=1<<t.z,r=t.x,o=t.y,s=n?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(K(t[l],t[l+1],e,i,r,o)),n&&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(K(t[l][a],t[l][a+1],e,i,r,o)),n&&u[u.length-1].push(t[l][a+2]);a.geometry.push(u)}}return t.transformed=!0,t}function K(t,e,n,i,r,o){return[Math.round(n*(t*i-r)),Math.round(n*(e*i-o))]}function Q(t,e,n,i,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:n,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const e of t)tt(s,e,o,r);return s}function tt(t,e,n,i){const r=e.geometry,o=e.type,s=[],a=i.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]),i.hasAltitude&&s.push(r[e+3]),t.numPoints++,t.numSimplified++;else if("LineString"===o)nt(s,r,t,n,!1,!1,i);else if("MultiLineString"===o||"Polygon"===o)for(let e=0;e<r.length;e++)nt(s,r[e],t,n,"Polygon"===o,0===e,i);else if("MultiPolygon"===o)for(let e=0;e<r.length;e++){const o=r[e];for(let e=0;e<o.length;e++)nt(s,o[e],t,n,!0,0===e,i)}if(s.length){let n=e.tags||null;if("LineString"===o&&i.lineMetrics){n={};for(const t in e.tags)n[t]=e.tags[t];n.mapbox_clip_start=r.start/r.size,n.mapbox_clip_end=r.end/r.size}const a={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:n};e.layer&&(a.layer=e.layer),null!==e.id&&(a.id=e.id),t.features.push(a)}}function et(t,e,n){return 0===t[e+2]&&t[e+3]>0&&n}function nt(t,e,n,i,r,o,s){const a=i*i,{hasAltitude:l,disableFilter:u}=s,c=l?4:3;if(!u&&i>0&&e.size<(r?a:i))return void(n.numPoints+=e.length/c);const h=[];for(let t=0;t<e.length;t+=c)(0===i||e[t+2]>a||et(e,t,l))&&(n.numSimplified++,h.push(e[t],e[t+1]),l&&h.push(e[t+3])),n.numPoints++;r&&function(t,e,n){const i=n?3:2;let r=0;for(let e=0,n=t.length,o=n-i;e<n;o=e,e+=i)r+=(t[e]-t[o])*(t[e+1]+t[o+1]);if(r>0===e){const e=i,r=i-1,o=i-2;for(let s=0,a=t.length;s<a/2;s+=i){const i=t[s],l=t[s+1];let u;n&&(u=t[s+2]),t[s]=t[a-e-s],t[s+1]=t[a-r-s],n&&(t[s+2]=t[a-o-s]),t[a-e-s]=i,t[a-r-s]=l,n&&(t[a-o-s]=u)}}}(h,o,l),t.push(h)}S.getJSON=function(t,e,n){if(M(e)){const t=n;n=e,e=t}const i=function(t,e){const i="string"==typeof e?JSON.parse(e):e||null;n(t,i)};return e&&e.jsonp?S.jsonp(t,i):((e=e||{}).returnJSON=!0,S.get(t,e,i))};const it={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 rt{constructor(t,e){const n=(e=this.options=function(t,e){for(const n in e)t[n]=e[n];return t}(Object.create(it),e)).debug;if(n&&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 i=function(t,e){const n=[];if(Array.isArray(t)){for(let i=0;i<t.length;i++)O(n,t[i].layer,t[i].data,e);return n}if("FeatureCollection"===t.type)for(let i=0;i<t.features.length;i++)q(n,t.features[i],e,i);else"Feature"===t.type?q(n,t,e):q(n,{geometry:t},e);return n}(t,e);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=function(t,e){const n=e.buffer/e.extent;let i=t;const r=D(t,1,-1-n,n,0,-1,2,e),o=D(t,1,1-n,2+n,0,-1,2,e);return(r||o)&&(i=D(t,1,-n,1+n,0,-1,2,e)||[],r&&(i=Z(r,1,e.hasAltitude).concat(i)),o&&(i=i.concat(Z(o,-1,e.hasAltitude)))),i}(i,e),i.length&&this.splitTile(i,0,0,0),n&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,n,i,r,o,s){const a=[t,e,n,i],l=this.options,u=l.debug;for(;a.length;){i=a.pop(),n=a.pop(),e=a.pop(),t=a.pop();const c=1<<e,h=ot(e,n,i);let d=this.tiles[h];if(!d&&(u>1&&console.time("creation"),d=this.tiles[h]=Q(t,e,n,i,l),this.tileCoords.push({z:e,x:n,y:i}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,n,i,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(n!==o>>t||i!==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=D(t,c,n-f,n+m,0,d.minX,d.maxX,l),k=D(t,c,n+p,n+y,0,d.minX,d.maxX,l);t=null,x&&(g=D(x,c,i-f,i+m,1,d.minY,d.maxY,l),b=D(x,c,i+p,i+y,1,d.minY,d.maxY,l),x=null),k&&(v=D(k,c,i-f,i+m,1,d.minY,d.maxY,l),w=D(k,c,i+p,i+y,1,d.minY,d.maxY,l),k=null),u>1&&console.timeEnd("clipping"),a.push(g||[],e+1,2*n,2*i),a.push(b||[],e+1,2*n,2*i+1),a.push(v||[],e+1,2*n+1,2*i),a.push(w||[],e+1,2*n+1,2*i+1)}}getTile(t,e,n){t=+t,e=+e,n=+n;const i=this.options,{extent:r,debug:o}=i,{hasAltitude:s}=i;if(t<0||t>24)return null;const a=1<<t,l=ot(t,e=e+a&a-1,n);if(this.tiles[l])return X(this.tiles[l],r,s);o>1&&console.log("drilling down to z%d-%d-%d",t,e,n);let u,c=t,h=e,d=n;for(;!u&&c>0;)c--,h>>=1,d>>=1,u=this.tiles[ot(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,n),o>1&&console.timeEnd("drilling down"),this.tiles[l]?X(this.tiles[l],r,s):null):null}}function ot(t,e,n){return 32*((1<<t)*n+e)+t}function st(t,e,n,i,r,o){const s=n&&Array.isArray(n[0]);for(let a=0,l=n.length;a<l;a++){t[e]=Math.round((s?n[a][0]:n[a].x)*i),t[e+1]=Math.round((s?n[a][1]:n[a].y)*i);let u=r||0;Array.isArray(r)&&(u=r[a]),u=u?Math.round(i*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 at(t,e,n,i){const r=t[3*e],o=t[3*e+1],s=t[3*n],a=t[3*n+1];return r===s&&(r<0||r>i)||o===a&&(o<0||o>i)}class lt{constructor(t,e){this.x=t,this.y=e}clone(){return new lt(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 lt(this.x-t.x,this.y-t.y)}distance(t){const e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)}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 lt(this.y,-this.x)}}function ut(t,e,n){const i=(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x);return i>1e-5?1:i<-1e-5?2:0}function ct(t,e,n,i){const r=e.x*i.y-e.y*i.x,o=n.x-t.x,s=n.y-t.y,a=(o*i.y-s*i.x)/r;return new lt(t.x+a*e.x,t.y+a*e.y)}const ht=[];function dt(t,e,n){let i=0;const r=[];for(let o=e;o<n;o+=3)ht[i]?(ht[i].x=t[o],ht[i].y=t[o+1]):ht[i]=new lt(t[o],t[o+1]),r.push(ht[i]),i++;const o=function(t){let e;this.UpdateOmbb=function(t,n,i,r,o,s,a,l){const u=ct(t,n,o,s),c=ct(i,r,o,s),h=ct(a,l,t,n),d=ct(a,l,i,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 n=[];for(let e=0;e<t.length;e++)n.push(t[(e+1)%t.length].diff(t[e])),n[e].normalize();const i=new lt(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),r=new lt(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);let o,s,a,l;for(let e=0;e<t.length;e++){const n=t[e];n.x<i.x&&(i.x=n.x,o=e),n.x>r.x&&(r.x=n.x,s=e),n.y<i.y&&(i.y=n.y,l=e),n.y>r.y&&(r.y=n.y,a=e)}let u=new lt(0,-1),c=new lt(0,1),h=new lt(-1,0),d=new lt(1,0);for(let e=0;e<t.length;e++){const e=[Math.acos(u.dot(n[o])),Math.acos(c.dot(n[s])),Math.acos(h.dot(n[a])),Math.acos(d.dot(n[l]))];switch(e.indexOf(Math.min.apply(Math,e))){case 0:u=n[o].clone(),c=u.clone(),c.negate(),h=u.orthogonal(),d=h.clone(),d.negate(),o=(o+1)%t.length;break;case 1:c=n[s].clone(),u=c.clone(),u.negate(),h=u.orthogonal(),d=h.clone(),d.negate(),s=(s+1)%t.length;break;case 2:h=n[a].clone(),d=h.clone(),d.negate(),u=d.orthogonal(),c=u.clone(),c.negate(),a=(a+1)%t.length;break;case 3:d=n[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 n=[];for(let n=1;n<t.length;n++)(t[n].x<e.x||Math.abs(t[n].x-e.x)<1e-5&&t[n].y<e.y)&&(e=t[n]);let i=t[0];do{n.unshift(e.clone());for(let n=1;n<t.length;n++){const r=ut(e,i,t[n]);(i.equals(e)||1===r||0===r&&e.distance(t[n])>e.distance(i))&&(i=t[n])}e=i}while(!i.equals(n[n.length-1]));return n}(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 ft="undefined"!=typeof Float32Array?Float32Array:Array;function pt(){var t=new ft(3);return ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function mt(t,e,n){var i=new ft(3);return i[0]=t,i[1]=e,i[2]=n,i}function yt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function gt(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function bt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function vt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function wt(t,e){var n=e[0],i=e[1],r=e[2],o=n*n+i*i+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 xt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function kt(t,e,n){var i=e[0],r=e[1],o=e[2],s=n[0],a=n[1],l=n[2];return t[0]=r*l-o*a,t[1]=o*s-i*l,t[2]=i*a-r*s,t}var Mt=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t};function jt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function At(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function Ft(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function Tt(){var t=new ft(4);return ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function zt(t,e){var n=e[0]+e[4]+e[8],i=void 0;if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;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;i=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*s+s]+1),t[r]=.5*i,i=.5/i,t[3]=(e[3*o+s]-e[3*s+o])*i,t[o]=(e[3*o+r]+e[3*r+o])*i,t[s]=(e[3*s+r]+e[3*r+s])*i}return t}pt(),function(){var t,e=(t=new ft(4),ft!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();var St,_t=Ft,Pt=function(t,e){var n=e[0],i=e[1],r=e[2],o=e[3],s=n*n+i*i+r*r+o*o;return s>0&&(s=1/Math.sqrt(s),t[0]=n*s,t[1]=i*s,t[2]=r*s,t[3]=o*s),t};function It(t,e){var n=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(n*n+i*i)}pt(),mt(1,0,0),mt(0,1,0),Tt(),Tt(),St=new ft(9),ft!=Float32Array&&(St[1]=0,St[2]=0,St[3]=0,St[5]=0,St[6]=0,St[7]=0),St[0]=1,St[4]=1,St[8]=1;var Ot=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)};function qt(t,e,n,i,r,o,s,a,l,u){0===t?function(t,e,n,i,r,o,s,a,l){const u=[0,0];for(let r=t;r<e;r+=3){const t=r/3*2,e=i[r],c=i[r+1];n[t]=u[0]+e*o*s/a,n[t+1]=u[1]-c*o*s/l}}(e,n,i,r,0,s,a,l,u):1===t&&function(t,e,n,i){const r=dt(i,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=It(s,a),d=It(a,l);for(let r=t;r<e;r+=3){const t=r/3*2,e=i[r],o=i[r+1];n[t]=Nt(e,o,s,u,h),n[t+1]=-Nt(e,o,a,c,d)}}(e,n,i,r)}!function(){var t=function(){var t=new ft(2);return ft!=Float32Array&&(t[0]=0,t[1]=0),t}()}();const Ct=[];function Nt(t,e,n,i,r){return Ct[0]=(i*i*n[0]+i*(e-n[1])+t)/(i*i+1),Ct[1]=i*(Ct[0]-n[0])+n[1],It(n,Ct)/r}function Rt(t,e,n,i,r){const o=3*e[n-1],s=3*e[n-1]+1,a=t[o],l=t[s];return u=i,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 Et=Lt;function Lt(t,e){this.x=t,this.y=e}function Dt(t,e,n){n=n||{},this.w=t||64,this.h=e||64,this.autoResize=!!n.autoResize,this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0}function $t(t,e,n){this.x=0,this.y=t,this.w=this.free=e,this.h=n}function Ut(t,e,n,i,r,o,s){this.id=t,this.x=e,this.y=n,this.w=i,this.h=r,this.maxw=o||i,this.maxh=s||r,this.refcount=0}Lt.prototype={clone:function(){return new Lt(this.x,this.y)},add:function(t){return this.clone().m(t)},sub:function(t){return this.clone().v(t)},multByPoint:function(t){return this.clone().k(t)},divByPoint:function(t){return this.clone().M(t)},mult:function(t){return this.clone().j(t)},div:function(t){return this.clone().A(t)},rotate:function(t){return this.clone().F(t)},rotateAround:function(t,e){return this.clone().T(t,e)},matMult:function(t){return this.clone().S(t)},unit:function(){return this.clone()._()},perp:function(){return this.clone().P()},round:function(){return this.clone().I()},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,n=t.y-this.y;return e*e+n*n},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)},S:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},m:function(t){return this.x+=t.x,this.y+=t.y,this},v:function(t){return this.x-=t.x,this.y-=t.y,this},j:function(t){return this.x*=t,this.y*=t,this},A:function(t){return this.x/=t,this.y/=t,this},k: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},_:function(){return this.A(this.mag()),this},P:function(){var t=this.y;return this.y=this.x,this.x=-t,this},F:function(t){var e=Math.cos(t),n=Math.sin(t),i=e*this.x-n*this.y,r=n*this.x+e*this.y;return this.x=i,this.y=r,this},T:function(t,e){var n=Math.cos(t),i=Math.sin(t),r=e.x+n*(this.x-e.x)-i*(this.y-e.y),o=e.y+i*(this.x-e.x)+n*(this.y-e.y);return this.x=r,this.y=o,this},I:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Lt.convert=function(t){return t instanceof Lt?t:Array.isArray(t)?new Lt(t[0],t[1]):t},Dt.prototype.pack=function(t,e){t=[].concat(t),e=e||{};for(var n,i,r,o,s=[],a=0;a<t.length;a++)if(n=t[a].w||t[a].width,i=t[a].h||t[a].height,r=t[a].id,n&&i){if(!(o=this.packOne(n,i,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},Dt.prototype.packOne=function(t,e,n){var i,r,o,s,a,l,u,c,h={freebin:-1,shelf:-1,waste:1/0},d=0;if("string"==typeof n||"number"==typeof n){if(i=this.getBin(n))return this.ref(i),i;"number"==typeof n&&(this.maxId=Math.max(n,this.maxId))}else n=++this.maxId;for(s=0;s<this.freebins.length;s++){if(e===(i=this.freebins[s]).maxh&&t===i.maxw)return this.allocFreebin(s,t,e,n);e>i.maxh||t>i.maxw||e<=i.maxh&&t<=i.maxw&&(o=i.maxw*i.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,n);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,n):-1!==h.shelf?this.allocShelf(h.shelf,t,e,n):e<=this.h-d&&t<=this.w?(r=new $t(d,this.w,e),this.allocShelf(this.shelves.push(r)-1,t,e,n)):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,n)):null},Dt.prototype.allocFreebin=function(t,e,n,i){var r=this.freebins.splice(t,1)[0];return r.id=i,r.w=e,r.h=n,r.refcount=0,this.bins[i]=r,this.ref(r),r},Dt.prototype.allocShelf=function(t,e,n,i){var r=this.shelves[t].alloc(e,n,i);return this.bins[i]=r,this.ref(r),r},Dt.prototype.shrink=function(){if(this.shelves.length>0){for(var t=0,e=0,n=0;n<this.shelves.length;n++){var i=this.shelves[n];e+=i.h,t=Math.max(i.w-i.free,t)}this.resize(t,e)}},Dt.prototype.getBin=function(t){return this.bins[t]},Dt.prototype.ref=function(t){if(1==++t.refcount){var e=t.h;this.stats[e]=1+(0|this.stats[e])}return t.refcount},Dt.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)},Dt.prototype.clear=function(){this.shelves=[],this.freebins=[],this.stats={},this.bins={},this.maxId=0},Dt.prototype.resize=function(t,e){this.w=t,this.h=e;for(var n=0;n<this.shelves.length;n++)this.shelves[n].resize(t);return!0},$t.prototype.alloc=function(t,e,n){if(t>this.free||e>this.h)return null;var i=this.x;return this.x+=t,this.free-=t,new Ut(n,i,this.y,t,e,t,this.h)},$t.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0};var Wt={exports:{}},Jt={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]},Ht={exports:{}},Gt=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))},Vt=Array.prototype.concat,Bt=Array.prototype.slice,Zt=Ht.exports=function(t){for(var e=[],n=0,i=t.length;n<i;n++){var r=t[n];Gt(r)?e=Vt.call(e,Bt.call(r)):e.push(r)}return e};Zt.wrap=function(t){return function(){return t(Zt(arguments))}};var Yt=Jt,Xt=Ht.exports,Kt=Object.hasOwnProperty,Qt=Object.create(null);for(var te in Yt)Kt.call(Yt,te)&&(Qt[Yt[te]]=te);var ee=Wt.exports={to:{},get:{}};function ne(t,e,n){return Math.min(Math.max(e,t),n)}function ie(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}ee.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=ee.get.hsl(t),n="hsl";break;case"hwb":e=ee.get.hwb(t),n="hwb";break;default:e=ee.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},ee.get.rgb=function(t){if(!t)return null;var e,n,i,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var o=2*n;r[n]=parseInt(e.slice(o,o+2),16)}i&&(r[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);i&&(r[3]=parseInt(i+i,16)/255)}else if(e=t.match(/^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+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]:Kt.call(Yt,e[1])?((r=Yt[e[1]])[3]=1,r):null:null;for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=ne(r[n],0,255);return r[3]=ne(r[3],0,1),r},ee.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 n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,ne(parseFloat(e[2]),0,100),ne(parseFloat(e[3]),0,100),ne(isNaN(n)?1:n,0,1)]}return null},ee.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 n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,ne(parseFloat(e[2]),0,100),ne(parseFloat(e[3]),0,100),ne(isNaN(n)?1:n,0,1)]}return null},ee.to.hex=function(){var t=Xt(arguments);return"#"+ie(t[0])+ie(t[1])+ie(t[2])+(t[3]<1?ie(Math.round(255*t[3])):"")},ee.to.rgb=function(){var t=Xt(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]+")"},ee.to.rgb.percent=function(){var t=Xt(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+i+"%)":"rgba("+e+"%, "+n+"%, "+i+"%, "+t[3]+")"},ee.to.hsl=function(){var t=Xt(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},ee.to.hwb=function(){var t=Xt(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},ee.to.keyword=function(t){return Qt[t.slice(0,3)]};var re={exports:{}},oe=Jt,se={};for(var ae in oe)oe.hasOwnProperty(ae)&&(se[oe[ae]]=ae);var le=re.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 ue in le)if(le.hasOwnProperty(ue)){if(!("channels"in le[ue]))throw new Error("missing channels property: "+ue);if(!("labels"in le[ue]))throw new Error("missing channel labels property: "+ue);if(le[ue].labels.length!==le[ue].channels)throw new Error("channel and label counts mismatch: "+ue);var ce=le[ue].channels,he=le[ue].labels;delete le[ue].channels,delete le[ue].labels,Object.defineProperty(le[ue],"channels",{value:ce}),Object.defineProperty(le[ue],"labels",{value:he})}function de(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}le.rgb.hsl=function(t){var e,n,i=t[0]/255,r=t[1]/255,o=t[2]/255,s=Math.min(i,r,o),a=Math.max(i,r,o),l=a-s;return a===s?e=0:i===a?e=(r-o)/l:r===a?e=2+(o-i)/l:o===a&&(e=4+(i-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+a)/2,[e,100*(a===s?0:n<=.5?l/(a+s):l/(2-a-s)),100*n]},le.rgb.hsv=function(t){var e,n,i,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),n=h(a),i=h(l),s===u?r=i-n:a===u?r=1/3+e-i:l===u&&(r=2/3+n-e),r<0?r+=1:r>1&&(r-=1)),[360*r,100*o,100*u]},le.rgb.hwb=function(t){var e=t[0],n=t[1],i=t[2];return[le.rgb.hsl(t)[0],100*(1/255*Math.min(e,Math.min(n,i))),100*(i=1-1/255*Math.max(e,Math.max(n,i)))]},le.rgb.cmyk=function(t){var e,n=t[0]/255,i=t[1]/255,r=t[2]/255;return[100*((1-n-(e=Math.min(1-n,1-i,1-r)))/(1-e)||0),100*((1-i-e)/(1-e)||0),100*((1-r-e)/(1-e)||0),100*e]},le.rgb.keyword=function(t){var e=se[t];if(e)return e;var n,i=1/0;for(var r in oe)if(oe.hasOwnProperty(r)){var o=de(t,oe[r]);o<i&&(i=o,n=r)}return n},le.keyword.rgb=function(t){return oe[t]},le.rgb.xyz=function(t){var e=t[0]/255,n=t[1]/255,i=t[2]/255;return[100*(.4124*(e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92)+.3576*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.1805*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)),100*(.2126*e+.7152*n+.0722*i),100*(.0193*e+.1192*n+.9505*i)]},le.rgb.lab=function(t){var e=le.rgb.xyz(t),n=e[0],i=e[1],r=e[2];return i/=100,r/=108.883,n=(n/=95.047)>.008856?Math.pow(n,1/3):7.787*n+16/116,[116*(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116)-16,500*(n-i),200*(i-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]},le.hsl.rgb=function(t){var e,n,i,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-(n=l<.5?l*(1+a):l+a-l*a),r=[0,0,0];for(var u=0;u<3;u++)(i=s+1/3*-(u-1))<0&&i++,i>1&&i--,o=6*i<1?e+6*(n-e)*i:2*i<1?n:3*i<2?e+(n-e)*(2/3-i)*6:e,r[u]=255*o;return r},le.hsl.hsv=function(t){var e=t[0],n=t[1]/100,i=t[2]/100,r=n,o=Math.max(i,.01);return n*=(i*=2)<=1?i:2-i,r*=o<=1?o:2-o,[e,100*(0===i?2*r/(o+r):2*n/(i+n)),100*((i+n)/2)]},le.hsv.rgb=function(t){var e=t[0]/60,n=t[1]/100,i=t[2]/100,r=Math.floor(e)%6,o=e-Math.floor(e),s=255*i*(1-n),a=255*i*(1-n*o),l=255*i*(1-n*(1-o));switch(i*=255,r){case 0:return[i,l,s];case 1:return[a,i,s];case 2:return[s,i,l];case 3:return[s,a,i];case 4:return[l,s,i];case 5:return[i,s,a]}},le.hsv.hsl=function(t){var e,n,i,r=t[0],o=t[1]/100,s=t[2]/100,a=Math.max(s,.01);return i=(2-o)*s,n=o*a,[r,100*(n=(n/=(e=(2-o)*a)<=1?e:2-e)||0),100*(i/=2)]},le.hwb.rgb=function(t){var e,n,i,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),i=6*l-(e=Math.floor(6*l)),0!=(1&e)&&(i=1-i),r=u+i*((n=1-c)-u),e){default:case 6:case 0:o=n,s=r,a=u;break;case 1:o=r,s=n,a=u;break;case 2:o=u,s=n,a=r;break;case 3:o=u,s=r,a=n;break;case 4:o=r,s=u,a=n;break;case 5:o=n,s=u,a=r}return[255*o,255*s,255*a]},le.cmyk.rgb=function(t){var e=t[0]/100,n=t[1]/100,i=t[2]/100,r=t[3]/100;return[255*(1-Math.min(1,e*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r))]},le.xyz.rgb=function(t){var e,n,i,r=t[0]/100,o=t[1]/100,s=t[2]/100;return n=-.9689*r+1.8758*o+.0415*s,i=.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,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,[255*(e=Math.min(Math.max(0,e),1)),255*(n=Math.min(Math.max(0,n),1)),255*(i=Math.min(Math.max(0,i),1))]},le.xyz.lab=function(t){var e=t[0],n=t[1],i=t[2];return n/=100,i/=108.883,e=(e/=95.047)>.008856?Math.pow(e,1/3):7.787*e+16/116,[116*(n=n>.008856?Math.pow(n,1/3):7.787*n+16/116)-16,500*(e-n),200*(n-(i=i>.008856?Math.pow(i,1/3):7.787*i+16/116))]},le.lab.xyz=function(t){var e,n,i,r=t[0];e=t[1]/500+(n=(r+16)/116),i=n-t[2]/200;var o=Math.pow(n,3),s=Math.pow(e,3),a=Math.pow(i,3);return n=o>.008856?o:(n-16/116)/7.787,e=s>.008856?s:(e-16/116)/7.787,i=a>.008856?a:(i-16/116)/7.787,[e*=95.047,n*=100,i*=108.883]},le.lab.lch=function(t){var e,n=t[0],i=t[1],r=t[2];return(e=360*Math.atan2(r,i)/2/Math.PI)<0&&(e+=360),[n,Math.sqrt(i*i+r*r),e]},le.lch.lab=function(t){var e,n=t[0],i=t[1];return e=t[2]/360*2*Math.PI,[n,i*Math.cos(e),i*Math.sin(e)]},le.rgb.ansi16=function(t){var e=t[0],n=t[1],i=t[2],r=1 in arguments?arguments[1]:le.rgb.hsv(t)[2];if(0===(r=Math.round(r/50)))return 30;var o=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(e/255));return 2===r&&(o+=60),o},le.hsv.ansi16=function(t){return le.rgb.ansi16(le.hsv.rgb(t),t[2])},le.rgb.ansi256=function(t){var e=t[0],n=t[1],i=t[2];return e===n&&n===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},le.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 n=.5*(1+~~(t>50));return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},le.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}var n;return t-=16,[Math.floor(t/36)/5*255,Math.floor((n=t%36)/6)/5*255,n%6/5*255]},le.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},le.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 n=e[0];3===e[0].length&&(n=n.split("").map((function(t){return t+t})).join(""));var i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},le.rgb.hcg=function(t){var e,n=t[0]/255,i=t[1]/255,r=t[2]/255,o=Math.max(Math.max(n,i),r),s=Math.min(Math.min(n,i),r),a=o-s;return e=a<=0?0:o===n?(i-r)/a%6:o===i?2+(r-n)/a:4+(n-i)/a+4,e/=6,[360*(e%=1),100*a,100*(a<1?s/(1-a):0)]},le.hsl.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=1,r=0;return(i=n<.5?2*e*n:2*e*(1-n))<1&&(r=(n-.5*i)/(1-i)),[t[0],100*i,100*r]},le.hsv.hcg=function(t){var e=t[1]/100,n=t[2]/100,i=e*n,r=0;return i<1&&(r=(n-i)/(1-i)),[t[0],100*i,100*r]},le.hcg.rgb=function(t){var e=t[0]/360,n=t[1]/100,i=t[2]/100;if(0===n)return[255*i,255*i,255*i];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-n)*i,[255*(n*o[0]+r),255*(n*o[1]+r),255*(n*o[2]+r)]},le.hcg.hsv=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e),i=0;return n>0&&(i=e/n),[t[0],100*i,100*n]},le.hcg.hsl=function(t){var e=t[1]/100,n=t[2]/100*(1-e)+.5*e,i=0;return n>0&&n<.5?i=e/(2*n):n>=.5&&n<1&&(i=e/(2*(1-n))),[t[0],100*i,100*n]},le.hcg.hwb=function(t){var e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},le.hwb.hcg=function(t){var e=t[1]/100,n=1-t[2]/100,i=n-e,r=0;return i<1&&(r=(n-i)/(1-i)),[t[0],100*i,100*r]},le.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},le.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},le.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},le.gray.hsl=le.gray.hsv=function(t){return[0,0,t[0]]},le.gray.hwb=function(t){return[0,100,t[0]]},le.gray.cmyk=function(t){return[0,0,0,t[0]]},le.gray.lab=function(t){return[t[0],0,0]},le.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(n.length)+n},le.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};var fe=re.exports;function pe(t){var e=function(){for(var t={},e=Object.keys(fe),n=e.length,i=0;i<n;i++)t[e[i]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;)for(var i=n.pop(),r=Object.keys(fe[i]),o=r.length,s=0;s<o;s++){var a=r[s],l=e[a];-1===l.distance&&(l.distance=e[i].distance+1,l.parent=i,n.unshift(a))}return e}function me(t,e){return function(n){return e(t(n))}}function ye(t,e){for(var n=[e[t].parent,t],i=fe[e[t].parent][t],r=e[t].parent;e[r].parent;)n.unshift(e[r].parent),i=me(fe[e[r].parent][r],i),r=e[r].parent;return i.conversion=n,i}var ge=re.exports,be=function(t){for(var e=pe(t),n={},i=Object.keys(e),r=i.length,o=0;o<r;o++){var s=i[o];null!==e[s].parent&&(n[s]=ye(s,e))}return n},ve={};Object.keys(ge).forEach((function(t){ve[t]={},Object.defineProperty(ve[t],"channels",{value:ge[t].channels}),Object.defineProperty(ve[t],"labels",{value:ge[t].labels});var e=be(t);Object.keys(e).forEach((function(n){var i=e[n];ve[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var i=n.length,r=0;r<i;r++)n[r]=Math.round(n[r]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}(i),ve[t][n].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}(i)}))}));var we=ve,xe=Wt.exports,ke=we,Me=[].slice,je=["keyword","gray","hex"],Ae={};Object.keys(ke).forEach((function(t){Ae[Me.call(ke[t].labels).sort().join("")]=t}));var Fe={};function Te(t,e){if(!(this instanceof Te))return new Te(t,e);if(e&&e in je&&(e=null),e&&!(e in ke))throw new Error("Unknown model: "+e);var n,i;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof Te)this.model=t.model,this.color=t.color.slice(),this.valpha=t.valpha;else if("string"==typeof t){var r=xe.get(t);if(null===r)throw new Error("Unable to parse color from string: "+t);this.model=r.model,i=ke[this.model].channels,this.color=r.value.slice(0,i),this.valpha="number"==typeof r.value[i]?r.value[i]:1}else if(t.length){this.model=e||"rgb",i=ke[this.model].channels;var o=Me.call(t,0,i);this.color=Pe(o,i),this.valpha="number"==typeof t[i]?t[i]: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 Ae))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Ae[a];var l=ke[this.model].labels,u=[];for(n=0;n<l.length;n++)u.push(t[l[n]]);this.color=Pe(u)}if(Fe[this.model])for(i=ke[this.model].channels,n=0;n<i;n++){var c=Fe[this.model][n];c&&(this.color[n]=c(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}function ze(t,e,n){return(t=Array.isArray(t)?t:[t]).forEach((function(t){(Fe[t]||(Fe[t]=[]))[e]=n})),t=t[0],function(i){var r;return arguments.length?(n&&(i=n(i)),(r=this[t]()).color[e]=i,r):(r=this[t]().color[e],n&&(r=n(r)),r)}}function Se(t){return function(e){return Math.max(0,Math.min(t,e))}}function _e(t){return Array.isArray(t)?t:[t]}function Pe(t,e){for(var n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}Te.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(t){var e=this.model in xe.to?this:this.rgb(),n=1===(e=e.round("number"==typeof t?t:1)).valpha?e.color:e.color.concat(this.valpha);return xe.to[e.model](n)},percentString:function(t){var e=this.rgb().round("number"==typeof t?t:1),n=1===e.valpha?e.color:e.color.concat(this.valpha);return xe.to.rgb.percent(n)},array:function(){return 1===this.valpha?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var t={},e=ke[this.model].channels,n=ke[this.model].labels,i=0;i<e;i++)t[n[i]]=this.color[i];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 Te(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 Te(this.color.concat(Math.max(0,Math.min(1,t))),this.model):this.valpha},red:ze("rgb",0,Se(255)),green:ze("rgb",1,Se(255)),blue:ze("rgb",2,Se(255)),hue:ze(["hsl","hsv","hsl","hwb","hcg"],0,(function(t){return(t%360+360)%360})),saturationl:ze("hsl",1,Se(100)),lightness:ze("hsl",2,Se(100)),saturationv:ze("hsv",1,Se(100)),value:ze("hsv",2,Se(100)),chroma:ze("hcg",1,Se(100)),gray:ze("hcg",2,Se(100)),white:ze("hwb",1,Se(100)),wblack:ze("hwb",2,Se(100)),cyan:ze("cmyk",0,Se(100)),magenta:ze("cmyk",1,Se(100)),yellow:ze("cmyk",2,Se(100)),black:ze("cmyk",3,Se(100)),x:ze("xyz",0,Se(100)),y:ze("xyz",1,Se(100)),z:ze("xyz",2,Se(100)),l:ze("lab",0,Se(100)),a:ze("lab",1),b:ze("lab",2),keyword:function(t){return arguments.length?new Te(t):ke[this.model].keyword(this.color)},hex:function(t){return arguments.length?new Te(t):xe.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=[],n=0;n<t.length;n++){var i=t[n]/255;e[n]=i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.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 Te.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(),n=e.color[0];return n=(n=(n+t)%360)<0?360+n:n,e.color[0]=n,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 n=t.rgb(),i=this.rgb(),r=void 0===e?.5:e,o=2*r-1,s=n.alpha()-i.alpha(),a=((o*s==-1?o:(o+s)/(1+o*s))+1)/2,l=1-a;return Te.rgb(a*n.red()+l*i.red(),a*n.green()+l*i.green(),a*n.blue()+l*i.blue(),n.alpha()*r+i.alpha()*(1-r))}},Object.keys(ke).forEach((function(t){if(-1===je.indexOf(t)){var e=ke[t].channels;Te.prototype[t]=function(){if(this.model===t)return new Te(this);if(arguments.length)return new Te(arguments,t);var n="number"==typeof arguments[e]?e:this.valpha;return new Te(_e(ke[this.model][t].raw(this.color)).concat(n),t)},Te[t]=function(n){return"number"==typeof n&&(n=Pe(Me.call(arguments),e)),new Te(n,t)}}}));var Ie=Te;\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 */const Oe=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function qe(t){if(!t)return"true";const e=t[0];if(t.length<=1)return"any"===e?"false":"true";return`(${"=="===e?Ne(t[1],t[2],"===",!1):"!="===e?Ne(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?Ne(t[1],t[2],e,!0):"any"===e?Ee(t.slice(1),"||"):"all"===e?Ee(t.slice(1),"&&"):"none"===e?$e(Ee(t.slice(1),"||")):"in"===e?Le(t[1],t.slice(2)):"!in"===e?$e(Le(t[1],t.slice(2))):"has"===e?De(t[1]):"!has"===e?$e(De(t[1])):"contains"===e?function(t,e,n){const i=Ce(t);return void 0!==n?`(${i} + \'\').indexOf("${e}") === ${n}`:`(${i} + \'\').indexOf("${e}") >= 0`}(t[1],t[2],t[3]):"true"})`}function Ce(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function Ne(t,e,n,i){if("object"==typeof(r=t)&&r&&t.op)return function(t,e,n,i){const r=t.property,o=t.op;let s=Ce(r);return"length"!==o?(console.error(`not support ${o} op`),"false"):(s=`((${s}+=\'\').length)`,Re(s,r,e,n,i))}(t,e,n,i);var r;return Re(Ce(t),t,e,n,i)}function Re(t,e,n,i,r){const o="$type"===e?Oe.indexOf(n):JSON.stringify(n);return(r?`typeof ${t}=== typeof ${o}&&`:"")+t+i+o}function Ee(t,e){return t.map(qe).join(e)}function Le(t,e){"$type"===t&&(e=e.map(t=>Oe.indexOf(t)));const n=JSON.stringify(e.sort(Ue)),i=Ce(t);return e.length<=200?`${n}.indexOf(${i}) !== -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; }(${i}, ${n},0,${e.length-1})`}function De(t){return"$id"===t?\'"id" in f\':JSON.stringify(t)+" in p"}function $e(t){return`!(${t})`}function Ue(t,e){return t<e?-1:t>e?1:0}var We={exports:{}};We.exports=function(){function t(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function e(t,e){return t<e?-1:t>e?1:0}return function(n,i,r,o,s){!function e(n,i,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,l=i-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(i-l*c/a+h)),f=Math.min(o,Math.floor(i+(a-l)*c/a+h));e(n,i,d,f,s)}var p=n[i],m=r,y=o;for(t(n,r,i),s(n[o],p)>0&&t(n,r,o);m<y;){for(t(n,m,y),m++,y--;s(n[m],p)<0;)m++;for(;s(n[y],p)>0;)y--}0===s(n[r],p)?t(n,r,y):(y++,t(n,y,o)),y<=i&&(r=y+1),i<=y&&(o=y-1)}}(n,i,r||0,o||n.length-1,s||e)}}();var Je=We.exports,He={exports:{}};function Ge(t,e){if(!(this instanceof Ge))return new Ge(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||Ve,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this.O(n)}function Ve(t,e){return t<e?-1:t>e?1:0}He.exports=Ge,He.exports.default=Ge,Ge.prototype={push:function(t){this.data.push(t),this.length++,this.q(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.O(0)),this.data.pop(),t}},peek:function(){return this.data[0]},q:function(t){for(var e=this.data,n=this.compare,i=e[t];t>0;){var r=t-1>>1,o=e[r];if(n(i,o)>=0)break;e[t]=o,t=r}e[t]=i},O:function(t){for(var e=this.data,n=this.compare,i=this.length>>1,r=e[t];t<i;){var o=1+(t<<1),s=o+1,a=e[o];if(s<this.length&&n(e[s],a)<0&&(o=s,a=e[s]),n(a,r)>=0)break;e[t]=a,t=o}e[t]=r}};var Be=He.exports;class Ze{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 Ye{constructor(t,e,n,i){this.a=i.a,this.b=i.b,this.c=i.c,this.v1=t,this.v2=e,this.v3=n,this.normal=[],this.computeNormal(),t.faces.push(this),t.addUniqueNeighbor(e),t.addUniqueNeighbor(n),e.faces.push(this),e.addUniqueNeighbor(t),e.addUniqueNeighbor(n),n.faces.push(this),n.addUniqueNeighbor(t),n.addUniqueNeighbor(e)}computeNormal(){const t=this.v1.position,e=this.v2.position,n=this.v3.position,i=kt([],Mt([],n,e),Mt([],t,e));wt(this.normal,i)}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 Xe=[],Ke=[],Qe=[],tn=[];function en(t,e,n){const i=kt(Ke,e,n);t=zt(t,function(t,e,n,i,r,o,s,a,l,u){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=o,t[5]=s,t[6]=a,t[7]=l,t[8]=u,t}(Xe,n[0],n[1],n[2],...i,...e));if((t=function(t){return t[3]<0?_t(t,t,-1):t}(t=Pt(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=n[3]>0?kt(Qe,n,e):kt(Qe,e,n);return xt(kt(tn,n,e),r)<0&&_t(t,t,-1),t}function nn(t,e){const n=[],i=[];let r=0;for(r=0;r<t.length;r+=3){const e=new Ze([t[r],t[r+1],t[r+2]],r/3);n.push(e)}if(!e.length){const t=e;e=[];for(let n=0;n<t;n++)e.push(n)}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 Ye(n[t.a],n[t.b],n[t.c],t)}const o=[],s=[0,0,0];for(r=0;r<n.length;r++){const t=n[r],e=t.index;gt(s,0,0,0);let a=t.faces.length;for(let e=0;e<a;e++)bt(s,s,t.faces[e].normal);a=a||1,gt(o,a,a,a),vt(s,s,o),i[3*e]=s[0],i[3*e+1]=s[1],i[3*e+2]=s[2]}return i}\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 rn(t,e,n){return t[0]=e[n],t[1]=e[n+1],t[2]=e[n+2],t}function on(t,e,n){return t[0]=e[n],t[1]=e[n+1],t}var sn={exports:{}};function an(t,e,n){n=n||2;var i,r,o,s,a,l,u,c=e&&e.length,h=c?e[0]*n:t.length,d=ln(t,0,h,n,!0),f=[];if(!d||d.next===d.prev)return f;if(c&&(d=function(t,e,n,i){var r,o,s,a,l,u=[];for(r=0,o=e.length;r<o;r++)s=e[r]*i,a=r<o-1?e[r+1]*i:t.length,(l=ln(t,s,a,i,!1))===l.next&&(l.steiner=!0),u.push(vn(l));for(u.sort(mn),r=0;r<u.length;r++)n=yn(u[r],n);return n}(t,e,d,n)),t.length>80*n){i=o=t[0],r=s=t[1];for(var p=n;p<h;p+=n)(a=t[p])<i&&(i=a),(l=t[p+1])<r&&(r=l),a>o&&(o=a),l>s&&(s=l);u=0!==(u=Math.max(o-i,s-r))?32767/u:0}return cn(d,f,n,i,r,u,0),f}function ln(t,e,n,i,r){var o,s;if(r===In(t,e,n,i)>0)for(o=e;o<n;o+=i)s=Sn(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=Sn(o,t[o],t[o+1],s);return s&&Mn(s,s.next)&&(_n(s),s=s.next),s}function un(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!Mn(i,i.next)&&0!==kn(i.prev,i,i.next))i=i.next;else{if(_n(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function cn(t,e,n,i,r,o,s){if(t){!s&&o&&function(t,e,n,i){var r=t;do{0===r.z&&(r.z=bn(r.x,r.y,e,n,i)),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,n,i,r,o,s,a,l,u=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<u&&(a++,i=i.nextZ);e++);for(l=u;a>0||l>0&&i;)0!==a&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,u*=2}while(s>1)}(r)}(t,i,r,o);for(var a,l,u=t;t.prev!==t.next;)if(a=t.prev,l=t.next,o?dn(t,i,r,o):hn(t))e.push(a.i/n|0),e.push(t.i/n|0),e.push(l.i/n|0),_n(t),t=l.next,u=l.next;else if((t=l)===u){s?1===s?cn(t=fn(un(t),e,n),e,n,i,r,o,2):2===s&&pn(t,e,n,i,r,o):cn(un(t),e,n,i,r,o,1);break}}}function hn(t){var e=t.prev,n=t,i=t.next;if(kn(e,n,i)>=0)return!1;for(var r=e.x,o=n.x,s=i.x,a=e.y,l=n.y,u=i.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=i.next;p!==e;){if(p.x>=c&&p.x<=d&&p.y>=h&&p.y<=f&&wn(r,a,o,l,s,u,p.x,p.y)&&kn(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function dn(t,e,n,i){var r=t.prev,o=t,s=t.next;if(kn(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=bn(f,p,e,n,i),b=bn(m,y,e,n,i),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&&wn(a,c,l,h,u,d,v.x,v.y)&&kn(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&&wn(a,c,l,h,u,d,w.x,w.y)&&kn(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&&wn(a,c,l,h,u,d,v.x,v.y)&&kn(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&&wn(a,c,l,h,u,d,w.x,w.y)&&kn(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function fn(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!Mn(r,o)&&jn(r,i,i.next,o)&&Tn(r,o)&&Tn(o,r)&&(e.push(r.i/n|0),e.push(i.i/n|0),e.push(o.i/n|0),_n(i),_n(i.next),i=t=o),i=i.next}while(i!==t);return un(i)}function pn(t,e,n,i,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&xn(s,a)){var l=zn(s,a);return s=un(s,s.next),l=un(l,l.next),cn(s,e,n,i,r,o,0),void cn(l,e,n,i,r,o,0)}a=a.next}s=s.next}while(s!==t)}function mn(t,e){return t.x-e.x}function yn(t,e){var n=function(t,e){var n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s&&(s=a,n=i.x<i.next.x?i:i.next,a===r))return n}i=i.next}while(i!==e);if(!n)return null;var l,u=n,c=n.x,h=n.y,d=1/0;i=n;do{r>=i.x&&i.x>=c&&r!==i.x&&wn(o<h?r:s,o,c,h,o<h?s:r,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(r-i.x),Tn(i,t)&&(l<d||l===d&&(i.x>n.x||i.x===n.x&&gn(n,i)))&&(n=i,d=l)),i=i.next}while(i!==u);return n}(t,e);if(!n)return e;var i=zn(n,t);return un(i,i.next),un(n,n.next)}function gn(t,e){return kn(t.prev,t,e.prev)<0&&kn(e.next,t,t.next)<0}function bn(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function vn(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function wn(t,e,n,i,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(i-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function xn(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&jn(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Tn(t,e)&&Tn(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)&&(kn(t.prev,t,e.prev)||kn(t,e.prev,e))||Mn(t,e)&&kn(t.prev,t,t.next)>0&&kn(e.prev,e,e.next)>0)}function kn(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Mn(t,e){return t.x===e.x&&t.y===e.y}function jn(t,e,n,i){var r=Fn(kn(t,e,n)),o=Fn(kn(t,e,i)),s=Fn(kn(n,i,t)),a=Fn(kn(n,i,e));return r!==o&&s!==a||(!(0!==r||!An(t,n,e))||(!(0!==o||!An(t,i,e))||(!(0!==s||!An(n,t,i))||!(0!==a||!An(n,e,i)))))}function An(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Fn(t){return t>0?1:t<0?-1:0}function Tn(t,e){return kn(t.prev,t,t.next)<0?kn(t,e,t.next)>=0&&kn(t,t.prev,e)>=0:kn(t,e,t.prev)<0||kn(t,t.next,e)<0}function zn(t,e){var n=new Pn(t.i,t.x,t.y),i=new Pn(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Sn(t,e,n,i){var r=new Pn(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function _n(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 Pn(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function In(t,e,n,i){for(var r=0,o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}sn.exports=an,sn.exports.default=an,an.deviation=function(t,e,n,i){var r=e&&e.length,o=r?e[0]*n:t.length,s=Math.abs(In(t,0,o,n));if(r)for(var a=0,l=e.length;a<l;a++){var u=e[a]*n,c=a<l-1?e[a+1]*n:t.length;s-=Math.abs(In(t,u,c,n))}var h=0;for(a=0;a<i.length;a+=3){var d=i[a]*n,f=i[a+1]*n,p=i[a+2]*n;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)},an.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},i=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[r][o][s]);r>0&&(i+=t[r-1].length,n.holes.push(i))}return n};var On=sn.exports;\n/*!\n * @maptalks/vector-packer v0.78.2\n * LICENSE : UNLICENSED\n * (c) 2016-2022 maptalks.com\n */const qn={Point:1,LineString:2,Polygon:3,MultiPoint:4,MultiLineString:5,MultiPolygon:6};function Cn(t,e={}){var n=[];if("FeatureCollection"===t.type)for(var i=0;i<t.features.length;i++)Nn(n,t.features[i],e,i);else Nn(n,"Feature"===t.type?t:{geometry:t},e);return n}function Nn(t,e,n,i){if(e.geometry&&e.geometry.geometry){var r=e.geometry.coordinates,o=e.geometry.type,s=[],a=e.id;if(n.promoteId?a=e.properties[n.promoteId]:n.generateId&&(a=i||0),"Point"===o)Rn(r,s);else if("MultiPoint"===o)for(var l=0;l<r.length;l++)Rn(r[l],s);else if("LineString"===o)Ln([r],s);else if("MultiLineString"===o){if(n.lineMetrics){for(l=0;l<r.length;l++)En(r[l],s=[]),t.push(Dn(a,"LineString",s,e.properties));return}Ln(r,s)}else if("Polygon"===o)Ln(r,s);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(l=0;l<e.geometry.geometries.length;l++)Nn(t,{id:a,geometry:e.geometry.geometries[l],properties:e.properties},n,i);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=[];Ln(r[l],u),s.push(u)}}t.push(Dn(a,o,s,e.properties))}}function Rn(t,e){const n=new Et(t[0],t[1]);n.z=100*(t[2]||0),e.push([n])}function En(t,e){for(let n=0;n<t.length;n++){const i=new Et(t[n][0],t[n][1]);i.z=100*(t[n][2]||0),e.push(i)}}function Ln(t,e,n,i){for(var r=0;r<t.length;r++){var o=[];En(t[r],o),e.push(o)}}function Dn(t,e,n,i){return{id:void 0===t?null:t,type:qn[e],geometry:n,properties:i}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */function $n(t,{width:e,height:n},i,r){if(r){if(r.length!==e*n*i)throw new RangeError("mismatched image size")}else r=new Uint8Array(e*n*i);return t.width=e,t.height=n,t.data=r,t}function Un(t,{width:e,height:n},i){if(e===t.width&&n===t.height)return;const r=$n({},{width:e,height:n},i);Wn(t,r,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,n)},i),t.width=e,t.height=n,t.data=r.data}function Wn(t,e,n,i,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||n.x>t.width-r.width||n.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||i.x>e.width-r.width||i.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=((n.y+l)*t.width+n.x)*o,c=((i.y+l)*e.width+i.x)*o;for(let t=0;t<r.width*o;t++)a[c+t]=s[u+t]}return e}class Jn{constructor(t,e){$n(this,t,1,e)}resize(t){Un(this,t,1)}clone(){return new Jn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,n,i,r){Wn(t,e,n,i,r,1)}}class Hn{constructor(t,e){$n(this,t,4,e)}resize(t){Un(this,t,4)}clone(){return new Hn({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,n,i,r){Wn(t,e,n,i,r,4)}}\n/*!\n * Codes from mapbox-gl-js\n * github.com/mapbox/mapbox-gl-js\n * MIT License\n */class Gn{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 Vn{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,e={},n=new Dt(0,0,{autoResize:!0}),i=[];for(const n in t){const r=t[n],o={x:0,y:0,w:r.data.width+2,h:r.data.height+2};i.push(o),e[n]=new Gn(o,r)}if(n.pack(i,{inPlace:!0}),!Bn(n.w)||!Bn(n.h)){const t=Zn(n.w),e=Zn(n.h);n.resize(t,e)}const r=new Hn({width:n.w,height:n.h});for(const n in t){const i=t[n],o=e[n].paddedRect;Hn.copy(i.data,r,{x:0,y:0},{x:o.x+1,y:o.y+1},i.data)}this.image=r,this.positions=e}}function Bn(t){return 0==(t&t-1)&&0!==t}function Zn(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 Yn{constructor(t){this.glyphMap=t,this.build()}build(){const t=this.glyphMap,e={},n=new Dt(0,0,{autoResize:!0}),i=[];for(const n in t){const r=t[n],o=e[n]={};for(const t in r){const e=r[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const n={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};i.push(n),o[t]={rect:n,metrics:e.metrics}}}n.pack(i,{inPlace:!0});const r=new Jn({width:n.w,height:n.h});for(const n in t){const i=t[n];for(const t in i){const o=i[+t];if(!o||0===o.bitmap.width||0===o.bitmap.height)continue;const s=e[n][t].rect;Jn.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 Xn(t){return t<65536?Uint16Array:Uint32Array}function Kn(t){return(t=Math.abs(t))<128?Int8Array:t<32768?Int16Array:Float32Array}function Qn(t){return t<256?Uint8Array:t<65536?Uint16Array:t<Math.pow(2,32)?Uint32Array:Float64Array}function ti(t){const e=t.type,n=[];if(1===e||4===e)for(let e=0;e<t.geometry.length;e++)Rn(t.geometry[e],n);else if(2===e)Ln(t.geometry,n);else if(3===e)Ln(t.geometry,n);else if(5===e)Ln(t.geometry,n);else if(6===e)for(let e=0;e<t.geometry.length;e++){const i=[];Ln(t.geometry[e],i),n.push(i)}return t.geometry=n,t}function ei(t){for(let e=1;e<arguments.length;e++){const n=arguments[e];for(const e in n)t[e]=n[e]}return t}function ni(t){return null==t}function ii(t){return"number"==typeof t&&!isNaN(t)}function ri(t){return"object"==typeof t&&!!t}function oi(t){return!ni(t)&&("string"==typeof t||null!==t.constructor&&t.constructor===String)}function si(t){return!ni(t)&&("function"==typeof t||null!==t.constructor&&t.constructor===Function)}const ai=Object.prototype.hasOwnProperty;function li(t,e){return ai.call(t,e)}const ui=Math.PI/180;function ci(t){return t&&f(t)&&t.property}function hi(t){const{pointAtTileRes:e,tileRatio:n}=t;return e*n}function di(t){return"centimeter"===t||"cm"===t?1:"millimeter"===t||"mm"===t?.1:100}const fi={};function pi(t,e){if(Array.isArray(e))for(let n=0;n<e.length;n++)t[n]=255*e[n];else{if(e&&void 0!==e.r&&void 0!==e.g&&void 0!==e.b)return t[0]=255*e.r,t[1]=255*e.g,t[2]=255*e.b,t[3]=void 0!==e.a?255*e.a:255,t;e=fi[e]=fi[e]||Ie(e).array();for(let n=0;n<e.length;n++)t[n]=e[n]}return 3===t.length&&t.push(255),t}const mi={textFill:1,textSize:1,textOpacity:1,markerWidth:1,markerHeight:1,markerOpacity:1,markerDx:1,markerDy:1,lineWidth:1,lineColor:1,lineOpacity:1,polygonFill:1,polygonOpacity:1},yi={textName:1,markerTextFitPadding:1,markerTextFit:1,lineGradientProperty:1};var gi=Object.freeze({__proto__:null,now:function(){return Date.now()},extend:ei,isNil:ni,isNumber:ii,isInteger:function(t){return(0|t)===t},isObject:ri,isString:oi,isFunction:si,hasOwn:li,join:function(t,e){return t.join?t.join(e||","):Array.prototype.join.call(t,e||",")},toRadian:function(t){return t*ui},toDegree:function(t){return t/ui},evaluate:function(t,e,n){return si(t)?t(void 0!==n?n:null,e):t},isFnTypeSymbol:ci,getAltitudeToLocal:hi,getTubeSizeScale:di,normalizeColor:pi,checkIfIdentityZoomDependent:function(t,e,n){if(Array.isArray(n)||(n=Object.values(n)),!n||!n.length)return!1;if(!mi[t])return!1;for(let t=0;t<n.length;t++){const i=n[t]&&(n[t].feature||n[t]);if(!i)continue;const r=i.properties&&i.properties[e];if(r&&f(r)&&!p(r).isZoomConstant)return!0}return!1},checkIfZoomFnTypeSymbol:function(t){return!!mi[t]||!!yi[t]}});function bi(t){let e=0;for(let n,i,r=0,o=t.length,s=o-1;r<o;s=r++)n=t[r],i=t[s],e+=void 0!==n.x?(i.x-n.x)*(n.y+i.y):(i[0]-n[0])*(n[1]+i[1]);return e}function vi(t,e,n,i,r){const o=t[e*i],s=t[e*i+1],a=t[n*i],l=t[n*i+1];return o===a&&(o<0||o>r)&&s!==l||s===l&&(s<0||s>r)&&o!==a}function wi(t,e,n){let i=n;return e&&t&&(i=+t[e]),isNaN(i)&&(i=n||0),100*i}function xi(t,e,n,i,r,o,s){e||0===e||(e=1);const a=wi(t.properties,n,i),l=a*e;let u=(o?100*o:0)||a;return r?u=wi(t.properties,r,o):s&&(u=a-wi(t.properties,s,o)),u*=e,{altitude:l,height:u}}function ki(t,e){return e<1/0&&(t.x<0||t.x>e||t.y<0||t.y>e)}function Mi(t){return null==t}function ji(t,e,n){if(t===n||t===e)return t;const i=n-e;return((t-e)%i+i)%i+e}function Ai(t,e){if(!e)return null;const n=new Map;for(let i=0;i<e.length;i++){const r=e[i],o=t[r];let s=n.get(o);s||(s=[],n.set(o,s)),s.push(r)}return n}class Fi{constructor(t,e,n,i){this.feature=t,this.symbol=e,this.fnTypes=n,this.options=i}getPolygonResource(){let t=this.symbol.polygonPatternFile;const{polygonPatternFileFn:e}=this.fnTypes;return this.C(t,e)}getLineResource(){let t=this.symbol.linePatternFile;const{linePatternFileFn:e}=this.fnTypes;return this.C(t,e)}C(t,e){return e&&(t=e(this.options.zoom,this.feature.properties)),t}}function Ti(t,e,n,i){const r=Math.abs(i)>>15,o=r>>1,s=r%2;let a=i%Math.pow(2,15);const l=e+(o<<14)*Math.sign(e),u=n+(s<<14)*Math.sign(n);return t[0]=l,t[1]=u,a=Math.round(a),t[2]=0===a?i<0?-1:0:a,t}const zi=Math.pow(2,14),Si=Math.pow(2,15);var _i={$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. Note: fog is renamed to atmosphere in the Android and iOS SDKs and planned to be changed in GL-JS v.3.0.0."},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 Mercator, Globe, Albers, Equal Earth, Equirectangular (WGS84), Lambert conformal conic, Natural Earth, and Winkel Tripel. Terrain, sky and fog are supported by only Mercator and globe. CustomLayerInterface is not supported outside of 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",android:"10.6.0",ios:"10.6.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region immediately below the horizon and within the `range` and above the horizon and within `horizon-blend`. 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",android:"10.6.0",ios:"10.6.0"}}},"high-color":{type:"color","property-type":"data-constant",default:"#245cdf",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the atmosphere region above the horizon, `high-color` extends further above the horizon than the `color` property and its spread can be controlled with `horizon-blend`. The opacity can be set to `0` to remove the high atmosphere color contribution.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"space-color":{type:"color","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"The color of the region above the horizon and after the end of the `horizon-blend` contribution. The opacity can be set to `0` to have a transparent background.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.0"}}},"horizon-blend":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],4,.2,7,.1],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Horizon blend applies a smooth fade from the color of the atmosphere to the color of space. A value of zero leaves a sharp transition from atmosphere to space. Increasing the value blends the color of atmosphere into increasingly high angles of the sky.","sdk-support":{"basic functionality":{js:"2.3.0",android:"10.6.0",ios:"10.6.0"}}},"star-intensity":{type:"number","property-type":"data-constant",default:["interpolate",["linear"],["zoom"],5,.35,6,0],minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"A value controlling the star intensity where `0` will show no stars and `1` will show stars at their maximum intensity.","sdk-support":{"basic functionality":{js:"2.9.0",android:"10.6.0",ios:"10.6.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."},globe:{doc:"A globe 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",minimum:[-180,-90],maximum:[180,90],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",minimum:[-90,-90],maximum:[90,90],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.",requires:["source"],"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"},"line-trim-offset":{type:"array",value:"number",doc:"The line part between [trim-start, trim-end] will be marked as transparent to make a route vanishing effect. The line trim-off offset is based on the whole line range [0.0, 1.0].",length:2,default:[0,0],minimum:[0,0],maximum:[1,1],transition:!1,requires:[{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"2.9.0",android:"10.5.0",ios:"10.5.0",macos:"10.5.0"}},"property-type":"constant"}},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."}}},Pi="undefined"!=typeof undefinedThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof undefined?global:"undefined"!=typeof self?self:{};function Ii(t){var e={exports:{}};return t(e,e.exports),e.exports}function Oi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}\n/*! https://mths.be/punycode v1.3.2 by @mathias */Ii((function(t,e){!function(n){var i=e&&!e.nodeType&&e,r=t&&!t.nodeType&&t,o="object"==typeof Pi&Πo.global!==o&&o.window!==o&&o.self!==o||(n=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 n=t.length,i=[];n--;)i[n]=e(t[n]);return i}function g(t,e){var n=t.split("@"),i="";return n.length>1&&(i=n[0]+"@",t=n[1]),i+y((t=t.replace(h,".")).split("."),e).join(".")}function b(t){for(var e,n,i=[],r=0,o=t.length;r<o;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<o?56320==(64512&(n=t.charCodeAt(r++)))?i.push(((1023&e)<<10)+(1023&n)+65536):(i.push(e),r--):i.push(e);return i}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,n){var i=0;for(t=n?f(t/700):t>>1,t+=f(t/e);t>455;i+=36)t=f(t/35);return f(i+36*t/(t+38))}function k(t){var e,n,i,r,o,s,a,u,c,h,d,p=[],y=t.length,g=0,b=128,w=72;for((n=t.lastIndexOf("-"))<0&&(n=0),i=0;i<n;++i)t.charCodeAt(i)>=128&&m("not-basic"),p.push(t.charCodeAt(i));for(r=n>0?n+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,n,i,r,o,s,a,u,c,h,d,y,g,v,k,M=[];for(y=(t=b(t)).length,e=128,n=0,o=72,s=0;s<y;++s)(d=t[s])<128&&M.push(p(d));for(i=r=M.length,r&&M.push("-");i<y;){for(a=l,s=0;s<y;++s)(d=t[s])>=e&&d<a&&(a=d);for(a-e>f((l-n)/(g=i+1))&&m("overflow"),n+=(a-e)*g,e=a,s=0;s<y;++s)if((d=t[s])<e&&++n>l&&m("overflow"),d==e){for(u=n,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(n,g,i==r),n=0,++i}++n,++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}))}},i&&r)if(t.exports==i)r.exports=s;else for(a in s)s.hasOwnProperty(a)&&(i[a]=s[a]);else n.punycode=s}(Pi)}));var qi=function(t,e,n,i){n=n||"=";var r={};if("string"!=typeof t||0===t.length)return r;var o=/\\+/g;t=t.split(e=e||"&");var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.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(n);p>=0?(u=f.substr(0,p),c=f.substr(p+1)):(u=f,c=""),h=decodeURIComponent(u),d=decodeURIComponent(c),Oi(r,h)?Array.isArray(r[h])?r[h].push(d):r[h]=[r[h],d]:r[h]=d}return r},Ci=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},Ni=function(t,e,n,i){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var r=encodeURIComponent(Ci(i))+n;return Array.isArray(t[i])?t[i].map((function(t){return r+encodeURIComponent(Ci(t))})).join(e):r+encodeURIComponent(Ci(t[i]))})).join(e):i?encodeURIComponent(Ci(i))+n+encodeURIComponent(Ci(t)):""};function Ri(t,...e){for(const n of e)for(const e in n)t[e]=n[e];return t}Ii((function(t,e){e.decode=e.parse=qi,e.encode=e.stringify=Ni}));class Ei extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}var Li=Ei;class Di{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,n]of e)this.bindings[t]=n}concat(t){return new Di(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)}}var $i=Di;const Ui={kind:"null"},Wi={kind:"number"},Ji={kind:"string"},Hi={kind:"boolean"},Gi={kind:"color"},Vi={kind:"object"},Bi={kind:"value"},Zi={kind:"collator"},Yi={kind:"formatted"},Xi={kind:"resolvedImage"};function Ki(t,e){return{kind:"array",itemType:t,N:e}}function Qi(t){if("array"===t.kind){const e=Qi(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const tr=[Ui,Wi,Ji,Hi,Gi,Yi,Vi,Ki(Bi),Xi];function er(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!er(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 tr)if(!er(t,e))return null}return`Expected ${Qi(t)} but found ${Qi(e)} instead.`}function nr(t,e){return e.some(e=>e.kind===t.kind)}function ir(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 rr=Ii((function(t,e){var n={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 i(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return i("%"===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,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in n)return n[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[i(255*s(g,y,f+1/3)),i(255*s(g,y,f)),i(255*s(g,y,f-1/3)),d];default:return null}}return null}}catch(t){}}));class or{constructor(t,e,n,i=1){this.r=t,this.g=e,this.b=n,this.a=i}static parse(t){if(!t)return;if(t instanceof or)return t;if("string"!=typeof t)return;const e=rr.parseCSSColor(t);return e?new or(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3]):void 0}toString(){const[t,e,n,i]=this.toArray();return`rgba(${Math.round(t)},${Math.round(e)},${Math.round(n)},${i})`}toArray(){const{r:t,g:e,b:n,a:i}=this;return 0===i?[0,0,0,0]:[255*t/i,255*e/i,255*n/i,i]}toArray01(){const{r:t,g:e,b:n,a:i}=this;return 0===i?[0,0,0,0]:[t/i,e/i,n/i,i]}toArray01PremultipliedAlpha(){const{r:t,g:e,b:n,a:i}=this;return[t,e,n,i]}}or.black=new or(0,0,0,1),or.white=new or(1,1,1,1),or.transparent=new or(0,0,0,0),or.red=new or(1,0,0,1),or.blue=new or(0,0,1,1);var sr=or;class ar{constructor(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,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 lr{constructor(t,e,n,i,r){this.text=t.normalize?t.normalize():t,this.image=e,this.scale=n,this.fontStack=i,this.textColor=r}}class ur{constructor(t){this.sections=t}static fromString(t){return new ur([new lr(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 ur?t:ur.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 n={};e.fontStack&&(n["text-font"]=["literal",e.fontStack.split(",")]),e.scale&&(n["font-scale"]=e.scale),e.textColor&&(n["text-color"]=["rgba"].concat(e.textColor.toArray())),t.push(n)}return t}}class cr{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new cr({name:t,available:!1}):null}serialize(){return["image",this.name]}}function hr(t,e,n,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,n,i].join(", ")}]: \'a\' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[t,e,n,i]:[t,e,n]).join(", ")}]: \'r\', \'g\', and \'b\' must be between 0 and 255.`}function dr(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 sr)return!0;if(t instanceof ar)return!0;if(t instanceof ur)return!0;if(t instanceof cr)return!0;if(Array.isArray(t)){for(const e of t)if(!dr(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!dr(t[e]))return!1;return!0}return!1}function fr(t){if(null===t)return Ui;if("string"==typeof t)return Ji;if("boolean"==typeof t)return Hi;if("number"==typeof t)return Wi;if(t instanceof sr)return Gi;if(t instanceof ar)return Zi;if(t instanceof ur)return Yi;if(t instanceof cr)return Xi;if(Array.isArray(t)){const e=t.length;let n;for(const e of t){const t=fr(e);if(n){if(n===t)continue;n=Bi;break}n=t}return Ki(n||Bi,e)}return Vi}function pr(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof sr||t instanceof ur||t instanceof cr?t.toString():JSON.stringify(t)}class mr{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(!dr(t[1]))return e.error("invalid value");const n=t[1];let i=fr(n);const r=e.expectedType;return"array"!==i.kind||0!==i.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(i=r),new mr(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof sr?["rgba"].concat(this.value.toArray()):this.value instanceof ur?this.value.serialize():this.value}}var yr=mr,gr=class{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}};const br={string:Ji,number:Wi,boolean:Hi,object:Vi};class vr{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 n,i=1;const r=t[0];if("array"===r){let r,o;if(t.length>2){const n=t[1];if("string"!=typeof n||!(n in br)||"object"===n)return e.error(\'The item type argument of "array" must be one of string, number, boolean\',1);r=br[n],i++}else r=Bi;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],i++}n=Ki(r,o)}else n=br[r];const o=[];for(;i<t.length;i++){const n=e.parse(t[i],i,Bi);if(!n)return null;o.push(n)}return new vr(n,o)}evaluate(t){for(let e=0;e<this.args.length;e++){const n=this.args[e].evaluate(t);if(!er(this.type,fr(n)))return n;if(e===this.args.length-1)throw new gr(`Expected value to be of type ${Qi(this.type)}, but found ${Qi(fr(n))} 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 n=t.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){e.push(n.kind);const i=t.N;("number"==typeof i||this.args.length>1)&&e.push(i)}}return e.concat(this.args.map(t=>t.serialize()))}}var wr=vr;class xr{constructor(t){this.type=Yi,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return e.error("First argument must be an image or text section.");const i=[];let r=!1;for(let n=1;n<=t.length-1;++n){const o=t[n];if(r&&"object"==typeof o&&!Array.isArray(o)){r=!1;let t=null;if(o["font-scale"]&&(t=e.parse(o["font-scale"],1,Wi),!t))return null;let n=null;if(o["text-font"]&&(n=e.parse(o["text-font"],1,Ki(Ji)),!n))return null;let s=null;if(o["text-color"]&&(s=e.parse(o["text-color"],1,Gi),!s))return null;const a=i[i.length-1];a.scale=t,a.font=n,a.textColor=s}else{const o=e.parse(t[n],1,Bi);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,i.push({content:o,scale:null,font:null,textColor:null})}}return new xr(i)}evaluate(t){return new ur(this.sections.map(e=>{const n=e.content.evaluate(t);return fr(n)===Xi?new lr("",n,null,null,null):new lr(pr(n),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 n={};e.scale&&(n["font-scale"]=e.scale.serialize()),e.font&&(n["text-font"]=e.font.serialize()),e.textColor&&(n["text-color"]=e.textColor.serialize()),t.push(n)}return t}}class kr{constructor(t){this.type=Xi,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const n=e.parse(t[1],1,Ji);return n?new kr(n):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),n=cr.fromString(e);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(e)>-1),n}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const Mr={"to-boolean":Hi,"to-color":Gi,"to-number":Wi,"to-string":Ji};class jr{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 n=t[0];if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");const i=Mr[n],r=[];for(let n=1;n<t.length;n++){const i=e.parse(t[n],n,Bi);if(!i)return null;r.push(i)}return new jr(i,r)}evaluate(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){let e,n;for(const i of this.args){if(e=i.evaluate(t),n=null,e instanceof sr)return e;if("string"==typeof e){const n=t.parseColor(e);if(n)return n}else if(Array.isArray(e)&&(n=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:hr(e[0],e[1],e[2],e[3]),!n))return new sr(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new gr(n||`Could not parse color from value \'${"string"==typeof e?e:String(JSON.stringify(e))}\'`)}if("number"===this.type.kind){let e=null;for(const n of this.args){if(e=n.evaluate(t),null===e)return 0;const i=Number(e);if(!isNaN(i))return i}throw new gr(`Could not convert ${JSON.stringify(e)} to number.`)}return"formatted"===this.type.kind?ur.fromString(pr(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?cr.fromString(pr(this.args[0].evaluate(t))):pr(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 xr([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new kr(this.args[0]).serialize();const t=["to-"+this.type.kind];return this.eachChild(e=>{t.push(e.serialize())}),t}}var Ar=jr;const Fr=["Unknown","Point","LineString","Polygon"];var Tr=class{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?Fr[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:n,y:i}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(n*e-t[0])+this.featureDistanceData.bearing[1]*(i*e-t[1])}return 0}parseColor(t){let e=this.R[t];return e||(e=this.R[t]=sr.parse(t)),e}};class zr{constructor(t,e,n,i){this.name=t,this.type=e,this.L=n,this.args=i}evaluate(t){return this.L(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 n=t[0],i=zr.definitions[n];if(!i)return e.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter(([e])=>!Array.isArray(e)||e.length===t.length-1);let a=null;for(const[i,o]of s){a=new to(e.registry,e.path,null,e.scope);const s=[];let l=!1;for(let e=1;e<t.length;e++){const n=t[e],r=Array.isArray(i)?i[e-1]:i.type,o=a.parse(n,1+s.length,r);if(!o){l=!0;break}s.push(o)}if(!l)if(Array.isArray(i)&&i.length!==s.length)a.error(`Expected ${i.length} arguments, but found ${s.length} instead.`);else{for(let t=0;t<s.length;t++){const e=Array.isArray(i)?i[t]:i.type,n=s[t];a.concat(t+1).checkSubtype(e,n.type)}if(0===a.errors.length)return new zr(n,r,o,s)}}if(1===s.length)e.errors.push(...a.errors);else{const n=(s.length?s:o).map(([t])=>{return e=t,Array.isArray(e)?`(${e.map(Qi).join(", ")})`:`(${Qi(e.type)}...)`;var e}).join(" | "),i=[];for(let n=1;n<t.length;n++){const r=e.parse(t[n],1+i.length);if(!r)return null;i.push(Qi(r.type))}e.error(`Expected arguments of type ${n}, but found (${i.join(", ")}) instead.`)}return null}static register(t,e){zr.definitions=e;for(const n in e)t[n]=zr}}var Sr=zr;class _r{constructor(t,e,n){this.type=Zi,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const n=t[1];if("object"!=typeof n||Array.isArray(n))return e.error("Collator options argument must be an object.");const i=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,Hi);if(!i)return null;const r=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,Hi);if(!r)return null;let o=null;return n.locale&&(o=e.parse(n.locale,1,Ji),!o)?null:new _r(i,r,o)}evaluate(t){return new ar(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 Pr(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 Ir(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Or(t,e){const n=(180+t[0])/360,i=(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(n*r*8192),Math.round(i*r*8192)]}function qr(t,e,n){const i=t[0]-e[0],r=t[1]-e[1],o=t[0]-n[0],s=t[1]-n[1];return i*s-o*r==0&&i*o<=0&&r*s<=0}function Cr(t,e){let n=!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(qr(t,a[e],a[e+1]))return!1;(r=a[e])[1]>(i=t)[1]!=(o=a[e+1])[1]>i[1]&&i[0]<(o[0]-r[0])*(i[1]-r[1])/(o[1]-r[1])+r[0]&&(n=!n)}}var i,r,o;return n}function Nr(t,e){for(let n=0;n<e.length;n++)if(Cr(t,e[n]))return!0;return!1}function Rr(t,e,n,i){const r=i[0]-n[0],o=i[1]-n[1],s=(t[0]-n[0])*o-r*(t[1]-n[1]),a=(e[0]-n[0])*o-r*(e[1]-n[1]);return s>0&&a<0||s<0&&a>0}function Er(t,e,n){for(const u of n)for(let n=0;n<u.length-1;++n)if(void 0,void 0,0!=(a=[(s=u[n+1])[0]-(o=u[n])[0],s[1]-o[1]])[0]*(l=[(r=e)[0]-(i=t)[0],r[1]-i[1]])[1]-a[1]*l[0]&&Rr(i,r,o,s)&&Rr(o,s,i,r))return!0;var i,r,o,s,a,l;return!1}function Lr(t,e){for(let n=0;n<t.length;++n)if(!Cr(t[n],e))return!1;for(let n=0;n<t.length-1;++n)if(Er(t[n],t[n+1],e))return!1;return!0}function Dr(t,e){for(let n=0;n<e.length;n++)if(Lr(t,e[n]))return!0;return!1}function $r(t,e,n){const i=[];for(let r=0;r<t.length;r++){const o=[];for(let i=0;i<t[r].length;i++){const s=Or(t[r][i],n);Pr(e,s),o.push(s)}i.push(o)}return i}function Ur(t,e,n){const i=[];for(let r=0;r<t.length;r++){const o=$r(t[r],e,n);i.push(o)}return i}function Wr(t,e,n,i){if(t[0]<n[0]||t[0]>n[2]){const e=.5*i;let r=t[0]-n[0]>e?-i:n[0]-t[0]>e?i:0;0===r&&(r=t[0]-n[2]>e?-i:n[2]-t[0]>e?i:0),t[0]+=r}Pr(e,t)}function Jr(t,e,n,i){const r=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],s=[];if(!t)return s;for(const i of t)for(const t of i){const i=[t.x+o[0],t.y+o[1]];Wr(i,e,n,r),s.push(i)}return s}function Hr(t,e,n,i){const r=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],s=[];if(!t)return s;for(const n of t){const t=[];for(const i of n){const n=[i.x+o[0],i.y+o[1]];Pr(e,n),t.push(n)}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 i of t)Wr(i,e,n,r)}var a;return s}class Gr{constructor(t,e){this.type=Hi,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(dr(t[1])){const e=t[1];if("FeatureCollection"===e.type)for(let t=0;t<e.features.length;++t){const n=e.features[t].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new Gr(e,e.features[t].geometry)}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new Gr(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new Gr(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 n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const o=$r(e.coordinates,i,r),s=Jr(t.geometry(),n,i,r);if(!Ir(n,i))return!1;for(const t of s)if(!Cr(t,o))return!1}if("MultiPolygon"===e.type){const o=Ur(e.coordinates,i,r),s=Jr(t.geometry(),n,i,r);if(!Ir(n,i))return!1;for(const t of s)if(!Nr(t,o))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if(!r)return!1;if("Polygon"===e.type){const o=$r(e.coordinates,i,r),s=Hr(t.geometry(),n,i,r);if(!Ir(n,i))return!1;for(const t of s)if(!Lr(t,o))return!1}if("MultiPolygon"===e.type){const o=Ur(e.coordinates,i,r),s=Hr(t.geometry(),n,i,r);if(!Ir(n,i))return!1;for(const t of s)if(!Dr(t,o))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}serialize(){return["within",this.geojson]}}var Vr=Gr;function Br(t){if(t instanceof Sr){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 Vr)return!1;let e=!0;return t.eachChild(t=>{e&&!Br(t)&&(e=!1)}),e}function Zr(t){if(t instanceof Sr&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(t=>{e&&!Zr(t)&&(e=!1)}),e}function Yr(t,e){if(t instanceof Sr&&e.indexOf(t.name)>=0)return!1;let n=!0;return t.eachChild(t=>{n&&!Yr(t,e)&&(n=!1)}),n}class Xr{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 n=t[1];return e.scope.has(n)?new Xr(n,e.scope.get(n)):e.error(`Unknown variable "${n}". Make sure "${n}" 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]}}var Kr=Xr;class Qr{constructor(t,e=[],n,i=new $i,r=[]){this.registry=t,this.path=e,this.key=e.map(t=>`[${t}]`).join(""),this.scope=i,this.errors=r,this.expectedType=n}parse(t,e,n,i,r={}){return e?this.concat(e,n,i).D(t,r):this.D(t,r)}D(t,e){function n(t,e,n){return"assert"===n?new wr(e,[t]):"coerce"===n?new Ar(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 i=t[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const r=this.registry[i];if(r){let i=r.parse(t,this);if(!i)return null;if(this.expectedType){const t=this.expectedType,r=i.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 i=n(i,t,e.typeAnnotation||"coerce");else i=n(i,t,e.typeAnnotation||"assert")}if(!(i instanceof yr)&&"resolvedImage"!==i.type.kind&&function t(e){if(e instanceof Kr)return t(e.boundExpression);if(e instanceof Sr&&"error"===e.name)return!1;if(e instanceof _r)return!1;if(e instanceof Vr)return!1;const n=e instanceof Ar||e instanceof wr;let i=!0;return e.eachChild(e=>{i=n?i&&t(e):i&&e instanceof yr}),!!i&&(Br(e)&&Yr(e,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"]))}(i)){const e=new Tr;try{i=new yr(i.type,i.evaluate(e))}catch(t){return this.error(t.message),null}}return i}return this.error(`Unknown expression "${i}". 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,n){const i="number"==typeof t?this.path.concat(t):this.path,r=n?this.scope.concat(n):this.scope;return new Qr(this.registry,i,e||null,r,this.errors)}error(t,...e){const n=`${this.key}${e.map(t=>`[${t}]`).join("")}`;this.errors.push(new Li(n,t))}checkSubtype(t,e){const n=er(t,e);return n&&this.error(n),n}}var to=Qr;function eo(t,e){const n=t.length-1;let i,r,o=0,s=n,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),i=t[a],r=t[a+1],i<=e){if(a===n||e<r)return a;o=a+1}else{if(!(i>e))throw new gr("Input is not a number.");s=a-1}return 0}class no{constructor(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of n)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 n=e.parse(t[1],1,Wi);if(!n)return null;const i=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let n=1;n<t.length;n+=2){const o=1===n?-1/0:t[n],s=t[n+1],a=n,l=n+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(i.length&&i[i.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,i.push([o,u])}return new no(r,n,i)}evaluate(t){const e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return n[0].evaluate(t);const r=e.length;return i>=e[r-1]?n[r-1].evaluate(t):n[eo(e,i)].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 io=no,ro=oo;function oo(t,e,n,i){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=n,this.p2y=i}function so(t,e,n){return t*(1-n)+e*n}oo.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},oo.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},oo.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},oo.prototype.solveCurveX=function(t,e){var n,i,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)<(n=0))return n;if(r>(i=1))return i;for(;n<i;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?n=r:i=r,r=.5*(i-n)+n}return r},oo.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var ao=Object.freeze({__proto__:null,number:so,color:function(t,e,n){return new sr(so(t.r,e.r,n),so(t.g,e.g,n),so(t.b,e.b,n),so(t.a,e.a,n))},array:function(t,e,n){return t.map((t,i)=>so(t,e[i],n))}});const lo=6/29*3*(6/29),uo=Math.PI/180,co=180/Math.PI;function ho(t){return t>.008856451679035631?Math.pow(t,1/3):t/lo+4/29}function fo(t){return t>6/29?t*t*t:lo*(t-4/29)}function po(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function mo(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function yo(t){const e=mo(t.r),n=mo(t.g),i=mo(t.b),r=ho((.4124564*e+.3575761*n+.1804375*i)/.95047),o=ho((.2126729*e+.7151522*n+.072175*i)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-ho((.0193339*e+.119192*n+.9503041*i)/1.08883)),alpha:t.a}}function go(t){let e=(t.l+16)/116,n=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;return e=1*fo(e),n=.95047*fo(n),i=1.08883*fo(i),new sr(po(3.2404542*n-1.5371385*e-.4985314*i),po(-.969266*n+1.8760108*e+.041556*i),po(.0556434*n-.2040259*e+1.0572252*i),t.alpha)}function bo(t,e,n){const i=e-t;return t+n*(i>180||i<-180?i-360*Math.round(i/360):i)}const vo={forward:yo,reverse:go,interpolate:function(t,e,n){return{l:so(t.l,e.l,n),a:so(t.a,e.a,n),b:so(t.b,e.b,n),alpha:so(t.alpha,e.alpha,n)}}},wo={forward:function(t){const{l:e,a:n,b:i}=yo(t),r=Math.atan2(i,n)*co;return{h:r<0?r+360:r,c:Math.sqrt(n*n+i*i),l:e,alpha:t.a}},reverse:function(t){const e=t.h*uo,n=t.c;return go({l:t.l,a:Math.cos(e)*n,b:Math.sin(e)*n,alpha:t.alpha})},interpolate:function(t,e,n){return{h:bo(t.h,e.h,n),c:so(t.c,e.c,n),l:so(t.l,e.l,n),alpha:so(t.alpha,e.alpha,n)}}};var xo=Object.freeze({__proto__:null,lab:vo,hcl:wo});class ko{constructor(t,e,n,i,r){this.type=t,this.operator=e,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(const[t,e]of r)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,n,i){let r=0;if("exponential"===t.name)r=Mo(e,t.base,n,i);else if("linear"===t.name)r=Mo(e,1,n,i);else if("cubic-bezier"===t.name){const o=t.controlPoints;r=new ro(o[0],o[1],o[2],o[3]).solve(Mo(e,1,n,i))}return r}static parse(t,e){let[n,i,r,...o]=t;if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const t=i[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:t}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);{const t=i.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);i={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,Wi),!r)return null;const s=[];let a=null;"interpolate-hcl"===n||"interpolate-lab"===n?a=Gi:e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType);for(let t=0;t<o.length;t+=2){const n=o[t],i=o[t+1],r=t+3,l=t+4;if("number"!=typeof n)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]>=n)return e.error(\'Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.\',r);const u=e.parse(i,l,a);if(!u)return null;a=a||u.type,s.push([n,u])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new ko(a,n,i,r,s):e.error(`Type ${Qi(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return n[0].evaluate(t);const r=e.length;if(i>=e[r-1])return n[r-1].evaluate(t);const o=eo(e,i),s=ko.interpolationFactor(this.interpolation,i,e[o],e[o+1]),a=n[o].evaluate(t),l=n[o+1].evaluate(t);return"interpolate"===this.operator?ao[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?wo.reverse(wo.interpolate(wo.forward(a),wo.forward(l),s)):vo.reverse(vo.interpolate(vo.forward(a),vo.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 Mo(t,e,n,i){const r=i-n,o=t-n;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}var jo=ko;class Ao{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 n=null;const i=e.expectedType;i&&"value"!==i.kind&&(n=i);const r=[];for(const i of t.slice(1)){const t=e.parse(i,1+r.length,n,void 0,{typeAnnotation:"omit"});if(!t)return null;n=n||t.type,r.push(t)}const o=i&&r.some(t=>er(i,t.type));return new Ao(o?Bi:n,r)}evaluate(t){let e,n=null,i=0;for(const r of this.args){if(i++,n=r.evaluate(t),n&&n instanceof cr&&!n.available&&(e||(e=n),n=null,i===this.args.length))return e;if(null!==n)break}return n}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}}var Fo=Ao;class To{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 n=[];for(let i=1;i<t.length-1;i+=2){const r=t[i];if("string"!=typeof r)return e.error(`Expected string, but found ${typeof r} instead.`,i);if(/[^a-zA-Z0-9_]/.test(r))return e.error("Variable names must contain only alphanumeric characters or \'_\'.",i);const o=e.parse(t[i+1],i+1);if(!o)return null;n.push([r,o])}const i=e.parse(t[t.length-1],t.length-1,e.expectedType,n);return i?new To(n,i):null}outputDefined(){return this.result.outputDefined()}serialize(){const t=["let"];for(const[e,n]of this.bindings)t.push(e,n.serialize());return t.push(this.result.serialize()),t}}var zo=To;class So{constructor(t,e,n){this.type=t,this.index=e,this.input=n}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const n=e.parse(t[1],1,Wi),i=e.parse(t[2],2,Ki(e.expectedType||Bi));return n&&i?new So(i.type.itemType,n,i):null}evaluate(t){const e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new gr(`Array index out of bounds: ${e} < 0.`);if(e>=n.length)throw new gr(`Array index out of bounds: ${e} > ${n.length-1}.`);if(e!==Math.floor(e))throw new gr(`Array index must be an integer, but found ${e} instead.`);return n[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}var _o=So;class Po{constructor(t,e){this.type=Hi,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 n=e.parse(t[1],1,Bi),i=e.parse(t[2],2,Bi);return n&&i?nr(n.type,[Hi,Ji,Wi,Ui,Bi])?new Po(n,i):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Qi(n.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(null==n)return!1;if(!ir(e,["boolean","string","number","null"]))throw new gr(`Expected first argument to be of type boolean, string, number or null, but found ${Qi(fr(e))} instead.`);if(!ir(n,["string","array"]))throw new gr(`Expected second argument to be of type array or string, but found ${Qi(fr(n))} instead.`);return n.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}var Io=Po;class Oo{constructor(t,e,n){this.type=Wi,this.needle=t,this.haystack=e,this.fromIndex=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 n=e.parse(t[1],1,Bi),i=e.parse(t[2],2,Bi);if(!n||!i)return null;if(!nr(n.type,[Hi,Ji,Wi,Ui,Bi]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${Qi(n.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Wi);return r?new Oo(n,i,r):null}return new Oo(n,i)}evaluate(t){const e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!ir(e,["boolean","string","number","null"]))throw new gr(`Expected first argument to be of type boolean, string, number or null, but found ${Qi(fr(e))} instead.`);if(!ir(n,["string","array"]))throw new gr(`Expected second argument to be of type array or string, but found ${Qi(fr(n))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(t);return n.indexOf(e,i)}return n.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()]}}var qo=Oo;class Co{constructor(t,e,n,i,r,o){this.inputType=t,this.type=e,this.input=n,this.cases=i,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 n,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=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(n){if(u.checkSubtype(n,fr(t)))return null}else n=fr(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,i);if(!c)return null;i=i||c.type,o.push(c)}const s=e.parse(t[1],1,Bi);if(!s)return null;const a=e.parse(t[t.length-1],t.length-1,i);return a?"value"!==s.type.kind&&e.concat(1).checkSubtype(n,s.type)?null:new Co(n,i,s,r,o,a):null}evaluate(t){const e=this.input.evaluate(t);return(fr(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(),n=[],i={};for(const t of e){const e=i[this.cases[t]];void 0===e?(i[this.cases[t]]=n.length,n.push([this.cases[t],[t]])):n[e][1].push(t)}const r=t=>"number"===this.inputType.kind?Number(t):t;for(const[e,i]of n)t.push(1===i.length?r(i[0]):i.map(r)),t.push(this.outputs[e].serialize());return t.push(this.otherwise.serialize()),t}}var No=Co;class Ro{constructor(t,e,n){this.type=t,this.branches=e,this.otherwise=n}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 n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const i=[];for(let r=1;r<t.length-1;r+=2){const o=e.parse(t[r],r,Hi);if(!o)return null;const s=e.parse(t[r+1],r+1,n);if(!s)return null;i.push([o,s]),n=n||s.type}const r=e.parse(t[t.length-1],t.length-1,n);return r?new Ro(n,i,r):null}evaluate(t){for(const[e,n]of this.branches)if(e.evaluate(t))return n.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,n]of this.branches)t(e),t(n);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}}var Eo=Ro;class Lo{constructor(t,e,n,i){this.type=t,this.input=e,this.beginIndex=n,this.endIndex=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 n=e.parse(t[1],1,Bi),i=e.parse(t[2],2,Wi);if(!n||!i)return null;if(!nr(n.type,[Ki(Bi),Ji,Bi]))return e.error(`Expected first argument to be of type array or string, but found ${Qi(n.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,Wi);return r?new Lo(n.type,n,i,r):null}return new Lo(n.type,n,i)}evaluate(t){const e=this.input.evaluate(t),n=this.beginIndex.evaluate(t);if(!ir(e,["string","array"]))throw new gr(`Expected first argument to be of type array or string, but found ${Qi(fr(e))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(t);return e.slice(n,i)}return e.slice(n)}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()]}}var Do=Lo;function $o(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 Uo(t,e,n,i){return 0===i.compare(e,n)}function Wo(t,e,n){const i="=="!==t&&"!="!==t;return class r{constructor(t,e,n){this.type=Hi,this.lhs=t,this.rhs=e,this.collator=n,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 n=t[0];let o=e.parse(t[1],1,Bi);if(!o)return null;if(!$o(n,o.type))return e.concat(1).error(`"${n}" comparisons are not supported for type \'${Qi(o.type)}\'.`);let s=e.parse(t[2],2,Bi);if(!s)return null;if(!$o(n,s.type))return e.concat(2).error(`"${n}" comparisons are not supported for type \'${Qi(s.type)}\'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error(`Cannot compare types \'${Qi(o.type)}\' and \'${Qi(s.type)}\'.`);i&&("value"===o.type.kind&&"value"!==s.type.kind?o=new wr(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new wr(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,Zi),!a)return null}return new r(o,s,a)}evaluate(r){const o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(i&&this.hasUntypedArgument){const e=fr(o),n=fr(s);if(e.kind!==n.kind||"string"!==e.kind&&"number"!==e.kind)throw new gr(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${n.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const t=fr(o),n=fr(s);if("string"!==t.kind||"string"!==n.kind)return e(r,o,s)}return this.collator?n(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 Jo=Wo("==",(function(t,e,n){return e===n}),Uo),Ho=Wo("!=",(function(t,e,n){return e!==n}),(function(t,e,n,i){return!Uo(0,e,n,i)})),Go=Wo("<",(function(t,e,n){return e<n}),(function(t,e,n,i){return i.compare(e,n)<0})),Vo=Wo(">",(function(t,e,n){return e>n}),(function(t,e,n,i){return i.compare(e,n)>0})),Bo=Wo("<=",(function(t,e,n){return e<=n}),(function(t,e,n,i){return i.compare(e,n)<=0})),Zo=Wo(">=",(function(t,e,n){return e>=n}),(function(t,e,n,i){return i.compare(e,n)>=0}));class Yo{constructor(t,e,n,i,r){this.type=Ji,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const n=e.parse(t[1],1,Wi);if(!n)return null;const i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");let r=null;if(i.locale&&(r=e.parse(i.locale,1,Ji),!r))return null;let o=null;if(i.currency&&(o=e.parse(i.currency,1,Ji),!o))return null;let s=null;if(i["min-fraction-digits"]&&(s=e.parse(i["min-fraction-digits"],1,Wi),!s))return null;let a=null;return i["max-fraction-digits"]&&(a=e.parse(i["max-fraction-digits"],1,Wi),!a)?null:new Yo(n,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 Xo{constructor(t){this.type=Wi,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const n=e.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?e.error(`Expected argument of type string or array, but found ${Qi(n.type)} instead.`):new Xo(n):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 gr(`Expected value to be of type string or array, but found ${Qi(fr(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}serialize(){const t=["length"];return this.eachChild(e=>{t.push(e.serialize())}),t}}const Ko={"==":Jo,"!=":Ho,">":Vo,"<":Go,">=":Zo,"<=":Bo,array:wr,at:_o,boolean:wr,case:Eo,coalesce:Fo,collator:_r,format:xr,image:kr,in:Io,"index-of":qo,interpolate:jo,"interpolate-hcl":jo,"interpolate-lab":jo,length:Xo,let:zo,literal:yr,match:No,number:wr,"number-format":Yo,object:wr,slice:Do,step:io,string:wr,"to-boolean":Ar,"to-color":Ar,"to-number":Ar,"to-string":Ar,var:Kr,within:Vr};function Qo(t,[e,n,i,r]){e=e.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);const o=r?r.evaluate(t):1,s=hr(e,n,i,o);if(s)throw new gr(s);return new sr(e/255*o,n/255*o,i/255*o,o)}function ts(t,e){return t in e}function es(t,e){const n=e[t];return void 0===n?null:n}function ns(t){return{type:t}}Sr.register(Ko,{error:[{kind:"error"},[Ji],(t,[e])=>{throw new gr(e.evaluate(t))}],typeof:[Ji,[Bi],(t,[e])=>Qi(fr(e.evaluate(t)))],"to-rgba":[Ki(Wi,4),[Gi],(t,[e])=>e.evaluate(t).toArray()],rgb:[Gi,[Wi,Wi,Wi],Qo],rgba:[Gi,[Wi,Wi,Wi,Wi],Qo],has:{type:Hi,overloads:[[[Ji],(t,[e])=>ts(e.evaluate(t),t.properties())],[[Ji,Vi],(t,[e,n])=>ts(e.evaluate(t),n.evaluate(t))]]},get:{type:Bi,overloads:[[[Ji],(t,[e])=>es(e.evaluate(t),t.properties())],[[Ji,Vi],(t,[e,n])=>es(e.evaluate(t),n.evaluate(t))]]},"feature-state":[Bi,[Ji],(t,[e])=>es(e.evaluate(t),t.featureState||{})],properties:[Vi,[],t=>t.properties()],"geometry-type":[Ji,[],t=>t.geometryType()],id:[Bi,[],t=>t.id()],zoom:[Wi,[],t=>t.globals.zoom],pitch:[Wi,[],t=>t.globals.pitch||0],"distance-from-center":[Wi,[],t=>t.distanceFromCenter()],"heatmap-density":[Wi,[],t=>t.globals.heatmapDensity||0],"line-progress":[Wi,[],t=>t.globals.lineProgress||0],"sky-radial-progress":[Wi,[],t=>t.globals.skyRadialProgress||0],accumulated:[Bi,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[Wi,ns(Wi),(t,e)=>{let n=0;for(const i of e)n+=i.evaluate(t);return n}],"*":[Wi,ns(Wi),(t,e)=>{let n=1;for(const i of e)n*=i.evaluate(t);return n}],"-":{type:Wi,overloads:[[[Wi,Wi],(t,[e,n])=>e.evaluate(t)-n.evaluate(t)],[[Wi],(t,[e])=>-e.evaluate(t)]]},"/":[Wi,[Wi,Wi],(t,[e,n])=>e.evaluate(t)/n.evaluate(t)],"%":[Wi,[Wi,Wi],(t,[e,n])=>e.evaluate(t)%n.evaluate(t)],ln2:[Wi,[],()=>Math.LN2],pi:[Wi,[],()=>Math.PI],e:[Wi,[],()=>Math.E],"^":[Wi,[Wi,Wi],(t,[e,n])=>Math.pow(e.evaluate(t),n.evaluate(t))],sqrt:[Wi,[Wi],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[Wi,[Wi],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[Wi,[Wi],(t,[e])=>Math.log(e.evaluate(t))],log2:[Wi,[Wi],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[Wi,[Wi],(t,[e])=>Math.sin(e.evaluate(t))],cos:[Wi,[Wi],(t,[e])=>Math.cos(e.evaluate(t))],tan:[Wi,[Wi],(t,[e])=>Math.tan(e.evaluate(t))],asin:[Wi,[Wi],(t,[e])=>Math.asin(e.evaluate(t))],acos:[Wi,[Wi],(t,[e])=>Math.acos(e.evaluate(t))],atan:[Wi,[Wi],(t,[e])=>Math.atan(e.evaluate(t))],min:[Wi,ns(Wi),(t,e)=>Math.min(...e.map(e=>e.evaluate(t)))],max:[Wi,ns(Wi),(t,e)=>Math.max(...e.map(e=>e.evaluate(t)))],abs:[Wi,[Wi],(t,[e])=>Math.abs(e.evaluate(t))],round:[Wi,[Wi],(t,[e])=>{const n=e.evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[Wi,[Wi],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[Wi,[Wi],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[Hi,[Ji,Bi],(t,[e,n])=>t.properties()[e.value]===n.value],"filter-id-==":[Hi,[Bi],(t,[e])=>t.id()===e.value],"filter-type-==":[Hi,[Ji],(t,[e])=>t.geometryType()===e.value],"filter-<":[Hi,[Ji,Bi],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i<r}],"filter-id-<":[Hi,[Bi],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n<i}],"filter->":[Hi,[Ji,Bi],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i>r}],"filter-id->":[Hi,[Bi],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n>i}],"filter-<=":[Hi,[Ji,Bi],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[Hi,[Bi],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n<=i}],"filter->=":[Hi,[Ji,Bi],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[Hi,[Bi],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n>=i}],"filter-has":[Hi,[Bi],(t,[e])=>e.value in t.properties()],"filter-has-id":[Hi,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[Hi,[Ki(Ji)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[Hi,[Ki(Bi)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[Hi,[Ji,Ki(Bi)],(t,[e,n])=>n.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[Hi,[Ji,Ki(Bi)],(t,[e,n])=>function(t,e,n,i){for(;n<=i;){const r=n+i>>1;if(e[r]===t)return!0;e[r]>t?i=r-1:n=r+1}return!1}(t.properties()[e.value],n.value,0,n.value.length-1)],all:{type:Hi,overloads:[[[Hi,Hi],(t,[e,n])=>e.evaluate(t)&&n.evaluate(t)],[ns(Hi),(t,e)=>{for(const n of e)if(!n.evaluate(t))return!1;return!0}]]},any:{type:Hi,overloads:[[[Hi,Hi],(t,[e,n])=>e.evaluate(t)||n.evaluate(t)],[ns(Hi),(t,e)=>{for(const n of e)if(n.evaluate(t))return!0;return!1}]]},"!":[Hi,[Hi],(t,[e])=>!e.evaluate(t)],"is-supported-script":[Hi,[Ji],(t,[e])=>{const n=t.globals&&t.globals.isSupportedScript;return!n||n(e.evaluate(t))}],upcase:[Ji,[Ji],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[Ji,[Ji],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[Ji,ns(Bi),(t,e)=>e.map(e=>pr(e.evaluate(t))).join("")],"resolved-locale":[Ji,[Zi],(t,[e])=>e.evaluate(t).resolvedLocale()]});var is=Ko;function rs(t){return{result:"success",value:t}}function os(t){return{result:"error",value:t}}function ss(t){return!!t.expression&&t.expression.interpolated}function as(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function ls(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function us(t){return t}function cs(t,e,n){return void 0!==t?t:void 0!==e?e:void 0!==n?n:void 0}function hs(t,e,n,i,r){return cs(typeof n===r?i[n]:void 0,t.default,e.default)}function ds(t,e,n){if("number"!==as(n))return cs(t.default,e.default);const i=t.stops.length;if(1===i)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[i-1][0])return t.stops[i-1][1];const r=eo(t.stops.map(t=>t[0]),n);return t.stops[r][1]}function fs(t,e,n){const i=void 0!==t.base?t.base:1;if("number"!==as(n))return cs(t.default,e.default);const r=t.stops.length;if(1===r)return t.stops[0][1];if(n<=t.stops[0][0])return t.stops[0][1];if(n>=t.stops[r-1][0])return t.stops[r-1][1];const o=eo(t.stops.map(t=>t[0]),n),s=function(t,e,n,i){const r=i-n,o=t-n;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(n,i,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1];let u=ao[e.type]||us;if(t.colorSpace&&"rgb"!==t.colorSpace){const e=xo[t.colorSpace];u=(t,n)=>e.reverse(e.interpolate(e.forward(t),e.forward(n),s))}return"function"==typeof a.evaluate?{evaluate(...t){const e=a.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==e&&void 0!==n)return u(e,n,s)}}:u(a,l,s)}function ps(t,e,n){return"color"===e.type?n=sr.parse(n):"formatted"===e.type?n=ur.fromString(n.toString()):"resolvedImage"===e.type?n=cr.fromString(n.toString()):as(n)===e.type||"enum"===e.type&&e.values[n]||(n=void 0),cs(n,t.default,e.default)}class ms{constructor(t,e){this.expression=t,this.U={},this.W=new Tr,this.J=e?function(t){return"color"===t.type&&(ls(t.default)||Array.isArray(t.default))?new sr(0,0,0,0):"color"===t.type?sr.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this.H=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,n,i,r,o,s,a){return this.W.globals=t,this.W.feature=e,this.W.featureState=n,this.W.canonical=i||null,this.W.availableImages=r||null,this.W.formattedSection=o,this.W.featureTileCoord=s||null,this.W.featureDistanceData=a||null,this.expression.evaluate(this.W)}evaluate(t,e,n,i,r,o,s,a){this.W.globals=t,this.W.feature=e||null,this.W.featureState=n||null,this.W.canonical=i||null,this.W.availableImages=r||null,this.W.formattedSection=o||null,this.W.featureTileCoord=s||null,this.W.featureDistanceData=a||null;try{const t=this.expression.evaluate(this.W);if(null==t||"number"==typeof t&&t!=t)return this.J;if(this.H&&!(t in this.H))throw new gr(`Expected value to be one of ${Object.keys(this.H).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this.U[t.message]||(this.U[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this.J}}}function ys(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in is}function gs(t,e){const n=new to(is,[],e?function(t){const e={color:Gi,string:Ji,number:Wi,enum:Ji,boolean:Hi,formatted:Yi,resolvedImage:Xi};return"array"===t.type?Ki(e[t.value]||Bi,t.length):e[t.type]}(e):void 0),i=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?rs(new ms(i,e)):os(n.errors)}class bs{constructor(t,e){this.kind=t,this.G=e,this.isStateDependent="constant"!==t&&!Zr(e.expression)}evaluateWithoutErrorHandling(t,e,n,i,r,o){return this.G.evaluateWithoutErrorHandling(t,e,n,i,r,o)}evaluate(t,e,n,i,r,o){return this.G.evaluate(t,e,n,i,r,o)}}class vs{constructor(t,e,n,i){this.kind=t,this.zoomStops=n,this.G=e,this.isStateDependent="camera"!==t&&!Zr(e.expression),this.interpolationType=i}evaluateWithoutErrorHandling(t,e,n,i,r,o){return this.G.evaluateWithoutErrorHandling(t,e,n,i,r,o)}evaluate(t,e,n,i,r,o){return this.G.evaluate(t,e,n,i,r,o)}interpolationFactor(t,e,n){return this.interpolationType?jo.interpolationFactor(this.interpolationType,t,e,n):0}}function ws(t,e){if("error"===(t=gs(t,e)).result)return t;const n=t.value.expression,i=Br(n);if(!i&&!function(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}(e))return os([new Li("","data expressions not supported")]);const r=Yr(n,["zoom","pitch","distance-from-center"]);if(!r&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return os([new Li("","zoom expressions not supported")]);const o=function t(e){let n=null;if(e instanceof zo)n=t(e.result);else if(e instanceof Fo){for(const i of e.args)if(n=t(i),n)break}else(e instanceof io||e instanceof jo)&&e.input instanceof Sr&&"zoom"===e.input.name&&(n=e);return n instanceof Li||e.eachChild(e=>{const i=t(e);i instanceof Li?n=i:!n&&i?n=new Li("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\'):n&&i&&n!==i&&(n=new Li("",\'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.\'))}),n}(n);if(!o&&!r)return os([new Li("",\'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.\')]);if(o instanceof Li)return os([o]);if(o instanceof jo&&!ss(e))return os([new Li("",\'"interpolate" expressions cannot be used with this property\')]);if(!o)return rs(new bs(i?"constant":"source",t.value));const s=o instanceof jo?o.interpolation:void 0;return rs(new vs(i?"camera":"composite",t.value,o.labels,s))}class xs{constructor(t,e){this.V=t,this.B=e,Ri(this,function t(e,n){const i="color"===n.type,r=e.stops&&"object"==typeof e.stops[0][0],o=r||!(r||void 0!==e.property),s=e.type||(ss(n)?"exponential":"interval");if(i&&((e=Ri({},e)).stops&&(e.stops=e.stops.map(t=>[t[0],sr.parse(t[1])])),e.default=sr.parse(e.default?e.default:n.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!xo[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);let a,l,u;if("exponential"===s)a=fs;else if("interval"===s)a=ds;else if("categorical"===s){a=hs,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=ps}if(r){const i={},r=[];for(let t=0;t<e.stops.length;t++){const n=e.stops[t],o=n[0].zoom;void 0===i[o]&&(i[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},r.push(o)),i[o].stops.push([n[0].value,n[1]])}const o=[];for(const e of r)o.push([i[e].zoom,t(i[e],n)]);const s={name:"linear"};return{kind:"composite",interpolationType:s,interpolationFactor:jo.interpolationFactor.bind(void 0,s),zoomStops:o.map(t=>t[0]),evaluate:({zoom:t},i)=>fs({stops:o,base:e.base},n,t).evaluate(t,i)}}if(o){const t="exponential"===s?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:t,interpolationFactor:jo.interpolationFactor.bind(void 0,t),zoomStops:e.stops.map(t=>t[0]),evaluate:({zoom:t})=>a(e,n,t,l,u)}}return{kind:"source",evaluate(t,i){const r=i&&i.properties?i.properties[e.property]:void 0;return void 0===r?cs(e.default,n.default):a(e,n,r,l,u)}}}(this.V,this.B))}static deserialize(t){return new xs(t.V,t.B)}static serialize(t){return{V:t.V,B:t.B}}}function ks(t){if(Array.isArray(t))return t.map(ks);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const n in t)e[n]=ks(t[n]);return e}return function(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}(t)}function Ms(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(!Ms(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}function js(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(js(t[e]))return!0;return!1}const As=new Set(["in","==","!=",">",">=","<","<=","to-boolean"]);function Fs(t,e){return t<e?-1:t>e?1:0}function Ts(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?zs(t[1],t[2],"=="):"!="===e?Ps(zs(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?zs(t[1],t[2],e):"any"===e?(n=t.slice(1),["any"].concat(n.map(Ts))):"all"===e?["all"].concat(t.slice(1).map(Ts)):"none"===e?["all"].concat(t.slice(1).map(Ts).map(Ps)):"in"===e?Ss(t[1],t.slice(2)):"!in"===e?Ps(Ss(t[1],t.slice(2))):"has"===e?_s(t[1]):"!has"===e?Ps(_s(t[1])):"within"!==e||t;var n}function zs(t,e,n){switch(t){case"$type":return["filter-type-"+n,e];case"$id":return["filter-id-"+n,e];default:return["filter-"+n,t,e]}}function Ss(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(Fs)]]:["filter-in-small",t,["literal",e]]}}function _s(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Ps(t){return["!",t]}Ii((function(t,e){var n=function(){var t=function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},e=[1,12],n=[1,13],i=[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,n,i,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.$.Z=this.Y.first_line;break;case 2:this.$=new Number(t),this.$.Z=this.Y.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.Z=this.Y.first_line;break;case 5:this.$=new Boolean(!1),this.$.Z=this.Y.first_line;break;case 6:return this.$=o[a-1];case 13:this.$={},Object.defineProperty(this.$,"Z",{value:this.Y.first_line,enumerable:!1});break;case 14:case 19:this.$=o[a-1],Object.defineProperty(this.$,"Z",{value:this.Y.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.$,"Z",{value:this.Y.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:n,7:3,8:i,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:n,7:3,8:i,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:n,7:3,8:i,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:n,7:3,8:i,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,n=[0],i=[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=n[n.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:n.push(b),i.push(d.yytext),r.push(d.yylloc),n.push(w[1]),b=null,l=d.yyleng,s=d.yytext,a=d.yylineno,m=d.yylloc;break;case 2:if(A.$=i[i.length-(M=this.productions_[w[1]][1])],A.Y={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.Y.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],i,r].concat(h))))return x;M&&(n=n.slice(0,-1*M*2),i=i.slice(0,-1*M),r=r.slice(0,-1*M)),n.push(this.productions_[w[1]][0]),i.push(A.$),r.push(A.Y),n.push(o[n[n.length-2]][n[n.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.X=t,this.K=this.tt=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.X[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.X=this.X.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\\r\\n?|\\n)/g);this.X=t+this.X,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=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),n.length-1&&(this.yylineno-=n.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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[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.K=!0,this},reject:function(){return this.options.backtrack_lexer?(this.tt=!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.X.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 n,i,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,K:this.K,X:this.X,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\\r\\n?|\\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.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.K=!1,this.tt=!1,this.X=this.X.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this.X&&(this.done=!1),n)return n;if(this.tt){for(var o in r)this[o]=r[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,i;this.X||(this.done=!0),this.K||(this.yytext="",this.match="");for(var r=this.et(),o=0;o<r.length;o++)if((n=this.X.match(this.rules[r[o]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=o,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,r[o])))return t;if(this.tt){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,r[i]))&&t:""===this.X?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]},et: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,n,i){switch(n){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=n,e.Parser=n.Parser,e.parse=function(){return n.parse.apply(n,arguments)}}));const Is={StyleExpression:ms,isExpression:ys,isExpressionFilter:Ms,createExpression:gs,createPropertyExpression:ws,normalizePropertyExpression:function(t,e){if(ls(t))return new xs(t,e);if(ys(t)){const n=ws(t,e);if("error"===n.result)throw new Error(n.value.map(t=>`${t.key}: ${t.message}`).join(", "));return n.value}{let n=t;return"string"==typeof t&&"color"===e.type&&(n=sr.parse(t)),{kind:"constant",evaluate:()=>n}}},ZoomConstantExpression:bs,ZoomDependentExpression:vs,StylePropertyFunction:xs},{isExpression:Os,createExpression:qs}=Is,Cs={};function Ns(t){if(!0===t)return function(){return!0};if(t&&t.condition){if("any"===t.type){const e=t.condition,n=[];for(let t=0;t<e.length;t++)n.push(Ns(e[t]));return(t,e)=>{for(let i=0;i<n.length;i++)if(n[i](t,e))return!0;return!1}}const e=Ns(t.condition);if(ni(t.layer))return e;const n=e=>e.layer===t.layer;return(t,i)=>n(t)&&e(t,i)}if(function t(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":case"!has":return 2===e.length&&("string"==typeof e[1]||e[1].property&&e[1].op);case"in":case"!in":return e.length>=2&&("string"==typeof e[1]||e[1].property&&e[1].op);case"==":case"!=":case">":case">=":case"<":case"<=":return 3===e.length&&("string"==typeof e[1]||e[1].property&&e[1].op);case"none":case"any":case"all":for(const n of e.slice(1))if(!t(n)&&"boolean"!=typeof n)return!1;return!0;case"contains":return!0;default:return!1}}(t))return new Function("f","var p = (f && f.properties || {}); return "+qe(t));{let e=function(t,e="fill"){if(null==t)return{filter:()=>!0,needGeometry:!1,needFeature:!1};Ms(t)||(t=Ts(t));const n=t;let i=!0;try{i=function(t){if(!js(t))return t;let e=ks(t);return function t(e){let n=!1;const i=[];if("case"===e[0]){for(let t=1;t<e.length-1;t+=2)n=n||js(e[t]),i.push(e[t+1]);i.push(e[e.length-1])}else if("match"===e[0]){n=n||js(e[1]);for(let t=2;t<e.length-1;t+=2)i.push(e[t+1]);i.push(e[e.length-1])}else if("step"===e[0]){n=n||js(e[1]);for(let t=1;t<e.length-1;t+=2)i.push(e[t+1])}n&&(e.length=0,e.push("any",...i));for(let n=1;n<e.length;n++)t(e[n])}(e),e=function t(e){if(!Array.isArray(e))return e;const n=function(t){if(As.has(t[0]))for(let e=1;e<t.length;e++)if(js(t[e]))return!0;return t}(e);return!0===n?n:n.map(e=>t(e))}(e),e}(n)}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(n,null,2)}\\n `)}const r=_i["filter_"+e],o=gs(i,r);let s=null;if("error"===o.result)throw new Error(o.value.map(t=>`${t.key}: ${t.message}`).join(", "));s=(t,e,n)=>o.value.evaluate(t,e,{},n);let a=null,l=null;if(i!==n){const t=gs(n,r);if("error"===t.result)throw new Error(t.value.map(t=>`${t.key}: ${t.message}`).join(", "));a=(e,n,i,r,o)=>t.value.evaluate(e,n,{},i,void 0,void 0,r,o),l=!Br(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 n=1;n<e.length;n++)if(t(e[n]))return!0;return!1}(i),needFeature:!!l}}(t);return e=e&&e.filter,(t,n)=>(Cs.zoom=n,e&&e(Cs,t))}}const Rs={type:"number","property-type":"data-driven",expression:{parameters:["zoom","feature"]}};function Es(t,e){Rs.type=e||"number";const n=qs(t,Rs);if("success"!==n.result)throw new Error(`Invalid maplibre spec expression: ${JSON.stringify(t)} (${n.value})`);return n.value}function Ls(t){return Os(t)}const Ds={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};function $s(t){return Ds[t]}const Us={markerPlacement:1,markerFile:1,mergeOnProperty:1,markerTextFit:1,markerType:1,markerHorizontalAlignment:1,markerVerticalAlignment:1,markerRotationAlignment:1,markerPitchAlignment:1,markerFillPatternFile:1,markerLinePatternFile:1,textName:1,textPlacement:1,textFaceName:1,textStyle:1,textHorizontalAlignment:1,textVerticalAlignment:1,textRotationAlignment:1,textPitchAlignment:1,lineJoin:1,lineCap:1,linePatternFile:1,polygonPatternFile:1},Ws={lineDasharray:1,markerLineDasharray:1,uvScale:1,uvOffset:1};function Js(t){return Us[t]?"string":$s(t)?"number":Ws[t]?"array":"color"}var Hs=Object.freeze({__proto__:null,compileStyle:function(t=[]){return function t(e){if(!Array.isArray(e))return t([e]);const n=[];for(let t=0;t<e.length;t++){let i;i=!0===e[t].filter?function(){return!0}:Ns(e[t].filter),n.push(ei({},e[t],{filter:i}))}return n}(t=t.map(t=>{const e=ei({},t);return e.filter&&e.filter.value&&(e.filter=e.filter.value),e}))},compileFilter:Ns,createExpression:Es,isExpression:Ls,isInterpolated:$s,getExpressionType:Js});const Gs=[],Vs={},Bs={},Zs={},Ys=[];class Xs{static isAtlasLoaded(t,e={}){const{iconAtlas:n}=e;return!!(!t||n&&n.positions[t])}static genFnTypes(t){const e={};for(const n in t)if(Ls(t[n])){const i=(n+"_Fn_0").trim(),r=(n+"Fn").trim(),o=Js(n);e[i]=Es(t[n],o),e[r]=(t,n)=>{let r;Vs.zoom=t,Bs.properties=n;try{r=e[i].evaluateWithoutErrorHandling(Vs,Bs,Zs,null,Ys)}catch(t){return null}return r}}else if(ci(t[n])){const i=(n+"_Fn_0").trim(),r=(n+"Fn").trim();$s(n)?(e[i]=p(t[n]),e[r]=(t,n)=>{const r=e[i](t,n);return ci(r)?p(r)(t,n):r}):(e[i]=m(t[n]),e[r]=(t,n)=>{const r=e[i](t,n);return ci(r)?m(r)(t,n):r})}return e}constructor(t,e,n){this.options=n,this.symbolDef=e,this.symbol=y(e,()=>[n.zoom]),this.styledVectors=[],this.properties={},this.nt=n.fnTypes||Xs.genFnTypes(this.symbolDef),ci(this.symbolDef.visible)&&(this.it=p(this.symbolDef.visible)),n.atlas&&(this.iconAtlas=n.atlas.iconAtlas,this.glyphAtlas=n.atlas.glyphAtlas),this.features=this.rt(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,n,i){this.needAltitudeAttribute()?(t.aPosition.push(e,n),t.aAltitude.push(i)):(Ti(Gs,e,n,i),t.aPosition.push(Gs[0],Gs[1],Gs[2]))}rt(t){if(!t.length)return t;const e="__fea_idx".trim();let n,i=0,r=t[i];for(;!r.geometry;)i++,r=t[i];if(Array.isArray(r.geometry)&&r.properties){let e=r.geometry[0];for(;Array.isArray(e);)e=e[0];e instanceof Et&&(n=t)}if(!n)if(n=[],Array.isArray(r.geometry))for(let e=0;e<t.length;e++){const i=ei({},t[e]);n.push(ti(i))}else for(let i=0;i<t.length;i++){const r=t[i],o=Cn(r);for(let t=0;t<o.length;t++){const i=o[t];i[e]=r[e],n.push(i)}}if(this.maxPosZ=0,!this.options.forceAltitudeAttribute){const t="line"===this.symbolDef.textPlacement;let e=0,i=!1;const{textPitchAlignmentFn:r}=this.nt;!r&&t&&"map"===this.symbolDef.textPitchAlignment&&(i=!0);for(let o=0;o<n.length;o++){const s=Qs(n[o]&&n[o].geometry);if(s>e&&(e=s),t&&!i&&r&&n[o].properties){const t=r(null,n[o].properties);"map"===t&&(i=t)}}this.hasMapPitchAlign=i,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]));n=n.sort((e,n)=>{const i=t.length;let r=-1,o=-1;for(let s=0;s<i&&(t[s](e)&&(r=s),t[s](n)&&(o=s),!(r>=0&&r<i&&o>=0&&o<i));s++);return r-o})}return n}load(t=1){const e="__fea_idx".trim(),n="_debug_info".trim(),i=this.nt,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},u=y(this.symbolDef,()=>[l.zoom]);let c=0,h=o.length;const d=this.options.debugIndex;try{for(;c<h;c++){const t=o[c];if(!t||!t.geometry)continue;if(void 0!==d&&t[n].index!==d)continue;t.properties||(t.properties={}),t.properties.$layer=t.layer,t.properties.$type=t.type;const h=this.createStyledVector(t,u,i,l,s,a);h&&h.feature.geometry&&(h.featureIdx=void 0===t[e]?c:t[e],this.count++,r.push(h))}}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((n,i)=>{this.fetchAtlas(t,e,(t,e)=>{if(t)i(t);else{if(e){const{icons:t,glyphs:n}=e;if(t&&Object.keys(t).length){for(const e in t){const n=t[e],{width:i,height:r,data:o}=n.data;n.data=new Hn({width:i,height:r},o)}this.iconAtlas=new Vn(t)}if(n&&Object.keys(n).length){for(const t in n){const e=n[t];for(const t in e){const n=e[t],{width:i,height:r,data:o}=n.bitmap;n.bitmap=new Jn({width:i,height:r},o)}}this.glyphAtlas=new Yn(n)}}n({glyphAtlas:this.glyphAtlas,iconAtlas:this.iconAtlas})}})})}fetchAtlas(t,e,n){Object.keys(t).length>0||Object.keys(e).length>0?this.options.requestor(t,e,n):n()}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 n=e.buffers;delete e.buffers;const i={data:e,buffers:n};if(this.iconAtlas){const t=i.data.iconAtlas=Ks(this.iconAtlas);if(t.glyphMap)for(const e in t.glyphMap)n.push(t.glyphMap[e].data.data.buffer);n.push(i.data.iconAtlas.image.data.buffer)}return this.glyphAtlas&&(i.data.glyphAtlas=Ks(this.glyphAtlas),n.push(i.data.glyphAtlas.image.data.buffer)),i}createStyledVector(t,e,n,i){return new Fi(t,e,n,i)}createDataPack(t,e){if(!t||!t.length)return null;this.maxIndex=0,this.maxPos=0,this.maxAltitude=0;const n=this.data={};let i=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++)n[r[t].name]=[];let s=[],a=0;const l=[];let u=0,c=!1,h=!0;const d=new Set;for(let i=0,r=t.length;i<r;i++){if(!t[i].feature.geometry)continue;const r=Array.isArray(t[i])?t[i][0].feature.id:t[i].feature.id;h&&(void 0!==Bs.id?d&&(d.has(Bs.id)?h=!1:d.add(Bs.id)):h=!1),ii(r)&&(Math.abs(r)>u&&(u=Math.abs(r)),r<0&&(c=!0));const f=this.data.aPosition.length;if(Array.isArray(t[i]))for(let n=0;n<t[i].length;n++)this.ot(t[i][n],e);else this.ot(t[i],e);const p=(n.aPosition.length-f)/o;for(let e=0;e<p;e++)s.push(t[i].featureIdx),ii(r)&&l.push(r);a=Math.max(a,t[i].featureIdx)}if(this.hasElements()&&!i.length)return null;s=new(Qn(a))(s),r[0].type=this.options.positionType?this.options.positionType:Kn(this.maxPos);const f=this.options.center;if(f&&(f[0]||f[1])){const t=n.aPosition;for(let e=0;e<t.length;e+=o)t[e]-=f[0],t[e+1]-=f[1]}const p=function(t,e){const n={};for(let i=0;i<t.length;i++){const r=t[i],o=r.type,s=r.name;n[s]=o===Array?e[s]:new o(e[s])}return n}(r,n);p.aPickingId=s;const m=[];for(const t in p)m.push(p[t].buffer);i=new(Xn(this.maxIndex))(i),m.push(i.buffer);const y={data:p,isIdUnique:h,is2D:0===this.maxPosZ,indices:this.hasElements()?i:null,positionSize:o,buffers:m,symbolIndex:this.symbolDef.index||{index:0}};if(this.st&&(y.markerPlacement=this.st),this.lt&&(y.textPlacement=this.lt),l.length){const t=c?Kn(u):Qn(u);y.featureIds=new t(l),m.push(y.featureIds.buffer)}else y.featureIds=[];return y.pickingIdIndiceMap=Ai(s,y.indices),y}ot(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:n,altitudeScale:i}=this.options;let r=wi(t,e,n);return i&&(r*=i),this.maxAltitude=Math.max(this.maxAltitude,Math.abs(r)),r}getIconAtlasMaxValue(){const t=this.iconAtlas.positions;let e=0;for(const n in t)if(li(t,n)){const{tl:i,displaySize:r}=t[n],o=Math.max(i[0],i[1],r[0]-1,r[1]-1);o>e&&(e=o)}return e}}function Ks(t){let e=t.positions,n=t.image&&t.image.format||"alpha";if(t instanceof Vn){e={};for(const n in t.positions){const i=t.positions[n];e[n]={paddedRect:i.paddedRect,pixelRatio:i.pixelRatio,tl:i.tl,br:i.br,displaySize:i.displaySize}}n="rgba"}const i=t.image;return{image:{width:i.width,height:i.height,data:i.data,format:n},glyphMap:t.glyphMap,positions:e}}function Qs(t){if(!t)return 0;let e=0;if(Array.isArray(t))for(let n=0;n<t.length;n++)if(Array.isArray(t[n])){const i=Qs(t[n]);i>e&&(e=i)}else{const i=Math.abs(t[n].z||0);i>e&&(e=i)}else{const n=Math.abs(t.z||0);n>e&&(e=n)}return e}function ta(t,e,n,i){const r="__fn_textSize".trim();let o=t.textSize;if(ni(e.textSize))return[16,16];t[r]&&(o=t[r]);const s=[];return s[0]=si(o)?o(i,n):o,s[1]=s[0],s}function ea(t){const e=t.stops;let n=-1/0;for(let t=0;t<e.length;t++){let i=e[t][1];ri(e[t][1])&&(i=ea(e[t][1])),i>n&&(n=i)}return n}function na(t,e,n){return[e||"normal",n||"normal","24px",t||"monospace"].join(" ")}const ia=/\\{[\\w-]+(?:\\|[\\w-]+)*\\}/g;function ra(t,e){return oi(t)?t.replace(ia,(function(t){if(!e)return"";if((t=t.substring(1,t.length-1)).indexOf("|")>0){const n=t.split("|");for(let t=0;t<n.length;t++){const i=e[n[t]];if(!ni(i))return i}return""}const n=e[t];return ni(n)?"":Array.isArray(n)?n.join():n})):t}var oa=Object.freeze({__proto__:null,getSDFFont:na,resolveText:ra,resolveVarNames:function(t){return t.match(ia)},resolveExpVarNames:function t(e,n){if(2!==n.length||"get"!==n[0])for(let i=0;i<n.length;i++)2===n[i].length&&"get"===n[i][0]?e.push(n[i][1]):Array.isArray(n[i])&&t(e,n[i]);else e.push(n[1])}});const sa=t=>t>=11904&&t<=12031,aa=t=>t>=12032&&t<=12255,la=t=>t>=12272&&t<=12287,ua=t=>t>=12288&&t<=12351,ca=t=>t>=12352&&t<=12447,ha=t=>t>=12448&&t<=12543,da=t=>t>=12544&&t<=12591,fa=t=>t>=12704&&t<=12735,pa=t=>t>=12736&&t<=12783,ma=t=>t>=12784&&t<=12799,ya=t=>t>=12800&&t<=13055,ga=t=>t>=13056&&t<=13311,ba=t=>t>=13312&&t<=19903,va=t=>t>=19968&&t<=40959,wa=t=>t>=40960&&t<=42127,xa=t=>t>=42128&&t<=42191,ka=t=>t>=63744&&t<=64255,Ma=t=>t>=64336&&t<=65023,ja=t=>t>=65040&&t<=65055,Aa=t=>t>=65072&&t<=65103,Fa=t=>t>=65104&&t<=65135,Ta=t=>t>=65136&&t<=65279,za=t=>t>=65280&&t<=65519;function Sa(t){return!((t=>t>=1536&&t<=1791)(t)||(t=>t>=1872&&t<=1919)(t)||(t=>t>=2208&&t<=2303)(t)||Ma(t)||Ta(t))}function _a(t){return!!(746===t||747===t||!(t<4352)&&(fa(t)||da(t)||Aa(t)&&!(t>=65097&&t<=65103)||ka(t)||ga(t)||sa(t)||pa(t)||!(!ua(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||ba(t)||va(t)||ya(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)||ca(t)||la(t)||(t=>t>=12688&&t<=12703)(t)||aa(t)||ma(t)||ha(t)&&12540!==t||!(!za(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)||!(!Fa(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||(t=>t>=5120&&t<=5759)(t)||(t=>t>=6320&&t<=6399)(t)||ja(t)||(t=>t>=19904&&t<=19967)(t)||wa(t)||xa(t)))}function Pa(t){return!(_a(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)||ua(t)||ha(t)||(t=>t>=57344&&t<=63743)(t)||Aa(t)||Fa(t)||za(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function Ia(t){return t>=1424&&t<=2303||Ma(t)||Ta(t)}const Oa=[[9,9],[32,32],[5760,5760],[8192,8198],[8200,8202],[8287,12288],[6158,6158],[8203,8205]];function qa(t){for(const e of Oa)if(t>=e[0]&&t<=e[1])return!0;return!1}const Ca={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\\\":"\","]":"﹈","^":"^",ut:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function Na(t,e,n,i,r,o,s,a,l,u){let c=t.trim();2===u&&(c=function(t){let e="";for(let n=0;n<t.length;n++){const i=t.charCodeAt(n+1)||null,r=t.charCodeAt(n-1)||null;e+=i&&Pa(i)&&!Ca[t[n+1]]||r&&Pa(r)&&!Ca[t[n-1]]||!Ca[t[n]]?t[n]:Ca[t[n]]}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 n=[];let i=0;for(let r=0;r<e.length;r++){const o=e[r];n.push(t.substring(i,o)),i=o}return i<t.length&&n.push(t.substring(i,t.length)),n}(c,function(t,e,n,i){if(!n)return[];if(!t)return[];const r=[],o=function(t,e,n,i){let r=0;for(let n=0;n<t.length;n++){const o=i[t.charCodeAt(n)];o&&(r+=o.metrics.advance+e)}return r/Math.max(1,Math.ceil(r/n))}(t,e,n,i);let s=0;for(let n=0;n<t.length;n++){const l=t.charCodeAt(n),u=i[l];u&&!Ra[l]&&(s+=u.metrics.advance+e),n<t.length-1&&(Ea[l]||!((a=l)<11904)&&(fa(a)||da(a)||Aa(a)||ka(a)||ga(a)||sa(a)||pa(a)||ua(a)||ba(a)||va(a)||ya(a)||za(a)||ca(a)||la(a)||aa(a)||ma(a)||ha(a)||ja(a)||xa(a)||wa(a)))&&r.push($a(n+1,s,o,r,Da(l,t.charCodeAt(n+1)),!1))}var a;return function t(e){return e?t(e.priorBreak).concat(e.index):[]}($a(t.length,s,o,r,0,!0))}(c,s,n,e)),function(t,e,n,i,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<n.length;t++){let r=n[t];if(r=r.trim(),!r.length){c-=i;continue}const o=d.length;for(let t=0;t<r.length;t++){const n=r.charCodeAt(t),i=e[n];i&&(_a(n)&&1!==s?(32!==n&&d.push({glyph:n,x:u,y:0,vertical:!0}),u+=l+a):(32!==n&&d.push({glyph:n,x:u,y:c,vertical:!1}),u+=i.metrics.advance+a))}d.length!==o&&(h=Math.max(u-a,h),Wa(d,e,o,d.length-1,f)),u=0,c-=i}const{horizontalAlign:p,verticalAlign:m}=Ua(r);!function(t,e,n,i,r,o,s){const a=(e-n)*r,l=-(-i*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,i,n.length);const y=n.length*i;t.top+=-m*y,t.bottom=t.top+y,t.left+=-p*h,t.right=t.left+h}(d,e,f,i,r,o,u,s,l),!!h.length&&d}const Ra={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ea={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 La(t,e,n,i){const r=Math.pow(t-e,2);return i?t<e?r/2:2*r:r+Math.abs(n)*n}function Da(t,e){let n=0;return 10===t&&(n-=1e4),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function $a(t,e,n,i,r,o){let s=null,a=La(e,n,r,o);for(let t=0;t<i.length;t++){const l=i[t],u=La(e-l.x,n,r,o)+l.badness;u<=a&&(s=l,a=u)}return{index:t,x:e,priorBreak:s,badness:a}}function Ua(t){let e=.5,n=.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":n=1;break;case"top":case"top-right":case"top-left":n=0}return{horizontalAlign:e,verticalAlign:n}}function Wa(t,e,n,i,r){if(!r)return;const o=e[t[i].glyph];if(o){const e=(t[i].x+o.metrics.advance)*r;if(!e)return;for(let r=n;r<=i;r++)t[r].x-=e}}function Ja(t){if(!function(t){for(const e of t)if(Ia(e.charCodeAt(0)))return!0;return!1}(t))return t;const e=[],n=[],i=[];let r=0,o=0,s=1,a=1;for(const l of t){const t=l.codePointAt(0);qa(t)?(i.push(l),r++):(s=Ia(t)?-1:1,a!==s?(o=r,n.length&&(a>0&&n.reverse(),e.push(...n)),i.length&&(e.splice(o,0,...i),i.length=0),a=s,n.length=0):i.length&&(n.push(...i),i.length=0),n.push(l),r++)}return i.length&&n.push(...i),n.length&&(a>0&&n.reverse(),e.push(...n)),e.reverse().join("")}const Ha=/\\{ *([\\w_]+) *\\}/g;class Ga{constructor(t,e,n,i,r){this.feature=t,this.symbolDef=e,this.symbol=n,this.options=r,this.ct=this.ht.bind(this),this.nt=i}ht(t,e){return this.feature.properties[e]||"default"}getShape(t,e){if(this.dt)return this.dt;const{textHorizontalAlignmentFn:n,textVerticalAlignmentFn:i,markerHorizontalAlignmentFn:r,markerVerticalAlignmentFn:o,textWrapWidthFn:s}=this.nt;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=Va(n?n(null,c):l.textHorizontalAlignment,i?i(null,c):l.textVerticalAlignment),y=1.2*h,g=function(t){for(let e=0;e<t.length;e++)if(!Sa(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=Na(r,p,w,y,m,"center",b,v,h,1),g&&f&&d&&(a.vertical=Na(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=Va(r?r(null,c):l.markerHorizontalAlignment,o?o(null,c):l.markerVerticalAlignment);a=function(t,e){const{horizontalAlign:n,verticalAlign:i}=Ua(e),r=-2048*n,o=-2048*i;return{image:t,top:o,bottom:o+2048,left:r,right:r+2048}}(t.positions[u.icon.url],e),this.size||(this.size=a.image.displaySize)}return this.dt=a,a}getIconAndGlyph(){if(this.iconGlyph)return this.iconGlyph;const{markerFileFn:t,markerTypeFn:e,markerPathFn:n,markerWidthFn:i,markerHeightFn:r,markerFillFn:o,markerFillPatternFileFn:s,markerFillOpacityFn:a,markerTextFitFn:l,markerTextFitPaddingFn:u,markerLineColorFn:c,markerLineWidthFn:h,markerLineOpacityFn:d,markerLineDasharrayFn:m,markerLinePatternFileFn:y,markerPathWidthFn:g,markerPathHeightFn:b,textNameFn:v,textFaceNameFn:w,textStyleFn:x,textWeightFn:k}=this.nt,{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,_=!ni(this.symbolDef.textName);let P;if(S){P=function(t,e,n,i,r,o){if(ni(e.markerWidth)&&ni(e.markerHeight))return null;const s="__fn_markerWidth".trim(),a="__fn_markerHeight".trim();let l=e.markerWidth||0,u=e.markerHeight||0;return ri(l)&&("identity"!==l.type?l=ea(l):(l=t.markerWidth,t[s]&&(l=t[s](i,n)),ri(l)&&(l="identity"===l.type?r(i,n):ea(l)))),ri(u)&&("identity"!==u.type?u=ea(u):(u=t.markerHeight,t[a]&&(u=t[a](i,n)),ri(u)&&(u="identity"===u.type?o(i,n):ea(u)))),[l,u]}(A,this.symbolDef,F,M,i,r)||[0,0];let t=A.markerTextFit;if(l&&(t=l(M,F)),t&&A.text&&"none"!==t){const e=A.text.textSize;let n=A.text.textName;f(n)&&(n=p(n)(M,F));const i=ra(n,F);if(i){const n="__fn_textSize".trim(),r="__fn_textSize_0".trim();f(e)&&!A.text[n]&&(A.text[r]=p(e),A.text[n]=(t,e)=>{const n=A.text[r](t,e);return f(n)?p(n)(t,e):n});const o=ta(A.text,A.text,F,M);if("width"!==t&&"both"!==t||(P[0]=o[0]*i.length),"height"!==t&&"both"!==t||(P[1]=o[1]),o[0]&&o[1]){let t=A.markerTextFitPadding||[0,0,0,0];u&&(t=u(M,F)),P[0]+=t[1]+t[3],P[1]+=t[0]+t[2]}}else P[0]=P[1]=-1}}if(_&&(P=ta(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=n?n(null,F):A.markerPath,e.markerPathWidth=g?g(null,F):A.markerPathWidth,e.markerPathHeight=b?b(null,F):A.markerPathHeight),i){const t=i(null,F);ni(t)||(e.markerWidth=t)}else A.markerWidth>=0&&(e.markerWidth=A.markerWidth);if(r){const t=r(null,F);ni(t)||(e.markerHeight=t)}else A.markerHeight>=0&&(e.markerHeight=A.markerHeight);if(o){const t=o(null,F);ni(t)||(e.markerFill=t)}else A.markerFill&&(e.markerFill=A.markerFill);if(s){const t=s(null,F);ni(t)||(e.markerFillPatternFile=t)}else A.markerFillPatternFile&&(e.markerFillPatternFile=A.markerFillPatternFile);if(a){const t=a(null,F);ni(t)||(e.markerFillOpacity=t)}else A.markerFillOpacity>=0&&(e.markerFillOpacity=A.markerFillOpacity);if(c){const t=c(null,F);ni(t)||(e.markerLineColor=t)}else A.markerLineColor&&(e.markerLineColor=A.markerLineColor);if(h){const t=h(null,F);ni(t)||(e.markerLineWidth=t)}else A.markerLineWidth>=0&&(e.markerLineWidth=A.markerLineWidth);if(d){const t=d(null,F);ni(t)||(e.markerLineOpacity=t)}else A.markerLineOpacity>=0&&(e.markerLineOpacity=A.markerLineOpacity);if(m){const t=m(null,F);ni(t)||(e.markerLineDasharray=t)}else A.markerLineDasharray&&(e.markerLineDasharray=A.markerLineDasharray);if(y){const t=y(null,F);ni(t)||(e.markerLinePatternFile=t)}else A.markerLinePatternFile&&(e.markerLinePatternFile=A.markerLinePatternFile);t="vector://"+JSON.stringify(e)}else t=T?T.replace(Ha,this.ct):A.markerPath?function(t,e,n){if(!t.markerPath)return null;let i=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);ii(t.markerOpacity)&&(i=t.markerOpacity),ii(t.opacity)&&(i*=t.opacity);const o={};if(r){for(const t in r.stroke)li(r.stroke,t)&&(ni(r.stroke[t])||(o[t]=r.stroke[t]));for(const t in r.fill)li(r.fill,t)&&(ni(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=oi(s[t])?{path:s[t]}:s[t],a=ei({},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"\'];i<1&&u.push(\'opacity="\'+i+\'"\'),t.markerPathWidth&&t.markerPathHeight&&u.push(\'viewBox="0 0 \'+t.markerPathWidth+" "+t.markerPathHeight+\'"\'),u.push(\'preserveAspectRatio="none"\'),e&&u.push(\'width="\'+e+\'"\'),n&&u.push(\'height="\'+n+\'"\'),u.push("><defs></defs>");for(let t=0;t<l.length;t++){let e="<path ";for(const n in l[t])li(l[t],n)&&(e+=" "+n+\'="\'+l[t][n]+\'"\');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=na(w?w(null,F):A.textFaceName,x?x(null,F):A.textStyle,k?k(null,F):A.textWeight);let n=ra(t,F);n&&n.length&&(n=Ja(n),j.glyph={font:e,text:n})}}return this.iconGlyph=j,j}}function Va(t,e){e&&"middle"!==e||(e="center"),t&&"middle"!==t||(t="center");let n="center"!==e?e:"";return n+="center"!==t?(n.length?"-":"")+t:"",n\n/*!\n * From mapbox-gl-js\n * MIT License\n * https://github.com/mapbox/mapbox-gl-js\n */}function Ba(t,e,n,i,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 Et(e,a.y+(e-a.x)/(h.x-a.x)*(h.y-a.y)).I(),a.z=s.z+(e-s.x)/(h.x-s.x)*(h.z-s.z),c=!0):h.x<e&&(s=h,h=new Et(e,a.y+(e-a.x)/(h.x-a.x)*(h.y-a.y)).I(),h.z=a.z+(e-a.x)/(s.x-a.x)*(s.z-a.z),c=!0),a.y<n&&h.y<n||(a.y<n?(s=a,a=new Et(a.x+(n-a.y)/(h.y-a.y)*(h.x-a.x),n).I(),a.z=s.z+(n-s.y)/(h.y-s.y)*(h.z-s.z),c=!0):h.y<n&&(s=h,h=new Et(a.x+(n-a.y)/(h.y-a.y)*(h.x-a.x),n).I(),h.z=a.z+(n-a.y)/(s.y-a.y)*(s.z-a.z),c=!0),a.x>=i&&h.x>=i||(a.x>=i?(s=a,a=new Et(i,a.y+(i-a.x)/(h.x-a.x)*(h.y-a.y)).I(),a.z=s.z+(i-s.x)/(h.x-s.x)*(h.z-s.z),c=!0):h.x>=i&&(s=h,h=new Et(i,a.y+(i-a.x)/(h.x-a.x)*(h.y-a.y)).I(),h.z=a.z+(i-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 Et(a.x+(r-a.y)/(h.y-a.y)*(h.x-a.x),r).I(),a.z=s.z+(r-s.y)/(h.y-s.y)*(h.z-s.z),c=!0):h.y>=r&&(s=h,h=new Et(a.x+(r-a.y)/(h.y-a.y)*(h.x-a.x),r).I(),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 Za extends Et{constructor(t,e,n,i){super(t,e),this.angle=n,void 0!==i&&(this.segment=i)}clone(){return new Za(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 Ya(t,e,n,i,r){if(void 0===e.segment)return!0;let o=e,s=e.segment+1,a=0;for(;a>-n/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<n/2;){const e=t[s],n=t[s+1];if(!n)return!1;let o=t[s-1].angleTo(e)-e.angleTo(n);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>i;)u-=l.shift().angleDelta;if(u>r)return!1;s++,a+=e.dist(n)}return!0}function Xa(t,e,n,i,r,o,s,a,l,u,c){const h=function(t,e,n){return t?.6*e*n:0}(i,o,s),d=function(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}(i,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,n,i,r,o,s,a,l,u,c,h){const d=s/2,f=function(t){let e=0;for(let n=0;n<t.length-1;n++)e+=t[n].dist(t[n+1]);return e}(e);let p=0,m=n-i,y=[];for(let t=0;t<e.length-1;t++){const n=e[t],a=e[t+1],l=n.dist(a),g=a.angleTo(n);for(;m+i<p+l;){m+=i;const b=(m-p)/l,v=Ka(n.x,a.x,b),w=Ka(n.y,a.y,b),x=Ka(n.z||0,a.z||0,b);if(v>=0&&v<u&&w>=0&&w<u&&m-d>=0&&m+d<=f){const i=new Za(v,w,g,t);i.z=x,c&&(i.axis=[n.y-w,v-n.x],i.angleR=x===(n.z||0)?0:Math.atan(.9*(x-(n.z||0))*h/n.dist(i))),i.line=e,i.I(),r&&!Ya(e,i,s,r,o)||y.push(i)}}p+=l}return l||y.length||a||(y=t(e,p/2,i,r,o,s,a,!0,u,c,h)),y}(t,f?e/2*a%e:(d/2+2*o)*s*a%e,e,h,n,d*s,f,!1,l,u,c)}function Ka(t,e,n){return t*(1-n)+e*n}function Qa(t,e){const n=t.length;if(n<=1)return[t];const i=[];let r,o;for(let e=0;e<n;e++){const n=bi(t[e]);0!==n&&(t[e].area=Math.abs(n),void 0===o&&(o=n<0),o===n<0?(r&&i.push(r),r=[t[e]]):r.push(t[e]))}if(r&&i.push(r),e>1)for(let t=0;t<i.length;t++)i[t].length<=e||(Je(i[t],e,1,i[t].length-1,tl),i[t]=i[t].slice(0,e));return i}function tl(t,e){return e.area-t.area}function el(t,e,n){const i=e.distSqr(n);if(0===i)return t.distSqr(e);const r=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/i;return t.distSqr(r<0?e:r>1?n:n.sub(e).j(r).m(e))}function nl(t,e=1,n=!1){let i=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<i)&&(i=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-i,s-r);let u=l/2;const c=new Be(null,il);if(0===l)return new Et(i,r);for(let e=i;e<o;e+=l)for(let n=r;n<s;n+=l)c.push(new rl(e+u,n+u,u,t));let h=function(t){let e=0,n=0,i=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;n+=(o.x+a.x)*l,i+=(o.y+a.y)*l,e+=3*l}return new rl(n/e,i/e,0,t)}(t),d=c.length;for(;c.length;){const i=c.pop();(i.d>h.d||!h.d)&&(h=i,n&&console.log("found best %d after %d probes",Math.round(1e4*i.d)/1e4,d)),i.max-h.d<=e||(u=i.h/2,c.push(new rl(i.p.x-u,i.p.y-u,u,t)),c.push(new rl(i.p.x+u,i.p.y-u,u,t)),c.push(new rl(i.p.x-u,i.p.y+u,u,t)),c.push(new rl(i.p.x+u,i.p.y+u,u,t)),d+=4)}return n&&(console.log("num probes: "+d),console.log("best distance: "+h.d)),h.p}function il(t,e){return e.max-t.max}function rl(t,e,n,i){this.p=new Et(t,e),this.h=n,this.d=function(t,e){let n=!1,i=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&&(n=!n),i=Math.min(i,el(t,r,a))}}return(n?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}const ol=45*Math.PI/100;function sl(t,e,n,i,r,o,s,a,l){const{feature:u,size:c,symbol:h}=t,d=c?24:0,f=i*(c?c[0]/d:1);if("line"===o){const t=[];let i=u.geometry;r&&(i=Ba(u.geometry,0,0,r,r));for(let o=0;o<i.length;o++){const u=Xa(i[o],s,ol,h.isIconText?null:n&&n.vertical||n&&n.horizontal||n,null,d,h.isIconText?1:f,1,r||1/0,a,l);if(h.textPlacement&&!h.isIconText)for(let t=0;t<u.length;t++)u[t].startIndex=e.length/3;if(t.push.apply(t,u),h.textPlacement&&!h.isIconText)for(let t=0;t<i[o].length;t++)e.push(i[o][t].x,i[o][t].y,i[o][t].z||0)}return t}return al(u,o,r)}function al(t,e,n){const i=[];if(3===t.type){const r=Qa(t.geometry,0);for(let t=0;t<r.length;t++){const o=r[t];if("vertex"===e)for(let t=0;t<o.length;t++){const e=o[t];for(let t=0;t<e.length;t++)ki(e[t],n)||i.push(e[t])}else if("vertex-first"===e){const t=o[0];t&&t[0]&&!ki(t[0],n)&&i.push(t[0])}else if("vertex-last"===e){const t=o[0];t&&t[t.length-1]&&!ki(t[t.length-1],n)&&i.push(t[t.length-1])}else{const t=nl(o,16);ki(t,n)||i.push(t)}}}else if(2===t.type)for(let r=0;r<t.geometry.length;r++){const o=t.geometry[r];if("vertex"===e)for(let t=0;t<o.length;t++)ki(o[t],n)||i.push(o[t]);else"vertex-last"===e?o&&o[o.length-1]&&!ki(o[o.length-1],n)&&i.push(o[o.length-1]):ki(o[0],n)||i.push(o[0])}else if(1===t.type)for(let e=0;e<t.geometry.length;e++){const r=t.geometry[e];for(let t=0;t<r.length;t++){const e=r[t];ki(e,n)||i.push(e)}}return i}function ll(t,e){const n={},i={},r=[];let o=0;function s(e){r.push(t[e]),o++}function a(t,e,n){const o=i[t];return delete i[t],i[e]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(n[0]),o}function l(t,e,i){const o=n[e];return delete n[e],n[t]=o,r[o].geometry[0].shift(),r[o].geometry[0]=i[0].concat(r[o].geometry[0]),o}function u(t,e,n){const i=n?e[0][e[0].length-1]:e[0][0];return`${t}:${i.x}:${i.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 i&&m in n&&i[p]!==n[m]){const t=l(p,m,d),e=a(p,m,r[t].geometry);delete n[p],delete i[m],i[u(f,r[e].geometry,!0)]=e,r[t].geometry=null}else p in i?a(p,m,d):m in n?l(p,m,d):(s(c),n[p]=o-1,i[m]=o-1)}return r.filter(t=>t.geometry)}class ul extends Xs{static needMerge(t,e,n){if(!t)return!1;let i="line"===t.textPlacement||"line"===t.markerPlacement;return i||(e.textPlacementFn&&(i="line"===e.textPlacementFn(n)),e.markerPlacementFn&&(i="line"===e.markerPlacementFn(n))),t.mergeOnProperty&&i}static mergeLineFeatures(t,e,n,i){const r="__index".trim();let o=e.textPlacement,s=e.markerPlacement;n.textPlacementFn&&(o=n.textPlacementFn(i)),n.markerPlacementFn&&(s=n.markerPlacementFn(i));const a=function(t,e,n,i,r){const o="__index".trim(),s=Xs.genFnTypes(e),{mergeOnPropertyFn:a}=s;if(!e.mergeOnProperty||"line"!==i&&"line"!==n)return[];if(!(Mi(l=e.mergeOnProperty)||"string"!=typeof l&&(null===l.constructor||l.constructor!==String)||"line"!==i&&"line"!==n))return[{features:t,property:e.mergeOnProperty}];var l;const u=[],c={},h=[];for(let s=0;s<t.length;s++){t[s][o]=s;const l=t[s].properties=t[s].properties||{};l.$layer=t[s].layer,l.$type=t[s].type;let d=n;"line"!==d&&(d=i);const f=a?a(r,l):e.mergeOnProperty;"line"!==d||Mi(f)?h.push(t[s]):(void 0===c[f]&&(c[f]=u.length,u.push({features:[],property:f})),u[c[f]].features.push(t[s]))}return h.length&&u.push({features:h}),u}(t,e,s,o,i);if(a.length){const e=[];for(let n=0;n<a.length;n++)e.push(a[n].property?ll(a[n].features,a[n].property):t);if(1===e.length)return e[0];{let t=[];for(let n=0;n<e.length;n++)t=t.concat(e[n]);return t.sort((t,e)=>t[r]-e[r]),t}}}static splitPointSymbol(t,e=0){const n=[];if(Array.isArray(t)){const e=t;for(let t=0;t<e.length;t++)e[t]&&n.push(...ul.splitPointSymbol(e[t],t));return n}let i=null,r=null;for(const e in t)0===e.indexOf("marker")?(i=i||{},i[e]=t[e]):0===e.indexOf("text")&&(r=r||{},r[e]=t[e]);return i&&(i.isIconText=!0,t.mergeOnProperty&&(i.mergeOnProperty=t.mergeOnProperty),n.push(i)),r&&(i&&(r.textPlacement=i.markerPlacement,r.textSpacing=i.markerSpacing,r.isIconText=!0),t.mergeOnProperty&&(r.mergeOnProperty=t.mergeOnProperty),n.push(r)),void 0!==t.visible&&(i&&(i.visible=t.visible),r&&(r.visible=t.visible)),i&&(i.markerTextFit&&r&&(i.text={},i.text.textName=r.textName,i.text.textSize=r.textSize),i.index={index:e,type:0}),r&&(r.index={index:e,type:1}),n}static isAtlasLoaded(t,e){const{icon:n,glyph:i}=t,{iconAtlas:r,glyphAtlas:o}=e;if(n&&(!r||!r.positions[n.url]))return!1;if(i){if(!o||!o.positions[i.font])return!1;const t=o.positions[i.font],{text:e}=i;for(let n=0;n<e.length;n++)if(!t[e.charCodeAt(n)])return!1}return!0}constructor(t,e,n){super(t,e,n),this.ft=e.textPlacement,this.nt.textPlacementFn&&(this.ft=this.nt.textPlacementFn(this.options.zoom))}createStyledVector(t,e,n,i,r,o){const s=new Ga(t,this.symbolDef,e,n,i),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:e}=a.glyph,n=o[t]=o[t]||{};for(let t=0;t<e.length;t++)n[e.charCodeAt(t)]=1;"line"===this.ft&&(o.options={isCharsCompact:!1})}return this.options.allowEmptyPack||a.icon||a.glyph?s:null}getFormat(t){const e=void 0!==t.textName,n=e?this.getPackSDFFormat(t):this.getPackMarkerFormat();e?n.push(...this.pt()):n.push(...this.yt());const{markerOpacityFn:i,textOpacityFn:r,markerPitchAlignmentFn:o,textPitchAlignmentFn:s,markerRotationAlignmentFn:a,textRotationAlignmentFn:l,markerRotationFn:u,textRotationFn:c,markerAllowOverlapFn:h,textAllowOverlapFn:d,markerIgnorePlacementFn:f,textIgnorePlacementFn:p}=this.nt;return(i||r)&&n.push({type:Uint8Array,width:1,name:"aColorOpacity"}),(o||s)&&n.push({type:Uint8Array,width:1,name:"aPitchAlign"}),(a||l)&&n.push({type:Uint8Array,width:1,name:"aRotationAlign"}),(u||c)&&n.push({type:Uint16Array,width:1,name:"aRotation"}),(h||d||f||p)&&n.push({type:Uint8Array,width:1,name:"aOverlap"}),n}gt(){return this.hasMapPitchAlign}pt(){const{textFillFn:t,textSizeFn:e,textHaloFillFn:n,textHaloRadiusFn:i,textHaloOpacityFn:r,textDxFn:o,textDyFn:s}=this.nt,a=[];return t&&a.push({type:Uint8Array,width:4,name:"aTextFill"}),e&&a.push({type:Uint8Array,width:1,name:"aTextSize"}),n&&a.push({type:Uint8Array,width:4,name:"aTextHaloFill"}),i&&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}yt(){const{markerWidthFn:t,markerHeightFn:e,markerDxFn:n,markerDyFn:i}=this.nt,r=[];return t&&r.push({type:this.options.markerWidthType||Uint8Array,width:1,name:"aMarkerWidth"}),e&&r.push({type:this.options.markerHeightType||Uint8Array,width:1,name:"aMarkerHeight"}),n&&r.push({type:Int8Array,width:1,name:"aMarkerDx"}),i&&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 n=t.getShape(this.iconAtlas,this.glyphAtlas);if(!this.options.allowEmptyPack&&!n)return;const i=this.bt(t,n,e);if(0===i.length)return;const r=this.data,o=this.needAltitudeAttribute()?2:3;let s=this.data.aPosition.length/o;const a=t.symbol,l=t.feature.properties,u="line"===this.ft&&!a.isIconText,c=void 0!==a.textName,h=c&&u&&function(t){let e=0;for(let n=0;n<t.length;n++)if(_a(t.charAt(n).charCodeAt(0)))e=0;else if(e++,e>=1)return!1;return!0}(t.getIconAndGlyph().glyph.text)?1:0,{textFillFn:d,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:C}=this.nt;let N,R,E,L,D,$,U,W,J,H,G,V,B,Z,Y,X,K;if(c){const e=t.getIconAndGlyph().glyph.font;N=function(t,e,n){const i=t.positionedGlyphs,r=[];for(let o=0;o<i.length;o++){const s=i[o],a=n[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 Et(p,m),v=new Et(y,m),w=new Et(p,g),x=new Et(y,g);if(e&&s.vertical){const t=new Et(-c,c),e=-Math.PI/2,n=new Et(5,0);b.T(e,t).m(n),v.T(e,t).m(n),w.T(e,t).m(n),x.T(e,t).m(n)}r.push({tl:b,tr:v,bl:w,br:x,tex:l,writingMode:t.writingMode,glyphOffset:d})}return r}(n.horizontal,u,this.glyphAtlas.positions[e]),d&&(R=d(null,l),R=f(R)?[0,0,0,0]:pi([],R)),p&&(E=p(this.options.zoom,l),Mi(E)&&(E=14)),m&&(L=m(null,l),L=pi([],L)),y&&(D=y(null,l)),g&&($=255*g(null,l)),b&&(U=b(null,l)||0),v&&(W=v(null,l)||0),w&&(B=+("map"===w(null,l))),x&&(Z=+("map"===x(null,l))),k&&(Y=ji(k(null,l),0,360)*Math.PI/180)}else N=n?function(t){const e=t.image,n=t.top-1/e.pixelRatio,i=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 Et(i,n),a=new Et(o,n),l=new Et(o,r),u=new Et(i,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]}]}(n):function(){const t=new Et(0,0),e=new Et(0,0),n=new Et(0,0);return[{tl:t,tr:e,bl:new Et(0,0),br:n,tex:{x:0,y:0,w:0,h:0},writingMode:void 0,glyphOffset:[0,0]}]}(),F&&(J=F(null,l)),T&&(H=T(null,l)),z&&(G=z(null,l)),S&&(V=S(null,l)),_&&(B=+("map"===_(null,l))),P&&(Z=+("map"===P(null,l))),I&&(Y=ji(I(null,l),0,360)*Math.PI/180);const Q=O||M;Q&&(X=Q(null,l)||0);const tt=q||j;let et;tt&&(K=tt(null,l)||0);const nt=A||C;nt&&(et=255*nt(this.options.zoom,l));const it=this.options.EXTENT,rt=N.length,{altitudeScale:ot,altitudeProperty:st,defaultAltitude:at}=this.options,{altitude:lt}=xi(t.feature,ot,st,at);for(let t=0;t<i.length;t++){const e=i[t],n=e.z||lt||0;if(it!==1/0&&ki(e,it))continue;const o=e.x,a=e.y,l=N.length;for(let t=0;t<l;t++){const i=N[t],{tl:l,tr:d,bl:f,br:p,tex:m}=i;this.vt(r,o,a,n,10*l.x,10*l.y,m.x,m.y+m.h),c&&this.wt(r,u,rt,i.glyphOffset,e,h,e.axis,e.angleR),this.xt(r,R,E,L,D,$,U,W,J,H,G,V,et,B,Z,Y,X,K),this.vt(r,o,a,n,10*d.x,10*d.y,m.x+m.w,m.y+m.h),c&&this.wt(r,u,rt,i.glyphOffset,e,h,e.axis,e.angleR),this.xt(r,R,E,L,D,$,U,W,J,H,G,V,et,B,Z,Y,X,K),this.vt(r,o,a,n,10*f.x,10*f.y,m.x,m.y),c&&this.wt(r,u,rt,i.glyphOffset,e,h,e.axis,e.angleR),this.xt(r,R,E,L,D,$,U,W,J,H,G,V,et,B,Z,Y,X,K),this.vt(r,o,a,n,10*p.x,10*p.y,m.x+m.w,m.y),c&&this.wt(r,u,rt,i.glyphOffset,e,h,e.axis,e.angleR),this.xt(r,R,E,L,D,$,U,W,J,H,G,V,et,B,Z,Y,X,K),this.addElements(s,s+1,s+2),this.addElements(s+1,s+2,s+3),s+=4;const y=Math.max(Math.abs(o),Math.abs(a),Math.abs(n));y>this.maxPos&&(this.maxPos=y)}}}vt(t,e,n,i,r,o,s,a){this.fillPosition(t,e,n,i),t.aShape.push(r,o),t.aTexCoord.push(s,a)}wt(t,e,n,i,r,o,s,a){if(t.aCount.push(n),e){t.aGlyphOffset.push(i[0],i[1]),this.gt()&&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)}}xt(t,e,n,i,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:C,markerRotationAlignmentFn:N,markerRotationFn:R,markerAllowOverlapFn:E,markerIgnorePlacementFn:L,markerOpacityFn:D}=this.nt;b&&t.aTextFill.push(...e),v&&t.aTextSize.push(n),w&&t.aTextHaloFill.push(...i),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||C)&&t.aPitchAlign.push(f),(N||F)&&t.aRotationAlign.push(p),(R||T)&&t.aRotation.push(9362*m);const $=E||z,U=L||S;($||U)&&t.aOverlap.push(($?8:0)+4*y+((U?2:0)+g)),r>0&&(this.properties.hasHalo=1)}bt(t,e,n){const{feature:i,symbol:r}=t,o=this.kt(t,r),s=i.properties,{markerSpacingFn:a,textSpacingFn:l}=this.nt,u=((a?a(null,s):r.markerSpacing)||(l?l(null,s):r.textSpacing)||250)*n,c=this.options.altitudeToTileScale;return sl(t,this.lineVertex,e,n,this.options.EXTENT,o,u,this.gt(),c)}kt(t,e){let n;return n=this.nt.markerPlacementFn?this.nt.markerPlacementFn(this.options.zoom,t.feature.properties):e.markerPlacement||this.ft,this.st||!e.markerPlacement&&!e.isIconText||(this.st=n),!this.ft||e.isIconText||this.lt||(this.lt=n),n}getPackSDFFormat(t){if("line"!==this.ft||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.gt()&&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 cl{constructor(t){this.x=t.x,this.y=t.y,this.z=t.z||0}clone(){return new cl(this)}_(){return this.A(this.mag()),this}A(t){return this.x/=t,this.y/=t,this.z/=t,this}P(){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().m(t)}sub(t){return this.clone().v(t)}m(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this}v(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().j(t)}j(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,n=t.y-this.y,i=t.z-this.z;return e*e+n*n+i*i}I(){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 hl=Math.cos(Math.PI/180*37.5),dl=Math.pow(2,16)/1,fl=new Et,pl=new Et,ml=new Et;class yl extends Xs{constructor(t,e,n){super(t,e,n);let i=!1;const{lineDasharrayFn:r,lineDashColorFn:o}=this.nt;this.hasGradient=this.symbol.lineGradientProperty,r&&(i=function(t,e,n){for(let i=0;i<t.length;i++)if(n(e,t[i].properties))return!0;return!1}(t,this.options.zoom,r),i&&(this.dasharrayFn=r)),this.hasDasharray=vl(this.symbol.lineDasharray)||i,this.hasDasharray&&o&&(this.dashColorFn=o)}createStyledVector(t,e,n,i,r){const o=new Fi(t,e,n,i),s=o.getLineResource();return!this.options.atlas&&s&&(r[s]=[0,0]),o}getFormat(){const{lineWidthFn:t,lineStrokeWidthFn:e,lineStrokeColorFn:n,lineColorFn:i,lineOpacityFn:r,lineDxFn:o,lineDyFn:s,linePatternAnimSpeedFn:a,linePatternGapFn:l}=this.nt,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"}),i&&u.push({type:Uint8Array,width:4,name:"aColor"}),n&&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:n,lineWidthFn:i,lineHeightFn:r,lineStrokeWidthFn:o,lineStrokeColorFn:s,lineColorFn:a,lineOpacityFn:l,lineDxFn:u,lineDyFn:c,linePatternAnimSpeedFn:h,linePatternGapFn:d}=this.nt,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"),n&&(b=n(this.options.zoom,y)||"butt"),i){let t=i(this.options.zoom,y);ni(t)&&(t=4),this.feaLineWidth=+t}else this.feaLineWidth=+p.lineWidth;if(r){let t=r(this.options.zoom,y);ni(t)&&(t=this.feaLineWidth),this.feaLineHeight=+t}else this.feaLineHeight=+p.lineHeight||this.feaLineWidth;if(o){let t=o(this.options.zoom,y);ni(t)&&(t=0),this.feaLineStrokeWidth=t}else this.feaLineStrokeWidth=p.lineStrokeWidth||0;if(a&&(this.feaColor=a(this.options.zoom,y)||[255,255,255,255],this.feaColor=f(this.feaColor)?[0,0,0,0]:pi([],this.feaColor)),s&&(this.feaStrokeColor=s(this.options.zoom,y)||[0,0,0,255],this.feaStrokeColor=f(this.feaStrokeColor)?[0,0,0,0]:pi([],this.feaStrokeColor)),l){let t=l(this.options.zoom,y);ni(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=pi([],t),this.feaDashColor=t}if(this.iconAtlas){const e=t.getLineResource(),n=this.iconAtlas.glyphMap[e];if(this.feaTexInfo=this.feaTexInfo||[0,0,0,0],n){const{tl:t,displaySize:n}=this.iconAtlas.positions[e];this.feaTexInfo[0]=t[0]+1,this.feaTexInfo[1]=t[1]+1,this.feaTexInfo[2]=n[0]-3,this.feaTexInfo[3]=n[1]-3}else this.feaTexInfo[0]=this.feaTexInfo[1]=this.feaTexInfo[2]=this.feaTexInfo[3]=0}if(u){let t=u(this.options.zoom,y);ni(t)&&(t=0),this.feaLineDx=t}if(c){let t=c(this.options.zoom,y);ni(t)&&(t=0),this.feaLineDy=t}if(h){let t=h(this.options.zoom,y);ni(t)&&(t=0),0!==t&&(this.properties.hasPatternAnim=1),this.feaPatternAnimSpeed=t}if(d){let t=d(this.options.zoom,y);ni(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 n=Ba(t,-1,-1,v+1,v+1);if(3===m.type&&n.length>1){const t=n[0],e=n[n.length-1];Ml(t[0],e[e.length-1])&&(n[0]=e.concat(t.slice(1)),n.length=n.length-1)}w.push(...n)}}const x=this.needAltitudeAttribute()?2:3;for(let t=0;t<w.length;t++)this.offset=this.data.aPosition.length/x,this.Mt(w[t],m,g,b,2,1.05)}jt(){return this.iconAtlas&&this.feaTexInfo[2]&&this.feaTexInfo[3]}Mt(t,e,n,i,r,o){const s=this.jt()||vl(this.feaDash)||vl(this.symbol.lineDasharray),a=this.options.isTube;a&&(t=t.map(t=>new cl(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&&li(e.properties,"mapbox_clip_start")&&li(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&&Ml(t[c-1],t[c-2]);)c--;let h=0;for(;h<c-1&&Ml(t[h],t[h+1]);)h++;if(c<(u?3:2))return;"bevel"===n&&(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)._().P());for(let e=h;e<c;e++){if(y=e===c-1?u?t[h+1]:void 0:t[e+1],y&&Ml(t[e],y))continue;b&&(g=b),p&&(m=p),p=t[e],b=y?y.sub(p)._().P():g,f.dir=m?p.sub(m)._():y.sub(p)._(),g=g||b,f.currentNormal=g;let l=g.add(b);0===l.x&&0===l.y||l._();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<hl&&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).j(d/t).I());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?n:u?"butt":i;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)._(),this.addCurrentVertex(p,b,0,0,f)):(l.j(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.P().j(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,n=j?0:t;if(m&&this.addCurrentVertex(p,g,e,n,f),"fakeround"===F){const t=Math.round(180*k/Math.PI/20);for(let e=1;e<t;e++){let n=e/t;if(.5!==n){const t=n-.5;n+=n*t*(n-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*t*t+(.848013+v*(.215638*v-1.06021)))}const i=b.sub(g).j(n).m(g)._().j(j?-1:1);this.addHalfVertex(p,i.x,i.y,!1,j,0,f)}}y&&(f.currentNormal=b,this.addCurrentVertex(p,b,-e,-n,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).j(d/t).I());e.z=p.z,this.updateDistance(p,e),this.addCurrentVertex(e,b,0,0,f),p=e}}}}addCurrentVertex(t,e,n,i,r,o=!1){const s=e.x+e.y*n,a=e.y-e.x*n,l=e.y*i-e.x,u=-e.y-e.x*i;let c=0,h=0;if(r.middleVertex){fl.x=s,fl.y=a,pl.x=l,pl.y=u;const t=r.currentNormal;if(c=kl(t,fl),0===n&&0===i)h=-c;else{const e=ml;e.x=t.x,e.y=t.y,e.j(-1),h=kl(e,pl)}}this.addHalfVertex(t,s,a,o,!1,n,r,c),this.addHalfVertex(t,l,u,o,!0,-i,r,h),this.prevVertex&&Ml(t,this.prevVertex)||(this.prevVertex=t),this.distance>dl/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,n,i,r,o))}addHalfVertex({x:t,y:e,z:n},i,r,o,s,a,l,u){this.fillData(this.data,t,e,n||0,i,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,n,i,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.nt;this.fillPosition(t,e,n,i);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(n)+1)}addElements(t,e,n){super.addElements(this.offset+t,this.offset+e,this.offset+n)}At(t){const e=this.options.EXTENT,n=this.elements;for(let i=0;i<n.length;i+=3)e!==1/0&&(bl(this.data.aPosition,n[i],n[i+1],3,e)||bl(this.data.aPosition,n[i+1],n[i+2],3,e))||t.push(n[i],n[i+1],n[i+2])}Ft(t){if(t.length<=1)return t;const e=[],n=this.options.EXTENT;let i,r=!0;for(i=0;i<t.length-1;i++){const o=gl(t[i],t[i+1],n);o&&r||(e.push(t[i]),r=o)}return r||e.push(t[i]),e}updateDistance(t,e){if(this.options.isTube){const n=t.dist(e),i=hi(this.options)*(e.z-t.z);this.distance+=Math.sqrt(n*n+i*i)}else this.distance+=t.dist(e);this.updateScaledDistance()}updateScaledDistance(){this.scaledDistance=this.totalDistance>0?(this.clipStart+(this.clipEnd-this.clipStart)*this.distance/this.totalDistance)*(dl-1):this.distance}}function gl(t,e,n){return n!==1/0&&(t.x<0&&e.x<0||t.x>n&&e.x>n||t.y<0&&e.y<0||t.y>n&&e.y>n)}function bl(t,e,n,i,r){if(r===1/0)return!1;const o=Math.floor(.5*t[e*i]),s=Math.floor(.5*t[e*i+1]),a=Math.floor(.5*t[n*i]),l=Math.floor(.5*t[n*i+1]);return o===a&&(o<0||o>r)&&s!==l||s===l&&(s<0||s>r)&&o!==a}function vl(t){if(!Array.isArray(t))return!1;for(let e=0;e<t.length;e++)if(t[e])return!0;return!1}const wl=new Et(0,0),xl=new Et(0,0);function kl(t,e){const n=t.mag(),i=e.mag();wl.x=e.x,wl.y=e.y;const r=t.angleTo(xl),o=e.angleTo(xl);return Math.sign(o-r)*Math.sqrt(i*i-n*n)}function Ml(t,e){return t.equals(e)&&t.z===e.z}class jl extends yl{constructor(t,e,n){super(t,e,n),this.Tt=n.altitudeProperty}getFormat(){const{lineColorFn:t,lineWidthFn:e}=this.nt,n=[{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&&n.push({type:Uint8Array,width:4,name:"aColor"}),e&&n.push({type:Uint8Array,width:1,name:"aLineWidth"}),this.Tt&&n.push({type:Array,width:1,name:"aLineHeight"}),n}placeVector(t){const e=t.feature;if(this.Tt){const{altitudeScale:t,altitudeProperty:n,defaultAltitude:i,heightProperty:r,defaultHeight:o,minHeightProperty:s}=this.options,{altitude:a,height:l}=xi(e,t,n,i,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}Mt(t,e,n,i,r,o){const s=this.data.aPosition.length/3;super.Mt(t,e,n,i,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 n=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],i=e.length/n;for(let t=0;t<i;t++)e.push(e[s*i+3*i+t])}n=this.data.aPosition.length/3;for(const t in this.data){const i=this.data[t],r=i.length/n;for(let t=0;t<r;t++)i.push(i[s*r+r*e+t])}n=this.data.aPosition.length/3;for(const t in this.data){const i=this.data[t],r=i.length/n;for(let t=0;t<r;t++)i.push(i[s*r+r*(e+3)+t])}super.addElements(t+1,l+1,l),super.addElements(l,l+1,l+2);const i=this.data.aPosition.length/3-this.offset;n=this.data.aPosition.length/3;for(const t in this.data){const e=this.data[t],i=e.length/n;for(let t=0;t<i;t++)e.push(e[a*i-i+t])}n=this.data.aPosition.length/3;for(const t in this.data){const i=this.data[t],r=i.length/n;for(let t=0;t<r;t++)i.push(i[a*r-e*r-r+t])}n=this.data.aPosition.length/3;for(const t in this.data){const i=this.data[t],r=i.length/n;for(let t=0;t<r;t++)i.push(i[a*r-e*r-3*r+t])}super.addElements(i,l-3,i+1),super.addElements(l-3,i+2,i+1)}}fillData(t,e,n,i,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+n;this.zt(t,e,n,r,o,s,a,l,p,m,d,f),c&&(u&&this.zt(t,e,n,r,o,s,a,l,p,m,d,f),this.zt(t,e,n,r,o,s,a,l,p,m,d,f),this.St(t,e,n,r,o,s,a,l,p,m,d,f),this.St(t,e,n,r,o,s,a,l,p,m,d,f)),this.maxPos=Math.max(this.maxPos,Math.abs(e),Math.abs(n))}zt(t,e,n,i,r,o,s,a,l,u,c,h){const{lineColorFn:d,lineWidthFn:f}=this.nt;t.aPosition.push(e,n,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.Tt&&t.aLineHeight.push(this.feaAltitude)}St(t,e,n,i,r,o,s,a,l,u,c,h){const{lineColorFn:d,lineWidthFn:f}=this.nt;t.aPosition.push(e,n,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.Tt&&t.aLineHeight.push(this.feaAltitude)}addElements(t,e,n){const i=!1!==this.options.top,r=!1!==this.options.side,o=(i?1:0)+(r?4:0);if(t*=o,e*=o,this.data.aUp[this.offset+(n*=o)+4]){if(i&&super.addElements(e,t,n),r){const t=i?1:0;super.addElements(e+t,n+t,n+t+2),super.addElements(e+t+1,n+t+1+2,e+t+1+2)}}else if(i&&super.addElements(t,n,e),r){const e=i?1:0;super.addElements(t+e,t+e+2,n+e),super.addElements(t+e+1+2,n+e+1+2,n+e+1)}}createDataPack(t,e){this.maxAltitude=0;const n=super.createDataPack(t,e);if(!n)return n;const{data:i,indices:r}=n;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}=i,f={},p=nn(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,n){const i=[];for(let r=0;r<t.length;r+=3){const t=e[r/3];i.push(t/256,n[r/3]?1:0)}return i}(o,a,l)),f.aPosition=s,m&&(f.aTexCoord0=new Float32Array(m)),f.aNormal=y?new Int8Array(p):new Float32Array(p),f.aPickingId=i.aPickingId,f.aExtrude=u,c&&(f.aColor=c),d&&(f.aLineWidth=d),h){const t=Kn(this.maxAltitude);f.aLineHeight=new t(h)}const g=[];for(const t in f)g.push(f[t].buffer);return n.data=f,n.buffers=g,n}}const Al=Math.pow(2,16)/1;class Fl extends Xs{getFormat(){return[...this.getPositionFormat()]}placeVector(t){const e=t.feature,n=3===e.type,i=e.geometry,r=this.elements;n&&(this.elements=[]);const o=this.needAltitudeAttribute()?2:3;for(let t=0;t<i.length;t++)this.offset=this.data.aPosition.length/o,this.Mt(i[t],e),n&&(this.At(r),this.elements=[]);n&&(this.elements=r)}Mt(t,e){const n=3===e.type;let i=t.length;for(;i>=2&&t[i-1].equals(t[i-2]);)i--;let r,o,s,a=0;for(;a<i-1&&t[a].equals(t[a+1]);)a++;if(!(i<(n?3:2))){this.distance=0,this.vertexLength=0,this.primitiveLength=0,this.e1=this.e2=this.e3=-1,n&&(r=t[i-2]);for(let e=a;e<i;e++)s=n&&e===i-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 n=this.vertexLength++;this.addLineVertex(this.data,t,e),n>=1&&this.addElements(n-1,n),e>Al&&(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)}At(t){const e=this.options.EXTENT,n=this.elements;for(let i=0;i<n.length;i+=2)vi(this.data.aPosition,n[i],n[i+1],3,e)||t.push(n[i],n[i+1])}}const Tl=45*Math.PI/100;class zl extends Xs{getFormat(){return[...this.getPositionFormat()]}placeVector(t){const e=this.bt(t,this.symbol.markerSpacing||250,this.symbol.markerPlacement||"point");for(let t=0;t<e.length;t++){const n=e[t];this.fillPosition(this.data,n.x,n.y,n.z);const i=Math.max(Math.abs(n.x),Math.abs(n.y));i>this.maxPos&&(this.maxPos=i)}}bt(t,e,n){const i=t.feature,r=this.options.EXTENT;if("line"===n){const t=[];let n=i.geometry;r&&(n=Ba(i.geometry,0,0,r,r));for(let i=0;i<n.length;i++){const o=Xa(n[i],e,Tl,null,null,24,1,1,r||1/0);t.push.apply(t,o)}return t}return al(i,n,r)}hasElements(){return!1}}\n/*!\n * from @turf/bboxClip\n * https://github.com/Turfjs/turf\n * MIT LICENSE\n */const Sl=[],_l=[];function Pl(t,e){var n,i,r,o,s,a,l;for(i=1;i<=8;i*=2){for(n=[],o=!(Ol(r=t[t.length-1],e)&i),s=0;s<t.length;s++){if((l=!(Ol(a=t[s],e)&i))!==o){const t=Il(r,a,i,e);n.push(void 0!==a.x?new Et(t[0],t[1]):t)}l&&n.push(a),r=a,o=l}if(!(t=n).length)break}return n}function Il(t,e,n,i){return Sl[0]=void 0===t.x?t[0]:t.x,Sl[1]=void 0===t.y?t[1]:t.y,t=Sl,_l[0]=void 0===e.x?e[0]:e.x,_l[1]=void 0===e.y?e[1]:e.y,e=_l,8&n?[t[0]+(e[0]-t[0])*(i[3]-t[1])/(e[1]-t[1]),i[3]]:4&n?[t[0]+(e[0]-t[0])*(i[1]-t[1])/(e[1]-t[1]),i[1]]:2&n?[i[2],t[1]+(e[1]-t[1])*(i[2]-t[0])/(e[0]-t[0])]:1&n?[i[0],t[1]+(e[1]-t[1])*(i[0]-t[0])/(e[0]-t[0])]:null}function Ol(t,e){Sl[0]=void 0===t.x?t[0]:t.x,Sl[1]=void 0===t.y?t[1]:t.y;var n=0;return(t=Sl)[0]<e[0]?n|=1:t[0]>e[2]&&(n|=2),t[1]<e[1]?n|=4:t[1]>e[3]&&(n|=8),n}const ql=[0,0,0,0];class Cl extends Xs{constructor(...t){super(...t),this.lineElements=[]}createStyledVector(t,e,n,i,r){const o=new Fi(t,e,n,i),s=o.getPolygonResource();return!this.options.atlas&&s&&(r[s]=[0,0]),o}getFormat(){const t=[...this.getPositionFormat()],{polygonFillFn:e,polygonOpacityFn:n,uvScaleFn:i,uvOffsetFn:r}=this.nt;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"}),n&&t.push({type:Uint8Array,width:1,name:"aOpacity"}),i&&t.push({type:Uint16Array,width:2,name:"aUVScale"}),r&&t.push({type:Uint8Array,width:2,name:"aUVOffset"}),t}placeVector(t,e){const n=t.feature;this._t(n.geometry,n,e)}_t(t,e){let n,i,r,o;const{polygonFillFn:s,polygonOpacityFn:a,uvScaleFn:l,uvOffsetFn:u}=this.nt,c=e.properties;s&&(n=s(this.options.zoom,c)||At([],255,255,255,255),n=f(n)?ql:pi([],n)),a&&(i=a(this.options.zoom,c),ni(i)&&(i=1),i*=255),l&&(r=l(this.options.zoom,c),ni(r)&&(r=[1,1]),r=[255*r[0],255*r[1]]),u&&(o=u(this.options.zoom,c),ni(o)&&(o=[0,0]),o=[255*o[0],255*o[1]]);const h=!!this.iconAtlas,d=Qa(t,500),p=[0,0],m=[0,0];if(h){const{polygonPatternFileFn:t}=this.nt,e=t?t(null,c):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<d.length;t++){const e=d[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=Pl(s,g)),0!==s.length){0!==t&&l.push(a.length/3);for(let t=0;t<s.length;t++){const e=s[t].x,l=s[t].y,u=s[t].z||0;this.fillPosition(this.data,e,l,u),h&&this.data.aTexInfo.push(p[0],p[1],m[0],m[1]),void 0!==n&&this.data.aColor.push(n[0],n[1],n[2],n[3]),void 0!==i&&this.data.aOpacity.push(i),void 0!==r&&this.data.aUVScale.push(r[0],r[1]),void 0!==o&&this.data.aUVOffset.push(o[0],o[1]);const c=Math.abs(e),d=Math.abs(l);c>this.maxPos&&(this.maxPos=c),d>this.maxPos&&(this.maxPos=d),a.push(e,l,u)}}}const u=On(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])}}}const Nl=[{type:Int16Array,width:3,name:"aPosition"}];class Rl extends Xs{getFormat(){return Nl}placeVector(t,e){const n=this.bt(t,e);if(0===n.length)return;const i=this.data,r=this.getAltitude(t.feature.properties);let o=i.aPosition.length/Nl[0].width;for(let t=0;t<n.length;t++){const e=n[t];i.aPosition.push(2*e.x+0,2*e.y+0,r),i.aPosition.push(2*e.x+1,2*e.y+0,r),i.aPosition.push(2*e.x+1,2*e.y+1,r),i.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)}}bt(t,e){const{feature:n,symbol:i}=t,r=this.kt(t,i),o=n.properties,{markerSpacingFn:s}=this.nt,a=((s?s(null,o):i.markerSpacing)||250)*e;return sl(t,null,null,e,this.options.EXTENT,r,a)}kt(t,e){return this.nt.markerPlacementFn?this.nt.markerPlacementFn(this.options.zoom,t.feature.properties):e.markerPlacement}}class El extends yl{constructor(t,e,n){(e=ei({},e)).lineJoin="miter",e.lineCap="butt",super(t,e,n),this.options.radialSegments%2==1&&this.options.radialSegments--}getFormat(){const{lineWidthFn:t,lineColorFn:e,lineOpacityFn:n,linePatternAnimSpeedFn:i,linePatternGapFn:r}=this.nt,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"}),n&&o.push({type:Uint8Array,width:1,name:"aOpacity"}),i&&o.push({type:Int8Array,width:1,name:"aLinePatternAnimSpeed"}),r&&o.push({type:Int8Array,width:1,name:"aLinePatternGap"}),o}addHalfVertex(t,e,n,i,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,n,i,r,o,s,a){gt(Ll,n,i,r),gt(Dl,o,s,0),kt($l,Ll,Dl),wt(Dl,Dl),wt($l,$l),Ul[e]||(Ul[e]=[]);const l=Ul[e];for(var u=0;u<e;u++){const t=Math.PI*u/e,n=1-Math.abs(t-0)/(Math.PI/2);l[u]=l[u]||[],Wl(Dl,$l,l[u],1,t,n*(a?-1:1))}return l}(0,d,f,p,m,e,n,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,n=this.needAltitudeAttribute()?2:3,i=this.data.aPosition.length/n;for(let n=0;n<e;n++){const r=n+i-2*e;let o,s;n===e-1&&t?(o=n+i-2*e+1,s=n+i-2*e-2*e+1):(o=n+i+1,s=n+i+1-2*e),super.addElements(n+i-this.offset,o-this.offset,r-this.offset),super.addElements(r-this.offset,o-this.offset,s-this.offset)}}fillData(t,e,n,i,r,o,s,a){const{lineWidthFn:l,lineColorFn:u,lineOpacityFn:c,linePatternAnimSpeedFn:h,linePatternGapFn:d}=this.nt,f=r.length;for(let o=0;o<f;o++){if(this.fillPosition(t,e,n,i),Ft(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=di(this.options.metric);let n=this.feaLineWidth*e;isNaN(n)&&(n=0),t.aLineWidth.push(Math.round(n))}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(n)+1)}createDataPack(t,e){const n=super.createDataPack(t,e);return n&&(n.is2D=!1),n}}const Ll=[],Dl=[],$l=[],Ul={};function Wl(t,e,n,i,r,o){return At(n,i*(Math.cos(r)*t[0]+Math.sin(r)*e[0]),i*(Math.cos(r)*t[1]+Math.sin(r)*e[1]),i*(Math.cos(r)*t[2]+Math.sin(r)*e[2]),o),n}class Jl extends El{addHalfVertex(t,e,n,i,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,n,i,r,o,s,a){gt(Gl,n,i,r),gt(Vl,o,s,0),kt(Bl,Gl,Vl),wt(Vl,Vl),wt(Bl,Bl),function(t,e,n){t[0]=e,t[1]=n}(Hl,t,e);const l=Ot(Hl)/t,u=Math.atan(e/t);let c=Math.PI/2+(Math.PI/2-u);return Zl[0]||(Zl[0]=[]),Wl(Vl,Bl,Zl[0],l,c,a?1:-1),c+=2*u,Zl[1]||(Zl[1]=[]),Wl(Vl,Bl,Zl[1],l,c,a?1:-1),Zl}(this.feaLineWidth,this.feaLineHeight,d,f,p,e,n,r);this.prevVertex&&this.fillTubeElements(r),this.fillData(this.data,l,u,c||0,m,r,h,a)}}const Hl=[],Gl=[],Vl=[],Bl=[],Zl=[];var Yl=Object.freeze({__proto__:null,clipPolygon:Pl,calculateSignedArea:bi,getFeaAltitudeAndHeight:xi,generatePickingIndiceIndex:Ai,convertRTLText:Ja,packPosition:Ti,unpackPosition:function(t,e,n,i){const r=(Math.sign(e)||1)*(Math.abs(e)%zi),o=(Math.sign(n)||1)*(Math.abs(n)%zi),s=Math.floor(Math.abs(e)/zi),a=Math.floor(Math.abs(n)/zi);return t[0]=r,t[1]=o,t[2]=Math.sign(i+1e-5)*(2*s+a)*Si+i,t},convertGeometry:ti,getPosArrayType:Kn,getUnsignedArrayType:Qn,getIndexArrayType:Xn});const Xl={},Kl={},Ql=[];Object.freeze({__proto__:null,loadSymbolFnTypes:function t(e,n){if(!e)return null;var i=!1;if(Array.isArray(e)){var r,o=[];for(let s=0;s<e.length;s++)(r=t(e[s],n))?(o.push(r),i=!0):o.push(e[s]);return i?o:e}var s={__fn_types_loaded:!0};const a=[];for(const t in e)li(e,t)&&a.push(t);const l=function(t){Object.defineProperty(s,t,{get:function(){return this["__fn_"+t]||(this["__fn_"+t]=p(this["_"+t])),this["__fn_"+t].apply(this,n())},set:function(e){this["_"+t]=e},configurable:!0,enumerable:!0})},u={},c=function(t,e){Object.defineProperty(s,t,{get:function(){this["__fn_"+t]||(this["__fn_"+t]=Es(this["_"+t],e));const i=n()[0];u.zoom=i;try{return this["__fn_"+t].evaluateWithoutErrorHandling(u,Xl,Kl,null,Ql)}catch(t){return null}},set:function(e){this["_"+t]=e},configurable:!0,enumerable:!0})};for(let t=0,n=a.length;t<n;t++){const n=a[t];if(f(e[n]))i=!0,s["_"+n]=e[n],l(n);else if(Ls(e[n])){i=!0;const t=Js(n);s["_"+n]=e[n],c(n,t)}else s[n]=e[n]}return i?s:e}});const tu={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},tu),Object.assign({lineDasharray:1},tu);function eu(t,e,n,i,r,o,s,a,l,u,c,h,d,f,p,m){const y=e.length,g=r/3;for(let n=2,i=y;n<i;n+=3)t[r+n-2]=e[n-2],t[r+n-1]=e[n-1],t[r+n-0]=e[n]-o;r+=y;for(let n=2,i=y;n<i;n+=3)t[r+n-2]=e[n-2],t[r+n-1]=e[n-1],t[r+n-0]=e[n]-s;r+=y;for(let n=2,i=y;n<i;n+=3)t[r+n-2]=e[n-2],t[r+n-1]=e[n-1],t[r+n-0]=e[n]-o;r+=y;for(let n=2,i=y;n<i;n+=3)t[r+n-2]=e[n-2],t[r+n-1]=e[n-1],t[r+n-0]=e[n]-s;r+=y,(n=n||[]).push(y/3);for(let e=0;e<n.length;e++){nu(g+(n[e-1]||0),g+n[e],t,y/3,a,i,l,u,c,h,d,f,p,m)}return r}function nu(t,e,n,i,r,o,s,a,l,u,c,h,d,f){const p=o.length;let m,y;for(let s=t,a=e;s<a-1;s++)m=s,y=s+1,at(n,m,y,r)||((s-t)%2==1&&(m+=2*i,y+=2*i),o.push(m+i,m,y),o.push(y,y+i,m+i));s&&function(t,e,n,i,r,o,s,a,l,u){let c,h=0,d=0,f=0,p=0;for(let m=r.length-1;m>=0;m--){const y=r[m],g=3*y+1,b=3*y+2,v=i[3*y],w=i[g],x=i[b];h||d||(h=Math.max(i[b],i[3*r[m-2]+2]),d=Math.min(i[b],i[3*r[m-2]+2]),c=h-d);let k=f;const M=m%6;0===t?(5===M&&(p=Rt(i,r,m,v,w)),k=2===M||3===M||4===M?f:f+p):1===t&&(2===M||3===M||4===M?k=0:5===M?(p=Rt(i,r,m,v,w),k=p):k=p);const j=k*a*l/o;let A;A="bottom"===e?x===h?c*u/s:0:x===h?0:c*u/s,n[2*y]=j,n[2*y+1]=A,0===M&&(f+=p)}}(a,l,u,n,o.slice(p,o.length),c[0],c[1],h,d,f)}function iu(t,e,n,i,r,o,s,a,l,u){void 0===e.top&&(e.top=!0),void 0===e.side&&(e.side=!0);const{altitudeScale:c,altitudeProperty:h,defaultAltitude:d,heightProperty:f,minHeightProperty:y,defaultHeight:g,tangent:b,uv:v,uvScale:w,topUVMode:x,sideUVMode:M,top:j,side:A,textureYOrigin:z,topThickness:S}=e,_=function(t,e,{altitudeScale:n,altitudeProperty:i,defaultAltitude:r,heightProperty:o,minHeightProperty:s,defaultHeight:a},{side:l,top:u,topThickness:c,uvOrigin:h,uv:d,uvSize:f,topUVMode:p,sideUVMode:m,textureYOrigin:y,glScale:g,localScale:b,vScale:v},w){const x=e/t[0].extent,M=[],j=[],A=[],T=[],z=[],S=[],_=!!d,P=!!u,I=!!l,O=_?[]:null;function q(t,n,i,r){if(P){const r=On(T,i,3);if(0===r.length)return n;let o;F(z,T),n+=T.length;for(let e=2,n=r.length;e<n;e+=3)o=r[e-1],r[e-1]=r[e]+t/3,r[e]=o+t/3,r[e-2]+=t/3;F(S,r),_&&qt(p||0,t,n,O,z,0,g,b,f[0],f[1]),c>0&&!I&&(n=eu(z,T,i,S,n,0,c,e,_,m||0,y,O,f,g,b,v))}return I&&(P&&(c=0),n=eu(z,T,i,S,n,c,r,e,_,m||0,y,O,f,g,b,v)),n}let C=0,N=0;const R=[-1,-1,e+1,e+1];let E=0,L=t.length;void 0!==w&&(E=w,L=w+1);let D=0,$=!1;for(;E<L;E++){const l=t[E],u=l.id;k(u)&&(Math.abs(u)>D&&(D=Math.abs(u)),u<0&&($=!0));const c=l.geometry,{altitude:h,height:d}=Yl.getFeaAltitudeAndHeight(l,n,i,r,o,a,s);C=Math.max(Math.abs(h),C);const f=z.length;let p=N,m=[];T.length=0;for(let t=0,n=c.length;t<n;t++){const i=Yl.calculateSignedArea(c[t])<0;!i&&t>0&&(N=q(p,N,m,d*x),T.length=0,m=[],p=N);let r=c[t];if(e!==1/0&&(r=Yl.clipPolygon(r,R)),!r.length){t===n-1&&(N=q(p,N,m,d*x));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]),i&&m.push(T.length/3),st(T,T.length,r,x,h),t===n-1&&(N=q(p,N,m,d*x))}const y=z.length-f,g="__fea_idx".trim();for(let t=0;t<y/3;t++)j.push(void 0===l[g]?E:l[g]),M.push(E),k(u)&&A.push(u)}const U=Yl.getUnsignedArrayType(j.length?j[j.length-1]:0),W={maxAltitude:C,vertices:new(Yl.getPosArrayType(Math.max(512,C)))(z),indices:S,pickingIds:new U(j),featureIndexes:M};if(A.length){const t=$?Yl.getPosArrayType(D):Yl.getUnsignedArrayType(D);W.featureIds=new t(A)}else W.featureIds=[];return O&&(O.length=z.length/3*2,W.uvs=O),W}(t,n,{altitudeScale:c,altitudeProperty:h,defaultAltitude:d||0,heightProperty:f,minHeightProperty:y,defaultHeight:g||0},{top:j,side:A,topThickness:10*S||0,uv:v||b,uvSize:w?[.5*w[0],.5*w[1]]:[.5,.5],uvOrigin:i,topUVMode:x,sideUVMode:M,textureYOrigin:z,glScale:r,localScale:s,vScale:o},u),P=[],I=new(Yl.getIndexArrayType(_.vertices.length/3))(_.indices);delete _.indices,P.push(I.buffer,_.vertices.buffer,_.pickingIds.buffer);const O=nn(_.vertices,I);let q=!0;for(let t=0;t<O.length;t++)O[t]=-O[t],O[t]%1!=0&&(q=!1);if(_.normals=O,b){let t=function(t,e,n,i){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,i,r){rn(l,t,3*e),rn(u,t,3*i),rn(c,t,3*r),on(h,n,2*e),on(d,n,2*i),on(f,n,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);gt(p,(j*o-M*y)*A,(j*g-M*b)*A,(j*v-M*w)*A),gt(m,(x*y-k*o)*A,(x*b-k*g)*A,(x*w-k*v)*A),bt(s[e],s[e],p),bt(s[i],s[i],p),bt(s[r],s[r],p),bt(a[e],a[e],m),bt(a[i],a[i],m),bt(a[r],a[r],m)}for(let t=0,e=i.length;t<e;t+=3)y(i[t+0],i[t+1],i[t+2]);const g=[],b=[],v=[],w=[];let x,k,M;function j(t){rn(v,e,3*t),yt(w,v),k=s[t],yt(g,k),Mt(g,g,function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}(v,v,xt(v,k))),wt(g,g),kt(b,w,k),M=xt(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=i.length;t<e;t+=3)j(i[t+0]),j(i[t+1]),j(i[t+2]);return o}(_.vertices,_.normals,_.uvs,I);t=function(t,e){const n=new Float32Array(e.length),i=[],r=[],o=[];for(let s=0;s<e.length;s+=4){const a=s/4*3;gt(r,t[a]||0,t[a+1]||0,t[a+2]||0),At(i,e[s]||0,e[s+1]||0,e[s+2]||0,e[s+3]||0),en(o,r,i),jt(n.subarray(s,s+4),o)}return n}(_.normals,t),_.tangents=t,P.push(t.buffer),delete _.normals}if(_.normals&&(_.normals=q?new Int8Array(_.normals):new Float32Array(_.normals),P.push(_.normals.buffer)),_.uvs){const t=_.uvs;_.uvs=new Float32Array(t),P.push(_.uvs.buffer)}const C=function(t,e,n,i){const r={};if(T(e.polygonFill)){const o=m(e.polygonFill),s=new Uint8Array(4*i.length);s.fill(255);for(let e=0;e<i.length;e++){const r=t[i[e]],a=r.properties||{};a.$layer=r.layer,a.$type=r.type;let l=o(n,a);delete a.$layer,delete a.$type,gi.normalizeColor(ru,l),s[4*e]=ru[0],s[4*e+1]=ru[1],s[4*e+2]=ru[2],s[4*e+3]=ru[3]}r.aColor=s}if(T(e.polygonOpacity)){const o=p(e.polygonOpacity),s=new Uint8Array(i.length);s.fill(255);for(let e=0;e<i.length;e++){const r=t[i[e]],a=r.properties||{};a.$layer=r.layer,a.$type=r.type;const l=o(n,a);delete a.$layer,delete a.$type,s[e]=255*l}r.aOpacity=s}return r}(t,a,l,_.featureIndexes),N={data:{data:{aPosition:_.vertices,aNormal:_.normals,aTexCoord0:_.uvs,aTangent:_.tangents,aPickingId:_.pickingIds},indices:I,properties:{maxAltitude:_.maxAltitude}},buffers:P};return _.featureIds.length?(N.data.featureIds=_.featureIds,P.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.data.pickingIdIndiceMap=Yl.generatePickingIndiceIndex(N.data.data.aPickingId,N.data.indices),N}const ru=[];function ou(t,e,n,i,{altitudeScale:r,altitudeProperty:o,defaultAltitude:s,heightProperty:a,minHeightProperty:l,defaultHeight:u,bottom:c}){const h=c,d=e/t[0].extent,p=2*function(t,e){let n=0;for(let i=0,r=t.length;i<r;i++){const r=t[i];if(k(r.geometry[0][0])){const t=3*r.geometry.length;n+=e?2*t-6:t}else for(let t=0,i=r.geometry.length;t<i;t++){let i=3*r.geometry[t].length;3===r.type&&(i-=3),n+=e?2*i-6:i}}return n}(t)+3*t.length*2,m=[],y=new Int16Array(p),g=new Uint8Array(y.length/3*4);f(n)&&(n=Hs.compileFilter(n));const b=[];function v(t,n,i){const r=n-t,o=y.subarray(t,n),s=y.subarray(n,n+r);s.set(o);for(let t=2,e=s.length;t<e;t+=3)s[t]=o[t]-i;const a=t/3,l=r/3;let u,c;for(let t=a,n=l+a;t<n;t++)t<n-1?(u=t,c=t+1):(u=t,c=a),at(y,u,c,e)||(b.push(u,c),h&&b.push(u+l,c+l),su(y,u,e)||b.push(u,u+l));return n+r}let w=0,x=0;const M="__fea_idx".trim(),j=[];for(let e=0,c=t.length;e<c;e++){const c=t[e],h=c.geometry;if(n){let t;t="function"==typeof n?n(c&&c.properties):n,gi.normalizeColor(j,t)}else gt(j,255,255,255);const f=w/3*4,{altitude:p,height:k}=Yl.getFeaAltitudeAndHeight(c,r,o,s,a,u,l);x=Math.max(Math.abs(p),x);let A=w;for(let t=0,e=h.length;t<e;t++){let e=h[t];const n=e.length;e[0][0]===e[n-1][0]&&e[0][1]===e[n-1][1]&&(e=e.slice(0,n-1)),w=st(y,A,e,d,p),w=v(A,w,k*d),A=w}const F=A/3*4;for(let t=f;t<F;t+=4)g[t]=j[0],g[t+1]=j[1],g[t+2]=j[2],g[t+3]=255*(i||1);const T=b.length-m.length;for(let t=0;t<T;t++)m.push(c[M])}const A=b.reduce((t,e)=>Math.max(t,e),0),F=new(Yl.getIndexArrayType(A))(b),T=Yl.getUnsignedArrayType(t.length);return{aPosition:new(Yl.getPosArrayType(Math.max(512,x)))(y),indices:F,aPickingId:new T(m),aColor:g}}function su(t,e,n){const i=t[3*e],r=t[3*e+1];return i<0||i>n||r<0||r>n}function au(t,e,n,i){const r=ou(t,e,n.lineColor,n.lineOpacity,i),o=[r.aPosition.buffer,r.indices.buffer,r.aPickingId.buffer],s=r.indices;return delete r.indices,{data:{data:r,indices:s},buffers:o}}\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 */const lu=["Unknown","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon","GeometryCollection"];function uu(t){if(!t)return"true";const e=t[0];if(t.length<=1)return"any"===e?"false":"true";return`(${"=="===e?hu(t[1],t[2],"===",!1):"!="===e?hu(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?hu(t[1],t[2],e,!0):"any"===e?fu(t.slice(1),"||"):"all"===e?fu(t.slice(1),"&&"):"none"===e?yu(fu(t.slice(1),"||")):"in"===e?pu(t[1],t.slice(2)):"!in"===e?yu(pu(t[1],t.slice(2))):"has"===e?mu(t[1]):"!has"===e?yu(mu(t[1])):"contains"===e?function(t,e,n){const i=cu(t);return void 0!==n?`(${i} + \'\').indexOf("${e}") === ${n}`:`(${i} + \'\').indexOf("${e}") >= 0`}(t[1],t[2],t[3]):"true"})`}function cu(t){return"$"===t[0]?"f."+t.substring(1):"p["+JSON.stringify(t)+"]"}function hu(t,e,n,i){if("object"==typeof(r=t)&&r&&t.op)return function(t,e,n,i){const r=t.property,o=t.op;let s=cu(r);return"length"!==o?(console.error(`not support ${o} op`),"false"):(s=`((${s}+=\'\').length)`,du(s,r,e,n,i))}(t,e,n,i);var r;return du(cu(t),t,e,n,i)}function du(t,e,n,i,r){const o="$type"===e?lu.indexOf(n):JSON.stringify(n);return(r?`typeof ${t}=== typeof ${o}&&`:"")+t+i+o}function fu(t,e){return t.map(uu).join(e)}function pu(t,e){"$type"===t&&(e=e.map(t=>lu.indexOf(t)));const n=JSON.stringify(e.sort(gu)),i=cu(t);return e.length<=200?`${n}.indexOf(${i}) !== -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; }(${i}, ${n},0,${e.length-1})`}function mu(t){return"$id"===t?\'"id" in f\':JSON.stringify(t)+" in p"}function yu(t){return`!(${t})`}function gu(t,e){return t<e?-1:t>e?1:0}const bu="__original_properties",vu="__fn-type_properties";class wu{constructor(t,e,n,i,r){this.id=t,this.options=e,this.upload=n,this.Pt(e.style),this.requests={},this.It=i,this.Ot=0,this.loadings=r}updateStyle(t,e){this.options.style=t,this.Ot=t.styleCounter,this.Pt(t),e()}updateOptions(t,e){this.options=w(this.options,t),e()}loadTile(t,e){const n=this.loadings,i=t.tileInfo.url,r=this.options.debugTile;if(r){const{x:n,y:i,z:o}=t.tileInfo;let s=!1;for(let t=0;t<r.length;t++)if(n===r[t].x&&i===r[t].y&&o===r[t].z){s=!0;break}if(!s)return void e()}n[i]?n[i].push({context:t,callback:e,ref:this}):(n[i]=[{context:t,callback:e,ref:this}],this.requests[i]=this.getTileFeatures(t,(e,r,o,s)=>{const a=n[i];if(delete n[i],this.checkIfCanceled(i))return delete this.requests[i],void this.qt(a,null,{canceled:!0});if(delete this.requests[i],this.options.debug&&r)for(let e=0;e<r.length;e++)r[e]._debug_info={index:e,id:r[e].id,tileId:t.tileInfo.id};if(e)this.qt(a,e);else if(r&&r.length){if(a)for(let t=0;t<a.length;t++)this.Ct.call(a[t].ref,a[t].context,a[t].callback,i,o,r,s)}else this.qt(a)}))}Ct(t,e,n,i,r,o){this.Nt(i,r,t).then(n=>{n.canceled?e(null,{canceled:!0}):(n.data.style=t.styleCounter,o&&w(n.data,o),e(null,n.data,n.buffers))}).catch(t=>{e(t)})}abortTile(t,e){delete this.requests[t],this.Rt(t),e()}Rt(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]}qt(t,e,n){if(t)for(let i=0;i<t.length;i++)t[i].callback(e,n)}checkIfCanceled(t){return!this.requests[t]}onRemove(){this.loadings={}}fetchIconGlyphs(t,e,n){this.upload("fetchIconGlyphs",{icons:t,glyphs:e},null,n)}Nt(t,e,n){if(!e.length)return Promise.resolve({data:null,buffers:[]});const{glScale:i,tileInfo:r}=n,o=!this.options.style.style.length&&!this.options.style.featureStyle.length;let s=this.pluginConfig.slice(0);o&&(s=this.Et(t)),this.featurePlugins&&F(s,this.featurePlugins);const a={};for(let t=0;t<s.length;t++)Tu(e,n.tileInfo.z,s[t],a);const l=[],u=[];for(let t=0;t<e.length;t++){const n=e[t],i=a[t];if(i){u.fill(null);let t=0;for(const e in i){let r=0;const o=i[e].values();for(const t of o){let i=u[r];i||(i=Pu(n),u[r]=i),i.properties[e]=t,r++}r>t&&(t=r)}for(let e=0;e<t;e++)l.push(u[e])}else l.push(n)}const c=(e=l)[0].extent,h=r.z,d={x:r.extent2d.xmin*i,y:r.extent2d.ymax*i},f=[],p=[],m=[],y=this.options,g=[],b={},v=[Promise.resolve(n.styleCounter)];let x=0,k=-1;const M=[];let j=!1;for(let t=0;t<s.length;t++){k++;const i=s[t];i.type!==x&&(k=0,x=i.type);const a=0===i.type?f:p;if(i.symbol&&!1===i.symbol.visible){a[k]=null;continue}qu(i.symbol,M,t),j=j||M[t]&&M[t].size>0;const{tileFeatures:l,tileFeaIndexes:u}=this.Lt(h,i.type,i.filter,e,b,t);if(!l.length){a[k]=null;continue}const y=u[u.length-1],w=Yl.getIndexArrayType(y);a[k]={styledFeatures:new w(u)},m.push({idx:t,typeIdx:k}),g.push(a[k].styledFeatures.buffer);const A={extent:c,zoom:h,tilePoint:d,...n};if(this.options.debugTile){const t=this.options.debugTile;for(let e=0;e<t.length;e++){const{x:n,y:i,z:o}=t[e];if(r.x===n&&r.y===i&&r.z===o){A.debugIndex=t[e].index;break}}}let F=this.Dt(l,i,A);o&&(F=F.then(t=>{if(!t)return null;if(t.data)t.data.layer=l[0].layer;else if(Array.isArray(t))for(let e=0;e<t.length;e++)t[e]&&t[e].data&&(t[e].data.layer=l[0].layer);return t})),v.push(F)}return Promise.all(v).then(([n,...i])=>{function r(t,e){if(void 0===t.data.ref&&(t.data.type=s[m[e].idx].renderPlugin.dataConfig.type,t.data.filter=s[m[e].idx].filter.def,t.buffers&&t.buffers.length))for(let e=0;e<t.buffers.length;e++)g.push(t.buffers[e])}if(n!==this.Ot)return{canceled:!0};for(let t=0;t<i.length;t++){if(!i[t])continue;const e=i[t],n=0===s[m[t].idx].type?f:p;if(Array.isArray(e)){const i=[];for(let n=0;n<e.length;n++)e[n]&&(r(e[n],t),(void 0===e[n].data.ref||e[e[n].data.ref])&&i.push(e[n].data));i.length&&(n[m[t].typeIdx].data=i)}else r(e,t),n[m[t].typeIdx].data=e.data}const o={},a=t;if(y.features||y.schema||j){let t,n=!1;for(let i=0,r=e.length;i<r;i++)if(t=e[i],a[t.layer].properties||(a[t.layer].properties=Mu(t.properties)),t&&(y.features||j&&b[i]))if("id"===y.features)o[i]=t.id;else{y.pickingGeometry||delete t.geometry,delete t.extent,delete t.properties.$layer,delete t.properties.$type,delete t.__index;const e=t.originalFeature;if(e){const e=t.properties,n=w({},t.originalFeature);delete e[bu],n.customProps=w({},e),t=n}const r=w({},t);if(!y.features){const r=b[i];for(let i=0;i<r.length;i++){const r=M[i];r&&r.forEach(i=>{const r=e?e.properties:t.properties;r[vu]||(r[vu]=new Set),r[vu].add(i),n=!0})}}o[i]=r}if(n)for(const t in o){const e=o[t];if(e.properties[vu]){const t=e.properties[vu];delete e.properties[vu];for(const n in e.properties)t.has(n)||delete e.properties[n]}}}return{data:{schema:a,data:f,featureData:p,extent:c,features:o},buffers:g}}).catch(t=>{console.error(t)})}Dt(t,e,n){let i=t;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}=n,f=a/s,p=r.type,m=n.debugIndex;let y=w({},r,{EXTENT:a,zoom:c,debugIndex:m,features:this.options.features});if("3d-extrusion"===p){const t=ju(o);return t&&(r.uv=1,2===t&&(r.tangent=1)),Promise.all([Promise.resolve(iu(i,r,a,h,l,u,this.options.tileSize[1]/a,o,c,m))])}if("3d-wireframe"===p)return Promise.all([Promise.resolve(au(i,a,o,r))]);if("point"===p){y=w(y,{requestor:this.fetchIconGlyphs.bind(this),altitudeToTileScale:u*a/this.options.tileSize[1]/l});const t=ul.splitPointSymbol(o),e=Xs.genFnTypes(t[0]);return ul.needMerge(t[0],e,c)&&(i=ul.mergeLineFeatures(i,t[0],e,c)),Promise.all(t.map((t,n)=>(0===n?y.fnTypes=e:delete y.fnTypes,new ul(i,t,y).load(f))))}if("native-point"===p)return Au(i,o,y,zl,a/s);if("line"===p)return y=w(y,{requestor:this.fetchIconGlyphs.bind(this),tileRatio:f}),Au(i,o,y,yl);if("native-line"===p)return Au(i,o,y,Fl);if("fill"===p)return y=w(y,{requestor:this.fetchIconGlyphs.bind(this)}),Au(i,o,y,Cl);if("line-extrusion"===p){delete o.lineGradientProperty,o.lineJoin="miter",o.lineCap="butt";const t=ju(o);if(t&&(r.uv=1,2===t&&(r.tangent=1)),y=w(y,{tileSize:s,zScale:u,glScale:l}),t){const t=[];if(!1!==r.top){const e=w({},y);e.side=!1,t.push(new jl(i,o,e))}return!1!==r.side&&(y.side=!0,y.top=!1,t.push(new jl(i,o,y))),Promise.all(t.map(t=>t.load()))}return Promise.all([new jl(i,o,y).load()])}if("circle"===p)return Au(i,o,y,Rl);if("round-tube"===p||"square-tube"===p){const t="round-tube"===p?El:Jl;return y=w(y,{requestor:this.fetchIconGlyphs.bind(this),radialSegments:"round-tube"===p?r.radialSegments||8:4,pointAtTileRes:d,tileRatio:f,isTube:!0}),Au(i,o,y,t)}return Promise.resolve([])}Lt(t,e,n,i,r,o){const s="__fea_idx".trim(),a=[],l=[],u=i.length;for(let c=0;c<u;c++)if((1===e||void 0===i[c].id||!this.styledFeatures[i[c].id])&&((!n.def||"default"===n.def)&&!r[c]||!0===n.def||n.def&&(void 0!==n.def.condition||Array.isArray(n.def))&&n(i[c],t))){const t=i[c];if(void 0===t[s]&&(t[s]=c),r[c]||(r[c]=[]),r[c].push(o),l.push(t),a.push(c),1===e)break}return{tileFeatures:l,tileFeaIndexes:a}}Pt(t){const{style:e,featureStyle:n}=t,i={};n.forEach(t=>{Array.isArray(t.id)?(t.id.forEach(t=>{i[t]=1}),t.filter=["in","$id",...t.id]):(i[t.id]=1,t.filter=["==","$id",t.id])});const r=Hs.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=Hs.compileStyle(n);for(let t=0;t<n.length;t++)s[t].type=1,s[t].filter.def=n[t].filter?n[t].filter.value||n[t].filter:void 0,s[t].renderPlugin&&o.push(s[t]);this.pluginConfig=r,this.featurePlugins=o,this.styledFeatures=i}Et(t){let e=this.$t;this.$t||(e=this.$t={});const n=["","Point","LineString","Polygon","MultiPoint","MultiLineString","MultiPolygon"],i=[];for(const o in t){const s=o;if(!e[o]){const i=[];for(let e=0;e<t[o].types.length;e++){const a=t[o].types[e],l=["all",["==","$layer",s],["==","$type",n[a]]],u={filter:(r=l,new Function("f","var p = (f && f.properties || {}); return "+uu(r))),renderPlugin:xu(a),symbol:ku(a)};u.filter.def=l,u.type=0,i.push(u)}e[s]=i}i.push(...e[s])}var r;return i}}function xu(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 ku(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 Mu(t){if(Array.isArray(t)||!j(t))return{};const e={};for(const n in t){const i=t[n];x(i)?e[n]="string":k(i)?e[n]="number":!0===i||!1===i?e[n]="boolean":Array.isArray(i)?e[n]="array":e[n]="object"}return e}function ju(t){if(!t)return 0;let e=0;for(const n in t){if(("normalTexture"===n||"bumpTexture"===n)&&t[n])return 2;if(n.indexOf("Texture")>0&&t[n])e=1;else if(j(t[n])){const i=ju(t[n]);if(2===i)return i;1===i&&(e=1)}}return e}function Au(t,e,n,i,r){const o={},s=Array.isArray(e)?e:[e];let a=-1;for(let t=0;t<s.length;t++)o[t]=Fu(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 i(t,s[e],n).load(r)):l.push({data:{ref:a,symbolIndex:{index:e}}}));return Promise.all(l)}function Fu(t){if(!t)return 0;for(const e in t)if(T(t[e]))return 1;return 0}function Tu(t,e,n,i){const r=n.customProperties;if(!r)return t;if(r)for(let t=0;t<r.length;t++)r[t].fn=Hs.compileFilter(r[t].filter);for(let n=0;n<r.length;n++)for(let o=0,s=t.length;o<s;o++)if(r[n].fn(t[o],e))for(const t in r[n].properties){const e=r[n].properties[t];A(e)||(i[o]||(i[o]={}),i[o][t]||(i[o][t]=new Set),i[o][t].add(e))}}const zu={get:(t,e)=>e in t?t[e]:t.originalFeature[e],has:(t,e)=>e in t||e in t.originalFeature},Su={get:function(t,e){return e in t?t[e]:t[bu][e]},has:(t,e)=>e in t||e in t[bu]},_u={};function Pu(t){const e={};e.originalFeature=t;const n=new Proxy(e,zu);return n.properties=new Proxy({},Su),n.properties[bu]=t.properties||_u,n}function Iu(t,e,n){t[e]||(t[e]=new Set),t[e].add(n)}const Ou=[];function qu(t,e,n){if(!t)return Ou;for(const i in t){if(!t[i]||!gi.checkIfZoomFnTypeSymbol(i))continue;if(T(t[i]))Iu(e,n,t[i].property);else{if("lineGradientProperty"===i){Iu(e,n,t[i]);continue}if("textName"===i)if(x(t[i])){const r=oa.resolveVarNames(t[i]);if(r)for(let t=0;t<r.length;t++)Iu(e,n,r[t])}else if(Hs.isExpression(t[i])){const r=[];oa.resolveExpVarNames(r,t[i]);for(let t=0;t<r.length;t++)Iu(e,n,r[t])}}const r=t[i].stops;if(r&&r.length)for(let t=0;t<r.length;t++)T(r[t][1])&&Iu(e,t,r[t][1].property)}return e[n]}function Cu(t,e){Nu(t.geometry,e)}function Nu(t,e){if(t)switch(t.type){case"Point":Ru(t.coordinates,e);break;case"MultiPoint":case"LineString":Eu(t.coordinates,e);break;case"MultiLineString":!function(t,e){for(let n=0,i=t.length;n<i;n++)Eu(t[n],e)}(t.coordinates,e);break;case"Polygon":Lu(t.coordinates,e);break;case"MultiPolygon":!function(t,e){for(let n=0,i=t.length;n<i;n++)Lu(t[n],e)}(t.coordinates,e);break;case"GeometryCollection":const n=t.geometries.length;for(let i=0;i<n;i++)Nu(t.geometries[i],e)}}function Ru(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 Eu(t,e){for(let n=0,i=t.length;n<i;n++)Ru(t[n],e)}function Lu(t,e){t.length&&Eu(t[0],e)}class Du extends wu{constructor(t,e,n,i,r,o){super(t,e,n,i,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,n=Math.round(e);return Math.abs(n-e)<1e-14?n:e}(e.tileSize[0]/256)),this.setData(e.data,o)}setData(t,e){if(delete this.index,!t)return void e();const n={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(x(t)&&"{"!=t.substring(0,1)||t.url)S.getJSON(t.url?t.url:t,t.url?t:{},(t,i)=>{if(t&&e(t),!i)return void e(null,{extent:null,idMap:{}});const r=i,{first1000:o,idMap:s}=this.Ut(r);this.Wt(o,s,r,n,e)});else{"string"==typeof t&&(t=JSON.parse(t));const i=Array.isArray(t)?t:t.features;let r=i;i&&i.length>1e3&&(r=i.slice(0,1e3)),this.Wt(r,null,t,n,e)}}Wt(t,e,n,i,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":const n=t.features.length;for(let i=0;i<n;i++)Cu(t.features[i],e);break;case"Feature":Cu(t,e);break;default:Nu(t,e)}return e}({type:"FeatureCollection",features:t}):null;this.index=function(t,e){return new rt(t,e)}(n,this.options.geojsonvt||i),r(null,{extent:o,idMap:e})}catch(t){console.warn(t),r({error:t.message})}}Ut(t){const e=[],n={};let i=0;function r(t){t&&("Feature"!==t.type||t.geometry)&&(void 0!==t.id&&null!==t.id||(t.id=i++),n[t.id]=w({},t),t.geometry?(n[t.id].geometry=w({},t.geometry),n[t.id].geometry.coordinates=null):t.coordinates&&(n[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:n}}getTileFeatures(t,e){const n=t.tileInfo,i=[];if(!this.index)return setTimeout((function(){e({loading:!0})}),1),1;const r=this.index.getTile(n.z+this.zoomOffset,n.x,n.y);if(!r||0===r.features.length)return setTimeout((function(){e(null,i,[])}),1),1;const o=[];for(let t=0,e=r.features.length;t<e;t++){const e=r.features[t];let n=e.layer;void 0===n&&(n="0"),o[n]={types:{}};o[n].types[e.type]=1,e.tags=e.tags||{},e.geometry.converted||(Yl.convertGeometry(e),e.geometry.converted=1),i.push({type:e.type,layer:n,id:e.id,geometry:e.geometry,properties:e.tags,extent:this.options.extent})}for(const t in o)o[t].types=Object.keys(o[t].types).map(t=>+t);return setTimeout((function(){e(null,i,o)}),1),1}onRemove(){super.onRemove(),delete this.index}}var $u={\n/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nread:function(t,e,n,i,r){var o,s,a=8*r-i-1,l=(1<<a)-1,u=l>>1,c=-7,h=n?r-1:0,d=n?-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+=i;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,i),o-=u}return(f?-1:1)*s*Math.pow(2,o-i)},write:function(t,e,n,i,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=i?0:o-1,p=i?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[n+f]=255&a,f+=p,a/=256,r-=8);for(s=s<<r|a,u+=r;u>0;t[n+f]=255&s,f+=p,s/=256,u-=8);t[n+f-p]|=128*m}},Uu=Ju,Wu=$u;function Ju(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ju.Varint=0,Ju.Fixed64=1,Ju.Bytes=2,Ju.Fixed32=5;var Hu="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Gu(t){return t.type===Ju.Bytes?t.readVarint()+t.pos:t.pos+1}function Vu(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Bu(t,e,n){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(i);for(var r=n.pos-1;r>=t;r--)n.buf[r+i]=n.buf[r]}function Zu(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function Yu(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function Xu(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function Ku(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function Qu(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function tc(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function ec(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function nc(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function ic(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function rc(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function oc(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function sc(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Ju.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var i=this.readVarint(),r=i>>3,o=this.pos;this.type=7&i,t(r,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=rc(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=sc(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=rc(this.buf,this.pos)+4294967296*rc(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=rc(this.buf,this.pos)+4294967296*sc(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Wu.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Wu.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,i=this.buf;return e=127&(n=i[this.pos++]),n<128?e:(e|=(127&(n=i[this.pos++]))<<7,n<128?e:(e|=(127&(n=i[this.pos++]))<<14,n<128?e:(e|=(127&(n=i[this.pos++]))<<21,n<128?e:function(t,e,n){var i,r,o=n.buf;if(r=o[n.pos++],i=(112&r)>>4,r<128)return Vu(t,i,e);if(r=o[n.pos++],i|=(127&r)<<3,r<128)return Vu(t,i,e);if(r=o[n.pos++],i|=(127&r)<<10,r<128)return Vu(t,i,e);if(r=o[n.pos++],i|=(127&r)<<17,r<128)return Vu(t,i,e);if(r=o[n.pos++],i|=(127&r)<<24,r<128)return Vu(t,i,e);if(r=o[n.pos++],i|=(1&r)<<31,r<128)return Vu(t,i,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=i[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&&Hu?function(t,e,n){return Hu.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var i="",r=e;for(;r<n;){var o,s,a,l=t[r],u=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>n)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,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),r+=c}return i}(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!==Ju.Bytes)return t.push(this.readVarint(e));var n=Gu(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Ju.Bytes)return t.push(this.readSVarint());var e=Gu(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Ju.Bytes)return t.push(this.readBoolean());var e=Gu(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Ju.Bytes)return t.push(this.readFloat());var e=Gu(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Ju.Bytes)return t.push(this.readDouble());var e=Gu(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Ju.Bytes)return t.push(this.readFixed32());var e=Gu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Ju.Bytes)return t.push(this.readSFixed32());var e=Gu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Ju.Bytes)return t.push(this.readFixed64());var e=Gu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Ju.Bytes)return t.push(this.readSFixed64());var e=Gu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Ju.Varint)for(;this.buf[this.pos++]>127;);else if(e===Ju.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Ju.Fixed32)this.pos+=4;else{if(e!==Ju.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 n=new Uint8Array(e);n.set(this.buf),this.buf=n,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),oc(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),oc(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),oc(this.buf,-1&t,this.pos),oc(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),oc(this.buf,-1&t,this.pos),oc(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 n,i;t>=0?(n=t%4294967296|0,i=t/4294967296|0):(i=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,i=i+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((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}(i,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,n){for(var i,r,o=0;o<e.length;o++){if((i=e.charCodeAt(o))>55295&&i<57344){if(!r){i>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):r=i;continue}if(i<56320){t[n++]=239,t[n++]=191,t[n++]=189,r=i;continue}i=r-55296<<10|i-56320|65536,r=null}else r&&(t[n++]=239,t[n++]=191,t[n++]=189,r=null);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:(i<65536?t[n++]=i>>12|224:(t[n++]=i>>18|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128),t[n++]=63&i|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&Bu(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),Wu.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Wu.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 n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var i=this.pos-n;i>=128&&Bu(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i},writeMessage:function(t,e,n){this.writeTag(t,Ju.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Zu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Yu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Qu,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Xu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Ku,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,tc,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ec,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,nc,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ic,e)},writeBytesField:function(t,e){this.writeTag(t,Ju.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Ju.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Ju.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Ju.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Ju.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Ju.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Ju.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Ju.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Ju.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Ju.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var ac=Et,lc=uc;function uc(t,e,n,i,r){this.properties={},this.extent=n,this.type=0,this.Jt=t,this.Ht=-1,this.Gt=i,this.Vt=r,t.readFields(cc,this,e)}function cc(t,e,n){1==t?e.id=n.readVarint():2==t?function(t,e){var n=t.readVarint()+t.pos;for(;t.pos<n;){var i=e.Gt[t.readVarint()],r=e.Vt[t.readVarint()];e.properties[i]=r}}(n,e):3==t?e.type=n.readVarint():4==t&&(e.Ht=n.pos)}function hc(t){for(var e,n,i=0,r=0,o=t.length,s=o-1;r<o;s=r++)e=t[r],i+=((n=t[s]).x-e.x)*(e.y+n.y);return i}uc.types=["Unknown","Point","LineString","Polygon"],uc.prototype.loadGeometry=function(){var t=this.Jt;t.pos=this.Ht;for(var e,n=t.readVarint()+t.pos,i=1,r=0,o=0,s=0,a=[];t.pos<n;){if(r<=0){var l=t.readVarint();i=7&l,r=l>>3}if(r--,1===i||2===i)o+=t.readSVarint(),s+=t.readSVarint(),1===i&&(e&&a.push(e),e=[]),e.push(new ac(o,s));else{if(7!==i)throw new Error("unknown command "+i);e&&e.push(e[0].clone())}}return e&&a.push(e),a},uc.prototype.bbox=function(){var t=this.Jt;t.pos=this.Ht;for(var e=t.readVarint()+t.pos,n=1,i=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,u=-1/0;t.pos<e;){if(i<=0){var c=t.readVarint();n=7&c,i=c>>3}if(i--,1===n||2===n)(r+=t.readSVarint())<s&&(s=r),r>a&&(a=r),(o+=t.readSVarint())<l&&(l=o),o>u&&(u=o);else if(7!==n)throw new Error("unknown command "+n)}return[s,l,a,u]},uc.prototype.toGeoJSON=function(t,e,n){var i,r,o=this.extent*Math.pow(2,n),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),u=uc.types[this.type];function c(t){for(var e=0;e<t.length;e++){var n=t[e],i=180-360*(n.y+a)/o;t[e]=[360*(n.x+s)/o-180,360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];c(l=h);break;case 2:for(i=0;i<l.length;i++)c(l[i]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var n,i,r=[],o=0;o<e;o++){var s=hc(t[o]);0!==s&&(void 0===i&&(i=s<0),i===s<0?(n&&r.push(n),n=[t[o]]):n.push(t[o]))}n&&r.push(n);return r}(l),i=0;i<l.length;i++)for(r=0;r<l[i].length;r++)c(l[i][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 dc=lc,fc=pc;function pc(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this.Jt=t,this.Gt=[],this.Vt=[],this.Bt=[],t.readFields(mc,this,e),this.length=this.Bt.length}function mc(t,e,n){15===t?e.version=n.readVarint():1===t?e.name=n.readString():5===t?e.extent=n.readVarint():2===t?e.Bt.push(n.pos):3===t?e.Gt.push(n.readString()):4===t&&e.Vt.push(function(t){var e=null,n=t.readVarint()+t.pos;for(;t.pos<n;){var i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(n))}pc.prototype.feature=function(t){if(t<0||t>=this.Bt.length)throw new Error("feature index out of bounds");this.Jt.pos=this.Bt[t];var e=this.Jt.readVarint()+this.Jt.pos;return new dc(this.Jt,e,this.extent,this.Gt,this.Vt)};var yc=fc;function gc(t,e,n){if(3===t){var i=new yc(n,n.readVarint()+n.pos);i.length&&(e[i.name]=i)}}var bc=function(t,e){this.layers=t.readFields(gc,{},e)};class vc extends wu{constructor(t,e,n,i,r,o){super(t,e,n,i,r),e=e||{},o()}getTileFeatures(t,e){const n=t.tileInfo.url,i=t.fetchOptions;if(this.It.has(n)){const{err:t,data:i}=this.It.get(n);return setTimeout(()=>{this.Zt(n,t,i,e)},1)}return S.getArrayBuffer(n,i,(t,i)=>{t?t.loading||this.It.add(n,{err:t,data:i&&i.data}):i&&i.data&&this.It.add(n,{err:null,data:i.data}),this.Zt(n,t,i&&i.data,e)})}Zt(t,e,n,i){if(e)return void i(e);let r;try{r=new bc(new Uu(n))}catch(e){return void i(e.message,[],[])}const o=[];if(!r.layers)return void i(null,o,[]);const s={};let a;for(const t in r.layers)if(l=r.layers,u=t,Object.prototype.hasOwnProperty.call(l,u)){s[t]={types:{}};const n=s[t].types;for(let i=0,s=r.layers[t].length;i<s;i++)try{a=r.layers[t].feature(i),n[a.type]=1;const e={type:a.type,layer:t,geometry:a.loadGeometry(),properties:a.properties,extent:a.extent};void 0!==a.id&&(e.id=a.id),o.push(e)}catch(e){console.warn("error when load vt geometry:",e)}}var l,u;for(const t in s)s[t].types=Object.keys(s[t].types).map(t=>+t);i(null,o,s,{byteLength:n.byteLength})}abortTile(t,e){const n=this.requests[t];delete this.requests[t],n&&n.abort&&n.abort(),this.Rt(t),e()}onRemove(){super.onRemove();for(const t in this.requests){const e=this.requests[t];e&&e.abort&&e.abort()}this.requests={}}}let wc=0;const xc=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}}(32);class kc{constructor(t){this.Yt={},this.Xt={},this.workerId=t}addLayer({actorId:t,mapId:e,layerId:n,params:i},r){if(this.Kt(e,n))return;const o=this.Qt(e,n),s=i.type,a=i.options,l=this.send.bind(this,t);this.Yt[o]="GeoJSONVectorTileLayer"===s?new Du(n,a,l,xc,{},r):new vc(n,a,l,xc,{},r)}removeLayer({mapId:t,layerId:e},n){const i=this.Kt(t,e),r=this.Qt(t,e);delete this.Yt[r],i&&i.onRemove(n)}loadTile({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.loadTile(n,i)}abortTile({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.abortTile&&r.abortTile(n.url,i)}removeTile({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.removeTile(n,i)}updateStyle({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.updateStyle(n,i)}updateOptions({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.updateOptions(n,i)}setData({mapId:t,layerId:e,params:n},i){const r=this.Kt(t,e);r&&r.setData(n.data,i)}receive(t){const e=t.callback,n=this.Xt[e];delete this.Xt[e],n&&t.error?n(new Error(t.error)):n&&n(null,t.data)}send(t,e,n,i,r){const o=r?`${t}-${wc++}`:null;r&&(this.Xt[o]=r),postMessage({type:"<request>",workerId:this.workerId,actorId:t,command:e,params:n,callback:String(o)},i||[])}Qt(t,e){return`${t}-${e}`}Kt(t,e){const n=this.Qt(t,e);return this.Yt[n]}te(){xc.reset()}}t.initialize=function(){},t.onmessage=function(t,e){const n=t.data;if(this.dispatcher||(this.dispatcher=new kc(t.workerId)),"<response>"===t.type)this.dispatcher.workerId===t.workerId&&this.dispatcher.receive(t);else{const i=n.command;this.dispatcher[i]({actorId:t.actorId,mapId:n.mapId,layerId:n.layerId,params:n.params},(t,n,r)=>{t&&404!==t.status&&console.error(i,t),e(t,n,r)})}},Object.defineProperty(t,"ee",{value:!0})}';
|
|
29
29
|
|
|
30
30
|
let L = 0;
|
|
31
31
|
|
|
@@ -35,7 +35,7 @@ function H() {
|
|
|
35
35
|
|
|
36
36
|
const V = "function" == typeof Object.assign;
|
|
37
37
|
|
|
38
|
-
function
|
|
38
|
+
function W(t, ...e) {
|
|
39
39
|
if (V) return Object.assign(t, ...e), t;
|
|
40
40
|
for (let n = 0; n < e.length; n++) {
|
|
41
41
|
const i = e[n];
|
|
@@ -44,7 +44,7 @@ function U(t, ...e) {
|
|
|
44
44
|
return t;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
function
|
|
47
|
+
function U(t) {
|
|
48
48
|
return !q(t) && ("string" == typeof t || null !== t.constructor && t.constructor === String);
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -68,13 +68,13 @@ function $(t, e) {
|
|
|
68
68
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
function
|
|
71
|
+
function J(t, e) {
|
|
72
72
|
let n;
|
|
73
73
|
return n = e.altitudeToPoint ? e.altitudeToPoint(100, t) : e.distanceToPointAtRes(100, 0, t).x,
|
|
74
74
|
n / 100 / 100;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
const
|
|
77
|
+
const X = [ "GeoJSONVectorTileLayer" ];
|
|
78
78
|
|
|
79
79
|
class Y extends t.worker.Actor {
|
|
80
80
|
constructor(t, e) {
|
|
@@ -82,7 +82,7 @@ class Y extends t.worker.Actor {
|
|
|
82
82
|
const n = e.getMap().id;
|
|
83
83
|
this.t = e, this.i = n, this.o = "vt_" + H();
|
|
84
84
|
const i = e.getJSONType();
|
|
85
|
-
this.s =
|
|
85
|
+
this.s = X.indexOf(i) >= 0, this.l = {}, this.h = new v({
|
|
86
86
|
iconErrorUrl: e.options.iconErrorUrl,
|
|
87
87
|
maxSize: e.options.maxIconSize
|
|
88
88
|
});
|
|
@@ -144,7 +144,7 @@ class Y extends t.worker.Actor {
|
|
|
144
144
|
this.s ? void 0 !== this.l[n] && this.send(i, null, e, this.l[n]) : this.broadcast(i, null, e);
|
|
145
145
|
}
|
|
146
146
|
loadTile(t, e) {
|
|
147
|
-
const n =
|
|
147
|
+
const n = W({}, t);
|
|
148
148
|
n.tileInfo = function(t) {
|
|
149
149
|
const e = {};
|
|
150
150
|
for (const n in t) void 0 !== t[n] && null !== t[n] && (t[n].toJSON ? e[n] = t[n].toJSON() : e[n] = t[n]);
|
|
@@ -235,7 +235,7 @@ class Q {
|
|
|
235
235
|
}), this.k({
|
|
236
236
|
transform: e,
|
|
237
237
|
data: this.S,
|
|
238
|
-
texData: this.
|
|
238
|
+
texData: this.O,
|
|
239
239
|
debugLine: 1,
|
|
240
240
|
primitive: "lines",
|
|
241
241
|
framebuffer: r || null,
|
|
@@ -244,7 +244,7 @@ class Q {
|
|
|
244
244
|
}), this.k({
|
|
245
245
|
transform: e,
|
|
246
246
|
data: this.T,
|
|
247
|
-
texData: this.
|
|
247
|
+
texData: this.O,
|
|
248
248
|
debugLine: 0,
|
|
249
249
|
primitive: "triangle strip",
|
|
250
250
|
framebuffer: r || null,
|
|
@@ -253,12 +253,12 @@ class Q {
|
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
255
|
delete() {
|
|
256
|
-
this.I && (this.I.destroy(), delete this.I), this.
|
|
256
|
+
this.I && (this.I.destroy(), delete this.I), this.O && (this.O.destroy(), delete this.O),
|
|
257
257
|
this.S && (this.S.destroy(), this.T.destroy(), delete this.S, delete this.T), this.k && (this.k.destroy(),
|
|
258
258
|
delete this.k);
|
|
259
259
|
}
|
|
260
260
|
_() {
|
|
261
|
-
this.
|
|
261
|
+
this.O = this.m.buffer(new Uint8Array([ 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1 ])),
|
|
262
262
|
this.k = this.m({
|
|
263
263
|
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 ",
|
|
264
264
|
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 ",
|
|
@@ -314,7 +314,7 @@ const nt = new Uint8Array([ 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1 ]), it = [];
|
|
|
314
314
|
class rt {
|
|
315
315
|
constructor(t, e, i) {
|
|
316
316
|
this.m = t;
|
|
317
|
-
(this.
|
|
317
|
+
(this.C = new n.Geometry({
|
|
318
318
|
aPosition: nt
|
|
319
319
|
}, null, nt.length / 2, {
|
|
320
320
|
positionSize: 2
|
|
@@ -337,7 +337,7 @@ class rt {
|
|
|
337
337
|
}
|
|
338
338
|
R() {
|
|
339
339
|
const t = this.D++;
|
|
340
|
-
return this.j[t] || (this.j[t] = new n.Mesh(this.
|
|
340
|
+
return this.j[t] || (this.j[t] = new n.Mesh(this.C)), this.j[t];
|
|
341
341
|
}
|
|
342
342
|
_(t) {
|
|
343
343
|
const e = this.N, i = {
|
|
@@ -383,7 +383,7 @@ class rt {
|
|
|
383
383
|
}), this.L = new n.Renderer(t);
|
|
384
384
|
}
|
|
385
385
|
remove() {
|
|
386
|
-
this.
|
|
386
|
+
this.C.dispose();
|
|
387
387
|
for (let t = 0; t < this.j.length; t++) this.j[t].dispose();
|
|
388
388
|
this.j.length = 0, this.H.dispose();
|
|
389
389
|
}
|
|
@@ -441,7 +441,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
441
441
|
return !0;
|
|
442
442
|
}
|
|
443
443
|
constructor(t) {
|
|
444
|
-
super(t), this.ready = !1, this.V = 0, this.
|
|
444
|
+
super(t), this.ready = !1, this.V = 0, this.W = {}, this.U = {}, this.G = {};
|
|
445
445
|
}
|
|
446
446
|
getTileLevelValue(t, e) {
|
|
447
447
|
if (this.isBackTile(t.id)) {
|
|
@@ -459,10 +459,10 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
459
459
|
setStyle(t) {
|
|
460
460
|
if (this.B && this.B.update(), this.q) {
|
|
461
461
|
this.V++, this.$();
|
|
462
|
-
const e = this.layer.
|
|
462
|
+
const e = this.layer.J();
|
|
463
463
|
e.styleCounter = this.V, this.q.updateStyle(e, e => {
|
|
464
464
|
if (e) throw new Error(e);
|
|
465
|
-
t || (this.
|
|
465
|
+
t || (this.X = !0, this.Y(), this.setToRedraw()), this.layer.fire("refreshstyle");
|
|
466
466
|
});
|
|
467
467
|
} else this.Y();
|
|
468
468
|
}
|
|
@@ -477,7 +477,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
477
477
|
const n = this.Z[e];
|
|
478
478
|
n && n.info && t.getAndRemove(n.info.id);
|
|
479
479
|
}
|
|
480
|
-
t.reset(), this.tilesInView = {}, this.tilesLoading = {}, this.
|
|
480
|
+
t.reset(), this.tilesInView = {}, this.tilesLoading = {}, this.W = {}, this._parentTiles = [],
|
|
481
481
|
this._childTiles = [];
|
|
482
482
|
}
|
|
483
483
|
updateOptions(t) {
|
|
@@ -490,20 +490,20 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
490
490
|
updateSceneConfig(t, e, n) {
|
|
491
491
|
const i = 0 === t ? this.tt() : this.et();
|
|
492
492
|
if (!i || !i[e]) return;
|
|
493
|
-
this.
|
|
494
|
-
const r = this.layer.
|
|
493
|
+
this.X = !0;
|
|
494
|
+
const r = this.layer.J(), o = this.layer.nt(t, r);
|
|
495
495
|
i[e].config = o[e].renderPlugin, i[e].updateSceneConfig({
|
|
496
496
|
sceneConfig: n
|
|
497
497
|
}), this.setToRedraw();
|
|
498
498
|
}
|
|
499
499
|
updateDataConfig(t, e, n, i) {
|
|
500
500
|
const r = 0 === t ? this.tt() : this.et();
|
|
501
|
-
r && r[e] && (this.
|
|
501
|
+
r && r[e] && (this.X = !0, r[e].updateDataConfig(n, i) ? this.setStyle() : this.setToRedraw());
|
|
502
502
|
}
|
|
503
503
|
updateSymbol(t, e, n) {
|
|
504
504
|
const i = 0 === t ? this.tt() : this.et();
|
|
505
505
|
if (!i || !i[e]) return !1;
|
|
506
|
-
const r = this.layer.
|
|
506
|
+
const r = this.layer.J(), o = this.layer.nt(t, r), s = i[e];
|
|
507
507
|
s.style = o[e];
|
|
508
508
|
const a = s.updateSymbol(n, o[e].symbol);
|
|
509
509
|
return !a && function t(e) {
|
|
@@ -524,7 +524,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
524
524
|
return t;
|
|
525
525
|
}
|
|
526
526
|
needRetireFrames() {
|
|
527
|
-
if (this.
|
|
527
|
+
if (this.X) return !0;
|
|
528
528
|
const t = this.it();
|
|
529
529
|
for (let e = 0; e < t.length; e++) if (t[e] && t[e].needToRetireFrames()) return !0;
|
|
530
530
|
return !1;
|
|
@@ -593,7 +593,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
593
593
|
}
|
|
594
594
|
ht() {
|
|
595
595
|
const t = this.V, e = [], n = [];
|
|
596
|
-
for (const n in this.
|
|
596
|
+
for (const n in this.U) if (+n !== t) {
|
|
597
597
|
e.push(n);
|
|
598
598
|
this.tt(n).forEach(t => {
|
|
599
599
|
t.remove();
|
|
@@ -605,14 +605,14 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
605
605
|
t.remove();
|
|
606
606
|
});
|
|
607
607
|
}
|
|
608
|
-
for (let t = 0; t < e.length; t++) delete this.
|
|
608
|
+
for (let t = 0; t < e.length; t++) delete this.U[e[t]];
|
|
609
609
|
for (let t = 0; t < n.length; t++) delete this.G[n[t]];
|
|
610
610
|
}
|
|
611
611
|
draw(t, e) {
|
|
612
|
-
this.ct !== t && (this.
|
|
612
|
+
this.ct !== t && (this.X = !1, this.ut());
|
|
613
613
|
const n = this.layer;
|
|
614
614
|
if (this.prepareCanvas(), !this.ready || !n.ready) return void this.completeRender();
|
|
615
|
-
let i = this.
|
|
615
|
+
let i = this.U[this.V];
|
|
616
616
|
i || (this.Y(), i = this.tt());
|
|
617
617
|
const r = this.et();
|
|
618
618
|
n.isDefaultRender() || i.length || r.length ? (n.options.collision && (n.clearCollisionIndex(),
|
|
@@ -666,13 +666,13 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
666
666
|
return !(!this.Mt || !this.Mt[t]);
|
|
667
667
|
}
|
|
668
668
|
loadTile(t) {
|
|
669
|
-
const {url: e} = t, n = this.
|
|
669
|
+
const {url: e} = t, n = this.W[e];
|
|
670
670
|
if (n) n.keys[t.id] || (n.tiles.push(t), n.keys[t.id] = 1); else {
|
|
671
671
|
const n = this.getTilePointAtTileRes(t.z), i = this.getTileGLScale(t.z);
|
|
672
|
-
this.
|
|
672
|
+
this.W[e] = {
|
|
673
673
|
keys: {},
|
|
674
674
|
tiles: [ t ]
|
|
675
|
-
}, this.
|
|
675
|
+
}, this.W[e].keys[t.id] = 1;
|
|
676
676
|
const r = this.layer.options.fetchOptions;
|
|
677
677
|
this.q.loadTile({
|
|
678
678
|
tileInfo: t,
|
|
@@ -694,10 +694,10 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
694
694
|
return e.distanceToPointAtRes(100, 100, n.getResolution(t)).x / 1e4;
|
|
695
695
|
}
|
|
696
696
|
Pt(t, e, n) {
|
|
697
|
-
if (!this.
|
|
697
|
+
if (!this.W[t]) return;
|
|
698
698
|
if (n && n.canceled) return;
|
|
699
|
-
const i = this.layer, r = i.isDefaultRender(), {tiles: o} = this.
|
|
700
|
-
if (delete this.
|
|
699
|
+
const i = this.layer, r = i.isDefaultRender(), {tiles: o} = this.W[t];
|
|
700
|
+
if (delete this.W[t], e) {
|
|
701
701
|
if (e.status && 404 === e.status) for (let t = 0; t < o.length; t++) {
|
|
702
702
|
const e = o[t];
|
|
703
703
|
this.onTileError(Z, e);
|
|
@@ -719,16 +719,16 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
719
719
|
for (let t = 0; t < n.data.length; t++) {
|
|
720
720
|
const e = n.data[t];
|
|
721
721
|
if (!e || !e.data || !e.styledFeatures.length) continue;
|
|
722
|
-
const {isUpdated: i, layer: r} = this.
|
|
722
|
+
const {isUpdated: i, layer: r} = this.Ot(0, t, e, a, l);
|
|
723
723
|
l.push(r), i && (s = i);
|
|
724
724
|
}
|
|
725
725
|
for (let t = 0; t < n.featureData.length; t++) {
|
|
726
726
|
const e = n.featureData[t];
|
|
727
|
-
e && e.data && e.styledFeatures.length && this.
|
|
727
|
+
e && e.data && e.styledFeatures.length && this.Ot(1, t, e, a);
|
|
728
728
|
}
|
|
729
|
-
s && i.
|
|
729
|
+
s && i.Ct();
|
|
730
730
|
const h = o[0].z, c = this.layer.getDataSchema(h);
|
|
731
|
-
if (this.
|
|
731
|
+
if (this.Et(c, n.schema), delete n.features, r && n.data.length !== l.length) {
|
|
732
732
|
const t = n.data;
|
|
733
733
|
n.data = [];
|
|
734
734
|
for (let e = 0; e < t.length; e++) t[e] && t[e].features && n.data.push(t[e]);
|
|
@@ -760,8 +760,8 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
760
760
|
url: t
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
|
-
|
|
764
|
-
const {style: r, isUpdated: o} = this.
|
|
763
|
+
Ot(t, e, n, i) {
|
|
764
|
+
const {style: r, isUpdated: o} = this.Ft(t, e, n.data), s = this.layer, a = s.isDefaultRender(), l = r.symbol, h = st(i, n.styledFeatures, e, l, s);
|
|
765
765
|
delete n.styledFeatures, n.features = h;
|
|
766
766
|
let c = n.data;
|
|
767
767
|
return Array.isArray(c) && (c = c[0]), {
|
|
@@ -772,7 +772,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
772
772
|
} : null
|
|
773
773
|
};
|
|
774
774
|
}
|
|
775
|
-
|
|
775
|
+
Et(t, e) {
|
|
776
776
|
for (const n in e) {
|
|
777
777
|
t[n] || (t[n] = {
|
|
778
778
|
types: e[n].types,
|
|
@@ -782,7 +782,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
782
782
|
for (const t in i) (!r[t] || r[t] && "object" !== i[t] && "object" === r[t]) && (r[t] = i[t]);
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
|
-
|
|
785
|
+
Ft(t, e, n) {
|
|
786
786
|
Array.isArray(n) && (n = n[0]);
|
|
787
787
|
const i = this.layer;
|
|
788
788
|
let r, o = !1;
|
|
@@ -795,7 +795,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
795
795
|
t[e][s] ? r = t[e][s] : (r = this.jt(i), r.filter = n.filter, t[e].push(r), t[e][s] = r,
|
|
796
796
|
o = !0);
|
|
797
797
|
} else {
|
|
798
|
-
const s = i.
|
|
798
|
+
const s = i.J(), a = i.nt(t, s), l = this.tt();
|
|
799
799
|
if (r = a[e], !r.renderPlugin) {
|
|
800
800
|
o = !0;
|
|
801
801
|
const {plugin: t, symbol: i, renderPlugin: s} = this.jt(n.type);
|
|
@@ -827,12 +827,12 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
827
827
|
}), t;
|
|
828
828
|
}
|
|
829
829
|
const t = [];
|
|
830
|
-
for (const e in this.
|
|
830
|
+
for (const e in this.U) t.push(...this.U[e]);
|
|
831
831
|
for (const e in this.G) t.push(...this.G[e]);
|
|
832
832
|
return t;
|
|
833
833
|
}
|
|
834
834
|
tt(t) {
|
|
835
|
-
return q(t) && (t = this.V), this.
|
|
835
|
+
return q(t) && (t = this.V), this.U[t] || ut;
|
|
836
836
|
}
|
|
837
837
|
et(t) {
|
|
838
838
|
return q(t) && (t = this.V), this.G[t] || ut;
|
|
@@ -855,7 +855,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
855
855
|
pluginIndex: s,
|
|
856
856
|
timestamp: t
|
|
857
857
|
};
|
|
858
|
-
r &&
|
|
858
|
+
r && W(d, r), o.startFrame(d), this.pickingFBO = c;
|
|
859
859
|
});
|
|
860
860
|
}
|
|
861
861
|
bt(t) {
|
|
@@ -889,12 +889,12 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
889
889
|
}), this.isEnableTileStencil() && e.painter && !e.painter.needClearStencil() && this.Vt(i);
|
|
890
890
|
const a = this.xt[o] || 0, l = this.Lt(e, a, r, t), c = e.endFrame(l);
|
|
891
891
|
c && c.redraw && this.setToRedraw(), h = !0;
|
|
892
|
-
}), h && this.layer.fire("canvasisdirty"), a && this.
|
|
892
|
+
}), h && this.layer.fire("canvasisdirty"), a && this.Wt();
|
|
893
893
|
}
|
|
894
894
|
getPolygonOffsetCount() {
|
|
895
895
|
return this.wt || 0;
|
|
896
896
|
}
|
|
897
|
-
|
|
897
|
+
Wt() {
|
|
898
898
|
if (this.layer.options.debug) {
|
|
899
899
|
const t = this.yt, e = [], n = this.getMap().projViewMatrix;
|
|
900
900
|
for (const i in this.tilesInView) {
|
|
@@ -908,7 +908,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
908
908
|
}
|
|
909
909
|
Ht(t) {
|
|
910
910
|
if (!t) return !0;
|
|
911
|
-
const e = this.yt, n = this.St(t), i = e && e.states && e.states.includesChanged, r = this.
|
|
911
|
+
const e = this.yt, n = this.St(t), i = e && e.states && e.states.includesChanged, r = this.Ut(t.painter.scene.getMeshes());
|
|
912
912
|
return !n || !i && !r ? 0 : r ? 2 : 1;
|
|
913
913
|
}
|
|
914
914
|
Lt(t, e, n, i) {
|
|
@@ -923,9 +923,9 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
923
923
|
cameraPosition: n,
|
|
924
924
|
timestamp: i
|
|
925
925
|
}, h = this.yt;
|
|
926
|
-
return h &&
|
|
926
|
+
return h && W(l, h), l;
|
|
927
927
|
}
|
|
928
|
-
|
|
928
|
+
Ut(t) {
|
|
929
929
|
if (!t) return !1;
|
|
930
930
|
const e = this.yt && this.yt.sceneFilter;
|
|
931
931
|
return e ? t.filter(t => e(t) || t.properties.hlBloomMesh && e(t.properties.hlBloomMesh)).length > 0 : t.length > 0;
|
|
@@ -978,15 +978,15 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
978
978
|
gt.prototype.drawTile.call(this, t, e, yt);
|
|
979
979
|
}
|
|
980
980
|
renderTerrainSkin(t, e, n, i, r, o) {
|
|
981
|
-
const s = this.
|
|
982
|
-
o && (o = this.
|
|
981
|
+
const s = this.Jt(r);
|
|
982
|
+
o && (o = this.Xt(o)), super.renderTerrainSkin(t, e, n, i, s, o);
|
|
983
983
|
}
|
|
984
|
-
|
|
984
|
+
Jt(t) {
|
|
985
985
|
const e = [];
|
|
986
|
-
for (let n = 0; n < t.length; n++) e[n] = this.
|
|
986
|
+
for (let n = 0; n < t.length; n++) e[n] = this.Xt(t[n]);
|
|
987
987
|
return e;
|
|
988
988
|
}
|
|
989
|
-
|
|
989
|
+
Xt(t) {
|
|
990
990
|
const e = this.Rt.canvas, n = this.ct, i = this.yt;
|
|
991
991
|
this.yt = null;
|
|
992
992
|
const {info: r, image: o, tileTerrainCanvas: s} = t;
|
|
@@ -1036,7 +1036,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1036
1036
|
tileZoom: this._tileZoom,
|
|
1037
1037
|
bloom: this.yt && this.yt.bloom
|
|
1038
1038
|
}, m = o.paintTile(p);
|
|
1039
|
-
!this.
|
|
1039
|
+
!this.X && (m.retire || m.redraw) && o.supportRenderMode("taa") && (this.X = !0),
|
|
1040
1040
|
m.redraw && this.setToRedraw();
|
|
1041
1041
|
}), e && e.style === this.V && this.Zt(t), this.setCanvasUpdated();
|
|
1042
1042
|
}
|
|
@@ -1066,7 +1066,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1066
1066
|
tileInfo: t,
|
|
1067
1067
|
tileZoom: this._tileZoom
|
|
1068
1068
|
}, p = r.createTile(f);
|
|
1069
|
-
n[h].geometry && (e.data[h] = 1), !this.
|
|
1069
|
+
n[h].geometry && (e.data[h] = 1), !this.X && p.retire && r.supportRenderMode("taa") && (this.X = !0);
|
|
1070
1070
|
});
|
|
1071
1071
|
}
|
|
1072
1072
|
checkTileInQueue(t) {
|
|
@@ -1102,7 +1102,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1102
1102
|
}
|
|
1103
1103
|
}
|
|
1104
1104
|
abortTileLoading(t, e) {
|
|
1105
|
-
e && e.url && (this.q && this.q.abortTile(e.url), delete this.
|
|
1105
|
+
e && e.url && (this.q && this.q.abortTile(e.url), delete this.W[e.url]), super.abortTileLoading(t, e);
|
|
1106
1106
|
}
|
|
1107
1107
|
resizeCanvas(t) {
|
|
1108
1108
|
super.resizeCanvas(t);
|
|
@@ -1130,7 +1130,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1130
1130
|
return e.readPixels(t.x, i - t.y, 1, 1, e.RGBA, e.UNSIGNED_BYTE, n), n[3] > 0;
|
|
1131
1131
|
}
|
|
1132
1132
|
Y() {
|
|
1133
|
-
const {style: t, featureStyle: e} = this.layer.
|
|
1133
|
+
const {style: t, featureStyle: e} = this.layer.J(), n = t.map((t, e) => {
|
|
1134
1134
|
const n = t.renderPlugin;
|
|
1135
1135
|
if (!n) return null;
|
|
1136
1136
|
if (!n.type) throw new Error("invalid plugin type for style at " + e);
|
|
@@ -1145,7 +1145,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1145
1145
|
return r.style = t, r.styleCounter = this.V, i.push(r), r;
|
|
1146
1146
|
});
|
|
1147
1147
|
const r = this.V;
|
|
1148
|
-
if (this.
|
|
1148
|
+
if (this.U[r] = n, this.G[r] = i, this.layer.fire("pluginsinited"), this.te && this.te.size || this.layer.te) {
|
|
1149
1149
|
this.layer.te && this.layer.ee();
|
|
1150
1150
|
this.getMap().getRenderer().callInNextFrame(() => {
|
|
1151
1151
|
this.it().forEach(t => {
|
|
@@ -1173,7 +1173,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1173
1173
|
return i;
|
|
1174
1174
|
}
|
|
1175
1175
|
pt(t) {
|
|
1176
|
-
return
|
|
1176
|
+
return J(t, this.getMap());
|
|
1177
1177
|
}
|
|
1178
1178
|
debugFBO(t, e) {
|
|
1179
1179
|
const n = document.getElementById(t), i = e.width, r = e.height;
|
|
@@ -1315,7 +1315,7 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1315
1315
|
delete this.At, delete this.kt, this.setToRedraw();
|
|
1316
1316
|
}
|
|
1317
1317
|
setZIndex() {
|
|
1318
|
-
return this.setToRedraw(), this.
|
|
1318
|
+
return this.setToRedraw(), this.X = !0, super.setZIndex.apply(this, arguments);
|
|
1319
1319
|
}
|
|
1320
1320
|
consumeTile(t, e) {
|
|
1321
1321
|
t.It && this.Zt(e), super.consumeTile(t, e), this.Kt(e, t);
|
|
@@ -1331,8 +1331,8 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
}
|
|
1333
1333
|
highlight(t) {
|
|
1334
|
-
if (this.te || (this.te = new Map), Array.isArray(t)) for (let e = 0; e < t.length; e++) q(t[e].name) && !q(t[e].id) && (t[e] =
|
|
1335
|
-
t[e].name = t[e].id), this.te.set(t[e].name, t[e]); else q(t.name) && !q(t.id) && ((t =
|
|
1334
|
+
if (this.te || (this.te = new Map), Array.isArray(t)) for (let e = 0; e < t.length; e++) q(t[e].name) && !q(t[e].id) && (t[e] = W({}, t[e]),
|
|
1335
|
+
t[e].name = t[e].id), this.te.set(t[e].name, t[e]); else q(t.name) && !q(t.id) && ((t = W({}, t)).name = t.id),
|
|
1336
1336
|
this.te.set(t.name, t);
|
|
1337
1337
|
this.it().forEach(t => {
|
|
1338
1338
|
t.highlight(this.te);
|
|
@@ -1354,8 +1354,8 @@ class gt extends t.renderer.TileLayerCanvasRenderer {
|
|
|
1354
1354
|
|
|
1355
1355
|
function vt(t) {
|
|
1356
1356
|
let e;
|
|
1357
|
-
Array.isArray(t.data) ? (e = [], B(e, t.data)) : (e = {},
|
|
1358
|
-
const n =
|
|
1357
|
+
Array.isArray(t.data) ? (e = [], B(e, t.data)) : (e = {}, W(e, t.data));
|
|
1358
|
+
const n = W({}, t);
|
|
1359
1359
|
return n.data = e, n;
|
|
1360
1360
|
}
|
|
1361
1361
|
|
|
@@ -1379,10 +1379,10 @@ function wt(t) {
|
|
|
1379
1379
|
|
|
1380
1380
|
function At(t, e, n) {
|
|
1381
1381
|
for (let i = 0; i < t.length; i++) {
|
|
1382
|
-
const r = t[i], o =
|
|
1382
|
+
const r = t[i], o = W({}, r), {renderPlugin: s} = r, a = W({}, s);
|
|
1383
1383
|
a.sceneConfig && !Object.keys(a.sceneConfig).length && delete a.sceneConfig;
|
|
1384
1384
|
let l = -1;
|
|
1385
|
-
for (let t = n.length - 1; t >= 0; t--) if (
|
|
1385
|
+
for (let t = n.length - 1; t >= 0; t--) if (F(a, n[t])) {
|
|
1386
1386
|
l = t;
|
|
1387
1387
|
break;
|
|
1388
1388
|
}
|
|
@@ -1580,14 +1580,14 @@ class Pt extends t.TileLayer {
|
|
|
1580
1580
|
style: this.isDefaultRender() ? {
|
|
1581
1581
|
style: [],
|
|
1582
1582
|
featureStyle: []
|
|
1583
|
-
} : this.
|
|
1583
|
+
} : this.J(),
|
|
1584
1584
|
features: this.options.debugTileData || this.options.features,
|
|
1585
1585
|
schema: this.options.schema,
|
|
1586
1586
|
pickingGeometry: this.options.pickingGeometry
|
|
1587
1587
|
};
|
|
1588
1588
|
}
|
|
1589
1589
|
setStyle(t) {
|
|
1590
|
-
if (t && (
|
|
1590
|
+
if (t && (U(t) || t.url)) {
|
|
1591
1591
|
const e = t, n = e.lastIndexOf("/"), i = n < 0 ? "." : e.substring(0, n);
|
|
1592
1592
|
return this.ready = !1, _t.getJSON(t.url ? t.url : t, t.url ? t : {}, (t, n) => {
|
|
1593
1593
|
if (t) throw this.setStyle([]), t;
|
|
@@ -1618,9 +1618,9 @@ class Pt extends t.TileLayer {
|
|
|
1618
1618
|
let {style: i, featureStyle: r} = n;
|
|
1619
1619
|
i = i || [], r = r || [];
|
|
1620
1620
|
const o = new Array(i.length);
|
|
1621
|
-
for (let t = 0; t < i.length; t++) o[t] =
|
|
1621
|
+
for (let t = 0; t < i.length; t++) o[t] = W({}, i[t]), o[t].renderPlugin = e[i[t].renderPlugin];
|
|
1622
1622
|
const s = new Array(r.length);
|
|
1623
|
-
for (let t = 0; t < r.length; t++) s[t] =
|
|
1623
|
+
for (let t = 0; t < r.length; t++) s[t] = W({}, r[t]), s[t].renderPlugin = e[r[t].renderPlugin];
|
|
1624
1624
|
const a = {
|
|
1625
1625
|
style: o,
|
|
1626
1626
|
featureStyle: s
|
|
@@ -1632,20 +1632,20 @@ class Pt extends t.TileLayer {
|
|
|
1632
1632
|
for (let n = 0; n < t.length; n++) {
|
|
1633
1633
|
const i = t[n].style;
|
|
1634
1634
|
if (i && Array.isArray(i) && i.length) for (let r = 0; r < i.length; r++) {
|
|
1635
|
-
const o =
|
|
1635
|
+
const o = W({}, t[n], i[r]);
|
|
1636
1636
|
i[r].ce = e.length, delete o.style, e.push(o);
|
|
1637
|
-
} else e.push(
|
|
1637
|
+
} else e.push(W({}, t[n]));
|
|
1638
1638
|
}
|
|
1639
1639
|
return e;
|
|
1640
1640
|
}(t.featureStyle), this.ue = t.style || [];
|
|
1641
1641
|
const e = t.background || {};
|
|
1642
1642
|
this.de = {
|
|
1643
1643
|
enable: e.enable || !1,
|
|
1644
|
-
color:
|
|
1645
|
-
opacity:
|
|
1644
|
+
color: Ot(e.color) || [ 0, 0, 0, 0 ],
|
|
1645
|
+
opacity: Ct(e.opacity, 1),
|
|
1646
1646
|
patternFile: e.patternFile,
|
|
1647
1647
|
depthRange: e.depthRange
|
|
1648
|
-
}, this.validateStyle(), this.ae && this.fe(), this.
|
|
1648
|
+
}, this.validateStyle(), this.ae && this.fe(), this.Ct();
|
|
1649
1649
|
const n = this.getRenderer();
|
|
1650
1650
|
n && n.setStyle(), this.fire("setstyle", {
|
|
1651
1651
|
style: this.getStyle(),
|
|
@@ -1727,20 +1727,20 @@ class Pt extends t.TileLayer {
|
|
|
1727
1727
|
const r = this.nt(t);
|
|
1728
1728
|
if (!r) return this;
|
|
1729
1729
|
let o, s = e;
|
|
1730
|
-
if (r[e].renderPlugin.sceneConfig || (r[e].renderPlugin.sceneConfig = {}),
|
|
1730
|
+
if (r[e].renderPlugin.sceneConfig || (r[e].renderPlugin.sceneConfig = {}), W(r[e].renderPlugin.sceneConfig, n),
|
|
1731
1731
|
void 0 !== i) {
|
|
1732
|
-
|
|
1732
|
+
Et(this.le, e, i), s = this.le[e].style[i].ce;
|
|
1733
1733
|
const t = r[s].renderPlugin;
|
|
1734
1734
|
t.sceneConfig || (t.sceneConfig = {}), o = t.sceneConfig;
|
|
1735
|
-
} else
|
|
1736
|
-
if (
|
|
1735
|
+
} else Ft(r, e), o = r[e].renderPlugin.sceneConfig;
|
|
1736
|
+
if (W(o, n), Array.isArray(this.options.style)) {
|
|
1737
1737
|
const t = this.options.style[e].renderPlugin;
|
|
1738
|
-
t.sceneConfig || (t.sceneConfig = {}),
|
|
1738
|
+
t.sceneConfig || (t.sceneConfig = {}), W(t.sceneConfig, n);
|
|
1739
1739
|
} else {
|
|
1740
1740
|
const r = this.nt(t, this.options.style);
|
|
1741
1741
|
let o;
|
|
1742
|
-
void 0 !== i ? (
|
|
1743
|
-
o.sceneConfig || (o.sceneConfig = {}),
|
|
1742
|
+
void 0 !== i ? (Et(r, e, i), o = r[e].style[i].renderPlugin) : (Ft(r, e), o = r[e].renderPlugin),
|
|
1743
|
+
o.sceneConfig || (o.sceneConfig = {}), W(o.sceneConfig, n);
|
|
1744
1744
|
}
|
|
1745
1745
|
const a = this.getRenderer();
|
|
1746
1746
|
return a && a.updateSceneConfig(t, s, n), 0 === t ? this.fire("updatesceneconfig", {
|
|
@@ -1762,14 +1762,14 @@ class Pt extends t.TileLayer {
|
|
|
1762
1762
|
const r = this.nt(t);
|
|
1763
1763
|
if (!r) return this;
|
|
1764
1764
|
let o, s = e;
|
|
1765
|
-
void 0 !== i ? (
|
|
1765
|
+
void 0 !== i ? (Et(this.le, e, i), s = this.le[e].style[i].ce, o = r[s].renderPlugin.dataConfig) : (Ft(r, e),
|
|
1766
1766
|
o = r[e].renderPlugin.dataConfig);
|
|
1767
|
-
const a =
|
|
1768
|
-
if (
|
|
1767
|
+
const a = W({}, o);
|
|
1768
|
+
if (W(o, n), Array.isArray(this.options.style)) W(this.options.style[e].renderPlugin.dataConfig, n); else {
|
|
1769
1769
|
const r = this.nt(t, this.options.style);
|
|
1770
1770
|
let o;
|
|
1771
|
-
void 0 !== i ? (
|
|
1772
|
-
o.dataConfig || (o.dataConfig = {}),
|
|
1771
|
+
void 0 !== i ? (Et(r, e, i), o = r[e].style[i].renderPlugin) : (Ft(r, e), o = r[e].renderPlugin),
|
|
1772
|
+
o.dataConfig || (o.dataConfig = {}), W(o.dataConfig, n);
|
|
1773
1773
|
}
|
|
1774
1774
|
const l = this.getRenderer();
|
|
1775
1775
|
return l && l.updateDataConfig(t, s, n, a), 0 === t ? this.fire("updatedataconfig", {
|
|
@@ -1782,7 +1782,7 @@ class Pt extends t.TileLayer {
|
|
|
1782
1782
|
}), this;
|
|
1783
1783
|
}
|
|
1784
1784
|
updateSymbol(t, e) {
|
|
1785
|
-
return
|
|
1785
|
+
return U(t) && (t = this.be(t)), this.xe(0, t, e);
|
|
1786
1786
|
}
|
|
1787
1787
|
updateFeatureSymbol(t, e, n) {
|
|
1788
1788
|
return this.xe(1, t, n, e);
|
|
@@ -1791,7 +1791,7 @@ class Pt extends t.TileLayer {
|
|
|
1791
1791
|
const o = this.nt(e);
|
|
1792
1792
|
if (!o) return this;
|
|
1793
1793
|
let s = n;
|
|
1794
|
-
void 0 !== r && (
|
|
1794
|
+
void 0 !== r && (Et(this.le, n, r), s = this.le[n].style[r].ce);
|
|
1795
1795
|
const a = o[s];
|
|
1796
1796
|
if (!a) throw new Error("No style defined at " + n);
|
|
1797
1797
|
const l = this, h = this.ae;
|
|
@@ -1808,22 +1808,22 @@ class Pt extends t.TileLayer {
|
|
|
1808
1808
|
}
|
|
1809
1809
|
}
|
|
1810
1810
|
for (const e in i) $(i, e) && (!t.Util.isObject(i[e]) || Array.isArray(i[e]) || i[e].stops ? o[e] = i[e] : (o[e] || (o[e] = {}),
|
|
1811
|
-
|
|
1811
|
+
W(o[e], i[e])));
|
|
1812
1812
|
let u = l.options.style;
|
|
1813
1813
|
Array.isArray(u) || (u = l.nt(e, l.options.style));
|
|
1814
1814
|
const d = JSON.parse(JSON.stringify(o));
|
|
1815
|
-
return void 0 !== r ? (
|
|
1815
|
+
return void 0 !== r ? (Et(u, n, r), void 0 === s ? u[n].style[r].symbol = d : u[n].style[r].symbol[s] = d) : (Ft(u, n),
|
|
1816
1816
|
void 0 === s ? u[n].symbol = d : u[n].symbol[s] = d), c;
|
|
1817
1817
|
}
|
|
1818
1818
|
const u = this.getRenderer();
|
|
1819
|
-
if (!u) return c(), this.
|
|
1819
|
+
if (!u) return c(), this.Ct(), this;
|
|
1820
1820
|
let d = !1;
|
|
1821
1821
|
const f = a.symbol;
|
|
1822
1822
|
if (Array.isArray(i)) for (let t = 0; t < i.length; t++) {
|
|
1823
1823
|
const e = c(i[t], f[t], t);
|
|
1824
1824
|
e && (d = e);
|
|
1825
1825
|
} else c(i, f);
|
|
1826
|
-
return this.
|
|
1826
|
+
return this.Ct(), d ? u.setStyle() : (d = u.updateSymbol(e, s, i), d && u.setStyle()),
|
|
1827
1827
|
0 === e ? this.fire("updatesymbol", {
|
|
1828
1828
|
index: n,
|
|
1829
1829
|
symbol: i
|
|
@@ -1872,15 +1872,15 @@ class Pt extends t.TileLayer {
|
|
|
1872
1872
|
polygonOpacity: 1
|
|
1873
1873
|
}
|
|
1874
1874
|
});
|
|
1875
|
-
const t = this.
|
|
1875
|
+
const t = this.J().background || {};
|
|
1876
1876
|
return this.Ae.enable = t.enable, this.Ae.symbol.polygonFill = t.color, this.Ae.symbol.polygonOpacity = t.opacity,
|
|
1877
1877
|
this.Ae.symbol.polygonPatternFile = t.patternFile, this.Ae.renderPlugin.sceneConfig.depthRange = t.depthRange,
|
|
1878
1878
|
this.Ae;
|
|
1879
1879
|
}
|
|
1880
1880
|
getComputedStyle() {
|
|
1881
|
-
return JSON.parse(JSON.stringify(this.
|
|
1881
|
+
return JSON.parse(JSON.stringify(this.J()));
|
|
1882
1882
|
}
|
|
1883
|
-
|
|
1883
|
+
J() {
|
|
1884
1884
|
return {
|
|
1885
1885
|
background: this.de,
|
|
1886
1886
|
style: this.ue || [],
|
|
@@ -1907,7 +1907,7 @@ class Pt extends t.TileLayer {
|
|
|
1907
1907
|
if (!r || !r.data) continue;
|
|
1908
1908
|
const {tile: o} = r.data, {x: s, y: a, z: l, extent: h} = o, c = n.getResolution(l), u = e.getTilePointNW(s, a, c), d = r.data.feature && r.data.feature.geometry;
|
|
1909
1909
|
if (d) {
|
|
1910
|
-
r.data =
|
|
1910
|
+
r.data = W({}, r.data), r.data.feature = W({}, r.data.feature);
|
|
1911
1911
|
const t = r.data.feature.type;
|
|
1912
1912
|
r.data.feature.type = "Feature", r.data.feature.geometry = this._e(t, d, u, h, c);
|
|
1913
1913
|
}
|
|
@@ -1953,7 +1953,7 @@ class Pt extends t.TileLayer {
|
|
|
1953
1953
|
static fromJSON(t) {
|
|
1954
1954
|
return t && "VectorTileLayer" === t.type ? new Pt(t.id, t.options) : null;
|
|
1955
1955
|
}
|
|
1956
|
-
|
|
1956
|
+
Ct() {}
|
|
1957
1957
|
static registerPlugin(t) {
|
|
1958
1958
|
Pt.plugins || (Pt.plugins = {}), Pt.plugins[t.type] = t;
|
|
1959
1959
|
}
|
|
@@ -1984,20 +1984,20 @@ function It(t) {
|
|
|
1984
1984
|
return !(!t || !t.properties);
|
|
1985
1985
|
}
|
|
1986
1986
|
|
|
1987
|
-
function
|
|
1987
|
+
function Ot(t) {
|
|
1988
1988
|
return t ? (Array.isArray(t) || (t = z(t).unitArray()), 3 === t.length && t.push(1),
|
|
1989
1989
|
t) : null;
|
|
1990
1990
|
}
|
|
1991
1991
|
|
|
1992
|
-
function
|
|
1992
|
+
function Ct(t, e) {
|
|
1993
1993
|
return null == t ? e : t;
|
|
1994
1994
|
}
|
|
1995
1995
|
|
|
1996
|
-
function
|
|
1996
|
+
function Et(t, e, n) {
|
|
1997
1997
|
if (!t[e] || !t[e].style || !t[e].style[n]) throw new Error(`No plugin defined at feature style of ${e} - ${n}`);
|
|
1998
1998
|
}
|
|
1999
1999
|
|
|
2000
|
-
function
|
|
2000
|
+
function Ft(t, e) {
|
|
2001
2001
|
if (!t[e]) throw new Error("No plugin defined at style of " + e);
|
|
2002
2002
|
}
|
|
2003
2003
|
|
|
@@ -2029,12 +2029,12 @@ class Dt extends Pt {
|
|
|
2029
2029
|
getWorkerOptions() {
|
|
2030
2030
|
const t = super.getWorkerOptions();
|
|
2031
2031
|
let e = this.options.data;
|
|
2032
|
-
return e =
|
|
2032
|
+
return e = U(e) || e && e.url ? Rt(e) : this.features, t.data = e, t.tileBuffer = this.options.tileBuffer,
|
|
2033
2033
|
t.extent = this.options.extent, t.hasAltitude = this.options.enableAltitude, t.simplifyTolerance = this.options.simplifyTolerance,
|
|
2034
2034
|
t;
|
|
2035
2035
|
}
|
|
2036
2036
|
setData(t) {
|
|
2037
|
-
if (this.options.data = t, t && (
|
|
2037
|
+
if (this.options.data = t, t && (U(t) || t.url)) {
|
|
2038
2038
|
return !!this.getRenderer() && this.Pe(), this;
|
|
2039
2039
|
}
|
|
2040
2040
|
return this.Ie(t), this.Pe(), this;
|
|
@@ -2043,7 +2043,7 @@ class Dt extends Pt {
|
|
|
2043
2043
|
if (this.options.convertFn) {
|
|
2044
2044
|
t = new Function("data", this.options.convertFn + "\nreturn convert(data)")(t);
|
|
2045
2045
|
}
|
|
2046
|
-
return this.features = t, this.
|
|
2046
|
+
return this.features = t, this.Oe(), this;
|
|
2047
2047
|
}
|
|
2048
2048
|
Pe() {
|
|
2049
2049
|
const t = this.getRenderer();
|
|
@@ -2051,27 +2051,27 @@ class Dt extends Pt {
|
|
|
2051
2051
|
const e = t.getWorkerConnection();
|
|
2052
2052
|
if (e) {
|
|
2053
2053
|
let n = this.options.data;
|
|
2054
|
-
n =
|
|
2054
|
+
n = U(n) || n.url ? Rt(n) : this.features, e.setData(n, (e, n) => {
|
|
2055
2055
|
t.clear(), this.onWorkerReady(null, n), t.setToRedraw();
|
|
2056
2056
|
});
|
|
2057
2057
|
}
|
|
2058
2058
|
}
|
|
2059
2059
|
}
|
|
2060
2060
|
getExtent() {
|
|
2061
|
-
return this.
|
|
2061
|
+
return this.Ce;
|
|
2062
2062
|
}
|
|
2063
2063
|
onWorkerReady(t, e) {
|
|
2064
2064
|
t ? this.fire("dataerror", {
|
|
2065
2065
|
error: t
|
|
2066
|
-
}) : (e && (e.extent && this.
|
|
2066
|
+
}) : (e && (e.extent && this.Ee(e.extent), e.idMap && (this.Fe = e.idMap)), this.fire("dataload", {
|
|
2067
2067
|
extent: e && e.extent
|
|
2068
2068
|
}));
|
|
2069
2069
|
}
|
|
2070
|
-
|
|
2071
|
-
this.
|
|
2070
|
+
Ee(e) {
|
|
2071
|
+
this.Ce = new t.Extent(...e);
|
|
2072
2072
|
}
|
|
2073
2073
|
ze(t, e) {
|
|
2074
|
-
|
|
2074
|
+
U(t) ? _t.getJSON(t, e) : _t.getJSON(t.url, t, e);
|
|
2075
2075
|
}
|
|
2076
2076
|
getData() {
|
|
2077
2077
|
return this.features || null;
|
|
@@ -2080,21 +2080,21 @@ class Dt extends Pt {
|
|
|
2080
2080
|
return this.getId() + "," + t + "," + e + "," + n;
|
|
2081
2081
|
}
|
|
2082
2082
|
getFeature(t) {
|
|
2083
|
-
return this.
|
|
2083
|
+
return this.Fe[t];
|
|
2084
2084
|
}
|
|
2085
2085
|
static fromJSON(t) {
|
|
2086
2086
|
return t && "GeoJSONVectorTileLayer" === t.type ? new Dt(t.id, t.options) : null;
|
|
2087
2087
|
}
|
|
2088
|
-
|
|
2088
|
+
Oe() {
|
|
2089
2089
|
if (!this.features) return;
|
|
2090
2090
|
if (this.features = JSON.parse(JSON.stringify(this.features)), !this.features) return;
|
|
2091
2091
|
let t = 0;
|
|
2092
|
-
this.
|
|
2092
|
+
this.Fe = {};
|
|
2093
2093
|
const e = this.features;
|
|
2094
2094
|
Array.isArray(e) ? e.forEach(e => {
|
|
2095
|
-
e && (void 0 !== e.id && null !== e.id || (e.id = t++), this.
|
|
2095
|
+
e && (void 0 !== e.id && null !== e.id || (e.id = t++), this.Fe[e.id] = e);
|
|
2096
2096
|
}) : e.features && e.features.forEach(e => {
|
|
2097
|
-
e && (void 0 !== e.id && null !== e.id || (e.id = t++), this.
|
|
2097
|
+
e && (void 0 !== e.id && null !== e.id || (e.id = t++), this.Fe[e.id] = e);
|
|
2098
2098
|
});
|
|
2099
2099
|
}
|
|
2100
2100
|
}
|
|
@@ -2127,7 +2127,7 @@ class Lt extends t.OverlayLayer {
|
|
|
2127
2127
|
if (!this.options.style) throw new Error("can't call update symbol when style is not set");
|
|
2128
2128
|
const n = Array.isArray(this.options.style) ? this.options.style : this.options.style.style;
|
|
2129
2129
|
if (!n[t]) throw new Error("invalid style at " + t);
|
|
2130
|
-
return
|
|
2130
|
+
return W(n[t].symbol, e), this.setStyle(this.options.style), this;
|
|
2131
2131
|
}
|
|
2132
2132
|
getPolygonOffsetCount() {
|
|
2133
2133
|
return 1;
|
|
@@ -2460,7 +2460,7 @@ const Ht = {
|
|
|
2460
2460
|
default: "point",
|
|
2461
2461
|
property: "_symbol_textPlacement"
|
|
2462
2462
|
}
|
|
2463
|
-
},
|
|
2463
|
+
}, Wt = {
|
|
2464
2464
|
lineWidth: {
|
|
2465
2465
|
type: "identity",
|
|
2466
2466
|
default: 2,
|
|
@@ -2531,7 +2531,7 @@ const Ht = {
|
|
|
2531
2531
|
default: void 0,
|
|
2532
2532
|
property: "_symbol_lineDashColor"
|
|
2533
2533
|
}
|
|
2534
|
-
},
|
|
2534
|
+
}, Ut = new t.Point(0, 0), Gt = "_vector3dlayer_id", qt = "_line_gradient_property".trim();
|
|
2535
2535
|
|
|
2536
2536
|
function Bt(e, n, i) {
|
|
2537
2537
|
const r = "__fea_idx".trim(), o = e.getMap(), s = o.getGLRes();
|
|
@@ -2540,20 +2540,20 @@ function Bt(e, n, i) {
|
|
|
2540
2540
|
let h = 1;
|
|
2541
2541
|
if (e instanceof t.Marker || e instanceof t.MultiPoint) {
|
|
2542
2542
|
e instanceof t.Marker && (a = [ a ]);
|
|
2543
|
-
for (let t = 0; t < a.length; t++) o.coordToPointAtRes(a[t], s,
|
|
2543
|
+
for (let t = 0; t < a.length; t++) o.coordToPointAtRes(a[t], s, Ut), l.push([ Ut.x, Ut.y, a[t].z || 0 ]);
|
|
2544
2544
|
} else if (e instanceof t.LineString || e instanceof t.MultiLineString) {
|
|
2545
2545
|
h = 2, e instanceof t.LineString && (a = [ a ]);
|
|
2546
2546
|
for (let t = 0; t < a.length; t++) {
|
|
2547
2547
|
l[t] = [];
|
|
2548
|
-
for (let e = 0; e < a[t].length; e++) o.coordToPointAtRes(a[t][e], s,
|
|
2548
|
+
for (let e = 0; e < a[t].length; e++) o.coordToPointAtRes(a[t][e], s, Ut), l[t].push([ Ut.x, Ut.y, a[t][e].z || 0 ]);
|
|
2549
2549
|
}
|
|
2550
2550
|
} else if (e instanceof t.Polygon || e instanceof t.MultiPolygon) {
|
|
2551
2551
|
h = 3, e instanceof t.Polygon && (a = [ a ]);
|
|
2552
2552
|
let n = 0;
|
|
2553
2553
|
for (let t = 0; t < a.length; t++) for (let e = 0; e < a[t].length; e++) {
|
|
2554
2554
|
l[n] = [];
|
|
2555
|
-
for (let i = 0; i < a[t][e].length; i++) o.coordToPointAtRes(a[t][e][i], s,
|
|
2556
|
-
l[n].push([
|
|
2555
|
+
for (let i = 0; i < a[t][e].length; i++) o.coordToPointAtRes(a[t][e][i], s, Ut),
|
|
2556
|
+
l[n].push([ Ut.x, Ut.y, a[t][e][i].z || 0 ]);
|
|
2557
2557
|
n++;
|
|
2558
2558
|
}
|
|
2559
2559
|
}
|
|
@@ -2561,7 +2561,7 @@ function Bt(e, n, i) {
|
|
|
2561
2561
|
if (Array.isArray(u) && u.length) {
|
|
2562
2562
|
const t = [], o = u.length;
|
|
2563
2563
|
for (let s = 0; s < o; s++) {
|
|
2564
|
-
const a = s === o - 1 ? c :
|
|
2564
|
+
const a = s === o - 1 ? c : W({}, c), f = $t(u[s], a);
|
|
2565
2565
|
for (const t in u[s]) if ($(u[s], t)) {
|
|
2566
2566
|
a[("_symbol_" + t).trim()] = u[s][t];
|
|
2567
2567
|
}
|
|
@@ -2602,19 +2602,19 @@ function $t(t, e) {
|
|
|
2602
2602
|
n;
|
|
2603
2603
|
}
|
|
2604
2604
|
|
|
2605
|
-
let
|
|
2605
|
+
let Jt = 1;
|
|
2606
2606
|
|
|
2607
|
-
const
|
|
2607
|
+
const Xt = "_symbol_".trim(), Yt = "__fea_idx".trim();
|
|
2608
2608
|
|
|
2609
2609
|
let Zt = new Float32Array(1);
|
|
2610
2610
|
|
|
2611
2611
|
class Kt extends t.renderer.CanvasRenderer {
|
|
2612
2612
|
constructor(...t) {
|
|
2613
2613
|
super(...t), this.features = {}, this.je = {}, this.D = 0, this.De = {}, this.Ne = {},
|
|
2614
|
-
this.Re = {}, this.Le = {}, this.He = {}, this.Ve = !0, this.
|
|
2614
|
+
this.Re = {}, this.Le = {}, this.He = {}, this.Ve = !0, this.We = {
|
|
2615
2615
|
id: 0,
|
|
2616
2616
|
pickingId: 0
|
|
2617
|
-
}, this.
|
|
2617
|
+
}, this.Ue = W({}, Ht, Vt), this.Ge = {};
|
|
2618
2618
|
}
|
|
2619
2619
|
hasNoAARendering() {
|
|
2620
2620
|
return !0;
|
|
@@ -2626,13 +2626,13 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
2626
2626
|
draw(t, e) {
|
|
2627
2627
|
const n = this.layer;
|
|
2628
2628
|
if (this.prepareCanvas(), this.ft = this.pt(this.getMap().getGLRes()), this.Ve) this.buildMesh(),
|
|
2629
|
-
this.$e(), this.
|
|
2629
|
+
this.$e(), this.Je(), this.Ge = {}, this.Xe = !1, this.Ve = !1, this.Ye = !1; else if (this.Xe) {
|
|
2630
2630
|
const t = this.atlas, e = this.Ze, n = this.Ke;
|
|
2631
2631
|
delete this.atlas, delete this.Ze, delete this.Ke, this.buildMesh(t), this.$e(e),
|
|
2632
|
-
this.
|
|
2632
|
+
this.Je(n), this.Xe = !1, this.Ye = !1;
|
|
2633
2633
|
} else if (this.Ye) {
|
|
2634
2634
|
const t = this.Ke;
|
|
2635
|
-
delete this.Ke, this.
|
|
2635
|
+
delete this.Ke, this.Je(t), this.Ye = !1;
|
|
2636
2636
|
}
|
|
2637
2637
|
if (!this.meshes && !this.Qe && !this.tn) return void this.completeRender();
|
|
2638
2638
|
this.en && (this.nn(), this.en = !1), this.in(), this.dt = t, this.yt = e || {};
|
|
@@ -2672,7 +2672,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
2672
2672
|
cameraPosition: this.getMap().cameraPosition,
|
|
2673
2673
|
timestamp: this.getFrameTimestamp()
|
|
2674
2674
|
};
|
|
2675
|
-
return this.yt &&
|
|
2675
|
+
return this.yt && W(t, this.yt), t;
|
|
2676
2676
|
}
|
|
2677
2677
|
drawOnInteracting(t, e, n) {
|
|
2678
2678
|
this.draw(e, n);
|
|
@@ -2823,7 +2823,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
2823
2823
|
r.translate(a, a, i.set(d, s[0], s[1], 0)), r.scale(a, a, i.set(u, 1, 1, this.ft));
|
|
2824
2824
|
const l = this.qe.createMeshes(e, a);
|
|
2825
2825
|
for (let t = 0; t < l.length; t++) l[t].geometry.properties.originElements = l[t].geometry.properties.elements.slice(),
|
|
2826
|
-
l[t].properties.level = 0, l[t].material.set("flipY", 1), l[t].properties.meshKey =
|
|
2826
|
+
l[t].properties.level = 0, l[t].material.set("flipY", 1), l[t].properties.meshKey = Jt++;
|
|
2827
2827
|
this.Qe = l, h && (this.en = !0), this.vn = !1, this.setToRedraw();
|
|
2828
2828
|
});
|
|
2829
2829
|
}
|
|
@@ -2853,9 +2853,9 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
2853
2853
|
forceAltitudeAttribute: !0,
|
|
2854
2854
|
markerWidthType: Uint16Array,
|
|
2855
2855
|
markerHeightType: Uint16Array
|
|
2856
|
-
}, o =
|
|
2856
|
+
}, o = W({}, r);
|
|
2857
2857
|
r.allowEmptyPack = 1;
|
|
2858
|
-
return A.splitPointSymbol(this.
|
|
2858
|
+
return A.splitPointSymbol(this.Ue).map((n, i) => new A(0 === i ? t : e, n, 0 === i ? r : o).load());
|
|
2859
2859
|
}
|
|
2860
2860
|
updateMesh() {}
|
|
2861
2861
|
xn(t) {
|
|
@@ -2896,7 +2896,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
2896
2896
|
}), !0;
|
|
2897
2897
|
}
|
|
2898
2898
|
kn(t) {
|
|
2899
|
-
return this._n(t, this.tn, this.Ke, this.Sn, this.Be, S,
|
|
2899
|
+
return this._n(t, this.tn, this.Ke, this.Sn, this.Be, S, Wt, this.Tn);
|
|
2900
2900
|
}
|
|
2901
2901
|
_n(t, e, n, i, r, o, s, a) {
|
|
2902
2902
|
if (!e) return !1;
|
|
@@ -2921,7 +2921,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
2921
2921
|
if (n[0].geometry.properties.aFeaIds.indexOf(f) < 0) return this.An(), this.setToRedraw(),
|
|
2922
2922
|
!1;
|
|
2923
2923
|
}
|
|
2924
|
-
const m =
|
|
2924
|
+
const m = W({}, s), y = p.map(t => this.createVectorPacks(r, o, m, t, n[0], i));
|
|
2925
2925
|
return Promise.all(y).then(t => {
|
|
2926
2926
|
for (let n = 0; n < t.length; n++) {
|
|
2927
2927
|
let i;
|
|
@@ -2951,14 +2951,14 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
2951
2951
|
}
|
|
2952
2952
|
}), !0;
|
|
2953
2953
|
}
|
|
2954
|
-
|
|
2954
|
+
Je(t) {
|
|
2955
2955
|
if (!Object.keys(this.He).length) return void (this.tn && (this.Be.deleteMesh(this.tn),
|
|
2956
2956
|
delete this.tn));
|
|
2957
2957
|
const {features: e, center: n} = this.ln(this.He);
|
|
2958
2958
|
if (!e.length) return;
|
|
2959
2959
|
const i = this.en;
|
|
2960
2960
|
this.Sn = n;
|
|
2961
|
-
const r = this.Tn(e), o =
|
|
2961
|
+
const r = this.Tn(e), o = W({}, Wt), s = r.map((e, i) => this.createMesh(this.Be, S, o, e, t && t[i], n));
|
|
2962
2962
|
this.Mn = !0, Promise.all(s).then(t => {
|
|
2963
2963
|
this.tn && this.Be.deleteMesh(this.tn);
|
|
2964
2964
|
const e = [], n = [];
|
|
@@ -2976,7 +2976,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
2976
2976
|
});
|
|
2977
2977
|
}
|
|
2978
2978
|
Tn(t) {
|
|
2979
|
-
const e = (
|
|
2979
|
+
const e = (Xt + "lineDasharray").trim(), n = (Xt + "linePatternFile").trim(), i = [], r = [], o = [];
|
|
2980
2980
|
for (let s = 0; s < t.length; s++) {
|
|
2981
2981
|
const a = t[s], l = a.properties && a.properties[e];
|
|
2982
2982
|
l && se(l) ? o.push(a) : a.properties && a.properties[n] ? r.push(a) : i.push(a);
|
|
@@ -2984,7 +2984,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
2984
2984
|
return [ r, o, i ];
|
|
2985
2985
|
}
|
|
2986
2986
|
Pn() {
|
|
2987
|
-
this.
|
|
2987
|
+
this.Xe = !0, this.setToRedraw();
|
|
2988
2988
|
}
|
|
2989
2989
|
An() {
|
|
2990
2990
|
this.Ve = !0, this.setToRedraw();
|
|
@@ -3005,11 +3005,11 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
3005
3005
|
wn(t) {
|
|
3006
3006
|
void 0 === t[Gt] && (t[Gt] = this.D++);
|
|
3007
3007
|
const e = t[Gt];
|
|
3008
|
-
this.features[e] && this.
|
|
3008
|
+
this.features[e] && this.On(e), this.features[e] = Bt(t, this.We, this.features[e]);
|
|
3009
3009
|
const n = this.features[e];
|
|
3010
|
-
return this.
|
|
3010
|
+
return this.Cn(n, e), this.je[e] = t, e;
|
|
3011
3011
|
}
|
|
3012
|
-
|
|
3012
|
+
Cn(t, e) {
|
|
3013
3013
|
if (!t) return;
|
|
3014
3014
|
const n = Array.isArray(t) ? t[0].id : t.id;
|
|
3015
3015
|
if (this.Ne[n] = t, Array.isArray(t)) for (let n = 0; n < t.length; n++) {
|
|
@@ -3030,7 +3030,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
3030
3030
|
this.De[i] = n;
|
|
3031
3031
|
}
|
|
3032
3032
|
}
|
|
3033
|
-
|
|
3033
|
+
On(t) {
|
|
3034
3034
|
const e = this.features[t];
|
|
3035
3035
|
if (e) if (Array.isArray(e)) for (let t = 0; t < e.length; t++) {
|
|
3036
3036
|
const n = e[t][Yt], i = e[t].id;
|
|
@@ -3052,14 +3052,14 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
3052
3052
|
}
|
|
3053
3053
|
}), i;
|
|
3054
3054
|
}
|
|
3055
|
-
|
|
3055
|
+
En(t) {
|
|
3056
3056
|
const e = t[Gt], n = this.features[e];
|
|
3057
3057
|
return Array.isArray(n) ? n[0][Yt] : n[Yt];
|
|
3058
3058
|
}
|
|
3059
3059
|
in() {
|
|
3060
3060
|
let t = !1;
|
|
3061
3061
|
for (const e in this.Ge) {
|
|
3062
|
-
const n = this.Ge[e], i = this.
|
|
3062
|
+
const n = this.Ge[e], i = this.En(n);
|
|
3063
3063
|
if (!this.vn && (this.Re[i] || this.Le[i])) {
|
|
3064
3064
|
const e = this.xn(n);
|
|
3065
3065
|
t = t || e;
|
|
@@ -3068,7 +3068,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
3068
3068
|
const e = this.kn(n);
|
|
3069
3069
|
t = t || e;
|
|
3070
3070
|
}
|
|
3071
|
-
if (!this.
|
|
3071
|
+
if (!this.Fn) {
|
|
3072
3072
|
const e = this.updateMesh(n);
|
|
3073
3073
|
t = t || e;
|
|
3074
3074
|
}
|
|
@@ -3085,7 +3085,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
3085
3085
|
if (t && t.length) {
|
|
3086
3086
|
for (let e = 0; e < t.length; e++) {
|
|
3087
3087
|
const n = t[e][Gt];
|
|
3088
|
-
void 0 !== n && (delete this.je[n], this.
|
|
3088
|
+
void 0 !== n && (delete this.je[n], this.On(n), delete this.features[n]);
|
|
3089
3089
|
}
|
|
3090
3090
|
this.An(), Qt(this);
|
|
3091
3091
|
}
|
|
@@ -3149,7 +3149,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
3149
3149
|
}
|
|
3150
3150
|
onGeometryPropertiesChange(t) {
|
|
3151
3151
|
const e = t.target, n = e[Gt];
|
|
3152
|
-
this.features[n] = Bt(e, this.
|
|
3152
|
+
this.features[n] = Bt(e, this.We), this.Cn(this.features[n], n), this.An(), Qt(this);
|
|
3153
3153
|
}
|
|
3154
3154
|
createContext() {
|
|
3155
3155
|
const t = this.canvas.gl && this.canvas.gl.wrap;
|
|
@@ -3157,13 +3157,13 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
3157
3157
|
t && (this.canvas.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height)),
|
|
3158
3158
|
this.prepareRequestors(), this.pickingFBO = this.canvas.pickingFBO || this.regl.framebuffer(this.canvas.width, this.canvas.height),
|
|
3159
3159
|
this.painter = this.createPainter();
|
|
3160
|
-
const e = Lt.get3DPainterClass("icon"), n =
|
|
3160
|
+
const e = Lt.get3DPainterClass("icon"), n = W({}, Ht, Vt);
|
|
3161
3161
|
this.Nn(n, "markerBloom"), this.Nn(n, "textBloom");
|
|
3162
|
-
const i =
|
|
3162
|
+
const i = W({}, K, this.layer.options.sceneConfig || {});
|
|
3163
3163
|
this.qe = new e(this.regl, this.layer, n, i, 0), this.qe.setTextShaderDefines({
|
|
3164
3164
|
REVERSE_MAP_ROTATION_ON_PITCH: 1
|
|
3165
3165
|
});
|
|
3166
|
-
const r = Lt.get3DPainterClass("line"), o =
|
|
3166
|
+
const r = Lt.get3DPainterClass("line"), o = W({}, Wt);
|
|
3167
3167
|
this.Nn(o, "lineBloom"), this.Be = new r(this.regl, this.layer, o, this.layer.options.sceneConfig, 0),
|
|
3168
3168
|
this.layer.getGeometries() && this.onGeometryAdd(this.layer.getGeometries());
|
|
3169
3169
|
}
|
|
@@ -3247,7 +3247,7 @@ class Kt extends t.renderer.CanvasRenderer {
|
|
|
3247
3247
|
return "win-intel-gpu-crash" === t && (this.layer.options.workarounds["win-intel-gpu-crash"] && te(this.gl));
|
|
3248
3248
|
}
|
|
3249
3249
|
pt(t) {
|
|
3250
|
-
return
|
|
3250
|
+
return J(t, this.getMap());
|
|
3251
3251
|
}
|
|
3252
3252
|
}
|
|
3253
3253
|
|
|
@@ -3265,15 +3265,15 @@ function te(t) {
|
|
|
3265
3265
|
}
|
|
3266
3266
|
|
|
3267
3267
|
function ee({properties: t}) {
|
|
3268
|
-
const e = (
|
|
3268
|
+
const e = (Xt + "markerFile").trim(), n = (Xt + "markerType").trim();
|
|
3269
3269
|
return t[e] || t[n];
|
|
3270
3270
|
}
|
|
3271
3271
|
|
|
3272
3272
|
function ne({properties: t}) {
|
|
3273
|
-
return t[(
|
|
3273
|
+
return t[(Xt + "textName").trim()];
|
|
3274
3274
|
}
|
|
3275
3275
|
|
|
3276
|
-
const ie = (
|
|
3276
|
+
const ie = (Xt + "lineWidth").trim(), re = "_line_gradient_property".trim();
|
|
3277
3277
|
|
|
3278
3278
|
function oe(t) {
|
|
3279
3279
|
return 2 === t.type && !t.properties[re] && void 0 !== t.properties[ie] || 3 === t.type && void 0 !== t.properties[ie];
|
|
@@ -3287,9 +3287,9 @@ function se(t) {
|
|
|
3287
3287
|
}
|
|
3288
3288
|
|
|
3289
3289
|
function ae(t, e) {
|
|
3290
|
-
if (Object.keys(t).sort().join() !== Object.keys(e.properties || {}).filter(t => 0 === t.indexOf(
|
|
3290
|
+
if (Object.keys(t).sort().join() !== Object.keys(e.properties || {}).filter(t => 0 === t.indexOf(Xt)).map(t => t.substring(Xt.length)).sort().join()) return !1;
|
|
3291
3291
|
for (const n in t) if ($(t, n)) {
|
|
3292
|
-
const i = (
|
|
3292
|
+
const i = (Xt + n).trim();
|
|
3293
3293
|
if (p(t[n]) !== p(e.properties[i])) return !1;
|
|
3294
3294
|
}
|
|
3295
3295
|
return !0;
|
|
@@ -3353,9 +3353,9 @@ ue.registerRenderer("gl", class extends Kt {
|
|
|
3353
3353
|
}
|
|
3354
3354
|
createPainter() {
|
|
3355
3355
|
const t = Lt.get3DPainterClass("line-gradient");
|
|
3356
|
-
this.painterSymbol =
|
|
3356
|
+
this.painterSymbol = W({}, {
|
|
3357
3357
|
lineGradientProperty: de
|
|
3358
|
-
},
|
|
3358
|
+
}, Wt), this.Nn(this.painterSymbol, "lineBloom");
|
|
3359
3359
|
return new t(this.regl, this.layer, this.painterSymbol, this.layer.options.sceneConfig, 0);
|
|
3360
3360
|
}
|
|
3361
3361
|
buildMesh() {
|
|
@@ -3363,15 +3363,15 @@ ue.registerRenderer("gl", class extends Kt {
|
|
|
3363
3363
|
if (t = t.filter(t => !!t.properties[de]), !t.length) return;
|
|
3364
3364
|
const n = this.en;
|
|
3365
3365
|
this.Ln = e;
|
|
3366
|
-
const i =
|
|
3367
|
-
this.
|
|
3366
|
+
const i = W({}, this.painterSymbol), r = this.createMesh(this.painter, S, i, t, null, e);
|
|
3367
|
+
this.Fn = !0, r.then(t => {
|
|
3368
3368
|
this.meshes && this.painter.deleteMesh(this.meshes);
|
|
3369
3369
|
const e = [], i = t && t.meshes;
|
|
3370
3370
|
if (i) {
|
|
3371
3371
|
e.push(...i);
|
|
3372
3372
|
for (let t = 0; t < i.length; t++) i[t].feaGroupIndex = 0, i[t].geometry.properties.originElements = i[t].geometry.properties.elements.slice();
|
|
3373
3373
|
}
|
|
3374
|
-
this.meshes = e, n && (this.en = n), this.
|
|
3374
|
+
this.meshes = e, n && (this.en = n), this.Fn = !1, this.setToRedraw();
|
|
3375
3375
|
});
|
|
3376
3376
|
}
|
|
3377
3377
|
}), ue.registerRenderer("canvas", null);
|
|
@@ -3421,8 +3421,8 @@ fe.registerRenderer("gl", class extends Kt {
|
|
|
3421
3421
|
if (!e.length) return;
|
|
3422
3422
|
const i = this.en;
|
|
3423
3423
|
this.Ln = n;
|
|
3424
|
-
const r = this.Hn(e), o =
|
|
3425
|
-
this.
|
|
3424
|
+
const r = this.Hn(e), o = W({}, pe), s = r.map((e, i) => this.createMesh(this.painter, P, o, e, t && t[i], n));
|
|
3425
|
+
this.Fn = !0, Promise.all(s).then(t => {
|
|
3426
3426
|
this.meshes && this.painter.deleteMesh(this.meshes);
|
|
3427
3427
|
const e = [], n = [];
|
|
3428
3428
|
for (let i = 0; i < t.length; i++) {
|
|
@@ -3434,7 +3434,7 @@ fe.registerRenderer("gl", class extends Kt {
|
|
|
3434
3434
|
n[i] = t[i].atlas;
|
|
3435
3435
|
}
|
|
3436
3436
|
}
|
|
3437
|
-
this.meshes = e, this.atlas = n, i && (this.en = i), this.
|
|
3437
|
+
this.meshes = e, this.atlas = n, i && (this.en = i), this.Fn = !1, this.setToRedraw();
|
|
3438
3438
|
});
|
|
3439
3439
|
}
|
|
3440
3440
|
Hn(t) {
|
|
@@ -3447,7 +3447,7 @@ fe.registerRenderer("gl", class extends Kt {
|
|
|
3447
3447
|
}
|
|
3448
3448
|
createPainter() {
|
|
3449
3449
|
const t = Lt.get3DPainterClass("fill");
|
|
3450
|
-
this.painterSymbol =
|
|
3450
|
+
this.painterSymbol = W({}, pe), this.Nn(this.painterSymbol, "polygonBloom");
|
|
3451
3451
|
return new t(this.regl, this.layer, this.painterSymbol, this.layer.options.sceneConfig, 0);
|
|
3452
3452
|
}
|
|
3453
3453
|
updateMesh(t) {
|
|
@@ -3482,7 +3482,7 @@ function ve(t, e) {
|
|
|
3482
3482
|
}
|
|
3483
3483
|
this.Vn || (this.Vn = {});
|
|
3484
3484
|
const l = r.excludes;
|
|
3485
|
-
this.
|
|
3485
|
+
this.Wn ? l !== this.Wn && (this.Un = l ? D(l) : null, this.Wn = l) : l && (this.Wn = l),
|
|
3486
3486
|
a.startFrame(t), this.Gn = {};
|
|
3487
3487
|
},
|
|
3488
3488
|
updateCollision: function(t) {
|
|
@@ -3548,8 +3548,8 @@ function ve(t, e) {
|
|
|
3548
3548
|
});
|
|
3549
3549
|
if (d.length) {
|
|
3550
3550
|
const t = n.getRenderer().isEnableTileStencil();
|
|
3551
|
-
for (let n = 0; n < d.length; n++) d[n] && (h = !0, this.
|
|
3552
|
-
l.animation && (d.
|
|
3551
|
+
for (let n = 0; n < d.length; n++) d[n] && (h = !0, this.Jn(d[n], o, e.timestamp, ge++, t));
|
|
3552
|
+
l.animation && (d.Xn = e.timestamp);
|
|
3553
3553
|
const i = this.qn(e);
|
|
3554
3554
|
this.Vn[i] = d;
|
|
3555
3555
|
}
|
|
@@ -3579,8 +3579,8 @@ function ve(t, e) {
|
|
|
3579
3579
|
if (!this.Gn[l]) {
|
|
3580
3580
|
let e = null, n = r.animation;
|
|
3581
3581
|
if (n) {
|
|
3582
|
-
const i = t.sceneConfig.animationDuration || 800, r = (t.timestamp - h.
|
|
3583
|
-
h.
|
|
3582
|
+
const i = t.sceneConfig.animationDuration || 800, r = (t.timestamp - h.Xn) / i, o = h[0].properties.createTime;
|
|
3583
|
+
h.Xn - o < i && r < 1 && (!0 !== n && 1 !== n || (n = "linear"), e = "linear" === n ? r : j(n, r),
|
|
3584
3584
|
u = !0);
|
|
3585
3585
|
}
|
|
3586
3586
|
o.addMesh(h, e, t), this.Gn[l] = 1;
|
|
@@ -3590,7 +3590,7 @@ function ve(t, e) {
|
|
|
3590
3590
|
retire: a
|
|
3591
3591
|
};
|
|
3592
3592
|
},
|
|
3593
|
-
|
|
3593
|
+
Jn: function(t, e, n, i, r) {
|
|
3594
3594
|
if (t.properties.tileTransform = e, t.properties.createTime = n, t.properties.meshKey = i,
|
|
3595
3595
|
t.needUpdateShadow = !0, r) {
|
|
3596
3596
|
const e = t.defines || {};
|
|
@@ -3685,13 +3685,13 @@ function ve(t, e) {
|
|
|
3685
3685
|
},
|
|
3686
3686
|
Zn(t, e, n) {
|
|
3687
3687
|
const i = e.featureIndexes || e.data.featureIndexes;
|
|
3688
|
-
if (i) if (this.
|
|
3688
|
+
if (i) if (this.Un) {
|
|
3689
3689
|
const r = e.indices;
|
|
3690
3690
|
let o = null, s = !1;
|
|
3691
3691
|
const a = [];
|
|
3692
3692
|
for (let t = 0; t < r.length; t++) {
|
|
3693
3693
|
const e = n[i[r[t]]];
|
|
3694
|
-
null !== o && o === r[t] || (s = this.
|
|
3694
|
+
null !== o && o === r[t] || (s = this.Un(e.feature), o = r[t]), s || a.push(r[t]);
|
|
3695
3695
|
}
|
|
3696
3696
|
t.setElements(new e.indices.constructor(a));
|
|
3697
3697
|
} else t.setElements(e.indices);
|
|
@@ -3793,19 +3793,19 @@ function Ie(t, e, n) {
|
|
|
3793
3793
|
return 3 === i.length && 4 === e && i.push(1), t && (t[n] = i), i;
|
|
3794
3794
|
}
|
|
3795
3795
|
|
|
3796
|
-
function
|
|
3796
|
+
function Oe(t, e, n, i) {
|
|
3797
3797
|
if (t.fill) t.fill(e, n, i); else for (let r = n; r < i; r++) t[r] = e;
|
|
3798
3798
|
}
|
|
3799
3799
|
|
|
3800
|
-
function
|
|
3800
|
+
function Ce(t) {
|
|
3801
3801
|
return "number" == typeof t && !isNaN(t);
|
|
3802
3802
|
}
|
|
3803
3803
|
|
|
3804
|
-
function
|
|
3804
|
+
function Ee(t) {
|
|
3805
3805
|
return t && (t.markerFile || t.markerType) && void 0 !== t.textName;
|
|
3806
3806
|
}
|
|
3807
3807
|
|
|
3808
|
-
function
|
|
3808
|
+
function Fe(t, e) {
|
|
3809
3809
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
3810
3810
|
}
|
|
3811
3811
|
|
|
@@ -3867,7 +3867,7 @@ function Le(t, e, n) {
|
|
|
3867
3867
|
const {features: c, aPickingId: u} = o, d = function(t, e, n, i, r) {
|
|
3868
3868
|
const o = [];
|
|
3869
3869
|
let s = 0, a = e[0];
|
|
3870
|
-
for (let l = 1, h = e.length; l < h; l++) e[l] === a && l !== h - 1 || ((r ||
|
|
3870
|
+
for (let l = 1, h = e.length; l < h; l++) e[l] === a && l !== h - 1 || ((r || Ue(t[a].feature, n, i)) && o.push(s, l === h - 1 ? h : l),
|
|
3871
3871
|
a = e[l], s = l);
|
|
3872
3872
|
return o;
|
|
3873
3873
|
}(c, u, e[r].property, l, h);
|
|
@@ -3888,7 +3888,7 @@ function Ve(t, e, n, i, r) {
|
|
|
3888
3888
|
if (!je(o.properties.features)) {
|
|
3889
3889
|
for (let s = 0; s < n.length; s++) {
|
|
3890
3890
|
const a = n[s], l = a.attrName;
|
|
3891
|
-
if (!
|
|
3891
|
+
if (!We(o, e, a)) {
|
|
3892
3892
|
const {aPickingId: t} = o.properties;
|
|
3893
3893
|
if (!t || o.ti === r) continue;
|
|
3894
3894
|
const e = (De + l + "Index").trim(), n = o.properties[e];
|
|
@@ -3913,12 +3913,12 @@ function Ve(t, e, n, i, r) {
|
|
|
3913
3913
|
}
|
|
3914
3914
|
}
|
|
3915
3915
|
|
|
3916
|
-
function
|
|
3916
|
+
function We(t, e, n) {
|
|
3917
3917
|
const i = e[n.symbolName], r = t.Qn;
|
|
3918
3918
|
return i !== r[n.symbolName] && (r[n.symbolName] = i, !0);
|
|
3919
3919
|
}
|
|
3920
3920
|
|
|
3921
|
-
function
|
|
3921
|
+
function Ue(t, e, n) {
|
|
3922
3922
|
for (let i = 0; i < n.length; i++) if ("$" === e[0] && t[e.substring(1)] === n[i] || t.properties[e] === n[i]) return !0;
|
|
3923
3923
|
return !1;
|
|
3924
3924
|
}
|
|
@@ -3971,14 +3971,14 @@ function Be(t, e, n, i, r, o, s) {
|
|
|
3971
3971
|
for (let e = i * o; e < r * o; e += o) t.set(l, e);
|
|
3972
3972
|
t.dirty = !0;
|
|
3973
3973
|
}
|
|
3974
|
-
} else t[i] !== l && (
|
|
3974
|
+
} else t[i] !== l && (Oe(t, l, i, r), t.dirty = !0);
|
|
3975
3975
|
}
|
|
3976
3976
|
|
|
3977
3977
|
function $e(t) {
|
|
3978
3978
|
return I.isFnTypeSymbol(t);
|
|
3979
3979
|
}
|
|
3980
3980
|
|
|
3981
|
-
const {loginIBLResOnCanvas:
|
|
3981
|
+
const {loginIBLResOnCanvas: Je, logoutIBLResOnCanvas: Xe, getIBLResOnCanvas: Ye} = n.pbr.PBRUtils, Ze = [], Ke = [], Qe = [], tn = t => 0 === t.properties.level, en = t => t.properties.level > 0;
|
|
3982
3982
|
|
|
3983
3983
|
class nn {
|
|
3984
3984
|
constructor(t, e, i, r, o, s) {
|
|
@@ -4027,7 +4027,7 @@ class nn {
|
|
|
4027
4027
|
return this.oi;
|
|
4028
4028
|
}
|
|
4029
4029
|
needToRetireFrames() {
|
|
4030
|
-
return this.
|
|
4030
|
+
return this.X;
|
|
4031
4031
|
}
|
|
4032
4032
|
fillIncludes(t, e, n) {
|
|
4033
4033
|
const i = n && n.includes;
|
|
@@ -4139,7 +4139,7 @@ class nn {
|
|
|
4139
4139
|
};
|
|
4140
4140
|
}
|
|
4141
4141
|
setToRedraw(t) {
|
|
4142
|
-
t && (this.
|
|
4142
|
+
t && (this.X = t), this.oi = !0;
|
|
4143
4143
|
}
|
|
4144
4144
|
callShader(t, e) {
|
|
4145
4145
|
this.callCurrentTileShader(t, e), this.callBackgroundTileShader(t, e);
|
|
@@ -4234,7 +4234,7 @@ class nn {
|
|
|
4234
4234
|
}
|
|
4235
4235
|
startFrame(t) {
|
|
4236
4236
|
this.ci || (this.init(t), this.ci = !0), this.ct !== t.timestamp && (this.oi = !1,
|
|
4237
|
-
this.
|
|
4237
|
+
this.X = !1), this.scene.clear();
|
|
4238
4238
|
}
|
|
4239
4239
|
resize() {}
|
|
4240
4240
|
delete() {
|
|
@@ -4259,9 +4259,9 @@ class nn {
|
|
|
4259
4259
|
return delete this.fi, this.setToRedraw(n), i;
|
|
4260
4260
|
}
|
|
4261
4261
|
pi(t, e) {
|
|
4262
|
-
for (const n in e) if (
|
|
4262
|
+
for (const n in e) if (Fe(e, n)) {
|
|
4263
4263
|
if (I.isFnTypeSymbol(e[n]) && !this.layer.options.features && (!t[n] || t[n].property !== e[n].property)) return !0;
|
|
4264
|
-
if (
|
|
4264
|
+
if (O[n] && !F(e[n], t[n])) return !0;
|
|
4265
4265
|
}
|
|
4266
4266
|
return !1;
|
|
4267
4267
|
}
|
|
@@ -4271,7 +4271,7 @@ class nn {
|
|
|
4271
4271
|
this.symbolDef[t] = _e(n);
|
|
4272
4272
|
const r = this.mi[t];
|
|
4273
4273
|
for (const t in r) delete r[t];
|
|
4274
|
-
const o = this.getMap(), s = [], a =
|
|
4274
|
+
const o = this.getMap(), s = [], a = C.loadSymbolFnTypes(this.symbolDef[t], () => (s[0] = o.getZoom(),
|
|
4275
4275
|
s));
|
|
4276
4276
|
for (const t in a) {
|
|
4277
4277
|
const e = Object.getOwnPropertyDescriptor(a, t);
|
|
@@ -4297,7 +4297,7 @@ class nn {
|
|
|
4297
4297
|
ii() {
|
|
4298
4298
|
const t = this.getMap(), e = [], n = () => (e[0] = t.getZoom(), e);
|
|
4299
4299
|
this.mi = [], this.ri = [];
|
|
4300
|
-
for (let t = 0; t < this.symbolDef.length; t++) this.mi[t] =
|
|
4300
|
+
for (let t = 0; t < this.symbolDef.length; t++) this.mi[t] = C.loadSymbolFnTypes(xe({}, this.symbolDef[t]), n),
|
|
4301
4301
|
this.symbolDef[t] && p(this.symbolDef[t].visible) && (this.ri[t] = y(this.symbolDef[t].visible));
|
|
4302
4302
|
}
|
|
4303
4303
|
getFnTypeConfig(t) {
|
|
@@ -4320,7 +4320,7 @@ class nn {
|
|
|
4320
4320
|
}
|
|
4321
4321
|
logoutTextureCache() {
|
|
4322
4322
|
const t = "__gl_textures".trim(), e = this.getMap(), n = this.gi;
|
|
4323
|
-
if (n) for (const i in n)
|
|
4323
|
+
if (n) for (const i in n) Fe(n, i) && e[t][i] && (e[t][i].count--, e[t][i].count <= 0 && delete e[t][i]);
|
|
4324
4324
|
e[t].count--, e[t].count <= 0 && (e[t] = {});
|
|
4325
4325
|
}
|
|
4326
4326
|
getCachedTexture(t) {
|
|
@@ -4468,11 +4468,11 @@ class nn {
|
|
|
4468
4468
|
}
|
|
4469
4469
|
createIBLTextures() {
|
|
4470
4470
|
const t = this.layer.getRenderer().canvas;
|
|
4471
|
-
|
|
4471
|
+
Je(t, this.regl, this.getMap()), this.setToRedraw(!0), this.layer.fire("iblupdated");
|
|
4472
4472
|
}
|
|
4473
4473
|
disposeIBLTextures() {
|
|
4474
4474
|
const t = this.layer.getRenderer().canvas;
|
|
4475
|
-
|
|
4475
|
+
Xe(t, this.getMap());
|
|
4476
4476
|
}
|
|
4477
4477
|
evaluateInFnTypeConfig(t, e, n, i, r) {
|
|
4478
4478
|
let o = this.Si;
|
|
@@ -4724,7 +4724,7 @@ class un extends sn {
|
|
|
4724
4724
|
if (!ke(this.sceneConfig.depthMask)) return !!this.sceneConfig.depthMask;
|
|
4725
4725
|
if (e.meshConfig.transparent) return !1;
|
|
4726
4726
|
const n = e.polygonOpacity;
|
|
4727
|
-
return !(
|
|
4727
|
+
return !(Ce(n) && n < 1);
|
|
4728
4728
|
},
|
|
4729
4729
|
func: this.sceneConfig.depthFunc || "<="
|
|
4730
4730
|
},
|
|
@@ -4834,7 +4834,7 @@ class fn extends sn {
|
|
|
4834
4834
|
});
|
|
4835
4835
|
d.setLocalTransform(e), d.positionMatrix = this.getAltitudeOffsetMatrix();
|
|
4836
4836
|
const f = {};
|
|
4837
|
-
return h && (f.HAS_PATTERN = 1), d.properties.symbolIndex = r, this.
|
|
4837
|
+
return h && (f.HAS_PATTERN = 1), d.properties.symbolIndex = r, this.Oi(d, f), i.data.aColor && (f.HAS_COLOR = 1),
|
|
4838
4838
|
i.data.aStrokeColor && (f.HAS_STROKE_COLOR = 1), this.setMeshDefines(f, i, s), i.data.aAltitude && (f.HAS_ALTITUDE = 1),
|
|
4839
4839
|
d.setDefines(f), d;
|
|
4840
4840
|
}
|
|
@@ -4842,15 +4842,15 @@ class fn extends sn {
|
|
|
4842
4842
|
delete this.Ii;
|
|
4843
4843
|
const e = t[0];
|
|
4844
4844
|
Array.isArray(e) && e.forEach(t => {
|
|
4845
|
-
this.
|
|
4845
|
+
this.Ci(t);
|
|
4846
4846
|
}), super.addMesh(...t);
|
|
4847
4847
|
}
|
|
4848
|
-
|
|
4848
|
+
Ci(t) {
|
|
4849
4849
|
if (!t.geometry.aLineWidth && t.material.get("lineWidth") <= 0 || !t.geometry.aOpacity && t.material.get("lineOpacity") <= 0) return;
|
|
4850
4850
|
const e = t.defines;
|
|
4851
|
-
this.
|
|
4851
|
+
this.Oi(t, e), t.setDefines(e), t.geometry.properties.hasPatternAnim && (this.Ii = 1);
|
|
4852
4852
|
}
|
|
4853
|
-
|
|
4853
|
+
Oi(t, e) {
|
|
4854
4854
|
const n = t.geometry, i = this.getSymbol(t.properties.symbolIndex);
|
|
4855
4855
|
n.data.aDasharray || Array.isArray(i.lineDasharray) && i.lineDasharray.reduce((t, e) => t + e, 0) > 0 ? (e.HAS_DASHARRAY = 1,
|
|
4856
4856
|
n.data.aDasharray && (e.HAS_DASHARRAY_ATTR = 1), n.data.aDashColor && (e.HAS_DASHARRAY_COLOR = 1)) : e.HAS_DASHARRAY && delete e.HAS_DASHARRAY;
|
|
@@ -4965,7 +4965,7 @@ class fn extends sn {
|
|
|
4965
4965
|
} ];
|
|
4966
4966
|
}
|
|
4967
4967
|
updateSceneConfig(t) {
|
|
4968
|
-
t.trailAnimation && this.createShader(this.
|
|
4968
|
+
t.trailAnimation && this.createShader(this.Ei);
|
|
4969
4969
|
}
|
|
4970
4970
|
init(t) {
|
|
4971
4971
|
const e = this.regl;
|
|
@@ -4983,7 +4983,7 @@ class fn extends sn {
|
|
|
4983
4983
|
}, this.pickingFBO, this.getMap()) ]);
|
|
4984
4984
|
}
|
|
4985
4985
|
createShader(t) {
|
|
4986
|
-
this.
|
|
4986
|
+
this.Ei = t;
|
|
4987
4987
|
const e = [], i = {};
|
|
4988
4988
|
this.fillIncludes(i, e, t), this.sceneConfig.trailAnimation && this.sceneConfig.trailAnimation.enable && (i.HAS_TRAIL = 1),
|
|
4989
4989
|
e.push({
|
|
@@ -5112,7 +5112,7 @@ class pn extends fn {
|
|
|
5112
5112
|
return this.createShapeFnTypeConfigs(t, e);
|
|
5113
5113
|
}
|
|
5114
5114
|
createShader(t) {
|
|
5115
|
-
this.
|
|
5115
|
+
this.Ei = t;
|
|
5116
5116
|
const e = [], i = {};
|
|
5117
5117
|
this.fillIncludes(i, e, t), this.sceneConfig.trailAnimation && this.sceneConfig.trailAnimation.enable && (i.HAS_TRAIL = 1),
|
|
5118
5118
|
e.push({
|
|
@@ -5185,7 +5185,7 @@ class Sn extends sn {
|
|
|
5185
5185
|
return e || void 0 === e ? "point" === t : "fxaa" === t || "fxaaAfterTaa" === t;
|
|
5186
5186
|
}
|
|
5187
5187
|
startMeshCollision(t) {
|
|
5188
|
-
const {meshKey: e} = t.properties, {renderer: n} = this.
|
|
5188
|
+
const {meshKey: e} = t.properties, {renderer: n} = this.Fi, i = n.isForeground(t instanceof vn ? t.meshes[0] : t);
|
|
5189
5189
|
if (t.properties.isForeground = i, t instanceof vn && t.meshes.length) for (let e = 0; e < t.meshes.length; e++) t.meshes[e].properties.isForeground = i;
|
|
5190
5190
|
this.zi = performance.now(), this.ji = this.Di(), this.Ni = this.Ri(e);
|
|
5191
5191
|
}
|
|
@@ -5199,15 +5199,15 @@ class Sn extends sn {
|
|
|
5199
5199
|
this.getMap().collisionFrameTime += performance.now() - this.zi;
|
|
5200
5200
|
}
|
|
5201
5201
|
Ri(t) {
|
|
5202
|
-
const e = this.getMap(), n = e.getZoom(), [i, r] = this.
|
|
5202
|
+
const e = this.getMap(), n = e.getZoom(), [i, r] = this.Wi(t);
|
|
5203
5203
|
return !i || !r || i.z !== n || i.width !== e.width || i.height !== e.height || i.distanceTo(this.Hi) > 2 || r.distanceTo(this.Vi) > 2;
|
|
5204
5204
|
}
|
|
5205
|
-
|
|
5205
|
+
Ui() {
|
|
5206
5206
|
const e = this.getMap();
|
|
5207
5207
|
this.Gi = {}, this.Hi = new t.Point(e.width / 2, e.height / 3), this.Vi = new t.Point(e.width / 2, 2 * e.height / 3),
|
|
5208
5208
|
delete this.ji, this.Li || (this.Li = {
|
|
5209
5209
|
tags: {}
|
|
5210
|
-
}), this.
|
|
5210
|
+
}), this.Fi = {
|
|
5211
5211
|
layer: this.layer,
|
|
5212
5212
|
renderer: this.layer.getRenderer(),
|
|
5213
5213
|
frameTimestamp: this.layer.getRenderer().getFrameTimestamp(),
|
|
@@ -5224,7 +5224,7 @@ class Sn extends sn {
|
|
|
5224
5224
|
const n = this.Li;
|
|
5225
5225
|
return n.tags[t] && n.tags[t][e];
|
|
5226
5226
|
}
|
|
5227
|
-
|
|
5227
|
+
Ji(t, e, n) {
|
|
5228
5228
|
const i = this.Li;
|
|
5229
5229
|
i.tags[t] = i.tags[t] || [], i.tags[t][e] = n;
|
|
5230
5230
|
}
|
|
@@ -5234,7 +5234,7 @@ class Sn extends sn {
|
|
|
5234
5234
|
const e = this.layer.options.collisionFrameLimit;
|
|
5235
5235
|
return t.collisionFrameTime <= e;
|
|
5236
5236
|
}
|
|
5237
|
-
|
|
5237
|
+
Wi(t) {
|
|
5238
5238
|
const e = "__meshAnchorKey".trim(), n = this.Li.tags[t];
|
|
5239
5239
|
if (n && n.anchor0) {
|
|
5240
5240
|
const {anchor0: t, anchor1: i} = n, r = t[e] = t[e] || t.x + "," + t.y, o = i[e] = i[e] || i.x + "," + i.y;
|
|
@@ -5249,8 +5249,8 @@ class Sn extends sn {
|
|
|
5249
5249
|
return kn[0] = kn[1] = null, kn;
|
|
5250
5250
|
}
|
|
5251
5251
|
updateBoxCollisionFading(t, e, n, i, r) {
|
|
5252
|
-
const {layer: o, renderer: s, zoom: a, collisionTags: l, isEnableUniquePlacement: h} = this.
|
|
5253
|
-
if (h && this.
|
|
5252
|
+
const {layer: o, renderer: s, zoom: a, collisionTags: l, isEnableUniquePlacement: h} = this.Fi, {meshKey: c, isForeground: u} = e.properties;
|
|
5253
|
+
if (h && this.Xi(c, r)) return !1;
|
|
5254
5254
|
const d = n.length;
|
|
5255
5255
|
let f = l[c] && l[c][r];
|
|
5256
5256
|
const p = f, m = this.Yi && f;
|
|
@@ -5283,7 +5283,7 @@ class Sn extends sn {
|
|
|
5283
5283
|
const {mesh: o, allElements: s, boxCount: a, start: l, end: h} = n[e], c = this.Zi(o, s, a, l, h, i, r);
|
|
5284
5284
|
c.isAllowOverlap && (f.isAllowOverlap = 1), 0 === t && (t = c.collides), c.boxes && f.boxes.push(...c.boxes);
|
|
5285
5285
|
}
|
|
5286
|
-
f.collides = t, this.
|
|
5286
|
+
f.collides = t, this.Ji(c, r, f);
|
|
5287
5287
|
}
|
|
5288
5288
|
}
|
|
5289
5289
|
let y = t && f && 0 === f.collides, g = 1, v = !1;
|
|
@@ -5333,7 +5333,7 @@ class Sn extends sn {
|
|
|
5333
5333
|
}
|
|
5334
5334
|
}
|
|
5335
5335
|
isBoxFading(t, e) {
|
|
5336
|
-
const {frameTimestamp: n} = this.
|
|
5336
|
+
const {frameTimestamp: n} = this.Fi;
|
|
5337
5337
|
let i = this.sceneConfig.fadingDuration;
|
|
5338
5338
|
ke(i) && (i = bn);
|
|
5339
5339
|
return n - Math.abs(this.Ki(t)[e]) < i;
|
|
@@ -5364,7 +5364,7 @@ class Sn extends sn {
|
|
|
5364
5364
|
er(t, e, n, i) {
|
|
5365
5365
|
let {fadingDuration: r, fadeInDelay: o, fadeOutDelay: s} = this.sceneConfig;
|
|
5366
5366
|
ke(r) && (r = bn), ke(o) && (o = xn), ke(s) && (s = wn);
|
|
5367
|
-
const {frameTimestamp: a} = this.
|
|
5367
|
+
const {frameTimestamp: a} = this.Fi;
|
|
5368
5368
|
let l = n[i], h = e ? 1 : 0;
|
|
5369
5369
|
if (!l) return e && t && (n[i] = a + o), 0;
|
|
5370
5370
|
if (a < Math.abs(l) && (!e && l > 0 || e && l < 0)) {
|
|
@@ -5379,7 +5379,7 @@ class Sn extends sn {
|
|
|
5379
5379
|
this.ar || (this.ar = {});
|
|
5380
5380
|
const {meshKey: e} = t.properties;
|
|
5381
5381
|
if (!this.ar[e]) {
|
|
5382
|
-
const {frameTimestamp: t} = this.
|
|
5382
|
+
const {frameTimestamp: t} = this.Fi;
|
|
5383
5383
|
this.ar[e] = {
|
|
5384
5384
|
timestamp: t
|
|
5385
5385
|
};
|
|
@@ -5399,7 +5399,7 @@ class Sn extends sn {
|
|
|
5399
5399
|
}
|
|
5400
5400
|
nr(t, e) {
|
|
5401
5401
|
if (!t) return;
|
|
5402
|
-
const {frameTimestamp: n} = this.
|
|
5402
|
+
const {frameTimestamp: n} = this.Fi;
|
|
5403
5403
|
let {fadingDuration: i} = this.sceneConfig;
|
|
5404
5404
|
ke(i) && (i = bn), t[e] = -(n - i - 1);
|
|
5405
5405
|
}
|
|
@@ -5449,7 +5449,7 @@ class Sn extends sn {
|
|
|
5449
5449
|
return this.isEnableCollision() || this.Bi;
|
|
5450
5450
|
}
|
|
5451
5451
|
updateCollision(t) {
|
|
5452
|
-
super.updateCollision(t), this.
|
|
5452
|
+
super.updateCollision(t), this.Ui(), this.gr(), this.vr && this.vr.length && (this.br(),
|
|
5453
5453
|
this.vr && (this.setToRedraw(), this.scene.addMesh(this.vr)));
|
|
5454
5454
|
(this.getMap().isZooming() || this.vr && this.vr.length) && (this.xr(), this.wr(this.scene.getMeshes()));
|
|
5455
5455
|
}
|
|
@@ -5586,7 +5586,7 @@ class Sn extends sn {
|
|
|
5586
5586
|
const {key: e, index: o} = s[t], a = this.Ki(n), l = Tn(e, i), h = r[l];
|
|
5587
5587
|
if (h) {
|
|
5588
5588
|
const t = h.length, e = h[t - 3].properties.meshKey, i = h[t - 2], r = h[t - 1];
|
|
5589
|
-
this.Ir[e] = this.Ir[e] || {}, this.Ir[e][r] = 1, this.
|
|
5589
|
+
this.Ir[e] = this.Ir[e] || {}, this.Ir[e][r] = 1, this.Or(a, o, i, r), h.push(n, a, o);
|
|
5590
5590
|
} else r[l] = [ n, a, o ];
|
|
5591
5591
|
}
|
|
5592
5592
|
}
|
|
@@ -5599,16 +5599,16 @@ class Sn extends sn {
|
|
|
5599
5599
|
}
|
|
5600
5600
|
}
|
|
5601
5601
|
}
|
|
5602
|
-
|
|
5602
|
+
Or(t, e, n, i) {
|
|
5603
5603
|
if (void 0 !== n[i]) if (void 0 === t[e]) t[e] = n[i]; else {
|
|
5604
5604
|
let r = t[e];
|
|
5605
5605
|
Math.abs(n[i]) > Math.abs(r) ? t[e] = n[i] : n[i] = t[e];
|
|
5606
5606
|
} else void 0 !== t[e] && (n[i] = t[e]);
|
|
5607
5607
|
}
|
|
5608
|
-
|
|
5608
|
+
Xi(t, e) {
|
|
5609
5609
|
return this.Ir && this.Ir[t] && this.Ir[t][e];
|
|
5610
5610
|
}
|
|
5611
|
-
|
|
5611
|
+
Cr(t, e) {
|
|
5612
5612
|
const {symbolIndex: n} = t.properties, i = n.type || 0;
|
|
5613
5613
|
let r = t.properties._collidesBoxes;
|
|
5614
5614
|
r || (r = t.properties._collidesBoxes = []);
|
|
@@ -5626,9 +5626,9 @@ class Sn extends sn {
|
|
|
5626
5626
|
}
|
|
5627
5627
|
return o[s];
|
|
5628
5628
|
}
|
|
5629
|
-
|
|
5630
|
-
let e = this.
|
|
5631
|
-
if (e || (e = this.
|
|
5629
|
+
Er(t) {
|
|
5630
|
+
let e = this.Fr;
|
|
5631
|
+
if (e || (e = this.Fr = []), !e[t]) {
|
|
5632
5632
|
e[t] = [];
|
|
5633
5633
|
for (let n = 0; n < t; n++) e[t][n] = {};
|
|
5634
5634
|
}
|
|
@@ -5655,21 +5655,21 @@ var Pn = "#include <gl2_vert>\n#define SHADER_NAME MARKER\n#define RAD 0.0174532
|
|
|
5655
5655
|
|
|
5656
5656
|
const In = [];
|
|
5657
5657
|
|
|
5658
|
-
function
|
|
5658
|
+
function On(t, e, n, i, r) {
|
|
5659
5659
|
return l.set(In, e[0], e[1], e[2], 1), l.transformMat4(In, In, n), t[2] = In[3],
|
|
5660
5660
|
l.scale(In, In, 1 / In[3]), t[0] = (In[0] + 1) * i / 2, t[1] = (1 - In[1]) * r / 2,
|
|
5661
5661
|
t;
|
|
5662
5662
|
}
|
|
5663
5663
|
|
|
5664
|
-
const
|
|
5664
|
+
const Cn = [], En = [], Fn = [], zn = [], jn = [], Dn = [];
|
|
5665
5665
|
|
|
5666
5666
|
function Nn(t, e, n, r, o, s, a, h, u, d, f, p, m, y) {
|
|
5667
5667
|
const {tileRatio: g, tileResolution: v} = u, b = g / (v / d.getResolution()) * (f / d.cameraToCenterDistance) * p;
|
|
5668
|
-
c.scale(n, n, b), c.scale(r, r, b), c.scale(o, o, b), c.scale(s, s, b), i.set(
|
|
5669
|
-
i.set(
|
|
5670
|
-
i.set(zn, s[0], s[1], m ? s[2] / y : 0), i.add(
|
|
5671
|
-
i.add(zn, zn, e),
|
|
5672
|
-
|
|
5668
|
+
c.scale(n, n, b), c.scale(r, r, b), c.scale(o, o, b), c.scale(s, s, b), i.set(Cn, n[0], n[1], m ? n[2] / y : 0),
|
|
5669
|
+
i.set(En, r[0], r[1], m ? r[2] / y : 0), i.set(Fn, o[0], o[1], m ? o[2] / y : 0),
|
|
5670
|
+
i.set(zn, s[0], s[1], m ? s[2] / y : 0), i.add(Cn, Cn, e), i.add(En, En, e), i.add(Fn, Fn, e),
|
|
5671
|
+
i.add(zn, zn, e), On(n, Cn, a, d.width, d.height), On(r, En, a, d.width, d.height),
|
|
5672
|
+
On(o, Fn, a, d.width, d.height), On(s, zn, a, d.width, d.height), c.set(jn, Math.min(n[0], r[0], o[0], s[0]), Math.min(n[1], r[1], o[1], s[1])),
|
|
5673
5673
|
c.set(Dn, Math.max(n[0], r[0], o[0], s[0]), Math.max(n[1], r[1], o[1], s[1])), l.set(t, jn[0] + h[0], jn[1] + h[1], Dn[0] + h[0], Dn[1] + h[1]);
|
|
5674
5674
|
}
|
|
5675
5675
|
|
|
@@ -5685,41 +5685,41 @@ function Ln(t, e, n, i, r) {
|
|
|
5685
5685
|
return h.set(t, s, -o, o, s);
|
|
5686
5686
|
}
|
|
5687
5687
|
|
|
5688
|
-
const Hn = [], Vn = [],
|
|
5688
|
+
const Hn = [], Vn = [], Wn = [], Un = [], Gn = [], qn = [], Bn = [], $n = [], Jn = [ 1, -1 ], Xn = [ 1, 1 ];
|
|
5689
5689
|
|
|
5690
5690
|
function Yn(t, e, n, r, o) {
|
|
5691
5691
|
const s = e.material.uniforms, a = o.cameraToCenterDistance, l = e.geometry.properties, h = this.getSymbol(l.symbolIndex), u = e.geometry.desc.positionSize, d = l.aAnchor, f = i.set(Hn, d[n * u], d[n * u + 1], 2 === u ? 0 : d[n * u + 2]);
|
|
5692
|
-
let p =
|
|
5692
|
+
let p = On(Vn, f, r, o.width, o.height);
|
|
5693
5693
|
const m = p[2];
|
|
5694
5694
|
let y = 1;
|
|
5695
5695
|
if (s.markerPerspectiveRatio) {
|
|
5696
5696
|
y = we(.5 + .5 * (1 - (1 - a / m) * s.markerPerspectiveRatio), 0, 4);
|
|
5697
5697
|
}
|
|
5698
5698
|
const {aShape: g, aMarkerDx: v, aMarkerDy: b, aMarkerWidth: x, aMarkerHeight: w, aPitchAlign: A, aRotationAlign: k, aRotation: _} = l, S = v ? v[n] : h.markerDx, T = b ? b[n] : h.markerDy, M = A ? A[n] : s.pitchWithMap, P = k ? k[n] : s.rotateWithMap, I = c.set($n, S || 0, -(T || 0));
|
|
5699
|
-
let
|
|
5700
|
-
0 === s.flipY && 1 === M && (c.multiply(
|
|
5701
|
-
c.multiply(
|
|
5699
|
+
let O = c.set(Un, g[2 * n] / 10, g[2 * n + 1] / 10), C = c.set(Gn, g[2 * n + 2] / 10, g[2 * n + 3] / 10), E = c.set(qn, g[2 * n + 4] / 10, g[2 * n + 5] / 10), F = c.set(Bn, g[2 * n + 6] / 10, g[2 * n + 7] / 10);
|
|
5700
|
+
0 === s.flipY && 1 === M && (c.multiply(O, O, Jn), c.multiply(C, C, Jn), c.multiply(E, E, Jn),
|
|
5701
|
+
c.multiply(F, F, Jn));
|
|
5702
5702
|
let z = x ? x[n] : h.markerWidth;
|
|
5703
5703
|
ke(z) && (z = 15);
|
|
5704
5704
|
let j = w ? w[n] : h.markerHeight;
|
|
5705
5705
|
ke(j) && (j = 15);
|
|
5706
|
-
const D = c.set(
|
|
5707
|
-
c.mul(
|
|
5706
|
+
const D = c.set(Xn, z / 2048, j / 2048);
|
|
5707
|
+
c.mul(O, O, D), c.mul(C, C, D), c.mul(E, E, D), c.mul(F, F, D);
|
|
5708
5708
|
const N = -(_ ? _[n] / 9362 : -(h.markerRotation || 0) * Math.PI / 180), R = o.getBearing() * Math.PI / 180;
|
|
5709
5709
|
if (R * P || N) {
|
|
5710
|
-
const t = Ln(
|
|
5711
|
-
|
|
5712
|
-
|
|
5710
|
+
const t = Ln(Wn, N, R, P, M);
|
|
5711
|
+
O = c.transformMat2(O, O, t), C = c.transformMat2(C, C, t), E = c.transformMat2(E, E, t),
|
|
5712
|
+
F = c.transformMat2(F, F, t);
|
|
5713
5713
|
}
|
|
5714
|
-
return 1 === M ? Nn(t, f, C,
|
|
5715
|
-
c.multiply(
|
|
5714
|
+
return 1 === M ? Nn(t, f, O, C, E, F, r, I, s, o, m, y) : (c.multiply(O, O, Jn),
|
|
5715
|
+
c.multiply(C, C, Jn), c.multiply(E, E, Jn), c.multiply(F, F, Jn), Rn(t, p, O, C, E, F, I, y)),
|
|
5716
5716
|
t;
|
|
5717
5717
|
}
|
|
5718
5718
|
|
|
5719
5719
|
const Zn = [], Kn = [], Qn = [], ti = [], ei = [], ni = [], ii = [ 1, -1 ];
|
|
5720
5720
|
|
|
5721
5721
|
function ri(t, e, n, r, o, s, a, l, h) {
|
|
5722
|
-
const u = r.material.uniforms, d = h.cameraToCenterDistance, f = r.geometry.properties, p = this.getSymbol(f.symbolIndex), m = "line" === p.textPlacement && !
|
|
5722
|
+
const u = r.material.uniforms, d = h.cameraToCenterDistance, f = r.geometry.properties, p = this.getSymbol(f.symbolIndex), m = "line" === p.textPlacement && !Ee(p), y = n[2];
|
|
5723
5723
|
let g = 1;
|
|
5724
5724
|
if (u.textPerspectiveRatio) {
|
|
5725
5725
|
g = we(.5 + .5 * (1 - (1 - d / y) * u.textPerspectiveRatio), 0, 4);
|
|
@@ -5732,7 +5732,7 @@ function ri(t, e, n, r, o, s, a, l, h) {
|
|
|
5732
5732
|
m = i.set(ti, r[3 * a + 6] / 10, r[3 * a + 7] / 10, r[3 * a + 8] / 10), v = i.set(ei, r[3 * a + 9] / 10, r[3 * a + 10] / 10, r[3 * a + 11] / 10)) : (d = c.set(Kn, r[2 * a] / 10, r[2 * a + 1] / 10),
|
|
5733
5733
|
p = c.set(Qn, r[2 * a + 2] / 10, r[2 * a + 3] / 10), m = c.set(ti, r[2 * a + 4] / 10, r[2 * a + 5] / 10),
|
|
5734
5734
|
v = c.set(ei, r[2 * a + 6] / 10, r[2 * a + 7] / 10)), 1 === S) {
|
|
5735
|
-
const n =
|
|
5735
|
+
const n = J(h.getResolution(), h);
|
|
5736
5736
|
Nn(t, e, d, p, m, v, l, M, u, h, y, g, s, n);
|
|
5737
5737
|
} else c.multiply(d, d, ii), c.multiply(p, p, ii), c.multiply(m, m, ii), c.multiply(v, v, ii),
|
|
5738
5738
|
Rn(t, n, d, p, m, v, M, g);
|
|
@@ -5875,7 +5875,7 @@ function ai(t, e, i, r, o, s, a, l, h) {
|
|
|
5875
5875
|
}
|
|
5876
5876
|
|
|
5877
5877
|
function li(t, e, n) {
|
|
5878
|
-
const i = this.getSymbol(t.properties.symbolIndex), r = "line" === t.properties.textPlacement && !
|
|
5878
|
+
const i = this.getSymbol(t.properties.symbolIndex), r = "line" === t.properties.textPlacement && !Ee(i), {aPosition: o, aShape: s} = t.data, a = o.length / t.desc.positionSize;
|
|
5879
5879
|
if (t.properties.aPickingId = t.data.aPickingId, t.properties.aCount = t.data.aCount,
|
|
5880
5880
|
delete t.data.aCount, (e || r) && (t.properties.aAnchor = o, t.properties.aShape = s),
|
|
5881
5881
|
t.properties.visElemts || (t.properties.elements = t.elements, t.properties.visElemts = new t.elements.constructor(t.elements.length)),
|
|
@@ -6106,10 +6106,10 @@ const di = [], fi = [], pi = [], mi = [];
|
|
|
6106
6106
|
|
|
6107
6107
|
function yi(t, e, n, i, r, o, s) {
|
|
6108
6108
|
t = 1 === t ? 1 : 0;
|
|
6109
|
-
const a = this.getMap(), l = e.geometry.properties, h = this.getSymbol(l.symbolIndex), c = "line" === l.textPlacement && !
|
|
6109
|
+
const a = this.getMap(), l = e.geometry.properties, h = this.getSymbol(l.symbolIndex), c = "line" === l.textPlacement && !Ee(h), {aTextSize: u, aTextHaloRadius: d, aShape: f} = l;
|
|
6110
6110
|
let p = u ? u[n[r]] : e.properties.textSize;
|
|
6111
6111
|
null == p && (p = si.textSize);
|
|
6112
|
-
const m = d ? d[n[r]] : e.properties.textHaloRadius, y = oi(pi, e, n[r]), g =
|
|
6112
|
+
const m = d ? d[n[r]] : e.properties.textHaloRadius, y = oi(pi, e, n[r]), g = On(mi, y, s, a.width, a.height), v = i, {boxes: b, collision: x} = this.Cr(e, r);
|
|
6113
6113
|
let w = 0;
|
|
6114
6114
|
if (c || 1 === e.material.uniforms.rotateWithMap || h.textRotation) {
|
|
6115
6115
|
let i = 0;
|
|
@@ -6452,16 +6452,16 @@ function Ii(t, e) {
|
|
|
6452
6452
|
T || (T = r.aPadOffsetX = new Int8Array(m.length), M = r.aPadOffsetY = new Int8Array(m.length))),
|
|
6453
6453
|
delete _.$layer, delete _.$type, m && n) {
|
|
6454
6454
|
const e = Math.abs((d - o) / 10 * S) + (P[1] + P[3] || 0);
|
|
6455
|
-
if (Ai[0] = e, m[t] !== Ai[0] && (
|
|
6455
|
+
if (Ai[0] = e, m[t] !== Ai[0] && (Oe(m, Ai[0], t, t + 4), m.dirty = !0), T) {
|
|
6456
6456
|
const e = (P[1] + P[3]) / 2 - P[3];
|
|
6457
|
-
ki[0] = e, T[t] !== ki[0] && (
|
|
6457
|
+
ki[0] = e, T[t] !== ki[0] && (Oe(T, e, t, t + 4), T.dirty = !0);
|
|
6458
6458
|
}
|
|
6459
6459
|
}
|
|
6460
6460
|
if (v && i) {
|
|
6461
6461
|
const e = Math.abs((f - u) / 10 * S) + (P[0] + P[2] || 0);
|
|
6462
|
-
if (Ai[0] = e, v[t] !== Ai[0] && (
|
|
6462
|
+
if (Ai[0] = e, v[t] !== Ai[0] && (Oe(v, Ai[0], t, t + 4), v.dirty = !0), M) {
|
|
6463
6463
|
const e = P[0] - (P[0] + P[2]) / 2;
|
|
6464
|
-
ki[0] = e, M[t] !== ki[0] && (
|
|
6464
|
+
ki[0] = e, M[t] !== ki[0] && (Oe(M, e, t, t + 4), M.dirty = !0);
|
|
6465
6465
|
}
|
|
6466
6466
|
}
|
|
6467
6467
|
};
|
|
@@ -6487,16 +6487,16 @@ function Ii(t, e) {
|
|
|
6487
6487
|
_ && (e.data.aPadOffsetX = _, e.data.aPadOffsetY = S);
|
|
6488
6488
|
}
|
|
6489
6489
|
|
|
6490
|
-
const
|
|
6490
|
+
const Oi = function(t) {
|
|
6491
6491
|
const e = this.layer.getRenderer();
|
|
6492
6492
|
return !this.zr(t) && e.isForeground(t) && !!t.geometry.properties.iconAtlas && !t.geometry.properties.isEmpty;
|
|
6493
|
-
},
|
|
6493
|
+
}, Ci = function(t) {
|
|
6494
6494
|
const e = this.layer.getRenderer();
|
|
6495
6495
|
return !(this.zr(t) || e.isForeground(t) || !t.geometry.properties.iconAtlas || t.geometry.properties.isEmpty);
|
|
6496
|
-
},
|
|
6496
|
+
}, Ei = function(t) {
|
|
6497
6497
|
const e = this.layer.getRenderer();
|
|
6498
6498
|
return !this.zr(t) && e.isForeground(t) && !!t.geometry.properties.glyphAtlas;
|
|
6499
|
-
},
|
|
6499
|
+
}, Fi = function(t) {
|
|
6500
6500
|
const e = this.layer.getRenderer();
|
|
6501
6501
|
return !this.zr(t) && !e.isForeground(t) && !!t.geometry.properties.glyphAtlas;
|
|
6502
6502
|
}, zi = [], ji = {
|
|
@@ -6506,11 +6506,11 @@ const Ci = function(t) {
|
|
|
6506
6506
|
class Ni extends Sn {
|
|
6507
6507
|
constructor(t, e, n, i, r, o) {
|
|
6508
6508
|
super(t, e, n, i, r, o), this.propAllowOverlap = "markerAllowOverlap", this.propIgnorePlacement = "markerIgnorePlacement",
|
|
6509
|
-
this.fi = {}, this.isLabelCollides = yi.bind(this), this.Nr =
|
|
6510
|
-
this.Lr =
|
|
6509
|
+
this.fi = {}, this.isLabelCollides = yi.bind(this), this.Nr = Oi.bind(this), this.Rr = Ci.bind(this),
|
|
6510
|
+
this.Lr = Ei.bind(this), this.Hr = Fi.bind(this), this.Vr = [];
|
|
6511
6511
|
}
|
|
6512
6512
|
setTextShaderDefines(t) {
|
|
6513
|
-
this.
|
|
6513
|
+
this.Wr = t;
|
|
6514
6514
|
}
|
|
6515
6515
|
createFnTypeConfig(t, e) {
|
|
6516
6516
|
return {
|
|
@@ -6529,8 +6529,8 @@ class Ni extends Sn {
|
|
|
6529
6529
|
}
|
|
6530
6530
|
postCreateGeometry(t, e) {
|
|
6531
6531
|
const {geometry: n, symbolIndex: i} = t, r = this.getSymbolDef(i), o = this.getFnTypeConfig(i);
|
|
6532
|
-
if (this.
|
|
6533
|
-
_i(n, r, o.icon); else if (this.Gr(n) &&
|
|
6532
|
+
if (this.Ur(n)) n.properties.iconAtlas ? this.drawDebugAtlas(n.properties.iconAtlas) : n.properties.isEmpty = !0,
|
|
6533
|
+
_i(n, r, o.icon); else if (this.Gr(n) && Ee(r)) {
|
|
6534
6534
|
const t = e[e.length - 1];
|
|
6535
6535
|
if (t) {
|
|
6536
6536
|
const {geometry: e, symbolIndex: o} = t;
|
|
@@ -6557,7 +6557,7 @@ class Ni extends Sn {
|
|
|
6557
6557
|
const o = this.isEnableCollision(), s = this.layer, {geometry: a, symbolIndex: l} = t;
|
|
6558
6558
|
a.properties.symbolIndex = l;
|
|
6559
6559
|
const h = this.getSymbolDef(l), c = this.getSymbol(l), u = this.getFnTypeConfig(l), d = [];
|
|
6560
|
-
if (this.
|
|
6560
|
+
if (this.Ur(a)) {
|
|
6561
6561
|
const t = function(t, e, i, r, o, s, a, l, h) {
|
|
6562
6562
|
if (e.isDisposed() || 0 === e.data.aPosition.length) return null;
|
|
6563
6563
|
const c = e.properties.iconAtlas;
|
|
@@ -6612,7 +6612,7 @@ class Ni extends Sn {
|
|
|
6612
6612
|
}
|
|
6613
6613
|
Br(t, e) {
|
|
6614
6614
|
const {collideIds: n} = t.properties, i = new Uint16Array(n.length);
|
|
6615
|
-
if (this.
|
|
6615
|
+
if (this.Ur(t)) {
|
|
6616
6616
|
let r = 0;
|
|
6617
6617
|
for (let t = 0; t < n.length; t += 4) i.fill(r++, t, t + 4);
|
|
6618
6618
|
t.properties.collideIds = i, t.properties.uniqueCollideIds = ze(i), e.markerCollideMap = {
|
|
@@ -6651,7 +6651,7 @@ class Ni extends Sn {
|
|
|
6651
6651
|
for (let e = 0; e < t.length; e++) {
|
|
6652
6652
|
if (!this.isMeshIterable(t[e])) continue;
|
|
6653
6653
|
const n = t[e].geometry, {symbolIndex: i} = n.properties;
|
|
6654
|
-
|
|
6654
|
+
Ee(this.getSymbolDef(i)) && Ii.call(this, this.getMap(), n);
|
|
6655
6655
|
}
|
|
6656
6656
|
const e = this.getMap().getZoom();
|
|
6657
6657
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -6673,11 +6673,11 @@ class Ni extends Sn {
|
|
|
6673
6673
|
}
|
|
6674
6674
|
callCurrentTileShader(t, e) {
|
|
6675
6675
|
this.shader.filter = e.sceneFilter ? [ this.Nr, e.sceneFilter ] : this.Nr, this.callRenderer(this.shader, t, e),
|
|
6676
|
-
this.
|
|
6676
|
+
this.Jr.filter = e.sceneFilter ? [ this.Lr, e.sceneFilter ] : this.Lr, this.callRenderer(this.Jr, t, e);
|
|
6677
6677
|
}
|
|
6678
6678
|
callBackgroundTileShader(t, e) {
|
|
6679
6679
|
this.shader.filter = e.sceneFilter ? [ this.Rr, e.sceneFilter ] : this.Rr, this.callRenderer(this.shader, t, e),
|
|
6680
|
-
this.
|
|
6680
|
+
this.Jr.filter = e.sceneFilter ? [ this.Hr, e.sceneFilter ] : this.Hr, this.callRenderer(this.Jr, t, e);
|
|
6681
6681
|
}
|
|
6682
6682
|
isMeshIterable(t) {
|
|
6683
6683
|
return t && t.geometry && !t.geometry.properties.isEmpty && t.material && !t.material.get("isHalo") && this.isMeshVisible(t) && !(this.shouldIgnoreBackground() && !this.layer.getRenderer().isForeground(t));
|
|
@@ -6685,7 +6685,7 @@ class Ni extends Sn {
|
|
|
6685
6685
|
$r() {
|
|
6686
6686
|
if (!this.yr()) return;
|
|
6687
6687
|
let t = this.Vr;
|
|
6688
|
-
t && t.length && this.
|
|
6688
|
+
t && t.length && this.Xr(t);
|
|
6689
6689
|
}
|
|
6690
6690
|
Yr(t, e, n, i) {
|
|
6691
6691
|
return this.updateBoxCollisionFading(!0, t, e, n, i);
|
|
@@ -6693,7 +6693,7 @@ class Ni extends Sn {
|
|
|
6693
6693
|
isEnableUniquePlacement() {
|
|
6694
6694
|
return this.isEnableCollision() && !0 === this.sceneConfig.uniquePlacement;
|
|
6695
6695
|
}
|
|
6696
|
-
|
|
6696
|
+
Xr(t) {
|
|
6697
6697
|
const e = this.layer.getRenderer();
|
|
6698
6698
|
t = t.sort(Ri);
|
|
6699
6699
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -6738,7 +6738,7 @@ class Ni extends Sn {
|
|
|
6738
6738
|
n[e] && u++;
|
|
6739
6739
|
}
|
|
6740
6740
|
if (!u) return !1;
|
|
6741
|
-
l = this.
|
|
6741
|
+
l = this.Er(u);
|
|
6742
6742
|
let d = 0;
|
|
6743
6743
|
for (let t = 0; t < c.length; t++) {
|
|
6744
6744
|
const n = c[t];
|
|
@@ -6790,7 +6790,7 @@ class Ni extends Sn {
|
|
|
6790
6790
|
isBoxCollides(t, e, n, i, r, o) {
|
|
6791
6791
|
if (this.Gr(t.geometry)) return yi.call(this, 0, t, e, n, i, r, o);
|
|
6792
6792
|
if (t.geometry.properties.isEmpty) return ji;
|
|
6793
|
-
const s = this.getMap(), {boxes: a, collision: l} = this.
|
|
6793
|
+
const s = this.getMap(), {boxes: a, collision: l} = this.Cr(t, i);
|
|
6794
6794
|
let h = 0, c = 0, u = 0;
|
|
6795
6795
|
for (let n = i; n < r; n += 6) {
|
|
6796
6796
|
const i = a[u] = a[u] || [];
|
|
@@ -6856,8 +6856,8 @@ class Ni extends Sn {
|
|
|
6856
6856
|
} ],
|
|
6857
6857
|
extraCommandProps: i
|
|
6858
6858
|
}), this.shader.version = 300;
|
|
6859
|
-
const {uniforms: o, extraCommandProps: s} = ci.call(this, this.layer, this.sceneConfig), a = this.
|
|
6860
|
-
if (this.
|
|
6859
|
+
const {uniforms: o, extraCommandProps: s} = ci.call(this, this.layer, this.sceneConfig), a = this.Wr || {};
|
|
6860
|
+
if (this.Jr = new n.MeshShader({
|
|
6861
6861
|
vert: xi,
|
|
6862
6862
|
frag: wi,
|
|
6863
6863
|
uniforms: o,
|
|
@@ -6917,7 +6917,7 @@ class Ni extends Sn {
|
|
|
6917
6917
|
const {elements: n} = t.geometry.properties;
|
|
6918
6918
|
return gi(t, n[e]);
|
|
6919
6919
|
}
|
|
6920
|
-
|
|
6920
|
+
Ur(t) {
|
|
6921
6921
|
const {symbolIndex: e} = t.properties;
|
|
6922
6922
|
return 0 === e.type;
|
|
6923
6923
|
}
|
|
@@ -7046,10 +7046,10 @@ Hi.prototype = {
|
|
|
7046
7046
|
return t instanceof Hi ? t : Array.isArray(t) ? new Hi(t[0], t[1]) : t;
|
|
7047
7047
|
};
|
|
7048
7048
|
|
|
7049
|
-
const Vi = [],
|
|
7049
|
+
const Vi = [], Wi = [], Ui = [];
|
|
7050
7050
|
|
|
7051
7051
|
function Gi(t, e, n, r, o, s, a, l) {
|
|
7052
|
-
const {aGlyphOffset: h, 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 = c.set(
|
|
7052
|
+
const {aGlyphOffset: h, 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 = c.set(Ui, y || 0, g || 0), b = c.set(Vi, h[2 * o], h[2 * o + 1]), x = i.set(Wi, u[3 * o], u[3 * o + 1], u[3 * o + 2]);
|
|
7053
7053
|
return function(t, e, n, i, r, o, s, a, l, h, c, u) {
|
|
7054
7054
|
const d = i[0] * h, f = c ? d - r : d + r;
|
|
7055
7055
|
let p = f > 0 ? 1 : -1, m = 0;
|
|
@@ -7082,9 +7082,9 @@ function $i(t, e, n, r, o, s, a, l, h, u, d) {
|
|
|
7082
7082
|
return 2 * y + m;
|
|
7083
7083
|
}
|
|
7084
7084
|
|
|
7085
|
-
var
|
|
7085
|
+
var Ji = "#define SHADER_NAME TEXT_LINE\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec2 aTexCoord;\n#ifdef HAS_OFFSET_Z\nattribute vec3 aOffset;\nuniform float altitudeScale;\n#else\nattribute vec2 aOffset;\n#endif\n#ifdef ENABLE_COLLISION\nattribute float aOpacity;\n#endif\n#ifdef HAS_OPACITY\nattribute float aColorOpacity;\n#endif\n#ifdef HAS_TEXT_SIZE\nattribute float aTextSize;\n#else\nuniform float textSize;\n#endif\n#ifdef HAS_TEXT_DX\nattribute float aTextDx;\n#else\nuniform float textDx;\n#endif\n#ifdef HAS_TEXT_DY\nattribute float aTextDy;\n#else\nuniform float textDy;\n#endif\n#if defined(HAS_PITCH_ALIGN)\nattribute float aPitchAlign;\n#else\nuniform float pitchWithMap;\n#endif\nuniform float zoomScale;\nuniform float cameraToCenterDistance;\nuniform mat4 projViewModelMatrix;\nuniform float textPerspectiveRatio;\nuniform float mapPitch;\nuniform vec2 texSize;\nuniform vec2 canvasSize;\nuniform float tileRatio;\nuniform float layerScale;\n#ifndef PICKING_MODE\nvarying vec2 vTexCoord;\nvarying float vGammaScale;\nvarying float vSize;\nvarying float vOpacity;\n#ifdef HAS_TEXT_FILL\nattribute vec4 aTextFill;\nvarying vec4 vTextFill;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nattribute vec4 aTextHaloFill;\nvarying vec4 vTextHaloFill;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nattribute float aTextHaloRadius;\nvarying float vTextHaloRadius;\n#endif\n#ifdef HAS_TEXT_HALO_OPACITY\nattribute float aTextHaloOpacity;\nvarying float vTextHaloOpacity;\n#endif\n#include <highlight_vert>\n#else\n#include <fbo_picking_vert>\n#endif\n#include <vt_position_vert>\nvoid main() {\n vec3 c = unpackVTPosition();\n#ifdef HAS_TEXT_DX\nfloat d = aTextDx;\n#else\nfloat d = textDx;\n#endif\n#ifdef HAS_TEXT_DY\nfloat e = aTextDy;\n#else\nfloat e = textDy;\n#endif\n#ifdef HAS_TEXT_SIZE\nfloat f = aTextSize * layerScale;\n#else\nfloat f = textSize * layerScale;\n#endif\n#ifdef HAS_PITCH_ALIGN\nfloat h = aPitchAlign;\n#else\nfloat h = pitchWithMap;\n#endif\ngl_Position = projViewModelMatrix * vec4(c, 1.);\n float i = gl_Position.w;\n float j = i / cameraToCenterDistance;\n float k = (1. - cameraToCenterDistance / i) * textPerspectiveRatio;\n float l = clamp(.5 + .5 * (1. - k), .0, 4.);\n#ifdef HAS_OFFSET_Z\nvec3 m = aOffset / 10.0;\n m[2] /= altitudeScale;\n#else\nvec3 m = vec3(aOffset / 10.0, .0);\n#endif\nvec2 n = aTexCoord;\n if(h == 1.) {\n m.xy *= tileRatio / zoomScale * j * l;\n gl_Position = projViewModelMatrix * vec4(c + m, 1.);\n } else {\n gl_Position.xy += m.xy * 2. / canvasSize * l * i;\n }\n gl_Position.xy += vec2(d, -e) * 2. / canvasSize * i;\n#ifndef PICKING_MODE\nif(h == 1.) {\n vGammaScale = j + mapPitch / 4.;\n } else {\n vGammaScale = mix(1., j, textPerspectiveRatio);\n }\n vGammaScale = clamp(vGammaScale, .0, 1.);\n vTexCoord = n / texSize;\n vSize = f;\n#ifdef ENABLE_COLLISION\nvOpacity = aOpacity / 255.;\n#else\nvOpacity = 1.;\n#endif\n#ifdef HAS_OPACITY\nvOpacity *= aColorOpacity / 255.;\n#endif\n#ifdef HAS_TEXT_FILL\nvTextFill = aTextFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_FILL\nvTextHaloFill = aTextHaloFill / 255.;\n#endif\n#ifdef HAS_TEXT_HALO_RADIUS\nvTextHaloRadius = aTextHaloRadius;\n#endif\n#ifdef HAS_TEXT_HALO_OPACITY\nvTextHaloOpacity = aTextHaloOpacity;\n#endif\nhighlight_setVarying();\n#else\n#ifdef ENABLE_COLLISION\nbool o = aOpacity == 255.;\n#else\nbool o = true;\n#endif\nfbo_picking_setData(gl_Position.w, o);\n#endif\n}";
|
|
7086
7086
|
|
|
7087
|
-
const
|
|
7087
|
+
const Xi = function(t) {
|
|
7088
7088
|
const e = this.layer.getRenderer();
|
|
7089
7089
|
return !this.zr(t) && e.isTileNearCamera(t) && "line" !== t.geometry.properties.textPlacement;
|
|
7090
7090
|
}, Yi = function(t) {
|
|
@@ -7101,7 +7101,7 @@ const Ji = function(t) {
|
|
|
7101
7101
|
class wr extends Sn {
|
|
7102
7102
|
constructor(t, e, n, i, r, o) {
|
|
7103
7103
|
super(t, e, n, i, r, o), this.propAllowOverlap = "textAllowOverlap", this.propIgnorePlacement = "textIgnorePlacement",
|
|
7104
|
-
this.colorCache = {}, this.po =
|
|
7104
|
+
this.colorCache = {}, this.po = Xi.bind(this), this.mo = Yi.bind(this), this.yo = Zi.bind(this),
|
|
7105
7105
|
this.vo = Ki.bind(this), this.isLabelCollides = yi.bind(this), this.bo();
|
|
7106
7106
|
}
|
|
7107
7107
|
bo() {
|
|
@@ -7247,7 +7247,7 @@ class wr extends Sn {
|
|
|
7247
7247
|
if (this.ko[o]) return this.ko[o];
|
|
7248
7248
|
const s = function(t, e, n, i, r) {
|
|
7249
7249
|
const o = [];
|
|
7250
|
-
for (let s = 0; s < e.length; s += 3) l.set(o, e[s], e[s + 1], e[s + 2], 1),
|
|
7250
|
+
for (let s = 0; s < e.length; s += 3) l.set(o, e[s], e[s + 1], e[s + 2], 1), On(o, o, n, i, r),
|
|
7251
7251
|
t[s] = o[0], t[s + 1] = o[1], t[s + 2] = e[s + 2];
|
|
7252
7252
|
return t;
|
|
7253
7253
|
}(t, e, n, i, r);
|
|
@@ -7256,7 +7256,7 @@ class wr extends Sn {
|
|
|
7256
7256
|
forEachBox(t, e) {
|
|
7257
7257
|
const n = this.getMap(), i = r.multiply(tr, n.projViewMatrix, t.localTransform), {collideIds: o, aCount: s, features: a, elements: l} = t.geometry.properties, h = o;
|
|
7258
7258
|
if (!h) return;
|
|
7259
|
-
const c = this.isEnableUniquePlacement(), u = this.
|
|
7259
|
+
const c = this.isEnableUniquePlacement(), u = this.Er(1);
|
|
7260
7260
|
u[0].allElements = l, u[0].mesh = t;
|
|
7261
7261
|
let d = 0, f = l[0], p = 0, m = h[f];
|
|
7262
7262
|
for (let n = 0; n <= l.length; n += 6) if (f = l[n], h[f] !== m || n === l.length) {
|
|
@@ -7264,7 +7264,7 @@ class wr extends Sn {
|
|
|
7264
7264
|
if (c && this.isMeshUniquePlaced(t) && r && !r.label) {
|
|
7265
7265
|
const e = r.properties || {};
|
|
7266
7266
|
e.$layer = r.layer, e.$type = r.type;
|
|
7267
|
-
const {symbolIndex: n} = t.properties, i = n && this.xo[n.index] ? this.xo[n.index](t.properties.z, e) : this.getSymbol(t.properties.symbolIndex).textName, o =
|
|
7267
|
+
const {symbolIndex: n} = t.properties, i = n && this.xo[n.index] ? this.xo[n.index](t.properties.z, e) : this.getSymbol(t.properties.symbolIndex).textName, o = E.resolveText(i, e);
|
|
7268
7268
|
delete e.$layer, delete e.$type, r.label = o;
|
|
7269
7269
|
}
|
|
7270
7270
|
const o = n, y = s[l[p]];
|
|
@@ -7277,19 +7277,19 @@ class wr extends Sn {
|
|
|
7277
7277
|
const d = this.yr(), f = this.getMap(), p = t.geometry, m = p.desc.positionSize, {aShape: y, aOffset: g, aAnchor: v, aAltitude: b, aPitchRotation: x} = p.properties, A = p.properties.aTextSize, k = !h, _ = e[n] * m;
|
|
7278
7278
|
let S = ir;
|
|
7279
7279
|
p.data.aAltitude ? i.set(ir, v[_], v[_ + 1], b[e[n]]) : w.unpackPosition(ir, v[_], v[_ + 1], v[_ + 2]);
|
|
7280
|
-
const T =
|
|
7280
|
+
const T = On(rr, S, a, f.width, f.height);
|
|
7281
7281
|
if (l.set(or, T[0], T[1], T[0], T[1]), f.isOffscreen(or)) return d || Ar(g, e, n, o),
|
|
7282
7282
|
!1;
|
|
7283
7283
|
k && (S = T);
|
|
7284
7284
|
const M = k ? 1 : p.properties.tileExtent / this.layer.options.tileSize[0];
|
|
7285
7285
|
let P = !0;
|
|
7286
|
-
const I = e[n],
|
|
7287
|
-
if (null ===
|
|
7288
|
-
const
|
|
7286
|
+
const I = e[n], O = e[o - 1], C = A ? A[I] : t.properties.textSize, E = this.Io(t, C, s, I, O, S, M, h);
|
|
7287
|
+
if (null === E) return Ar(g, e, n, o), !1;
|
|
7288
|
+
const F = O - I <= 3, z = t.material.uniforms, j = 1 === z.pitchWithMap, D = Math.floor(E / 2), N = E % 2;
|
|
7289
7289
|
for (let a = n; a < o; a += 6) {
|
|
7290
7290
|
const l = e[a];
|
|
7291
7291
|
let h;
|
|
7292
|
-
if (h = D || a !== n ||
|
|
7292
|
+
if (h = D || a !== n || F ? D || a !== o - 6 || F ? Gi.call(this, er, t, C, s, l, S, M, D) : yr : mr,
|
|
7293
7293
|
!h) {
|
|
7294
7294
|
P = !1, d || Ar(g, e, n, o);
|
|
7295
7295
|
break;
|
|
@@ -7308,7 +7308,7 @@ class wr extends Sn {
|
|
|
7308
7308
|
}
|
|
7309
7309
|
for (let t = 0; t < 4; t++) {
|
|
7310
7310
|
const e = 2 * (l + t);
|
|
7311
|
-
c.set(ar, y[e] / 10, y[e + 1] / 10), c.scale(ar, ar,
|
|
7311
|
+
c.set(ar, y[e] / 10, y[e + 1] / 10), c.scale(ar, ar, C / 24), c.transformMat2(ar, ar, p),
|
|
7312
7312
|
j ? (c.multiply(ar, ar, hr), c.add(lr, ar, h), m && (lr[2] = 0, v && i.transformMat4(lr, lr, v))) : (c.multiply(lr, h, hr),
|
|
7313
7313
|
c.add(lr, ar, lr)), cr[0] = 10 * lr[0], cr[1] = 10 * lr[1], m && (cr[2] = 10 * lr[2]);
|
|
7314
7314
|
const n = (m ? 3 : 2) * (l + t);
|
|
@@ -7331,7 +7331,7 @@ class wr extends Sn {
|
|
|
7331
7331
|
}) : t.material && delete t.material.uniforms.texture), super.deleteMesh(t, e));
|
|
7332
7332
|
}
|
|
7333
7333
|
delete() {
|
|
7334
|
-
super.delete(), this.So.dispose(), delete this.ko, this.
|
|
7334
|
+
super.delete(), this.So.dispose(), delete this.ko, this.Oo && this.Oo.dispose();
|
|
7335
7335
|
}
|
|
7336
7336
|
needClearStencil() {
|
|
7337
7337
|
return !0;
|
|
@@ -7349,7 +7349,7 @@ class wr extends Sn {
|
|
|
7349
7349
|
let r = i;
|
|
7350
7350
|
if (this.layer.getRenderer().isEnableWorkAround("win-intel-gpu-crash") && (r = xe({}, i),
|
|
7351
7351
|
r.stencil = xe({}, i.stencil), r.stencil.enable = !0), this.So = new n.MeshShader({
|
|
7352
|
-
vert:
|
|
7352
|
+
vert: Ji,
|
|
7353
7353
|
frag: wi,
|
|
7354
7354
|
uniforms: e,
|
|
7355
7355
|
extraCommandProps: r
|
|
@@ -7366,7 +7366,7 @@ class wr extends Sn {
|
|
|
7366
7366
|
return "line" !== this.getSymbol(e).textPlacement;
|
|
7367
7367
|
};
|
|
7368
7368
|
const i = new n.FBORayPicking(this.renderer, {
|
|
7369
|
-
vert: "#define PICKING_MODE 1\n" +
|
|
7369
|
+
vert: "#define PICKING_MODE 1\n" + Ji,
|
|
7370
7370
|
uniforms: e,
|
|
7371
7371
|
extraCommandProps: {
|
|
7372
7372
|
viewport: this.pickingViewport
|
|
@@ -7376,7 +7376,7 @@ class wr extends Sn {
|
|
|
7376
7376
|
}
|
|
7377
7377
|
}
|
|
7378
7378
|
getUniformValues(t) {
|
|
7379
|
-
const e = t.projViewMatrix, n = t.cameraToCenterDistance, i = [ t.width, t.height ], r =
|
|
7379
|
+
const e = t.projViewMatrix, n = t.cameraToCenterDistance, i = [ t.width, t.height ], r = J(t.getResolution(), t);
|
|
7380
7380
|
return {
|
|
7381
7381
|
layerScale: this.layer.options.styleScale || 1,
|
|
7382
7382
|
mapPitch: t.getPitch() * Math.PI / 180,
|
|
@@ -7594,7 +7594,7 @@ class Pr extends sn {
|
|
|
7594
7594
|
}
|
|
7595
7595
|
}
|
|
7596
7596
|
|
|
7597
|
-
const Ir = [ 0, 0 ],
|
|
7597
|
+
const Ir = [ 0, 0 ], Or = [ 1, 1, 1 ], Cr = [ 1, 1, 1, 1 ], Er = [ 0, 0 ], Fr = [];
|
|
7598
7598
|
|
|
7599
7599
|
class zr extends nn {
|
|
7600
7600
|
supportRenderMode(t) {
|
|
@@ -7607,9 +7607,9 @@ class zr extends nn {
|
|
|
7607
7607
|
if (!this.material) return this.setToRedraw(), null;
|
|
7608
7608
|
const {geometry: s, symbolIndex: a} = t, l = new n.Mesh(s, this.material);
|
|
7609
7609
|
if (this.sceneConfig.animation) {
|
|
7610
|
-
|
|
7610
|
+
Or[2] = .01;
|
|
7611
7611
|
const t = [];
|
|
7612
|
-
r.fromScaling(t,
|
|
7612
|
+
r.fromScaling(t, Or), r.multiply(t, e, t), e = t;
|
|
7613
7613
|
}
|
|
7614
7614
|
const h = this.getSymbolDef(a), c = this.getFnTypeConfig(a);
|
|
7615
7615
|
Ne(s, h, c);
|
|
@@ -7627,10 +7627,10 @@ class zr extends nn {
|
|
|
7627
7627
|
enumerable: !0,
|
|
7628
7628
|
get: () => {
|
|
7629
7629
|
const t = this.dataConfig.defaultAltitude * (this.dataConfig.altitudeScale || 1);
|
|
7630
|
-
return
|
|
7630
|
+
return Ce(t) ? t : 0;
|
|
7631
7631
|
}
|
|
7632
7632
|
});
|
|
7633
|
-
} else Se(l.uniforms, "polygonFill", f, "polygonFill",
|
|
7633
|
+
} else Se(l.uniforms, "polygonFill", f, "polygonFill", Cr, Pe(this.colorCache)),
|
|
7634
7634
|
Se(l.uniforms, "polygonOpacity", f, "polygonOpacity", 1);
|
|
7635
7635
|
if (s.data.aColor && (d.HAS_COLOR = 1), s.data.aLineWidth && (d.HAS_LINE_WIDTH = 1),
|
|
7636
7636
|
s.data.aLineHeight && (d.HAS_LINE_HEIGHT = 1), s.data.aOpacity) {
|
|
@@ -7666,7 +7666,7 @@ class zr extends nn {
|
|
|
7666
7666
|
}), l.properties.symbolIndex = a, l;
|
|
7667
7667
|
}
|
|
7668
7668
|
getShadowMeshes() {
|
|
7669
|
-
if (!this.isVisible()) return
|
|
7669
|
+
if (!this.isVisible()) return Fr;
|
|
7670
7670
|
this.shadowCount = this.scene.getMeshes().length;
|
|
7671
7671
|
const t = this.scene.getMeshes().filter(t => 0 === t.properties.level);
|
|
7672
7672
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -7680,28 +7680,28 @@ class zr extends nn {
|
|
|
7680
7680
|
return t.material && t.material.uvOffsetAnim;
|
|
7681
7681
|
}
|
|
7682
7682
|
getUVOffset(t) {
|
|
7683
|
-
const e = this.getSymbols()[0], n = e.material && e.material.uvOffset ||
|
|
7683
|
+
const e = this.getSymbols()[0], n = e.material && e.material.uvOffset || Er, i = this.layer.getRenderer().getFrameTimestamp(), r = [ n[0], n[1] ], o = !!e.material && e.material.noiseTexture, s = o ? 5e5 : 1e3, a = o ? 256 : 1;
|
|
7684
7684
|
return t && t[0] && (r[0] = i * t[0] % s / s * a), t && t[1] && (r[1] = i * t[1] % s / s * a),
|
|
7685
7685
|
r;
|
|
7686
7686
|
}
|
|
7687
7687
|
needPolygonOffset() {
|
|
7688
|
-
return this.
|
|
7688
|
+
return this.Co;
|
|
7689
7689
|
}
|
|
7690
7690
|
startFrame(...t) {
|
|
7691
|
-
return delete this.
|
|
7691
|
+
return delete this.Co, super.startFrame(...t);
|
|
7692
7692
|
}
|
|
7693
7693
|
addMesh(t, e) {
|
|
7694
7694
|
t.forEach(t => {
|
|
7695
|
-
this.
|
|
7695
|
+
this.Ci(t, e);
|
|
7696
7696
|
}), super.addMesh(...arguments);
|
|
7697
7697
|
}
|
|
7698
|
-
|
|
7698
|
+
Ci(t, e) {
|
|
7699
7699
|
if (null !== e) {
|
|
7700
7700
|
const n = t.localTransform;
|
|
7701
|
-
0 === e && (e = .01),
|
|
7701
|
+
0 === e && (e = .01), Or[2] = e, r.fromScaling(n, Or), r.multiply(n, t.properties.tileTransform, n),
|
|
7702
7702
|
t.setLocalTransform(n);
|
|
7703
7703
|
} else t.setLocalTransform(t.properties.tileTransform);
|
|
7704
|
-
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.
|
|
7704
|
+
t.material !== this.material && t.setMaterial(this.material), t.geometry.properties.maxAltitude <= 0 && (this.Co = !0),
|
|
7705
7705
|
this.getSymbol(t.properties.symbolIndex).ssr ? t.ssr = 1 : t.ssr = 0;
|
|
7706
7706
|
}
|
|
7707
7707
|
deleteMesh(t, e) {
|
|
@@ -7753,7 +7753,7 @@ class zr extends nn {
|
|
|
7753
7753
|
}
|
|
7754
7754
|
updateSymbol(t, e) {
|
|
7755
7755
|
const n = super.updateSymbol(t, e);
|
|
7756
|
-
return t.material && this.
|
|
7756
|
+
return t.material && this.Eo(t.material), n;
|
|
7757
7757
|
}
|
|
7758
7758
|
pi(t, e) {
|
|
7759
7759
|
return jr(t) !== jr(e);
|
|
@@ -7795,14 +7795,14 @@ class Dr extends zr {
|
|
|
7795
7795
|
return this.shader;
|
|
7796
7796
|
}
|
|
7797
7797
|
delete(t) {
|
|
7798
|
-
this.getMap().off("updatelights", this.
|
|
7798
|
+
this.getMap().off("updatelights", this.Fo, this), super.delete(t), this.material.dispose();
|
|
7799
7799
|
}
|
|
7800
7800
|
init() {
|
|
7801
|
-
this.getMap().on("updatelights", this.
|
|
7801
|
+
this.getMap().on("updatelights", this.Fo, this);
|
|
7802
7802
|
const t = this.regl;
|
|
7803
7803
|
this.renderer = new n.Renderer(t);
|
|
7804
7804
|
const e = this.getShaderConfig();
|
|
7805
|
-
this.shader = new n.PhongShader(e), this.
|
|
7805
|
+
this.shader = new n.PhongShader(e), this.Eo();
|
|
7806
7806
|
const i = {
|
|
7807
7807
|
vert: this.getPickingVert(),
|
|
7808
7808
|
uniforms: [ "projViewMatrix", "modelMatrix", "positionMatrix", {
|
|
@@ -7818,7 +7818,7 @@ class Dr extends zr {
|
|
|
7818
7818
|
};
|
|
7819
7819
|
this.picking = [ new n.FBORayPicking(this.renderer, i, this.layer.getRenderer().pickingFBO, this.getMap()) ];
|
|
7820
7820
|
}
|
|
7821
|
-
|
|
7821
|
+
Fo() {
|
|
7822
7822
|
this.setToRedraw();
|
|
7823
7823
|
}
|
|
7824
7824
|
getShaderConfig() {
|
|
@@ -7867,10 +7867,10 @@ class Dr extends zr {
|
|
|
7867
7867
|
}
|
|
7868
7868
|
};
|
|
7869
7869
|
}
|
|
7870
|
-
|
|
7870
|
+
Eo() {
|
|
7871
7871
|
this.material && this.material.dispose();
|
|
7872
7872
|
const t = this.getSymbols()[0].material, e = {};
|
|
7873
|
-
for (const n in t)
|
|
7873
|
+
for (const n in t) Fe(t, n) && (e[n] = t[n]);
|
|
7874
7874
|
this.material = new n.PhongMaterial(e);
|
|
7875
7875
|
}
|
|
7876
7876
|
getUniformValues(t, e) {
|
|
@@ -8047,10 +8047,10 @@ class Hr extends zr {
|
|
|
8047
8047
|
delete this.No);
|
|
8048
8048
|
}
|
|
8049
8049
|
init(t) {
|
|
8050
|
-
this.getMap().on("updatelights", this.Lo, this), this.createIBLTextures(), this.
|
|
8050
|
+
this.getMap().on("updatelights", this.Lo, this), this.createIBLTextures(), this.Ei = this.Ei || t;
|
|
8051
8051
|
const e = this.regl;
|
|
8052
|
-
this.renderer = new n.Renderer(e), this.Ho = this.Vo.bind(this), this.
|
|
8053
|
-
this.
|
|
8052
|
+
this.renderer = new n.Renderer(e), this.Ho = this.Vo.bind(this), this.Wo = this.disposeCachedTexture.bind(this),
|
|
8053
|
+
this.Uo = this.Go.bind(this), this.Eo(), this.Pi(t);
|
|
8054
8054
|
const i = {
|
|
8055
8055
|
vert: "\n #include <gl2_vert>\n attribute vec3 aPosition;\n uniform mat4 projViewModelMatrix;\n uniform mat4 positionMatrix;\n //引入fbo picking的vert相关函数\n #include <line_extrusion_vert>\n #include <get_output>\n #include <fbo_picking_vert>\n void main() {\n mat4 localPositionMatrix = getPositionMatrix();\n #ifdef IS_LINE_EXTRUSION\n vec3 linePosition = getLineExtrudePosition(aPosition);\n vec4 localVertex = getPosition(linePosition);\n #else\n vec4 localVertex = getPosition(aPosition);\n #endif\n\n gl_Position = projViewModelMatrix * localPositionMatrix * localVertex;\n fbo_picking_setData(gl_Position.w, true);\n }\n ",
|
|
8056
8056
|
uniforms: [ {
|
|
@@ -8124,10 +8124,10 @@ class Hr extends zr {
|
|
|
8124
8124
|
Go() {
|
|
8125
8125
|
this.setToRedraw(!0);
|
|
8126
8126
|
}
|
|
8127
|
-
|
|
8127
|
+
Eo(t) {
|
|
8128
8128
|
const e = this.dataConfig, i = t || this.getSymbols()[0].material, r = {};
|
|
8129
8129
|
let o = !1;
|
|
8130
|
-
for (const t in i) if (
|
|
8130
|
+
for (const t in i) if (Fe(i, t)) if (t.indexOf("Texture") > 0) {
|
|
8131
8131
|
let s = i[t];
|
|
8132
8132
|
if (!s) {
|
|
8133
8133
|
r[t] = void 0;
|
|
@@ -8144,13 +8144,13 @@ class Hr extends zr {
|
|
|
8144
8144
|
url: a,
|
|
8145
8145
|
wrap: "repeat"
|
|
8146
8146
|
}), s.flipY = !e.side || "bottom" === this.dataConfig.textureYOrigin, r[t] = new n.Texture2D(s, this.jo),
|
|
8147
|
-
r[t].once("complete", this.Ho), r[t].once("disposed", this.
|
|
8147
|
+
r[t].once("complete", this.Ho), r[t].once("disposed", this.Wo), r[t].promise && this.addCachedTexture(a, r[t].promise),
|
|
8148
8148
|
o = !0;
|
|
8149
8149
|
} else r[t] = i[t];
|
|
8150
8150
|
if (this.material) {
|
|
8151
8151
|
for (let t in r) this.material.set(t, r[t]);
|
|
8152
8152
|
this.setToRedraw(!0);
|
|
8153
|
-
} else this.material = new n.pbr.StandardMaterial(r), this.material.once("complete", this.
|
|
8153
|
+
} else this.material = new n.pbr.StandardMaterial(r), this.material.once("complete", this.Uo);
|
|
8154
8154
|
o || this.Go();
|
|
8155
8155
|
}
|
|
8156
8156
|
getShader() {
|
|
@@ -8172,9 +8172,9 @@ class Hr extends zr {
|
|
|
8172
8172
|
|
|
8173
8173
|
var Vr = "#include <gl2_vert>\n#define EXTRUDE_SCALE 63.0\n#define EXTRUDE_MOD 64.0\n#define MAX_LINE_DISTANCE 65535.0\nuniform mat4 projViewModelMatrix;\nuniform vec2 centiMeterToLocal;\n#ifdef HAS_ALTITUDE\nattribute vec2 aPosition;\nattribute float aAltitude;\n#else\nattribute vec3 aPosition;\n#endif\nattribute vec4 aTubeNormal;\n#ifdef HAS_LINE_WIDTH\nattribute float aLineWidth;\n#else\nuniform float lineWidth;\n#endif\n#include <vt_position_vert>\n#ifdef PICKING_MODE\n#include <fbo_picking_vert>\n#else\nuniform mat4 modelViewMatrix;\nuniform mat3 modelNormalMatrix;\nuniform mat4 modelMatrix;\n#if defined(HAS_PATTERN)\nuniform float resolution;\nuniform float tileResolution;\nuniform float tileRatio;\nattribute float aLinesofar;\nvarying highp float vLinesofar;\nattribute vec4 aTexInfo;\nvarying vec4 vTexInfo;\nvarying float vNormalY;\nvarying float vPatternHeight;\nattribute float aNormalDistance;\n#if defined(HAS_PATTERN_ANIM)\nattribute float aLinePatternAnimSpeed;\nvarying float vLinePatternAnimSpeed;\n#endif\n#if defined(HAS_PATTERN_GAP)\nattribute float aLinePatternGap;\nvarying float vLinePatternGap;\n#endif\n#endif\n#ifdef HAS_COLOR\nattribute vec4 aColor;\nvarying vec4 vColor;\n#endif\n#ifdef HAS_OPACITY\nattribute float aOpacity;\nvarying float vOpacity;\n#endif\nvarying vec3 vModelNormal;\nvarying vec4 vViewVertex;\nvarying vec3 vModelVertex;\n#endif\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\n#include <vsm_shadow_vert>\n#endif\n#include <highlight_vert>\nvoid main() {\n \n#ifdef HAS_LINE_WIDTH\nfloat c = aLineWidth;\n#else\nfloat c = lineWidth;\n#endif\nfloat d = c / 2.;\n vec3 e = aTubeNormal.xyz / EXTRUDE_SCALE;\n vec3 f = unpackVTPosition();\n vec4 h = vec4(f, 1.);\n h.xy += e.xy * d * centiMeterToLocal;\n h.z += e.z * d;\n gl_Position = projViewModelMatrix * h;\n#ifdef PICKING_MODE\nfbo_picking_setData(gl_Position.w, true);\n#else\nvViewVertex = modelViewMatrix * h;\n vec3 i = normalize(e);\n vModelNormal = modelNormalMatrix * i;\n vModelVertex = (modelMatrix * h).xyz;\n#if defined(HAS_SHADOWING) && !defined(HAS_BLOOM)\nshadow_computeShadowPars(h);\n#endif\n#ifdef HAS_COLOR\nvColor = aColor / 255.;\n#endif\n#ifdef HAS_PATTERN\nfloat j = tileResolution / resolution;\n float k = aLinesofar - d * centiMeterToLocal.y * aNormalDistance / EXTRUDE_SCALE;\n vLinesofar = k / tileRatio * j;\n vTexInfo = vec4(aTexInfo.xy, aTexInfo.zw + 1.);\n vPatternHeight = c * centiMeterToLocal.x / tileRatio * j;\n vNormalY = aTubeNormal.w / EXTRUDE_SCALE;\n#if defined(HAS_PATTERN_ANIM)\nvLinePatternAnimSpeed = aLinePatternAnimSpeed / 127.;\n#endif\n#if defined(HAS_PATTERN_GAP)\nvLinePatternGap = aLinePatternGap / 10.0;\n#endif\n#endif\nhighlight_setVarying();\n#endif\n}";
|
|
8174
8174
|
|
|
8175
|
-
const {getPBRUniforms:
|
|
8175
|
+
const {getPBRUniforms: Wr} = n.pbr.PBRUtils;
|
|
8176
8176
|
|
|
8177
|
-
class
|
|
8177
|
+
class Ur extends sn {
|
|
8178
8178
|
needToRedraw() {
|
|
8179
8179
|
return super.needToRedraw() || this.isAnimating();
|
|
8180
8180
|
}
|
|
@@ -8253,7 +8253,7 @@ class Wr extends sn {
|
|
|
8253
8253
|
}
|
|
8254
8254
|
}
|
|
8255
8255
|
createShader(t) {
|
|
8256
|
-
this.
|
|
8256
|
+
this.Ei = t;
|
|
8257
8257
|
const e = [], i = {};
|
|
8258
8258
|
this.fillIncludes(i, e, t), e.push({
|
|
8259
8259
|
name: "projViewModelMatrix",
|
|
@@ -8312,7 +8312,7 @@ class Wr extends sn {
|
|
|
8312
8312
|
};
|
|
8313
8313
|
}
|
|
8314
8314
|
getUniformValues(t, e) {
|
|
8315
|
-
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r =
|
|
8315
|
+
const {iblTexes: n, dfgLUT: i} = this.getIBLRes(), r = Wr(t, n, i, null, e && e.jitter), o = t.projViewMatrix, s = t.viewMatrix;
|
|
8316
8316
|
return r.projViewMatrix = o, r.viewMatrix = s, r.resolution = t.getResolution(),
|
|
8317
8317
|
r.currentTime = this.layer.getRenderer().getFrameTimestamp() || 0, this.setIncludeUniformValues(r, e),
|
|
8318
8318
|
r;
|
|
@@ -8394,10 +8394,10 @@ class Wr extends sn {
|
|
|
8394
8394
|
}
|
|
8395
8395
|
}
|
|
8396
8396
|
|
|
8397
|
-
const Gr = [], qr = [], Br = [ 0, 0, 0 ], $r = [ 0, 0, 0 ],
|
|
8397
|
+
const Gr = [], qr = [], Br = [ 0, 0, 0 ], $r = [ 0, 0, 0 ], Jr = [ 1, 1, 1 ], Xr = [], Yr = [ 1, 1, 1, 1 ], Zr = [], Kr = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1 ], Qr = t => class extends t {
|
|
8398
8398
|
constructor(t, e, i, r, o, s) {
|
|
8399
8399
|
super(t, e, i, r, o, s), this.Bo = !1, this.scene.sortFunction = this.sortByCommandKey,
|
|
8400
|
-
this.$o = [], this.
|
|
8400
|
+
this.$o = [], this.Jo = new n.GLTFManager(t), this.Xo();
|
|
8401
8401
|
}
|
|
8402
8402
|
isAnimating() {
|
|
8403
8403
|
const t = this.getSymbols();
|
|
@@ -8419,7 +8419,7 @@ const Gr = [], qr = [], Br = [ 0, 0, 0 ], $r = [ 0, 0, 0 ], Xr = [ 1, 1, 1 ], Jr
|
|
|
8419
8419
|
};
|
|
8420
8420
|
}
|
|
8421
8421
|
getFnTypeConfig() {
|
|
8422
|
-
return
|
|
8422
|
+
return Xr;
|
|
8423
8423
|
}
|
|
8424
8424
|
createMesh(t, e, {tileTranslationMatrix: o, tileExtent: s}) {
|
|
8425
8425
|
if (!this.Bo) return null;
|
|
@@ -8463,7 +8463,7 @@ const Gr = [], qr = [], Br = [ 0, 0, 0 ], $r = [ 0, 0, 0 ], Xr = [ 1, 1, 1 ], Jr
|
|
|
8463
8463
|
r.multiply(S, b, S);
|
|
8464
8464
|
const T = [];
|
|
8465
8465
|
r.fromTranslation(T, w), r.multiply(S, T, S), _.setPositionMatrix(() => {
|
|
8466
|
-
if (
|
|
8466
|
+
if (Ce(v)) {
|
|
8467
8467
|
const t = a.getGLScale() / a.getGLScale(v);
|
|
8468
8468
|
return i.set(Gr, t, t, t), r.fromScaling(T, Gr), r.multiply(T, T, S);
|
|
8469
8469
|
}
|
|
@@ -8519,7 +8519,7 @@ const Gr = [], qr = [], Br = [ 0, 0, 0 ], $r = [ 0, 0, 0 ], Xr = [ 1, 1, 1 ], Jr
|
|
|
8519
8519
|
n && this.setToRedraw(!0), super.prepareRender(t);
|
|
8520
8520
|
}
|
|
8521
8521
|
getShadowMeshes() {
|
|
8522
|
-
if (!this.isVisible()) return
|
|
8522
|
+
if (!this.isVisible()) return Xr;
|
|
8523
8523
|
this.shadowCount = this.scene.getMeshes().length;
|
|
8524
8524
|
return this.scene.getMeshes().filter(t => 0 === t.properties.level);
|
|
8525
8525
|
}
|
|
@@ -8552,17 +8552,17 @@ const Gr = [], qr = [], Br = [ 0, 0, 0 ], $r = [ 0, 0, 0 ], Xr = [ 1, 1, 1 ], Jr
|
|
|
8552
8552
|
return t.positionAttribute = "POSITION", t.normalAttribute = "NORMAL", t;
|
|
8553
8553
|
}
|
|
8554
8554
|
init(t) {
|
|
8555
|
-
super.init(t), this.
|
|
8555
|
+
super.init(t), this.Xo();
|
|
8556
8556
|
}
|
|
8557
|
-
|
|
8557
|
+
Xo() {
|
|
8558
8558
|
if (this.Yo) return;
|
|
8559
8559
|
this.Yo = [];
|
|
8560
8560
|
const t = this.getSymbols();
|
|
8561
8561
|
this.es = 0;
|
|
8562
8562
|
for (let e = 0; e < t.length; e++) {
|
|
8563
8563
|
const n = t[e].url || "pyramid";
|
|
8564
|
-
this.
|
|
8565
|
-
const i = this.
|
|
8564
|
+
this.Jo.loginGLTF(n);
|
|
8565
|
+
const i = this.Jo.getGLTF(n);
|
|
8566
8566
|
if (i.then) i.then(n => {
|
|
8567
8567
|
if (!n.gltfPack) return this.es++, void (this.es >= t.length && (this.Bo = !0, this.setToRedraw(!0)));
|
|
8568
8568
|
const {gltfPack: i} = n;
|
|
@@ -8589,11 +8589,11 @@ const Gr = [], qr = [], Br = [ 0, 0, 0 ], $r = [ 0, 0, 0 ], Xr = [ 1, 1, 1 ], Jr
|
|
|
8589
8589
|
const t = this.getSymbols();
|
|
8590
8590
|
for (let e = 0; e < t.length; e++) {
|
|
8591
8591
|
const n = t[e].url || "pyramid";
|
|
8592
|
-
this.
|
|
8592
|
+
this.Jo.logoutGLTF(n);
|
|
8593
8593
|
}
|
|
8594
8594
|
}
|
|
8595
8595
|
Qo(t, e, n, o) {
|
|
8596
|
-
const s = i.set(Gr, ...e || Br), a = n || $r, l = o ||
|
|
8596
|
+
const s = i.set(Gr, ...e || Br), a = n || $r, l = o || Jr, h = u.fromEuler(qr, a[0], a[1], a[2]);
|
|
8597
8597
|
return r.fromRotationTranslationScale(t, h, s, l);
|
|
8598
8598
|
}
|
|
8599
8599
|
};
|
|
@@ -8643,9 +8643,9 @@ class so extends sn {
|
|
|
8643
8643
|
this.renderer.render(this.rs, n, this.os, this.getRenderFBO(e));
|
|
8644
8644
|
}
|
|
8645
8645
|
addMesh(t, e) {
|
|
8646
|
-
this.
|
|
8646
|
+
this.Ci(t, e), super.addMesh(...arguments);
|
|
8647
8647
|
}
|
|
8648
|
-
|
|
8648
|
+
Ci(t) {
|
|
8649
8649
|
const e = this.getSymbol(ro).ssr;
|
|
8650
8650
|
for (let n = 0; n < t.length; n++) t[n].ssr = e ? 1 : 0;
|
|
8651
8651
|
}
|
|
@@ -8913,7 +8913,7 @@ const go = ve("lit", Hr);
|
|
|
8913
8913
|
|
|
8914
8914
|
go.registerAt(Pt);
|
|
8915
8915
|
|
|
8916
|
-
const vo = ve("tube",
|
|
8916
|
+
const vo = ve("tube", Ur);
|
|
8917
8917
|
|
|
8918
8918
|
vo.registerAt(Pt);
|
|
8919
8919
|
|
|
@@ -8994,8 +8994,8 @@ const Ao = ve("water", so);
|
|
|
8994
8994
|
|
|
8995
8995
|
Ao.registerAt(Pt), Lt.registerPainter("lit", Hr), Lt.registerPainter("icon", Ni),
|
|
8996
8996
|
Lt.registerPainter("fill", un), Lt.registerPainter("line", fn), Lt.registerPainter("line-gradient", pn),
|
|
8997
|
-
Lt.registerPainter("water", so), Lt.registerPainter("tube",
|
|
8998
|
-
Pt.VERSION = "0.78.
|
|
8997
|
+
Lt.registerPainter("water", so), Lt.registerPainter("tube", Ur), n.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"),
|
|
8998
|
+
Pt.VERSION = "0.78.2", Lt.VERSION = "0.78.2";
|
|
8999
8999
|
|
|
9000
9000
|
if (e.mat4.create(), e.transcoders) {
|
|
9001
9001
|
const n = t.Map.VERSION;
|
|
@@ -9009,4 +9009,4 @@ if (e.mat4.create(), e.transcoders) {
|
|
|
9009
9009
|
|
|
9010
9010
|
export { un as FillPainter, lo as FillPlugin, bo as GLTFPhongPlugin, xo as GLTFStandardPlugin, Dt as GeoJSONVectorTileLayer, wo as HeatmapPlugin, Ni as IconPainter, uo as IconPlugin, co as LineGradientPlugin, fn as LinePainter, ho as LinePlugin, ue as LineStringLayer, go as LitPlugin, zt as MapboxVectorTileLayer, Pr as NativeLinePainter, po as NativeLinePlugin, Tr as NativePointPainter, Dr as PhongPainter, mo as PhongPlugin, ce as PointLayer, fe as PolygonLayer, wr as TextPainter, fo as TextPlugin, vo as TubePlugin, Lt as Vector3DLayer, Pt as VectorTileLayer, gt as VectorTileLayerRenderer, Ao as WaterPlugin, Rr as WireframePainter, yo as WireframePlugin };
|
|
9011
9011
|
|
|
9012
|
-
"undefined" != typeof console && console.log("@maptalks/vt v0.78.
|
|
9012
|
+
"undefined" != typeof console && console.log("@maptalks/vt v0.78.2");
|