{const f=this.tileUrlFunction(d,e,r),h=this.sourceTileCache.containsKey(f)?this.sourceTileCache.get(f):new this.tileClass(d,f?G.IDLE:G.EMPTY,f,this.format_,this.tileLoadFunction);n.sourceTiles.push(h);const g=h.getState();if(g {const f=this.tileUrlFunction(d,e,r),h=this.sourceTileCache.containsKey(f)?this.sourceTileCache.get(f):new this.tileClass(d,f?G.IDLE:G.EMPTY,f,this.format_,this.tileLoadFunction);n.sourceTiles.push(h);const g=h.getState();if(g>1,c=-7,p=r?i-1:0,d=r?-1:1,f=t[e+p];for(p+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=o*256+t[e+p],p+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+t[e+p],p+=d,c-=8);if(o===0)o=1-u;else{if(o===l)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-u}return(f?-1:1)*a*Math.pow(2,o-n)};Or.write=function(t,e,r,n,i,o){var a,s,l,u=o*8-i-1,c=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,h=n?1:-1,g=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=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?e+=d/l:e+=d*Math.pow(2,1-p),e*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*l-1)*Math.pow(2,i),a=a+p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=s&255,f+=h,s/=256,i-=8);for(a=a<0;t[r+f]=a&255,f+=h,a/=256,u-=8);t[r+f-h]|=g*128};var wa=L,Ft=Or;function L(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.Varint=0;L.Fixed64=1;L.Bytes=2;L.Fixed32=5;var Sr=65536*65536,Mn=1/Sr,Ta=12,fi=typeof TextDecoder>"u"?null:new TextDecoder("utf8");L.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pose)i=o-1;else throw new re("Input is not a number.");return 0}class on{constructor(e,r,n){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[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.");const n=r.parse(e[1],1,y);if(!n)return null;const i=[];let o=null;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);for(let a=1;a>1,c=-7,p=r?i-1:0,d=r?-1:1,f=t[e+p];for(p+=d,o=f&(1<<-c)-1,f>>=-c,c+=s;c>0;o=o*256+t[e+p],p+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+t[e+p],p+=d,c-=8);if(o===0)o=1-u;else{if(o===l)return a?NaN:(f?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-u}return(f?-1:1)*a*Math.pow(2,o-n)};Or.write=function(t,e,r,n,i,o){var a,s,l,u=o*8-i-1,c=(1<>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,h=n?1:-1,g=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=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+p>=1?e+=d/l:e+=d*Math.pow(2,1-p),e*l>=2&&(a++,l/=2),a+p>=c?(s=0,a=c):a+p>=1?(s=(e*l-1)*Math.pow(2,i),a=a+p):(s=e*Math.pow(2,p-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=s&255,f+=h,s/=256,i-=8);for(a=a<0;t[r+f]=a&255,f+=h,a/=256,u-=8);t[r+f-h]|=g*128};var wa=L,Ft=Or;function L(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.Varint=0;L.Fixed64=1;L.Bytes=2;L.Fixed32=5;var Sr=65536*65536,Mn=1/Sr,Ta=12,fi=typeof TextDecoder>"u"?null:new TextDecoder("utf8");L.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pose)i=o-1;else throw new re("Input is not a number.");return 0}class on{constructor(e,r,n){this.type=e,this.input=r,this.labels=[],this.outputs=[];for(const[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.");const n=r.parse(e[1],1,y);if(!n)return null;const i=[];let o=null;r.expectedType&&r.expectedType.kind!=="value"&&(o=r.expectedType);for(let a=1;a=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:ye(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],s=e.slice();s[t]=s[0]+i;for(let r=1;r=i[0]||e[1]<=i[1]&&e[3]>=i[1]?!0:ye(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){const t=this.stride,i=this.flatCoordinates[t]-this.flatCoordinates[0],s=e.slice();s[t]=s[0]+i;for(let r=1;r0;){const n=this.get(e);if(t(n,e))return e}return-1},wd=function*(){for(const t of v(this,Et))yield t.value},Sd=function*(){for(const[t,e]of v(this,Et).entries())yield[t,e.value]},De=function(){v(this,vs).value},vn=function(){v(this,vs).value=!v(this,vs).peek()},xs);class wl{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}class si{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}function Z0(i,t,e){let n,s;e=e||xi;let r=0,a=i.length,o=!1;for(;r>1),s=+e(i[n],t),s<0?r=n+1:(a=n,o=!s);return o?r:~r}function xi(i,t){return i>t?1:i{const a=this.loadedTileCallback.bind(this,n,s);return t.forEachLoadedTile(e,s,r,a)}}forEachFeatureAtCoordinate(t,e,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===U.LOADED||e.getState()===U.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=U.LOADED&&e!=U.ERROR&&t.addEventListener(Z.CHANGE,this.boundHandleImageChange_),e==U.IDLE&&(t.load(),e=t.getState()),e==U.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class mf extends si{constructor(t,e,n,s){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=s}}const an=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Qm=an.includes("firefox"),ty=an.includes("safari")&&!an.includes("chrom");ty&&(an.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(an));const ey=an.includes("webkit")&&!an.includes("edge"),yf=an.includes("macintosh"),pf=typeof devicePixelRatio<"u"?devicePixelRatio:1,vf=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Vl=typeof Image<"u"&&Image.prototype.decode,iy=typeof createImageBitmap=="function",xf=function(){let i=!1;try{const t=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return i}();function jt(i,t,e,n){let s;return e&&e.length?s=e.shift():vf?s=new OffscreenCanvas(i||300,t||300):s=document.createElement("canvas"),i&&(s.width=i),t&&(s.height=t),s.getContext("2d",n)}let ph;function Eo(){return ph||(ph=jt(1,1)),ph}function Jo(i){const t=i.canvas;t.width=1,t.height=1,i.clearRect(0,0,1,1)}function wC(i){let t=i.offsetWidth;const e=getComputedStyle(i);return t+=parseInt(e.marginLeft,10)+parseInt(e.marginRight,10),t}function SC(i){let t=i.offsetHeight;const e=getComputedStyle(i);return t+=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),t}function Hc(i,t){const e=t.parentNode;e&&e.replaceChild(i,t)}function Hh(i){return i&&i.parentNode?i.parentNode.removeChild(i):null}function ny(i){for(;i.lastChild;)i.removeChild(i.lastChild)}function sy(i,t){const e=i.childNodes;for(let n=0;;++n){const s=e[n],r=t[n];if(!s&&!r)break;if(s!==r){if(!s){i.appendChild(r);continue}if(!r){i.removeChild(s),--n;continue}i.insertBefore(r,s)}}}class Ef{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(Eo(),{get:(t,e)=>{if(typeof Eo()[e]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,n)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,n),!0)})}pushMethodArgs_=(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this);pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,s=e.length;n.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,r=Math.min(Math.max(0,r),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[r*255,a*255,o*255]};Br.xyz=function(i,t){var e=i[0]/255,n=i[1]/255,s=i[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=e*.41239079926595+n*.35758433938387+s*.18048078840183,a=e*.21263900587151+n*.71516867876775+s*.072192315360733,o=e*.019330818715591+n*.11919477979462+s*.95053215224966;return t=t||Ut.whitepoint[2].E,[r*t[0],a*t[1],o*t[2]]};const Kl={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(i,t,e){var n,s,r,a,o,h,l,c,u,d,f,g,_;if(r=i[0],a=i[1],o=i[2],r===0)return[0,0,0];var m=.0011070564598794539;return t=t||"D65",e=e||2,u=Ut.whitepoint[e][t][0],d=Ut.whitepoint[e][t][1],f=Ut.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),n=a/(13*r)+g||0,s=o/(13*r)+_||0,l=r>8?d*Math.pow((r+16)/116,3):d*r*m,h=l*9*n/(4*s)||0,c=l*(12-3*n-20*s)/(4*s)||0,[h,l,c]}};Ut.luv=function(i,t,e){var n,s,r,a,o,h,l,c,u,d,f,g,_,m=.008856451679035631,y=903.2962962962961;t=t||"D65",e=e||2,u=Ut.whitepoint[e][t][0],d=Ut.whitepoint[e][t][1],f=Ut.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),h=i[0],l=i[1],c=i[2],n=4*h/(h+15*l+3*c)||0,s=9*l/(h+15*l+3*c)||0;var p=l/d;return r=p<=m?y*p:116*Math.pow(p,1/3)-16,a=13*r*(n-g),o=13*r*(s-_),[r,a,o]};var Mf={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(i){var t=i[0],e=i[1],n=i[2],s,r,a;return a=n/360*2*Math.PI,s=e*Math.cos(a),r=e*Math.sin(a),[t,s,r]},xyz:function(i){return Kl.xyz(Mf.luv(i))}};Kl.lchuv=function(i){var t=i[0],e=i[1],n=i[2],s=Math.sqrt(e*e+n*n),r=Math.atan2(n,e),a=r*360/2/Math.PI;return a<0&&(a+=360),[t,s,a]};Ut.lchuv=function(i){return Kl.lchuv(Ut.luv(i))};const Jc={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]};var Qc={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function ry(i){var t,e=[],n=1,s;if(typeof i=="number")return{space:"rgb",values:[i>>>16,(i&65280)>>>8,i&255],alpha:1};if(typeof i=="number")return{space:"rgb",values:[i>>>16,(i&65280)>>>8,i&255],alpha:1};if(i=String(i).toLowerCase(),Jc[i])e=Jc[i].slice(),s="rgb";else if(i==="transparent")n=0,s="rgb",e=[0,0,0];else if(i[0]==="#"){var r=i.slice(1),a=r.length,o=a<=4;n=1,o?(e=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],a===4&&(n=parseInt(r[3]+r[3],16)/255)):(e=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],a===8&&(n=parseInt(r[6]+r[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),s="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(i)){var h=t[1];s=h.replace(/a$/,"");var l=s==="cmyk"?4:s==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=e.shift()),e=e.map(function(c,u){if(c[c.length-1]==="%")return c=parseFloat(c)/100,u===3?c:s==="rgb"?c*255:s[0]==="h"||s[0]==="l"&&!u?c*100:s==="lab"?c*125:s==="lch"?u<2?c*150:c*360:s[0]==="o"&&!u?c:s==="oklab"?c*.4:s==="oklch"?u<2?c*.4:c*360:c;if(s[u]==="h"||u===2&&s[s.length-1]==="h"){if(Qc[c]!==void 0)return Qc[c];if(c.endsWith("deg"))return parseFloat(c);if(c.endsWith("turn"))return parseFloat(c)*360;if(c.endsWith("grad"))return parseFloat(c)*360/400;if(c.endsWith("rad"))return parseFloat(c)*180/Math.PI}return c==="none"?0:parseFloat(c)}),n=e.length>l?e.pop():1}else/[0-9](?:\s|\/|,)/.test(i)&&(e=i.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),s=i.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:s,values:e,alpha:n}}const vh={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(i){var t=i[0]/360,e=i[1]/100,n=i[2]/100,s,r,a,o,h,l=0;if(e===0)return h=n*255,[h,h,h];for(r=n<.5?n*(1+e):n+e-n*e,s=2*n-r,o=[0,0,0];l<3;)a=t+1/3*-(l-1),a<0?a++:a>1&&a--,h=6*a<1?s+(r-s)*6*a:2*a<1?r:3*a<2?s+(r-s)*(2/3-a)*6:s,o[l++]=h*255;return o}};Br.hsl=function(i){var t=i[0]/255,e=i[1]/255,n=i[2]/255,s=Math.min(t,e,n),r=Math.max(t,e,n),a=r-s,o,h,l;return r===s?o=0:t===r?o=(e-n)/a:e===r?o=2+(n-t)/a:n===r&&(o=4+(t-e)/a),o=Math.min(o*60,360),o<0&&(o+=360),l=(s+r)/2,r===s?h=0:l<=.5?h=a/(r+s):h=a/(2-r-s),[o,h*100,l*100]};function ay(i){Array.isArray(i)&&i.raw&&(i=String.raw(...arguments)),i instanceof Number&&(i=+i);var t,e=ry(i);if(!e.space)return[];const n=e.space[0]==="h"?vh.min:Br.min,s=e.space[0]==="h"?vh.max:Br.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],n[0]),s[0]),t[1]=Math.min(Math.max(e.values[1],n[1]),s[1]),t[2]=Math.min(Math.max(e.values[2],n[2]),s[2]),e.space[0]==="h"&&(t=vh.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}function oy(i){return typeof i=="string"?i:Zl(i)}const hy=1024,dr={};let xh=0;function ly(i){if(i.length===4)return i;const t=i.slice();return t[3]=1,t}function tu(i){const t=Ut.lchuv(Br.xyz(i));return t[3]=i[3],t}function cy(i){const t=Ut.rgb(Mf.xyz(i));return t[3]=i[3],t}function $l(i){if(dr.hasOwnProperty(i))return dr[i];if(xh>=hy){let e=0;for(const n in dr)e++&3||(delete dr[n],--xh)}const t=ay(i);if(t.length!==4)throw new Error('Failed to parse "'+i+'" as color');for(const e of t)if(isNaN(e))throw new Error('Failed to parse "'+i+'" as color');return wf(t),dr[i]=t,++xh,t}function Ur(i){return Array.isArray(i)?i:$l(i)}function wf(i){return i[0]=It(i[0]+.5|0,0,255),i[1]=It(i[1]+.5|0,0,255),i[2]=It(i[2]+.5|0,0,255),i[3]=It(i[3],0,1),i}function Zl(i){let t=i[0];t!=(t|0)&&(t=t+.5|0);let e=i[1];e!=(e|0)&&(e=e+.5|0);let n=i[2];n!=(n|0)&&(n=n+.5|0);const s=i[3]===void 0?1:Math.round(i[3]*1e3)/1e3;return"rgba("+t+","+e+","+n+","+s+")"}function uy(i){try{return $l(i),!0}catch{return!1}}const eu=[];let Jn=null;function dy(){Jn=jt(1,1,void 0,{willReadFrequently:!0})}class Hl extends Jm{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=Ge(),this.pixelTransform=Ge(),this.inversePixelTransform=Ge(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,n){Jn||dy(),Jn.clearRect(0,0,1,1);let s;try{Jn.drawImage(t,e,n,1,1,0,0,1,1),s=Jn.getImageData(0,0,1,1).data}catch{return Jn=null,null}return s}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,e,n){const s=this.getLayer().getClassName();let r,a;if(t&&t.className===s&&(!n||t&&t.style.backgroundColor&&ln(Ur(t.style.backgroundColor),Ur(n)))){const o=t.firstElementChild;o instanceof HTMLCanvasElement&&(a=o.getContext("2d"))}if(a&&a.canvas.style.transform===e?(this.container=t,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){r=document.createElement("div"),r.className=s;let o=r.style;o.position="absolute",o.width="100%",o.height="100%",a=jt();const h=a.canvas;r.appendChild(h),o=h.style,o.position="absolute",o.left="0",o.transformOrigin="top left",this.container=r,this.context=a}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const s=Wn(n),r=$o(n),a=Ko(n),o=Vo(n);Ft(e.coordinateToPixelTransform,s),Ft(e.coordinateToPixelTransform,r),Ft(e.coordinateToPixelTransform,a),Ft(e.coordinateToPixelTransform,o);const h=this.inversePixelTransform;Ft(h,s),Ft(h,r),Ft(h,a),Ft(h,o),t.save(),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}prepareContainer(t,e){const n=t.extent,s=t.viewState.resolution,r=t.viewState.rotation,a=t.pixelRatio,o=Math.round(nt(n)/s*a),h=Math.round(Pt(n)/s*a);ei(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,r,-o/2,-h/2),$d(this.inversePixelTransform,this.pixelTransform);const l=z_(this.pixelTransform);if(this.useContainer(e,l,this.getBackground(t)),!this.containerReused){const c=this.context.canvas;c.width!=o||c.height!=h?(c.width=o,c.height=h):this.context.clearRect(0,0,o,h),l!==c.style.transform&&(c.style.transform=l)}}dispatchRenderEvent_(t,e,n){const s=this.getLayer();if(s.hasListener(t)){const r=new mf(t,this.inversePixelTransform,n,e);s.dispatchEvent(r)}}preRender(t,e){this.frameState=e,!e.declutter&&this.dispatchRenderEvent_(Te.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(Te.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new Ef),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(Te.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(Te.POSTRENDER,this.context,t))}getRenderTransform(t,e,n,s,r,a,o){const h=r/2,l=a/2,c=s/e,u=-c,d=-t[0]+o,f=-t[1];return ei(this.tempTransform,h,l,c,u,-n,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class fy extends Hl{constructor(t){super(t),this.image_=null}getImage(){return this.image_?this.image_.getImage():null}prepareFrame(t){const e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,s=t.viewState,r=s.resolution,a=this.getLayer().getSource(),o=t.viewHints;let h=t.extent;if(e.extent!==void 0&&(h=Fn(h,vi(e.extent,s.projection))),!o[Nt.ANIMATING]&&!o[Nt.INTERACTING]&&!Bn(h))if(a){const l=s.projection,c=a.getImage(h,r,n,l);c&&(this.loadImage(c)?this.image_=c:c.getState()===U.EMPTY&&(this.image_=null))}else this.image_=null;return!!this.image_}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),s=Ft(e.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!kn(r,s))return null;const a=this.image_.getExtent(),o=this.image_.getImage(),h=nt(a),l=Math.floor(o.width*((s[0]-a[0])/h));if(l<0||l>=o.width)return null;const c=Pt(a),u=Math.floor(o.height*((a[3]-s[1])/c));return u<0||u>=o.height?null:this.getImageData(o,l,u)}renderFrame(t,e){const n=this.image_,s=n.getExtent(),r=n.getResolution(),[a,o]=Array.isArray(r)?r:[r,r],h=n.getPixelRatio(),l=t.layerStatesArray[t.layerIndex],c=t.pixelRatio,u=t.viewState,d=u.center,f=u.resolution,g=c*a/(f*h),_=c*o/(f*h);this.prepareContainer(t,e);const m=this.context.canvas.width,y=this.context.canvas.height,p=this.getRenderContext(t);let x=!1,M=!0;if(l.extent){const I=vi(l.extent,u.projection);M=ne(I,t.extent),x=M&&!Ve(I,t.extent),x&&this.clipUnrotated(p,t,I)}const E=n.getImage(),w=ei(this.tempTransform,m/2,y/2,g,_,0,h*(s[0]-d[0])/a,h*(d[1]-s[3])/o);this.renderedResolution=o*c/h;const C=E.width*w[0],S=E.height*w[3];if(this.getLayer().getSource().getInterpolate()||(p.imageSmoothingEnabled=!1),this.preRender(p,t),M&&C>=.5&&S>=.5){const I=w[4],z=w[5],F=l.opacity;F!==1&&(p.save(),p.globalAlpha=F),p.drawImage(E,0,0,+E.width,+E.height,I,z,C,S),F!==1&&p.restore()}return this.postRender(this.context,t),x&&p.restore(),p.imageSmoothingEnabled=!0,this.container}}class gy extends Hm{constructor(t){super(t)}createRenderer(){return new fy(this)}getData(t){return super.getData(t)}}class Sf extends ba{constructor(t,e,n,s){super(),this.extent=t,this.pixelRatio_=n,this.resolution=e,this.state=typeof s=="function"?U.IDLE:s,this.image_=null,this.loader=typeof s=="function"?s:null}changed(){this.dispatchEvent(Z.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==U.IDLE&&this.loader){this.state=U.LOADING,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;Rd(()=>this.loader(this.getExtent(),e,this.getPixelRatio())).then(n=>{"image"in n&&(this.image_=n.image),"extent"in n&&(this.extent=n.extent),"resolution"in n&&(this.resolution=n.resolution),"pixelRatio"in n&&(this.pixelRatio_=n.pixelRatio),(n instanceof HTMLImageElement||n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement)&&(this.image_=n),this.state=U.LOADED}).catch(n=>{this.state=U.ERROR,console.error(n)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function _y(i,t,e){const n=i;let s=!0,r=!1,a=!1;const o=[_o(n,Z.LOAD,function(){a=!0,r||t()})];return n.src&&Vl?(r=!0,n.decode().then(function(){s&&t()}).catch(function(h){s&&(a?t():e())})):o.push(_o(n,Z.ERROR,e)),function(){s=!1,o.forEach(Mt)}}function my(i,t){return new Promise((e,n)=>{function s(){a(),e(i)}function r(){a(),n(new Error("Image load error"))}function a(){i.removeEventListener("load",s),i.removeEventListener("error",r)}i.addEventListener("load",s),i.addEventListener("error",r)})}function Cf(i,t){return t&&(i.src=t),i.src&&Vl?new Promise((e,n)=>i.decode().then(()=>e(i)).catch(s=>i.complete&&i.width?e(i):n(s))):my(i)}function Rf(i,t){return t&&(i.src=t),i.src&&Vl&&iy?i.decode().then(()=>createImageBitmap(i)).catch(e=>{if(i.complete&&i.width)return i;throw e}):Cf(i)}const bf=.5,yy=10,iu=.25;class If{constructor(t,e,n,s,r,a){this.sourceProj_=t,this.targetProj_=e;let o={};const h=Gr(this.targetProj_,this.sourceProj_);this.transformInv_=function(p){const x=p[0]+"/"+p[1];return o[x]||(o[x]=h(p)),o[x]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&nt(s)>=nt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?nt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?nt(this.targetProj_.getExtent()):null;const l=Wn(n),c=$o(n),u=Ko(n),d=Vo(n),f=this.transformInv_(l),g=this.transformInv_(c),_=this.transformInv_(u),m=this.transformInv_(d),y=yy+(a?Math.max(0,Math.ceil(Math.log2(yo(n)/(a*a*256*256)))):0);if(this.addQuad_(l,c,u,d,f,g,_,m,y),this.wrapsXInSource_){let p=1/0;this.triangles_.forEach(function(x,M,E){p=Math.min(p,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(x=>{if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-p>this.sourceWorldWidth_/2){const M=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];M[0][0]-p>this.sourceWorldWidth_/2&&(M[0][0]-=this.sourceWorldWidth_),M[1][0]-p>this.sourceWorldWidth_/2&&(M[1][0]-=this.sourceWorldWidth_),M[2][0]-p>this.sourceWorldWidth_/2&&(M[2][0]-=this.sourceWorldWidth_);const E=Math.min(M[0][0],M[1][0],M[2][0]);Math.max(M[0][0],M[1][0],M[2][0])-E=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Za(he.REMOVE,e,t)),e}setAt(t,e){const n=this.getLength();if(t>=n){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Za(he.REMOVE,s,t)),this.dispatchEvent(new Za(he.ADD,e,t))}updateLength_(){this.set(hu.LENGTH,this.array_.length)}assertUnique_(t,e){for(let n=0,s=this.array_.length;nthis.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const n=this.cache_[e];!(t++&3)&&!n.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,n){const s=Ch(t,e,n);return s in this.cache_?this.cache_[s]:null}getPattern(t,e,n){const s=Ch(t,e,n);return s in this.patternCache_?this.patternCache_[s]:null}set(t,e,n,s,r){const a=Ch(t,e,n),o=a in this.cache_;this.cache_[a]=s,r&&(s.getImageState()===U.IDLE&&s.load(),s.getImageState()===U.LOADING?s.ready().then(()=>{this.patternCache_[a]=Eo().createPattern(s.getImage(1),"repeat")}):this.patternCache_[a]=Eo().createPattern(s.getImage(1),"repeat")),o||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Ch(i,t,e){const n=e?Ur(e):"null";return t+":"+i+":"+n}const $e=new Hp;let fr=null;class Jp extends ba{constructor(t,e,n,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=r,this.imageState_=s===void 0?U.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===U.LOADED){fr||(fr=jt(1,1,void 0,{willReadFrequently:!0})),fr.drawImage(this.image_,0,0);try{fr.getImageData(0,0,1,1),this.tainted_=!1}catch{fr=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(Z.CHANGE)}handleImageError_(){this.imageState_=U.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=U.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=jt(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===U.IDLE){this.image_||this.initializeImage_(),this.imageState_=U.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Cf(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==U.LOADED)return;const e=this.image_,n=document.createElement("canvas");n.width=Math.ceil(e.width*t),n.height=Math.ceil(e.height*t);const s=n.getContext("2d");s.scale(t,t),s.drawImage(e,0,0),s.globalCompositeOperation="multiply",s.fillStyle=oy(this.color_),s.fillRect(0,0,n.width/t,n.height/t),s.globalCompositeOperation="destination-in",s.drawImage(e,0,0),this.canvas_[t]=n}ready(){return this.ready_||(this.ready_=new Promise(t=>{this.imageState_===U.LOADED||this.imageState_===U.ERROR?t():this.addEventListener(Z.CHANGE,function e(){(this.imageState_===U.LOADED||this.imageState_===U.ERROR)&&(this.removeEventListener(Z.CHANGE,e),t())})})),this.ready_}}function rc(i,t,e,n,s,r){let a=t===void 0?void 0:$e.get(t,e,s);return a||(a=new Jp(i,i&&"src"in i?i.src||void 0:t,e,n,s),$e.set(t,e,s,a,r)),r&&a&&!$e.getPattern(t,e,s)&&$e.set(t,e,s,a,r),a}class Ri{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,t.color!==void 0&&this.setColor(t.color)}clone(){const t=this.getColor();return new Ri({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(t!==null&&typeof t=="object"&&"src"in t){const e=rc(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),e.getImageState()===U.IDLE&&e.load(),e.getImageState()===U.LOADING&&(this.patternImage_=e)}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function lu(i,t,e,n,s,r,a){let o,h;const l=(e-t)/n;if(l===1)o=t;else if(l===2)o=t,h=s;else if(l!==0){let c=i[t],u=i[t+1],d=0;const f=[0];for(let m=t+n;m0;){const n=this.get(e);if(t(n,e))return e}return-1},wd=function*(){for(const t of v(this,Et))yield t.value},Sd=function*(){for(const[t,e]of v(this,Et).entries())yield[t,e.value]},De=function(){v(this,vs).value},vn=function(){v(this,vs).value=!v(this,vs).peek()},xs);class wl{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}class si{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}function Z0(i,t,e){let n,s;e=e||xi;let r=0,a=i.length,o=!1;for(;r>1),s=+e(i[n],t),s<0?r=n+1:(a=n,o=!s);return o?r:~r}function xi(i,t){return i>t?1:i{const a=this.loadedTileCallback.bind(this,n,s);return t.forEachLoadedTile(e,s,r,a)}}forEachFeatureAtCoordinate(t,e,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===U.LOADED||e.getState()===U.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=U.LOADED&&e!=U.ERROR&&t.addEventListener(Z.CHANGE,this.boundHandleImageChange_),e==U.IDLE&&(t.load(),e=t.getState()),e==U.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class mf extends si{constructor(t,e,n,s){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=s}}const an=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Qm=an.includes("firefox"),ty=an.includes("safari")&&!an.includes("chrom");ty&&(an.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(an));const ey=an.includes("webkit")&&!an.includes("edge"),yf=an.includes("macintosh"),pf=typeof devicePixelRatio<"u"?devicePixelRatio:1,vf=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,Vl=typeof Image<"u"&&Image.prototype.decode,iy=typeof createImageBitmap=="function",xf=function(){let i=!1;try{const t=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return i}();function jt(i,t,e,n){let s;return e&&e.length?s=e.shift():vf?s=new OffscreenCanvas(i||300,t||300):s=document.createElement("canvas"),i&&(s.width=i),t&&(s.height=t),s.getContext("2d",n)}let ph;function Eo(){return ph||(ph=jt(1,1)),ph}function Jo(i){const t=i.canvas;t.width=1,t.height=1,i.clearRect(0,0,1,1)}function wC(i){let t=i.offsetWidth;const e=getComputedStyle(i);return t+=parseInt(e.marginLeft,10)+parseInt(e.marginRight,10),t}function SC(i){let t=i.offsetHeight;const e=getComputedStyle(i);return t+=parseInt(e.marginTop,10)+parseInt(e.marginBottom,10),t}function Hc(i,t){const e=t.parentNode;e&&e.replaceChild(i,t)}function Hh(i){return i&&i.parentNode?i.parentNode.removeChild(i):null}function ny(i){for(;i.lastChild;)i.removeChild(i.lastChild)}function sy(i,t){const e=i.childNodes;for(let n=0;;++n){const s=e[n],r=t[n];if(!s&&!r)break;if(s!==r){if(!s){i.appendChild(r);continue}if(!r){i.removeChild(s),--n;continue}i.insertBefore(r,s)}}}class Ef{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(Eo(),{get:(t,e)=>{if(typeof Eo()[e]=="function")return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,n)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,n),!0)})}pushMethodArgs_=(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this);pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,s=e.length;n.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,r=Math.min(Math.max(0,r),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[r*255,a*255,o*255]};Br.xyz=function(i,t){var e=i[0]/255,n=i[1]/255,s=i[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=e*.41239079926595+n*.35758433938387+s*.18048078840183,a=e*.21263900587151+n*.71516867876775+s*.072192315360733,o=e*.019330818715591+n*.11919477979462+s*.95053215224966;return t=t||Ut.whitepoint[2].E,[r*t[0],a*t[1],o*t[2]]};const $l={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(i,t,e){var n,s,r,a,o,h,l,c,u,d,f,g,_;if(r=i[0],a=i[1],o=i[2],r===0)return[0,0,0];var m=.0011070564598794539;return t=t||"D65",e=e||2,u=Ut.whitepoint[e][t][0],d=Ut.whitepoint[e][t][1],f=Ut.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),n=a/(13*r)+g||0,s=o/(13*r)+_||0,l=r>8?d*Math.pow((r+16)/116,3):d*r*m,h=l*9*n/(4*s)||0,c=l*(12-3*n-20*s)/(4*s)||0,[h,l,c]}};Ut.luv=function(i,t,e){var n,s,r,a,o,h,l,c,u,d,f,g,_,m=.008856451679035631,y=903.2962962962961;t=t||"D65",e=e||2,u=Ut.whitepoint[e][t][0],d=Ut.whitepoint[e][t][1],f=Ut.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),h=i[0],l=i[1],c=i[2],n=4*h/(h+15*l+3*c)||0,s=9*l/(h+15*l+3*c)||0;var p=l/d;return r=p<=m?y*p:116*Math.pow(p,1/3)-16,a=13*r*(n-g),o=13*r*(s-_),[r,a,o]};var Mf={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(i){var t=i[0],e=i[1],n=i[2],s,r,a;return a=n/360*2*Math.PI,s=e*Math.cos(a),r=e*Math.sin(a),[t,s,r]},xyz:function(i){return $l.xyz(Mf.luv(i))}};$l.lchuv=function(i){var t=i[0],e=i[1],n=i[2],s=Math.sqrt(e*e+n*n),r=Math.atan2(n,e),a=r*360/2/Math.PI;return a<0&&(a+=360),[t,s,a]};Ut.lchuv=function(i){return $l.lchuv(Ut.luv(i))};const Jc={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]};var Qc={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function ry(i){var t,e=[],n=1,s;if(typeof i=="number")return{space:"rgb",values:[i>>>16,(i&65280)>>>8,i&255],alpha:1};if(typeof i=="number")return{space:"rgb",values:[i>>>16,(i&65280)>>>8,i&255],alpha:1};if(i=String(i).toLowerCase(),Jc[i])e=Jc[i].slice(),s="rgb";else if(i==="transparent")n=0,s="rgb",e=[0,0,0];else if(i[0]==="#"){var r=i.slice(1),a=r.length,o=a<=4;n=1,o?(e=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],a===4&&(n=parseInt(r[3]+r[3],16)/255)):(e=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],a===8&&(n=parseInt(r[6]+r[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),s="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(i)){var h=t[1];s=h.replace(/a$/,"");var l=s==="cmyk"?4:s==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=e.shift()),e=e.map(function(c,u){if(c[c.length-1]==="%")return c=parseFloat(c)/100,u===3?c:s==="rgb"?c*255:s[0]==="h"||s[0]==="l"&&!u?c*100:s==="lab"?c*125:s==="lch"?u<2?c*150:c*360:s[0]==="o"&&!u?c:s==="oklab"?c*.4:s==="oklch"?u<2?c*.4:c*360:c;if(s[u]==="h"||u===2&&s[s.length-1]==="h"){if(Qc[c]!==void 0)return Qc[c];if(c.endsWith("deg"))return parseFloat(c);if(c.endsWith("turn"))return parseFloat(c)*360;if(c.endsWith("grad"))return parseFloat(c)*360/400;if(c.endsWith("rad"))return parseFloat(c)*180/Math.PI}return c==="none"?0:parseFloat(c)}),n=e.length>l?e.pop():1}else/[0-9](?:\s|\/|,)/.test(i)&&(e=i.match(/([0-9]+)/g).map(function(c){return parseFloat(c)}),s=i.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:s,values:e,alpha:n}}const vh={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(i){var t=i[0]/360,e=i[1]/100,n=i[2]/100,s,r,a,o,h,l=0;if(e===0)return h=n*255,[h,h,h];for(r=n<.5?n*(1+e):n+e-n*e,s=2*n-r,o=[0,0,0];l<3;)a=t+1/3*-(l-1),a<0?a++:a>1&&a--,h=6*a<1?s+(r-s)*6*a:2*a<1?r:3*a<2?s+(r-s)*(2/3-a)*6:s,o[l++]=h*255;return o}};Br.hsl=function(i){var t=i[0]/255,e=i[1]/255,n=i[2]/255,s=Math.min(t,e,n),r=Math.max(t,e,n),a=r-s,o,h,l;return r===s?o=0:t===r?o=(e-n)/a:e===r?o=2+(n-t)/a:n===r&&(o=4+(t-e)/a),o=Math.min(o*60,360),o<0&&(o+=360),l=(s+r)/2,r===s?h=0:l<=.5?h=a/(r+s):h=a/(2-r-s),[o,h*100,l*100]};function ay(i){Array.isArray(i)&&i.raw&&(i=String.raw(...arguments)),i instanceof Number&&(i=+i);var t,e=ry(i);if(!e.space)return[];const n=e.space[0]==="h"?vh.min:Br.min,s=e.space[0]==="h"?vh.max:Br.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],n[0]),s[0]),t[1]=Math.min(Math.max(e.values[1],n[1]),s[1]),t[2]=Math.min(Math.max(e.values[2],n[2]),s[2]),e.space[0]==="h"&&(t=vh.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}function oy(i){return typeof i=="string"?i:Zl(i)}const hy=1024,dr={};let xh=0;function ly(i){if(i.length===4)return i;const t=i.slice();return t[3]=1,t}function tu(i){const t=Ut.lchuv(Br.xyz(i));return t[3]=i[3],t}function cy(i){const t=Ut.rgb(Mf.xyz(i));return t[3]=i[3],t}function Kl(i){if(dr.hasOwnProperty(i))return dr[i];if(xh>=hy){let e=0;for(const n in dr)e++&3||(delete dr[n],--xh)}const t=ay(i);if(t.length!==4)throw new Error('Failed to parse "'+i+'" as color');for(const e of t)if(isNaN(e))throw new Error('Failed to parse "'+i+'" as color');return wf(t),dr[i]=t,++xh,t}function Ur(i){return Array.isArray(i)?i:Kl(i)}function wf(i){return i[0]=It(i[0]+.5|0,0,255),i[1]=It(i[1]+.5|0,0,255),i[2]=It(i[2]+.5|0,0,255),i[3]=It(i[3],0,1),i}function Zl(i){let t=i[0];t!=(t|0)&&(t=t+.5|0);let e=i[1];e!=(e|0)&&(e=e+.5|0);let n=i[2];n!=(n|0)&&(n=n+.5|0);const s=i[3]===void 0?1:Math.round(i[3]*1e3)/1e3;return"rgba("+t+","+e+","+n+","+s+")"}function uy(i){try{return Kl(i),!0}catch{return!1}}const eu=[];let Jn=null;function dy(){Jn=jt(1,1,void 0,{willReadFrequently:!0})}class Hl extends Jm{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=Ge(),this.pixelTransform=Ge(),this.inversePixelTransform=Ge(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,n){Jn||dy(),Jn.clearRect(0,0,1,1);let s;try{Jn.drawImage(t,e,n,1,1,0,0,1,1),s=Jn.getImageData(0,0,1,1).data}catch{return Jn=null,null}return s}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,e,n){const s=this.getLayer().getClassName();let r,a;if(t&&t.className===s&&(!n||t&&t.style.backgroundColor&&ln(Ur(t.style.backgroundColor),Ur(n)))){const o=t.firstElementChild;o instanceof HTMLCanvasElement&&(a=o.getContext("2d"))}if(a&&a.canvas.style.transform===e?(this.container=t,this.context=a,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){r=document.createElement("div"),r.className=s;let o=r.style;o.position="absolute",o.width="100%",o.height="100%",a=jt();const h=a.canvas;r.appendChild(h),o=h.style,o.position="absolute",o.left="0",o.transformOrigin="top left",this.container=r,this.context=a}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const s=Wn(n),r=Ko(n),a=$o(n),o=Vo(n);Ft(e.coordinateToPixelTransform,s),Ft(e.coordinateToPixelTransform,r),Ft(e.coordinateToPixelTransform,a),Ft(e.coordinateToPixelTransform,o);const h=this.inversePixelTransform;Ft(h,s),Ft(h,r),Ft(h,a),Ft(h,o),t.save(),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}prepareContainer(t,e){const n=t.extent,s=t.viewState.resolution,r=t.viewState.rotation,a=t.pixelRatio,o=Math.round(nt(n)/s*a),h=Math.round(Pt(n)/s*a);ei(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,r,-o/2,-h/2),Kd(this.inversePixelTransform,this.pixelTransform);const l=z_(this.pixelTransform);if(this.useContainer(e,l,this.getBackground(t)),!this.containerReused){const c=this.context.canvas;c.width!=o||c.height!=h?(c.width=o,c.height=h):this.context.clearRect(0,0,o,h),l!==c.style.transform&&(c.style.transform=l)}}dispatchRenderEvent_(t,e,n){const s=this.getLayer();if(s.hasListener(t)){const r=new mf(t,this.inversePixelTransform,n,e);s.dispatchEvent(r)}}preRender(t,e){this.frameState=e,!e.declutter&&this.dispatchRenderEvent_(Te.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(Te.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new Ef),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(Te.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(Te.POSTRENDER,this.context,t))}getRenderTransform(t,e,n,s,r,a,o){const h=r/2,l=a/2,c=s/e,u=-c,d=-t[0]+o,f=-t[1];return ei(this.tempTransform,h,l,c,u,-n,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class fy extends Hl{constructor(t){super(t),this.image_=null}getImage(){return this.image_?this.image_.getImage():null}prepareFrame(t){const e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,s=t.viewState,r=s.resolution,a=this.getLayer().getSource(),o=t.viewHints;let h=t.extent;if(e.extent!==void 0&&(h=Fn(h,vi(e.extent,s.projection))),!o[Nt.ANIMATING]&&!o[Nt.INTERACTING]&&!Bn(h))if(a){const l=s.projection,c=a.getImage(h,r,n,l);c&&(this.loadImage(c)?this.image_=c:c.getState()===U.EMPTY&&(this.image_=null))}else this.image_=null;return!!this.image_}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),s=Ft(e.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!kn(r,s))return null;const a=this.image_.getExtent(),o=this.image_.getImage(),h=nt(a),l=Math.floor(o.width*((s[0]-a[0])/h));if(l<0||l>=o.width)return null;const c=Pt(a),u=Math.floor(o.height*((a[3]-s[1])/c));return u<0||u>=o.height?null:this.getImageData(o,l,u)}renderFrame(t,e){const n=this.image_,s=n.getExtent(),r=n.getResolution(),[a,o]=Array.isArray(r)?r:[r,r],h=n.getPixelRatio(),l=t.layerStatesArray[t.layerIndex],c=t.pixelRatio,u=t.viewState,d=u.center,f=u.resolution,g=c*a/(f*h),_=c*o/(f*h);this.prepareContainer(t,e);const m=this.context.canvas.width,y=this.context.canvas.height,p=this.getRenderContext(t);let x=!1,M=!0;if(l.extent){const I=vi(l.extent,u.projection);M=ne(I,t.extent),x=M&&!Ve(I,t.extent),x&&this.clipUnrotated(p,t,I)}const E=n.getImage(),w=ei(this.tempTransform,m/2,y/2,g,_,0,h*(s[0]-d[0])/a,h*(d[1]-s[3])/o);this.renderedResolution=o*c/h;const C=E.width*w[0],S=E.height*w[3];if(this.getLayer().getSource().getInterpolate()||(p.imageSmoothingEnabled=!1),this.preRender(p,t),M&&C>=.5&&S>=.5){const I=w[4],z=w[5],F=l.opacity;F!==1&&(p.save(),p.globalAlpha=F),p.drawImage(E,0,0,+E.width,+E.height,I,z,C,S),F!==1&&p.restore()}return this.postRender(this.context,t),x&&p.restore(),p.imageSmoothingEnabled=!0,this.container}}class gy extends Hm{constructor(t){super(t)}createRenderer(){return new fy(this)}getData(t){return super.getData(t)}}class Sf extends ba{constructor(t,e,n,s){super(),this.extent=t,this.pixelRatio_=n,this.resolution=e,this.state=typeof s=="function"?U.IDLE:s,this.image_=null,this.loader=typeof s=="function"?s:null}changed(){this.dispatchEvent(Z.CHANGE)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==U.IDLE&&this.loader){this.state=U.LOADING,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;Rd(()=>this.loader(this.getExtent(),e,this.getPixelRatio())).then(n=>{"image"in n&&(this.image_=n.image),"extent"in n&&(this.extent=n.extent),"resolution"in n&&(this.resolution=n.resolution),"pixelRatio"in n&&(this.pixelRatio_=n.pixelRatio),(n instanceof HTMLImageElement||n instanceof ImageBitmap||n instanceof HTMLCanvasElement||n instanceof HTMLVideoElement)&&(this.image_=n),this.state=U.LOADED}).catch(n=>{this.state=U.ERROR,console.error(n)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function _y(i,t,e){const n=i;let s=!0,r=!1,a=!1;const o=[_o(n,Z.LOAD,function(){a=!0,r||t()})];return n.src&&Vl?(r=!0,n.decode().then(function(){s&&t()}).catch(function(h){s&&(a?t():e())})):o.push(_o(n,Z.ERROR,e)),function(){s=!1,o.forEach(Mt)}}function my(i,t){return new Promise((e,n)=>{function s(){a(),e(i)}function r(){a(),n(new Error("Image load error"))}function a(){i.removeEventListener("load",s),i.removeEventListener("error",r)}i.addEventListener("load",s),i.addEventListener("error",r)})}function Cf(i,t){return t&&(i.src=t),i.src&&Vl?new Promise((e,n)=>i.decode().then(()=>e(i)).catch(s=>i.complete&&i.width?e(i):n(s))):my(i)}function Rf(i,t){return t&&(i.src=t),i.src&&Vl&&iy?i.decode().then(()=>createImageBitmap(i)).catch(e=>{if(i.complete&&i.width)return i;throw e}):Cf(i)}const bf=.5,yy=10,iu=.25;class If{constructor(t,e,n,s,r,a){this.sourceProj_=t,this.targetProj_=e;let o={};const h=Gr(this.targetProj_,this.sourceProj_);this.transformInv_=function(p){const x=p[0]+"/"+p[1];return o[x]||(o[x]=h(p)),o[x]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&nt(s)>=nt(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?nt(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?nt(this.targetProj_.getExtent()):null;const l=Wn(n),c=Ko(n),u=$o(n),d=Vo(n),f=this.transformInv_(l),g=this.transformInv_(c),_=this.transformInv_(u),m=this.transformInv_(d),y=yy+(a?Math.max(0,Math.ceil(Math.log2(yo(n)/(a*a*256*256)))):0);if(this.addQuad_(l,c,u,d,f,g,_,m,y),this.wrapsXInSource_){let p=1/0;this.triangles_.forEach(function(x,M,E){p=Math.min(p,x.source[0][0],x.source[1][0],x.source[2][0])}),this.triangles_.forEach(x=>{if(Math.max(x.source[0][0],x.source[1][0],x.source[2][0])-p>this.sourceWorldWidth_/2){const M=[[x.source[0][0],x.source[0][1]],[x.source[1][0],x.source[1][1]],[x.source[2][0],x.source[2][1]]];M[0][0]-p>this.sourceWorldWidth_/2&&(M[0][0]-=this.sourceWorldWidth_),M[1][0]-p>this.sourceWorldWidth_/2&&(M[1][0]-=this.sourceWorldWidth_),M[2][0]-p>this.sourceWorldWidth_/2&&(M[2][0]-=this.sourceWorldWidth_);const E=Math.min(M[0][0],M[1][0],M[2][0]);Math.max(M[0][0],M[1][0],M[2][0])-E