12 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d2111408"],{"229e":function(t,e,r){"use strict";r.d(e,"a",(function(){return Ct})),r.d(e,"b",(function(){return Ht})),r.d(e,"c",(function(){return $t})),r.d(e,"d",(function(){return qt})),r.d(e,"e",(function(){return Yt})),r.d(e,"f",(function(){return jt})),r.d(e,"g",(function(){return Kt}));var n,i,a=r("ab39"),s=r("ff93"),o=r("b2b2"),l=r("ae0b");!function(t){t[t.R8_SIGNED=0]="R8_SIGNED",t[t.R8_UNSIGNED=1]="R8_UNSIGNED",t[t.R16_SIGNED=2]="R16_SIGNED",t[t.R16_UNSIGNED=3]="R16_UNSIGNED",t[t.R8G8_SIGNED=4]="R8G8_SIGNED",t[t.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",t[t.R16G16_SIGNED=6]="R16G16_SIGNED",t[t.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",t[t.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",t[t.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",t[t.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",t[t.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",t[t.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"}(n||(n={})),function(t){t[t.UNIFORM=0]="UNIFORM",t[t.DATA_DRIVEN=1]="DATA_DRIVEN",t[t.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",t[t.UNUSED=3]="UNUSED"}(i||(i={}));var u=r("d17d"),c=r("3f3e");class h{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layoutInfo||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return 0===this._locations.size&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layoutInfo||this._buildAttributesInfo(),this._layoutInfo}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,r,n,i){const a=this.getUniforms();for(const s of a){const{name:a,type:o,getValue:l}=s,u=l(r,e,n,i);if(null!==u)switch(o){case"float":t.setUniform1f(a,u);break;case"vec2":t.setUniform2fv(a,u);break;case"vec4":t.setUniform4fv(a,u)}}}encodeAttributes(t,e,r,i){const a=this.attributesInfo(),s=this.getEncodingInfos(),o=[];let l=0,u=0;for(const h of Object.keys(s)){var c;const p=s[h],{type:y,precisionFactor:f,isLayout:g}=a[h],d=g?r.getLayoutProperty(h):r.getPaintProperty(h),_=null==(c=d.interpolator)?void 0:c.getInterpolationRange(e);let m=0;for(const r of p){const{offset:a,bufferElementsToAdd:s}=r;if(s>0){for(let t=0;t<s;t++)o.push(0);l+=u,u=r.bufferElementsToAdd}const c=null!=i?i:d.getValue(_?_[m]:e,t);switch(y){case n.R8_SIGNED:case n.R8_UNSIGNED:o[l]|=this._encodeByte(c*(f||1),8*a);break;case n.R16_SIGNED:case n.R16_UNSIGNED:o[l]|=this._encodeShort(c*(f||1),8*a);break;case n.R8G8_SIGNED:case n.R8G8_UNSIGNED:o[l]|=this._encodeByte(c*(f||1),8*a),o[l]|=this._encodeByte(c*(f||1),8*a+8);break;case n.R16G16_SIGNED:case n.R16G16_UNSIGNED:o[l]|=this._encodeShort(c*(f||1),8*a),o[l]|=this._encodeShort(c*(f||1),8*a+16);break;case n.R8G8B8A8_SIGNED:case n.R8G8B8A8_UNSIGNED:o[l]|=this._encodeByte(c*(f||1),8*a),o[l]|=this._encodeByte(c*(f||1),8*a+8),o[l]|=this._encodeByte(c*(f||1),8*a+16),o[l]|=this._encodeByte(c*(f||1),8*a+24);break;case n.R8G8B8A8_COLOR:o[l]=this._encodeColor(c);break;case n.R16G16B16A16_DASHARRAY:case n.R16G16B16A16_PATTERN:this._encodePattern(l,o,c);break;default:throw new Error("Unsupported encoding type")}m++}}return o}getAtributeState(t){let e=0;const r=3+2*t;return e|=this._bit(r),e|=this._bit(r+1)<<1,e}_buildAttributesInfo(){const t=[],e={},r={};let n=-1;const a=this.attributesInfo(),s=this.attributes();let o=-1;for(const u of s){o++;const s=this.getAtributeState(o);if(s===i.UNIFORM||s===i.UNUSED)continue;const l=a[u],c=[];e[u]=c;const p=l.type;for(let e=0;e<s;e++){const{dataType:e,bytesPerElement:i,count:a,normalized:s}=h._encodingInfo[p],o=i*a;let l=r[e],u=0;if(!l||l.count+a>4)n++,l={dataIndex:n,count:0,offset:0},4!==a&&(r[e]=l),t.push({location:-1,name:"a_data_"+n,count:a,type:e,normalized:s}),u=Math.ceil(Math.max(o/4,1));else{const e=t[l.dataIndex];e.count+=a,u=Math.ceil(Math.max(e.count*i/4,1))-Math.ceil(Math.max(l.offset/4,1))}c.push({dataIndex:l.dataIndex,offset:l.offset,bufferElementsToAdd:u}),l.offset+=o,l.count+=a}}for(const i of t)switch(i.type){case u["k"].BYTE:case u["k"].UNSIGNED_BYTE:i.count=4;case u["k"].SHORT:case u["k"].UNSIGNED_SHORT:i.count+=i.count%2}this._buildVertexBufferLayout(t);let l=0;const c=this._layoutInfo.geometry;for(const i of c)this._locations.set(i.name,l++);const p=this._layoutInfo.opacity;if(p)for(const i of p)this._locations.set(i.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e={},r=this.geometryInfo();let n=r[0].stride;if(0===t.length)e.geometry=r;else{const i=[];let a=n;for(const e of t)n+=p(e.type)*e.count;for(const t of r){const e={...t};e.stride=n,i.push(e)}for(const e of t)i.push(new c["a"](e.name,e.count,e.type,a,n)),a+=p(e.type)*e.count;e.geometry=i}this.opacityInfo()&&(e.opacity=this.opacityInfo()),this._layoutInfo=e,this._stride=n}_buildShaderInfo(t,e){let r="\n",a="\n";const s=[];for(const n of t)r+=`attribute ${this._getType(n.count)} ${n.name};\n`;const l=this.attributes(),u=this.attributesInfo();let c=-1;for(const p of l){c++;const{name:t,type:l,precisionFactor:f,isLayout:g}=u[p],d=f&&1!==f?" * "+1/f:"",{bytesPerElement:_,count:m}=h._encodingInfo[l],b=t=>`a_data_${t.dataIndex}${y(m,t.offset,_)}`;switch(this.getAtributeState(c)){case i.UNIFORM:{const e=this._getType(m),i="u_"+t;s.push({name:i,type:e,getValue:(t,e,r,i)=>{const a=g?t.getLayoutValue(p,e):t.getPaintValue(p,e);if(l===n.R16G16B16A16_DASHARRAY){const r=t.getDashKey(a,t.getLayoutValue("line-cap",e)),n=i.getMosaicItemPosition(r,!1);if(Object(o["j"])(n))return null;const{tl:s,br:l}=n;return[s[0],l[1],l[0],s[1]]}if(l===n.R16G16B16A16_PATTERN){const t=i.getMosaicItemPosition(a,-1===p.indexOf("line-"));if(Object(o["j"])(t))return null;const{tl:e,br:r}=t;return[e[0],r[1],r[0],e[1]]}if(l===n.R8G8B8A8_COLOR){const t=a[3];return[t*a[0],t*a[1],t*a[2],t]}return a}}),r+=`uniform ${e} ${i};\n`,a+=`${e} ${t} = ${i};\n`}break;case i.DATA_DRIVEN:{const r=b(e[p][0]);a+=`${this._getType(m)} ${t} = ${r}${d};\n`}break;case i.INTERPOLATED_DATA_DRIVEN:{const n="u_t_"+t;s.push({name:n,type:"float",getValue:(t,e,r,n)=>(g?t.getLayoutProperty(p):t.getPaintProperty(p)).interpolator.interpolationUniformValue(r,e)}),r+=`uniform float ${n};\n`;const i=b(e[p][0]),o=b(e[p][1]);a+=`${this._getType(m)} ${t} = mix(${i}${d}, ${o}${d}, ${n});\n`}}}this._shaderHeader=r,this._shaderMain=a,this._uniforms=s}_bit(t){return(this._key&1<<t)>>t}_getType(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4"}throw new Error("Invalid count")}_encodeColor(t){const e=255*t[3];return l["a"].i8888to32(t[0]*e,t[1]*e,t[2]*e,e)}_encodePattern(t,e,r){if(!r||!r.rect)return;const n=2,i=r.rect,a=r.width,s=r.height;e[t]=this._encodeShort(i.x+n,0),e[t]|=this._encodeShort(i.y+n+s,16),e[t+1]=this._encodeShort(i.x+n+a,0),e[t+1]|=this._encodeShort(i.y+n,16)}_encodeByte(t,e){return(255&t)<<e}_encodeShort(t,e){return(65535&t)<<e}}h._encodingInfo={[n.R8_SIGNED]:{dataType:u["k"].BYTE,bytesPerElement:1,count:1,normalized:!1},[n.R8_UNSIGNED]:{dataType:u["k"].UNSIGNED_BYTE,bytesPerElement:1,count:1,normalized:!1},[n.R16_SIGNED]:{dataType:u["k"].SHORT,bytesPerElement:2,count:1,normalized:!1},[n.R16_UNSIGNED]:{dataType:u["k"].UNSIGNED_SHORT,bytesPerElement:2,count:1,normalized:!1},[n.R8G8_SIGNED]:{dataType:u["k"].BYTE,bytesPerElement:1,count:2,normalized:!1},[n.R8G8_UNSIGNED]:{dataType:u["k"].UNSIGNED_BYTE,bytesPerElement:1,count:2,normalized:!1},[n.R16G16_SIGNED]:{dataType:u["k"].SHORT,bytesPerElement:2,count:2,normalized:!1},[n.R16G16_UNSIGNED]:{dataType:u["k"].UNSIGNED_SHORT,bytesPerElement:2,count:2,normalized:!1},[n.R8G8B8A8_SIGNED]:{dataType:u["k"].BYTE,bytesPerElement:1,count:4,normalized:!1},[n.R8G8B8A8_UNSIGNED]:{dataType:u["k"].UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!1},[n.R8G8B8A8_COLOR]:{dataType:u["k"].UNSIGNED_BYTE,bytesPerElement:1,count:4,normalized:!0},[n.R16G16B16A16_DASHARRAY]:{dataType:u["k"].UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1},[n.R16G16B16A16_PATTERN]:{dataType:u["k"].UNSIGNED_SHORT,bytesPerElement:2,count:4,normalized:!1}};const p=t=>{switch(t){case u["k"].FLOAT:case u["k"].INT:case u["k"].UNSIGNED_INT:return 4;case u["k"].SHORT:case u["k"].UNSIGNED_SHORT:return 2;case u["k"].BYTE:case u["k"].UNSIGNED_BYTE:return 1}},y=(t,e,r)=>{const n=e/r;if(1===t)switch(n){case 0:return".x";case 1:return".y";case 2:return".z";case 3:return".w"}else if(2===t)switch(n){case 0:return".xy";case 1:return".yz";case 2:return".zw"}else if(3===t)switch(n){case 0:return".xyz";case 1:return".yzw"}return""};class f extends h{constructor(t){super(t)}geometryInfo(){return f.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return f.ATTRIBUTES}attributesInfo(){return f.ATTRIBUTES_INFO}}f.ATTRIBUTES=[],f.GEOMETRY_LAYOUT=[new c["a"]("a_pos",2,u["k"].BYTE,0,2)],f.ATTRIBUTES_INFO={};class g extends h{constructor(t){super(t)}geometryInfo(){return g.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return g.ATTRIBUTES}attributesInfo(){return g.ATTRIBUTES_INFO}}g.ATTRIBUTES=["circle-radius","circle-color","circle-opacity","circle-stroke-width","circle-stroke-color","circle-stroke-opacity","circle-blur"],g.GEOMETRY_LAYOUT=[new c["a"]("a_pos",2,u["k"].SHORT,0,4)],g.ATTRIBUTES_INFO={"circle-radius":{name:"radius",type:n.R8_UNSIGNED},"circle-color":{name:"color",type:n.R8G8B8A8_COLOR},"circle-opacity":{name:"opacity",type:n.R8_UNSIGNED,precisionFactor:100},"circle-stroke-width":{name:"stroke_width",type:n.R8_UNSIGNED,precisionFactor:4},"circle-stroke-color":{name:"stroke_color",type:n.R8G8B8A8_COLOR},"circle-stroke-opacity":{name:"stroke_opacity",type:n.R8_UNSIGNED,precisionFactor:100},"circle-blur":{name:"blur",type:n.R8_UNSIGNED,precisionFactor:32}};class d extends h{constructor(t){super(t)}geometryInfo(){return d.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return d.ATTRIBUTES}attributesInfo(){return d.ATTRIBUTES_INFO}}d.ATTRIBUTES=["fill-color","fill-opacity","fill-pattern"],d.GEOMETRY_LAYOUT=[new c["a"]("a_pos",2,u["k"].SHORT,0,4)],d.ATTRIBUTES_INFO={"fill-color":{name:"color",type:n.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:n.R8_UNSIGNED,precisionFactor:100},"fill-pattern":{name:"tlbr",type:n.R16G16B16A16_PATTERN,isOptional:!0}};class _ extends h{constructor(t,e){super(t),this.usefillColor=e}geometryInfo(){return _.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return this.usefillColor?_.ATTRIBUTES_FILL:_.ATTRIBUTES_OUTLINE}attributesInfo(){return this.usefillColor?_.ATTRIBUTES_INFO_FILL:_.ATTRIBUTES_INFO_OUTLINE}}_.ATTRIBUTES_OUTLINE=["fill-outline-color","fill-opacity"],_.ATTRIBUTES_FILL=["fill-color","fill-opacity"],_.GEOMETRY_LAYOUT=[new c["a"]("a_pos",2,u["k"].SHORT,0,8),new c["a"]("a_offset",2,u["k"].BYTE,4,8),new c["a"]("a_xnormal",2,u["k"].BYTE,6,8)],_.ATTRIBUTES_INFO_OUTLINE={"fill-outline-color":{name:"color",type:n.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:n.R8_UNSIGNED,precisionFactor:100}},_.ATTRIBUTES_INFO_FILL={"fill-color":{name:"color",type:n.R8G8B8A8_COLOR},"fill-opacity":{name:"opacity",type:n.R8_UNSIGNED,precisionFactor:100}};class m extends h{constructor(t){super(t)}geometryInfo(){return m.GEOMETRY_LAYOUT}opacityInfo(){return null}attributes(){return m.ATTRIBUTES}attributesInfo(){return m.ATTRIBUTES_INFO}}m.ATTRIBUTES=["line-blur","line-color","line-gap-width","line-offset","line-opacity","line-width","line-pattern","line-dasharray"],m.GEOMETRY_LAYOUT=[new c["a"]("a_pos",2,u["k"].SHORT,0,16),new c["a"]("a_extrude_offset",4,u["k"].BYTE,4,16),new c["a"]("a_dir_normal",4,u["k"].BYTE,8,16),new c["a"]("a_accumulatedDistance",2,u["k"].UNSIGNED_SHORT,12,16)],m.ATTRIBUTES_INFO={"line-width":{name:"width",type:n.R8_UNSIGNED,precisionFactor:2},"line-gap-width":{name:"gap_width",type:n.R8_UNSIGNED,precisionFactor:2},"line-offset":{name:"offset",type:n.R8_SIGNED,precisionFactor:2},"line-color":{name:"color",type:n.R8G8B8A8_COLOR},"line-opacity":{name:"opacity",type:n.R8_UNSIGNED,precisionFactor:100},"line-blur":{name:"blur",type:n.R8_UNSIGNED,precisionFactor:4},"line-pattern":{name:"tlbr",type:n.R16G16B16A16_PATTERN,isOptional:!0},"line-dasharray":{name:"tlbr",type:n.R16G16B16A16_DASHARRAY,isOptional:!0}};const b=[new c["a"]("a_pos",2,u["k"].SHORT,0,16),new c["a"]("a_vertexOffset",2,u["k"].SHORT,4,16),new c["a"]("a_texAngleRange",4,u["k"].UNSIGNED_BYTE,8,16),new c["a"]("a_levelInfo",4,u["k"].UNSIGNED_BYTE,12,16)],w=[new c["a"]("a_opacityInfo",1,u["k"].UNSIGNED_BYTE,0,1)];class v extends h{constructor(t){super(t)}geometryInfo(){return b}opacityInfo(){return w}attributes(){return v.ATTRIBUTES}attributesInfo(){return v.ATTRIBUTES_INFO}}v.ATTRIBUTES=["icon-color","icon-opacity","icon-halo-blur","icon-halo-color","icon-halo-width","icon-size"],v.ATTRIBUTES_INFO={"icon-color":{name:"color",type:n.R8G8B8A8_COLOR},"icon-opacity":{name:"opacity",type:n.R8_UNSIGNED,precisionFactor:100},"icon-halo-color":{name:"halo_color",type:n.R8G8B8A8_COLOR},"icon-halo-width":{name:"halo_width",type:n.R8_UNSIGNED,precisionFactor:4},"icon-halo-blur":{name:"halo_blur",type:n.R8_UNSIGNED,precisionFactor:4},"icon-size":{name:"size",type:n.R8_UNSIGNED,precisionFactor:32,isLayout:!0}};class E extends h{constructor(t){super(t)}geometryInfo(){return b}opacityInfo(){return w}attributes(){return E.ATTRIBUTES}attributesInfo(){return E.ATTRIBUTES_INFO}}E.ATTRIBUTES=["text-color","text-opacity","text-halo-blur","text-halo-color","text-halo-width","text-size"],E.ATTRIBUTES_INFO={"text-color":{name:"color",type:n.R8G8B8A8_COLOR},"text-opacity":{name:"opacity",type:n.R8_UNSIGNED,precisionFactor:100},"text-halo-color":{name:"halo_color",type:n.R8G8B8A8_COLOR},"text-halo-width":{name:"halo_width",type:n.R8_UNSIGNED,precisionFactor:4},"text-halo-blur":{name:"halo_blur",type:n.R8_UNSIGNED,precisionFactor:4},"text-size":{name:"size",type:n.R8_UNSIGNED,isLayout:!0}};var I=r("9ef0"),T=r("d329"),D=r("0554"),x=r("3b19");const R={kind:"null"},N={kind:"number"},A={kind:"string"},P={kind:"boolean"},S={kind:"color"},L={kind:"object"},O={kind:"value"};function U(t,e){return{kind:"array",itemType:t,n:e}}const k=[R,N,A,P,S,L,U(O)];function B(t){if("array"===t.kind){const e=B(t.itemType);return"number"==typeof t.n?`array<${e}, ${t.n}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}function G(t){if(null===t)return R;if("string"==typeof t)return A;if("boolean"==typeof t)return P;if("number"==typeof t)return N;if(t instanceof I["a"])return S;if(Array.isArray(t)){let e;for(const r of t){const t=G(r);if(e){if(e!==t){e=O;break}}else e=t}return U(e||O,t.length)}return"object"==typeof t?L:O}function M(t,e){if("array"===e.kind)return"array"===t.kind&&(0===t.n&&"value"===t.itemType.kind||M(t.itemType,e.itemType))&&("number"!=typeof e.n||e.n===t.n);if("value"===e.kind)for(const r of k)if(M(t,r))return!0;return e.kind===t.kind}function z(t){if(null===t)return"";const e=typeof t;return"string"===e?t:"number"===e||"boolean"===e?String(t):t instanceof I["a"]?t.toString():JSON.stringify(t)}var F=r("3976");class V{constructor(t){this.parent=t,this.vars={}}add(t,e){this.vars[t]=e}get(t){return this.vars[t]?this.vars[t]:this.parent?this.parent.get(t):null}}class C{constructor(){this.type=O}static parse(t){if(t.length>1)throw new Error('"id" does not expect arguments');return new C}evaluate(t,e){return null==t?void 0:t.id}}class ${constructor(){this.type=A}static parse(t){if(t.length>1)throw new Error('"geometry-type" does not expect arguments');return new $}evaluate(t,e){if(!t)return null;switch(t.type){case F["a"].Point:return"Point";case F["a"].LineString:return"LineString";case F["a"].Polygon:return"Polygon";default:return null}}}class Y{constructor(){this.type=L}static parse(t){if(t.length>1)throw new Error('"properties" does not expect arguments');return new Y}evaluate(t,e){return null==t?void 0:t.values}}class j{constructor(){this.type=N}static parse(t){if(t.length>1)throw new Error('"zoom" does not expect arguments');return new j}evaluate(t,e){return e}}class H{constructor(t,e,r){this.lhs=t,this.rhs=e,this.compare=r,this.type=P}static parse(t,e,r){if(3!==t.length&&4!==t.length)throw new Error(`"${t[0]}" expects 2 or 3 arguments`);if(4===t.length)throw new Error(`"${t[0]}" collator not supported`);return new H(kt(t[1],e),kt(t[2],e),r)}evaluate(t,e){return this.compare(this.lhs.evaluate(t,e),this.rhs.evaluate(t,e))}}class q extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t===e)}}class K extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t!==e)}}class W extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t<e)}}class Z extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t<=e)}}class J extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t>e)}}class Q extends H{static parse(t,e){return H.parse(t,e,(t,e)=>t>=e)}}class X{constructor(t){this.arg=t,this.type=P}static parse(t,e){if(2!==t.length)throw new Error('"!" expects 1 argument');return new X(kt(t[1],e))}evaluate(t,e){return!this.arg.evaluate(t,e)}}class tt{constructor(t){this.args=t,this.type=P}static parse(t,e){const r=[];for(let n=1;n<t.length;n++)r.push(kt(t[n],e));return new tt(r)}evaluate(t,e){for(const r of this.args)if(!r.evaluate(t,e))return!1;return!0}}class et{constructor(t){this.args=t,this.type=P}static parse(t,e){const r=[];for(let n=1;n<t.length;n++)r.push(kt(t[n],e));return new et(r)}evaluate(t,e){for(const r of this.args)if(r.evaluate(t,e))return!0;return!1}}class rt{constructor(t){this.args=t,this.type=P}static parse(t,e){const r=[];for(let n=1;n<t.length;n++)r.push(kt(t[n],e));return new rt(r)}evaluate(t,e){for(const r of this.args)if(r.evaluate(t,e))return!1;return!0}}class nt{constructor(t,e,r){this.type=t,this.args=e,this.fallback=r}static parse(t,e,r){if(t.length<4)throw new Error('"case" expects at least 3 arguments');if(t.length%2==1)throw new Error('"case" expects an odd number of arguments');let n;const i=[];for(let s=1;s<t.length-1;s+=2){const a=kt(t[s],e),o=kt(t[s+1],e,r);n||(n=o.type),i.push({condition:a,output:o})}const a=kt(t[t.length-1],e,r);return n||(n=a.type),new nt(n,i,a)}evaluate(t,e){for(const r of this.args)if(r.condition.evaluate(t,e))return r.output.evaluate(t,e);return this.fallback.evaluate(t,e)}}class it{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)throw new Error('"coalesce" expects at least 1 argument');let r;const n=[];for(let i=1;i<t.length;i++){const a=kt(t[i],e);r||(r=a.type),n.push(a)}return new it(r,n)}evaluate(t,e){for(const r of this.args){const n=r.evaluate(t,e);if(null!==n)return n}return null}}class at{constructor(t,e,r,n,i){this.type=t,this.input=e,this.labels=r,this.outputs=n,this.fallback=i}static parse(t,e){if(t.length<3)throw new Error('"match" expects at least 3 arguments');if(t.length%2==0)throw new Error('"case" expects an even number of arguments');let r;const n=kt(t[1],e),i=[],a={};let s;for(let o=2;o<t.length-1;o+=2){let n=t[o];Array.isArray(n)||(n=[n]);for(const t of n){const e=typeof t;if("string"!==e&&"number"!==e)throw new Error('"match" requires string or number literal as labels');if(s){if(e!==s)throw new Error('"match" requires labels to have the same type')}else s=e;a[t]=i.length}const l=kt(t[o+1],e);r||(r=l.type),i.push(l)}return new at(r,n,a,i,kt(t[t.length-1],e))}evaluate(t,e){const r=this.input.evaluate(t,e);return(this.outputs[this.labels[r]]||this.fallback).evaluate(t,e)}}class st{constructor(t,e,r,n,i){this.operator=t,this.type=e,this.interpolation=r,this.input=n,this.stops=i}static parse(t,e,r){const n=t[0];if(t.length<5)throw new Error(`"${n}" expects at least 4 arguments`);const i=t[1];if(!Array.isArray(i)||0===i.length)throw new Error(`"${i}" is not a valid interpolation`);switch(i[0]){case"linear":if(1!==i.length)throw new Error("Linear interpolation cannot have parameters");break;case"exponential":if(2!==i.length||"number"!=typeof i[1])throw new Error("Exponential interpolation requires one numeric argument");break;case"cubic-bezier":if(5!==i.length)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1");for(let t=1;t<5;t++){const e=i[t];if("number"!=typeof e||e<0||e>1)throw new Error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1")}break;default:throw new Error(`"${t[0]}" unknown interpolation type "${i[0]}"`)}if(t.length%2!=1)throw new Error(`"${n}" expects an even number of arguments`);const a=kt(t[2],e,N);let s;"interpolate-hcl"===n||"interpolate-lab"===n?s=S:r&&"value"!==r.kind&&(s=r);const o=[];for(let l=3;l<t.length;l+=2){const r=t[l];if("number"!=typeof r)throw new Error(`"${n}" requires stop inputs as literal numbers`);if(o.length&&o[o.length-1][0]>=r)throw new Error(`"${n}" requires strictly ascending stop inputs`);const i=kt(t[l+1],e,s);s||(s=i.type),o.push([r,i])}if(s&&s!==S&&s!==N&&("array"!==s.kind||s.itemType!==N))throw new Error(`"${n}" cannot interpolate type ${B(s)}`);return new st(n,s,i,a,o)}evaluate(t,e){const r=this.stops;if(1===r.length)return r[0][1].evaluate(t,e);const n=this.input.evaluate(t,e);if(n<=r[0][0])return r[0][1].evaluate(t,e);if(n>=r[r.length-1][0])return r[r.length-1][1].evaluate(t,e);let i=0;for(;++i<r.length&&!(n<r[i][0]););const a=r[i-1][0],s=r[i][0],o=st.interpolationRatio(this.interpolation,n,a,s),l=r[i-1][1].evaluate(t,e),u=r[i][1].evaluate(t,e);if("interpolate"===this.operator){if("array"===this.type.kind&&Array.isArray(l)&&Array.isArray(u))return l.map((t,e)=>Object(x["e"])(t,u[e],o));if("color"===this.type.kind&&l instanceof I["a"]&&u instanceof I["a"]){const t=new I["a"](l),e=new I["a"](u);return new I["a"]([Object(x["e"])(t.r,e.r,o),Object(x["e"])(t.g,e.g,o),Object(x["e"])(t.b,e.b,o),Object(x["e"])(t.a,e.a,o)])}if("number"===this.type.kind&&"number"==typeof l&&"number"==typeof u)return Object(x["e"])(l,u,o);throw new Error(`"${this.operator}" cannot interpolate type ${B(this.type)}`)}if("interpolate-hcl"===this.operator){const t=Object(T["c"])(l),e=Object(T["c"])(u),r=e.h-t.h,n=Object(T["d"])({h:t.h+o*(r>180||r<-180?r-360*Math.round(r/360):r),c:Object(x["e"])(t.c,e.c,o),l:Object(x["e"])(t.l,e.l,o)});return new I["a"]({a:Object(x["e"])(l.a,u.a,o),...n})}if("interpolate-lab"===this.operator){const t=Object(T["b"])(l),e=Object(T["b"])(u),r=Object(T["d"])({l:Object(x["e"])(t.l,e.l,o),a:Object(x["e"])(t.a,e.a,o),b:Object(x["e"])(t.b,e.b,o)});return new I["a"]({a:Object(x["e"])(l.a,u.a,o),...r})}throw new Error(`Unexpected operator "${this.operator}"`)}interpolationUniformValue(t,e){const r=this.stops;if(1===r.length)return 0;if(t>=r[r.length-1][0])return 0;let n=0;for(;++n<r.length&&!(t<r[n][0]););const i=r[n-1][0],a=r[n][0];return st.interpolationRatio(this.interpolation,e,i,a)}getInterpolationRange(t){const e=this.stops;if(1===e.length){const t=e[0][0];return[t,t]}const r=e[e.length-1][0];if(t>=r)return[r,r];let n=0;for(;++n<e.length&&!(t<e[n][0]););return[e[n-1][0],e[n][0]]}static interpolationRatio(t,e,r,n){let i=0;return"linear"===t[0]?i=st._exponentialInterpolationRatio(e,1,r,n):"exponential"===t[0]?i=st._exponentialInterpolationRatio(e,t[1],r,n):"cubic-bezier"===t[0]&&(i=Object(D["c"])(t[1],t[2],t[3],t[4])(st._exponentialInterpolationRatio(e,1,r,n),1e-5)),i<0?i=0:i>1&&(i=1),i}static _exponentialInterpolationRatio(t,e,r,n){const i=n-r;if(0===i)return 0;const a=t-r;return 1===e?a/i:(e**a-1)/(e**i-1)}}class ot{constructor(t,e,r){this.type=t,this.input=e,this.stops=r}static parse(t,e){if(t.length<5)throw new Error('"step" expects at least 4 arguments');if(t.length%2!=1)throw new Error('"step" expects an even number of arguments');const r=kt(t[1],e,N);let n;const i=[];i.push([-1/0,kt(t[2],e)]);for(let a=3;a<t.length;a+=2){const r=t[a];if("number"!=typeof r)throw new Error('"step" requires stop inputs as literal numbers');if(i.length&&i[i.length-1][0]>=r)throw new Error('"step" requires strictly ascending stop inputs');const s=kt(t[a+1],e);n||(n=s.type),i.push([r,s])}return new ot(n,r,i)}evaluate(t,e){const r=this.stops;if(1===r.length)return r[0][1].evaluate(t,e);const n=this.input.evaluate(t,e);let i=0;for(;++i<r.length&&!(n<r[i][0]););return this.stops[i-1][1].evaluate(t,e)}}class lt{constructor(t,e){this.type=t,this.output=e}static parse(t,e,r){if(t.length<4)throw new Error('"let" expects at least 3 arguments');if(t.length%2==1)throw new Error('"let" expects an odd number of arguments');const n=new V(e);for(let a=1;a<t.length-1;a+=2){const r=t[a];if("string"!=typeof r)throw new Error('"let" requires a string to define variable names - found '+r);n.add(r,kt(t[a+1],e))}const i=kt(t[t.length-1],n,r);return new lt(i.type,i)}evaluate(t,e){return this.output.evaluate(t,e)}}class ut{constructor(t,e){this.type=t,this.output=e}static parse(t,e,r){if(2!==t.length||"string"!=typeof t[1])throw new Error('"var" requires just one literal string argument');const n=e.get(t[1]);if(!n)throw new Error(t[1]+' must be defined before being used in a "var" expression');return new ut(r||O,n)}evaluate(t,e){return this.output.evaluate(t,e)}}class ct{constructor(t,e,r){this.type=t,this.index=e,this.array=r}static parse(t,e){if(3!==t.length)throw new Error('"at" expects 2 arguments');const r=kt(t[1],e,N),n=kt(t[2],e);return new ct(n.type.itemType,r,n)}evaluate(t,e){const r=this.index.evaluate(t,e),n=this.array.evaluate(t,e);if(r<0||r>=n.length)throw new Error('"at" index out of bounds');if(r!==Math.floor(r))throw new Error('"at" index must be an integer');return n[r]}}class ht{constructor(t,e){this.key=t,this.obj=e,this.type=O}static parse(t,e){let r,n;switch(t.length){case 2:return r=kt(t[1],e),new ht(r);case 3:return r=kt(t[1],e),n=kt(t[2],e),new ht(r,n);default:throw new Error('"get" expects 1 or 2 arguments')}}evaluate(t,e){const r=this.key.evaluate(t,e);return this.obj?this.obj.evaluate(t,e)[r]:null==t?void 0:t.values[r]}}class pt{constructor(t,e){this.key=t,this.obj=e,this.type=P}static parse(t,e){let r,n;switch(t.length){case 2:return r=kt(t[1],e),new pt(r);case 3:return r=kt(t[1],e),n=kt(t[2],e),new pt(r,n);default:throw new Error('"has" expects 1 or 2 arguments')}}evaluate(t,e){const r=this.key.evaluate(t,e);return this.obj?r in this.obj.evaluate(t,e):!(null==t||!t.values[r])}}class yt{constructor(t,e){this.key=t,this.vals=e,this.type=P}static parse(t,e){if(3!==t.length)throw new Error('"in" expects 2 arguments');return new yt(kt(t[1],e),kt(t[2],e))}evaluate(t,e){const r=this.key.evaluate(t,e);return-1!==this.vals.evaluate(t,e).indexOf(r)}}class ft{constructor(t,e,r){this.item=t,this.array=e,this.from=r,this.type=N}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"index-of" expects 3 or 4 arguments');const r=kt(t[1],e),n=kt(t[2],e);if(4===t.length){const i=kt(t[3],e,N);return new ft(r,n,i)}return new ft(r,n)}evaluate(t,e){const r=this.item.evaluate(t,e),n=this.array.evaluate(t,e);if(this.from){const i=this.from.evaluate(t,e);if(i!==Math.floor(i))throw new Error('"index-of" index must be an integer');return n.indexOf(r,i)}return n.indexOf(r)}}class gt{constructor(t){this.arg=t,this.type=N}static parse(t,e){if(2!==t.length)throw new Error('"length" expects 2 arguments');const r=kt(t[1],e);return new gt(r)}evaluate(t,e){const r=this.arg.evaluate(t,e);if("string"==typeof r)return r.length;if(Array.isArray(r))return r.length;throw new Error('"length" expects string or array')}}class dt{constructor(t,e,r,n){this.type=t,this.array=e,this.from=r,this.to=n}static parse(t,e){if(t.length<3||t.length>4)throw new Error('"slice" expects 2 or 3 arguments');const r=kt(t[1],e),n=kt(t[2],e,N);if(n.type!==N)throw new Error('"slice" index must return a number');if(4===t.length){const i=kt(t[3],e,N);if(i.type!==N)throw new Error('"slice" index must return a number');return new dt(r.type,r,n,i)}return new dt(r.type,r,n)}evaluate(t,e){const r=this.array.evaluate(t,e);if(!Array.isArray(r)&&"string"!=typeof r)throw new Error('"slice" input must be an array or a string');const n=this.from.evaluate(t,e);if(n<0||n>=r.length)throw new Error('"slice" index out of bounds');if(n!==Math.floor(n))throw new Error('"slice" index must be an integer');if(this.to){const i=this.to.evaluate(t,e);if(i<0||i>=r.length)throw new Error('"slice" index out of bounds');if(i!==Math.floor(i))throw new Error('"slice" index must be an integer');return r.slice(n,i)}return r.slice(n)}}class _t{constructor(){this.type=P}static parse(t){if(1!==t.length)throw new Error('"has-id" expects no arguments');return new _t}evaluate(t,e){return t&&void 0!==t.id}}class mt{constructor(t,e){this.args=t,this.calculate=e,this.type=N}static parse(t,e,r){const n=t.slice(1).map(t=>kt(t,e));return new mt(n,r)}evaluate(t,e){let r;return this.args&&(r=this.args.map(r=>r.evaluate(t,e))),this.calculate(r)}}class bt extends mt{static parse(t,e){switch(t.length){case 2:return mt.parse(t,e,t=>-t[0]);case 3:return mt.parse(t,e,t=>t[0]-t[1]);default:throw new Error('"-" expects 1 or 2 arguments')}}}class wt extends mt{static parse(t,e){return mt.parse(t,e,t=>{let e=1;for(const r of t)e*=r;return e})}}class vt extends mt{static parse(t,e){if(3===t.length)return mt.parse(t,e,t=>t[0]/t[1]);throw new Error('"/" expects 2 arguments')}}class Et extends mt{static parse(t,e){if(3===t.length)return mt.parse(t,e,t=>t[0]%t[1]);throw new Error('"%" expects 2 arguments')}}class It extends mt{static parse(t,e){if(3===t.length)return mt.parse(t,e,t=>t[0]**t[1]);throw new Error('"^" expects 1 or 2 arguments')}}class Tt extends mt{static parse(t,e){return mt.parse(t,e,t=>{let e=0;for(const r of t)e+=r;return e})}}class Dt{constructor(t,e){this.args=t,this.calculate=e,this.type=N}static parse(t,e){const r=t.slice(1).map(t=>kt(t,e));return new Dt(r,Dt.ops[t[0]])}evaluate(t,e){let r;return this.args&&(r=this.args.map(r=>r.evaluate(t,e))),this.calculate(r)}}Dt.ops={abs:t=>Math.abs(t[0]),acos:t=>Math.acos(t[0]),asin:t=>Math.asin(t[0]),atan:t=>Math.atan(t[0]),ceil:t=>Math.ceil(t[0]),cos:t=>Math.cos(t[0]),e:()=>Math.E,floor:t=>Math.floor(t[0]),ln:t=>Math.log(t[0]),ln2:()=>Math.LN2,log10:t=>Math.log(t[0])/Math.LN10,log2:t=>Math.log(t[0])/Math.LN2,max:t=>Math.max(...t),min:t=>Math.min(...t),pi:()=>Math.PI,round:t=>Math.round(t[0]),sin:t=>Math.sin(t[0]),sqrt:t=>Math.sqrt(t[0]),tan:t=>Math.tan(t[0])};class xt{constructor(t){this.args=t,this.type=A}static parse(t,e){return new xt(t.slice(1).map(t=>kt(t,e)))}evaluate(t,e){return this.args.map(r=>r.evaluate(t,e)).join("")}}class Rt{constructor(t,e){this.arg=t,this.calculate=e,this.type=A}static parse(t,e){if(2!==t.length)throw new Error(t[0]+" expects 1 argument");const r=kt(t[1],e);return new Rt(r,Rt.ops[t[0]])}evaluate(t,e){return this.calculate(this.arg.evaluate(t,e))}}Rt.ops={downcase:t=>t.toLowerCase(),upcase:t=>t.toUpperCase()};class Nt{constructor(t){this.args=t,this.type=S}static parse(t,e){if(4!==t.length)throw new Error('"rgb" expects 3 arguments');const r=t.slice(1).map(t=>kt(t,e));return new Nt(r)}evaluate(t,e){const r=this._validate(this.args[0].evaluate(t,e)),n=this._validate(this.args[1].evaluate(t,e)),i=this._validate(this.args[2].evaluate(t,e));return new I["a"]({r:r,g:n,b:i})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(t+": invalid color component");return Math.round(t)}}class At{constructor(t){this.args=t,this.type=S}static parse(t,e){if(5!==t.length)throw new Error('"rgba" expects 4 arguments');const r=t.slice(1).map(t=>kt(t,e));return new At(r)}evaluate(t,e){const r=this._validate(this.args[0].evaluate(t,e)),n=this._validate(this.args[1].evaluate(t,e)),i=this._validate(this.args[2].evaluate(t,e)),a=this._validateAlpha(this.args[3].evaluate(t,e));return new I["a"]({r:r,g:n,b:i,a:a})}_validate(t){if("number"!=typeof t||t<0||t>255)throw new Error(t+": invalid color component");return Math.round(t)}_validateAlpha(t){if("number"!=typeof t||t<0||t>1)throw new Error(t+": invalid alpha color component");return t}}class Pt{constructor(t){this.color=t,this.type=U(N,4)}static parse(t,e){if(2!==t.length)throw new Error('"to-rgba" expects 1 argument');const r=kt(t[1],e);return new Pt(r)}evaluate(t,e){return new I["a"](this.color.evaluate(t,e)).toRgba()}}class St{constructor(t,e){this.type=t,this.args=e}static parse(t,e){const r=t[0];if(t.length<2)throw new Error(r+" expects at least one argument");let n,i=1;if("array"===r){if(t.length>2){switch(t[1]){case"string":n=A;break;case"number":n=N;break;case"boolean":n=P;break;default:throw new Error('"array" type argument must be string, number or boolean')}i++}else n=O;let e;if(t.length>3){if(e=t[2],null!==e&&("number"!=typeof e||e<0||e!==Math.floor(e)))throw new Error('"array" length argument must be a positive integer literal');i++}n=U(n,e)}else switch(r){case"string":n=A;break;case"number":n=N;break;case"boolean":n=P;break;case"object":n=L}const a=[];for(;i<t.length;i++){const r=kt(t[i],e);a.push(r)}return new St(n,a)}evaluate(t,e){let r;for(const n of this.args){const i=n.evaluate(t,e);if(r=G(i),M(r,this.type))return i}throw new Error(`Expected ${B(this.type)} but got ${B(r)}`)}}class Lt{constructor(t,e){this.type=t,this.args=e}static parse(t,e){const r=t[0],n=Lt.types[r];if(n===P||n===A){if(2!==t.length)throw new Error(r+" expects one argument")}else if(t.length<2)throw new Error(r+" expects at least one argument");const i=[];for(let a=1;a<t.length;a++){const r=kt(t[a],e);i.push(r)}return new Lt(n,i)}evaluate(t,e){if(this.type===P)return Boolean(this.args[0].evaluate(t,e));if(this.type===A)return z(this.args[0].evaluate(t,e));if(this.type===N){for(const r of this.args){const n=Number(r.evaluate(t,e));if(!isNaN(n))return n}return null}if(this.type===S){for(const r of this.args)try{const n=Lt.toColor(r.evaluate(t,e));if(n instanceof I["a"])return n}catch{}return null}}static toBoolean(t){return Boolean(t)}static toString(t){return z(t)}static toNumber(t){const e=Number(t);if(isNaN(e))throw new Error(`"${t}" is not a number`);return e}static toColor(t){if(t instanceof I["a"])return t;if("string"==typeof t){const e=I["a"].fromString(t);if(e)return e;throw new Error(`"${t}" is not a color`)}if(Array.isArray(t))return I["a"].fromArray(t);throw new Error(`"${t}" is not a color`)}}Lt.types={"to-boolean":P,"to-color":S,"to-number":N,"to-string":A};class Ot{constructor(t){this.val=t,this.type=G(t)}static parse(t){if(2!==t.length)throw new Error('"literal" expects 1 argument');return new Ot(t[1])}evaluate(t,e){return this.val}}class Ut{constructor(t){this.arg=t,this.type=A}static parse(t,e){if(2!==t.length)throw new Error('"typeof" expects 1 argument');return new Ut(kt(t[1],e))}evaluate(t,e){return B(G(this.arg.evaluate(t,e)))}}function kt(t,e,r){const n=typeof t;if("string"===n||"boolean"===n||"number"===n||null===t){if(r)switch(r.kind){case"string":"string"!==n&&(t=Lt.toString(t));break;case"number":"number"!==n&&(t=Lt.toNumber(t));break;case"color":t=Lt.toColor(t)}t=["literal",t]}if(!Array.isArray(t)||0===t.length)throw new Error("Expression must be a non empty array");const i=t[0];if("string"!=typeof i)throw new Error("First element of expression must be a string");const a=Bt[i];if(void 0===a)throw new Error(`Invalid expression operator "${i}"`);if(!a)throw new Error(`Unimplemented expression operator "${i}"`);return a.parse(t,e,r)}const Bt={array:St,boolean:St,collator:null,format:null,image:null,literal:Ot,number:St,"number-format":null,object:St,string:St,"to-boolean":Lt,"to-color":Lt,"to-number":Lt,"to-string":Lt,typeof:Ut,accumulated:null,"feature-state":null,"geometry-type":$,id:C,"line-progress":null,properties:Y,at:ct,get:ht,has:pt,in:yt,"index-of":ft,length:gt,slice:dt,"!":X,"!=":K,"<":W,"<=":Z,"==":q,">":J,">=":Q,all:tt,any:et,case:nt,coalesce:it,match:at,within:null,interpolate:st,"interpolate-hcl":st,"interpolate-lab":st,step:ot,let:lt,var:ut,concat:xt,downcase:Rt,"is-supported-script":null,"resolved-locale":null,upcase:Rt,rgb:Nt,rgba:At,"to-rgba":Pt,"-":bt,"*":wt,"/":vt,"%":Et,"^":It,"+":Tt,abs:Dt,acos:Dt,asin:Dt,atan:Dt,ceil:Dt,cos:Dt,e:Dt,floor:Dt,ln:Dt,ln2:Dt,log10:Dt,log2:Dt,max:Dt,min:Dt,pi:Dt,round:Dt,sin:Dt,sqrt:Dt,tan:Dt,zoom:j,"heatmap-density":null,"has-id":_t,none:rt};class Gt{constructor(t){this._expression=t}filter(t,e){if(!this._expression)return!0;try{return this._expression.evaluate(t,e)}catch(r){return console.log(r.message),!0}}static createFilter(t){if(!t)return null;this.isLegacyFilter(t)&&(t=this.convertLegacyFilter(t));try{const e=kt(t,null,P);return new Gt(e)}catch(e){return console.log(e.message),null}}static isLegacyFilter(t){if(!Array.isArray(t))return!0;if(0===t.length)return!0;switch(t[0]){case"==":case"!=":case">":case"<":case">=":case"<=":return 3===t.length&&"string"==typeof t[1]&&!Array.isArray(t[2]);case"in":return t.length>=3&&"string"==typeof t[1]&&!Array.isArray(t[2]);case"!in":case"none":case"!has":return!0;case"any":case"all":for(let e=1;e<t.length;e++)if(!this.isLegacyFilter(t[1]))return!1;return!0;case"has":return 2===t.length&&("$id"===t[1]||"$type"===t[1]);default:return!1}}static convertLegacyFilter(t){if(!Array.isArray(t)||0===t.length)return!0;const e=t[0];if(1===t.length)return"any"!==e;switch(e){case"==":return Gt.convertComparison("==",t[1],t[2]);case"!=":return Gt.negate(Gt.convertComparison("==",t[1],t[2]));case">":case"<":case">=":case"<=":return Gt.convertComparison(e,t[1],t[2]);case"in":return Gt.convertIn(t[1],t.slice(2));case"!in":return Gt.negate(Gt.convertIn(t[1],t.slice(2)));case"any":case"all":case"none":return Gt.convertCombining(e,t.slice(1));case"has":return Gt.convertHas(t[1]);case"!has":return Gt.negate(Gt.convertHas(t[1]));default:throw new Error("Unexpected legacy filter.")}}static convertComparison(t,e,r){switch(e){case"$type":return[t,["geometry-type"],r];case"$id":return[t,["id"],r];default:return[t,["get",e],r]}}static convertIn(t,e){switch(t){case"$type":return["in",["geometry-type"],["literal",e]];case"$id":return["in",["id"],["literal",e]];default:return["in",["get",t],["literal",e]]}}static convertHas(t){switch(t){case"$type":return!0;case"$id":return["has-id"];default:return["has",t]}}static convertCombining(t,e){return[t].concat(e.map(this.convertLegacyFilter))}static negate(t){return["!",t]}}var Mt=r("ef89");class zt{constructor(t,e){let r;switch(this.isDataDriven=!1,this.interpolator=null,t.type){case"number":case"color":r=!0;break;case"array":r="number"===t.value;break;default:r=!1}if(null==e&&(e=t.default),Array.isArray(e)&&e.length>0&&Bt[e[0]]){const r={number:N,color:S,string:A,boolean:P,enum:A};try{const n="array"===t.type?U(r[t.value]||O,t.length):r[t.type],i=kt(e,null,n);this.getValue=this._buildExpression(i,t),this.isDataDriven=!0,i instanceof st&&i.input instanceof j&&(this.interpolator=i)}catch(i){console.log(i.message),this.getValue=this._buildSimple(t.default)}return}r&&"interval"===e.type&&(r=!1);const n=e&&e.stops&&e.stops.length>0;if(n)for(const a of e.stops)a[1]=this._validate(a[1],t);if(this.isDataDriven=!!e&&!!e.property,this.isDataDriven)if(void 0!==e.default&&(e.default=this._validate(e.default,t)),n)switch(e.type){case"identity":this.getValue=this._buildIdentity(e,t);break;case"categorical":this.getValue=this._buildCategorical(e,t);break;default:this.getValue=r?this._buildInterpolate(e,t):this._buildInterval(e,t)}else this.getValue=this._buildIdentity(e,t);else n?this.getValue=r?this._buildZoomInterpolate(e):this._buildZoomInterval(e):(e=this._validate(e,t),this.getValue=this._buildSimple(e))}_validate(t,e){if("number"===e.type){if(t<e.minimum)return e.minimum;if(t>e.maximum)return e.maximum}else"color"===e.type?t=zt._parseColor(t):"enum"===e.type?"string"==typeof t&&(t=e.values.indexOf(t)):"array"===e.type&&"enum"===e.value?t=t.map(t=>"string"==typeof t?e.values.indexOf(t):t):"string"===e.type&&(t=z(t));return t}_buildSimple(t){return()=>t}_buildExpression(t,e){return(r,n)=>{try{const i=t.evaluate(n,r);return void 0===i?e.default:this._validate(i,e)}catch(i){return console.log(i.message),e.default}}}_buildIdentity(t,e){return(r,n)=>{let i;return n&&(i=n.values[t.property]),void 0!==i&&(i=this._validate(i,e)),null!=i?i:void 0!==t.default?t.default:e.default}}_buildCategorical(t,e){return(r,n)=>{let i;return n&&(i=n.values[t.property]),i=this._categorical(i,t.stops),void 0!==i?i:void 0!==t.default?t.default:e.default}}_buildInterval(t,e){return(r,n)=>{let i;return n&&(i=n.values[t.property]),"number"==typeof i?this._interval(i,t.stops):void 0!==t.default?t.default:e.default}}_buildInterpolate(t,e){return(r,n)=>{let i;return n&&(i=n.values[t.property]),"number"==typeof i?this._interpolate(i,t.stops,t.base||1):void 0!==t.default?t.default:e.default}}_buildZoomInterpolate(t){return e=>this._interpolate(e,t.stops,t.base||1)}_buildZoomInterval(t){return e=>this._interval(e,t.stops)}_categorical(t,e){const r=e.length;for(let n=0;n<r;n++)if(e[n][0]===t)return e[n][1]}_interval(t,e){const r=e.length;let n=0;for(let i=0;i<r&&e[i][0]<=t;i++)n=i;return e[n][1]}_interpolate(t,e,r){let n,i;const a=e.length;for(let s=0;s<a;s++){const r=e[s];if(!(r[0]<=t)){i=r;break}n=r}if(n&&i){const e=i[0]-n[0],a=t-n[0],s=1===r?a/e:(r**a-1)/(r**e-1);if(Array.isArray(n[1])){const t=n[1],e=i[1],r=[];for(let n=0;n<t.length;n++)r.push(Object(x["e"])(t[n],e[n],s));return r}return Object(x["e"])(n[1],i[1],s)}return n?n[1]:i?i[1]:void 0}static _isEmpty(t){for(const e in t)if(t.hasOwnProperty(e))return!1;return!0}static _parseColor(t){return Array.isArray(t)?t:("string"==typeof t&&(t=new I["a"](t)),t instanceof I["a"]&&!this._isEmpty(t)?I["a"].toUnitRGBA(t):void 0)}}var Ft=r("8c81");class Vt{constructor(t,e,r,n){switch(this.type=t,this.typeName=e.type,this.id=e.id,this.source=e.source,this.sourceLayer=e["source-layer"],this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,this.filter=e.filter,this.layout=e.layout,this.paint=e.paint,this.z=r,this.uid=n,t){case Mt["c"].BACKGROUND:this._layoutDefinition=Mt["b"].backgroundLayoutDefinition,this._paintDefinition=Mt["b"].backgroundPaintDefinition;break;case Mt["c"].FILL:this._layoutDefinition=Mt["b"].fillLayoutDefinition,this._paintDefinition=Mt["b"].fillPaintDefinition;break;case Mt["c"].LINE:this._layoutDefinition=Mt["b"].lineLayoutDefinition,this._paintDefinition=Mt["b"].linePaintDefinition;break;case Mt["c"].SYMBOL:this._layoutDefinition=Mt["b"].symbolLayoutDefinition,this._paintDefinition=Mt["b"].symbolPaintDefinition;break;case Mt["c"].CIRCLE:this._layoutDefinition=Mt["b"].circleLayoutDefinition,this._paintDefinition=Mt["b"].circlePaintDefinition}this._layoutProperties=this._parseLayout(this.layout),this._paintProperties=this._parsePaint(this.paint)}getFeatureFilter(){return void 0!==this._featureFilter?this._featureFilter:this._featureFilter=Gt.createFilter(this.filter)}getLayoutProperty(t){return this._layoutProperties[t]}getPaintProperty(t){return this._paintProperties[t]}getLayoutValue(t,e,r){let n;const i=this._layoutProperties[t];return i&&(n=i.getValue(e,r)),void 0===n&&(n=this._layoutDefinition[t].default),n}getPaintValue(t,e,r){let n;const i=this._paintProperties[t];return i&&(n=i.getValue(e,r)),void 0===n&&(n=this._paintDefinition[t].default),n}isPainterDataDriven(){const t=this._paintProperties;if(t)for(const e in t)if(t[e].isDataDriven)return!0;return!1}_parseLayout(t){const e={};for(const r in t){const n=this._layoutDefinition[r];n&&(e[r]=new zt(n,t[r]))}return e}_parsePaint(t){const e={};for(const r in t){const n=this._paintDefinition[r];n&&(e[r]=new zt(n,t[r]))}return e}computeAttributesKey(t,e,r,n){let i=0,a=0;for(const s of e){let t=3;if(!s||s!==n){const e=r[s],{isLayout:n,isOptional:i}=e,a=n?this.getLayoutProperty(s):this.getPaintProperty(s);t=null!=a&&a.interpolator?2:null!=a&&a.isDataDriven?1:i&&!a?3:0}a|=t<<i,i+=2}return a<<3|t}}class Ct extends Vt{constructor(t,e,r,n){super(t,e,r,n),this.backgroundMaterial=new f(this.computeAttributesKey(s["b"].BACKGROUND,f.ATTRIBUTES,f.ATTRIBUTES_INFO))}}class $t extends Vt{constructor(t,e,r,n){super(t,e,r,n);const i=this.getPaintProperty("fill-color"),a=this.getPaintProperty("fill-opacity"),o=this.getPaintProperty("fill-pattern");this.hasDataDrivenColor=null==i?void 0:i.isDataDriven,this.hasDataDrivenOpacity=null==a?void 0:a.isDataDriven,this.hasDataDrivenFill=this.hasDataDrivenColor||this.hasDataDrivenOpacity||(null==o?void 0:o.isDataDriven);const l=this.getPaintProperty("fill-outline-color");this.outlineUsesFillColor=!l,this.hasDataDrivenOutlineColor=null==l?void 0:l.isDataDriven,this.hasDataDrivenOutline=l?l.isDataDriven:!!i&&i.isDataDriven,this.hasDataDrivenOutline=(l?this.hasDataDrivenOutlineColor:this.hasDataDrivenColor)||this.hasDataDrivenOpacity,this.fillMaterial=new d(this.computeAttributesKey(s["b"].FILL,d.ATTRIBUTES,d.ATTRIBUTES_INFO)),this.outlineMaterial=new _(this.computeAttributesKey(s["b"].OUTLINE,this.outlineUsesFillColor?_.ATTRIBUTES_FILL:_.ATTRIBUTES_OUTLINE,this.outlineUsesFillColor?_.ATTRIBUTES_INFO_FILL:_.ATTRIBUTES_INFO_OUTLINE),this.outlineUsesFillColor)}}class Yt extends Vt{constructor(t,e,r,n){var i,a,o,l,u,c,h,p,y;super(t,e,r,n);const f=this.getPaintProperty("line-pattern");if(this.lineMaterial=new m(this.computeAttributesKey(s["b"].LINE,m.ATTRIBUTES,m.ATTRIBUTES_INFO,f?"line-dasharray":"")),this.hasDataDrivenLine=(null==(i=this.getPaintProperty("line-blur"))?void 0:i.isDataDriven)||(null==(a=this.getPaintProperty("line-color"))?void 0:a.isDataDriven)||(null==(o=this.getPaintProperty("line-gap-width"))?void 0:o.isDataDriven)||(null==(l=this.getPaintProperty("line-offset"))?void 0:l.isDataDriven)||(null==(u=this.getPaintProperty("line-opacity"))?void 0:u.isDataDriven)||(null==(c=this.getPaintProperty("line-pattern"))?void 0:c.isDataDriven)||(null==(h=this.getPaintProperty("line-dasharray"))?void 0:h.isDataDriven)||(null==(p=this.getLayoutProperty("line-cap"))?void 0:p.isDataDriven)||(null==(y=this.getPaintProperty("line-width"))?void 0:y.isDataDriven),this.canUseThinTessellation=!1,!this.hasDataDrivenLine){const t=this.getPaintProperty("line-width");if(!t||"number"==typeof t&&.5*t<Ft["O"]){const t=this.getPaintProperty("line-offset");(!t||"number"==typeof t&&0===t)&&(this.canUseThinTessellation=!0)}}}getDashKey(t,e){let r;switch(e){case a["d"].BUTT:r="Butt";break;case a["d"].ROUND:r="Round";break;case a["d"].SQUARE:r="Square";break;default:r="Butt"}return`dasharray-[${t.toString()}]-${r}`}}class jt extends Vt{constructor(t,e,r,n){var i,a,o,l,u,c,h,p,y,f,g,d;super(t,e,r,n),this.iconMaterial=new v(this.computeAttributesKey(s["b"].ICON,v.ATTRIBUTES,v.ATTRIBUTES_INFO)),this.textMaterial=new E(this.computeAttributesKey(s["b"].TEXT,E.ATTRIBUTES,E.ATTRIBUTES_INFO)),this.hasDataDrivenIcon=(null==(i=this.getPaintProperty("icon-color"))?void 0:i.isDataDriven)||(null==(a=this.getPaintProperty("icon-halo-blur"))?void 0:a.isDataDriven)||(null==(o=this.getPaintProperty("icon-halo-color"))?void 0:o.isDataDriven)||(null==(l=this.getPaintProperty("icon-halo-width"))?void 0:l.isDataDriven)||(null==(u=this.getPaintProperty("icon-opacity"))?void 0:u.isDataDriven)||(null==(c=this.getLayoutProperty("icon-size"))?void 0:c.isDataDriven),this.hasDataDrivenText=(null==(h=this.getPaintProperty("text-color"))?void 0:h.isDataDriven)||(null==(p=this.getPaintProperty("text-halo-blur"))?void 0:p.isDataDriven)||(null==(y=this.getPaintProperty("text-halo-color"))?void 0:y.isDataDriven)||(null==(f=this.getPaintProperty("text-halo-width"))?void 0:f.isDataDriven)||(null==(g=this.getPaintProperty("text-opacity"))?void 0:g.isDataDriven)||(null==(d=this.getLayoutProperty("text-size"))?void 0:d.isDataDriven)}}class Ht extends Vt{constructor(t,e,r,n){super(t,e,r,n),this.circleMaterial=new g(this.computeAttributesKey(s["b"].CIRCLE,g.ATTRIBUTES,g.ATTRIBUTES_INFO))}}class qt{constructor(t,e,r){var n,i,a,s,o;let l;this.allowOverlap=t.getLayoutValue("icon-allow-overlap",e),this.ignorePlacement=t.getLayoutValue("icon-ignore-placement",e),this.keepUpright=t.getLayoutValue("icon-keep-upright",e),this.optional=t.getLayoutValue("icon-optional",e),this.rotationAlignment=t.getLayoutValue("icon-rotation-alignment",e),this.rotationAlignment===Mt["a"].AUTO&&(this.rotationAlignment=r?Mt["a"].MAP:Mt["a"].VIEWPORT),l=t.getLayoutProperty("icon-anchor"),null!=(n=l)&&n.isDataDriven?this._anchorProp=l:this.anchor=t.getLayoutValue("icon-anchor",e),l=t.getLayoutProperty("icon-offset"),null!=(i=l)&&i.isDataDriven?this._offsetProp=l:this.offset=t.getLayoutValue("icon-offset",e),l=t.getLayoutProperty("icon-padding"),null!=(a=l)&&a.isDataDriven?this._paddingProp=l:this.padding=t.getLayoutValue("icon-padding",e),l=t.getLayoutProperty("icon-rotate"),null!=(s=l)&&s.isDataDriven?this._rotateProp=l:this.rotate=t.getLayoutValue("icon-rotate",e),l=t.getLayoutProperty("icon-size"),null!=(o=l)&&o.isDataDriven?this._sizeProp=l:this.size=t.getLayoutValue("icon-size",e)}update(t,e){this._anchorProp&&(this.anchor=this._anchorProp.getValue(t,e)),this._offsetProp&&(this.offset=this._offsetProp.getValue(t,e)),this._paddingProp&&(this.padding=this._paddingProp.getValue(t,e)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(t,e)),this._sizeProp&&(this.size=this._sizeProp.getValue(t,e))}}class Kt{constructor(t,e,r){var n,i,a,s,o,l,u,c,h,p,y;let f;this.allowOverlap=t.getLayoutValue("text-allow-overlap",e),this.ignorePlacement=t.getLayoutValue("text-ignore-placement",e),this.keepUpright=t.getLayoutValue("text-keep-upright",e),this.optional=t.getLayoutValue("text-optional",e),this.rotationAlignment=t.getLayoutValue("text-rotation-alignment",e),this.rotationAlignment===Mt["a"].AUTO&&(this.rotationAlignment=r?Mt["a"].MAP:Mt["a"].VIEWPORT),f=t.getLayoutProperty("text-anchor"),null!=(n=f)&&n.isDataDriven?this._anchorProp=f:this.anchor=t.getLayoutValue("text-anchor",e),f=t.getLayoutProperty("text-justify"),null!=(i=f)&&i.isDataDriven?this._justifyProp=f:this.justify=t.getLayoutValue("text-justify",e),f=t.getLayoutProperty("text-letter-spacing"),null!=(a=f)&&a.isDataDriven?this._letterSpacingProp=f:this.letterSpacing=t.getLayoutValue("text-letter-spacing",e),f=t.getLayoutProperty("text-line-height"),null!=(s=f)&&s.isDataDriven?this._lineHeightProp=f:this.lineHeight=t.getLayoutValue("text-line-height",e),f=t.getLayoutProperty("text-max-angle"),null!=(o=f)&&o.isDataDriven?this._maxAngleProp=f:this.maxAngle=t.getLayoutValue("text-max-angle",e),f=t.getLayoutProperty("text-max-width"),null!=(l=f)&&l.isDataDriven?this._maxWidthProp=f:this.maxWidth=t.getLayoutValue("text-max-width",e),f=t.getLayoutProperty("text-offset"),null!=(u=f)&&u.isDataDriven?this._offsetProp=f:this.offset=t.getLayoutValue("text-offset",e),f=t.getLayoutProperty("text-padding"),null!=(c=f)&&c.isDataDriven?this._paddingProp=f:this.padding=t.getLayoutValue("text-padding",e),f=t.getLayoutProperty("text-rotate"),null!=(h=f)&&h.isDataDriven?this._rotateProp=f:this.rotate=t.getLayoutValue("text-rotate",e),f=t.getLayoutProperty("text-size"),null!=(p=f)&&p.isDataDriven?this._sizeProp=f:this.size=t.getLayoutValue("text-size",e),f=t.getLayoutProperty("text-writing-mode"),null!=(y=f)&&y.isDataDriven?this._writingModeProp=f:this.writingMode=t.getLayoutValue("text-writing-mode",e)}update(t,e){this._anchorProp&&(this.anchor=this._anchorProp.getValue(t,e)),this._justifyProp&&(this.justify=this._justifyProp.getValue(t,e)),this._letterSpacingProp&&(this.letterSpacing=this._letterSpacingProp.getValue(t,e)),this._lineHeightProp&&(this.lineHeight=this._lineHeightProp.getValue(t,e)),this._maxAngleProp&&(this.maxAngle=this._maxAngleProp.getValue(t,e)),this._maxWidthProp&&(this.maxWidth=this._maxWidthProp.getValue(t,e)),this._offsetProp&&(this.offset=this._offsetProp.getValue(t,e)),this._paddingProp&&(this.padding=this._paddingProp.getValue(t,e)),this._rotateProp&&(this.rotate=this._rotateProp.getValue(t,e)),this._sizeProp&&(this.size=this._sizeProp.getValue(t,e)),this._writingModeProp&&(this.writingMode=this._writingModeProp.getValue(t,e))}}},3976:function(t,e,r){"use strict";r.d(e,"a",(function(){return i})),r.d(e,"b",(function(){return n}));class n{constructor(t,e){this.x=t,this.y=e}clone(){return new n(this.x,this.y)}equals(t,e){return t===this.x&&e===this.y}isEqual(t){return t.x===this.x&&t.y===this.y}setCoords(t,e){this.x=t,this.y=e}normalize(){const t=this.x,e=this.y,r=Math.sqrt(t*t+e*e);this.x/=r,this.y/=r}rightPerpendicular(){const t=this.x;this.x=this.y,this.y=-t}move(t,e){this.x+=t,this.y+=e}assign(t){this.x=t.x,this.y=t.y}assignAdd(t,e){this.x=t.x+e.x,this.y=t.y+e.y}assignSub(t,e){this.x=t.x-e.x,this.y=t.y-e.y}rotate(t,e){const r=this.x,n=this.y;this.x=r*t-n*e,this.y=r*e+n*t}scale(t){this.x*=t,this.y*=t}length(){const t=this.x,e=this.y;return Math.sqrt(t*t+e*e)}static distance(t,e){const r=e.x-t.x,n=e.y-t.y;return Math.sqrt(r*r+n*n)}static add(t,e){return new n(t.x+e.x,t.y+e.y)}static sub(t,e){return new n(t.x-e.x,t.y-e.y)}}var i;!function(t){t[t.Unknown=0]="Unknown",t[t.Point=1]="Point",t[t.LineString=2]="LineString",t[t.Polygon=3]="Polygon"}(i||(i={}))},"901e":function(t,e,r){"use strict";r.d(e,"a",(function(){return a}));var n=r("ef89"),i=r("229e");class a{constructor(t){if(this._style=t,this.backgroundBucketIds=[],this._uidToLayer=new Map,this._layerByName={},this._runningId=0,t.layers||(t.layers=[]),this.version=parseFloat(t.version),this.layers=t.layers.map((t,e,r)=>this._create(t,e,r)),this.layers){let t;for(let e=0;e<this.layers.length;e++)t=this.layers[e],this._layerByName[t.id]=t,this._uidToLayer.set(t.uid,t),t.type===n["c"].BACKGROUND&&this.backgroundBucketIds.push(t.id)}this._identifyRefLayers()}isPainterDataDriven(t){const e=this._layerByName[t];return!!e&&e.isPainterDataDriven()}getStyleLayerId(t){return t>=this.layers.length?null:this.layers[t].id}getStyleLayerByUID(t){const e=this._uidToLayer.get(t);return null!=e?e:null}getStyleLayerIndex(t){const e=this._layerByName[t];return e?this.layers.indexOf(e):-1}setStyleLayer(t,e){if(!t||!t.id)return;const r=this._style;null!=e&&e>=this.layers.length&&(e=this.layers.length-1);let n,i=!0;const s=this._layerByName[t.id];if(s){const o=this.layers.indexOf(s);e||(e=o),e===o?(i=!1,n=a._recreateLayer(t,s),this.layers[e]=n,r.layers[e]=t):(this.layers.splice(o,1),r.layers.splice(o,1),n=this._create(t,e,this.layers),this.layers.splice(e,0,n),r.layers.splice(e,0,t))}else n=this._create(t,e,this.layers),!e||e>=this.layers.length?(this.layers.push(n),r.layers.push(t)):(this.layers.splice(e,0,n),r.layers.splice(e,0,t));this._layerByName[t.id]=n,this._uidToLayer.set(n.uid,n),i&&this._recomputeZValues(),this._identifyRefLayers()}getStyleLayer(t){const e=this._layerByName[t];return e?{type:e.typeName,id:e.id,source:e.source,"source-layer":e.sourceLayer,minzoom:e.minzoom,maxzoom:e.maxzoom,filter:e.filter,layout:e.layout,paint:e.paint}:null}deleteStyleLayer(t){const e=this._layerByName[t];if(e){delete this._layerByName[t],this._uidToLayer.delete(e.uid);const r=this.layers.indexOf(e);this.layers.splice(r,1),this._style.layers.splice(r,1),this._recomputeZValues(),this._identifyRefLayers()}}getLayerById(t){return this._layerByName[t]}getLayoutProperties(t){const e=this._layerByName[t];return e?e.layout:null}getPaintProperties(t){const e=this._layerByName[t];return e?e.paint:null}setPaintProperties(t,e){const r=this._layerByName[t];if(!r)return;const n={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:r.layout,paint:e},i=a._recreateLayer(n,r),s=this.layers.indexOf(r);this.layers[s]=i,this._style.layers[s].paint=e,this._layerByName[r.id]=i,this._uidToLayer.set(r.uid,i)}setLayoutProperties(t,e){const r=this._layerByName[t];if(!r)return;const n={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:e,paint:r.paint},i=a._recreateLayer(n,r),s=this.layers.indexOf(r);this.layers[s]=i,this._style.layers[s].layout=e,this._layerByName[r.id]=i,this._uidToLayer.set(r.uid,i)}setStyleLayerVisibility(t,e){const r=this._layerByName[t];if(!r)return;const n=r.layout||{};n.visibility=e;const i={type:r.typeName,id:r.id,source:r.source,"source-layer":r.sourceLayer,minzoom:r.minzoom,maxzoom:r.maxzoom,filter:r.filter,layout:n,paint:r.paint},s=a._recreateLayer(i,r),o=this.layers.indexOf(r);this.layers[o]=s,this._style.layers[o].layout=n,this._layerByName[r.id]=s,this._uidToLayer.set(r.uid,s)}getStyleLayerVisibility(t){var e;const r=this._layerByName[t];if(!r)return"none";const n=r.layout;return null!=(e=null==n?void 0:n.visibility)?e:"visible"}_recomputeZValues(){const t=this.layers,e=1/(t.length+1);for(let r=0;r<t.length;r++)t[r].z=1-(1+r)*e}_identifyRefLayers(){const t=[],e=[];let r=0;for(const s of this.layers){const o=s.layout;if(s.type===n["c"].FILL){var i;const e=s;let n=s.source+"|"+s.sourceLayer;n+=null!=(i="|"+(null==o?void 0:o.visibility))?i:"",n+="|"+s.minzoom,n+="|"+s.maxzoom,n+="|"+JSON.stringify(s.filter),(e.hasDataDrivenFill||e.hasDataDrivenOutline)&&(n+="|"+r),t.push({key:n,layer:s})}else if(s.type===n["c"].LINE){var a;const t=s;let n=s.source+"|"+s.sourceLayer;n+=null!=(a="|"+(null==o?void 0:o.visibility))?a:"",n+="|"+s.minzoom,n+="|"+s.maxzoom,n+="|"+JSON.stringify(s.filter),n+="|"+(void 0!==o?o["line-cap"]:""),n+="|"+(void 0!==o?o["line-join"]:""),t.hasDataDrivenLine&&(n+="|"+r),e.push({key:n,layer:s})}++r}this._assignRefLayers(t),this._assignRefLayers(e)}_assignRefLayers(t){let e,r;t.sort((t,e)=>t.key<e.key?-1:t.key>e.key?1:0);const i=t.length;for(let a=0;a<i;a++){const s=t[a];if(s.key===e)s.layer.refLayerId=r;else if(e=s.key,r=s.layer.id,s.layer.type===n["c"].FILL){if(!s.layer.getPaintProperty("fill-outline-color"))for(let n=a+1;n<i;n++){const i=t[n];if(i.key!==e)break;if(i.layer.getPaintProperty("fill-outline-color")){t[a]=i,t[n]=s,r=i.layer.id;break}}}else if(s.layer.type===n["c"].LINE){let n=s.layer;for(let o=a+1;o<i;o++){const i=t[o];if(i.key!==e)break;const l=i.layer;(n.canUseThinTessellation&&!l.canUseThinTessellation||!n.canUseThinTessellation&&(l.getPaintProperty("line-pattern")||l.getPaintProperty("line-dasharray")))&&(n=l,t[a]=i,t[o]=s,r=i.layer.id)}}}}_create(t,e,r){const a=1-(1+e)*(1/(r.length+1)),s=this._runningId++;switch(t.type){case"background":return new i["a"](n["c"].BACKGROUND,t,a,s);case"fill":return new i["c"](n["c"].FILL,t,a,s);case"line":return new i["e"](n["c"].LINE,t,a,s);case"symbol":return new i["f"](n["c"].SYMBOL,t,a,s);case"raster":throw new Error("Unsupported vector tile raster layer");case"circle":return new i["b"](n["c"].CIRCLE,t,a,s)}throw new Error("Unknown vector tile layer")}static _recreateLayer(t,e){switch(t.type){case"background":return new i["a"](n["c"].BACKGROUND,t,e.z,e.uid);case"fill":return new i["c"](n["c"].FILL,t,e.z,e.uid);case"line":return new i["e"](n["c"].LINE,t,e.z,e.uid);case"symbol":return new i["f"](n["c"].SYMBOL,t,e.z,e.uid);case"raster":throw new Error("Unsupported vector tile raster layer");case"circle":return new i["b"](n["c"].CIRCLE,t,e.z,e.uid)}}}},ae0b:function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));class n{constructor(t){this._array=[],t<=0&&console.error("strideInBytes must be positive!"),this._stride=t}get array(){return this._array}get index(){return 4*this._array.length/this._stride}get itemSize(){return this._stride}get sizeInBytes(){return 4*this._array.length}reset(){this.array.length=0}toBuffer(){return new Uint32Array(this._array).buffer}static i1616to32(t,e){return 65535&t|e<<16}static i8888to32(t,e,r,n){return 255&t|(255&e)<<8|(255&r)<<16|n<<24}static i8816to32(t,e,r){return 255&t|(255&e)<<8|r<<16}}},d329:function(t,e,r){"use strict";function n(t){return"r"in t&&"g"in t&&"b"in t}function i(t){return"h"in t&&"s"in t&&"v"in t}function a(t){return"l"in t&&"a"in t&&"b"in t}function s(t){return"l"in t&&"c"in t&&"h"in t}function o(t){return"x"in t&&"y"in t&&"z"in t}r.d(e,"a",(function(){return T})),r.d(e,"b",(function(){return D})),r.d(e,"c",(function(){return x})),r.d(e,"d",(function(){return I}));const l=[[.4124,.3576,.1805],[.2126,.7152,.0722],[.0193,.1192,.9505]],u=[[3.2406,-1.5372,-.4986],[-.9689,1.8758,.0415],[.0557,-.204,1.057]];function c(t,e){const r=[];let n,i;if(t[0].length!==e.length)throw"dimensions do not match";const a=t.length,s=t[0].length;let o=0;for(n=0;n<a;n++){for(o=0,i=0;i<s;i++)o+=t[n][i]*e[i];r.push(o)}return r}function h(t){const e=[t.r/255,t.g/255,t.b/255].map(t=>t<=.04045?t/12.92:((t+.055)/1.055)**2.4),r=c(l,e);return{x:100*r[0],y:100*r[1],z:100*r[2]}}function p(t){const e=c(u,[t.x/100,t.y/100,t.z/100]).map(t=>{const e=t<=.0031308?12.92*t:1.055*t**(1/2.4)-.055;return Math.min(1,Math.max(e,0))});return{r:Math.round(255*e[0]),g:Math.round(255*e[1]),b:Math.round(255*e[2])}}function y(t){const e=[t.x/95.047,t.y/100,t.z/108.883].map(t=>t>(6/29)**3?t**(1/3):1/3*(29/6)**2*t+4/29);return{l:116*e[1]-16,a:500*(e[0]-e[1]),b:200*(e[1]-e[2])}}function f(t){const e=t.l,r=[(e+16)/116+t.a/500,(e+16)/116,(e+16)/116-t.b/200].map(t=>t>6/29?t**3:3*(6/29)**2*(t-4/29));return{x:95.047*r[0],y:100*r[1],z:108.883*r[2]}}function g(t){const e=t.l,r=t.a,n=t.b,i=Math.sqrt(r*r+n*n);let a=Math.atan2(n,r);return a=a>0?a:a+2*Math.PI,{l:e,c:i,h:a}}function d(t){const e=t.l,r=t.c,n=t.h;return{l:e,a:r*Math.cos(n),b:r*Math.sin(n)}}function _(t){return y(h(t))}function m(t){return p(f(t))}function b(t){return g(y(h(t)))}function w(t){return p(f(d(t)))}function v(t){const e=t.r,r=t.g,n=t.b,i=Math.max(e,r,n),a=i-Math.min(e,r,n);let s=i,o=0===a?0:i===e?(r-n)/a%6:i===r?(n-e)/a+2:(e-r)/a+4,l=0===a?0:a/s;return o<0&&(o+=6),o*=60,l*=100,s*=100/255,{h:o,s:l,v:s}}function E(t){const e=(t.h+360)%360/60,r=t.s/100,n=t.v/100*255,i=n*r,a=i*(1-Math.abs(e%2-1));let s;switch(Math.floor(e)){case 0:s={r:i,g:a,b:0};break;case 1:s={r:a,g:i,b:0};break;case 2:s={r:0,g:i,b:a};break;case 3:s={r:0,g:a,b:i};break;case 4:s={r:a,g:0,b:i};break;case 5:case 6:s={r:i,g:0,b:a};break;default:s={r:0,g:0,b:0}}return s.r=Math.round(s.r+n-i),s.g=Math.round(s.g+n-i),s.b=Math.round(s.b+n-i),s}function I(t){return n(t)?t:s(t)?w(t):a(t)?m(t):o(t)?p(t):i(t)?E(t):t}function T(t){return i(t)?t:v(I(t))}function D(t){return a(t)?t:_(I(t))}function x(t){return s(t)?t:b(I(t))}}}]);
- //# sourceMappingURL=chunk-d2111408.350835c9.js.map
|