@mappedin/mappedin-js 6.0.1-beta.9 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +103 -7
  2. package/THIRD_PARTY_LICENSES.txt +8938 -21631
  3. package/lib/esm/GLTFExporter-AEIYURV6.js +2 -0
  4. package/lib/esm/GLTFExporter-AEIYURV6.js.map +7 -0
  5. package/lib/esm/GLTFLoader-YNJUYSBY.js +2 -0
  6. package/lib/esm/GLTFLoader-YNJUYSBY.js.map +7 -0
  7. package/lib/esm/chunk-C5ID5LHV.js +938 -0
  8. package/lib/esm/chunk-C5ID5LHV.js.map +7 -0
  9. package/lib/esm/chunk-DBCMQGTD.js +3820 -0
  10. package/lib/esm/chunk-DBCMQGTD.js.map +7 -0
  11. package/lib/esm/chunk-KYQ66GHT.js +2048 -0
  12. package/lib/esm/chunk-KYQ66GHT.js.map +7 -0
  13. package/lib/esm/chunk-RIFXMIJM.js +2 -0
  14. package/lib/esm/chunk-RIFXMIJM.js.map +7 -0
  15. package/lib/esm/chunk-ROCNZJLL.js +2 -0
  16. package/lib/esm/chunk-ROCNZJLL.js.map +7 -0
  17. package/lib/esm/fonts/roboto-regular.ttf +0 -0
  18. package/lib/esm/index.css +2 -1
  19. package/lib/esm/index.css.map +7 -0
  20. package/lib/esm/index.d.ts +27257 -25380
  21. package/lib/esm/index.js +2 -1
  22. package/lib/esm/index.js.map +7 -0
  23. package/lib/esm/inspector-2XETNHYZ.css +2 -0
  24. package/lib/esm/inspector-2XETNHYZ.css.map +7 -0
  25. package/lib/esm/inspector-J5CSSXEZ.js +483 -0
  26. package/lib/esm/inspector-J5CSSXEZ.js.map +7 -0
  27. package/lib/esm/internal-HTTM4ECA.js +2 -0
  28. package/lib/esm/internal-HTTM4ECA.js.map +7 -0
  29. package/lib/esm/internal-R5XTRV7Q.css +2 -0
  30. package/lib/esm/internal-R5XTRV7Q.css.map +7 -0
  31. package/lib/esm/roboto-regular-R5KXKW73.js +2 -0
  32. package/lib/esm/roboto-regular-R5KXKW73.js.map +7 -0
  33. package/lib/esm/text3d-AXM5ZHCS.css +2 -0
  34. package/lib/esm/text3d-AXM5ZHCS.css.map +7 -0
  35. package/lib/esm/text3d-FUGEPZHU.js +253 -0
  36. package/lib/esm/text3d-FUGEPZHU.js.map +7 -0
  37. package/lib/esm/workers/collision-worker.csp.js +23 -0
  38. package/lib/esm/workers/maplibre-worker.csp.js +2 -0
  39. package/lib/index-rn.js +4306 -0
  40. package/lib/index.css +2 -1
  41. package/package.json +24 -21
  42. package/lib/esm/GLTFExporter-DDZP3YM5.js +0 -1
  43. package/lib/esm/GLTFLoader-54EWX6DJ.js +0 -1
  44. package/lib/esm/browser-UXFEBJ7R.js +0 -1
  45. package/lib/esm/chunk-A35HKGOE.js +0 -1
  46. package/lib/esm/chunk-FE5S74VA.js +0 -1
  47. package/lib/esm/chunk-NTOUDKDJ.js +0 -1
  48. package/lib/esm/chunk-RZFBTKMI.js +0 -1
  49. package/lib/esm/chunk-SHB4JBRW.js +0 -1
  50. package/lib/esm/chunk-WVWEOR6I.js +0 -1
  51. package/lib/esm/inspector-HCNPJZJK.js +0 -1
  52. package/lib/esm/inspector-OZDC5DPH.css +0 -1
  53. package/lib/esm/internal-4B7MJ7JY.js +0 -1
  54. package/lib/esm/outdoor-context-v4-M3BL3WQZ.js +0 -1
@@ -0,0 +1,2 @@
1
+ (()=>{var jy=Object.create;var Hi=Object.defineProperty;var qy=Object.getOwnPropertyDescriptor;var Wy=Object.getOwnPropertyNames;var Xy=Object.getPrototypeOf,Hy=Object.prototype.hasOwnProperty;var l=(t,e)=>Hi(t,"name",{value:e,configurable:!0});var Zy=(t,e)=>()=>(t&&(e=t(t=0)),e);var we=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jy=(t,e)=>{for(var r in e)Hi(t,r,{get:e[r],enumerable:!0})},Yy=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Wy(e))!Hy.call(t,i)&&i!==r&&Hi(t,i,{get:()=>e[i],enumerable:!(n=qy(e,i))||n.enumerable});return t};var ee=(t,e,r)=>(r=t!=null?jy(Xy(t)):{},Yy(e||!t||!t.__esModule?Hi(r,"default",{value:t,enumerable:!0}):r,t));var g=Zy(()=>{});var de=we((d0,lu)=>{"use strict";g();lu.exports=br;function br(t,e){this.x=t,this.y=e}l(br,"Point");br.prototype={clone:l(function(){return new br(this.x,this.y)},"clone"),add:l(function(t){return this.clone()._add(t)},"add"),sub:l(function(t){return this.clone()._sub(t)},"sub"),multByPoint:l(function(t){return this.clone()._multByPoint(t)},"multByPoint"),divByPoint:l(function(t){return this.clone()._divByPoint(t)},"divByPoint"),mult:l(function(t){return this.clone()._mult(t)},"mult"),div:l(function(t){return this.clone()._div(t)},"div"),rotate:l(function(t){return this.clone()._rotate(t)},"rotate"),rotateAround:l(function(t,e){return this.clone()._rotateAround(t,e)},"rotateAround"),matMult:l(function(t){return this.clone()._matMult(t)},"matMult"),unit:l(function(){return this.clone()._unit()},"unit"),perp:l(function(){return this.clone()._perp()},"perp"),round:l(function(){return this.clone()._round()},"round"),mag:l(function(){return Math.sqrt(this.x*this.x+this.y*this.y)},"mag"),equals:l(function(t){return this.x===t.x&&this.y===t.y},"equals"),dist:l(function(t){return Math.sqrt(this.distSqr(t))},"dist"),distSqr:l(function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},"distSqr"),angle:l(function(){return Math.atan2(this.y,this.x)},"angle"),angleTo:l(function(t){return Math.atan2(this.y-t.y,this.x-t.x)},"angleTo"),angleWith:l(function(t){return this.angleWithSep(t.x,t.y)},"angleWith"),angleWithSep:l(function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},"angleWithSep"),_matMult:l(function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},"_matMult"),_add:l(function(t){return this.x+=t.x,this.y+=t.y,this},"_add"),_sub:l(function(t){return this.x-=t.x,this.y-=t.y,this},"_sub"),_mult:l(function(t){return this.x*=t,this.y*=t,this},"_mult"),_div:l(function(t){return this.x/=t,this.y/=t,this},"_div"),_multByPoint:l(function(t){return this.x*=t.x,this.y*=t.y,this},"_multByPoint"),_divByPoint:l(function(t){return this.x/=t.x,this.y/=t.y,this},"_divByPoint"),_unit:l(function(){return this._div(this.mag()),this},"_unit"),_perp:l(function(){var t=this.y;return this.y=this.x,this.x=-t,this},"_perp"),_rotate:l(function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},"_rotate"),_rotateAround:l(function(t,e){var r=Math.cos(t),n=Math.sin(t),i=e.x+r*(this.x-e.x)-n*(this.y-e.y),o=e.y+n*(this.x-e.x)+r*(this.y-e.y);return this.x=i,this.y=o,this},"_rotateAround"),_round:l(function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},"_round")};br.convert=function(t){return t instanceof br?t:Array.isArray(t)?new br(t[0],t[1]):t}});var pu=we((x0,cu)=>{"use strict";g();cu.exports=uu;function uu(t,e,r,n){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=r,this.p2y=n}l(uu,"UnitBezier");uu.prototype={sampleCurveX:l(function(t){return((this.ax*t+this.bx)*t+this.cx)*t},"sampleCurveX"),sampleCurveY:l(function(t){return((this.ay*t+this.by)*t+this.cy)*t},"sampleCurveY"),sampleCurveDerivativeX:l(function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},"sampleCurveDerivativeX"),solveCurveX:l(function(t,e){if(e===void 0&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var r=t,n=0;n<8;n++){var i=this.sampleCurveX(r)-t;if(Math.abs(i)<e)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r=r-i/o}var a=0,s=1;for(r=t,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-t)<e));n++)t>i?a=r:s=r,r=(s-a)*.5+a;return r},"solveCurveX"),solve:l(function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))},"solve")}});var sp=we((e1,rl)=>{g();function _g(t,e){var r,n,i,o,a,s,u,c,p,f;for(r=t.length&3,n=t.length-r,i=e,a=3432918353,u=461845907,f=0;f<n;)p=t.charCodeAt(f)&255|(t.charCodeAt(++f)&255)<<8|(t.charCodeAt(++f)&255)<<16|(t.charCodeAt(++f)&255)<<24,++f,p=(p&65535)*a+(((p>>>16)*a&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*u+(((p>>>16)*u&65535)<<16)&4294967295,i^=p,i=i<<13|i>>>19,o=(i&65535)*5+(((i>>>16)*5&65535)<<16)&4294967295,i=(o&65535)+27492+(((o>>>16)+58964&65535)<<16);switch(p=0,r){case 3:p^=(t.charCodeAt(f+2)&255)<<16;case 2:p^=(t.charCodeAt(f+1)&255)<<8;case 1:p^=t.charCodeAt(f)&255,p=(p&65535)*a+(((p>>>16)*a&65535)<<16)&4294967295,p=p<<15|p>>>17,p=(p&65535)*u+(((p>>>16)*u&65535)<<16)&4294967295,i^=p}return i^=t.length,i^=i>>>16,i=(i&65535)*2246822507+(((i>>>16)*2246822507&65535)<<16)&4294967295,i^=i>>>13,i=(i&65535)*3266489909+(((i>>>16)*3266489909&65535)<<16)&4294967295,i^=i>>>16,i>>>0}l(_g,"murmurhash3_32_gc");typeof rl<"u"&&(rl.exports=_g)});var lp=we((n1,nl)=>{g();function Ig(t,e){for(var r=t.length,n=e^r,i=0,o;r>=4;)o=t.charCodeAt(i)&255|(t.charCodeAt(++i)&255)<<8|(t.charCodeAt(++i)&255)<<16|(t.charCodeAt(++i)&255)<<24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),o^=o>>>24,o=(o&65535)*1540483477+(((o>>>16)*1540483477&65535)<<16),n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)^o,r-=4,++i;switch(r){case 3:n^=(t.charCodeAt(i+2)&255)<<16;case 2:n^=(t.charCodeAt(i+1)&255)<<8;case 1:n^=t.charCodeAt(i)&255,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16)}return n^=n>>>13,n=(n&65535)*1540483477+(((n>>>16)*1540483477&65535)<<16),n^=n>>>15,n>>>0}l(Ig,"murmurhash2_32_gc");typeof nl!==void 0&&(nl.exports=Ig)});var il=we((a1,oa)=>{g();var up=sp(),Tg=lp();oa.exports=up;oa.exports.murmur3=up;oa.exports.murmur2=Tg});var bl=we((o_,Wp)=>{"use strict";g();var yb=de();Wp.exports=Gr;function Gr(t,e,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=i,t.readFields(mb,this,e)}l(Gr,"VectorTileFeature");function mb(t,e,r){t==1?e.id=r.readVarint():t==2?hb(r,e):t==3?e.type=r.readVarint():t==4&&(e._geometry=r.pos)}l(mb,"readFeature");function hb(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var n=e._keys[t.readVarint()],i=e._values[t.readVarint()];e.properties[n]=i}}l(hb,"readTag");Gr.types=["Unknown","Point","LineString","Polygon"];Gr.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=[],s;t.pos<e;){if(n<=0){var u=t.readVarint();r=u&7,n=u>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),r===1&&(s&&a.push(s),s=[]),s.push(new yb(i,o));else if(r===7)s&&s.push(s[0].clone());else throw new Error("unknown command "+r)}return s&&a.push(s),a};Gr.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,u=1/0,c=-1/0;t.pos<e;){if(n<=0){var p=t.readVarint();r=p&7,n=p>>3}if(n--,r===1||r===2)i+=t.readSVarint(),o+=t.readSVarint(),i<a&&(a=i),i>s&&(s=i),o<u&&(u=o),o>c&&(c=o);else if(r!==7)throw new Error("unknown command "+r)}return[a,u,s,c]};Gr.prototype.toGeoJSON=function(t,e,r){var n=this.extent*Math.pow(2,r),i=this.extent*t,o=this.extent*e,a=this.loadGeometry(),s=Gr.types[this.type],u,c;function p(m){for(var h=0;h<m.length;h++){var d=m[h],x=180-(d.y+o)*360/n;m[h]=[(d.x+i)*360/n-180,360/Math.PI*Math.atan(Math.exp(x*Math.PI/180))-90]}}switch(l(p,"project"),this.type){case 1:var f=[];for(u=0;u<a.length;u++)f[u]=a[u][0];a=f,p(a);break;case 2:for(u=0;u<a.length;u++)p(a[u]);break;case 3:for(a=db(a),u=0;u<a.length;u++)for(c=0;c<a[u].length;c++)p(a[u][c]);break}a.length===1?a=a[0]:s="Multi"+s;var y={type:"Feature",geometry:{type:s,coordinates:a},properties:this.properties};return"id"in this&&(y.id=this.id),y};function db(t){var e=t.length;if(e<=1)return[t];for(var r=[],n,i,o=0;o<e;o++){var a=gb(t[o]);a!==0&&(i===void 0&&(i=a<0),i===a<0?(n&&r.push(n),n=[t[o]]):n.push(t[o]))}return n&&r.push(n),r}l(db,"classifyRings");function gb(t){for(var e=0,r=0,n=t.length,i=n-1,o,a;r<n;i=r++)o=t[r],a=t[i],e+=(a.x-o.x)*(o.y+a.y);return e}l(gb,"signedArea")});var xl=we((l_,Hp)=>{"use strict";g();var bb=bl();Hp.exports=Xp;function Xp(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(xb,this,e),this.length=this._features.length}l(Xp,"VectorTileLayer");function xb(t,e,r){t===15?e.version=r.readVarint():t===1?e.name=r.readString():t===5?e.extent=r.readVarint():t===2?e._features.push(r.pos):t===3?e._keys.push(r.readString()):t===4&&e._values.push(vb(r))}l(xb,"readLayer");function vb(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var n=t.readVarint()>>3;e=n===1?t.readString():n===2?t.readFloat():n===3?t.readDouble():n===4?t.readVarint64():n===5?t.readVarint():n===6?t.readSVarint():n===7?t.readBoolean():null}return e}l(vb,"readValueMessage");Xp.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new bb(this._pbf,e,this.extent,this._keys,this._values)}});var Jp=we((p_,Zp)=>{"use strict";g();var Pb=xl();Zp.exports=Sb;function Sb(t,e){this.layers=t.readFields(wb,{},e)}l(Sb,"VectorTile");function wb(t,e,r){if(t===3){var n=new Pb(r,r.readVarint()+r.pos);n.length&&(e[n.name]=n)}}l(wb,"readTile")});var Gt=we((m_,Sa)=>{g();Sa.exports.VectorTile=Jp();Sa.exports.VectorTileFeature=bl();Sa.exports.VectorTileLayer=xl()});var bf=we(Al=>{g();Al.read=function(t,e,r,n,i){var o,a,s=i*8-n-1,u=(1<<s)-1,c=u>>1,p=-7,f=r?i-1:0,y=r?-1:1,m=t[e+f];for(f+=y,o=m&(1<<-p)-1,m>>=-p,p+=s;p>0;o=o*256+t[e+f],f+=y,p-=8);for(a=o&(1<<-p)-1,o>>=-p,p+=n;p>0;a=a*256+t[e+f],f+=y,p-=8);if(o===0)o=1-c;else{if(o===u)return a?NaN:(m?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-c}return(m?-1:1)*a*Math.pow(2,o-n)};Al.write=function(t,e,r,n,i,o){var a,s,u,c=o*8-i-1,p=(1<<c)-1,f=p>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=n?0:o-1,h=n?1:-1,d=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=p):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+f>=1?e+=y/u:e+=y*Math.pow(2,1-f),e*u>=2&&(a++,u/=2),a+f>=p?(s=0,a=p):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a=a+f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[r+m]=s&255,m+=h,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[r+m]=a&255,m+=h,a/=256,c-=8);t[r+m-h]|=d*128}});var gi=we((hI,wf)=>{"use strict";g();wf.exports=Q;var Ta=bf();function Q(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}l(Q,"Pbf");Q.Varint=0;Q.Fixed64=1;Q.Bytes=2;Q.Fixed32=5;var _l=65536*65536,xf=1/_l,Ub=12,Sf=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");Q.prototype={destroy:l(function(){this.buf=null},"destroy"),readFields:l(function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=n&7,t(i,e,this),this.pos===o&&this.skip(n)}return e},"readFields"),readMessage:l(function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},"readMessage"),readFixed32:l(function(){var t=Ca(this.buf,this.pos);return this.pos+=4,t},"readFixed32"),readSFixed32:l(function(){var t=Pf(this.buf,this.pos);return this.pos+=4,t},"readSFixed32"),readFixed64:l(function(){var t=Ca(this.buf,this.pos)+Ca(this.buf,this.pos+4)*_l;return this.pos+=8,t},"readFixed64"),readSFixed64:l(function(){var t=Ca(this.buf,this.pos)+Pf(this.buf,this.pos+4)*_l;return this.pos+=8,t},"readSFixed64"),readFloat:l(function(){var t=Ta.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},"readFloat"),readDouble:l(function(){var t=Ta.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},"readDouble"),readVarint:l(function(t){var e=this.buf,r,n;return n=e[this.pos++],r=n&127,n<128||(n=e[this.pos++],r|=(n&127)<<7,n<128)||(n=e[this.pos++],r|=(n&127)<<14,n<128)||(n=e[this.pos++],r|=(n&127)<<21,n<128)?r:(n=e[this.pos],r|=(n&15)<<28,$b(r,t,this))},"readVarint"),readVarint64:l(function(){return this.readVarint(!0)},"readVarint64"),readSVarint:l(function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},"readSVarint"),readBoolean:l(function(){return!!this.readVarint()},"readBoolean"),readString:l(function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=Ub&&Sf?nx(this.buf,e,t):rx(this.buf,e,t)},"readString"),readBytes:l(function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},"readBytes"),readPackedVarint:l(function(t,e){if(this.type!==Q.Bytes)return t.push(this.readVarint(e));var r=gt(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},"readPackedVarint"),readPackedSVarint:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readSVarint());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},"readPackedSVarint"),readPackedBoolean:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readBoolean());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},"readPackedBoolean"),readPackedFloat:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readFloat());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},"readPackedFloat"),readPackedDouble:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readDouble());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},"readPackedDouble"),readPackedFixed32:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readFixed32());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},"readPackedFixed32"),readPackedSFixed32:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readSFixed32());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},"readPackedSFixed32"),readPackedFixed64:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readFixed64());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},"readPackedFixed64"),readPackedSFixed64:l(function(t){if(this.type!==Q.Bytes)return t.push(this.readSFixed64());var e=gt(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},"readPackedSFixed64"),skip:l(function(t){var e=t&7;if(e===Q.Varint)for(;this.buf[this.pos++]>127;);else if(e===Q.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Q.Fixed32)this.pos+=4;else if(e===Q.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+e)},"skip"),writeTag:l(function(t,e){this.writeVarint(t<<3|e)},"writeTag"),realloc:l(function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},"realloc"),finish:l(function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},"finish"),writeFixed32:l(function(t){this.realloc(4),$r(this.buf,t,this.pos),this.pos+=4},"writeFixed32"),writeSFixed32:l(function(t){this.realloc(4),$r(this.buf,t,this.pos),this.pos+=4},"writeSFixed32"),writeFixed64:l(function(t){this.realloc(8),$r(this.buf,t&-1,this.pos),$r(this.buf,Math.floor(t*xf),this.pos+4),this.pos+=8},"writeFixed64"),writeSFixed64:l(function(t){this.realloc(8),$r(this.buf,t&-1,this.pos),$r(this.buf,Math.floor(t*xf),this.pos+4),this.pos+=8},"writeSFixed64"),writeVarint:l(function(t){if(t=+t||0,t>268435455||t<0){jb(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))},"writeVarint"),writeSVarint:l(function(t){this.writeVarint(t<0?-t*2-1:t*2)},"writeSVarint"),writeBoolean:l(function(t){this.writeVarint(!!t)},"writeBoolean"),writeString:l(function(t){t=String(t),this.realloc(t.length*4),this.pos++;var e=this.pos;this.pos=ix(this.buf,t,this.pos);var r=this.pos-e;r>=128&&vf(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},"writeString"),writeFloat:l(function(t){this.realloc(4),Ta.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},"writeFloat"),writeDouble:l(function(t){this.realloc(8),Ta.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},"writeDouble"),writeBytes:l(function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},"writeBytes"),writeRawMessage:l(function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&vf(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},"writeRawMessage"),writeMessage:l(function(t,e,r){this.writeTag(t,Q.Bytes),this.writeRawMessage(e,r)},"writeMessage"),writePackedVarint:l(function(t,e){e.length&&this.writeMessage(t,Xb,e)},"writePackedVarint"),writePackedSVarint:l(function(t,e){e.length&&this.writeMessage(t,Hb,e)},"writePackedSVarint"),writePackedBoolean:l(function(t,e){e.length&&this.writeMessage(t,Yb,e)},"writePackedBoolean"),writePackedFloat:l(function(t,e){e.length&&this.writeMessage(t,Zb,e)},"writePackedFloat"),writePackedDouble:l(function(t,e){e.length&&this.writeMessage(t,Jb,e)},"writePackedDouble"),writePackedFixed32:l(function(t,e){e.length&&this.writeMessage(t,Kb,e)},"writePackedFixed32"),writePackedSFixed32:l(function(t,e){e.length&&this.writeMessage(t,Qb,e)},"writePackedSFixed32"),writePackedFixed64:l(function(t,e){e.length&&this.writeMessage(t,ex,e)},"writePackedFixed64"),writePackedSFixed64:l(function(t,e){e.length&&this.writeMessage(t,tx,e)},"writePackedSFixed64"),writeBytesField:l(function(t,e){this.writeTag(t,Q.Bytes),this.writeBytes(e)},"writeBytesField"),writeFixed32Field:l(function(t,e){this.writeTag(t,Q.Fixed32),this.writeFixed32(e)},"writeFixed32Field"),writeSFixed32Field:l(function(t,e){this.writeTag(t,Q.Fixed32),this.writeSFixed32(e)},"writeSFixed32Field"),writeFixed64Field:l(function(t,e){this.writeTag(t,Q.Fixed64),this.writeFixed64(e)},"writeFixed64Field"),writeSFixed64Field:l(function(t,e){this.writeTag(t,Q.Fixed64),this.writeSFixed64(e)},"writeSFixed64Field"),writeVarintField:l(function(t,e){this.writeTag(t,Q.Varint),this.writeVarint(e)},"writeVarintField"),writeSVarintField:l(function(t,e){this.writeTag(t,Q.Varint),this.writeSVarint(e)},"writeSVarintField"),writeStringField:l(function(t,e){this.writeTag(t,Q.Bytes),this.writeString(e)},"writeStringField"),writeFloatField:l(function(t,e){this.writeTag(t,Q.Fixed32),this.writeFloat(e)},"writeFloatField"),writeDoubleField:l(function(t,e){this.writeTag(t,Q.Fixed64),this.writeDouble(e)},"writeDoubleField"),writeBooleanField:l(function(t,e){this.writeVarintField(t,!!e)},"writeBooleanField")};function $b(t,e,r){var n=r.buf,i,o;if(o=n[r.pos++],i=(o&112)>>4,o<128||(o=n[r.pos++],i|=(o&127)<<3,o<128)||(o=n[r.pos++],i|=(o&127)<<10,o<128)||(o=n[r.pos++],i|=(o&127)<<17,o<128)||(o=n[r.pos++],i|=(o&127)<<24,o<128)||(o=n[r.pos++],i|=(o&1)<<31,o<128))return Ur(t,i,e);throw new Error("Expected varint not more than 10 bytes")}l($b,"readVarintRemainder");function gt(t){return t.type===Q.Bytes?t.readVarint()+t.pos:t.pos+1}l(gt,"readPackedEnd");function Ur(t,e,r){return r?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}l(Ur,"toNum");function jb(t,e){var r,n;if(t>=0?(r=t%4294967296|0,n=t/4294967296|0):(r=~(-t%4294967296),n=~(-t/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),qb(r,n,e),Wb(n,e)}l(jb,"writeBigVarint");function qb(t,e,r){r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos++]=t&127|128,t>>>=7,r.buf[r.pos]=t&127}l(qb,"writeBigVarintLow");function Wb(t,e){var r=(t&7)<<4;e.buf[e.pos++]|=r|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=t&127)))))}l(Wb,"writeBigVarintHigh");function vf(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}l(vf,"makeRoomForExtraLength");function Xb(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}l(Xb,"writePackedVarint");function Hb(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}l(Hb,"writePackedSVarint");function Zb(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}l(Zb,"writePackedFloat");function Jb(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}l(Jb,"writePackedDouble");function Yb(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}l(Yb,"writePackedBoolean");function Kb(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}l(Kb,"writePackedFixed32");function Qb(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}l(Qb,"writePackedSFixed32");function ex(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}l(ex,"writePackedFixed64");function tx(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}l(tx,"writePackedSFixed64");function Ca(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+t[e+3]*16777216}l(Ca,"readUInt32");function $r(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}l($r,"writeInt32");function Pf(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}l(Pf,"readInt32");function rx(t,e,r){for(var n="",i=e;i<r;){var o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s>r)break;var u,c,p;s===1?o<128&&(a=o):s===2?(u=t[i+1],(u&192)===128&&(a=(o&31)<<6|u&63,a<=127&&(a=null))):s===3?(u=t[i+1],c=t[i+2],(u&192)===128&&(c&192)===128&&(a=(o&15)<<12|(u&63)<<6|c&63,(a<=2047||a>=55296&&a<=57343)&&(a=null))):s===4&&(u=t[i+1],c=t[i+2],p=t[i+3],(u&192)===128&&(c&192)===128&&(p&192)===128&&(a=(o&15)<<18|(u&63)<<12|(c&63)<<6|p&63,(a<=65535||a>=1114112)&&(a=null))),a===null?(a=65533,s=1):a>65535&&(a-=65536,n+=String.fromCharCode(a>>>10&1023|55296),a=56320|a&1023),n+=String.fromCharCode(a),i+=s}return n}l(rx,"readUtf8");function nx(t,e,r){return Sf.decode(t.subarray(e,r))}l(nx,"readUtf8TextDecoder");function ix(t,e,r){for(var n=0,i,o;n<e.length;n++){if(i=e.charCodeAt(n),i>55295&&i<57344)if(o)if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||n+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):o=i;continue}else o&&(t[r++]=239,t[r++]=191,t[r++]=189,o=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=i&63|128)}return r}l(ix,"writeUtf8")});var xy=we((NE,by)=>{g();by.exports=Ya;function Ya(t,e){var r=t&&t.type,n;if(r==="FeatureCollection")for(n=0;n<t.features.length;n++)Ya(t.features[n],e);else if(r==="GeometryCollection")for(n=0;n<t.geometries.length;n++)Ya(t.geometries[n],e);else if(r==="Feature")Ya(t.geometry,e);else if(r==="Polygon")dy(t.coordinates,e);else if(r==="MultiPolygon")for(n=0;n<t.coordinates.length;n++)dy(t.coordinates[n],e);return t}l(Ya,"rewind");function dy(t,e){if(t.length!==0){gy(t[0],e);for(var r=1;r<t.length;r++)gy(t[r],!e)}}l(dy,"rewindRings");function gy(t,e){for(var r=0,n=0,i=0,o=t.length,a=o-1;i<o;a=i++){var s=(t[i][0]-t[a][0])*(t[a][1]+t[i][1]),u=r+s;n+=Math.abs(r)>=Math.abs(s)?r-u+s:s-u+r,r=u}r+n>=0!=!!e&&t.reverse()}l(gy,"rewindRing")});var wy=we((HE,Sy)=>{"use strict";g();var qx=de(),Wx=Gt().VectorTileFeature;Sy.exports=Py;function Py(t,e){this.options=e||{},this.features=t,this.length=t.length}l(Py,"GeoJSONWrapper");Py.prototype.feature=function(t){return new Qa(this.features[t],this.options.extent)};function Qa(t,e){this.id=typeof t.id=="number"?t.id:void 0,this.type=t.type,this.rawGeometry=t.type===1?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}l(Qa,"FeatureWrapper");Qa.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var r=t[e],n=[],i=0;i<r.length;i++)n.push(new qx(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry};Qa.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,n=1/0,i=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),r=Math.max(r,u.x),n=Math.min(n,u.y),i=Math.max(i,u.y)}return[e,n,r,i]};Qa.prototype.toGeoJSON=Wx.prototype.toGeoJSON});var Iy=we((YE,Vi)=>{g();var Xx=gi(),_y=wy();Vi.exports=jl;Vi.exports.fromVectorTileJs=jl;Vi.exports.fromGeojsonVt=Hx;Vi.exports.GeoJSONWrapper=_y;function jl(t){var e=new Xx;return Zx(t,e),e.finish()}l(jl,"fromVectorTileJs");function Hx(t,e){e=e||{};var r={};for(var n in t)r[n]=new _y(t[n].features,e),r[n].name=n,r[n].version=e.version,r[n].extent=e.extent;return jl({layers:r})}l(Hx,"fromGeojsonVt");function Zx(t,e){for(var r in t.layers)e.writeMessage(3,Jx,t.layers[r])}l(Zx,"writeTile");function Jx(t,e){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r,n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<t.length;r++)n.feature=t.feature(r),e.writeMessage(2,Yx,n);var i=n.keys;for(r=0;r<i.length;r++)e.writeStringField(3,i[r]);var o=n.values;for(r=0;r<o.length;r++)e.writeMessage(4,e0,o[r])}l(Jx,"writeLayer");function Yx(t,e){var r=t.feature;r.id!==void 0&&e.writeVarintField(1,r.id),e.writeMessage(2,Kx,t),e.writeVarintField(3,r.type),e.writeMessage(4,Qx,r)}l(Yx,"writeFeature");function Kx(t,e){var r=t.feature,n=t.keys,i=t.values,o=t.keycache,a=t.valuecache;for(var s in r.properties){var u=r.properties[s],c=o[s];if(u!==null){typeof c>"u"&&(n.push(s),c=n.length-1,o[s]=c),e.writeVarint(c);var p=typeof u;p!=="string"&&p!=="boolean"&&p!=="number"&&(u=JSON.stringify(u));var f=p+":"+u,y=a[f];typeof y>"u"&&(i.push(u),y=i.length-1,a[f]=y),e.writeVarint(y)}}}l(Kx,"writeProperties");function $l(t,e){return(e<<3)+(t&7)}l($l,"command");function Ay(t){return t<<1^t>>31}l(Ay,"zigzag");function Qx(t,e){for(var r=t.loadGeometry(),n=t.type,i=0,o=0,a=r.length,s=0;s<a;s++){var u=r[s],c=1;n===1&&(c=u.length),e.writeVarint($l(1,c));for(var p=n===3?u.length-1:u.length,f=0;f<p;f++){f===1&&n!==1&&e.writeVarint($l(2,p-1));var y=u[f].x-i,m=u[f].y-o;e.writeVarint(Ay(y)),e.writeVarint(Ay(m)),i+=y,o+=m}n===3&&e.writeVarint($l(7,1))}}l(Qx,"writeGeometry");function e0(t,e){var r=typeof t;r==="string"?e.writeStringField(1,t):r==="boolean"?e.writeBooleanField(7,t):r==="number"&&(t%1!==0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}l(e0,"writeValue")});g();g();g();var Mm=ee(de(),1),wu=ee(pu(),1);g();g();var cs;function fu(){return cs==null&&(cs=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),cs}l(fu,"offscreenCanvasSupported");var Zi;function yu(){if(Zi==null&&(Zi=!1,fu())){let r=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(r){for(let i=0;i<5*5;i++){let o=i*4;r.fillStyle=`rgb(${o},${o+1},${o+2})`,r.fillRect(i%5,Math.floor(i/5),1,1)}let n=r.getImageData(0,0,5,5).data;for(let i=0;i<5*5*4;i++)if(i%4!==3&&n[i]!==i){Zi=!0;break}}}return Zi||!1}l(yu,"isOffscreenCanvasDistorted");g();g();var Qr=1e-6,en=typeof Float32Array<"u"?Float32Array:Array,tn=Math.random;var k0=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Ji={};Jy(Ji,{add:()=>nm,ceil:()=>im,clone:()=>Qy,copy:()=>tm,create:()=>mu,cross:()=>hm,dist:()=>Tm,distance:()=>bu,div:()=>Im,divide:()=>gu,dot:()=>mm,equals:()=>wm,exactEquals:()=>Sm,floor:()=>om,forEach:()=>Em,fromValues:()=>em,inverse:()=>fm,len:()=>km,length:()=>vu,lerp:()=>dm,max:()=>sm,min:()=>am,mul:()=>_m,multiply:()=>du,negate:()=>pm,normalize:()=>ym,random:()=>gm,round:()=>lm,scale:()=>um,scaleAndAdd:()=>cm,set:()=>rm,sqrDist:()=>Cm,sqrLen:()=>Fm,squaredDistance:()=>xu,squaredLength:()=>Pu,str:()=>Pm,sub:()=>Am,subtract:()=>hu,transformMat4:()=>bm,transformQuat:()=>xm,zero:()=>vm});g();function mu(){var t=new en(4);return en!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}l(mu,"create");function Qy(t){var e=new en(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}l(Qy,"clone");function em(t,e,r,n){var i=new en(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}l(em,"fromValues");function tm(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}l(tm,"copy");function rm(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}l(rm,"set");function nm(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}l(nm,"add");function hu(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}l(hu,"subtract");function du(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}l(du,"multiply");function gu(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}l(gu,"divide");function im(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t}l(im,"ceil");function om(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t}l(om,"floor");function am(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}l(am,"min");function sm(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}l(sm,"max");function lm(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t}l(lm,"round");function um(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}l(um,"scale");function cm(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}l(cm,"scaleAndAdd");function bu(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return Math.hypot(r,n,i,o)}l(bu,"distance");function xu(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}l(xu,"squaredDistance");function vu(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.hypot(e,r,n,i)}l(vu,"length");function Pu(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}l(Pu,"squaredLength");function pm(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}l(pm,"negate");function fm(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}l(fm,"inverse");function ym(t,e){var r=e[0],n=e[1],i=e[2],o=e[3],a=r*r+n*n+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=r*a,t[1]=n*a,t[2]=i*a,t[3]=o*a,t}l(ym,"normalize");function mm(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}l(mm,"dot");function hm(t,e,r,n){var i=r[0]*n[1]-r[1]*n[0],o=r[0]*n[2]-r[2]*n[0],a=r[0]*n[3]-r[3]*n[0],s=r[1]*n[2]-r[2]*n[1],u=r[1]*n[3]-r[3]*n[1],c=r[2]*n[3]-r[3]*n[2],p=e[0],f=e[1],y=e[2],m=e[3];return t[0]=f*c-y*u+m*s,t[1]=-(p*c)+y*a-m*o,t[2]=p*u-f*a+m*i,t[3]=-(p*s)+f*o-y*i,t}l(hm,"cross");function dm(t,e,r,n){var i=e[0],o=e[1],a=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=o+n*(r[1]-o),t[2]=a+n*(r[2]-a),t[3]=s+n*(r[3]-s),t}l(dm,"lerp");function gm(t,e){e=e||1;var r,n,i,o,a,s;do r=tn()*2-1,n=tn()*2-1,a=r*r+n*n;while(a>=1);do i=tn()*2-1,o=tn()*2-1,s=i*i+o*o;while(s>=1);var u=Math.sqrt((1-a)/s);return t[0]=e*r,t[1]=e*n,t[2]=e*i*u,t[3]=e*o*u,t}l(gm,"random");function bm(t,e,r){var n=e[0],i=e[1],o=e[2],a=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,t[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,t[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,t[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,t}l(bm,"transformMat4");function xm(t,e,r){var n=e[0],i=e[1],o=e[2],a=r[0],s=r[1],u=r[2],c=r[3],p=c*n+s*o-u*i,f=c*i+u*n-a*o,y=c*o+a*i-s*n,m=-a*n-s*i-u*o;return t[0]=p*c+m*-a+f*-u-y*-s,t[1]=f*c+m*-s+y*-a-p*-u,t[2]=y*c+m*-u+p*-s-f*-a,t[3]=e[3],t}l(xm,"transformQuat");function vm(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}l(vm,"zero");function Pm(t){return"vec4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}l(Pm,"str");function Sm(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}l(Sm,"exactEquals");function wm(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],u=e[2],c=e[3];return Math.abs(r-a)<=Qr*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-s)<=Qr*Math.max(1,Math.abs(n),Math.abs(s))&&Math.abs(i-u)<=Qr*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(o-c)<=Qr*Math.max(1,Math.abs(o),Math.abs(c))}l(wm,"equals");var Am=hu,_m=du,Im=gu,Tm=bu,Cm=xu,km=vu,Fm=Pu,Em=function(){var t=mu();return function(e,r,n,i,o,a){var s,u;for(r||(r=4),n||(n=0),i?u=Math.min(i*r+n,e.length):u=e.length,s=n;s<u;s+=r)t[0]=e[s],t[1]=e[s+1],t[2]=e[s+2],t[3]=e[s+3],o(t,t,a),e[s]=t[0],e[s+1]=t[1],e[s+2]=t[2],e[s+3]=t[3];return e}}();g();g();function Au(t){if(t<=0)return 0;if(t>=1)return 1;let e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}l(Au,"easeCubicInOut");function Lm(t,e,r,n){let i=new wu.default(t,e,r,n);return o=>i.solve(o)}l(Lm,"bezier");var q0=Lm(.25,.1,.25,1);function st(t,e,r){return Math.min(r,Math.max(e,t))}l(st,"clamp");function _u(t,e,r){let n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i}l(_u,"wrap");function xe(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}l(xe,"extend");function Iu(t){return Math.log(t)/Math.LN2%1===0}l(Iu,"isPowerOfTwo");function on(t,e,r){let n={};for(let i in t)n[i]=e.call(r||this,t[i],i,t);return n}l(on,"mapObject");function Tu(t,e,r){let n={};for(let i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}l(Tu,"filterObject");function at(t){return Array.isArray(t)?t.map(at):typeof t=="object"&&t?on(t,at):t}l(at,"clone");var Su={};function ye(t){Su[t]||(typeof console<"u"&&console.warn(t),Su[t]=!0)}l(ye,"warnOnce");function lt(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}l(lt,"isCounterClockwise");function ut(t){return typeof WorkerGlobalScope<"u"&&typeof t<"u"&&t instanceof WorkerGlobalScope}l(ut,"isWorker");function wt(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap}l(wt,"isImageBitmap");function Dm(t,e,r,n,i){let o=Math.max(-e,0)*4,u=(Math.max(0,r)-r)*n*4+o,c=n*4,p=Math.max(0,e),f=Math.max(0,r),y=Math.min(t.width,e+n),m=Math.min(t.height,r+i);return{rect:{x:p,y:f,width:y-p,height:m-f},layout:[{offset:u,stride:c}]}}l(Dm,"computeVideoFrameParameters");async function Bm(t,e,r,n,i){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let o=new VideoFrame(t,{timestamp:0});try{let a=o?.format;if(!a||!(a.startsWith("BGR")||a.startsWith("RGB")))throw new Error(`Unrecognized format ${a}`);let s=a.startsWith("BGR"),u=new Uint8ClampedArray(n*i*4);if(await o.copyTo(u,Dm(t,e,r,n,i)),s)for(let c=0;c<u.length;c+=4){let p=u[c];u[c]=u[c+2],u[c+2]=p}return u}finally{o.close()}}l(Bm,"readImageUsingVideoFrame");var rn,nn;function Vm(t,e,r,n,i){let o=t.width,a=t.height;(!rn||!nn)&&(rn=new OffscreenCanvas(o,a),nn=rn.getContext("2d",{willReadFrequently:!0})),rn.width=o,rn.height=a,nn.drawImage(t,0,0,o,a);let s=nn.getImageData(e,r,n,i);return nn.clearRect(0,0,o,a),s.data}l(Vm,"readImageDataUsingOffscreenCanvas");async function Cu(t,e,r,n,i){if(yu())try{return await Bm(t,e,r,n,i)}catch{}return Vm(t,e,r,n,i)}l(Cu,"getImageData");function ps(t,e,r,n){return t.addEventListener(e,r,n),{unsubscribe:l(()=>{t.removeEventListener(e,r,n)},"unsubscribe")}}l(ps,"subscribe");function fs(t){return t*Math.PI/180}l(fs,"degreesToRadians");var Yi=25,Ki=0;g();g();var Wt=class t{static{l(this,"TransferableGridIndex")}constructor(e,r,n){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let a=new Int32Array(this.arrayBuffer);e=a[0],r=a[1],n=a[2],this.d=r+2*n;for(let c=0;c<this.d*this.d;c++){let p=a[3+c],f=a[3+c+1];i.push(p===f?null:a.subarray(p,f))}let s=a[3+i.length],u=a[3+i.length+1];this.keys=a.subarray(s,u),this.bboxes=a.subarray(u),this.insert=this._insertReadonly}else{this.d=r+2*n;for(let a=0;a<this.d*this.d;a++)i.push([]);this.keys=[],this.bboxes=[]}this.n=r,this.extent=e,this.padding=n,this.scale=r/e,this.uid=0;let o=n/r*e;this.min=-o,this.max=e+o}insert(e,r,n,i,o){this._forEachCell(r,n,i,o,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i),this.bboxes.push(o)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,r,n,i,o,a){this.cells[o].push(a)}query(e,r,n,i,o){let a=this.min,s=this.max;if(e<=a&&r<=a&&s<=n&&s<=i&&!o)return Array.prototype.slice.call(this.keys);{let u=[],c={};return this._forEachCell(e,r,n,i,this._queryCell,u,c,o),u}}_queryCell(e,r,n,i,o,a,s,u){let c=this.cells[o];if(c!==null){let p=this.keys,f=this.bboxes;for(let y=0;y<c.length;y++){let m=c[y];if(s[m]===void 0){let h=m*4;(u?u(f[h+0],f[h+1],f[h+2],f[h+3]):e<=f[h+2]&&r<=f[h+3]&&n>=f[h+0]&&i>=f[h+1])?(s[m]=!0,a.push(p[m])):s[m]=!1}}}}_forEachCell(e,r,n,i,o,a,s,u){let c=this._convertToCellCoord(e),p=this._convertToCellCoord(r),f=this._convertToCellCoord(n),y=this._convertToCellCoord(i);for(let m=c;m<=f;m++)for(let h=p;h<=y;h++){let d=this.d*h+m;if(!(u&&!u(this._convertFromCellCoord(m),this._convertFromCellCoord(h),this._convertFromCellCoord(m+1),this._convertFromCellCoord(h+1)))&&o.call(this,e,r,n,i,d,a,s,u))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,r=3+this.cells.length+1+1,n=0;for(let a=0;a<this.cells.length;a++)n+=this.cells[a].length;let i=new Int32Array(r+n+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let o=r;for(let a=0;a<e.length;a++){let s=e[a];i[3+a]=o,i.set(s,o),o+=s.length}return i[3+e.length]=o,i.set(this.keys,o),o+=this.keys.length,i[3+e.length+1]=o,i.set(this.bboxes,o),o+=this.bboxes.length,i.buffer}static serialize(e,r){let n=e.toArrayBuffer();return r&&r.push(n),{buffer:n}}static deserialize(e){return new t(e.buffer)}};g();var Rm=8,zm={version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},Om={"*":{type:"source"}},Gm=["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],Nm={type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},Um={type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},$m={type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},jm={type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},qm={type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Wm={type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},Xm={id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},Hm=["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],Zm={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Jm={"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Ym={"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Km={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},Qm={"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},eh={"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},th={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},rh={visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},nh={type:"array",value:"*"},ih={type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},oh={type:"enum",values:{Point:{},LineString:{},Polygon:{}}},ah={type:"array",minimum:0,maximum:24,value:["number","color"],length:2},sh={type:"array",value:"*",minimum:1},lh={anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},uh={"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},ch={source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},ph={type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},fh=["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],yh={"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},mh={"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},hh={"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},dh={"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},gh={"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},bh={"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},xh={"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},vh={"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},Ph={duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},Sh={"*":{type:"string"}},A={$version:Rm,$root:zm,sources:Om,source:Gm,source_vector:Nm,source_raster:Um,source_raster_dem:$m,source_geojson:jm,source_video:qm,source_image:Wm,layer:Xm,layout:Hm,layout_background:Zm,layout_fill:Jm,layout_circle:Ym,layout_heatmap:Km,"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:Qm,layout_symbol:eh,layout_raster:th,layout_hillshade:rh,"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:nh,filter_operator:ih,geometry_type:oh,function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:ah,expression:sh,light:lh,sky:uh,terrain:ch,projection:ph,paint:fh,paint_fill:yh,"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:mh,paint_circle:hh,paint_heatmap:dh,paint_symbol:gh,paint_raster:bh,paint_hillshade:xh,"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:vh,transition:Ph,"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:Sh},wh=["type","source","source-layer","minzoom","maxzoom","filter","layout"];var E=class{static{l(this,"ValidationError")}constructor(e,r,n,i){this.message=(e?`${e}: `:"")+n,i&&(this.identifier=i),r!=null&&r.__line__&&(this.line=r.__line__)}};function Sr(t,...e){for(let r of e)for(let n in r)t[n]=r[n];return t}l(Sr,"extendBy");var Oe=class extends Error{static{l(this,"ExpressionParsingError")}constructor(e,r){super(r),this.message=r,this.key=e}},Ss=class t{static{l(this,"Scope")}constructor(e,r=[]){this.parent=e,this.bindings={};for(let[n,i]of r)this.bindings[n]=i}concat(e){return new t(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return this.bindings[e]?!0:this.parent?this.parent.has(e):!1}},Ir={kind:"null"},M={kind:"number"},W={kind:"string"},q={kind:"boolean"},Ne={kind:"color"},bo={kind:"projectionDefinition"},Zt={kind:"object"},j={kind:"value"},Ah={kind:"error"},xo={kind:"collator"},Tr={kind:"formatted"},vo={kind:"padding"},un={kind:"colorArray"},Po={kind:"numberArray"},wn={kind:"resolvedImage"},So={kind:"variableAnchorOffsetCollection"};function Ee(t,e){return{kind:"array",itemType:t,N:e}}l(Ee,"array");function se(t){if(t.kind==="array"){let e=se(t.itemType);return typeof t.N=="number"?`array<${e}, ${t.N}>`:t.itemType.kind==="value"?"array":`array<${e}>`}else return t.kind}l(se,"typeToString");var _h=[Ir,M,W,q,Ne,bo,Tr,Zt,Ee(j),vo,Po,un,wn,So];function cn(t,e){if(e.kind==="error")return null;if(t.kind==="array"){if(e.kind==="array"&&(e.N===0&&e.itemType.kind==="value"||!cn(t.itemType,e.itemType))&&(typeof t.N!="number"||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if(t.kind==="value"){for(let r of _h)if(!cn(r,e))return null}}return`Expected ${se(t)} but found ${se(e)} instead.`}l(cn,"checkSubtype");function Gs(t,e){return e.some(r=>r.kind===t.kind)}l(Gs,"isValidType");function Jt(t,e){return e.some(r=>r==="null"?t===null:r==="array"?Array.isArray(t):r==="object"?t&&!Array.isArray(t)&&typeof t=="object":r===typeof t)}l(Jt,"isValidNativeType");function At(t,e){return t.kind==="array"&&e.kind==="array"?t.itemType.kind===e.itemType.kind&&typeof t.N=="number":t.kind===e.kind}l(At,"verifyType");var Zu=.96422,Ju=1,Yu=.82521,Ku=4/29,Pr=6/29,Qu=3*Pr*Pr,Ih=Pr*Pr*Pr,Th=Math.PI/180,Ch=180/Math.PI;function ec(t){return t=t%360,t<0&&(t+=360),t}l(ec,"constrainAngle");function tc([t,e,r,n]){t=ys(t),e=ys(e),r=ys(r);let i,o,a=ms((.2225045*t+.7168786*e+.0606169*r)/Ju);t===e&&e===r?i=o=a:(i=ms((.4360747*t+.3850649*e+.1430804*r)/Zu),o=ms((.0139322*t+.0971045*e+.7141733*r)/Yu));let s=116*a-16;return[s<0?0:s,500*(i-a),200*(a-o),n]}l(tc,"rgbToLab");function ys(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}l(ys,"rgb2xyz");function ms(t){return t>Ih?Math.pow(t,1/3):t/Qu+Ku}l(ms,"xyz2lab");function rc([t,e,r,n]){let i=(t+16)/116,o=isNaN(e)?i:i+e/500,a=isNaN(r)?i:i-r/200;return i=Ju*ds(i),o=Zu*ds(o),a=Yu*ds(a),[hs(3.1338561*o-1.6168667*i-.4906146*a),hs(-.9787684*o+1.9161415*i+.033454*a),hs(.0719453*o-.2289914*i+1.4052427*a),n]}l(rc,"labToRgb");function hs(t){return t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055,t<0?0:t>1?1:t}l(hs,"xyz2rgb");function ds(t){return t>Pr?t*t*t:Qu*(t-Ku)}l(ds,"lab2xyz");function kh(t){let[e,r,n,i]=tc(t),o=Math.sqrt(r*r+n*n);return[Math.round(o*1e4)?ec(Math.atan2(n,r)*Ch):NaN,o,e,i]}l(kh,"rgbToHcl");function Fh([t,e,r,n]){return t=isNaN(t)?0:t*Th,rc([r,Math.cos(t)*e,Math.sin(t)*e,n])}l(Fh,"hclToRgb");function Eh([t,e,r,n]){t=ec(t),e/=100,r/=100;function i(o){let a=(o+t/30)%12,s=e*Math.min(r,1-r);return r-s*Math.max(-1,Math.min(a-3,9-a,1))}return l(i,"f"),[i(0),i(8),i(4),n]}l(Eh,"hslToRgb");var Mh=Object.hasOwn||l(function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},"hasOwnProperty");function sn(t,e){return Mh(t,e)?t[e]:void 0}l(sn,"getOwn");function Lh(t){if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e=sn(Dh,t);if(e){let[i,o,a]=e;return[i/255,o/255,a/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){let o=t.length<6?1:2,a=1;return[Qi(t.slice(a,a+=o)),Qi(t.slice(a,a+=o)),Qi(t.slice(a,a+=o)),Qi(t.slice(a,a+o)||"ff")]}if(t.startsWith("rgb")){let i=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,o=t.match(i);if(o){let[a,s,u,c,p,f,y,m,h,d,x,b]=o,P=[c||" ",y||" ",d].join("");if(P===" "||P===" /"||P===",,"||P===",,,"){let v=[u,f,h].join(""),S=v==="%%%"?100:v===""?255:0;if(S){let _=[xr(+s/S,0,1),xr(+p/S,0,1),xr(+m/S,0,1),x?ku(+x,b):1];if(Fu(_))return _}}return}}let r=/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,n=t.match(r);if(n){let[i,o,a,s,u,c,p,f,y]=n,m=[a||" ",u||" ",p].join("");if(m===" "||m===" /"||m===",,"||m===",,,"){let h=[+o,xr(+s,0,100),xr(+c,0,100),f?ku(+f,y):1];if(Fu(h))return Eh(h)}}}l(Lh,"parseCssColor");function Qi(t){return parseInt(t.padEnd(2,t),16)/255}l(Qi,"parseHex");function ku(t,e){return xr(e?t/100:t,0,1)}l(ku,"parseAlpha");function xr(t,e,r){return Math.min(Math.max(e,t),r)}l(xr,"clamp");function Fu(t){return!t.some(Number.isNaN)}l(Fu,"validateNumbers");var Dh={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function It(t,e,r){return t+r*(e-t)}l(It,"interpolateNumber");function wr(t,e,r){return t.map((n,i)=>It(n,e[i],r))}l(wr,"interpolateArray");function Bh(t){return t==="rgb"||t==="hcl"||t==="lab"}l(Bh,"isSupportedInterpolationColorSpace");var Y=class t{static{l(this,"Color")}constructor(e,r,n,i=1,o=!0){this.r=e,this.g=r,this.b=n,this.a=i,o||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,r,n,i]))}static parse(e){if(e instanceof t)return e;if(typeof e!="string")return;let r=Lh(e);if(r)return new t(...r,!1)}get rgb(){let{r:e,g:r,b:n,a:i}=this,o=i||1/0;return this.overwriteGetter("rgb",[e/o,r/o,n/o,i])}get hcl(){return this.overwriteGetter("hcl",kh(this.rgb))}get lab(){return this.overwriteGetter("lab",tc(this.rgb))}overwriteGetter(e,r){return Object.defineProperty(this,e,{value:r}),r}toString(){let[e,r,n,i]=this.rgb;return`rgba(${[e,r,n].map(o=>Math.round(o*255)).join(",")},${i})`}static interpolate(e,r,n,i="rgb"){switch(i){case"rgb":{let[o,a,s,u]=wr(e.rgb,r.rgb,n);return new t(o,a,s,u,!1)}case"hcl":{let[o,a,s,u]=e.hcl,[c,p,f,y]=r.hcl,m,h;if(!isNaN(o)&&!isNaN(c)){let v=c-o;c>o&&v>180?v-=360:c<o&&o-c>180&&(v+=360),m=o+n*v}else isNaN(o)?isNaN(c)?m=NaN:(m=c,(s===1||s===0)&&(h=p)):(m=o,(f===1||f===0)&&(h=a));let[d,x,b,P]=Fh([m,h??It(a,p,n),It(s,f,n),It(u,y,n)]);return new t(d,x,b,P,!1)}case"lab":{let[o,a,s,u]=rc(wr(e.lab,r.lab,n));return new t(o,a,s,u,!1)}}}};Y.black=new Y(0,0,0,1);Y.white=new Y(1,1,1,1);Y.transparent=new Y(0,0,0,0);Y.red=new Y(1,0,0,1);var pn=class{static{l(this,"Collator")}constructor(e,r,n){e?this.sensitivity=r?"variant":"case":this.sensitivity=r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,r){return this.collator.compare(e,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}},Vh=["bottom","center","top"],fn=class{static{l(this,"FormattedSection")}constructor(e,r,n,i,o,a){this.text=e,this.image=r,this.scale=n,this.fontStack=i,this.textColor=o,this.verticalAlign=a}},Le=class t{static{l(this,"Formatted")}constructor(e){this.sections=e}static fromString(e){return new t([new fn(e,null,null,null,null,null)])}isEmpty(){return this.sections.length===0?!0:!this.sections.some(e=>e.text.length!==0||e.image&&e.image.name.length!==0)}static factory(e){return e instanceof t?e:t.fromString(e)}toString(){return this.sections.length===0?"":this.sections.map(e=>e.text).join("")}},Ue=class t{static{l(this,"Padding")}constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="number")return new t([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let r of e)if(typeof r!="number")return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]];break}return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){return new t(wr(e.values,r.values,n))}},$e=class t{static{l(this,"NumberArray")}constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="number")return new t([e]);if(Array.isArray(e)){for(let r of e)if(typeof r!="number")return;return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){return new t(wr(e.values,r.values,n))}},Ae=class t{static{l(this,"ColorArray")}constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(typeof e=="string"){let n=Y.parse(e);return n?new t([n]):void 0}if(!Array.isArray(e))return;let r=[];for(let n of e){if(typeof n!="string")return;let i=Y.parse(n);if(!i)return;r.push(i)}return new t(r)}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n,i="rgb"){let o=[];if(e.values.length!=r.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${r.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)o.push(Y.interpolate(e.values[a],r.values[a],n,i));return new t(o)}},ae=class extends Error{static{l(this,"RuntimeError")}constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}},Rh=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),De=class t{static{l(this,"VariableAnchorOffsetCollection")}constructor(e){this.values=e.slice()}static parse(e){if(e instanceof t)return e;if(!(!Array.isArray(e)||e.length<1||e.length%2!==0)){for(let r=0;r<e.length;r+=2){let n=e[r],i=e[r+1];if(typeof n!="string"||!Rh.has(n)||!Array.isArray(i)||i.length!==2||typeof i[0]!="number"||typeof i[1]!="number")return}return new t(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,r,n){let i=e.values,o=r.values;if(i.length!==o.length)throw new ae(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${r.toString()}`);let a=[];for(let s=0;s<i.length;s+=2){if(i[s]!==o[s])throw new ae(`Cannot interpolate values containing mismatched anchors. from[${s}]: ${i[s]}, to[${s}]: ${o[s]}`);a.push(i[s]);let[u,c]=i[s+1],[p,f]=o[s+1];a.push([It(u,p,n),It(c,f,n)])}return new t(a)}},_e=class t{static{l(this,"ResolvedImage")}constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new t({name:e,available:!1}):null}},Tt=class t{static{l(this,"ProjectionDefinition")}constructor(e,r,n){this.from=e,this.to=r,this.transition=n}static interpolate(e,r,n){return new t(e,r,n)}static parse(e){if(e instanceof t)return e;if(Array.isArray(e)&&e.length===3&&typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="number")return new t(e[0],e[1],e[2]);if(typeof e=="object"&&typeof e.from=="string"&&typeof e.to=="string"&&typeof e.transition=="number")return new t(e.from,e.to,e.transition);if(typeof e=="string")return new t(e,e,1)}};function nc(t,e,r,n){return typeof t=="number"&&t>=0&&t<=255&&typeof e=="number"&&e>=0&&e<=255&&typeof r=="number"&&r>=0&&r<=255?typeof n>"u"||typeof n=="number"&&n>=0&&n<=1?null:`Invalid rgba value [${[t,e,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof n=="number"?[t,e,r,n]:[t,e,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}l(nc,"validateRGBA");function yn(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Tt||t instanceof Y||t instanceof pn||t instanceof Le||t instanceof Ue||t instanceof $e||t instanceof Ae||t instanceof De||t instanceof _e)return!0;if(Array.isArray(t)){for(let e of t)if(!yn(e))return!1;return!0}else if(typeof t=="object"){for(let e in t)if(!yn(t[e]))return!1;return!0}else return!1}l(yn,"isValue");function fe(t){if(t===null)return Ir;if(typeof t=="string")return W;if(typeof t=="boolean")return q;if(typeof t=="number")return M;if(t instanceof Y)return Ne;if(t instanceof Tt)return bo;if(t instanceof pn)return xo;if(t instanceof Le)return Tr;if(t instanceof Ue)return vo;if(t instanceof $e)return Po;if(t instanceof Ae)return un;if(t instanceof De)return So;if(t instanceof _e)return wn;if(Array.isArray(t)){let e=t.length,r;for(let n of t){let i=fe(n);if(!r)r=i;else{if(r===i)continue;r=j;break}}return Ee(r||j,e)}else return Zt}l(fe,"typeOf");function ln(t){let e=typeof t;return t===null?"":e==="string"||e==="number"||e==="boolean"?String(t):t instanceof Y||t instanceof Tt||t instanceof Le||t instanceof Ue||t instanceof $e||t instanceof Ae||t instanceof De||t instanceof _e?t.toString():JSON.stringify(t)}l(ln,"valueToString");var Ct=class t{static{l(this,"Literal")}constructor(e,r){this.type=e,this.value=r}static parse(e,r){if(e.length!==2)return r.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!yn(e[1]))return r.error("invalid value");let n=e[1],i=fe(n),o=r.expectedType;return i.kind==="array"&&i.N===0&&o&&o.kind==="array"&&(typeof o.N!="number"||o.N===0)&&(i=o),new t(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}},eo={string:W,number:M,boolean:q,object:Zt},We=class t{static{l(this,"Assertion")}constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=1,i,o=e[0];if(o==="array"){let s;if(e.length>2){let c=e[1];if(typeof c!="string"||!(c in eo)||c==="object")return r.error('The item type argument of "array" must be one of string, number, boolean',1);s=eo[c],n++}else s=j;let u;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return r.error('The length argument to "array" must be a positive integer literal',2);u=e[2],n++}i=Ee(s,u)}else{if(!eo[o])throw new Error(`Types doesn't contain name = ${o}`);i=eo[o]}let a=[];for(;n<e.length;n++){let s=r.parse(e[n],n,j);if(!s)return null;a.push(s)}return new t(i,a)}evaluate(e){for(let r=0;r<this.args.length;r++){let n=this.args[r].evaluate(e);if(cn(this.type,fe(n))){if(r===this.args.length-1)throw new ae(`Expected value to be of type ${se(this.type)}, but found ${se(fe(n))} instead.`)}else return n}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},Eu={"to-boolean":q,"to-color":Ne,"to-number":M,"to-string":W},_t=class t{static{l(this,"Coercion")}constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=e[0];if(!Eu[n])throw new Error(`Can't parse ${n} as it is not part of the known types`);if((n==="to-boolean"||n==="to-string")&&e.length!==2)return r.error("Expected one argument.");let i=Eu[n],o=[];for(let a=1;a<e.length;a++){let s=r.parse(e[a],a,j);if(!s)return null;o.push(s)}return new t(i,o)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let r,n;for(let i of this.args){if(r=i.evaluate(e),n=null,r instanceof Y)return r;if(typeof r=="string"){let o=e.parseColor(r);if(o)return o}else if(Array.isArray(r)&&(r.length<3||r.length>4?n=`Invalid rgba value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:n=nc(r[0],r[1],r[2],r[3]),!n))return new Y(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new ae(n||`Could not parse color from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"padding":{let r;for(let n of this.args){r=n.evaluate(e);let i=Ue.parse(r);if(i)return i}throw new ae(`Could not parse padding from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"numberArray":{let r;for(let n of this.args){r=n.evaluate(e);let i=$e.parse(r);if(i)return i}throw new ae(`Could not parse numberArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"colorArray":{let r;for(let n of this.args){r=n.evaluate(e);let i=Ae.parse(r);if(i)return i}throw new ae(`Could not parse colorArray from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"variableAnchorOffsetCollection":{let r;for(let n of this.args){r=n.evaluate(e);let i=De.parse(r);if(i)return i}throw new ae(`Could not parse variableAnchorOffsetCollection from value '${typeof r=="string"?r:JSON.stringify(r)}'`)}case"number":{let r=null;for(let n of this.args){if(r=n.evaluate(e),r===null)return 0;let i=Number(r);if(!isNaN(i))return i}throw new ae(`Could not convert ${JSON.stringify(r)} to number.`)}case"formatted":return Le.fromString(ln(this.args[0].evaluate(e)));case"resolvedImage":return _e.fromString(ln(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return ln(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}},zh=["Unknown","Point","LineString","Polygon"],io=class{static{l(this,"EvaluationContext")}constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?zh[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let r=this._parseColorCache.get(e);return r||(r=Y.parse(e),this._parseColorCache.set(e,r)),r}},oo=class t{static{l(this,"ParsingContext")}constructor(e,r,n=[],i,o=new Ss,a=[]){this.registry=e,this.path=n,this.key=n.map(s=>`[${s}]`).join(""),this.scope=o,this.errors=a,this.expectedType=i,this._isConstant=r}parse(e,r,n,i,o={}){return r?this.concat(r,n,i)._parse(e,o):this._parse(e,o)}_parse(e,r){(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number")&&(e=["literal",e]);function n(i,o,a){return a==="assert"?new We(o,[i]):a==="coerce"?new _t(o,[i]):i}if(l(n,"annotate"),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let i=e[0];if(typeof i!="string")return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let o=this.registry[i];if(o){let a=o.parse(e,this);if(!a)return null;if(this.expectedType){let s=this.expectedType,u=a.type;if((s.kind==="string"||s.kind==="number"||s.kind==="boolean"||s.kind==="object"||s.kind==="array")&&u.kind==="value")a=n(a,s,r.typeAnnotation||"assert");else if(s.kind==="projectionDefinition"&&["string","array"].includes(u.kind)||["color","formatted","resolvedImage"].includes(s.kind)&&["value","string"].includes(u.kind)||["padding","numberArray"].includes(s.kind)&&["value","number","array"].includes(u.kind)||s.kind==="colorArray"&&["value","string","array"].includes(u.kind)||s.kind==="variableAnchorOffsetCollection"&&["value","array"].includes(u.kind))a=n(a,s,r.typeAnnotation||"coerce");else if(this.checkSubtype(s,u))return null}if(!(a instanceof Ct)&&a.type.kind!=="resolvedImage"&&this._isConstant(a)){let s=new io;try{a=new Ct(a.type,a.evaluate(s))}catch(u){return this.error(u.message),null}}return a}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}else return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):typeof e=="object"?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,r,n){let i=typeof e=="number"?this.path.concat(e):this.path,o=n?this.scope.concat(n):this.scope;return new t(this.registry,this._isConstant,i,r||null,o,this.errors)}error(e,...r){let n=`${this.key}${r.map(i=>`[${i}]`).join("")}`;this.errors.push(new Oe(n,e))}checkSubtype(e,r){let n=cn(e,r);return n&&this.error(n),n}},ao=class t{static{l(this,"Let")}constructor(e,r){this.type=r.type,this.bindings=[].concat(e),this.result=r}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let r of this.bindings)e(r[1]);e(this.result)}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let n=[];for(let o=1;o<e.length-1;o+=2){let a=e[o];if(typeof a!="string")return r.error(`Expected string, but found ${typeof a} instead.`,o);if(/[^a-zA-Z0-9_]/.test(a))return r.error("Variable names must contain only alphanumeric characters or '_'.",o);let s=r.parse(e[o+1],o+1);if(!s)return null;n.push([a,s])}let i=r.parse(e[e.length-1],e.length-1,r.expectedType,n);return i?new t(n,i):null}outputDefined(){return this.result.outputDefined()}},so=class t{static{l(this,"Var")}constructor(e,r){this.type=r.type,this.name=e,this.boundExpression=r}static parse(e,r){if(e.length!==2||typeof e[1]!="string")return r.error("'var' expression requires exactly one string literal argument.");let n=e[1];return r.scope.has(n)?new t(n,r.scope.get(n)):r.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}},ws=class t{static{l(this,"At")}constructor(e,r,n){this.type=e,this.index=r,this.input=n}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,M),i=r.parse(e[2],2,Ee(r.expectedType||j));if(!n||!i)return null;let o=i.type;return new t(o.itemType,n,i)}evaluate(e){let r=this.index.evaluate(e),n=this.input.evaluate(e);if(r<0)throw new ae(`Array index out of bounds: ${r} < 0.`);if(r>=n.length)throw new ae(`Array index out of bounds: ${r} > ${n.length-1}.`);if(r!==Math.floor(r))throw new ae(`Array index must be an integer, but found ${r} instead.`);return n[r]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}},As=class t{static{l(this,"In")}constructor(e,r){this.type=q,this.needle=e,this.haystack=r}static parse(e,r){if(e.length!==3)return r.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,j),i=r.parse(e[2],2,j);return!n||!i?null:Gs(n.type,[q,W,M,Ir,j])?new t(n,i):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${se(n.type)} instead`)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!n)return!1;if(!Jt(r,["boolean","string","number","null"]))throw new ae(`Expected first argument to be of type boolean, string, number or null, but found ${se(fe(r))} instead.`);if(!Jt(n,["string","array"]))throw new ae(`Expected second argument to be of type array or string, but found ${se(fe(n))} instead.`);return n.indexOf(r)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}},_s=class t{static{l(this,"IndexOf")}constructor(e,r,n){this.type=M,this.needle=e,this.haystack=r,this.fromIndex=n}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,j),i=r.parse(e[2],2,j);if(!n||!i)return null;if(!Gs(n.type,[q,W,M,Ir,j]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${se(n.type)} instead`);if(e.length===4){let o=r.parse(e[3],3,M);return o?new t(n,i,o):null}else return new t(n,i)}evaluate(e){let r=this.needle.evaluate(e),n=this.haystack.evaluate(e);if(!Jt(r,["boolean","string","number","null"]))throw new ae(`Expected first argument to be of type boolean, string, number or null, but found ${se(fe(r))} instead.`);let i;if(this.fromIndex&&(i=this.fromIndex.evaluate(e)),Jt(n,["string"])){let o=n.indexOf(r,i);return o===-1?-1:[...n.slice(0,o)].length}else{if(Jt(n,["array"]))return n.indexOf(r,i);throw new ae(`Expected second argument to be of type array or string, but found ${se(fe(n))} instead.`)}}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}},Is=class t{static{l(this,"Match")}constructor(e,r,n,i,o,a){this.inputType=e,this.type=r,this.input=n,this.cases=i,this.outputs=o,this.otherwise=a}static parse(e,r){if(e.length<5)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!==1)return r.error("Expected an even number of arguments.");let n,i;r.expectedType&&r.expectedType.kind!=="value"&&(i=r.expectedType);let o={},a=[];for(let c=2;c<e.length-1;c+=2){let p=e[c],f=e[c+1];Array.isArray(p)||(p=[p]);let y=r.concat(c);if(p.length===0)return y.error("Expected at least one branch label.");for(let h of p){if(typeof h!="number"&&typeof h!="string")return y.error("Branch labels must be numbers or strings.");if(typeof h=="number"&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return y.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof h=="number"&&Math.floor(h)!==h)return y.error("Numeric branch labels must be integer values.");if(!n)n=fe(h);else if(y.checkSubtype(n,fe(h)))return null;if(typeof o[String(h)]<"u")return y.error("Branch labels must be unique.");o[String(h)]=a.length}let m=r.parse(f,c,i);if(!m)return null;i=i||m.type,a.push(m)}let s=r.parse(e[1],1,j);if(!s)return null;let u=r.parse(e[e.length-1],e.length-1,i);return!u||s.type.kind!=="value"&&r.concat(1).checkSubtype(n,s.type)?null:new t(n,i,s,o,a,u)}evaluate(e){let r=this.input.evaluate(e);return(fe(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every(e=>e.outputDefined())&&this.otherwise.outputDefined()}},Ts=class t{static{l(this,"Case")}constructor(e,r,n){this.type=e,this.branches=r,this.otherwise=n}static parse(e,r){if(e.length<4)return r.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!==0)return r.error("Expected an odd number of arguments.");let n;r.expectedType&&r.expectedType.kind!=="value"&&(n=r.expectedType);let i=[];for(let a=1;a<e.length-1;a+=2){let s=r.parse(e[a],a,q);if(!s)return null;let u=r.parse(e[a+1],a+1,n);if(!u)return null;i.push([s,u]),n=n||u.type}let o=r.parse(e[e.length-1],e.length-1,n);if(!o)return null;if(!n)throw new Error("Can't infer output type");return new t(n,i,o)}evaluate(e){for(let[r,n]of this.branches)if(r.evaluate(e))return n.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[r,n]of this.branches)e(r),e(n);e(this.otherwise)}outputDefined(){return this.branches.every(([e,r])=>r.outputDefined())&&this.otherwise.outputDefined()}},Cs=class t{static{l(this,"Slice")}constructor(e,r,n,i){this.type=e,this.input=r,this.beginIndex=n,this.endIndex=i}static parse(e,r){if(e.length<=2||e.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);let n=r.parse(e[1],1,j),i=r.parse(e[2],2,M);if(!n||!i)return null;if(!Gs(n.type,[Ee(j),W,j]))return r.error(`Expected first argument to be of type array or string, but found ${se(n.type)} instead`);if(e.length===4){let o=r.parse(e[3],3,M);return o?new t(n.type,n,i,o):null}else return new t(n.type,n,i)}evaluate(e){let r=this.input.evaluate(e),n=this.beginIndex.evaluate(e),i;if(this.endIndex&&(i=this.endIndex.evaluate(e)),Jt(r,["string"]))return[...r].slice(n,i).join("");if(Jt(r,["array"]))return r.slice(n,i);throw new ae(`Expected first argument to be of type array or string, but found ${se(fe(r))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};function wo(t,e){let r=t.length-1,n=0,i=r,o=0,a,s;for(;n<=i;)if(o=Math.floor((n+i)/2),a=t[o],s=t[o+1],a<=e){if(o===r||e<s)return o;n=o+1}else if(a>e)i=o-1;else throw new ae("Input is not a number.");return 0}l(wo,"findStopLessThanOrEqualTo");var Ar=class t{static{l(this,"Step")}constructor(e,r,n){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(let[i,o]of n)this.labels.push(i),this.outputs.push(o)}static parse(e,r){if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return r.error("Expected an even number of arguments.");let n=r.parse(e[1],1,M);if(!n)return null;let i=[],o=null;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);for(let a=1;a<e.length;a+=2){let s=a===1?-1/0:e[a],u=e[a+1],c=a,p=a+1;if(typeof s!="number")return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',c);if(i.length&&i[i.length-1][0]>=s)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);let f=r.parse(u,p,o);if(!f)return null;o=o||f.type,i.push([s,f])}return new t(o,n,i)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);let a=wo(r,i);return n[a].evaluate(e)}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function Oh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}l(Oh,"getDefaultExportFromCjs");var gs,Mu;function Gh(){if(Mu)return gs;Mu=1,gs=t;function t(e,r,n,i){this.cx=3*e,this.bx=3*(n-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(i-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=r,this.p2x=n,this.p2y=i}return l(t,"UnitBezier"),t.prototype={sampleCurveX:l(function(e){return((this.ax*e+this.bx)*e+this.cx)*e},"sampleCurveX"),sampleCurveY:l(function(e){return((this.ay*e+this.by)*e+this.cy)*e},"sampleCurveY"),sampleCurveDerivativeX:l(function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},"sampleCurveDerivativeX"),solveCurveX:l(function(e,r){if(r===void 0&&(r=1e-6),e<0)return 0;if(e>1)return 1;for(var n=e,i=0;i<8;i++){var o=this.sampleCurveX(n)-e;if(Math.abs(o)<r)return n;var a=this.sampleCurveDerivativeX(n);if(Math.abs(a)<1e-6)break;n=n-o/a}var s=0,u=1;for(n=e,i=0;i<20&&(o=this.sampleCurveX(n),!(Math.abs(o-e)<r));i++)e>o?s=n:u=n,n=(u-s)*.5+s;return n},"solveCurveX"),solve:l(function(e,r){return this.sampleCurveY(this.solveCurveX(e,r))},"solve")},gs}l(Gh,"requireUnitbezier");var Nh=Gh(),Uh=Oh(Nh),Me=class t{static{l(this,"Interpolate")}constructor(e,r,n,i,o){this.type=e,this.operator=r,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(let[a,s]of o)this.labels.push(a),this.outputs.push(s)}static interpolationFactor(e,r,n,i){let o=0;if(e.name==="exponential")o=bs(r,e.base,n,i);else if(e.name==="linear")o=bs(r,1,n,i);else if(e.name==="cubic-bezier"){let a=e.controlPoints;o=new Uh(a[0],a[1],a[2],a[3]).solve(bs(r,1,n,i))}return o}static parse(e,r){let[n,i,o,...a]=e;if(!Array.isArray(i)||i.length===0)return r.error("Expected an interpolation type expression.",1);if(i[0]==="linear")i={name:"linear"};else if(i[0]==="exponential"){let c=i[1];if(typeof c!="number")return r.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:c}}else if(i[0]==="cubic-bezier"){let c=i.slice(1);if(c.length!==4||c.some(p=>typeof p!="number"||p<0||p>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:c}}else return r.error(`Unknown interpolation type ${String(i[0])}`,1,0);if(e.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!==0)return r.error("Expected an even number of arguments.");if(o=r.parse(o,2,M),!o)return null;let s=[],u=null;(n==="interpolate-hcl"||n==="interpolate-lab")&&r.expectedType!=un?u=Ne:r.expectedType&&r.expectedType.kind!=="value"&&(u=r.expectedType);for(let c=0;c<a.length;c+=2){let p=a[c],f=a[c+1],y=c+3,m=c+4;if(typeof p!="number")return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',y);if(s.length&&s[s.length-1][0]>=p)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',y);let h=r.parse(f,m,u);if(!h)return null;u=u||h.type,s.push([p,h])}return!At(u,M)&&!At(u,bo)&&!At(u,Ne)&&!At(u,vo)&&!At(u,Po)&&!At(u,un)&&!At(u,So)&&!At(u,Ee(M))?r.error(`Type ${se(u)} is not interpolatable.`):new t(u,n,i,o,s)}evaluate(e){let r=this.labels,n=this.outputs;if(r.length===1)return n[0].evaluate(e);let i=this.input.evaluate(e);if(i<=r[0])return n[0].evaluate(e);let o=r.length;if(i>=r[o-1])return n[o-1].evaluate(e);let a=wo(r,i),s=r[a],u=r[a+1],c=t.interpolationFactor(this.interpolation,i,s,u),p=n[a].evaluate(e),f=n[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return It(p,f,c);case"color":return Y.interpolate(p,f,c);case"padding":return Ue.interpolate(p,f,c);case"colorArray":return Ae.interpolate(p,f,c);case"numberArray":return $e.interpolate(p,f,c);case"variableAnchorOffsetCollection":return De.interpolate(p,f,c);case"array":return wr(p,f,c);case"projectionDefinition":return Tt.interpolate(p,f,c)}case"interpolate-hcl":switch(this.type.kind){case"color":return Y.interpolate(p,f,c,"hcl");case"colorArray":return Ae.interpolate(p,f,c,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Y.interpolate(p,f,c,"lab");case"colorArray":return Ae.interpolate(p,f,c,"lab")}}}eachChild(e){e(this.input);for(let r of this.outputs)e(r)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}};function bs(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}l(bs,"exponentialInterpolation");var pt={color:Y.interpolate,number:It,padding:Ue.interpolate,numberArray:$e.interpolate,colorArray:Ae.interpolate,variableAnchorOffsetCollection:De.interpolate,array:wr},lo=class t{static{l(this,"Coalesce")}constructor(e,r){this.type=e,this.args=r}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=null,i=r.expectedType;i&&i.kind!=="value"&&(n=i);let o=[];for(let s of e.slice(1)){let u=r.parse(s,1+o.length,n,void 0,{typeAnnotation:"omit"});if(!u)return null;n=n||u.type,o.push(u)}if(!n)throw new Error("No output type");return i&&o.some(s=>cn(i,s.type))?new t(j,o):new t(n,o)}evaluate(e){let r=null,n=0,i;for(let o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof _e&&!r.available&&(i||(i=r.name),r=null,n===this.args.length&&(r=i)),r!==null)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}};function Lu(t,e){return t==="=="||t==="!="?e.kind==="boolean"||e.kind==="string"||e.kind==="number"||e.kind==="null"||e.kind==="value":e.kind==="string"||e.kind==="number"||e.kind==="value"}l(Lu,"isComparableType");function $h(t,e,r){return e===r}l($h,"eq");function jh(t,e,r){return e!==r}l(jh,"neq");function qh(t,e,r){return e<r}l(qh,"lt");function Wh(t,e,r){return e>r}l(Wh,"gt");function Xh(t,e,r){return e<=r}l(Xh,"lteq");function Hh(t,e,r){return e>=r}l(Hh,"gteq");function ic(t,e,r,n){return n.compare(e,r)===0}l(ic,"eqCollate");function Zh(t,e,r,n){return!ic(t,e,r,n)}l(Zh,"neqCollate");function Jh(t,e,r,n){return n.compare(e,r)<0}l(Jh,"ltCollate");function Yh(t,e,r,n){return n.compare(e,r)>0}l(Yh,"gtCollate");function Kh(t,e,r,n){return n.compare(e,r)<=0}l(Kh,"lteqCollate");function Qh(t,e,r,n){return n.compare(e,r)>=0}l(Qh,"gteqCollate");function Cr(t,e,r){let n=t!=="=="&&t!=="!=";return class oc{static{l(this,"Comparison")}constructor(o,a,s){this.type=q,this.lhs=o,this.rhs=a,this.collator=s,this.hasUntypedArgument=o.type.kind==="value"||a.type.kind==="value"}static parse(o,a){if(o.length!==3&&o.length!==4)return a.error("Expected two or three arguments.");let s=o[0],u=a.parse(o[1],1,j);if(!u)return null;if(!Lu(s,u.type))return a.concat(1).error(`"${s}" comparisons are not supported for type '${se(u.type)}'.`);let c=a.parse(o[2],2,j);if(!c)return null;if(!Lu(s,c.type))return a.concat(2).error(`"${s}" comparisons are not supported for type '${se(c.type)}'.`);if(u.type.kind!==c.type.kind&&u.type.kind!=="value"&&c.type.kind!=="value")return a.error(`Cannot compare types '${se(u.type)}' and '${se(c.type)}'.`);n&&(u.type.kind==="value"&&c.type.kind!=="value"?u=new We(c.type,[u]):u.type.kind!=="value"&&c.type.kind==="value"&&(c=new We(u.type,[c])));let p=null;if(o.length===4){if(u.type.kind!=="string"&&c.type.kind!=="string"&&u.type.kind!=="value"&&c.type.kind!=="value")return a.error("Cannot use collator to compare non-string types.");if(p=a.parse(o[3],3,xo),!p)return null}return new oc(u,c,p)}evaluate(o){let a=this.lhs.evaluate(o),s=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){let u=fe(a),c=fe(s);if(u.kind!==c.kind||!(u.kind==="string"||u.kind==="number"))throw new ae(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${u.kind}, ${c.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){let u=fe(a),c=fe(s);if(u.kind!=="string"||c.kind!=="string")return e(o,a,s)}return this.collator?r(o,a,s,this.collator.evaluate(o)):e(o,a,s)}eachChild(o){o(this.lhs),o(this.rhs),this.collator&&o(this.collator)}outputDefined(){return!0}}}l(Cr,"makeComparison");var ed=Cr("==",$h,ic),td=Cr("!=",jh,Zh),rd=Cr("<",qh,Jh),nd=Cr(">",Wh,Yh),id=Cr("<=",Xh,Kh),od=Cr(">=",Hh,Qh),uo=class t{static{l(this,"CollatorExpression")}constructor(e,r,n){this.type=xo,this.locale=n,this.caseSensitive=e,this.diacriticSensitive=r}static parse(e,r){if(e.length!==2)return r.error("Expected one argument.");let n=e[1];if(typeof n!="object"||Array.isArray(n))return r.error("Collator options argument must be an object.");let i=r.parse(n["case-sensitive"]===void 0?!1:n["case-sensitive"],1,q);if(!i)return null;let o=r.parse(n["diacritic-sensitive"]===void 0?!1:n["diacritic-sensitive"],1,q);if(!o)return null;let a=null;return n.locale&&(a=r.parse(n.locale,1,W),!a)?null:new t(i,o,a)}evaluate(e){return new pn(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}},ks=class t{static{l(this,"NumberFormat")}constructor(e,r,n,i,o){this.type=W,this.number=e,this.locale=r,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=o}static parse(e,r){if(e.length!==3)return r.error("Expected two arguments.");let n=r.parse(e[1],1,M);if(!n)return null;let i=e[2];if(typeof i!="object"||Array.isArray(i))return r.error("NumberFormat options argument must be an object.");let o=null;if(i.locale&&(o=r.parse(i.locale,1,W),!o))return null;let a=null;if(i.currency&&(a=r.parse(i.currency,1,W),!a))return null;let s=null;if(i["min-fraction-digits"]&&(s=r.parse(i["min-fraction-digits"],1,M),!s))return null;let u=null;return i["max-fraction-digits"]&&(u=r.parse(i["max-fraction-digits"],1,M),!u)?null:new t(n,o,a,s,u)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}},mn=class t{static{l(this,"FormatExpression")}constructor(e){this.type=Tr,this.sections=e}static parse(e,r){if(e.length<2)return r.error("Expected at least one argument.");let n=e[1];if(!Array.isArray(n)&&typeof n=="object")return r.error("First argument must be an image or text section.");let i=[],o=!1;for(let a=1;a<=e.length-1;++a){let s=e[a];if(o&&typeof s=="object"&&!Array.isArray(s)){o=!1;let u=null;if(s["font-scale"]&&(u=r.parse(s["font-scale"],1,M),!u))return null;let c=null;if(s["text-font"]&&(c=r.parse(s["text-font"],1,Ee(W)),!c))return null;let p=null;if(s["text-color"]&&(p=r.parse(s["text-color"],1,Ne),!p))return null;let f=null;if(s["vertical-align"]){if(typeof s["vertical-align"]=="string"&&!Vh.includes(s["vertical-align"]))return r.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${s["vertical-align"]}' instead.`);if(f=r.parse(s["vertical-align"],1,W),!f)return null}let y=i[i.length-1];y.scale=u,y.font=c,y.textColor=p,y.verticalAlign=f}else{let u=r.parse(e[a],1,j);if(!u)return null;let c=u.type.kind;if(c!=="string"&&c!=="value"&&c!=="null"&&c!=="resolvedImage")return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,i.push({content:u,scale:null,font:null,textColor:null,verticalAlign:null})}}return new t(i)}evaluate(e){let r=l(n=>{let i=n.content.evaluate(e);return fe(i)===wn?new fn("",i,null,null,null,n.verticalAlign?n.verticalAlign.evaluate(e):null):new fn(ln(i),null,n.scale?n.scale.evaluate(e):null,n.font?n.font.evaluate(e).join(","):null,n.textColor?n.textColor.evaluate(e):null,n.verticalAlign?n.verticalAlign.evaluate(e):null)},"evaluateSection");return new Le(this.sections.map(r))}eachChild(e){for(let r of this.sections)e(r.content),r.scale&&e(r.scale),r.font&&e(r.font),r.textColor&&e(r.textColor),r.verticalAlign&&e(r.verticalAlign)}outputDefined(){return!1}},Fs=class t{static{l(this,"ImageExpression")}constructor(e){this.type=wn,this.input=e}static parse(e,r){if(e.length!==2)return r.error("Expected two arguments.");let n=r.parse(e[1],1,W);return n?new t(n):r.error("No image name provided.")}evaluate(e){let r=this.input.evaluate(e),n=_e.fromString(r);return n&&e.availableImages&&(n.available=e.availableImages.indexOf(r)>-1),n}eachChild(e){e(this.input)}outputDefined(){return!1}},Es=class t{static{l(this,"Length")}constructor(e){this.type=M,this.input=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=r.parse(e[1],1);return n?n.type.kind!=="array"&&n.type.kind!=="string"&&n.type.kind!=="value"?r.error(`Expected argument of type string or array, but found ${se(n.type)} instead.`):new t(n):null}evaluate(e){let r=this.input.evaluate(e);if(typeof r=="string")return[...r].length;if(Array.isArray(r))return r.length;throw new ae(`Expected value to be of type string or array, but found ${se(fe(r))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}},Ye=8192;function ad(t,e){let r=sd(t[0]),n=ud(t[1]),i=Math.pow(2,e.z);return[Math.round(r*i*Ye),Math.round(n*i*Ye)]}l(ad,"getTileCoordinates");function Ns(t,e){let r=Math.pow(2,e.z),n=(t[0]/Ye+e.x)/r,i=(t[1]/Ye+e.y)/r;return[ld(n),cd(i)]}l(Ns,"getLngLatFromTileCoord");function sd(t){return(180+t)/360}l(sd,"mercatorXfromLng");function ld(t){return t*360-180}l(ld,"lngFromMercatorXfromLng");function ud(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}l(ud,"mercatorYfromLat");function cd(t){return 360/Math.PI*Math.atan(Math.exp((180-t*360)*Math.PI/180))-90}l(cd,"latFromMercatorY");function An(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])}l(An,"updateBBox");function hn(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}l(hn,"boxWithinBox");function pd(t,e,r){return e[1]>t[1]!=r[1]>t[1]&&t[0]<(r[0]-e[0])*(t[1]-e[1])/(r[1]-e[1])+e[0]}l(pd,"rayIntersect");function fd(t,e,r){let n=t[0]-e[0],i=t[1]-e[1],o=t[0]-r[0],a=t[1]-r[1];return n*a-o*i===0&&n*o<=0&&i*a<=0}l(fd,"pointOnBoundary");function Ao(t,e,r,n){let i=[e[0]-t[0],e[1]-t[1]],o=[n[0]-r[0],n[1]-r[1]];return dd(o,i)===0?!1:!!(Du(t,e,r,n)&&Du(r,n,t,e))}l(Ao,"segmentIntersectSegment");function yd(t,e,r){for(let n of r)for(let i=0;i<n.length-1;++i)if(Ao(t,e,n[i],n[i+1]))return!0;return!1}l(yd,"lineIntersectPolygon");function kr(t,e,r=!1){let n=!1;for(let i of e)for(let o=0;o<i.length-1;o++){if(fd(t,i[o],i[o+1]))return r;pd(t,i[o],i[o+1])&&(n=!n)}return n}l(kr,"pointWithinPolygon");function md(t,e){for(let r of e)if(kr(t,r))return!0;return!1}l(md,"pointWithinPolygons");function ac(t,e){for(let r of t)if(!kr(r,e))return!1;for(let r=0;r<t.length-1;++r)if(yd(t[r],t[r+1],e))return!1;return!0}l(ac,"lineStringWithinPolygon");function hd(t,e){for(let r of e)if(ac(t,r))return!0;return!1}l(hd,"lineStringWithinPolygons");function dd(t,e){return t[0]*e[1]-t[1]*e[0]}l(dd,"perp");function Du(t,e,r,n){let i=t[0]-r[0],o=t[1]-r[1],a=e[0]-r[0],s=e[1]-r[1],u=n[0]-r[0],c=n[1]-r[1],p=i*c-u*o,f=a*c-u*s;return p>0&&f<0||p<0&&f>0}l(Du,"twoSided");function Us(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=[];for(let a=0;a<t[i].length;a++){let s=ad(t[i][a],r);An(e,s),o.push(s)}n.push(o)}return n}l(Us,"getTilePolygon");function sc(t,e,r){let n=[];for(let i=0;i<t.length;i++){let o=Us(t[i],e,r);n.push(o)}return n}l(sc,"getTilePolygons");function lc(t,e,r,n){if(t[0]<r[0]||t[0]>r[2]){let i=n*.5,o=t[0]-r[0]>i?-n:r[0]-t[0]>i?n:0;o===0&&(o=t[0]-r[2]>i?-n:r[2]-t[0]>i?n:0),t[0]+=o}An(e,t)}l(lc,"updatePoint");function gd(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}l(gd,"resetBBox");function Bu(t,e,r,n){let i=Math.pow(2,n.z)*Ye,o=[n.x*Ye,n.y*Ye],a=[];for(let s of t)for(let u of s){let c=[u.x+o[0],u.y+o[1]];lc(c,e,r,i),a.push(c)}return a}l(Bu,"getTilePoints");function Vu(t,e,r,n){let i=Math.pow(2,n.z)*Ye,o=[n.x*Ye,n.y*Ye],a=[];for(let s of t){let u=[];for(let c of s){let p=[c.x+o[0],c.y+o[1]];An(e,p),u.push(p)}a.push(u)}if(e[2]-e[0]<=i/2){gd(e);for(let s of a)for(let u of s)lc(u,e,r,i)}return a}l(Vu,"getTileLines");function bd(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=Us(e.coordinates,n,i),a=Bu(t.geometry(),r,n,i);if(!hn(r,n))return!1;for(let s of a)if(!kr(s,o))return!1}if(e.type==="MultiPolygon"){let o=sc(e.coordinates,n,i),a=Bu(t.geometry(),r,n,i);if(!hn(r,n))return!1;for(let s of a)if(!md(s,o))return!1}return!0}l(bd,"pointsWithinPolygons");function xd(t,e){let r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=t.canonicalID();if(e.type==="Polygon"){let o=Us(e.coordinates,n,i),a=Vu(t.geometry(),r,n,i);if(!hn(r,n))return!1;for(let s of a)if(!ac(s,o))return!1}if(e.type==="MultiPolygon"){let o=sc(e.coordinates,n,i),a=Vu(t.geometry(),r,n,i);if(!hn(r,n))return!1;for(let s of a)if(!hd(s,o))return!1}return!0}l(xd,"linesWithinPolygons");var dn=class t{static{l(this,"Within")}constructor(e,r){this.type=q,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(yn(e[1])){let n=e[1];if(n.type==="FeatureCollection"){let i=[];for(let o of n.features){let{type:a,coordinates:s}=o.geometry;a==="Polygon"&&i.push(s),a==="MultiPolygon"&&i.push(...s)}if(i.length){let o={type:"MultiPolygon",coordinates:i};return new t(n,o)}}else if(n.type==="Feature"){let i=n.geometry.type;if(i==="Polygon"||i==="MultiPolygon")return new t(n,n.geometry)}else if(n.type==="Polygon"||n.type==="MultiPolygon")return new t(n,n)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return bd(e,this.geometries);if(e.geometryType()==="LineString")return xd(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}},co=class{static{l(this,"TinyQueue")}constructor(e=[],r=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:n}=this,i=r[e];for(;e>0;){let o=e-1>>1,a=r[o];if(n(i,a)>=0)break;r[e]=a,e=o}r[e]=i}_down(e){let{data:r,compare:n}=this,i=this.length>>1,o=r[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&n(r[s],r[a])<0&&(a=s),n(r[a],o)>=0)break;r[e]=r[a],e=a}r[e]=o}};function uc(t,e,r=0,n=t.length-1,i=vd){for(;n>r;){if(n-r>600){let u=n-r+1,c=e-r+1,p=Math.log(u),f=.5*Math.exp(2*p/3),y=.5*Math.sqrt(p*f*(u-f)/u)*(c-u/2<0?-1:1),m=Math.max(r,Math.floor(e-c*f/u+y)),h=Math.min(n,Math.floor(e+(u-c)*f/u+y));uc(t,e,m,h,i)}let o=t[e],a=r,s=n;for(an(t,r,e),i(t[n],o)>0&&an(t,r,n);a<s;){for(an(t,a,s),a++,s--;i(t[a],o)<0;)a++;for(;i(t[s],o)>0;)s--}i(t[r],o)===0?an(t,r,s):(s++,an(t,s,n)),s<=e&&(r=s+1),e<=s&&(n=s-1)}}l(uc,"quickselect");function an(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}l(an,"swap");function vd(t,e){return t<e?-1:t>e?1:0}l(vd,"defaultCompare");function er(t,e){if(t.length<=1)return[t];let n=[],i,o;for(let a of t){let s=Sd(a);s!==0&&(a.area=Math.abs(s),o===void 0&&(o=s<0),o===s<0?(i&&n.push(i),i=[a]):i.push(a))}if(i&&n.push(i),e>1)for(let a=0;a<n.length;a++)n[a].length<=e||(uc(n[a],e,1,n[a].length-1,Pd),n[a]=n[a].slice(0,e));return n}l(er,"classifyRings");function Pd(t,e){return e.area-t.area}l(Pd,"compareAreas");function Sd(t){let e=0;for(let r=0,n=t.length,i=n-1,o,a;r<n;i=r++)o=t[r],a=t[i],e+=(a.x-o.x)*(o.y+a.y);return e}l(Sd,"calculateSignedArea");var wd=6378.137,Ru=1/298.257223563,zu=Ru*(2-Ru),Ou=Math.PI/180,gn=class{static{l(this,"CheapRuler")}constructor(e){let r=Ou*wd*1e3,n=Math.cos(e*Ou),i=1/(1-zu*(1-n*n)),o=Math.sqrt(i);this.kx=r*o*n,this.ky=r*o*i*(1-zu)}distance(e,r){let n=this.wrap(e[0]-r[0])*this.kx,i=(e[1]-r[1])*this.ky;return Math.sqrt(n*n+i*i)}pointOnLine(e,r){let n=1/0,i,o,a,s;for(let u=0;u<e.length-1;u++){let c=e[u][0],p=e[u][1],f=this.wrap(e[u+1][0]-c)*this.kx,y=(e[u+1][1]-p)*this.ky,m=0;(f!==0||y!==0)&&(m=(this.wrap(r[0]-c)*this.kx*f+(r[1]-p)*this.ky*y)/(f*f+y*y),m>1?(c=e[u+1][0],p=e[u+1][1]):m>0&&(c+=f/this.kx*m,p+=y/this.ky*m)),f=this.wrap(r[0]-c)*this.kx,y=(r[1]-p)*this.ky;let h=f*f+y*y;h<n&&(n=h,i=c,o=p,a=u,s=m)}return{point:[i,o],index:a,t:Math.max(0,Math.min(1,s))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}},Ms=100,Ls=50;function cc(t,e){return e[0]-t[0]}l(cc,"compareDistPair");function po(t){return t[1]-t[0]+1}l(po,"getRangeSize");function ct(t,e){return t[1]>=t[0]&&t[1]<e}l(ct,"isRangeSafe");function Ds(t,e){if(t[0]>t[1])return[null,null];let r=po(t);if(e){if(r===2)return[t,null];let i=Math.floor(r/2);return[[t[0],t[0]+i],[t[0]+i,t[1]]]}if(r===1)return[t,null];let n=Math.floor(r/2)-1;return[[t[0],t[0]+n],[t[0]+n+1,t[1]]]}l(Ds,"splitRange");function Bs(t,e){if(!ct(e,t.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let n=e[0];n<=e[1];++n)An(r,t[n]);return r}l(Bs,"getBBox");function Vs(t){let e=[1/0,1/0,-1/0,-1/0];for(let r of t)for(let n of r)An(e,n);return e}l(Vs,"getPolygonBBox");function Gu(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}l(Gu,"isValidBBox");function $s(t,e,r){if(!Gu(t)||!Gu(e))return NaN;let n=0,i=0;return t[2]<e[0]&&(n=e[0]-t[2]),t[0]>e[2]&&(n=t[0]-e[2]),t[1]>e[3]&&(i=t[1]-e[3]),t[3]<e[1]&&(i=e[1]-t[3]),r.distance([0,0],[n,i])}l($s,"bboxToBBoxDistance");function Ht(t,e,r){let n=r.pointOnLine(e,t);return r.distance(t,n.point)}l(Ht,"pointToLineDistance");function js(t,e,r,n,i){let o=Math.min(Ht(t,[r,n],i),Ht(e,[r,n],i)),a=Math.min(Ht(r,[t,e],i),Ht(n,[t,e],i));return Math.min(o,a)}l(js,"segmentToSegmentDistance");function Ad(t,e,r,n,i){if(!(ct(e,t.length)&&ct(n,r.length)))return 1/0;let a=1/0;for(let s=e[0];s<e[1];++s){let u=t[s],c=t[s+1];for(let p=n[0];p<n[1];++p){let f=r[p],y=r[p+1];if(Ao(u,c,f,y))return 0;a=Math.min(a,js(u,c,f,y,i))}}return a}l(Ad,"lineToLineDistance");function _d(t,e,r,n,i){if(!(ct(e,t.length)&&ct(n,r.length)))return NaN;let a=1/0;for(let s=e[0];s<=e[1];++s)for(let u=n[0];u<=n[1];++u)if(a=Math.min(a,i.distance(t[s],r[u])),a===0)return a;return a}l(_d,"pointsToPointsDistance");function Id(t,e,r){if(kr(t,e,!0))return 0;let n=1/0;for(let i of e){let o=i[0],a=i[i.length-1];if(o!==a&&(n=Math.min(n,Ht(t,[a,o],r)),n===0))return n;let s=r.pointOnLine(i,t);if(n=Math.min(n,r.distance(t,s.point)),n===0)return n}return n}l(Id,"pointToPolygonDistance");function Td(t,e,r,n){if(!ct(e,t.length))return NaN;for(let o=e[0];o<=e[1];++o)if(kr(t[o],r,!0))return 0;let i=1/0;for(let o=e[0];o<e[1];++o){let a=t[o],s=t[o+1];for(let u of r)for(let c=0,p=u.length,f=p-1;c<p;f=c++){let y=u[f],m=u[c];if(Ao(a,s,y,m))return 0;i=Math.min(i,js(a,s,y,m,n))}}return i}l(Td,"lineToPolygonDistance");function Nu(t,e){for(let r of t)for(let n of r)if(kr(n,e,!0))return!0;return!1}l(Nu,"polygonIntersect");function Cd(t,e,r,n=1/0){let i=Vs(t),o=Vs(e);if(n!==1/0&&$s(i,o,r)>=n)return n;if(hn(i,o)){if(Nu(t,e))return 0}else if(Nu(e,t))return 0;let a=1/0;for(let s of t)for(let u=0,c=s.length,p=c-1;u<c;p=u++){let f=s[p],y=s[u];for(let m of e)for(let h=0,d=m.length,x=d-1;h<d;x=h++){let b=m[x],P=m[h];if(Ao(f,y,b,P))return 0;a=Math.min(a,js(f,y,b,P,r))}}return a}l(Cd,"polygonToPolygonDistance");function Uu(t,e,r,n,i,o){if(!o)return;let a=$s(Bs(n,o),i,r);a<e&&t.push([a,o,[0,0]])}l(Uu,"updateQueue");function to(t,e,r,n,i,o,a){if(!o||!a)return;let s=$s(Bs(n,o),Bs(i,a),r);s<e&&t.push([s,o,a])}l(to,"updateQueueTwoSets");function fo(t,e,r,n,i=1/0){let o=Math.min(n.distance(t[0],r[0][0]),i);if(o===0)return o;let a=new co([[0,[0,t.length-1],[0,0]]],cc),s=Vs(r);for(;a.length>0;){let u=a.pop();if(u[0]>=o)continue;let c=u[1],p=e?Ls:Ms;if(po(c)<=p){if(!ct(c,t.length))return NaN;if(e){let f=Td(t,c,r,n);if(isNaN(f)||f===0)return f;o=Math.min(o,f)}else for(let f=c[0];f<=c[1];++f){let y=Id(t[f],r,n);if(o=Math.min(o,y),o===0)return 0}}else{let f=Ds(c,e);Uu(a,o,n,t,s,f[0]),Uu(a,o,n,t,s,f[1])}}return o}l(fo,"pointsToPolygonDistance");function yo(t,e,r,n,i,o=1/0){let a=Math.min(o,i.distance(t[0],r[0]));if(a===0)return a;let s=new co([[0,[0,t.length-1],[0,r.length-1]]],cc);for(;s.length>0;){let u=s.pop();if(u[0]>=a)continue;let c=u[1],p=u[2],f=e?Ls:Ms,y=n?Ls:Ms;if(po(c)<=f&&po(p)<=y){if(!ct(c,t.length)&&ct(p,r.length))return NaN;let m;if(e&&n)m=Ad(t,c,r,p,i),a=Math.min(a,m);else if(e&&!n){let h=t.slice(c[0],c[1]+1);for(let d=p[0];d<=p[1];++d)if(m=Ht(r[d],h,i),a=Math.min(a,m),a===0)return a}else if(!e&&n){let h=r.slice(p[0],p[1]+1);for(let d=c[0];d<=c[1];++d)if(m=Ht(t[d],h,i),a=Math.min(a,m),a===0)return a}else m=_d(t,c,r,p,i),a=Math.min(a,m)}else{let m=Ds(c,e),h=Ds(p,n);to(s,a,i,t,r,m[0],h[0]),to(s,a,i,t,r,m[0],h[1]),to(s,a,i,t,r,m[1],h[0]),to(s,a,i,t,r,m[1],h[1])}}return a}l(yo,"pointSetToPointSetDistance");function kd(t,e){let r=t.geometry(),n=r.flat().map(a=>Ns([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new gn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,yo(n,!1,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,yo(n,!1,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,fo(n,!1,a.coordinates,i,o));break}if(o===0)return o}return o}l(kd,"pointToGeometryDistance");function Fd(t,e){let r=t.geometry(),n=r.flat().map(a=>Ns([a.x,a.y],t.canonical));if(r.length===0)return NaN;let i=new gn(n[0][1]),o=1/0;for(let a of e){switch(a.type){case"Point":o=Math.min(o,yo(n,!0,[a.coordinates],!1,i,o));break;case"LineString":o=Math.min(o,yo(n,!0,a.coordinates,!0,i,o));break;case"Polygon":o=Math.min(o,fo(n,!0,a.coordinates,i,o));break}if(o===0)return o}return o}l(Fd,"lineStringToGeometryDistance");function Ed(t,e){let r=t.geometry();if(r.length===0||r[0].length===0)return NaN;let n=er(r,0).map(a=>a.map(s=>s.map(u=>Ns([u.x,u.y],t.canonical)))),i=new gn(n[0][0][0][1]),o=1/0;for(let a of e)for(let s of n){switch(a.type){case"Point":o=Math.min(o,fo([a.coordinates],!1,s,i,o));break;case"LineString":o=Math.min(o,fo(a.coordinates,!0,s,i,o));break;case"Polygon":o=Math.min(o,Cd(s,a.coordinates,i,o));break}if(o===0)return o}return o}l(Ed,"polygonToGeometryDistance");function xs(t){return t.type==="MultiPolygon"?t.coordinates.map(e=>({type:"Polygon",coordinates:e})):t.type==="MultiLineString"?t.coordinates.map(e=>({type:"LineString",coordinates:e})):t.type==="MultiPoint"?t.coordinates.map(e=>({type:"Point",coordinates:e})):[t]}l(xs,"toSimpleGeometry");var bn=class t{static{l(this,"Distance")}constructor(e,r){this.type=M,this.geojson=e,this.geometries=r}static parse(e,r){if(e.length!==2)return r.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(yn(e[1])){let n=e[1];if(n.type==="FeatureCollection")return new t(n,n.features.map(i=>xs(i.geometry)).flat());if(n.type==="Feature")return new t(n,xs(n.geometry));if("type"in n&&"coordinates"in n)return new t(n,xs(n))}return r.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return kd(e,this.geometries);if(e.geometryType()==="LineString")return Fd(e,this.geometries);if(e.geometryType()==="Polygon")return Ed(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}},xn=class t{static{l(this,"GlobalState")}constructor(e){this.type=j,this.key=e}static parse(e,r){if(e.length!==2)return r.error(`Expected 1 argument, but found ${e.length-1} instead.`);let n=e[1];return n==null?r.error("Global state property must be defined."):typeof n!="string"?r.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new t(n)}evaluate(e){var r;let n=(r=e.globals)===null||r===void 0?void 0:r.globalState;return!n||Object.keys(n).length===0?null:sn(n,this.key)}eachChild(){}outputDefined(){return!1}},tr={"==":ed,"!=":td,">":nd,"<":rd,">=":od,"<=":id,array:We,at:ws,boolean:We,case:Ts,coalesce:lo,collator:uo,format:mn,image:Fs,in:As,"index-of":_s,interpolate:Me,"interpolate-hcl":Me,"interpolate-lab":Me,length:Es,let:ao,literal:Ct,match:Is,number:We,"number-format":ks,object:We,slice:Cs,step:Ar,string:We,"to-boolean":_t,"to-color":_t,"to-number":_t,"to-string":_t,var:so,within:dn,distance:bn,"global-state":xn},Ke=class t{static{l(this,"CompoundExpression")}constructor(e,r,n,i){this.name=e,this.type=r,this._evaluate=n,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,r){let n=e[0],i=t.definitions[n];if(!i)return r.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);let o=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter(([c])=>!Array.isArray(c)||c.length===e.length-1),u=null;for(let[c,p]of s){u=new oo(r.registry,mo,r.path,null,r.scope);let f=[],y=!1;for(let m=1;m<e.length;m++){let h=e[m],d=Array.isArray(c)?c[m-1]:c.type,x=u.parse(h,1+f.length,d);if(!x){y=!0;break}f.push(x)}if(!y){if(Array.isArray(c)&&c.length!==f.length){u.error(`Expected ${c.length} arguments, but found ${f.length} instead.`);continue}for(let m=0;m<f.length;m++){let h=Array.isArray(c)?c[m]:c.type,d=f[m];u.concat(m+1).checkSubtype(h,d.type)}if(u.errors.length===0)return new t(n,o,p,f)}}if(s.length===1)r.errors.push(...u.errors);else{let p=(s.length?s:a).map(([y])=>Ld(y)).join(" | "),f=[];for(let y=1;y<e.length;y++){let m=r.parse(e[y],1+f.length);if(!m)return null;f.push(se(m.type))}r.error(`Expected arguments of type ${p}, but found (${f.join(", ")}) instead.`)}return null}static register(e,r){t.definitions=r;for(let n in r)e[n]=t}};function $u(t,[e,r,n,i]){e=e.evaluate(t),r=r.evaluate(t),n=n.evaluate(t);let o=i?i.evaluate(t):1,a=nc(e,r,n,o);if(a)throw new ae(a);return new Y(e/255,r/255,n/255,o,!1)}l($u,"rgba");function ju(t,e){return t in e}l(ju,"has");function vs(t,e){let r=e[t];return typeof r>"u"?null:r}l(vs,"get");function Md(t,e,r,n){for(;r<=n;){let i=r+n>>1;if(e[i]===t)return!0;e[i]>t?n=i-1:r=i+1}return!1}l(Md,"binarySearch");function Xt(t){return{type:t}}l(Xt,"varargs");Ke.register(tr,{error:[Ah,[W],(t,[e])=>{throw new ae(e.evaluate(t))}],typeof:[W,[j],(t,[e])=>se(fe(e.evaluate(t)))],"to-rgba":[Ee(M,4),[Ne],(t,[e])=>{let[r,n,i,o]=e.evaluate(t).rgb;return[r*255,n*255,i*255,o]}],rgb:[Ne,[M,M,M],$u],rgba:[Ne,[M,M,M,M],$u],has:{type:q,overloads:[[[W],(t,[e])=>ju(e.evaluate(t),t.properties())],[[W,Zt],(t,[e,r])=>ju(e.evaluate(t),r.evaluate(t))]]},get:{type:j,overloads:[[[W],(t,[e])=>vs(e.evaluate(t),t.properties())],[[W,Zt],(t,[e,r])=>vs(e.evaluate(t),r.evaluate(t))]]},"feature-state":[j,[W],(t,[e])=>vs(e.evaluate(t),t.featureState||{})],properties:[Zt,[],t=>t.properties()],"geometry-type":[W,[],t=>t.geometryType()],id:[j,[],t=>t.id()],zoom:[M,[],t=>t.globals.zoom],"heatmap-density":[M,[],t=>t.globals.heatmapDensity||0],elevation:[M,[],t=>t.globals.elevation||0],"line-progress":[M,[],t=>t.globals.lineProgress||0],accumulated:[j,[],t=>t.globals.accumulated===void 0?null:t.globals.accumulated],"+":[M,Xt(M),(t,e)=>{let r=0;for(let n of e)r+=n.evaluate(t);return r}],"*":[M,Xt(M),(t,e)=>{let r=1;for(let n of e)r*=n.evaluate(t);return r}],"-":{type:M,overloads:[[[M,M],(t,[e,r])=>e.evaluate(t)-r.evaluate(t)],[[M],(t,[e])=>-e.evaluate(t)]]},"/":[M,[M,M],(t,[e,r])=>e.evaluate(t)/r.evaluate(t)],"%":[M,[M,M],(t,[e,r])=>e.evaluate(t)%r.evaluate(t)],ln2:[M,[],()=>Math.LN2],pi:[M,[],()=>Math.PI],e:[M,[],()=>Math.E],"^":[M,[M,M],(t,[e,r])=>Math.pow(e.evaluate(t),r.evaluate(t))],sqrt:[M,[M],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[M,[M],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[M,[M],(t,[e])=>Math.log(e.evaluate(t))],log2:[M,[M],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[M,[M],(t,[e])=>Math.sin(e.evaluate(t))],cos:[M,[M],(t,[e])=>Math.cos(e.evaluate(t))],tan:[M,[M],(t,[e])=>Math.tan(e.evaluate(t))],asin:[M,[M],(t,[e])=>Math.asin(e.evaluate(t))],acos:[M,[M],(t,[e])=>Math.acos(e.evaluate(t))],atan:[M,[M],(t,[e])=>Math.atan(e.evaluate(t))],min:[M,Xt(M),(t,e)=>Math.min(...e.map(r=>r.evaluate(t)))],max:[M,Xt(M),(t,e)=>Math.max(...e.map(r=>r.evaluate(t)))],abs:[M,[M],(t,[e])=>Math.abs(e.evaluate(t))],round:[M,[M],(t,[e])=>{let r=e.evaluate(t);return r<0?-Math.round(-r):Math.round(r)}],floor:[M,[M],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[M,[M],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[q,[W,j],(t,[e,r])=>t.properties()[e.value]===r.value],"filter-id-==":[q,[j],(t,[e])=>t.id()===e.value],"filter-type-==":[q,[W],(t,[e])=>t.geometryType()===e.value],"filter-<":[q,[W,j],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<i}],"filter-id-<":[q,[j],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<n}],"filter->":[q,[W,j],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>i}],"filter-id->":[q,[j],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>n}],"filter-<=":[q,[W,j],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n<=i}],"filter-id-<=":[q,[j],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r<=n}],"filter->=":[q,[W,j],(t,[e,r])=>{let n=t.properties()[e.value],i=r.value;return typeof n==typeof i&&n>=i}],"filter-id->=":[q,[j],(t,[e])=>{let r=t.id(),n=e.value;return typeof r==typeof n&&r>=n}],"filter-has":[q,[j],(t,[e])=>e.value in t.properties()],"filter-has-id":[q,[],t=>t.id()!==null&&t.id()!==void 0],"filter-type-in":[q,[Ee(W)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[q,[Ee(j)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[q,[W,Ee(j)],(t,[e,r])=>r.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[q,[W,Ee(j)],(t,[e,r])=>Md(t.properties()[e.value],r.value,0,r.value.length-1)],all:{type:q,overloads:[[[q,q],(t,[e,r])=>e.evaluate(t)&&r.evaluate(t)],[Xt(q),(t,e)=>{for(let r of e)if(!r.evaluate(t))return!1;return!0}]]},any:{type:q,overloads:[[[q,q],(t,[e,r])=>e.evaluate(t)||r.evaluate(t)],[Xt(q),(t,e)=>{for(let r of e)if(r.evaluate(t))return!0;return!1}]]},"!":[q,[q],(t,[e])=>!e.evaluate(t)],"is-supported-script":[q,[W],(t,[e])=>{let r=t.globals&&t.globals.isSupportedScript;return r?r(e.evaluate(t)):!0}],upcase:[W,[W],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[W,[W],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[W,Xt(j),(t,e)=>e.map(r=>ln(r.evaluate(t))).join("")],"resolved-locale":[W,[xo],(t,[e])=>e.evaluate(t).resolvedLocale()]});function Ld(t){return Array.isArray(t)?`(${t.map(se).join(", ")})`:`(${se(t.type)}...)`}l(Ld,"stringifySignature");function mo(t){if(t instanceof so)return mo(t.boundExpression);if(t instanceof Ke&&t.name==="error")return!1;if(t instanceof uo)return!1;if(t instanceof dn)return!1;if(t instanceof bn)return!1;if(t instanceof xn)return!1;let e=t instanceof _t||t instanceof We,r=!0;return t.eachChild(n=>{e?r=r&&mo(n):r=r&&n instanceof Ct}),r?_o(t)&&Io(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]):!1}l(mo,"isExpressionConstant");function _o(t){if(t instanceof Ke){if(t.name==="get"&&t.args.length===1)return!1;if(t.name==="feature-state")return!1;if(t.name==="has"&&t.args.length===1)return!1;if(t.name==="properties"||t.name==="geometry-type"||t.name==="id")return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof dn||t instanceof bn)return!1;let e=!0;return t.eachChild(r=>{e&&!_o(r)&&(e=!1)}),e}l(_o,"isFeatureConstant");function vn(t){if(t instanceof Ke&&t.name==="feature-state")return!1;let e=!0;return t.eachChild(r=>{e&&!vn(r)&&(e=!1)}),e}l(vn,"isStateConstant");function Io(t,e){if(t instanceof Ke&&e.indexOf(t.name)>=0)return!1;let r=!0;return t.eachChild(n=>{r&&!Io(n,e)&&(r=!1)}),r}l(Io,"isGlobalPropertyConstant");function Rs(t){return{result:"success",value:t}}l(Rs,"success");function vr(t){return{result:"error",value:t}}l(vr,"error");function kt(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}l(kt,"supportsPropertyExpression");function pc(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}l(pc,"supportsZoomExpression");function qs(t){return!!t.expression&&t.expression.interpolated}l(qs,"supportsInterpolation");function X(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}l(X,"getType");function To(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&fe(t)===Zt}l(To,"isFunction$1");function Dd(t){return t}l(Dd,"identityFunction");function Bd(t){switch(t.type){case"color":return Y.parse;case"padding":return Ue.parse;case"numberArray":return $e.parse;case"colorArray":return Ae.parse;default:return null}}l(Bd,"getParseFunction");function Vd(t){switch(t){case"exponential":return yc;case"interval":return zd;case"categorical":return Rd;case"identity":return Od;default:throw new Error(`Unknown function type "${t}"`)}}l(Vd,"getInnerFunction");function fc(t,e){let r=t.stops&&typeof t.stops[0][0]=="object",n=r||t.property!==void 0,i=r||!n,o=t.type||(qs(e)?"exponential":"interval"),a=Bd(e);if(a&&(t=Sr({},t),t.stops&&(t.stops=t.stops.map(p=>[p[0],a(p[1])])),t.default?t.default=a(t.default):t.default=a(e.default)),t.colorSpace&&!Bh(t.colorSpace))throw new Error(`Unknown color space: "${t.colorSpace}"`);let s=Vd(o),u,c;if(o==="categorical"){u=Object.create(null);for(let p of t.stops)u[p[0]]=p[1];c=typeof t.stops[0][0]}if(r){let p={},f=[];for(let h=0;h<t.stops.length;h++){let d=t.stops[h],x=d[0].zoom;p[x]===void 0&&(p[x]={zoom:x,type:t.type,property:t.property,default:t.default,stops:[]},f.push(x)),p[x].stops.push([d[0].value,d[1]])}let y=[];for(let h of f)y.push([p[h].zoom,fc(p[h],e)]);let m={name:"linear"};return{kind:"composite",interpolationType:m,interpolationFactor:Me.interpolationFactor.bind(void 0,m),zoomStops:y.map(h=>h[0]),evaluate({zoom:h},d){return yc({stops:y,base:t.base},e,h).evaluate(h,d)}}}else if(i){let p=o==="exponential"?{name:"exponential",base:t.base!==void 0?t.base:1}:null;return{kind:"camera",interpolationType:p,interpolationFactor:Me.interpolationFactor.bind(void 0,p),zoomStops:t.stops.map(f=>f[0]),evaluate:l(({zoom:f})=>s(t,e,f,u,c),"evaluate")}}else return{kind:"source",evaluate(p,f){let y=f&&f.properties?f.properties[t.property]:void 0;return y===void 0?_n(t.default,e.default):s(t,e,y,u,c)}}}l(fc,"createFunction");function _n(t,e,r){if(t!==void 0)return t;if(e!==void 0)return e;if(r!==void 0)return r}l(_n,"coalesce$1");function Rd(t,e,r,n,i){let o=typeof r===i?n[r]:void 0;return _n(o,t.default,e.default)}l(Rd,"evaluateCategoricalFunction");function zd(t,e,r){if(X(r)!=="number")return _n(t.default,e.default);let n=t.stops.length;if(n===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];let i=wo(t.stops.map(o=>o[0]),r);return t.stops[i][1]}l(zd,"evaluateIntervalFunction");function yc(t,e,r){let n=t.base!==void 0?t.base:1;if(X(r)!=="number")return _n(t.default,e.default);let i=t.stops.length;if(i===1||r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[i-1][0])return t.stops[i-1][1];let o=wo(t.stops.map(p=>p[0]),r),a=Gd(r,n,t.stops[o][0],t.stops[o+1][0]),s=t.stops[o][1],u=t.stops[o+1][1],c=pt[e.type]||Dd;return typeof s.evaluate=="function"?{evaluate(...p){let f=s.evaluate.apply(void 0,p),y=u.evaluate.apply(void 0,p);if(!(f===void 0||y===void 0))return c(f,y,a,t.colorSpace)}}:c(s,u,a,t.colorSpace)}l(yc,"evaluateExponentialFunction");function Od(t,e,r){switch(e.type){case"color":r=Y.parse(r);break;case"formatted":r=Le.fromString(r.toString());break;case"resolvedImage":r=_e.fromString(r.toString());break;case"padding":r=Ue.parse(r);break;case"colorArray":r=Ae.parse(r);break;case"numberArray":r=$e.parse(r);break;default:X(r)!==e.type&&(e.type!=="enum"||!e.values[r])&&(r=void 0)}return _n(r,t.default,e.default)}l(Od,"evaluateIdentityFunction");function Gd(t,e,r,n){let i=n-r,o=t-r;return i===0?0:e===1?o/i:(Math.pow(e,o)-1)/(Math.pow(e,i)-1)}l(Gd,"interpolationFactor");var Yt=class{static{l(this,"StyleExpression")}constructor(e,r){this.expression=e,this._warningHistory={},this._evaluator=new io,this._defaultValue=r?Ud(r):null,this._enumValues=r&&r.type==="enum"?r.values:null}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._evaluator.globals=e,this._evaluator.feature=r,this._evaluator.featureState=n,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,r,n,i,o,a){this._evaluator.globals=e,this._evaluator.feature=r||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||null;try{let s=this.expression.evaluate(this._evaluator);if(s==null||typeof s=="number"&&s!==s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ae(`Expected value to be one of ${Object.keys(this._enumValues).map(u=>JSON.stringify(u)).join(", ")}, but found ${JSON.stringify(s)} instead.`);return s}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,typeof console<"u"&&console.warn(s.message)),this._defaultValue}}};function In(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in tr}l(In,"isExpression");function rr(t,e){let r=new oo(tr,mo,[],e?Nd(e):void 0),n=r.parse(t,void 0,void 0,void 0,e&&e.type==="string"?{typeAnnotation:"coerce"}:void 0);return n?Rs(new Yt(n,e)):vr(r.errors)}l(rr,"createExpression");var Qe=class{static{l(this,"ZoomConstantExpression")}constructor(e,r){this.kind=e,this._styleExpression=r,this.isStateDependent=e!=="constant"&&!vn(r.expression),this.globalStateRefs=Co(r.expression)}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,o,a)}evaluate(e,r,n,i,o,a){return this._styleExpression.evaluate(e,r,n,i,o,a)}},Ft=class{static{l(this,"ZoomDependentExpression")}constructor(e,r,n,i){this.kind=e,this.zoomStops=n,this._styleExpression=r,this.isStateDependent=e!=="camera"&&!vn(r.expression),this.globalStateRefs=Co(r.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,r,n,i,o,a){return this._styleExpression.evaluateWithoutErrorHandling(e,r,n,i,o,a)}evaluate(e,r,n,i,o,a){return this._styleExpression.evaluate(e,r,n,i,o,a)}interpolationFactor(e,r,n){return this.interpolationType?Me.interpolationFactor(this.interpolationType,e,r,n):0}};function mc(t){return t._styleExpression!==void 0}l(mc,"isZoomExpression");function hc(t,e){let r=rr(t,e);if(r.result==="error")return r;let n=r.value.expression,i=_o(n);if(!i&&!kt(e))return vr([new Oe("","data expressions not supported")]);let o=Io(n,["zoom"]);if(!o&&!pc(e))return vr([new Oe("","zoom expressions not supported")]);let a=no(n);if(!a&&!o)return vr([new Oe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Oe)return vr([a]);if(a instanceof Me&&!qs(e))return vr([new Oe("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Rs(i?new Qe("constant",r.value):new Qe("source",r.value));let s=a instanceof Me?a.interpolation:void 0;return Rs(i?new Ft("camera",r.value,a.labels,s):new Ft("composite",r.value,a.labels,s))}l(hc,"createPropertyExpression");var Pn=class t{static{l(this,"StylePropertyFunction")}constructor(e,r){this._parameters=e,this._specification=r,Sr(this,fc(this._parameters,this._specification))}static deserialize(e){return new t(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};function dc(t,e){if(To(t))return new Pn(t,e);if(In(t)){let r=hc(t,e);if(r.result==="error")throw new Error(r.value.map(n=>`${n.key}: ${n.message}`).join(", "));return r.value}else{let r=t;return e.type==="color"&&typeof t=="string"?r=Y.parse(t):e.type==="padding"&&(typeof t=="number"||Array.isArray(t))?r=Ue.parse(t):e.type==="numberArray"&&(typeof t=="number"||Array.isArray(t))?r=$e.parse(t):e.type==="colorArray"&&(typeof t=="string"||Array.isArray(t))?r=Ae.parse(t):e.type==="variableAnchorOffsetCollection"&&Array.isArray(t)?r=De.parse(t):e.type==="projectionDefinition"&&typeof t=="string"&&(r=Tt.parse(t)),{globalStateRefs:new Set,kind:"constant",evaluate:l(()=>r,"evaluate")}}}l(dc,"normalizePropertyExpression");function no(t){let e=null;if(t instanceof ao)e=no(t.result);else if(t instanceof lo){for(let r of t.args)if(e=no(r),e)break}else(t instanceof Ar||t instanceof Me)&&t.input instanceof Ke&&t.input.name==="zoom"&&(e=t);return e instanceof Oe||t.eachChild(r=>{let n=no(r);n instanceof Oe?e=n:!e&&n?e=new Oe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new Oe("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}l(no,"findZoomCurve");function Co(t,e=new Set){return t instanceof xn&&e.add(t.key),t.eachChild(r=>{Co(r,e)}),e}l(Co,"findGlobalStateRefs");function Nd(t){let e={color:Ne,string:W,number:M,enum:W,boolean:q,formatted:Tr,padding:vo,numberArray:Po,colorArray:un,projectionDefinition:bo,resolvedImage:wn,variableAnchorOffsetCollection:So};return t.type==="array"?Ee(e[t.value]||j,t.length):e[t.type]}l(Nd,"getExpectedType");function Ud(t){if(t.type==="color"&&To(t.default))return new Y(0,0,0,0);switch(t.type){case"color":return Y.parse(t.default)||null;case"padding":return Ue.parse(t.default)||null;case"numberArray":return $e.parse(t.default)||null;case"colorArray":return Ae.parse(t.default)||null;case"variableAnchorOffsetCollection":return De.parse(t.default)||null;case"projectionDefinition":return Tt.parse(t.default)||null;default:return t.default===void 0?null:t.default}}l(Ud,"getDefaultValue");function Ws(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(let e of t.slice(1))if(!Ws(e)&&typeof e!="boolean")return!1;return!0;default:return!0}}l(Ws,"isExpressionFilter");var $d={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Et(t){if(t==null)return{filter:l(()=>!0,"filter"),needGeometry:!1,getGlobalStateRefs:l(()=>new Set,"getGlobalStateRefs")};Ws(t)||(t=ho(t));let e=rr(t,$d);if(e.result==="error")throw new Error(e.value.map(r=>`${r.key}: ${r.message}`).join(", "));{let r=gc(t);return{filter:l((n,i,o)=>e.value.evaluate(n,i,{},o),"filter"),needGeometry:r,getGlobalStateRefs:l(()=>Co(e.value.expression),"getGlobalStateRefs")}}}l(Et,"featureFilter");function jd(t,e){return t<e?-1:t>e?1:0}l(jd,"compare");function gc(t){if(!Array.isArray(t))return!1;if(t[0]==="within"||t[0]==="distance")return!0;for(let e=1;e<t.length;e++)if(gc(t[e]))return!0;return!1}l(gc,"geometryNeeded");function ho(t){if(!t)return!0;let e=t[0];return t.length<=1?e!=="any":e==="=="?Ps(t[1],t[2],"=="):e==="!="?ro(Ps(t[1],t[2],"==")):e==="<"||e===">"||e==="<="||e===">="?Ps(t[1],t[2],e):e==="any"?qd(t.slice(1)):e==="all"?["all"].concat(t.slice(1).map(ho)):e==="none"?["all"].concat(t.slice(1).map(ho).map(ro)):e==="in"?qu(t[1],t.slice(2)):e==="!in"?ro(qu(t[1],t.slice(2))):e==="has"?Wu(t[1]):e==="!has"?ro(Wu(t[1])):!0}l(ho,"convertFilter$1");function Ps(t,e,r){switch(t){case"$type":return[`filter-type-${r}`,e];case"$id":return[`filter-id-${r}`,e];default:return[`filter-${r}`,t,e]}}l(Ps,"convertComparisonOp$1");function qd(t){return["any"].concat(t.map(ho))}l(qd,"convertDisjunctionOp");function qu(t,e){if(e.length===0)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(r=>typeof r!=typeof e[0])?["filter-in-large",t,["literal",e.sort(jd)]]:["filter-in-small",t,["literal",e]]}}l(qu,"convertInOp$1");function Wu(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}l(Wu,"convertHasOp$1");function ro(t){return["!",t]}l(ro,"convertNegation");function zs(t){let e=typeof t;if(e==="number"||e==="boolean"||e==="string"||t===void 0||t===null)return JSON.stringify(t);if(Array.isArray(t)){let i="[";for(let o of t)i+=`${zs(o)},`;return`${i}]`}let r=Object.keys(t).sort(),n="{";for(let i=0;i<r.length;i++)n+=`${JSON.stringify(r[i])}:${zs(t[r[i]])},`;return`${n}}`}l(zs,"stringify$1");function Wd(t){let e="";for(let r of wh)e+=`/${zs(t[r])}`;return e}l(Wd,"getKey");function bc(t,e){let r={};for(let i=0;i<t.length;i++){let o=e&&e[t[i].id]||Wd(t[i]);e&&(e[t[i].id]=o);let a=r[o];a||(a=r[o]=[]),a.push(t[i])}let n=[];for(let i in r)n.push(r[i]);return n}l(bc,"groupByLayout");function xc(t){let e=t.key,r=t.value;return r?[new E(e,r,"constants have been deprecated as of v8")]:[]}l(xc,"validateConstants");function pe(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}l(pe,"unbundle");function Kt(t){if(Array.isArray(t))return t.map(Kt);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){let e={};for(let r in t)e[r]=Kt(t[r]);return e}return pe(t)}l(Kt,"deepUnbundle");function Ge(t){let e=t.key,r=t.value,n=t.valueSpec||{},i=t.objectElementValidators||{},o=t.style,a=t.styleSpec,s=t.validateSpec,u=[],c=X(r);if(c!=="object")return[new E(e,r,`object expected, ${c} found`)];for(let p in r){let f=p.split(".")[0],y=sn(n,f)||n["*"],m;if(sn(i,f))m=i[f];else if(sn(n,f))m=s;else if(i["*"])m=i["*"];else if(n["*"])m=s;else{u.push(new E(e,r[p],`unknown property "${p}"`));continue}u=u.concat(m({key:(e&&`${e}.`)+p,value:r[p],valueSpec:y,style:o,styleSpec:a,object:r,objectKey:p,validateSpec:s},r))}for(let p in n)i[p]||n[p].required&&n[p].default===void 0&&r[p]===void 0&&u.push(new E(e,r,`missing required property "${p}"`));return u}l(Ge,"validateObject");function Xs(t){let e=t.value,r=t.valueSpec,n=t.validateSpec,i=t.style,o=t.styleSpec,a=t.key,s=t.arrayElementValidator||n;if(X(e)!=="array")return[new E(a,e,`array expected, ${X(e)} found`)];if(r.length&&e.length!==r.length)return[new E(a,e,`array length ${r.length} expected, length ${e.length} found`)];if(r["min-length"]&&e.length<r["min-length"])return[new E(a,e,`array length at least ${r["min-length"]} expected, length ${e.length} found`)];let u={type:r.value,values:r.values};o.$version<7&&(u.function=r.function),X(r.value)==="object"&&(u=r.value);let c=[];for(let p=0;p<e.length;p++)c=c.concat(s({array:e,arrayIndex:p,value:e[p],valueSpec:u,validateSpec:t.validateSpec,style:i,styleSpec:o,key:`${a}[${p}]`}));return c}l(Xs,"validateArray");function ko(t){let e=t.key,r=t.value,n=t.valueSpec,i=X(r);return i==="number"&&r!==r&&(i="NaN"),i!=="number"?[new E(e,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new E(e,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new E(e,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}l(ko,"validateNumber");function vc(t){let e=t.valueSpec,r=pe(t.value.type),n,i={},o,a,s=r!=="categorical"&&t.value.property===void 0,u=!s,c=X(t.value.stops)==="array"&&X(t.value.stops[0])==="array"&&X(t.value.stops[0][0])==="object",p=Ge({key:t.key,value:t.value,valueSpec:t.styleSpec.function,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:f,default:h}});return r==="identity"&&s&&p.push(new E(t.key,t.value,'missing required property "property"')),r!=="identity"&&!t.value.stops&&p.push(new E(t.key,t.value,'missing required property "stops"')),r==="exponential"&&t.valueSpec.expression&&!qs(t.valueSpec)&&p.push(new E(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(u&&!kt(t.valueSpec)?p.push(new E(t.key,t.value,"property functions not supported")):s&&!pc(t.valueSpec)&&p.push(new E(t.key,t.value,"zoom functions not supported"))),(r==="categorical"||c)&&t.value.property===void 0&&p.push(new E(t.key,t.value,'"property" property is required')),p;function f(d){if(r==="identity")return[new E(d.key,d.value,'identity function may not have a "stops" property')];let x=[],b=d.value;return x=x.concat(Xs({key:d.key,value:b,valueSpec:d.valueSpec,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec,arrayElementValidator:y})),X(b)==="array"&&b.length===0&&x.push(new E(d.key,b,"array must have at least one stop")),x}l(f,"validateFunctionStops");function y(d){let x=[],b=d.value,P=d.key;if(X(b)!=="array")return[new E(P,b,`array expected, ${X(b)} found`)];if(b.length!==2)return[new E(P,b,`array length 2 expected, length ${b.length} found`)];if(c){if(X(b[0])!=="object")return[new E(P,b,`object expected, ${X(b[0])} found`)];if(b[0].zoom===void 0)return[new E(P,b,"object stop key must have zoom")];if(b[0].value===void 0)return[new E(P,b,"object stop key must have value")];if(a&&a>pe(b[0].zoom))return[new E(P,b[0].zoom,"stop zoom values must appear in ascending order")];pe(b[0].zoom)!==a&&(a=pe(b[0].zoom),o=void 0,i={}),x=x.concat(Ge({key:`${P}[0]`,value:b[0],valueSpec:{zoom:{}},validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec,objectElementValidators:{zoom:ko,value:m}}))}else x=x.concat(m({key:`${P}[0]`,value:b[0],validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec},b));return In(Kt(b[1]))?x.concat([new E(`${P}[1]`,b[1],"expressions are not allowed in function stops.")]):x.concat(d.validateSpec({key:`${P}[1]`,value:b[1],valueSpec:e,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec}))}l(y,"validateFunctionStop");function m(d,x){let b=X(d.value),P=pe(d.value),v=d.value!==null?d.value:x;if(!n)n=b;else if(b!==n)return[new E(d.key,v,`${b} stop domain type must match previous stop domain type ${n}`)];if(b!=="number"&&b!=="string"&&b!=="boolean")return[new E(d.key,v,"stop domain value must be a number, string, or boolean")];if(b!=="number"&&r!=="categorical"){let S=`number expected, ${b} found`;return kt(e)&&r===void 0&&(S+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new E(d.key,v,S)]}return r==="categorical"&&b==="number"&&(!isFinite(P)||Math.floor(P)!==P)?[new E(d.key,v,`integer expected, found ${P}`)]:r!=="categorical"&&b==="number"&&o!==void 0&&P<o?[new E(d.key,v,"stop domain values must appear in ascending order")]:(o=P,r==="categorical"&&P in i?[new E(d.key,v,"stop domain values must be unique")]:(i[P]=!0,[]))}l(m,"validateStopDomainValue");function h(d){return d.validateSpec({key:d.key,value:d.value,valueSpec:e,validateSpec:d.validateSpec,style:d.style,styleSpec:d.styleSpec})}l(h,"validateFunctionDefault")}l(vc,"validateFunction");function _r(t){let e=(t.expressionContext==="property"?hc:rr)(Kt(t.value),t.valueSpec);if(e.result==="error")return e.value.map(n=>new E(`${t.key}${n.key}`,t.value,n.message));let r=e.value.expression||e.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!r.outputDefined())return[new E(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!vn(r))return[new E(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!vn(r))return[new E(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!Io(r,["zoom","feature-state"]))return[new E(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!_o(r))return[new E(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}l(_r,"validateExpression");function Xd(t){let e=t.value,r=t.key,n=X(e);return n!=="boolean"?[new E(r,e,`boolean expected, ${n} found`)]:[]}l(Xd,"validateBoolean");function Os(t){let e=t.key,r=t.value,n=X(r);return n!=="string"?[new E(e,r,`color expected, ${n} found`)]:Y.parse(String(r))?[]:[new E(e,r,`color expected, "${r}" found`)]}l(Os,"validateColor");function Sn(t){let e=t.key,r=t.value,n=t.valueSpec,i=[];return Array.isArray(n.values)?n.values.indexOf(pe(r))===-1&&i.push(new E(e,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):Object.keys(n.values).indexOf(pe(r))===-1&&i.push(new E(e,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}l(Sn,"validateEnum");function Hs(t){return Ws(Kt(t.value))?_r(Sr({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Pc(t)}l(Hs,"validateFilter");function Pc(t){let e=t.value,r=t.key;if(X(e)!=="array")return[new E(r,e,`array expected, ${X(e)} found`)];let n=t.styleSpec,i,o=[];if(e.length<1)return[new E(r,e,"filter array must have at least 1 element")];switch(o=o.concat(Sn({key:`${r}[0]`,value:e[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),pe(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&pe(e[1])==="$type"&&o.push(new E(r,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":e.length!==3&&o.push(new E(r,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(i=X(e[1]),i!=="string"&&o.push(new E(`${r}[1]`,e[1],`string expected, ${i} found`)));for(let a=2;a<e.length;a++)i=X(e[a]),pe(e[1])==="$type"?o=o.concat(Sn({key:`${r}[${a}]`,value:e[a],valueSpec:n.geometry_type,style:t.style,styleSpec:t.styleSpec})):i!=="string"&&i!=="number"&&i!=="boolean"&&o.push(new E(`${r}[${a}]`,e[a],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let a=1;a<e.length;a++)o=o.concat(Pc({key:`${r}[${a}]`,value:e[a],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":i=X(e[1]),e.length!==2?o.push(new E(r,e,`filter array for "${e[0]}" operator must have 2 elements`)):i!=="string"&&o.push(new E(`${r}[1]`,e[1],`string expected, ${i} found`));break}return o}l(Pc,"validateNonExpressionFilter");function Sc(t,e){let r=t.key,n=t.validateSpec,i=t.style,o=t.styleSpec,a=t.value,s=t.objectKey,u=o[`${e}_${t.layerType}`];if(!u)return[];let c=s.match(/^(.*)-transition$/);if(e==="paint"&&c&&u[c[1]]&&u[c[1]].transition)return n({key:r,value:a,valueSpec:o.transition,style:i,styleSpec:o});let p=t.valueSpec||u[s];if(!p)return[new E(r,a,`unknown property "${s}"`)];let f;if(X(a)==="string"&&kt(p)&&!p.tokens&&(f=/^{([^}]+)}$/.exec(a)))return[new E(r,a,`"${s}" does not support interpolation syntax
2
+ Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(f[1])} }\`.`)];let y=[];return t.layerType==="symbol"&&(s==="text-field"&&i&&!i.glyphs&&y.push(new E(r,a,'use of "text-field" requires a style "glyphs" property')),s==="text-font"&&To(Kt(a))&&pe(a.type)==="identity"&&y.push(new E(r,a,'"text-font" does not support identity functions'))),y.concat(n({key:t.key,value:a,valueSpec:p,style:i,styleSpec:o,expressionContext:"property",propertyType:e,propertyKey:s}))}l(Sc,"validateProperty");function wc(t){return Sc(t,"paint")}l(wc,"validatePaintProperty");function Ac(t){return Sc(t,"layout")}l(Ac,"validateLayoutProperty");function _c(t){let e=[],r=t.value,n=t.key,i=t.style,o=t.styleSpec;if(X(r)!=="object")return[new E(n,r,`object expected, ${X(r)} found`)];!r.type&&!r.ref&&e.push(new E(n,r,'either "type" or "ref" is required'));let a=pe(r.type),s=pe(r.ref);if(r.id){let u=pe(r.id);for(let c=0;c<t.arrayIndex;c++){let p=i.layers[c];pe(p.id)===u&&e.push(new E(n,r.id,`duplicate layer id "${r.id}", previously used at line ${p.id.__line__}`))}}if("ref"in r){["type","source","source-layer","filter","layout"].forEach(c=>{c in r&&e.push(new E(n,r[c],`"${c}" is prohibited for ref layers`))});let u;i.layers.forEach(c=>{pe(c.id)===s&&(u=c)}),u?u.ref?e.push(new E(n,r.ref,"ref cannot reference another ref layer")):a=pe(u.type):e.push(new E(n,r.ref,`ref layer "${s}" not found`))}else if(a!=="background")if(!r.source)e.push(new E(n,r,'missing required property "source"'));else{let u=i.sources&&i.sources[r.source],c=u&&pe(u.type);u?c==="vector"&&a==="raster"?e.push(new E(n,r.source,`layer "${r.id}" requires a raster source`)):c!=="raster-dem"&&a==="hillshade"?e.push(new E(n,r.source,`layer "${r.id}" requires a raster-dem source`)):c!=="raster-dem"&&a==="color-relief"?e.push(new E(n,r.source,`layer "${r.id}" requires a raster-dem source`)):c==="raster"&&a!=="raster"?e.push(new E(n,r.source,`layer "${r.id}" requires a vector source`)):c==="vector"&&!r["source-layer"]?e.push(new E(n,r,`layer "${r.id}" must specify a "source-layer"`)):c==="raster-dem"&&a!=="hillshade"&&a!=="color-relief"?e.push(new E(n,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):a==="line"&&r.paint&&r.paint["line-gradient"]&&(c!=="geojson"||!u.lineMetrics)&&e.push(new E(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new E(n,r.source,`source "${r.source}" not found`))}return e=e.concat(Ge({key:n,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*"(){return[]},type(){return t.validateSpec({key:`${n}.type`,value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:r,objectKey:"type"})},filter:Hs,layout(u){return Ge({layer:r,key:u.key,value:u.value,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,objectElementValidators:{"*"(c){return Ac(Sr({layerType:a},c))}}})},paint(u){return Ge({layer:r,key:u.key,value:u.value,style:u.style,styleSpec:u.styleSpec,validateSpec:u.validateSpec,objectElementValidators:{"*"(c){return wc(Sr({layerType:a},c))}}})}}})),e}l(_c,"validateLayer");function Qt(t){let e=t.value,r=t.key,n=X(e);return n!=="string"?[new E(r,e,`string expected, ${n} found`)]:[]}l(Qt,"validateString");function Hd(t){var e;let r=(e=t.sourceName)!==null&&e!==void 0?e:"",n=t.value,i=t.styleSpec,o=i.source_raster_dem,a=t.style,s=[],u=X(n);if(n===void 0)return s;if(u!=="object")return s.push(new E("source_raster_dem",n,`object expected, ${u} found`)),s;let p=pe(n.encoding)==="custom",f=["redFactor","greenFactor","blueFactor","baseShift"],y=t.value.encoding?`"${t.value.encoding}"`:"Default";for(let m in n)!p&&f.includes(m)?s.push(new E(m,n[m],`In "${r}": "${m}" is only valid when "encoding" is set to "custom". ${y} encoding found`)):o[m]?s=s.concat(t.validateSpec({key:m,value:n[m],valueSpec:o[m],validateSpec:t.validateSpec,style:a,styleSpec:i})):s.push(new E(m,n[m],`unknown property "${m}"`));return s}l(Hd,"validateRasterDEMSource");var Xu={promoteId:Zd};function Ic(t){let e=t.value,r=t.key,n=t.styleSpec,i=t.style,o=t.validateSpec;if(!e.type)return[new E(r,e,'"type" is required')];let a=pe(e.type),s;switch(a){case"vector":case"raster":return s=Ge({key:r,value:e,valueSpec:n[`source_${a.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:Xu,validateSpec:o}),s;case"raster-dem":return s=Hd({sourceName:r,value:e,style:t.style,styleSpec:n,validateSpec:o}),s;case"geojson":if(s=Ge({key:r,value:e,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:o,objectElementValidators:Xu}),e.cluster)for(let u in e.clusterProperties){let[c,p]=e.clusterProperties[u],f=typeof c=="string"?[c,["accumulated"],["get",u]]:c;s.push(..._r({key:`${r}.${u}.map`,value:p,expressionContext:"cluster-map"})),s.push(..._r({key:`${r}.${u}.reduce`,value:f,expressionContext:"cluster-reduce"}))}return s;case"video":return Ge({key:r,value:e,valueSpec:n.source_video,style:i,validateSpec:o,styleSpec:n});case"image":return Ge({key:r,value:e,valueSpec:n.source_image,style:i,validateSpec:o,styleSpec:n});case"canvas":return[new E(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Sn({key:`${r}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}l(Ic,"validateSource");function Zd({key:t,value:e}){if(X(e)==="string")return Qt({key:t,value:e});{let r=[];for(let n in e)r.push(...Qt({key:`${t}.${n}`,value:e[n]}));return r}}l(Zd,"validatePromoteId");function Tc(t){let e=t.value,r=t.styleSpec,n=r.light,i=t.style,o=[],a=X(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new E("light",e,`object expected, ${a} found`)]),o;for(let s in e){let u=s.match(/^(.*)-transition$/);u&&n[u[1]]&&n[u[1]].transition?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:r.transition,validateSpec:t.validateSpec,style:i,styleSpec:r})):n[s]?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r})):o=o.concat([new E(s,e[s],`unknown property "${s}"`)])}return o}l(Tc,"validateLight");function Cc(t){let e=t.value,r=t.styleSpec,n=r.sky,i=t.style,o=X(e);if(e===void 0)return[];if(o!=="object")return[new E("sky",e,`object expected, ${o} found`)];let a=[];for(let s in e)n[s]?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a=a.concat([new E(s,e[s],`unknown property "${s}"`)]);return a}l(Cc,"validateSky");function kc(t){let e=t.value,r=t.styleSpec,n=r.terrain,i=t.style,o=[],a=X(e);if(e===void 0)return o;if(a!=="object")return o=o.concat([new E("terrain",e,`object expected, ${a} found`)]),o;for(let s in e)n[s]?o=o.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],validateSpec:t.validateSpec,style:i,styleSpec:r})):o=o.concat([new E(s,e[s],`unknown property "${s}"`)]);return o}l(kc,"validateTerrain");function Jd(t){return Qt(t).length===0?[]:_r(t)}l(Jd,"validateFormatted");function Yd(t){return Qt(t).length===0?[]:_r(t)}l(Yd,"validateImage");function Kd(t){let e=t.key,r=t.value;if(X(r)==="array"){if(r.length<1||r.length>4)return[new E(e,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},o=[];for(let a=0;a<r.length;a++)o=o.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return o}else return ko({key:e,value:r,valueSpec:{}})}l(Kd,"validatePadding");function Qd(t){let e=t.key,r=t.value;if(X(r)==="array"){let i={type:"number"};if(r.length<1)return[new E(e,r,"array length at least 1 expected, length 0 found")];let o=[];for(let a=0;a<r.length;a++)o=o.concat(t.validateSpec({key:`${e}[${a}]`,value:r[a],validateSpec:t.validateSpec,valueSpec:i}));return o}else return ko({key:e,value:r,valueSpec:{}})}l(Qd,"validateNumberArray");function eg(t){let e=t.key,r=t.value;if(X(r)==="array"){if(r.length<1)return[new E(e,r,"array length at least 1 expected, length 0 found")];let i=[];for(let o=0;o<r.length;o++)i=i.concat(Os({key:`${e}[${o}]`,value:r[o]}));return i}else return Os({key:e,value:r})}l(eg,"validateColorArray");function tg(t){let e=t.key,r=t.value,n=X(r),i=t.styleSpec;if(n!=="array"||r.length<1||r.length%2!==0)return[new E(e,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let o=[];for(let a=0;a<r.length;a+=2)o=o.concat(Sn({key:`${e}[${a}]`,value:r[a],valueSpec:i.layout_symbol["text-anchor"]})),o=o.concat(Xs({key:`${e}[${a+1}]`,value:r[a+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:i}));return o}l(tg,"validateVariableAnchorOffsetCollection");function Fc(t){let e=[],r=t.value,n=t.key;if(Array.isArray(r)){let i=[],o=[];for(let a in r){r[a].id&&i.includes(r[a].id)&&e.push(new E(n,r,`all the sprites' ids must be unique, but ${r[a].id} is duplicated`)),i.push(r[a].id),r[a].url&&o.includes(r[a].url)&&e.push(new E(n,r,`all the sprites' URLs must be unique, but ${r[a].url} is duplicated`)),o.push(r[a].url);let s={id:{type:"string",required:!0},url:{type:"string",required:!0}};e=e.concat(Ge({key:`${n}[${a}]`,value:r[a],valueSpec:s,validateSpec:t.validateSpec}))}return e}else return Qt({key:n,value:r})}l(Fc,"validateSprite");function rg(t){let e=t.value,r=t.styleSpec,n=r.projection,i=t.style,o=X(e);if(e===void 0)return[];if(o!=="object")return[new E("projection",e,`object expected, ${o} found`)];let a=[];for(let s in e)n[s]?a=a.concat(t.validateSpec({key:s,value:e[s],valueSpec:n[s],style:i,styleSpec:r})):a=a.concat([new E(s,e[s],`unknown property "${s}"`)]);return a}l(rg,"validateProjection");function ng(t){let e=t.key,r=t.value;r=r instanceof String?r.valueOf():r;let n=X(r);return n==="array"&&!og(r)&&!ig(r)?[new E(e,r,`projection expected, invalid array ${JSON.stringify(r)} found`)]:["array","string"].includes(n)?[]:[new E(e,r,`projection expected, invalid type "${n}" found`)]}l(ng,"validateProjectionDefinition");function ig(t){return!!["interpolate","step","literal"].includes(t[0])}l(ig,"isPropertyValueSpecification");function og(t){return Array.isArray(t)&&t.length===3&&typeof t[0]=="string"&&typeof t[1]=="string"&&typeof t[2]=="number"}l(og,"isProjectionDefinitionValue");function ag(t){return!!t&&t.constructor===Object}l(ag,"isObjectLiteral");function Ec(t){return ag(t.value)?[]:[new E(t.key,t.value,`object expected, ${X(t.value)} found`)]}l(Ec,"validateState");var Hu={"*"(){return[]},array:Xs,boolean:Xd,number:ko,color:Os,constants:xc,enum:Sn,filter:Hs,function:vc,layer:_c,object:Ge,source:Ic,light:Tc,sky:Cc,terrain:kc,projection:rg,projectionDefinition:ng,string:Qt,formatted:Jd,resolvedImage:Yd,padding:Kd,numberArray:Qd,colorArray:eg,variableAnchorOffsetCollection:tg,sprite:Fc,state:Ec};function go(t){let e=t.value,r=t.valueSpec,n=t.styleSpec;return t.validateSpec=go,r.expression&&To(pe(e))?vc(t):r.expression&&In(Kt(e))?_r(t):r.type&&Hu[r.type]?Hu[r.type](t):Ge(Sr({},t,{valueSpec:r.type?n[r.type]:r}))}l(go,"validate");function Mc(t){let e=t.value,r=t.key,n=Qt(t);return n.length||(e.indexOf("{fontstack}")===-1&&n.push(new E(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&n.push(new E(r,e,'"glyphs" url must include a "{range}" token'))),n}l(Mc,"validateGlyphsUrl");function Be(t,e=A){let r=[];return r=r.concat(go({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:go,objectElementValidators:{glyphs:Mc,"*"(){return[]}}})),t.constants&&(r=r.concat(xc({key:"constants",value:t.constants}))),Lc(r)}l(Be,"validateStyleMin");Be.source=He(Xe(Ic));Be.sprite=He(Xe(Fc));Be.glyphs=He(Xe(Mc));Be.light=He(Xe(Tc));Be.sky=He(Xe(Cc));Be.terrain=He(Xe(kc));Be.state=He(Xe(Ec));Be.layer=He(Xe(_c));Be.filter=He(Xe(Hs));Be.paintProperty=He(Xe(wc));Be.layoutProperty=He(Xe(Ac));function Xe(t){return function(e){return t({...e,validateSpec:go})}}l(Xe,"injectValidateSpec");function Lc(t){return[].concat(t).sort((e,r)=>e.line-r.line)}l(Lc,"sortErrors");function He(t){return function(...e){return Lc(t.apply(this,e))}}l(He,"wrapCleanErrors");g();g();var Dc="AbortError";function Bc(t){return t.message===Dc}l(Bc,"isAbortError");function Zs(){return new Error(Dc)}l(Zs,"createAbortError");g();g();var Fo={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Vc(t){return Fo.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}l(Vc,"getProtocol");function Rc(t,e){Fo.REGISTERED_PROTOCOLS[t]=e}l(Rc,"addProtocol");function zc(t){delete Fo.REGISTERED_PROTOCOLS[t]}l(zc,"removeProtocol");g();var Oc="global-dispatcher",nr=class extends Error{static{l(this,"AJAXError")}constructor(e,r,n,i){super(`AJAXError: ${r} (${e}): ${n}`),this.status=e,this.statusText=r,this.url=n,this.body=i}},Nc=l(()=>ut(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,"getReferrer"),sg=l(t=>/^file:/.test(t)||/^file:/.test(Nc())&&!/^\w+:/.test(t),"isFileURL");async function lg(t,e){let r=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:Nc(),signal:e.signal});t.type==="json"&&!r.headers.has("Accept")&&r.headers.set("Accept","application/json");let n;try{n=await fetch(r)}catch(a){throw new nr(0,a.message,t.url,new Blob)}if(!n.ok){let a=await n.blob();throw new nr(n.status,n.statusText,t.url,a)}let i;t.type==="arrayBuffer"||t.type==="image"?i=n.arrayBuffer():t.type==="json"?i=n.json():i=n.text();let o=await i;if(e.signal.aborted)throw Zs();return{data:o,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}l(lg,"makeFetchRequest");function ug(t,e){return new Promise((r,n)=>{let i=new XMLHttpRequest;i.open(t.method||"GET",t.url,!0),(t.type==="arrayBuffer"||t.type==="image")&&(i.responseType="arraybuffer");for(let o in t.headers)i.setRequestHeader(o,t.headers[o]);t.type==="json"&&(i.responseType="text",t.headers?.Accept||i.setRequestHeader("Accept","application/json")),i.withCredentials=t.credentials==="include",i.onerror=()=>{n(new Error(i.statusText))},i.onload=()=>{if(!e.signal.aborted)if((i.status>=200&&i.status<300||i.status===0)&&i.response!==null){let o=i.response;if(t.type==="json")try{o=JSON.parse(i.response)}catch(a){n(a);return}r({data:o,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")})}else{let o=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});n(new nr(i.status,i.statusText,t.url,o))}},e.signal.addEventListener("abort",()=>{i.abort(),n(Zs())}),i.send(t.body)})}l(ug,"makeXMLHttpRequest");var Uc=l(function(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){let r=Vc(t.url);if(r)return r(t,e);if(ut(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:Oc},e)}if(!sg(t.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return lg(t,e);if(ut(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:Oc},e)}return ug(t,e)},"makeRequest"),$c=l((t,e)=>Uc(xe(t,{type:"json"}),e),"getJSON"),jc=l((t,e)=>Uc(xe(t,{type:"arrayBuffer"}),e),"getArrayBuffer");var ft={};function k(t,e,r={}){if(ft[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),ft[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}l(k,"register");k("Object",Object);k("Set",Set);k("TransferableGridIndex",Wt);k("Color",Y);k("Error",Error);k("AJAXError",nr);k("ResolvedImage",_e);k("StylePropertyFunction",Pn);k("StyleExpression",Yt,{omit:["_evaluator"]});k("ZoomDependentExpression",Ft);k("ZoomConstantExpression",Qe);k("CompoundExpression",Ke,{omit:["_evaluate"]});for(let t in tr)tr[t]._classRegistryKey||k(`Expression_${t}`,tr[t]);function qc(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}l(qc,"isArrayBuffer");function Js(t){let e=t.constructor;return t.$name||e._classRegistryKey}l(Js,"getClassRegistryKey");function cg(t){if(t===null||typeof t!="object")return!1;let e=Js(t);return!!(e&&e!=="Object")}l(cg,"isRegistered");function Wc(t){return!cg(t)&&(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||qc(t)||wt(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}l(Wc,"isSerializeHandledByBuiltin");function Fr(t,e){if(Wc(t)){if((qc(t)||wt(t))&&e&&e.push(t),ArrayBuffer.isView(t)){let o=t;e&&e.push(o.buffer)}return t instanceof ImageData&&e&&e.push(t.data.buffer),t}if(Array.isArray(t)){let o=[];for(let a of t)o.push(Fr(a,e));return o}if(typeof t!="object")throw new Error(`can't serialize object of type ${typeof t}`);let r=Js(t);if(!r)throw new Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!ft[r])throw new Error(`${r} is not registered.`);let{klass:n}=ft[r],i=n.serialize?n.serialize(t,e):{};if(n.serialize){if(e&&i===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let o in t){if(!t.hasOwnProperty(o)||ft[r].omit.indexOf(o)>=0)continue;let a=t[o];i[o]=ft[r].shallow.indexOf(o)>=0?a:Fr(a,e)}t instanceof Error&&(i.message=t.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return r!=="Object"&&(i.$name=r),i}l(Fr,"serialize");function Er(t){if(Wc(t))return t;if(Array.isArray(t))return t.map(Er);if(typeof t!="object")throw new Error(`can't deserialize object of type ${typeof t}`);let e=Js(t)||"Object";if(!ft[e])throw new Error(`can't deserialize unregistered class ${e}`);let{klass:r}=ft[e];if(!r)throw new Error(`can't deserialize unregistered class ${e}`);if(r.deserialize)return r.deserialize(t);let n=Object.create(r.prototype);for(let i of Object.keys(t)){if(i==="$name")continue;let o=t[i];n[i]=ft[e].shallow.indexOf(i)>=0?o:Er(o)}return n}l(Er,"deserialize");g();var Eo=class{static{l(this,"ThrottledInvoker")}constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}};var pg={once:!0},Mo=class{static{l(this,"Actor")}constructor(e,r){this.target=e,this.mapId=r,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Eo(()=>this.process()),this.subscription=ps(this.target,"message",n=>this.receive(n),!1),this.globalScope=ut(self)?e:window}registerMessageHandler(e,r){this.messageHandlers[e]=r}sendAsync(e,r){return new Promise((n,i)=>{let o=Math.round(Math.random()*1e18).toString(36).substring(0,10),a=r?ps(r.signal,"abort",()=>{a?.unsubscribe(),delete this.resolveRejects[o];let c={id:o,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(c)},pg):null;this.resolveRejects[o]={resolve:l(c=>{a?.unsubscribe(),n(c)},"resolve"),reject:l(c=>{a?.unsubscribe(),i(c)},"reject")};let s=[],u={...e,id:o,sourceMapId:this.mapId,origin:location.origin,data:Fr(e.data,s)};this.target.postMessage(u,{transfer:s})})}receive(e){let r=e.data,n=r.id;if(!(r.origin!=="file://"&&location.origin!=="file://"&&r.origin!=="resource://android"&&location.origin!=="resource://android"&&r.origin!==location.origin)&&!(r.targetMapId&&this.mapId!==r.targetMapId)){if(r.type==="<cancel>"){delete this.tasks[n];let i=this.abortControllers[n];delete this.abortControllers[n],i&&i.abort();return}if(ut(self)||r.mustQueue){this.tasks[n]=r,this.taskQueue.push(n),this.invoker.trigger();return}this.processTask(n,r)}}process(){if(this.taskQueue.length===0)return;let e=this.taskQueue.shift(),r=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),r&&this.processTask(e,r)}async processTask(e,r){if(r.type==="<response>"){let o=this.resolveRejects[e];if(delete this.resolveRejects[e],!o)return;r.error?o.reject(Er(r.error)):o.resolve(Er(r.data));return}if(!this.messageHandlers[r.type]){this.completeTask(e,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));return}let n=Er(r.data),i=new AbortController;this.abortControllers[e]=i;try{let o=await this.messageHandlers[r.type](r.sourceMapId,n,i);this.completeTask(e,null,o)}catch(o){this.completeTask(e,o)}}completeTask(e,r,n){let i=[];delete this.abortControllers[e];let o={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:r?Fr(r):null,data:Fr(n,i)};this.target.postMessage(o,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}};g();g();g();g();g();g();function Xc(t,e,r){r[t]&&r[t].indexOf(e)!==-1||(r[t]=r[t]||[],r[t].push(e))}l(Xc,"_addEventListener");function Ys(t,e,r){if(r&&r[t]){let n=r[t].indexOf(e);n!==-1&&r[t].splice(n,1)}}l(Ys,"_removeEventListener");var Lo=class{static{l(this,"Event")}constructor(e,r={}){xe(this,r),this.type=e}},Tn=class extends Lo{static{l(this,"ErrorEvent")}constructor(e,r={}){super("error",xe({error:e},r))}},Do=class{static{l(this,"Evented")}on(e,r){return this._listeners=this._listeners||{},Xc(e,r,this._listeners),{unsubscribe:l(()=>{this.off(e,r)},"unsubscribe")}}off(e,r){return Ys(e,r,this._listeners),Ys(e,r,this._oneTimeListeners),this}once(e,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},Xc(e,r,this._oneTimeListeners),this):new Promise(n=>this.once(e,n))}fire(e,r){typeof e=="string"&&(e=new Lo(e,r||{}));let n=e.type;if(this.listens(n)){e.target=this;let i=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(let s of i)s.call(this,e);let o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(let s of o)Ys(n,s,this._oneTimeListeners),s.call(this,e);let a=this._eventedParent;a&&(xe(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),a.fire(e))}else e instanceof Tn&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,r){return this._eventedParent=e,this._eventedParentData=r,this}};var yt=Be,Nv=yt.source,Uv=yt.light,$v=yt.sky,jv=yt.terrain,qv=yt.filter,Hc=yt.paintProperty,Zc=yt.layoutProperty;function Jc(t,e){let r=!1;if(e&&e.length)for(let n of e)t.fire(new Tn(new Error(n.message))),r=!0;return r}l(Jc,"emitValidationErrors");g();g();g();var Cn=class{static{l(this,"ZoomHistory")}constructor(){this.first=!0}update(e,r){let n=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=n,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=n,!0):(this.lastFloorZoom>n?(this.lastIntegerZoom=n+1,this.lastIntegerZoomTime=r):this.lastFloorZoom<n&&(this.lastIntegerZoom=n,this.lastIntegerZoomTime=r),e!==this.lastZoom?(this.lastZoom=e,this.lastFloorZoom=n,!0):!1)}};g();g();var H={"Latin-1 Supplement":l(t=>t>=128&&t<=255,"Latin-1 Supplement"),"Hangul Jamo":l(t=>t>=4352&&t<=4607,"Hangul Jamo"),Khmer:l(t=>t>=6016&&t<=6143,"Khmer"),"General Punctuation":l(t=>t>=8192&&t<=8303,"General Punctuation"),"Letterlike Symbols":l(t=>t>=8448&&t<=8527,"Letterlike Symbols"),"Number Forms":l(t=>t>=8528&&t<=8591,"Number Forms"),"Miscellaneous Technical":l(t=>t>=8960&&t<=9215,"Miscellaneous Technical"),"Control Pictures":l(t=>t>=9216&&t<=9279,"Control Pictures"),"Optical Character Recognition":l(t=>t>=9280&&t<=9311,"Optical Character Recognition"),"Enclosed Alphanumerics":l(t=>t>=9312&&t<=9471,"Enclosed Alphanumerics"),"Geometric Shapes":l(t=>t>=9632&&t<=9727,"Geometric Shapes"),"Miscellaneous Symbols":l(t=>t>=9728&&t<=9983,"Miscellaneous Symbols"),"Miscellaneous Symbols and Arrows":l(t=>t>=11008&&t<=11263,"Miscellaneous Symbols and Arrows"),"Ideographic Description Characters":l(t=>t>=12272&&t<=12287,"Ideographic Description Characters"),"CJK Symbols and Punctuation":l(t=>t>=12288&&t<=12351,"CJK Symbols and Punctuation"),Hiragana:l(t=>t>=12352&&t<=12447,"Hiragana"),Katakana:l(t=>t>=12448&&t<=12543,"Katakana"),Kanbun:l(t=>t>=12688&&t<=12703,"Kanbun"),"CJK Strokes":l(t=>t>=12736&&t<=12783,"CJK Strokes"),"Enclosed CJK Letters and Months":l(t=>t>=12800&&t<=13055,"Enclosed CJK Letters and Months"),"CJK Compatibility":l(t=>t>=13056&&t<=13311,"CJK Compatibility"),"Yijing Hexagram Symbols":l(t=>t>=19904&&t<=19967,"Yijing Hexagram Symbols"),"CJK Unified Ideographs":l(t=>t>=19968&&t<=40959,"CJK Unified Ideographs"),"Hangul Syllables":l(t=>t>=44032&&t<=55215,"Hangul Syllables"),"Private Use Area":l(t=>t>=57344&&t<=63743,"Private Use Area"),"Vertical Forms":l(t=>t>=65040&&t<=65055,"Vertical Forms"),"CJK Compatibility Forms":l(t=>t>=65072&&t<=65103,"CJK Compatibility Forms"),"Small Form Variants":l(t=>t>=65104&&t<=65135,"Small Form Variants"),"Halfwidth and Fullwidth Forms":l(t=>t>=65280&&t<=65519,"Halfwidth and Fullwidth Forms")};function kn(t){for(let e of t)if(Bo(e.charCodeAt(0)))return!0;return!1}l(kn,"allowsVerticalWritingMode");function Yc(t){for(let e of t)if(!mg(e.charCodeAt(0)))return!1;return!0}l(Yc,"allowsLetterSpacing");function Ks(t){let e=t.map(r=>{try{return new RegExp(`\\p{sc=${r}}`,"u").source}catch{return null}}).filter(r=>r);return new RegExp(e.join("|"),"u")}l(Ks,"sanitizedRegExpFromScriptCodes");var fg=["Arab","Dupl","Mong","Ougr","Syrc"],yg=Ks(fg);function mg(t){return!yg.test(String.fromCodePoint(t))}l(mg,"charAllowsLetterSpacing");var hg=["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"],Kc=Ks(hg);function Qc(t){return t<11904?!1:H["CJK Compatibility Forms"](t)||H["CJK Compatibility"](t)||H["CJK Strokes"](t)||H["CJK Symbols and Punctuation"](t)||H["Enclosed CJK Letters and Months"](t)||H["Halfwidth and Fullwidth Forms"](t)||H["Ideographic Description Characters"](t)||H["Vertical Forms"](t)?!0:Kc.test(String.fromCodePoint(t))}l(Qc,"charAllowsIdeographicBreaking");function Bo(t){return t===746||t===747?!0:t<4352?!1:!!(H["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||H["CJK Compatibility"](t)||H["CJK Strokes"](t)||H["CJK Symbols and Punctuation"](t)&&!(t>=12296&&t<=12305)&&!(t>=12308&&t<=12319)&&t!==12336||H["Enclosed CJK Letters and Months"](t)||H["Ideographic Description Characters"](t)||H.Kanbun(t)||H.Katakana(t)&&t!==12540||H["Halfwidth and Fullwidth Forms"](t)&&t!==65288&&t!==65289&&t!==65293&&!(t>=65306&&t<=65310)&&t!==65339&&t!==65341&&t!==65343&&!(t>=65371&&t<=65503)&&t!==65507&&!(t>=65512&&t<=65519)||H["Small Form Variants"](t)&&!(t>=65112&&t<=65118)&&!(t>=65123&&t<=65126)||H["Vertical Forms"](t)||H["Yijing Hexagram Symbols"](t)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(t))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(t))||Kc.test(String.fromCodePoint(t)))}l(Bo,"charHasUprightVerticalOrientation");function dg(t){return!!(H["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||H["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||H["Letterlike Symbols"](t)||H["Number Forms"](t)||H["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||H["Control Pictures"](t)&&t!==9251||H["Optical Character Recognition"](t)||H["Enclosed Alphanumerics"](t)||H["Geometric Shapes"](t)||H["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||H["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||H["CJK Symbols and Punctuation"](t)||H.Katakana(t)||H["Private Use Area"](t)||H["CJK Compatibility Forms"](t)||H["Small Form Variants"](t)||H["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}l(dg,"charHasNeutralVerticalOrientation");function Qs(t){return!(Bo(t)||dg(t))}l(Qs,"charHasRotatedVerticalOrientation");function ep(t){return new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(t))}l(ep,"charInComplexShapingScript");var gg=["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"],bg=Ks(gg);function tp(t){return bg.test(String.fromCodePoint(t))}l(tp,"charInRTLScript");function xg(t,e){return!(!e&&tp(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||H.Khmer(t))}l(xg,"charInSupportedScript");function rp(t){for(let e of t)if(tp(e.charCodeAt(0)))return!0;return!1}l(rp,"stringContainsRTLText");function np(t,e){for(let r of t)if(!xg(r.charCodeAt(0),e))return!1;return!0}l(np,"isStringInSupportedScript");g();var el=class{constructor(){this.TIMEOUT=5e3;this.applyArabicShaping=null;this.processBidirectionalText=null;this.processStyledBidirectionalText=null;this.pluginStatus="unavailable";this.pluginURL=null;this.loadScriptResolve=l(()=>{},"loadScriptResolve")}static{l(this,"RTLWorkerPlugin")}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(Ie.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getRTLTextPluginStatus(){return this.pluginStatus}async syncState(e,r){if(this.isParsed())return this.getState();if(e.pluginStatus!=="loading")return this.setState(e),e;let n=e.pluginURL,i=new Promise(s=>{this.loadScriptResolve=s});r(n);let o=new Promise(s=>setTimeout(()=>s(),this.TIMEOUT));if(await Promise.race([i,o]),this.isParsed()){let s={pluginStatus:"loaded",pluginURL:n};return this.setState(s),s}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${n}`)}},Ie=new el;var Z=class{static{l(this,"EvaluationParameters")}constructor(e,r){this.zoom=e,r?(this.now=r.now||0,this.fadeDuration=r.fadeDuration||0,this.zoomHistory=r.zoomHistory||new Cn,this.transition=r.transition||{},this.globalState=r.globalState||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Cn,this.transition={},this.globalState={})}isSupportedScript(e){return np(e,Ie.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,r=e-Math.floor(e),n=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:r+(1-r)*n}:{fromScale:.5,toScale:1,t:1-(1-n)*r}}};var Mr=class{static{l(this,"PropertyValue")}constructor(e,r){this.property=e,this.value=r,this.expression=dc(r===void 0?e.specification.default:r,e.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,r,n){return this.property.possiblyEvaluate(this,e,r,n)}},Fn=class{static{l(this,"TransitionablePropertyValue")}constructor(e){this.property=e,this.value=new Mr(e,void 0)}transitioned(e,r){return new Ro(this.property,this.value,r,xe({},e.transition,this.transition),e.now)}untransitioned(){return new Ro(this.property,this.value,null,{},0)}},Vo=class{static{l(this,"Transitionable")}constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return at(this._values[e].value.value)}setValue(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Fn(this._values[e].property)),this._values[e].value=new Mr(this._values[e].property,r===null?void 0:at(r))}getTransition(e){return at(this._values[e].transition)}setTransition(e,r){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Fn(this._values[e].property)),this._values[e].transition=at(r)||void 0}serialize(){let e={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(e[r]=n);let i=this.getTransition(r);i!==void 0&&(e[`${r}-transition`]=i)}return e}transitioned(e,r){let n=new zo(this._properties);for(let i of Object.keys(this._values))n._values[i]=this._values[i].transitioned(e,r._values[i]);return n}untransitioned(){let e=new zo(this._properties);for(let r of Object.keys(this._values))e._values[r]=this._values[r].untransitioned();return e}},Ro=class{static{l(this,"TransitioningPropertyValue")}constructor(e,r,n,i,o){this.property=e,this.value=r,this.begin=o+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=n)}possiblyEvaluate(e,r,n){let i=e.now||0,o=this.value.possiblyEvaluate(e,r,n),a=this.prior;if(a){if(i>this.end)return this.prior=null,o;if(this.value.isDataDriven())return this.prior=null,o;if(i<this.begin)return a.possiblyEvaluate(e,r,n);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,r,n),o,Au(s))}}else return o}},zo=class{static{l(this,"Transitioning")}constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,r,n){let i=new Mt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,r,n);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}},Oo=class{static{l(this,"Layout")}constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return this._values[e].value!==void 0}getValue(e){return at(this._values[e].value)}setValue(e,r){this._values[e]=new Mr(this._values[e].property,r===null?void 0:at(r))}serialize(){let e={};for(let r of Object.keys(this._values)){let n=this.getValue(r);n!==void 0&&(e[r]=n)}return e}possiblyEvaluate(e,r,n){let i=new Mt(this._properties);for(let o of Object.keys(this._values))i._values[o]=this._values[o].possiblyEvaluate(e,r,n);return i}},ve=class{static{l(this,"PossiblyEvaluatedPropertyValue")}constructor(e,r,n){this.property=e,this.value=r,this.parameters=n}isConstant(){return this.value.kind==="constant"}constantOr(e){return this.value.kind==="constant"?this.value.value:e}evaluate(e,r,n,i){return this.property.evaluate(this.value,this.parameters,e,r,n,i)}},Mt=class{static{l(this,"PossiblyEvaluated")}constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}},L=class{static{l(this,"DataConstantProperty")}constructor(e){this.specification=e}possiblyEvaluate(e,r){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(r)}interpolate(e,r,n){let i=this.specification.type,o=pt[i];return o?o(e,r,n):e}},V=class{static{l(this,"DataDrivenProperty")}constructor(e,r){this.specification=e,this.overrides=r}possiblyEvaluate(e,r,n,i){return e.expression.kind==="constant"||e.expression.kind==="camera"?new ve(this,{kind:"constant",value:e.expression.evaluate(r,null,{},n,i)},r):new ve(this,e.expression,r)}interpolate(e,r,n){if(e.value.kind!=="constant"||r.value.kind!=="constant")return e;if(e.value.value===void 0||r.value.value===void 0)return new ve(this,{kind:"constant",value:void 0},e.parameters);let i=this.specification.type,o=pt[i];if(o){let a=o(e.value.value,r.value.value,n);return new ve(this,{kind:"constant",value:a},e.parameters)}else return e}evaluate(e,r,n,i,o,a){return e.kind==="constant"?e.value:e.evaluate(r,n,i,o,a)}},mt=class extends V{static{l(this,"CrossFadedDataDrivenProperty")}possiblyEvaluate(e,r,n,i){if(e.value===void 0)return new ve(this,{kind:"constant",value:void 0},r);if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},n,i),s=e.property.specification.type==="resolvedImage"&&typeof o!="string"?o.name:o,u=this._calculate(s,s,s,r);return new ve(this,{kind:"constant",value:u},r)}else if(e.expression.kind==="camera"){let o=this._calculate(e.expression.evaluate({zoom:r.zoom-1}),e.expression.evaluate({zoom:r.zoom}),e.expression.evaluate({zoom:r.zoom+1}),r);return new ve(this,{kind:"constant",value:o},r)}else return new ve(this,e.expression,r)}evaluate(e,r,n,i,o,a){if(e.kind==="source"){let s=e.evaluate(r,n,i,o,a);return this._calculate(s,s,s,r)}else return e.kind==="composite"?this._calculate(e.evaluate({zoom:Math.floor(r.zoom)-1},n,i),e.evaluate({zoom:Math.floor(r.zoom)},n,i),e.evaluate({zoom:Math.floor(r.zoom)+1},n,i),r):e.value}_calculate(e,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:n,to:r}}interpolate(e){return e}},ir=class{static{l(this,"CrossFadedProperty")}constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){if(e.value!==void 0)if(e.expression.kind==="constant"){let o=e.expression.evaluate(r,null,{},n,i);return this._calculate(o,o,o,r)}else return this._calculate(e.expression.evaluate(new Z(Math.floor(r.zoom-1),r)),e.expression.evaluate(new Z(Math.floor(r.zoom),r)),e.expression.evaluate(new Z(Math.floor(r.zoom+1),r)),r)}_calculate(e,r,n,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:r}:{from:n,to:r}}interpolate(e){return e}},ht=class{static{l(this,"ColorRampProperty")}constructor(e){this.specification=e}possiblyEvaluate(e,r,n,i){return!!e.expression.evaluate(r,null,{},n,i)}interpolate(){return!1}},ne=class{static{l(this,"Properties")}constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let r in e){let n=e[r];n.specification.overridable&&this.overridableProperties.push(r);let i=this.defaultPropertyValues[r]=new Mr(n,void 0),o=this.defaultTransitionablePropertyValues[r]=new Fn(n);this.defaultTransitioningPropertyValues[r]=o.untransitioned(),this.defaultPossiblyEvaluatedValues[r]=i.possiblyEvaluate({})}}};k("DataDrivenProperty",V);k("DataConstantProperty",L);k("CrossFadedDataDrivenProperty",mt);k("CrossFadedProperty",ir);k("ColorRampProperty",ht);var Go="-transition",le=class extends Do{static{l(this,"StyleLayer")}constructor(e,r){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:l(()=>!0,"filter"),needGeometry:!1,getGlobalStateRefs:l(()=>new Set,"getGlobalStateRefs")},e.type!=="custom"&&(e=e,this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,e.type!=="background"&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=Et(e.filter)),r.layout&&(this._unevaluatedLayout=new Oo(r.layout)),r.paint)){this._transitionablePaint=new Vo(r.paint);for(let n in e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(let n in e.layout)this.setLayoutProperty(n,e.layout[n],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Mt(r.paint)}}setFilter(e){this.filter=e,this._featureFilter=Et(e)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return e==="visibility"?this.visibility:this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;if(this._unevaluatedLayout)for(let r in this._unevaluatedLayout._values){let n=this._unevaluatedLayout._values[r];for(let i of n.getGlobalStateRefs())e.add(i)}for(let r of this._featureFilter.getGlobalStateRefs())e.add(r);return e}setLayoutProperty(e,r,n={}){if(r!=null){let i=`layers.${this.id}.layout.${e}`;if(this._validate(Zc,i,e,r,n))return}if(e==="visibility"){this.visibility=r;return}this._unevaluatedLayout.setValue(e,r)}getPaintProperty(e){return e.endsWith(Go)?this._transitionablePaint.getTransition(e.slice(0,-Go.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,r,n={}){if(r!=null){let i=`layers.${this.id}.paint.${e}`;if(this._validate(Hc,i,e,r,n))return!1}if(e.endsWith(Go))return this._transitionablePaint.setTransition(e.slice(0,-Go.length),r||void 0),!1;{let i=this._transitionablePaint._values[e],o=i.property.specification["property-type"]==="cross-faded-data-driven",a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,r),this._handleSpecialPaintPropertyUpdate(e);let u=this._transitionablePaint._values[e].value;return u.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(e,s,u)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,r,n){return!1}isHidden(e){return this.minzoom&&e<this.minzoom||this.maxzoom&&e>=this.maxzoom?!0:this.visibility==="none"}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,r){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,r)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,r)}serialize(){let e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),Tu(e,(r,n)=>r!==void 0&&!(n==="layout"&&!Object.keys(r).length)&&!(n==="paint"&&!Object.keys(r).length))}_validate(e,r,n,i,o={}){return o&&o.validate===!1?!1:Jc(this,e.call(yt,{key:r,layerType:this.type,objectKey:n,value:i,styleSpec:A,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let r=this.paint.get(e);if(!(!(r instanceof ve)||!kt(r.property.specification))&&(r.value.kind==="source"||r.value.kind==="composite")&&r.value.isStateDependent)return!0}return!1}};g();g();g();var vg={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Lt=class{static{l(this,"Struct")}constructor(e,r){this._structArray=e,this._pos1=r*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}},Pg=128,Sg=5,ie=class{static{l(this,"StructArray")}constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,r){return e._trim(),r&&(e.isTransferred=!0,r.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let r=Object.create(this.prototype);return r.arrayBuffer=e.arrayBuffer,r.length=e.length,r.capacity=e.arrayBuffer.byteLength/r.bytesPerElement,r._refreshViews(),r}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*Sg),Pg),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let r=this.uint8;this._refreshViews(),r&&this.uint8.set(r)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}};function re(t,e=1){let r=0,n=0,i=t.map(a=>{let s=wg(a.type),u=r=ip(r,Math.max(e,s)),c=a.components||1;return n=Math.max(n,s),r+=s*c,{name:a.name,type:a.type,components:c,offset:u}}),o=ip(r,Math.max(n,e));return{members:i,size:o,alignment:e}}l(re,"createLayout");function wg(t){return vg[t].BYTES_PER_ELEMENT}l(wg,"sizeOf");function ip(t,e){return Math.ceil(t/e)*e}l(ip,"align");var op=ee(de(),1);var or=class extends ie{static{l(this,"StructArrayLayout2i4")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.int16[i+0]=r,this.int16[i+1]=n,e}};or.prototype.bytesPerElement=4;k("StructArrayLayout2i4",or);var En=class extends ie{static{l(this,"StructArrayLayout3i6")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.int16[o+0]=r,this.int16[o+1]=n,this.int16[o+2]=i,e}};En.prototype.bytesPerElement=6;k("StructArrayLayout3i6",En);var No=class extends ie{static{l(this,"StructArrayLayout4i8")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let a=e*4;return this.int16[a+0]=r,this.int16[a+1]=n,this.int16[a+2]=i,this.int16[a+3]=o,e}};No.prototype.bytesPerElement=8;k("StructArrayLayout4i8",No);var Mn=class extends ie{static{l(this,"StructArrayLayout2i4i12")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let u=e*6;return this.int16[u+0]=r,this.int16[u+1]=n,this.int16[u+2]=i,this.int16[u+3]=o,this.int16[u+4]=a,this.int16[u+5]=s,e}};Mn.prototype.bytesPerElement=12;k("StructArrayLayout2i4i12",Mn);var Ln=class extends ie{static{l(this,"StructArrayLayout2i4ub8")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let u=e*4,c=e*8;return this.int16[u+0]=r,this.int16[u+1]=n,this.uint8[c+4]=i,this.uint8[c+5]=o,this.uint8[c+6]=a,this.uint8[c+7]=s,e}};Ln.prototype.bytesPerElement=8;k("StructArrayLayout2i4ub8",Ln);var Dt=class extends ie{static{l(this,"StructArrayLayout2f8")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.float32[i+0]=r,this.float32[i+1]=n,e}};Dt.prototype.bytesPerElement=8;k("StructArrayLayout2f8",Dt);var Dn=class extends ie{static{l(this,"StructArrayLayout10ui20")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,u,c,p){let f=this.length;return this.resize(f+1),this.emplace(f,e,r,n,i,o,a,s,u,c,p)}emplace(e,r,n,i,o,a,s,u,c,p,f){let y=e*10;return this.uint16[y+0]=r,this.uint16[y+1]=n,this.uint16[y+2]=i,this.uint16[y+3]=o,this.uint16[y+4]=a,this.uint16[y+5]=s,this.uint16[y+6]=u,this.uint16[y+7]=c,this.uint16[y+8]=p,this.uint16[y+9]=f,e}};Dn.prototype.bytesPerElement=20;k("StructArrayLayout10ui20",Dn);var Bn=class extends ie{static{l(this,"StructArrayLayout4i4ui4i24")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,u,c,p,f,y){let m=this.length;return this.resize(m+1),this.emplace(m,e,r,n,i,o,a,s,u,c,p,f,y)}emplace(e,r,n,i,o,a,s,u,c,p,f,y,m){let h=e*12;return this.int16[h+0]=r,this.int16[h+1]=n,this.int16[h+2]=i,this.int16[h+3]=o,this.uint16[h+4]=a,this.uint16[h+5]=s,this.uint16[h+6]=u,this.uint16[h+7]=c,this.int16[h+8]=p,this.int16[h+9]=f,this.int16[h+10]=y,this.int16[h+11]=m,e}};Bn.prototype.bytesPerElement=24;k("StructArrayLayout4i4ui4i24",Bn);var Vn=class extends ie{static{l(this,"StructArrayLayout3f12")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.float32[o+0]=r,this.float32[o+1]=n,this.float32[o+2]=i,e}};Vn.prototype.bytesPerElement=12;k("StructArrayLayout3f12",Vn);var Rn=class extends ie{static{l(this,"StructArrayLayout1ul4")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.uint32[n+0]=r,e}};Rn.prototype.bytesPerElement=4;k("StructArrayLayout1ul4",Rn);var zn=class extends ie{static{l(this,"StructArrayLayout6i1ul2ui20")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,u,c){let p=this.length;return this.resize(p+1),this.emplace(p,e,r,n,i,o,a,s,u,c)}emplace(e,r,n,i,o,a,s,u,c,p){let f=e*10,y=e*5;return this.int16[f+0]=r,this.int16[f+1]=n,this.int16[f+2]=i,this.int16[f+3]=o,this.int16[f+4]=a,this.int16[f+5]=s,this.uint32[y+3]=u,this.uint16[f+8]=c,this.uint16[f+9]=p,e}};zn.prototype.bytesPerElement=20;k("StructArrayLayout6i1ul2ui20",zn);var On=class extends ie{static{l(this,"StructArrayLayout2i2i2i12")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let u=e*6;return this.int16[u+0]=r,this.int16[u+1]=n,this.int16[u+2]=i,this.int16[u+3]=o,this.int16[u+4]=a,this.int16[u+5]=s,e}};On.prototype.bytesPerElement=12;k("StructArrayLayout2i2i2i12",On);var Uo=class extends ie{static{l(this,"StructArrayLayout2f1f2i16")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o){let a=this.length;return this.resize(a+1),this.emplace(a,e,r,n,i,o)}emplace(e,r,n,i,o,a){let s=e*4,u=e*8;return this.float32[s+0]=r,this.float32[s+1]=n,this.float32[s+2]=i,this.int16[u+6]=o,this.int16[u+7]=a,e}};Uo.prototype.bytesPerElement=16;k("StructArrayLayout2f1f2i16",Uo);var Gn=class extends ie{static{l(this,"StructArrayLayout2ub2f2i16")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,r,n,i,o,a)}emplace(e,r,n,i,o,a,s){let u=e*16,c=e*4,p=e*8;return this.uint8[u+0]=r,this.uint8[u+1]=n,this.float32[c+1]=i,this.float32[c+2]=o,this.int16[p+6]=a,this.int16[p+7]=s,e}};Gn.prototype.bytesPerElement=16;k("StructArrayLayout2ub2f2i16",Gn);var Nn=class extends ie{static{l(this,"StructArrayLayout3ui6")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*3;return this.uint16[o+0]=r,this.uint16[o+1]=n,this.uint16[o+2]=i,e}};Nn.prototype.bytesPerElement=6;k("StructArrayLayout3ui6",Nn);var Un=class extends ie{static{l(this,"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b){let P=this.length;return this.resize(P+1),this.emplace(P,e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b)}emplace(e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P){let v=e*24,S=e*12,_=e*48;return this.int16[v+0]=r,this.int16[v+1]=n,this.uint16[v+2]=i,this.uint16[v+3]=o,this.uint32[S+2]=a,this.uint32[S+3]=s,this.uint32[S+4]=u,this.uint16[v+10]=c,this.uint16[v+11]=p,this.uint16[v+12]=f,this.float32[S+7]=y,this.float32[S+8]=m,this.uint8[_+36]=h,this.uint8[_+37]=d,this.uint8[_+38]=x,this.uint32[S+10]=b,this.int16[v+22]=P,e}};Un.prototype.bytesPerElement=48;k("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Un);var $n=class extends ie{static{l(this,"StructArrayLayout8i15ui1ul2f2ui64")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F,D,R,z,N){let B=this.length;return this.resize(B+1),this.emplace(B,e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F,D,R,z,N)}emplace(e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F,D,R,z,N,B){let C=e*32,O=e*16;return this.int16[C+0]=r,this.int16[C+1]=n,this.int16[C+2]=i,this.int16[C+3]=o,this.int16[C+4]=a,this.int16[C+5]=s,this.int16[C+6]=u,this.int16[C+7]=c,this.uint16[C+8]=p,this.uint16[C+9]=f,this.uint16[C+10]=y,this.uint16[C+11]=m,this.uint16[C+12]=h,this.uint16[C+13]=d,this.uint16[C+14]=x,this.uint16[C+15]=b,this.uint16[C+16]=P,this.uint16[C+17]=v,this.uint16[C+18]=S,this.uint16[C+19]=_,this.uint16[C+20]=T,this.uint16[C+21]=I,this.uint16[C+22]=F,this.uint32[O+12]=D,this.float32[O+13]=R,this.float32[O+14]=z,this.uint16[C+30]=N,this.uint16[C+31]=B,e}};$n.prototype.bytesPerElement=64;k("StructArrayLayout8i15ui1ul2f2ui64",$n);var ar=class extends ie{static{l(this,"StructArrayLayout1f4")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.float32[n+0]=r,e}};ar.prototype.bytesPerElement=4;k("StructArrayLayout1f4",ar);var jn=class extends ie{static{l(this,"StructArrayLayout1ui2f12")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*6,a=e*3;return this.uint16[o+0]=r,this.float32[a+1]=n,this.float32[a+2]=i,e}};jn.prototype.bytesPerElement=12;k("StructArrayLayout1ui2f12",jn);var qn=class extends ie{static{l(this,"StructArrayLayout1ul2ui8")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r,n){let i=this.length;return this.resize(i+1),this.emplace(i,e,r,n)}emplace(e,r,n,i){let o=e*2,a=e*4;return this.uint32[o+0]=r,this.uint16[a+2]=n,this.uint16[a+3]=i,e}};qn.prototype.bytesPerElement=8;k("StructArrayLayout1ul2ui8",qn);var Wn=class extends ie{static{l(this,"StructArrayLayout2ui4")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,r){let n=this.length;return this.resize(n+1),this.emplace(n,e,r)}emplace(e,r,n){let i=e*2;return this.uint16[i+0]=r,this.uint16[i+1]=n,e}};Wn.prototype.bytesPerElement=4;k("StructArrayLayout2ui4",Wn);var $o=class extends ie{static{l(this,"StructArrayLayout1ui2")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let r=this.length;return this.resize(r+1),this.emplace(r,e)}emplace(e,r){let n=e*1;return this.uint16[n+0]=r,e}};$o.prototype.bytesPerElement=2;k("StructArrayLayout1ui2",$o);var Lr=class extends ie{static{l(this,"StructArrayLayout4f16")}_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,r,n,i){let o=this.length;return this.resize(o+1),this.emplace(o,e,r,n,i)}emplace(e,r,n,i,o){let a=e*4;return this.float32[a+0]=r,this.float32[a+1]=n,this.float32[a+2]=i,this.float32[a+3]=o,e}};Lr.prototype.bytesPerElement=16;k("StructArrayLayout4f16",Lr);var jo=class extends Lt{static{l(this,"CollisionBoxStruct")}get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new op.default(this.anchorPointX,this.anchorPointY)}};jo.prototype.size=20;var Xn=class extends zn{static{l(this,"CollisionBoxArray")}get(e){return new jo(this,e)}};k("CollisionBoxArray",Xn);var qo=class extends Lt{static{l(this,"PlacedSymbolStruct")}get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};qo.prototype.size=48;var Hn=class extends Un{static{l(this,"PlacedSymbolArray")}get(e){return new qo(this,e)}};k("PlacedSymbolArray",Hn);var Wo=class extends Lt{static{l(this,"SymbolInstanceStruct")}get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}};Wo.prototype.size=64;var Zn=class extends $n{static{l(this,"SymbolInstanceArray")}get(e){return new Wo(this,e)}};k("SymbolInstanceArray",Zn);var Jn=class extends ar{static{l(this,"GlyphOffsetArray")}getoffsetX(e){return this.float32[e*1+0]}};k("GlyphOffsetArray",Jn);var Yn=class extends En{static{l(this,"SymbolLineVertexArray")}getx(e){return this.int16[e*3+0]}gety(e){return this.int16[e*3+1]}gettileUnitDistanceFromAnchor(e){return this.int16[e*3+2]}};k("SymbolLineVertexArray",Yn);var Xo=class extends Lt{static{l(this,"TextAnchorOffsetStruct")}get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}};Xo.prototype.size=12;var Kn=class extends jn{static{l(this,"TextAnchorOffsetArray")}get(e){return new Xo(this,e)}};k("TextAnchorOffsetArray",Kn);var Ho=class extends Lt{static{l(this,"FeatureIndexStruct")}get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};Ho.prototype.size=8;var Qn=class extends qn{static{l(this,"FeatureIndexArray")}get(e){return new Ho(this,e)}};k("FeatureIndexArray",Qn);var Zo=class extends or{static{l(this,"PosArray")}};var Jo=class extends or{static{l(this,"CircleLayoutArray")}},Yo=class extends or{static{l(this,"FillLayoutArray")}},Ko=class extends Mn{static{l(this,"FillExtrusionLayoutArray")}};var Qo=class extends Ln{static{l(this,"LineLayoutArray")}},ea=class extends Dt{static{l(this,"LineExtLayoutArray")}},dt=class extends Dn{static{l(this,"PatternLayoutArray")}},ta=class extends Bn{static{l(this,"SymbolLayoutArray")}},ra=class extends Vn{static{l(this,"SymbolDynamicLayoutArray")}},na=class extends Rn{static{l(this,"SymbolOpacityArray")}},ei=class extends On{static{l(this,"CollisionBoxLayoutArray")}};var ia=class extends Gn{static{l(this,"CollisionVertexArray")}};var Ve=class extends Nn{static{l(this,"TriangleIndexArray")}},Bt=class extends Wn{static{l(this,"LineIndexArray")}};g();var Ag=re([{name:"a_pos",components:2,type:"Int16"}],4);var{members:ap,size:zP,alignment:OP}=Ag;g();var me=class t{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1;this.segments=e}static{l(this,"SegmentVector")}prepareSegment(e,r,n,i){let o=this.segments[this.segments.length-1];return e>t.MAX_VERTEX_ARRAY_LENGTH&&ye(`Max vertices per segment is ${t.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${t.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!o||o.vertexLength+e>t.MAX_VERTEX_ARRAY_LENGTH||o.sortKey!==i?this.createNewSegment(r,n,i):o}createNewSegment(e,r,n){let i={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0,vaos:{}};return n!==void 0&&(i.sortKey=n),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(i),i}getOrCreateLatestSegment(e,r,n){return this.prepareSegment(0,e,r,n)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let r in e.vaos)e.vaos[r].destroy()}static simpleSegment(e,r,n,i){return new t([{vertexOffset:e,primitiveOffset:r,vertexLength:n,primitiveLength:i,vaos:{},sortKey:0}])}};me.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1;k("SegmentVector",me);g();g();function tl(t,e){return t=st(Math.floor(t),0,255),e=st(Math.floor(e),0,255),256*t+e}l(tl,"packUint8ToFloat");g();var ti=re([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);g();var pp=ee(il(),1);var ri=class t{static{l(this,"FeaturePositionMap")}constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,r,n,i){this.ids.push(cp(e)),this.positions.push(r,n,i)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let r=cp(e),n=0,i=this.ids.length-1;for(;n<i;){let a=n+i>>1;this.ids[a]>=r?i=a:n=a+1}let o=[];for(;this.ids[n]===r;){let a=this.positions[3*n],s=this.positions[3*n+1],u=this.positions[3*n+2];o.push({index:a,start:s,end:u}),n++}return o}static serialize(e,r){let n=new Float64Array(e.ids),i=new Uint32Array(e.positions);return ol(n,i,0,n.length-1),r&&r.push(n.buffer,i.buffer),{ids:n,positions:i}}static deserialize(e){let r=new t;return r.ids=e.ids,r.positions=e.positions,r.indexed=!0,r}};function cp(t){let e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:(0,pp.default)(String(t))}l(cp,"getNumericId");function ol(t,e,r,n){for(;r<n;){let i=t[r+n>>1],o=r-1,a=n+1;for(;;){do o++;while(t[o]<i);do a--;while(t[a]>i);if(o>=a)break;aa(t,o,a),aa(e,3*o,3*a),aa(e,3*o+1,3*a+1),aa(e,3*o+2,3*a+2)}a-r<n-a?(ol(t,e,r,a),r=a+1):(ol(t,e,a+1,n),n=a)}}l(ol,"sort");function aa(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}l(aa,"swap");k("FeaturePositionMap",ri);g();var ni=class{static{l(this,"Uniform")}constructor(e,r){this.gl=e.gl,this.location=r}};var Dr=class extends ni{static{l(this,"Uniform1f")}constructor(e,r){super(e,r),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}};var sa=class extends ni{static{l(this,"Uniform4f")}constructor(e,r){super(e,r),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}},la=class extends ni{static{l(this,"UniformColor")}constructor(e,r){super(e,r),this.current=Y.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}};var y1=new Float32Array(16);function al(t){return[tl(255*t.r,255*t.g),tl(255*t.b,255*t.a)]}l(al,"packColor");var sr=class{static{l(this,"ConstantBinder")}constructor(e,r,n){this.value=e,this.uniformNames=r.map(i=>`u_${i}`),this.type=n}setUniform(e,r,n){e.set(n.constantOr(this.value))}getBinding(e,r,n){return this.type==="color"?new la(e,r):new Dr(e,r)}},Vt=class{static{l(this,"CrossFadedConstantBinder")}constructor(e,r){this.uniformNames=r.map(n=>`u_${n}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,r){this.pixelRatioFrom=r.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=r.tlbr,this.patternTo=e.tlbr}setUniform(e,r,n,i){let o=i==="u_pattern_to"?this.patternTo:i==="u_pattern_from"?this.patternFrom:i==="u_pixel_ratio_to"?this.pixelRatioTo:i==="u_pixel_ratio_from"?this.pixelRatioFrom:null;o&&e.set(o)}getBinding(e,r,n){return n.substr(0,9)==="u_pattern"?new sa(e,r):new Dr(e,r)}},Ze=class{static{l(this,"SourceExpressionBinder")}constructor(e,r,n,i){this.expression=e,this.type=n,this.maxValue=0,this.paintVertexAttributes=r.map(o=>({name:`a_${o}`,type:"Float32",components:n==="color"?2:1,offset:0})),this.paintVertexArray=new i}populatePaintArray(e,r,n,i,o){let a=this.paintVertexArray.length,s=this.expression.evaluate(new Z(0),r,{},i,[],o);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,r,n,i){let o=this.expression.evaluate({zoom:0},n,i);this._setPaintValue(e,r,o)}_setPaintValue(e,r,n){if(this.type==="color"){let i=al(n);for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,i[0],i[1])}else{for(let i=e;i<r;i++)this.paintVertexArray.emplace(i,n);this.maxValue=Math.max(this.maxValue,Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},Re=class{static{l(this,"CompositeExpressionBinder")}constructor(e,r,n,i,o,a){this.expression=e,this.uniformNames=r.map(s=>`u_${s}_t`),this.type=n,this.useIntegerZoom=i,this.zoom=o,this.maxValue=0,this.paintVertexAttributes=r.map(s=>({name:`a_${s}`,type:"Float32",components:n==="color"?4:2,offset:0})),this.paintVertexArray=new a}populatePaintArray(e,r,n,i,o){let a=this.expression.evaluate(new Z(this.zoom),r,{},i,[],o),s=this.expression.evaluate(new Z(this.zoom+1),r,{},i,[],o),u=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(u,e,a,s)}updatePaintArray(e,r,n,i){let o=this.expression.evaluate({zoom:this.zoom},n,i),a=this.expression.evaluate({zoom:this.zoom+1},n,i);this._setPaintValue(e,r,o,a)}_setPaintValue(e,r,n,i){if(this.type==="color"){let o=al(n),a=al(i);for(let s=e;s<r;s++)this.paintVertexArray.emplace(s,o[0],o[1],a[0],a[1])}else{for(let o=e;o<r;o++)this.paintVertexArray.emplace(o,n,i);this.maxValue=Math.max(this.maxValue,Math.abs(n),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,r){let n=this.useIntegerZoom?Math.floor(r.zoom):r.zoom,i=st(this.expression.interpolationFactor(n,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,r,n){return new Dr(e,r)}},et=class{static{l(this,"CrossFadedCompositeBinder")}constructor(e,r,n,i,o,a){this.expression=e,this.type=r,this.useIntegerZoom=n,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new o,this.zoomOutPaintVertexArray=new o}populatePaintArray(e,r,n){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,r.patterns&&r.patterns[this.layerId],n)}updatePaintArray(e,r,n,i,o){this._setPaintValues(e,r,n.patterns&&n.patterns[this.layerId],o)}_setPaintValues(e,r,n,i){if(!i||!n)return;let{min:o,mid:a,max:s}=n,u=i[o],c=i[a],p=i[s];if(!(!u||!c||!p))for(let f=e;f<r;f++)this.zoomInPaintVertexArray.emplace(f,c.tl[0],c.tl[1],c.br[0],c.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],c.pixelRatio,u.pixelRatio),this.zoomOutPaintVertexArray.emplace(f,c.tl[0],c.tl[1],c.br[0],c.br[1],p.tl[0],p.tl[1],p.br[0],p.br[1],c.pixelRatio,p.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,ti.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,ti.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}},ua=class{static{l(this,"ProgramConfiguration")}constructor(e,r,n){this.binders={},this._buffers=[];let i=[];for(let o in e.paint._values){if(!n(o))continue;let a=e.paint.get(o);if(!(a instanceof ve)||!kt(a.property.specification))continue;let s=Cg(o,e.type),u=a.value,c=a.property.specification.type,p=a.property.useIntegerZoom,f=a.property.specification["property-type"],y=f==="cross-faded"||f==="cross-faded-data-driven";if(u.kind==="constant")this.binders[o]=y?new Vt(u.value,s):new sr(u.value,s,c),i.push(`/u_${o}`);else if(u.kind==="source"||y){let m=fp(o,c,"source");this.binders[o]=y?new et(u,c,p,r,m,e.id):new Ze(u,s,c,m),i.push(`/a_${o}`)}else{let m=fp(o,c,"composite");this.binders[o]=new Re(u,s,c,p,r,m),i.push(`/z_${o}`)}}this.cacheKey=i.sort().join("")}getMaxValue(e){let r=this.binders[e];return r instanceof Ze||r instanceof Re?r.maxValue:0}populatePaintArrays(e,r,n,i,o){for(let a in this.binders){let s=this.binders[a];(s instanceof Ze||s instanceof Re||s instanceof et)&&s.populatePaintArray(e,r,n,i,o)}}setConstantPatternPositions(e,r){for(let n in this.binders){let i=this.binders[n];i instanceof Vt&&i.setConstantPatternPositions(e,r)}}updatePaintArrays(e,r,n,i,o){let a=!1;for(let s in e){let u=r.getPositions(s);for(let c of u){let p=n.feature(c.index);for(let f in this.binders){let y=this.binders[f];if((y instanceof Ze||y instanceof Re||y instanceof et)&&y.expression.isStateDependent===!0){let m=i.paint.get(f);y.expression=m.value,y.updatePaintArray(c.start,c.end,p,e[s],o),a=!0}}}}return a}defines(){let e=[];for(let r in this.binders){let n=this.binders[r];(n instanceof sr||n instanceof Vt)&&e.push(...n.uniformNames.map(i=>`#define HAS_UNIFORM_${i}`))}return e}getBinderAttributes(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof Ze||n instanceof Re)for(let i=0;i<n.paintVertexAttributes.length;i++)e.push(n.paintVertexAttributes[i].name);else if(n instanceof et)for(let i=0;i<ti.members.length;i++)e.push(ti.members[i].name)}return e}getBinderUniforms(){let e=[];for(let r in this.binders){let n=this.binders[r];if(n instanceof sr||n instanceof Vt||n instanceof Re)for(let i of n.uniformNames)e.push(i)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,r){let n=[];for(let i in this.binders){let o=this.binders[i];if(o instanceof sr||o instanceof Vt||o instanceof Re){for(let a of o.uniformNames)if(r[a]){let s=o.getBinding(e,r[a],a);n.push({name:a,property:i,binding:s})}}}return n}setUniforms(e,r,n,i){for(let{name:o,property:a,binding:s}of r)this.binders[a].setUniform(s,i,n.get(a),o)}updatePaintBuffers(e){this._buffers=[];for(let r in this.binders){let n=this.binders[r];if(e&&n instanceof et){let i=e.fromScale===2?n.zoomInPaintVertexBuffer:n.zoomOutPaintVertexBuffer;i&&this._buffers.push(i)}else(n instanceof Ze||n instanceof Re)&&n.paintVertexBuffer&&this._buffers.push(n.paintVertexBuffer)}}upload(e){for(let r in this.binders){let n=this.binders[r];(n instanceof Ze||n instanceof Re||n instanceof et)&&n.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let r=this.binders[e];(r instanceof Ze||r instanceof Re||r instanceof et)&&r.destroy()}}},Te=class{static{l(this,"ProgramConfigurationSet")}constructor(e,r,n=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new ua(i,r,n);this.needsUpload=!1,this._featureMap=new ri,this._bufferOffset=0}populatePaintArrays(e,r,n,i,o,a){for(let s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(e,r,i,o,a);r.id!==void 0&&this._featureMap.add(r.id,n,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,r,n,i){for(let o of n)this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,r,o,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let r in this.programConfigurations)this.programConfigurations[r].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};function Cg(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}-`,"").replace(/-/g,"_")]}l(Cg,"paintAttributeNames");function kg(t){return{"line-pattern":{source:dt,composite:dt},"fill-pattern":{source:dt,composite:dt},"fill-extrusion-pattern":{source:dt,composite:dt}}[t]}l(kg,"getLayoutException");function fp(t,e,r){let n={color:{source:Dt,composite:Lr},number:{source:ar,composite:Dt}},i=kg(t);return i&&i[r]||n[e][r]}l(fp,"layoutType");k("ConstantBinder",sr);k("CrossFadedConstantBinder",Vt);k("SourceExpressionBinder",Ze);k("CrossFadedCompositeBinder",et);k("CompositeExpressionBinder",Re);k("ProgramConfiguration",ua,{omit:["_buffers"]});k("ProgramConfigurationSet",Te);g();g();var Fg=15,sl=Math.pow(2,Fg-1)-1,yp=-sl-1;function Ce(t){let e=8192/t.extent,r=t.loadGeometry();for(let n=0;n<r.length;n++){let i=r[n];for(let o=0;o<i.length;o++){let a=i[o],s=Math.round(a.x*e),u=Math.round(a.y*e);a.x=st(s,yp,sl),a.y=st(u,yp,sl),(s<a.x||s>a.x+1||u<a.y||u>a.y+1)&&ye("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}l(Ce,"loadGeometry");g();function je(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Ce(t):[]}}l(je,"toEvaluationFeature");var mp=-32768;function Eg(t,e,r,n,i){t.emplaceBack(mp+e*8+n,mp+r*8+i)}l(Eg,"addCircleVertex");var lr=class{static{l(this,"CircleBucket")}constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Jo,this.indexArray=new Ve,this.segments=new me,this.programConfigurations=new Te(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){let i=this.layers[0],o=[],a=null,s=!1,u=i.type==="heatmap";if(i.type==="circle"){let p=i;a=p.layout.get("circle-sort-key"),s=!a.isConstant(),u=u||p.paint.get("circle-pitch-alignment")==="map"}let c=u?r.subdivisionGranularity.circle:1;for(let{feature:p,id:f,index:y,sourceLayerIndex:m}of e){let h=this.layers[0]._featureFilter.needGeometry,d=je(p,h);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),d,n))continue;let x=s?a.evaluate(d,{},n):void 0,b={id:f,properties:p.properties,type:p.type,sourceLayerIndex:m,index:y,geometry:h?d.geometry:Ce(p),patterns:{},sortKey:x};o.push(b)}s&&o.sort((p,f)=>p.sortKey-f.sortKey);for(let p of o){let{geometry:f,index:y,sourceLayerIndex:m}=p,h=e[y].feature;this.addFeature(p,f,y,n,c),r.featureIndex.insert(h,f,y,m,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ap),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,r,n,i,o=1){let a;switch(o){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${o}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let u of r)for(let c of u){let p=c.x,f=c.y;if(p<0||p>=8192||f<0||f>=8192)continue;let y=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,e.sortKey),m=y.vertexLength;for(let h=0;h<s;h++)for(let d=0;d<s;d++)Eg(this.layoutVertexArray,p,f,a[d],a[h]);for(let h=0;h<s-1;h++)for(let d=0;d<s-1;d++){let x=m+h*s+d,b=m+(h+1)*s+d;this.indexArray.emplaceBack(x,b+1,x+1),this.indexArray.emplaceBack(x,b,b+1)}y.vertexLength+=s*s,y.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,{},i)}};k("CircleBucket",lr,{omit:["layers"]});g();var ii=ee(de(),1);function dp(t,e){for(let r=0;r<t.length;r++)if(Br(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(Br(t,e[r]))return!0;return!!ul(t,e)}l(dp,"polygonIntersectsPolygon");function gp(t,e,r){return!!(Br(t,e)||ll(e,t,r))}l(gp,"polygonIntersectsBufferedPoint");function ca(t,e){if(t.length===1)return hp(e,t[0]);for(let r=0;r<e.length;r++){let n=e[r];for(let i=0;i<n.length;i++)if(Br(t,n[i]))return!0}for(let r=0;r<t.length;r++)if(hp(e,t[r]))return!0;for(let r=0;r<e.length;r++)if(ul(t,e[r]))return!0;return!1}l(ca,"polygonIntersectsMultiPolygon");function bp(t,e,r){for(let n=0;n<e.length;n++){let i=e[n];if(t.length>=3){for(let o=0;o<i.length;o++)if(Br(t,i[o]))return!0}if(Mg(t,i,r))return!0}return!1}l(bp,"polygonIntersectsBufferedMultiLine");function Mg(t,e,r){if(t.length>1){if(ul(t,e))return!0;for(let n=0;n<e.length;n++)if(ll(e[n],t,r))return!0}for(let n=0;n<t.length;n++)if(ll(t[n],e,r))return!0;return!1}l(Mg,"lineIntersectsBufferedLine");function ul(t,e){if(t.length===0||e.length===0)return!1;for(let r=0;r<t.length-1;r++){let n=t[r],i=t[r+1];for(let o=0;o<e.length-1;o++){let a=e[o],s=e[o+1];if(Lg(n,i,a,s))return!0}}return!1}l(ul,"lineIntersectsLine");function Lg(t,e,r,n){return lt(t,r,n)!==lt(e,r,n)&&lt(t,e,r)!==lt(t,e,n)}l(Lg,"lineSegmentIntersectsLineSegment");function ll(t,e,r){let n=r*r;if(e.length===1)return t.distSqr(e[0])<n;for(let i=1;i<e.length;i++){let o=e[i-1],a=e[i];if(cl(t,o,a)<n)return!0}return!1}l(ll,"pointIntersectsBufferedLine");function cl(t,e,r){let n=e.distSqr(r);if(n===0)return t.distSqr(e);let i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/n;return i<0?t.distSqr(e):i>1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}l(cl,"distToSegmentSquared");function hp(t,e){let r=!1,n,i,o;for(let a=0;a<t.length;a++){n=t[a];for(let s=0,u=n.length-1;s<n.length;u=s++)i=n[s],o=n[u],i.y>e.y!=o.y>e.y&&e.x<(o.x-i.x)*(e.y-i.y)/(o.y-i.y)+i.x&&(r=!r)}return r}l(hp,"multiPolygonContainsPoint");function Br(t,e){let r=!1;for(let n=0,i=t.length-1;n<t.length;i=n++){let o=t[n],a=t[i];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}l(Br,"polygonContainsPoint");function xp(t,e,r,n,i){for(let a of t)if(e<=a.x&&r<=a.y&&n>=a.x&&i>=a.y)return!0;let o=[new ii.default(e,r),new ii.default(e,i),new ii.default(n,i),new ii.default(n,r)];if(t.length>2){for(let a of o)if(Br(t,a))return!0}for(let a=0;a<t.length-1;a++){let s=t[a],u=t[a+1];if(Dg(s,u,o))return!0}return!1}l(xp,"polygonIntersectsBox");function Dg(t,e,r){let n=r[0],i=r[2];if(t.x<n.x&&e.x<n.x||t.x>i.x&&e.x>i.x||t.y<n.y&&e.y<n.y||t.y>i.y&&e.y>i.y)return!1;let o=lt(t,e,r[0]);return o!==lt(t,e,r[1])||o!==lt(t,e,r[2])||o!==lt(t,e,r[3])}l(Dg,"edgeIntersectsBox");g();var pa=ee(de(),1);function ur(t,e,r){let n=e.paint.get(t).value;return n.kind==="constant"?n.value:r.programConfigurations.get(e.id).getMaxValue(t)}l(ur,"getMaximumPaintValue");function Rt(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}l(Rt,"translateDistance");function zt(t,e,r,n,i){if(!e[0]&&!e[1])return t;let o=pa.default.convert(e)._mult(i);r==="viewport"&&o._rotate(-n);let a=[];for(let s=0;s<t.length;s++){let u=t[s];a.push(u.sub(o))}return a}l(zt,"translate");function vp(t,e){let r=[];for(let n=0;n<t.length;n++){let i=t[n],o=[];for(let a=0;a<i.length;a++){let s=i[a-1],u=i[a],c=i[a+1],p=a===0?new pa.default(0,0):u.sub(s)._unit()._perp(),f=a===i.length-1?new pa.default(0,0):c.sub(u)._unit()._perp(),y=p._add(f)._unit(),m=y.x*f.x+y.y*f.y;m!==0&&y._mult(1/m),o.push(y._mult(e)._add(u))}r.push(o)}return r}l(vp,"offsetLine");g();var Pp,Bg=l(()=>Pp=Pp||new ne({"circle-sort-key":new V(A.layout_circle["circle-sort-key"])}),"getLayout"),Sp,Vg=l(()=>Sp=Sp||new ne({"circle-radius":new V(A.paint_circle["circle-radius"]),"circle-color":new V(A.paint_circle["circle-color"]),"circle-blur":new V(A.paint_circle["circle-blur"]),"circle-opacity":new V(A.paint_circle["circle-opacity"]),"circle-translate":new L(A.paint_circle["circle-translate"]),"circle-translate-anchor":new L(A.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new L(A.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new L(A.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new V(A.paint_circle["circle-stroke-width"]),"circle-stroke-color":new V(A.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new V(A.paint_circle["circle-stroke-opacity"])}),"getPaint"),wp={get paint(){return Vg()},get layout(){return Bg()}};var Ap=ee(de(),1);var fa=class extends le{static{l(this,"CircleStyleLayer")}constructor(e){super(e,wp)}createBucket(e){return new lr(e)}queryRadius(e){let r=e;return ur("circle-radius",this,r)+ur("circle-stroke-width",this,r)+Rt(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:u}){let c=zt(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-o.bearingInRadians,a),p=this.paint.get("circle-radius").evaluate(r,n),f=this.paint.get("circle-stroke-width").evaluate(r,n),y=p+f,m=this.paint.get("circle-pitch-alignment")==="map",h=m?c:Rg(c,o,s,u),d=m?y*a:y;for(let x of i)for(let b of x){let P=m?b:_p(b,o,s,u),v=d,S=o.projectTileCoordinates(b.x,b.y,s,u).signedDistanceFromCamera;if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?v*=S/o.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(v*=o.cameraToCenterDistance/S),gp(h,P,v))return!0}return!1}};function _p(t,e,r,n){let i=e.projectTileCoordinates(t.x,t.y,r,n).point;return new Ap.default((i.x*.5+.5)*e.width,(-i.y*.5+.5)*e.height)}l(_p,"projectPoint");function Rg(t,e,r,n){return t.map(i=>_p(i,e,r,n))}l(Rg,"projectQueryGeometry");g();g();var oi=class extends lr{static{l(this,"HeatmapBucket")}};k("HeatmapBucket",oi,{omit:["layers"]});g();var Ip,zg=l(()=>Ip=Ip||new ne({"heatmap-radius":new V(A.paint_heatmap["heatmap-radius"]),"heatmap-weight":new V(A.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new L(A.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ht(A.paint_heatmap["heatmap-color"]),"heatmap-opacity":new L(A.paint_heatmap["heatmap-opacity"])}),"getPaint"),Tp={get paint(){return zg()}};g();g();function pl(t,{width:e,height:r},n,i){if(!i)i=new Uint8Array(e*r*n);else if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==e*r*n)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${e*r*n}`);return t.width=e,t.height=r,t.data=i,t}l(pl,"createImage");function Cp(t,{width:e,height:r},n){if(e===t.width&&r===t.height)return;let i=pl({},{width:e,height:r},n);fl(t,i,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,r)},n),t.width=e,t.height=r,t.data=i.data}l(Cp,"resizeImage");function fl(t,e,r,n,i,o){if(i.width===0||i.height===0)return e;if(i.width>t.width||i.height>t.height||r.x>t.width-i.width||r.y>t.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>e.width||i.height>e.height||n.x>e.width-i.width||n.y>e.height-i.height)throw new RangeError("out of range destination coordinates for image copy");let a=t.data,s=e.data;if(a===s)throw new Error("srcData equals dstData, so image is already copied");for(let u=0;u<i.height;u++){let c=((r.y+u)*t.width+r.x)*o,p=((n.y+u)*e.width+n.x)*o;for(let f=0;f<i.width*o;f++)s[p+f]=a[c+f]}return e}l(fl,"copyImage");var cr=class t{static{l(this,"AlphaImage")}constructor(e,r){pl(this,e,1,r)}resize(e){Cp(this,e,1)}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){fl(e,r,n,i,o,1)}},he=class t{static{l(this,"RGBAImage")}constructor(e,r){pl(this,e,4,r)}resize(e){Cp(this,e,4)}replace(e,r){r?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new t({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,r,n,i,o){fl(e,r,n,i,o,4)}setPixel(e,r,n){let i=(e*this.width+r)*4;this.data[i+0]=Math.round(n.r*255/n.a),this.data[i+1]=Math.round(n.g*255/n.a),this.data[i+2]=Math.round(n.b*255/n.a),this.data[i+3]=Math.round(n.a*255)}};k("AlphaImage",cr);k("RGBAImage",he);function kp(t){let e={},r=t.resolution||256,n=t.clips?t.clips.length:1,i=t.image||new he({width:r,height:n});if(!Iu(r))throw new Error(`width is not a power of 2 - ${r}`);let o=l((a,s,u)=>{e[t.evaluationKey]=u;let c=t.expression.evaluate(e);i.setPixel(a/4/r,s/4,c)},"renderPixel");if(t.clips)for(let a=0,s=0;a<n;++a,s+=r*4)for(let u=0,c=0;u<r;u++,c+=4){let p=u/(r-1),{start:f,end:y}=t.clips[a],m=f*(1-p)+y*p;o(s,c,m)}else for(let a=0,s=0;a<r;a++,s+=4){let u=a/(r-1);o(0,s,u)}return i}l(kp,"renderColorRamp");var Fp="big-fb";var ya=class extends le{static{l(this,"HeatmapStyleLayer")}createBucket(e){return new oi(e)}constructor(e){super(e,Tp),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){e==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=kp({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Fp)&&this.heatmapFbos.delete(Fp)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}};g();g();var Ep,Og=l(()=>Ep=Ep||new ne({"hillshade-illumination-direction":new L(A.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new L(A.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new L(A.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new L(A.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new L(A.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new L(A.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new L(A.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new L(A.paint_hillshade["hillshade-method"])}),"getPaint"),Mp={get paint(){return Og()}};var ma=class extends le{static{l(this,"HillshadeStyleLayer")}constructor(e){super(e,Mp),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,r=this.paint.get("hillshade-illumination-altitude").values,n=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,o=Math.max(e.length,r.length,n.length,i.length);e=e.concat(Array(o-e.length).fill(e.at(-1))),r=r.concat(Array(o-r.length).fill(r.at(-1))),n=n.concat(Array(o-n.length).fill(n.at(-1))),i=i.concat(Array(o-i.length).fill(i.at(-1)));let a=r.map(fs);return{directionRadians:e.map(fs),altitudeRadians:a,shadowColor:i,highlightColor:n}}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}};g();g();var Lp,Gg=l(()=>Lp=Lp||new ne({"color-relief-opacity":new L(A["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new ht(A["paint_color-relief"]["color-relief-color"])}),"getPaint"),Dp={get paint(){return Gg()}};g();var ai=class{static{l(this,"Texture")}constructor(e,r,n,i){this.context=e,this.format=n,this.texture=e.gl.createTexture(),this.update(r,i)}update(e,r,n){let{width:i,height:o}=e,a=(!this.size||this.size[0]!==i||this.size[1]!==o)&&!n,{context:s}=this,{gl:u}=s;if(this.useMipmap=!!(r&&r.useMipmap),u.bindTexture(u.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===u.RGBA&&(!r||r.premultiply!==!1)),a)this.size=[i,o],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||wt(e)?u.texImage2D(u.TEXTURE_2D,0,this.format,this.format,u.UNSIGNED_BYTE,e):u.texImage2D(u.TEXTURE_2D,0,this.format,i,o,0,this.format,u.UNSIGNED_BYTE,e.data);else{let{x:c,y:p}=n||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||wt(e)?u.texSubImage2D(u.TEXTURE_2D,0,c,p,u.RGBA,u.UNSIGNED_BYTE,e):u.texSubImage2D(u.TEXTURE_2D,0,c,p,i,o,u.RGBA,u.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&u.generateMipmap(u.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(e,r,n){let{context:i}=this,{gl:o}=i;o.bindTexture(o.TEXTURE_2D,this.texture),n===o.LINEAR_MIPMAP_NEAREST&&!this.isSizePowerOfTwo()&&(n=o.LINEAR),e!==this.filter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,e),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,n||e),this.filter=e),r!==this.wrap&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,r),this.wrap=r)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}};g();var si=class{static{l(this,"DEMData")}constructor(e,r,n,i=1,o=1,a=1,s=0){if(this.uid=e,r.height!==r.width)throw new RangeError("DEM tiles must be square");if(n&&!["mapbox","terrarium","custom"].includes(n)){ye(`"${n}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);return}this.stride=r.height;let u=this.dim=r.height-2;switch(this.data=new Uint32Array(r.data.buffer),n){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=i,this.greenFactor=o,this.blueFactor=a,this.baseShift=s;break;case"mapbox":default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4;break}for(let c=0;c<u;c++)this.data[this._idx(-1,c)]=this.data[this._idx(0,c)],this.data[this._idx(u,c)]=this.data[this._idx(u-1,c)],this.data[this._idx(c,-1)]=this.data[this._idx(c,0)],this.data[this._idx(c,u)]=this.data[this._idx(c,u-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(u,-1)]=this.data[this._idx(u-1,0)],this.data[this._idx(-1,u)]=this.data[this._idx(0,u-1)],this.data[this._idx(u,u)]=this.data[this._idx(u-1,u-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let c=0;c<u;c++)for(let p=0;p<u;p++){let f=this.get(c,p);f>this.max&&(this.max=f),f<this.min&&(this.min=f)}}get(e,r){let n=new Uint8Array(this.data.buffer),i=this._idx(e,r)*4;return this.unpack(n[i],n[i+1],n[i+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,r){if(e<-1||e>=this.dim+1||r<-1||r>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(r+1)*this.stride+(e+1)}unpack(e,r,n){return e*this.redFactor+r*this.greenFactor+n*this.blueFactor-this.baseShift}pack(e){return yl(e,this.getUnpackVector())}getPixels(){return new he({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,r,n){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=r*this.dim,o=r*this.dim+this.dim,a=n*this.dim,s=n*this.dim+this.dim;switch(r){case-1:i=o-1;break;case 1:o=i+1;break}switch(n){case-1:a=s-1;break;case 1:s=a+1;break}let u=-r*this.dim,c=-n*this.dim;for(let p=a;p<s;p++)for(let f=i;f<o;f++)this.data[this._idx(f,p)]=e.data[this._idx(f+u,p+c)]}};function yl(t,e){let r=e[0],n=e[1],i=e[2],o=e[3],a=Math.min(r,n,i),s=Math.round((t+o)/a);return{r:Math.floor(s*a/r)%256,g:Math.floor(s*a/n)%256,b:Math.floor(s*a/i)%256}}l(yl,"packDEMData");k("DEMData",si);var ha=class extends le{static{l(this,"ColorReliefStyleLayer")}constructor(e){super(e,Dp)}_createColorRamp(e){let r={elevationStops:[],colorStops:[]},n=this._transitionablePaint._values["color-relief-color"].value.expression;if(n instanceof Qe&&n._styleExpression.expression instanceof Me){this.colorRampExpression=n;let a=n._styleExpression.expression;r.elevationStops=a.labels,r.colorStops=[];for(let s of r.elevationStops)r.colorStops.push(a.evaluate({globals:{elevation:s}}))}if(r.elevationStops.length<1&&(r.elevationStops=[0],r.colorStops=[Y.transparent]),r.elevationStops.length<2&&(r.elevationStops.push(r.elevationStops[0]+1),r.colorStops.push(r.colorStops[0])),r.elevationStops.length<=e)return r;let i={elevationStops:[],colorStops:[]},o=(r.elevationStops.length-1)/(e-1);for(let a=0;a<r.elevationStops.length-.5;a+=o)i.elevationStops.push(r.elevationStops[Math.round(a)]),i.colorStops.push(r.colorStops[Math.round(a)]);return ye(`Too many colors in specification of ${this.id} color-relief layer, may not render properly.`),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,r,n){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(r),o=new he({width:i.colorStops.length,height:1}),a=new he({width:i.colorStops.length,height:1});for(let s=0;s<i.elevationStops.length;s++){let u=yl(i.elevationStops[s],n);a.setPixel(0,s,new Y(u.r/255,u.g/255,u.b/255,1)),o.setPixel(0,s,i.colorStops[s])}return this.colorRampTextures={elevationTexture:new ai(e,a,e.gl.RGBA),colorTexture:new ai(e,o,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return this.visibility!=="none"&&!!this.colorRampTextures}};g();g();g();var Ng=re([{name:"a_pos",components:2,type:"Int16"}],4);var{members:Bp,size:Yw,alignment:Kw}=Ng;g();function Vr(t,e,r){let n=r.patternDependencies,i=!1;for(let o of e){let a=o.paint.get(`${t}-pattern`);a.isConstant()||(i=!0);let s=a.constantOr(null);s&&(i=!0,n[s.to]=!0,n[s.from]=!0)}return i}l(Vr,"hasPattern");function Rr(t,e,r,n,i){let o=i.patternDependencies;for(let a of e){let u=a.paint.get(`${t}-pattern`).value;if(u.kind!=="constant"){let c=u.evaluate({zoom:n-1},r,{},i.availableImages),p=u.evaluate({zoom:n},r,{},i.availableImages),f=u.evaluate({zoom:n+1},r,{},i.availableImages);c=c&&c.name?c.name:c,p=p&&p.name?p.name:p,f=f&&f.name?f.name:f,o[c]=!0,o[p]=!0,o[f]=!0,r.patterns[a.id]={min:c,mid:p,max:f}}}return r}l(Rr,"addPatternDependencies");g();var yi=ee(de(),1);g();function dl(t,e,r=2){let n=e&&e.length,i=n?e[0]*r:t.length,o=Rp(t,0,i,r,!0),a=[];if(!o||o.next===o.prev)return a;let s,u,c;if(n&&(o=Wg(t,e,o,r)),t.length>80*r){s=1/0,u=1/0;let p=-1/0,f=-1/0;for(let y=r;y<i;y+=r){let m=t[y],h=t[y+1];m<s&&(s=m),h<u&&(u=h),m>p&&(p=m),h>f&&(f=h)}c=Math.max(p-s,f-u),c=c!==0?32767/c:0}return ui(o,a,r,s,u,c,0),a}l(dl,"earcut");function Rp(t,e,r,n,i){let o;if(i===nb(t,e,r,n)>0)for(let a=e;a<r;a+=n)o=Vp(a/n|0,t[a],t[a+1],o);else for(let a=r-n;a>=e;a-=n)o=Vp(a/n|0,t[a],t[a+1],o);return o&&zr(o,o.next)&&(pi(o),o=o.next),o}l(Rp,"linkedList");function pr(t,e){if(!t)return t;e||(e=t);let r=t,n;do if(n=!1,!r.steiner&&(zr(r,r.next)||ce(r.prev,r,r.next)===0)){if(pi(r),r=e=r.prev,r===r.next)break;n=!0}else r=r.next;while(n||r!==e);return e}l(pr,"filterPoints");function ui(t,e,r,n,i,o,a){if(!t)return;!a&&o&&Yg(t,n,i,o);let s=t;for(;t.prev!==t.next;){let u=t.prev,c=t.next;if(o?$g(t,n,i,o):Ug(t)){e.push(u.i,t.i,c.i),pi(t),t=c.next,s=c.next;continue}if(t=c,t===s){a?a===1?(t=jg(pr(t),e),ui(t,e,r,n,i,o,2)):a===2&&qg(t,e,r,n,i,o):ui(pr(t),e,r,n,i,o,1);break}}}l(ui,"earcutLinked");function Ug(t){let e=t.prev,r=t,n=t.next;if(ce(e,r,n)>=0)return!1;let i=e.x,o=r.x,a=n.x,s=e.y,u=r.y,c=n.y,p=Math.min(i,o,a),f=Math.min(s,u,c),y=Math.max(i,o,a),m=Math.max(s,u,c),h=n.next;for(;h!==e;){if(h.x>=p&&h.x<=y&&h.y>=f&&h.y<=m&&li(i,s,o,u,a,c,h.x,h.y)&&ce(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}l(Ug,"isEar");function $g(t,e,r,n){let i=t.prev,o=t,a=t.next;if(ce(i,o,a)>=0)return!1;let s=i.x,u=o.x,c=a.x,p=i.y,f=o.y,y=a.y,m=Math.min(s,u,c),h=Math.min(p,f,y),d=Math.max(s,u,c),x=Math.max(p,f,y),b=ml(m,h,e,r,n),P=ml(d,x,e,r,n),v=t.prevZ,S=t.nextZ;for(;v&&v.z>=b&&S&&S.z<=P;){if(v.x>=m&&v.x<=d&&v.y>=h&&v.y<=x&&v!==i&&v!==a&&li(s,p,u,f,c,y,v.x,v.y)&&ce(v.prev,v,v.next)>=0||(v=v.prevZ,S.x>=m&&S.x<=d&&S.y>=h&&S.y<=x&&S!==i&&S!==a&&li(s,p,u,f,c,y,S.x,S.y)&&ce(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;v&&v.z>=b;){if(v.x>=m&&v.x<=d&&v.y>=h&&v.y<=x&&v!==i&&v!==a&&li(s,p,u,f,c,y,v.x,v.y)&&ce(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;S&&S.z<=P;){if(S.x>=m&&S.x<=d&&S.y>=h&&S.y<=x&&S!==i&&S!==a&&li(s,p,u,f,c,y,S.x,S.y)&&ce(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}l($g,"isEarHashed");function jg(t,e){let r=t;do{let n=r.prev,i=r.next.next;!zr(n,i)&&Op(n,r,r.next,i)&&ci(n,i)&&ci(i,n)&&(e.push(n.i,r.i,i.i),pi(r),pi(r.next),r=t=i),r=r.next}while(r!==t);return pr(r)}l(jg,"cureLocalIntersections");function qg(t,e,r,n,i,o){let a=t;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&eb(a,s)){let u=Gp(a,s);a=pr(a,a.next),u=pr(u,u.next),ui(a,e,r,n,i,o,0),ui(u,e,r,n,i,o,0);return}s=s.next}a=a.next}while(a!==t)}l(qg,"splitEarcut");function Wg(t,e,r,n){let i=[];for(let o=0,a=e.length;o<a;o++){let s=e[o]*n,u=o<a-1?e[o+1]*n:t.length,c=Rp(t,s,u,n,!1);c===c.next&&(c.steiner=!0),i.push(Qg(c))}i.sort(Xg);for(let o=0;o<i.length;o++)r=Hg(i[o],r);return r}l(Wg,"eliminateHoles");function Xg(t,e){let r=t.x-e.x;if(r===0&&(r=t.y-e.y,r===0)){let n=(t.next.y-t.y)/(t.next.x-t.x),i=(e.next.y-e.y)/(e.next.x-e.x);r=n-i}return r}l(Xg,"compareXYSlope");function Hg(t,e){let r=Zg(t,e);if(!r)return e;let n=Gp(r,t);return pr(n,n.next),pr(r,r.next)}l(Hg,"eliminateHole");function Zg(t,e){let r=e,n=t.x,i=t.y,o=-1/0,a;if(zr(t,r))return r;do{if(zr(t,r.next))return r.next;if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){let f=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(f<=n&&f>o&&(o=f,a=r.x<r.next.x?r:r.next,f===n))return a}r=r.next}while(r!==e);if(!a)return null;let s=a,u=a.x,c=a.y,p=1/0;r=a;do{if(n>=r.x&&r.x>=u&&n!==r.x&&zp(i<c?n:o,i,u,c,i<c?o:n,i,r.x,r.y)){let f=Math.abs(i-r.y)/(n-r.x);ci(r,t)&&(f<p||f===p&&(r.x>a.x||r.x===a.x&&Jg(a,r)))&&(a=r,p=f)}r=r.next}while(r!==s);return a}l(Zg,"findHoleBridge");function Jg(t,e){return ce(t.prev,t,e.prev)<0&&ce(e.next,t,t.next)<0}l(Jg,"sectorContainsSector");function Yg(t,e,r,n){let i=t;do i.z===0&&(i.z=ml(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,Kg(i)}l(Yg,"indexCurve");function Kg(t){let e,r=1;do{let n=t,i;t=null;let o=null;for(e=0;n;){e++;let a=n,s=0;for(let c=0;c<r&&(s++,a=a.nextZ,!!a);c++);let u=r;for(;s>0||u>0&&a;)s!==0&&(u===0||!a||n.z<=a.z)?(i=n,n=n.nextZ,s--):(i=a,a=a.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=a}o.nextZ=null,r*=2}while(e>1);return t}l(Kg,"sortLinked");function ml(t,e,r,n,i){return t=(t-r)*i|0,e=(e-n)*i|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}l(ml,"zOrder");function Qg(t){let e=t,r=t;do(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),e=e.next;while(e!==t);return r}l(Qg,"getLeftmost");function zp(t,e,r,n,i,o,a,s){return(i-a)*(e-s)>=(t-a)*(o-s)&&(t-a)*(n-s)>=(r-a)*(e-s)&&(r-a)*(o-s)>=(i-a)*(n-s)}l(zp,"pointInTriangle");function li(t,e,r,n,i,o,a,s){return!(t===a&&e===s)&&zp(t,e,r,n,i,o,a,s)}l(li,"pointInTriangleExceptFirst");function eb(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!tb(t,e)&&(ci(t,e)&&ci(e,t)&&rb(t,e)&&(ce(t.prev,t,e.prev)||ce(t,e.prev,e))||zr(t,e)&&ce(t.prev,t,t.next)>0&&ce(e.prev,e,e.next)>0)}l(eb,"isValidDiagonal");function ce(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}l(ce,"area");function zr(t,e){return t.x===e.x&&t.y===e.y}l(zr,"equals");function Op(t,e,r,n){let i=ga(ce(t,e,r)),o=ga(ce(t,e,n)),a=ga(ce(r,n,t)),s=ga(ce(r,n,e));return!!(i!==o&&a!==s||i===0&&da(t,r,e)||o===0&&da(t,n,e)||a===0&&da(r,t,n)||s===0&&da(r,e,n))}l(Op,"intersects");function da(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}l(da,"onSegment");function ga(t){return t>0?1:t<0?-1:0}l(ga,"sign");function tb(t,e){let r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Op(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}l(tb,"intersectsPolygon");function ci(t,e){return ce(t.prev,t,t.next)<0?ce(t,e,t.next)>=0&&ce(t,t.prev,e)>=0:ce(t,e,t.prev)<0||ce(t,t.next,e)<0}l(ci,"locallyInside");function rb(t,e){let r=t,n=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==t);return n}l(rb,"middleInside");function Gp(t,e){let r=hl(t.i,t.x,t.y),n=hl(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}l(Gp,"splitPolygon");function Vp(t,e,r,n){let i=hl(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}l(Vp,"insertNode");function pi(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)}l(pi,"removeNode");function hl(t,e,r){return{i:t,x:e,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}l(hl,"createNode");function nb(t,e,r,n){let i=0;for(let o=e,a=r-n;o<r;o+=n)i+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return i}l(nb,"signedArea");g();var Ot=class{static{l(this,"SubdivisionGranularityExpression")}constructor(e,r){if(r>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=r}getGranularityForZoomLevel(e){let r=1<<e;return Math.max(Math.floor(this._baseZoomGranularity/r),this._minGranularity,1)}},ba=class t{static{l(this,"SubdivisionGranularitySetting")}constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}static{this.noSubdivision=new t({fill:new Ot(0,0),line:new Ot(0,0),tile:new Ot(0,0),stencil:new Ot(0,0),circle:1})}};k("SubdivisionGranularityExpression",Ot);k("SubdivisionGranularitySetting",ba);var Or=-32768,fi=32767,gl=class{constructor(e,r){this._vertexBuffer=[];this._vertexDictionary=new Map;this._used=!1;this._granularity=e,this._granularityCellSize=8192/e,this._canonical=r}static{l(this,"Subdivider")}_getKey(e,r){return e=e+32768,r=r+32768,e<<16|r<<0}_vertexToIndex(e,r){if(e<-32768||r<-32768||e>32767||r>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");let n=Math.round(e)|0,i=Math.round(r)|0,o=this._getKey(n,i);if(this._vertexDictionary.has(o))return this._vertexDictionary.get(o);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(o,a),this._vertexBuffer.push(n,i),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return ob(this._vertexBuffer,e);let r=[],n=e.length;for(let i=0;i<n;i+=3){let o=[e[i+0],e[i+1],e[i+2]],a=[this._vertexBuffer[e[i+0]*2+0],this._vertexBuffer[e[i+0]*2+1],this._vertexBuffer[e[i+1]*2+0],this._vertexBuffer[e[i+1]*2+1],this._vertexBuffer[e[i+2]*2+0],this._vertexBuffer[e[i+2]*2+1]],s=1/0,u=1/0,c=-1/0,p=-1/0;for(let d=0;d<3;d++){let x=a[d*2],b=a[d*2+1];s=Math.min(s,x),c=Math.max(c,x),u=Math.min(u,b),p=Math.max(p,b)}if(s===c||u===p)continue;let f=Math.floor(s/this._granularityCellSize),y=Math.ceil(c/this._granularityCellSize),m=Math.floor(u/this._granularityCellSize),h=Math.ceil(p/this._granularityCellSize);if(f===y&&m===h){r.push(...o);continue}for(let d=m;d<h;d++){let x=this._scanlineGenerateVertexRingForCellRow(d,a,o);ab(this._vertexBuffer,x,r)}}return r}_scanlineGenerateVertexRingForCellRow(e,r,n){let i=e*this._granularityCellSize,o=i+this._granularityCellSize,a=[];for(let s=0;s<3;s++){let u=r[s*2],c=r[s*2+1],p=r[(s+1)*2%6],f=r[((s+1)*2+1)%6],y=r[(s+2)*2%6],m=r[((s+2)*2+1)%6],h=p-u,d=f-c,x=h===0,b=d===0,P=(i-c)/d,v=(o-c)/d,S=Math.min(P,v),_=Math.max(P,v);if(!b&&(S>=1||_<=0)||b&&(c<i||c>o)){f>=i&&f<=o&&a.push(n[(s+1)%3]);continue}if(!b&&S>0){let F=u+h*S,D=c+d*S;a.push(this._vertexToIndex(F,D))}let T=u+h*Math.max(S,0),I=u+h*Math.min(_,1);if(x||this._generateIntraEdgeVertices(a,u,c,p,f,T,I),!b&&_<1){let F=u+h*_,D=c+d*_;a.push(this._vertexToIndex(F,D))}(b||f>=i&&f<=o)&&a.push(n[(s+1)%3]),!b&&(f<=i||f>=o)&&this._generateInterEdgeVertices(a,u,c,p,f,y,m,I,i,o)}return a}_generateIntraEdgeVertices(e,r,n,i,o,a,s){let u=i-r,c=o-n,p=c===0,f=p?Math.min(r,i):Math.min(a,s),y=p?Math.max(r,i):Math.max(a,s),m=Math.floor(f/this._granularityCellSize)+1,h=Math.ceil(y/this._granularityCellSize)-1;if(p?r<i:a<s)for(let x=m;x<=h;x++){let b=x*this._granularityCellSize,P=n+c*(b-r)/u;e.push(this._vertexToIndex(b,P))}else for(let x=h;x>=m;x--){let b=x*this._granularityCellSize,P=n+c*(b-r)/u;e.push(this._vertexToIndex(b,P))}}_generateInterEdgeVertices(e,r,n,i,o,a,s,u,c,p){let f=o-n,y=a-i,m=s-o,h=(c-o)/m,d=(p-o)/m,x=Math.min(h,d),b=Math.max(h,d),P=i+y*x,v=Math.floor(Math.min(P,u)/this._granularityCellSize)+1,S=Math.ceil(Math.max(P,u)/this._granularityCellSize)-1,_=u<P,T=m===0;if(T&&(s===c||s===p))return;if(T||x>=1||b<=0){let F=r-a,D=n-s,R=(c-s)/D,z=(p-s)/D,N=Math.min(R,z),B=a+F*N;v=Math.floor(Math.min(B,u)/this._granularityCellSize)+1,S=Math.ceil(Math.max(B,u)/this._granularityCellSize)-1,_=u<B}let I=f>0?p:c;if(_)for(let F=v;F<=S;F++){let D=F*this._granularityCellSize;e.push(this._vertexToIndex(D,I))}else for(let F=S;F>=v;F--){let D=F*this._granularityCellSize;e.push(this._vertexToIndex(D,I))}}_generateOutline(e){let r=[];for(let n of e){let i=tt(n,this._granularity,!0),o=this._pointArrayToIndices(i),a=[];for(let s=1;s<o.length;s++)a.push(o[s-1]),a.push(o[s]);r.push(a)}return r}_handlePoles(e){let r=!1,n=!1;this._canonical&&(this._canonical.y===0&&(r=!0),this._canonical.y===(1<<this._canonical.z)-1&&(n=!0)),(r||n)&&this._fillPoles(e,r,n)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let r=0;r<e.length;r+=2){let n=e[r+1];n===Or&&(e[r+1]=Or+1),n===fi&&(e[r+1]=fi-1)}}_generatePoleQuad(e,r,n,i,o,a){i>o!=(a===Or)?(e.push(r),e.push(n),e.push(this._vertexToIndex(i,a)),e.push(n),e.push(this._vertexToIndex(o,a)),e.push(this._vertexToIndex(i,a))):(e.push(n),e.push(r),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(o,a)),e.push(n),e.push(this._vertexToIndex(i,a)))}_fillPoles(e,r,n){let i=this._vertexBuffer,o=0,a=8192,s=e.length;for(let u=2;u<s;u+=3){let c=e[u-2],p=e[u-1],f=e[u],y=i[c*2],m=i[c*2+1],h=i[p*2],d=i[p*2+1],x=i[f*2],b=i[f*2+1];r&&(m===o&&d===o&&this._generatePoleQuad(e,c,p,y,h,Or),d===o&&b===o&&this._generatePoleQuad(e,p,f,h,x,Or),b===o&&m===o&&this._generatePoleQuad(e,f,c,x,y,Or)),n&&(m===a&&d===a&&this._generatePoleQuad(e,c,p,y,h,fi),d===a&&b===a&&this._generatePoleQuad(e,p,f,h,x,fi),b===a&&m===a&&this._generatePoleQuad(e,f,c,x,y,fi))}}_initializeVertices(e){for(let r=0;r<e.length;r+=2)this._vertexToIndex(e[r],e[r+1])}subdividePolygonInternal(e,r){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;let{flattened:n,holeIndices:i}=ib(e);this._initializeVertices(n);let o;try{let s=dl(n,i),u=this._convertIndices(n,s);o=this._subdivideTrianglesScanline(u)}catch(s){console.error(s)}let a=[];return r&&(a=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(o),{verticesFlattened:this._vertexBuffer,indicesTriangles:o,indicesLineList:a}}_convertIndices(e,r){let n=[];for(let i=0;i<r.length;i++){let o=e[r[i]*2],a=e[r[i]*2+1];n.push(this._vertexToIndex(o,a))}return n}_pointArrayToIndices(e){let r=[];for(let n=0;n<e.length;n++){let i=e[n];r.push(this._vertexToIndex(i.x,i.y))}return r}};function xa(t,e,r,n=!0){return new gl(r,e).subdividePolygonInternal(t,n)}l(xa,"subdividePolygon");function tt(t,e,r=!1){if(!t||t.length<1)return[];if(t.length<2)return[];let n=t[0],i=t[t.length-1],o=r&&(n.x!==i.x||n.y!==i.y);if(e<2)return o?[...t,t[0]]:[...t];let a=Math.floor(8192/e),s=[];s.push(new yi.default(t[0].x,t[0].y));let u=t.length,c=o?u:u-1;for(let p=0;p<c;p++){let f=t[p],y=p<u-1?t[p+1]:t[0],m=f.x,h=f.y,d=y.x,x=y.y,b=m!==d,P=h!==x;if(!b&&!P)continue;let v=d-m,S=x-h,_=Math.abs(v),T=Math.abs(S),I=m,F=h;for(;;){let R=v>0?(Math.floor(I/a)+1)*a:(Math.ceil(I/a)-1)*a,z=S>0?(Math.floor(F/a)+1)*a:(Math.ceil(F/a)-1)*a,N=Math.abs(I-R),B=Math.abs(F-z),C=Math.abs(I-d),O=Math.abs(F-x),$=b?N/_:Number.POSITIVE_INFINITY,U=P?B/T:Number.POSITIVE_INFINITY;if((C<=N||!b)&&(O<=B||!P))break;if($<U&&b||!P){I=R,F=F+S*$;let G=new yi.default(I,Math.round(F));(s[s.length-1].x!==G.x||s[s.length-1].y!==G.y)&&s.push(G)}else{I=I+v*U,F=z;let G=new yi.default(Math.round(I),F);(s[s.length-1].x!==G.x||s[s.length-1].y!==G.y)&&s.push(G)}}let D=new yi.default(d,x);(s[s.length-1].x!==D.x||s[s.length-1].y!==D.y)&&s.push(D)}return s}l(tt,"subdivideVertexLine");function ib(t){let e=[],r=[];for(let n of t)if(n.length!==0){n!==t[0]&&e.push(r.length/2);for(let i=0;i<n.length;i++)r.push(n[i].x),r.push(n[i].y)}return{flattened:r,holeIndices:e}}l(ib,"flatten");function ob(t,e){let r=[];for(let n=0;n<e.length;n+=3){let i=e[n],o=e[n+1],a=e[n+2],s=t[i*2],u=t[i*2+1],c=t[o*2],p=t[o*2+1],f=t[a*2],y=t[a*2+1],m=c-s,h=p-u,d=f-s,x=y-u;m*x-h*d>0?(r.push(i),r.push(a),r.push(o)):(r.push(i),r.push(o),r.push(a))}return r}l(ob,"fixWindingOrder");function ab(t,e,r){if(e.length===0)throw new Error("Subdivision vertex ring is empty.");let n=0,i=t[e[0]*2];for(let u=1;u<e.length;u++){let c=t[e[u]*2];c<i&&(i=c,n=u)}let o=e.length,a=n,s=(a+1)%o;for(;;){let u=a-1>=0?a-1:o-1,c=(s+1)%o,p=t[e[u]*2],f=t[e[u]*2+1],y=t[e[c]*2],m=t[e[c]*2+1],h=t[e[a]*2],d=t[e[a]*2+1],x=t[e[s]*2],b=t[e[s]*2+1],P=!1;if(p<y)P=!0;else if(p>y)P=!1;else{let v=x-h,_=b-d,T=-v,I=d<b?1:-1,F=((p-h)*_+(f-d)*T)*I,D=((y-h)*_+(m-d)*T)*I;F>D&&(P=!0)}if(P){let v=e[u],S=e[a],_=e[s];v!==S&&v!==_&&S!==_&&r.push(_,S,v),a--,a<0&&(a=o-1)}else{let v=e[c],S=e[a],_=e[s];v!==S&&v!==_&&S!==_&&r.push(_,S,v),s++,s>=o&&(s=0)}if(u===c)break}}l(ab,"scanlineTriangulateVertexRing");g();function va(t,e,r,n,i,o,a,s,u){let c=i.length/2,p=a&&s&&u;if(c<me.MAX_VERTEX_ARRAY_LENGTH){let f=e.prepareSegment(c,r,n),y=f.vertexLength;for(let d=0;d<o.length;d+=3)n.emplaceBack(y+o[d],y+o[d+1],y+o[d+2]);f.vertexLength+=c,f.primitiveLength+=o.length/3;let m,h;p&&(h=a.prepareSegment(c,r,s),m=h.vertexLength,h.vertexLength+=c);for(let d=0;d<i.length;d+=2)t(i[d],i[d+1]);if(p)for(let d=0;d<u.length;d++){let x=u[d];for(let b=1;b<x.length;b+=2)s.emplaceBack(m+x[b-1],m+x[b]);h.primitiveLength+=x.length/2}}else sb(e,r,n,i,o,t),p&&lb(a,r,s,i,u,t),e.forceNewSegmentOnNextPrepare(),a?.forceNewSegmentOnNextPrepare()}l(va,"fillLargeMeshArrays");function mi(t,e,r,n,i,o,a){if(o){let s=n.count;return r(e[i*2],e[i*2+1]),t[i]=n.count,n.count++,a.vertexLength++,s}else return t[i]}l(mi,"copyOrReuseVertex");function sb(t,e,r,n,i,o){let a=[];for(let f=0;f<n.length/2;f++)a.push(-1);let s={count:0},u=0,c=t.getOrCreateLatestSegment(e,r),p=c.vertexLength;for(let f=2;f<i.length;f+=3){let y=i[f-2],m=i[f-1],h=i[f],d=a[y]<u,x=a[m]<u,b=a[h]<u,P=(d?1:0)+(x?1:0)+(b?1:0);c.vertexLength+P>me.MAX_VERTEX_ARRAY_LENGTH&&(c=t.createNewSegment(e,r),u=s.count,d=!0,x=!0,b=!0,p=0);let v=mi(a,n,o,s,y,d,c),S=mi(a,n,o,s,m,x,c),_=mi(a,n,o,s,h,b,c);r.emplaceBack(p+v-u,p+S-u,p+_-u),c.primitiveLength++}}l(sb,"fillSegmentsTriangles");function lb(t,e,r,n,i,o){let a=[];for(let f=0;f<n.length/2;f++)a.push(-1);let s={count:0},u=0,c=t.getOrCreateLatestSegment(e,r),p=c.vertexLength;for(let f=0;f<i.length;f++){let y=i[f];for(let m=1;m<i[f].length;m+=2){let h=y[m-1],d=y[m],x=a[h]<u,b=a[d]<u,P=(x?1:0)+(b?1:0);c.vertexLength+P>me.MAX_VERTEX_ARRAY_LENGTH&&(c=t.createNewSegment(e,r),u=s.count,x=!0,b=!0,p=0);let v=mi(a,n,o,s,h,x,c),S=mi(a,n,o,s,d,b,c);r.emplaceBack(p+v-u,p+S-u),c.primitiveLength++}}}l(lb,"fillSegmentsLines");var ub=500,fr=class{static{l(this,"FillBucket")}constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Yo,this.indexArray=new Ve,this.indexArray2=new Bt,this.programConfigurations=new Te(e.layers,e.zoom),this.segments=new me,this.segments2=new me,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=Vr("fill",this.layers,r);let i=this.layers[0].layout.get("fill-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:u,index:c,sourceLayerIndex:p}of e){let f=this.layers[0]._featureFilter.needGeometry,y=je(s,f);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),y,n))continue;let m=o?i.evaluate(y,{},n,r.availableImages):void 0,h={id:u,properties:s.properties,type:s.type,sourceLayerIndex:p,index:c,geometry:f?y.geometry:Ce(s),patterns:{},sortKey:m};a.push(h)}o&&a.sort((s,u)=>s.sortKey-u.sortKey);for(let s of a){let{geometry:u,index:c,sourceLayerIndex:p}=s;if(this.hasPattern){let y=Rr("fill",this.layers,s,this.zoom,r);this.patternFeatures.push(y)}else this.addFeature(s,u,c,n,{},r.subdivisionGranularity);let f=e[c].feature;r.featureIndex.insert(f,u,c,p,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}addFeatures(e,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Bp),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,r,n,i,o,a){for(let s of er(r,ub)){let u=xa(s,i,a.fill.getGranularityForZoomLevel(i.z)),c=this.layoutVertexArray;va((p,f)=>{c.emplaceBack(p,f)},this.segments,this.layoutVertexArray,this.indexArray,u.verticesFlattened,u.indicesTriangles,this.segments2,this.indexArray2,u.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}};k("FillBucket",fr,{omit:["layers","patternFeatures"]});g();var Np,cb=l(()=>Np=Np||new ne({"fill-sort-key":new V(A.layout_fill["fill-sort-key"])}),"getLayout"),Up,pb=l(()=>Up=Up||new ne({"fill-antialias":new L(A.paint_fill["fill-antialias"]),"fill-opacity":new V(A.paint_fill["fill-opacity"]),"fill-color":new V(A.paint_fill["fill-color"]),"fill-outline-color":new V(A.paint_fill["fill-outline-color"]),"fill-translate":new L(A.paint_fill["fill-translate"]),"fill-translate-anchor":new L(A.paint_fill["fill-translate-anchor"]),"fill-pattern":new mt(A.paint_fill["fill-pattern"])}),"getPaint"),$p={get paint(){return pb()},get layout(){return cb()}};var Pa=class extends le{static{l(this,"FillStyleLayer")}constructor(e){super(e,$p)}recalculate(e,r){super.recalculate(e,r);let n=this.paint._values["fill-outline-color"];n.value.kind==="constant"&&n.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new fr(e)}queryRadius(){return Rt(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:r,transform:n,pixelsToTileUnits:i}){let o=zt(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-n.bearingInRadians,i);return ca(o,r)}isTileClipped(){return!0}};g();g();g();var fb=re([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),jp=re([{name:"a_centroid",components:2,type:"Int16"}],4);var{members:qp,size:t_,alignment:r_}=fb;var Kp=ee(Gt(),1);var Ab=Kp.default.VectorTileFeature.types,_b=500,vl=Math.pow(2,13);function hi(t,e,r,n,i,o,a,s){t.emplaceBack(e,r,Math.floor(n*vl)*2+a,i*vl*2,o*vl*2,Math.round(s))}l(hi,"addVertex");var yr=class{static{l(this,"FillExtrusionBucket")}constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ko,this.centroidVertexArray=new Zo,this.indexArray=new Ve,this.programConfigurations=new Te(e.layers,e.zoom),this.segments=new me,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.features=[],this.hasPattern=Vr("fill-extrusion",this.layers,r);for(let{feature:i,id:o,index:a,sourceLayerIndex:s}of e){let u=this.layers[0]._featureFilter.needGeometry,c=je(i,u);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),c,n))continue;let p={id:o,sourceLayerIndex:s,index:a,geometry:u?c.geometry:Ce(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(Rr("fill-extrusion",this.layers,p,this.zoom,r)):this.addFeature(p,p.geometry,a,n,{},r.subdivisionGranularity),r.featureIndex.insert(i,p.geometry,a,s,this.index,!0)}}addFeatures(e,r,n){for(let i of this.features){let{geometry:o}=i;this.addFeature(i,o,i.index,r,n,e.subdivisionGranularity)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,qp),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,jp.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,r,n,i,o,a){for(let s of er(r,_b)){let u={x:0,y:0,sampleCount:0},c=this.layoutVertexArray.length;this.processPolygon(u,i,e,s,a);let p=this.layoutVertexArray.length-c,f=Math.floor(u.x/u.sampleCount),y=Math.floor(u.y/u.sampleCount);for(let m=0;m<p;m++)this.centroidVertexArray.emplaceBack(f,y)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}processPolygon(e,r,n,i,o){if(i.length<1||Yp(i[0]))return;for(let f of i)f.length!==0&&Ib(e,f);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=o.fill.getGranularityForZoomLevel(r.z),u=Ab[n.type]==="Polygon";for(let f of i){if(f.length===0||Yp(f))continue;let y=tt(f,s,u);this._generateSideFaces(y,a)}if(!u)return;let c=xa(i,r,s,!1),p=this.layoutVertexArray;va((f,y)=>{hi(p,f,y,0,0,1,1,0)},this.segments,this.layoutVertexArray,this.indexArray,c.verticesFlattened,c.indicesTriangles)}_generateSideFaces(e,r){let n=0;for(let i=1;i<e.length;i++){let o=e[i],a=e[i-1];if(Tb(o,a))continue;r.segment.vertexLength+4>me.MAX_VERTEX_ARRAY_LENGTH&&(r.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=o.sub(a)._perp()._unit(),u=a.dist(o);n+u>32768&&(n=0),hi(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,0,n),hi(this.layoutVertexArray,o.x,o.y,s.x,s.y,0,1,n),n+=u,hi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,n),hi(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,n);let c=r.segment.vertexLength;this.indexArray.emplaceBack(c,c+2,c+1),this.indexArray.emplaceBack(c+1,c+2,c+3),r.segment.vertexLength+=4,r.segment.primitiveLength+=2}}};function Ib(t,e){for(let r=0;r<e.length;r++){let n=e[r];r===e.length-1&&e[0].x===n.x&&e[0].y===n.y||(t.x+=n.x,t.y+=n.y,t.sampleCount++)}}l(Ib,"accumulatePointsToCentroid");k("FillExtrusionBucket",yr,{omit:["layers","features"]});function Tb(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}l(Tb,"isBoundaryEdge");function Yp(t){return t.every(e=>e.x<0)||t.every(e=>e.x>8192)||t.every(e=>e.y<0)||t.every(e=>e.y>8192)}l(Yp,"isEntirelyOutside");g();var Qp,Cb=l(()=>Qp=Qp||new ne({"fill-extrusion-opacity":new L(A["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new V(A["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new L(A["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new L(A["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new mt(A["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new V(A["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new V(A["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new L(A["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])}),"getPaint"),ef={get paint(){return Cb()}};var wa=ee(de(),1);var Aa=class extends le{static{l(this,"FillExtrusionStyleLayer")}constructor(e){super(e,ef)}createBucket(e){return new yr(e)}queryRadius(){return Rt(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a,pixelPosMatrix:s}){let u=zt(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-o.bearingInRadians,a),c=this.paint.get("fill-extrusion-height").evaluate(r,n),p=this.paint.get("fill-extrusion-base").evaluate(r,n),f=Eb(u,s,0),y=Fb(i,p,c,s),m=y[0],h=y[1];return kb(m,h,f)}};function di(t,e){return t.x*e.x+t.y*e.y}l(di,"dot");function tf(t,e){if(t.length===1){let r=0,n=e[r++],i;for(;!i||n.equals(i);)if(i=e[r++],!i)return 1/0;for(;r<e.length;r++){let o=e[r],a=t[0],s=i.sub(n),u=o.sub(n),c=a.sub(n),p=di(s,s),f=di(s,u),y=di(u,u),m=di(c,s),h=di(c,u),d=p*y-f*f,x=(y*m-f*h)/d,b=(p*h-f*m)/d,P=1-x-b,v=n.z*P+i.z*x+o.z*b;if(isFinite(v))return v}return 1/0}else{let r=1/0;for(let n of e)r=Math.min(r,n.z);return r}}l(tf,"getIntersectionDistance");function kb(t,e,r){let n=1/0;ca(r,e)&&(n=tf(r,e[0]));for(let i=0;i<e.length;i++){let o=e[i],a=t[i];for(let s=0;s<o.length-1;s++){let u=o[s],c=o[s+1],p=a[s],f=a[s+1],y=[u,c,f,p,u];dp(r,y)&&(n=Math.min(n,tf(r,y)))}}return n===1/0?!1:n}l(kb,"checkIntersection");function Fb(t,e,r,n){let i=[],o=[],a=n[8]*e,s=n[9]*e,u=n[10]*e,c=n[11]*e,p=n[8]*r,f=n[9]*r,y=n[10]*r,m=n[11]*r;for(let h of t){let d=[],x=[];for(let b of h){let P=b.x,v=b.y,S=n[0]*P+n[4]*v+n[12],_=n[1]*P+n[5]*v+n[13],T=n[2]*P+n[6]*v+n[14],I=n[3]*P+n[7]*v+n[15],F=S+a,D=_+s,R=T+u,z=I+c,N=S+p,B=_+f,C=T+y,O=I+m,$=new wa.default(F/z,D/z);$.z=R/z,d.push($);let U=new wa.default(N/O,B/O);U.z=C/O,x.push(U)}i.push(d),o.push(x)}return[i,o]}l(Fb,"projectExtrusion");function Eb(t,e,r){let n=[];for(let i of t){let o=[i.x,i.y,r,1];Ji.transformMat4(o,o,e),n.push(new wa.default(o[0]/o[3],o[1]/o[3]))}return n}l(Eb,"projectQueryGeometry");g();g();g();var Mb=re([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:rf,size:K_,alignment:Q_}=Mb;g();var Lb=re([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:nf,size:n2,alignment:i2}=Lb;var sf=ee(Gt(),1);var Db=sf.default.VectorTileFeature.types,of=63,Bb=Math.cos(75/2*(Math.PI/180)),Vb=15,Rb=20,zb=15,lf=1/2,af=Math.pow(2,zb-1)/lf,mr=class{static{l(this,"LineBucket")}constructor(e){this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(r=>r.id),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(r=>{this.gradients[r.id]={}}),this.layoutVertexArray=new Qo,this.layoutVertexArray2=new ea,this.indexArray=new Ve,this.programConfigurations=new Te(e.layers,e.zoom),this.segments=new me,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(r=>r.isStateDependent()).map(r=>r.id)}populate(e,r,n){this.hasPattern=Vr("line",this.layers,r);let i=this.layers[0].layout.get("line-sort-key"),o=!i.isConstant(),a=[];for(let{feature:s,id:u,index:c,sourceLayerIndex:p}of e){let f=this.layers[0]._featureFilter.needGeometry,y=je(s,f);if(!this.layers[0]._featureFilter.filter(new Z(this.zoom,{globalState:this.globalState}),y,n))continue;let m=o?i.evaluate(y,{},n):void 0,h={id:u,properties:s.properties,type:s.type,sourceLayerIndex:p,index:c,geometry:f?y.geometry:Ce(s),patterns:{},sortKey:m};a.push(h)}o&&a.sort((s,u)=>s.sortKey-u.sortKey);for(let s of a){let{geometry:u,index:c,sourceLayerIndex:p}=s;if(this.hasPattern){let y=Rr("line",this.layers,s,this.zoom,r);this.patternFeatures.push(y)}else this.addFeature(s,u,c,n,{},r.subdivisionGranularity);let f=e[c].feature;r.featureIndex.insert(f,u,c,p,this.index)}}update(e,r,n){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,r,this.stateDependentLayers,n)}addFeatures(e,r,n){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,r,n,e.subdivisionGranularity)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,nf)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,rf),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end")){let r=+e.properties.mapbox_clip_start,n=+e.properties.mapbox_clip_end;return{start:r,end:n}}}addFeature(e,r,n,i,o,a){let s=this.layers[0].layout,u=s.get("line-join").evaluate(e,{}),c=s.get("line-cap"),p=s.get("line-miter-limit"),f=s.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let y of r)this.addLine(y,e,u,c,p,f,i,a);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,n,o,i)}addLine(e,r,n,i,o,a,s,u){this.distance=0,this.scaledDistance=0,this.totalDistance=0;let c=s?u.line.getGranularityForZoomLevel(s.z):1;if(e=tt(e,c),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let S=0;S<e.length-1;S++)this.totalDistance+=e[S].dist(e[S+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let p=Db[r.type]==="Polygon",f=e.length;for(;f>=2&&e[f-1].equals(e[f-2]);)f--;let y=0;for(;y<f-1&&e[y].equals(e[y+1]);)y++;if(f<(p?3:2))return;n==="bevel"&&(o=1.05);let m=this.overscaling<=16?Vb*8192/(512*this.overscaling):0,h=this.segments.prepareSegment(f*10,this.layoutVertexArray,this.indexArray),d,x,b,P,v;this.e1=this.e2=-1,p&&(d=e[f-2],v=e[y].sub(d)._unit()._perp());for(let S=y;S<f;S++){if(b=S===f-1?p?e[y+1]:void 0:e[S+1],b&&e[S].equals(b))continue;v&&(P=v),d&&(x=d),d=e[S],v=b?b.sub(d)._unit()._perp():P,P=P||v;let _=P.add(v);(_.x!==0||_.y!==0)&&_._unit();let T=P.x*v.x+P.y*v.y,I=_.x*v.x+_.y*v.y,F=I!==0?1/I:1/0,D=2*Math.sqrt(2-2*I),R=I<Bb&&x&&b,z=P.x*v.y-P.y*v.x>0;if(R&&S>y){let C=d.dist(x);if(C>2*m){let O=d.sub(d.sub(x)._mult(m/C)._round());this.updateDistance(x,O),this.addCurrentVertex(O,P,0,0,h),x=O}}let N=x&&b,B=N?n:p?"butt":i;if(N&&B==="round"&&(F<a?B="miter":F<=2&&(B="fakeround")),B==="miter"&&F>o&&(B="bevel"),B==="bevel"&&(F>2&&(B="flipbevel"),F<o&&(B="miter")),x&&this.updateDistance(x,d),B==="miter")_._mult(F),this.addCurrentVertex(d,_,0,0,h);else if(B==="flipbevel"){if(F>100)_=v.mult(-1);else{let C=F*P.add(v).mag()/P.sub(v).mag();_._perp()._mult(C*(z?-1:1))}this.addCurrentVertex(d,_,0,0,h),this.addCurrentVertex(d,_.mult(-1),0,0,h)}else if(B==="bevel"||B==="fakeround"){let C=-Math.sqrt(F*F-1),O=z?C:0,$=z?0:C;if(x&&this.addCurrentVertex(d,P,O,$,h),B==="fakeround"){let U=Math.round(D*180/Math.PI/Rb);for(let G=1;G<U;G++){let te=G/U;if(te!==.5){let oe=te-.5,ge=1.0904+T*(-3.2452+T*(3.55645-T*1.43519)),qt=.848013+T*(-1.06021+T*.215638);te=te+te*oe*(te-1)*(ge*oe*oe+qt)}let J=v.sub(P)._mult(te)._add(P)._unit()._mult(z?-1:1);this.addHalfVertex(d,J.x,J.y,!1,z,0,h)}}b&&this.addCurrentVertex(d,v,-O,-$,h)}else if(B==="butt")this.addCurrentVertex(d,_,0,0,h);else if(B==="square"){let C=x?1:-1;this.addCurrentVertex(d,_,C,C,h)}else B==="round"&&(x&&(this.addCurrentVertex(d,P,0,0,h),this.addCurrentVertex(d,P,1,1,h,!0)),b&&(this.addCurrentVertex(d,v,-1,-1,h,!0),this.addCurrentVertex(d,v,0,0,h)));if(R&&S<f-1){let C=d.dist(b);if(C>2*m){let O=d.add(b.sub(d)._mult(m/C)._round());this.updateDistance(d,O),this.addCurrentVertex(O,v,0,0,h),d=O}}}}addCurrentVertex(e,r,n,i,o,a=!1){let s=r.x+r.y*n,u=r.y-r.x*n,c=-r.x+r.y*i,p=-r.y-r.x*i;this.addHalfVertex(e,s,u,a,!1,n,o),this.addHalfVertex(e,c,p,a,!0,-i,o),this.distance>af/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,r,n,i,o,a))}addHalfVertex({x:e,y:r},n,i,o,a,s,u){let p=(this.lineClips?this.scaledDistance*(af-1):this.scaledDistance)*lf;if(this.layoutVertexArray.emplaceBack((e<<1)+(o?1:0),(r<<1)+(a?1:0),Math.round(of*n)+128,Math.round(of*i)+128,(s===0?0:s<0?-1:1)+1|(p&63)<<2,p>>6),this.lineClips){let y=this.scaledDistance-this.lineClips.start,m=this.lineClips.end-this.lineClips.start,h=y/m;this.layoutVertexArray2.emplaceBack(h,this.lineClipsArray.length)}let f=u.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,f,this.e2),u.primitiveLength++),a?this.e2=f:this.e1=f}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,r){this.distance+=e.dist(r),this.updateScaledDistance()}};k("LineBucket",mr,{omit:["layers","patternFeatures"]});g();var uf,Ob=l(()=>uf=uf||new ne({"line-cap":new L(A.layout_line["line-cap"]),"line-join":new V(A.layout_line["line-join"]),"line-miter-limit":new L(A.layout_line["line-miter-limit"]),"line-round-limit":new L(A.layout_line["line-round-limit"]),"line-sort-key":new V(A.layout_line["line-sort-key"])}),"getLayout"),cf,Gb=l(()=>cf=cf||new ne({"line-opacity":new V(A.paint_line["line-opacity"]),"line-color":new V(A.paint_line["line-color"]),"line-translate":new L(A.paint_line["line-translate"]),"line-translate-anchor":new L(A.paint_line["line-translate-anchor"]),"line-width":new V(A.paint_line["line-width"]),"line-gap-width":new V(A.paint_line["line-gap-width"]),"line-offset":new V(A.paint_line["line-offset"]),"line-blur":new V(A.paint_line["line-blur"]),"line-dasharray":new ir(A.paint_line["line-dasharray"]),"line-pattern":new mt(A.paint_line["line-pattern"]),"line-gradient":new ht(A.paint_line["line-gradient"])}),"getPaint"),Pl={get paint(){return Gb()},get layout(){return Ob()}};var Sl=class extends V{static{l(this,"LineFloorwidthProperty")}possiblyEvaluate(e,r){return r=new Z(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),super.possiblyEvaluate(e,r)}evaluate(e,r,n,i){return r=xe({},r,{zoom:Math.floor(r.zoom)}),super.evaluate(e,r,n,i)}},_a;var Ia=class extends le{static{l(this,"LineStyleLayer")}constructor(e){super(e,Pl),this.gradientVersion=0,_a||(_a=new Sl(Pl.paint.properties["line-width"].specification),_a.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if(e==="line-gradient"){let r=this.gradientExpression();mc(r)?this.stepInterpolant=r._styleExpression.expression instanceof Ar:this.stepInterpolant=!1,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,r){super.recalculate(e,r),this.paint._values["line-floorwidth"]=_a.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new mr(e)}queryRadius(e){let r=e,n=pf(ur("line-width",this,r),ur("line-gap-width",this,r)),i=ur("line-offset",this,r);return n/2+Math.abs(i)+Rt(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:r,featureState:n,geometry:i,transform:o,pixelsToTileUnits:a}){let s=zt(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-o.bearingInRadians,a),u=a/2*pf(this.paint.get("line-width").evaluate(r,n),this.paint.get("line-gap-width").evaluate(r,n)),c=this.paint.get("line-offset").evaluate(r,n);return c&&(i=vp(i,c*a)),bp(s,i,u)}isTileClipped(){return!0}};function pf(t,e){return e>0?e+2*t:t}l(pf,"getLineWidth");g();g();g();var ff=re([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),yf=re([{name:"a_projected_pos",components:3,type:"Float32"}],4),$2=re([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),mf=re([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]),j2=re([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),wl=re([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),q2=re([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),W2=re([{name:"triangle",components:3,type:"Uint16"}]),X2=re([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),H2=re([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Z2=re([{type:"Float32",name:"offsetX"}]),J2=re([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Y2=re([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);var wi=ee(de(),1);g();function Nb(t,e,r){let n=e.layout.get("text-transform").evaluate(r,{});return n==="uppercase"?t=t.toLocaleUpperCase():n==="lowercase"&&(t=t.toLocaleLowerCase()),Ie.applyArabicShaping&&(t=Ie.applyArabicShaping(t)),t}l(Nb,"transformTextInternal");function hf(t,e,r){return t.sections.forEach(n=>{n.text=Nb(n.text,e,r)}),t}l(hf,"transformText");g();function df(t){let e={},r={},n=[],i=0;function o(c){n.push(t[c]),i++}l(o,"add");function a(c,p,f){let y=r[c];return delete r[c],r[p]=y,n[y].geometry[0].pop(),n[y].geometry[0]=n[y].geometry[0].concat(f[0]),y}l(a,"mergeFromRight");function s(c,p,f){let y=e[p];return delete e[p],e[c]=y,n[y].geometry[0].shift(),n[y].geometry[0]=f[0].concat(n[y].geometry[0]),y}l(s,"mergeFromLeft");function u(c,p,f){let y=f?p[0][p[0].length-1]:p[0][0];return`${c}:${y.x}:${y.y}`}l(u,"getKey");for(let c=0;c<t.length;c++){let p=t[c],f=p.geometry,y=p.text?p.text.toString():null;if(!y){o(c);continue}let m=u(y,f),h=u(y,f,!0);if(m in r&&h in e&&r[m]!==e[h]){let d=s(m,h,f),x=a(m,h,n[d].geometry);delete e[m],delete r[h],r[u(y,n[x].geometry,!0)]=x,n[d].geometry=null}else m in r?a(m,h,f):h in e?s(m,h,f):(o(c),e[m]=i-1,r[h]=i-1)}return n.filter(c=>c.geometry)}l(df,"mergeLines");g();g();var Nr={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"};function gf(t){let e="";for(let r=0;r<t.length;r++){let n=t.charCodeAt(r+1)||null,i=t.charCodeAt(r-1)||null;(!n||!Qs(n)||Nr[t[r+1]])&&(!i||!Qs(i)||Nr[t[r-1]])&&Nr[t[r]]?e+=Nr[t[r]]:e+=t[r]}return e}l(gf,"verticalizePunctuation");g();var ue=24;g();var ox=ee(gi(),1);var ax=3;var ka=ax;g();g();g();function bi(t){let e=0,r=0;for(let s of t)e+=s.w*s.h,r=Math.max(r,s.w);t.sort((s,u)=>u.h-s.h);let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],o=0,a=0;for(let s of t)for(let u=i.length-1;u>=0;u--){let c=i[u];if(!(s.w>c.w||s.h>c.h)){if(s.x=c.x,s.y=c.y,a=Math.max(a,s.y+s.h),o=Math.max(o,s.x+s.w),s.w===c.w&&s.h===c.h){let p=i.pop();u<i.length&&(i[u]=p)}else s.h===c.h?(c.x+=s.w,c.w-=s.w):s.w===c.w?(c.y+=s.h,c.h-=s.h):(i.push({x:c.x+s.w,y:c.y,w:c.w-s.w,h:s.h}),c.y+=s.h,c.h-=s.h);break}}return{w:o,h:a,fill:e/(o*a)||0}}l(bi,"potpack");var be=1;var Fa=class{static{l(this,"ImagePosition")}constructor(e,{pixelRatio:r,version:n,stretchX:i,stretchY:o,content:a,textFitWidth:s,textFitHeight:u}){this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=o,this.content=a,this.version=n,this.textFitWidth=s,this.textFitHeight=u}get tl(){return[this.paddedRect.x+be,this.paddedRect.y+be]}get br(){return[this.paddedRect.x+this.paddedRect.w-be,this.paddedRect.y+this.paddedRect.h-be]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-be*2)/this.pixelRatio,(this.paddedRect.h-be*2)/this.pixelRatio]}},xi=class{static{l(this,"ImageAtlas")}constructor(e,r){let n={},i={};this.haveRenderCallbacks=[];let o=[];this.addImages(e,n,o),this.addImages(r,i,o);let{w:a,h:s}=bi(o),u=new he({width:a||1,height:s||1});for(let c in e){let p=e[c],f=n[c].paddedRect;he.copy(p.data,u,{x:0,y:0},{x:f.x+be,y:f.y+be},p.data)}for(let c in r){let p=r[c],f=i[c].paddedRect,y=f.x+be,m=f.y+be,h=p.data.width,d=p.data.height;he.copy(p.data,u,{x:0,y:0},{x:y,y:m},p.data),he.copy(p.data,u,{x:0,y:d-1},{x:y,y:m-1},{width:h,height:1}),he.copy(p.data,u,{x:0,y:0},{x:y,y:m+d},{width:h,height:1}),he.copy(p.data,u,{x:h-1,y:0},{x:y-1,y:m},{width:1,height:d}),he.copy(p.data,u,{x:0,y:0},{x:y+h,y:m},{width:1,height:d})}this.image=u,this.iconPositions=n,this.patternPositions=i}addImages(e,r,n){for(let i in e){let o=e[i],a={x:0,y:0,w:o.data.width+2*be,h:o.data.height+2*be};n.push(a),r[i]=new Fa(a,o),o.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,r){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let n in e.updatedImages)this.patchUpdatedImage(this.iconPositions[n],e.getImage(n),r),this.patchUpdatedImage(this.patternPositions[n],e.getImage(n),r)}patchUpdatedImage(e,r,n){if(!e||!r||e.version===r.version)return;e.version=r.version;let[i,o]=e.tl;n.update(r.data,void 0,{x:i,y:o})}};k("ImagePosition",Fa);k("ImageAtlas",xi);var La=(i=>(i[i.none=0]="none",i[i.horizontal=1]="horizontal",i[i.vertical=2]="vertical",i[i.horizontalOnly=3]="horizontalOnly",i))(La||{}),Pi=-17;function sx(t){for(let e of t)if(e.positionedGlyphs.length!==0)return!1;return!0}l(sx,"isEmpty");var Af=57344,_f=63743,Ea=class t{static{l(this,"SectionOptions")}constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(e,r,n){let i=new t;return i.scale=e||1,i.fontStack=r,i.verticalAlign=n||"bottom",i}static forImage(e,r){let n=new t;return n.imageName=e,n.verticalAlign=r||"bottom",n}},vi=class t{static{l(this,"TaggedString")}constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,r){let n=new t;for(let i=0;i<e.sections.length;i++){let o=e.sections[i];o.image?n.addImageSection(o):n.addTextSection(o,r)}return n}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=gf(this.text)}trim(){let e=0;for(let n=0;n<this.text.length&&Ma[this.text.charCodeAt(n)];n++)e++;let r=this.text.length;for(let n=this.text.length-1;n>=0&&n>=e&&Ma[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)}substring(e,r){let n=new t;return n.text=this.text.substring(e,r),n.sectionIndex=this.sectionIndex.slice(e,r),n.sections=this.sections,n}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((e,r)=>Math.max(e,this.sections[r].scale),0)}getMaxImageSize(e){let r=0,n=0;for(let i=0;i<this.length();i++){let o=this.getSection(i);if(o.imageName){let a=e[o.imageName];if(!a)continue;let s=a.displaySize;r=Math.max(r,s[0]),n=Math.max(n,s[1])}}return{maxImageWidth:r,maxImageHeight:n}}addTextSection(e,r){this.text+=e.text,this.sections.push(Ea.forText(e.scale,e.fontStack||r,e.verticalAlign));let n=this.sections.length-1;for(let i=0;i<e.text.length;++i)this.sectionIndex.push(n)}addImageSection(e){let r=e.image?e.image.name:"";if(r.length===0){ye("Can't add FormattedSection with an empty image.");return}let n=this.getNextImageSectionCharCode();if(!n){ye(`Reached maximum number of images ${_f-Af+2}`);return}this.text+=String.fromCharCode(n),this.sections.push(Ea.forImage(r,e.verticalAlign)),this.sectionIndex.push(this.sections.length-1)}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=_f?null:++this.imageSectionID:(this.imageSectionID=Af,this.imageSectionID)}};function lx(t,e){let r=[],n=t.text,i=0;for(let o of e)r.push(t.substring(i,o)),i=o;return i<n.length&&r.push(t.substring(i,n.length)),r}l(lx,"breakLines");function Si(t,e,r,n,i,o,a,s,u,c,p,f,y,m,h){let d=vi.fromFeature(t,i);f===2&&d.verticalizePunctuation();let x,{processBidirectionalText:b,processStyledBidirectionalText:P}=Ie;if(b&&d.sections.length===1){x=[];let _=b(d.toString(),Il(d,c,o,e,n,m));for(let T of _){let I=new vi;I.text=T,I.sections=d.sections;for(let F=0;F<T.length;F++)I.sectionIndex.push(0);x.push(I)}}else if(P){x=[];let _=P(d.text,d.sectionIndex,Il(d,c,o,e,n,m));for(let T of _){let I=new vi;I.text=T[0],I.sectionIndex=T[1],I.sections=d.sections,x.push(I)}}else x=lx(d,Il(d,c,o,e,n,m));let v=[],S={positionedLines:v,text:d.toString(),top:p[1],bottom:p[1],left:p[0],right:p[0],writingMode:f,iconsInText:!1,verticalizable:!1};return dx(S,e,r,n,x,a,s,u,f,c,y,h),sx(v)?!1:S}l(Si,"shapeText");var Ma={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ux={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},cx={40:!0};function Cf(t,e,r,n,i,o){if(e.imageName){let a=n[e.imageName];return a?a.displaySize[0]*e.scale*ue/o+i:0}else{let a=r[e.fontStack],s=a&&a[t];return s?s.metrics.advance*e.scale+i:0}}l(Cf,"getGlyphAdvance");function px(t,e,r,n,i,o){let a=0;for(let u=0;u<t.length();u++){let c=t.getSection(u);a+=Cf(t.getCharCode(u),c,n,i,e,o)}let s=Math.max(1,Math.ceil(a/r));return a/s}l(px,"determineAverageLineWidth");function If(t,e,r,n){let i=Math.pow(t-e,2);return n?t<e?i/2:i*2:i+Math.abs(r)*r}l(If,"calculateBadness");function fx(t,e,r){let n=0;return t===10&&(n-=1e4),r&&(n+=150),(t===40||t===65288)&&(n+=50),(e===41||e===65289)&&(n+=50),n}l(fx,"calculatePenalty");function Tf(t,e,r,n,i,o){let a=null,s=If(e,r,i,o);for(let u of n){let c=e-u.x,p=If(c,r,i,o)+u.badness;p<=s&&(a=u,s=p)}return{index:t,x:e,priorBreak:a,badness:s}}l(Tf,"evaluateBreak");function kf(t){return t?kf(t.priorBreak).concat(t.index):[]}l(kf,"leastBadBreaks");function Il(t,e,r,n,i,o){if(!t)return[];let a=[],s=px(t,e,r,n,i,o),u=t.text.indexOf("\u200B")>=0,c=0;for(let p=0;p<t.length();p++){let f=t.getSection(p),y=t.getCharCode(p);if(Ma[y]||(c+=Cf(y,f,n,i,e,o)),p<t.length()-1){let m=Qc(y);(ux[y]||m||f.imageName||p!==t.length()-2&&cx[t.getCharCode(p+1)])&&a.push(Tf(p+1,c,s,a,fx(y,t.getCharCode(p+1),m&&u),!1))}}return kf(Tf(t.length(),c,s,a,0,!0))}l(Il,"determineLineBreaks");function Ff(t){let e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0;break}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0;break}return{horizontalAlign:e,verticalAlign:r}}l(Ff,"getAnchorAlignment");function yx(t,e,r){let n=e.getMaxScale()*ue,{maxImageWidth:i,maxImageHeight:o}=e.getMaxImageSize(t),a=Math.max(n,o*r);return{verticalLineContentWidth:Math.max(n,i*r),horizontalLineContentHeight:a}}l(yx,"calculateLineContentSize");function Ef(t){switch(t){case"top":return 0;case"center":return .5;default:return 1}}l(Ef,"getVerticalAlignFactor");function mx(t,e,r,n){if(t&&t.rect)return t;let i=e[r.fontStack],o=i&&i[n];return o?{rect:null,metrics:o.metrics}:null}l(mx,"getRectAndMetrics");function hx(t,e,r){return!(t===1||!e&&!Bo(r)||e&&(Ma[r]||ep(r)))}l(hx,"isLineVertical");function dx(t,e,r,n,i,o,a,s,u,c,p,f){let y=0,m=0,h=0,d=0,x=s==="right"?1:s==="left"?0:.5,b=ue/f,P=0;for(let _ of i){_.trim();let T=_.getMaxScale(),I={positionedGlyphs:[],lineOffset:0};t.positionedLines[P]=I;let F=I.positionedGlyphs,D=0;if(!_.length()){m+=o,++P;continue}let R=yx(n,_,b);for(let B=0;B<_.length();B++){let C=_.getSection(B),O=_.getSectionIndex(B),$=_.getCharCode(B),U=hx(u,p,$),G;if(C.imageName){if(t.iconsInText=!0,C.scale=C.scale*b,G=bx(C,U,T,R,n),!G)continue;D=Math.max(D,G.imageOffset)}else if(G=gx(C,$,U,R,e,r),!G)continue;let{rect:te,metrics:J,baselineOffset:oe}=G;if(F.push({glyph:$,imageName:C.imageName,x:y,y:m+oe+Pi,vertical:U,scale:C.scale,fontStack:C.fontStack,sectionIndex:O,metrics:J,rect:te}),!U)y+=J.advance*C.scale+c;else{t.verticalizable=!0;let ge=C.imageName?J.advance:ue;y+=ge*C.scale+c}}if(F.length!==0){let B=y-c;h=Math.max(B,h),xx(F,0,F.length-1,x)}y=0;let z=(T-1)*ue;I.lineOffset=Math.max(D,z);let N=o*T+D;m+=N,d=Math.max(N,d),++P}let{horizontalAlign:v,verticalAlign:S}=Ff(a);vx(t.positionedLines,x,v,S,h,d,o,m,i.length),t.top+=-S*m,t.bottom=t.top+m,t.left+=-v*h,t.right=t.left+h}l(dx,"shapeLines");function gx(t,e,r,n,i,o){let a=o[t.fontStack],s=a&&a[e],u=mx(s,i,t,e);if(u===null)return null;let c;if(r)c=n.verticalLineContentWidth-t.scale*ue;else{let p=Ef(t.verticalAlign);c=(n.horizontalLineContentHeight-t.scale*ue)*p}return{rect:u.rect,metrics:u.metrics,baselineOffset:c}}l(gx,"shapeTextSection");function bx(t,e,r,n,i){let o=i[t.imageName];if(!o)return null;let a=o.paddedRect,s=o.displaySize,u={width:s[0],height:s[1],left:be,top:-ka,advance:e?s[1]:s[0]},c;if(e)c=n.verticalLineContentWidth-s[1]*t.scale;else{let f=Ef(t.verticalAlign);c=(n.horizontalLineContentHeight-s[1]*t.scale)*f}let p=(e?s[0]:s[1])*t.scale-ue*r;return{rect:a,metrics:u,baselineOffset:c,imageOffset:p}}l(bx,"shapeImageSection");function xx(t,e,r,n){if(n===0)return;let i=t[r],o=i.metrics.advance*i.scale,a=(t[r].x+o)*n;for(let s=e;s<=r;s++)t[s].x-=a}l(xx,"justifyLine");function vx(t,e,r,n,i,o,a,s,u){let c=(e-r)*i,p=0;o!==a?p=-s*n-Pi:p=-n*u*a+.5*a;for(let f of t)for(let y of f.positionedGlyphs)y.x+=c,y.y+=p}l(vx,"align");function Mf(t,e,r){let{horizontalAlign:n,verticalAlign:i}=Ff(r),o=e[0],a=e[1],s=o-t.displaySize[0]*n,u=s+t.displaySize[0],c=a-t.displaySize[1]*i,p=c+t.displaySize[1];return{image:t,top:c,bottom:p,left:s,right:u}}l(Mf,"shapeIcon");function Da(t){let e=t.left,r=t.top,n=t.right-e,i=t.bottom-r,o=t.image.content[2]-t.image.content[0],a=t.image.content[3]-t.image.content[1],s=t.image.textFitWidth??"stretchOrShrink",u=t.image.textFitHeight??"stretchOrShrink",c=o/a;if(u==="proportional"){if(s==="stretchOnly"&&n/i<c||s==="proportional"){let p=Math.ceil(i*c);e*=p/n,n=p}}else if(s==="proportional"&&u==="stretchOnly"&&c!==0&&n/i>c){let p=Math.ceil(n/c);r*=p/i,i=p}return{x1:e,y1:r,x2:e+n,y2:r+i}}l(Da,"applyTextFit");function Tl(t,e,r,n,i,o){let a=t.image,s;if(a.content){let x=a.content,b=a.pixelRatio||1;s=[x[0]/b,x[1]/b,a.displaySize[0]-x[2]/b,a.displaySize[1]-x[3]/b]}let u=e.left*o,c=e.right*o,p,f,y,m;r==="width"||r==="both"?(m=i[0]+u-n[3],f=i[0]+c+n[1]):(m=i[0]+(u+c-a.displaySize[0])/2,f=m+a.displaySize[0]);let h=e.top*o,d=e.bottom*o;return r==="height"||r==="both"?(p=i[1]+h-n[0],y=i[1]+d+n[2]):(p=i[1]+(h+d-a.displaySize[1])/2,y=p+a.displaySize[1]),{image:a,top:p,right:f,bottom:y,left:m,collisionPadding:s}}l(Tl,"fitIconToText");var Lf=ee(Gt(),1);g();var jr=255,Nt=128,rt=jr*Nt;function Cl(t,e){let{expression:r}=e;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new Z(t+1))};if(r.kind==="source")return{kind:"source"};{let{zoomStops:n,interpolationType:i}=r,o=0;for(;o<n.length&&n[o]<=t;)o++;o=Math.max(0,o-1);let a=o;for(;a<n.length&&n[a]<t+1;)a++;a=Math.min(n.length-1,a);let s=n[o],u=n[a];if(r.kind==="composite")return{kind:"composite",minZoom:s,maxZoom:u,interpolationType:i};let c=r.evaluate(new Z(s)),p=r.evaluate(new Z(u));return{kind:"camera",minZoom:s,maxZoom:u,minSize:c,maxSize:p,interpolationType:i}}}l(Cl,"getSizeData");g();function kl(t,e,r){let n="never",i=t.get(e);return i?n=i:t.get(r)&&(n="always"),n}l(kl,"getOverlapMode");var Px=Lf.default.VectorTileFeature.types,Sx=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ba(t,e,r,n,i,o,a,s,u,c,p,f,y){let m=s?Math.min(rt,Math.round(s[0])):0,h=s?Math.min(rt,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(n*32),Math.round(i*32),o,a,(m<<1)+(u?1:0),h,c*16,p*16,f*256,y*256)}l(Ba,"addVertex");function Df(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}l(Df,"addDynamicAttributes");function wx(t){for(let e of t.sections)if(rp(e.text))return!0;return!1}l(wx,"containsRTLText");var Ai=class{static{l(this,"SymbolBuffers")}constructor(e){this.layoutVertexArray=new ta,this.indexArray=new Ve,this.programConfigurations=e,this.segments=new me,this.dynamicLayoutVertexArray=new ra,this.opacityVertexArray=new na,this.hasVisibleVertices=!1,this.placedSymbolArray=new Hn}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(e,r,n,i){this.isEmpty()||(n&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ff.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,r),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,yf.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Sx,!0),this.opacityVertexBuffer.itemSize=1),(n||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};k("SymbolBuffers",Ai);var _i=class{static{l(this,"CollisionBuffers")}constructor(e,r,n){this.layoutVertexArray=new e,this.layoutAttributes=r,this.indexArray=new n,this.segments=new me,this.collisionVertexArray=new ia}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,mf.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};k("CollisionBuffers",_i);var Je=class{static{l(this,"SymbolBucket")}constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.globalState=e.globalState,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(u=>u.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Cl(this.zoom,n["text-size"]),this.iconSizeData=Cl(this.zoom,n["icon-size"]);let i=this.layers[0].layout,o=i.get("symbol-sort-key"),a=i.get("symbol-z-order");this.canOverlap=kl(i,"text-overlap","text-allow-overlap")!=="never"||kl(i,"icon-overlap","icon-allow-overlap")!=="never"||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey=a!=="viewport-y"&&!o.isConstant();let s=a==="viewport-y"||a==="auto"&&!this.sortFeaturesByKey;this.sortFeaturesByY=s&&this.canOverlap,i.get("symbol-placement")==="point"&&(this.writingModes=i.get("text-writing-mode").map(u=>La[u])),this.stateDependentLayerIds=this.layers.filter(u=>u.isStateDependent()).map(u=>u.id),this.sourceID=e.sourceID}createArrays(){this.text=new Ai(new Te(this.layers,this.zoom,e=>/^text/.test(e))),this.icon=new Ai(new Te(this.layers,this.zoom,e=>/^icon/.test(e))),this.glyphOffsetArray=new Jn,this.lineVertexArray=new Yn,this.symbolInstances=new Zn,this.textAnchorOffsets=new Kn}calculateGlyphDependencies(e,r,n,i,o){for(let a=0;a<e.length;a++)if(r[e.charCodeAt(a)]=!0,(n||i)&&o){let s=Nr[e.charAt(a)];s&&(r[s.charCodeAt(0)]=!0)}}populate(e,r,n){let i=this.layers[0],o=i.layout,a=o.get("text-font"),s=o.get("text-field"),u=o.get("icon-image"),c=(s.value.kind!=="constant"||s.value.value instanceof Le&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&(a.value.kind!=="constant"||a.value.value.length>0),p=u.value.kind!=="constant"||!!u.value.value||Object.keys(u.parameters).length>0,f=o.get("symbol-sort-key");if(this.features=[],!c&&!p)return;let y=r.iconDependencies,m=r.glyphDependencies,h=r.availableImages,d=new Z(this.zoom,{globalState:this.globalState});for(let{feature:x,id:b,index:P,sourceLayerIndex:v}of e){let S=i._featureFilter.needGeometry,_=je(x,S);if(!i._featureFilter.filter(d,_,n))continue;S||(_.geometry=Ce(x));let T;if(c){let R=i.getValueAndResolveTokens("text-field",_,n,h),z=Le.factory(R),N=this.hasRTLText=this.hasRTLText||wx(z);(!N||Ie.getRTLTextPluginStatus()==="unavailable"||N&&Ie.isParsed())&&(T=hf(z,i,_))}let I;if(p){let R=i.getValueAndResolveTokens("icon-image",_,n,h);R instanceof _e?I=R:I=_e.fromString(R)}if(!T&&!I)continue;let F=this.sortFeaturesByKey?f.evaluate(_,{},n):void 0,D={id:b,text:T,icon:I,index:P,sourceLayerIndex:v,geometry:_.geometry,properties:x.properties,type:Px[x.type],sortKey:F};if(this.features.push(D),I&&(y[I.name]=!0),T){let R=a.evaluate(_,{},n).join(","),z=o.get("text-rotation-alignment")!=="viewport"&&o.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let N of T.sections)if(N.image)y[N.image.name]=!0;else{let B=kn(T.toString()),C=N.fontStack||R,O=m[C]=m[C]||{};this.calculateGlyphDependencies(N.text,O,z,this.allowVerticalPlacement,B)}}}o.get("symbol-placement")==="line"&&(this.features=df(this.features)),this.sortFeaturesByKey&&this.features.sort((x,b)=>x.sortKey-b.sortKey)}update(e,r,n){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,r,this.layers,n),this.icon.programConfigurations.updatePaintArrays(e,r,this.layers,n))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,r){let n=this.lineVertexArray.length;if(e.segment!==void 0){let i=e.dist(r[e.segment+1]),o=e.dist(r[e.segment]),a={};for(let s=e.segment+1;s<r.length;s++)a[s]={x:r[s].x,y:r[s].y,tileUnitDistanceFromAnchor:i},s<r.length-1&&(i+=r[s+1].dist(r[s]));for(let s=e.segment||0;s>=0;s--)a[s]={x:r[s].x,y:r[s].y,tileUnitDistanceFromAnchor:o},s>0&&(o+=r[s-1].dist(r[s]));for(let s=0;s<r.length;s++){let u=a[s];this.lineVertexArray.emplaceBack(u.x,u.y,u.tileUnitDistanceFromAnchor)}}return{lineStartIndex:n,lineLength:this.lineVertexArray.length-n}}addSymbols(e,r,n,i,o,a,s,u,c,p,f,y){let m=e.indexArray,h=e.layoutVertexArray,d=e.segments.prepareSegment(4*r.length,h,m,this.canOverlap?a.sortKey:void 0),x=this.glyphOffsetArray.length,b=d.vertexLength,P=this.allowVerticalPlacement&&s===2?Math.PI/2:0,v=a.text&&a.text.sections;for(let S=0;S<r.length;S++){let{tl:_,tr:T,bl:I,br:F,tex:D,pixelOffsetTL:R,pixelOffsetBR:z,minFontScaleX:N,minFontScaleY:B,glyphOffset:C,isSDF:O,sectionIndex:$}=r[S],U=d.vertexLength,G=C[1];Ba(h,u.x,u.y,_.x,G+_.y,D.x,D.y,n,O,R.x,R.y,N,B),Ba(h,u.x,u.y,T.x,G+T.y,D.x+D.w,D.y,n,O,z.x,R.y,N,B),Ba(h,u.x,u.y,I.x,G+I.y,D.x,D.y+D.h,n,O,R.x,z.y,N,B),Ba(h,u.x,u.y,F.x,G+F.y,D.x+D.w,D.y+D.h,n,O,z.x,z.y,N,B),Df(e.dynamicLayoutVertexArray,u,P),m.emplaceBack(U,U+2,U+1),m.emplaceBack(U+1,U+2,U+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(C[0]),(S===r.length-1||$!==r[S+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(h.length,a,a.index,{},y,v&&v[$])}e.placedSymbolArray.emplaceBack(u.x,u.y,x,this.glyphOffsetArray.length-x,b,c,p,u.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,f)}_addCollisionDebugVertex(e,r,n,i,o,a){return r.emplaceBack(0,0),e.emplaceBack(n.x,n.y,i,o,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,r,n,i,o,a,s){let u=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),c=u.vertexLength,p=o.layoutVertexArray,f=o.collisionVertexArray,y=s.anchorX,m=s.anchorY;this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(e,r)),this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(n,r)),this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(n,i)),this._addCollisionDebugVertex(p,f,a,y,m,new wi.default(e,i)),u.vertexLength+=4;let h=o.indexArray;h.emplaceBack(c,c+1),h.emplaceBack(c+1,c+2),h.emplaceBack(c+2,c+3),h.emplaceBack(c+3,c),u.primitiveLength+=4}addDebugCollisionBoxes(e,r,n,i){for(let o=e;o<r;o++){let a=this.collisionBoxArray.get(o),s=a.x1,u=a.y1,c=a.x2,p=a.y2;this.addCollisionDebugVertices(s,u,c,p,i?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,n)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new _i(ei,wl.members,Bt),this.iconCollisionBox=new _i(ei,wl.members,Bt);for(let e=0;e<this.symbolInstances.length;e++){let r=this.symbolInstances.get(e);this.addDebugCollisionBoxes(r.textBoxStartIndex,r.textBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r,!0),this.addDebugCollisionBoxes(r.iconBoxStartIndex,r.iconBoxEndIndex,r,!1),this.addDebugCollisionBoxes(r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex,r,!1)}}_deserializeCollisionBoxesForSymbol(e,r,n,i,o,a,s,u,c){let p={};for(let f=r;f<n;f++){let y=e.get(f);p.textBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.textFeatureIndex=y.featureIndex;break}for(let f=i;f<o;f++){let y=e.get(f);p.verticalTextBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.verticalTextFeatureIndex=y.featureIndex;break}for(let f=a;f<s;f++){let y=e.get(f);p.iconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.iconFeatureIndex=y.featureIndex;break}for(let f=u;f<c;f++){let y=e.get(f);p.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},p.verticalIconFeatureIndex=y.featureIndex;break}return p}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let r=0;r<this.symbolInstances.length;r++){let n=this.symbolInstances.get(r);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,n.textBoxStartIndex,n.textBoxEndIndex,n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n.iconBoxStartIndex,n.iconBoxEndIndex,n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,r){let n=e.placedSymbolArray.get(r),i=n.vertexStartIndex+n.numGlyphs*4;for(let o=n.vertexStartIndex;o<i;o+=4)e.indexArray.emplaceBack(o,o+2,o+1),e.indexArray.emplaceBack(o+1,o+2,o+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;let r=Math.sin(e),n=Math.cos(e),i=[],o=[],a=[];for(let s=0;s<this.symbolInstances.length;++s){a.push(s);let u=this.symbolInstances.get(s);i.push(Math.round(r*u.anchorX+n*u.anchorY)|0),o.push(u.featureIndex)}return a.sort((s,u)=>i[s]-i[u]||o[u]-o[s]),a}addToSortKeyRanges(e,r){let n=this.sortKeyRanges[this.sortKeyRanges.length-1];n&&n.sortKey===r?n.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:r,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let r of this.symbolInstanceIndexes){let n=this.symbolInstances.get(r);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((i,o,a)=>{i>=0&&a.indexOf(i)===o&&this.addIndicesForPlacedSymbol(this.text,i)}),n.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),n.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),n.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};k("SymbolBucket",Je,{omit:["layers","collisionBoxArray","features","compareText"]});Je.MAX_GLYPHS=65535;Je.addDynamicAttributes=Df;g();function Bf(t,e){return e.replace(/{([^{}]+)}/g,(r,n)=>t&&n in t?String(t[n]):"")}l(Bf,"resolveTokens");g();var Vf,Ax=l(()=>Vf=Vf||new ne({"symbol-placement":new L(A.layout_symbol["symbol-placement"]),"symbol-spacing":new L(A.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new L(A.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new V(A.layout_symbol["symbol-sort-key"]),"symbol-z-order":new L(A.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new L(A.layout_symbol["icon-allow-overlap"]),"icon-overlap":new L(A.layout_symbol["icon-overlap"]),"icon-ignore-placement":new L(A.layout_symbol["icon-ignore-placement"]),"icon-optional":new L(A.layout_symbol["icon-optional"]),"icon-rotation-alignment":new L(A.layout_symbol["icon-rotation-alignment"]),"icon-size":new V(A.layout_symbol["icon-size"]),"icon-text-fit":new L(A.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new L(A.layout_symbol["icon-text-fit-padding"]),"icon-image":new V(A.layout_symbol["icon-image"]),"icon-rotate":new V(A.layout_symbol["icon-rotate"]),"icon-padding":new V(A.layout_symbol["icon-padding"]),"icon-keep-upright":new L(A.layout_symbol["icon-keep-upright"]),"icon-offset":new V(A.layout_symbol["icon-offset"]),"icon-anchor":new V(A.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new L(A.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new L(A.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new L(A.layout_symbol["text-rotation-alignment"]),"text-field":new V(A.layout_symbol["text-field"]),"text-font":new V(A.layout_symbol["text-font"]),"text-size":new V(A.layout_symbol["text-size"]),"text-max-width":new V(A.layout_symbol["text-max-width"]),"text-line-height":new L(A.layout_symbol["text-line-height"]),"text-letter-spacing":new V(A.layout_symbol["text-letter-spacing"]),"text-justify":new V(A.layout_symbol["text-justify"]),"text-radial-offset":new V(A.layout_symbol["text-radial-offset"]),"text-variable-anchor":new L(A.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new V(A.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new V(A.layout_symbol["text-anchor"]),"text-max-angle":new L(A.layout_symbol["text-max-angle"]),"text-writing-mode":new L(A.layout_symbol["text-writing-mode"]),"text-rotate":new V(A.layout_symbol["text-rotate"]),"text-padding":new L(A.layout_symbol["text-padding"]),"text-keep-upright":new L(A.layout_symbol["text-keep-upright"]),"text-transform":new V(A.layout_symbol["text-transform"]),"text-offset":new V(A.layout_symbol["text-offset"]),"text-allow-overlap":new L(A.layout_symbol["text-allow-overlap"]),"text-overlap":new L(A.layout_symbol["text-overlap"]),"text-ignore-placement":new L(A.layout_symbol["text-ignore-placement"]),"text-optional":new L(A.layout_symbol["text-optional"])}),"getLayout"),Rf,_x=l(()=>Rf=Rf||new ne({"icon-opacity":new V(A.paint_symbol["icon-opacity"]),"icon-color":new V(A.paint_symbol["icon-color"]),"icon-halo-color":new V(A.paint_symbol["icon-halo-color"]),"icon-halo-width":new V(A.paint_symbol["icon-halo-width"]),"icon-halo-blur":new V(A.paint_symbol["icon-halo-blur"]),"icon-translate":new L(A.paint_symbol["icon-translate"]),"icon-translate-anchor":new L(A.paint_symbol["icon-translate-anchor"]),"text-opacity":new V(A.paint_symbol["text-opacity"]),"text-color":new V(A.paint_symbol["text-color"],{runtimeType:Ne,getOverride:l(t=>t.textColor,"getOverride"),hasOverride:l(t=>!!t.textColor,"hasOverride")}),"text-halo-color":new V(A.paint_symbol["text-halo-color"]),"text-halo-width":new V(A.paint_symbol["text-halo-width"]),"text-halo-blur":new V(A.paint_symbol["text-halo-blur"]),"text-translate":new L(A.paint_symbol["text-translate"]),"text-translate-anchor":new L(A.paint_symbol["text-translate-anchor"])}),"getPaint"),Va={get paint(){return _x()},get layout(){return Ax()}};g();var Ii=class{static{l(this,"FormatSectionOverride")}constructor(e){if(e.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:Ir,this.defaultValue=e}evaluate(e){if(e.formattedSection){let r=this.defaultValue.property.overrides;if(r&&r.hasOverride(e.formattedSection))return r.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){let r=this.defaultValue.value;e(r._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};k("FormatSectionOverride",Ii,{omit:["defaultValue"]});var Ra=class t extends le{static{l(this,"SymbolStyleLayer")}constructor(e){super(e,Va)}recalculate(e,r){if(super.recalculate(e,r),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout.get("symbol-placement")!=="point"?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){let n=this.layout.get("text-writing-mode");if(n){let i=[];for(let o of n)i.indexOf(o)<0&&i.push(o);this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,r,n,i){let o=this.layout.get(e).evaluate(r,{},n,i),a=this._unevaluatedLayout._values[e];return!a.isDataDriven()&&!In(a.value)&&o?Bf(r.properties,o):o}createBucket(e){return new Je(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of Va.paint.overridableProperties){if(!t.hasPaintOverride(this.layout,e))continue;let r=this.paint.get(e),n=new Ii(r),i=new Yt(n,r.property.specification),o=null;r.value.kind==="constant"||r.value.kind==="source"?o=new Qe("source",i):o=new Ft("composite",i,r.value.zoomStops),this.paint._values[e]=new ve(r.property,o,r.parameters)}}_handleOverridablePaintPropertyUpdate(e,r,n){return!this.layout||r.isDataDriven()||n.isDataDriven()?!1:t.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,r){let n=e.get("text-field"),i=Va.paint.properties[r],o=!1,a=l(s=>{for(let u of s)if(i.overrides&&i.overrides.hasOverride(u)){o=!0;return}},"checkSections");if(n.value.kind==="constant"&&n.value.value instanceof Le)a(n.value.value.sections);else if(n.value.kind==="source"){let s=l(c=>{if(!o)if(c instanceof Ct&&fe(c.value)===Tr){let p=c.value;a(p.sections)}else c instanceof mn?a(c.sections):c.eachChild(s)},"checkExpression"),u=n.value;u._styleExpression&&s(u._styleExpression.expression)}return o}};function zf(t,e,r,n=1){let i=t.get("icon-padding").evaluate(e,{},r),o=i&&i.values;return[o[0]*n,o[1]*n,o[2]*n,o[3]*n]}l(zf,"getIconPadding");g();g();var Of,Ix=l(()=>Of=Of||new ne({"background-color":new L(A.paint_background["background-color"]),"background-pattern":new ir(A.paint_background["background-pattern"]),"background-opacity":new L(A.paint_background["background-opacity"])}),"getPaint"),Gf={get paint(){return Ix()}};var za=class extends le{static{l(this,"BackgroundStyleLayer")}constructor(e){super(e,Gf)}};g();g();var Nf,Tx=l(()=>Nf=Nf||new ne({"raster-opacity":new L(A.paint_raster["raster-opacity"]),"raster-hue-rotate":new L(A.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new L(A.paint_raster["raster-brightness-min"]),"raster-brightness-max":new L(A.paint_raster["raster-brightness-max"]),"raster-saturation":new L(A.paint_raster["raster-saturation"]),"raster-contrast":new L(A.paint_raster["raster-contrast"]),"raster-resampling":new L(A.paint_raster["raster-resampling"]),"raster-fade-duration":new L(A.paint_raster["raster-fade-duration"])}),"getPaint"),Uf={get paint(){return Tx()}};var Oa=class extends le{static{l(this,"RasterStyleLayer")}constructor(e){super(e,Uf)}};g();var Ga=class extends le{constructor(r){super(r,{});this.onAdd=l(r=>{this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},"onAdd");this.onRemove=l(r=>{this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},"onRemove");this.implementation=r}static{l(this,"CustomStyleLayer")}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}};function $f(t){if(t.type==="custom")return new Ga(t);switch(t.type){case"background":return new za(t);case"circle":return new fa(t);case"color-relief":return new ha(t);case"fill":return new Pa(t);case"fill-extrusion":return new Aa(t);case"heatmap":return new ya(t);case"hillshade":return new ma(t);case"line":return new Ia(t);case"raster":return new Oa(t);case"symbol":return new Ra(t)}}l($f,"createStyleLayer");var Na=class{static{l(this,"StyleLayerIndex")}constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(e,r){for(let i of e){this._layerConfigs[i.id]=i;let o=this._layers[i.id]=$f(i);o._featureFilter=Et(o.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(let i of r)delete this.keyCache[i],delete this._layerConfigs[i],delete this._layers[i];this.familiesBySource={};let n=bc(Object.values(this._layerConfigs),this.keyCache);for(let i of n){let o=i.map(f=>this._layers[f.id]),a=o[0];if(a.visibility==="none")continue;let s=a.source||"",u=this.familiesBySource[s];u||(u=this.familiesBySource[s]={});let c=a.sourceLayer||"_geojsonTileLayer",p=u[c];p||(p=u[c]=[]),p.push(o)}}};g();var my=ee(Gt(),1),hy=ee(gi(),1);g();g();g();var qr=class{static{l(this,"DictionaryCoder")}constructor(e){this._stringToNumber={},this._numberToString=[];for(let r=0;r<e.length;r++){let n=e[r];this._stringToNumber[n]=r,this._numberToString[r]=n}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}};var qf=ee(Gt(),1),Wf=ee(gi(),1);g();var Ua=class{static{l(this,"GeoJSONFeature")}constructor(e,r,n,i,o){this.type="Feature",this._vectorTileFeature=e,e._z=r,e._x=n,e._y=i,this.properties=e.properties,this.id=o}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let r in this)r==="_geometry"||r==="_vectorTileFeature"||(e[r]=this[r]);return e}};g();var Ti=ee(de(),1);var hr=class t{constructor(){this.minX=1/0;this.maxX=-1/0;this.minY=1/0;this.maxY=-1/0}static{l(this,"Bounds")}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let r=new t;return r.extend(e(new Ti.default(this.minX,this.minY))),r.extend(e(new Ti.default(this.maxX,this.minY))),r.extend(e(new Ti.default(this.minX,this.maxY))),r.extend(e(new Ti.default(this.maxX,this.maxY))),r}static fromPoints(e){let r=new t;for(let n of e)r.extend(n);return r}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}};var Ci=class{static{l(this,"FeatureIndex")}constructor(e,r){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Wt(8192,16,0),this.grid3D=new Wt(8192,16,0),this.featureIndexArray=new Qn,this.promoteId=r}insert(e,r,n,i,o,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(n,i,o);let u=a?this.grid3D:this.grid;for(let c=0;c<r.length;c++){let p=r[c],f=[1/0,1/0,-1/0,-1/0];for(let y=0;y<p.length;y++){let m=p[y];f[0]=Math.min(f[0],m.x),f[1]=Math.min(f[1],m.y),f[2]=Math.max(f[2],m.x),f[3]=Math.max(f[3],m.y)}f[0]<8192&&f[1]<8192&&f[2]>=0&&f[3]>=0&&u.insert(s,f[0],f[1],f[2],f[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new qf.default.VectorTile(new Wf.default(this.rawTileData)).layers,this.sourceLayerCoder=new qr(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,r,n,i){this.loadVTLayers();let o=e.params,a=8192/e.tileSize/e.scale,s=Et(o.filter),u=e.queryGeometry,c=e.queryPadding*a,p=hr.fromPoints(u),f=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),y=hr.fromPoints(e.cameraQueryGeometry).expandBy(c),m=this.grid3D.query(y.minX,y.minY,y.maxX,y.maxY,(x,b,P,v)=>xp(e.cameraQueryGeometry,x-c,b-c,P+c,v+c));for(let x of m)f.push(x);f.sort(Cx);let h={},d;for(let x=0;x<f.length;x++){let b=f[x];if(b===d)continue;d=b;let P=this.featureIndexArray.get(b),v=null;this.loadMatchingFeature(h,P.bucketIndex,P.sourceLayerIndex,P.featureIndex,s,o.layers,o.availableImages,r,n,i,(S,_,T)=>(v||(v=Ce(S)),_.queryIntersectsFeature({queryGeometry:u,feature:S,featureState:T,geometry:v,zoom:this.z,transform:e.transform,pixelsToTileUnits:a,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation})))}return h}loadMatchingFeature(e,r,n,i,o,a,s,u,c,p,f){let y=this.bucketLayerIDs[r];if(a&&!y.some(b=>a.has(b)))return;let m=this.sourceLayerCoder.decode(n),d=this.vtLayers[m].feature(i);if(o.needGeometry){let b=je(d,!0);if(!o.filter(new Z(this.tileID.overscaledZ),b,this.tileID.canonical))return}else if(!o.filter(new Z(this.tileID.overscaledZ),d))return;let x=this.getId(d,m);for(let b=0;b<y.length;b++){let P=y[b];if(a&&!a.has(P))continue;let v=u[P];if(!v)continue;let S={};x&&p&&(S=p.getState(v.sourceLayer||"_geojsonTileLayer",x));let _=xe({},c[P]);_.paint=jf(_.paint,v.paint,d,S,s),_.layout=jf(_.layout,v.layout,d,S,s);let T=!f||f(d,v,S);if(!T)continue;let I=new Ua(d,this.z,this.x,this.y,x);I.layer=_;let F=e[P];F===void 0&&(F=e[P]=[]),F.push({featureIndex:i,feature:I,intersectionZ:T})}}lookupSymbolFeatures(e,r,n,i,o,a,s,u){let c={};this.loadVTLayers();let p=Et(o);for(let f of e)this.loadMatchingFeature(c,n,i,f,p,a,s,u,r);return c}hasLayer(e){for(let r of this.bucketLayerIDs)for(let n of r)if(e===n)return!0;return!1}getId(e,r){let n=e.id;if(this.promoteId){let i=typeof this.promoteId=="string"?this.promoteId:this.promoteId[r];n=e.properties[i],typeof n=="boolean"&&(n=Number(n)),n===void 0&&e.properties?.cluster&&this.promoteId&&(n=Number(e.properties.cluster_id))}return n}};k("FeatureIndex",Ci,{omit:["rawTileData","sourceLayerCoder"]});function jf(t,e,r,n,i){return on(t,(o,a)=>{let s=e instanceof Mt?e.get(a):null;return s&&s.evaluate?s.evaluate(r,n,i):s})}l(jf,"evaluateProperties");function Cx(t,e){return e-t}l(Cx,"topDownFeatureComparator");g();g();var Xf=ee(de(),1);var nt=class t extends Xf.default{static{l(this,"Anchor")}constructor(e,r,n,i){super(e,r),this.angle=n,i!==void 0&&(this.segment=i)}clone(){return new t(this.x,this.y,this.angle,this.segment)}};k("Anchor",nt);g();g();function Fl(t,e,r,n,i){if(e.segment===void 0||r===0)return!0;let o=e,a=e.segment+1,s=0;for(;s>-r/2;){if(a--,a<0)return!1;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;let u=[],c=0;for(;s<r/2;){let p=t[a-1],f=t[a],y=t[a+1];if(!y)return!1;let m=p.angleTo(f)-f.angleTo(y);for(m=Math.abs((m+3*Math.PI)%(Math.PI*2)-Math.PI),u.push({distance:s,angleDelta:m}),c+=m;s-u[0].distance>n;)c-=u.shift().angleDelta;if(c>i)return!1;a++,s+=f.dist(y)}return!0}l(Fl,"checkMaxAngle");function Hf(t){let e=0;for(let r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}l(Hf,"getLineLength");function Zf(t,e,r){return t?3/5*e*r:0}l(Zf,"getAngleWindowSize");function Jf(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}l(Jf,"getShapedLabelLength");function Yf(t,e,r,n,i,o){let a=Zf(r,i,o),s=Jf(r,n)*o,u=0,c=Hf(t)/2;for(let p=0;p<t.length-1;p++){let f=t[p],y=t[p+1],m=f.dist(y);if(u+m>c){let h=(c-u)/m,d=pt.number(f.x,y.x,h),x=pt.number(f.y,y.y,h),b=new nt(d,x,y.angleTo(f),p);return b._round(),!a||Fl(t,b,s,a,e)?b:void 0}u+=m}}l(Yf,"getCenterAnchor");function Kf(t,e,r,n,i,o,a,s,u){let c=Zf(n,o,a),p=Jf(n,i),f=p*a,y=t[0].x===0||t[0].x===u||t[0].y===0||t[0].y===u;e-f<e/4&&(e=f+e/4);let m=o*2,h=y?e/2*s%e:(p/2+m)*a*s%e;return Qf(t,h,e,c,r,f,y,!1,u)}l(Kf,"getAnchors");function Qf(t,e,r,n,i,o,a,s,u){let c=o/2,p=Hf(t),f=0,y=e-r,m=[];for(let h=0;h<t.length-1;h++){let d=t[h],x=t[h+1],b=d.dist(x),P=x.angleTo(d);for(;y+r<f+b;){y+=r;let v=(y-f)/b,S=pt.number(d.x,x.x,v),_=pt.number(d.y,x.y,v);if(S>=0&&S<u&&_>=0&&_<u&&y-c>=0&&y+c<=p){let T=new nt(S,_,P,h);T._round(),(!n||Fl(t,T,o,n,i))&&m.push(T)}}f+=b}return!s&&!m.length&&!a&&(m=Qf(t,f/2,r,n,i,o,a,!0,u)),m}l(Qf,"resample");g();var bt=ee(de(),1);function ey(t,e,r,n,i){let o=[];for(let a=0;a<t.length;a++){let s=t[a],u;for(let c=0;c<s.length-1;c++){let p=s[c],f=s[c+1];p.x<e&&f.x<e||(p.x<e?p=new bt.default(e,p.y+(f.y-p.y)*((e-p.x)/(f.x-p.x)))._round():f.x<e&&(f=new bt.default(e,p.y+(f.y-p.y)*((e-p.x)/(f.x-p.x)))._round()),!(p.y<r&&f.y<r)&&(p.y<r?p=new bt.default(p.x+(f.x-p.x)*((r-p.y)/(f.y-p.y)),r)._round():f.y<r&&(f=new bt.default(p.x+(f.x-p.x)*((r-p.y)/(f.y-p.y)),r)._round()),!(p.x>=n&&f.x>=n)&&(p.x>=n?p=new bt.default(n,p.y+(f.y-p.y)*((n-p.x)/(f.x-p.x)))._round():f.x>=n&&(f=new bt.default(n,p.y+(f.y-p.y)*((n-p.x)/(f.x-p.x)))._round()),!(p.y>=i&&f.y>=i)&&(p.y>=i?p=new bt.default(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round():f.y>=i&&(f=new bt.default(p.x+(f.x-p.x)*((i-p.y)/(f.y-p.y)),i)._round()),(!u||!p.equals(u[u.length-1]))&&(u=[p],o.push(u)),u.push(f)))))}}return o}l(ey,"clipLine");g();var Pe=ee(de(),1);var Wr=be;function El(t,e,r,n){let i=[],o=t.image,a=o.pixelRatio,s=o.paddedRect.w-2*Wr,u=o.paddedRect.h-2*Wr,c={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom},p=o.stretchX||[[0,s]],f=o.stretchY||[[0,u]],y=l((C,O)=>C+O[1]-O[0],"reduceRanges"),m=p.reduce(y,0),h=f.reduce(y,0),d=s-m,x=u-h,b=0,P=m,v=0,S=h,_=0,T=d,I=0,F=x;if(o.content&&n){let C=o.content,O=C[2]-C[0],$=C[3]-C[1];(o.textFitWidth||o.textFitHeight)&&(c=Da(t)),b=$a(p,0,C[0]),v=$a(f,0,C[1]),P=$a(p,C[0],C[2]),S=$a(f,C[1],C[3]),_=C[0]-b,I=C[1]-v,T=O-P,F=$-S}let D=c.x1,R=c.y1,z=c.x2-D,N=c.y2-R,B=l((C,O,$,U)=>{let G=ja(C.stretch-b,P,z,D),te=qa(C.fixed-_,T,C.stretch,m),J=ja(O.stretch-v,S,N,R),oe=qa(O.fixed-I,F,O.stretch,h),ge=ja($.stretch-b,P,z,D),qt=qa($.fixed-_,T,$.stretch,m),it=ja(U.stretch-v,S,N,R),vt=qa(U.fixed-I,F,U.stretch,h),$i=new Pe.default(G,J),ji=new Pe.default(ge,J),qi=new Pe.default(ge,it),Wi=new Pe.default(G,it),ss=new Pe.default(te/a,oe/a),ke=new Pe.default(qt/a,vt/a),Pt=e*Math.PI/180;if(Pt){let St=Math.sin(Pt),Kr=Math.cos(Pt),ze=[Kr,-St,St,Kr];$i._matMult(ze),ji._matMult(ze),Wi._matMult(ze),qi._matMult(ze)}let Yr=C.stretch+C.fixed,ls=$.stretch+$.fixed,Xi=O.stretch+O.fixed,us=U.stretch+U.fixed,Fe={x:o.paddedRect.x+Wr+Yr,y:o.paddedRect.y+Wr+Xi,w:ls-Yr,h:us-Xi},Se=T/a/z,ot=F/a/N;return{tl:$i,tr:ji,bl:Wi,br:qi,tex:Fe,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:ss,pixelOffsetBR:ke,minFontScaleX:Se,minFontScaleY:ot,isSDF:r}},"makeBox");if(!n||!o.stretchX&&!o.stretchY)i.push(B({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:u+1}));else{let C=ty(p,d,m),O=ty(f,x,h);for(let $=0;$<C.length-1;$++){let U=C[$],G=C[$+1];for(let te=0;te<O.length-1;te++){let J=O[te],oe=O[te+1];i.push(B(U,J,G,oe))}}}return i}l(El,"getIconQuads");function $a(t,e,r){let n=0;for(let i of t)n+=Math.max(e,Math.min(r,i[1]))-Math.max(e,Math.min(r,i[0]));return n}l($a,"sumWithinRange");function ty(t,e,r){let n=[{fixed:-Wr,stretch:0}];for(let[i,o]of t){let a=n[n.length-1];n.push({fixed:i-a.stretch,stretch:a.stretch}),n.push({fixed:i-a.stretch,stretch:a.stretch+(o-i)})}return n.push({fixed:e+Wr,stretch:r}),n}l(ty,"stretchZonesToCuts");function ja(t,e,r,n){return t/e*r+n}l(ja,"getEmOffset");function qa(t,e,r,n){return t-e*r/n}l(qa,"getPxOffset");function ry(t,e,r,n,i,o,a,s){let u=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[];for(let p of e.positionedLines)for(let f of p.positionedGlyphs){if(!f.rect)continue;let y=f.rect||{},h=ka+1,d=!0,x=1,b=0,P=(i||s)&&f.vertical,v=f.metrics.advance*f.scale/2;if(s&&e.verticalizable){let J=(f.scale-1)*ue,oe=(ue-f.metrics.width*f.scale)/2;b=p.lineOffset/2-(f.imageName?-oe:J)}if(f.imageName){let J=a[f.imageName];d=J.sdf,x=J.pixelRatio,h=be/x}let S=i?[f.x+v,f.y]:[0,0],_=i?[0,0]:[f.x+v+r[0],f.y+r[1]-b],T=[0,0];P&&(T=_,_=[0,0]);let I=f.metrics.isDoubleResolution?2:1,F=(f.metrics.left-h)*f.scale-v+_[0],D=(-f.metrics.top-h)*f.scale+_[1],R=F+y.w/I*f.scale/x,z=D+y.h/I*f.scale/x,N=new Pe.default(F,D),B=new Pe.default(R,D),C=new Pe.default(F,z),O=new Pe.default(R,z);if(P){let J=new Pe.default(-v,v-Pi),oe=-Math.PI/2,ge=ue/2-v,qt=f.imageName?ge:0,it=new Pe.default(5-Pi-ge,-qt),vt=new Pe.default(...T);N._rotateAround(oe,J)._add(it)._add(vt),B._rotateAround(oe,J)._add(it)._add(vt),C._rotateAround(oe,J)._add(it)._add(vt),O._rotateAround(oe,J)._add(it)._add(vt)}if(u){let J=Math.sin(u),oe=Math.cos(u),ge=[oe,-J,J,oe];N._matMult(ge),B._matMult(ge),C._matMult(ge),O._matMult(ge)}let $=new Pe.default(0,0),U=new Pe.default(0,0);c.push({tl:N,tr:B,bl:C,br:O,tex:y,writingMode:e.writingMode,glyphOffset:S,sectionIndex:f.sectionIndex,isSDF:d,pixelOffsetTL:$,pixelOffsetBR:U,minFontScaleX:0,minFontScaleY:0})}return c}l(ry,"getGlyphQuads");g();var ki=ee(de(),1);var dr=class{static{l(this,"CollisionFeature")}constructor(e,r,n,i,o,a,s,u,c,p){if(this.boxStartIndex=e.length,c){let f=a.top,y=a.bottom,m=a.collisionPadding;m&&(f-=m[1],y+=m[3]);let h=y-f;h>0&&(h=Math.max(10,h),this.circleDiameter=h)}else{let f=a.image?.content&&(a.image.textFitWidth||a.image.textFitHeight)?Da(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};f.y1=f.y1*s-u[0],f.y2=f.y2*s+u[2],f.x1=f.x1*s-u[3],f.x2=f.x2*s+u[1];let y=a.collisionPadding;if(y&&(f.x1-=y[0]*s,f.y1-=y[1]*s,f.x2+=y[2]*s,f.y2+=y[3]*s),p){let m=new ki.default(f.x1,f.y1),h=new ki.default(f.x2,f.y1),d=new ki.default(f.x1,f.y2),x=new ki.default(f.x2,f.y2),b=p*Math.PI/180;m._rotate(b),h._rotate(b),d._rotate(b),x._rotate(b),f.x1=Math.min(m.x,h.x,d.x,x.x),f.x2=Math.max(m.x,h.x,d.x,x.x),f.y1=Math.min(m.y,h.y,d.y,x.y),f.y2=Math.max(m.y,h.y,d.y,x.y)}e.emplaceBack(r.x,r.y,f.x1,f.y1,f.x2,f.y2,n,i,o)}this.boxEndIndex=e.length}};g();g();var Fi=class{static{l(this,"TinyQueue")}constructor(e=[],r=(n,i)=>n<i?-1:n>i?1:0){if(this.data=e,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;let e=this.data[0],r=this.data.pop();return--this.length>0&&(this.data[0]=r,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:r,compare:n}=this,i=r[e];for(;e>0;){let o=e-1>>1,a=r[o];if(n(i,a)>=0)break;r[e]=a,e=o}r[e]=i}_down(e){let{data:r,compare:n}=this,i=this.length>>1,o=r[e];for(;e<i;){let a=(e<<1)+1,s=a+1;if(s<this.length&&n(r[s],r[a])<0&&(a=s),n(r[a],o)>=0)break;r[e]=r[a],e=a}r[e]=o}};var Ml=ee(de(),1);function ny(t,e=1,r=!1){let n=hr.fromPoints(t[0]),i=Math.min(n.width(),n.height()),o=i/2,a=new Fi([],kx),{minX:s,minY:u,maxX:c,maxY:p}=n;if(i===0)return new Ml.default(s,u);for(let m=s;m<c;m+=i)for(let h=u;h<p;h+=i)a.push(new Xr(m+o,h+o,o,t));let f=Ex(t),y=a.length;for(;a.length;){let m=a.pop();(m.d>f.d||!f.d)&&(f=m,r&&console.log("found best %d after %d probes",Math.round(1e4*m.d)/1e4,y)),!(m.max-f.d<=e)&&(o=m.h/2,a.push(new Xr(m.p.x-o,m.p.y-o,o,t)),a.push(new Xr(m.p.x+o,m.p.y-o,o,t)),a.push(new Xr(m.p.x-o,m.p.y+o,o,t)),a.push(new Xr(m.p.x+o,m.p.y+o,o,t)),y+=4)}return r&&(console.log(`num probes: ${y}`),console.log(`best distance: ${f.d}`)),f.p}l(ny,"findPoleOfInaccessibility");function kx(t,e){return e.max-t.max}l(kx,"compareMax");function Xr(t,e,r,n){this.p=new Ml.default(t,e),this.h=r,this.d=Fx(this.p,n),this.max=this.d+this.h*Math.SQRT2}l(Xr,"Cell");function Fx(t,e){let r=!1,n=1/0;for(let i=0;i<e.length;i++){let o=e[i];for(let a=0,s=o.length,u=s-1;a<s;u=a++){let c=o[a],p=o[u];c.y>t.y!=p.y>t.y&&t.x<(p.x-c.x)*(t.y-c.y)/(p.y-c.y)+c.x&&(r=!r),n=Math.min(n,cl(t,c,p))}}return(r?1:-1)*Math.sqrt(n)}l(Fx,"pointToPolygonDist");function Ex(t){let e=0,r=0,n=0,i=t[0];for(let o=0,a=i.length,s=a-1;o<a;s=o++){let u=i[o],c=i[s],p=u.x*c.y-c.x*u.y;r+=(u.x+c.x)*p,n+=(u.y+c.y)*p,e+=p*3}return new Xr(r/e,n/e,0,t)}l(Ex,"getCentroidCell");var Vl=ee(il(),1);g();var Ll=(o=>(o[o.center=1]="center",o[o.left=2]="left",o[o.right=3]="right",o[o.top=4]="top",o[o.bottom=5]="bottom",o[o["top-left"]=6]="top-left",o[o["top-right"]=7]="top-right",o[o["bottom-left"]=8]="bottom-left",o[o["bottom-right"]=9]="bottom-right",o))(Ll||{}),Ut=7,Wa=Number.POSITIVE_INFINITY;function Dl(t,e){function r(i,o){let a=0,s=0;o<0&&(o=0);let u=o/Math.SQRT2;switch(i){case"top-right":case"top-left":s=u-Ut;break;case"bottom-right":case"bottom-left":s=-u+Ut;break;case"bottom":s=-o+Ut;break;case"top":s=o-Ut;break}switch(i){case"top-right":case"bottom-right":a=-u;break;case"top-left":case"bottom-left":a=u;break;case"left":a=o;break;case"right":a=-o;break}return[a,s]}l(r,"fromRadialOffset");function n(i,o,a){let s=0,u=0;switch(o=Math.abs(o),a=Math.abs(a),i){case"top-right":case"top-left":case"top":u=a-Ut;break;case"bottom-right":case"bottom-left":case"bottom":u=-a+Ut;break}switch(i){case"top-right":case"bottom-right":case"right":s=-o;break;case"top-left":case"bottom-left":case"left":s=o;break}return[s,u]}return l(n,"fromTextOffset"),e[1]!==Wa?n(t,e[0],e[1]):r(t,e[0])}l(Dl,"evaluateVariableOffset");function Bl(t,e,r){let n=t.layout,i=n.get("text-variable-anchor-offset")?.evaluate(e,{},r);if(i){let a=i.values,s=[];for(let u=0;u<a.length;u+=2){let c=s[u]=a[u],p=a[u+1].map(f=>f*ue);c.startsWith("top")?p[1]-=Ut:c.startsWith("bottom")&&(p[1]+=Ut),s[u+1]=p}return new De(s)}let o=n.get("text-variable-anchor");if(o){let a;t._unevaluatedLayout.getValue("text-radial-offset")!==void 0?a=[n.get("text-radial-offset").evaluate(e,{},r)*ue,Wa]:a=n.get("text-offset").evaluate(e,{},r).map(c=>c*ue);let u=[];for(let c of o)u.push(c,Dl(c,a));return new De(u)}return null}l(Bl,"getTextVariableAnchorOffset");function ay(t){t.bucket.createArrays();let e=512*t.bucket.overscaling;t.bucket.tilePixelRatio=8192/e,t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],n=r.layout,i=r._unevaluatedLayout._values,o={layoutIconSize:i["icon-size"].possiblyEvaluate(new Z(t.bucket.zoom+1),t.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new Z(t.bucket.zoom+1),t.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new Z(18))};if(t.bucket.textSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.textSizeData;o.compositeTextSizes=[i["text-size"].possiblyEvaluate(new Z(p),t.canonical),i["text-size"].possiblyEvaluate(new Z(f),t.canonical)]}if(t.bucket.iconSizeData.kind==="composite"){let{minZoom:p,maxZoom:f}=t.bucket.iconSizeData;o.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new Z(p),t.canonical),i["icon-size"].possiblyEvaluate(new Z(f),t.canonical)]}let a=n.get("text-line-height")*ue,s=n.get("text-rotation-alignment")!=="viewport"&&n.get("symbol-placement")!=="point",u=n.get("text-keep-upright"),c=n.get("text-size");for(let p of t.bucket.features){let f=n.get("text-font").evaluate(p,{},t.canonical).join(","),y=c.evaluate(p,{},t.canonical),m=o.layoutTextSize.evaluate(p,{},t.canonical),h=o.layoutIconSize.evaluate(p,{},t.canonical),d={horizontal:{},vertical:void 0},x=p.text,b=[0,0];if(x){let _=x.toString(),T=n.get("text-letter-spacing").evaluate(p,{},t.canonical)*ue,I=Yc(_)?T:0,F=n.get("text-anchor").evaluate(p,{},t.canonical),D=Bl(r,p,t.canonical);if(!D){let C=n.get("text-radial-offset").evaluate(p,{},t.canonical);C?b=Dl(F,[C*ue,Wa]):b=n.get("text-offset").evaluate(p,{},t.canonical).map(O=>O*ue)}let R=s?"center":n.get("text-justify").evaluate(p,{},t.canonical),N=n.get("symbol-placement")==="point"?n.get("text-max-width").evaluate(p,{},t.canonical)*ue:1/0,B=l(()=>{t.bucket.allowVerticalPlacement&&kn(_)&&(d.vertical=Si(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,N,a,F,"left",I,b,2,!0,m,y))},"addVerticalShapingForPointLabelIfNeeded");if(!s&&D){let C=new Set;if(R==="auto")for(let $=0;$<D.values.length;$+=2)C.add(iy(D.values[$]));else C.add(R);let O=!1;for(let $ of C)if(!d.horizontal[$])if(O)d.horizontal[$]=d.horizontal[0];else{let U=Si(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,N,a,"center",$,I,b,1,!1,m,y);U&&(d.horizontal[$]=U,O=U.positionedLines.length===1)}B()}else{R==="auto"&&(R=iy(F));let C=Si(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,N,a,F,R,I,b,1,!1,m,y);C&&(d.horizontal[R]=C),B(),kn(_)&&s&&u&&(d.vertical=Si(x,t.glyphMap,t.glyphPositions,t.imagePositions,f,N,a,F,R,I,b,2,!1,m,y))}}let P,v=!1;if(p.icon&&p.icon.name){let _=t.imageMap[p.icon.name];_&&(P=Mf(t.imagePositions[p.icon.name],n.get("icon-offset").evaluate(p,{},t.canonical),n.get("icon-anchor").evaluate(p,{},t.canonical)),v=!!_.sdf,t.bucket.sdfIcons===void 0?t.bucket.sdfIcons=v:t.bucket.sdfIcons!==v&&ye("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(_.pixelRatio!==t.bucket.pixelRatio||n.get("icon-rotate").constantOr(1)!==0)&&(t.bucket.iconsNeedLinear=!0))}let S=sy(d.horizontal)||d.vertical;t.bucket.iconsInText=S?S.iconsInText:!1,(S||P)&&Mx(t.bucket,p,d,P,t.imageMap,o,m,h,b,v,t.canonical,t.subdivisionGranularity)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()}l(ay,"performSymbolLayout");function iy(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}l(iy,"getAnchorJustification");function Mx(t,e,r,n,i,o,a,s,u,c,p,f){let y=o.textMaxSize.evaluate(e,{});y===void 0&&(y=a);let m=t.layers[0].layout,h=m.get("icon-offset").evaluate(e,{},p),d=sy(r.horizontal),x=24,b=a/x,P=t.tilePixelRatio*b,v=t.tilePixelRatio*y/x,S=t.tilePixelRatio*s,_=t.tilePixelRatio*m.get("symbol-spacing"),T=m.get("text-padding")*t.tilePixelRatio,I=zf(m,e,p,t.tilePixelRatio),F=m.get("text-max-angle")/180*Math.PI,D=m.get("text-rotation-alignment")!=="viewport"&&m.get("symbol-placement")!=="point",R=m.get("icon-rotation-alignment")==="map"&&m.get("symbol-placement")!=="point",z=m.get("symbol-placement"),N=_/2,B=m.get("icon-text-fit"),C;n&&B!=="none"&&(t.allowVerticalPlacement&&r.vertical&&(C=Tl(n,r.vertical,B,m.get("icon-text-fit-padding"),h,b)),d&&(n=Tl(n,d,B,m.get("icon-text-fit-padding"),h,b)));let O=p?f.line.getGranularityForZoomLevel(p.z):1,$=l((U,G)=>{G.x<0||G.x>=8192||G.y<0||G.y>=8192||Dx(t,G,U,r,n,i,C,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,P,[T,T,T,T],D,u,S,I,R,h,e,o,c,p,a)},"addSymbolAtAnchor");if(z==="line")for(let U of ey(e.geometry,0,0,8192,8192)){let G=tt(U,O),te=Kf(G,_,F,r.vertical||d,n,x,v,t.overscaling,8192);for(let J of te){let oe=d;(!oe||!Bx(t,oe.text,N,J))&&$(G,J)}}else if(z==="line-center"){for(let U of e.geometry)if(U.length>1){let G=tt(U,O),te=Yf(G,F,r.vertical||d,n,x,v);te&&$(G,te)}}else if(e.type==="Polygon")for(let U of er(e.geometry,0)){let G=ny(U,16),te=tt(U[0],O,!0);$(te,new nt(G.x,G.y,0))}else if(e.type==="LineString")for(let U of e.geometry){let G=tt(U,O);$(G,new nt(G[0].x,G[0].y,0))}else if(e.type==="Point")for(let U of e.geometry)for(let G of U)$([G],new nt(G.x,G.y,0))}l(Mx,"addFeature");function Lx(t,e){let r=t.length,n=e?.values;if(n?.length>0)for(let i=0;i<n.length;i+=2){let o=Ll[n[i]],a=n[i+1];t.emplaceBack(o,a[0],a[1])}return[r,t.length]}l(Lx,"addTextVariableAnchorOffsets");function oy(t,e,r,n,i,o,a,s,u,c,p,f,y,m,h){let d=ry(e,r,s,i,o,a,n,t.allowVerticalPlacement),x=t.textSizeData,b=null;x.kind==="source"?(b=[Nt*i.layout.get("text-size").evaluate(a,{})],b[0]>rt&&ye(`${t.layerIds[0]}: Value for "text-size" is >= ${jr}. Reduce your "text-size".`)):x.kind==="composite"&&(b=[Nt*m.compositeTextSizes[0].evaluate(a,{},h),Nt*m.compositeTextSizes[1].evaluate(a,{},h)],(b[0]>rt||b[1]>rt)&&ye(`${t.layerIds[0]}: Value for "text-size" is >= ${jr}. Reduce your "text-size".`)),t.addSymbols(t.text,d,b,s,o,a,c,e,u.lineStartIndex,u.lineLength,y,h);for(let P of p)f[P]=t.text.placedSymbolArray.length-1;return d.length*4}l(oy,"addTextVertices");function sy(t){for(let e in t)return t[e];return null}l(sy,"getDefaultHorizontalShaping");function Dx(t,e,r,n,i,o,a,s,u,c,p,f,y,m,h,d,x,b,P,v,S,_,T,I,F){let D=t.addToLineVertexArray(e,r),R,z,N,B,C=0,O=0,$=0,U=0,G=-1,te=-1,J={},oe=(0,Vl.default)("");if(t.allowVerticalPlacement&&n.vertical){let Se=s.layout.get("text-rotate").evaluate(S,{},I)+90,ot=n.vertical;N=new dr(u,e,c,p,f,ot,y,m,h,Se),a&&(B=new dr(u,e,c,p,f,a,x,b,h,Se))}if(i){let Fe=s.layout.get("icon-rotate").evaluate(S,{}),Se=s.layout.get("icon-text-fit")!=="none",ot=El(i,Fe,T,Se),St=a?El(a,Fe,T,Se):void 0;z=new dr(u,e,c,p,f,i,x,b,!1,Fe),C=ot.length*4;let Kr=t.iconSizeData,ze=null;Kr.kind==="source"?(ze=[Nt*s.layout.get("icon-size").evaluate(S,{})],ze[0]>rt&&ye(`${t.layerIds[0]}: Value for "icon-size" is >= ${jr}. Reduce your "icon-size".`)):Kr.kind==="composite"&&(ze=[Nt*_.compositeIconSizes[0].evaluate(S,{},I),Nt*_.compositeIconSizes[1].evaluate(S,{},I)],(ze[0]>rt||ze[1]>rt)&&ye(`${t.layerIds[0]}: Value for "icon-size" is >= ${jr}. Reduce your "icon-size".`)),t.addSymbols(t.icon,ot,ze,v,P,S,0,e,D.lineStartIndex,D.lineLength,-1,I),G=t.icon.placedSymbolArray.length-1,St&&(O=St.length*4,t.addSymbols(t.icon,St,ze,v,P,S,2,e,D.lineStartIndex,D.lineLength,-1,I),te=t.icon.placedSymbolArray.length-1)}let ge=Object.keys(n.horizontal);for(let Fe of ge){let Se=n.horizontal[Fe];if(!R){oe=(0,Vl.default)(Se.text);let St=s.layout.get("text-rotate").evaluate(S,{},I);R=new dr(u,e,c,p,f,Se,y,m,h,St)}let ot=Se.positionedLines.length===1;if($+=oy(t,e,Se,o,s,h,S,d,D,n.vertical?1:3,ot?ge:[Fe],J,G,_,I),ot)break}n.vertical&&(U+=oy(t,e,n.vertical,o,s,h,S,d,D,2,["vertical"],J,te,_,I));let qt=R?R.boxStartIndex:t.collisionBoxArray.length,it=R?R.boxEndIndex:t.collisionBoxArray.length,vt=N?N.boxStartIndex:t.collisionBoxArray.length,$i=N?N.boxEndIndex:t.collisionBoxArray.length,ji=z?z.boxStartIndex:t.collisionBoxArray.length,qi=z?z.boxEndIndex:t.collisionBoxArray.length,Wi=B?B.boxStartIndex:t.collisionBoxArray.length,ss=B?B.boxEndIndex:t.collisionBoxArray.length,ke=-1,Pt=l((Fe,Se)=>Fe&&Fe.circleDiameter?Math.max(Fe.circleDiameter,Se):Se,"getCollisionCircleHeight");ke=Pt(R,ke),ke=Pt(N,ke),ke=Pt(z,ke),ke=Pt(B,ke);let Yr=ke>-1?1:0;Yr&&(ke*=F/ue),t.glyphOffsetArray.length>=Je.MAX_GLYPHS&&ye("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),S.sortKey!==void 0&&t.addToSortKeyRanges(t.symbolInstances.length,S.sortKey);let ls=Bl(s,S,I),[Xi,us]=Lx(t.textAnchorOffsets,ls);t.symbolInstances.emplaceBack(e.x,e.y,J.right>=0?J.right:-1,J.center>=0?J.center:-1,J.left>=0?J.left:-1,J.vertical||-1,G,te,oe,qt,it,vt,$i,ji,qi,Wi,ss,c,$,U,C,O,Yr,0,y,ke,Xi,us)}l(Dx,"addSymbol");function Bx(t,e,r,n){let i=t.compareText;if(!(e in i))i[e]=[];else{let o=i[e];for(let a=o.length-1;a>=0;a--)if(n.dist(o[a])<r)return!0}return i[e].push(n),!1}l(Bx,"anchorIsTooClose");g();var Xa=1,Ei=class{static{l(this,"GlyphAtlas")}constructor(e){let r={},n=[];for(let s in e){let u=e[s],c=r[s]={};for(let p in u){let f=u[+p];if(!f||f.bitmap.width===0||f.bitmap.height===0)continue;let y={x:0,y:0,w:f.bitmap.width+2*Xa,h:f.bitmap.height+2*Xa};n.push(y),c[p]={rect:y,metrics:f.metrics}}}let{w:i,h:o}=bi(n),a=new cr({width:i||1,height:o||1});for(let s in e){let u=e[s];for(let c in u){let p=u[+c];if(!p||p.bitmap.width===0||p.bitmap.height===0)continue;let f=r[s][c].rect;cr.copy(p.bitmap,a,{x:0,y:0},{x:f.x+Xa,y:f.y+Xa},p.bitmap)}}this.image=a,this.positions=r}};k("GlyphAtlas",Ei);g();g();function uy(t,e,r){e=Math.pow(2,r)-e-1;var n=ly(t*256,e*256,r),i=ly((t+1)*256,(e+1)*256,r);return n[0]+","+n[1]+","+i[0]+","+i[1]}l(uy,"getTileBBox");function ly(t,e,r){var n=2*Math.PI*6378137/256/Math.pow(2,r),i=t*n-2*Math.PI*6378137/2,o=e*n-2*Math.PI*6378137/2;return[i,o]}l(ly,"getMercCoords");var yy=ee(de(),1);g();g();var Rl=63710088e-1,Mi=class t{static{l(this,"LngLat")}constructor(e,r){if(isNaN(e)||isNaN(r))throw new Error(`Invalid LngLat object: (${e}, ${r})`);if(this.lng=+e,this.lat=+r,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new t(_u(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let r=Math.PI/180,n=this.lat*r,i=e.lat*r,o=Math.sin(n)*Math.sin(i)+Math.cos(n)*Math.cos(i)*Math.cos((e.lng-this.lng)*r);return Rl*Math.acos(Math.min(o,1))}static convert(e){if(e instanceof t)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new t(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new t(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}};var cy=2*Math.PI*Rl;function py(t){return cy*Math.cos(t*Math.PI/180)}l(py,"circumferenceAtLatitude");function Vx(t){return(180+t)/360}l(Vx,"mercatorXfromLng");function Rx(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}l(Rx,"mercatorYfromLat");function zx(t,e){return t/py(e)}l(zx,"mercatorZfromAltitude");function Ox(t){return t*360-180}l(Ox,"lngFromMercatorX");function zl(t){let e=180-t*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}l(zl,"latFromMercatorY");function Gx(t,e){return t*py(zl(e))}l(Gx,"altitudeFromMercatorZ");function Nx(t){return 1/Math.cos(t*Math.PI/180)}l(Nx,"mercatorScale");var Li=class t{static{l(this,"MercatorCoordinate")}constructor(e,r,n=0){this.x=+e,this.y=+r,this.z=+n}static fromLngLat(e,r=0){let n=Mi.convert(e);return new t(Vx(n.lng),Rx(n.lat),zx(r,n.lat))}toLngLat(){return new Mi(Ox(this.x),zl(this.y))}toAltitude(){return Gx(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/cy*Nx(zl(this.y))}};g();function fy(t,e,r){return!(t<Ki||t>Yi||r<0||r>=Math.pow(2,t)||e<0||e>=Math.pow(2,t))}l(fy,"isInBoundsForTileZoomXY");var Ha=class{static{l(this,"CanonicalTileID")}constructor(e,r,n){if(!fy(e,r,n))throw new Error(`x=${r}, y=${n}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} ${Ki}<=z<=${Yi} `);this.z=e,this.x=r,this.y=n,this.key=Di(0,e,e,r,n)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,r,n){let i=uy(this.x,this.y,this.z),o=Ux(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(n==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,r>1?"@2x":"").replace(/{quadkey}/g,o).replace(/{bbox-epsg-3857}/g,i)}isChildOf(e){let r=this.z-e.z;return r>0&&e.x===this.x>>r&&e.y===this.y>>r}getTilePoint(e){let r=Math.pow(2,this.z);return new yy.default((e.x*r-this.x)*8192,(e.y*r-this.y)*8192)}toString(){return`${this.z}/${this.x}/${this.y}`}},Ol=class{static{l(this,"UnwrappedTileID")}constructor(e,r){this.wrap=e,this.canonical=r,this.key=Di(e,r.z,r.z,r.x,r.y)}},Bi=class t{constructor(e,r,n,i,o){this.terrainRttPosMatrix32f=null;if(e<n)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${n}`);this.overscaledZ=e,this.wrap=r,this.canonical=new Ha(n,+i,+o),this.key=Di(r,e,n,i,o)}static{l(this,"OverscaledTileID")}clone(){return new t(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?new t(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new t(e,this.wrap,e,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,r){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let n=this.canonical.z-e;return e>this.canonical.z?Di(this.wrap*+r,e,this.canonical.z,this.canonical.x,this.canonical.y):Di(this.wrap*+r,e,e,this.canonical.x>>n,this.canonical.y>>n)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let r=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>r&&e.canonical.y===this.canonical.y>>r}children(e){if(this.overscaledZ>=e)return[new t(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,n=this.canonical.x*2,i=this.canonical.y*2;return[new t(r,this.wrap,r,n,i),new t(r,this.wrap,r,n+1,i),new t(r,this.wrap,r,n,i+1),new t(r,this.wrap,r,n+1,i+1)]}isLessThan(e){return this.wrap<e.wrap?!0:this.wrap>e.wrap?!1:this.overscaledZ<e.overscaledZ?!0:this.overscaledZ>e.overscaledZ?!1:this.canonical.x<e.canonical.x?!0:this.canonical.x>e.canonical.x?!1:this.canonical.y<e.canonical.y}wrapped(){return new t(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new t(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Ol(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Li(e.x-this.wrap,e.y))}};function Di(t,e,r,n,i){t*=2,t<0&&(t=t*-1-1);let o=1<<r;return(o*o*t+o*i+n).toString(36)+r.toString(36)+e.toString(36)}l(Di,"calculateTileKey");function Ux(t,e,r){let n="",i;for(let o=t;o>0;o--)i=1<<o-1,n+=(e&i?1:0)+(r&i?2:0);return n}l(Ux,"getQuadkey");k("CanonicalTileID",Ha);k("OverscaledTileID",Bi,{omit:["terrainRttPosMatrix32f"]});var Za=class{static{l(this,"WorkerTile")}constructor(e){this.tileID=new Bi(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[],this.globalState=e.globalState}async parse(e,r,n,i,o){this.status="parsing",this.data=e,this.collisionBoxArray=new Xn;let a=new qr(Object.keys(e.layers).sort()),s=new Ci(this.tileID,this.promoteId);s.bucketLayerIDs=[];let u={},c={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n,subdivisionGranularity:o},p=r.familiesBySource[this.source];for(let T in p){let I=e.layers[T];if(!I)continue;I.version===1&&ye(`Vector tile source "${this.source}" layer "${T}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let F=a.encode(T),D=[];for(let R=0;R<I.length;R++){let z=I.feature(R),N=s.getId(z,T);D.push({feature:z,id:N,index:R,sourceLayerIndex:F})}for(let R of p[T]){let z=R[0];if(z.source!==this.source&&ye(`layer.source = ${z.source} does not equal this.source = ${this.source}`),z.minzoom&&this.zoom<Math.floor(z.minzoom)||z.maxzoom&&this.zoom>=z.maxzoom||z.visibility==="none")continue;Gl(R,this.zoom,n),(u[z.id]=z.createBucket({index:s.bucketLayerIDs.length,layers:R,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:F,sourceID:this.source,globalState:this.globalState})).populate(D,c,this.tileID.canonical),s.bucketLayerIDs.push(R.map(B=>B.id))}}let f=on(c.glyphDependencies,T=>Object.keys(T).map(Number));this.inFlightDependencies.forEach(T=>T?.abort()),this.inFlightDependencies=[];let y=Promise.resolve({});if(Object.keys(f).length){let T=new AbortController;this.inFlightDependencies.push(T),y=i.sendAsync({type:"GG",data:{stacks:f,source:this.source,tileID:this.tileID,type:"glyphs"}},T)}let m=Object.keys(c.iconDependencies),h=Promise.resolve({});if(m.length){let T=new AbortController;this.inFlightDependencies.push(T),h=i.sendAsync({type:"GI",data:{icons:m,source:this.source,tileID:this.tileID,type:"icons"}},T)}let d=Object.keys(c.patternDependencies),x=Promise.resolve({});if(d.length){let T=new AbortController;this.inFlightDependencies.push(T),x=i.sendAsync({type:"GI",data:{icons:d,source:this.source,tileID:this.tileID,type:"patterns"}},T)}let[b,P,v]=await Promise.all([y,h,x]),S=new Ei(b),_=new xi(P,v);for(let T in u){let I=u[T];I instanceof Je?(Gl(I.layers,this.zoom,n),ay({bucket:I,glyphMap:b,glyphPositions:S.positions,imageMap:P,imagePositions:_.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:c.subdivisionGranularity})):I.hasPattern&&(I instanceof mr||I instanceof fr||I instanceof yr)&&(Gl(I.layers,this.zoom,n),I.addFeatures(c,this.tileID.canonical,_.patternPositions))}return this.status="done",{buckets:Object.values(u).filter(T=>!T.isEmpty()),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:S.image,imageAtlas:_,glyphMap:this.returnDependencies?b:null,iconMap:this.returnDependencies?P:null,glyphPositions:this.returnDependencies?S.positions:null}}};function Gl(t,e,r){let n=new Z(e);for(let i of t)i.recalculate(n,r)}l(Gl,"recalculateLayers");g();var $x=60,AE=1e3/$x;var Hr=class{static{l(this,"RequestPerformance")}constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return e.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}};var Zr=class{static{l(this,"VectorTileWorkerSource")}constructor(e,r,n){this.actor=e,this.layerIndex=r,this.availableImages=n,this.fetching={},this.loading={},this.loaded={}}async loadVectorTile(e,r){let n=await jc(e.request,r);try{return{vectorTile:new my.default.VectorTile(new hy.default(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(i){let o=new Uint8Array(n.data),a=o[0]===31&&o[1]===139,s=`Unable to parse the tile at ${e.request.url}, `;throw a?s+="please make sure the data is not gzipped and that you have configured the relevant header in the server":s+=`got error: ${i.message}`,new Error(s)}}async loadTile(e){let r=e.uid,n=e&&e.request&&e.request.collectResourceTiming?new Hr(e.request):!1,i=new Za(e);this.loading[r]=i;let o=new AbortController;i.abort=o;try{let a=await this.loadVectorTile(e,o);if(delete this.loading[r],!a)return null;let s=a.rawData,u={};a.expires&&(u.expires=a.expires),a.cacheControl&&(u.cacheControl=a.cacheControl);let c={};if(n){let f=n.finish();f&&(c.resourceTiming=JSON.parse(JSON.stringify(f)))}i.vectorTile=a.vectorTile;let p=i.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity);this.loaded[r]=i,this.fetching[r]={rawTileData:s,cacheControl:u,resourceTiming:c};try{let f=await p;return xe({rawTileData:s.slice(0)},f,u,c)}finally{delete this.fetching[r]}}catch(a){throw delete this.loading[r],i.status="done",this.loaded[r]=i,a}}async reloadTile(e){let r=e.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let n=this.loaded[r];if(n.showCollisionBoxes=e.showCollisionBoxes,n.globalState=e.globalState,n.status==="parsing"){let i=await n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity),o;if(this.fetching[r]){let{rawTileData:a,cacheControl:s,resourceTiming:u}=this.fetching[r];delete this.fetching[r],o=xe({rawTileData:a.slice(0)},i,s,u)}else o=i;return o}if(n.status==="done"&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,e.subdivisionGranularity)}async abortTile(e){let r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort.abort(),delete r[n])}async removeTile(e){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]}};g();var Ja=class{static{l(this,"RasterDEMTileWorkerSource")}constructor(){this.loaded={}}async loadTile(e){let{uid:r,encoding:n,rawImageData:i,redFactor:o,greenFactor:a,blueFactor:s,baseShift:u}=e,c=i.width+2,p=i.height+2,f=wt(i)?new he({width:c,height:p},await Cu(i,-1,-1,c,p)):i,y=new si(r,f,n,o,a,s,u);return this.loaded=this.loaded||{},this.loaded[r]=y,y}removeTile(e){let r=this.loaded,n=e.uid;r&&r[n]&&delete r[n]}};g();var Uy=ee(xy(),1);g();var Nl=ee(de(),1),vy=ee(Gt(),1);var jx=vy.default.VectorTileFeature.prototype.toGeoJSON,Ul=class{static{l(this,"FeatureWrapper")}constructor(e){this._feature=e,this.extent=8192,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(this._feature.type===1){let e=[];for(let r of this._feature.geometry)e.push([new Nl.default(r[0],r[1])]);return e}else{let e=[];for(let r of this._feature.geometry){let n=[];for(let i of r)n.push(new Nl.default(i[0],i[1]));e.push(n)}return e}}toGeoJSON(e,r,n){return jx.call(this,e,r,n)}},Ka=class{static{l(this,"GeoJSONWrapper")}constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=e.length,this._features=e}feature(e){return new Ul(this._features[e])}};var $y=ee(Iy(),1);g();g();var Ty=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],ql=1,Ri=8,Oi=class t{static{l(this,"KDBush")}static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[r,n]=new Uint8Array(e,0,2);if(r!==219)throw new Error("Data does not appear to be in a KDBush format.");let i=n>>4;if(i!==ql)throw new Error(`Got v${i} data when expected v${ql}.`);let o=Ty[n&15];if(!o)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new t(s,a,o,e)}constructor(e,r=64,n=Float64Array,i){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+r,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let o=Ty.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-s%8)%8;if(o<0)throw new Error(`Unexpected typed array class: ${n}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,Ri,e),this.coords=new this.ArrayType(this.data,Ri+s+u,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Ri+a+s+u),this.ids=new this.IndexArrayType(this.data,Ri,e),this.coords=new this.ArrayType(this.data,Ri+s+u,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(ql<<4)+o]),new Uint16Array(this.data,2,1)[0]=r,new Uint32Array(this.data,4,1)[0]=e)}add(e,r){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=r,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Xl(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,r,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:a,nodeSize:s}=this,u=[0,o.length-1,0],c=[];for(;u.length;){let p=u.pop()||0,f=u.pop()||0,y=u.pop()||0;if(f-y<=s){for(let x=y;x<=f;x++){let b=a[2*x],P=a[2*x+1];b>=e&&b<=n&&P>=r&&P<=i&&c.push(o[x])}continue}let m=y+f>>1,h=a[2*m],d=a[2*m+1];h>=e&&h<=n&&d>=r&&d<=i&&c.push(o[m]),(p===0?e<=h:r<=d)&&(u.push(y),u.push(m-1),u.push(1-p)),(p===0?n>=h:i>=d)&&(u.push(m+1),u.push(f),u.push(1-p))}return c}within(e,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:i,coords:o,nodeSize:a}=this,s=[0,i.length-1,0],u=[],c=n*n;for(;s.length;){let p=s.pop()||0,f=s.pop()||0,y=s.pop()||0;if(f-y<=a){for(let x=y;x<=f;x++)Cy(o[2*x],o[2*x+1],e,r)<=c&&u.push(i[x]);continue}let m=y+f>>1,h=o[2*m],d=o[2*m+1];Cy(h,d,e,r)<=c&&u.push(i[m]),(p===0?e-n<=h:r-n<=d)&&(s.push(y),s.push(m-1),s.push(1-p)),(p===0?e+n>=h:r+n>=d)&&(s.push(m+1),s.push(f),s.push(1-p))}return u}};function Xl(t,e,r,n,i,o){if(i-n<=r)return;let a=n+i>>1;ky(t,e,a,n,i,o),Xl(t,e,r,n,a-1,1-o),Xl(t,e,r,a+1,i,1-o)}l(Xl,"sort");function ky(t,e,r,n,i,o){for(;i>n;){if(i-n>600){let c=i-n+1,p=r-n+1,f=Math.log(c),y=.5*Math.exp(2*f/3),m=.5*Math.sqrt(f*y*(c-y)/c)*(p-c/2<0?-1:1),h=Math.max(n,Math.floor(r-p*y/c+m)),d=Math.min(i,Math.floor(r+(c-p)*y/c+m));ky(t,e,r,h,d,o)}let a=e[2*r+o],s=n,u=i;for(zi(t,e,n,r),e[2*i+o]>a&&zi(t,e,n,i);s<u;){for(zi(t,e,s,u),s++,u--;e[2*s+o]<a;)s++;for(;e[2*u+o]>a;)u--}e[2*n+o]===a?zi(t,e,n,u):(u++,zi(t,e,u,i)),u<=r&&(n=u+1),r<=u&&(i=u-1)}}l(ky,"select");function zi(t,e,r,n){Wl(t,r,n),Wl(e,2*r,2*n),Wl(e,2*r+1,2*n+1)}l(zi,"swapItem");function Wl(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}l(Wl,"swap");function Cy(t,e,r,n){let i=t-r,o=e-n;return i*i+o*o}l(Cy,"sqDist");var t0={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:l(t=>t,"map")},Fy=Math.fround||(t=>e=>(t[0]=+e,t[0]))(new Float32Array(1)),gr=2,jt=3,Hl=4,$t=5,My=6,Gi=class{static{l(this,"Supercluster")}constructor(e){this.options=Object.assign(Object.create(t0),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:r,minZoom:n,maxZoom:i}=this.options;r&&console.time("total time");let o=`prepare ${e.length} points`;r&&console.time(o),this.points=e;let a=[];for(let u=0;u<e.length;u++){let c=e[u];if(!c.geometry)continue;let[p,f]=c.geometry.coordinates,y=Fy(es(p)),m=Fy(ts(f));a.push(y,m,1/0,u,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this._createTree(a);r&&console.timeEnd(o);for(let u=i;u>=n;u--){let c=+Date.now();s=this.trees[u]=this._createTree(this._cluster(s,u)),r&&console.log("z%d: %d clusters in %dms",u,s.numItems,+Date.now()-c)}return r&&console.timeEnd("total time"),this}getClusters(e,r){let n=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),o=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,o=180;else if(n>o){let f=this.getClusters([n,i,180,a],r),y=this.getClusters([-180,i,o,a],r);return f.concat(y)}let s=this.trees[this._limitZoom(r)],u=s.range(es(n),ts(a),es(o),ts(i)),c=s.data,p=[];for(let f of u){let y=this.stride*f;p.push(c[y+$t]>1?Ey(c,y,this.clusterProps):this.points[c[y+jt]])}return p}getChildren(e){let r=this._getOriginId(e),n=this._getOriginZoom(e),i="No cluster with the specified id.",o=this.trees[n];if(!o)throw new Error(i);let a=o.data;if(r*this.stride>=a.length)throw new Error(i);let s=this.options.radius/(this.options.extent*Math.pow(2,n-1)),u=a[r*this.stride],c=a[r*this.stride+1],p=o.within(u,c,s),f=[];for(let y of p){let m=y*this.stride;a[m+Hl]===e&&f.push(a[m+$t]>1?Ey(a,m,this.clusterProps):this.points[a[m+jt]])}if(f.length===0)throw new Error(i);return f}getLeaves(e,r,n){r=r||10,n=n||0;let i=[];return this._appendLeaves(i,e,r,n,0),i}getTile(e,r,n){let i=this.trees[this._limitZoom(e)],o=Math.pow(2,e),{extent:a,radius:s}=this.options,u=s/a,c=(n-u)/o,p=(n+1+u)/o,f={features:[]};return this._addTileFeatures(i.range((r-u)/o,c,(r+1+u)/o,p),i.data,r,n,o,f),r===0&&this._addTileFeatures(i.range(1-u/o,c,1,p),i.data,o,n,o,f),r===o-1&&this._addTileFeatures(i.range(0,c,u/o,p),i.data,-1,n,o,f),f.features.length?f:null}getClusterExpansionZoom(e){let r=this._getOriginZoom(e)-1;for(;r<=this.options.maxZoom;){let n=this.getChildren(e);if(r++,n.length!==1)break;e=n[0].properties.cluster_id}return r}_appendLeaves(e,r,n,i,o){let a=this.getChildren(r);for(let s of a){let u=s.properties;if(u&&u.cluster?o+u.point_count<=i?o+=u.point_count:o=this._appendLeaves(e,u.cluster_id,n,i,o):o<i?o++:e.push(s),e.length===n)break}return o}_createTree(e){let r=new Oi(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)r.add(e[n],e[n+1]);return r.finish(),r.data=e,r}_addTileFeatures(e,r,n,i,o,a){for(let s of e){let u=s*this.stride,c=r[u+$t]>1,p,f,y;if(c)p=Ly(r,u,this.clusterProps),f=r[u],y=r[u+1];else{let d=this.points[r[u+jt]];p=d.properties;let[x,b]=d.geometry.coordinates;f=es(x),y=ts(b)}let m={type:1,geometry:[[Math.round(this.options.extent*(f*o-n)),Math.round(this.options.extent*(y*o-i))]],tags:p},h;c||this.options.generateId?h=r[u+jt]:h=this.points[r[u+jt]].id,h!==void 0&&(m.id=h),a.features.push(m)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,r){let{radius:n,extent:i,reduce:o,minPoints:a}=this.options,s=n/(i*Math.pow(2,r)),u=e.data,c=[],p=this.stride;for(let f=0;f<u.length;f+=p){if(u[f+gr]<=r)continue;u[f+gr]=r;let y=u[f],m=u[f+1],h=e.within(u[f],u[f+1],s),d=u[f+$t],x=d;for(let b of h){let P=b*p;u[P+gr]>r&&(x+=u[P+$t])}if(x>d&&x>=a){let b=y*d,P=m*d,v,S=-1,_=((f/p|0)<<5)+(r+1)+this.points.length;for(let T of h){let I=T*p;if(u[I+gr]<=r)continue;u[I+gr]=r;let F=u[I+$t];b+=u[I]*F,P+=u[I+1]*F,u[I+Hl]=_,o&&(v||(v=this._map(u,f,!0),S=this.clusterProps.length,this.clusterProps.push(v)),o(v,this._map(u,I)))}u[f+Hl]=_,c.push(b/x,P/x,1/0,_,-1,x),o&&c.push(S)}else{for(let b=0;b<p;b++)c.push(u[f+b]);if(x>1)for(let b of h){let P=b*p;if(!(u[P+gr]<=r)){u[P+gr]=r;for(let v=0;v<p;v++)c.push(u[P+v])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,r,n){if(e[r+$t]>1){let a=this.clusterProps[e[r+My]];return n?Object.assign({},a):a}let i=this.points[e[r+jt]].properties,o=this.options.map(i);return n&&o===i?Object.assign({},o):o}};function Ey(t,e,r){return{type:"Feature",id:t[e+jt],properties:Ly(t,e,r),geometry:{type:"Point",coordinates:[r0(t[e]),n0(t[e+1])]}}}l(Ey,"getClusterJSON");function Ly(t,e,r){let n=t[e+$t],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?`${Math.round(n/100)/10}k`:n,o=t[e+My],a=o===-1?{}:Object.assign({},r[o]);return Object.assign(a,{cluster:!0,cluster_id:t[e+jt],point_count:n,point_count_abbreviated:i})}l(Ly,"getClusterProperties");function es(t){return t/360+.5}l(es,"lngX");function ts(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}l(ts,"latY");function r0(t){return(t-.5)*360}l(r0,"xLng");function n0(t){let e=(180-t*360)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}l(n0,"yLat");g();g();g();function Ni(t,e,r,n){let i=n,o=e+(r-e>>1),a=r-e,s,u=t[e],c=t[e+1],p=t[r],f=t[r+1];for(let y=e+3;y<r;y+=3){let m=i0(t[y],t[y+1],u,c,p,f);if(m>i)s=y,i=m;else if(m===i){let h=Math.abs(y-o);h<a&&(s=y,a=h)}}i>n&&(s-e>3&&Ni(t,e,s,n),t[s+2]=i,r-s>3&&Ni(t,s,r,n))}l(Ni,"simplify");function i0(t,e,r,n,i,o){let a=i-r,s=o-n;if(a!==0||s!==0){let u=((t-r)*a+(e-n)*s)/(a*a+s*s);u>1?(r=i,n=o):u>0&&(r+=a*u,n+=s*u)}return a=t-r,s=e-n,a*a+s*s}l(i0,"getSqSegDist");g();function xt(t,e,r,n){let i={id:t??null,type:e,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(e==="Point"||e==="MultiPoint"||e==="LineString")rs(i,r);else if(e==="Polygon")rs(i,r[0]);else if(e==="MultiLineString")for(let o of r)rs(i,o);else if(e==="MultiPolygon")for(let o of r)rs(i,o[0]);return i}l(xt,"createFeature");function rs(t,e){for(let r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}l(rs,"calcLineBBox");function Yl(t,e){let r=[];if(t.type==="FeatureCollection")for(let n=0;n<t.features.length;n++)ns(r,t.features[n],e,n);else t.type==="Feature"?ns(r,t,e):ns(r,{geometry:t},e);return r}l(Yl,"convert");function ns(t,e,r,n){if(!e.geometry)return;let i=e.geometry.coordinates;if(i&&i.length===0)return;let o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],u=e.id;if(r.promoteId?u=e.properties[r.promoteId]:r.generateId&&(u=n||0),o==="Point")Dy(i,s);else if(o==="MultiPoint")for(let c of i)Dy(c,s);else if(o==="LineString")Jl(i,s,a,!1);else if(o==="MultiLineString")if(r.lineMetrics){for(let c of i)s=[],Jl(c,s,a,!1),t.push(xt(u,"LineString",s,e.properties));return}else Zl(i,s,a,!1);else if(o==="Polygon")Zl(i,s,a,!0);else if(o==="MultiPolygon")for(let c of i){let p=[];Zl(c,p,a,!0),s.push(p)}else if(o==="GeometryCollection"){for(let c of e.geometry.geometries)ns(t,{id:u,geometry:c,properties:e.properties},r,n);return}else throw new Error("Input data is not a valid GeoJSON object.");t.push(xt(u,o,s,e.properties))}l(ns,"convertFeature");function Dy(t,e){e.push(By(t[0]),Vy(t[1]),0)}l(Dy,"convertPoint");function Jl(t,e,r,n){let i,o,a=0;for(let u=0;u<t.length;u++){let c=By(t[u][0]),p=Vy(t[u][1]);e.push(c,p,0),u>0&&(n?a+=(i*p-c*o)/2:a+=Math.sqrt(Math.pow(c-i,2)+Math.pow(p-o,2))),i=c,o=p}let s=e.length-3;e[2]=1,Ni(e,0,s,r),e[s+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}l(Jl,"convertLine");function Zl(t,e,r,n){for(let i=0;i<t.length;i++){let o=[];Jl(t[i],o,r,n),e.push(o)}}l(Zl,"convertLines");function By(t){return t/360+.5}l(By,"projectX");function Vy(t){let e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}l(Vy,"projectY");g();function qe(t,e,r,n,i,o,a,s){if(r/=e,n/=e,o>=r&&a<n)return t;if(a<r||o>=n)return null;let u=[];for(let c of t){let p=c.geometry,f=c.type,y=i===0?c.minX:c.minY,m=i===0?c.maxX:c.maxY;if(y>=r&&m<n){u.push(c);continue}else if(m<r||y>=n)continue;let h=[];if(f==="Point"||f==="MultiPoint")o0(p,h,r,n,i);else if(f==="LineString")zy(p,h,r,n,i,!1,s.lineMetrics);else if(f==="MultiLineString")Kl(p,h,r,n,i,!1);else if(f==="Polygon")Kl(p,h,r,n,i,!0);else if(f==="MultiPolygon")for(let d of p){let x=[];Kl(d,x,r,n,i,!0),x.length&&h.push(x)}if(h.length){if(s.lineMetrics&&f==="LineString"){for(let d of h)u.push(xt(c.id,f,d,c.tags));continue}(f==="LineString"||f==="MultiLineString")&&(h.length===1?(f="LineString",h=h[0]):f="MultiLineString"),(f==="Point"||f==="MultiPoint")&&(f=h.length===3?"Point":"MultiPoint"),u.push(xt(c.id,f,h,c.tags))}}return u.length?u:null}l(qe,"clip");function o0(t,e,r,n,i){for(let o=0;o<t.length;o+=3){let a=t[o+i];a>=r&&a<=n&&Jr(e,t[o],t[o+1],t[o+2])}}l(o0,"clipPoints");function zy(t,e,r,n,i,o,a){let s=Ry(t),u=i===0?a0:s0,c=t.start,p,f;for(let b=0;b<t.length-3;b+=3){let P=t[b],v=t[b+1],S=t[b+2],_=t[b+3],T=t[b+4],I=i===0?P:v,F=i===0?_:T,D=!1;a&&(p=Math.sqrt(Math.pow(P-_,2)+Math.pow(v-T,2))),I<r?F>r&&(f=u(s,P,v,_,T,r),a&&(s.start=c+p*f)):I>n?F<n&&(f=u(s,P,v,_,T,n),a&&(s.start=c+p*f)):Jr(s,P,v,S),F<r&&I>=r&&(f=u(s,P,v,_,T,r),D=!0),F>n&&I<=n&&(f=u(s,P,v,_,T,n),D=!0),!o&&D&&(a&&(s.end=c+p*f),e.push(s),s=Ry(t)),a&&(c+=p)}let y=t.length-3,m=t[y],h=t[y+1],d=t[y+2],x=i===0?m:h;x>=r&&x<=n&&Jr(s,m,h,d),y=s.length-3,o&&y>=3&&(s[y]!==s[0]||s[y+1]!==s[1])&&Jr(s,s[0],s[1],s[2]),s.length&&e.push(s)}l(zy,"clipLine");function Ry(t){let e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}l(Ry,"newSlice");function Kl(t,e,r,n,i,o){for(let a of t)zy(a,e,r,n,i,o,!1)}l(Kl,"clipLines");function Jr(t,e,r,n){t.push(e,r,n)}l(Jr,"addPoint");function a0(t,e,r,n,i,o){let a=(o-e)/(n-e);return Jr(t,o,r+(i-r)*a,1),a}l(a0,"intersectX");function s0(t,e,r,n,i,o){let a=(o-r)/(i-r);return Jr(t,e+(n-e)*a,o,1),a}l(s0,"intersectY");g();function eu(t,e){let r=e.buffer/e.extent,n=t,i=qe(t,1,-1-r,r,0,-1,2,e),o=qe(t,1,1-r,2+r,0,-1,2,e);return(i||o)&&(n=qe(t,1,-r,1+r,0,-1,2,e)||[],i&&(n=Oy(i,1).concat(n)),o&&(n=n.concat(Oy(o,-1)))),n}l(eu,"wrap");function Oy(t,e){let r=[];for(let n=0;n<t.length;n++){let i=t[n],o=i.type,a;if(o==="Point"||o==="MultiPoint"||o==="LineString")a=Ql(i.geometry,e);else if(o==="MultiLineString"||o==="Polygon"){a=[];for(let s of i.geometry)a.push(Ql(s,e))}else if(o==="MultiPolygon"){a=[];for(let s of i.geometry){let u=[];for(let c of s)u.push(Ql(c,e));a.push(u)}}r.push(xt(i.id,o,a,i.tags))}return r}l(Oy,"shiftFeatureCoords");function Ql(t,e){let r=[];r.size=t.size,t.start!==void 0&&(r.start=t.start,r.end=t.end);for(let n=0;n<t.length;n+=3)r.push(t[n]+e,t[n+1],t[n+2]);return r}l(Ql,"shiftCoords");g();function is(t,e){if(t.transformed)return t;let r=1<<t.z,n=t.x,i=t.y;for(let o of t.features){let a=o.geometry,s=o.type;if(o.geometry=[],s===1)for(let u=0;u<a.length;u+=2)o.geometry.push(Gy(a[u],a[u+1],e,r,n,i));else for(let u=0;u<a.length;u++){let c=[];for(let p=0;p<a[u].length;p+=2)c.push(Gy(a[u][p],a[u][p+1],e,r,n,i));o.geometry.push(c)}}return t.transformed=!0,t}l(is,"transformTile");function Gy(t,e,r,n,i,o){return[Math.round(r*(t*n-i)),Math.round(r*(e*n-o))]}l(Gy,"transformPoint");g();function ru(t,e,r,n,i){let o=e===i.maxZoom?0:i.tolerance/((1<<e)*i.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:r,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let s of t)l0(a,s,o,i);return a}l(ru,"createTile");function l0(t,e,r,n){let i=e.geometry,o=e.type,a=[];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),o==="Point"||o==="MultiPoint")for(let s=0;s<i.length;s+=3)a.push(i[s],i[s+1]),t.numPoints++,t.numSimplified++;else if(o==="LineString")tu(a,i,t,r,!1,!1);else if(o==="MultiLineString"||o==="Polygon")for(let s=0;s<i.length;s++)tu(a,i[s],t,r,o==="Polygon",s===0);else if(o==="MultiPolygon")for(let s=0;s<i.length;s++){let u=i[s];for(let c=0;c<u.length;c++)tu(a,u[c],t,r,!0,c===0)}if(a.length){let s=e.tags||null;if(o==="LineString"&&n.lineMetrics){s={};for(let c in e.tags)s[c]=e.tags[c];s.mapbox_clip_start=i.start/i.size,s.mapbox_clip_end=i.end/i.size}let u={geometry:a,type:o==="Polygon"||o==="MultiPolygon"?3:o==="LineString"||o==="MultiLineString"?2:1,tags:s};e.id!==null&&(u.id=e.id),t.features.push(u)}}l(l0,"addFeature");function tu(t,e,r,n,i,o){let a=n*n;if(n>0&&e.size<(i?a:n)){r.numPoints+=e.length/3;return}let s=[];for(let u=0;u<e.length;u+=3)(n===0||e[u+2]>a)&&(r.numSimplified++,s.push(e[u],e[u+1])),r.numPoints++;i&&u0(s,o),t.push(s)}l(tu,"addLine");function u0(t,e){let r=0;for(let n=0,i=t.length,o=i-2;n<i;o=n,n+=2)r+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(r>0===e)for(let n=0,i=t.length;n<i/2;n+=2){let o=t[n],a=t[n+1];t[n]=t[i-2-n],t[n+1]=t[i-1-n],t[i-2-n]=o,t[i-1-n]=a}}l(u0,"rewind");var c0={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},iu=class{static{l(this,"GeoJSONVT")}constructor(e,r){r=this.options=p0(Object.create(c0),r);let n=r.debug;if(n&&console.time("preprocess data"),r.maxZoom<0||r.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(r.promoteId&&r.generateId)throw new Error("promoteId and generateId cannot be used together.");let i=Yl(e,r);this.tiles={},this.tileCoords=[],n&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",r.indexMaxZoom,r.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=eu(i,r),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(e,r,n,i,o,a,s){let u=[e,r,n,i],c=this.options,p=c.debug;for(;u.length;){i=u.pop(),n=u.pop(),r=u.pop(),e=u.pop();let f=1<<r,y=nu(r,n,i),m=this.tiles[y];if(!m&&(p>1&&console.time("creation"),m=this.tiles[y]=ru(e,r,n,i,c),this.tileCoords.push({z:r,x:n,y:i}),p)){p>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",r,n,i,m.numFeatures,m.numPoints,m.numSimplified),console.timeEnd("creation"));let F=`z${r}`;this.stats[F]=(this.stats[F]||0)+1,this.total++}if(m.source=e,o==null){if(r===c.indexMaxZoom||m.numPoints<=c.indexMaxPoints)continue}else{if(r===c.maxZoom||r===o)continue;if(o!=null){let F=o-r;if(n!==a>>F||i!==s>>F)continue}}if(m.source=null,e.length===0)continue;p>1&&console.time("clipping");let h=.5*c.buffer/c.extent,d=.5-h,x=.5+h,b=1+h,P=null,v=null,S=null,_=null,T=qe(e,f,n-h,n+x,0,m.minX,m.maxX,c),I=qe(e,f,n+d,n+b,0,m.minX,m.maxX,c);e=null,T&&(P=qe(T,f,i-h,i+x,1,m.minY,m.maxY,c),v=qe(T,f,i+d,i+b,1,m.minY,m.maxY,c),T=null),I&&(S=qe(I,f,i-h,i+x,1,m.minY,m.maxY,c),_=qe(I,f,i+d,i+b,1,m.minY,m.maxY,c),I=null),p>1&&console.timeEnd("clipping"),u.push(P||[],r+1,n*2,i*2),u.push(v||[],r+1,n*2,i*2+1),u.push(S||[],r+1,n*2+1,i*2),u.push(_||[],r+1,n*2+1,i*2+1)}}getTile(e,r,n){e=+e,r=+r,n=+n;let i=this.options,{extent:o,debug:a}=i;if(e<0||e>24)return null;let s=1<<e;r=r+s&s-1;let u=nu(e,r,n);if(this.tiles[u])return is(this.tiles[u],o);a>1&&console.log("drilling down to z%d-%d-%d",e,r,n);let c=e,p=r,f=n,y;for(;!y&&c>0;)c--,p=p>>1,f=f>>1,y=this.tiles[nu(c,p,f)];return!y||!y.source?null:(a>1&&(console.log("found parent tile z%d-%d-%d",c,p,f),console.time("drilling down")),this.splitTile(y.source,c,p,f,e,r,n),a>1&&console.timeEnd("drilling down"),this.tiles[u]?is(this.tiles[u],o):null)}};function nu(t,e,r){return((1<<t)*r+e)*32+t}l(nu,"toID");function p0(t,e){for(let r in e)t[r]=e[r];return t}l(p0,"extend");function ou(t,e){return new iu(t,e)}l(ou,"geojsonvt");g();function Ui(t,e){return e?t.properties[e]:t.id}l(Ui,"getFeatureId");function au(t,e){if(t==null)return!0;if(t.type==="Feature")return Ui(t,e)!=null;if(t.type==="FeatureCollection"){let r=new Set;for(let n of t.features){let i=Ui(n,e);if(i==null||r.has(i))return!1;r.add(i)}return!0}return!1}l(au,"isUpdateableGeoJSON");function su(t,e){let r=new Map;if(t!=null)if(t.type==="Feature")r.set(Ui(t,e),t);else for(let n of t.features)r.set(Ui(n,e),n);return r}l(su,"toUpdateable");function Ny(t,e,r){if(e.removeAll&&t.clear(),e.remove)for(let n of e.remove)t.delete(n);if(e.add)for(let n of e.add){let i=Ui(n,r);i!=null&&t.set(i,n)}if(e.update)for(let n of e.update){let i=t.get(n.id);if(i==null)continue;let o=n.newGeometry||n.removeAllProperties,a=!n.removeAllProperties&&(n.removeProperties?.length>0||n.addOrUpdateProperties?.length>0);if((o||a)&&(i={...i},t.set(n.id,i),a&&(i.properties={...i.properties})),n.newGeometry&&(i.geometry=n.newGeometry),n.removeAllProperties)i.properties={};else if(n.removeProperties?.length>0)for(let s of n.removeProperties)Object.prototype.hasOwnProperty.call(i.properties,s)&&delete i.properties[s];if(n.addOrUpdateProperties?.length>0)for(let{key:s,value:u}of n.addOrUpdateProperties)i.properties[s]=u}}l(Ny,"applySourceDiff");var os=class extends Zr{constructor(){super(...arguments);this._dataUpdateable=new Map}static{l(this,"GeoJSONWorkerSource")}async loadVectorTile(r,n){let i=r.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let o=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!o)return null;let a=new Ka(o.features),s=(0,$y.default)(a);return(s.byteOffset!==0||s.byteLength!==s.buffer.byteLength)&&(s=new Uint8Array(s)),{vectorTile:a,rawData:s.buffer}}async loadData(r){this._pendingRequest?.abort();let n=r&&r.request&&r.request.collectResourceTiming?new Hr(r.request):!1;this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(r,this._pendingRequest),this._geoJSONIndex=r.cluster?new Gi(f0(r)).load((await this._pendingData).features):ou(await this._pendingData,r.geojsonVtOptions),this.loaded={};let i={};if(n){let o=n.finish();o&&(i.resourceTiming={},i.resourceTiming[r.source]=JSON.parse(JSON.stringify(o)))}return i}catch(i){if(delete this._pendingRequest,Bc(i))return{abandoned:!0};throw i}}async getData(){return this._pendingData}reloadTile(r){let n=this.loaded,i=r.uid;return n&&n[i]?super.reloadTile(r):this.loadTile(r)}async loadAndProcessGeoJSON(r,n){let i=await this.loadGeoJSON(r,n);if(delete this._pendingRequest,typeof i!="object")throw new Error(`Input data given to '${r.source}' is not a valid GeoJSON object.`);if((0,Uy.default)(i,!0),r.filter){let o=rr(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(o.result==="error")throw new Error(o.value.map(s=>`${s.key}: ${s.message}`).join(", "));i={type:"FeatureCollection",features:i.features.filter(s=>o.value.evaluate({zoom:0},s))}}return i}async loadGeoJSON(r,n){let{promoteId:i}=r;if(r.request){let o=await $c(r.request,n);return this._dataUpdateable=au(o.data,i)?su(o.data,i):void 0,o.data}if(typeof r.data=="string")try{let o=JSON.parse(r.data);return this._dataUpdateable=au(o,i)?su(o,i):void 0,o}catch{throw new Error(`Input data given to '${r.source}' is not a valid GeoJSON object.`)}if(!r.dataDiff)throw new Error(`Input data given to '${r.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${r.source}`);return Ny(this._dataUpdateable,r.dataDiff,i),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}async removeSource(r){this._pendingRequest&&this._pendingRequest.abort()}getClusterExpansionZoom(r){return this._geoJSONIndex.getClusterExpansionZoom(r.clusterId)}getClusterChildren(r){return this._geoJSONIndex.getChildren(r.clusterId)}getClusterLeaves(r){return this._geoJSONIndex.getLeaves(r.clusterId,r.limit,r.offset)}};function f0({superclusterOptions:t,clusterProperties:e}){if(!e||!t)return t;let r={},n={},i={accumulated:null,zoom:0},o={properties:null},a=Object.keys(e);for(let s of a){let[u,c]=e[s],p=rr(c),f=rr(typeof u=="string"?[u,["accumulated"],["get",s]]:u);r[s]=p.value,n[s]=f.value}return t.map=s=>{o.properties=s;let u={};for(let c of a)u[c]=r[c].evaluate(i,o);return u},t.reduce=(s,u)=>{o.properties=u;for(let c of a)i.accumulated=s[c],s[c]=n[c].evaluate(i,o)},t}l(f0,"getSuperclusterOptions");var as=class{static{l(this,"Worker")}constructor(e){this.self=e,this.actor=new Mo(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(r,n)=>{if(this.externalWorkerSourceTypes[r])throw new Error(`Worker source with name "${r}" already registered.`);this.externalWorkerSourceTypes[r]=n},this.self.addProtocol=Rc,this.self.removeProtocol=zc,this.self.registerRTLTextPlugin=r=>{Ie.setMethods(r)},this.actor.registerMessageHandler("LDT",(r,n)=>this._getDEMWorkerSource(r,n.source).loadTile(n)),this.actor.registerMessageHandler("RDT",async(r,n)=>{this._getDEMWorkerSource(r,n.source).removeTile(n)}),this.actor.registerMessageHandler("GCEZ",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterExpansionZoom(n)),this.actor.registerMessageHandler("GCC",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterChildren(n)),this.actor.registerMessageHandler("GCL",async(r,n)=>this._getWorkerSource(r,n.type,n.source).getClusterLeaves(n)),this.actor.registerMessageHandler("LD",(r,n)=>this._getWorkerSource(r,n.type,n.source).loadData(n)),this.actor.registerMessageHandler("GD",(r,n)=>this._getWorkerSource(r,n.type,n.source).getData()),this.actor.registerMessageHandler("LT",(r,n)=>this._getWorkerSource(r,n.type,n.source).loadTile(n)),this.actor.registerMessageHandler("RT",(r,n)=>this._getWorkerSource(r,n.type,n.source).reloadTile(n)),this.actor.registerMessageHandler("AT",(r,n)=>this._getWorkerSource(r,n.type,n.source).abortTile(n)),this.actor.registerMessageHandler("RMT",(r,n)=>this._getWorkerSource(r,n.type,n.source).removeTile(n)),this.actor.registerMessageHandler("RS",async(r,n)=>{if(!this.workerSources[r]||!this.workerSources[r][n.type]||!this.workerSources[r][n.type][n.source])return;let i=this.workerSources[r][n.type][n.source];delete this.workerSources[r][n.type][n.source],i.removeSource!==void 0&&i.removeSource(n)}),this.actor.registerMessageHandler("RM",async r=>{delete this.layerIndexes[r],delete this.availableImages[r],delete this.workerSources[r],delete this.demWorkerSources[r]}),this.actor.registerMessageHandler("SR",async(r,n)=>{this.referrer=n}),this.actor.registerMessageHandler("SRPS",(r,n)=>this._syncRTLPluginState(r,n)),this.actor.registerMessageHandler("IS",async(r,n)=>{this.self.importScripts(n)}),this.actor.registerMessageHandler("SI",(r,n)=>this._setImages(r,n)),this.actor.registerMessageHandler("UL",async(r,n)=>{this._getLayerIndex(r).update(n.layers,n.removedIds)}),this.actor.registerMessageHandler("SL",async(r,n)=>{this._getLayerIndex(r).replace(n)})}async _setImages(e,r){this.availableImages[e]=r;for(let n in this.workerSources[e]){let i=this.workerSources[e][n];for(let o in i)i[o].availableImages=r}}async _syncRTLPluginState(e,r){return await Ie.syncState(r,this.self.importScripts)}_getAvailableImages(e){let r=this.availableImages[e];return r||(r=[]),r}_getLayerIndex(e){let r=this.layerIndexes[e];return r||(r=this.layerIndexes[e]=new Na),r}_getWorkerSource(e,r,n){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][r]||(this.workerSources[e][r]={}),!this.workerSources[e][r][n]){let i={sendAsync:l((o,a)=>(o.targetMapId=e,this.actor.sendAsync(o,a)),"sendAsync")};switch(r){case"vector":this.workerSources[e][r][n]=new Zr(i,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][r][n]=new os(i,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][r][n]=new this.externalWorkerSourceTypes[r](i,this._getLayerIndex(e),this._getAvailableImages(e));break}}return this.workerSources[e][r][n]}_getDEMWorkerSource(e,r){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][r]||(this.demWorkerSources[e][r]=new Ja),this.demWorkerSources[e][r]}};ut(self)&&(self.worker=new as(self));})();