osmgl 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/osmgl.js CHANGED
@@ -1,11 +1,11 @@
1
- import Qn from'earcut';import Al from'pbf';import*as ri from'polygon-clipping';var B=Map,ee=Set;var De=class{constructor(){this.listeners=new B;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new ee),o.add(t),this}once(e,t){let o=r=>{this.off(e,o),t(r);};return this.on(e,o)}off(e,t){return this.listeners.get(e)?.delete(t),this}emit(e,t){let o=this.listeners.get(e);if(!o)return this;for(let r of [...o])try{r(t);}catch(n){console.error(`[osmgl] \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A "${e}" \u0431\u0440\u043E\u0441\u0438\u043B \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435:`,n);}return this}removeAllListeners(){this.listeners.clear();}};var we=(i,e,t)=>i<e?e:i>t?t:i;var $e=i=>i*Math.PI/180,_n=i=>i*180/Math.PI;function rt(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var io=i=>1-Math.pow(1-i,3);function he(i){let e=i.trim();if(e[0]==="#"){let o=e.slice(1);if(o.length===3||o.length===4){let r=o.split("").map(n=>parseInt(n+n,16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}if(o.length===6||o.length===8){let r=[];for(let n=0;n<o.length;n+=2)r.push(parseInt(o.slice(n,n+2),16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}}let t=e.match(/^rgba?\(([^)]+)\)$/i);if(t){let o=t[1].split(",").map(r=>parseFloat(r));if(o.length>=3)return [o[0]/255,o[1]/255,o[2]/255,o.length>3?o[3]:1]}return [1,0,1,1]}function _e(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var ao=class{constructor(e){this._program=null;this._vao=null;this._framebuffer=null;this._depthTest=false;this._depthMask=true;this._colorMask=true;this._depthFunc="lequal";this._blend="none";this._cull="none";this._viewport=[0,0,0,0];this._activeTexture=-1;this._boundTextures=new B;this._stencilTest=false;this.screen=null;this.gl=e,this.caps=dl(e),e.enable(e.DEPTH_TEST),this._depthTest=true,e.depthFunc(e.LEQUAL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false);}useProgram(e){return this._program===e?false:(this.gl.useProgram(e),this._program=e,true)}bindVAO(e){this._vao!==e&&(this.gl.bindVertexArray(e),this._vao=e);}bindFramebuffer(e){let t=e??this.screen;this._framebuffer!==t&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this._framebuffer=t);}bindTexture(e,t,o=this.gl.TEXTURE_2D){this._activeTexture!==e&&(this.gl.activeTexture(this.gl.TEXTURE0+e),this._activeTexture=e),this._boundTextures.get(e)!==t&&(this.gl.bindTexture(o,t),this._boundTextures.set(e,t));}viewport(e,t,o,r){let n=this._viewport;n[0]===e&&n[1]===t&&n[2]===o&&n[3]===r||(this.gl.viewport(e,t,o,r),this._viewport=[e,t,o,r]);}setDepthTest(e){this._depthTest!==e&&(e?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTest=e);}setDepthMask(e){this._depthMask!==e&&(this.gl.depthMask(e),this._depthMask=e);}setColorMask(e){this._colorMask!==e&&(this.gl.colorMask(e,e,e,e),this._colorMask=e);}setDepthFunc(e){if(this._depthFunc===e)return;let t=this.gl;this.gl.depthFunc(e==="less"?t.LESS:e==="always"?t.ALWAYS:e==="greater"?t.GREATER:t.LEQUAL),this._depthFunc=e;}setBlend(e){if(this._blend===e)return;let t=this.gl;e==="none"?t.disable(t.BLEND):(this._blend==="none"&&t.enable(t.BLEND),e==="alpha"?t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="premultiplied"?t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="multiply"?t.blendFunc(t.DST_COLOR,t.ZERO):t.blendFunc(t.ONE,t.ONE)),this._blend=e;}setCull(e){if(this._cull===e)return;let t=this.gl;e==="none"?t.disable(t.CULL_FACE):(this._cull==="none"&&t.enable(t.CULL_FACE),t.cullFace(e==="back"?t.BACK:t.FRONT)),this._cull=e;}setStencilTest(e){this._stencilTest!==e&&(e?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTest=e);}clear(e,t=true,o=false){let r=this.gl,n=0;e&&(r.clearColor(e[0],e[1],e[2],e[3]),n|=r.COLOR_BUFFER_BIT),t&&(this.setDepthMask(true),r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT),o&&(r.clearStencil(0),n|=r.STENCIL_BUFFER_BIT),n&&r.clear(n);}invalidateState(){this._program=null,this._vao=null,this._framebuffer=null,this._activeTexture=-1,this._boundTextures.clear(),this._viewport=[-1,-1,-1,-1];}};function dl(i){let e=i.getExtension("EXT_texture_filter_anisotropic")??i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),t=i.getExtension("WEBGL_debug_renderer_info");return {maxTextureSize:i.getParameter(i.MAX_TEXTURE_SIZE),maxVertexAttribs:i.getParameter(i.MAX_VERTEX_ATTRIBS),colorBufferFloat:!!i.getExtension("EXT_color_buffer_float"),anisotropic:e,maxAnisotropy:e?i.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,timerQuery:!!i.getExtension("EXT_disjoint_timer_query_webgl2"),rendererName:t?String(i.getParameter(t.UNMASKED_RENDERER_WEBGL)):"unknown"}}var qe=512,lo=40075016686e-3,Cn=85.051129;function Z(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var Ge=i=>512*Math.pow(2,i),so=i=>Math.max(-Cn,Math.min(Cn,i));function re(i){return (180+i)/360}function ne(i){let e=so(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Se(i){return i*360-180}function Ce(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Ae(i){return lo*Math.cos(i*Math.PI/180)}function Xo(i,e){return i/Ae(e)}function vu(i,e){return i*Ae(e)}function wu(i,e){return Xo(1,i)*Ge(e)}function xu(i,e){return Ae(i)/Ge(e)}function Sn(i,e){let t=Math.pow(2,i);return Ae(Ce((e+.5)/t))/t}function Yo(i){return lo/Math.pow(2,i)}function Mn(i,e,t){let o=Yo(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var Mt=class i{constructor(e,t){this.west=1/0;this.south=1/0;this.east=-1/0;this.north=-1/0;e&&this.extend(e),t&&this.extend(t);}static from(e){let t=new i;for(let o of e)t.extend(o);return t}extend(e){if(e instanceof i)return e.isEmpty()?this:(this.west=Math.min(this.west,e.west),this.south=Math.min(this.south,e.south),this.east=Math.max(this.east,e.east),this.north=Math.max(this.north,e.north),this);let t=Z(e);return this.west=Math.min(this.west,t.lng),this.south=Math.min(this.south,t.lat),this.east=Math.max(this.east,t.lng),this.north=Math.max(this.north,t.lat),this}isEmpty(){return !(this.west<=this.east&&this.south<=this.north)}getCenter(){return {lng:(this.west+this.east)/2,lat:(this.south+this.north)/2}}getSouthWest(){return {lng:this.west,lat:this.south}}getNorthEast(){return {lng:this.east,lat:this.north}}contains(e){let t=Z(e);return t.lng>=this.west&&t.lng<=this.east&&t.lat>=this.south&&t.lat<=this.north}pad(e){if(this.isEmpty())return this;let t=(this.east-this.west)*e,o=(this.north-this.south)*e;return this.west-=t,this.east+=t,this.south-=o,this.north+=o,this}toMercator(){return {minX:re(this.west),maxX:re(this.east),minY:ne(this.north),maxY:ne(this.south)}}};function Ko(i,e){if(i.isEmpty())return null;let t={top:e.padding?.top??0,right:e.padding?.right??0,bottom:e.padding?.bottom??0,left:e.padding?.left??0},o=Math.max(e.width-t.left-t.right,Tn),r=Math.max(e.height-t.top-t.bottom,Tn),n=i.toMercator(),a=e.bearing??0,l=-a*Math.PI/180,s=Math.cos(l),c=Math.sin(l),f=(n.minX+n.maxX)/2,u=(n.minY+n.maxY)/2,h=0,m=0;for(let[v,x]of [[n.minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]){let C=(v-f)*s-(x-u)*c,S=(v-f)*c+(x-u)*s;h=Math.max(h,Math.abs(C)*2),m=Math.max(m,Math.abs(S)*2);}let d=Math.min(o/Math.max(h,1e-12),r/Math.max(m,1e-12)),p=Math.min(Math.max(Math.log2(d/512),e.minZoom??0),e.maxZoom??22),y=Ge(p),b=(t.left-t.right)/2/y,g=(t.top-t.bottom)/2/y;return {center:{lng:Se(f-(b*s+g*c)),lat:Ce(u-(-b*c+g*s))},zoom:p,bearing:a}}var Tn=32;function N(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function Pe(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function xe(i,e,t){let o=e[0],r=e[1],n=e[2],a=e[3],l=e[4],s=e[5],c=e[6],f=e[7],u=e[8],h=e[9],m=e[10],d=e[11],p=e[12],y=e[13],b=e[14],g=e[15];for(let v=0;v<4;v++){let x=t[v*4],C=t[v*4+1],S=t[v*4+2],M=t[v*4+3];i[v*4]=x*o+C*l+S*u+M*p,i[v*4+1]=x*r+C*s+S*h+M*y,i[v*4+2]=x*n+C*c+S*m+M*b,i[v*4+3]=x*a+C*f+S*d+M*g;}return i}function Ie(i,e,t,o,r){return i!==e&&i.set(e),i[12]=e[0]*t+e[4]*o+e[8]*r+e[12],i[13]=e[1]*t+e[5]*o+e[9]*r+e[13],i[14]=e[2]*t+e[6]*o+e[10]*r+e[14],i[15]=e[3]*t+e[7]*o+e[11]*r+e[15],i}function Le(i,e,t,o,r){for(let n=0;n<4;n++)i[n]=e[n]*t,i[4+n]=e[4+n]*o,i[8+n]=e[8+n]*r,i[12+n]=e[12+n];return i}function qo(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[4],a=e[5],l=e[6],s=e[7],c=e[8],f=e[9],u=e[10],h=e[11];return i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=n*r+c*o,i[5]=a*r+f*o,i[6]=l*r+u*o,i[7]=s*r+h*o,i[8]=c*r-n*o,i[9]=f*r-a*o,i[10]=u*r-l*o,i[11]=h*r-s*o,i}function Zo(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[0],a=e[1],l=e[2],s=e[3],c=e[4],f=e[5],u=e[6],h=e[7];return i!==e&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=n*r+c*o,i[1]=a*r+f*o,i[2]=l*r+u*o,i[3]=s*r+h*o,i[4]=c*r-n*o,i[5]=f*r-a*o,i[6]=u*r-l*o,i[7]=h*r-s*o,i}function kn(i,e,t,o,r){let n=1/Math.tan(e/2);return i.fill(0),i[0]=n/t,i[5]=n,i[11]=-1,i[10]=(r+o)/(o-r),i[14]=2*r*o/(o-r),i}function An(i,e,t,o,r,n,a){let l=1/(e-t),s=1/(o-r),c=1/(n-a);return i.fill(0),i[0]=-2*l,i[5]=-2*s,i[10]=2*c,i[12]=(e+t)*l,i[13]=(r+o)*s,i[14]=(a+n)*c,i[15]=1,i}function Fe(i,e){let t=e[0],o=e[1],r=e[2],n=e[3],a=e[4],l=e[5],s=e[6],c=e[7],f=e[8],u=e[9],h=e[10],m=e[11],d=e[12],p=e[13],y=e[14],b=e[15],g=t*l-o*a,v=t*s-r*a,x=t*c-n*a,C=o*s-r*l,S=o*c-n*l,M=r*c-n*s,w=f*p-u*d,_=f*y-h*d,T=f*b-m*d,L=u*y-h*p,k=u*b-m*p,z=h*b-m*y,A=g*z-v*k+x*L+C*T-S*_+M*w;return A?(A=1/A,i[0]=(l*z-s*k+c*L)*A,i[1]=(r*k-o*z-n*L)*A,i[2]=(p*M-y*S+b*C)*A,i[3]=(h*S-u*M-m*C)*A,i[4]=(s*T-a*z-c*_)*A,i[5]=(t*z-r*T+n*_)*A,i[6]=(y*x-d*M-b*v)*A,i[7]=(f*M-h*x+m*v)*A,i[8]=(a*k-l*T+c*w)*A,i[9]=(o*T-t*k-n*w)*A,i[10]=(d*S-p*x+b*g)*A,i[11]=(u*x-f*S-m*g)*A,i[12]=(l*_-a*L-s*w)*A,i[13]=(t*L-o*_+r*w)*A,i[14]=(p*v-d*C-y*g)*A,i[15]=(f*C-u*v+h*g)*A,i):null}function ce(i,e,t){let[o,r,n,a]=t;return i[0]=e[0]*o+e[4]*r+e[8]*n+e[12]*a,i[1]=e[1]*o+e[5]*r+e[9]*n+e[13]*a,i[2]=e[2]*o+e[6]*r+e[10]*n+e[14]*a,i[3]=e[3]*o+e[7]*r+e[11]*n+e[15]*a,i}function He(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function co(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function En(i,e){return [i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function ml(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function $o(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function Ln(i,e,t,o){let r=co(ml(t,e)),n=co(En(r,o)),a=En(n,r);return i[0]=n[0],i[1]=a[0],i[2]=-r[0],i[3]=0,i[4]=n[1],i[5]=a[1],i[6]=-r[1],i[7]=0,i[8]=n[2],i[9]=a[2],i[10]=-r[2],i[11]=0,i[12]=-$o(n,e),i[13]=-$o(a,e),i[14]=$o(r,e),i[15]=1,i}var Tt=60,fo=4.5,Ze=6,uo=i=>i/(2*Math.PI);function ho(i){if(i<=fo)return 0;if(i>=Ze)return 1;let e=(i-fo)/(Ze-fo);return e*e*(3-2*e)}function mo(i,e){let t=i*Math.PI/180,o=so(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function Qo(i){let e=Math.hypot(i[0],i[1],i[2])||1,t=i[0]/e,o=i[1]/e,r=i[2]/e;return {lng:Math.atan2(t,r)*180/Math.PI,lat:Math.asin(-o)*180/Math.PI}}function pl(i,e){return mo(Se(i),Ce(e))}function Jo(i,e){let t=i*Math.PI/180,o=so(e)*Math.PI/180,r=Math.cos(o),n=Math.sin(o);return {east:[Math.cos(t),0,-Math.sin(t)],south:[n*Math.sin(t),r,n*Math.cos(t)],up:[r*Math.sin(t),-n,r*Math.cos(t)]}}function In(i,e,t){let o=i[0]*e,r=i[1]*e,n=i[2]*e;return [o*t.east[0]+r*t.east[1]+n*t.east[2],o*t.south[0]+r*t.south[1]+n*t.south[2],o*t.up[0]+r*t.up[1]+n*t.up[2]-e]}function bl(i,e,t,o,r){let n=i-t;return n>.5&&(n-=1),n<-0.5&&(n+=1),[n*r,(e-o)*r,0]}function Fn(i,e,t,o,r,n,a,l){let s=In(pl(i,e),r,a);if(l<=0)return s;let c=bl(i,e,t,o,n);return [s[0]+(c[0]-s[0])*l,s[1]+(c[1]-s[1])*l,s[2]+(c[2]-s[2])*l]}function er(i,e,t){let o=i[0]*e[0]+i[1]*e[1]+i[2]*e[2],r=i[0]**2+i[1]**2+i[2]**2-t*t,n=o*o-r;if(n<0)return null;let a=-o-Math.sqrt(n);return a<0?null:[i[0]+e[0]*a,i[1]+e[1]*a,i[2]+e[2]*a]}var Rn=1e3,yl=2,zn=84,gl=.42,Et=class i{constructor(){this.width=0;this.height=0;this.minZoom=0;this.maxZoom=22;this.minPitch=0;this.maxPitch=75;this._center={lng:0,lat:0};this._zoom=0;this._bearing=0;this._pitch=0;this._fov=$e(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=N();this._viewProjPx=N();this._viewMatrix=N();this._pixelMatrix=N();this._pixelMatrixInverse=N();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=N();this._localView=N();this._localProj=N();this._localPixel=N();this._localPixelInverse=N();this._localF32=new Float32Array(16);this._globeBasis={east:[1,0,0],south:[0,1,0],up:[0,0,1]};this._objectF32=new Float32Array(16);this._objectMatrix=N();this._shadowView=N();this._shadowProj=N();this._shadowVP=N();this._shadowVPm=N();this._shadowTile=N();this._shadowObject=N();this._shadowTile32=new Float32Array(16);this._shadowObject32=new Float32Array(16);this._shadowValid=false;this._calc();}get center(){return {...this._center}}set center(e){this._center={lng:e.lng,lat:e.lat},this._dirty=true;}globeMinZoom(){let e=Math.max(Math.min(this.width,this.height),1),t=gl*e*2*Math.PI/512;return Math.log2(Math.max(t,1e-6))}effectiveMinZoom(){return this.projection==="globe"?Math.max(this.minZoom,this.globeMinZoom()):this.minZoom}get zoom(){return this._zoom}set zoom(e){let t=we(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=rt(e);t!==this._bearing&&(this._bearing=t,this._dirty=true);}get pitch(){return this._pitch}set pitch(e){let t=this.projection==="globe"&&this._zoom<Ze?Math.min(this.maxPitch,Tt):this.maxPitch,o=we(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return _n(this._fov)}set fov(e){let t=$e(we(e,1,89));t!==this._fov&&(this._fov=t,this._dirty=true);}resize(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this._dirty=true);}get worldSize(){return this._ensure(),this._worldSize}get pixelsPerMeter(){return this._ensure(),this._pixelsPerMeter}get cameraToCenterDistance(){return this._ensure(),this._cameraToCenterDistance}get cameraPositionPx(){return this._ensure(),this._cameraPosPx}get projMatrix(){return this._ensure(),this._projMatrix}get viewMatrix(){return this._ensure(),this._viewMatrix}get centerPointPx(){return this._ensure(),{x:this._centerX,y:this._centerY}}clone(){let e=new i;return e.width=this.width,e.height=this.height,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e.minPitch=this.minPitch,e.maxPitch=this.maxPitch,e._center={...this._center},e._zoom=this._zoom,e._bearing=this._bearing,e._pitch=this._pitch,e._fov=this._fov,e._dirty=true,e}project(e,t=0){this._ensure();let o=[re(e.lng)*this._worldSize,ne(e.lat)*this._worldSize,t,1],r=[0,0,0,0];ce(r,this._pixelMatrix,o);let n=r[3]||1e-9;return {x:r[0]/n,y:r[1]/n}}worldPxToPoint(e,t,o=0){if(this._ensure(),this.globeActive){let n=this.globeLocal(e/this._worldSize,t/this._worldSize),a={lng:Se(e/this._worldSize),lat:Ce(t/this._worldSize)};return this.isOnGlobeFront(a.lng,a.lat,0)?(n[2]+=o*this._pixelsPerMeter,this.localToPoint(n)):null}let r=[0,0,0,0];return ce(r,this._pixelMatrix,[e,t,o,1]),r[3]<=1e-6?null:{x:r[0]/r[3],y:r[1]/r[3]}}unproject(e){if(this.globeActive){let o=this.globeUnproject(e);if(o)return o}let t=this.pointToWorldPx(e);return {lng:Se(t.x/this._worldSize),lat:Ce(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ce(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),ce(o,this._pixelMatrixInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a={x:t[0]/r,y:t[1]/r,z:t[2]/r},l={x:o[0]/n,y:o[1]/n,z:o[2]/n},s=l.z-a.z,c=Math.abs(s)<1e-9?1:(0-a.z)/s,f=we(c,-1e6,1e6);return {x:a.x+(l.x-a.x)*f,y:a.y+(l.y-a.y)*f}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let l=this.globeUnproject(t);if(!l)return;let s=rt(this._center.lng+(e.lng-l.lng)),c=we(this._center.lat+(e.lat-l.lat),-zn,zn);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:re(e.lng)*this._worldSize,y:ne(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Se((this._centerX+n)/this._worldSize),lat:Ce((this._centerY+a)/this._worldSize)},this._dirty=true;}tileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._tileMatrix;return Ie(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Le(n,n,r,r,1),He(this._f32,n)}tileMatrix64(e,t,o=N()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return Ie(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Le(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return Ie(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Le(r,r,this._worldSize,this._worldSize,1),He(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-$e(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,$e(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<Ze}get globeFlatMix(){return this._ensure(),ho(this._zoom)}get globeRadiusPx(){return this._ensure(),uo(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=N();if(!Fe(t,this._localView))return {dir:[0,0,1],horizonCos:1};let o=t[12],r=t[13],n=t[14]+e,a=Math.hypot(o,r,n)||1;return {dir:[o/a,r/a,n/a],horizonCos:e/Math.max(a,e+1e-6)}}localRayCorners(){this._ensure();let e=this.width,t=this.height;return [[0,0],[e,0],[0,t],[e,t]].map(([r,n])=>{let a=[0,0,0,0],l=[0,0,0,0];ce(a,this._localPixelInverse,[r,n,0,1]),ce(l,this._localPixelInverse,[r,n,1,1]);let s=a[3]||1e-9,c=l[3]||1e-9,f=l[0]/c-a[0]/s,u=l[1]/c-a[1]/s,h=l[2]/c-a[2]/s,m=Math.hypot(f,u,h)||1;return [f/m,u/m,h/m]})}globeDisc(){this._ensure();let e=this.globeCamera();return {dir:[-e.dir[0],-e.dir[1],-e.dir[2]],angle:Math.asin(Math.min(e.horizonCos,1))}}localMatrix(){return this._ensure(),He(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),Fn(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,ho(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return ce(t,this._localPixel,[e[0],e[1],e[2],1]),t[3]<=1e-6?null:{x:t[0]/t[3],y:t[1]/t[3]}}globeUnproject(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];ce(t,this._localPixelInverse,[e.x,e.y,0,1]),ce(o,this._localPixelInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a=this.globeRadiusPx,l=[t[0]/r,t[1]/r,t[2]/r+a],s=[o[0]/n-l[0],o[1]/n-l[1],o[2]/n+a-l[2]],c=Math.hypot(s[0],s[1],s[2])||1,f=[s[0]/c,s[1]/c,s[2]/c],u=er(l,f,a);if(!u)return null;let h=this._globeBasis,m=[u[0]/a,u[1]/a,u[2]/a],d=[m[0]*h.east[0]+m[1]*h.south[0]+m[2]*h.up[0],m[0]*h.east[1]+m[1]*h.south[1]+m[2]*h.up[1],m[0]*h.east[2]+m[1]*h.south[2]+m[2]*h.up[2]];return Qo(d)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=mo(e,t),l=[a[0]*n.east[0]+a[1]*n.east[1]+a[2]*n.east[2],a[0]*n.south[0]+a[1]*n.south[1]+a[2]*n.south[2],a[0]*n.up[0]+a[1]*n.up[1]+a[2]*n.up[2]];return l[0]*r.dir[0]+l[1]*r.dir[1]+l[2]*r.dir[2]>=r.horizonCos-o}updateShadow(e,t){this._ensure();let o=Math.max(this.width,this.height)*yl,r=N();if(!Fe(r,this._viewProjPx))return;let n=this._cameraPosPx,a=[],l=[0,0,0,0];for(let C of [-1,1])for(let S of [-1,1])for(let M of [-1,1]){if(ce(l,r,[C,S,M,1]),l[3]===0)continue;let w=l[0]/l[3],_=l[1]/l[3],T=w-n[0],L=_-n[1],k=Math.hypot(T,L);if(k>o){let z=o/k;w=n[0]+T*z,_=n[1]+L*z;}a.push({x:w,y:_,z:0});}if(!a.length)return;let s=co(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;Ln(f,[this._centerX,this._centerY,0],[this._centerX+s[0],this._centerY+s[1],s[2]],c);let u=Math.min(t*this._pixelsPerMeter,o),h=1/0,m=1/0,d=1/0,p=-1/0,y=-1/0,b=-1/0,g=[0,0,0,0];for(let C of a)for(let S of [0,u])ce(g,f,[C.x,C.y,S,1]),g[0]<h&&(h=g[0]),g[0]>p&&(p=g[0]),g[1]<m&&(m=g[1]),g[1]>y&&(y=g[1]),g[2]<d&&(d=g[2]),g[2]>b&&(b=g[2]);let v=u+1,x=this._shadowProj;An(x,h,p,m,y,-b-v,-d+v),xe(this._shadowVP,x,f),Le(this._shadowVPm,this._shadowVP,1,1,this._pixelsPerMeter),this._shadowValid=true;}get shadowReady(){return this._shadowValid}shadowObjectMatrix(e,t,o=0){this._ensure();let r=this._shadowObject;return Ie(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Le(r,r,this._worldSize,this._worldSize,1),He(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return Ie(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Le(n,n,r,r,1),He(this._shadowTile32,n)}shadowDepthPerMeter(){return this._ensure(),Math.abs(this._shadowVPm[10])}shadowTexelWorldSize(e){return 2/(this._shadowVP[0]*e||1)}isTileVisible(e){this._ensure();let t=e.bounds(),o=t.minX*this._worldSize,r=t.maxX*this._worldSize,n=t.minY*this._worldSize,a=t.maxY*this._worldSize,l=Rn*this._pixelsPerMeter;for(let s of this._frustumPlanes){let c=s[0]>0?r:o,f=s[1]>0?a:n,u=s[2]>0?l:0;if(s[0]*c+s[1]*f+s[2]*u+s[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let n=e*this._worldSize,a=t*this._worldSize,l=o*this._pixelsPerMeter,s=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*n+c[1]*a+c[2]*l+c[3]<-s)return false;return true}distanceToTile(e){this._ensure();let t=e.bounds(),[o,r,n]=this._cameraPosPx,a=Math.max(t.minX*this._worldSize-o,0,o-t.maxX*this._worldSize),l=Math.max(t.minY*this._worldSize-r,0,r-t.maxY*this._worldSize),s=Math.max(0-n,0,n-Rn*this._pixelsPerMeter);return Math.hypot(a,l,s)}get flatFarDistance(){return this._ensure(),Math.hypot(this._cameraToCenterDistance,this.width/2,this.height/2)}detailZoom(e){return this._ensure(),this._zoom-Math.max(0,Math.log2(Math.max(e,1)/this.flatFarDistance))}_ensure(){this._dirty&&this._calc();}_calc(){this._dirty=false;let e=Ge(this._zoom);this._worldSize=e,this._pixelsPerMeter=Xo(1,this._center.lat)*e,this._centerX=re(this._center.lng)*e,this._centerY=ne(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=$e(this._pitch),n=-$e(this._bearing),a=.5/Math.tan(this._fov/2)*o;this._cameraToCenterDistance=a;let l=Math.PI/2+r,s=this._fov/2,c=Math.sin(s)*a/Math.sin(we(Math.PI-l-s,.01,Math.PI-.01)),f=Math.cos(Math.PI/2-r)*c+a,u=Math.min(f*1.01,a*30),h=o/50;if(this.projection==="globe"&&this._zoom<Ze){let g=uo(e);h=Math.max(a-g*1.6,a*.02),u=a+g*2.4;}let m=this._viewMatrix;Le(m,N(),1,-1,1),Ie(m,m,0,0,-a),qo(m,m,r),Zo(m,m,n),Ie(m,m,-this._centerX,-this._centerY,0);let d=N();kn(d,this._fov,t/o,h,u),xe(this._viewProjPx,d,m);let p=N();Le(p,m,1,1,this._pixelsPerMeter),xe(this._projMatrix,d,p);let y=this._localView;Le(y,N(),1,-1,1),Ie(y,y,0,0,-a),qo(y,y,r),Zo(y,y,n),xe(this._localProj,d,y),this._globeBasis=Jo(this._center.lng,this._center.lat);let b=N();Le(b,N(),t/2,-o/2,1),Ie(b,b,1,-1,0),xe(this._pixelMatrix,b,this._projMatrix),Fe(this._pixelMatrixInverse,this._pixelMatrix)||console.warn("[osmgl] \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u043A\u0430\u043C\u0435\u0440\u044B \u0432\u044B\u0440\u043E\u0436\u0434\u0435\u043D\u0430, unproject \u0434\u0430\u0441\u0442 \u043C\u0443\u0441\u043E\u0440"),xe(this._localPixel,b,this._localProj),Fe(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=N();if(!Fe(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=N();if(!Fe(e,this._viewProjPx)){this._frustumPlanes=[];return}let t=[];for(let l of [-1,1])for(let s of [-1,1])for(let c of [-1,1]){let f=[0,0,0,0];ce(f,e,[c,s,l,1]);let u=f[3]||1e-9;t.push([f[0]/u,f[1]/u,f[2]/u]);}let o=[[0,1,2],[6,5,4],[0,2,4],[5,3,1],[0,4,1],[3,6,2]];this._frustumPlanes=o.map(([l,s,c])=>{let f=t[l],u=t[s],h=t[c],m=u[0]-f[0],d=u[1]-f[1],p=u[2]-f[2],y=h[0]-f[0],b=h[1]-f[1],g=h[2]-f[2],v=d*g-p*b,x=p*y-m*g,C=m*b-d*y,S=Math.hypot(v,x,C)||1;v/=S,x/=S,C/=S;let M=new Float64Array(4);return M[0]=v,M[1]=x,M[2]=C,M[3]=-(v*f[0]+x*f[1]+C*f[2]),M});let r=0,n=0,a=0;for(let l of t)r+=l[0]/8,n+=l[1]/8,a+=l[2]/8;for(let l of this._frustumPlanes)l[0]*r+l[1]*n+l[2]*a+l[3]<0&&(l[0]=-l[0],l[1]=-l[1],l[2]=-l[2],l[3]=-l[3]);}tileScreenSize(e,t){return this._ensure(),this._worldSize/Math.pow(2,e)*this._cameraToCenterDistance/Math.max(t,1e-6)}visibleWrapRange(){this._ensure();let e=[this.pointToWorldPx({x:0,y:this.height}),this.pointToWorldPx({x:this.width,y:this.height}),this.pointToWorldPx({x:0,y:0}),this.pointToWorldPx({x:this.width,y:0})],t=1/0,o=-1/0;for(let r of e){let n=Math.floor(r.x/this._worldSize);n<t&&(t=n),n>o&&(o=n);}return !isFinite(t)||!isFinite(o)?{min:0,max:0}:{min:we(t,-3,3),max:we(o,-3,3)}}};var vl={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},Pn=2,wl=100,xl=.5,_l=.1,Cl=25,Hn=i=>Math.abs(i.y)>Math.abs(i.x);function Wn(i,e,t){let o=Math.hypot(i.x,i.y)>=Pn,r=Math.hypot(e.x,e.y)>=Pn;return !o&&!r?void 0:!o||!r?t<wl?void 0:false:i.y>0==e.y>0&&Hn(i)&&Hn(e)}function On(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var Sl=160,tr=4,po=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new B;this.dragMode="none";this.lastPoint={x:0,y:0};this.panAnchor=null;this.samples=[];this.inertiaRaf=0;this.touch=null;this.lastTapTime=0;this.disposed=false;this.onContextMenu=e=>{this.opts.dragRotate&&e.preventDefault();};this.onPointerDown=e=>{this.stopInertia(),this.canvas.setPointerCapture(e.pointerId),this.pointers.set(e.pointerId,this.point(e));let t=this.point(e);if(this.pointers.size===2){this.beginTouchGesture();return}if(this.pointers.size>2)return;(e.button===2||e.ctrlKey||e.metaKey)&&this.opts.dragRotate?this.dragMode="rotate":this.opts.dragPan&&(this.dragMode="pan",this.panAnchor=this.tr.unproject(t)),this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.opts.keyboard&&this.canvas.focus({preventScroll:true});};this.onPointerMove=e=>{if(!this.pointers.has(e.pointerId))return;let t=this.point(e);if(this.pointers.set(e.pointerId,t),this.pointers.size>=2){this.updateTouchGesture();return}let o=t.x-this.lastPoint.x,r=t.y-this.lastPoint.y;this.lastPoint=t,this.pushSample(t),this.dragMode==="pan"&&this.panAnchor?(this.tr.setLocationAtPoint(this.panAnchor,t),this.onChange("pan")):this.dragMode==="rotate"&&(this.tr.bearing=this.tr.bearing-o*.4,this.tr.pitch=this.tr.pitch-r*.4,this.onChange("rotate"));};this.onPointerUp=e=>{if(this.pointers.has(e.pointerId)){if(this.pointers.delete(e.pointerId),this.canvas.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId),this.pointers.size===1){let t=[...this.pointers.values()][0];this.touch=null,this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.dragMode=this.opts.dragPan?"pan":"none",this.panAnchor=this.opts.dragPan?this.tr.unproject(t):null;return}if(this.pointers.size>0){this.pointers.size>=2&&this.beginTouchGesture();return}if(this.touch=null,this.dragMode==="pan"&&this.opts.inertia>0&&this.startInertia(),this.dragMode="none",this.panAnchor=null,this.opts.doubleClickZoom&&e.pointerType!=="touch"){let t=performance.now();t-this.lastTapTime<300?(this.zoomAround(this.point(e),e.shiftKey?-1:1),this.lastTapTime=0):this.lastTapTime=t;}this.onInteractionEnd();}};this.onWheel=e=>{if(!this.opts.scrollZoom)return;e.preventDefault(),this.stopInertia();let t=e.deltaY;e.deltaMode===1?t*=40:e.deltaMode===2&&(t*=800);let o=we(-t/200,-2,2);this.zoomAround(this.point(e),o),this.onInteractionEnd();};this.onKeyDown=e=>{if(!this.opts.keyboard)return;let t=e.shiftKey?200:80,o={x:this.tr.width/2,y:this.tr.height/2},r=true;switch(e.key){case "ArrowLeft":e.shiftKey?this.rotateBy(-15,0):this.panBy(-t,0,o);break;case "ArrowRight":e.shiftKey?this.rotateBy(15,0):this.panBy(t,0,o);break;case "ArrowUp":e.shiftKey?this.rotateBy(0,10):this.panBy(0,-t,o);break;case "ArrowDown":e.shiftKey?this.rotateBy(0,-10):this.panBy(0,t,o);break;case "=":case "+":this.zoomAround(o,1);break;case "-":case "_":this.zoomAround(o,-1);break;default:r=false;}r&&(e.preventDefault(),this.onInteractionEnd());};this.opts={...vl,...n},this.bind();}setOptions(e){this.opts={...this.opts,...e};}bind(){let e=this.canvas;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("contextmenu",this.onContextMenu),e.addEventListener("keydown",this.onKeyDown),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.style.touchAction="none";}point(e){let t=this.canvas.getBoundingClientRect();return {x:e.clientX-t.left,y:e.clientY-t.top}}beginTouchGesture(){let[e,t]=[...this.pointers.values()],o=t.x-e.x,r=t.y-e.y,n=Math.hypot(o,r);this.touch={mode:void 0,lastA:e,lastB:t,startA:e,startB:t,startDist:n,startAngle:Math.atan2(r,o),minDist:n,zoomActive:false,rotateActive:false,firstMoveAt:0,pitchPossible:Math.abs(o)>=Math.abs(r)},this.dragMode="none",this.panAnchor=null;}updateTouchGesture(){let e=this.touch;if(!e)return;let[t,o]=[...this.pointers.values()],r={x:t.x-e.lastA.x,y:t.y-e.lastA.y},n={x:o.x-e.lastB.x,y:o.y-e.lastB.y};if(e.mode===void 0){!e.firstMoveAt&&(Math.hypot(r.x,r.y)>0||Math.hypot(n.x,n.y)>0)&&(e.firstMoveAt=performance.now());let a=e.pitchPossible&&this.opts.touchPitch?Wn(r,n,e.firstMoveAt?performance.now()-e.firstMoveAt:0):false;if(a===void 0)return;e.mode=a?"pitch":"zoomRotate";}if(e.mode==="pitch"){let a=(r.y+n.y)/2;a!==0&&(this.tr.pitch=this.tr.pitch-a*xl,this.onChange("pitch"));}else this.opts.touchZoomRotate&&this.applyZoomRotate(e,t,o);e.lastA=t,e.lastB=o;}applyZoomRotate(e,t,o){let r=Math.hypot(o.x-t.x,o.y-t.y),n=Math.atan2(o.y-t.y,o.x-t.x),a={x:(e.lastA.x+e.lastB.x)/2,y:(e.lastA.y+e.lastB.y)/2},l={x:(t.x+o.x)/2,y:(t.y+o.y)/2},s=this.tr.unproject(a),c="pan",f=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&f>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=_l&&(e.zoomActive=true),e.zoomActive)){let u=Math.log2(r/f);u!==0&&(this.tr.zoom=this.tr.zoom+u,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let u=Cl/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(On(n,e.startAngle))>=u&&(e.rotateActive=true),e.rotateActive){let h=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),m=On(n,h);m!==0&&(this.tr.bearing=this.tr.bearing-m,c==="pan"&&(c="rotate"));}}this.tr.setLocationAtPoint(s,l),this.onChange(c);}zoomAround(e,t){let o=this.tr.unproject(e);this.tr.zoom=this.tr.zoom+t,this.tr.setLocationAtPoint(o,e),this.onChange("zoom");}panBy(e,t,o){let r=this.tr.unproject(o);this.tr.setLocationAtPoint(r,{x:o.x-e,y:o.y-t}),this.onChange("pan");}rotateBy(e,t){e&&(this.tr.bearing=this.tr.bearing+e),t&&(this.tr.pitch=this.tr.pitch+t),this.onChange("rotate");}pushSample(e){let t=performance.now();for(this.samples.push({t,x:e.x,y:e.y});this.samples.length>2&&t-this.samples[0].t>Sl;)this.samples.shift();}startInertia(){if(this.samples.length<2)return;let e=this.samples[0],t=this.samples[this.samples.length-1],o=t.t-e.t;if(o<8||performance.now()-t.t>60)return;let r=(t.x-e.x)/o*this.opts.inertia,n=(t.y-e.y)/o*this.opts.inertia,a=Math.hypot(r,n);if(a<.05)return;a>tr&&(r=r/a*tr,n=n/a*tr);let l=performance.now(),s=()=>{if(this.disposed)return;let c=performance.now(),f=Math.min(c-l,34);l=c;let u=Math.exp(-25e-4*f*10);if(r*=u,n*=u,Math.hypot(r,n)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let h={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*f,-n*f,h),this.inertiaRaf=requestAnimationFrame(s);};this.inertiaRaf=requestAnimationFrame(s);}stopInertia(){this.inertiaRaf&&cancelAnimationFrame(this.inertiaRaf),this.inertiaRaf=0;}destroy(){this.disposed=true,this.stopInertia();let e=this.canvas;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("contextmenu",this.onContextMenu),e.removeEventListener("keydown",this.onKeyDown),this.pointers.clear();}};var ye=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let n=e.gl,a=n.createBuffer();if(!a)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=a,e.bindVAO(null),n.bindBuffer(n.ARRAY_BUFFER,a),n.bufferData(n.ARRAY_BUFFER,t,r?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.byteLength=t.byteLength;}update(e,t=0){let o=this.ctx.gl;o.bindBuffer(o.ARRAY_BUFFER,this.buffer),o.bufferSubData(o.ARRAY_BUFFER,t,e);}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},de=class{constructor(e,t){this.ctx=e;let o=e.gl,r=o.createBuffer();if(!r)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=r,e.bindVAO(null),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,r),o.bufferData(o.ELEMENT_ARRAY_BUFFER,t,o.STATIC_DRAW),this.count=t.length,this.type=t instanceof Uint32Array?o.UNSIGNED_INT:o.UNSIGNED_SHORT;}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},fe=class{constructor(e,t,o){this.ctx=e;let r=e.gl,n=r.createVertexArray();if(!n)throw new Error("[osmgl] createVertexArray \u0432\u0435\u0440\u043D\u0443\u043B null");this.vao=n,e.bindVAO(n);for(let{buffer:a,locations:l}of t){r.bindBuffer(r.ARRAY_BUFFER,a.buffer);for(let s of a.layout.attribs){let c=l.get(s.name);c===void 0||c<0||(r.enableVertexAttribArray(c),s.integer?r.vertexAttribIPointer(c,s.size,s.type,a.layout.stride,s.offset):r.vertexAttribPointer(c,s.size,s.type,s.normalized??false,a.layout.stride,s.offset),s.divisor&&r.vertexAttribDivisor(c,s.divisor));}}o&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,o.buffer),e.bindVAO(null);}bind(){this.ctx.bindVAO(this.vao);}destroy(){this.ctx.gl.deleteVertexArray(this.vao);}};var Tl=["a_pos","a_height","a_tint","a_ao","a_normal","a_kind","a_level","a_wall","a_p0","a_p1","a_corner","a_width","a_dist","a_tex"],me=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new B;this.attribs=new B;let a=e.gl,l=El(n),s=Vn(a,a.VERTEX_SHADER,Bn(o,l),`${t}.vert`),c=Vn(a,a.FRAGMENT_SHADER,Bn(r,l),`${t}.frag`),f=a.createProgram();if(!f)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0443 ${t}`);if(a.attachShader(f,s),a.attachShader(f,c),Tl.forEach((u,h)=>a.bindAttribLocation(f,h,u)),a.linkProgram(f),a.detachShader(f,s),a.detachShader(f,c),a.deleteShader(s),a.deleteShader(c),!a.getProgramParameter(f,a.LINK_STATUS)){let u=a.getProgramInfoLog(f);throw a.deleteProgram(f),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${u}`)}this.program=f,this.cacheLocations();}cacheLocations(){let e=this.ctx.gl,t=e.getProgramParameter(this.program,e.ACTIVE_UNIFORMS);for(let r=0;r<t;r++){let n=e.getActiveUniform(this.program,r);if(!n)continue;let a=n.name.replace(/\[0\]$/,"");this.uniforms.set(a,e.getUniformLocation(this.program,n.name));}let o=e.getProgramParameter(this.program,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let n=e.getActiveAttrib(this.program,r);n&&this.attribs.set(n.name,e.getAttribLocation(this.program,n.name));}}use(){this.ctx.useProgram(this.program);}attribLocation(e){return this.attribs.get(e)??-1}loc(e){return this.uniforms.get(e)??null}setMat4(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix4fv(o,false,t);}setMat3(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix3fv(o,false,t);}setFloat(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1f(o,t);}setInt(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1i(o,t);}setVec2(e,t,o){let r=this.loc(e);r&&this.ctx.gl.uniform2f(r,t,o);}setVec3(e,t,o,r){let n=this.loc(e);n&&this.ctx.gl.uniform3f(n,t,o,r);}setVec4(e,t,o,r,n){let a=this.loc(e);a&&this.ctx.gl.uniform4f(a,t,o,r,n);}setVec4v(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform4f(o,t[0],t[1],t[2],t[3]);}setVec4Array(e,t){let o=this.loc(e)??this.loc(`${e}[0]`);o&&this.ctx.gl.uniform4fv(o,t);}destroy(){this.ctx.gl.deleteProgram(this.program),this.uniforms.clear(),this.attribs.clear();}};function El(i){let e=[];for(let[t,o]of Object.entries(i))o!==false&&e.push(o===true?`#define ${t}`:`#define ${t} ${o}`);return e.join(`
2
- `)}function Bn(i,e){if(!e)return i;let t=i.match(/^\s*#version[^\n]*\n/);return t?i.slice(0,t[0].length)+e+`
1
+ import ti from'earcut';import Rl from'pbf';import*as ai from'polygon-clipping';var B=Map,ee=Set;var Ge=class{constructor(){this.listeners=new B;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new ee),o.add(t),this}once(e,t){let o=r=>{this.off(e,o),t(r);};return this.on(e,o)}off(e,t){return this.listeners.get(e)?.delete(t),this}emit(e,t){let o=this.listeners.get(e);if(!o)return this;for(let r of [...o])try{r(t);}catch(n){console.error(`[osmgl] \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u0447\u0438\u043A "${e}" \u0431\u0440\u043E\u0441\u0438\u043B \u0438\u0441\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435:`,n);}return this}removeAllListeners(){this.listeners.clear();}};var we=(i,e,t)=>i<e?e:i>t?t:i;var Ae=i=>i*Math.PI/180,Mn=i=>i*180/Math.PI;function rt(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var ao=i=>1-Math.pow(1-i,3);function ce(i){let e=i.trim();if(e[0]==="#"){let o=e.slice(1);if(o.length===3||o.length===4){let r=o.split("").map(n=>parseInt(n+n,16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}if(o.length===6||o.length===8){let r=[];for(let n=0;n<o.length;n+=2)r.push(parseInt(o.slice(n,n+2),16)/255);return [r[0],r[1],r[2],r.length===4?r[3]:1]}}let t=e.match(/^rgba?\(([^)]+)\)$/i);if(t){let o=t[1].split(",").map(r=>parseFloat(r));if(o.length>=3)return [o[0]/255,o[1]/255,o[2]/255,o.length>3?o[3]:1]}return [1,0,1,1]}function _e(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var lo=class{constructor(e){this._program=null;this._vao=null;this._framebuffer=null;this._depthTest=false;this._depthMask=true;this._colorMask=true;this._depthFunc="lequal";this._blend="none";this._cull="none";this._viewport=[0,0,0,0];this._activeTexture=-1;this._boundTextures=new B;this._stencilTest=false;this.screen=null;this.gl=e,this.caps=yl(e),e.enable(e.DEPTH_TEST),this._depthTest=true,e.depthFunc(e.LEQUAL),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,false);}useProgram(e){return this._program===e?false:(this.gl.useProgram(e),this._program=e,true)}bindVAO(e){this._vao!==e&&(this.gl.bindVertexArray(e),this._vao=e);}bindFramebuffer(e){let t=e??this.screen;this._framebuffer!==t&&(this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,t),this._framebuffer=t);}bindTexture(e,t,o=this.gl.TEXTURE_2D){this._activeTexture!==e&&(this.gl.activeTexture(this.gl.TEXTURE0+e),this._activeTexture=e),this._boundTextures.get(e)!==t&&(this.gl.bindTexture(o,t),this._boundTextures.set(e,t));}viewport(e,t,o,r){let n=this._viewport;n[0]===e&&n[1]===t&&n[2]===o&&n[3]===r||(this.gl.viewport(e,t,o,r),this._viewport=[e,t,o,r]);}setDepthTest(e){this._depthTest!==e&&(e?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._depthTest=e);}setDepthMask(e){this._depthMask!==e&&(this.gl.depthMask(e),this._depthMask=e);}setColorMask(e){this._colorMask!==e&&(this.gl.colorMask(e,e,e,e),this._colorMask=e);}setDepthFunc(e){if(this._depthFunc===e)return;let t=this.gl;this.gl.depthFunc(e==="less"?t.LESS:e==="always"?t.ALWAYS:e==="greater"?t.GREATER:t.LEQUAL),this._depthFunc=e;}setBlend(e){if(this._blend===e)return;let t=this.gl;e==="none"?t.disable(t.BLEND):(this._blend==="none"&&t.enable(t.BLEND),e==="alpha"?t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="premultiplied"?t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA):e==="multiply"?t.blendFunc(t.DST_COLOR,t.ZERO):t.blendFunc(t.ONE,t.ONE)),this._blend=e;}setCull(e){if(this._cull===e)return;let t=this.gl;e==="none"?t.disable(t.CULL_FACE):(this._cull==="none"&&t.enable(t.CULL_FACE),t.cullFace(e==="back"?t.BACK:t.FRONT)),this._cull=e;}setStencilTest(e){this._stencilTest!==e&&(e?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._stencilTest=e);}clear(e,t=true,o=false){let r=this.gl,n=0;e&&(r.clearColor(e[0],e[1],e[2],e[3]),n|=r.COLOR_BUFFER_BIT),t&&(this.setDepthMask(true),r.clearDepth(1),n|=r.DEPTH_BUFFER_BIT),o&&(r.clearStencil(0),n|=r.STENCIL_BUFFER_BIT),n&&r.clear(n);}invalidateState(){this._program=null,this._vao=null,this._framebuffer=null,this._activeTexture=-1,this._boundTextures.clear(),this._viewport=[-1,-1,-1,-1];}};function yl(i){let e=i.getExtension("EXT_texture_filter_anisotropic")??i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),t=i.getExtension("WEBGL_debug_renderer_info");return {maxTextureSize:i.getParameter(i.MAX_TEXTURE_SIZE),maxVertexAttribs:i.getParameter(i.MAX_VERTEX_ATTRIBS),colorBufferFloat:!!i.getExtension("EXT_color_buffer_float"),anisotropic:e,maxAnisotropy:e?i.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1,timerQuery:!!i.getExtension("EXT_disjoint_timer_query_webgl2"),rendererName:t?String(i.getParameter(t.UNMASKED_RENDERER_WEBGL)):"unknown"}}var qe=512,so=40075016686e-3,Tn=85.051129;function Z(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var Ne=i=>512*Math.pow(2,i),co=i=>Math.max(-Tn,Math.min(Tn,i));function oe(i){return (180+i)/360}function re(i){let e=co(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Se(i){return i*360-180}function Ce(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Le(i){return so*Math.cos(i*Math.PI/180)}function Yo(i,e){return i/Le(e)}function _u(i,e){return i*Le(e)}function Cu(i,e){return Yo(1,i)*Ne(e)}function Su(i,e){return Le(i)/Ne(e)}function En(i,e){let t=Math.pow(2,i);return Le(Ce((e+.5)/t))/t}function Ko(i){return so/Math.pow(2,i)}function kn(i,e,t){let o=Ko(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var Tt=class i{constructor(e,t){this.west=1/0;this.south=1/0;this.east=-1/0;this.north=-1/0;e&&this.extend(e),t&&this.extend(t);}static from(e){let t=new i;for(let o of e)t.extend(o);return t}extend(e){if(e instanceof i)return e.isEmpty()?this:(this.west=Math.min(this.west,e.west),this.south=Math.min(this.south,e.south),this.east=Math.max(this.east,e.east),this.north=Math.max(this.north,e.north),this);let t=Z(e);return this.west=Math.min(this.west,t.lng),this.south=Math.min(this.south,t.lat),this.east=Math.max(this.east,t.lng),this.north=Math.max(this.north,t.lat),this}isEmpty(){return !(this.west<=this.east&&this.south<=this.north)}getCenter(){return {lng:(this.west+this.east)/2,lat:(this.south+this.north)/2}}getSouthWest(){return {lng:this.west,lat:this.south}}getNorthEast(){return {lng:this.east,lat:this.north}}contains(e){let t=Z(e);return t.lng>=this.west&&t.lng<=this.east&&t.lat>=this.south&&t.lat<=this.north}pad(e){if(this.isEmpty())return this;let t=(this.east-this.west)*e,o=(this.north-this.south)*e;return this.west-=t,this.east+=t,this.south-=o,this.north+=o,this}toMercator(){return {minX:oe(this.west),maxX:oe(this.east),minY:re(this.north),maxY:re(this.south)}}};function $o(i,e){if(i.isEmpty())return null;let t={top:e.padding?.top??0,right:e.padding?.right??0,bottom:e.padding?.bottom??0,left:e.padding?.left??0},o=Math.max(e.width-t.left-t.right,An),r=Math.max(e.height-t.top-t.bottom,An),n=i.toMercator(),a=e.bearing??0,l=-a*Math.PI/180,s=Math.cos(l),c=Math.sin(l),f=(n.minX+n.maxX)/2,u=(n.minY+n.maxY)/2,d=0,h=0;for(let[v,x]of [[n.minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]){let C=(v-f)*s-(x-u)*c,S=(v-f)*c+(x-u)*s;d=Math.max(d,Math.abs(C)*2),h=Math.max(h,Math.abs(S)*2);}let m=Math.min(o/Math.max(d,1e-12),r/Math.max(h,1e-12)),y=Math.min(Math.max(Math.log2(m/512),e.minZoom??0),e.maxZoom??22),p=Ne(y),b=(t.left-t.right)/2/p,g=(t.top-t.bottom)/2/p;return {center:{lng:Se(f-(b*s+g*c)),lat:Ce(u-(-b*c+g*s))},zoom:y,bearing:a}}var An=32;function N(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function Oe(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function xe(i,e,t){let o=e[0],r=e[1],n=e[2],a=e[3],l=e[4],s=e[5],c=e[6],f=e[7],u=e[8],d=e[9],h=e[10],m=e[11],y=e[12],p=e[13],b=e[14],g=e[15];for(let v=0;v<4;v++){let x=t[v*4],C=t[v*4+1],S=t[v*4+2],M=t[v*4+3];i[v*4]=x*o+C*l+S*u+M*y,i[v*4+1]=x*r+C*s+S*d+M*p,i[v*4+2]=x*n+C*c+S*h+M*b,i[v*4+3]=x*a+C*f+S*m+M*g;}return i}function Re(i,e,t,o,r){return i!==e&&i.set(e),i[12]=e[0]*t+e[4]*o+e[8]*r+e[12],i[13]=e[1]*t+e[5]*o+e[9]*r+e[13],i[14]=e[2]*t+e[6]*o+e[10]*r+e[14],i[15]=e[3]*t+e[7]*o+e[11]*r+e[15],i}function Ie(i,e,t,o,r){for(let n=0;n<4;n++)i[n]=e[n]*t,i[4+n]=e[4+n]*o,i[8+n]=e[8+n]*r,i[12+n]=e[12+n];return i}function Zo(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[4],a=e[5],l=e[6],s=e[7],c=e[8],f=e[9],u=e[10],d=e[11];return i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[4]=n*r+c*o,i[5]=a*r+f*o,i[6]=l*r+u*o,i[7]=s*r+d*o,i[8]=c*r-n*o,i[9]=f*r-a*o,i[10]=u*r-l*o,i[11]=d*r-s*o,i}function Qo(i,e,t){let o=Math.sin(t),r=Math.cos(t),n=e[0],a=e[1],l=e[2],s=e[3],c=e[4],f=e[5],u=e[6],d=e[7];return i!==e&&(i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15]),i[0]=n*r+c*o,i[1]=a*r+f*o,i[2]=l*r+u*o,i[3]=s*r+d*o,i[4]=c*r-n*o,i[5]=f*r-a*o,i[6]=u*r-l*o,i[7]=d*r-s*o,i}function In(i,e,t,o,r){let n=1/Math.tan(e/2);return i.fill(0),i[0]=n/t,i[5]=n,i[11]=-1,i[10]=(r+o)/(o-r),i[14]=2*r*o/(o-r),i}function Fn(i,e,t,o,r,n,a){let l=1/(e-t),s=1/(o-r),c=1/(n-a);return i.fill(0),i[0]=-2*l,i[5]=-2*s,i[10]=2*c,i[12]=(e+t)*l,i[13]=(r+o)*s,i[14]=(a+n)*c,i[15]=1,i}function ze(i,e){let t=e[0],o=e[1],r=e[2],n=e[3],a=e[4],l=e[5],s=e[6],c=e[7],f=e[8],u=e[9],d=e[10],h=e[11],m=e[12],y=e[13],p=e[14],b=e[15],g=t*l-o*a,v=t*s-r*a,x=t*c-n*a,C=o*s-r*l,S=o*c-n*l,M=r*c-n*s,w=f*y-u*m,_=f*p-d*m,T=f*b-h*m,L=u*p-d*y,k=u*b-h*y,z=d*b-h*p,A=g*z-v*k+x*L+C*T-S*_+M*w;return A?(A=1/A,i[0]=(l*z-s*k+c*L)*A,i[1]=(r*k-o*z-n*L)*A,i[2]=(y*M-p*S+b*C)*A,i[3]=(d*S-u*M-h*C)*A,i[4]=(s*T-a*z-c*_)*A,i[5]=(t*z-r*T+n*_)*A,i[6]=(p*x-m*M-b*v)*A,i[7]=(f*M-d*x+h*v)*A,i[8]=(a*k-l*T+c*w)*A,i[9]=(o*T-t*k-n*w)*A,i[10]=(m*S-y*x+b*g)*A,i[11]=(u*x-f*S-h*g)*A,i[12]=(l*_-a*L-s*w)*A,i[13]=(t*L-o*_+r*w)*A,i[14]=(y*v-m*C-p*g)*A,i[15]=(f*C-u*v+d*g)*A,i):null}function fe(i,e,t){let[o,r,n,a]=t;return i[0]=e[0]*o+e[4]*r+e[8]*n+e[12]*a,i[1]=e[1]*o+e[5]*r+e[9]*n+e[13]*a,i[2]=e[2]*o+e[6]*r+e[10]*n+e[14]*a,i[3]=e[3]*o+e[7]*r+e[11]*n+e[15]*a,i}function We(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function fo(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function Ln(i,e){return [i[1]*e[2]-i[2]*e[1],i[2]*e[0]-i[0]*e[2],i[0]*e[1]-i[1]*e[0]]}function gl(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function qo(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function Rn(i,e,t,o){let r=fo(gl(t,e)),n=fo(Ln(r,o)),a=Ln(n,r);return i[0]=n[0],i[1]=a[0],i[2]=-r[0],i[3]=0,i[4]=n[1],i[5]=a[1],i[6]=-r[1],i[7]=0,i[8]=n[2],i[9]=a[2],i[10]=-r[2],i[11]=0,i[12]=-qo(n,e),i[13]=-qo(a,e),i[14]=qo(r,e),i[15]=1,i}var Et=60,uo=4.5,Ze=6,ho=i=>i/(2*Math.PI);function mo(i){if(i<=uo)return 0;if(i>=Ze)return 1;let e=(i-uo)/(Ze-uo);return e*e*(3-2*e)}function po(i,e){let t=i*Math.PI/180,o=co(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function Jo(i){let e=Math.hypot(i[0],i[1],i[2])||1,t=i[0]/e,o=i[1]/e,r=i[2]/e;return {lng:Math.atan2(t,r)*180/Math.PI,lat:Math.asin(-o)*180/Math.PI}}function vl(i,e){return po(Se(i),Ce(e))}function er(i,e){let t=i*Math.PI/180,o=co(e)*Math.PI/180,r=Math.cos(o),n=Math.sin(o);return {east:[Math.cos(t),0,-Math.sin(t)],south:[n*Math.sin(t),r,n*Math.cos(t)],up:[r*Math.sin(t),-n,r*Math.cos(t)]}}function zn(i,e,t){let o=i[0]*e,r=i[1]*e,n=i[2]*e;return [o*t.east[0]+r*t.east[1]+n*t.east[2],o*t.south[0]+r*t.south[1]+n*t.south[2],o*t.up[0]+r*t.up[1]+n*t.up[2]-e]}function wl(i,e,t,o,r){let n=i-t;return n>.5&&(n-=1),n<-0.5&&(n+=1),[n*r,(e-o)*r,0]}function Pn(i,e,t,o,r,n,a,l){let s=zn(vl(i,e),r,a);if(l<=0)return s;let c=wl(i,e,t,o,n);return [s[0]+(c[0]-s[0])*l,s[1]+(c[1]-s[1])*l,s[2]+(c[2]-s[2])*l]}function tr(i,e,t){let o=i[0]*e[0]+i[1]*e[1]+i[2]*e[2],r=i[0]**2+i[1]**2+i[2]**2-t*t,n=o*o-r;if(n<0)return null;let a=-o-Math.sqrt(n);return a<0?null:[i[0]+e[0]*a,i[1]+e[1]*a,i[2]+e[2]*a]}var Hn=1e3,xl=2,On=84,_l=.42,kt=class i{constructor(){this.width=0;this.height=0;this.minZoom=0;this.maxZoom=22;this.minPitch=0;this.maxPitch=75;this._center={lng:0,lat:0};this._zoom=0;this._bearing=0;this._pitch=0;this._fov=Ae(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=N();this._viewProjPx=N();this._viewMatrix=N();this._pixelMatrix=N();this._pixelMatrixInverse=N();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=N();this._localView=N();this._localProj=N();this._localPixel=N();this._localPixelInverse=N();this._localF32=new Float32Array(16);this._globeBasis={east:[1,0,0],south:[0,1,0],up:[0,0,1]};this._objectF32=new Float32Array(16);this._objectMatrix=N();this._shadowView=N();this._shadowProj=N();this._shadowVP=N();this._shadowVPm=N();this._shadowTile=N();this._shadowObject=N();this._shadowTile32=new Float32Array(16);this._shadowObject32=new Float32Array(16);this._shadowValid=false;this._calc();}get center(){return {...this._center}}set center(e){this._center={lng:e.lng,lat:e.lat},this._dirty=true;}globeMinZoom(){let e=Math.max(Math.min(this.width,this.height),1),t=_l*e*2*Math.PI/512;return Math.log2(Math.max(t,1e-6))}effectiveMinZoom(){return this.projection==="globe"?Math.max(this.minZoom,this.globeMinZoom()):this.minZoom}get zoom(){return this._zoom}set zoom(e){let t=we(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=rt(e);t!==this._bearing&&(this._bearing=t,this._dirty=true);}get pitch(){return this._pitch}set pitch(e){let t=this.projection==="globe"&&this._zoom<Ze?Math.min(this.maxPitch,Et):this.maxPitch,o=we(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return Mn(this._fov)}set fov(e){let t=Ae(we(e,1,89));t!==this._fov&&(this._fov=t,this._dirty=true);}resize(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this._dirty=true);}get worldSize(){return this._ensure(),this._worldSize}get pixelsPerMeter(){return this._ensure(),this._pixelsPerMeter}get cameraToCenterDistance(){return this._ensure(),this._cameraToCenterDistance}get cameraPositionPx(){return this._ensure(),this._cameraPosPx}get projMatrix(){return this._ensure(),this._projMatrix}get viewMatrix(){return this._ensure(),this._viewMatrix}get centerPointPx(){return this._ensure(),{x:this._centerX,y:this._centerY}}clone(){let e=new i;return e.width=this.width,e.height=this.height,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e.minPitch=this.minPitch,e.maxPitch=this.maxPitch,e._center={...this._center},e._zoom=this._zoom,e._bearing=this._bearing,e._pitch=this._pitch,e._fov=this._fov,e._dirty=true,e}project(e,t=0){if(this._ensure(),this.globeActive){let a=this.globeLocal(oe(e.lng),re(e.lat));a[2]+=t*this._pixelsPerMeter;let l=this.localToPoint(a);if(l)return l}let o=[oe(e.lng)*this._worldSize,re(e.lat)*this._worldSize,t,1],r=[0,0,0,0];fe(r,this._pixelMatrix,o);let n=r[3]||1e-9;return {x:r[0]/n,y:r[1]/n}}worldPxToPoint(e,t,o=0){if(this._ensure(),this.globeActive){let n=this.globeLocal(e/this._worldSize,t/this._worldSize),a={lng:Se(e/this._worldSize),lat:Ce(t/this._worldSize)};return this.isOnGlobeFront(a.lng,a.lat,0)?(n[2]+=o*this._pixelsPerMeter,this.localToPoint(n)):null}let r=[0,0,0,0];return fe(r,this._pixelMatrix,[e,t,o,1]),r[3]<=1e-6?null:{x:r[0]/r[3],y:r[1]/r[3]}}unproject(e){if(this.globeActive){let o=this.globeUnproject(e);if(o)return o}let t=this.pointToWorldPx(e);return {lng:Se(t.x/this._worldSize),lat:Ce(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];fe(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),fe(o,this._pixelMatrixInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a={x:t[0]/r,y:t[1]/r,z:t[2]/r},l={x:o[0]/n,y:o[1]/n,z:o[2]/n},s=l.z-a.z,c=Math.abs(s)<1e-9?1:(0-a.z)/s,f=we(c,-1e6,1e6);return {x:a.x+(l.x-a.x)*f,y:a.y+(l.y-a.y)*f}}setLocationAtPoint(e,t){if(this._ensure(),this.globeActive){let l=this.globeUnproject(t);if(!l)return;let s=rt(this._center.lng+(e.lng-l.lng)),c=we(this._center.lat+(e.lat-l.lat),-On,On);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:oe(e.lng)*this._worldSize,y:re(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Se((this._centerX+n)/this._worldSize),lat:Ce((this._centerY+a)/this._worldSize)},this._dirty=true;}tileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._tileMatrix;return Re(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Ie(n,n,r,r,1),We(this._f32,n)}tileMatrix64(e,t,o=N()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return Re(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Ie(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return Re(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Ie(r,r,this._worldSize,this._worldSize,1),We(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Ae(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Ae(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<Ze}get globeFlatMix(){return this._ensure(),mo(this._zoom)}get globeRadiusPx(){return this._ensure(),ho(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=N();if(!ze(t,this._localView))return {dir:[0,0,1],horizonCos:1};let o=t[12],r=t[13],n=t[14]+e,a=Math.hypot(o,r,n)||1;return {dir:[o/a,r/a,n/a],horizonCos:e/Math.max(a,e+1e-6)}}localRayCorners(){this._ensure();let e=this.width,t=this.height;return [[0,0],[e,0],[0,t],[e,t]].map(([r,n])=>{let a=[0,0,0,0],l=[0,0,0,0];fe(a,this._localPixelInverse,[r,n,0,1]),fe(l,this._localPixelInverse,[r,n,1,1]);let s=a[3]||1e-9,c=l[3]||1e-9,f=l[0]/c-a[0]/s,u=l[1]/c-a[1]/s,d=l[2]/c-a[2]/s,h=Math.hypot(f,u,d)||1;return [f/h,u/h,d/h]})}cameraRay(){this._ensure();let e=Ae(this._pitch),t=Ae(this._bearing),o=Math.sin(e),r=Math.cos(e),n=Math.sin(t),a=Math.cos(t);return {right:[a,n,0],up:[n*r,-a*r,o],fwd:[n*o,-a*o,-r],focal:this.height/2/Math.tan(this._fov/2),axisElev:e-Math.PI/2}}globeDisc(){this._ensure();let e=this.globeCamera();return {dir:[-e.dir[0],-e.dir[1],-e.dir[2]],angle:Math.asin(Math.min(e.horizonCos,1))}}localMatrix(){return this._ensure(),We(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),Pn(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,mo(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return fe(t,this._localPixel,[e[0],e[1],e[2],1]),t[3]<=1e-6?null:{x:t[0]/t[3],y:t[1]/t[3]}}globeUnproject(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];fe(t,this._localPixelInverse,[e.x,e.y,0,1]),fe(o,this._localPixelInverse,[e.x,e.y,1,1]);let r=t[3]||1e-9,n=o[3]||1e-9,a=this.globeRadiusPx,l=[t[0]/r,t[1]/r,t[2]/r+a],s=[o[0]/n-l[0],o[1]/n-l[1],o[2]/n+a-l[2]],c=Math.hypot(s[0],s[1],s[2])||1,f=[s[0]/c,s[1]/c,s[2]/c],u=tr(l,f,a);if(!u)return null;let d=this._globeBasis,h=[u[0]/a,u[1]/a,u[2]/a],m=[h[0]*d.east[0]+h[1]*d.south[0]+h[2]*d.up[0],h[0]*d.east[1]+h[1]*d.south[1]+h[2]*d.up[1],h[0]*d.east[2]+h[1]*d.south[2]+h[2]*d.up[2]];return Jo(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=po(e,t),l=[a[0]*n.east[0]+a[1]*n.east[1]+a[2]*n.east[2],a[0]*n.south[0]+a[1]*n.south[1]+a[2]*n.south[2],a[0]*n.up[0]+a[1]*n.up[1]+a[2]*n.up[2]];return l[0]*r.dir[0]+l[1]*r.dir[1]+l[2]*r.dir[2]>=r.horizonCos-o}updateShadow(e,t){this._ensure();let o=Math.max(this.width,this.height)*xl,r=N();if(!ze(r,this._viewProjPx))return;let n=this._cameraPosPx,a=[],l=[0,0,0,0];for(let C of [-1,1])for(let S of [-1,1])for(let M of [-1,1]){if(fe(l,r,[C,S,M,1]),l[3]===0)continue;let w=l[0]/l[3],_=l[1]/l[3],T=w-n[0],L=_-n[1],k=Math.hypot(T,L);if(k>o){let z=o/k;w=n[0]+T*z,_=n[1]+L*z;}a.push({x:w,y:_,z:0});}if(!a.length)return;let s=fo(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;Rn(f,[this._centerX,this._centerY,0],[this._centerX+s[0],this._centerY+s[1],s[2]],c);let u=Math.min(t*this._pixelsPerMeter,o),d=1/0,h=1/0,m=1/0,y=-1/0,p=-1/0,b=-1/0,g=[0,0,0,0];for(let C of a)for(let S of [0,u])fe(g,f,[C.x,C.y,S,1]),g[0]<d&&(d=g[0]),g[0]>y&&(y=g[0]),g[1]<h&&(h=g[1]),g[1]>p&&(p=g[1]),g[2]<m&&(m=g[2]),g[2]>b&&(b=g[2]);let v=u+1,x=this._shadowProj;Fn(x,d,y,h,p,-b-v,-m+v),xe(this._shadowVP,x,f),Ie(this._shadowVPm,this._shadowVP,1,1,this._pixelsPerMeter),this._shadowValid=true;}get shadowReady(){return this._shadowValid}shadowObjectMatrix(e,t,o=0){this._ensure();let r=this._shadowObject;return Re(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Ie(r,r,this._worldSize,this._worldSize,1),We(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return Re(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Ie(n,n,r,r,1),We(this._shadowTile32,n)}shadowDepthPerMeter(){return this._ensure(),Math.abs(this._shadowVPm[10])}shadowTexelWorldSize(e){return 2/(this._shadowVP[0]*e||1)}isTileVisible(e){this._ensure();let t=e.bounds(),o=t.minX*this._worldSize,r=t.maxX*this._worldSize,n=t.minY*this._worldSize,a=t.maxY*this._worldSize,l=Hn*this._pixelsPerMeter;for(let s of this._frustumPlanes){let c=s[0]>0?r:o,f=s[1]>0?a:n,u=s[2]>0?l:0;if(s[0]*c+s[1]*f+s[2]*u+s[3]<0)return false}return true}isSphereVisible(e,t,o,r){this._ensure();let n=e*this._worldSize,a=t*this._worldSize,l=o*this._pixelsPerMeter,s=r*this._pixelsPerMeter;for(let c of this._frustumPlanes)if(c[0]*n+c[1]*a+c[2]*l+c[3]<-s)return false;return true}distanceToTile(e){this._ensure();let t=e.bounds(),[o,r,n]=this._cameraPosPx,a=Math.max(t.minX*this._worldSize-o,0,o-t.maxX*this._worldSize),l=Math.max(t.minY*this._worldSize-r,0,r-t.maxY*this._worldSize),s=Math.max(0-n,0,n-Hn*this._pixelsPerMeter);return Math.hypot(a,l,s)}get flatFarDistance(){return this._ensure(),Math.hypot(this._cameraToCenterDistance,this.width/2,this.height/2)}detailZoom(e){return this._ensure(),this._zoom-Math.max(0,Math.log2(Math.max(e,1)/this.flatFarDistance))}_ensure(){this._dirty&&this._calc();}_calc(){this._dirty=false;let e=Ne(this._zoom);this._worldSize=e,this._pixelsPerMeter=Yo(1,this._center.lat)*e,this._centerX=oe(this._center.lng)*e,this._centerY=re(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Ae(this._pitch),n=-Ae(this._bearing),a=.5/Math.tan(this._fov/2)*o;this._cameraToCenterDistance=a;let l=Math.PI/2+r,s=this._fov/2,c=Math.sin(s)*a/Math.sin(we(Math.PI-l-s,.01,Math.PI-.01)),f=Math.cos(Math.PI/2-r)*c+a,u=Math.min(f*1.01,a*30),d=o/50;if(this.projection==="globe"&&this._zoom<Ze){let g=ho(e);d=Math.max(a-g*1.6,a*.02),u=a+g*2.4;}let h=this._viewMatrix;Ie(h,N(),1,-1,1),Re(h,h,0,0,-a),Zo(h,h,r),Qo(h,h,n),Re(h,h,-this._centerX,-this._centerY,0);let m=N();In(m,this._fov,t/o,d,u),xe(this._viewProjPx,m,h);let y=N();Ie(y,h,1,1,this._pixelsPerMeter),xe(this._projMatrix,m,y);let p=this._localView;Ie(p,N(),1,-1,1),Re(p,p,0,0,-a),Zo(p,p,r),Qo(p,p,n),xe(this._localProj,m,p),this._globeBasis=er(this._center.lng,this._center.lat);let b=N();Ie(b,N(),t/2,-o/2,1),Re(b,b,1,-1,0),xe(this._pixelMatrix,b,this._projMatrix),ze(this._pixelMatrixInverse,this._pixelMatrix)||console.warn("[osmgl] \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u043A\u0430\u043C\u0435\u0440\u044B \u0432\u044B\u0440\u043E\u0436\u0434\u0435\u043D\u0430, unproject \u0434\u0430\u0441\u0442 \u043C\u0443\u0441\u043E\u0440"),xe(this._localPixel,b,this._localProj),ze(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=N();if(!ze(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=N();if(!ze(e,this._viewProjPx)){this._frustumPlanes=[];return}let t=[];for(let l of [-1,1])for(let s of [-1,1])for(let c of [-1,1]){let f=[0,0,0,0];fe(f,e,[c,s,l,1]);let u=f[3]||1e-9;t.push([f[0]/u,f[1]/u,f[2]/u]);}let o=[[0,1,2],[6,5,4],[0,2,4],[5,3,1],[0,4,1],[3,6,2]];this._frustumPlanes=o.map(([l,s,c])=>{let f=t[l],u=t[s],d=t[c],h=u[0]-f[0],m=u[1]-f[1],y=u[2]-f[2],p=d[0]-f[0],b=d[1]-f[1],g=d[2]-f[2],v=m*g-y*b,x=y*p-h*g,C=h*b-m*p,S=Math.hypot(v,x,C)||1;v/=S,x/=S,C/=S;let M=new Float64Array(4);return M[0]=v,M[1]=x,M[2]=C,M[3]=-(v*f[0]+x*f[1]+C*f[2]),M});let r=0,n=0,a=0;for(let l of t)r+=l[0]/8,n+=l[1]/8,a+=l[2]/8;for(let l of this._frustumPlanes)l[0]*r+l[1]*n+l[2]*a+l[3]<0&&(l[0]=-l[0],l[1]=-l[1],l[2]=-l[2],l[3]=-l[3]);}tileScreenSize(e,t){return this._ensure(),this._worldSize/Math.pow(2,e)*this._cameraToCenterDistance/Math.max(t,1e-6)}visibleWrapRange(){this._ensure();let e=[this.pointToWorldPx({x:0,y:this.height}),this.pointToWorldPx({x:this.width,y:this.height}),this.pointToWorldPx({x:0,y:0}),this.pointToWorldPx({x:this.width,y:0})],t=1/0,o=-1/0;for(let r of e){let n=Math.floor(r.x/this._worldSize);n<t&&(t=n),n>o&&(o=n);}return !isFinite(t)||!isFinite(o)?{min:0,max:0}:{min:we(t,-3,3),max:we(o,-3,3)}}};var Cl={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},Wn=2,Sl=100,Ml=.5,Tl=.1,El=25,Bn=i=>Math.abs(i.y)>Math.abs(i.x);function Dn(i,e,t){let o=Math.hypot(i.x,i.y)>=Wn,r=Math.hypot(e.x,e.y)>=Wn;return !o&&!r?void 0:!o||!r?t<Sl?void 0:false:i.y>0==e.y>0&&Bn(i)&&Bn(e)}function Vn(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var kl=160,or=4,bo=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new B;this.dragMode="none";this.lastPoint={x:0,y:0};this.panAnchor=null;this.samples=[];this.inertiaRaf=0;this.touch=null;this.lastTapTime=0;this.disposed=false;this.onContextMenu=e=>{this.opts.dragRotate&&e.preventDefault();};this.onPointerDown=e=>{this.stopInertia(),this.canvas.setPointerCapture(e.pointerId),this.pointers.set(e.pointerId,this.point(e));let t=this.point(e);if(this.pointers.size===2){this.beginTouchGesture();return}if(this.pointers.size>2)return;(e.button===2||e.ctrlKey||e.metaKey)&&this.opts.dragRotate?this.dragMode="rotate":this.opts.dragPan&&(this.dragMode="pan",this.panAnchor=this.tr.unproject(t)),this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.opts.keyboard&&this.canvas.focus({preventScroll:true});};this.onPointerMove=e=>{if(!this.pointers.has(e.pointerId))return;let t=this.point(e);if(this.pointers.set(e.pointerId,t),this.pointers.size>=2){this.updateTouchGesture();return}let o=t.x-this.lastPoint.x,r=t.y-this.lastPoint.y;this.lastPoint=t,this.pushSample(t),this.dragMode==="pan"&&this.panAnchor?(this.tr.setLocationAtPoint(this.panAnchor,t),this.onChange("pan")):this.dragMode==="rotate"&&(this.tr.bearing=this.tr.bearing-o*.4,this.tr.pitch=this.tr.pitch-r*.4,this.onChange("rotate"));};this.onPointerUp=e=>{if(this.pointers.has(e.pointerId)){if(this.pointers.delete(e.pointerId),this.canvas.hasPointerCapture(e.pointerId)&&this.canvas.releasePointerCapture(e.pointerId),this.pointers.size===1){let t=[...this.pointers.values()][0];this.touch=null,this.lastPoint=t,this.samples=[{t:performance.now(),x:t.x,y:t.y}],this.dragMode=this.opts.dragPan?"pan":"none",this.panAnchor=this.opts.dragPan?this.tr.unproject(t):null;return}if(this.pointers.size>0){this.pointers.size>=2&&this.beginTouchGesture();return}if(this.touch=null,this.dragMode==="pan"&&this.opts.inertia>0&&this.startInertia(),this.dragMode="none",this.panAnchor=null,this.opts.doubleClickZoom&&e.pointerType!=="touch"){let t=performance.now();t-this.lastTapTime<300?(this.zoomAround(this.point(e),e.shiftKey?-1:1),this.lastTapTime=0):this.lastTapTime=t;}this.onInteractionEnd();}};this.onWheel=e=>{if(!this.opts.scrollZoom)return;e.preventDefault(),this.stopInertia();let t=e.deltaY;e.deltaMode===1?t*=40:e.deltaMode===2&&(t*=800);let o=we(-t/200,-2,2);this.zoomAround(this.point(e),o),this.onInteractionEnd();};this.onKeyDown=e=>{if(!this.opts.keyboard)return;let t=e.shiftKey?200:80,o={x:this.tr.width/2,y:this.tr.height/2},r=true;switch(e.key){case "ArrowLeft":e.shiftKey?this.rotateBy(-15,0):this.panBy(-t,0,o);break;case "ArrowRight":e.shiftKey?this.rotateBy(15,0):this.panBy(t,0,o);break;case "ArrowUp":e.shiftKey?this.rotateBy(0,10):this.panBy(0,-t,o);break;case "ArrowDown":e.shiftKey?this.rotateBy(0,-10):this.panBy(0,t,o);break;case "=":case "+":this.zoomAround(o,1);break;case "-":case "_":this.zoomAround(o,-1);break;default:r=false;}r&&(e.preventDefault(),this.onInteractionEnd());};this.opts={...Cl,...n},this.bind();}setOptions(e){this.opts={...this.opts,...e};}bind(){let e=this.canvas;e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("contextmenu",this.onContextMenu),e.addEventListener("keydown",this.onKeyDown),e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),e.style.touchAction="none";}point(e){let t=this.canvas.getBoundingClientRect();return {x:e.clientX-t.left,y:e.clientY-t.top}}beginTouchGesture(){let[e,t]=[...this.pointers.values()],o=t.x-e.x,r=t.y-e.y,n=Math.hypot(o,r);this.touch={mode:void 0,lastA:e,lastB:t,startA:e,startB:t,startDist:n,startAngle:Math.atan2(r,o),minDist:n,zoomActive:false,rotateActive:false,firstMoveAt:0,pitchPossible:Math.abs(o)>=Math.abs(r)},this.dragMode="none",this.panAnchor=null;}updateTouchGesture(){let e=this.touch;if(!e)return;let[t,o]=[...this.pointers.values()],r={x:t.x-e.lastA.x,y:t.y-e.lastA.y},n={x:o.x-e.lastB.x,y:o.y-e.lastB.y};if(e.mode===void 0){!e.firstMoveAt&&(Math.hypot(r.x,r.y)>0||Math.hypot(n.x,n.y)>0)&&(e.firstMoveAt=performance.now());let a=e.pitchPossible&&this.opts.touchPitch?Dn(r,n,e.firstMoveAt?performance.now()-e.firstMoveAt:0):false;if(a===void 0)return;e.mode=a?"pitch":"zoomRotate";}if(e.mode==="pitch"){let a=(r.y+n.y)/2;a!==0&&(this.tr.pitch=this.tr.pitch-a*Ml,this.onChange("pitch"));}else this.opts.touchZoomRotate&&this.applyZoomRotate(e,t,o);e.lastA=t,e.lastB=o;}applyZoomRotate(e,t,o){let r=Math.hypot(o.x-t.x,o.y-t.y),n=Math.atan2(o.y-t.y,o.x-t.x),a={x:(e.lastA.x+e.lastB.x)/2,y:(e.lastA.y+e.lastB.y)/2},l={x:(t.x+o.x)/2,y:(t.y+o.y)/2},s=this.tr.unproject(a),c="pan",f=Math.hypot(e.lastB.x-e.lastA.x,e.lastB.y-e.lastA.y);if(r>0&&f>0&&e.startDist>0&&(!e.zoomActive&&Math.abs(Math.log2(r/e.startDist))>=Tl&&(e.zoomActive=true),e.zoomActive)){let u=Math.log2(r/f);u!==0&&(this.tr.zoom=this.tr.zoom+u,c="zoom");}if(this.opts.dragRotate){e.minDist=Math.min(e.minDist,r);let u=El/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(Vn(n,e.startAngle))>=u&&(e.rotateActive=true),e.rotateActive){let d=Math.atan2(e.lastB.y-e.lastA.y,e.lastB.x-e.lastA.x),h=Vn(n,d);h!==0&&(this.tr.bearing=this.tr.bearing-h,c==="pan"&&(c="rotate"));}}this.tr.setLocationAtPoint(s,l),this.onChange(c);}zoomAround(e,t){let o=this.tr.unproject(e);this.tr.zoom=this.tr.zoom+t,this.tr.setLocationAtPoint(o,e),this.onChange("zoom");}panBy(e,t,o){let r=this.tr.unproject(o);this.tr.setLocationAtPoint(r,{x:o.x-e,y:o.y-t}),this.onChange("pan");}rotateBy(e,t){e&&(this.tr.bearing=this.tr.bearing+e),t&&(this.tr.pitch=this.tr.pitch+t),this.onChange("rotate");}pushSample(e){let t=performance.now();for(this.samples.push({t,x:e.x,y:e.y});this.samples.length>2&&t-this.samples[0].t>kl;)this.samples.shift();}startInertia(){if(this.samples.length<2)return;let e=this.samples[0],t=this.samples[this.samples.length-1],o=t.t-e.t;if(o<8||performance.now()-t.t>60)return;let r=(t.x-e.x)/o*this.opts.inertia,n=(t.y-e.y)/o*this.opts.inertia,a=Math.hypot(r,n);if(a<.05)return;a>or&&(r=r/a*or,n=n/a*or);let l=performance.now(),s=()=>{if(this.disposed)return;let c=performance.now(),f=Math.min(c-l,34);l=c;let u=Math.exp(-25e-4*f*10);if(r*=u,n*=u,Math.hypot(r,n)<.01){this.inertiaRaf=0,this.onInteractionEnd();return}let d={x:this.tr.width/2,y:this.tr.height/2};this.panBy(-r*f,-n*f,d),this.inertiaRaf=requestAnimationFrame(s);};this.inertiaRaf=requestAnimationFrame(s);}stopInertia(){this.inertiaRaf&&cancelAnimationFrame(this.inertiaRaf),this.inertiaRaf=0;}destroy(){this.disposed=true,this.stopInertia();let e=this.canvas;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("contextmenu",this.onContextMenu),e.removeEventListener("keydown",this.onKeyDown),this.pointers.clear();}};var ye=class{constructor(e,t,o,r=false){this.ctx=e;this.layout=o;let n=e.gl,a=n.createBuffer();if(!a)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=a,e.bindVAO(null),n.bindBuffer(n.ARRAY_BUFFER,a),n.bufferData(n.ARRAY_BUFFER,t,r?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.byteLength=t.byteLength;}update(e,t=0){let o=this.ctx.gl;o.bindBuffer(o.ARRAY_BUFFER,this.buffer),o.bufferSubData(o.ARRAY_BUFFER,t,e);}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},he=class{constructor(e,t){this.ctx=e;let o=e.gl,r=o.createBuffer();if(!r)throw new Error("[osmgl] createBuffer \u0432\u0435\u0440\u043D\u0443\u043B null");this.buffer=r,e.bindVAO(null),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,r),o.bufferData(o.ELEMENT_ARRAY_BUFFER,t,o.STATIC_DRAW),this.count=t.length,this.type=t instanceof Uint32Array?o.UNSIGNED_INT:o.UNSIGNED_SHORT;}destroy(){this.ctx.gl.deleteBuffer(this.buffer);}},ue=class{constructor(e,t,o){this.ctx=e;let r=e.gl,n=r.createVertexArray();if(!n)throw new Error("[osmgl] createVertexArray \u0432\u0435\u0440\u043D\u0443\u043B null");this.vao=n,e.bindVAO(n);for(let{buffer:a,locations:l}of t){r.bindBuffer(r.ARRAY_BUFFER,a.buffer);for(let s of a.layout.attribs){let c=l.get(s.name);c===void 0||c<0||(r.enableVertexAttribArray(c),s.integer?r.vertexAttribIPointer(c,s.size,s.type,a.layout.stride,s.offset):r.vertexAttribPointer(c,s.size,s.type,s.normalized??false,a.layout.stride,s.offset),s.divisor&&r.vertexAttribDivisor(c,s.divisor));}}o&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,o.buffer),e.bindVAO(null);}bind(){this.ctx.bindVAO(this.vao);}destroy(){this.ctx.gl.deleteVertexArray(this.vao);}};var Ll=["a_pos","a_height","a_tint","a_ao","a_normal","a_kind","a_level","a_wall","a_p0","a_p1","a_corner","a_width","a_dist","a_tex"],me=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new B;this.attribs=new B;let a=e.gl,l=Il(n),s=Nn(a,a.VERTEX_SHADER,Gn(o,l),`${t}.vert`),c=Nn(a,a.FRAGMENT_SHADER,Gn(r,l),`${t}.frag`),f=a.createProgram();if(!f)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0443 ${t}`);if(a.attachShader(f,s),a.attachShader(f,c),Ll.forEach((u,d)=>a.bindAttribLocation(f,d,u)),a.linkProgram(f),a.detachShader(f,s),a.detachShader(f,c),a.deleteShader(s),a.deleteShader(c),!a.getProgramParameter(f,a.LINK_STATUS)){let u=a.getProgramInfoLog(f);throw a.deleteProgram(f),new Error(`[osmgl] \u043B\u0438\u043D\u043A\u043E\u0432\u043A\u0430 ${t} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430: ${u}`)}this.program=f,this.cacheLocations();}cacheLocations(){let e=this.ctx.gl,t=e.getProgramParameter(this.program,e.ACTIVE_UNIFORMS);for(let r=0;r<t;r++){let n=e.getActiveUniform(this.program,r);if(!n)continue;let a=n.name.replace(/\[0\]$/,"");this.uniforms.set(a,e.getUniformLocation(this.program,n.name));}let o=e.getProgramParameter(this.program,e.ACTIVE_ATTRIBUTES);for(let r=0;r<o;r++){let n=e.getActiveAttrib(this.program,r);n&&this.attribs.set(n.name,e.getAttribLocation(this.program,n.name));}}use(){this.ctx.useProgram(this.program);}attribLocation(e){return this.attribs.get(e)??-1}loc(e){return this.uniforms.get(e)??null}setMat4(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix4fv(o,false,t);}setMat3(e,t){let o=this.loc(e);o&&this.ctx.gl.uniformMatrix3fv(o,false,t);}setFloat(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1f(o,t);}setInt(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform1i(o,t);}setVec2(e,t,o){let r=this.loc(e);r&&this.ctx.gl.uniform2f(r,t,o);}setVec3(e,t,o,r){let n=this.loc(e);n&&this.ctx.gl.uniform3f(n,t,o,r);}setVec4(e,t,o,r,n){let a=this.loc(e);a&&this.ctx.gl.uniform4f(a,t,o,r,n);}setVec4v(e,t){let o=this.loc(e);o&&this.ctx.gl.uniform4f(o,t[0],t[1],t[2],t[3]);}setVec4Array(e,t){let o=this.loc(e)??this.loc(`${e}[0]`);o&&this.ctx.gl.uniform4fv(o,t);}destroy(){this.ctx.gl.deleteProgram(this.program),this.uniforms.clear(),this.attribs.clear();}};function Il(i){let e=[];for(let[t,o]of Object.entries(i))o!==false&&e.push(o===true?`#define ${t}`:`#define ${t} ${o}`);return e.join(`
2
+ `)}function Gn(i,e){if(!e)return i;let t=i.match(/^\s*#version[^\n]*\n/);return t?i.slice(0,t[0].length)+e+`
3
3
  `+i.slice(t[0].length):`${e}
4
- ${i}`}function Vn(i,e,t,o){let r=i.createShader(e);if(!r)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0448\u0435\u0439\u0434\u0435\u0440 ${o}`);if(i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS)){let n=i.getShaderInfoLog(r)??"";throw i.deleteShader(r),new Error(`[osmgl] \u043A\u043E\u043C\u043F\u0438\u043B\u044F\u0446\u0438\u044F ${o} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430:
4
+ ${i}`}function Nn(i,e,t,o){let r=i.createShader(e);if(!r)throw new Error(`[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0448\u0435\u0439\u0434\u0435\u0440 ${o}`);if(i.shaderSource(r,t),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS)){let n=i.getShaderInfoLog(r)??"";throw i.deleteShader(r),new Error(`[osmgl] \u043A\u043E\u043C\u043F\u0438\u043B\u044F\u0446\u0438\u044F ${o} \u043D\u0435 \u043F\u0440\u043E\u0448\u043B\u0430:
5
5
  ${n}
6
- ${kl(t)}`)}return r}function kl(i){return i.split(`
6
+ ${Fl(t)}`)}return r}function Fl(i){return i.split(`
7
7
  `).map((e,t)=>`${String(t+1).padStart(4)} | ${e}`).join(`
8
- `)}var At=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(At||{}),bo=class i{constructor(e,t,o,r){this.pbf=e;this.keys=t;this.values=o;this.extent=r;this.type=0;this.properties={};this.geomOffset=-1;}static read(e,t,o,r,n){let a=new i(e,o,r,n);return e.readFields(Ll,a,t),a}loadGeometry(){if(this.geomOffset<0)return [];let e=this.pbf,t=e.pos;e.pos=this.geomOffset;let o=e.readVarint()+e.pos,r=1,n=0,a=0,l=0,s=[],c=[];for(;e.pos<o;){if(n<=0){let f=e.readVarint();r=f&7,n=f>>3;}if(n--,r===1||r===2)a+=e.readSVarint(),l+=e.readSVarint(),r===1&&(c.length&&s.push(c),c=[]),c.push(a,l);else if(r===7)c.length>=2&&c.push(c[0],c[1]);else throw new Error(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 MVT: ${r}`)}return c.length&&s.push(c),e.pos=t,s}bbox(){let e=this.loadGeometry(),t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return [t,o,r,n]}};function Ll(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?Il(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function Il(i,e){let t=i.readVarint()+i.pos;for(;i.pos<t;){let o=e.keys[i.readVarint()],r=e.values[i.readVarint()];o!==void 0&&(e.properties[o]=r);}}var yo=class i{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[];}static read(e,t){let o=new i(e);return e.readFields(Fl,o,t),o}get length(){return this.featureOffsets.length}feature(e){let t=this.pbf;t.pos=this.featureOffsets[e];let o=t.readVarint()+t.pos;return bo.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function Fl(i,e,t){t&&(i===15?e.version=t.readVarint():i===1?e.name=t.readString():i===5?e.extent=t.readVarint():i===2?e.featureOffsets.push(t.pos):i===3?e.keys.push(t.readString()):i===4&&e.values.push(Rl(t)));}function Rl(i){let e=i.readVarint()+i.pos,t=null;for(;i.pos<e;){let o=i.readVarint()>>3;o===1?t=i.readString():o===2?t=i.readFloat():o===3?t=i.readDouble():o===4?t=i.readVarint64():o===5?t=i.readVarint():o===6?t=i.readSVarint():o===7?t=i.readBoolean():i.skip(o);}return t}var kt=class{constructor(e){this.layers={};new Al(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=yo.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function Qe(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=zl(o);r!==0&&(r>0?(t&&e.push(t),t={outer:o,holes:[]}):t&&t.holes.push(o));}return t&&e.push(t),e}function zl(i){let e=0;for(let t=0,o=i.length-2;t<i.length;o=t,t+=2)e+=(i[o]-i[t])*(i[t+1]+i[o+1]);return e/2}function D(i,e,t){return i===void 0?t:typeof i=="number"?i:Dn(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function ke(i,e,t){return i===void 0?t:typeof i=="string"?he(i):Dn(i.stops,e,(o,r,n)=>{let a=he(o),l=he(r);return [a[0]+(l[0]-a[0])*n,a[1]+(l[1]-a[1])*n,a[2]+(l[2]-a[2])*n,a[3]+(l[3]-a[3])*n]},t)}function Dn(i,e,t,o){if(!i.length)return o;if(e<=i[0][0])return t(i[0][1],i[0][1],0);let r=i[i.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let n=1;n<i.length;n++){let[a,l]=i[n];if(e>a)continue;let[s,c]=i[n-1],f=a-s,u=f===0?0:(e-s)/f;return t(c,l,u)}return o}function pe(i,e){if(!i)return true;let t=i[0];switch(t){case "all":return i.slice(1).every(o=>pe(o,e));case "any":return i.slice(1).some(o=>pe(o,e));case "!":return !pe(i[1],e);case "has":return e[i[1]]!=null;case "!has":return e[i[1]]==null;case "in":{let o=e[i[1]];return o==null?false:i.slice(2).includes(o)}case "!in":{let o=e[i[1]];return o==null?true:!i.slice(2).includes(o)}default:{let o=e[i[1]],r=i[2];if(o==null)return t==="!=";switch(t){case "==":return o===r;case "!=":return o!==r;case ">":return o>r;case ">=":return o>=r;case "<":return o<r;case "<=":return o<=r;default:return true}}}}var Pl=Math.PI/8,Hl=.35,Ol=32,Gn=.25,Nn=.5,Un=.07;function Re(i,e){let t=e.radius;if(!(t>0))return i;let o=i.length/2-1;if(o<3)return i;let r=Math.max(2,Math.round(e.segments??4)),n=Math.max(e.minCutRatio??Hl,0),a=e.extent,l=e.margin??0,s=[];for(let c=0;c<o;c++){let f=i[c*2],u=i[c*2+1],h=i[(c+o-1)%o*2],m=i[(c+o-1)%o*2+1],d=i[(c+1)%o*2],p=i[(c+1)%o*2+1],y=f-h,b=u-m,g=d-f,v=p-u,x=Math.hypot(y,b),C=Math.hypot(g,v);if(x<1e-6||C<1e-6){s.push(f,u);continue}let S=y/x,M=b/x,w=g/C,_=v/C;if(e.keep?.[c]){s.push(f,u);continue}let T=S*w+M*_;if(T>.985){s.push(f,u);continue}if(a!==void 0&&(or(f,u,a,l)||or(h,m,a,l)||or(d,p,a,l))){s.push(f,u);continue}let L=Math.min(t,x*.4,C*.4);if(L<t*n){s.push(f,u);continue}let k=f-S*L,z=u-M*L,A=f+w*L,I=u+_*L,E=Math.acos(Math.max(-1,Math.min(1,T))),F=Math.min(Pl,Math.PI/2/r),P=Math.ceil(E/F-1e-6),R=e.maxChord&&e.maxChord>0?Math.ceil(L/Math.tan(E/2)*E/e.maxChord):0,W=Math.max(1,Math.min(Ol,Math.max(Math.min(r,P),R)));s.push(k,z);for(let G=1;G<W;G++){let O=G/W,H=1-O;s.push(H*H*k+2*H*O*f+O*O*A,H*H*z+2*H*O*u+O*O*I);}s.push(A,I);}return s.length<6?i:(s.push(s[0],s[1]),s)}var or=(i,e,t,o)=>i<=-o||e<=-o||i>=t+o||e>=t+o;var Oe=i=>i/64;function nt(i,e,t=0){let o=jn(i.outer,e,t);if(!o)return null;let r=[];for(let n of i.holes){let a=jn(n,e,t);a&&r.push(a);}return {outer:o,holes:r}}function jn(i,e,t){let o=[];for(let r=0;r<i.length-2;r+=2)o.push(i[r],i[r+1]);if(o.length<6)return null;for(let r=0;r<4;r++){let n=o;o=[];let a=n.length/2;if(a===0)return null;for(let l=0;l<a;l++){let s=n[l*2],c=n[l*2+1],f=n[(l+a-1)%a*2],u=n[(l+a-1)%a*2+1],h=Xn(s,c,r,e,t),m=Xn(f,u,r,e,t);if(h!==m){let d=Wl(f,u,s,c,r,e,t);o.push(f+(s-f)*d,u+(c-u)*d);}h&&o.push(s,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function Xn(i,e,t,o,r){return t===0?i>=-r:t===1?i<=o+r:t===2?e>=-r:e<=o+r}function Wl(i,e,t,o,r,n,a){return r===0?(-a-i)/(t-i):r===1?(n+a-i)/(t-i):r===2?(-a-e)/(o-e):(n+a-e)/(o-e)}function go(i,e,t,o,r,n=0){let a=-n,l=r+n;return i===a&&t===a||i===l&&t===l||e===a&&o===a||e===l&&o===l}function Yn(i,e){for(let t=0;t<i.length;t+=2)if(i[t]<=0||i[t]>=e||i[t+1]<=0||i[t+1]>=e)return true;return false}var Me=18,st=32,lt=8,Jn=65535/st,Bl=9,Vl=1,Dl=0,Gl=1,Nl=2;var Kn=0,Ul=1,$n=2,jl=3,Xl=.47;function ir(i,e,t,o={}){let r=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:Xl,n=Math.max(1024,i.length*48),a=new ArrayBuffer(n*Me),l={verts:new DataView(a),vertsU8:new Uint8Array(a),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};l.ensure=h=>s(h);let s=h=>{if(l.vertexCount+h<=n)return;n=Math.max(n*2,l.vertexCount+h);let m=new ArrayBuffer(n*Me);new Uint8Array(m).set(l.vertsU8.subarray(0,l.vertOffset)),a=m,l.verts=new DataView(m),l.vertsU8=new Uint8Array(m);};for(let h of i.features()){if(h.type!==3||!pe(t,h.properties))continue;let m=ds(h.properties),d=ms(h.properties,m);if(m<=d)continue;let p=bs(h.properties)??Number(h.id??0),y=hs(p>>>0),b=us(y,h.properties),g=fs(h.properties,m),v=Qe(h.loadGeometry());for(let x of v){let C=nt(x,e);if(!C)continue;let S=Yn(C.outer,e),M=(o.cornerRadius??0)/r,w={radius:M,segments:o.cornerSegments,extent:e,minCutRatio:0,maxChord:r>0?Nn/r:0},_=M>0?{outer:Re(C.outer,w),holes:C.holes.map(I=>Re(I,w))}:C,T=_.outer.length/2+_.holes.reduce((I,E)=>I+E.length/2,0);s(T*5+32);let L=_.holes.length||S?null:ql(_.outer),k=L?os(h.properties,L,m,y,r):null,z=null,A=[];if(k&&L){let I=ei(is(_.outer,r),L,k.shape);A=as(I,_.outer);let E=ls(I,A);if(E>1e-6){let F=Math.min(Math.max(E*r*Jl,ts),es);z=ss(I,F/E,m);}}Zn(l,_.outer,d,m,p,b,g,r,e,z);for(let I of _.holes)Zn(l,I,d,m,p,b,g,r,e,null);z?cs(l,A,z,m,p,b,g,r):$l(l,_.outer,_.holes,m,p,b,g);}}if(!l.indices.length)return null;let c=new Uint32Array(l.indices),f=new Float64Array(l.featureIds);return {vertices:a.slice(0,l.vertOffset),indices:c.buffer,featureIds:f.buffer,vertexCount:l.vertexCount,indexCount:c.length,extent:e}}var ar=(i,e)=>i|e<<2,qn=i=>Math.max(-32768,Math.min(32767,i)),rr=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,Jn)*st)));function it(i,e,t,o,r,n,a,l,s,c,f=0,u=0,h=0){let m=i.vertOffset;return i.verts.setInt16(m,qn(Math.round(e*lt)),true),i.verts.setInt16(m+2,qn(Math.round(t*lt)),true),i.verts.setUint16(m+4,Math.round(Math.min(o,Jn)*st),true),i.vertsU8[m+6]=s,i.vertsU8[m+7]=l,i.verts.setInt8(m+8,nr(Math.round(r*127))),i.verts.setInt8(m+9,nr(Math.round(n*127))),i.verts.setInt8(m+10,nr(Math.round(a*127))),i.vertsU8[m+11]=c,i.verts.setUint16(m+12,rr(f),true),i.verts.setUint16(m+14,rr(u),true),i.verts.setUint16(m+16,rr(h),true),i.vertOffset+=Me,i.vertexCount++}function Zn(i,e,t,o,r,n,a,l,s,c=null){let f=e.length/2;if(f<3)return;let u=ar(Dl,a),h=Kl(e,l),m=o-t,d=new Float64Array(f*2),p=new Uint8Array(f);{let y=new Float64Array(f*2);for(let b=0;b<f-1;b++){let g=e[b*2+2]-e[b*2],v=e[b*2+3]-e[b*2+1],x=Math.hypot(g,v)||1;y[b*2]=v/x,y[b*2+1]=-g/x;}for(let b=0;b<f-1;b++){let g=(b+f-2)%(f-1),v=y[g*2]*y[b*2]+y[g*2+1]*y[b*2+1],x=y[g*2]+y[b*2],C=y[g*2+1]+y[b*2+1],S=Math.hypot(x,C);v>.5&&S>1e-6&&(d[b*2]=x/S,d[b*2+1]=C/S,p[b]=1);}}for(let y=0;y<f-1;y++){let b=e[y*2],g=e[y*2+1],v=e[y*2+2],x=e[y*2+3];if(b===v&&g===x||go(b,g,v,x,s))continue;let C=v-b,S=x-g,M=Math.hypot(C,S)||1,w=S/M,_=-C/M,T=h.offset[y],L=h.width[y],k=[0,1];if(c){for(let A=0;A<c.length;A++)for(let I=A+1;I<c.length;I++){let E=Je(c[A],b,g)-Je(c[I],b,g),F=Je(c[A],v,x)-Je(c[I],v,x);if(E===F)continue;let P=E/(E-F);P>1e-4&&P<1-1e-4&&k.push(P);}k.sort((A,I)=>A-I);}let z=(A,I)=>{if(!c)return o;let E=1/0;for(let F of c)E=Math.min(E,Je(F,A,I));return Math.max(o,E)};for(let A=0;A+1<k.length;A++){let I=k[A],E=k[A+1];if(E-I<1e-6)continue;let F=b+C*I,P=g+S*I,R=b+C*E,W=g+S*E,G=T+M*I*l,O=T+M*E*l,H=(y+1)%(f-1),V=p[y]?d[y*2]:w,Y=p[y]?d[y*2+1]:_,$=p[H]?d[H*2]:w,Q=p[H]?d[H*2+1]:_,ue=w+(V-w)*(1-I),J=_+(Y-_)*(1-I),X=w+($-w)*E,te=_+(Q-_)*E,ie=Math.hypot(ue,J)||1,q=Math.hypot(X,te)||1,U=ue/ie,j=J/ie,le=X/q,ae=te/q;i.ensure(4);let se=it(i,F,P,t,U,j,0,0,n,u,G,L,m),oe=it(i,R,W,t,le,ae,0,0,n,u,O,L,m),ge=it(i,F,P,z(F,P),U,j,0,255,n,u,G,L,m),Ee=it(i,R,W,z(R,W),le,ae,0,255,n,u,O,L,m);i.indices.push(se,Ee,oe,se,ge,Ee),i.featureIds.push(r,r);}}}var Yl=.9976;function Kl(i,e){let t=i.length/2-1,o=[];for(let s=0;s<t;s++){let c=i[s*2+2]-i[s*2],f=i[s*2+3]-i[s*2+1],u=Math.hypot(c,f);o.push(u>0?{x:c/u,y:f/u,len:u*e}:{x:0,y:0,len:0});}let r=(s,c)=>o[s].len>0&&o[c].len>0&&o[s].x*o[c].x+o[s].y*o[c].y>=Yl,n=0;for(;n<t&&r((n-1+t)%t,n);)n++;n>=t&&(n=0);let a=new Array(t).fill(0),l=new Array(t).fill(0);for(let s=0;s<t;){let c=(n+s)%t,f=[c],u=o[c].len,h=s+1;for(;h<t;){let d=(n+h)%t;if(!r((n+h-1)%t,d))break;f.push(d),u+=o[d].len,h++;}let m=0;for(let d of f)a[d]=m,l[d]=u,m+=o[d].len;s=h;}return {offset:a,width:l}}function $l(i,e,t,o,r,n,a){let l=[],s=[];for(let h=0;h<e.length;h++)l.push(e[h]);for(let h of t){s.push(l.length/2);for(let m=0;m<h.length;m++)l.push(h[m]);}let c=Qn(l,s.length?s:void 0,2);if(!c.length)return;let f=ar(Gl,a),u=i.vertexCount;for(let h=0;h<l.length;h+=2)it(i,l[h],l[h+1],o,0,0,1,255,n,f);for(let h=0;h<c.length;h+=3)i.indices.push(u+c[h],u+c[h+2],u+c[h+1]),i.featureIds.push(r);}function ql(i){let e=Zl(i);if(e.length<3)return null;let t=Math.abs(Ql(i));if(t<=0)return null;let o=null,r=1/0;for(let n=0;n<e.length;n++){let a=(n+1)%e.length,l=e[a].x-e[n].x,s=e[a].y-e[n].y,c=Math.hypot(l,s);if(c<1e-6)continue;l/=c,s/=c;let f=1/0,u=-1/0,h=1/0,m=-1/0;for(let x of e){let C=x.x*l+x.y*s,S=-x.x*s+x.y*l;C<f&&(f=C),C>u&&(u=C),S<h&&(h=S),S>m&&(m=S);}let d=u-f,p=m-h,y=d*p;if(y<=0||y>=r)continue;r=y;let b=(f+u)/2,g=(h+m)/2,v=d>=p;o={cx:b*l-g*s,cy:b*s+g*l,ax:v?l:-s,ay:v?s:l,halfLong:(v?d:p)/2,halfShort:(v?p:d)/2,fill:t/y};}return o}function Zl(i){let e=[];for(let n=0;n<i.length-2;n+=2)e.push({x:i[n],y:i[n+1]});if(e.length<3)return e;e.sort((n,a)=>n.x===a.x?n.y-a.y:n.x-a.x);let t=(n,a,l)=>(a.x-n.x)*(l.y-n.y)-(a.y-n.y)*(l.x-n.x),o=[];for(let n of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],n)<=0;)o.pop();o.push(n);}let r=[];for(let n=e.length-1;n>=0;n--){let a=e[n];for(;r.length>=2&&t(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a);}return o.pop(),r.pop(),o.concat(r)}function Ql(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var Jl=Math.tan(30*Math.PI/180),es=3.5,ts=.9;function os(i,e,t,o,r){if(e.fill<.86)return null;let n=e.halfShort*2*r,a=e.halfLong*2*r,l=n*a,s=e.halfShort>0?e.halfLong/e.halfShort:99,c=rs(i);if(!c){if(t>15||l>600||n<3)return null;let f=o%1e3/1e3;l<30?c=f<.5?"skillion":"gabled":s<1.25?c=f<.35?"pyramidal":"hipped":c=f<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function rs(i){let e=String(i.roof_shape??i["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var Je=(i,e,t)=>i.a*e+i.b*t+i.c;function ns(i,e,t,o){let r=i.length/2;if(r<3)return [];let n=[],a=l=>[i[l*2],i[l*2+1]];for(let l=0;l<r;l++){let[s,c]=a(l),[f,u]=a((l+r-1)%r),h=e*s+t*c+o,m=e*f+t*u+o;if(h<=0!=m<=0){let d=m/(m-h);n.push(f+(s-f)*d,u+(c-u)*d);}h<=0&&n.push(s,c);}return n}function is(i,e){let t=.5/Math.max(e,1e-6),o=i.length/2-1;if(o<5)return i;let r=[],n=0;r.push(i[0],i[1]);for(let a=1;a<o;a++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1],u=c-l,h=f-s,m=Math.hypot(u,h),d=m>1e-6;if(d){for(let p=n+1;p<a;p++)if(Math.abs((i[p*2]-l)*h-(i[p*2+1]-s)*u)/m>=t){d=false;break}}d||(r.push(i[(a-1)*2],i[(a-1)*2+1]),n=a-1);}return r.length/2<3?i:(r.push(r[0],r[1]),r)}function ei(i,e,t){let{ax:o,ay:r,halfLong:n}=e;if(t==="skillion"){let s=-r,c=o;return [{a:s,b:c,c:-(s*e.cx+c*e.cy)+e.halfShort}]}let a=[],l=i.length/2-1;for(let s=0;s<l;s++){let c=i[s*2],f=i[s*2+1],u=i[(s+1)%l*2],h=i[(s+1)%l*2+1],m=u-c,d=h-f,p=Math.hypot(m,d);if(p<1e-6||t==="gabled"&&Math.abs((m*o+d*r)/p)<.86)continue;let y=-d/p,b=m/p;a.push({a:y,b,c:-(y*c+b*f)});}return !a.length&&n>0?ei(i,e,"hipped"):a}function as(i,e){let t=[];for(let r=0;r<e.length-2;r+=2)t.push(e[r],e[r+1]);if(t.length<6)return [];let o=[];for(let r=0;r<i.length;r++){let n=t;for(let a=0;a<i.length&&n.length>=6;a++)a!==r&&(n=ns(n,i[r].a-i[a].a,i[r].b-i[a].b,i[r].c-i[a].c));o.push(n.length>=6?n:[]);}return o}function ls(i,e){let t=0;for(let o=0;o<e.length;o++){let r=e[o];for(let n=0;n<r.length;n+=2){let a=Je(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function ss(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function cs(i,e,t,o,r,n,a,l){let s=ar(Nl,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let u=Qn(f,void 0,2);if(!u.length)continue;let h=-t[c].a/l,m=-t[c].b/l,d=Math.hypot(h,m,1),p={x:h/d,y:m/d,z:1/d};i.ensure(f.length/2);let y=i.vertexCount;for(let b=0;b<f.length;b+=2){let g=Math.max(o,Je(t[c],f[b],f[b+1]));it(i,f[b],f[b+1],g,p.x,p.y,p.z,255,n,s);}for(let b=0;b<u.length;b+=3)i.indices.push(y+u[b],y+u[b+2],y+u[b+1]),i.featureIds.push(r);}}function fs(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?jl:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?$n:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Kn:e>=40?$n:Ul}function us(i,e){let t=String(e.class??""),o=128;return t==="industrial"||t==="warehouse"||t==="construction"?o=96:t==="commercial"||t==="office"||t==="retail"?o=150:(t==="apartments"||t==="residential"||t==="house")&&(o=134),Math.max(0,Math.min(255,o+(i%121-60)))}function hs(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function ds(i){let e=at(i.render_height)??at(i.height)??ps(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,Vl):Bl}function ms(i,e){let t=at(i.render_min_height)??at(i.min_height)??at(i.base)??0;return t>0&&t<e?t:0}function ps(i){let e=at(i);return e&&e>0?e*3:null}function at(i){if(typeof i=="number"&&isFinite(i))return i;if(typeof i=="string"){let e=parseFloat(i);if(isFinite(e))return e}return null}var nr=i=>i>127?127:i<-127?-127:i;function bs(i){let e=i.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=Number(e);if(Number.isFinite(t))return t}return null}function ti(i){let e=[];for(let t=0;t+1<i.length;t+=2)e.push([i[t],i[t+1]]);return e}function oi(i){let e=[];for(let o of i)e.push(o[0],o[1]);let t=e.length;return t>=4&&(e[0]!==e[t-2]||e[1]!==e[t-1])&&e.push(e[0],e[1]),e}function ni(i,e,t=0){if(i.length<2)return i;let o=new Map;for(let n of i){let a=n.lift??0,l=o.get(a);l?l.push(n):o.set(a,[n]);}let r=[];for(let[n,a]of o){if(a.length<2){r.push(...a);continue}let s=(t>0&&e?a.map(u=>({outer:e(u.outer,-t)??u.outer,holes:u.holes.map(h=>e(h,t)??h)})):a).map(u=>[ti(u.outer),...u.holes.map(ti)]),c;try{c=ri.union(s[0],...s.slice(1));}catch{r.push(...a);continue}let f=c;if(!Array.isArray(f)||f.length===0){r.push(...a);continue}for(let u of f){if(!u.length)continue;let h=oi(u[0]);if(h.length<8)continue;let m=[];for(let d=1;d<u.length;d++){let p=oi(u[d]);p.length>=8&&m.push(p);}r.push(n?{outer:h,holes:m,lift:n}:{outer:h,holes:m});}}return r}var ct=16,fi=64,gs=0,vs=1,ii=2,ws=3,Lt=1,xs=.6;function ur(i,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,n=o.elevation,a=o.base??0,l=Math.max(o.bevel??0,0)/r,s=Math.max(o.bevelDrop??0,0),c=Math.max(o.cornerRadius??0,0)/r,f=Math.max(512,i.length*24),u=new ArrayBuffer(f*ct),h={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(w){if(h.count+w<=f)return;f=Math.max(f*2,h.count+w);let _=new ArrayBuffer(f*ct);new Uint8Array(_).set(h.bytes.subarray(0,h.offset)),u=_,h.view=new DataView(_),h.bytes=new Uint8Array(_);}},m=[],d=new Map;for(let w of i.features()){if(w.type!==3||!pe(t,w.properties))continue;let _=o.liftBy?.(w.properties)??0;for(let T of Qe(w.loadGeometry())){let L=nt(T,e,Oe(e));L&&m.push(_?{...L,lift:_}:L);}}let p=new Set,y=Math.max(o.weld??xs,0),b=ni(m,(w,_)=>sr(w,_,e,p),y/r),g=y>0?b.map(w=>({...w,outer:ci(w.outer,y/r,e),holes:w.holes.map(_=>ci(_,y/r,e))})):b;for(let w of g){ai(w.outer,d);for(let _ of w.holes)ai(_,d);}o.onShapes?.(g);let v=new Set;for(let[w,_]of d)_>1&&v.add(w);let x=[],C={radius:c,segments:o.cornerSegments,extent:e,margin:Oe(e),minCutRatio:0,maxChord:Gn/r};for(let w of g){let _=c>0?{outer:Re(w.outer,{...C,keep:li(w.outer,v)}),holes:w.holes.map(F=>Re(F,{...C,keep:li(F,v)}))}:w,T=l>0?sr(_.outer,l,e,v):_.outer,L=_.holes.map(F=>l>0?sr(F,-l,e,v):F),k=w.lift??0,z=n+k,A=a+k;si(h,T??_.outer,L.map((F,P)=>F??_.holes[P]),z);let I=z,E=z-s;T&&l>0&&s>0&&lr(h,T,_.outer,I,E,vs,e,v),E!==A&&lr(h,_.outer,_.outer,E,A,ii,e,v);for(let F of _.holes)if(E!==A&&lr(h,F,F,E,A,ii,e,v),z<A){let P=h.indices.length;si(h,F,[],A,ws);for(let R=P;R<h.indices.length;R++)x.push(h.indices[R]);h.indices.length=P;}}if(!h.indices.length&&!x.length)return null;let S=h.indices.length,M=new Uint32Array(S+x.length);return M.set(h.indices,0),M.set(x,S),{vertices:u.slice(0,h.offset),indices:M.buffer,vertexCount:h.count,indexCount:M.length,extent:e,capIndexOffset:S}}function ft(i,e,t,o){let r=`${Math.round(i*100)},${Math.round(e*100)}`,n=`${Math.round(t*100)},${Math.round(o*100)}`;return r<n?`${r}|${n}`:`${n}|${r}`}function ai(i,e){for(let t=0;t+3<i.length;t+=2){let o=ft(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function li(i,e){if(!e.size)return;let t=i.length/2-1,o=new Array(t).fill(false);for(let r=0;r<t;r++){let n=ft(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=ft(i[r*2],i[r*2+1],i[(r+1)%t*2],i[(r+1)%t*2+1]);(e.has(n)||e.has(a))&&(o[r]=true);}return o}function It(i,e,t,o,r,n,a,l){let s=i.offset;return i.view.setFloat32(s,e,true),i.view.setFloat32(s+4,t,true),i.view.setInt16(s+8,_s(Math.round(o*fi)),true),i.view.setInt8(s+10,fr(Math.round(r*127))),i.view.setInt8(s+11,fr(Math.round(n*127))),i.view.setInt8(s+12,fr(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-Lt:e>=i.extent?Lt:0),i.view.setInt8(s+15,t<=0?-Lt:t>=i.extent?Lt:0),i.offset+=ct,i.count++}function si(i,e,t,o,r=gs){let n=[],a=[];for(let c=0;c<e.length;c++)n.push(e[c]);for(let c of t){a.push(n.length/2);for(let f=0;f<c.length;f++)n.push(c[f]);}let l=Qn(n,a.length?a:void 0,2);if(!l.length)return;i.ensure(n.length/2);let s=i.count;for(let c=0;c<n.length;c+=2)It(i,n[c],n[c+1],o,0,0,1,r);for(let c=0;c<l.length;c+=3)i.indices.push(s+l[c],s+l[c+2],s+l[c+1]);}function lr(i,e,t,o,r,n,a,l){let s=Math.min(e.length,t.length)/2;if(!(s<3)){i.ensure((s-1)*4);for(let c=0;c<s-1;c++){let f=t[c*2],u=t[c*2+1],h=t[c*2+2],m=t[c*2+3];if(f===h&&u===m||go(f,u,h,m,a,Oe(a))||l.has(ft(f,u,h,m)))continue;let d=h-f,p=m-u,y=Math.hypot(d,p)||1,b=p/y,g=-d/y,v=o-r,x=Math.hypot(e[c*2]-f,e[c*2+1]-u)||0,C=0;if(x>1e-6&&v!==0){let T=1/Math.hypot(1,v/x);C=x/Math.hypot(x,v)*Math.sign(v),b*=T,g*=T;}let S=It(i,e[c*2],e[c*2+1],o,b,g,C,n),M=It(i,e[c*2+2],e[c*2+3],o,b,g,C,n),w=It(i,f,u,r,b,g,C,n),_=It(i,h,m,r,b,g,C,n);i.indices.push(w,M,_,w,S,M);}}}function sr(i,e,t,o){let r=i.length/2-1;if(r<3)return null;let n=[];for(let f=0;f<r;f++){let u=i[f*2],h=i[f*2+1],m=i[(f+r-1)%r*2],d=i[(f+r-1)%r*2+1],p=i[(f+1)%r*2],y=i[(f+1)%r*2+1],b=Math.hypot(u-m,h-d)||1,g=Math.hypot(p-u,y-h)||1,v=(h-d)/b,x=-(u-m)/b,C=(y-h)/g,S=-(p-u)/g,M=v+C,w=x+S,_=Math.hypot(M,w);if(_<1e-6){n.push(u,h);continue}M/=_,w/=_;let T=Math.min(1/Math.max(M*v+w*x,.35),3),L=u-M*e*T,k=h-w*e*T,z=ft(m,d,u,h),A=ft(u,h,p,y);if(o.has(z)||o.has(A)){n.push(u,h);continue}let I=-Oe(t),E=t+Oe(t),F=(P,R)=>P<=I||P>=E||R<=I||R>=E;(F(u,h)||F(m,d)||F(p,y))&&(L=u,k=h),n.push(L,k);}n.push(n[0],n[1]);let a=Math.abs(cr(i)),l=cr(n);if(Math.sign(l)!==Math.sign(cr(i))||Math.abs(l)<a*.25)return null;let s=-Oe(t),c=t+Oe(t);for(let f=0;f<n.length;f+=2)n[f]=Math.max(s,Math.min(c,n[f])),n[f+1]=Math.max(s,Math.min(c,n[f+1]));return n}function cr(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var fr=i=>i>127?127:i<-127?-127:i,_s=i=>i>32767?32767:i<-32768?-32768:i;function ci(i,e,t){if(!(e>0))return i;let o=Oe(t),r=-o,n=t+o,a=i;for(let l=0;l<3;l++){let s=a.length/2-1;if(s<6)break;let c=new Array(s).fill(true),f=s;for(let h=0;h<s&&!(f<=5);h++){let m=a[h*2],d=a[h*2+1];if(m<=r||m>=n||d<=r||d>=n)continue;let p=(h+s-1)%s;for(;!c[p]&&p!==h;)p=(p+s-1)%s;let y=(h+1)%s;for(;!c[y]&&y!==h;)y=(y+1)%s;if(p===h||y===h)break;let b=a[p*2],g=a[p*2+1],v=a[y*2]-b,x=a[y*2+1]-g,C=Math.hypot(v,x);C<1e-6||Math.abs((m-b)*x-(d-g)*v)/C<e&&(c[h]=false,f--);}if(f===s)break;let u=[];for(let h=0;h<s;h++)c[h]&&u.push(a[h*2],a[h*2+1]);u.push(u[0],u[1]),a=u;}return a}var Ne=4;function Ss(i,e,t,o,r){let n=o*o,a=[],l=f=>i[f*2],s=f=>i[f*2+1],c=(f,u)=>{let h=i.length/2;return i.push((l(f)+l(u))/2,(s(f)+s(u))/2),h};for(let f=0;f<e.length;f+=3){a.push([t+e[f],t+e[f+1],t+e[f+2]]);let u=0;for(;a.length&&!(++u>2e4);){let[h,m,d]=a.pop(),p=(l(h)-l(m))**2+(s(h)-s(m))**2,y=(l(m)-l(d))**2+(s(m)-s(d))**2,b=(l(d)-l(h))**2+(s(d)-s(h))**2,g=Math.max(p,y,b);if(g<=n){r.push(h,m,d);continue}if(g===p){let v=c(h,m);a.push([h,v,d],[v,m,d]);}else if(g===y){let v=c(m,d);a.push([m,v,h],[v,d,h]);}else {let v=c(d,h);a.push([d,v,m],[v,h,m]);}}}}function hr(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let m of i.features()){if(m.type!==3||!pe(e,m.properties))continue;let d=m.properties.osm_id,p=typeof d=="number"?d:typeof d=="string"?Number(d):NaN,y=Number.isFinite(p)?p:Number(m.id??0);for(let b of Qe(m.loadGeometry())){let g=r?nt(b,n):b;if(!g)continue;let v=[],x=[],C=o?Re(g.outer,o):g.outer;for(let w=0;w<C.length;w++)v.push(C[w]);for(let w of g.holes){let _=o?Re(w,o):w;x.push(v.length/2);for(let T=0;T<_.length;T++)v.push(_[T]);}let S=Qn(v,x.length?x:void 0,2);if(!S.length)continue;let M=a.length/2;for(let w=0;w<v.length;w++)a.push(v[w]);if(t>0){let w=[];Ss(a,S,M,t,w);for(let _=0;_<w.length;_+=3)l.push(w[_],w[_+2],w[_+1]),s.push(y);continue}for(let w=0;w<S.length;w+=3)l.push(M+S[w],M+S[w+2],M+S[w+1]),s.push(y);}}if(!l.length)return null;let c=a.length/2,f=new Int16Array(a),u=new Uint32Array(l);return {featureIds:new Float64Array(s).buffer,vertices:f.buffer,indices:u.buffer,vertexCount:c,indexCount:u.length}}var Ms=100;function dr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function mr(i,e,t,o){if(!(t<=0)){i.extent=o;for(let r of e){let n=r.outer;if(n.length<6)continue;let a=1/0,l=1/0,s=-1/0,c=-1/0;for(let f=0;f<n.length;f+=2)n[f]<a&&(a=n[f]),n[f]>s&&(s=n[f]),n[f+1]<l&&(l=n[f+1]),n[f+1]>c&&(c=n[f+1]);i.shapes.push({outer:n,holes:r.holes,level:t,minX:a,minY:l,maxX:s,maxY:c});}i.cells=[];}}function Ts(i){i.cells=Array.from({length:1024},()=>[]);let e=i.extent/32;for(let t=0;t<i.shapes.length;t++){let o=i.shapes[t],r=ut(Math.floor(o.minX/e)),n=ut(Math.floor(o.maxX/e)),a=ut(Math.floor(o.minY/e)),l=ut(Math.floor(o.maxY/e));for(let s=a;s<=l;s++)for(let c=r;c<=n;c++)i.cells[s*32+c].push(t);}}var hi=i=>i.shapes.length===0;function vo(i,e,t){!i.cells.length&&i.shapes.length&&Ts(i);let o=i.extent/32,r=i.cells[ut(Math.floor(t/o))*32+ut(Math.floor(e/o))];if(!r||!r.length)return 0;let n=0;for(let a of r){let l=i.shapes[a];if(l.level<=n||e<l.minX||e>l.maxX||t<l.minY||t>l.maxY||!ui(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(ui(c,e,t)){s=true;break}s||(n=l.level);}return Math.min(Math.round(n*100),127)}function pr(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=vo(i,e[0],e[1]);t.push(e[0],e[1]),o.push(a);for(let l=0;l+3<e.length;l+=2){let s=e[l],c=e[l+1],f=e[l+2],u=e[l+3],h=vo(i,f,u);if(h!==a&&n>0){let m=Math.hypot(f-s,u-c),d=Math.min(Math.ceil(m/n),64),p=a;for(let y=1;y<d;y++){let b=y/d,g=s+(f-s)*b,v=c+(u-c)*b,x=vo(i,g,v);x!==p&&(t.push(g,v),o.push(x),p=x);}}t.push(f,u),o.push(h),a=h;}return {pts:t,levels:o}}var ut=i=>i<0?0:i>31?31:i;function ui(i,e,t){let o=false,r=i.length/2;for(let n=0,a=r-1;n<r;a=n++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1];s>t!=f>t&&e<(c-l)*(t-s)/(f-s)+l&&(o=!o);}return o}var Es=5;function et(i){let e=i.layer,t=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;if(Number.isFinite(t)&&t!==0)return Math.max(-5,Math.min(5,Math.trunc(t)));let o=i.brunnel;return o==="bridge"?1:o==="tunnel"?-1:0}var Ue=20;function br(i,e,t=0,o,r=0,n={}){let{level:a}=n,l=Math.max(256,i.length*24),s=new ArrayBuffer(l*Ue),c=new DataView(s),f=0,u=[],h=g=>{if(f+g<=l)return;l=Math.max(l*2,f+g);let v=new ArrayBuffer(l*Ue);new Uint8Array(v).set(new Uint8Array(s,0,f*Ue)),s=v,c=new DataView(v);},m=(g,v,x,C,S,M,w,_=0,T=0,L=0)=>{let k=f*Ue;return c.setInt16(k,g,true),c.setInt16(k+2,v,true),c.setInt16(k+4,x,true),c.setInt16(k+6,C,true),c.setInt8(k+8,S),c.setInt8(k+9,M),c.setInt8(k+10,_),c.setInt8(k+11,T),c.setFloat32(k+12,w,true),c.setFloat32(k+16,L,true),f++},d=0,p=r>0?12/r:0,y=p>0?Fs(i):null;for(let g of i.features()){if(g.type!==2&&g.type!==3||!pe(e,g.properties)||a!==void 0&&et(g.properties)!==a)continue;let v=g.properties.width;d=typeof v=="number"&&v>.5&&v<100?v:0;let x=g.type===3;for(let C of g.loadGeometry()){let S=t>0?As(di(C),t):di(C);if(S.length<4)continue;let M=o&&!hi(o)?pr(o,S):null,w=M?M.pts:S,_=M?.levels,T=w.length/2;if(T<2)continue;let L=et(g.properties),k=wo(Math.round(w[0]),Math.round(w[1])),z=wo(Math.round(w[T*2-2]),Math.round(w[T*2-1])),A=null,I=d;if(y&&d>0&&!x){let F=0;for(let O=0;O<T-1;O++)F+=Math.hypot(w[O*2+2]-w[O*2],w[O*2+3]-w[O*2+1]);I=pi(L,d,k,z,y);let P=O=>Math.min(y.width.get(O)??0,I*2),R=P(k)-I,W=P(z)-I,G=Math.min(p,F/2);if(G>0&&(R>0||W>0)){A=H=>{let V=0;return R>0&&H<G&&(V=R*(1-H/G)),W>0&&F-H<G&&(V=Math.max(V,W*(1-(F-H)/G))),I+V};let O=[];for(let H of [G,F-G])H>.01&&H<F-.01&&O.push(H);if(O.length){let H=ks(w,_,O);w=H.pts,_=H.levels,T=w.length/2;}}}h((T-1)*4);let E=0;for(let F=0;F<T-1;F++){let P=w[F*2],R=w[F*2+1],W=w[F*2+2],G=w[F*2+3],O=Math.hypot(W-P,G-R);if(x&&Is(P,R,W,G,i.extent)){E+=O;continue}let H=Ls(P,R,W,G,i.extent);if(!H){E+=O;continue}let[V,Y,$,Q]=H,ue=Math.hypot(V-P,Y-R),J=Math.hypot($-V,Q-Y),X=Math.hypot(W-$,G-Q),te=E+ue,ie=_?_[F]:0,q=_?_[F+1]:0,U=A?A(te):I,j=A?A(te+J):I,le=m(V,Y,$,Q,0,-1,te,ie,q,U),ae=m(V,Y,$,Q,0,1,te,ie,q,U),se=m(V,Y,$,Q,1,1,te,ie,q,j),oe=m(V,Y,$,Q,1,-1,te,ie,q,j);E+=ue+J+X,u.push(le,ae,se,le,se,oe);}}}if(!u.length)return null;let b=new Uint32Array(u);return {vertices:s.slice(0,f*Ue),indices:b.buffer,vertexCount:f,indexCount:b.length}}function ks(i,e,t){let o=[...t].sort((s,c)=>s-c),r=[i[0],i[1]],n=e?[e[0]]:void 0,a=0,l=0;for(let s=0;s+3<i.length;s+=2){let c=i[s],f=i[s+1],u=i[s+2],h=i[s+3],m=Math.hypot(u-c,h-f);for(;l<o.length&&o[l]<=a+.01;)l++;for(;l<o.length&&o[l]<a+m-.01;){let d=(o[l]-a)/m;r.push(c+(u-c)*d,f+(h-f)*d),n&&e&&n.push(Math.round(e[s/2]+(e[s/2+1]-e[s/2])*d)),l++;}a+=m,r.push(u,h),n&&e&&n.push(e[s/2+1]);}return {pts:r,levels:n}}function As(i,e){let t=[];for(let o=0;o+3<i.length;o+=2){let r=i[o],n=i[o+1],a=i[o+2],l=i[o+3];t.push(r,n);let s=Math.min(64,Math.floor(Math.hypot(a-r,l-n)/e));for(let c=1;c<s;c++){let f=c/s;t.push(r+(a-r)*f,n+(l-n)*f);}}return t.push(i[i.length-2],i[i.length-1]),t}function di(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}function Ls(i,e,t,o,r){let n=t-i,a=o-e,l=0,s=1,c=[[-n,i],[n,r-i],[-a,e],[a,r-e]];for(let[f,u]of c){if(f===0){if(u<0)return null;continue}let h=u/f;if(f<0){if(h>s)return null;h>l&&(l=h);}else {if(h<l)return null;h<s&&(s=h);}}return s-l<1e-6?null:[Math.round(i+n*l),Math.round(e+a*l),Math.round(i+n*s),Math.round(e+a*s)]}function Is(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var mi=new WeakMap,wo=(i,e)=>(i+512)*65536+(e+512);function pi(i,e,t,o,r){if(i===0||e<=0)return e;let n=8*4294967296,a=Math.max(r.raw.get(t+n)??0,r.raw.get(o+n)??0);return a>0&&e>a?a:e}function Fs(i){let e=mi.get(i);if(e)return e;let t={width:new Map,ends:new Map,raw:new Map},o=[];for(let r of i.features()){if(r.type!==2)continue;let n=r.properties.width,a=typeof n=="number"&&n>.5&&n<100?n:0,l=et(r.properties);for(let s of r.loadGeometry()){if(s.length<4)continue;let c=wo(Math.round(s[0]),Math.round(s[1])),f=wo(Math.round(s[s.length-2]),Math.round(s[s.length-1]));for(let u of [c,f]){let h=u+(l+8)*4294967296;t.ends.set(h,(t.ends.get(h)??0)+1),a>0&&t.raw.set(h,Math.max(t.raw.get(h)??0,a));}o.push({h:c,t:f,lv:l,w:a});}}for(let r of o){let n=pi(r.lv,r.w,r.h,r.t,t);if(!(n<=0))for(let a of [r.h,r.t]){let l=t.width.get(a);(l===void 0||n>l)&&t.width.set(a,n);}}return mi.set(i,t),t}var yr={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[1.35,7.5],fogIntensity:.92,spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.75},gr={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var bi={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16}},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11}},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10}},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12}},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"}},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15}},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1}},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var yi={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"landcover-wood",type:"fill","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}},cornerRadius:4,cornerSegments:3},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"},cornerRadius:4,cornerSegments:3},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"},cornerRadius:4,cornerSegments:3},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10},cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12},cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"},cornerRadius:3,cornerSegments:3},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15},cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"},cornerRadius:5,cornerSegments:3},{id:"water",type:"fill","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1},cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1},cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var gi={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16,sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11,sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26,sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9,sideShade:.16},elevation:.15,bevel:.5,bevelDrop:.08,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10,sideShade:.16},elevation:.35,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12,sideShade:.16},elevation:.3,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"}},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15,sideShade:.16},elevation:.6,bevel:.5,bevelDrop:.15,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.35,bevel:.8,bevelDrop:.12,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.2,bevel:.4,bevelDrop:.08,cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.3}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4,elevation:.08}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.15,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.13,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.11,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.12}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2,elevation:.05}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,elevation:.14,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,elevation:.16,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.182}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.162}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16},elevation:.09,bevel:.05,bevelDrop:.02,groundBy:{"landcover:wood":.7,"landcover:forest":.7,"landcover:grass":.5,"landcover:farmland":.5,"landcover:meadow":.5,"landcover:sand":.12,"landcover:beach":.12,"landcover:wetland":.15,"landcover:swamp":.15,"landuse:pitch":.35,"landuse:stadium":.35,"landuse:playground":.35,"landuse:track":.35,"landuse:swimming_pool":.35,"landuse:cemetery":.3,"landuse:grave_yard":.3,"park:park":.6}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var vi={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"landcover-wood",type:"surface","source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.175,bevel:.125,bevelDrop:.038,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface","source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.125,bevel:.113,bevelDrop:.03,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface","source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.035,bevel:.15,bevelDrop:.02,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill","source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface","source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.045,bevel:.125,bevelDrop:.02,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]},material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.02,bevel:.1,bevelDrop:.02},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.03,bevel:.1,bevelDrop:.02},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.055,bevel:.1,bevelDrop:.02},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",sideShade:.16},elevation:.088,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat",sideShade:.16},elevation:.075,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5",material:"flat",sideShade:.16},cornerRadius:3,cornerSegments:3,elevation:.19,bevel:.1,bevelDrop:.02},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.15,bevel:.125,bevelDrop:.038,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6",material:"flat",sideShade:.16},cornerRadius:5,cornerSegments:3,elevation:.065,bevel:.1,bevelDrop:.02},{id:"water",type:"surface","source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.087,bevel:.2,bevelDrop:.03,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.05,bevel:.1,bevelDrop:.02,cornerRadius:4,cornerSegments:3},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.075}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.02}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.037,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.033,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.028,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.03}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.013}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.035,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.04,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.047}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.042}},{id:"boundary",type:"line","source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:true},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:true},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:true,paint:{color:"#ffffff",opacity:.9,sideShade:.16,material:"flat"},elevation:.023,bevel:.013,bevelDrop:.005,groundBy:{"landcover:wood":.175,"landcover:forest":.175,"landcover:grass":.125,"landcover:farmland":.125,"landcover:meadow":.125,"landcover:sand":.035,"landcover:beach":.035,"landcover:wetland":.045,"landcover:swamp":.045,"landuse:residential":.02,"landuse:suburb":.02,"landuse:neighbourhood":.02,"landuse:quarter":.02,"landuse:industrial":.03,"landuse:quarry":.03,"landuse:railway":.03,"landuse:substation":.03,"landuse:school":.055,"landuse:university":.055,"landuse:college":.055,"landuse:hospital":.055,"landuse:clinic":.055,"landuse:police":.055,"landuse:kindergarten":.055,"landuse:bus_station":.055,"landuse:pitch":.088,"landuse:stadium":.088,"landuse:playground":.088,"landuse:track":.088,"landuse:swimming_pool":.088,"landuse:cemetery":.075,"landuse:grave_yard":.075,"landuse:parking":.19,"landuse:fuel":.19,"park:park":.15,"aeroway:aerodrome":.065,"aeroway:apron":.065,"aeroway:helipad":.065}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var wi={name:"\u041D\u043E\u0447\u043D\u0430\u044F",background:"#11151c",model3dKey:"night",light:{ambientColor:"#8fa3c4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cfd8ea",keyIntensity:.3,fillAzimuth:300,fillAltitude:20,fillColor:"#4a5f86",fillIntensity:.22},paint:{"landcover-wood":{color:"#16261a"},"landcover-grass":{color:"#182619"},"landcover-sand":{color:"#2a2417"},"landcover-ice":{color:"#1b2730"},"landcover-wetland":{color:"#16242a"},"landuse-residential":{color:"#171b23"},"landuse-industrial":{color:"#1b1c20"},"landuse-civic":{color:"#1c1f28"},"landuse-sport":{color:"#16261c"},"landuse-cemetery":{color:"#182018"},"landuse-parking":{color:"#191d24"},park:{color:"#15271a"},"aeroway-area":{color:"#1b1e26"},water:{color:"#0f2438"},"water-pool":{color:"#123048"},waterway:{color:"#14304a"},"aeroway-line":{color:"#242833"},"road-casing-major":{color:"#2a2519"},"road-casing-secondary":{color:{stops:[[16,"#22262f"],[18.5,"#2a2519"]]}},"road-casing-minor":{color:{stops:[[16,"#1e222a"],[18.5,"#2a2519"]]}},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:{stops:[[16,"#2f343d"],[18.5,"#6b5c3c"]]}},"road-secondary":{color:{stops:[[16,"#3c424d"],[18.5,"#6b5c3c"]]}},"road-ramp":{color:"#6b5c3c"},"road-major":{color:"#6b5c3c"},boundary:{color:"#4a3f52"},building:{color:"#232833",roofColor:"#2b313d",aoStrength:.3,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#39424f",windowGlow:.35},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"road-label":{color:"#a8b0bd",haloColor:"#12161d",haloWidth:1.5},"water-label":{color:"#6ea2c7",haloColor:"#0e1b28"},"place-label":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2},"poi-food":{color:"#d89964",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#12161d",haloWidth:1.3,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#12161d",haloWidth:1.3,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#12161d",haloWidth:1.3,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#12161d",haloWidth:1.3,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var xi={name:"\u0413\u0440\u0430\u0444\u0438\u0442",background:"#eeeeee",light:{ambientColor:"#ffffff",ambientIntensity:.55,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.5,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.16},paint:{"landcover-wood":{color:"#e2e2e2"},"landcover-grass":{color:"#e7e7e7"},"landcover-sand":{color:"#eaeaea"},"landcover-ice":{color:"#f0f0f0"},"landcover-wetland":{color:"#e4e4e4"},"landuse-residential":{color:"#e9e9e9"},"landuse-industrial":{color:"#e5e5e5"},"landuse-civic":{color:"#ebebeb"},"landuse-sport":{color:"#e4e4e4"},"landuse-cemetery":{color:"#e6e6e6"},"landuse-parking":{color:"#ececec"},park:{color:"#e3e3e3"},"aeroway-area":{color:"#e8e8e8"},water:{color:"#d4d4d4"},"water-pool":{color:"#d8d8d8"},waterway:{color:"#d4d4d4"},"aeroway-line":{color:"#dedede"},"road-casing-major":{color:"#c9c9c9"},"road-casing-secondary":{color:{stops:[[16,"#d2d2d2"],[18.5,"#c9c9c9"]]}},"road-casing-minor":{color:{stops:[[16,"#d8d8d8"],[18.5,"#c9c9c9"]]}},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:{stops:[[16,"#f7f7f7"],[18.5,"#ffffff"]]}},"road-secondary":{color:{stops:[[16,"#fbfbfb"],[18.5,"#ffffff"]]}},"road-ramp":{color:"#ffffff"},"road-major":{color:"#ffffff"},boundary:{color:"#b0b0b0"},building:{color:"#dcdcdc",roofColor:"#e0e0e0",aoStrength:.22,tintVariation:.05,windowColor:"#b7bcc2",windowFrameColor:"#f2f2f2",windowGlow:0},housenumber:{color:"#9a9a9a",haloColor:"#f4f4f4"},poi:{color:"#3c3c3c",haloColor:"#ffffff"},"road-label":{color:"#585858",haloColor:"#ffffff"},"water-label":{color:"#6e6e6e",haloColor:"#ffffff"},"place-label":{color:"#2a2a2a",haloColor:"#ffffff"},"poi-food":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#e9e9e9",opacity:.97},"indoor-corridor":{color:"#eeeeee"},"indoor-room":{color:"#e2e2e2"},"indoor-service":{color:"#cecece"},"indoor-shop":{color:"#d7cfdf"},"indoor-food":{color:"#dfd7cf"},"indoor-wc":{color:"#cfd9df"},"indoor-wall":{color:"#c0c0c0",roofColor:"#d4d4d4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c2bbd1",opacity:.95},"indoor-door":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-poi":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-name":{color:"#2a2a2a",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[1.35,7.5],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var _i={name:"\u0411\u043B\u0435\u0434\u043D\u0430\u044F",background:"#f7f6f3",light:{ambientColor:"#ffffff",ambientIntensity:.62,keyAzimuth:120,keyAltitude:65,keyColor:"#fffaf0",keyIntensity:.38,fillAzimuth:300,fillAltitude:25,fillColor:"#eef2f8",fillIntensity:.14},paint:{"landcover-wood":{color:"#e8efe2"},"landcover-grass":{color:"#edf2e6"},"landcover-sand":{color:"#f4eede"},"landcover-ice":{color:"#f0f5f7"},"landcover-wetland":{color:"#e8f0ec"},"landuse-residential":{color:"#f2f0ec"},"landuse-industrial":{color:"#f0edeb"},"landuse-civic":{color:"#f4efe9"},"landuse-sport":{color:"#e9f1e4"},"landuse-cemetery":{color:"#ecefe6"},"landuse-parking":{color:"#f3f1ed"},park:{color:"#e7f0df"},"aeroway-area":{color:"#f0f0f2"},water:{color:"#dce9f2"},"water-pool":{color:"#dcecf5"},waterway:{color:"#dce9f2"},"aeroway-line":{color:"#ebebee"},"road-casing-major":{color:"#efe4d2"},"road-casing-secondary":{color:{stops:[[16,"#eceae2"],[18.5,"#efe4d2"]]}},"road-casing-minor":{color:{stops:[[16,"#efedE6"],[18.5,"#efe4d2"]]}},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:{stops:[[16,"#fdfcfa"],[18.5,"#fff8e8"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#fff8e8"]]}},"road-ramp":{color:"#fff8e8"},"road-major":{color:"#fff8e8"},boundary:{color:"#cfc3d2"},building:{color:"#eae7e0",roofColor:"#ecE9e2",aoStrength:.14,tintVariation:.04,windowColor:"#c7d6e4",windowFrameColor:"#f6f7f9",windowGlow:0},housenumber:{color:"#a9a296",haloColor:"#fbfaf7"},poi:{color:"#6b6b6b",haloColor:"#ffffff"},"road-label":{color:"#8a8474",haloColor:"#ffffff"},"water-label":{color:"#7ea8c4",haloColor:"#ffffff"},"place-label":{color:"#55524c",haloColor:"#ffffff"},"poi-food":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#f4f3f0",opacity:.97},"indoor-corridor":{color:"#f8f7f6"},"indoor-room":{color:"#edece8"},"indoor-service":{color:"#dcd9d1"},"indoor-shop":{color:"#e0dae6"},"indoor-food":{color:"#e6e0da"},"indoor-wc":{color:"#dae1e6"},"indoor-wall":{color:"#cdcbc4",roofColor:"#e0dedb",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc5d9",opacity:.95},"indoor-door":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-poi":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-name":{color:"#55524c",haloColor:"#ffffff"}},sky:{skyColor:"#c8dbee",horizonColor:"#eef2f6",fogRange:[1.4,9],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var Ci={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#dfdbda",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},paint:{"landcover-wood":{color:"#9bda95"},"landcover-grass":{color:"#b2e6a8"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d5e8f1"},"landcover-wetland":{color:"#badbde"},"landuse-residential":{color:"#e4e1e0"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#d6d4d4"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#dfdcd9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-casing-minor":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-secondary":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-ramp":{color:"#99abc2"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ffffff",roofColor:"#f2f1f0",aoStrength:.19,tintVariation:0,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[1.34,7.36],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var Si={name:"\u041C\u0443\u043B\u044C\u0442\u044F\u0448\u043D\u0430\u044F",background:"#f7f3de",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#61d161"},"landcover-grass":{color:"#91e481"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c7dfeb"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#f2ecd9"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#9fec79"},"landuse-cemetery":{color:"#a8d69f"},"landuse-parking":{color:"#dddcda"},park:{color:"#91e481"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#71c8f4"},waterway:{color:"#71c8f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#ca6a16"},"road-casing-secondary":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-casing-minor":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-ramp":{color:"#f8c662"},"road-major":{color:"#f8c662"},boundary:{color:"#f6517a"},building:{color:"#f4dfc2",roofColor:"#f4dfc2",aoStrength:.19,tintVariation:.06,windowColor:"#5b9ee0",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#80d1fa"},"indoor-shell":{color:"#ebe9e5",opacity:.97},"indoor-corridor":{color:"#efedea"},"indoor-room":{color:"#e5e1dc"},"indoor-service":{color:"#d4cec6"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#c4c0ba",roofColor:"#d6d4d0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#8cb5c9",horizonColor:"#e8e2c7",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var Mi={name:"\u041A\u0438\u0431\u0435\u0440\u043F\u0430\u043D\u043A",background:"#120817",model3dKey:"night",light:{ambientColor:"#b279cf",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#ff70d0",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#854770",fillIntensity:.22},paint:{"landcover-wood":{color:"#0c3728"},"landcover-grass":{color:"#104131"},"landcover-sand":{color:"#262417"},"landcover-ice":{color:"#74345f"},"landcover-wetland":{color:"#152223"},"landuse-residential":{color:"#170b1e"},"landuse-industrial":{color:"#171921"},"landuse-civic":{color:"#21171a"},"landuse-sport":{color:"#0c4529"},"landuse-cemetery":{color:"#151e1b"},"landuse-parking":{color:"#272428"},park:{color:"#104131"},"aeroway-area":{color:"#1a1c23"},water:{color:"#5f1145"},waterway:{color:"#711452"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#981662"},"road-casing-secondary":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-casing-minor":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-secondary":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-ramp":{color:"#f631a4"},"road-major":{color:"#f631a4"},boundary:{color:"#f53da8"},building:{color:"#311839",roofColor:"#9d2575",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#84dcff",windowGlow:.5},housenumber:{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},poi:{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"road-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#110514",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#110514",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#110514",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#110514",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#110514",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#110514",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#110514",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#110514",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#110514",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#84135f"},"indoor-shell":{color:"#4c3752",opacity:.97},"indoor-corridor":{color:"#46334c"},"indoor-room":{color:"#553e5d"},"indoor-service":{color:"#6e5078"},"indoor-shop":{color:"#59446f"},"indoor-food":{color:"#6f5a44"},"indoor-wc":{color:"#445e6f"},"indoor-wall":{color:"#7b6681",roofColor:"#938298",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#635287",opacity:.95},"indoor-door":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-poi":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-name":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#110514"}},sky:{skyColor:"#180813",horizonColor:"#281831",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var Ti={name:"\u0420\u0430\u0441\u0441\u0432\u0435\u0442",background:"#f4ebe1",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffe0c0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a4db9f"},"landcover-grass":{color:"#bae7b1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#dbe7f0"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f5efeb"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#c1ecac"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#dddbda"},park:{color:"#bae7b1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6d2f2"},waterway:{color:"#a6d2f2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#92a1bf"},"road-casing-secondary":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-casing-minor":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-secondary":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-ramp":{color:"#a9b9d1"},"road-major":{color:"#a9b9d1"},boundary:{color:"#f584a1"},building:{color:"#f6ebdf",roofColor:"#fdede7",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#f0ece8",windowGlow:0},housenumber:{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},poi:{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"road-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"poi-food":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b9ddf7"},"indoor-shell":{color:"#f8f7f5",opacity:.97},"indoor-corridor":{color:"#fcfbfb"},"indoor-room":{color:"#f1efed"},"indoor-service":{color:"#e0dbd6"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#d1cdc9",roofColor:"#e4e2e0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-poi":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-name":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fdfaf7"}},sky:{skyColor:"#8cb0c9",horizonColor:"#e4d7cb",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var Ei={name:"\u0421\u0443\u043C\u0435\u0440\u043A\u0438",background:"#d7cbc1",light:{ambientColor:"#ececeb",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#ffcaa0",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#75af6a"},"landcover-grass":{color:"#94bd7f"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c1c8d7"},"landcover-wetland":{color:"#83bec3"},"landuse-residential":{color:"#d5cac3"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#91c775"},"landuse-cemetery":{color:"#9ac982"},"landuse-parking":{color:"#c0bcb9"},park:{color:"#94bd7f"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#708bc2"},waterway:{color:"#708bc2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6a5b9a"},"road-casing-secondary":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-casing-minor":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-secondary":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-ramp":{color:"#8576b2"},"road-major":{color:"#8576b2"},boundary:{color:"#e05275"},building:{color:"#e0d1c2",roofColor:"#f1d6cb",aoStrength:.2,tintVariation:.07,windowColor:"#6b9ed1",windowFrameColor:"#efe6df",windowGlow:0},housenumber:{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},poi:{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"road-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"poi-food":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#7a94ca"},"indoor-shell":{color:"#e3deda",opacity:.97},"indoor-corridor":{color:"#e7e3df"},"indoor-room":{color:"#dcd7d1"},"indoor-service":{color:"#cbc3ba"},"indoor-shop":{color:"#ccc2d6"},"indoor-food":{color:"#d6ccc2"},"indoor-wc":{color:"#c2ced6"},"indoor-wall":{color:"#bbb5af",roofColor:"#cdc9c6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b6adc9",opacity:.95},"indoor-door":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-poi":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-name":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"building-entrance":{haloColor:"#f5ebe0"}},sky:{skyColor:"#5675b3",horizonColor:"#c0b4aa",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var ki={name:"\u0417\u0435\u043C\u043B\u044F",background:"#dbd1bd",light:{ambientColor:"#edecea",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff2dc",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d6e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#50a136"},"landcover-grass":{color:"#8ac76b"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#aec5d6"},"landcover-wetland":{color:"#7cbac0"},"landuse-residential":{color:"#ded5c4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#86d161"},"landuse-cemetery":{color:"#94c67b"},"landuse-parking":{color:"#c0beb9"},park:{color:"#8ac76b"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#3b91ce"},waterway:{color:"#4798d1"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a47546"},"road-casing-secondary":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-casing-minor":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-secondary":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-ramp":{color:"#cdaa7a"},"road-major":{color:"#cdaa7a"},boundary:{color:"#bf6a40"},building:{color:"#d4c5af",roofColor:"#d4c5af",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceae4",windowGlow:0},housenumber:{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},poi:{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"road-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"poi-food":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#4299d7"},"indoor-shell":{color:"#d6d0c8",opacity:.97},"indoor-corridor":{color:"#d9d5cd"},"indoor-room":{color:"#cfc9bf"},"indoor-service":{color:"#beb5a9"},"indoor-shop":{color:"#bcafca"},"indoor-food":{color:"#cabdaf"},"indoor-wc":{color:"#afbfca"},"indoor-wall":{color:"#ada79e",roofColor:"#bebbb5",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbc",opacity:.95},"indoor-door":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-poi":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-name":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"building-entrance":{haloColor:"#f7f4ee"}},sky:{skyColor:"#568db3",horizonColor:"#c4baa5",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var Ai={name:"\u0424\u0443\u0442\u0443\u0440\u0438\u0437\u043C",background:"#0c0f1d",model3dKey:"night",light:{ambientColor:"#8590c7",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#8ff0ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#477b85",fillIntensity:.22},paint:{"landcover-wood":{color:"#123026"},"landcover-grass":{color:"#18392e"},"landcover-sand":{color:"#2d2a1b"},"landcover-ice":{color:"#276672"},"landcover-wetland":{color:"#192829"},"landuse-residential":{color:"#111422"},"landuse-industrial":{color:"#1b1d27"},"landuse-civic":{color:"#271b1f"},"landuse-sport":{color:"#143d29"},"landuse-cemetery":{color:"#192420"},"landuse-parking":{color:"#292a2e"},park:{color:"#18392e"},"aeroway-area":{color:"#1e2129"},water:{color:"#055261"},waterway:{color:"#076a7e"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#8b238b"},"road-casing-secondary":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-casing-minor":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-secondary":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-ramp":{color:"#e03ee0"},"road-major":{color:"#e03ee0"},boundary:{color:"#eb47eb"},building:{color:"#1e2b3e",roofColor:"#277686",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#bfe6ff",windowGlow:.5},housenumber:{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},poi:{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"road-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080a17",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080a17",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080a17",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080a17",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080a17",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#027288"},"indoor-shell":{color:"#394556",opacity:.97},"indoor-corridor":{color:"#354050"},"indoor-room":{color:"#404d60"},"indoor-service":{color:"#52637b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#687485",roofColor:"#858e9a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-poi":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-name":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080a17"}},sky:{skyColor:"#081619",horizonColor:"#1b1f30",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var Li={name:"\u0421\u0442\u0435\u043A\u043B\u043E \u043C\u044F\u0433\u043A\u043E\u0435",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#bddbc3"},"landcover-grass":{color:"#d0ecda"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbebdb"},"landcover-wetland":{color:"#d9ebed"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#cdefd4"},"landuse-cemetery":{color:"#dbf0e3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#ccead9"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#b9e5f4"},waterway:{color:"#81c6e4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#dabc95"},"road-casing-secondary":{color:{stops:[[16,"#d5cdb8"],[18.5,"#dabc95"]]}},"road-casing-minor":{color:{stops:[[16,"#cad1d8"],[18.5,"#dabc95"]]}},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8e5c3"]]}},"road-secondary":{color:{stops:[[16,"#fbf6ea"],[18.5,"#f8e5c3"]]}},"road-ramp":{color:"#f8e5c3"},"road-major":{color:"#f8e5c3"},boundary:{color:"#ce97c0"},building:{color:"#e5ebf0",roofColor:"#f7fbfd",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#ceeef9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Ii={name:"\u0421\u0442\u0435\u043A\u043B\u043E",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#b8e0cf"},"landcover-grass":{color:"#cbebdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#e5f0f3"},"landcover-wetland":{color:"#d6e9eb"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#c8efd5"},"landuse-cemetery":{color:"#d8eee3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#cbebdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#bee6f4"},waterway:{color:"#bee6f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#9dc7dd"},"road-casing-secondary":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-casing-minor":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-secondary":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-ramp":{color:"#b8daea"},"road-major":{color:"#b8daea"},boundary:{color:"#e28dc6"},building:{color:"#e8eef3",roofColor:"#f4f8fb",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#d3eff9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[1.35,7.42],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Fi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0447\u0451\u0440\u043D\u0430\u044F",background:"#1a1a1a",model3dKey:"night",light:{ambientColor:"#a8a8a8",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cccccc",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#854747",fillIntensity:.22},paint:{"landcover-wood":{color:"#212121"},"landcover-grass":{color:"#292929"},"landcover-sand":{color:"#33301f"},"landcover-ice":{color:"#545454"},"landcover-wetland":{color:"#1d2e30"},"landuse-residential":{color:"#1f1f1f"},"landuse-industrial":{color:"#1f222d"},"landuse-civic":{color:"#2d1f24"},"landuse-sport":{color:"#2d2525"},"landuse-cemetery":{color:"#2a1d1d"},"landuse-parking":{color:"#332e2e"},park:{color:"#292929"},"aeroway-area":{color:"#23262f"},water:{color:"#383838"},waterway:{color:"#3d3d3d"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#525252"},"road-casing-secondary":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-casing-minor":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-secondary":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-ramp":{color:"#757575"},"road-major":{color:"#757575"},boundary:{color:"#808080"},building:{color:"#2e2e2e",roofColor:"#4f4f4f",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#c8ccd4",windowGlow:.36},housenumber:{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},poi:{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"road-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"poi-food":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#4c4c4c"},"indoor-shell":{color:"#484848",opacity:.97},"indoor-corridor":{color:"#424242"},"indoor-room":{color:"#505050"},"indoor-service":{color:"#676767"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#767676",roofColor:"#909090",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-poi":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-name":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"building-entrance":{color:"#cac4c4",haloColor:"#0a0a0a"}},sky:{skyColor:"#190909",horizonColor:"#282828",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var Ri={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0441\u0438\u043D\u044F\u044F",background:"#e3e9f2",light:{ambientColor:"#f7f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#eef4ff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee5ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a1b8ce"},"landcover-grass":{color:"#bdccdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#baccde"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#ebeff4"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#b8d3e0"},"landuse-cemetery":{color:"#c2d4e5"},"landuse-parking":{color:"#dadbdd"},park:{color:"#bdccdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5799db"},waterway:{color:"#5f9edd"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#407fbf"},"road-casing-secondary":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-casing-minor":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-secondary":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-ramp":{color:"#71a3d6"},"road-major":{color:"#71a3d6"},boundary:{color:"#478cd1"},building:{color:"#cfdae8",roofColor:"#e5edf6",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8eef6",windowGlow:0},housenumber:{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},poi:{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"road-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#61a2e3"},"indoor-shell":{color:"#e6e8ec",opacity:.97},"indoor-corridor":{color:"#ebedf0"},"indoor-room":{color:"#dde1e5"},"indoor-service":{color:"#c6ccd4"},"indoor-shop":{color:"#d6cedf"},"indoor-food":{color:"#dfd7ce"},"indoor-wc":{color:"#ced8df"},"indoor-wall":{color:"#babfc5",roofColor:"#d1d4d7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1bad1",opacity:.95},"indoor-door":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-poi":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-name":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfcfe"}},sky:{skyColor:"#8cabc9",horizonColor:"#ced6e1",fogRange:[1.34,7.35],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var zi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0437\u0435\u043B\u0451\u043D\u0430\u044F",background:"#dfecdf",light:{ambientColor:"#f5f6f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#f0fff0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dcece7",fillIntensity:.18},paint:{"landcover-wood":{color:"#5ccc65"},"landcover-grass":{color:"#8cd98c"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#bbd8ce"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#e6efe6"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#94e085"},"landuse-cemetery":{color:"#9fd69f"},"landuse-parking":{color:"#d4d8d4"},park:{color:"#8cd98c"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5ec9a6"},waterway:{color:"#66ccaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#44a754"},"road-casing-secondary":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-casing-minor":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-secondary":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-ramp":{color:"#64c474"},"road-major":{color:"#64c474"},boundary:{color:"#39c668"},building:{color:"#cfe2cb",roofColor:"#dff1df",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8f0e8",windowGlow:0},housenumber:{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},poi:{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"road-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"poi-food":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#67d1af"},"indoor-shell":{color:"#e1e8e0",opacity:.97},"indoor-corridor":{color:"#e6ece5"},"indoor-room":{color:"#d9e1d7"},"indoor-service":{color:"#c3d0c1"},"indoor-shop":{color:"#d1c8db"},"indoor-food":{color:"#dbd2c8"},"indoor-wc":{color:"#c8d4db"},"indoor-wall":{color:"#b7c0b5",roofColor:"#cdd2cc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bcb4cd",opacity:.95},"indoor-door":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-poi":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-name":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fcf8"}},sky:{skyColor:"#83c5af",horizonColor:"#cad9ca",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var Pi={name:"\u041B\u0443\u043D\u043D\u0430\u044F",background:"#c8cbd0",light:{ambientColor:"#ebecec",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#e8ecf2",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#a8abb3"},"landcover-grass":{color:"#b9bbc1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbcdd2"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ced0d4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#b2bdc7"},"landuse-cemetery":{color:"#adbddc"},"landuse-parking":{color:"#b9bcc0"},park:{color:"#b9bbc1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#929aaa"},waterway:{color:"#929aaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6c7689"},"road-casing-secondary":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-casing-minor":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-secondary":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-ramp":{color:"#949ba8"},"road-major":{color:"#949ba8"},boundary:{color:"#6a7181"},building:{color:"#c8cbd0",roofColor:"#d9dbdd",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#cfd6e0",windowGlow:0},housenumber:{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},poi:{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"road-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"poi-food":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#9ca4b3"},"indoor-shell":{color:"#d6d9dc",opacity:.97},"indoor-corridor":{color:"#dbdde0"},"indoor-room":{color:"#ced1d5"},"indoor-service":{color:"#b9bcc3"},"indoor-shop":{color:"#c7bcd2"},"indoor-food":{color:"#d2c7bc"},"indoor-wc":{color:"#bcc9d2"},"indoor-wall":{color:"#acafb4",roofColor:"#c2c4c7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b1a7c5",opacity:.95},"indoor-door":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-poi":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-name":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"building-entrance":{haloColor:"#f1f2f4"}},sky:{skyColor:"#5675b3",horizonColor:"#b1b4b9",fogRange:[1.33,7.14],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var Hi={name:"\u041C\u0430\u0442\u043E\u0432\u0430\u044F",background:"#e7e6e4",light:{ambientColor:"#f5f5f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6ec",fillIntensity:.18},paint:{"landcover-wood":{color:"#a3be9d"},"landcover-grass":{color:"#b3cbae"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d6dce0"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ecebe9"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#b6d2a7"},"landuse-cemetery":{color:"#b5dcad"},"landuse-parking":{color:"#d8d6d4"},park:{color:"#b3cbae"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6bbc9"},waterway:{color:"#a6bbc9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#969fb0"},"road-casing-secondary":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-casing-minor":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-secondary":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-ramp":{color:"#aeb4c2"},"road-major":{color:"#aeb4c2"},boundary:{color:"#ca919f"},building:{color:"#dad6d2",roofColor:"#e3e0dd",aoStrength:.19,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f0f0f2",windowGlow:0},housenumber:{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},poi:{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"road-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"poi-food":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b3c6d2"},"indoor-shell":{color:"#e6e3e1",opacity:.97},"indoor-corridor":{color:"#eae8e6"},"indoor-room":{color:"#dfdcd8"},"indoor-service":{color:"#cdc8c2"},"indoor-shop":{color:"#d1c8da"},"indoor-food":{color:"#dad1c8"},"indoor-wc":{color:"#c8d3da"},"indoor-wall":{color:"#bebab6",roofColor:"#d1cecc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bbb3cd",opacity:.95},"indoor-door":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-poi":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-name":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f6f5f4"}},sky:{skyColor:"#83abc5",horizonColor:"#d3d2d0",fogRange:[1.34,7.31],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var Oi={name:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0437\u043C",background:"#f7f7f7",light:{ambientColor:"#fcfcfc",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#d6e1d6"},"landcover-grass":{color:"#e1eae1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#edf0f2"},"landcover-wetland":{color:"#e3f1f2"},"landuse-residential":{color:"#fafafa"},"landuse-industrial":{color:"#e7e8ef"},"landuse-civic":{color:"#f3e7eb"},"landuse-sport":{color:"#e1edde"},"landuse-cemetery":{color:"#e6f4e6"},"landuse-parking":{color:"#e9e7e7"},park:{color:"#e1eae1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#d7e2ea"},waterway:{color:"#d7e2ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a3a3a3"},"road-casing-secondary":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-casing-minor":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-secondary":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-ramp":{color:"#bdbdbd"},"road-major":{color:"#bdbdbd"},boundary:{color:"#999999"},building:{color:"#ebebeb",roofColor:"#f2f2f2",aoStrength:.18,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f4f4f6",windowGlow:0},housenumber:{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#e8eff4"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"}},sky:{skyColor:"#a4c0d4",horizonColor:"#e6e6e6",fogRange:[1.35,7.44],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var Wi={name:"\u041E\u043A\u0435\u0430\u043D",background:"#d7e3ea",light:{ambientColor:"#f3f4f4",ambientIntensity:.47,keyAzimuth:120,keyAltitude:60,keyColor:"#e8f6ff",keyIntensity:.59,fillAzimuth:300,fillAltitude:25,fillColor:"#d8e4ea",fillIntensity:.18},paint:{"landcover-wood":{color:"#75c7c7"},"landcover-grass":{color:"#97d8d2"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#accedf"},"landcover-wetland":{color:"#a5d0d4"},"landuse-residential":{color:"#dfe8ec"},"landuse-industrial":{color:"#cbcedc"},"landuse-civic":{color:"#e3c9d2"},"landuse-sport":{color:"#90dfcb"},"landuse-cemetery":{color:"#a6d9d4"},"landuse-parking":{color:"#cfd2d3"},park:{color:"#97d8d2"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#30abe8"},waterway:{color:"#3eb0ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#47a3c2"},"road-casing-secondary":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-casing-minor":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-secondary":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-ramp":{color:"#79c0d8"},"road-major":{color:"#79c0d8"},boundary:{color:"#47bad1"},building:{color:"#d2dee4",roofColor:"#e7f0f3",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e6f0f6",windowGlow:0},housenumber:{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},poi:{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"road-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"poi-food":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#38b3f1"},"indoor-shell":{color:"#e5e9eb",opacity:.97},"indoor-corridor":{color:"#eaeeef"},"indoor-room":{color:"#dce2e5"},"indoor-service":{color:"#c6cfd4"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#bac1c4",roofColor:"#d0d4d6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-poi":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-name":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fbfc"}},sky:{skyColor:"#7aaac1",horizonColor:"#c1cfd6",fogRange:[1.34,7.27],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var Bi={name:"\u041F\u0440\u0435\u043C\u0438\u0443\u043C",background:"#211f1c",model3dKey:"night",light:{ambientColor:"#b0aaa4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c8b48a",keyIntensity:.3,fillAzimuth:300,fillAltitude:25,fillColor:"#496887",fillIntensity:.22},paint:{"landcover-wood":{color:"#1b271b"},"landcover-grass":{color:"#232f23"},"landcover-sand":{color:"#393622"},"landcover-ice":{color:"#2d3d4c"},"landcover-wetland":{color:"#213436"},"landuse-residential":{color:"#272421"},"landuse-industrial":{color:"#242633"},"landuse-civic":{color:"#332429"},"landuse-sport":{color:"#22331f"},"landuse-cemetery":{color:"#213021"},"landuse-parking":{color:"#383633"},park:{color:"#232f23"},"aeroway-area":{color:"#272a35"},water:{color:"#16293b"},waterway:{color:"#1c334a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#856e32"},"road-casing-secondary":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-casing-minor":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-secondary":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-ramp":{color:"#bf9e4a"},"road-major":{color:"#bf9e4a"},boundary:{color:"#d1aa47"},building:{color:"#443b2c",roofColor:"#726037",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#eef0f4",windowGlow:.36},housenumber:{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},poi:{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"road-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#181410",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#181410",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#181410",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#181410",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#181410",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#181410",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#181410",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#181410",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#181410",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#1c3752"},"indoor-shell":{color:"#564b39",opacity:.97},"indoor-corridor":{color:"#504635"},"indoor-room":{color:"#605440"},"indoor-service":{color:"#7b6c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#857a68",roofColor:"#9a9285",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-poi":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-name":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#181410"}},sky:{skyColor:"#09121b",horizonColor:"#2c2a27",fogRange:[1.3,6.51],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var Vi={name:"\u0420\u0435\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u0430\u044F",background:"#d6dac8",light:{ambientColor:"#eeeeed",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff0d8",keyIntensity:.57,fillAzimuth:300,fillAltitude:25,fillColor:"#cbd9e3",fillIntensity:.18},paint:{"landcover-wood":{color:"#62a63f"},"landcover-grass":{color:"#8dbf69"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#b4c9d7"},"landcover-wetland":{color:"#75b7bd"},"landuse-residential":{color:"#d6d1c2"},"landuse-industrial":{color:"#b9bdd0"},"landuse-civic":{color:"#d9b5c1"},"landuse-sport":{color:"#8bc95e"},"landuse-cemetery":{color:"#95c374"},"landuse-parking":{color:"#c3c5bf"},park:{color:"#8dbf69"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#4d97cb"},waterway:{color:"#599ecf"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#856b47"},"road-casing-secondary":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-casing-minor":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-secondary":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-ramp":{color:"#ccaa66"},"road-major":{color:"#ccaa66"},boundary:{color:"#8a735c"},building:{color:"#cdc4b7",roofColor:"#cdc4b7",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceef2",windowGlow:0},housenumber:{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},poi:{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"road-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"poi-food":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#559fd3"},"indoor-shell":{color:"#d6d0c9",opacity:.97},"indoor-corridor":{color:"#dad5ce"},"indoor-room":{color:"#cfc9c0"},"indoor-service":{color:"#beb6a9"},"indoor-shop":{color:"#bdb0ca"},"indoor-food":{color:"#cabeb0"},"indoor-wc":{color:"#b0c0ca"},"indoor-wall":{color:"#ada79e",roofColor:"#bfbbb6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbd",opacity:.95},"indoor-door":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-poi":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-name":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"building-entrance":{haloColor:"#f5f5f0"}},sky:{skyColor:"#5f92b7",horizonColor:"#bfc4b1",fogRange:[1.33,7.17],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var Di={name:"\u041A\u043E\u0441\u043C\u043E\u0441",background:"#0c0a1a",model3dKey:"night",light:{ambientColor:"#8c7fcb",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c0a8ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#475385",fillIntensity:.22},paint:{"landcover-wood":{color:"#241730"},"landcover-grass":{color:"#2e203c"},"landcover-sand":{color:"#292719"},"landcover-ice":{color:"#2e365b"},"landcover-wetland":{color:"#172526"},"landuse-residential":{color:"#110e20"},"landuse-industrial":{color:"#191b24"},"landuse-civic":{color:"#24191d"},"landuse-sport":{color:"#281c40"},"landuse-cemetery":{color:"#1c1721"},"landuse-parking":{color:"#27272b"},park:{color:"#2e203c"},"aeroway-area":{color:"#1c1f26"},water:{color:"#121c49"},waterway:{color:"#16225a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#7e279b"},"road-casing-secondary":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-casing-minor":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-secondary":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-ramp":{color:"#bf4ce6"},"road-major":{color:"#bf4ce6"},boundary:{color:"#ec51b8"},building:{color:"#2a2145",roofColor:"#7f30a6",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#9fb0d8",windowGlow:.5},housenumber:{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},poi:{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"road-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080614",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080614",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080614",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080614",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080614",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080614",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080614",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080614",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080614",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#152466"},"indoor-shell":{color:"#403956",opacity:.97},"indoor-corridor":{color:"#3c3550"},"indoor-room":{color:"#484060"},"indoor-service":{color:"#5c527b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#6f6885",roofColor:"#8a859a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-poi":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-name":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080614"}},sky:{skyColor:"#080b18",horizonColor:"#1d1931",fogRange:[1.3,6.5],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var Gi={name:"\u0412\u0443\u043B\u043A\u0430\u043D",background:"#29211e",model3dKey:"night",light:{ambientColor:"#b6a6a1",ambientIntensity:.35,keyAzimuth:120,keyAltitude:55,keyColor:"#ffb070",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#8b604b",fillIntensity:.22},paint:{"landcover-wood":{color:"#31241c"},"landcover-grass":{color:"#392e22"},"landcover-sand":{color:"#403c26"},"landcover-ice":{color:"#aa6b4b"},"landcover-wetland":{color:"#243b3d"},"landuse-residential":{color:"#2f2623"},"landuse-industrial":{color:"#282b39"},"landuse-civic":{color:"#39282e"},"landuse-sport":{color:"#3e2e1e"},"landuse-cemetery":{color:"#362e26"},"landuse-parking":{color:"#3e3938"},park:{color:"#392e22"},"aeroway-area":{color:"#2b2f3b"},water:{color:"#8b3f18"},waterway:{color:"#9c461c"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#aa350e"},"road-casing-secondary":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-casing-minor":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-secondary":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-ramp":{color:"#f98c1f"},"road-major":{color:"#f98c1f"},boundary:{color:"#f48c25"},building:{color:"#422b24",roofColor:"#c1551f",aoStrength:.28,tintVariation:.09,windowColor:"#84dcff",windowFrameColor:"#d8b0a0",windowGlow:.5},housenumber:{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},poi:{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"road-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#150b09",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#150b09",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#150b09",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#150b09",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#150b09",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#c2531a"},"indoor-shell":{color:"#564039",opacity:.97},"indoor-corridor":{color:"#503b35"},"indoor-room":{color:"#604840"},"indoor-service":{color:"#7b5c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#856f68",roofColor:"#9a8a85",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-poi":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-name":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#150b09"}},sky:{skyColor:"#1c100a",horizonColor:"#312a27",fogRange:[1.3,6.52],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var Ni={name:"\u0411\u0435\u043B\u0430\u044F",background:"#f5f1f0",light:{ambientColor:"#fafafa",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a7e2a2"},"landcover-grass":{color:"#b8ebad"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d7eaf4"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f6f4f4"},"landuse-industrial":{color:"#e0e2eb"},"landuse-civic":{color:"#efe1e6"},"landuse-sport":{color:"#c0f0a8"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#e4e2e2"},park:{color:"#b8ebad"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#99ddff"},waterway:{color:"#99ddff"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#94a0b8"},"road-casing-secondary":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-casing-minor":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-secondary":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-ramp":{color:"#a1b0c4"},"road-major":{color:"#a1b0c4"},boundary:{color:"#f87797"},building:{color:"#ffffff",roofColor:"#ffffff",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b1e5ff"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#9bbecf",horizonColor:"#e5dfdc",fogRange:[1.35,7.4],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var Ui={"3d":Ci,cartoon:Si,cyberpunk:Mi,dawn:Ti,dusk:Ei,earth:ki,future:Ai,"glass-refined":Li,glass:Ii,"harmony-black":Fi,"harmony-blue":Ri,"harmony-green":zi,lunar:Pi,matte:Hi,minimal:Oi,ocean:Wi,premium:Bi,realistic:Vi,space:Di,volcano:Gi,white:Ni};function xo(i,e){let t=new Set(e.hidden??[]),o=i.layers.map(r=>{let n=e.paint?.[r.id],a={...r,paint:n?{...r.paint,...n}:{...r.paint}};return t.has(r.id)&&(a.visible=false),a});if(e.paint)for(let r of Object.keys(e.paint))i.layers.some(n=>n.id===r)||console.warn(`[osmgl] \u0442\u0435\u043C\u0430 \xAB${e.name}\xBB: \u0432 \u0431\u0430\u0437\u043E\u0432\u043E\u043C \u0441\u0442\u0438\u043B\u0435 \u043D\u0435\u0442 \u0441\u043B\u043E\u044F \xAB${r}\xBB`);return {...i,name:e.name,background:e.background??i.background,light:{...i.light,...e.light},sky:{...i.sky,...e.sky},model3dKey:e.model3dKey??i.model3dKey,layers:o}}var K="base",ji="\u241F",ze=(i,e)=>i+"\u241F"+String(e);var ht=class{constructor(e=vr){this.splitValues={};this.spec=e,this.light={...gr,...e.light??{}},this.sky={...yr,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return he(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let n=e.paint?.color;if(n&&typeof n=="object"&&"from"in n){let l=this.layers.find(f=>f.id===n.from)?.paint?.color,s=ke(l,t,o),c=1-Math.min(Math.max(n.darken??0,0),1);return [s[0]*c,s[1]*c,s[2]*c,s[3]]}return ke(n,t,o)}layerVisibleAt(e,t){return !(e.visible===false||e.minzoom!==void 0&&t<e.minzoom||e.maxzoom!==void 0&&t>=e.maxzoom)}workerPlan(e=K){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??K)===e).map(t=>({id:t.id,type:t.type,sourceLayer:t["source-layer"],filter:t.filter,minzoom:t.minzoom??0,maxzoom:t.maxzoom??24,...t.splitBy?{splitBy:t.splitBy}:{},...t.type==="line"&&t.network?{network:t.network}:{},...t.cornerRadius?{cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments}:{},...t.clipToTile?{clipToTile:true}:{},...t.groundBy?{groundBy:t.groundBy}:{},...t.type==="surface"?{elevation:t.elevation,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop,weld:t.weld}:{},...t.type==="line"&&typeof t.paint?.elevation=="number"&&t.paint.elevation>0?{ground:true}:{},...t.type==="symbol"?{textField:t.layout?.textField,iconImage:t.layout?.iconImage,iconRotate:t.layout?.iconRotate,textPlacement:t.layout?.textPlacement,abbreviate:t.layout?.abbreviate}:{}}))}usedSources(){return [...new Set(this.layers.map(e=>e.source??K))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:ze(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},vr=bi,lc=yi,sc=gi,cc=vi,dt={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:wi,mono:xi,pale:_i,...Ui};function _o(i,e=vr){if(typeof i!="string")return xo(e,i);if(i==="day")return e;let t=dt[i];return t?xo(e,t):(console.warn(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0442\u0435\u043C\u0430 \xAB${i}\xBB; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B: ${Object.keys(dt).join(", ")}`),e)}var Ft=class{constructor(e,t){this.ctx=e;let o=e.gl;this._size=t;let r=o.createTexture(),n=o.createFramebuffer();if(!r||!n)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B");this.texture=r,this.framebuffer=n,e.bindTexture(7,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_FUNC,o.LEQUAL),this.allocate(t),o.bindFramebuffer(o.FRAMEBUFFER,n),o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,r,0),o.drawBuffers([o.NONE]),o.readBuffer(o.NONE);let a=o.checkFramebufferStatus(o.FRAMEBUFFER);if(o.bindFramebuffer(o.FRAMEBUFFER,null),e.bindTexture(7,null),a!==o.FRAMEBUFFER_COMPLETE)throw new Error(`[osmgl] \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0430\u0441\u044C: 0x${a.toString(16)}`)}get size(){return this._size}resize(e){e!==this._size&&(this._size=e,this.ctx.bindTexture(7,this.texture),this.allocate(e),this.ctx.bindTexture(7,null));}bind(){let e=this.ctx.gl;this.ctx.bindFramebuffer(this.framebuffer),this.ctx.viewport(0,0,this._size,this._size),this.ctx.setDepthTest(true),this.ctx.setDepthMask(true),e.clear(e.DEPTH_BUFFER_BIT);}bindTexture(e){this.ctx.bindTexture(e,this.texture);}allocate(e){let t=this.ctx.gl;t.texImage2D(t.TEXTURE_2D,0,t.DEPTH_COMPONENT24,e,e,0,t.DEPTH_COMPONENT,t.UNSIGNED_INT,null);}destroy(){this.ctx.gl.deleteFramebuffer(this.framebuffer),this.ctx.gl.deleteTexture(this.texture);}};function Xi(i){let e=i.gl,t=e.createTexture();if(!t)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u0433\u043B\u0443\u0448\u043A\u0443 \u043A\u0430\u0440\u0442\u044B \u0442\u0435\u043D\u0435\u0439");return i.bindTexture(7,t),e.texImage2D(e.TEXTURE_2D,0,e.DEPTH_COMPONENT24,1,1,0,e.DEPTH_COMPONENT,e.UNSIGNED_INT,new Uint32Array([4294967295])),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_FUNC,e.LEQUAL),i.bindTexture(7,null),t}var Rt=`
8
+ `)}var Lt=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Lt||{}),yo=class i{constructor(e,t,o,r){this.pbf=e;this.keys=t;this.values=o;this.extent=r;this.type=0;this.properties={};this.geomOffset=-1;}static read(e,t,o,r,n){let a=new i(e,o,r,n);return e.readFields(zl,a,t),a}loadGeometry(){if(this.geomOffset<0)return [];let e=this.pbf,t=e.pos;e.pos=this.geomOffset;let o=e.readVarint()+e.pos,r=1,n=0,a=0,l=0,s=[],c=[];for(;e.pos<o;){if(n<=0){let f=e.readVarint();r=f&7,n=f>>3;}if(n--,r===1||r===2)a+=e.readSVarint(),l+=e.readSVarint(),r===1&&(c.length&&s.push(c),c=[]),c.push(a,l);else if(r===7)c.length>=2&&c.push(c[0],c[1]);else throw new Error(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u043A\u043E\u043C\u0430\u043D\u0434\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 MVT: ${r}`)}return c.length&&s.push(c),e.pos=t,s}bbox(){let e=this.loadGeometry(),t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return [t,o,r,n]}};function zl(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?Pl(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function Pl(i,e){let t=i.readVarint()+i.pos;for(;i.pos<t;){let o=e.keys[i.readVarint()],r=e.values[i.readVarint()];o!==void 0&&(e.properties[o]=r);}}var go=class i{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[];}static read(e,t){let o=new i(e);return e.readFields(Hl,o,t),o}get length(){return this.featureOffsets.length}feature(e){let t=this.pbf;t.pos=this.featureOffsets[e];let o=t.readVarint()+t.pos;return yo.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function Hl(i,e,t){t&&(i===15?e.version=t.readVarint():i===1?e.name=t.readString():i===5?e.extent=t.readVarint():i===2?e.featureOffsets.push(t.pos):i===3?e.keys.push(t.readString()):i===4&&e.values.push(Ol(t)));}function Ol(i){let e=i.readVarint()+i.pos,t=null;for(;i.pos<e;){let o=i.readVarint()>>3;o===1?t=i.readString():o===2?t=i.readFloat():o===3?t=i.readDouble():o===4?t=i.readVarint64():o===5?t=i.readVarint():o===6?t=i.readSVarint():o===7?t=i.readBoolean():i.skip(o);}return t}var At=class{constructor(e){this.layers={};new Rl(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=go.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function Qe(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=Wl(o);r!==0&&(r>0?(t&&e.push(t),t={outer:o,holes:[]}):t&&t.holes.push(o));}return t&&e.push(t),e}function Wl(i){let e=0;for(let t=0,o=i.length-2;t<i.length;o=t,t+=2)e+=(i[o]-i[t])*(i[t+1]+i[o+1]);return e/2}function V(i,e,t){return i===void 0?t:typeof i=="number"?i:Un(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function ke(i,e,t){return i===void 0?t:typeof i=="string"?ce(i):Un(i.stops,e,(o,r,n)=>{let a=ce(o),l=ce(r);return [a[0]+(l[0]-a[0])*n,a[1]+(l[1]-a[1])*n,a[2]+(l[2]-a[2])*n,a[3]+(l[3]-a[3])*n]},t)}function Un(i,e,t,o){if(!i.length)return o;if(e<=i[0][0])return t(i[0][1],i[0][1],0);let r=i[i.length-1];if(e>=r[0])return t(r[1],r[1],0);for(let n=1;n<i.length;n++){let[a,l]=i[n];if(e>a)continue;let[s,c]=i[n-1],f=a-s,u=f===0?0:(e-s)/f;return t(c,l,u)}return o}function pe(i,e){if(!i)return true;let t=i[0];switch(t){case "all":return i.slice(1).every(o=>pe(o,e));case "any":return i.slice(1).some(o=>pe(o,e));case "!":return !pe(i[1],e);case "has":return e[i[1]]!=null;case "!has":return e[i[1]]==null;case "in":{let o=e[i[1]];return o==null?false:i.slice(2).includes(o)}case "!in":{let o=e[i[1]];return o==null?true:!i.slice(2).includes(o)}default:{let o=e[i[1]],r=i[2];if(o==null)return t==="!=";switch(t){case "==":return o===r;case "!=":return o!==r;case ">":return o>r;case ">=":return o>=r;case "<":return o<r;case "<=":return o<=r;default:return true}}}}var Bl=Math.PI/8,Vl=.35,Dl=32,jn=.25,Xn=.5,Yn=.07;function Pe(i,e){let t=e.radius;if(!(t>0))return i;let o=i.length/2-1;if(o<3)return i;let r=Math.max(2,Math.round(e.segments??4)),n=Math.max(e.minCutRatio??Vl,0),a=e.extent,l=e.margin??0,s=[];for(let c=0;c<o;c++){let f=i[c*2],u=i[c*2+1],d=i[(c+o-1)%o*2],h=i[(c+o-1)%o*2+1],m=i[(c+1)%o*2],y=i[(c+1)%o*2+1],p=f-d,b=u-h,g=m-f,v=y-u,x=Math.hypot(p,b),C=Math.hypot(g,v);if(x<1e-6||C<1e-6){s.push(f,u);continue}let S=p/x,M=b/x,w=g/C,_=v/C;if(e.keep?.[c]){s.push(f,u);continue}let T=S*w+M*_;if(T>.985){s.push(f,u);continue}if(a!==void 0&&(rr(f,u,a,l)||rr(d,h,a,l)||rr(m,y,a,l))){s.push(f,u);continue}let L=Math.min(t,x*.4,C*.4);if(L<t*n){s.push(f,u);continue}let k=f-S*L,z=u-M*L,A=f+w*L,I=u+_*L,E=Math.acos(Math.max(-1,Math.min(1,T))),F=Math.min(Bl,Math.PI/2/r),P=Math.ceil(E/F-1e-6),R=e.maxChord&&e.maxChord>0?Math.ceil(L/Math.tan(E/2)*E/e.maxChord):0,W=Math.max(1,Math.min(Dl,Math.max(Math.min(r,P),R)));s.push(k,z);for(let G=1;G<W;G++){let O=G/W,H=1-O;s.push(H*H*k+2*H*O*f+O*O*A,H*H*z+2*H*O*u+O*O*I);}s.push(A,I);}return s.length<6?i:(s.push(s[0],s[1]),s)}var rr=(i,e,t,o)=>i<=-o||e<=-o||i>=t+o||e>=t+o;var Be=i=>i/64;function nt(i,e,t=0){let o=Kn(i.outer,e,t);if(!o)return null;let r=[];for(let n of i.holes){let a=Kn(n,e,t);a&&r.push(a);}return {outer:o,holes:r}}function Kn(i,e,t){let o=[];for(let r=0;r<i.length-2;r+=2)o.push(i[r],i[r+1]);if(o.length<6)return null;for(let r=0;r<4;r++){let n=o;o=[];let a=n.length/2;if(a===0)return null;for(let l=0;l<a;l++){let s=n[l*2],c=n[l*2+1],f=n[(l+a-1)%a*2],u=n[(l+a-1)%a*2+1],d=$n(s,c,r,e,t),h=$n(f,u,r,e,t);if(d!==h){let m=Gl(f,u,s,c,r,e,t);o.push(f+(s-f)*m,u+(c-u)*m);}d&&o.push(s,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function $n(i,e,t,o,r){return t===0?i>=-r:t===1?i<=o+r:t===2?e>=-r:e<=o+r}function Gl(i,e,t,o,r,n,a){return r===0?(-a-i)/(t-i):r===1?(n+a-i)/(t-i):r===2?(-a-e)/(o-e):(n+a-e)/(o-e)}function vo(i,e,t,o,r,n=0){let a=-n,l=r+n;return i===a&&t===a||i===l&&t===l||e===a&&o===a||e===l&&o===l}function qn(i,e){for(let t=0;t<i.length;t+=2)if(i[t]<=0||i[t]>=e||i[t+1]<=0||i[t+1]>=e)return true;return false}var Me=18,st=32,lt=8,oi=65535/st,Nl=9,Ul=1,jl=0,Xl=1,Yl=2;var Zn=0,Kl=1,Qn=2,$l=3,ql=.47;function ar(i,e,t,o={}){let r=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:ql,n=Math.max(1024,i.length*48),a=new ArrayBuffer(n*Me),l={verts:new DataView(a),vertsU8:new Uint8Array(a),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};l.ensure=d=>s(d);let s=d=>{if(l.vertexCount+d<=n)return;n=Math.max(n*2,l.vertexCount+d);let h=new ArrayBuffer(n*Me);new Uint8Array(h).set(l.vertsU8.subarray(0,l.vertOffset)),a=h,l.verts=new DataView(h),l.vertsU8=new Uint8Array(h);};for(let d of i.features()){if(d.type!==3||!pe(t,d.properties))continue;let h=ys(d.properties),m=gs(d.properties,h);if(h<=m)continue;let y=ws(d.properties)??Number(d.id??0),p=bs(y>>>0),b=ps(p,d.properties),g=ms(d.properties,h),v=Qe(d.loadGeometry());for(let x of v){let C=nt(x,e);if(!C)continue;let S=qn(C.outer,e),M=(o.cornerRadius??0)/r,w={radius:M,segments:o.cornerSegments,extent:e,minCutRatio:0,maxChord:r>0?Xn/r:0},_=M>0?{outer:Pe(C.outer,w),holes:C.holes.map(I=>Pe(I,w))}:C,T=_.outer.length/2+_.holes.reduce((I,E)=>I+E.length/2,0);s(T*5+32);let L=_.holes.length||S?null:es(_.outer),k=L?as(d.properties,L,h,p,r):null,z=null,A=[];if(k&&L){let I=ri(cs(_.outer,r),L,k.shape);A=fs(I,_.outer);let E=us(I,A);if(E>1e-6){let F=Math.min(Math.max(E*r*rs,is),ns);z=ds(I,F/E,h);}}ei(l,_.outer,m,h,y,b,g,r,e,z);for(let I of _.holes)ei(l,I,m,h,y,b,g,r,e,null);z?hs(l,A,z,h,y,b,g,r):Jl(l,_.outer,_.holes,h,y,b,g);}}if(!l.indices.length)return null;let c=new Uint32Array(l.indices),f=new Float64Array(l.featureIds);return {vertices:a.slice(0,l.vertOffset),indices:c.buffer,featureIds:f.buffer,vertexCount:l.vertexCount,indexCount:c.length,extent:e}}var lr=(i,e)=>i|e<<2,Jn=i=>Math.max(-32768,Math.min(32767,i)),nr=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,oi)*st)));function it(i,e,t,o,r,n,a,l,s,c,f=0,u=0,d=0){let h=i.vertOffset;return i.verts.setInt16(h,Jn(Math.round(e*lt)),true),i.verts.setInt16(h+2,Jn(Math.round(t*lt)),true),i.verts.setUint16(h+4,Math.round(Math.min(o,oi)*st),true),i.vertsU8[h+6]=s,i.vertsU8[h+7]=l,i.verts.setInt8(h+8,ir(Math.round(r*127))),i.verts.setInt8(h+9,ir(Math.round(n*127))),i.verts.setInt8(h+10,ir(Math.round(a*127))),i.vertsU8[h+11]=c,i.verts.setUint16(h+12,nr(f),true),i.verts.setUint16(h+14,nr(u),true),i.verts.setUint16(h+16,nr(d),true),i.vertOffset+=Me,i.vertexCount++}function ei(i,e,t,o,r,n,a,l,s,c=null){let f=e.length/2;if(f<3)return;let u=lr(jl,a),d=Ql(e,l),h=o-t,m=new Float64Array(f*2),y=new Uint8Array(f);{let p=new Float64Array(f*2);for(let b=0;b<f-1;b++){let g=e[b*2+2]-e[b*2],v=e[b*2+3]-e[b*2+1],x=Math.hypot(g,v)||1;p[b*2]=v/x,p[b*2+1]=-g/x;}for(let b=0;b<f-1;b++){let g=(b+f-2)%(f-1),v=p[g*2]*p[b*2]+p[g*2+1]*p[b*2+1],x=p[g*2]+p[b*2],C=p[g*2+1]+p[b*2+1],S=Math.hypot(x,C);v>.5&&S>1e-6&&(m[b*2]=x/S,m[b*2+1]=C/S,y[b]=1);}}for(let p=0;p<f-1;p++){let b=e[p*2],g=e[p*2+1],v=e[p*2+2],x=e[p*2+3];if(b===v&&g===x||vo(b,g,v,x,s))continue;let C=v-b,S=x-g,M=Math.hypot(C,S)||1,w=S/M,_=-C/M,T=d.offset[p],L=d.width[p],k=[0,1];if(c){for(let A=0;A<c.length;A++)for(let I=A+1;I<c.length;I++){let E=Je(c[A],b,g)-Je(c[I],b,g),F=Je(c[A],v,x)-Je(c[I],v,x);if(E===F)continue;let P=E/(E-F);P>1e-4&&P<1-1e-4&&k.push(P);}k.sort((A,I)=>A-I);}let z=(A,I)=>{if(!c)return o;let E=1/0;for(let F of c)E=Math.min(E,Je(F,A,I));return Math.max(o,E)};for(let A=0;A+1<k.length;A++){let I=k[A],E=k[A+1];if(E-I<1e-6)continue;let F=b+C*I,P=g+S*I,R=b+C*E,W=g+S*E,G=T+M*I*l,O=T+M*E*l,H=(p+1)%(f-1),D=y[p]?m[p*2]:w,Y=y[p]?m[p*2+1]:_,$=y[H]?m[H*2]:w,Q=y[H]?m[H*2+1]:_,de=w+(D-w)*(1-I),J=_+(Y-_)*(1-I),X=w+($-w)*E,te=_+(Q-_)*E,ie=Math.hypot(de,J)||1,q=Math.hypot(X,te)||1,U=de/ie,j=J/ie,le=X/q,ae=te/q;i.ensure(4);let se=it(i,F,P,t,U,j,0,0,n,u,G,L,h),ne=it(i,R,W,t,le,ae,0,0,n,u,O,L,h),ge=it(i,F,P,z(F,P),U,j,0,255,n,u,G,L,h),Ee=it(i,R,W,z(R,W),le,ae,0,255,n,u,O,L,h);i.indices.push(se,Ee,ne,se,ge,Ee),i.featureIds.push(r,r);}}}var Zl=.9976;function Ql(i,e){let t=i.length/2-1,o=[];for(let s=0;s<t;s++){let c=i[s*2+2]-i[s*2],f=i[s*2+3]-i[s*2+1],u=Math.hypot(c,f);o.push(u>0?{x:c/u,y:f/u,len:u*e}:{x:0,y:0,len:0});}let r=(s,c)=>o[s].len>0&&o[c].len>0&&o[s].x*o[c].x+o[s].y*o[c].y>=Zl,n=0;for(;n<t&&r((n-1+t)%t,n);)n++;n>=t&&(n=0);let a=new Array(t).fill(0),l=new Array(t).fill(0);for(let s=0;s<t;){let c=(n+s)%t,f=[c],u=o[c].len,d=s+1;for(;d<t;){let m=(n+d)%t;if(!r((n+d-1)%t,m))break;f.push(m),u+=o[m].len,d++;}let h=0;for(let m of f)a[m]=h,l[m]=u,h+=o[m].len;s=d;}return {offset:a,width:l}}function Jl(i,e,t,o,r,n,a){let l=[],s=[];for(let d=0;d<e.length;d++)l.push(e[d]);for(let d of t){s.push(l.length/2);for(let h=0;h<d.length;h++)l.push(d[h]);}let c=ti(l,s.length?s:void 0,2);if(!c.length)return;let f=lr(Xl,a),u=i.vertexCount;for(let d=0;d<l.length;d+=2)it(i,l[d],l[d+1],o,0,0,1,255,n,f);for(let d=0;d<c.length;d+=3)i.indices.push(u+c[d],u+c[d+2],u+c[d+1]),i.featureIds.push(r);}function es(i){let e=ts(i);if(e.length<3)return null;let t=Math.abs(os(i));if(t<=0)return null;let o=null,r=1/0;for(let n=0;n<e.length;n++){let a=(n+1)%e.length,l=e[a].x-e[n].x,s=e[a].y-e[n].y,c=Math.hypot(l,s);if(c<1e-6)continue;l/=c,s/=c;let f=1/0,u=-1/0,d=1/0,h=-1/0;for(let x of e){let C=x.x*l+x.y*s,S=-x.x*s+x.y*l;C<f&&(f=C),C>u&&(u=C),S<d&&(d=S),S>h&&(h=S);}let m=u-f,y=h-d,p=m*y;if(p<=0||p>=r)continue;r=p;let b=(f+u)/2,g=(d+h)/2,v=m>=y;o={cx:b*l-g*s,cy:b*s+g*l,ax:v?l:-s,ay:v?s:l,halfLong:(v?m:y)/2,halfShort:(v?y:m)/2,fill:t/p};}return o}function ts(i){let e=[];for(let n=0;n<i.length-2;n+=2)e.push({x:i[n],y:i[n+1]});if(e.length<3)return e;e.sort((n,a)=>n.x===a.x?n.y-a.y:n.x-a.x);let t=(n,a,l)=>(a.x-n.x)*(l.y-n.y)-(a.y-n.y)*(l.x-n.x),o=[];for(let n of e){for(;o.length>=2&&t(o[o.length-2],o[o.length-1],n)<=0;)o.pop();o.push(n);}let r=[];for(let n=e.length-1;n>=0;n--){let a=e[n];for(;r.length>=2&&t(r[r.length-2],r[r.length-1],a)<=0;)r.pop();r.push(a);}return o.pop(),r.pop(),o.concat(r)}function os(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var rs=Math.tan(30*Math.PI/180),ns=3.5,is=.9;function as(i,e,t,o,r){if(e.fill<.86)return null;let n=e.halfShort*2*r,a=e.halfLong*2*r,l=n*a,s=e.halfShort>0?e.halfLong/e.halfShort:99,c=ls(i);if(!c){if(t>15||l>600||n<3)return null;let f=o%1e3/1e3;l<30?c=f<.5?"skillion":"gabled":s<1.25?c=f<.35?"pyramidal":"hipped":c=f<.8?"gabled":"hipped";}return c==="flat"?null:{shape:c}}function ls(i){let e=String(i.roof_shape??i["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var Je=(i,e,t)=>i.a*e+i.b*t+i.c;function ss(i,e,t,o){let r=i.length/2;if(r<3)return [];let n=[],a=l=>[i[l*2],i[l*2+1]];for(let l=0;l<r;l++){let[s,c]=a(l),[f,u]=a((l+r-1)%r),d=e*s+t*c+o,h=e*f+t*u+o;if(d<=0!=h<=0){let m=h/(h-d);n.push(f+(s-f)*m,u+(c-u)*m);}d<=0&&n.push(s,c);}return n}function cs(i,e){let t=.5/Math.max(e,1e-6),o=i.length/2-1;if(o<5)return i;let r=[],n=0;r.push(i[0],i[1]);for(let a=1;a<o;a++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1],u=c-l,d=f-s,h=Math.hypot(u,d),m=h>1e-6;if(m){for(let y=n+1;y<a;y++)if(Math.abs((i[y*2]-l)*d-(i[y*2+1]-s)*u)/h>=t){m=false;break}}m||(r.push(i[(a-1)*2],i[(a-1)*2+1]),n=a-1);}return r.length/2<3?i:(r.push(r[0],r[1]),r)}function ri(i,e,t){let{ax:o,ay:r,halfLong:n}=e;if(t==="skillion"){let s=-r,c=o;return [{a:s,b:c,c:-(s*e.cx+c*e.cy)+e.halfShort}]}let a=[],l=i.length/2-1;for(let s=0;s<l;s++){let c=i[s*2],f=i[s*2+1],u=i[(s+1)%l*2],d=i[(s+1)%l*2+1],h=u-c,m=d-f,y=Math.hypot(h,m);if(y<1e-6||t==="gabled"&&Math.abs((h*o+m*r)/y)<.86)continue;let p=-m/y,b=h/y;a.push({a:p,b,c:-(p*c+b*f)});}return !a.length&&n>0?ri(i,e,"hipped"):a}function fs(i,e){let t=[];for(let r=0;r<e.length-2;r+=2)t.push(e[r],e[r+1]);if(t.length<6)return [];let o=[];for(let r=0;r<i.length;r++){let n=t;for(let a=0;a<i.length&&n.length>=6;a++)a!==r&&(n=ss(n,i[r].a-i[a].a,i[r].b-i[a].b,i[r].c-i[a].c));o.push(n.length>=6?n:[]);}return o}function us(i,e){let t=0;for(let o=0;o<e.length;o++){let r=e[o];for(let n=0;n<r.length;n+=2){let a=Je(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function ds(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function hs(i,e,t,o,r,n,a,l){let s=lr(Yl,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let u=ti(f,void 0,2);if(!u.length)continue;let d=-t[c].a/l,h=-t[c].b/l,m=Math.hypot(d,h,1),y={x:d/m,y:h/m,z:1/m};i.ensure(f.length/2);let p=i.vertexCount;for(let b=0;b<f.length;b+=2){let g=Math.max(o,Je(t[c],f[b],f[b+1]));it(i,f[b],f[b+1],g,y.x,y.y,y.z,255,n,s);}for(let b=0;b<u.length;b+=3)i.indices.push(p+u[b],p+u[b+2],p+u[b+1]),i.featureIds.push(r);}}function ms(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?$l:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?Qn:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?Zn:e>=40?Qn:Kl}function ps(i,e){let t=String(e.class??""),o=128;return t==="industrial"||t==="warehouse"||t==="construction"?o=96:t==="commercial"||t==="office"||t==="retail"?o=150:(t==="apartments"||t==="residential"||t==="house")&&(o=134),Math.max(0,Math.min(255,o+(i%121-60)))}function bs(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function ys(i){let e=at(i.render_height)??at(i.height)??vs(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,Ul):Nl}function gs(i,e){let t=at(i.render_min_height)??at(i.min_height)??at(i.base)??0;return t>0&&t<e?t:0}function vs(i){let e=at(i);return e&&e>0?e*3:null}function at(i){if(typeof i=="number"&&isFinite(i))return i;if(typeof i=="string"){let e=parseFloat(i);if(isFinite(e))return e}return null}var ir=i=>i>127?127:i<-127?-127:i;function ws(i){let e=i.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let t=Number(e);if(Number.isFinite(t))return t}return null}var Ue=4;function sr(i,e,t,o,r){let n=o*o,a=[],l=f=>i[f*2],s=f=>i[f*2+1],c=(f,u)=>{let d=i.length/2;return i.push((l(f)+l(u))/2,(s(f)+s(u))/2),d};for(let f=0;f<e.length;f+=3){a.push([t+e[f],t+e[f+1],t+e[f+2]]);let u=0;for(;a.length&&!(++u>2e4);){let[d,h,m]=a.pop(),y=(l(d)-l(h))**2+(s(d)-s(h))**2,p=(l(h)-l(m))**2+(s(h)-s(m))**2,b=(l(m)-l(d))**2+(s(m)-s(d))**2,g=Math.max(y,p,b);if(g<=n){r.push(d,h,m);continue}if(g===y){let v=c(d,h);a.push([d,v,m],[v,h,m]);}else if(g===p){let v=c(h,m);a.push([h,v,d],[v,m,d]);}else {let v=c(m,d);a.push([m,v,h],[v,d,h]);}}}}function cr(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let h of i.features()){if(h.type!==3||!pe(e,h.properties))continue;let m=h.properties.osm_id,y=typeof m=="number"?m:typeof m=="string"?Number(m):NaN,p=Number.isFinite(y)?y:Number(h.id??0);for(let b of Qe(h.loadGeometry())){let g=r?nt(b,n):b;if(!g)continue;let v=[],x=[],C=o?Pe(g.outer,o):g.outer;for(let w=0;w<C.length;w++)v.push(C[w]);for(let w of g.holes){let _=o?Pe(w,o):w;x.push(v.length/2);for(let T=0;T<_.length;T++)v.push(_[T]);}let S=ti(v,x.length?x:void 0,2);if(!S.length)continue;let M=a.length/2;for(let w=0;w<v.length;w++)a.push(v[w]);if(t>0){let w=[];sr(a,S,M,t,w);for(let _=0;_<w.length;_+=3)l.push(w[_],w[_+2],w[_+1]),s.push(p);continue}for(let w=0;w<S.length;w+=3)l.push(M+S[w],M+S[w+2],M+S[w+1]),s.push(p);}}if(!l.length)return null;let c=a.length/2,f=new Int16Array(a),u=new Uint32Array(l);return {featureIds:new Float64Array(s).buffer,vertices:f.buffer,indices:u.buffer,vertexCount:c,indexCount:u.length}}function ni(i){let e=[];for(let t=0;t+1<i.length;t+=2)e.push([i[t],i[t+1]]);return e}function ii(i){let e=[];for(let o of i)e.push(o[0],o[1]);let t=e.length;return t>=4&&(e[0]!==e[t-2]||e[1]!==e[t-1])&&e.push(e[0],e[1]),e}function li(i,e,t=0){if(i.length<2)return i;let o=new Map;for(let n of i){let a=n.lift??0,l=o.get(a);l?l.push(n):o.set(a,[n]);}let r=[];for(let[n,a]of o){if(a.length<2){r.push(...a);continue}let s=(t>0&&e?a.map(u=>({outer:e(u.outer,-t)??u.outer,holes:u.holes.map(d=>e(d,t)??d)})):a).map(u=>[ni(u.outer),...u.holes.map(ni)]),c;try{c=ai.union(s[0],...s.slice(1));}catch{r.push(...a);continue}let f=c;if(!Array.isArray(f)||f.length===0){r.push(...a);continue}for(let u of f){if(!u.length)continue;let d=ii(u[0]);if(d.length<8)continue;let h=[];for(let m=1;m<u.length;m++){let y=ii(u[m]);y.length>=8&&h.push(y);}r.push(n?{outer:d,holes:h,lift:n}:{outer:d,holes:h});}}return r}var ct=16,hi=64,mi=0,Cs=1,si=2,Ss=3,It=1,Ms=.6;function mr(i,e,t,o){let r=o.metersPerUnit>0?o.metersPerUnit:.5,n=o.elevation,a=o.base??0,l=Math.max(o.bevel??0,0)/r,s=Math.max(o.bevelDrop??0,0),c=Math.max(o.cornerRadius??0,0)/r,f=Math.max(512,i.length*24),u=new ArrayBuffer(f*ct),d={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(w){if(d.count+w<=f)return;f=Math.max(f*2,d.count+w);let _=new ArrayBuffer(f*ct);new Uint8Array(_).set(d.bytes.subarray(0,d.offset)),u=_,d.view=new DataView(_),d.bytes=new Uint8Array(_);}},h=[],m=new Map;for(let w of i.features()){if(w.type!==3||!pe(t,w.properties))continue;let _=o.liftBy?.(w.properties)??0;for(let T of Qe(w.loadGeometry())){let L=nt(T,e,Be(e));L&&h.push(_?{...L,lift:_}:L);}}let y=new Set,p=Math.max(o.weld??Ms,0),b=li(h,(w,_)=>ur(w,_,e,y),p/r),g=p>0?b.map(w=>({...w,outer:di(w.outer,p/r,e),holes:w.holes.map(_=>di(_,p/r,e))})):b;for(let w of g){ci(w.outer,m);for(let _ of w.holes)ci(_,m);}o.onShapes?.(g);let v=new Set;for(let[w,_]of m)_>1&&v.add(w);let x=[],C={radius:c,segments:o.cornerSegments,extent:e,margin:Be(e),minCutRatio:0,maxChord:jn/r};for(let w of g){let _=c>0?{outer:Pe(w.outer,{...C,keep:fi(w.outer,v)}),holes:w.holes.map(F=>Pe(F,{...C,keep:fi(F,v)}))}:w,T=l>0?ur(_.outer,l,e,v):_.outer,L=_.holes.map(F=>l>0?ur(F,-l,e,v):F),k=w.lift??0,z=n+k,A=a+k;ui(d,T??_.outer,L.map((F,P)=>F??_.holes[P]),z,mi,o.maxSegment??0);let I=z,E=z-s;T&&l>0&&s>0&&fr(d,T,_.outer,I,E,Cs,e,v),E!==A&&fr(d,_.outer,_.outer,E,A,si,e,v);for(let F of _.holes)if(E!==A&&fr(d,F,F,E,A,si,e,v),z<A){let P=d.indices.length;ui(d,F,[],A,Ss);for(let R=P;R<d.indices.length;R++)x.push(d.indices[R]);d.indices.length=P;}}if(!d.indices.length&&!x.length)return null;let S=d.indices.length,M=new Uint32Array(S+x.length);return M.set(d.indices,0),M.set(x,S),{vertices:u.slice(0,d.offset),indices:M.buffer,vertexCount:d.count,indexCount:M.length,extent:e,capIndexOffset:S}}function ft(i,e,t,o){let r=`${Math.round(i*100)},${Math.round(e*100)}`,n=`${Math.round(t*100)},${Math.round(o*100)}`;return r<n?`${r}|${n}`:`${n}|${r}`}function ci(i,e){for(let t=0;t+3<i.length;t+=2){let o=ft(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function fi(i,e){if(!e.size)return;let t=i.length/2-1,o=new Array(t).fill(false);for(let r=0;r<t;r++){let n=ft(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=ft(i[r*2],i[r*2+1],i[(r+1)%t*2],i[(r+1)%t*2+1]);(e.has(n)||e.has(a))&&(o[r]=true);}return o}function Ft(i,e,t,o,r,n,a,l){let s=i.offset;return i.view.setFloat32(s,e,true),i.view.setFloat32(s+4,t,true),i.view.setInt16(s+8,Ts(Math.round(o*hi)),true),i.view.setInt8(s+10,hr(Math.round(r*127))),i.view.setInt8(s+11,hr(Math.round(n*127))),i.view.setInt8(s+12,hr(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-It:e>=i.extent?It:0),i.view.setInt8(s+15,t<=0?-It:t>=i.extent?It:0),i.offset+=ct,i.count++}function ui(i,e,t,o,r=mi,n=0){let a=[],l=[];for(let u=0;u<e.length;u++)a.push(e[u]);for(let u of t){l.push(a.length/2);for(let d=0;d<u.length;d++)a.push(u[d]);}let s=ti(a,l.length?l:void 0,2);if(!s.length)return;let c=s;if(n>0){let u=[];sr(a,s,0,n,u),c=u;}i.ensure(a.length/2);let f=i.count;for(let u=0;u<a.length;u+=2)Ft(i,a[u],a[u+1],o,0,0,1,r);for(let u=0;u<c.length;u+=3)i.indices.push(f+c[u],f+c[u+2],f+c[u+1]);}function fr(i,e,t,o,r,n,a,l){let s=Math.min(e.length,t.length)/2;if(!(s<3)){i.ensure((s-1)*4);for(let c=0;c<s-1;c++){let f=t[c*2],u=t[c*2+1],d=t[c*2+2],h=t[c*2+3];if(f===d&&u===h||vo(f,u,d,h,a,Be(a))||l.has(ft(f,u,d,h)))continue;let m=d-f,y=h-u,p=Math.hypot(m,y)||1,b=y/p,g=-m/p,v=o-r,x=Math.hypot(e[c*2]-f,e[c*2+1]-u)||0,C=0;if(x>1e-6&&v!==0){let T=1/Math.hypot(1,v/x);C=x/Math.hypot(x,v)*Math.sign(v),b*=T,g*=T;}let S=Ft(i,e[c*2],e[c*2+1],o,b,g,C,n),M=Ft(i,e[c*2+2],e[c*2+3],o,b,g,C,n),w=Ft(i,f,u,r,b,g,C,n),_=Ft(i,d,h,r,b,g,C,n);i.indices.push(w,M,_,w,S,M);}}}function ur(i,e,t,o){let r=i.length/2-1;if(r<3)return null;let n=[];for(let f=0;f<r;f++){let u=i[f*2],d=i[f*2+1],h=i[(f+r-1)%r*2],m=i[(f+r-1)%r*2+1],y=i[(f+1)%r*2],p=i[(f+1)%r*2+1],b=Math.hypot(u-h,d-m)||1,g=Math.hypot(y-u,p-d)||1,v=(d-m)/b,x=-(u-h)/b,C=(p-d)/g,S=-(y-u)/g,M=v+C,w=x+S,_=Math.hypot(M,w);if(_<1e-6){n.push(u,d);continue}M/=_,w/=_;let T=Math.min(1/Math.max(M*v+w*x,.35),3),L=u-M*e*T,k=d-w*e*T,z=ft(h,m,u,d),A=ft(u,d,y,p);if(o.has(z)||o.has(A)){n.push(u,d);continue}let I=-Be(t),E=t+Be(t),F=(P,R)=>P<=I||P>=E||R<=I||R>=E;(F(u,d)||F(h,m)||F(y,p))&&(L=u,k=d),n.push(L,k);}n.push(n[0],n[1]);let a=Math.abs(dr(i)),l=dr(n);if(Math.sign(l)!==Math.sign(dr(i))||Math.abs(l)<a*.25)return null;let s=-Be(t),c=t+Be(t);for(let f=0;f<n.length;f+=2)n[f]=Math.max(s,Math.min(c,n[f])),n[f+1]=Math.max(s,Math.min(c,n[f+1]));return n}function dr(i){let e=0;for(let t=0;t<i.length-2;t+=2)e+=i[t]*i[t+3]-i[t+2]*i[t+1];return e/2}var hr=i=>i>127?127:i<-127?-127:i,Ts=i=>i>32767?32767:i<-32768?-32768:i;function di(i,e,t){if(!(e>0))return i;let o=Be(t),r=-o,n=t+o,a=i;for(let l=0;l<3;l++){let s=a.length/2-1;if(s<6)break;let c=new Array(s).fill(true),f=s;for(let d=0;d<s&&!(f<=5);d++){let h=a[d*2],m=a[d*2+1];if(h<=r||h>=n||m<=r||m>=n)continue;let y=(d+s-1)%s;for(;!c[y]&&y!==d;)y=(y+s-1)%s;let p=(d+1)%s;for(;!c[p]&&p!==d;)p=(p+1)%s;if(y===d||p===d)break;let b=a[y*2],g=a[y*2+1],v=a[p*2]-b,x=a[p*2+1]-g,C=Math.hypot(v,x);C<1e-6||Math.abs((h-b)*x-(m-g)*v)/C<e&&(c[d]=false,f--);}if(f===s)break;let u=[];for(let d=0;d<s;d++)c[d]&&u.push(a[d*2],a[d*2+1]);u.push(u[0],u[1]),a=u;}return a}var Es=100;function pr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function br(i,e,t,o){if(!(t<=0)){i.extent=o;for(let r of e){let n=r.outer;if(n.length<6)continue;let a=1/0,l=1/0,s=-1/0,c=-1/0;for(let f=0;f<n.length;f+=2)n[f]<a&&(a=n[f]),n[f]>s&&(s=n[f]),n[f+1]<l&&(l=n[f+1]),n[f+1]>c&&(c=n[f+1]);i.shapes.push({outer:n,holes:r.holes,level:t,minX:a,minY:l,maxX:s,maxY:c});}i.cells=[];}}function ks(i){i.cells=Array.from({length:1024},()=>[]);let e=i.extent/32;for(let t=0;t<i.shapes.length;t++){let o=i.shapes[t],r=ut(Math.floor(o.minX/e)),n=ut(Math.floor(o.maxX/e)),a=ut(Math.floor(o.minY/e)),l=ut(Math.floor(o.maxY/e));for(let s=a;s<=l;s++)for(let c=r;c<=n;c++)i.cells[s*32+c].push(t);}}var bi=i=>i.shapes.length===0;function wo(i,e,t){!i.cells.length&&i.shapes.length&&ks(i);let o=i.extent/32,r=i.cells[ut(Math.floor(t/o))*32+ut(Math.floor(e/o))];if(!r||!r.length)return 0;let n=0;for(let a of r){let l=i.shapes[a];if(l.level<=n||e<l.minX||e>l.maxX||t<l.minY||t>l.maxY||!pi(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(pi(c,e,t)){s=true;break}s||(n=l.level);}return Math.min(Math.round(n*100),127)}function yr(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=wo(i,e[0],e[1]);t.push(e[0],e[1]),o.push(a);for(let l=0;l+3<e.length;l+=2){let s=e[l],c=e[l+1],f=e[l+2],u=e[l+3],d=wo(i,f,u);if(d!==a&&n>0){let h=Math.hypot(f-s,u-c),m=Math.min(Math.ceil(h/n),64),y=a;for(let p=1;p<m;p++){let b=p/m,g=s+(f-s)*b,v=c+(u-c)*b,x=wo(i,g,v);x!==y&&(t.push(g,v),o.push(x),y=x);}}t.push(f,u),o.push(d),a=d;}return {pts:t,levels:o}}var ut=i=>i<0?0:i>31?31:i;function pi(i,e,t){let o=false,r=i.length/2;for(let n=0,a=r-1;n<r;a=n++){let l=i[n*2],s=i[n*2+1],c=i[a*2],f=i[a*2+1];s>t!=f>t&&e<(c-l)*(t-s)/(f-s)+l&&(o=!o);}return o}var As=5;function et(i){let e=i.layer,t=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;if(Number.isFinite(t)&&t!==0)return Math.max(-5,Math.min(5,Math.trunc(t)));let o=i.brunnel;return o==="bridge"?1:o==="tunnel"?-1:0}var je=20;function gr(i,e,t=0,o,r=0,n={}){let{level:a}=n,l=Math.max(256,i.length*24),s=new ArrayBuffer(l*je),c=new DataView(s),f=0,u=[],d=g=>{if(f+g<=l)return;l=Math.max(l*2,f+g);let v=new ArrayBuffer(l*je);new Uint8Array(v).set(new Uint8Array(s,0,f*je)),s=v,c=new DataView(v);},h=(g,v,x,C,S,M,w,_=0,T=0,L=0)=>{let k=f*je;return c.setInt16(k,g,true),c.setInt16(k+2,v,true),c.setInt16(k+4,x,true),c.setInt16(k+6,C,true),c.setInt8(k+8,S),c.setInt8(k+9,M),c.setInt8(k+10,_),c.setInt8(k+11,T),c.setFloat32(k+12,w,true),c.setFloat32(k+16,L,true),f++},m=0,y=r>0?12/r:0,p=y>0?zs(i):null;for(let g of i.features()){if(g.type!==2&&g.type!==3||!pe(e,g.properties)||a!==void 0&&et(g.properties)!==a)continue;let v=g.properties.width;m=typeof v=="number"&&v>.5&&v<100?v:0;let x=g.type===3;for(let C of g.loadGeometry()){let S=t>0?Is(yi(C),t):yi(C);if(S.length<4)continue;let M=o&&!bi(o)?yr(o,S):null,w=M?M.pts:S,_=M?.levels,T=w.length/2;if(T<2)continue;let L=et(g.properties),k=xo(Math.round(w[0]),Math.round(w[1])),z=xo(Math.round(w[T*2-2]),Math.round(w[T*2-1])),A=null,I=m;if(p&&m>0&&!x){let F=0;for(let O=0;O<T-1;O++)F+=Math.hypot(w[O*2+2]-w[O*2],w[O*2+3]-w[O*2+1]);I=vi(L,m,k,z,p);let P=O=>Math.min(p.width.get(O)??0,I*2),R=P(k)-I,W=P(z)-I,G=Math.min(y,F/2);if(G>0&&(R>0||W>0)){A=H=>{let D=0;return R>0&&H<G&&(D=R*(1-H/G)),W>0&&F-H<G&&(D=Math.max(D,W*(1-(F-H)/G))),I+D};let O=[];for(let H of [G,F-G])H>.01&&H<F-.01&&O.push(H);if(O.length){let H=Ls(w,_,O);w=H.pts,_=H.levels,T=w.length/2;}}}d((T-1)*4);let E=0;for(let F=0;F<T-1;F++){let P=w[F*2],R=w[F*2+1],W=w[F*2+2],G=w[F*2+3],O=Math.hypot(W-P,G-R);if(x&&Rs(P,R,W,G,i.extent)){E+=O;continue}let H=Fs(P,R,W,G,i.extent);if(!H){E+=O;continue}let[D,Y,$,Q]=H,de=Math.hypot(D-P,Y-R),J=Math.hypot($-D,Q-Y),X=Math.hypot(W-$,G-Q),te=E+de,ie=_?_[F]:0,q=_?_[F+1]:0,U=A?A(te):I,j=A?A(te+J):I,le=h(D,Y,$,Q,0,-1,te,ie,q,U),ae=h(D,Y,$,Q,0,1,te,ie,q,U),se=h(D,Y,$,Q,1,1,te,ie,q,j),ne=h(D,Y,$,Q,1,-1,te,ie,q,j);E+=de+J+X,u.push(le,ae,se,le,se,ne);}}}if(!u.length)return null;let b=new Uint32Array(u);return {vertices:s.slice(0,f*je),indices:b.buffer,vertexCount:f,indexCount:b.length}}function Ls(i,e,t){let o=[...t].sort((s,c)=>s-c),r=[i[0],i[1]],n=e?[e[0]]:void 0,a=0,l=0;for(let s=0;s+3<i.length;s+=2){let c=i[s],f=i[s+1],u=i[s+2],d=i[s+3],h=Math.hypot(u-c,d-f);for(;l<o.length&&o[l]<=a+.01;)l++;for(;l<o.length&&o[l]<a+h-.01;){let m=(o[l]-a)/h;r.push(c+(u-c)*m,f+(d-f)*m),n&&e&&n.push(Math.round(e[s/2]+(e[s/2+1]-e[s/2])*m)),l++;}a+=h,r.push(u,d),n&&e&&n.push(e[s/2+1]);}return {pts:r,levels:n}}function Is(i,e){let t=[];for(let o=0;o+3<i.length;o+=2){let r=i[o],n=i[o+1],a=i[o+2],l=i[o+3];t.push(r,n);let s=Math.min(64,Math.floor(Math.hypot(a-r,l-n)/e));for(let c=1;c<s;c++){let f=c/s;t.push(r+(a-r)*f,n+(l-n)*f);}}return t.push(i[i.length-2],i[i.length-1]),t}function yi(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}function Fs(i,e,t,o,r){let n=t-i,a=o-e,l=0,s=1,c=[[-n,i],[n,r-i],[-a,e],[a,r-e]];for(let[f,u]of c){if(f===0){if(u<0)return null;continue}let d=u/f;if(f<0){if(d>s)return null;d>l&&(l=d);}else {if(d<l)return null;d<s&&(s=d);}}return s-l<1e-6?null:[Math.round(i+n*l),Math.round(e+a*l),Math.round(i+n*s),Math.round(e+a*s)]}function Rs(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var gi=new WeakMap,xo=(i,e)=>(i+512)*65536+(e+512);function vi(i,e,t,o,r){if(i===0||e<=0)return e;let n=8*4294967296,a=Math.max(r.raw.get(t+n)??0,r.raw.get(o+n)??0);return a>0&&e>a?a:e}function zs(i){let e=gi.get(i);if(e)return e;let t={width:new Map,ends:new Map,raw:new Map},o=[];for(let r of i.features()){if(r.type!==2)continue;let n=r.properties.width,a=typeof n=="number"&&n>.5&&n<100?n:0,l=et(r.properties);for(let s of r.loadGeometry()){if(s.length<4)continue;let c=xo(Math.round(s[0]),Math.round(s[1])),f=xo(Math.round(s[s.length-2]),Math.round(s[s.length-1]));for(let u of [c,f]){let d=u+(l+8)*4294967296;t.ends.set(d,(t.ends.get(d)??0)+1),a>0&&t.raw.set(d,Math.max(t.raw.get(d)??0,a));}o.push({h:c,t:f,lv:l,w:a});}}for(let r of o){let n=vi(r.lv,r.w,r.h,r.t,t);if(!(n<=0))for(let a of [r.h,r.t]){let l=t.width.get(a);(l===void 0||n>l)&&t.width.set(a,n);}}return gi.set(i,t),t}var vr={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},wr={ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#fff4e2",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6f2",fillIntensity:.18};var wi={version:1,name:"OSM 3D \u2014 \u0434\u043D\u0435\u0432\u043D\u043E\u0439",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16}},{id:"landcover-grass",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11}},{id:"landcover-sand",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26}},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9}},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10}},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12}},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"}},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15}},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"fill",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1}},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1}},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var xi={version:1,name:"\u041C\u044F\u0433\u043A\u0430\u044F \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044F",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16},cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11},cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26},cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9},cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}},cornerRadius:4,cornerSegments:3},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"},cornerRadius:4,cornerSegments:3},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"},cornerRadius:4,cornerSegments:3},{id:"landuse-sport",type:"fill","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10},cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"fill","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12},cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"},cornerRadius:3,cornerSegments:3},{id:"park",type:"fill","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15},cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"},cornerRadius:5,cornerSegments:3},{id:"water",type:"fill",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1},cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"fill","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1},cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]}}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat"}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat"}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"fill",source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var _i={version:1,name:"\u0420\u0435\u043B\u044C\u0435\u0444",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"foliage",materialScale:16,sideShade:.16},elevation:.7,bevel:.5,bevelDrop:.15,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"foliage",materialScale:11,sideShade:.16},elevation:.5,bevel:.45,bevelDrop:.12,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"sand",materialScale:26,sideShade:.16},elevation:.12,bevel:.6,bevelDrop:.08,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"foliage",materialScale:9,sideShade:.16},elevation:.15,bevel:.5,bevelDrop:.08,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"fill","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]}}},{id:"landuse-industrial",type:"fill","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd"}},{id:"landuse-civic",type:"fill","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8"}},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"foliage",materialScale:10,sideShade:.16},elevation:.35,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"foliage",materialScale:12,sideShade:.16},elevation:.3,bevel:.4,bevelDrop:.1,cornerRadius:5,cornerSegments:4},{id:"landuse-parking",type:"fill","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5"}},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"foliage",materialScale:15,sideShade:.16},elevation:.6,bevel:.5,bevelDrop:.15,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"fill","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6"}},{id:"water",type:"surface",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.35,bevel:.8,bevelDrop:.12,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.2,bevel:.4,bevelDrop:.08,cornerRadius:4,cornerSegments:4},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.3}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"asphalt",materialScale:4,elevation:.08}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.1,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.15,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.13,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.11,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.12}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"asphalt",materialScale:2,elevation:.05}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"asphalt",materialScale:3,elevation:.14,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"asphalt",materialScale:3,elevation:.16,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"asphalt",materialScale:3,elevation:.18,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.182}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.162}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9,sideShade:.16},elevation:.09,bevel:.05,bevelDrop:.02,groundBy:{"landcover:wood":.7,"landcover:forest":.7,"landcover:grass":.5,"landcover:farmland":.5,"landcover:meadow":.5,"landcover:sand":.12,"landcover:beach":.12,"landcover:wetland":.15,"landcover:swamp":.15,"landuse:pitch":.35,"landuse:stadium":.35,"landuse:playground":.35,"landuse:track":.35,"landuse:swimming_pool":.35,"landuse:cemetery":.3,"landuse:grave_yard":.3,"park:park":.6}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Ci={version:1,name:"\u041E\u0431\u044A\u0451\u043C\u043D\u044B\u0439 \u0433\u043E\u0440\u043E\u0434",background:"#dbd8d4",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},layers:[{id:"world-landcover-wood",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","wood","forest"],paint:{color:{from:"landcover-wood"}}},{id:"world-landcover-grass",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","grass","farmland","meadow"],paint:{color:{from:"landcover-grass"}}},{id:"world-landcover-sand",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","sand","beach"],paint:{color:{from:"landcover-sand"}}},{id:"world-landcover-ice",type:"fill",source:"world","source-layer":"landcover",maxzoom:7,filter:["in","class","ice","glacier"],paint:{color:{from:"landcover-ice"}}},{id:"world-water",type:"fill",source:"world","source-layer":"water",maxzoom:7,paint:{color:{from:"water"}}},{id:"world-boundary",type:"line",source:"world","source-layer":"boundary",maxzoom:7,paint:{color:{from:"boundary"},opacity:.7,width:{stops:[[0,.5],[6,1.1]]}}},{id:"landcover-wood",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wood","forest"],paint:{color:"#c6dcb4",opacity:{stops:[[8,.5],[12,.85]]},material:"flat",sideShade:.16},elevation:.175,bevel:.125,bevelDrop:.038,cornerRadius:10,cornerSegments:4},{id:"landcover-grass",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","grass","farmland","meadow"],paint:{color:"#d9e6c6",opacity:{stops:[[8,.45],[12,.8]]},material:"flat",sideShade:.16},elevation:.125,bevel:.113,bevelDrop:.03,cornerRadius:8,cornerSegments:4},{id:"landcover-sand",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","sand","beach"],paint:{color:"#f2e7c8",material:"flat",sideShade:.16},elevation:.035,bevel:.15,bevelDrop:.02,cornerRadius:10,cornerSegments:4},{id:"landcover-ice",type:"fill",minzoom:7,"source-layer":"landcover",filter:["in","class","ice","glacier"],paint:{color:"#e6f2f7"}},{id:"landcover-wetland",type:"surface",minzoom:7,"source-layer":"landcover",filter:["in","class","wetland","swamp"],paint:{color:"#cfe0d4",material:"flat",sideShade:.16},elevation:.045,bevel:.125,bevelDrop:.02,cornerRadius:8,cornerSegments:4},{id:"landuse-residential",type:"surface","source-layer":"landuse",filter:["in","class","residential","suburb","neighbourhood","quarter"],paint:{color:"#d3d0cb",opacity:{stops:[[10,.4],[14,.7]]},material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.02,bevel:.1,bevelDrop:.02},{id:"landuse-industrial",type:"surface","source-layer":"landuse",filter:["in","class","industrial","quarry","railway","substation"],paint:{color:"#e7e0dd",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.03,bevel:.1,bevelDrop:.02},{id:"landuse-civic",type:"surface","source-layer":"landuse",filter:["in","class","school","university","college","hospital","clinic","police","kindergarten","bus_station"],paint:{color:"#ece3d8",material:"flat",sideShade:.16},cornerRadius:4,cornerSegments:3,elevation:.055,bevel:.1,bevelDrop:.02},{id:"landuse-sport",type:"surface","source-layer":"landuse",filter:["in","class","pitch","stadium","playground","track","swimming_pool"],paint:{color:"#cfe3c4",material:"flat",sideShade:.16},elevation:.088,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-cemetery",type:"surface","source-layer":"landuse",filter:["in","class","cemetery","grave_yard"],paint:{color:"#d6dfc8",material:"flat",sideShade:.16},elevation:.075,bevel:.1,bevelDrop:.025,cornerRadius:5,cornerSegments:3},{id:"landuse-parking",type:"surface","source-layer":"landuse",filter:["in","class","parking","fuel"],paint:{color:"#dddad5",material:"flat",sideShade:.16},cornerRadius:3,cornerSegments:3,elevation:.19,bevel:.1,bevelDrop:.02},{id:"park",type:"surface","source-layer":"park",paint:{color:"#cfe5bd",opacity:.75,material:"flat",sideShade:.16},elevation:.15,bevel:.125,bevelDrop:.038,cornerRadius:9,cornerSegments:4},{id:"aeroway-area",type:"surface","source-layer":"aeroway",filter:["in","class","aerodrome","apron","helipad"],paint:{color:"#e4e2e6",material:"flat",sideShade:.16},cornerRadius:5,cornerSegments:3,elevation:.065,bevel:.1,bevelDrop:.02},{id:"water",type:"surface",minzoom:7,"source-layer":"water",filter:["!in","class","swimming_pool"],paint:{color:"#a5cbe3",material:"water",materialScale:14,materialSpeed:1,sideShade:0},elevation:-0.087,bevel:.2,bevelDrop:.03,cornerRadius:7,cornerSegments:4},{id:"water-pool",type:"surface","source-layer":"water",filter:["==","class","swimming_pool"],paint:{color:"#9fd3e8",material:"water",materialScale:8,materialSpeed:1,sideShade:0},elevation:-0.05,bevel:.1,bevelDrop:.02,cornerRadius:4,cornerSegments:3},{id:"waterway",type:"line","source-layer":"waterway",paint:{color:"#a5cbe3",width:{stops:[[8,.6],[12,1.4],[16,4],[19,11.5],[20,23],[21,46],[22,92]]},material:"water",materialScale:10,materialSpeed:1,elevation:-0.075}},{id:"aeroway-line",type:"line","source-layer":"aeroway",filter:["in","class","runway","taxiway"],paint:{color:"#d8d5da",width:{stops:[[10,1],[14,5],[18,24],[19,24],[20,48],[21,96],[22,192]]},material:"flat",elevation:.02}},{id:"road-bridge-outline",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service","track"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},widthFromData:true,widthExtra:5.5}},{id:"road-bridge-outline-thin",type:"line",network:"roads","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","path","pedestrian","footway","steps","rail","transit"]],minzoom:14,paint:{elevation:.025,color:{from:"road-casing-major",darken:.2},width:{stops:[[14,2.5],[17,5],[19,9],[20,15],[21,28]]}}},{id:"road-casing-major",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","motorway","trunk","primary"],minzoom:5,paint:{color:"#d4ab68",width:{stops:[[6,1.6],[10,3.4],[14,8],[16,14],[18,30],[19,45],[20,90],[21,180],[22,360]]},elevation:.037,widthFromData:true,widthExtra:2.5}},{id:"road-casing-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#c6bca6"],[18.5,"#d4ab68"]]},width:{stops:[[10,1.6],[14,5.5],[16,10],[18,22],[19,33],[20,66],[21,132],[22,264]]},elevation:.033,widthFromData:true,widthExtra:2}},{id:"road-casing-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#cdc4b2"],[18.5,"#d4ab68"]]},width:{stops:[[13,1.4],[16,6],[18,14],[19,22],[20,44],[21,88],[22,176]]},elevation:.028,widthFromData:true,widthExtra:1.5}},{id:"road-rail",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","rail","transit"],minzoom:10,paint:{color:"#b2a99e",width:{stops:[[10,.8],[14,1.8],[18,4],[19,5.5],[20,11],[21,22],[22,44]]},elevation:.03}},{id:"road-path",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","path","pedestrian","footway","steps"],minzoom:14,paint:{color:"#bdb2a0",width:{stops:[[14,.8],[17,2],[19,4],[20,8],[21,16],[22,32]]},dashArray:[4,3],material:"flat",elevation:.013}},{id:"road-minor",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","minor","service","track"],minzoom:12,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[13,.6],[16,4],[18,11],[19,18],[20,36],[21,72],[22,144]]},material:"flat",elevation:.035,widthFromData:true}},{id:"road-ramp",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["in","class","secondary","tertiary"],minzoom:9,paint:{color:{stops:[[16,"#ffffff"],[18.5,"#ffdfa3"]]},width:{stops:[[10,.8],[14,3.6],[16,7.5],[18,18],[19,28],[20,56],[21,112],[22,224]]},material:"flat",elevation:.04,widthFromData:true}},{id:"road-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["in","class","motorway","trunk","primary"],["!has","ramp"]],minzoom:5,paint:{color:"#ffdfa3",width:{stops:[[6,.8],[10,2.2],[14,6],[16,11],[18,25],[19,38.5],[20,77],[21,154],[22,308]]},material:"flat",elevation:.045,widthFromData:true}},{id:"road-lane-divider-major",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","motorway","trunk","primary"]],minzoom:16.5,paint:{color:"#e3bd7f",width:{stops:[[16.5,.54],[17,.78],[18,1.4],[19,2.17],[20,4.34],[21,8.68],[22,17.36]]},dashArray:[7,18],material:"flat",elevation:.047}},{id:"road-lane-divider-secondary",network:"roads",type:"line","source-layer":"transportation",filter:["all",["!has","oneway"],["in","class","secondary","tertiary"]],minzoom:16.5,paint:{color:"#d8cfbc",width:{stops:[[16.5,.46],[17,.67],[18,1.2],[19,1.86],[20,3.72],[21,7.44],[22,14.88]]},dashArray:[7,18],material:"flat",elevation:.042}},{id:"boundary",type:"line",minzoom:7,"source-layer":"boundary",filter:["<=","admin_level",4],paint:{color:"#b3a6b8",opacity:.7,width:{stops:[[4,.7],[10,1.4],[16,2.4]]},dashArray:[6,4]}},{id:"building",type:"fill-extrusion","source-layer":"building",minzoom:15,paint:{color:"#ffffff",roofColor:"#f2f1f0",opacity:1,heightScale:{stops:[[15,0],[15.8,1]]},aoStrength:.18,tintVariation:0,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35},cornerRadius:1.6,cornerSegments:2},{id:"indoor-venue",type:"fill-extrusion",source:"indoor","source-layer":"area",filter:["all",["==","class","level"],["==","base",1]],minzoom:15,maxzoom:16,paint:{color:"#d8d3c8",roofColor:"#d9d3c7",opacity:1,aoStrength:.18,tintVariation:.06,windowColor:"#7f9ab5",windowFrameColor:"#e9e5dc",windowGlow:0,facadeDetail:1,floorHeight:3.2,roofVariation:.35}},{id:"road-closed-casing",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#ffffff",width:{stops:[[11,4],[14,6],[17,10],[19,16],[20,32],[21,64],[22,128]]},opacity:.9},overlay:"roads"},{id:"road-closed",type:"line",source:"closures","source-layer":"closures",minzoom:11,paint:{color:"#d92b2b",width:{stops:[[11,2.5],[14,4],[17,7],[19,11],[20,22],[21,44],[22,88]]},dashArray:[5,4]},overlay:"roads"},{id:"road-closed-end",type:"symbol",source:"closures","source-layer":"closure_ends",minzoom:13,layout:{iconImage:"road_closed",iconFrame:"circle",iconFrameScale:1.6,allowOverlap:true,priority:6},paint:{color:"#d92b2b",frameColor:"#d92b2b",frameOpacity:1,frameHaloColor:"#ffffff",frameHaloWidth:1.4,iconColor:"#ffffff",iconHaloWidth:0,iconSize:13}},{id:"crossing",type:"surface",weld:0,source:"points","source-layer":"crossings",minzoom:16.5,overlay:"roads",paint:{color:"#ffffff",opacity:.9,sideShade:.16,material:"flat"},elevation:.023,bevel:.013,bevelDrop:.005,groundBy:{"landcover:wood":.175,"landcover:forest":.175,"landcover:grass":.125,"landcover:farmland":.125,"landcover:meadow":.125,"landcover:sand":.035,"landcover:beach":.035,"landcover:wetland":.045,"landcover:swamp":.045,"landuse:residential":.02,"landuse:suburb":.02,"landuse:neighbourhood":.02,"landuse:quarter":.02,"landuse:industrial":.03,"landuse:quarry":.03,"landuse:railway":.03,"landuse:substation":.03,"landuse:school":.055,"landuse:university":.055,"landuse:college":.055,"landuse:hospital":.055,"landuse:clinic":.055,"landuse:police":.055,"landuse:kindergarten":.055,"landuse:bus_station":.055,"landuse:pitch":.088,"landuse:stadium":.088,"landuse:playground":.088,"landuse:track":.088,"landuse:swimming_pool":.088,"landuse:cemetery":.075,"landuse:grave_yard":.075,"landuse:parking":.19,"landuse:fuel":.19,"park:park":.15,"aeroway:aerodrome":.065,"aeroway:apron":.065,"aeroway:helipad":.065}},{id:"housenumber",type:"symbol","source-layer":"housenumber",minzoom:17,layout:{textField:"{housenumber}",textSize:{stops:[[17,9],[19,11]]},maxLineChars:6,priority:-60},paint:{color:"#8c8478",haloColor:"#f5f3ee",haloWidth:1}},{id:"poi-food",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c2681c",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c2681c",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream"]},{id:"poi-shop",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#2f77c4",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#2f77c4",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle"]},{id:"poi-transport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3b82a6",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3b82a6",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport"]},{id:"poi-health",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#c24444",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#c24444",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pharmacy","hospital","doctors","dentist","veterinary"]},{id:"poi-education",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#3f7f7a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#3f7f7a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","school","college","university","library","kindergarten"]},{id:"poi-culture",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#8b5aa5",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#8b5aa5",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information"]},{id:"poi-sport",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4f8b45",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4f8b45",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running"]},{id:"poi-lodging",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#7a5fbf",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#7a5fbf",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","lodging"]},{id:"poi-service",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#59636e",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#59636e",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["in","class","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"poi",type:"symbol","source-layer":"poi",minzoom:15,layout:{textField:["{name:ru}","{name}"],iconImage:"{class}",textSize:{stops:[[15,10.5],[18,12.5]]},iconSize:{stops:[[15,13],[18,16]]},iconTextGap:2,maxLineChars:14,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:1,frameColor:"#4a4a4a",frameHaloColor:"#ffffff",frameHaloWidth:1.2,iconColor:"#ffffff",iconHaloWidth:0},filter:["!in","class","cafe","restaurant","fast_food","bar","pub","beer","bakery","ice_cream","shop","clothing_store","grocery","alcohol_shop","music","laundry","hairdresser","car","bicycle","bus","railway","parking","fuel","bicycle_parking","bicycle_rental","taxi","airport","pharmacy","hospital","doctors","dentist","veterinary","school","college","university","library","kindergarten","museum","theatre","cinema","art_gallery","attraction","monument","zoo","theme_park","castle","place_of_worship","information","pitch","park","garden","playground","stadium","sports_centre","swimming_pool","athletics","running","lodging","bank","atm","post","office","town_hall","police","fire_station","toilets"]},{id:"traffic-signal",type:"symbol",source:"points","source-layer":"roadpoints",minzoom:16,filter:["==","kind","traffic_signals"],layout:{iconImage:"traffic_signals",priority:3},paint:{color:"#5c6470",haloColor:"#ffffff",haloWidth:1.4,iconSize:15}},{id:"road-shield",type:"symbol","source-layer":"transportation_name",filter:["has","ref"],minzoom:11,layout:{textField:"{ref}",iconImage:"shield-{ref_length}",iconPlacement:"behind",textSize:{stops:[[11,9.5],[16,11]]},iconTextGap:4,maxLineChars:10,collisionPadding:70,priority:3},paint:{color:"#3a4048",haloColor:"#f7f3e8",haloWidth:.5,iconColor:"#f7f3e8",iconHaloColor:"#8a8172",iconHaloWidth:1.4}},{id:"road-label",type:"symbol","source-layer":"transportation_name",minzoom:14,layout:{textField:["{name:ru}","{name}"],textPlacement:"line",textSize:{stops:[[14,10],[18,13]]},priority:20,abbreviate:true},paint:{color:"#5c5646",haloColor:"#ffffff",haloWidth:1.6}},{id:"water-label",type:"symbol","source-layer":"water_name",minzoom:10,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[10,11],[16,14]]},priority:30},paint:{color:"#3d7ea6",haloColor:"#ffffff",haloWidth:1.4}},{id:"place-label",type:"symbol","source-layer":"place",minzoom:4,layout:{textField:["{name:ru}","{name}"],textSize:{stops:[[6,12],[12,17],[16,22]]},maxLineChars:16,priority:90},paint:{color:"#3a3a3a",haloColor:"#ffffff",haloWidth:1.8}},{id:"indoor-shell",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","level"],minzoom:16,paint:{color:"#f6f3ec",opacity:.97},clipToTile:true},{id:"indoor-corridor",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","corridor"],minzoom:16,paint:{color:"#ffffff"},clipToTile:true},{id:"indoor-room",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["in","class","room","area"],minzoom:16,paint:{color:"#efeae0"},clipToTile:true},{id:"indoor-service",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","service"],minzoom:16,paint:{color:"#e6e1d6"},clipToTile:true},{id:"indoor-shop",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","shop"],minzoom:16,paint:{color:"#e8e0f0"},clipToTile:true},{id:"indoor-food",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","food"],minzoom:16,paint:{color:"#f7e3cd"},clipToTile:true},{id:"indoor-wc",type:"fill",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wc"],minzoom:16,paint:{color:"#d8e8f2"},clipToTile:true},{id:"indoor-wall",type:"fill-extrusion",source:"indoor","source-layer":"area",splitBy:"level",filter:["==","class","wall"],minzoom:16,paint:{color:"#cbc4b8",roofColor:"#e4ded2",facadeDetail:0,tintVariation:0,roofVariation:0,aoStrength:0}},{id:"indoor-transportation",type:"fill",source:"indoor","source-layer":"transportation",splitBy:"level",minzoom:16,paint:{color:"#d9d2e8",opacity:.95},clipToTile:true},{id:"indoor-door",type:"symbol",source:"indoor","source-layer":"poi",filter:["==","class","door"],splitBy:"level",minzoom:18,layout:{iconImage:"door",iconSize:{stops:[[18,9],[20,13]]},allowOverlap:true,priority:-10},paint:{color:"#8a8172",haloColor:"#ffffff",haloWidth:1.2}},{id:"indoor-poi",type:"symbol",source:"indoor","source-layer":"poi",splitBy:"level",minzoom:17,layout:{textField:["{name}"],iconImage:"{class}",textSize:{stops:[[17,10],[19,12]]},iconSize:{stops:[[17,12],[19,15]]},iconTextGap:2,iconFrame:"circle",iconFrameScale:1.55},paint:{color:"#4a4a4a",haloColor:"#ffffff",haloWidth:1.3,frameOpacity:.32}},{id:"indoor-name",type:"symbol",source:"indoor","source-layer":"area_name",splitBy:"level",minzoom:17,layout:{textField:["{name}"],textSize:{stops:[[17,10.5],[19,12.5]]},maxLineChars:8},paint:{color:"#3c3830",haloColor:"#ffffff",haloWidth:1.4}},{id:"building-entrance",type:"symbol",source:"points","source-layer":"entrances",minzoom:17,layout:{iconImage:"entrance",showFor:"highlight",textField:["{ref}"],textSize:{stops:[[17,10],[19,12.5]]},allowOverlap:true,priority:40,iconRotate:"angle",placement:"map",arrowLength:{stops:[[17,22],[18,32],[19,40],[20,48],[22,56]]},arrowWidth:{stops:[[17,6],[18,8.5],[19,10.5],[20,12.5],[22,15]]},arrowOutline:{stops:[[17,1.4],[18,2],[19,2.5],[20,3],[22,3.5]]},arrowGap:{stops:[[17,14],[18,19],[19,23],[20,27],[22,31]]},arrowUnits:"pixels",iconTextGap:3,arrowDotRadius:{stops:[[17,2.2],[18,3.2],[19,4],[20,4.8],[22,5.6]]},arrowDotGap:{stops:[[17,5],[18,7],[19,9],[20,11],[22,12.5]]}},paint:{color:"#2d6ecb",haloColor:"#ffffff",haloWidth:1.6}}],sources:{world:{url:"/tileserver/data/world/{z}/{x}/{y}.pbf",minzoom:0,maxzoom:6},indoor:{url:"/tileserver/data/indoor/{z}/{x}/{y}.pbf",minzoom:15,maxzoom:18},points:{url:"/tileserver/data/points/{z}/{x}/{y}.pbf",minzoom:13,maxzoom:16},closures:{url:"/tileserver/data/closures/{z}/{x}/{y}.pbf",minzoom:10,maxzoom:16}}};var Si={name:"\u041D\u043E\u0447\u043D\u0430\u044F",background:"#11151c",model3dKey:"night",light:{ambientColor:"#8fa3c4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cfd8ea",keyIntensity:.3,fillAzimuth:300,fillAltitude:20,fillColor:"#4a5f86",fillIntensity:.22},paint:{"landcover-wood":{color:"#16261a"},"landcover-grass":{color:"#182619"},"landcover-sand":{color:"#2a2417"},"landcover-ice":{color:"#1b2730"},"landcover-wetland":{color:"#16242a"},"landuse-residential":{color:"#171b23"},"landuse-industrial":{color:"#1b1c20"},"landuse-civic":{color:"#1c1f28"},"landuse-sport":{color:"#16261c"},"landuse-cemetery":{color:"#182018"},"landuse-parking":{color:"#191d24"},park:{color:"#15271a"},"aeroway-area":{color:"#1b1e26"},water:{color:"#0f2438"},"water-pool":{color:"#123048"},waterway:{color:"#14304a"},"aeroway-line":{color:"#242833"},"road-casing-major":{color:"#2a2519"},"road-casing-secondary":{color:{stops:[[16,"#22262f"],[18.5,"#2a2519"]]}},"road-casing-minor":{color:{stops:[[16,"#1e222a"],[18.5,"#2a2519"]]}},"road-rail":{color:"#333842"},"road-path":{color:"#2a2e36"},"road-minor":{color:{stops:[[16,"#2f343d"],[18.5,"#6b5c3c"]]}},"road-secondary":{color:{stops:[[16,"#3c424d"],[18.5,"#6b5c3c"]]}},"road-ramp":{color:"#6b5c3c"},"road-major":{color:"#6b5c3c"},boundary:{color:"#4a3f52"},building:{color:"#232833",roofColor:"#2b313d",aoStrength:.3,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#39424f",windowGlow:.35},housenumber:{color:"#5f6672",haloColor:"#12161d"},poi:{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"road-label":{color:"#a8b0bd",haloColor:"#12161d",haloWidth:1.5},"water-label":{color:"#6ea2c7",haloColor:"#0e1b28"},"place-label":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2},"poi-food":{color:"#d89964",haloColor:"#12161d",haloWidth:1.3,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#12161d",haloWidth:1.3,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#12161d",haloWidth:1.3,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#12161d",haloWidth:1.3,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#12161d",haloWidth:1.3,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#12161d",haloWidth:1.3,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#12161d",haloWidth:1.3,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#12161d",iconColor:"#1b1b1b",iconHaloWidth:0},"building-entrance":{color:"#79a0d7",haloColor:"#12161d"},"indoor-shell":{color:"#3a4254",opacity:.97},"indoor-corridor":{color:"#363d4e"},"indoor-room":{color:"#414a5f"},"indoor-service":{color:"#535f79"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#697183",roofColor:"#868c99",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#65548a",opacity:.95},"indoor-door":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-poi":{color:"#c3ccd9",haloColor:"#12161d",haloWidth:1.3},"indoor-name":{color:"#e2e7ee",haloColor:"#10141b",haloWidth:2}},sky:{skyColor:"#080d18",horizonColor:"#1b2436",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#02030a",atmosphereColor:"#3f6fa8",starIntensity:.8}};var Mi={name:"\u0413\u0440\u0430\u0444\u0438\u0442",background:"#eeeeee",light:{ambientColor:"#ffffff",ambientIntensity:.55,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.5,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.16},paint:{"landcover-wood":{color:"#e2e2e2"},"landcover-grass":{color:"#e7e7e7"},"landcover-sand":{color:"#eaeaea"},"landcover-ice":{color:"#f0f0f0"},"landcover-wetland":{color:"#e4e4e4"},"landuse-residential":{color:"#e9e9e9"},"landuse-industrial":{color:"#e5e5e5"},"landuse-civic":{color:"#ebebeb"},"landuse-sport":{color:"#e4e4e4"},"landuse-cemetery":{color:"#e6e6e6"},"landuse-parking":{color:"#ececec"},park:{color:"#e3e3e3"},"aeroway-area":{color:"#e8e8e8"},water:{color:"#d4d4d4"},"water-pool":{color:"#d8d8d8"},waterway:{color:"#d4d4d4"},"aeroway-line":{color:"#dedede"},"road-casing-major":{color:"#c9c9c9"},"road-casing-secondary":{color:{stops:[[16,"#d2d2d2"],[18.5,"#c9c9c9"]]}},"road-casing-minor":{color:{stops:[[16,"#d8d8d8"],[18.5,"#c9c9c9"]]}},"road-rail":{color:"#c2c2c2"},"road-path":{color:"#d0d0d0"},"road-minor":{color:{stops:[[16,"#f7f7f7"],[18.5,"#ffffff"]]}},"road-secondary":{color:{stops:[[16,"#fbfbfb"],[18.5,"#ffffff"]]}},"road-ramp":{color:"#ffffff"},"road-major":{color:"#ffffff"},boundary:{color:"#b0b0b0"},building:{color:"#dcdcdc",roofColor:"#e0e0e0",aoStrength:.22,tintVariation:.05,windowColor:"#b7bcc2",windowFrameColor:"#f2f2f2",windowGlow:0},housenumber:{color:"#9a9a9a",haloColor:"#f4f4f4"},poi:{color:"#3c3c3c",haloColor:"#ffffff"},"road-label":{color:"#585858",haloColor:"#ffffff"},"water-label":{color:"#6e6e6e",haloColor:"#ffffff"},"place-label":{color:"#2a2a2a",haloColor:"#ffffff"},"poi-food":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#3c3c3c",haloColor:"#ffffff",frameColor:"#3c3c3c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#e9e9e9",opacity:.97},"indoor-corridor":{color:"#eeeeee"},"indoor-room":{color:"#e2e2e2"},"indoor-service":{color:"#cecece"},"indoor-shop":{color:"#d7cfdf"},"indoor-food":{color:"#dfd7cf"},"indoor-wc":{color:"#cfd9df"},"indoor-wall":{color:"#c0c0c0",roofColor:"#d4d4d4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c2bbd1",opacity:.95},"indoor-door":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-poi":{color:"#3c3c3c",haloColor:"#ffffff"},"indoor-name":{color:"#2a2a2a",haloColor:"#ffffff"}},sky:{skyColor:"#8f96a0",horizonColor:"#d7dade",fogRange:[2.43,10.12],fogIntensity:.9,spaceColor:"#07080b",atmosphereColor:"#9aa3ad",starIntensity:.5}};var Ti={name:"\u0411\u043B\u0435\u0434\u043D\u0430\u044F",background:"#f7f6f3",light:{ambientColor:"#ffffff",ambientIntensity:.62,keyAzimuth:120,keyAltitude:65,keyColor:"#fffaf0",keyIntensity:.38,fillAzimuth:300,fillAltitude:25,fillColor:"#eef2f8",fillIntensity:.14},paint:{"landcover-wood":{color:"#e8efe2"},"landcover-grass":{color:"#edf2e6"},"landcover-sand":{color:"#f4eede"},"landcover-ice":{color:"#f0f5f7"},"landcover-wetland":{color:"#e8f0ec"},"landuse-residential":{color:"#f2f0ec"},"landuse-industrial":{color:"#f0edeb"},"landuse-civic":{color:"#f4efe9"},"landuse-sport":{color:"#e9f1e4"},"landuse-cemetery":{color:"#ecefe6"},"landuse-parking":{color:"#f3f1ed"},park:{color:"#e7f0df"},"aeroway-area":{color:"#f0f0f2"},water:{color:"#dce9f2"},"water-pool":{color:"#dcecf5"},waterway:{color:"#dce9f2"},"aeroway-line":{color:"#ebebee"},"road-casing-major":{color:"#efe4d2"},"road-casing-secondary":{color:{stops:[[16,"#eceae2"],[18.5,"#efe4d2"]]}},"road-casing-minor":{color:{stops:[[16,"#efedE6"],[18.5,"#efe4d2"]]}},"road-rail":{color:"#e0dcd6"},"road-path":{color:"#e6e2da"},"road-minor":{color:{stops:[[16,"#fdfcfa"],[18.5,"#fff8e8"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#fff8e8"]]}},"road-ramp":{color:"#fff8e8"},"road-major":{color:"#fff8e8"},boundary:{color:"#cfc3d2"},building:{color:"#eae7e0",roofColor:"#ecE9e2",aoStrength:.14,tintVariation:.04,windowColor:"#c7d6e4",windowFrameColor:"#f6f7f9",windowGlow:0},housenumber:{color:"#a9a296",haloColor:"#fbfaf7"},poi:{color:"#6b6b6b",haloColor:"#ffffff"},"road-label":{color:"#8a8474",haloColor:"#ffffff"},"water-label":{color:"#7ea8c4",haloColor:"#ffffff"},"place-label":{color:"#55524c",haloColor:"#ffffff"},"poi-food":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#6b6b6b",haloColor:"#ffffff",frameColor:"#6b6b6b",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"},"indoor-shell":{color:"#f4f3f0",opacity:.97},"indoor-corridor":{color:"#f8f7f6"},"indoor-room":{color:"#edece8"},"indoor-service":{color:"#dcd9d1"},"indoor-shop":{color:"#e0dae6"},"indoor-food":{color:"#e6e0da"},"indoor-wc":{color:"#dae1e6"},"indoor-wall":{color:"#cdcbc4",roofColor:"#e0dedb",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc5d9",opacity:.95},"indoor-door":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-poi":{color:"#6b6b6b",haloColor:"#ffffff"},"indoor-name":{color:"#55524c",haloColor:"#ffffff"}},sky:{skyColor:"#c8dbee",horizonColor:"#eef2f6",fogRange:[2.52,12.15],fogIntensity:.85,spaceColor:"#0a1018",atmosphereColor:"#9fd0ff",starIntensity:.45}};var Ei={name:"\u041E\u0431\u044A\u0451\u043C\u043D\u0430\u044F",background:"#dfdbda",light:{ambientColor:"#ffffff",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#ffffff",fillIntensity:.18},paint:{"landcover-wood":{color:"#9bda95"},"landcover-grass":{color:"#b2e6a8"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d5e8f1"},"landcover-wetland":{color:"#badbde"},"landuse-residential":{color:"#e4e1e0"},"landuse-industrial":{color:"#dadce7"},"landuse-civic":{color:"#ecdae0"},"landuse-sport":{color:"#bbeba2"},"landuse-cemetery":{color:"#c2e2bb"},"landuse-parking":{color:"#d6d4d4"},park:{color:"#b2e6a8"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#94d8f9"},waterway:{color:"#94d8f9"},"aeroway-line":{color:"#dfdcd9"},"road-casing-major":{color:"#8997b3"},"road-casing-secondary":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-casing-minor":{color:{stops:[[16,"#9da7be"],[18.5,"#8997b3"]]}},"road-rail":{color:"#9e9e9e"},"road-path":{color:"#bbc1d3"},"road-minor":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-secondary":{color:{stops:[[16,"#bbc1d3"],[18.5,"#99abc2"]]}},"road-ramp":{color:"#99abc2"},"road-major":{color:"#99abc2"},boundary:{color:"#f66f91"},building:{color:"#ffffff",roofColor:"#f2f1f0",aoStrength:.19,tintVariation:0,windowColor:"#6b9ed1",windowFrameColor:"#eef0f4",windowGlow:0},housenumber:{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#a7e1fd"},"indoor-shell":{color:"#f4f3f1",opacity:.97},"indoor-corridor":{color:"#f8f8f6"},"indoor-room":{color:"#eeece8"},"indoor-service":{color:"#ddd8d2"},"indoor-shop":{color:"#e0dae7"},"indoor-food":{color:"#e7e1da"},"indoor-wc":{color:"#dae2e7"},"indoor-wall":{color:"#cecac5",roofColor:"#e0dedc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#ccc6d9",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#2e2e2e",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#91b8cb",horizonColor:"#dfd9d6",fogRange:[2.41,9.94],fogIntensity:.86,spaceColor:"#0e0b0a",atmosphereColor:"#5daad0",starIntensity:.38}};var ki={name:"\u041C\u0443\u043B\u044C\u0442\u044F\u0448\u043D\u0430\u044F",background:"#f7f3de",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#61d161"},"landcover-grass":{color:"#91e481"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c7dfeb"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#f2ecd9"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#9fec79"},"landuse-cemetery":{color:"#a8d69f"},"landuse-parking":{color:"#dddcda"},park:{color:"#91e481"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#71c8f4"},waterway:{color:"#71c8f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#ca6a16"},"road-casing-secondary":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-casing-minor":{color:{stops:[[16,"#5a6faf"],[18.5,"#ca6a16"]]}},"road-rail":{color:"#737373"},"road-path":{color:"#ffffff"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-secondary":{color:{stops:[[16,"#ffffff"],[18.5,"#f8c662"]]}},"road-ramp":{color:"#f8c662"},"road-major":{color:"#f8c662"},boundary:{color:"#f6517a"},building:{color:"#f4dfc2",roofColor:"#f4dfc2",aoStrength:.19,tintVariation:.06,windowColor:"#5b9ee0",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#80d1fa"},"indoor-shell":{color:"#ebe9e5",opacity:.97},"indoor-corridor":{color:"#efedea"},"indoor-room":{color:"#e5e1dc"},"indoor-service":{color:"#d4cec6"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#c4c0ba",roofColor:"#d6d4d0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#f05a0f",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#222b59",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#8cb5c9",horizonColor:"#e8e2c7",fogRange:[2.41,9.92],fogIntensity:.86,spaceColor:"#131105",atmosphereColor:"#5ca9d0",starIntensity:.39}};var Ai={name:"\u041A\u0438\u0431\u0435\u0440\u043F\u0430\u043D\u043A",background:"#120817",model3dKey:"night",light:{ambientColor:"#b279cf",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#ff70d0",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#854770",fillIntensity:.22},paint:{"landcover-wood":{color:"#0c3728"},"landcover-grass":{color:"#104131"},"landcover-sand":{color:"#262417"},"landcover-ice":{color:"#74345f"},"landcover-wetland":{color:"#152223"},"landuse-residential":{color:"#170b1e"},"landuse-industrial":{color:"#171921"},"landuse-civic":{color:"#21171a"},"landuse-sport":{color:"#0c4529"},"landuse-cemetery":{color:"#151e1b"},"landuse-parking":{color:"#272428"},park:{color:"#104131"},"aeroway-area":{color:"#1a1c23"},water:{color:"#5f1145"},waterway:{color:"#711452"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#981662"},"road-casing-secondary":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-casing-minor":{color:{stops:[[16,"#6a1b6a"],[18.5,"#981662"]]}},"road-rail":{color:"#39acac"},"road-path":{color:"#12e2e2"},"road-minor":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-secondary":{color:{stops:[[16,"#12e2e2"],[18.5,"#f631a4"]]}},"road-ramp":{color:"#f631a4"},"road-major":{color:"#f631a4"},boundary:{color:"#f53da8"},building:{color:"#311839",roofColor:"#9d2575",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#84dcff",windowGlow:.5},housenumber:{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},poi:{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"road-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#110514",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#110514",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#110514",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#110514",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#110514",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#110514",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#110514",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#110514",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#110514",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#110514",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#84135f"},"indoor-shell":{color:"#4c3752",opacity:.97},"indoor-corridor":{color:"#46334c"},"indoor-room":{color:"#553e5d"},"indoor-service":{color:"#6e5078"},"indoor-shop":{color:"#59446f"},"indoor-food":{color:"#6f5a44"},"indoor-wc":{color:"#445e6f"},"indoor-wall":{color:"#7b6681",roofColor:"#938298",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#635287",opacity:.95},"indoor-door":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-poi":{color:"#f6e95a",haloColor:"#110514",haloWidth:1.4},"indoor-name":{color:"#acf6f6",haloColor:"#110514",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#110514"}},sky:{skyColor:"#180813",horizonColor:"#281831",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#060308",atmosphereColor:"#b5358b",starIntensity:.82}};var Li={name:"\u0420\u0430\u0441\u0441\u0432\u0435\u0442",background:"#f4ebe1",light:{ambientColor:"#f8f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffe0c0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a4db9f"},"landcover-grass":{color:"#bae7b1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#dbe7f0"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f5efeb"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#c1ecac"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#dddbda"},park:{color:"#bae7b1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6d2f2"},waterway:{color:"#a6d2f2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#92a1bf"},"road-casing-secondary":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-casing-minor":{color:{stops:[[16,"#a6afc9"],[18.5,"#92a1bf"]]}},"road-rail":{color:"#b5a49b"},"road-path":{color:"#c3c9df"},"road-minor":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-secondary":{color:{stops:[[16,"#c3c9df"],[18.5,"#a9b9d1"]]}},"road-ramp":{color:"#a9b9d1"},"road-major":{color:"#a9b9d1"},boundary:{color:"#f584a1"},building:{color:"#f6ebdf",roofColor:"#fdede7",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#f0ece8",windowGlow:0},housenumber:{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},poi:{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"road-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"poi-food":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fdfaf7",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fdfaf7",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b9ddf7"},"indoor-shell":{color:"#f8f7f5",opacity:.97},"indoor-corridor":{color:"#fcfbfb"},"indoor-room":{color:"#f1efed"},"indoor-service":{color:"#e0dbd6"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#d1cdc9",roofColor:"#e4e2e0",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-poi":{color:"#56738f",haloColor:"#fdfaf7",haloWidth:1.4},"indoor-name":{color:"#46332a",haloColor:"#fdfaf7",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fdfaf7"}},sky:{skyColor:"#8cb0c9",horizonColor:"#e4d7cb",fogRange:[2.41,9.92],fogIntensity:.86,spaceColor:"#120c07",atmosphereColor:"#5c9fd0",starIntensity:.39}};var Ii={name:"\u0421\u0443\u043C\u0435\u0440\u043A\u0438",background:"#d7cbc1",light:{ambientColor:"#ececeb",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#ffcaa0",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#75af6a"},"landcover-grass":{color:"#94bd7f"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#c1c8d7"},"landcover-wetland":{color:"#83bec3"},"landuse-residential":{color:"#d5cac3"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#91c775"},"landuse-cemetery":{color:"#9ac982"},"landuse-parking":{color:"#c0bcb9"},park:{color:"#94bd7f"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#708bc2"},waterway:{color:"#708bc2"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6a5b9a"},"road-casing-secondary":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-casing-minor":{color:{stops:[[16,"#7078a4"],[18.5,"#6a5b9a"]]}},"road-rail":{color:"#93796c"},"road-path":{color:"#8f94b7"},"road-minor":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-secondary":{color:{stops:[[16,"#8f94b7"],[18.5,"#8576b2"]]}},"road-ramp":{color:"#8576b2"},"road-major":{color:"#8576b2"},boundary:{color:"#e05275"},building:{color:"#e0d1c2",roofColor:"#f1d6cb",aoStrength:.2,tintVariation:.07,windowColor:"#6b9ed1",windowFrameColor:"#efe6df",windowGlow:0},housenumber:{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},poi:{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"road-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"poi-food":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5ebe0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5ebe0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#7a94ca"},"indoor-shell":{color:"#e3deda",opacity:.97},"indoor-corridor":{color:"#e7e3df"},"indoor-room":{color:"#dcd7d1"},"indoor-service":{color:"#cbc3ba"},"indoor-shop":{color:"#ccc2d6"},"indoor-food":{color:"#d6ccc2"},"indoor-wc":{color:"#c2ced6"},"indoor-wall":{color:"#bbb5af",roofColor:"#cdc9c6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b6adc9",opacity:.95},"indoor-door":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-poi":{color:"#64568f",haloColor:"#f5ebe0",haloWidth:1.4},"indoor-name":{color:"#2c283e",haloColor:"#f5ebe0",haloWidth:1.4},"building-entrance":{haloColor:"#f5ebe0"}},sky:{skyColor:"#5675b3",horizonColor:"#c0b4aa",fogRange:[2.39,9.64],fogIntensity:.87,spaceColor:"#0e0b09",atmosphereColor:"#557dce",starIntensity:.45}};var Fi={name:"\u0417\u0435\u043C\u043B\u044F",background:"#dbd1bd",light:{ambientColor:"#edecea",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff2dc",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d6e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#50a136"},"landcover-grass":{color:"#8ac76b"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#aec5d6"},"landcover-wetland":{color:"#7cbac0"},"landuse-residential":{color:"#ded5c4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#86d161"},"landuse-cemetery":{color:"#94c67b"},"landuse-parking":{color:"#c0beb9"},park:{color:"#8ac76b"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#3b91ce"},waterway:{color:"#4798d1"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a47546"},"road-casing-secondary":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-casing-minor":{color:{stops:[[16,"#a79376"],[18.5,"#a47546"]]}},"road-rail":{color:"#877564"},"road-path":{color:"#c6bba9"},"road-minor":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-secondary":{color:{stops:[[16,"#c6bba9"],[18.5,"#cdaa7a"]]}},"road-ramp":{color:"#cdaa7a"},"road-major":{color:"#cdaa7a"},boundary:{color:"#bf6a40"},building:{color:"#d4c5af",roofColor:"#d4c5af",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceae4",windowGlow:0},housenumber:{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},poi:{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"road-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"poi-food":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f7f4ee",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f7f4ee",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#4299d7"},"indoor-shell":{color:"#d6d0c8",opacity:.97},"indoor-corridor":{color:"#d9d5cd"},"indoor-room":{color:"#cfc9bf"},"indoor-service":{color:"#beb5a9"},"indoor-shop":{color:"#bcafca"},"indoor-food":{color:"#cabdaf"},"indoor-wc":{color:"#afbfca"},"indoor-wall":{color:"#ada79e",roofColor:"#bebbb5",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbc",opacity:.95},"indoor-door":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-poi":{color:"#7c5c3c",haloColor:"#f7f4ee",haloWidth:1.4},"indoor-name":{color:"#46382a",haloColor:"#f7f4ee",haloWidth:1.4},"building-entrance":{haloColor:"#f7f4ee"}},sky:{skyColor:"#568db3",horizonColor:"#c4baa5",fogRange:[2.39,9.64],fogIntensity:.87,spaceColor:"#0f0c08",atmosphereColor:"#559cce",starIntensity:.45}};var Ri={name:"\u0424\u0443\u0442\u0443\u0440\u0438\u0437\u043C",background:"#0c0f1d",model3dKey:"night",light:{ambientColor:"#8590c7",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#8ff0ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#477b85",fillIntensity:.22},paint:{"landcover-wood":{color:"#123026"},"landcover-grass":{color:"#18392e"},"landcover-sand":{color:"#2d2a1b"},"landcover-ice":{color:"#276672"},"landcover-wetland":{color:"#192829"},"landuse-residential":{color:"#111422"},"landuse-industrial":{color:"#1b1d27"},"landuse-civic":{color:"#271b1f"},"landuse-sport":{color:"#143d29"},"landuse-cemetery":{color:"#192420"},"landuse-parking":{color:"#292a2e"},park:{color:"#18392e"},"aeroway-area":{color:"#1e2129"},water:{color:"#055261"},waterway:{color:"#076a7e"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#8b238b"},"road-casing-secondary":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-casing-minor":{color:{stops:[[16,"#185662"],[18.5,"#8b238b"]]}},"road-rail":{color:"#8546a4"},"road-path":{color:"#22b6c3"},"road-minor":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-secondary":{color:{stops:[[16,"#22b6c3"],[18.5,"#e03ee0"]]}},"road-ramp":{color:"#e03ee0"},"road-major":{color:"#e03ee0"},boundary:{color:"#eb47eb"},building:{color:"#1e2b3e",roofColor:"#277686",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#bfe6ff",windowGlow:.5},housenumber:{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},poi:{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"road-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080a17",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080a17",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080a17",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080a17",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080a17",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080a17",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080a17",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080a17",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#027288"},"indoor-shell":{color:"#394556",opacity:.97},"indoor-corridor":{color:"#354050"},"indoor-room":{color:"#404d60"},"indoor-service":{color:"#52637b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#687485",roofColor:"#858e9a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-poi":{color:"#eb84eb",haloColor:"#080a17",haloWidth:1.4},"indoor-name":{color:"#c6edf1",haloColor:"#080a17",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080a17"}},sky:{skyColor:"#081619",horizonColor:"#1b1f30",fogRange:[2.34,8.79],fogIntensity:.9,spaceColor:"#030408",atmosphereColor:"#35a1b7",starIntensity:.81}};var zi={name:"\u0421\u0442\u0435\u043A\u043B\u043E \u043C\u044F\u0433\u043A\u043E\u0435",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#bddbc3"},"landcover-grass":{color:"#d0ecda"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbebdb"},"landcover-wetland":{color:"#d9ebed"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#cdefd4"},"landuse-cemetery":{color:"#dbf0e3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#ccead9"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#b9e5f4"},waterway:{color:"#81c6e4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#dabc95"},"road-casing-secondary":{color:{stops:[[16,"#d5cdb8"],[18.5,"#dabc95"]]}},"road-casing-minor":{color:{stops:[[16,"#cad1d8"],[18.5,"#dabc95"]]}},"road-rail":{color:"#a5a0b1"},"road-path":{color:"#9fbcad"},"road-minor":{color:{stops:[[16,"#ffffff"],[18.5,"#f8e5c3"]]}},"road-secondary":{color:{stops:[[16,"#fbf6ea"],[18.5,"#f8e5c3"]]}},"road-ramp":{color:"#f8e5c3"},"road-major":{color:"#f8e5c3"},boundary:{color:"#ce97c0"},building:{color:"#e5ebf0",roofColor:"#f7fbfd",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#ceeef9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#4e6779",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2f3f50",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c0f",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Pi={name:"\u0421\u0442\u0435\u043A\u043B\u043E",background:"#f2f5f7",light:{ambientColor:"#fbfbfb",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee9ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#b8e0cf"},"landcover-grass":{color:"#cbebdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#e5f0f3"},"landcover-wetland":{color:"#d6e9eb"},"landuse-residential":{color:"#f6f7f9"},"landuse-industrial":{color:"#e3e5ed"},"landuse-civic":{color:"#f1e4e8"},"landuse-sport":{color:"#c8efd5"},"landuse-cemetery":{color:"#d8eee3"},"landuse-parking":{color:"#e4e6e7"},park:{color:"#cbebdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#bee6f4"},waterway:{color:"#bee6f4"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#9dc7dd"},"road-casing-secondary":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-casing-minor":{color:{stops:[[16,"#bdcfdb"],[18.5,"#9dc7dd"]]}},"road-rail":{color:"#adb9c2"},"road-path":{color:"#d6e2eb"},"road-minor":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-secondary":{color:{stops:[[16,"#d6e2eb"],[18.5,"#b8daea"]]}},"road-ramp":{color:"#b8daea"},"road-major":{color:"#b8daea"},boundary:{color:"#e28dc6"},building:{color:"#e8eef3",roofColor:"#f4f8fb",aoStrength:.18,tintVariation:.06,windowColor:"#bcd4e8",windowFrameColor:"#dfe8f2",windowGlow:0},housenumber:{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},poi:{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"road-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfdfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfdfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#d3eff9"},"indoor-shell":{color:"#f5f7f8",opacity:.97},"indoor-corridor":{color:"#fbfbfc"},"indoor-room":{color:"#edeff1"},"indoor-service":{color:"#d6dce0"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#c9ced1",roofColor:"#e0e2e4",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-poi":{color:"#457aa1",haloColor:"#fbfdfe",haloWidth:1.4},"indoor-name":{color:"#2d4053",haloColor:"#fbfdfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfdfe"}},sky:{skyColor:"#9fc5d2",horizonColor:"#dfe3e8",fogRange:[2.43,10.02],fogIntensity:.85,spaceColor:"#090c10",atmosphereColor:"#5fb3d0",starIntensity:.37}};var Hi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0447\u0451\u0440\u043D\u0430\u044F",background:"#1a1a1a",model3dKey:"night",light:{ambientColor:"#a8a8a8",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#cccccc",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#854747",fillIntensity:.22},paint:{"landcover-wood":{color:"#212121"},"landcover-grass":{color:"#292929"},"landcover-sand":{color:"#33301f"},"landcover-ice":{color:"#545454"},"landcover-wetland":{color:"#1d2e30"},"landuse-residential":{color:"#1f1f1f"},"landuse-industrial":{color:"#1f222d"},"landuse-civic":{color:"#2d1f24"},"landuse-sport":{color:"#2d2525"},"landuse-cemetery":{color:"#2a1d1d"},"landuse-parking":{color:"#332e2e"},park:{color:"#292929"},"aeroway-area":{color:"#23262f"},water:{color:"#383838"},waterway:{color:"#3d3d3d"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#525252"},"road-casing-secondary":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-casing-minor":{color:{stops:[[16,"#383838"],[18.5,"#525252"]]}},"road-rail":{color:"#595959"},"road-path":{color:"#525252"},"road-minor":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-secondary":{color:{stops:[[16,"#525252"],[18.5,"#757575"]]}},"road-ramp":{color:"#757575"},"road-major":{color:"#757575"},boundary:{color:"#808080"},building:{color:"#2e2e2e",roofColor:"#4f4f4f",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#c8ccd4",windowGlow:.36},housenumber:{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},poi:{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"road-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"poi-food":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4,frameColor:"#a3a3a3",frameOpacity:1,frameHaloColor:"#0a0a0a",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#4c4c4c"},"indoor-shell":{color:"#484848",opacity:.97},"indoor-corridor":{color:"#424242"},"indoor-room":{color:"#505050"},"indoor-service":{color:"#676767"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#767676",roofColor:"#909090",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-poi":{color:"#a3a3a3",haloColor:"#0a0a0a",haloWidth:1.4},"indoor-name":{color:"#d9d9d9",haloColor:"#0a0a0a",haloWidth:1.4},"building-entrance":{color:"#cac4c4",haloColor:"#0a0a0a"}},sky:{skyColor:"#190909",horizonColor:"#282828",fogRange:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#b83535",starIntensity:.8}};var Oi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0441\u0438\u043D\u044F\u044F",background:"#e3e9f2",light:{ambientColor:"#f7f7f7",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#eef4ff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee5ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a1b8ce"},"landcover-grass":{color:"#bdccdb"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#baccde"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#ebeff4"},"landuse-industrial":{color:"#d7d9e4"},"landuse-civic":{color:"#ead7dd"},"landuse-sport":{color:"#b8d3e0"},"landuse-cemetery":{color:"#c2d4e5"},"landuse-parking":{color:"#dadbdd"},park:{color:"#bdccdb"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5799db"},waterway:{color:"#5f9edd"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#407fbf"},"road-casing-secondary":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-casing-minor":{color:{stops:[[16,"#80a1c6"],[18.5,"#407fbf"]]}},"road-rail":{color:"#738dab"},"road-path":{color:"#b0c5dd"},"road-minor":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-secondary":{color:{stops:[[16,"#b0c5dd"],[18.5,"#71a3d6"]]}},"road-ramp":{color:"#71a3d6"},"road-major":{color:"#71a3d6"},boundary:{color:"#478cd1"},building:{color:"#cfdae8",roofColor:"#e5edf6",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8eef6",windowGlow:0},housenumber:{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},poi:{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"road-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"poi-food":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#fbfcfe",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#fbfcfe",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#61a2e3"},"indoor-shell":{color:"#e6e8ec",opacity:.97},"indoor-corridor":{color:"#ebedf0"},"indoor-room":{color:"#dde1e5"},"indoor-service":{color:"#c6ccd4"},"indoor-shop":{color:"#d6cedf"},"indoor-food":{color:"#dfd7ce"},"indoor-wc":{color:"#ced8df"},"indoor-wall":{color:"#babfc5",roofColor:"#d1d4d7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1bad1",opacity:.95},"indoor-door":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-poi":{color:"#3e6da3",haloColor:"#fbfcfe",haloWidth:1.4},"indoor-name":{color:"#1f395c",haloColor:"#fbfcfe",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#fbfcfe"}},sky:{skyColor:"#8cabc9",horizonColor:"#ced6e1",fogRange:[2.41,9.92],fogIntensity:.86,spaceColor:"#080b10",atmosphereColor:"#5c96d0",starIntensity:.39}};var Wi={name:"\u0413\u0430\u0440\u043C\u043E\u043D\u0438\u044F \u0437\u0435\u043B\u0451\u043D\u0430\u044F",background:"#dfecdf",light:{ambientColor:"#f5f6f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#f0fff0",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dcece7",fillIntensity:.18},paint:{"landcover-wood":{color:"#5ccc65"},"landcover-grass":{color:"#8cd98c"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#bbd8ce"},"landcover-wetland":{color:"#9fccd1"},"landuse-residential":{color:"#e6efe6"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#94e085"},"landuse-cemetery":{color:"#9fd69f"},"landuse-parking":{color:"#d4d8d4"},park:{color:"#8cd98c"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#5ec9a6"},waterway:{color:"#66ccaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#44a754"},"road-casing-secondary":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-casing-minor":{color:{stops:[[16,"#7fbd7f"],[18.5,"#44a754"]]}},"road-rail":{color:"#72a172"},"road-path":{color:"#afd4af"},"road-minor":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-secondary":{color:{stops:[[16,"#afd4af"],[18.5,"#64c474"]]}},"road-ramp":{color:"#64c474"},"road-major":{color:"#64c474"},boundary:{color:"#39c668"},building:{color:"#cfe2cb",roofColor:"#dff1df",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e8f0e8",windowGlow:0},housenumber:{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},poi:{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"road-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"poi-food":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fcf8",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fcf8",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#67d1af"},"indoor-shell":{color:"#e1e8e0",opacity:.97},"indoor-corridor":{color:"#e6ece5"},"indoor-room":{color:"#d9e1d7"},"indoor-service":{color:"#c3d0c1"},"indoor-shop":{color:"#d1c8db"},"indoor-food":{color:"#dbd2c8"},"indoor-wc":{color:"#c8d4db"},"indoor-wall":{color:"#b7c0b5",roofColor:"#cdd2cc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bcb4cd",opacity:.95},"indoor-door":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-poi":{color:"#358d44",haloColor:"#f8fcf8",haloWidth:1.4},"indoor-name":{color:"#1c4a24",haloColor:"#f8fcf8",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fcf8"}},sky:{skyColor:"#83c5af",horizonColor:"#cad9ca",fogRange:[2.41,9.87],fogIntensity:.86,spaceColor:"#090f09",atmosphereColor:"#5bcfa9",starIntensity:.4}};var Bi={name:"\u041B\u0443\u043D\u043D\u0430\u044F",background:"#c8cbd0",light:{ambientColor:"#ebecec",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#e8ecf2",keyIntensity:.56,fillAzimuth:300,fillAltitude:25,fillColor:"#c7d0e1",fillIntensity:.19},paint:{"landcover-wood":{color:"#a8abb3"},"landcover-grass":{color:"#b9bbc1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#cbcdd2"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ced0d4"},"landuse-industrial":{color:"#b3b7cc"},"landuse-civic":{color:"#d5aebb"},"landuse-sport":{color:"#b2bdc7"},"landuse-cemetery":{color:"#adbddc"},"landuse-parking":{color:"#b9bcc0"},park:{color:"#b9bbc1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#929aaa"},waterway:{color:"#929aaa"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#6c7689"},"road-casing-secondary":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-casing-minor":{color:{stops:[[16,"#848b9a"],[18.5,"#6c7689"]]}},"road-rail":{color:"#7e838b"},"road-path":{color:"#acb0b9"},"road-minor":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-secondary":{color:{stops:[[16,"#acb0b9"],[18.5,"#949ba8"]]}},"road-ramp":{color:"#949ba8"},"road-major":{color:"#949ba8"},boundary:{color:"#6a7181"},building:{color:"#c8cbd0",roofColor:"#d9dbdd",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#cfd6e0",windowGlow:0},housenumber:{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},poi:{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"road-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"poi-food":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f1f2f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f1f2f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#9ca4b3"},"indoor-shell":{color:"#d6d9dc",opacity:.97},"indoor-corridor":{color:"#dbdde0"},"indoor-room":{color:"#ced1d5"},"indoor-service":{color:"#b9bcc3"},"indoor-shop":{color:"#c7bcd2"},"indoor-food":{color:"#d2c7bc"},"indoor-wc":{color:"#bcc9d2"},"indoor-wall":{color:"#acafb4",roofColor:"#c2c4c7",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#b1a7c5",opacity:.95},"indoor-door":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-poi":{color:"#606876",haloColor:"#f1f2f4",haloWidth:1.4},"indoor-name":{color:"#31363f",haloColor:"#f1f2f4",haloWidth:1.4},"building-entrance":{haloColor:"#f1f2f4"}},sky:{skyColor:"#5675b3",horizonColor:"#b1b4b9",fogRange:[2.39,9.64],fogIntensity:.87,spaceColor:"#0a0b0c",atmosphereColor:"#557dce",starIntensity:.45}};var Vi={name:"\u041C\u0430\u0442\u043E\u0432\u0430\u044F",background:"#e7e6e4",light:{ambientColor:"#f5f5f5",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dce6ec",fillIntensity:.18},paint:{"landcover-wood":{color:"#a3be9d"},"landcover-grass":{color:"#b3cbae"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d6dce0"},"landcover-wetland":{color:"#acd4d7"},"landuse-residential":{color:"#ecebe9"},"landuse-industrial":{color:"#d1d4e0"},"landuse-civic":{color:"#e7d0d7"},"landuse-sport":{color:"#b6d2a7"},"landuse-cemetery":{color:"#b5dcad"},"landuse-parking":{color:"#d8d6d4"},park:{color:"#b3cbae"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#a6bbc9"},waterway:{color:"#a6bbc9"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#969fb0"},"road-casing-secondary":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-casing-minor":{color:{stops:[[16,"#abb0ba"],[18.5,"#969fb0"]]}},"road-rail":{color:"#adadad"},"road-path":{color:"#c7cad1"},"road-minor":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-secondary":{color:{stops:[[16,"#c7cad1"],[18.5,"#aeb4c2"]]}},"road-ramp":{color:"#aeb4c2"},"road-major":{color:"#aeb4c2"},boundary:{color:"#ca919f"},building:{color:"#dad6d2",roofColor:"#e3e0dd",aoStrength:.19,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f0f0f2",windowGlow:0},housenumber:{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},poi:{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"road-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"poi-food":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f6f5f4",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f6f5f4",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b3c6d2"},"indoor-shell":{color:"#e6e3e1",opacity:.97},"indoor-corridor":{color:"#eae8e6"},"indoor-room":{color:"#dfdcd8"},"indoor-service":{color:"#cdc8c2"},"indoor-shop":{color:"#d1c8da"},"indoor-food":{color:"#dad1c8"},"indoor-wc":{color:"#c8d3da"},"indoor-wall":{color:"#bebab6",roofColor:"#d1cecc",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#bbb3cd",opacity:.95},"indoor-door":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-poi":{color:"#707a8f",haloColor:"#f6f5f4",haloWidth:1.4},"indoor-name":{color:"#4d4742",haloColor:"#f6f5f4",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f6f5f4"}},sky:{skyColor:"#83abc5",horizonColor:"#d3d2d0",fogRange:[2.41,9.87],fogIntensity:.86,spaceColor:"#0d0c0b",atmosphereColor:"#5ba1cf",starIntensity:.4}};var Di={name:"\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u0438\u0437\u043C",background:"#f7f7f7",light:{ambientColor:"#fcfcfc",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee7ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#d6e1d6"},"landcover-grass":{color:"#e1eae1"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#edf0f2"},"landcover-wetland":{color:"#e3f1f2"},"landuse-residential":{color:"#fafafa"},"landuse-industrial":{color:"#e7e8ef"},"landuse-civic":{color:"#f3e7eb"},"landuse-sport":{color:"#e1edde"},"landuse-cemetery":{color:"#e6f4e6"},"landuse-parking":{color:"#e9e7e7"},park:{color:"#e1eae1"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#d7e2ea"},waterway:{color:"#d7e2ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#a3a3a3"},"road-casing-secondary":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-casing-minor":{color:{stops:[[16,"#b8b8b8"],[18.5,"#a3a3a3"]]}},"road-rail":{color:"#b3b3b3"},"road-path":{color:"#d1d1d1"},"road-minor":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-secondary":{color:{stops:[[16,"#d1d1d1"],[18.5,"#bdbdbd"]]}},"road-ramp":{color:"#bdbdbd"},"road-major":{color:"#bdbdbd"},boundary:{color:"#999999"},building:{color:"#ebebeb",roofColor:"#f2f2f2",aoStrength:.18,tintVariation:.06,windowColor:"#9fb0c0",windowFrameColor:"#f4f4f6",windowGlow:0},housenumber:{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4,frameColor:"#737373",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#e8eff4"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#737373",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#404040",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#564e4e",haloColor:"#ffffff"}},sky:{skyColor:"#a4c0d4",horizonColor:"#e6e6e6",fogRange:[2.43,10.04],fogIntensity:.85,spaceColor:"#0d0d0d",atmosphereColor:"#5fa1d1",starIntensity:.37}};var Gi={name:"\u041E\u043A\u0435\u0430\u043D",background:"#d7e3ea",light:{ambientColor:"#f3f4f4",ambientIntensity:.47,keyAzimuth:120,keyAltitude:60,keyColor:"#e8f6ff",keyIntensity:.59,fillAzimuth:300,fillAltitude:25,fillColor:"#d8e4ea",fillIntensity:.18},paint:{"landcover-wood":{color:"#75c7c7"},"landcover-grass":{color:"#97d8d2"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#accedf"},"landcover-wetland":{color:"#a5d0d4"},"landuse-residential":{color:"#dfe8ec"},"landuse-industrial":{color:"#cbcedc"},"landuse-civic":{color:"#e3c9d2"},"landuse-sport":{color:"#90dfcb"},"landuse-cemetery":{color:"#a6d9d4"},"landuse-parking":{color:"#cfd2d3"},park:{color:"#97d8d2"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#30abe8"},waterway:{color:"#3eb0ea"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#47a3c2"},"road-casing-secondary":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-casing-minor":{color:{stops:[[16,"#8ab2c7"],[18.5,"#47a3c2"]]}},"road-rail":{color:"#8a9ea8"},"road-path":{color:"#b8d3e0"},"road-minor":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-secondary":{color:{stops:[[16,"#b8d3e0"],[18.5,"#79c0d8"]]}},"road-ramp":{color:"#79c0d8"},"road-major":{color:"#79c0d8"},boundary:{color:"#47bad1"},building:{color:"#d2dee4",roofColor:"#e7f0f3",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#e6f0f6",windowGlow:0},housenumber:{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},poi:{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"road-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"poi-food":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f8fbfc",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f8fbfc",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#38b3f1"},"indoor-shell":{color:"#e5e9eb",opacity:.97},"indoor-corridor":{color:"#eaeeef"},"indoor-room":{color:"#dce2e5"},"indoor-service":{color:"#c6cfd4"},"indoor-shop":{color:"#d6cede"},"indoor-food":{color:"#ded6ce"},"indoor-wc":{color:"#ced8de"},"indoor-wall":{color:"#bac1c4",roofColor:"#d0d4d6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#c1b9d1",opacity:.95},"indoor-door":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-poi":{color:"#3b7b9b",haloColor:"#f8fbfc",haloWidth:1.4},"indoor-name":{color:"#1f3c51",haloColor:"#f8fbfc",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#f8fbfc"}},sky:{skyColor:"#7aaac1",horizonColor:"#c1cfd6",fogRange:[2.41,9.82],fogIntensity:.86,spaceColor:"#080d0f",atmosphereColor:"#5aa8cf",starIntensity:.41}};var Ni={name:"\u041F\u0440\u0435\u043C\u0438\u0443\u043C",background:"#211f1c",model3dKey:"night",light:{ambientColor:"#b0aaa4",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c8b48a",keyIntensity:.3,fillAzimuth:300,fillAltitude:25,fillColor:"#496887",fillIntensity:.22},paint:{"landcover-wood":{color:"#1b271b"},"landcover-grass":{color:"#232f23"},"landcover-sand":{color:"#393622"},"landcover-ice":{color:"#2d3d4c"},"landcover-wetland":{color:"#213436"},"landuse-residential":{color:"#272421"},"landuse-industrial":{color:"#242633"},"landuse-civic":{color:"#332429"},"landuse-sport":{color:"#22331f"},"landuse-cemetery":{color:"#213021"},"landuse-parking":{color:"#383633"},park:{color:"#232f23"},"aeroway-area":{color:"#272a35"},water:{color:"#16293b"},waterway:{color:"#1c334a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#856e32"},"road-casing-secondary":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-casing-minor":{color:{stops:[[16,"#423b2e"],[18.5,"#856e32"]]}},"road-rail":{color:"#6b6457"},"road-path":{color:"#5e5645"},"road-minor":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-secondary":{color:{stops:[[16,"#5e5645"],[18.5,"#bf9e4a"]]}},"road-ramp":{color:"#bf9e4a"},"road-major":{color:"#bf9e4a"},boundary:{color:"#d1aa47"},building:{color:"#443b2c",roofColor:"#726037",aoStrength:.29,tintVariation:.1,windowColor:"#8fb8e8",windowFrameColor:"#eef0f4",windowGlow:.36},housenumber:{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},poi:{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"road-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#181410",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#181410",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#181410",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#181410",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#181410",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#181410",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#181410",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#181410",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#181410",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#181410",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#1c3752"},"indoor-shell":{color:"#564b39",opacity:.97},"indoor-corridor":{color:"#504635"},"indoor-room":{color:"#605440"},"indoor-service":{color:"#7b6c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#857a68",roofColor:"#9a9285",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-poi":{color:"#d4bb7d",haloColor:"#181410",haloWidth:1.4},"indoor-name":{color:"#eae3d7",haloColor:"#181410",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#181410"}},sky:{skyColor:"#09121b",horizonColor:"#2c2a27",fogRange:[2.34,8.79],fogIntensity:.9,spaceColor:"#060606",atmosphereColor:"#3679b9",starIntensity:.79}};var Ui={name:"\u0420\u0435\u0430\u043B\u0438\u0441\u0442\u0438\u0447\u043D\u0430\u044F",background:"#d6dac8",light:{ambientColor:"#eeeeed",ambientIntensity:.46,keyAzimuth:120,keyAltitude:59,keyColor:"#fff0d8",keyIntensity:.57,fillAzimuth:300,fillAltitude:25,fillColor:"#cbd9e3",fillIntensity:.18},paint:{"landcover-wood":{color:"#62a63f"},"landcover-grass":{color:"#8dbf69"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#b4c9d7"},"landcover-wetland":{color:"#75b7bd"},"landuse-residential":{color:"#d6d1c2"},"landuse-industrial":{color:"#b9bdd0"},"landuse-civic":{color:"#d9b5c1"},"landuse-sport":{color:"#8bc95e"},"landuse-cemetery":{color:"#95c374"},"landuse-parking":{color:"#c3c5bf"},park:{color:"#8dbf69"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#4d97cb"},waterway:{color:"#599ecf"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#856b47"},"road-casing-secondary":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-casing-minor":{color:{stops:[[16,"#766b60"],[18.5,"#856b47"]]}},"road-rail":{color:"#666666"},"road-path":{color:"#9c948b"},"road-minor":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-secondary":{color:{stops:[[16,"#9c948b"],[18.5,"#ccaa66"]]}},"road-ramp":{color:"#ccaa66"},"road-major":{color:"#ccaa66"},boundary:{color:"#8a735c"},building:{color:"#cdc4b7",roofColor:"#cdc4b7",aoStrength:.2,tintVariation:.07,windowColor:"#9fb0c0",windowFrameColor:"#eceef2",windowGlow:0},housenumber:{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},poi:{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"road-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"poi-food":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#f5f5f0",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#f5f5f0",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#559fd3"},"indoor-shell":{color:"#d6d0c9",opacity:.97},"indoor-corridor":{color:"#dad5ce"},"indoor-room":{color:"#cfc9c0"},"indoor-service":{color:"#beb6a9"},"indoor-shop":{color:"#bdb0ca"},"indoor-food":{color:"#cabeb0"},"indoor-wc":{color:"#b0c0ca"},"indoor-wall":{color:"#ada79e",roofColor:"#bfbbb6",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#a69bbd",opacity:.95},"indoor-door":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-poi":{color:"#735c45",haloColor:"#f5f5f0",haloWidth:1.4},"indoor-name":{color:"#3b332b",haloColor:"#f5f5f0",haloWidth:1.4},"building-entrance":{haloColor:"#f5f5f0"}},sky:{skyColor:"#5f92b7",horizonColor:"#bfc4b1",fogRange:[2.39,9.68],fogIntensity:.87,spaceColor:"#0d0e09",atmosphereColor:"#569dce",starIntensity:.44}};var ji={name:"\u041A\u043E\u0441\u043C\u043E\u0441",background:"#0c0a1a",model3dKey:"night",light:{ambientColor:"#8c7fcb",ambientIntensity:.34,keyAzimuth:120,keyAltitude:55,keyColor:"#c0a8ff",keyIntensity:.28,fillAzimuth:300,fillAltitude:25,fillColor:"#475385",fillIntensity:.22},paint:{"landcover-wood":{color:"#241730"},"landcover-grass":{color:"#2e203c"},"landcover-sand":{color:"#292719"},"landcover-ice":{color:"#2e365b"},"landcover-wetland":{color:"#172526"},"landuse-residential":{color:"#110e20"},"landuse-industrial":{color:"#191b24"},"landuse-civic":{color:"#24191d"},"landuse-sport":{color:"#281c40"},"landuse-cemetery":{color:"#1c1721"},"landuse-parking":{color:"#27272b"},park:{color:"#2e203c"},"aeroway-area":{color:"#1c1f26"},water:{color:"#121c49"},waterway:{color:"#16225a"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#7e279b"},"road-casing-secondary":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-casing-minor":{color:{stops:[[16,"#3a2060"],[18.5,"#7e279b"]]}},"road-rail":{color:"#985298"},"road-path":{color:"#6b35b6"},"road-minor":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-secondary":{color:{stops:[[16,"#6b35b6"],[18.5,"#bf4ce6"]]}},"road-ramp":{color:"#bf4ce6"},"road-major":{color:"#bf4ce6"},boundary:{color:"#ec51b8"},building:{color:"#2a2145",roofColor:"#7f30a6",aoStrength:.29,tintVariation:.1,windowColor:"#84dcff",windowFrameColor:"#9fb0d8",windowGlow:.5},housenumber:{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},poi:{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"road-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#080614",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#080614",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#080614",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#080614",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#080614",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#080614",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#080614",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#080614",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#080614",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#080614",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#152466"},"indoor-shell":{color:"#403956",opacity:.97},"indoor-corridor":{color:"#3c3550"},"indoor-room":{color:"#484060"},"indoor-service":{color:"#5c527b"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#6f6885",roofColor:"#8a859a",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-poi":{color:"#d186ea",haloColor:"#080614",haloWidth:1.4},"indoor-name":{color:"#dbd1f0",haloColor:"#080614",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#080614"}},sky:{skyColor:"#080b18",horizonColor:"#1d1931",fogRange:[2.34,8.77],fogIntensity:.9,spaceColor:"#040308",atmosphereColor:"#354cb6",starIntensity:.82}};var Xi={name:"\u0412\u0443\u043B\u043A\u0430\u043D",background:"#29211e",model3dKey:"night",light:{ambientColor:"#b6a6a1",ambientIntensity:.35,keyAzimuth:120,keyAltitude:55,keyColor:"#ffb070",keyIntensity:.29,fillAzimuth:300,fillAltitude:25,fillColor:"#8b604b",fillIntensity:.22},paint:{"landcover-wood":{color:"#31241c"},"landcover-grass":{color:"#392e22"},"landcover-sand":{color:"#403c26"},"landcover-ice":{color:"#aa6b4b"},"landcover-wetland":{color:"#243b3d"},"landuse-residential":{color:"#2f2623"},"landuse-industrial":{color:"#282b39"},"landuse-civic":{color:"#39282e"},"landuse-sport":{color:"#3e2e1e"},"landuse-cemetery":{color:"#362e26"},"landuse-parking":{color:"#3e3938"},park:{color:"#392e22"},"aeroway-area":{color:"#2b2f3b"},water:{color:"#8b3f18"},waterway:{color:"#9c461c"},"aeroway-line":{color:"#55493a"},"road-casing-major":{color:"#aa350e"},"road-casing-secondary":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-casing-minor":{color:{stops:[[16,"#712b14"],[18.5,"#aa350e"]]}},"road-rail":{color:"#8f583d"},"road-path":{color:"#e65e19"},"road-minor":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-secondary":{color:{stops:[[16,"#e65e19"],[18.5,"#f98c1f"]]}},"road-ramp":{color:"#f98c1f"},"road-major":{color:"#f98c1f"},boundary:{color:"#f48c25"},building:{color:"#422b24",roofColor:"#c1551f",aoStrength:.28,tintVariation:.09,windowColor:"#84dcff",windowFrameColor:"#d8b0a0",windowGlow:.5},housenumber:{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},poi:{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"road-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"water-label":{color:"#9fbcd1",haloColor:"#131b20",haloWidth:1.4},"place-label":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"poi-food":{color:"#d89964",haloColor:"#150b09",haloWidth:1.4,frameColor:"#d89964",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-shop":{color:"#699cd4",haloColor:"#150b09",haloWidth:1.4,frameColor:"#699cd4",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-transport":{color:"#75acc8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#75acc8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-health":{color:"#ca7272",haloColor:"#150b09",haloWidth:1.4,frameColor:"#ca7272",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-education":{color:"#81bbb7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#81bbb7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-culture":{color:"#a684b8",haloColor:"#150b09",haloWidth:1.4,frameColor:"#a684b8",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-sport":{color:"#89bb81",haloColor:"#150b09",haloWidth:1.4,frameColor:"#89bb81",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-lodging":{color:"#8e79c3",haloColor:"#150b09",haloWidth:1.4,frameColor:"#8e79c3",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"poi-service":{color:"#959ea7",haloColor:"#150b09",haloWidth:1.4,frameColor:"#959ea7",frameOpacity:1,frameHaloColor:"#150b09",iconColor:"#1b1b1b",iconHaloWidth:0},"water-pool":{color:"#c2531a"},"indoor-shell":{color:"#564039",opacity:.97},"indoor-corridor":{color:"#503b35"},"indoor-room":{color:"#604840"},"indoor-service":{color:"#7b5c52"},"indoor-shop":{color:"#5c4672"},"indoor-food":{color:"#725d46"},"indoor-wc":{color:"#466172"},"indoor-wall":{color:"#856f68",roofColor:"#9a8a85",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#66558a",opacity:.95},"indoor-door":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-poi":{color:"#f09e4c",haloColor:"#150b09",haloWidth:1.4},"indoor-name":{color:"#f3e0ce",haloColor:"#150b09",haloWidth:1.4},"building-entrance":{color:"#79a0d7",haloColor:"#150b09"}},sky:{skyColor:"#1c100a",horizonColor:"#312a27",fogRange:[2.34,8.8],fogIntensity:.9,spaceColor:"#070605",atmosphereColor:"#ba6336",starIntensity:.78}};var Yi={name:"\u0411\u0435\u043B\u0430\u044F",background:"#f5f1f0",light:{ambientColor:"#fafafa",ambientIntensity:.48,keyAzimuth:120,keyAltitude:60,keyColor:"#ffffff",keyIntensity:.6,fillAzimuth:300,fillAltitude:25,fillColor:"#dee8ed",fillIntensity:.18},paint:{"landcover-wood":{color:"#a7e2a2"},"landcover-grass":{color:"#b8ebad"},"landcover-sand":{color:"#efeac8"},"landcover-ice":{color:"#d7eaf4"},"landcover-wetland":{color:"#c1dee1"},"landuse-residential":{color:"#f6f4f4"},"landuse-industrial":{color:"#e0e2eb"},"landuse-civic":{color:"#efe1e6"},"landuse-sport":{color:"#c0f0a8"},"landuse-cemetery":{color:"#c8e5c2"},"landuse-parking":{color:"#e4e2e2"},park:{color:"#b8ebad"},"aeroway-area":{color:"#d6dbeb"},water:{color:"#99ddff"},waterway:{color:"#99ddff"},"aeroway-line":{color:"#f0ede9"},"road-casing-major":{color:"#94a0b8"},"road-casing-secondary":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-casing-minor":{color:{stops:[[16,"#a3adc2"],[18.5,"#94a0b8"]]}},"road-rail":{color:"#a6a6a6"},"road-path":{color:"#bfc6d9"},"road-minor":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-secondary":{color:{stops:[[16,"#bfc6d9"],[18.5,"#a1b0c4"]]}},"road-ramp":{color:"#a1b0c4"},"road-major":{color:"#a1b0c4"},boundary:{color:"#f87797"},building:{color:"#ffffff",roofColor:"#ffffff",aoStrength:.19,tintVariation:.06,windowColor:"#6b9ed1",windowFrameColor:"#ffffff",windowGlow:0},housenumber:{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},poi:{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"road-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"water-label":{color:"#35688d",haloColor:"#f7f7f7",haloWidth:1.4},"place-label":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"poi-food":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c2681c",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-shop":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#2f77c4",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-transport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3b82a6",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-health":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#c24444",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-education":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#3f7f7a",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-culture":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#8b5aa5",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-sport":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#4f8b45",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-lodging":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#7a5fbf",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"poi-service":{haloColor:"#ffffff",haloWidth:1.4,frameColor:"#59636e",frameOpacity:1,frameHaloColor:"#ffffff",iconColor:"#ffffff",iconHaloWidth:0},"water-pool":{color:"#b1e5ff"},"indoor-shell":{color:"#f7f7f7",opacity:.97},"indoor-corridor":{color:"#fbfbfb"},"indoor-room":{color:"#efefef"},"indoor-service":{color:"#dbdbdb"},"indoor-shop":{color:"#e4dfea"},"indoor-food":{color:"#eae4df"},"indoor-wc":{color:"#dfe5ea"},"indoor-wall":{color:"#cdcdcd",roofColor:"#e2e2e2",aoStrength:0,facadeDetail:0,tintVariation:0,roofVariation:0},"indoor-transportation":{color:"#d0cbdc",opacity:.95},"indoor-door":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-poi":{color:"#586e84",haloColor:"#ffffff",haloWidth:1.4},"indoor-name":{color:"#262626",haloColor:"#ffffff",haloWidth:1.4},"building-entrance":{color:"#225aaa",haloColor:"#ffffff"}},sky:{skyColor:"#9bbecf",horizonColor:"#e5dfdc",fogRange:[2.43,9.99],fogIntensity:.85,spaceColor:"#0f0c0a",atmosphereColor:"#5eaad0",starIntensity:.38}};var Ki={"3d":Ei,cartoon:ki,cyberpunk:Ai,dawn:Li,dusk:Ii,earth:Fi,future:Ri,"glass-refined":zi,glass:Pi,"harmony-black":Hi,"harmony-blue":Oi,"harmony-green":Wi,lunar:Bi,matte:Vi,minimal:Di,ocean:Gi,premium:Ni,realistic:Ui,space:ji,volcano:Xi,white:Yi};function _o(i,e){let t=new Set(e.hidden??[]),o=i.layers.map(r=>{let n=e.paint?.[r.id],a={...r,paint:n?{...r.paint,...n}:{...r.paint}};return t.has(r.id)&&(a.visible=false),a});if(e.paint)for(let r of Object.keys(e.paint))i.layers.some(n=>n.id===r)||console.warn(`[osmgl] \u0442\u0435\u043C\u0430 \xAB${e.name}\xBB: \u0432 \u0431\u0430\u0437\u043E\u0432\u043E\u043C \u0441\u0442\u0438\u043B\u0435 \u043D\u0435\u0442 \u0441\u043B\u043E\u044F \xAB${r}\xBB`);return {...i,name:e.name,background:e.background??i.background,light:{...i.light,...e.light},sky:{...i.sky,...e.sky},model3dKey:e.model3dKey??i.model3dKey,layers:o}}var K="base",$i="\u241F",He=(i,e)=>i+"\u241F"+String(e);var dt=class{constructor(e=xr){this.splitValues={};this.spec=e,this.light={...wr,...e.light??{}},this.sky={...vr,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return ce(this.spec.background??"#eceae4")}colorAt(e,t,o=[1,0,1,1]){let n=e.paint?.color;if(n&&typeof n=="object"&&"from"in n){let l=this.layers.find(f=>f.id===n.from)?.paint?.color,s=ke(l,t,o),c=1-Math.min(Math.max(n.darken??0,0),1);return [s[0]*c,s[1]*c,s[2]*c,s[3]]}return ke(n,t,o)}layerVisibleAt(e,t){return !(e.visible===false||e.minzoom!==void 0&&t<e.minzoom||e.maxzoom!==void 0&&t>=e.maxzoom)}workerPlan(e=K){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??K)===e).map(t=>({id:t.id,type:t.type,sourceLayer:t["source-layer"],filter:t.filter,minzoom:t.minzoom??0,maxzoom:t.maxzoom??24,...t.splitBy?{splitBy:t.splitBy}:{},...t.type==="line"&&t.network?{network:t.network}:{},...t.cornerRadius?{cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments}:{},...t.clipToTile?{clipToTile:true}:{},...t.groundBy?{groundBy:t.groundBy}:{},...t.type==="surface"?{elevation:t.elevation,base:t.base,bevel:t.bevel,bevelDrop:t.bevelDrop,weld:t.weld}:{},...t.type==="line"&&typeof t.paint?.elevation=="number"&&t.paint.elevation>0?{ground:true}:{},...t.type==="symbol"?{textField:t.layout?.textField,iconImage:t.layout?.iconImage,iconRotate:t.layout?.iconRotate,textPlacement:t.layout?.textPlacement,abbreviate:t.layout?.abbreviate}:{}}))}usedSources(){return [...new Set(this.layers.map(e=>e.source??K))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:He(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},xr=wi,cc=xi,fc=_i,uc=Ci,ht={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:Si,mono:Mi,pale:Ti,...Ki};function Co(i,e=xr){if(typeof i!="string")return _o(e,i);if(i==="day")return e;let t=ht[i];return t?_o(e,t):(console.warn(`[osmgl] \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u0430\u044F \u0442\u0435\u043C\u0430 \xAB${i}\xBB; \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B: ${Object.keys(ht).join(", ")}`),e)}var Rt=class{constructor(e,t){this.ctx=e;let o=e.gl;this._size=t;let r=o.createTexture(),n=o.createFramebuffer();if(!r||!n)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B");this.texture=r,this.framebuffer=n,e.bindTexture(7,r),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_MODE,o.COMPARE_REF_TO_TEXTURE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_COMPARE_FUNC,o.LEQUAL),this.allocate(t),o.bindFramebuffer(o.FRAMEBUFFER,n),o.framebufferTexture2D(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.TEXTURE_2D,r,0),o.drawBuffers([o.NONE]),o.readBuffer(o.NONE);let a=o.checkFramebufferStatus(o.FRAMEBUFFER);if(o.bindFramebuffer(o.FRAMEBUFFER,null),e.bindTexture(7,null),a!==o.FRAMEBUFFER_COMPLETE)throw new Error(`[osmgl] \u0446\u0435\u043B\u044C \u0433\u043B\u0443\u0431\u0438\u043D\u044B \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0430\u0441\u044C: 0x${a.toString(16)}`)}get size(){return this._size}resize(e){e!==this._size&&(this._size=e,this.ctx.bindTexture(7,this.texture),this.allocate(e),this.ctx.bindTexture(7,null));}bind(){let e=this.ctx.gl;this.ctx.bindFramebuffer(this.framebuffer),this.ctx.viewport(0,0,this._size,this._size),this.ctx.setDepthTest(true),this.ctx.setDepthMask(true),e.clear(e.DEPTH_BUFFER_BIT);}bindTexture(e){this.ctx.bindTexture(e,this.texture);}allocate(e){let t=this.ctx.gl;t.texImage2D(t.TEXTURE_2D,0,t.DEPTH_COMPONENT24,e,e,0,t.DEPTH_COMPONENT,t.UNSIGNED_INT,null);}destroy(){this.ctx.gl.deleteFramebuffer(this.framebuffer),this.ctx.gl.deleteTexture(this.texture);}};function qi(i){let e=i.gl,t=e.createTexture();if(!t)throw new Error("[osmgl] \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043E\u0437\u0434\u0430\u0442\u044C \u0437\u0430\u0433\u043B\u0443\u0448\u043A\u0443 \u043A\u0430\u0440\u0442\u044B \u0442\u0435\u043D\u0435\u0439");return i.bindTexture(7,t),e.texImage2D(e.TEXTURE_2D,0,e.DEPTH_COMPONENT24,1,1,0,e.DEPTH_COMPONENT,e.UNSIGNED_INT,new Uint32Array([4294967295])),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_MODE,e.COMPARE_REF_TO_TEXTURE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_COMPARE_FUNC,e.LEQUAL),i.bindTexture(7,null),t}var zt=`
9
9
  uniform vec3 u_ambient_color;
10
10
  uniform float u_ambient_intensity;
11
11
  uniform vec3 u_key_dir; // \u043A\u0443\u0434\u0430 \u043B\u0435\u0442\u0438\u0442 \u0441\u0432\u0435\u0442 \u043A\u043B\u044E\u0447\u0435\u0432\u043E\u0433\u043E \u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A\u0430
@@ -68,7 +68,7 @@ vec3 applyLightWithFactor(vec3 albedo, vec3 normal, float keyFactor) {
68
68
  vec3 applyLight(vec3 albedo, vec3 normal) {
69
69
  return applyLightWithFactor(albedo, normal, max(dot(normal, -u_key_dir), 0.0));
70
70
  }
71
- `,Co=`
71
+ `,So=`
72
72
  // \u0423 \u0441\u0440\u0430\u0432\u043D\u0438\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u0441\u044D\u043C\u043F\u043B\u0435\u0440\u0430 \u0432 GLSL ES 3.00 \u041D\u0415\u0422 \u0442\u043E\u0447\u043D\u043E\u0441\u0442\u0438 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E (\u0432 \u043E\u0442\u043B\u0438\u0447\u0438\u0435
73
73
  // \u043E\u0442 \u043E\u0431\u044B\u0447\u043D\u043E\u0433\u043E sampler2D \u0432\u043E \u0444\u0440\u0430\u0433\u043C\u0435\u043D\u0442\u0435) \u2014 \u0431\u0435\u0437 \u044D\u0442\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u0438 \u0448\u0435\u0439\u0434\u0435\u0440 \u043D\u0435 \u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u0443\u0435\u0442\u0441\u044F.
74
74
  precision highp sampler2DShadow;
@@ -129,7 +129,7 @@ float shadowOcclusion(float ndotl) {
129
129
 
130
130
  return (1.0 - lit * 0.25) * u_shadow_params.x;
131
131
  }
132
- `,wr=`
132
+ `,_r=`
133
133
  uniform int u_material; // 0 \u2014 \u043D\u0435\u0442, 1 \u0432\u043E\u0434\u0430, 2 \u0437\u0435\u043B\u0435\u043D\u044C, 3 \u043F\u0435\u0441\u043E\u043A, 4 \u0430\u0441\u0444\u0430\u043B\u044C\u0442
134
134
  uniform vec4 u_material_params; // x: \u0441\u0438\u043B\u0430, y: \u043C\u0430\u0441\u0448\u0442\u0430\u0431 (\u043C), z: \u0441\u043A\u043E\u0440\u043E\u0441\u0442\u044C, w: \u0432\u0440\u0435\u043C\u044F (\u0441)
135
135
 
@@ -238,7 +238,36 @@ vec3 applyMaterial(vec3 color, vec2 world) {
238
238
 
239
239
  return mix(color, shaded, strength);
240
240
  }
241
- `,Yi=`
241
+ `,Zi=`
242
+ uniform vec3 u_globe_sun; // \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u041D\u0410 \u0441\u043E\u043B\u043D\u0446\u0435 \u0432 \u0442\u0435\u0445 \u0436\u0435 \u043E\u0441\u044F\u0445, \u0447\u0442\u043E \u0438 \u043D\u043E\u0440\u043C\u0430\u043B\u044C \u0448\u0430\u0440\u0430
243
+ uniform vec2 u_globe_light; // x: \u0441\u0438\u043B\u0430 \u0441\u043E\u043B\u043D\u0435\u0447\u043D\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u044B, y: \u0437\u0430\u0442\u0435\u043C\u043D\u0435\u043D\u0438\u0435 \u043A \u043A\u0440\u0430\u044E \u0434\u0438\u0441\u043A\u0430
244
+
245
+ /**
246
+ * \u041D\u043E\u0440\u043C\u0430\u043B\u044C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0439 \u0442\u043E\u0447\u043A\u0438, \u043F\u043E\u0441\u0447\u0438\u0442\u0430\u043D\u043D\u043E\u0439 globeLocal. \u041D\u0443\u0436\u043D\u0430 \u043E\u0441\u0432\u0435\u0449\u0435\u043D\u0438\u044E: \u0441\u0447\u0438\u0442\u0430\u0442\u044C \u0435\u0451 \u0432\u0442\u043E\u0440\u043E\u0439 \u0440\u0430\u0437
247
+ * \u0437\u043D\u0430\u0447\u0438\u043B\u043E \u0431\u044B \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u0432\u0435\u0441\u044C \u043F\u0435\u0440\u0435\u0432\u043E\u0434 \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440\u0430 \u0432 \u0441\u0444\u0435\u0440\u0443.
248
+ */
249
+ vec3 g_globe_normal = vec3(0.0, 0.0, 1.0);
250
+
251
+ /**
252
+ * \u0421\u0412\u0415\u0422 \u0428\u0410\u0420\u0410. \u041F\u043B\u043E\u0441\u043A\u0438\u0439 \u0434\u0438\u0441\u043A \u043D\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043F\u043B\u0430\u043D\u0435\u0442\u043E\u0439, \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0435\u0433\u043E \u043D\u0438 \u043A\u0440\u0430\u0441\u044C: \u043A\u0440\u0443\u0433\u043B\u044B\u043C \u0435\u0433\u043E \u0434\u0435\u043B\u0430\u0435\u0442 \u043D\u0435
253
+ * \u0441\u0438\u043B\u0443\u044D\u0442, \u0430 \u0442\u043E, \u043A\u0430\u043A \u043F\u043E \u043D\u0435\u043C\u0443 \u043B\u043E\u0436\u0438\u0442\u0441\u044F \u0441\u0432\u0435\u0442.
254
+ *
255
+ * \u0414\u0432\u0435 \u0441\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0449\u0438\u0435. \u0421\u043E\u043B\u043D\u0435\u0447\u043D\u0430\u044F \u0441\u0442\u043E\u0440\u043E\u043D\u0430 \u0441\u0432\u0435\u0442\u043B\u0435\u0435 \u0442\u0435\u043D\u0435\u0432\u043E\u0439 \u2014 \u043D\u043E \u0411\u0415\u0417 \u0442\u0435\u0440\u043C\u0438\u043D\u0430\u0442\u043E\u0440\u0430: \u043A\u0430\u0440\u0442\u0430 \u043E\u0431\u044F\u0437\u0430\u043D\u0430
256
+ * \u0447\u0438\u0442\u0430\u0442\u044C\u0441\u044F \u0438 \u043D\u0430 \u043D\u043E\u0447\u043D\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u0435, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043F\u0435\u0440\u0435\u043F\u0430\u0434 \u043C\u044F\u0433\u043A\u0438\u0439 \u0438 \u043D\u0438\u043A\u043E\u0433\u0434\u0430 \u043D\u0435 \u0443\u0445\u043E\u0434\u0438\u0442 \u0432 \u0442\u0435\u043C\u043D\u043E\u0442\u0443. \u0418 \u043A\u0440\u0430\u0439
257
+ * \u0434\u0438\u0441\u043A\u0430 \u0442\u0435\u043C\u043D\u0435\u0435 \u0441\u0435\u0440\u0435\u0434\u0438\u043D\u044B: \u0443 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0433\u043E \u0448\u0430\u0440\u0430 \u043B\u0443\u0447 \u0442\u0430\u043C \u0438\u0434\u0451\u0442 \u043F\u043E \u043A\u0430\u0441\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0439.
258
+ *
259
+ * \u041E\u0434\u043D\u0430 \u0444\u0443\u043D\u043A\u0446\u0438\u044F \u043D\u0430 \u0432\u0441\u0435\u0445, \u043A\u0442\u043E \u0440\u0438\u0441\u0443\u0435\u0442 \u043D\u0430 \u0441\u0444\u0435\u0440\u0435, \u2014 \u0438\u043D\u0430\u0447\u0435 \u0442\u0435\u043B\u043E \u043F\u043B\u0430\u043D\u0435\u0442\u044B \u043E\u043A\u0430\u0436\u0435\u0442\u0441\u044F \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u044B\u043C, \u0430 \u043E\u043A\u0435\u0430\u043D
260
+ * \u043D\u0430 \u043D\u0451\u043C \u043F\u043B\u043E\u0441\u043A\u0438\u043C.
261
+ */
262
+ float globeShade() {
263
+ float lit = dot(g_globe_normal, u_globe_sun);
264
+ float sun = mix(1.0 - u_globe_light.x, 1.0 + u_globe_light.x * 0.35, smoothstep(-0.45, 0.65, lit));
265
+ float limb = mix(1.0 - u_globe_light.y, 1.0, pow(clamp(g_globe_normal.z, 0.0, 1.0), 0.35));
266
+ return sun * limb;
267
+ }
268
+
269
+ `,Cr=`
270
+ ${Zi}
242
271
  uniform vec4 u_globe; // x: \u0432\u043A\u043B, y: \u0434\u043E\u043B\u044F \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u044B, z: \u0440\u0430\u0434\u0438\u0443\u0441, w: worldSize
243
272
  uniform vec2 u_globe_center; // \u0446\u0435\u043D\u0442\u0440 \u043A\u0430\u0440\u0442\u044B \u0432 \u043D\u043E\u0440\u043C\u0430\u043B\u0438\u0437\u043E\u0432\u0430\u043D\u043D\u043E\u043C \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440\u0435
244
273
  uniform vec4 u_globe_cam; // xyz: \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043D\u0430 \u043A\u0430\u043C\u0435\u0440\u0443 \u043E\u0442 \u0446\u0435\u043D\u0442\u0440\u0430 \u0448\u0430\u0440\u0430, w: \u043A\u043E\u0441\u0438\u043D\u0443\u0441 \u0443\u0433\u043B\u0430 \u0434\u043E \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430
@@ -258,6 +287,7 @@ vec3 globeLocal(vec2 tilePos) {
258
287
  float cosLat = cos(lat);
259
288
  vec3 unit = vec3(cosLat * sin(lng), -sin(lat), cosLat * cos(lng));
260
289
  vec3 nl = u_globe_basis * unit;
290
+ g_globe_normal = nl;
261
291
 
262
292
  // \u0422\u043E\u0447\u043A\u0443 \u0417\u0410 \u0413\u041E\u0420\u0418\u0417\u041E\u041D\u0422\u041E\u041C \u043F\u0440\u0438\u0436\u0438\u043C\u0430\u0435\u043C \u043A \u0435\u0433\u043E \u043B\u0438\u043D\u0438\u0438, \u0430 \u043D\u0435 \u0432\u044B\u0431\u0440\u0430\u0441\u044B\u0432\u0430\u0435\u043C.
263
293
  //
@@ -291,9 +321,11 @@ vec3 globeLocal(vec2 tilePos) {
291
321
 
292
322
  return mix(sphere, flat_pos, u_globe.y);
293
323
  }
294
- `,Ki=`#version 300 es
324
+ `,Qi=`#version 300 es
295
325
  precision highp float;
296
326
 
327
+ ${Zi}
328
+
297
329
  in vec2 a_lnglat; // \u0440\u0430\u0434\u0438\u0430\u043D\u044B: \u0434\u043E\u043B\u0433\u043E\u0442\u0430, \u0448\u0438\u0440\u043E\u0442\u0430
298
330
 
299
331
  uniform mat4 u_matrix; // \u043A\u0430\u043C\u0435\u0440\u0430 \u0434\u043B\u044F \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u044B\u0445 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442
@@ -301,6 +333,7 @@ uniform mat3 u_globe_basis;
301
333
  uniform vec4 u_globe; // z: \u0440\u0430\u0434\u0438\u0443\u0441
302
334
 
303
335
  out float v_rim;
336
+ out float v_shade;
304
337
 
305
338
  void main() {
306
339
  float cosLat = cos(a_lnglat.y);
@@ -314,11 +347,16 @@ void main() {
314
347
  // \u0432 \u0442\u043E\u0447\u043A\u0435 \u043F\u043E\u0434 \u043A\u0430\u043C\u0435\u0440\u043E\u0439 \u043E\u043D\u0430 \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u0432\u0432\u0435\u0440\u0445, \u0443 \u043A\u0440\u0430\u044F \u0434\u0438\u0441\u043A\u0430 \u2014 \u0432\u0431\u043E\u043A.
315
348
  vec3 n = u_globe_basis * unit;
316
349
  v_rim = 1.0 - clamp(n.z, 0.0, 1.0);
350
+ // \u0421\u0432\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0422\u041E\u0419 \u0416\u0415 \u0444\u0443\u043D\u043A\u0446\u0438\u0435\u0439, \u0447\u0442\u043E \u0443 \u0437\u0430\u043B\u0438\u0432\u043E\u043A \u043D\u0430 \u0441\u0444\u0435\u0440\u0435: \u0438\u043D\u0430\u0447\u0435 \u0442\u0435\u043B\u043E \u043F\u043B\u0430\u043D\u0435\u0442\u044B \u043E\u043A\u0430\u0436\u0435\u0442\u0441\u044F
351
+ // \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u044B\u043C, \u0430 \u043E\u043A\u0435\u0430\u043D \u043D\u0430 \u043D\u0451\u043C \u043F\u043B\u043E\u0441\u043A\u0438\u043C.
352
+ g_globe_normal = n;
353
+ v_shade = globeShade();
317
354
  }
318
- `,$i=`#version 300 es
355
+ `,Ji=`#version 300 es
319
356
  precision highp float;
320
357
 
321
358
  in float v_rim;
359
+ in float v_shade;
322
360
  uniform vec3 u_body_color;
323
361
  uniform vec3 u_atmo_color;
324
362
  uniform float u_atmo_strength;
@@ -329,19 +367,20 @@ void main() {
329
367
  // \u041A\u0430\u0439\u043C\u0430 \u043D\u0430\u0440\u0430\u0441\u0442\u0430\u0435\u0442 \u043A\u0440\u0443\u0442\u043E: \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043D\u0435 \u0434\u0438\u0441\u043A\u0430 \u0435\u0451 \u0431\u044B\u0442\u044C \u043D\u0435 \u0434\u043E\u043B\u0436\u043D\u043E \u0432\u043E\u0432\u0441\u0435, \u0438\u043D\u0430\u0447\u0435
330
368
  // \u043F\u043B\u0430\u043D\u0435\u0442\u0430 \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u043F\u043E\u0434\u0441\u0432\u0435\u0447\u0435\u043D\u043D\u043E\u0439 \u0438\u0437\u043D\u0443\u0442\u0440\u0438.
331
369
  float rim = pow(v_rim, 6.0) * u_atmo_strength;
332
- fragColor = vec4(mix(u_body_color, u_atmo_color, clamp(rim, 0.0, 1.0)), 1.0);
370
+ vec3 body = u_body_color * v_shade;
371
+ fragColor = vec4(mix(body, u_atmo_color, clamp(rim, 0.0, 1.0)), 1.0);
333
372
  }
334
- `,qi=`#version 300 es
373
+ `,ea=`#version 300 es
335
374
  precision highp float;
336
375
  in vec2 a_pos; // 0..1, \u043E\u0431\u0449\u0438\u0439 \u043A\u0432\u0430\u0434\u0440\u0430\u0442
337
376
  uniform float u_center_depth; // NDC-\u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u0446\u0435\u043D\u0442\u0440\u0430 \u0448\u0430\u0440\u0430
338
377
  void main() {
339
378
  gl_Position = vec4(a_pos * 2.0 - 1.0, u_center_depth, 1.0);
340
379
  }
341
- `,Zi=`#version 300 es
380
+ `,ta=`#version 300 es
342
381
  precision highp float;
343
382
  void main() {}
344
- `,Qi=`#version 300 es
383
+ `,oa=`#version 300 es
345
384
  precision highp float;
346
385
  in vec2 a_pos; // \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430 \xD7 8, \u043A\u0430\u043A \u0443 \u0437\u0434\u0430\u043D\u0438\u0439 (BUILDING_POS_SCALE)
347
386
  in float a_height; // \u043C\u0435\u0442\u0440\u044B \xD7 32, \u043A\u0430\u043A \u0443 \u0437\u0434\u0430\u043D\u0438\u0439 (BUILDING_HEIGHT_SCALE)
@@ -350,12 +389,41 @@ uniform float u_height_scale;
350
389
  void main() {
351
390
  gl_Position = u_matrix * vec4(a_pos / 8.0, (a_height / 32.0) * u_height_scale, 1.0);
352
391
  }
353
- `,xr=`#version 300 es
392
+ `,Sr=`#version 300 es
354
393
  precision highp float;
355
394
  void main() {}
356
- `,je=`
395
+ `,ra=`
396
+ uniform vec3 u_cam_ray; // x: \u043D\u0430\u043A\u043B\u043E\u043D \u043E\u0441\u0438 \u043A\u0430\u043C\u0435\u0440\u044B \u043D\u0430\u0434 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C (\u0440\u0430\u0434), y: \u0444\u043E\u043A\u0443\u0441 (\u043F\u0438\u043A\u0441\u0435\u043B\u0438 \u0431\u0443\u0444\u0435\u0440\u0430), z: Y \u0446\u0435\u043D\u0442\u0440\u0430 \u043A\u0430\u0434\u0440\u0430 \u0441\u043D\u0438\u0437\u0443
397
+ uniform float u_haze_exp; // \u043F\u043E\u043A\u0430\u0437\u0430\u0442\u0435\u043B\u044C \u043F\u043E\u043B\u043E\u0441\u044B \u043C\u0433\u043B\u044B: \u0431\u043E\u043B\u044C\u0448\u0435 \u2014 \u0443\u0436\u0435 \u043F\u043E\u043B\u043E\u0441\u0430
398
+
399
+ /** \u0421\u0438\u043D\u0443\u0441 \u0443\u0433\u043B\u0430 \u043F\u043E\u0434\u044A\u0451\u043C\u0430 \u043B\u0443\u0447\u0430, \u0438\u0434\u0443\u0449\u0435\u0433\u043E \u0447\u0435\u0440\u0435\u0437 \u044D\u0442\u043E\u0442 \u043F\u0438\u043A\u0441\u0435\u043B\u044C. */
400
+ float rayElevSin() {
401
+ return sin(u_cam_ray.x + atan((gl_FragCoord.y - u_cam_ray.z) / max(u_cam_ray.y, 1.0)));
402
+ }
403
+
404
+ /** \u0412\u043E\u0437\u0434\u0443\u0448\u043D\u0430\u044F \u043C\u0430\u0441\u0441\u0430 \u043F\u043E \u041A\u0430\u0441\u0442\u0435\u043D\u0443\u2013\u042F\u043D\u0433\u0443: 1 \u0432 \u0437\u0435\u043D\u0438\u0442\u0435, \u043E\u043A\u043E\u043B\u043E 38 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430. */
405
+ float airMass(float sinE) {
406
+ float deg = degrees(asin(clamp(sinE, -1.0, 1.0)));
407
+ return 1.0 / (max(sinE, 0.0) + 0.15 * pow(max(93.885 - deg, 1.0), -1.253));
408
+ }
409
+
410
+ /** \u0414\u043E\u043B\u044F \u043C\u0433\u043B\u044B: 0 \u0432 \u0437\u0435\u043D\u0438\u0442\u0435, \u043F\u043E\u0447\u0442\u0438 1 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430. */
411
+ float hazeMix(float sinE) {
412
+ return pow(clamp(1.0 - 1.0 / airMass(sinE), 0.0, 1.0), u_haze_exp);
413
+ }
414
+ `,Xe=`
415
+ ${ra}
357
416
  uniform vec3 u_fog_color;
358
417
  uniform vec3 u_fog_range; // x: \u043D\u0430\u0447\u0430\u043B\u043E, y: \u043A\u043E\u043D\u0435\u0446 (\u043C\u0438\u0440\u043E\u0432\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438), z: \u043F\u0440\u0435\u0434\u0435\u043B \u0441\u0438\u043B\u044B
418
+ /** \u0412\u0435\u0440\u0442\u0438\u043A\u0430\u043B\u044C\u043D\u044B\u0439 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D \u0434\u044B\u043C\u043A\u0438 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445: \u0433\u0434\u0435 \u043E\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442 \u043E\u0442\u043F\u0443\u0441\u043A\u0430\u0442\u044C \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u044E \u0438 \u0433\u0434\u0435 \u043E\u0442\u043F\u0443\u0441\u043A\u0430\u0435\u0442 \u0441\u043E\u0432\u0441\u0435\u043C. */
419
+ uniform vec2 u_fog_vertical;
420
+
421
+ /*
422
+ * \u0414\u042B\u041C\u041A\u0410 \u0421\u041B\u0410\u0411\u0415\u0415\u0422, \u0427\u0415\u041C \u0412\u042B\u0428\u0415 \u0421\u041C\u041E\u0422\u0420\u0418\u0422 \u041B\u0423\u0427. \u0422\u043E\u043B\u0449\u0430 \u0432\u043E\u0437\u0434\u0443\u0445\u0430 \u043D\u0430 \u043B\u0443\u0447\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043D\u0435 \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0442 \u0440\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u044F:
423
+ * \u0432\u0434\u043E\u043B\u044C \u0437\u0435\u043C\u043B\u0438 \u0435\u0451 \u043A\u0438\u043B\u043E\u043C\u0435\u0442\u0440\u044B, \u0430 \u0432\u0432\u0435\u0440\u0445 \u2014 \u0441\u0447\u0438\u0442\u0430\u043D\u043D\u044B\u0435 \u0441\u043E\u0442\u043D\u0438 \u043C\u0435\u0442\u0440\u043E\u0432. \u0411\u0435\u0437 \u044D\u0442\u043E\u0433\u043E \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044F \u0434\u0430\u043B\u0451\u043A\u0430\u044F \u043A\u0440\u044B\u0448\u0430
424
+ * \u0432\u044B\u0446\u0432\u0435\u0442\u0430\u043B\u0430 \u0440\u043E\u0432\u043D\u043E \u043A\u0430\u043A \u0437\u0435\u043C\u043B\u044F \u043F\u043E\u0434 \u043D\u0435\u0439, \u0438 \u0434\u0430\u043B\u044C\u043D\u0438\u0439 \u043F\u043B\u0430\u043D \u0432\u044B\u0445\u043E\u0434\u0438\u043B \u0440\u0430\u0432\u043D\u043E\u043C\u0435\u0440\u043D\u043E\u0439 \u0437\u0430\u043B\u0438\u0432\u043A\u043E\u0439. \u041C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u2014
425
+ * \u0442\u0430 \u0436\u0435 \u0434\u043E\u043B\u044F \u043C\u0433\u043B\u044B, \u0447\u0442\u043E \u043A\u0440\u0430\u0441\u0438\u0442 \u043D\u0435\u0431\u043E (hazeMix), \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u0434\u044B\u043C\u043A\u0430 \u0438 \u043D\u0435\u0431\u043E \u043F\u0440\u0438\u0445\u043E\u0434\u044F\u0442 \u0432 \u043E\u0434\u0438\u043D \u0446\u0432\u0435\u0442.
426
+ */
359
427
 
360
428
  float fogAmount() {
361
429
  if (u_fog_range.z <= 0.001) return 0.0;
@@ -364,7 +432,24 @@ float fogAmount() {
364
432
  if (t <= 0.0) return 0.0;
365
433
  float falloff = 1.0 - min(1.0, exp(-6.0 * t));
366
434
  falloff *= falloff * falloff;
367
- return min(falloff, 1.0) * u_fog_range.z;
435
+ return min(falloff, 1.0) * u_fog_range.z * hazeMix(rayElevSin());
436
+ }
437
+
438
+ /**
439
+ * \u0414\u044B\u043C\u043A\u0430 \u0441 \u0443\u0447\u0451\u0442\u043E\u043C \u0412\u042B\u0421\u041E\u0422\u042B \u0442\u043E\u0447\u043A\u0438 \u043D\u0430\u0434 \u0437\u0435\u043C\u043B\u0451\u0439.
440
+ *
441
+ * \u041C\u0433\u043B\u0430 \u043B\u0435\u0436\u0438\u0442 \u0441\u043B\u043E\u0435\u043C \u0443 \u0437\u0435\u043C\u043B\u0438, \u0438 \u0431\u0430\u0448\u043D\u044F \u0438\u0437 \u043D\u0435\u0451 \u0432\u044B\u0445\u043E\u0434\u0438\u0442: \u043D\u0438\u0437 \u0442\u0435\u0440\u044F\u0435\u0442\u0441\u044F, \u0432\u0435\u0440\u0445 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0447\u0438\u0441\u0442\u044B\u043C. \u0420\u043E\u0432\u043D\u043E
442
+ * \u0432\u044B\u0446\u0432\u0435\u0442\u0448\u0430\u044F \u043F\u043E \u0432\u0441\u0435\u0439 \u0432\u044B\u0441\u043E\u0442\u0435 \u0431\u0430\u0448\u043D\u044F \u2014 \u043F\u0435\u0440\u0432\u043E\u0435, \u0447\u0442\u043E \u0432\u044B\u0434\u0430\u0451\u0442 \u043D\u0430\u0440\u0438\u0441\u043E\u0432\u0430\u043D\u043D\u0443\u044E \u0434\u044B\u043C\u043A\u0443.
443
+ *
444
+ * \u041F\u0440\u0435\u0434\u0435\u043B \u043D\u0435 \u0434\u0430\u0451\u0442 \u0432\u044B\u0441\u043E\u043A\u043E\u043C\u0443 \u0434\u043E\u043C\u0443 \u0432\u044B\u043F\u0440\u044B\u0433\u043D\u0443\u0442\u044C \u0438\u0437 \u041F\u041E\u041B\u041D\u041E\u0421\u0422\u042C\u042E \u0437\u0430\u0442\u044F\u043D\u0443\u0442\u043E\u0439 \u0434\u0430\u043B\u0438: \u0442\u0430\u043C \u043D\u0435\u0442 \u0443\u0436\u0435 \u043D\u0438\u0447\u0435\u0433\u043E, \u0438\u0437 \u0447\u0435\u0433\u043E
445
+ * \u043E\u043D \u043C\u043E\u0433 \u0431\u044B \u043F\u0440\u043E\u0441\u0442\u0443\u043F\u0438\u0442\u044C, \u0438 \u0447\u0438\u0441\u0442\u0430\u044F \u043A\u0440\u044B\u0448\u0430 \u043F\u043E\u0441\u0440\u0435\u0434\u0438 \u0431\u0435\u043B\u0438\u0437\u043D\u044B \u0447\u0438\u0442\u0430\u043B\u0430\u0441\u044C \u0431\u044B \u0432\u044B\u0440\u0435\u0437\u0430\u043D\u043D\u043E\u0439 \u043D\u0430\u043A\u043B\u0435\u0439\u043A\u043E\u0439.
446
+ */
447
+ float fogAmountAt(float heightMeters) {
448
+ float f = fogAmount();
449
+ if (u_fog_vertical.y <= u_fog_vertical.x) return f;
450
+ float up = smoothstep(u_fog_vertical.x, u_fog_vertical.y, heightMeters);
451
+ float limit = 1.0 - smoothstep(0.9, 1.0, f);
452
+ return f * (1.0 - min(up, limit));
368
453
  }
369
454
 
370
455
  /** \u0426\u0432\u0435\u0442 \u0443\u0436\u0435 premultiplied \u2014 \u0446\u0432\u0435\u0442 \u0434\u044B\u043C\u043A\u0438 \u0434\u043E\u043C\u043D\u043E\u0436\u0430\u0435\u043C \u043D\u0430 \u0442\u0443 \u0436\u0435 \u0430\u043B\u044C\u0444\u0443. */
@@ -376,7 +461,11 @@ vec4 applyFogPremultiplied(vec4 color) {
376
461
  vec3 applyFog(vec3 color) {
377
462
  return mix(color, u_fog_color, fogAmount());
378
463
  }
379
- `,Ji=`#version 300 es
464
+
465
+ vec3 applyFogAt(vec3 color, float heightMeters) {
466
+ return mix(color, u_fog_color, fogAmountAt(heightMeters));
467
+ }
468
+ `,na=`#version 300 es
380
469
  precision highp float;
381
470
 
382
471
  in vec3 a_pos;
@@ -449,7 +538,7 @@ void main() {
449
538
  // \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043E\u043D\u0430 \u0436\u0435 \u0433\u043E\u0434\u0438\u0442\u0441\u044F \u0438 \u0434\u043B\u044F \u0432\u0435\u043A\u0442\u043E\u0440\u0430 \u0432\u0437\u0433\u043B\u044F\u0434\u0430.
450
539
  v_view = u_normal_matrix * (u_camera_model - a_pos);
451
540
  }
452
- `,ea=`#version 300 es
541
+ `,ia=`#version 300 es
453
542
  precision highp float;
454
543
 
455
544
  in vec3 a_pos;
@@ -513,12 +602,12 @@ void main() {
513
602
  v_nmodel = a_normal;
514
603
  v_view = n * (u_camera_model - a_pos);
515
604
  }
516
- `,_r=`#version 300 es
605
+ `,Mr=`#version 300 es
517
606
  precision highp float;
518
607
 
519
- ${Rt}
520
- ${Co}
521
- ${je}
608
+ ${zt}
609
+ ${So}
610
+ ${Xe}
522
611
 
523
612
  in vec3 v_normal;
524
613
  in vec2 v_tex;
@@ -797,14 +886,14 @@ void main() {
797
886
  float alpha = albedo.a * u_opacity;
798
887
  fragColor = vec4(applyFog(color) * alpha, alpha);
799
888
  }
800
- `,ta=`#version 300 es
889
+ `,aa=`#version 300 es
801
890
  precision highp float;
802
891
  in vec3 a_pos;
803
892
  uniform mat4 u_matrix;
804
893
  void main() {
805
894
  gl_Position = u_matrix * vec4(a_pos, 1.0);
806
895
  }
807
- `,oa=`#version 300 es
896
+ `,la=`#version 300 es
808
897
  precision highp float;
809
898
  in vec2 a_pos; // 0..1, \u0442\u043E\u0442 \u0436\u0435 \u043A\u0432\u0430\u0434\u0440\u0430\u0442, \u0447\u0442\u043E \u0443 \u0442\u0435\u043D\u0438 \u043D\u0430 \u0437\u0435\u043C\u043B\u0435
810
899
 
@@ -823,7 +912,7 @@ void main() {
823
912
  v_ray = mix(mix(u_ray_bl, u_ray_br, a_pos.x), mix(u_ray_tl, u_ray_tr, a_pos.x), a_pos.y);
824
913
  gl_Position = vec4(a_pos * 2.0 - 1.0, 0.999, 1.0);
825
914
  }
826
- `,ra=`#version 300 es
915
+ `,sa=`#version 300 es
827
916
  precision highp float;
828
917
 
829
918
  in vec2 v_uv;
@@ -831,7 +920,20 @@ in vec3 v_ray;
831
920
 
832
921
  uniform vec3 u_sky_color;
833
922
  uniform vec3 u_horizon_color;
834
- uniform vec3 u_sky_params; // x: Y \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 (\u0441\u043D\u0438\u0437\u0443), y: \u0448\u0438\u0440\u0438\u043D\u0430 \u043F\u0435\u0440\u0435\u0445\u043E\u0434\u0430 \u0432\u0432\u0435\u0440\u0445, z: \u043F\u043E\u043B\u043E\u0441\u0430 \u0434\u044B\u043C\u043A\u0438 \u0432\u043D\u0438\u0437
923
+ uniform vec3 u_high_color; // \u0432\u0435\u0440\u0445\u043D\u044F\u044F \u0430\u0442\u043C\u043E\u0441\u0444\u0435\u0440\u0430: \u0432\u044B\u0448\u0435 \u0432\u043E\u0437\u0434\u0443\u0445\u0430 \u043C\u0435\u043D\u044C\u0448\u0435 \u0438 \u0441\u0438\u043D\u044C \u0433\u043B\u0443\u0431\u0436\u0435
924
+ /** x: Y \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 (\u0441\u043D\u0438\u0437\u0443), y: \u043D\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F, z: \u043F\u043E\u043B\u043E\u0441\u0430 \u0440\u0430\u0441\u0442\u0432\u043E\u0440\u0435\u043D\u0438\u044F \u041F\u041E\u0414 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C. */
925
+ uniform vec3 u_sky_params;
926
+ /** \u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u041D\u0410 \u0441\u043E\u043B\u043D\u0446\u0435 \u0432 \u043C\u0438\u0440\u043E\u0432\u044B\u0445 \u043E\u0441\u044F\u0445, \u0435\u0433\u043E \u0446\u0432\u0435\u0442 \u0438 \u0441\u0438\u043B\u0430 \u043F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0438 \u0432 \u043D\u0435\u0431\u0435. */
927
+ uniform vec3 u_sun_dir;
928
+ uniform vec3 u_sun_color;
929
+ uniform float u_sun_glow;
930
+ /** \u0411\u0430\u0437\u0438\u0441 \u043A\u0430\u043C\u0435\u0440\u044B \u0432 \u043C\u0438\u0440\u043E\u0432\u044B\u0445 \u043E\u0441\u044F\u0445: \u043F\u043E \u043D\u0435\u043C\u0443 \u0438\u0437 \u043F\u0438\u043A\u0441\u0435\u043B\u044F \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u043B\u0443\u0447 (\u0441\u043C. Transform.cameraRay). */
931
+ uniform vec3 u_cam_right;
932
+ uniform vec3 u_cam_up;
933
+ uniform vec3 u_cam_fwd;
934
+ uniform vec2 u_cam_center; // \u0446\u0435\u043D\u0442\u0440 \u043A\u0430\u0434\u0440\u0430 \u0432 \u043F\u0438\u043A\u0441\u0435\u043B\u044F\u0445 \u0431\u0443\u0444\u0435\u0440\u0430
935
+
936
+ ${ra}
835
937
 
836
938
  // \u041A\u043E\u0441\u043C\u043E\u0441: \u0432\u043A\u043B\u044E\u0447\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u0433\u043B\u043E\u0431\u0443\u0441\u0435.
837
939
  uniform vec3 u_space_color;
@@ -874,10 +976,53 @@ float stars(vec3 dir) {
874
976
 
875
977
  void main() {
876
978
  float above = gl_FragCoord.y - u_sky_params.x;
877
- // \u041D\u0438\u0436\u0435 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u2014 \u0447\u0438\u0441\u0442\u044B\u0439 \u0446\u0432\u0435\u0442 \u0434\u044B\u043C\u043A\u0438; \u0432\u044B\u0448\u0435 \u2014 \u043F\u043B\u0430\u0432\u043D\u044B\u0439 \u043F\u0435\u0440\u0435\u0445\u043E\u0434 \u043A \u0437\u0435\u043D\u0438\u0442\u0443.
878
- float t = clamp(above / max(u_sky_params.y, 1.0), 0.0, 1.0);
879
- // \u041A\u0432\u0430\u0434\u0440\u0430\u0442: \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u043F\u043E\u043B\u043E\u0441\u0430 \u0441\u0432\u0435\u0442\u043B\u0435\u0435 \u0438 \u0443\u0436\u0435, \u043A\u0430\u043A \u0432 \u0436\u0438\u0437\u043D\u0438
880
- vec3 sky = mix(u_horizon_color, u_sky_color, t * t);
979
+
980
+ /*
981
+ * \u041D\u0415\u0411\u041E \u2014 \u0422\u0420\u0418 \u0417\u041E\u041D\u042B, \u0430 \u043D\u0435 \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0446\u0432\u0435\u0442\u043E\u0432.
982
+ *
983
+ * \u0421\u043D\u0438\u0437\u0443 \u0432\u0432\u0435\u0440\u0445: \u043C\u0433\u043B\u0430 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 (\u0442\u043E\u0442 \u0436\u0435 \u0446\u0432\u0435\u0442, \u0432 \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0443\u0445\u043E\u0434\u0438\u0442 \u0434\u0430\u043B\u044C\u043D\u044F\u044F \u0437\u0435\u043C\u043B\u044F), \u043D\u0430\u0434 \u043D\u0435\u0439 \u043E\u0442\u043A\u0440\u044B\u0442\u043E\u0435
984
+ * \u043D\u0435\u0431\u043E, \u0435\u0449\u0451 \u0432\u044B\u0448\u0435 \u2014 \u0432\u0435\u0440\u0445\u043D\u044F\u044F \u0430\u0442\u043C\u043E\u0441\u0444\u0435\u0440\u0430, \u0433\u0434\u0435 \u0432\u043E\u0437\u0434\u0443\u0445\u0430 \u043C\u0435\u043D\u044C\u0448\u0435 \u0438 \u0441\u0438\u043D\u044C \u0433\u043B\u0443\u0431\u0436\u0435. \u0414\u0432\u0443\u0445 \u0446\u0432\u0435\u0442\u043E\u0432 \u043D\u0430 \u044D\u0442\u043E \u043D\u0435
985
+ * \u0445\u0432\u0430\u0442\u0430\u0435\u0442: \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u0440\u043E\u0432\u043D\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430, \u043F\u043E \u043A\u043E\u0442\u043E\u0440\u043E\u0439 \u043D\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043D\u0438 \u0442\u043E\u043B\u0449\u0430 \u0432\u043E\u0437\u0434\u0443\u0445\u0430, \u043D\u0438 \u0432\u044B\u0441\u043E\u0442\u0430.
986
+ *
987
+ * \u041C\u0433\u043B\u0430 \u043F\u043E\u0434\u043C\u0435\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0413\u0410\u0423\u0421\u0421\u041E\u041C \u043F\u043E \u043F\u0440\u0435\u0432\u044B\u0448\u0435\u043D\u0438\u044E \u043D\u0430\u0434 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C \u2014 \u0442\u043E\u0439 \u0436\u0435 \u0444\u0443\u043D\u043A\u0446\u0438\u0435\u0439 \u0438 \u043E\u0442 \u0442\u043E\u0439 \u0436\u0435
988
+ * \u0432\u0435\u043B\u0438\u0447\u0438\u043D\u044B, \u0447\u0442\u043E \u0438 \u0434\u044B\u043C\u043A\u0430 \u043D\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 (\u0441\u043C. fogHorizon \u0432 \u0431\u043B\u043E\u043A\u0435 FOG). \u0421\u043E\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u0435 \u0444\u0443\u043D\u043A\u0446\u0438\u0439 \u0438 \u0434\u0435\u043B\u0430\u0435\u0442
989
+ * \u0441\u0442\u044B\u043A \u043D\u0435\u0432\u0438\u0434\u0438\u043C\u044B\u043C: \u0434\u0430\u043B\u044C\u043D\u0438\u0439 \u0434\u043E\u043C \u0438 \u043D\u0435\u0431\u043E \u0437\u0430 \u043D\u0438\u043C \u043F\u0440\u0438\u0445\u043E\u0434\u044F\u0442 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u0432 \u043E\u0434\u0438\u043D \u0446\u0432\u0435\u0442.
990
+ */
991
+ /*
992
+ * \u041B\u0443\u0447 \u0447\u0435\u0440\u0435\u0437 \u044D\u0442\u043E\u0442 \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u2014 \u0432 \u043C\u0438\u0440\u043E\u0432\u044B\u0445 \u043E\u0441\u044F\u0445. \u041D\u0435\u0431\u043E \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043E\u0442 \u043D\u0435\u0433\u043E, \u0430 \u043D\u0435 \u043E\u0442 \u044D\u043A\u0440\u0430\u043D\u043D\u043E\u0439 \u0432\u044B\u0441\u043E\u0442\u044B:
993
+ * \u0442\u043E\u043B\u044C\u043A\u043E \u043F\u043E \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u043C\u0443 \u0443\u0433\u043B\u0443 \u043F\u043E\u0434\u044A\u0451\u043C\u0430 \u043F\u043E\u043B\u0443\u0447\u0430\u0435\u0442\u0441\u044F \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0430\u044F \u0432\u043E\u0437\u0434\u0443\u0448\u043D\u0430\u044F \u043C\u0430\u0441\u0441\u0430 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430.
994
+ */
995
+ vec3 dir = normalize(u_cam_fwd * u_cam_ray.y
996
+ + u_cam_right * (gl_FragCoord.x - u_cam_center.x)
997
+ + u_cam_up * (gl_FragCoord.y - u_cam_center.y));
998
+ float sinE = dir.z;
999
+
1000
+ /*
1001
+ * \u0413\u0420\u0410\u0414\u0418\u0415\u041D\u0422 \u0421\u0416\u0410\u0422 \u0412 \u0412\u0418\u0414\u0418\u041C\u0423\u042E \u041F\u041E\u041B\u041E\u0421\u0423 \u041D\u0415\u0411\u0410, \u0430 \u043D\u0435 \u0440\u0430\u0437\u043B\u043E\u0436\u0435\u043D \u043F\u043E \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u043C \u0443\u0433\u043B\u0430\u043C.
1002
+ *
1003
+ * \u041D\u0430\u043A\u043B\u043E\u043D \u043A\u0430\u043C\u0435\u0440\u044B \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D 75\xB0, \u0438 \u043D\u0430\u0434 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u043E\u043C \u0432 \u043A\u0430\u0434\u0440 \u043F\u043E\u043F\u0430\u0434\u0430\u0435\u0442 \u0432\u0441\u0435\u0433\u043E \u0442\u0440\u0438 \u0441 \u043F\u043E\u043B\u043E\u0432\u0438\u043D\u043E\u0439 \u0433\u0440\u0430\u0434\u0443\u0441\u0430.
1004
+ * \u0412 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u0430\u0442\u043C\u043E\u0441\u0444\u0435\u0440\u0435 \u044D\u0442\u0438 \u0433\u0440\u0430\u0434\u0443\u0441\u044B \u0446\u0435\u043B\u0438\u043A\u043E\u043C \u0437\u0430\u043D\u044F\u0442\u044B \u043C\u0433\u043B\u043E\u0439 \u2014 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438 \u0432\u0435\u0440\u043D\u0430\u044F \u043A\u0440\u0438\u0432\u0430\u044F \u043E\u0441\u0442\u0430\u0432\u0438\u043B\u0430 \u0431\u044B
1005
+ * \u043E\u0442 \u0441\u0438\u043D\u0435\u0432\u044B \u043E\u0434\u043D\u0443 \u0431\u0435\u043B\u0451\u0441\u0443\u044E \u043F\u043E\u043B\u043E\u0441\u0443. \u041F\u043E\u044D\u0442\u043E\u043C\u0443 \u0432\u0441\u044F \u0430\u0442\u043C\u043E\u0441\u0444\u0435\u0440\u0430 \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0432 \u0442\u0443 \u043F\u043E\u043B\u043E\u0441\u0443, \u043A\u043E\u0442\u043E\u0440\u0430\u044F \u0432\u0438\u0434\u043D\u0430:
1006
+ * \u043C\u0433\u043B\u0430 \u0432\u043D\u0438\u0437\u0443, \u043E\u0442\u043A\u0440\u044B\u0442\u043E\u0435 \u043D\u0435\u0431\u043E \u0432\u044B\u0448\u0435, \u0432\u0435\u0440\u0445\u043D\u044F\u044F \u0430\u0442\u043C\u043E\u0441\u0444\u0435\u0440\u0430 \u0443 \u043A\u0440\u043E\u043C\u043A\u0438.
1007
+ *
1008
+ * \u041D\u0430 \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 \u0442\u0430\u043A\u043E\u0439 \u043F\u043E\u0434\u043C\u0435\u043D\u044B \u043D\u0435\u0442: \u0442\u0430\u043C \u0434\u044B\u043C\u043A\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043E\u0442 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0433\u043E \u0443\u0433\u043B\u0430 \u043B\u0443\u0447\u0430 (\u0441\u043C. hazeMix), \u0438
1009
+ * \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u043E\u0431\u0435 \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u0432\u0441\u0451 \u0440\u0430\u0432\u043D\u043E \u0441\u0445\u043E\u0434\u044F\u0442\u0441\u044F \u0432 \u0446\u0432\u0435\u0442\u0435 \u043C\u0433\u043B\u044B.
1010
+ */
1011
+ float up = max(0.0, above) / max(u_sky_params.y, 1.0);
1012
+ vec3 sky = mix(u_sky_color, u_high_color, clamp(up * 0.8, 0.0, 1.0));
1013
+
1014
+ /*
1015
+ * \u041F\u043E\u0434\u0441\u0432\u0435\u0442\u043A\u0430 \u0432\u043E\u043A\u0440\u0443\u0433 \u0441\u043E\u043B\u043D\u0446\u0430 \u2014 \u0440\u0430\u0441\u0441\u0435\u044F\u043D\u0438\u0435 \u0432\u043F\u0435\u0440\u0451\u0434 (\u041C\u0438). \u0418\u043C\u0435\u043D\u043D\u043E \u043E\u043D\u0430 \u043E\u0442\u043B\u0438\u0447\u0430\u0435\u0442 \u043D\u0430\u0440\u0438\u0441\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u043E\u0442
1016
+ * \u043D\u0435\u0431\u0430: \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430 \u0441\u043E \u0441\u0442\u043E\u0440\u043E\u043D\u044B \u0441\u043E\u043B\u043D\u0446\u0430 \u0432\u043E\u0437\u0434\u0443\u0445 \u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044F, \u0441 \u043F\u0440\u043E\u0442\u0438\u0432\u043E\u043F\u043E\u043B\u043E\u0436\u043D\u043E\u0439 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0445\u043E\u043B\u043E\u0434\u043D\u044B\u043C.
1017
+ * \u0424\u0430\u0437\u0430 \u0425\u0435\u043D\u044C\u0438\u2013\u0413\u0440\u0438\u043D\u0448\u0442\u0435\u0439\u043D\u0430, \u0442\u0430 \u0436\u0435, \u0447\u0442\u043E \u0432 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043A\u0438\u0445 \u043C\u043E\u0434\u0435\u043B\u044F\u0445, \u0442\u043E\u043B\u044C\u043A\u043E \u043E\u0434\u0438\u043D \u0447\u043B\u0435\u043D \u0432\u043C\u0435\u0441\u0442\u043E \u0438\u043D\u0442\u0435\u0433\u0440\u0430\u043B\u0430.
1018
+ */
1019
+ float cosT = clamp(dot(dir, u_sun_dir), -1.0, 1.0);
1020
+ float g = 0.76;
1021
+ float phase = (1.0 - g * g) / pow(1.0 + g * g - 2.0 * g * cosT, 1.5);
1022
+ sky += u_sun_color * (u_sun_glow * phase * 0.06);
1023
+
1024
+ // \u041C\u0433\u043B\u0430 \u0443 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430: \u0441\u043F\u0430\u0434 \u0431\u044B\u0441\u0442\u0440\u044B\u0439, \u0438\u043D\u0430\u0447\u0435 \u043E\u043D\u0430 \u0441\u044A\u0435\u0434\u0430\u0435\u0442 \u0432\u0441\u044E \u0432\u0438\u0434\u0438\u043C\u0443\u044E \u043F\u043E\u043B\u043E\u0441\u0443.
1025
+ sky = mix(sky, u_horizon_color, exp(-4.0 * up));
881
1026
 
882
1027
  // \u041D\u0418\u0416\u0415 \u0413\u041E\u0420\u0418\u0417\u041E\u041D\u0422\u0410 \u041D\u0415\u0411\u041E \u0420\u0410\u0421\u0422\u0412\u041E\u0420\u042F\u0415\u0422\u0421\u042F, \u0430 \u043D\u0435 \u0437\u0430\u043B\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0451 \u0434\u044B\u043C\u043A\u043E\u0439.
883
1028
  //
@@ -912,7 +1057,7 @@ void main() {
912
1057
 
913
1058
  fragColor = vec4(sky * alpha, alpha);
914
1059
  }
915
- `,na=`#version 300 es
1060
+ `,ca=`#version 300 es
916
1061
  precision highp float;
917
1062
 
918
1063
  in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
@@ -930,10 +1075,10 @@ void main() {
930
1075
  v_uv = u_uv_transform.xy + a_pos * u_uv_transform.z;
931
1076
  gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
932
1077
  }
933
- `,ia=`#version 300 es
1078
+ `,fa=`#version 300 es
934
1079
  precision highp float;
935
1080
 
936
- ${je}
1081
+ ${Xe}
937
1082
 
938
1083
  in vec2 v_uv;
939
1084
 
@@ -948,7 +1093,7 @@ void main() {
948
1093
  // \u043A\u0430\u043C\u0435\u0440\u0435 \u0434\u0430\u043B\u0451\u043A\u0438\u0439 \u0440\u0430\u0441\u0442\u0440 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u0447\u0451\u0442\u043A\u0438\u043C \u0442\u0430\u043C, \u0433\u0434\u0435 \u0432\u0441\u0451 \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u043E\u0435 \u0443\u0436\u0435 \u0437\u0430\u0442\u044F\u043D\u0443\u0442\u043E.
949
1094
  fragColor = applyFogPremultiplied(vec4(color.rgb * color.a, color.a)) * u_opacity;
950
1095
  }
951
- `,aa=`#version 300 es
1096
+ `,ua=`#version 300 es
952
1097
  precision highp float;
953
1098
  in vec2 a_pos; // \u0443\u0433\u043E\u043B \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0430 \u0442\u0430\u0439\u043B\u0430, 0..1
954
1099
  uniform mat4 u_matrix;
@@ -959,11 +1104,11 @@ void main() {
959
1104
  gl_Position = u_matrix * local;
960
1105
  v_shadow = u_shadow_matrix * local;
961
1106
  }
962
- `,la=`#version 300 es
1107
+ `,da=`#version 300 es
963
1108
  precision highp float;
964
1109
 
965
- ${Co}
966
- ${je}
1110
+ ${So}
1111
+ ${Xe}
967
1112
 
968
1113
  uniform vec3 u_shadow_ground; // \u0432\u043E \u0447\u0442\u043E \u043F\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044F \u043E\u0441\u0432\u0435\u0449\u0451\u043D\u043D\u044B\u0439 \u0446\u0432\u0435\u0442 \u0432 \u0442\u0435\u043D\u0438
969
1114
  uniform float u_ground_ndotl; // \u0441\u0438\u043D\u0443\u0441 \u0432\u044B\u0441\u043E\u0442\u044B \u0441\u043E\u043B\u043D\u0446\u0430: \u0437\u0435\u043C\u043B\u044F \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u0430
@@ -975,10 +1120,10 @@ void main() {
975
1120
  float occlusion = shadowOcclusion(u_ground_ndotl) * (1.0 - fogAmount());
976
1121
  fragColor = vec4(mix(vec3(1.0), u_shadow_ground, occlusion), 1.0);
977
1122
  }
978
- `,sa=`#version 300 es
1123
+ `,ha=`#version 300 es
979
1124
  precision highp float;
980
1125
 
981
- ${Yi}
1126
+ ${Cr}
982
1127
 
983
1128
  in vec2 a_pos;
984
1129
  uniform mat4 u_matrix;
@@ -987,27 +1132,34 @@ uniform float u_meters_per_unit; // \u0435\u0434\u0438\u043D\u0438\u0446\u0430
987
1132
  uniform vec2 u_world_origin;
988
1133
 
989
1134
  out vec2 v_world;
1135
+ /** \u0421\u0432\u0435\u0442 \u0448\u0430\u0440\u0430: \u043D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u0435\u0434\u0438\u043D\u0438\u0446\u0430, \u043D\u0430 \u0441\u0444\u0435\u0440\u0435 \u2014 \u0441\u043E\u043B\u043D\u0446\u0435 \u0438 \u043A\u0440\u0430\u0439 \u0434\u0438\u0441\u043A\u0430 (\u0441\u043C. globeShade). */
1136
+ out float v_globe_shade;
990
1137
 
991
1138
  void main() {
992
1139
  // \u041D\u0430 \u0433\u043B\u043E\u0431\u0443\u0441\u0435 u_matrix \u2014 \u043A\u0430\u043C\u0435\u0440\u0430 \u0434\u043B\u044F \u041B\u041E\u041A\u0410\u041B\u042C\u041D\u042B\u0425 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442, \u043D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u2014
993
1140
  // \u043F\u0440\u0438\u0432\u044B\u0447\u043D\u0430\u044F \u043C\u0430\u0442\u0440\u0438\u0446\u0430 \u0442\u0430\u0439\u043B\u0430. \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u043E\u0434\u043D\u0430 \u043D\u0430 \u0432\u0435\u0441\u044C \u0434\u0432\u0438\u0436\u043E\u043A.
994
- gl_Position = u_globe.x > 0.5
995
- ? u_matrix * vec4(globeLocal(a_pos), 1.0)
996
- : u_matrix * vec4(a_pos, 0.0, 1.0);
1141
+ v_globe_shade = 1.0;
1142
+ if (u_globe.x > 0.5) {
1143
+ gl_Position = u_matrix * vec4(globeLocal(a_pos), 1.0);
1144
+ v_globe_shade = globeShade();
1145
+ } else {
1146
+ gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
1147
+ }
997
1148
 
998
1149
  // \u041D\u0430\u0447\u0430\u043B\u043E \u0442\u0430\u0439\u043B\u0430 \u041E\u0411\u042F\u0417\u0410\u0422\u0415\u041B\u042C\u041D\u041E: \u0431\u0435\u0437 \u043D\u0435\u0433\u043E \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0437\u0430\u043D\u043E\u0432\u043E \u043D\u0430
999
1150
  // \u043A\u0430\u0436\u0434\u043E\u0439 \u0433\u0440\u0430\u043D\u0438\u0446\u0435, \u0438 \u043F\u043E \u0448\u0432\u0430\u043C \u0438\u0434\u0443\u0442 \u043F\u043E\u043B\u043E\u0441\u044B. \u042E\u043D\u0438\u0444\u043E\u0440\u043C \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D \u0431\u044B\u043B, \u0430 \u0432 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0443
1000
1151
  // \u043D\u0435 \u043F\u043E\u043F\u0430\u0434\u0430\u043B \u2014 \u0443 \u043B\u0438\u043D\u0438\u0439 \u0438 \u043F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0435\u0439 \u044D\u0442\u043E \u0441\u0434\u0435\u043B\u0430\u043D\u043E, \u0443 \u0437\u0430\u043B\u0438\u0432\u043A\u0438 \u0437\u0430\u0431\u044B\u043B\u043E\u0441\u044C.
1001
1152
  v_world = u_world_origin + a_pos * u_meters_per_unit;
1002
1153
  }
1003
- `,ca=`#version 300 es
1154
+ `,ma=`#version 300 es
1004
1155
  precision highp float;
1005
1156
 
1006
- ${je}
1007
- ${Rt}
1008
- ${wr}
1157
+ ${Xe}
1158
+ ${zt}
1159
+ ${_r}
1009
1160
 
1010
1161
  in vec2 v_world;
1162
+ in float v_globe_shade;
1011
1163
 
1012
1164
  uniform vec4 u_color;
1013
1165
  out vec4 fragColor;
@@ -1020,12 +1172,14 @@ void main() {
1020
1172
  // \u043F\u0440\u0435\u0436\u043D\u0435\u0439, \u0438\u043D\u0430\u0447\u0435 premultiplied-\u0431\u043B\u0435\u043D\u0434\u0438\u043D\u0433 \u0440\u0430\u0437\u043E\u0448\u0451\u043B\u0441\u044F \u0431\u044B \u0441 \u043D\u0435\u0439.
1021
1173
  vec4 c = u_color;
1022
1174
  if (u_material != 0) c.rgb = applyMaterial(c.rgb, v_world);
1175
+ // \u0421\u0432\u0435\u0442 \u0448\u0430\u0440\u0430. \u041D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u0440\u0430\u0432\u0435\u043D \u0435\u0434\u0438\u043D\u0438\u0446\u0435 \u0438 \u043D\u0435 \u0441\u0442\u043E\u0438\u0442 \u043D\u0438\u0447\u0435\u0433\u043E.
1176
+ c.rgb *= v_globe_shade;
1023
1177
  fragColor = applyFogPremultiplied(c);
1024
1178
  }
1025
- `,fa=`#version 300 es
1179
+ `,pa=`#version 300 es
1026
1180
  precision highp float;
1027
1181
 
1028
- ${Yi}
1182
+ ${Cr}
1029
1183
 
1030
1184
  in vec2 a_p0; // \u043D\u0430\u0447\u0430\u043B\u043E \u043E\u0442\u0440\u0435\u0437\u043A\u0430 (\u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u043E \u0443 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0448\u0438\u043D \u043A\u0430\u043F\u0441\u0443\u043B\u044B)
1031
1185
  in vec2 a_p1; // \u043A\u043E\u043D\u0435\u0446 \u043E\u0442\u0440\u0435\u0437\u043A\u0430
@@ -1143,12 +1297,12 @@ void main() {
1143
1297
  v_dist0 = a_dist * u_tile_to_px;
1144
1298
  v_seg_len = len * u_tile_to_px;
1145
1299
  }
1146
- `,ua=`#version 300 es
1300
+ `,ba=`#version 300 es
1147
1301
  precision highp float;
1148
1302
 
1149
- ${je}
1150
- ${Rt}
1151
- ${wr}
1303
+ ${Xe}
1304
+ ${zt}
1305
+ ${_r}
1152
1306
 
1153
1307
  in vec2 v_pos;
1154
1308
  in vec2 v_p0;
@@ -1411,7 +1565,7 @@ void main() {
1411
1565
  if (alpha <= 0.003) discard;
1412
1566
  fragColor = applyFogPremultiplied(color) * alpha;
1413
1567
  }
1414
- `,ha=`#version 300 es
1568
+ `,ya=`#version 300 es
1415
1569
  precision highp float;
1416
1570
 
1417
1571
  in vec2 a_pos; // \u0442\u043E\u0447\u043A\u0430 \u043E\u0441\u0438, \u043B\u043E\u043A\u0430\u043B\u044C\u043D\u044B\u0439 \u043C\u0435\u0440\u043A\u0430\u0442\u043E\u0440
@@ -1445,10 +1599,10 @@ void main() {
1445
1599
  v_half = u_half_width;
1446
1600
  v_dist = a_dist * u_units_to_px;
1447
1601
  }
1448
- `,da=`#version 300 es
1602
+ `,ga=`#version 300 es
1449
1603
  precision highp float;
1450
1604
 
1451
- ${je}
1605
+ ${Xe}
1452
1606
 
1453
1607
  in float v_side;
1454
1608
  in float v_outset;
@@ -1494,7 +1648,7 @@ void main() {
1494
1648
  if (alpha <= 0.003) discard;
1495
1649
  fragColor = applyFogPremultiplied(color) * alpha;
1496
1650
  }
1497
- `,ma=`#version 300 es
1651
+ `,va=`#version 300 es
1498
1652
  precision highp float;
1499
1653
 
1500
1654
  in vec2 a_pos;
@@ -1510,6 +1664,11 @@ uniform float u_height_scale; // 0..1 \u2014 \u0430\u043D\u0438\u043C\u0430\u0
1510
1664
  uniform mat4 u_shadow_matrix;
1511
1665
  uniform float u_meters_per_unit;
1512
1666
  uniform vec2 u_world_origin; // \u043D\u0430\u0447\u0430\u043B\u043E \u0442\u0430\u0439\u043B\u0430 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445 \u2014 \u0440\u0438\u0441\u0443\u043D\u043E\u043A \u0441\u043A\u0432\u043E\u0437\u043D\u043E\u0439
1667
+ /**
1668
+ * \u041A\u0430\u043C\u0435\u0440\u0430 \u0432 \u043C\u0435\u0442\u0440\u0430\u0445 \u041E\u0422 \u041D\u0410\u0427\u0410\u041B\u0410 \u042D\u0422\u041E\u0413\u041E \u0422\u0410\u0419\u041B\u0410. \u041D\u0435 \u043E\u0442 \u043C\u0438\u0440\u043E\u0432\u043E\u0433\u043E \u043D\u0443\u043B\u044F: \u043C\u0438\u0440\u043E\u0432\u044B\u0435 \u043C\u0435\u0442\u0440\u044B \u0437\u0430\u0432\u043E\u0440\u0430\u0447\u0438\u0432\u0430\u044E\u0442\u0441\u044F
1669
+ * \u043A\u0430\u0436\u0434\u044B\u0435 65 \u043A\u043C, \u0438 \u0440\u0430\u0437\u043D\u043E\u0441\u0442\u044C \u043A\u0430\u043C\u0435\u0440\u044B \u0441 \u0442\u043E\u0447\u043A\u043E\u0439 \u043D\u0430 \u0434\u0440\u0443\u0433\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u0435 \u0432\u0438\u0442\u043A\u0430 \u0443\u0448\u043B\u0430 \u0431\u044B \u0432 \u043C\u0443\u0441\u043E\u0440.
1670
+ */
1671
+ uniform vec3 u_camera_local;
1513
1672
 
1514
1673
  out vec3 v_normal;
1515
1674
  out float v_ao;
@@ -1530,6 +1689,8 @@ out vec2 v_world;
1530
1689
  out float v_up;
1531
1690
  /** \u0413\u0440\u0430\u043D\u044C \u0432 \u043C\u0435\u0442\u0440\u0430\u0445: \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0432\u0434\u043E\u043B\u044C \u043D\u0435\u0451, \u0435\u0451 \u0448\u0438\u0440\u0438\u043D\u0430 \u0438 \u0432\u044B\u0441\u043E\u0442\u0430. */
1532
1691
  out vec3 v_wall;
1692
+ /** \u041E\u0442 \u0442\u043E\u0447\u043A\u0438 \u043A \u043A\u0430\u043C\u0435\u0440\u0435, \u0432 \u043C\u0435\u0442\u0440\u0430\u0445. \u041D\u0443\u0436\u0435\u043D \u043E\u0442\u043A\u043E\u0441\u0430\u043C \u043E\u043A\u043E\u043D: \u043F\u043E \u043D\u0435\u043C\u0443 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043F\u0430\u0440\u0430\u043B\u043B\u0430\u043A\u0441. */
1693
+ out vec3 v_view;
1533
1694
 
1534
1695
  void main() {
1535
1696
  // \u041F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u043F\u0440\u0438\u0445\u043E\u0434\u0438\u0442 \u0432 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445 \u0442\u0430\u0439\u043B\u0430 \xD7 8 (BUILDING_POS_SCALE): \u0446\u0435\u043B\u044B\u0445 \u0435\u0434\u0438\u043D\u0438\u0446 \u043D\u0435 \u0445\u0432\u0430\u0442\u0430\u043B\u043E
@@ -1549,13 +1710,18 @@ void main() {
1549
1710
  // \u041C\u0435\u0442\u0440\u044B \u0438\u0437 Uint16: \u043C\u043D\u043E\u0436\u0438\u0442\u0435\u043B\u044C \u0442\u043E\u0442 \u0436\u0435, \u0447\u0442\u043E \u0443 \u0433\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440\u0430 (BUILDING_HEIGHT_SCALE) \u2014 32 \u0435\u0434\u0438\u043D\u0438\u0446\u044B
1550
1711
  // \u043D\u0430 \u043C\u0435\u0442\u0440, \u0442\u043E \u0435\u0441\u0442\u044C 3 \u0441\u043C. \u0422\u043E\u0447\u043D\u043E\u0441\u0442\u044C \u0437\u0434\u0435\u0441\u044C \u0432\u0430\u0436\u043D\u0430: \u0438\u0437 \u044D\u0442\u043E\u0439 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u044B \u0440\u0430\u0441\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u043E\u043A\u043D\u0430.
1551
1712
  v_wall = a_wall / 32.0;
1713
+ v_view = u_camera_local - vec3(pos * u_meters_per_unit, h);
1552
1714
  }
1553
- `,fc=`
1715
+ `,dc=`
1554
1716
  uniform float u_facade_detail; // 0 \u2014 \u0433\u043B\u0430\u0434\u043A\u0438\u0435 \u0441\u0442\u0435\u043D\u044B, 1 \u2014 \u043F\u043E\u043B\u043D\u044B\u0439 \u0440\u0438\u0441\u0443\u043D\u043E\u043A
1555
1717
  uniform vec3 u_window_color;
1556
1718
  uniform vec3 u_window_frame;
1557
1719
  uniform float u_window_glow; // \u0434\u043E\u043B\u044F \u0441\u0432\u0435\u0442\u044F\u0449\u0438\u0445\u0441\u044F \u043E\u043A\u043E\u043D (\u043D\u043E\u0447\u043D\u044B\u0435 \u0442\u0435\u043C\u044B)
1558
1720
  uniform float u_floor_height; // \u043C\u0435\u0442\u0440\u044B, \u0431\u0430\u0437\u043E\u0432\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u044D\u0442\u0430\u0436\u0430
1721
+ uniform float u_window_recess; // \u043D\u0430 \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043C\u0435\u0442\u0440\u043E\u0432 \u0441\u0442\u0435\u043A\u043B\u043E \u0443\u0442\u043E\u043F\u043B\u0435\u043D\u043E \u043E\u0442 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u0441\u0442\u0435\u043D\u044B
1722
+ uniform float u_window_recess_shade; // \u043D\u0430\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0442\u0451\u043C\u043D\u043E\u0439 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u0442\u0435\u043D\u044C \u043E\u0442\u043A\u043E\u0441\u0430, 0..1
1723
+ uniform float u_plinth_height; // \u043C\u0435\u0442\u0440\u044B, \u043D\u0430 \u043A\u043E\u0442\u043E\u0440\u044B\u0445 \u0446\u043E\u043A\u043E\u043B\u044C\u043D\u043E\u0435 \u0437\u0430\u0442\u0435\u043C\u043D\u0435\u043D\u0438\u0435 \u0441\u0445\u043E\u0434\u0438\u0442 \u043D\u0430 \u043D\u0435\u0442
1724
+ uniform float u_plinth_shade; // \u0441\u0438\u043B\u0430 \u0437\u0430\u0442\u0435\u043C\u043D\u0435\u043D\u0438\u044F \u0443 \u0441\u0430\u043C\u043E\u0439 \u0437\u0435\u043C\u043B\u0438, 0..1
1559
1725
  uniform float u_roof_variation; // \u0440\u0430\u0437\u0431\u0440\u043E\u0441 \u0446\u0432\u0435\u0442\u0430 \u0441\u043A\u0430\u0442\u043D\u044B\u0445 \u043A\u0440\u043E\u0432\u0435\u043B\u044C
1560
1726
 
1561
1727
  float hashNoise(vec2 p) {
@@ -1576,7 +1742,7 @@ float band(float v, float half_, float aa) {
1576
1742
  * \u0441\u0435\u0442\u043A\u043E\u0439, \u043E\u0444\u0438\u0441 \u2014 \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u044B\u043C\u0438 \u043B\u0435\u043D\u0442\u0430\u043C\u0438 \u043E\u0441\u0442\u0435\u043A\u043B\u0435\u043D\u0438\u044F, \u0446\u0435\u0445 \u2014 \u043A\u0440\u0443\u043F\u043D\u044B\u043C\u0438 \u043F\u0430\u043D\u0435\u043B\u044F\u043C\u0438
1577
1743
  * \u0441 \u0440\u0435\u0434\u043A\u0438\u043C\u0438 \u043E\u043A\u043D\u0430\u043C\u0438 \u043F\u043E\u0432\u0435\u0440\u0445\u0443. \u0418\u043C\u0435\u043D\u043D\u043E \u044D\u0442\u043E \u0438 \u043E\u0442\u043B\u0438\u0447\u0430\u0435\u0442 \u0437\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0443 \u043D\u0430 \u0433\u043B\u0430\u0437.
1578
1744
  */
1579
- vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa, out float glow) {
1745
+ vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa, vec2 sunOff, vec2 par, out float glow) {
1580
1746
  float floorH = u_floor_height;
1581
1747
  float stepX = 2.7;
1582
1748
  float winW = 1.5;
@@ -1636,24 +1802,41 @@ vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa,
1636
1802
  */
1637
1803
  float fine = 1.0 - smoothstep(0.05, 0.14, aa);
1638
1804
 
1639
- float win = 0.0;
1640
- float frame = 0.0;
1641
- if (inGrid) {
1642
- win = band(fx, winW * 0.5, aa) * band(fy, winH * 0.5, aa);
1643
- frame = (band(fx, winW * 0.5 + 0.12, aa) * band(fy, winH * 0.5 + 0.12, aa) - win) * fine;
1644
- }
1645
-
1805
+ /*
1806
+ * \u0413\u041B\u0423\u0411\u0418\u041D\u0410 \u041E\u041A\u041D\u0410. \u041C\u0430\u0441\u043A\u0430 win \u2014 \u043E\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0435 \u0432 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u0441\u0442\u0435\u043D\u044B, \u0442\u043E\u0447\u043A\u0430 deep \u2014 \u0442\u0430\u043C, \u0433\u0434\u0435 \u043B\u0443\u0447 \u0432\u0437\u0433\u043B\u044F\u0434\u0430,
1807
+ * \u0432\u043E\u0439\u0434\u044F \u0432 \u044D\u0442\u043E \u043E\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0435, \u0434\u043E\u0445\u043E\u0434\u0438\u0442 \u0434\u043E \u0441\u0442\u0435\u043A\u043B\u0430. \u0421\u0442\u0435\u043A\u043B\u043E \u0432\u0438\u0434\u043D\u043E \u0442\u043E\u043B\u044C\u043A\u043E \u0442\u0430\u043C, \u0433\u0434\u0435 \u043E\u0431\u0435 \u0442\u043E\u0447\u043A\u0438 \u0432\u043D\u0443\u0442\u0440\u0438 \u043F\u0440\u043E\u0451\u043C\u0430; \u0433\u0434\u0435
1808
+ * \u043B\u0443\u0447 \u0443\u0441\u043F\u0435\u043B \u0432\u044B\u0439\u0442\u0438 \u0437\u0430 \u043A\u0440\u0430\u0439 \u2014 \u0432\u0438\u0434\u0435\u043D \u041E\u0422\u041A\u041E\u0421, \u0431\u043E\u043A\u043E\u0432\u0430\u044F \u0441\u0442\u0435\u043D\u043A\u0430 \u043D\u0438\u0448\u0438. \u041E\u043D \u0438 \u043F\u043E\u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0441\u0431\u043E\u043A\u0443 \u043F\u0440\u0438
1809
+ * \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0435 \u043A\u0430\u043C\u0435\u0440\u044B, \u0438 \u044D\u0442\u043E \u0435\u0434\u0438\u043D\u0441\u0442\u0432\u0435\u043D\u043D\u043E\u0435, \u0447\u0442\u043E \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043A\u0430\u043A \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0430\u044F \u0433\u043B\u0443\u0431\u0438\u043D\u0430.
1810
+ */
1646
1811
  float atGround = step(y, mBot);
1647
- if (cls == 1 || cls == 2) {
1648
- // \u041F\u0435\u0440\u0432\u044B\u0439 \u044D\u0442\u0430\u0436: \u0432\u0438\u0442\u0440\u0438\u043D\u044B \u043F\u043E \u0442\u0435\u043C \u0436\u0435 \u043A\u043E\u043B\u043E\u043D\u043A\u0430\u043C, \u0447\u0442\u043E \u0438 \u043E\u043A\u043D\u0430 \u0432\u044B\u0448\u0435.
1649
- float gw = band(fx, cw * 0.36, aa) * band(y - mBot * 0.55, mBot * 0.3, aa);
1650
- win = mix(win, max(win, gw), atGround * step(0.0, gx) * step(gx, cols));
1812
+ bool inCols = gx >= 0.0 && gx <= cols;
1813
+
1814
+ /*
1815
+ * \u041F\u0420\u041E\u0401\u041C \u2014 \u041E\u0414\u041D\u0410 \u041A\u041E\u0420\u041E\u0411\u041A\u0410 \u043D\u0430 \u0432\u0441\u0435 \u0441\u043B\u0443\u0447\u0430\u0438. \u0412\u0438\u0442\u0440\u0438\u043D\u0430 \u043F\u0435\u0440\u0432\u043E\u0433\u043E \u044D\u0442\u0430\u0436\u0430 \u043E\u0442\u043B\u0438\u0447\u0430\u0435\u0442\u0441\u044F \u043E\u0442 \u043E\u043A\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0440\u0430\u0437\u043C\u0435\u0440\u043E\u043C
1816
+ * \u0438 \u0442\u0435\u043C, \u043E\u0442 \u0447\u0435\u0433\u043E \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0435\u0451 \u0446\u0435\u043D\u0442\u0440; \u0440\u0430\u043D\u044C\u0448\u0435 \u043E\u043D\u0430 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u043B\u0430\u0441\u044C \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E\u0439 \u043C\u0430\u0441\u043A\u043E\u0439 \u0421\u0420\u0410\u0417\u0423 \u0438 \u0432 \u043F\u0440\u043E\u0451\u043C, \u0438
1817
+ * \u0432 \u0441\u0442\u0435\u043A\u043B\u043E \u2014 \u043E\u0442\u043A\u043E\u0441\u0443 \u0442\u0430\u043C \u0431\u044B\u043B\u043E \u043D\u0435\u043E\u0442\u043A\u0443\u0434\u0430 \u0432\u0437\u044F\u0442\u044C\u0441\u044F, \u0438 \u043D\u0438\u0437 \u0434\u043E\u043C\u0430 \u043E\u0441\u0442\u0430\u0432\u0430\u043B\u0441\u044F \u0441 \u043F\u043B\u043E\u0441\u043A\u0438\u043C\u0438 \u043E\u043A\u043D\u0430\u043C\u0438. \u0422\u0435\u043F\u0435\u0440\u044C
1818
+ * \u0440\u0430\u0437\u043C\u0435\u0440\u044B \u043A\u043E\u0440\u043E\u0431\u043A\u0438 \u043F\u043E\u0434\u043C\u0435\u043D\u044F\u044E\u0442\u0441\u044F, \u0430 \u0433\u043B\u0443\u0431\u0438\u043D\u0430, \u043E\u0442\u043A\u043E\u0441\u044B \u0438 \u043F\u0435\u0440\u0435\u043F\u043B\u0451\u0442 \u0441\u0447\u0438\u0442\u0430\u044E\u0442\u0441\u044F \u0434\u0430\u043B\u044C\u0448\u0435 \u043E\u0434\u043D\u0438\u043C \u043A\u043E\u0434\u043E\u043C.
1819
+ */
1820
+ vec2 f = vec2(fx, fy);
1821
+ vec2 halfBox = vec2(winW, winH) * 0.5;
1822
+ bool opening = inGrid;
1823
+ if ((cls == 1 || cls == 2) && atGround > 0.5 && inCols) {
1824
+ f = vec2(fx, y - mBot * 0.55);
1825
+ halfBox = vec2(cw * 0.36, mBot * 0.3);
1826
+ opening = true;
1651
1827
  }
1828
+ // \u0426\u0435\u0445: \u043E\u043A\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0432\u044B\u0448\u0435 \u0447\u0435\u0442\u044B\u0440\u0451\u0445 \u043C\u0435\u0442\u0440\u043E\u0432, \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u043E\u0435 \u2014 \u0433\u043B\u0443\u0445\u0438\u0435 \u043F\u0430\u043D\u0435\u043B\u0438.
1829
+ if (cls == 3 && y < 4.0) opening = false;
1830
+
1831
+ vec2 deep = f - par * u_window_recess;
1652
1832
 
1653
- // \u0426\u0435\u0445: \u043E\u043A\u043D\u0430 \u0442\u043E\u043B\u044C\u043A\u043E \u0432\u044B\u0448\u0435 \u0447\u0435\u0442\u044B\u0440\u0451\u0445 \u043C\u0435\u0442\u0440\u043E\u0432, \u043E\u0441\u0442\u0430\u043B\u044C\u043D\u043E\u0435 \u2014 \u043F\u0430\u043D\u0435\u043B\u0438.
1654
- if (cls == 3) {
1655
- win *= step(4.0, y);
1656
- frame *= step(4.0, y);
1833
+ float win = 0.0;
1834
+ float glassMask = 0.0;
1835
+ float frame = 0.0;
1836
+ if (opening) {
1837
+ win = band(f.x, halfBox.x, aa) * band(f.y, halfBox.y, aa);
1838
+ glassMask = win * band(deep.x, halfBox.x, aa) * band(deep.y, halfBox.y, aa);
1839
+ frame = (band(f.x, halfBox.x + 0.12, aa) * band(f.y, halfBox.y + 0.12, aa) - win) * fine;
1657
1840
  }
1658
1841
 
1659
1842
  /*
@@ -1671,9 +1854,6 @@ vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa,
1671
1854
  float seams = (cls == 2 ? seamX : max(seamY, seamX) * (cls == 3 ? 1.0 : 0.55)) * fine;
1672
1855
  color *= 1.0 - seams * 0.10;
1673
1856
 
1674
- // \u0426\u043E\u043A\u043E\u043B\u044C \u0442\u0435\u043C\u043D\u0435\u0435 \u2014 \u0437\u0434\u0430\u043D\u0438\u0435 \xAB\u0441\u0442\u043E\u0438\u0442\xBB, \u0430 \u043D\u0435 \u0432\u0438\u0441\u0438\u0442.
1675
- color *= mix(1.0, 0.86, atGround * (cls == 0 || cls == 3 ? 1.0 : 0.4));
1676
-
1677
1857
  // \u0421\u0442\u0435\u043A\u043B\u043E: \u0443 \u043A\u0430\u0436\u0434\u043E\u0433\u043E \u043E\u043A\u043D\u0430 \u0441\u0432\u043E\u0439 \u0442\u043E\u043D \u0438 \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u043F\u043E \u0432\u044B\u0441\u043E\u0442\u0435 \u2014 \u0441\u0432\u0435\u0440\u0445\u0443 \u0432 \u043D\u0451\u043C
1678
1858
  // \u043E\u0442\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044F \u043D\u0435\u0431\u043E, \u0441\u043D\u0438\u0437\u0443 \u0442\u0451\u043C\u043D\u044B\u0439 \u0438\u043D\u0442\u0435\u0440\u044C\u0435\u0440. \u0420\u043E\u0432\u043D\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043D\u0430\u043A\u043B\u0435\u0439\u043A\u043E\u0439.
1679
1859
  // \u0412\u0445\u043E\u0434 \u0445\u0435\u0448\u0430 \u2014 \u0442\u043E\u043B\u044C\u043A\u043E \u0426\u0415\u041B\u042B\u0415 \u0447\u0438\u0441\u043B\u0430: \u043D\u043E\u043C\u0435\u0440 \u044F\u0447\u0435\u0439\u043A\u0438 \u0438 \u043E\u0442\u0442\u0435\u043D\u043E\u043A, \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0451\u043D\u043D\u044B\u0439 \u043A \u0441\u0432\u043E\u0435\u043C\u0443
@@ -1681,7 +1861,9 @@ vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa,
1681
1861
  vec2 cell = floor(vec2(gx, gy));
1682
1862
  float cellSeed = floor(seed * 255.0 + 0.5);
1683
1863
  float jitter = hashNoise(cell + cellSeed * 37.0);
1684
- float sky = clamp(0.5 + fy / max(winH, 0.2), 0.0, 1.0);
1864
+ // \u0413\u0440\u0430\u0434\u0438\u0435\u043D\u0442 \u043D\u0435\u0431\u0430 \u0436\u0438\u0432\u0451\u0442 \u041D\u0410 \u0421\u0422\u0415\u041A\u041B\u0415, \u0437\u043D\u0430\u0447\u0438\u0442 \u0438 \u0441\u0447\u0438\u0442\u0430\u0442\u044C \u0435\u0433\u043E \u043D\u0430\u0434\u043E \u0432 \u0442\u043E\u0447\u043A\u0435 \u0441\u0442\u0435\u043A\u043B\u0430: \u0438\u043D\u0430\u0447\u0435 \u043F\u0440\u0438 \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0435
1865
+ // \u043A\u0430\u043C\u0435\u0440\u044B \u043E\u0442\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043F\u0440\u0438\u043A\u043B\u0435\u0435\u043D\u043D\u044B\u043C \u043A \u0441\u0442\u0435\u043D\u0435, \u0430 \u043D\u0435 \u0441\u044A\u0435\u0437\u0436\u0430\u0435\u0442 \u0432\u043C\u0435\u0441\u0442\u0435 \u0441 \u043E\u043A\u043D\u043E\u043C.
1866
+ float sky = clamp(0.5 + deep.y / max(halfBox.y * 2.0, 0.2), 0.0, 1.0);
1685
1867
  vec3 glass = u_window_color * (0.7 + 0.45 * jitter) * (0.82 + 0.5 * sky);
1686
1868
 
1687
1869
  // \u041D\u043E\u0447\u044C\u044E \u0433\u043E\u0440\u0438\u0442 \u0447\u0430\u0441\u0442\u044C \u043E\u043A\u043E\u043D. \u041A\u0430\u043A\u0438\u0435 \u0438\u043C\u0435\u043D\u043D\u043E \u2014 \u0440\u0435\u0448\u0430\u0435\u0442 \u0445\u0435\u0448 \u044F\u0447\u0435\u0439\u043A\u0438, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043F\u0440\u0438
@@ -1689,12 +1871,53 @@ vec4 facadePattern(vec3 base, vec3 wall, float y, int cls, float seed, float aa,
1689
1871
  float lit = step(1.0 - u_window_glow, hashNoise(cell * 1.7 + cellSeed * 91.0));
1690
1872
  // \u042F\u0440\u043A\u043E\u0441\u0442\u044C \u0433\u043E\u0440\u044F\u0449\u0435\u0433\u043E \u043E\u043A\u043D\u0430 \u0442\u043E\u0436\u0435 \u0440\u0430\u0437\u043D\u0430\u044F: \u043E\u0434\u0438\u043D\u0430\u043A\u043E\u0432\u043E \u0441\u0432\u0435\u0442\u044F\u0449\u0438\u0435\u0441\u044F \u043E\u043A\u043D\u0430 \u0432\u044B\u0433\u043B\u044F\u0434\u044F\u0442
1691
1873
  // \u0441\u0432\u0435\u0442\u043E\u0434\u0438\u043E\u0434\u043D\u043E\u0439 \u0432\u044B\u0432\u0435\u0441\u043A\u043E\u0439, \u0430 \u043D\u0435 \u0436\u0438\u043B\u044B\u043C \u0434\u043E\u043C\u043E\u043C.
1692
- glow = win * lit * (0.45 + 0.75 * jitter);
1874
+ glow = glassMask * lit * (0.45 + 0.75 * jitter);
1875
+
1876
+ /*
1877
+ * \u0422\u0435\u043D\u044C \u043E\u0442 \u043A\u0440\u0430\u044F \u043F\u0440\u043E\u0451\u043C\u0430. \u0422\u043E\u0447\u043A\u0430 \u0441\u0442\u0435\u043A\u043B\u0430 \u043E\u0441\u0432\u0435\u0449\u0435\u043D\u0430, \u0435\u0441\u043B\u0438 \u043B\u0443\u0447 \u043D\u0430 \u0441\u043E\u043B\u043D\u0446\u0435 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u043D\u0430\u0440\u0443\u0436\u0443, \u0442\u043E \u0435\u0441\u0442\u044C \u0435\u0441\u043B\u0438
1878
+ * \u0441\u0434\u0432\u0438\u043D\u0443\u0442\u0430\u044F \u043D\u0430 sunOff \u0442\u043E\u0447\u043A\u0430 \u0435\u0449\u0451 \u0432\u043D\u0443\u0442\u0440\u0438 \u043E\u043A\u043D\u0430. \u0421\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0412 \u0422\u041E\u0427\u041A\u0415 \u0421\u0422\u0415\u041A\u041B\u0410 \u0438 \u0434\u043E \u043F\u0435\u0440\u0435\u043F\u043B\u0451\u0442\u0430: \u0441\u0430\u043C
1879
+ * \u043F\u0435\u0440\u0435\u043F\u043B\u0451\u0442 \u043B\u0435\u0436\u0438\u0442 \u0432 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u0441\u0442\u0435\u043D\u044B \u0438 \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u0437\u0430\u0442\u0435\u043D\u044F\u0435\u0442.
1880
+ *
1881
+ * \u0413\u0440\u0430\u043D\u0438\u0446\u0430 \u0420\u0410\u0417\u041C\u042B\u0422\u0410 \u043D\u0430 \u0432\u0441\u044E \u0434\u043B\u0438\u043D\u0443 \u0432\u044B\u043D\u043E\u0441\u0430, \u0430 \u043D\u0435 \u043D\u0430 \u043F\u0438\u043A\u0441\u0435\u043B\u044C. \u0421\u043E\u043B\u043D\u0446\u0435 \u2014 \u043D\u0435 \u0442\u043E\u0447\u043A\u0430, \u043A\u0440\u0430\u0439 \u043F\u0440\u043E\u0451\u043C\u0430 \u0434\u0430\u0451\u0442
1882
+ * \u043F\u043E\u043B\u0443\u0442\u0435\u043D\u044C \u0442\u0435\u043C \u0448\u0438\u0440\u0435, \u0447\u0435\u043C \u0434\u043B\u0438\u043D\u043D\u0435\u0435 \u0442\u0435\u043D\u044C; \u0440\u0435\u0437\u043A\u0430\u044F \u0433\u0440\u0430\u043D\u0438\u0446\u0430 \u043D\u0430 \u0441\u0442\u0435\u043A\u043B\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043F\u044F\u0442\u043D\u043E\u043C \u0433\u0440\u044F\u0437\u0438, \u0430 \u043D\u0435
1883
+ * \u0433\u043B\u0443\u0431\u0438\u043D\u043E\u0439. \u0421\u0442\u0435\u043A\u043B\u043E \u0432\u0434\u043E\u0431\u0430\u0432\u043E\u043A \u0437\u0435\u0440\u043A\u0430\u043B\u044C\u043D\u043E\u0435: \u0442\u0435\u043D\u044C \u043D\u0430 \u043D\u0451\u043C \u0438 \u0432 \u0436\u0438\u0437\u043D\u0438 \u0435\u0434\u0432\u0430 \u0432\u0438\u0434\u043D\u0430, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u043E\u043D\u0430 \u0437\u0434\u0435\u0441\u044C
1884
+ * \u0437\u0430\u043C\u0435\u0442\u043D\u043E \u0441\u043B\u0430\u0431\u0435\u0435, \u0447\u0435\u043C \u043D\u0430 \u043E\u0442\u043A\u043E\u0441\u0435.
1885
+ */
1886
+ float penumbra = max(abs(sunOff.x), abs(sunOff.y)) * 0.9 + aa;
1887
+ float sunlit = band(deep.x + sunOff.x, halfBox.x, penumbra) * band(deep.y + sunOff.y, halfBox.y, penumbra);
1888
+ glass *= 1.0 - (1.0 - sunlit) * u_window_recess_shade * fine;
1889
+ color = mix(color, glass, glassMask * 0.9);
1890
+
1891
+ /*
1892
+ * \u041E\u0442\u043A\u043E\u0441 \u2014 \u0447\u0430\u0441\u0442\u044C \u043F\u0440\u043E\u0451\u043C\u0430, \u0433\u0434\u0435 \u043B\u0443\u0447 \u043D\u0435 \u0434\u043E\u0448\u0451\u043B \u0434\u043E \u0441\u0442\u0435\u043A\u043B\u0430. \u041E\u043D \u043D\u0435 \u043F\u043B\u043E\u0441\u043A\u0438\u0439: \u043D\u0438\u0437 \u043F\u0435\u0440\u0435\u043C\u044B\u0447\u043A\u0438 \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u0432\u043D\u0438\u0437
1893
+ * \u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u0442\u0435\u043D\u0438, \u043F\u043E\u0434\u043E\u043A\u043E\u043D\u043D\u0438\u043A \u0441\u043C\u043E\u0442\u0440\u0438\u0442 \u0432\u0432\u0435\u0440\u0445 \u0438 \u043B\u043E\u0432\u0438\u0442 \u043D\u0435\u0431\u043E, \u0431\u043E\u043A\u043E\u0432\u044B\u0435 \u0449\u0451\u043A\u0438 \u043C\u0435\u0436\u0434\u0443 \u043D\u0438\u043C\u0438.
1894
+ *
1895
+ * \u041A\u0430\u043A\u0430\u044F \u0438\u043C\u0435\u043D\u043D\u043E \u0433\u0440\u0430\u043D\u044C \u0432\u0438\u0434\u043D\u0430 \u2014 \u0440\u0435\u0448\u0430\u0435\u0442 \u041D\u0415 \u0432\u044B\u0441\u043E\u0442\u0430 \u0442\u043E\u0447\u043A\u0438, \u0430 \u0442\u043E, \u0434\u043E \u043A\u0430\u043A\u043E\u0439 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u043B\u0443\u0447 \u0434\u043E\u0448\u0451\u043B
1896
+ * \u0420\u0410\u041D\u042C\u0428\u0415. \u042D\u0442\u043E \u043E\u0431\u044B\u0447\u043D\u0430\u044F \u0437\u0430\u0434\u0430\u0447\u0430 \u043F\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043D\u0438\u044F \u043B\u0443\u0447\u0430 \u0441 \u043A\u043E\u0440\u043E\u0431\u043A\u043E\u0439, \u0438 \u0431\u0435\u0437 \u043D\u0435\u0451 \u0443 \u043D\u0438\u0436\u043D\u0435\u0433\u043E \u0443\u0433\u043B\u0430 \u0431\u043E\u043A\u043E\u0432\u0430\u044F
1897
+ * \u0449\u0435\u043A\u0430 \u043E\u0431\u0440\u044B\u0432\u0430\u043B\u0430\u0441\u044C \u043F\u043E\u0434\u043E\u043A\u043E\u043D\u043D\u0438\u043A\u043E\u043C: \u0432 \u0443\u0433\u043B\u0443 \u043B\u0443\u0447 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u043F\u043E \u043E\u0431\u0435\u0438\u043C \u043E\u0441\u044F\u043C, \u0438 \u0432\u044B\u0431\u043E\u0440 \xAB\u043F\u043E \u0432\u044B\u0441\u043E\u0442\u0435\xBB
1898
+ * \u043E\u0442\u0434\u0430\u0432\u0430\u043B \u0443\u0433\u043E\u043B \u0433\u043E\u0440\u0438\u0437\u043E\u043D\u0442\u0430\u043B\u044C\u043D\u043E\u0439 \u0433\u0440\u0430\u043D\u0438. \u0423 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u043D\u0438\u0448\u0438 \u0442\u0430\u043C \u0438\u0434\u0451\u0442 \u0434\u0438\u0430\u0433\u043E\u043D\u0430\u043B\u044C \u2014 \u043B\u0438\u043D\u0438\u044F \u0441\u0445\u043E\u0434\u0430 \u0434\u0432\u0443\u0445
1899
+ * \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0435\u0439.
1900
+ */
1901
+ float revealMask = max(win - glassMask, 0.0) * fine;
1902
+ if (revealMask > 0.001) {
1903
+ // \u0421\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0442\u043E\u0447\u043A\u0438 \u043F\u043E\u043F\u0430\u0434\u0430\u043D\u0438\u044F \u043D\u0430 \u041C\u0415\u0422\u0420 \u0433\u043B\u0443\u0431\u0438\u043D\u044B; \u043E\u0442\u0441\u044E\u0434\u0430 \u2014 \u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u0432\u044B\u0445\u043E\u0434\u0430 \u043F\u043E \u043A\u0430\u0436\u0434\u043E\u0439 \u043E\u0441\u0438.
1904
+ vec2 dir = -par;
1905
+ float big = 1e6;
1906
+ float tX = abs(dir.x) > 1e-4 ? ((dir.x > 0.0 ? halfBox.x : -halfBox.x) - f.x) / dir.x : big;
1907
+ float tY = abs(dir.y) > 1e-4 ? ((dir.y > 0.0 ? halfBox.y : -halfBox.y) - f.y) / dir.y : big;
1908
+ // \u0428\u0438\u0440\u0438\u043D\u0430 \u0440\u0430\u0437\u043C\u044B\u0442\u0438\u044F \u2014 \u0432 \u0442\u0435\u0445 \u0436\u0435 \u0435\u0434\u0438\u043D\u0438\u0446\u0430\u0445, \u0447\u0442\u043E \u0438 \u0433\u043B\u0443\u0431\u0438\u043D\u0430: \u043F\u0438\u043A\u0441\u0435\u043B\u044C \u043F\u043E \u0433\u0440\u0430\u043D\u0438 \u044D\u0442\u043E aa \u043C\u0435\u0442\u0440\u043E\u0432 \u0432\u0431\u043E\u043A,
1909
+ // \u0430 \u0432\u0431\u043E\u043A \u0437\u0430 \u043C\u0435\u0442\u0440 \u0433\u043B\u0443\u0431\u0438\u043D\u044B \u043B\u0443\u0447 \u0443\u0445\u043E\u0434\u0438\u0442 \u043D\u0430 length(dir).
1910
+ float w = aa / max(length(dir), 1e-3) + 1e-4;
1911
+ float sideFirst = smoothstep(-w, w, tY - tX);
1912
+ // \u041B\u0443\u0447 \u0438\u0434\u0451\u0442 \u0432\u0432\u0435\u0440\u0445 \u2014 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0440\u0445 \u043D\u0438\u0448\u0438, \u0430 \u044D\u0442\u043E \u043D\u0438\u0437 \u043F\u0435\u0440\u0435\u043C\u044B\u0447\u043A\u0438, \u043E\u043D \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u0442\u0435\u043D\u0438.
1913
+ float horizTone = dir.y > 0.0 ? 0.58 : 1.06;
1914
+ float tone = mix(horizTone, 0.82, sideFirst);
1915
+ color = mix(color, base * tone, revealMask);
1916
+ }
1693
1917
 
1694
- color = mix(color, glass, win * 0.9);
1695
1918
  color = mix(color, u_window_frame, frame * 0.75);
1696
1919
 
1697
- return vec4(color, win);
1920
+ return vec4(color, glassMask);
1698
1921
  }
1699
1922
 
1700
1923
  /**
@@ -1736,17 +1959,18 @@ vec3 roofHue(vec3 base, float seed) {
1736
1959
  float hueLum = max(dot(hue, vec3(0.2126, 0.7152, 0.0722)), 1e-3);
1737
1960
  return hue * (baseLum / hueLum);
1738
1961
  }
1739
- `,pa=`#version 300 es
1962
+ `,wa=`#version 300 es
1740
1963
  precision highp float;
1741
1964
 
1742
- ${Rt}
1743
- ${Co}
1744
- ${je}
1745
- ${fc}
1965
+ ${zt}
1966
+ ${So}
1967
+ ${Xe}
1968
+ ${dc}
1746
1969
 
1747
1970
  in vec3 v_normal;
1748
1971
  in float v_ao;
1749
1972
  flat in float v_tint; // \u0431\u0435\u0437 \u0438\u043D\u0442\u0435\u0440\u043F\u043E\u043B\u044F\u0446\u0438\u0438 \u2014 \u0441\u043C. \u0432\u0435\u0440\u0448\u0438\u043D\u043D\u044B\u0439 \u0448\u0435\u0439\u0434\u0435\u0440
1973
+ in vec3 v_view; // \u043E\u0442 \u0442\u043E\u0447\u043A\u0438 \u043A \u043A\u0430\u043C\u0435\u0440\u0435, \u043C\u0435\u0442\u0440\u044B
1750
1974
  in float v_kind;
1751
1975
  in vec2 v_world;
1752
1976
  in float v_up;
@@ -1775,6 +1999,22 @@ void main() {
1775
1999
  // \u0440\u0430\u0437\u0431\u0440\u043E\u0441 \u043E\u0442\u0442\u0435\u043D\u043A\u0430 \u043F\u043E \u0437\u0434\u0430\u043D\u0438\u044F\u043C: \u043A\u0432\u0430\u0440\u0442\u0430\u043B \u043F\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0431\u044B\u0442\u044C \u0441\u043F\u043B\u043E\u0448\u043D\u043E\u0439 \u043C\u0430\u0441\u0441\u043E\u0439
1776
2000
  albedo *= 1.0 + (v_tint - 0.5) * 2.0 * u_tint_variation;
1777
2001
 
2002
+ /*
2003
+ * \u0426\u041E\u041A\u041E\u041B\u042C. \u0423 \u0437\u0435\u043C\u043B\u0438 \u0441\u0442\u0435\u043D\u0430 \u0442\u0435\u043C\u043D\u0435\u0435: \u0442\u0443\u0434\u0430 \u043C\u0435\u043D\u044C\u0448\u0435 \u0434\u043E\u0445\u043E\u0434\u0438\u0442 \u043D\u0435\u0431\u0430, \u0438 \u0437\u0434\u0430\u043D\u0438\u0435 \u0432\u0438\u0437\u0443\u0430\u043B\u044C\u043D\u043E \u0441\u0442\u043E\u0438\u0442, \u0430 \u043D\u0435 \u0432\u0438\u0441\u0438\u0442.
2004
+ *
2005
+ * \u0420\u0430\u043D\u044C\u0448\u0435 \u044D\u0442\u043E \u0431\u044B\u043B\u0430 \u041F\u041E\u041B\u041E\u0421\u0410 \u0441 \u0440\u0435\u0437\u043A\u0438\u043C \u0432\u0435\u0440\u0445\u043D\u0438\u043C \u043A\u0440\u0430\u0435\u043C \u043D\u0430 \u0432\u044B\u0441\u043E\u0442\u0435 \u0446\u043E\u043A\u043E\u043B\u044C\u043D\u043E\u0433\u043E \u043F\u043E\u044F\u0441\u0430, \u0438 \u0441\u0447\u0438\u0442\u0430\u043B\u0430\u0441\u044C \u043E\u043D\u0430
2006
+ * \u0432\u043D\u0443\u0442\u0440\u0438 \u0444\u0430\u0441\u0430\u0434\u043D\u043E\u0433\u043E \u0443\u0437\u043E\u0440\u0430 \u2014 \u0442\u043E \u0435\u0441\u0442\u044C \u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u0433\u0440\u0430\u043D\u044F\u0445, \u043A\u0443\u0434\u0430 \u0443\u0437\u043E\u0440 \u0432\u043E\u043E\u0431\u0449\u0435 \u043B\u043E\u0436\u0438\u0442\u0441\u044F. \u041D\u0430 \u0441\u043A\u0440\u0443\u0433\u043B\u0451\u043D\u043D\u043E\u043C
2007
+ * \u0443\u0433\u043B\u0443 \u0433\u0440\u0430\u043D\u044C \u0441\u043B\u0438\u0448\u043A\u043E\u043C \u0443\u0437\u043A\u0430\u044F, \u0443\u0437\u043E\u0440 \u0442\u0443\u0434\u0430 \u043D\u0435 \u043A\u043B\u0430\u0434\u0451\u0442\u0441\u044F, \u0438 \u043F\u043E\u043B\u043E\u0441\u0430 \u0442\u0430\u043C \u043E\u0431\u0440\u044B\u0432\u0430\u043B\u0430\u0441\u044C \u043F\u043E\u0441\u0440\u0435\u0434\u0438 \u0434\u043E\u043C\u0430.
2008
+ *
2009
+ * \u0422\u0435\u043F\u0435\u0440\u044C \u044D\u0442\u043E \u0437\u0430\u0442\u0443\u0445\u0430\u043D\u0438\u0435 \u0432\u0432\u0435\u0440\u0445 \u043F\u043E \u0432\u044B\u0441\u043E\u0442\u0435 \u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043E\u043D\u043E \u0434\u043B\u044F \u0432\u0441\u0435\u0439 \u0441\u0442\u0435\u043D\u044B \u0440\u0430\u0437\u043E\u043C, \u0434\u043E \u0443\u0437\u043E\u0440\u0430. \u0421\u043F\u0430\u0434
2010
+ * \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043D\u044B\u0439: \u0443 \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0439 \u043A\u043E\u043D\u0442\u0430\u043A\u0442\u043D\u043E\u0439 \u0442\u0435\u043D\u0438 \u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u043F\u0430\u0434\u0430\u0435\u0442 \u0431\u044B\u0441\u0442\u0440\u0435\u0435 \u0443 \u0437\u0435\u043C\u043B\u0438, \u0430 \u043B\u0438\u043D\u0435\u0439\u043D\u044B\u0439 \u0441\u043F\u0430\u0434
2011
+ * \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0433\u0440\u0430\u0434\u0438\u0435\u043D\u0442\u043D\u043E\u0439 \u0437\u0430\u043B\u0438\u0432\u043A\u043E\u0439.
2012
+ */
2013
+ if (!isRoof) {
2014
+ float toGround = 1.0 - clamp(v_up / max(u_plinth_height, 0.01), 0.0, 1.0);
2015
+ albedo *= 1.0 - u_plinth_shade * toGround * toGround;
2016
+ }
2017
+
1778
2018
  /*
1779
2019
  * \u041C\u0415\u0422\u0420\u041E\u0412 \u041D\u0410 \u041F\u0418\u041A\u0421\u0415\u041B\u042C \u2014 \u0438 \u043C\u0435\u0440\u0430 \u0442\u043E\u0433\u043E, \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0434\u0435\u0442\u0430\u043B\u0435\u0439 \u0438\u043C\u0435\u0435\u0442 \u0441\u043C\u044B\u0441\u043B \u0440\u0438\u0441\u043E\u0432\u0430\u0442\u044C, \u0438 \u0448\u0438\u0440\u0438\u043D\u0430 \u0441\u0433\u043B\u0430\u0436\u0438\u0432\u0430\u043D\u0438\u044F.
1780
2020
  *
@@ -1804,9 +2044,47 @@ void main() {
1804
2044
  // \u0420\u0430\u0441\u043A\u043B\u0430\u0434\u043A\u0430 \u0438\u0434\u0451\u0442 \u043F\u043E \u0413\u0420\u0410\u041D\u0418, \u0430 \u043D\u0435 \u043F\u043E \u043E\u0431\u0449\u0435\u0439 \u0441\u0435\u0442\u043A\u0435: \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0432\u0434\u043E\u043B\u044C \u043D\u0435\u0451, \u0435\u0451
1805
2045
  // \u0448\u0438\u0440\u0438\u043D\u0430 \u0438 \u0432\u044B\u0441\u043E\u0442\u0430 \u043F\u0440\u0438\u0448\u043B\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u043C. \u0424\u0440\u043E\u043D\u0442\u043E\u043D\u044B \u0438 \u043F\u0440\u043E\u0447\u0438\u0435 \u043A\u0443\u0441\u043A\u0438 \u0431\u0435\u0437 \u0433\u0440\u0430\u043D\u0438
1806
2046
  // (v_wall.y == 0) \u043E\u0441\u0442\u0430\u044E\u0442\u0441\u044F \u0433\u043B\u0443\u0445\u0438\u043C\u0438.
2047
+ /*
2048
+ * \u041E\u0422\u041A\u041E\u0421 \u041E\u041A\u041D\u0410. \u0421\u0442\u0435\u043A\u043B\u043E \u0441\u0442\u043E\u0438\u0442 \u043D\u0435 \u0437\u0430\u043F\u043E\u0434\u043B\u0438\u0446\u043E \u0441\u043E \u0441\u0442\u0435\u043D\u043E\u0439, \u0430 \u043D\u0430 \u0433\u043B\u0443\u0431\u0438\u043D\u0435 u_window_recess, \u0438 \u043A\u0440\u0430\u0439
2049
+ * \u043F\u0440\u043E\u0451\u043C\u0430 \u043A\u043B\u0430\u0434\u0451\u0442 \u043D\u0430 \u043D\u0435\u0433\u043E \u0442\u0435\u043D\u044C \u2014 \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441 \u0442\u043E\u0439 \u0441\u0442\u043E\u0440\u043E\u043D\u044B, \u0433\u0434\u0435 \u043D\u0435\u0442 \u0441\u043E\u043B\u043D\u0446\u0430. \u042D\u0442\u043E \u0438 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u043A\u0430\u043A
2050
+ * \xAB\u043E\u043A\u043D\u043E \u0443\u0442\u043E\u043F\u043B\u0435\u043D\u043E\xBB: \u043F\u043B\u043E\u0441\u043A\u0430\u044F \u0437\u0430\u043B\u0438\u0432\u043A\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u044B\u0433\u043B\u044F\u0434\u0438\u0442 \u043D\u0430\u043A\u043B\u0435\u0439\u043A\u043E\u0439, \u0441\u043A\u043E\u043B\u044C\u043A\u043E \u0435\u0439 \u043D\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0439
2051
+ * \u043F\u0435\u0440\u0435\u043F\u043B\u0451\u0442\u0430.
2052
+ *
2053
+ * \u0421\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0442\u0435\u043D\u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0440\u043E\u0432\u043D\u043E \u043A\u0430\u043A \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435: \u043B\u0443\u0447 \u043D\u0430 \u0441\u043E\u043B\u043D\u0446\u0435 \u043E\u0442 \u0442\u043E\u0447\u043A\u0438 \u0441\u0442\u0435\u043A\u043B\u0430 \u0432\u044B\u0445\u043E\u0434\u0438\u0442 \u0438\u0437
2054
+ * \u043F\u0440\u043E\u0451\u043C\u0430 \u0447\u0435\u0440\u0435\u0437 \u0442\u043E\u0447\u043A\u0443 \u0441\u0442\u0435\u043D\u044B, \u043E\u0442\u0441\u0442\u043E\u044F\u0449\u0443\u044E \u043D\u0430 \u0433\u043B\u0443\u0431\u0438\u043D\u0443 \xD7 \u0442\u0430\u043D\u0433\u0435\u043D\u0441 \u0443\u0433\u043B\u0430. \u0420\u0430\u0441\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u0435\u043C \u043D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435
2055
+ * \u043D\u0430 \u0441\u043E\u043B\u043D\u0446\u0435 \u043F\u043E \u043E\u0441\u044F\u043C \u0433\u0440\u0430\u043D\u0438 \u2014 \u0432\u0434\u043E\u043B\u044C \u043D\u0435\u0451 (t) \u0438 \u0432\u0432\u0435\u0440\u0445 \u2014 \u0438 \u0434\u0435\u043B\u0438\u043C \u043D\u0430 \u0441\u043E\u0441\u0442\u0430\u0432\u043B\u044F\u044E\u0449\u0443\u044E \u043F\u043E \u043D\u043E\u0440\u043C\u0430\u043B\u0438.
2056
+ * \u0423 \u043A\u0440\u0430\u044F \u0433\u0440\u0430\u043D\u0438 (\u0441\u043E\u043B\u043D\u0446\u0435 \u043F\u043E\u0447\u0442\u0438 \u0432\u0434\u043E\u043B\u044C \u0441\u0442\u0435\u043D\u044B) \u0442\u0430\u043D\u0433\u0435\u043D\u0441 \u0443\u0445\u043E\u0434\u0438\u0442 \u0432 \u0431\u0435\u0441\u043A\u043E\u043D\u0435\u0447\u043D\u043E\u0441\u0442\u044C, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0441\u043C\u0435\u0449\u0435\u043D\u0438\u0435
2057
+ * \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u043E: \u0434\u043B\u0438\u043D\u043D\u0430\u044F \u0442\u0435\u043D\u044C \u0432\u0441\u0451 \u0440\u0430\u0432\u043D\u043E \u043D\u0430\u043A\u0440\u044B\u043B\u0430 \u0431\u044B \u043E\u043A\u043D\u043E \u0446\u0435\u043B\u0438\u043A\u043E\u043C.
2058
+ */
2059
+ vec3 t = normalize(cross(vec3(0.0, 0.0, 1.0), n));
2060
+
2061
+ /*
2062
+ * \u041F\u0410\u0420\u0410\u041B\u041B\u0410\u041A\u0421 \u041E\u0422\u041A\u041E\u0421\u0410. \u041B\u0443\u0447 \u0432\u0437\u0433\u043B\u044F\u0434\u0430 \u043D\u0435 \u043E\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0441\u0442\u0438 \u0441\u0442\u0435\u043D\u044B: \u0432\u043D\u0443\u0442\u0440\u0438 \u043F\u0440\u043E\u0451\u043C\u0430 \u043E\u043D
2063
+ * \u0438\u0434\u0451\u0442 \u0434\u0430\u043B\u044C\u0448\u0435 \u0438 \u043F\u0435\u0440\u0435\u0441\u0435\u043A\u0430\u0435\u0442 \u0441\u0442\u0435\u043A\u043B\u043E \u043D\u0430 \u0433\u043B\u0443\u0431\u0438\u043D\u0435 u_window_recess. \u0421\u043C\u0435\u0449\u0435\u043D\u0438\u0435 \u0442\u043E\u0447\u043A\u0438 \u043F\u043E\u043F\u0430\u0434\u0430\u043D\u0438\u044F
2064
+ * \u0432\u0434\u043E\u043B\u044C \u0433\u0440\u0430\u043D\u0438 \u0438 \u043F\u043E \u0432\u044B\u0441\u043E\u0442\u0435 \u0438 \u0435\u0441\u0442\u044C \u043F\u0430\u0440\u0430\u043B\u043B\u0430\u043A\u0441 \u2014 \u0438\u0437-\u0437\u0430 \u043D\u0435\u0433\u043E \u0441\u0431\u043E\u043A\u0443 \u0432\u0438\u0434\u043D\u043E \u043E\u0442\u043A\u043E\u0441, \u0438 \u0432\u0438\u0434\u043D\u043E
2065
+ * \u0418\u041C\u0415\u041D\u041D\u041E \u0422\u041E\u0422, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u043E\u0442\u0432\u0451\u0440\u043D\u0443\u0442 \u043E\u0442 \u043A\u0430\u043C\u0435\u0440\u044B. \u0422\u0435\u043D\u044C \u043E\u0442 \u043A\u0440\u0430\u044F \u0441\u0432\u0435\u0442\u0430 \u044D\u0442\u043E\u0433\u043E \u043D\u0435 \u0434\u0430\u0451\u0442: \u043E\u043D\u0430 \u0441\u0442\u043E\u0438\u0442 \u043D\u0430
2066
+ * \u043C\u0435\u0441\u0442\u0435 \u043F\u0440\u0438 \u043F\u043E\u0432\u043E\u0440\u043E\u0442\u0435, \u0438 \u043E\u043A\u043D\u043E \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043D\u0430\u043A\u043B\u0435\u0439\u043A\u043E\u0439.
2067
+ *
2068
+ * \u042D\u0442\u043E \u0442\u043E\u0442 \u0436\u0435 \u043F\u0440\u0438\u0451\u043C, \u043A\u043E\u0442\u043E\u0440\u044B\u043C \u0432 \u0438\u0433\u0440\u0430\u0445 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u043E\u043C\u043D\u0430\u0442\u044B \u0437\u0430 \u043E\u043A\u043D\u0430\u043C\u0438 (interior mapping): \u0432\u043C\u0435\u0441\u0442\u043E
2069
+ * \u0433\u0435\u043E\u043C\u0435\u0442\u0440\u0438\u0438 \u2014 \u043F\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043D\u0438\u0435 \u043B\u0443\u0447\u0430 \u0441 \u043A\u043E\u0440\u043E\u0431\u043A\u043E\u0439 \u0432 \u043E\u0441\u044F\u0445 \u0433\u0440\u0430\u043D\u0438.
2070
+ */
2071
+ vec3 view = normalize(v_view);
2072
+ float viewN = dot(view, n);
2073
+ // \u0413\u0440\u0430\u043D\u044C \u043A \u043D\u0430\u043C \u043F\u043E\u0447\u0442\u0438 \u0440\u0435\u0431\u0440\u043E\u043C \u2014 \u043F\u0430\u0440\u0430\u043B\u043B\u0430\u043A\u0441 \u0443\u0445\u043E\u0434\u0438\u0442 \u0432 \u0431\u0435\u0441\u043A\u043E\u043D\u0435\u0447\u043D\u043E\u0441\u0442\u044C; \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0438\u0432\u0430\u0435\u043C.
2074
+ vec2 par = vec2(dot(view, t), view.z) / max(viewN, 0.25);
2075
+
2076
+ vec3 sun = -u_key_dir;
2077
+ float sunN = dot(sun, n);
2078
+ vec2 sunOff = vec2(0.0);
2079
+ if (sunN > 0.02) {
2080
+ // \u041F\u0440\u0435\u0434\u0435\u043B \u2014 \u0434\u0432\u043E\u0439\u043D\u0430\u044F \u0433\u043B\u0443\u0431\u0438\u043D\u0430 \u043E\u0442\u043A\u043E\u0441\u0430: \u0434\u0430\u043B\u044C\u0448\u0435 \u0442\u0435\u043D\u044C \u0437\u0430\u043D\u0438\u043C\u0430\u0435\u0442 \u043F\u043E\u043B-\u043E\u043A\u043D\u0430 \u0438 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F \u0443\u0436\u0435 \u043D\u0435
2081
+ // \u0433\u043B\u0443\u0431\u0438\u043D\u043E\u0439, \u0430 \u0433\u0440\u044F\u0437\u043D\u044B\u043C \u043F\u044F\u0442\u043D\u043E\u043C \u043D\u0430 \u0441\u0442\u0435\u043A\u043B\u0435.
2082
+ float lim = u_window_recess * 2.0;
2083
+ sunOff = clamp(vec2(dot(sun, t), sun.z) / sunN * u_window_recess, -lim, lim);
2084
+ }
1807
2085
  float lit = 0.0;
1808
2086
  vec4 wall = v_wall.y > 0.5
1809
- ? facadePattern(albedo, v_wall, v_up, cls, v_tint, aa, lit)
2087
+ ? facadePattern(albedo, v_wall, v_up, cls, v_tint, aa, sunOff, par, lit)
1810
2088
  : vec4(albedo, 0.0);
1811
2089
  albedo = mix(albedo, wall.rgb, detail);
1812
2090
  glass = wall.a * detail;
@@ -1832,11 +2110,14 @@ void main() {
1832
2110
  color += u_window_color * glow * 0.55;
1833
2111
 
1834
2112
  float alpha = u_opacity * u_wall_color.a;
1835
- fragColor = vec4(applyFog(color) * alpha, alpha);
2113
+ // \u0412\u044B\u0441\u043E\u0442\u0443 \u0437\u043D\u0430\u0435\u0442 \u0442\u043E\u043B\u044C\u043A\u043E \u0437\u0434\u0430\u043D\u0438\u0435 \u2014 \u043E\u043D\u043E \u0438 \u043F\u0440\u043E\u0441\u0438\u0442 \u0434\u044B\u043C\u043A\u0443 \u0441 \u0435\u0451 \u0443\u0447\u0451\u0442\u043E\u043C: \u043D\u0438\u0437 \u0432 \u043C\u0433\u043B\u0435, \u0432\u0435\u0440\u0445 \u0447\u0438\u0449\u0435.
2114
+ fragColor = vec4(applyFogAt(color, v_up) * alpha, alpha);
1836
2115
  }
1837
- `,ba=`#version 300 es
2116
+ `,xa=`#version 300 es
1838
2117
  precision highp float;
1839
2118
 
2119
+ ${Cr}
2120
+
1840
2121
  in vec2 a_pos; // \u0435\u0434\u0438\u043D\u0438\u0446\u044B \u0442\u0430\u0439\u043B\u0430, \u0414\u0420\u041E\u0411\u041D\u042B\u0415 (\u0441\u043C. generators/surface.ts)
1841
2122
  in float a_level; // \u043C\u0435\u0442\u0440\u044B \xD7 SURFACE_LEVEL_SCALE (64)
1842
2123
  in vec3 a_normal;
@@ -1866,21 +2147,34 @@ void main() {
1866
2147
  // \u043F\u043E\u043A\u0440\u0430\u0441\u0438\u0442 \u2014 \u0434\u0430\u0436\u0435 \u0443 \u043F\u043E\u043B\u0443\u043F\u0440\u043E\u0437\u0440\u0430\u0447\u043D\u043E\u0433\u043E \u0441\u043B\u043E\u044F.
1867
2148
  vec2 pos = a_pos + a_bleed;
1868
2149
 
2150
+ /*
2151
+ * \u041D\u0430 \u0433\u043B\u043E\u0431\u0443\u0441\u0435 u_matrix \u2014 \u043A\u0430\u043C\u0435\u0440\u0430 \u0434\u043B\u044F \u041B\u041E\u041A\u0410\u041B\u042C\u041D\u042B\u0425 \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442, \u043D\u0430 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043A\u0430\u0440\u0442\u0435 \u043F\u0440\u0438\u0432\u044B\u0447\u043D\u0430\u044F \u043C\u0430\u0442\u0440\u0438\u0446\u0430
2152
+ * \u0442\u0430\u0439\u043B\u0430. \u0420\u0430\u0437\u0432\u0438\u043B\u043A\u0430 \u0442\u0430 \u0436\u0435, \u0447\u0442\u043E \u0443 \u0437\u0430\u043B\u0438\u0432\u043A\u0438 \u0438 \u043B\u0438\u043D\u0438\u0439.
2153
+ *
2154
+ * \u041F\u043E\u0432\u0435\u0440\u0445\u043D\u043E\u0441\u0442\u0435\u0439 \u044D\u0442\u0430 \u0432\u0435\u0442\u043A\u0430 \u0434\u043E\u043B\u0433\u043E \u043D\u0435 \u043A\u0430\u0441\u0430\u043B\u0430\u0441\u044C, \u0438 \u0437\u0440\u044F: \u0432\u043E\u0434\u043E\u0439, \u0437\u0435\u043B\u0435\u043D\u044C\u044E \u0438 \u0437\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u043E\u0439 \u0437\u0430\u043D\u044F\u0442\u044B \u043A\u0430\u043A \u0440\u0430\u0437
2155
+ * \u0441\u043B\u043E\u0438 \u0442\u0438\u043F\u0430 surface, \u0430 \u0440\u0438\u0441\u043E\u0432\u0430\u043B\u0438\u0441\u044C \u043E\u043D\u0438 \u043F\u043B\u043E\u0441\u043A\u043E\u0439 \u043C\u0430\u0442\u0440\u0438\u0446\u0435\u0439 \u2014 \u043D\u0430 \u0448\u0430\u0440\u0435 \u043E\u043A\u0435\u0430\u043D \u0432\u044B\u0445\u043E\u0434\u0438\u043B \u043F\u0440\u044F\u043C\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u043E\u0439
2156
+ * \u0437\u0430\u043F\u043B\u0430\u0442\u043E\u0439, \u0430 \u0434\u0430\u043B\u044C\u043D\u0438\u0435 \u043C\u043E\u0440\u044F \u0432\u0438\u0441\u0435\u043B\u0438 \u0437\u0430 \u0434\u0438\u0441\u043A\u043E\u043C.
2157
+ *
2158
+ * \u0423\u0440\u043E\u0432\u0435\u043D\u044C \u043D\u0430 \u0448\u0430\u0440\u0435 \u043D\u0435 \u043F\u043E\u0434\u043D\u0438\u043C\u0430\u0435\u043C: \u0443 \u0441\u0444\u0435\u0440\u044B \xAB\u0432\u0432\u0435\u0440\u0445\xBB \u0441\u0432\u043E\u0451 \u0432 \u043A\u0430\u0436\u0434\u043E\u0439 \u0442\u043E\u0447\u043A\u0435, \u0430 \u043D\u0430 \u0437\u0443\u043C\u0430\u0445 \u0433\u043B\u043E\u0431\u0443\u0441\u0430
2159
+ * \u043F\u0440\u0438\u043F\u043E\u0434\u043D\u044F\u0442\u044B\u0439 \u043D\u0430 \u043C\u0435\u0442\u0440 \u043F\u0430\u0440\u043A \u0432\u0441\u0451 \u0440\u0430\u0432\u043D\u043E \u043D\u0435\u0440\u0430\u0437\u043B\u0438\u0447\u0438\u043C.
2160
+ */
1869
2161
  vec4 local = vec4(pos, level, 1.0);
1870
- gl_Position = u_matrix * local;
2162
+ gl_Position = u_globe.x > 0.5
2163
+ ? u_matrix * vec4(globeLocal(pos), 1.0)
2164
+ : u_matrix * local;
1871
2165
 
1872
2166
  v_normal = a_normal;
1873
2167
  v_kind = a_kind;
1874
2168
  v_world = u_world_origin + pos * u_meters_per_unit;
1875
2169
  v_shadow = u_shadow_matrix * local;
1876
2170
  }
1877
- `,ya=`#version 300 es
2171
+ `,_a=`#version 300 es
1878
2172
  precision highp float;
1879
2173
 
1880
- ${Rt}
1881
- ${Co}
1882
- ${je}
1883
- ${wr}
2174
+ ${zt}
2175
+ ${So}
2176
+ ${Xe}
2177
+ ${_r}
1884
2178
 
1885
2179
  in vec3 v_normal;
1886
2180
  in float v_kind; // 0 \u0432\u0435\u0440\u0445, 1 \u0431\u043E\u0440\u0442, 2 \u044E\u0431\u043A\u0430, 3 \u043A\u0440\u044B\u0448\u043A\u0430 \u043E\u0441\u0442\u0440\u043E\u0432\u0430
@@ -1929,7 +2223,7 @@ void main() {
1929
2223
 
1930
2224
  fragColor = vec4(applyFog(color) * alpha, alpha);
1931
2225
  }
1932
- `,ga=`#version 300 es
2226
+ `,Ca=`#version 300 es
1933
2227
  precision highp float;
1934
2228
 
1935
2229
  in vec2 a_pos; // \u044D\u043A\u0440\u0430\u043D\u043D\u044B\u0435 \u043F\u0438\u043A\u0441\u0435\u043B\u0438 (CSS)
@@ -1959,7 +2253,7 @@ void main() {
1959
2253
  v_scale = a_scale;
1960
2254
  v_fade = a_fade;
1961
2255
  }
1962
- `,va=`#version 300 es
2256
+ `,Sa=`#version 300 es
1963
2257
  precision highp float;
1964
2258
 
1965
2259
  in vec2 v_tex;
@@ -2009,6 +2303,6 @@ void main() {
2009
2303
  if (color.a <= 0.001) discard;
2010
2304
  fragColor = color;
2011
2305
  }
2012
- `;var So=i=>i.kind==="symbol",wa=i=>i.kind==="placement";function We(i,e,t,o){for(let r of i)for(let n=0;n+5<r.length;n+=6){let a=r[n],l=r[n+1],s=r[n+2],c=r[n+3],f=r[n+4],u=r[n+5];if(uc(e,t,a,l,s,c,f,u)||o>0&&(Cr(e,t,a,l,s,c)<=o||Cr(e,t,s,c,f,u)<=o||Cr(e,t,f,u,a,l)<=o))return true}return false}function uc(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),u=s<0||c<0||f<0,h=s>0||c>0||f>0;return !(u&&h)}function Cr(i,e,t,o,r,n){let a=r-t,l=n-o,s=a*a+l*l,c=s>0?Math.max(0,Math.min(1,((i-t)*a+(e-o)*l)/s)):0;return Math.hypot(i-(t+a*c),e-(o+l*c))}function Sr(i,e){let t=new DataView(i.vertices),o=new Uint32Array(i.indices),r=e.bounds(),n=(r.maxX-r.minX)/i.extent,a=new Float64Array(o.length*2);for(let l=0;l<o.length;l++){let s=o[l]*Ne;a[l*2]=r.minX+t.getInt16(s,true)*n,a[l*2+1]=r.minY+t.getInt16(s+2,true)*n;}return a}function Mr(i,e,t){let o=new DataView(i.vertices),r=t.bounds(),n=(r.maxX-r.minX)/e,a=r.minX,l=r.minY,s=new Float64Array(i.indices.length*2);for(let c=0;c<i.indices.length;c++){let f=i.indices[c]*Me;s[c*2]=a+o.getInt16(f,true)*n,s[c*2+1]=l+o.getInt16(f+2,true)*n;}return s}var dc={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},mc=40,pc=10.5,xa=2.5,bc=16,yc=4,gc=7,zt=class{constructor(){this.vbo=null;this.ibo=null;this.vao=null;this.capacity=0;this.perArrow=0;this.indicesPerArrow=0;this.highlightFootprint=null;this.count=0;}render(e,t,o,r,n,a,l,s=false){this.count=0;let c=t.zoom,f=r.layers.filter(x=>x.type==="symbol"&&x.layout?.placement==="map"&&r.layerVisibleAt(x,c));if(!f.length)return;let u=t.center,h=re(u.lng),m=ne(u.lat),d=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(d>0))return;let p=[];for(let x of f){let C=o.get(x.source??K);if(!C)continue;let S=r.bucketKeyFor(x);if(S===null)continue;let M=x.layout?.showFor==="highlight";if(M&&!this.highlightFootprint)continue;let w=d*1.5,T=x.layout?.arrowUnits==="meters"?d:1/t.worldSize,L=D(x.layout?.arrowLength,c,mc)*T,k=D(x.layout?.arrowWidth,c,pc)*T,z=D(x.layout?.arrowOutline,c,xa)*T,A=D(x.layout?.arrowGap,c,bc)*T,I=D(x.layout?.arrowDotRadius,c,yc)*T,E=D(x.layout?.arrowDotGap,c,gc)*T,F=Er(L,k,I,A-E),P=z>0?Er(L,k,I,A-E,z).outline:null,R={layer:x,verts:[],shape:F};for(let W of C.visibleTiles){let O=C.getTile(W)?.data?.buckets?.[S];if(!O||!So(O))continue;let H=new Int16Array(O.anchors),V=O.rotations?new Int16Array(O.rotations):null,Y=W.bounds(),$=(Y.maxX-Y.minX)/O.extent,Q=Y.minX,ue=Y.minY;for(let J=0;J<H.length/2;J++){let X=Q+H[J*2]*$,te=ue+H[J*2+1]*$;if(M&&!We(this.highlightFootprint,X,te,w))continue;let ie=(V?V[J]:0)*Math.PI/180,q=Math.sin(ie),U=-Math.cos(ie),j=X-h-q*A,le=te-m-U*A;P&&kr(R,P,j,le,q,U),kr(R,F.outline,j,le,q,U),this.count++;}}R.verts.length&&p.push(R);}if(!p.length)return;let y=p[0].shape,b=y.outline.length/2,g=[],v=[];for(let x of p){let C=g.length/2/b;for(let S of x.verts)g.push(S);v.push({layer:x.layer,first:C,count:x.verts.length/2/b});}if(this.ensureBuffers(e,g.length/2/b,y,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(g).buffer)),n.use(),l?.(n),s&&n.setMat4("u_shadow_matrix",t.shadowObjectMatrix(h,m,0)),n.setMat4("u_matrix",t.objectMatrix(h,m,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let x of v){let C=x.layer.paint,S=D(C.opacity,c,1),M=ke(C.color,c,[.18,.45,.76,1]),w=ke(C.haloColor,c,[1,1,1,1]),_=D(x.layer.layout?.arrowOutline,c,xa)>0;vc(e,n,x,w,M,S,_,this.indicesPerArrow);}e.bindVAO(null),e.setDepthTest(true);}}ensureBuffers(e,t,o,r){let n=o.outline.length/2;if(this.vao&&t<=this.capacity&&n===this.perArrow)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacity=Math.max(256,Math.ceil(t*1.5)),this.perArrow=n,this.indicesPerArrow=o.indices.length,this.vbo=new ye(e,new Uint8Array(this.capacity*n*8),dc,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let l=0;l<this.capacity;l++){let s=l*n;for(let c=0;c<o.indices.length;c++)a[l*o.indices.length+c]=s+o.indices[c];}this.ibo=new de(e,a),this.vao=new fe(e,[{buffer:this.vbo,locations:r}],this.ibo);}destroy(){this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.vao=null,this.vbo=null,this.ibo=null,this.capacity=0;}};function vc(i,e,t,o,r,n,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",_e([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=s)_a(i,t.first+c,l);}e.setVec4v("u_color",_e([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=s)_a(i,t.first+c,l);}function _a(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var Ca=4,Tr=12;function Er(i,e,t,o,r=0){let n=i*.38,a=e*1.35,l=n*.3,s=e*.32,c=e/2,f=-i+s,u=[],h=(b,g)=>u.push(b,g);h(0,0),h(-n,a),h(-n+l,c),h(f,s);for(let b=1;b<Ca;b++){let g=b/Ca*Math.PI;h(f-Math.sin(g)*s,Math.cos(g)*s);}h(f,-s),h(-n+l,-c),h(-n,-a);let m=r>0?wc(u,r):u,d=Qn(u,void 0,2);if(t<=0)return {outline:m,indices:d};let p=m.length/2,y=t+r;for(let b=0;b<Tr;b++){let g=b/Tr*Math.PI*2;m.push(o+Math.cos(g)*y,Math.sin(g)*y);}for(let b=1;b<Tr-1;b++)d.push(p,p+b,p+b+1);return {outline:m,indices:d}}function wc(i,e){let t=i.length/2,o=0;for(let a=0;a<t;a++){let l=(a+1)%t;o+=i[a*2]*i[l*2+1]-i[l*2]*i[a*2+1];}let r=o<0?-1:1,n=[];for(let a=0;a<t;a++){let l=i[(a+t-1)%t*2],s=i[(a+t-1)%t*2+1],c=i[a*2],f=i[a*2+1],u=i[(a+1)%t*2],h=i[(a+1)%t*2+1],m=Math.hypot(c-l,f-s)||1,d=Math.hypot(u-c,h-f)||1,p=r*(f-s)/m,y=-r*(c-l)/m,b=r*(h-f)/d,g=-r*(u-c)/d,v=p+b,x=y+g,C=Math.hypot(v,x);if(C<1e-9){n.push(c,f);continue}v/=C,x/=C;let S=Math.min(1/Math.max(v*p+x*y,.35),3);n.push(c+v*e*S,f+x*e*S);}return n}function kr(i,e,t,o,r,n){let a=-n,l=r;for(let s=0;s<e.length;s+=2){let c=e[s],f=e[s+1];i.verts.push(t+r*c+a*f,o+n*c+l*f);}}function xc(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return kr(s,Er(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var _c=5;function Sa(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var Mo=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,n,a,l,s=false){if(!a.size)return;let c=n.layers.filter(f=>f.type==="raster"&&!!f.overlay===s&&n.layerVisibleAt(f,l));if(c.length){r.use(),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),r.setInt("u_image",0);for(let f of c){let u=a.get(f.source);if(!u)continue;let h=D(f.paint?.opacity,l,1);if(!(h<=.001)){r.setFloat("u_opacity",h),o.bind();for(let m of u.visibleTiles){let d=this.patchFor(e,u,m);d&&(e.bindTexture(0,d.texture),r.setVec3("u_uv_transform",d.uv[0],d.uv[1],d.uv[2]),r.setMat4("u_matrix",t.tileMatrix(m,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));}}}e.bindVAO(null);}}patchFor(e,t,o){let r=t.getTile(o),n=r&&r.state==="loaded"?this.textureFor(e,r):null;if(n)return {texture:n,uv:[0,0,1]};for(let a=1;a<=_c&&a<=o.z;a++){let l=o.scaledTo(o.z-a),s=t.getTile(l);if(!s||s.state!=="loaded")continue;let c=this.textureFor(e,s);if(c)return {texture:c,uv:Sa(o,a)}}return null}textureFor(e,t){let o=t.texture;if(o)return o.handle;if(!t.image)return null;let r=e.gl,n=r.createTexture();if(!n)return null;e.bindTexture(0,n),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t.image),r.generateMipmap(r.TEXTURE_2D),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),this.applyAnisotropy(r);let a={handle:n,destroy:()=>r.deleteTexture(n)};return t.texture=a,t.image.close(),t.image=null,n}applyAnisotropy(e){if(!this.anisotropyChecked){this.anisotropyChecked=true;let t=e.getExtension("EXT_texture_filter_anisotropic");t&&(this.anisotropyPname=t.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropy=Math.min(4,e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT)));}this.anisotropy>0&&e.texParameterf(e.TEXTURE_2D,this.anisotropyPname,this.anisotropy);}};var Cc="indoor-",Pt=class{constructor(){this.parts=null;this.stamp="";this.cache=new B;this.box=null;this.hidden=new ee;this.collected=new ee;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],n;for(let h of t.layers){if(!h.id.startsWith(Cc)||h.type!=="fill"||!t.layerVisibleAt(h,o))continue;let m=t.bucketKeyFor(h);m&&(r.push(m),n??(n=e.get(h.source??K)));}if(!r.length||!n){this.parts&&this.destroy();return}let a=r.join(",")+"|"+n.visibleTiles.map(h=>h.dataKey+(n.getTile(h)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let l=[],s=1/0,c=1/0,f=-1/0,u=-1/0;for(let h of n.visibleTiles){let m=n.getTile(h)?.data?.buckets;if(m)for(let d of r){let p=m[d];if(!p||p.kind!=="fill")continue;let y=Sr(p,h);l.push(y);for(let b=0;b<y.length;b+=2)y[b]<s&&(s=y[b]),y[b]>f&&(f=y[b]),y[b+1]<c&&(c=y[b+1]),y[b+1]>u&&(u=y[b+1]);}}this.parts=l.length?l:null,this.box=l.length?[s,c,f,u]:null,this.hidden.clear(),this.collected.clear();}collectHidden(e,t){let o=this.parts;if(!o||!e.featureIds)return;let r=new Uint32Array(e.indices),n=new Float64Array(e.featureIds),a=new DataView(e.vertices),l=t.bounds(),s=(l.maxX-l.minX)/e.extent,c=this.box,f=new B;for(let u=0;u*3<r.length;u++){let h=n[u];if(this.hidden.has(h))continue;let m=f.get(h);m||f.set(h,m=[1/0,1/0,-1/0,-1/0]);for(let d=0;d<3;d++){let p=r[u*3+d]*Me,y=a.getInt16(p,true),b=a.getInt16(p+2,true);y<m[0]&&(m[0]=y),b<m[1]&&(m[1]=b),y>m[2]&&(m[2]=y),b>m[3]&&(m[3]=b);}}for(let[u,h]of f){let m=l.minX+(h[0]+h[2])/2*s,d=l.minY+(h[1]+h[3])/2*s;c&&(m<c[0]||m>c[2]||d<c[1]||d>c[3])||We(o,m,d,0)&&this.hidden.add(u);}}destroy(){this.parts=null,this.hidden.clear(),this.collected.clear(),this.box=null,this.stamp="",this.free();}free(){this.cache.forEach(e=>{e?.vao.destroy(),e?.ibo.destroy();}),this.cache.clear();}prepare(e,t){if(!this.parts)return;let o=this.hidden.size;for(let r of e.visibleTiles){if(this.collected.has(r.dataKey))continue;let n=e.getTile(r)?.data?.buckets?.[t];!n||n.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(n,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,n,a){if(!this.parts)return null;let l=this.cache.get(r.dataKey);if(l!==void 0)return l;let s=t.data?.buckets?.[o];if(!s)return null;let c=null;if(s.kind==="fill-extrusion"&&s.featureIds&&this.hidden.size){let f=new Uint32Array(s.indices),u=new Float64Array(s.featureIds),h=[];for(let m=0;m*3<f.length;m++)this.hidden.has(u[m])||h.push(f[m*3],f[m*3+1],f[m*3+2]);if(h.length<f.length){let m=new de(e,new Uint32Array(h));c={vao:new fe(e,[{buffer:n,locations:a}],m),ibo:m,count:h.length};}}return this.cache.set(r.dataKey,c),c}};var Ma=35,Sc=70,Mc=.35,Tc=.5,Ec=1.1;function mt(i,e){let t=e.sky;if(!t.enabled||t.fogIntensity<=0)return {near:0,far:1/0,intensity:0,cutoff:1/0};let o=i.cameraToCenterDistance,r=we((i.pitch-Ma)/(Sc-Ma),0,1),n=t.fogRange[0]*(1-Mc*r)*o,a=t.fogRange[1]*(1-Tc*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*Ec:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function Ar(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let u=e.getTile(f),h=u&&Ta(u,t);if(!h||!Fe(l,i.tileMatrix64(f,h.extent))||(ce(s,l,[r,n,-1,1]),ce(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let m=s[0]/s[3],d=s[1]/s[3],p=s[2]/s[3],y=c[0]/c[3]-m,b=c[1]/c[3]-d,g=c[2]/c[3]-p,v=Ac(h,m,d,p,y,b,g);v&&(!a||v.t<a.distance)&&(a={featureId:v.featureId,tile:f,layerId:t,distance:v.t});}return a}function Lr(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let u=e.getTile(f);if(u)for(let h of t){let m=u.data?.buckets?.[h];if(!m||m.kind!=="fill"||!m.featureIds||!Fe(l,i.tileMatrix64(f,m.extent))||(ce(s,l,[r,n,-1,1]),ce(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let d=s[0]/s[3],p=s[1]/s[3],y=s[2]/s[3],b=c[2]/c[3]-y;if(Math.abs(b)<1e-9)continue;let g=-y/b;if(g<0||g>1)continue;let v=d+(c[0]/c[3]-d)*g,x=p+(c[1]/c[3]-p)*g,C=kc(m,v,x);C!==null&&(!a||g<a.distance)&&(a={featureId:C,tile:f,layerId:h,distance:g});}}return a}function kc(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*Ne,true),l=s=>o.getInt16(s*Ne+2,true);for(let s=0;s*3<r.length;s++){let c=r[s*3],f=r[s*3+1],u=r[s*3+2],h=a(c),m=l(c),d=a(f),p=l(f),y=a(u),b=l(u),g=(e-d)*(m-p)-(h-d)*(t-p),v=(e-y)*(p-b)-(d-y)*(t-b),x=(e-h)*(b-m)-(y-h)*(t-m),C=g<0||v<0||x<0,S=g>0||v>0||x>0;if(!(C&&S))return n[s]}return null}function Ta(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function Ac(i,e,t,o,r,n,a){let l=new DataView(i.vertices),s=new Uint32Array(i.indices),c=new Float64Array(i.featureIds),f=p=>l.getInt16(p*Me,true)/lt,u=p=>l.getInt16(p*Me+2,true)/lt,h=p=>l.getUint16(p*Me+4,true)/st,m=1/0,d=-1;for(let p=0;p+2<s.length;p+=3){let y=s[p],b=s[p+1],g=s[p+2],v=f(y),x=u(y),C=h(y),S=f(b)-v,M=u(b)-x,w=h(b)-C,_=f(g)-v,T=u(g)-x,L=h(g)-C,k=n*L-a*T,z=a*_-r*L,A=r*T-n*_,I=S*k+M*z+w*A;if(I>-1e-9&&I<1e-9)continue;let E=1/I,F=e-v,P=t-x,R=o-C,W=(F*k+P*z+R*A)*E;if(W<0||W>1)continue;let G=P*w-R*M,O=R*S-F*w,H=F*M-P*S,V=(r*G+n*O+a*H)*E;if(V<0||W+V>1)continue;let Y=(_*G+T*O+L*H)*E;Y<0||Y>1||Y>=m||(m=Y,d=c[p/3]??0);}return d>=0?{featureId:d,t:m}:null}function To(i,e,t){let o=Ta(i,e);if(!o)return null;let r=new Uint32Array(o.indices),n=new Float64Array(o.featureIds),a=[];for(let l=0;l+2<r.length;l+=3)n[l/3]===t&&a.push(r[l],r[l+1],r[l+2]);return a.length?{vertices:o.vertices,indices:new Uint32Array(a)}:null}var pt=24,Ir=8,Ic=2,Fc=12,Eo=8,ko=8;function Ht(i){let e=0;for(let m of i)e+=m.length/2;if(e<2)return null;let t=(Eo+2)*2,o=e*t+i.length*(ko+2)*2+8,r=e*(Eo+2)*6+i.length*ko*6+24,n=new ArrayBuffer(o*pt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(m,d,p,y,b,g)=>{let v=s*pt;return a.setFloat32(v,m,true),a.setFloat32(v+4,d,true),a.setFloat32(v+8,p,true),a.setFloat32(v+12,y,true),a.setFloat32(v+16,b,true),a.setFloat32(v+20,g,true),s++},u=(m,d,p,y)=>{l[c++]=m,l[c++]=d,l[c++]=y,l[c++]=m,l[c++]=y,l[c++]=p;},h=(m,d,p,y,b,g,v)=>{let x=f(m,d,0,0,0,v),C=f(m,d,p,y,1,v);for(let S=1;S<=ko;S++){let M=Math.PI*S/ko,w=p*Math.cos(M)+b*Math.sin(M),_=y*Math.cos(M)+g*Math.sin(M),T=f(m,d,w,_,1,v);l[c++]=x,l[c++]=C,l[c++]=T,C=T;}};for(let m of i){let d=Rc(m),p=d.length/2;if(p<2)continue;let y=new Float64Array(p-1),b=new Float64Array(p-1);for(let S=0;S<p-1;S++){let M=d[S*2+2]-d[S*2],w=d[S*2+3]-d[S*2+1],_=Math.hypot(M,w)||1;y[S]=M/_,b[S]=w/_;}let g=0,v=-1,x=-1;for(let S=0;S<p;S++){let M=d[S*2],w=d[S*2+1];S>0&&(g+=Math.hypot(M-d[S*2-2],w-d[S*2-1]));let _=S>0?S-1:0,T=S<p-1?S:p-2,L=-b[_],k=y[_],z=-b[T],A=y[T],I=L+z,E=k+A,F=Math.hypot(I,E);F>1e-9?(I/=F,E/=F):(I=L,E=k);let P=I*z+E*A,R=P>1e-6?1/P:1/0,W=Math.acos(Math.min(1,Math.max(-1,y[_]*y[T]+b[_]*b[T])));if(!(W>Fc*Math.PI/180)&&R<=Ic){let O=f(M,w,I*R,E*R,1,g),H=f(M,w,-I*R,-E*R,-1,g);v>=0&&u(v,x,O,H),v=O,x=H;}else {let O=Math.max(1,Math.min(Eo,Math.ceil(W/(Math.PI/Eo)))),V=y[_]*b[T]-b[_]*y[T]>=0?1:-1,Y=f(M,w,L,k,1,g),$=f(M,w,-L,-k,-1,g);v>=0&&u(v,x,Y,$);for(let Q=1;Q<=O;Q++){let ue=V*W*(Q/O),J=Math.cos(ue),X=Math.sin(ue),te=L*J-k*X,ie=L*X+k*J,q=f(M,w,te,ie,1,g),U=f(M,w,-te,-ie,-1,g);u(Y,$,q,U),Y=q,$=U;}v=Y,x=$;}}let C=p-2;h(d[0],d[1],-b[0],y[0],-y[0],-b[0],0),h(d[(p-1)*2],d[(p-1)*2+1],-b[C],y[C],y[C],b[C],g);}return c?{vertices:n.slice(0,s*pt),indices:l.slice(0,c),vertexCount:s}:null}function Fr(i){if(!i.length||i[0].length<6)return null;let e=[],t=[];for(let n=0;n<i[0].length;n++)e.push(i[0][n]);for(let n=1;n<i.length;n++)if(!(i[n].length<6)){t.push(e.length/2);for(let a=0;a<i[n].length;a++)e.push(i[n][a]);}let o=Qn(e,t.length?t:void 0,2);if(!o.length)return null;let r=new Uint32Array(o.length);for(let n=0;n<o.length;n+=3)r[n]=o[n],r[n+1]=o[n+2],r[n+2]=o[n+1];return {vertices:new Float32Array(e).buffer,indices:r,vertexCount:e.length/2}}function Rc(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}var Ot=5126,zc={stride:Ir,attribs:[{name:"a_pos",size:2,type:Ot,offset:0}]},zr={stride:pt,attribs:[{name:"a_pos",size:2,type:Ot,offset:0},{name:"a_extrude",size:2,type:Ot,offset:8},{name:"a_side",size:1,type:Ot,offset:16},{name:"a_dist",size:1,type:Ot,offset:20}]},Rr=class{constructor(e,t){this.revision=e;this.parts=t;}destroy(){for(let e of this.parts)e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy();}},Pc=(i,e)=>[i[0],i[1],i[2],i[3]*e],Wt=class{constructor(){this.objects=[];this.markers=[];this.gpu=new B;this.markerHost=null;}setMarkerHost(e){this.markerHost=e;for(let t of this.markers)t.attach(e);}add(e){this.objects.includes(e)||this.objects.push(e);}remove(e){let t=this.objects.indexOf(e);t<0||(this.objects.splice(t,1),this.gpu.get(e.id)?.destroy(),this.gpu.delete(e.id));}addMarker(e){this.markers.includes(e)||(this.markers.push(e),this.markerHost&&e.attach(this.markerHost));}removeMarker(e){let t=this.markers.indexOf(e);t<0||(this.markers.splice(t,1),e.detach());}get all(){return this.objects}get allMarkers(){return this.markers}get isEmpty(){return this.objects.length===0}updateMarkers(e){for(let t of this.markers)t.update(e);}render(e,t,o,r,n,a,l,s=false,c=false){if(!this.objects.length||c&&!this.objects.some(d=>d.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((d,p)=>d.zIndex-p.zIndex);let f=e.gl.drawingBufferWidth,u=t.width>0?f/t.width:1,h=t.worldSize*u,m=null;for(let d of this.objects){if(!d.visible)continue;let p=d.ghostOpacity;if(c&&p<=0)continue;let y=this.gpuFor(e,d,r,a);if(!y)continue;let b=s?t.shadowObjectMatrix(d.originX,d.originY,d.altitude):null,g=t.objectMatrix(d.originX,d.originY,d.altitude);for(let{part:v,vao:x,ibo:C}of y.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let S=c?Pc(v.color,p):v.color;if(v.kind==="fill")m!==o&&(o.use(),l?.(o),m=o),o.setVec4v("u_color",_e(S)),b&&o.setMat4("u_shadow_matrix",b),o.setMat4("u_matrix",g);else {m!==n&&(n.use(),l?.(n),m=n);let M=v.width/2*u,w=h>1e-9?1/h:1;if(n.setVec4v("u_color",_e(S)),n.setFloat("u_half_width",M),n.setFloat("u_offset",(v.offset??0)*u),n.setFloat("u_aa",1),n.setFloat("u_units_per_px",w),n.setFloat("u_units_to_px",h),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[_,T]=v.dashArray;n.setVec2("u_dash",_*u,(_+T)*u);}if(v.arrow){n.setVec4v("u_arrow_color",_e(v.arrowColor??[1,1,1,1]));let _=(v.arrowSize??5)*u;n.setVec3("u_arrow",(v.arrowPeriod??46)*u,Math.max(_*.4,1),Math.min(_,M*.72));}b&&n.setMat4("u_shadow_matrix",b),n.setMat4("u_matrix",g);}x.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.count,C.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=(a,l,s)=>e.worldPxToPoint(re(a)*r,ne(l)*r,s);for(let a=this.objects.length-1;a>=0;a--){let l=this.objects[a];if(l.visible&&l.hitTest(t,n,o))return l}return null}boundsOf(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e.rings())for(let l of a){let s=Z(l);s.lng<t&&(t=s.lng),s.lng>r&&(r=s.lng),s.lat<o&&(o=s.lat),s.lat>n&&(n=s.lat);}return isFinite(t)?{west:t,south:o,east:r,north:n}:null}gpuFor(e,t,o,r){let n=this.gpu.get(t.id);if(n&&n.revision===t.revision)return n;n?.destroy();let a=[];for(let s of t.build()){let c=s.kind==="fill"?zc:zr,f=s.kind==="fill"?o:r,u=new ye(e,new Uint8Array(s.mesh.vertices),c),h=new de(e,s.mesh.indices),m=new fe(e,[{buffer:u,locations:f}],h);a.push({part:s,vao:m,vbo:u,ibo:h});}let l=new Rr(t.revision,a);return this.gpu.set(t.id,l),a.length?l:null}destroy(){for(let e of this.gpu.values())e.destroy();this.gpu.clear();for(let e of this.markers)e.detach();this.markers=[],this.objects=[];}};var Ao=32,Hc=1179937895,Oc=1313821514,Wc=5130562,Bc={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Vc={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function Pr(i){let{json:e,bin:t}=Ea(i),o=await Gc(e,t);return Aa(e,t,o)}function Dc(i){let{json:e,bin:t}=Ea(i);for(let o of e.bufferViews??[])if(o.extensions?.EXT_meshopt_compression)throw new Error("[osmgl] GLB \u0441\u0436\u0430\u0442 meshopt \u2014 \u043D\u0443\u0436\u0435\u043D parseGlbAsync");return Aa(e,t,null)}function Ea(i){let e=new DataView(i);if(e.getUint32(0,true)!==Hc)throw new Error("[osmgl] \u044D\u0442\u043E \u043D\u0435 GLB: \u043D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0438\u0433\u043D\u0430\u0442\u0443\u0440\u0430");if(e.getUint32(4,true)!==2)throw new Error("[osmgl] \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E glTF 2.0");let t=null,o=null,r=12;for(;r+8<=i.byteLength;){let n=e.getUint32(r,true),a=e.getUint32(r+4,true),l=r+8;a===Oc?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,l,n))):a===Wc&&(o=new Uint8Array(i,l,n)),r=l+n+(4-n%4)%4;}if(!t)throw new Error("[osmgl] \u0432 GLB \u043D\u0435\u0442 JSON-\u043A\u0443\u0441\u043A\u0430");return {json:t,bin:o??new Uint8Array(0)}}async function Gc(i,e){let t=i.bufferViews??[],o=[];for(let a=0;a<t.length;a++)t[a].extensions?.EXT_meshopt_compression&&o.push(a);if(!o.length)return null;let{MeshoptDecoder:r}=await import('meshoptimizer');await r.ready;let n=new Map;for(let a of o){let l=t[a].extensions.EXT_meshopt_compression,s=l.byteOffset??0,c=e.subarray(s,s+l.byteLength),f=new Uint8Array(l.count*l.byteStride);r.decodeGltfBuffer(f,l.count,l.byteStride,c,l.mode,l.filter??"NONE"),n.set(a,f);}return n}function ka(i){let e=N();if(i.matrix){for(let w=0;w<16;w++)e[w]=i.matrix[w];return e}Pe(e);let[t,o,r]=i.translation??[0,0,0],[n,a,l,s]=i.rotation??[0,0,0,1],[c,f,u]=i.scale??[1,1,1],h=n+n,m=a+a,d=l+l,p=n*h,y=n*m,b=n*d,g=a*m,v=a*d,x=l*d,C=s*h,S=s*m,M=s*d;return e[0]=(1-(g+x))*c,e[1]=(y+M)*c,e[2]=(b-S)*c,e[4]=(y-M)*f,e[5]=(1-(p+x))*f,e[6]=(v+C)*f,e[8]=(b+S)*u,e[9]=(v-C)*u,e[10]=(1-(p+g))*u,e[12]=t,e[13]=o,e[14]=r,e}var Nc={5120:127,5121:255,5122:32767,5123:65535};function Uc(i){let e=i[0],t=i[1],o=i[2],r=i[4],n=i[5],a=i[6],l=i[8],s=i[9],c=i[10],f=e*(n*c-a*s)-r*(t*c-o*s)+l*(t*a-o*n);if(Math.abs(f)<1e-20)return [1,0,0,0,1,0,0,0,1];let u=1/f;return [(n*c-a*s)*u,(a*l-r*c)*u,(r*s-n*l)*u,(o*s-t*c)*u,(e*c-o*l)*u,(t*l-e*s)*u,(t*a-o*n)*u,(o*r-e*a)*u,(e*n-t*r)*u]}function Aa(i,e,t){let o=w=>{let _=t?.get(w);if(_)return _;let T=i.bufferViews?.[w];if(!T)return null;let L=T.byteOffset??0;return e.subarray(L,L+T.byteLength)},r=[],n=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],u=w=>{if(w===void 0)return null;let _=i.accessors?.[w];if(!_)return null;let T=Vc[_.type]??1,L=new Float64Array(_.count*T),k=_.bufferView!==void 0?i.bufferViews?.[_.bufferView]:void 0;if(!k||_.bufferView===void 0)return {data:L,components:T};let z=o(_.bufferView);if(!z)return {data:L,components:T};let A=Bc[_.componentType]??4,I=k.extensions?.EXT_meshopt_compression,E=I?I.byteStride:k.byteStride,F=E&&E>0?E:A*T,P=_.byteOffset??0,R=new DataView(z.buffer,z.byteOffset,z.byteLength),W=_.normalized?Nc[_.componentType]??1:1;for(let G=0;G<_.count;G++)for(let O=0;O<T;O++){let H=P+G*F+O*A,V;switch(_.componentType){case 5120:V=R.getInt8(H);break;case 5121:V=R.getUint8(H);break;case 5122:V=R.getInt16(H,true);break;case 5123:V=R.getUint16(H,true);break;case 5125:V=R.getUint32(H,true);break;default:V=R.getFloat32(H,true);}L[G*T+O]=W===1?V:Math.max(V/W,-1);}return {data:L,components:T}},h=(w,_,T=-1)=>{if(w.mode!==void 0&&w.mode!==4)return;let L=u(w.attributes.POSITION);if(!L)return;let k=u(w.attributes.NORMAL),z=u(w.attributes.TEXCOORD_0),A=u(w.indices),I=r.length/3,E=L.data.length/3,F=Uc(_),R=(w.material!==void 0?i.materials?.[w.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,W=R?{ox:R.offset?.[0]??0,oy:R.offset?.[1]??0,sx:R.scale?.[0]??1,sy:R.scale?.[1]??1,rot:R.rotation??0}:null;for(let X=0;X<E;X++){let te=L.data[X*3],ie=L.data[X*3+1],q=L.data[X*3+2],U=_[0]*te+_[4]*ie+_[8]*q+_[12],j=_[1]*te+_[5]*ie+_[9]*q+_[13],le=_[2]*te+_[6]*ie+_[10]*q+_[14];if(r.push(U,j,le),U<c[0]&&(c[0]=U),j<c[1]&&(c[1]=j),le<c[2]&&(c[2]=le),U>f[0]&&(f[0]=U),j>f[1]&&(f[1]=j),le>f[2]&&(f[2]=le),k){let oe=k.data[X*3],ge=k.data[X*3+1],Ee=k.data[X*3+2],ve=F[0]*oe+F[3]*ge+F[6]*Ee,oo=F[1]*oe+F[4]*ge+F[7]*Ee,ro=F[2]*oe+F[5]*ge+F[8]*Ee,no=Math.hypot(ve,oo,ro);no>1e-12?(ve/=no,oo/=no,ro/=no):(ve=0,oo=1,ro=0),n.push(ve,oo,ro);}else n.push(0,1,0);let ae=z?z.data[X*2]:0,se=z?z.data[X*2+1]:0;if(W){if(W.rot!==0){let oe=Math.cos(W.rot),ge=Math.sin(W.rot),Ee=oe*ae+ge*se,ve=-ge*ae+oe*se;ae=Ee,se=ve;}ae=ae*W.sx+W.ox,se=se*W.sy+W.oy;}a.push(ae,se);}let G=l.length;if(A)for(let X=0;X<A.data.length;X++)l.push(I+A.data[X]);else for(let X=0;X<E;X++)l.push(I+X);let O=w.material!==void 0?i.materials?.[w.material]:void 0,H=O?.pbrMetallicRoughness,V=H?.metallicFactor!==void 0||H?.roughnessFactor!==void 0,Y=H?.baseColorFactor??[1,1,1,1],$=H?.baseColorTexture?.index,Q=$!==void 0?i.textures?.[$]?.source:void 0,ue=O?.emissiveFactor??[0,0,0],J=O?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:G,indexCount:l.length-G,baseColor:[Y[0],Y[1],Y[2],Y[3]??1],metallic:V?H?.metallicFactor??1:0,roughness:V?H?.roughnessFactor??1:1,emissive:[ue[0]*J,ue[1]*J,ue[2]*J],texture:Q??-1,doubleSided:O?.doubleSided===true,blend:O?.alphaMode==="BLEND",alphaCutoff:O?.alphaMode==="MASK"?O.alphaCutoff??.5:.02,node:T});},m=i.skins?.length?null:jc(i,u),d=m?m.nodes:null,p=(w,_,T,L)=>{let k=i.nodes?.[w];if(!k)return;let z=ka(k),A=N();xe(A,_,z);let I=N(),E=L,F=d?.get(w);if(F?(F.parentNode=L,F.parent=T.slice(),Pe(I),E=w):xe(I,T,z),k.mesh!==void 0)for(let R of i.meshes?.[k.mesh]?.primitives??[])h(R,I,E);let P=k.extensions?.KHR_lights_punctual?.light;if(P!==void 0){let R=i.extensions?.KHR_lights_punctual?.lights?.[P],W=R?.type;if(R&&(W==="point"||W==="spot"||W==="directional")){let G=-A[8],O=-A[9],H=-A[10],V=Math.hypot(G,O,H)||1,Y=R.spot?.innerConeAngle??0,$=R.spot?.outerConeAngle??Math.PI/4;y.push({type:W,color:[R.color?.[0]??1,R.color?.[1]??1,R.color?.[2]??1],intensity:R.intensity??1,range:R.range??0,position:[A[12],A[13],A[14]],direction:[G/V,O/V,H/V],cosInner:Math.cos(Y),cosOuter:Math.cos($)});}}for(let R of k.children??[])p(R,A,I,E);},y=[],b=N();Pe(b);let g=N();Pe(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((w,_)=>_)??[];for(let w of v)p(w,b,g,-1);let x=[];for(let w of i.images??[]){if(w.bufferView===void 0){x.push(new Uint8Array(0));continue}let _=o(w.bufferView);x.push(_?_.slice():new Uint8Array(0));}let C=r.length/3,S=new ArrayBuffer(C*Ao),M=new Float32Array(S);for(let w=0;w<C;w++){let _=w*8;M[_]=r[w*3],M[_+1]=r[w*3+1],M[_+2]=r[w*3+2],M[_+3]=n[w*3],M[_+4]=n[w*3+1],M[_+5]=n[w*3+2],M[_+6]=a[w*2],M[_+7]=a[w*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,f[0]=f[1]=f[2]=0),{vertices:S,indices:new Uint32Array(l),primitives:s,images:x,min:c,max:f,animation:m,lights:y}}function jc(i,e){let t=i.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let n of t.channels){let a=n.target.node,l=n.target.path;if(a===void 0||l!=="translation"&&l!=="rotation"&&l!=="scale")continue;let s=t.samplers[n.sampler];if(!s)continue;let c=e(s.input),f=e(s.output);if(!c||!f||!c.data.length)continue;let u=l==="rotation"?4:3,h=s.interpolation==="CUBICSPLINE",m=c.data.length,d=new Float32Array(m*u);for(let y=0;y<m;y++){let b=h?(y*3+1)*u:y*u;for(let g=0;g<u;g++)d[y*u+g]=f.data[b+g];}let p=o.get(a)??{parentNode:-1,parent:Pe(N()),base:Xc(i.nodes?.[a]),channels:[]};p.channels.push({path:l,times:Float32Array.from(c.data),values:d,step:s.interpolation==="STEP"}),o.set(a,p),r=Math.max(r,c.data[m-1]);}return o.size?{duration:r||1,nodes:o}:null}function Xc(i){let e=i?.translation,t=i?.rotation,o=i?.scale;return {t:[e?.[0]??0,e?.[1]??0,e?.[2]??0],r:[t?.[0]??0,t?.[1]??0,t?.[2]??0,t?.[3]??1],s:[o?.[0]??1,o?.[1]??1,o?.[2]??1]}}function Hr(i,e,t,o){let r=i.nodes.get(e);if(!r)return Pe(o);let n=N();Yc(r,t,n);let a=N();if(xe(a,r.parent,n),r.parentNode<0)return La(o,a);let l=N();return Hr(i,r.parentNode,t,l),xe(o,l,a)}var La=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function Yc(i,e,t){let o=[...i.base.t],r=[...i.base.r],n=[...i.base.s];for(let a of i.channels){let l=a.times.length,s=a.path==="rotation"?4:3,c=0;for(;c<l-1&&a.times[c+1]<e;)c++;let f=Math.min(c+1,l-1),u=a.times[f]-a.times[c],h=a.step||u<=0?0:Math.min(Math.max((e-a.times[c])/u,0),1),m=c*s,d=f*s;if(a.path==="rotation"){let p=0;for(let g=0;g<4;g++)p+=a.values[m+g]*a.values[d+g];let y=p<0?-1:1,b=0;for(let g=0;g<4;g++)r[g]=a.values[m+g]*(1-h)+a.values[d+g]*y*h,b+=r[g]*r[g];b=Math.sqrt(b)||1;for(let g=0;g<4;g++)r[g]/=b;}else {let p=a.path==="translation"?o:n;for(let y=0;y<3;y++)p[y]=a.values[m+y]*(1-h)+a.values[d+y]*h;}}return La(t,ka({translation:o,rotation:r,scale:n}))}var Te=5126,Kc=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Ia={stride:Ao,attribs:[{name:"a_pos",size:3,type:Te,offset:0},{name:"a_normal",size:3,type:Te,offset:12},{name:"a_tex",size:2,type:Te,offset:24}]},Wr=class{constructor(e,t,o,r){this.vao=e;this.vbo=t;this.ibo=o;this.textures=r;this.users=0;this.instVao=null;}destroy(e){this.vao.destroy(),this.instVao?.destroy(),this.vbo.destroy(),this.ibo.destroy();for(let t of this.textures)t&&e.deleteTexture(t);}},Or=256,Lo=41,Fa={stride:Lo*4,attribs:[{name:"a_i_m0",size:4,type:Te,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Te,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Te,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Te,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Te,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Te,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Te,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Te,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Te,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Te,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Te,offset:152,divisor:1}]},Bt=2,bt=16,Xe=class{constructor(){this.models=[];this.gpu=new B;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Or*Lo);this.drawnInstanced=new Set;this.onLoaded=null;this.growDurationSec=.45;this.fadeDurationSec=.6;this.transitioning=false;this.depthTimeSec=0;this.lightPacks=new WeakMap;this.shadow32=new Float32Array(16);this.shadowNode32=new Float32Array(16);this.shadowNodeColor32=new Float32Array(16);}add(e){this.models.includes(e)||(this.models.push(e),e.isLoaded||e.load(()=>this.onLoaded?.()));}remove(e,t){let o=this.models.indexOf(e);if(o<0)return;this.models.splice(o,1);let r=this.gpu.get(e.url);r&&(this.counted.delete(e)&&r.users--,!(r.users>0)&&(t&&r.destroy(t),this.gpu.delete(e.url)));}get all(){return this.models}get hasTransitions(){return this.transitioning}get hasAnimated(){return this.models.some(e=>e.isAnimated)}get isEmpty(){return this.models.length===0}get readyCount(){return this.models.filter(e=>e.visible&&e.isLoaded).length}render(e,t,o,r,n,a,l=0,s){if(this.models.length){this.drawnInstanced.clear(),s&&this.renderInstanced(e,t,s.shader,s.locations,n,a),o.use(),n(o),o.setInt("u_base_texture",Bt);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let f=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!f||!c.mesh)continue;let u=c.fade<1;o.setFloat("u_opacity",c.fade);let h=c.matrixFor(t);o.setMat4("u_matrix",h),o.setMat3("u_normal_matrix",c.normalMatrix());let m=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let d=c.cameraInModelSpace(t);o.setVec3("u_camera_model",d[0],d[1],d[2]),o.setFloat("u_reflect",1),f.vao.bind();for(let p of [false,true])if(!(u&&!p))for(let y of c.mesh.primitives){if(!u&&y.blend!==p)continue;o.setMat4("u_matrix",y.node>=0?c.matrixForNode(t,y.node,l):h),m&&o.setMat4("u_shadow_matrix",y.node>=0?this.shadowMatrixForNodeAt(t,c,y.node,l):m);let b=y.texture>=0?f.textures[y.texture]:null;o.setFloat("u_has_texture",b?1:0),o.setFloat("u_alpha_cutoff",y.alphaCutoff),b&&e.bindTexture(Bt,b),o.setVec4v("u_base_color",y.baseColor),o.setVec3("u_emissive",y.emissive[0],y.emissive[1],y.emissive[2]),o.setFloat("u_metallic",y.metallic),o.setFloat("u_roughness",y.roughness),e.setCull(y.doubleSided?"none":"back"),e.setBlend(p?"premultiplied":"none"),e.setDepthMask(!p),e.gl.drawElements(e.gl.TRIANGLES,y.indexCount,e.gl.UNSIGNED_INT,y.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,n,a){let l=new B;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(u=>u.blend||u.node>=0))continue;let f=l.get(c.url);f?f.push(c):l.set(c.url,[c]);}let s=false;o.setFloat("u_reflect",0);for(let[,c]of l){if(c.length<2)continue;let f=this.gpuFor(e,c[0],r);if(!f||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new ye(e,this.instScratch,Fa,true)),f.instVao||(f.instVao=new fe(e,[{buffer:f.vbo,locations:r},{buffer:this.instBuffer,locations:r}],f.ibo)),s||(o.use(),n(o),o.setInt("u_base_texture",Bt),o.setFloat("u_opacity",1),s=true);let u=c[0].mesh;for(let h=0;h<c.length;h+=Or){let m=Math.min(Or,c.length-h);for(let d=0;d<m;d++){let p=c[h+d],y=d*Lo;this.instScratch.set(p.matrixFor(t),y);let b=a?this.shadowMatrix(t,p):Kc;this.instScratch.set(b,y+16),this.instScratch.set(p.normalMatrix(),y+32),this.drawnInstanced.add(p);}this.instBuffer.update(this.instScratch.subarray(0,m*Lo)),e.bindVAO(f.instVao.vao);for(let d of u.primitives){let p=d.texture>=0?f.textures[d.texture]:null;o.setFloat("u_has_texture",p?1:0),o.setFloat("u_alpha_cutoff",d.alphaCutoff),p&&e.bindTexture(Bt,p),o.setVec4v("u_base_color",d.baseColor),o.setVec3("u_emissive",d.emissive[0],d.emissive[1],d.emissive[2]),o.setFloat("u_metallic",d.metallic),o.setFloat("u_roughness",d.roughness),e.setCull(d.doubleSided?"none":"back"),e.setBlend("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,d.indexCount,e.gl.UNSIGNED_INT,d.indexOffset*4,m);}}}s&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(f=>f.type!=="directional"),n=r.length<=bt?r:[...r].sort((f,u)=>u.intensity-f.intensity).slice(0,bt),a=new Float32Array(bt*4),l=new Float32Array(bt*4),s=new Float32Array(bt*4),c=new Float32Array(bt*4);n.forEach((f,u)=>{let h=u*4;a[h]=f.position[0],a[h+1]=f.position[1],a[h+2]=f.position[2],a[h+3]=f.range,l[h]=f.color[0]*f.intensity,l[h+1]=f.color[1]*f.intensity,l[h+2]=f.color[2]*f.intensity,l[h+3]=f.type==="spot"?1:0,s[h]=f.direction[0],s[h+1]=f.direction[1],s[h+2]=f.direction[2],c[h]=f.cosInner,c[h+1]=f.cosOuter;}),o={count:n.length,pos:a,color:l,dir:s,cone:c},this.lightPacks.set(t,o);}e.setInt("u_light_count",o.count),o.count!==0&&(e.setVec4Array("u_light_pos",o.pos),e.setVec4Array("u_light_color",o.color),e.setVec4Array("u_light_dir",o.dir),e.setVec4Array("u_light_cone",o.cone));}inView(e,t){if(!t.mesh)return false;let r=t.origin(),n=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+n*.5,n)}advanceTransitions(){this.transitioning=false;for(let e of this.models)e.advanceGrow(this.growDurationSec)&&(this.transitioning=true),e.advanceFade(this.fadeDurationSec)&&(this.transitioning=true);}renderDepth(e,t,o,r){if(this.models.length){o.use();for(let n of this.models){let a=n.visible&&n.fade>.5?this.gpuFor(e,n,r):null;if(!a||!n.mesh)continue;let l=this.shadowMatrix(t,n);o.setMat4("u_matrix",l),a.vao.bind();for(let s of n.mesh.primitives)s.blend||(o.setMat4("u_matrix",s.node>=0?this.shadowMatrixForNode(t,n,s.node):l),e.gl.drawElements(e.gl.TRIANGLES,s.indexCount,e.gl.UNSIGNED_INT,s.indexOffset*4));}e.bindVAO(null);}}shadowMatrix(e,t){let o=t.origin();return t.matrixInSpace(e.shadowObjectMatrix(o.x,o.y,t.altitude),this.shadow32)}shadowMatrixForNode(e,t,o){return this.shadowMatrixForNodeInto(e,t,o,this.depthTimeSec,this.shadowNode32)}shadowMatrixForNodeAt(e,t,o,r){return this.shadowMatrixForNodeInto(e,t,o,r,this.shadowNodeColor32)}shadowMatrixForNodeInto(e,t,o,r,n){let a=t.origin();return t.matrixInSpaceForNode(e.shadowObjectMatrix(a.x,a.y,t.altitude),o,r,n)}gpuFor(e,t,o){let r=this.gpu.get(t.url);if(r)return this.counted.has(t)||(this.counted.add(t),r.users++),r;if(!t.mesh)return null;let n=e.gl,a=new ye(e,new Uint8Array(t.mesh.vertices),Ia),l=new de(e,t.mesh.indices),s=new fe(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(u=>{if(!u)return null;let h=n.createTexture();return h?(e.bindTexture(Bt,h),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,u),n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),h):null}),f=new Wr(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return Ia}static get instanceLayout(){return Fa}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Br=4,Ra=new ee;function $c(i){Ra.has(i)||(Ra.add(i),console.warn(`[osmgl] ${i}`));}var qc=.5,Zc=.01,Qc=300,Vr=127,Dr=128,Vt=5120,Ro=5121,Dt=5122,za=5123,Gt=5126,Jc={stride:8,attribs:[{name:"a_pos",size:2,type:Gt,offset:0}]},Gr={stride:Ne,attribs:[{name:"a_pos",size:2,type:Dt,offset:0}]},Pa={stride:Ue,attribs:[{name:"a_p0",size:2,type:Dt,offset:0},{name:"a_p1",size:2,type:Dt,offset:4},{name:"a_corner",size:2,type:Vt,offset:8},{name:"a_ground",size:2,type:Vt,offset:10},{name:"a_dist",size:1,type:Gt,offset:12},{name:"a_width",size:1,type:Gt,offset:16}]},Io={stride:Me,attribs:[{name:"a_pos",size:2,type:Dt,offset:0},{name:"a_height",size:1,type:za,offset:4},{name:"a_tint",size:1,type:Ro,normalized:true,offset:6},{name:"a_ao",size:1,type:Ro,normalized:true,offset:7},{name:"a_normal",size:3,type:Vt,normalized:true,offset:8},{name:"a_kind",size:1,type:Ro,offset:11},{name:"a_wall",size:3,type:za,offset:12}]},ef={flat:0,water:1,foliage:2,sand:3,asphalt:4},tf=[1,9,14,26,3],Ha={stride:ct,attribs:[{name:"a_pos",size:2,type:Gt,offset:0},{name:"a_level",size:1,type:Dt,offset:8},{name:"a_normal",size:3,type:Vt,normalized:true,offset:10},{name:"a_kind",size:1,type:Ro,offset:13},{name:"a_bleed",size:2,type:Vt,offset:14}]},Nr=class{constructor(e,t,o,r,n,a,l=r){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=n;this.extent=a;this.capIndexOffset=l;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.ibo.destroy();}},Wa={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Nt=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new B;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new Mo;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new B;this.lineLocs=new B;this.objectLine=null;this.objectLineLocs=new B;this.buildingLocs=new B;this.shadows={...Wa};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new B;this.patternScale=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new B;this.highlightKey="";this.groundArrows=new zt;this.highlightTris=new B;this.fillHighlightGpu=new B;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Pt;this.hiddenBuildings=new Set;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new B;this.hiddenStamp="";this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new Xe;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new B;this.modelInstLocs=new B;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=o=>[...o].sort((r,n)=>r-n).join(","),t=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues);if(t!==this.hiddenStamp){this.hiddenStamp=t;for(let o of this.hiddenCut.values())o?.vao.destroy(),o?.ibo.destroy();this.hiddenCut.clear();}}hiddenFor(e,t){return t?this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.hiddenCut.get(l);if(s!==void 0&&(s===null||s.vbo===n))return s;s&&(s.vao.destroy(),s.ibo.destroy());let c=t.data?.buckets?.[o];if(!c||c.kind!=="fill-extrusion"||!c.featureIds)return null;let f=new Uint32Array(c.indices),u=new Float64Array(c.featureIds),h=[];for(let d=0;d*3<f.length;d++)a.has(u[d])||h.push(f[d*3],f[d*3+1],f[d*3+2]);let m=null;if(h.length<f.length){let d=new de(e,new Uint32Array(h));m={vao:new fe(e,[{buffer:n,locations:this.buildingLocs}],d),ibo:d,count:h.length,vbo:n};}return this.hiddenCut.set(l,m),m}init(e){this.symbols?.init(e),this.fill=new me(e,"fill",sa,ca),this.surface=new me(e,"surface",ba,ya),this.line=new me(e,"line",fa,ua),this.objectLine=new me(e,"objectLine",ha,da),this.building=new me(e,"buildings",ma,pa),this.depth=new me(e,"depth",Qi,xr),this.groundShadow=new me(e,"groundShadow",aa,la),this.sky=new me(e,"sky",oa,ra),this.raster=new me(e,"raster",na,ia),this.globeBody=new me(e,"globeBody",Ki,$i),this.globeClip=new me(e,"globeClip",qi,Zi),this.globeMesh=of(e,this.globeBody),this.model=new me(e,"model",Ji,_r),this.modelInstanced=new me(e,"model-instanced",ea,_r),this.modelDepth=new me(e,"modelDepth",ta,xr);for(let n of Xe.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...Xe.layout.attribs,...Xe.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=Xi(e);let t=new B([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new ye(e,new Float32Array([0,0,1,0,1,1,0,1]),Jc),r=new de(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new fe(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let n of Gr.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of Ha.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of Pa.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of zr.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of Io.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));}render(e,t,o,r,n,a=new B){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=n/1e3,this.materialAnimating=false,this.fog=mt(t,r),this.patternScale=lo/Math.max(Ae(t.center.lat),1);let c=d=>o.get(d.source??K);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,l),this.syncHiddenStamp(),this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,n),this.drawSky(e,t,r),this.drawGlobeBody(e,t,r),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let f=d=>d.type==="line"&&D(d.paint.elevation,l,0)!==0,u=new Set;for(let d of r.layers){if(d.type==="raster"||d.type==="fill-extrusion"||d.type==="symbol"||d.overlay||f(d)||!r.layerVisibleAt(d,l))continue;let p=c(d);if(p){if(d.type==="line"&&d.network){if(u.has(d.network))continue;u.add(d.network),this.drawNetwork(e,t,r,c,d.network,l,y=>!y.overlay&&!f(y)&&r.layerVisibleAt(y,l));continue}if(d.type==="surface"){if(!this.flattened(p,r,d))continue;this.drawFill(e,t,p,r,d,l);continue}d.type==="fill"?this.drawFill(e,t,p,r,d,l):this.drawLine(e,t,p,r,d,l);}}this.drawFillHighlight(e,t,o,r),this.groundArrows&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,d=>{this.applyFogUniforms(d,t,r),d.setVec4("u_globe",0,0,0,0),d.setInt("u_material",0),d.setFloat("u_elevation",0),d.setVec2("u_world_origin",0,0);},this.shadowActive)),this.drawGroundShadow(e,t,o,r),this.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let d of r.layers){if(d.type!=="surface"||d.overlay||!r.layerVisibleAt(d,l))continue;let p=c(d);p&&(this.flattened(p,r,d)||this.drawSurface(e,t,p,r,d,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let h=new Set;for(let d of r.layers){if(d.type==="raster"||!f(d)||d.overlay||!r.layerVisibleAt(d,l))continue;let p=c(d);if(p){if(d.type==="line"&&d.network){if(h.has(d.network))continue;h.add(d.network),this.drawNetwork(e,t,r,c,d.network,l,y=>!y.overlay&&f(y)&&r.layerVisibleAt(y,l));continue}this.drawLine(e,t,p,r,d,l);}}e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let d of r.layers){if(d.type!=="fill-extrusion"||!r.layerVisibleAt(d,l))continue;let p=c(d);p&&(this.drawBuildings(e,t,p,r,d,l,n)&&(s=true),this.drawHighlight(e,t,p,r,d,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,d=>{this.applyShadowUniforms(d),this.applyFogUniforms(d,t,r),this.applyLight(d,r);},this.shadowActive,n/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(s=true)),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");for(let d of r.layers){if(d.type==="raster"||!d.overlay||d.type==="symbol"||d.type==="fill-extrusion"||!r.layerVisibleAt(d,l))continue;let p=c(d);if(p){if(d.type==="surface"){this.flattened(p,r,d)?this.drawFill(e,t,p,r,d,l):this.drawSurface(e,t,p,r,d,l),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");continue}d.type==="fill"?this.drawFill(e,t,p,r,d,l):this.drawLine(e,t,p,r,d,l);}}this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,d=>{this.applyFogUniforms(d,t,r),d.setVec4("u_globe",0,0,0,0),d.setInt("u_material",0),d.setFloat("u_elevation",0),d.setVec2("u_world_origin",0,0);},this.shadowActive),e.setDepthTest(false)),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l,true);let m=r.layers.filter(d=>d.type==="line"&&D(d.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(d,l));if(m.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let d of m){let p=c(d);p&&this.drawLine(e,t,p,r,d,l,D(d.paint.ghostOpacity,l,0));}e.setDepthFunc("lequal"),e.setDepthTest(false);}return this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,d=>{this.applyFogUniforms(d,t,r),d.setVec4("u_globe",0,0,0,0),d.setInt("u_material",0),d.setFloat("u_elevation",0),d.setVec2("u_world_origin",0,0);},this.shadowActive,true),e.setDepthFunc("lequal"),e.setDepthTest(false)),this.symbols&&(this.symbols.highlightFootprint=this.highlightFootprint()),this.symbols?.render(e,t,o,r),e.bindVAO(null),s||this.materialAnimating}renderShadowMap(e,t,o,r,n){if(this.shadowPlaceholder&&e.bindTexture(Br,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(u=>u.type==="fill-extrusion"&&!u.overlay&&r.layerVisibleAt(u,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new Ft(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(Fo(l.keyAzimuth,l.keyAltitude),Qc),!t.shadowReady)return;let s=this.shadowTarget;s.bind(),e.setDepthFunc("lequal"),e.setBlend("none"),e.setCull("none");let c=e.gl;c.enable(c.POLYGON_OFFSET_FILL),c.polygonOffset(2,4);let f=this.depth;f.use();for(let u of a){let h=o.get(u.source??K);if(!h)continue;let m=r.bucketKeyFor(u);if(m===null)continue;let d=D(u.paint.heightScale,t.zoom,1);(u.source??K)===K&&this.indoorMask.prepare(h,m);for(let p of h.visibleTiles){if(!this.drawsTile(t,r,u,p))continue;let y=h.getTile(p),b=y&&this.bucketFor(e,y,m,Io,this.buildingLocs,"fill-extrusion");if(!b)continue;f.setFloat("u_height_scale",this.growScale(b,n,!h.warm)*d),f.setMat4("u_matrix",t.shadowTileMatrix(p,b.extent));let g=(u.source??K)===K,v=this.cutHidden(e,y,m,p.dataKey,b.buffer,this.hiddenFor(m,g)),x=g?v??this.indoorMask.indicesFor(e,y,m,p,b.buffer,this.buildingLocs):v;x?(x.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,e.gl.UNSIGNED_INT,0)):(b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,b.indexType,0));}}this.modelDepth&&(this.models.depthTimeSec=n/1e3,e.gl.polygonOffset(6,96),this.models.renderDepth(e,t,this.modelDepth,this.modelLocs),e.gl.polygonOffset(2,4)),c.disable(c.POLYGON_OFFSET_FILL),e.bindFramebuffer(null),e.viewport(0,0,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),s.bindTexture(Br),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(s.size))/(t.pixelsPerMeter||1),this.shadowActive=true;}drawGlobeBody(e,t,o){if(!t.globeActive||!this.globeBody||!this.globeMesh)return;let r=this.globeBody;r.use(),this.applyGlobeUniforms(r,t),r.setMat4("u_matrix",t.localMatrix());let n=o.background;r.setVec3("u_body_color",n[0],n[1],n[2]),Be(r,"u_atmo_color",o.sky.horizonColor),r.setFloat("u_atmo_strength",o.sky.enabled?1-t.globeFlatMix:0),e.setBlend("none"),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("less"),e.setCull("none"),this.globeMesh.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,this.globeMesh.count,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null),this.drawGlobeClip(e,t),e.setBlend("premultiplied"),e.setDepthTest(false),e.setDepthMask(false);}drawGlobeClip(e,t){if(!this.globeClip||!this.quad)return;let o=e.gl,r=[0,0,-t.globeRadiusPx,1],n=[0,0,0,0];if(ce(n,t.localProjMatrix,r),n[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",n[2]/n[3]),o.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("always"),this.quad.vao.bind(),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0),o.colorMask(true,true,true,true),e.bindVAO(null);}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),Be(r,"u_sky_color",o.sky.skyColor),Be(r,"u_horizon_color",o.sky.horizonColor);let n=t.width>0?e.gl.drawingBufferWidth/t.width:1,a=t.horizonScreenY(),l=(t.height-a)*n,s=Math.max(a,1)*n,c=Math.min(s*.5,t.height*n*.1);r.setVec3("u_sky_params",l,o.sky.horizonBlend*s,c);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){Be(r,"u_space_color",o.sky.spaceColor),Be(r,"u_atmo_color",o.sky.atmosphereColor);let u=t.globeDisc();r.setVec4("u_globe_disc",u.dir[0],u.dir[1],u.dir[2],u.angle);let[h,m,d,p]=t.localRayCorners();r.setVec3("u_ray_tl",h[0],h[1],h[2]),r.setVec3("u_ray_tr",m[0],m[1],m[2]),r.setVec3("u_ray_bl",d[0],d[1],d[2]),r.setVec3("u_ray_br",p[0],p[1],p[2]);}e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.quad.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null);}applyGlobeUniforms(e,t){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let o=t.globeBasis,r=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,r),e.setVec2("u_globe_center",t.centerPointPx.x/r,t.centerPointPx.y/r);let n=t.globeCamera();e.setVec4("u_globe_cam",n.dir[0],n.dir[1],n.dir[2],n.horizonCos),e.setMat3("u_globe_basis",[o.east[0],o.south[0],o.up[0],o.east[1],o.south[1],o.up[1],o.east[2],o.south[2],o.up[2]]);}applyTileMatrix(e,t,o,r){if(t.globeActive){let n=o.bounds();e.setVec3("u_tile_merc",n.minX,n.minY,(n.maxX-n.minX)/r),e.setMat4("u_matrix",t.localMatrix());return}e.setMat4("u_matrix",t.tileMatrix(o,r));}applyFogUniforms(e,t,o){let r=this.fog??mt(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0);return}Be(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);}drawsTile(e,t,o,r){let n=this.fog;if(!n)return true;let a=e.distanceToTile(r);return a>n.cutoff?false:t.layerVisibleAt(o,e.detailZoom(a))}earthDepthLevel(e,t){let o=0;for(let n of e.layers)n.type==="surface"?o=Math.min(o,(n.elevation-(n.bevelDrop??0))*this.reliefScale):n.type==="line"&&(o=Math.min(o,D(n.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(qc/Math.max(t.pixelsPerMeter,1e-9),Zc);return o-r}clipToTile(e,t){let o=this.stencilIds.get(t.dataKey);e.setStencilTest(o!==void 0),o!==void 0&&e.gl.stencilFunc(e.gl.EQUAL,o,Vr);}drawTileStencil(e,t,o){this.stencilIds.clear();let r=o.get(K);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>Vr)return;let a=e.gl;a.stencilMask(255),e.clear(null,false,true),e.setStencilTest(true),a.stencilOp(a.KEEP,a.KEEP,a.REPLACE),e.setColorMask(false),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");let l=this.fill;l.use(),l.setVec4("u_globe",0,0,0,0),l.setInt("u_material",0),l.setVec2("u_world_origin",0,0),l.setVec4("u_color",0,0,0,1),l.setFloat("u_elevation",0),this.quad.vao.bind();let s=0;for(let c of n)s++,this.stencilIds.set(c.dataKey,s),a.stencilFunc(a.ALWAYS,s,Vr),l.setMat4("u_matrix",t.tileMatrix(c,1)),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);e.bindVAO(null),e.setColorMask(true),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),e.setStencilTest(false);}drawEarthDepth(e,t,o,r){if(!this.fill||!this.quad)return;let n=o.get(K);if(!n)return;let a=this.fill;a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setVec2("u_world_origin",0,0),a.setVec4("u_color",0,0,0,1),a.setFloat("u_elevation",0);let l=this.earthDepthLevel(r,t);e.gl.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setCull("none"),e.gl.enable(e.gl.POLYGON_OFFSET_FILL),e.gl.polygonOffset(1,8),this.quad.vao.bind();let s=new Float32Array(16);for(let c of n.visibleTiles){let f=t.tileMatrix(c,1);s.set(f);for(let u=0;u<4;u++)s[12+u]+=l*f[8+u];a.setMat4("u_matrix",s),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);}e.bindVAO(null),e.gl.disable(e.gl.POLYGON_OFFSET_FILL),e.gl.colorMask(true,true,true,true);}drawGroundShadow(e,t,o,r){if(!this.shadowActive||!this.groundShadow||!this.quad)return;let n=o.get(K);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=Fo(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=he(l.ambientColor),u=he(l.keyColor),h=[0,0,0];for(let m=0;m<3;m++){let d=f[m]*l.ambientIntensity,p=u[m]*l.keyIntensity*c;h[m]=d>0?d/(d+p):1;}a.setVec3("u_shadow_ground",h[0],h[1],h[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let m of n.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(m,1)),a.setMat4("u_matrix",t.tileMatrix(m,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",Br),!this.shadowActive){e.setVec4("u_shadow_params",0,0,0,0);return}let t=this.shadowTarget?.size??1,r=Math.max(this.shadows.bias,1.5*this.shadowTexelMeters)*(this.shadowDepthPerMeter||1);e.setVec4("u_shadow_params",this.shadows.strength,1/t,r,1),e.setFloat("u_shadow_normal_offset",1.5*2/t);let n=he(this.shadows.color);e.setVec3("u_shadow_color",n[0],n[1],n[2]);}get shadowsActive(){return this.shadowActive}applyTileScale(e,t,o){let r=Yo(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=Mn(t.z,t.x,t.y);e.setVec2("u_world_origin",n/this.patternScale,a/this.patternScale);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,n=this.detailScale<=0?0:ef[r??"flat"]??0;if(e.setInt("u_material",n),n===0)return;let a=t.paint,l=D(a.materialStrength,o,1)*this.detailScale,s=D(a.materialScale,o,tf[n]),c=D(a.materialSpeed,o,n===1?1:0);e.setVec4("u_material_params",l,s,c,this.materialTime),c>0&&l>.004&&(this.materialAnimating=true);}drawFill(e,t,o,r,n,a){let l=this.fill,s=r.colorAt(n,a),c=D(n.paint?.opacity,a,1);if(c<=.001)return;l.use(),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(l,t),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",_e([s[0],s[1],s[2],s[3]*c]));let f=r.bucketKeyFor(n);if(f!==null){for(let u of o.visibleTiles){if(!this.drawsTile(t,r,n,u))continue;let h=o.getTile(u),m=h&&this.bucketFor(e,h,f,Gr,this.fillLocs,"fill");m&&(this.clipToTile(e,u),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,m.extent)),this.applyTileScale(l,u,m.extent),this.applyTileMatrix(l,t,u,m.extent),m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.indexCount,m.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,n,a,l=0,s){let c=this.line,f=r.colorAt(n,a),u=D(n.paint.opacity,a,1)*(l||1),h=D(n.paint.width,a,1);if(u<=.001||h<=.01)return;let m=e.gl.drawingBufferWidth,d=e.gl.drawingBufferHeight,p=t.width>0?m/t.width:1,y=h/2*p;c.use(),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t),this.applyLight(c,r),this.applyMaterial(c,n,a),c.setVec4v("u_color",_e([f[0],f[1],f[2],f[3]*u])),c.setFloat("u_center_w",t.cameraToCenterDistance);let b=D(n.paint.offset,a,0)*p,g=Math.max(D(n.paint.blur,a,0),0)*p;c.setFloat("u_elevation",D(n.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",m,d);let v=n.paint.dashArray,x=n.paint.arrow===true,C=n.paint.arrowStyle,S=x&&(C==="head"||C==="headOnly"),M=x&&C==="dash";if(c.setInt("u_pattern",M?5:v?1:C==="headOnly"&&x?4:S?3:x?2:0),v){let[_,T]=v;c.setVec2("u_dash",_*p,(_+T)*p);}if(x){let _=ke(n.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",_e(_));let T=D(n.paint.arrowPeriod,a,46)*p,L=D(n.paint.arrowSize,a,5)*p;if(M){let k=D(n.paint.arrowGap,a,24)*p,z=Math.max(T-k,1),A=Math.min(L,z),I=D(n.paint.arrowShaft,a,2)*p,E=D(n.paint.arrowHead,a,4)*p,F=D(n.paint.arrowOutline,a,0)*p;c.setVec4("u_arrow",I,A,E,z),c.setVec2("u_dash",F,T);}else S?c.setVec4("u_arrow",T,L,y,0):c.setVec4("u_arrow",T,Math.max(L*.4,1),Math.min(L,y*.72),0);}let w=r.bucketKeyFor(n);if(w!==null)for(let _ of o.visibleTiles){if(!this.drawsTile(t,r,n,_))continue;let T=o.getTile(_);if(!T)continue;let L=n.network?s!==void 0?[ze(n.id,s)]:(T.data?.levels??[]).map(k=>ze(n.id,k)):[w];for(let k of L){let z=this.bucketFor(e,T,k,Pa,this.lineLocs,"line");if(!z)continue;let A=_.bounds(),I=(A.maxX-A.minX)*t.worldSize/z.extent*p;c.setFloat("u_tile_to_px",I);let E=I>1e-6?1/I:1;c.setFloat("u_half_width",y*E),c.setFloat("u_blur",g*E),c.setFloat("u_meters_to_units",t.pixelsPerMeter*E),c.setFloat("u_width_from_data",n.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",D(n.paint.widthExtra,a,0)*E),c.setFloat("u_offset",b*E),c.setFloat("u_tile_per_px",E),this.applyTileScale(c,_,z.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(_,z.extent)),this.applyTileMatrix(c,t,_,z.extent),z.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,z.indexCount,z.indexType,0);}}}drawNetwork(e,t,o,r,n,a,l){let s=o.layers.filter(f=>f.type==="line"&&f.network===n&&l(f));if(!s.length)return;let c=new Set;for(let f of s){let u=r(f);if(u)for(let h of u.visibleTiles){let m=u.getTile(h);for(let d of m?.data?.levels??[])c.add(d);}}if(c.size)for(let f of [...c].sort((u,h)=>u-h))for(let u of s){let h=r(u);h&&this.drawLine(e,t,h,o,u,a,0,f);}}drawHighlight(e,t,o,r,n,a){let l=this.highlight;if(!l||!this.building||l.layerId!==n.id)return;let s=`${n.id}/${l.featureId}`;this.highlightKey!==s&&(this.disposeHighlight(),this.highlightKey=s);let c=he(l.color)??[.31,.79,.5,1],f=this.building;f.use(),this.applyShadowUniforms(f),this.applyFogUniforms(f,t,r),this.applyLight(f,r),f.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),f.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),f.setFloat("u_opacity",l.opacity),f.setFloat("u_ao_strength",D(n.paint.aoStrength,a,.4)),f.setFloat("u_tint_variation",0),f.setFloat("u_facade_detail",0),f.setFloat("u_window_glow",0),f.setFloat("u_roof_variation",0),f.setFloat("u_height_scale",D(n.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");for(let u of o.visibleTiles){let h=o.getTile(u);if(!h)continue;let m=h.data?.buckets?.[n.id];if(!m)continue;let d=u.dataKey,p=this.highlightGpu.get(d);if(p===void 0){let y=To(h,n.id,l.featureId);if(y){let b=new ye(e,new Uint8Array(y.vertices),Io),g=new de(e,y.indices);p={vao:new fe(e,[{buffer:b,locations:this.buildingLocs}],g),vbo:b,ibo:g,count:y.indices.length};}else p=null;this.highlightGpu.set(d,p);}p&&(this.applyTileScale(f,u,m.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,m.extent)),f.setMat4("u_matrix",t.tileMatrix(u,m.extent)),p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.count,e.gl.UNSIGNED_INT,0));}e.setBlend("none"),e.setDepthMask(true);}refreshHighlight(){this.disposeHighlight();}disposeHighlight(){for(let e of this.highlightGpu.values())e&&(e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy());this.highlightGpu.clear(),this.highlightTris.clear(),this.highlightKey="";}syncHighlightFootprint(e,t){let o=this.highlight;if(!o){this.highlightTris.size&&this.highlightTris.clear();return}let r=`${o.layerId}/${o.featureId}`;this.footprintKey!==r&&(this.highlightTris.clear(),this.footprintKey=r);let n=t.layers.find(s=>s.id===o.layerId),a=e.get(n?.source??K);if(!a)return;let l=new ee;for(let s of a.visibleTiles){if(l.add(s.dataKey),this.highlightTris.has(s.dataKey))continue;let c=a.getTile(s),f=c?.data?.buckets?.[o.layerId];if(!c||!f)continue;let u=To(c,o.layerId,o.featureId);u&&this.highlightTris.set(s.dataKey,Mr(u,f.extent,s));}for(let s of [...this.highlightTris.keys()])l.has(s)||this.highlightTris.delete(s);}drawFillHighlight(e,t,o,r){let n=this.highlightFill,a=this.fill;if(!n||!a)return;let l=r.layers.find(h=>h.id===n.layerId),s=l?o.get(l.source??K):void 0;if(!l||!s)return;let c=n.bucketKey,f=he(n.color)??[.31,.79,.5,1];a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setFloat("u_elevation",0),a.setVec2("u_world_origin",0,0),a.setVec4v("u_color",_e([f[0],f[1],f[2],n.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,Dr,Dr),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(Dr);for(let h of s.visibleTiles){let m=s.getTile(h),d=m?.data?.buckets?.[c];if(!m||!d||d.kind!=="fill"||!d.featureIds)continue;let p=this.fillHighlightFor(e,d,h,n.featureId,c);p&&(a.setMat4("u_matrix",t.tileMatrix(h,d.extent)),p.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,p.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,n){let a=`${n}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${n}/${r}`&&(this.fillHighlightGpu.forEach(h=>{h?.vao.destroy(),h?.ibo.destroy(),h?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${n}/${r}`);let l=this.fillHighlightGpu.get(a);if(l!==void 0)return l;let s=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),f=[];for(let h=0;h*3<s.length;h++)c[h]===r&&f.push(s[h*3],s[h*3+1],s[h*3+2]);let u=null;if(f.length){let h=new ye(e,new Uint8Array(t.vertices),Gr),m=new de(e,new Uint32Array(f));u={vao:new fe(e,[{buffer:h,locations:this.fillLocs}],m),vbo:h,ibo:m,count:f.length};}return this.fillHighlightGpu.set(a,u),u}highlightFootprint(){return this.highlight&&this.highlightTris.size?[...this.highlightTris.values()]:this.indoorMask.footprint()}drawSurface(e,t,o,r,n,a){let l=this.surface,s=r.colorAt(n,a,[.7,.8,.7,1]),c=D(n.paint.opacity,a,1);if(c<=.001)return;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",s),l.setFloat("u_opacity",c),l.setFloat("u_side_shade",D(n.paint.sideShade,a,.12));let f=n.elevation<(n.base??0),u=n.paint.sideColor?ke(n.paint.sideColor,a,s):s;l.setVec3("u_side_color",u[0],u[1],u[2]),l.setFloat("u_side_light",D(n.paint.sideLight,a,f?1:0)),l.setFloat("u_relief",this.reliefScale);let h=r.bucketKeyFor(n);if(h===null)return;let m=c>=1&&!n.overlay;e.setDepthMask(m),e.setBlend(m?"none":"premultiplied"),e.setCull("none");let d=[];for(let b of o.visibleTiles){if(!this.drawsTile(t,r,n,b))continue;let g=o.getTile(b),v=g&&this.bucketFor(e,g,h,Ha,this.surfaceLocs,"surface");v&&d.push({id:b,bucket:v});}let p=(b,g)=>{this.clipToTile(e,b),this.applyTileScale(l,b,g.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(b,g.extent)),l.setMat4("u_matrix",t.tileMatrix(b,g.extent)),g.vao.bind();},y=d.filter(({bucket:b})=>b.capIndexOffset<b.indexCount);if(y.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g}of y){p(b,g);let v=g.indexType===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,g.indexCount-g.capIndexOffset,g.indexType,g.capIndexOffset*v);}e.setColorMask(true),e.setDepthMask(m);}for(let{id:b,bucket:g}of d)p(b,g),e.gl.drawElements(e.gl.TRIANGLES,g.capIndexOffset,g.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,n,a,l){let s=this.building,c=r.colorAt(n,a,[.86,.84,.8,1]),f=n.paint.roofColor?r.colorAt({...n,paint:{...n.paint,color:n.paint.roofColor}},a,c):c,u=D(n.paint.opacity,a,1);if(u<=.001)return false;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),s.setVec4v("u_wall_color",c),s.setVec4v("u_roof_color",f),s.setFloat("u_opacity",u),s.setFloat("u_ao_strength",D(n.paint.aoStrength,a,.4)),s.setFloat("u_tint_variation",D(n.paint.tintVariation,a,.07));let h=(x,C)=>n.paint[x]?r.colorAt({...n,paint:{...n.paint,color:n.paint[x]}},a,C):C,m=h("windowColor",[.62,.71,.8,1]),d=h("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);s.setVec3("u_window_color",m[0],m[1],m[2]),s.setVec3("u_window_frame",d[0],d[1],d[2]),s.setFloat("u_facade_detail",D(n.paint.facadeDetail,a,1)*this.detailScale),s.setFloat("u_window_glow",D(n.paint.windowGlow,a,0)),s.setFloat("u_floor_height",D(n.paint.floorHeight,a,3.2)),s.setFloat("u_roof_variation",D(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let p=u>=1;e.setDepthMask(p),e.setBlend(p?"none":"premultiplied");let y=D(n.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(n);if(g===null)return b;let v=(n.source??K)===K;v&&this.indoorMask.prepare(o,g);for(let x of o.visibleTiles){if(!this.drawsTile(t,r,n,x))continue;let C=o.getTile(x),S=C&&this.bucketFor(e,C,g,Io,this.buildingLocs,"fill-extrusion");if(!S)continue;let M=this.growScale(S,l,!o.warm);M<1&&(b=true),s.setFloat("u_height_scale",M*y),this.applyTileScale(s,x,S.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(x,S.extent)),s.setMat4("u_matrix",t.tileMatrix(x,S.extent));let _=this.cutHidden(e,C,g,x.dataKey,S.buffer,this.hiddenFor(g,v))??(C&&v?this.indoorMask.indicesFor(e,C,g,x,S.buffer,this.buildingLocs):null);_?(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.count,e.gl.UNSIGNED_INT,0)):(S.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,S.indexCount,S.indexType,0));}return b}growScale(e,t,o=true){if(e.firstDrawTime===0&&(e.firstDrawTime=t),!o||this.growDurationMs<=0)return 1;let r=(t-e.firstDrawTime)/this.growDurationMs;return r<1?rf(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Be(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,n,a]=Fo(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,n,a),Be(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[l,s,c]=Fo(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",l,s,c),Be(e,"u_fill_color",o.fillColor),e.setFloat("u_fill_intensity",o.fillIntensity);}flattened(e,t,o){let r=t.bucketKeyFor(o);if(r===null)return false;for(let n of e.visibleTiles){let a=e.getTile(n)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,n,a){let l=t.buckets.get(o);if(l)return l;let s=t.data?.buckets?.[o];if(!s||s.kind==="symbol"||s.kind==="placement")return null;if(s.kind!==a)return $c(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${s.kind}\xBB, \u0430 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u0430\u043A \xAB${a}\xBB \u2014 \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D`),null;let c=new ye(e,new Uint8Array(s.vertices),r),f=new de(e,new Uint32Array(s.indices)),u=new fe(e,[{buffer:c,locations:n}],f),h=new Nr(u,c,f,f.count,f.type,s.extent,s.capIndexOffset??f.count);return t.buckets.set(o,h),h}destroy(e){this.disposeHighlight(),this.fill?.destroy(),this.surface?.destroy(),this.line?.destroy(),this.objectLine?.destroy(),this.building?.destroy(),this.symbols?.destroy(e),this.models.destroy(e.gl),this.shadowTarget?.destroy(),this.shadowTarget=null,this.shadowPlaceholder&&e.gl.deleteTexture(this.shadowPlaceholder),this.shadowPlaceholder=null,this.quad&&(this.quad.vao.destroy(),this.quad.vbo.destroy(),this.quad.ibo.destroy(),this.quad=null),this.globeMesh&&(this.globeMesh.vao.destroy(),this.globeMesh.vbo.destroy(),this.globeMesh.ibo.destroy(),this.globeMesh=null),this.fill=this.line=this.building=null,this.objectLine=null;}},Oa=new B;function of(i,e){let r=new Float32Array(4290),n=0;for(let h=0;h<=32;h++){let m=(h/32-.5)*Math.PI;for(let d=0;d<=64;d++)r[n++]=d/64*2*Math.PI-Math.PI,r[n++]=m;}let a=new Uint16Array(2048*6),l=0;for(let h=0;h<32;h++)for(let m=0;m<64;m++){let d=h*65+m,p=d+64+1;a[l++]=d,a[l++]=d+1,a[l++]=p,a[l++]=d+1,a[l++]=p+1,a[l++]=p;}let s={stride:8,attribs:[{name:"a_lnglat",size:2,type:Gt,offset:0}]},c=new B([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new ye(i,r,s),u=new de(i,a);return {vao:new fe(i,[{buffer:f,locations:c}],u),vbo:f,ibo:u,count:a.length}}function Be(i,e,t){let o=Oa.get(t);o||(o=he(t),Oa.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function Fo(i,e){let t=i*Math.PI/180,o=e*Math.PI/180,r=Math.cos(o);return [-Math.sin(t)*r,Math.cos(t)*r,-Math.sin(o)]}function rf(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var zo=1,Ut=class{constructor(e=1024){this.entries=new B;this.shelfY=0;this.shelfX=0;this.shelfHeight=0;this.texture=null;this.dirty=true;this.full=false;this.size=e,this.data=new Uint8Array(e*e);}get(e){return this.entries.get(e)}add(e,t,o,r){let n=this.entries.get(e);if(n)return n;if(this.full||o>this.size)return null;if(this.shelfX+o+zo>this.size&&(this.shelfY+=this.shelfHeight+zo,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+zo>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 SDF \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a={x:this.shelfX,y:this.shelfY,width:o,height:r};for(let l=0;l<r;l++){let s=l*o,c=(a.y+l)*this.size+a.x;this.data.set(t.subarray(s,s+o),c);}return this.shelfX+=o+zo,r>this.shelfHeight&&(this.shelfHeight=r),this.entries.set(e,a),this.dirty=true,a}bind(e,t){let o=e.gl;this.texture?e.bindTexture(t,this.texture):(this.texture=o.createTexture(),e.bindTexture(t,this.texture),o.texStorage2D(o.TEXTURE_2D,1,o.R8,this.size,this.size),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),this.dirty=true),this.dirty&&(o.pixelStorei(o.UNPACK_ALIGNMENT,1),o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.size,this.size,o.RED,o.UNSIGNED_BYTE,this.data),this.dirty=false);}destroy(e){this.texture&&e.gl.deleteTexture(this.texture),this.texture=null,this.entries.clear(),this.data=new Uint8Array(0);}};var Ur=.75,Xt=8,be=3,Ve=24,yt=256,Ba=255,jt=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new B;this.loaded=new ee;this.inflight=new B;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/yt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/yt);if(r<=Ba&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new ee;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let n=Math.floor(r/yt);n>Ba||this.loaded.has(n)||t.add(n);}return t.size?(await Promise.all([...t].map(o=>this.loadRange(o))),true):false}loadRange(e){let t=this.inflight.get(e);if(t)return t;let o=this.urlTemplate.replace("{fontstack}",encodeURIComponent(this.fontstack)).replace("{range}",`${e*yt}-${e*yt+yt-1}`),r=fetch(o,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.arrayBuffer()}).then(n=>{for(let a of Va(n))this.glyphs.set(a.id,a);this.loaded.add(e);}).catch(n=>{this.loaded.add(e),console.warn(`[osmgl] \u0433\u043B\u0438\u0444\u044B ${o} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0438\u0441\u044C:`,n instanceof Error?n.message:n);}).finally(()=>{this.inflight.delete(e);});return this.inflight.set(e,r),r}};function Va(i){let e=new Al(i instanceof Uint8Array?i:new Uint8Array(i)),t=[];return e.readFields((o,r,n)=>{if(o!==1||!n)return;let a=n.readVarint()+n.pos;n.readFields((l,s,c)=>{if(l!==3||!c)return;let f=c.readVarint()+c.pos,u={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((h,m,d)=>{d&&(h===1?u.id=d.readVarint():h===2?u.bitmap=d.readBytes():h===3?u.width=d.readVarint():h===4?u.height=d.readVarint():h===5?u.left=d.readSVarint():h===6?u.top=d.readSVarint():h===7&&(u.advance=d.readVarint()));},null,f),t.push(u);},null,a);},null),t}var af=.25,gt=1e20;function jr(i,e,t){let o=e+be*2,r=t+be*2,n=o*r,a=new Float64Array(n),l=new Float64Array(n);a.fill(gt),l.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let u=i[c*e+f]/255,h=(c+be)*o+(f+be);if(u>=1)a[h]=0,l[h]=gt;else if(u>0){let m=.5-u;a[h]=m>0?m*m:0,l[h]=m<0?m*m:0;}else a[h]=gt,l[h]=0;}Da(a,o,r),Da(l,o,r);let s=new Uint8Array(n);for(let c=0;c<n;c++){let f=Math.sqrt(a[c])-Math.sqrt(l[c]);s[c]=lf(Math.round(255-255*(f/Xt+af)));}return {data:s,width:o,height:r}}function Da(i,e,t){let o=Math.max(e,t),r=new Float64Array(o),n=new Float64Array(o),a=new Int32Array(o),l=new Float64Array(o+1);for(let s=0;s<e;s++){for(let c=0;c<t;c++)r[c]=i[c*e+s];Ga(r,n,a,l,t);for(let c=0;c<t;c++)i[c*e+s]=n[c];}for(let s=0;s<t;s++){for(let c=0;c<e;c++)r[c]=i[s*e+c];Ga(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function Ga(i,e,t,o,r){t[0]=0,o[0]=-gt,o[1]=gt;for(let n=1,a=0;n<r;n++){let l=0;do{let s=t[a];l=(i[n]-i[s]+n*n-s*s)/(n-s)/2;}while(l<=o[a]&&--a>-1);a++,t[a]=n,o[a]=l,o[a+1]=gt;}for(let n=0,a=0;n<r;n++){for(;o[a+1]<n;)a++;let l=t[a];e[n]=(n-l)*(n-l)+i[l];}}var lf=i=>i<0?0:i>255?255:i;var Na=48,Yt=class{constructor(e={}){this.defs=e;this.sdfs=new B;this.pending=new ee;this.failed=new ee;}setIcons(e){this.defs=e,this.sdfs.clear(),this.failed.clear();}has(e){return this.sdfs.has(e)}get(e){return this.sdfs.get(e)}isDefined(e){return this.defs[e]!==void 0}async ensure(e){if(this.sdfs.has(e)||this.pending.has(e)||this.failed.has(e))return false;let t=this.defs[e];if(t===void 0)return this.failed.add(e),false;this.pending.add(e);try{let o=typeof t=="string"?t:t.svg,r=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(o),n=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round(Na*(n>1?n:1))),l=Math.max(8,Math.round(Na/(n<1?n:1))),s=await sf(o,a,l);return this.sdfs.set(e,jr(s,a,l)),!0}catch(o){return this.failed.add(e),console.warn(`[osmgl] \u0438\u043A\u043E\u043D\u043A\u0430 \xAB${e}\xBB \u043D\u0435 \u0440\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043E\u0432\u0430\u043B\u0430\u0441\u044C:`,o instanceof Error?o.message:o),false}finally{this.pending.delete(e);}}};async function sf(i,e,t){let o=i.includes("width=")?i:i.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),n=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((u,h)=>{a.onload=()=>u(),a.onerror=()=>h(new Error("\u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C SVG")),a.src=n;});let l=document.createElement("canvas");l.width=e,l.height=t;let s=l.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("\u043D\u0435\u0442 2D-\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430");s.clearRect(0,0,e,t),s.drawImage(a,0,0,e,t);let c=s.getImageData(0,0,e,t).data,f=new Uint8ClampedArray(e*t);for(let u=0;u<f.length;u++)f[u]=c[u*4+3];return f}finally{URL.revokeObjectURL(n);}}var tt={dot:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="5"/></svg>',entrance:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5 19.5 10l-2.1 2.1-3.9-3.9V21h-3V8.2l-3.9 3.9L4.5 10 12 2.5z"/></svg>',door:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h11a3 3 0 0 1 3 3v17H5V2zm9 9.2a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z"/></svg>',elevator:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h14v18H5V3zm7 2.2L9.2 9h5.6L12 5.2zM9.2 15h5.6L12 18.8 9.2 15z"/></svg>',"frame-circle":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"/></svg>',cafe:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 6h12v6a6 6 0 0 1-12 0V6zm12 1h2.5a2.5 2.5 0 0 1 0 5H16V7zM3 20h14v2H3z"/></svg>',restaurant:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h2v8a2 2 0 0 1-4 0V2h2zM5 2v6h2V2zm7 0h2v20h-2V13a4 4 0 0 1 0-8V2zM6 12h2v10H6z"/></svg>',shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h16l-1.5 12h-13L4 8zm4-3a4 4 0 0 1 8 0v2h-2V5a2 2 0 0 0-4 0v2H8V5z"/></svg>',grocery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h3l3 11h9l2-8H8m1 15a2 2 0 1 0 4 0 2 2 0 0 0-4 0zm8 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0z"/></svg>',fuel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h9v18H4V3zm2 2v5h5V5H6zm10 2 3 3v8a2 2 0 0 1-4 0V9h1V7z"/></svg>',parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h6a5 5 0 0 1 0 10H9v8H6V3zm3 3v4h3a2 2 0 0 0 0-4H9z"/></svg>',hospital:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 3h4v7h7v4h-7v7h-4v-7H3v-4h7V3z"/></svg>',pharmacy:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 4h2v5h5v2h-5v5h-2v-5H6V9h5V4zM5 18h14v3H5z"/></svg>',school:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12z"/></svg>',bank:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2 2 8h20L12 2zM4 10h3v8H4v-8zm6.5 0h3v8h-3v-8zM17 10h3v8h-3v-8zM2 20h20v2H2z"/></svg>',bus:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 5a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10a2 2 0 0 1-2 2v2h-3v-2H9v2H6v-2a2 2 0 0 1-2-2V5zm2 2v5h12V7H6zm1 8a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0z"/></svg>',railway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h12v11a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V3zm2 3v4h8V6H8zm-2 15 3-3h6l3 3H6z"/></svg>',park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a6 6 0 0 1 5.2 9 4.5 4.5 0 0 1-2.4 8.3H13V22h-2v-2.7H9.2A4.5 4.5 0 0 1 6.8 11 6 6 0 0 1 12 2z"/></svg>',hotel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3v7h10a4 4 0 0 1 4 4v3h-3v-3H5v3H2V6zm5 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',place_of_worship:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 3 5 5 5 8v12h-4v-5a1 1 0 0 0-2 0v5H7V10c0-3 2-5 5-8z"/></svg>',police:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l8 3v7c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V5l8-3z"/></svg>',stadium:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 4c5.5 0 10 1.8 10 4v4c0 2.2-4.5 4-10 4S2 14.2 2 12V8c0-2.2 4.5-4 10-4zm0 2C7.6 6 4 7.1 4 8s3.6 2 8 2 8-1.1 8-2-3.6-2-8-2z"/></svg>',fast_food:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9a9 9 0 0 1 18 0H3zm-1 3h20v2H2v-2zm2 4h16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z"/></svg>',bakery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 9c0-2 1.5-3 3-3h10c1.5 0 3 1 3 3l-1 9H5L4 9zm4-1v9h2V8H8zm4 0v9h2V8h-2z"/></svg>',ice_cream:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a5 5 0 0 1 5 5H7a5 5 0 0 1 5-5zM7 9h10l-5 13L7 9z"/></svg>',bar:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h18l-8 9v6h4v2H7v-2h4v-6L3 4zm3.5 2 2 2h7l2-2h-11z"/></svg>',butcher:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h6l2 5-3 3-5-3V3zm8 7 6 6-2 2-6-6 2-2zM3 17h8v4H3v-4z"/></svg>',alcohol_shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4v4l3 5v11H7V11l3-5V2zm-1 11h6v7H9v-7z"/></svg>',clothing_store:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 3h6l5 3-2 4-2-1v12H8V9L6 10 4 6l5-3zm1 1.5L12 6l2-1.5h-4z"/></svg>',hairdresser:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3l9 9-2 2-2-2-2 2 2 2-1 1a3 3 0 1 1-2-2l1-1-1-1a3 3 0 1 1 2-2L5 3zm14 0l-6 6 2 2 5-6V3zM6 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm0-11a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/></svg>',laundry:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h14v20H5V2zm2 2v2h10V4H7zm5 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"/></svg>',music:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 4l11-2v13a3.5 3.5 0 1 1-2-3.2V6L11 7.4v10.1A3.5 3.5 0 1 1 9 14.3V4z"/></svg>',car:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 11l2-5a2 2 0 0 1 2-1h6a2 2 0 0 1 2 1l2 5v7h-3v-2H8v2H5v-7zm2.5-1h9l-1.2-3H8.7L7.5 10zM7 13a1.3 1.3 0 1 0 0 2.6A1.3 1.3 0 0 0 7 13zm10 0a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z"/></svg>',bicycle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 12a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm12 0a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM6 15a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm12 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM9 4h4l4 8-2 1-3-6H9V4z"/></svg>',atm:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v3h16V7H4zm0 5v5h16v-5H4zm2 2h5v2H6v-2z"/></svg>',post:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2.5 2 7.5 6 7.5-6h-15z"/></svg>',telephone:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2c1 0 2 3 2 4s-2 2-2 3 4 6 5 6 2-2 3-2 4 1 4 2-1 4-3 4C9 19 5 15 3 5c0-2 3-3 4-3z"/></svg>',office:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h11v20H4V2zm2 3v3h3V5H6zm5 0v3h3V5h-3zM6 10v3h3v-3H6zm5 0v3h3v-3h-3zM6 15v3h3v-3H6zm5 0v7h3v-7h-3zM17 8h4v14h-4V8z"/></svg>',town_hall:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 5v2H3V7l9-5zM5 11h3v7H5v-7zm5.5 0h3v7h-3v-7zM16 11h3v7h-3v-7zM3 20h18v2H3v-2z"/></svg>',doctors:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2v6a5 5 0 0 0 4 4.9V16a3 3 0 1 0 6 0v-1.2a2.5 2.5 0 1 0-2 0V16a1 1 0 1 1-2 0v-3.1A5 5 0 0 0 17 8V2h-3v6a2 2 0 0 1-4 0V2H7z"/></svg>',dentist:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 4-1 6 0 2 1 2 4 1 8l-1 5c-1 4-3 4-3.5 1L14 12c-.4-2-1.6-2-2 0l-.5 4c-.5 3-2.5 3-3.5-1l-1-5C6 6 6 3 8 2c2-1 3 0 4 0z"/></svg>',veterinary:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 11c3 0 6 3 6 6a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3c0-3 3-6 6-6zM6 5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm12 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM10 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm4 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',library:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h5c1.5 0 2.5.5 3 1.2.5-.7 1.5-1.2 3-1.2h5v16h-5c-1.5 0-2.5.6-3 1.5-.5-.9-1.5-1.5-3-1.5H4V3zm2 2v12h3c1 0 2 .2 2.5.5V5.8C11 5.3 10 5 9 5H6z"/></svg>',college:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12zm15-2v7h2v-7h-2z"/></svg>',museum:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 5v2H2V7l10-5zM5 11h2.5v7H5v-7zm5 0h2.5v7H10v-7zm5 0h2.5v7H15v-7zM3 20h18v2H3v-2z"/></svg>',art_gallery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 0 0 0 20c1.7 0 2-1 1.4-2-.7-1.2 0-2.5 1.6-2.5H18a4 4 0 0 0 4-4c0-6-4.5-11.5-10-11.5zM7 9a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 7 9zm3-4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 10 5zm5 0a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 15 5zm3 4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 18 9z"/></svg>',theatre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2zM13 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',cinema:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h20v16H2V4zm3 2v2h2V6H5zm0 5v2h2v-2H5zm0 5v2h2v-2H5zm12-10v2h2V6h-2zm0 5v2h2v-2h-2zm0 5v2h2v-2h-2zM9 6v12h6V6H9z"/></svg>',monument:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4l1 13H9l1-13zM7 17h10v2H7v-2zm-2 3h14v2H5v-2z"/></svg>',castle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3V3h2v3h3V3h2v3h3V3h2v3h3v16H2V6zm7 8h6v8H9v-8z"/></svg>',attraction:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8L12 2z"/></svg>',zoo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c3.3 0 6 2.7 6 5.5S15.3 21 12 21s-6-.7-6-3.5S8.7 12 12 12zM5 6a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 5 6zm14 0a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 19 6zM9.5 2a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4zm5 0a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4z"/></svg>',theme_park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v6h-2V2zM4 20a8 8 0 0 1 16 0v2H4v-2zm3.5-2h9A6 6 0 0 0 12 14a6 6 0 0 0-4.5 4zM3 9l3-2 3 2-3 2-3-2zm12 0l3-2 3 2-3 2-3-2z"/></svg>',information:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 4h3v3h-3V6zm0 5h3v8h-3v-8z"/></svg>',garden:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2 2 3 4 3 6a3 3 0 0 1-6 0c0-2 1-4 3-6zM4 9c2.5 0 5 1.5 6 4H8c-2.5 0-4-1.5-4-4zm16 0c0 2.5-1.5 4-4 4h-2c1-2.5 3.5-4 6-4zm-9 5h2v8h-2v-8z"/></svg>',pitch:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v10h7V7H4zm9 0v10h7V7h-7zm-1 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>',playground:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h2v16H3V4zm16 0h2v16h-2V4zM5 6h14v2H5V6zm2 3 3 11H8L5 9h2zm10 0-3 11h2l3-11h-2z"/></svg>',swimming_pool:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3a3 3 0 0 1 6 0v3h4a3 3 0 0 1 3 3h-3a1 1 0 0 0-1 1v3H12V6a1 1 0 0 0-2 0v8H6V3zm-4 14c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',sports_centre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h3v8H4V8zM2 10h2v4H2v-4zm15-2h3v8h-3V8zm3 2h2v4h-2v-4zM8 11h8v2H8v-2z"/></svg>',bicycle_parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h5a4 4 0 0 1 0 8H7v5H4V2zm3 3v2h2a1 1 0 0 0 0-2H7zm-2 13a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm10 0a4 4 0 1 1 8 0 4 4 0 0 1-8 0z"/></svg>',aerialway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4l20-2v2L13 5v2h1l4 3v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6l4-3h1V5.3L2 6V4zm7 8v3h6v-3H9z"/></svg>',ferry_terminal:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v3h4v4h-4v5l7 2-2 6c-2 0-2-1-4-1s-2 1-4 1-2-1-4-1-2 1-4 1l-2-6 7-2V9H3V5h4V2h4zM9 7v2h6V7H9z"/></svg>',traffic_signals:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-3v3h4v2H7v-2h4v-3H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm4 1.6a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8z"/></svg>',road_closed:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 10.1h16v3.8H4z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},cf={lodging:"hotel",beer:"bar",pub:"bar",kindergarten:"school",university:"college",lift_gate:"gate",toll_booth:"gate",border_control:"gate",bollard:"gate",picnic_site:"campsite",motorcycle_parking:"parking",bicycle_rental:"bicycle",harbor:"ferry_terminal",reservoir:"basin",water_park:"swimming_pool",volleyball:"pitch",basketball:"pitch",tennis:"pitch",horse_racing:"pitch",athletics:"sports_centre",running:"sports_centre",cycling:"bicycle",climbing:"sports_centre",climbing_adventure:"sports_centre",winter_sports:"sports_centre",ice_rink:"sports_centre",karting:"car",motor:"car",escape_game:"attraction"};for(let[i,e]of Object.entries(cf)){let t=tt[e];t?tt[i]=t:console.warn(`[osmgl] \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0438\u043A\u043E\u043D\u043A\u0438 \xAB${i}\xBB \u0441\u0441\u044B\u043B\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0443\u044E \xAB${e}\xBB`);}var ff=1.2;function Xr(i,e,t=16,o=0){let r=uf(i,t),n=[],a=[],l=0;for(let f of r){let u=0,h=0;for(let m of f){let d=m.codePointAt(0);if(d===void 0)continue;let p=e.get(d);p&&(u+=p.advance,h++);}h>1&&(u+=o*(h-1)),a.push(u),u>l&&(l=u);}if(l===0)return null;let s=Ve*ff,c=r.length*s;for(let f=0;f<r.length;f++){let u=-a[f]/2,h=-c/2+f*s+s/2;for(let m of r[f]){let d=m.codePointAt(0);if(d===void 0)continue;let p=e.get(d);p&&(p.width>0&&p.height>0&&p.bitmap&&n.push({glyph:p,x:u,y:h}),u+=p.advance+o);}}return n.length?{glyphs:n,width:l,height:c}:null}function uf(i,e){let t=i.replace(/\s+/g," ").trim();if(t.length<=e)return [t];let o=t.split(" "),r=[],n="";for(let a of o)n?n.length+1+a.length<=e?n+=" "+a:(r.push(n),n=a):n=a;return n&&r.push(n),r.slice(0,3)}function Yr(i,e,t,o){if(i.length<2)return [];let r=-o,n=-o,a=e+o,l=t+o,s=h=>h.x>=r&&h.x<=a&&h.y>=n&&h.y<=l,c=[],f=[],u=()=>{f.length>=2&&c.push(f),f=[];};for(let h=0;h+1<i.length;h++){let m=i[h],d=i[h+1],p=s(m),y=s(d);if(p&&y){f.length||f.push(m),f.push(d);continue}let b=hf(m,d,r,n,a,l);if(!b){u();continue}f.length||f.push(b[0]),f.push(b[1]),y||u();}return u(),c}function hf(i,e,t,o,r,n){let a=e.x-i.x,l=e.y-i.y,s=0,c=1,f=[[-a,i.x-t],[a,r-i.x],[-l,i.y-o],[l,n-i.y]];for(let[u,h]of f){if(u===0){if(h<0)return null;continue}let m=h/u;if(u<0){if(m>c)return null;m>s&&(s=m);}else {if(m<s)return null;m<c&&(c=m);}}return [{x:i.x+a*s,y:i.y+l*s},{x:i.x+a*c,y:i.y+l*c}]}var df=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function $r(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=yf(i),n=r[r.length-1];if(n<t)return [];let a=o.maxAngle??25,l=o.stableScale&&o.stableScale>0?o.stableScale:1,s=n*l,c=o.fontSize?o.fontSize*.6:t/e.length,f=(o.fontSize??0)*.85,u=[],h=o.spacing??250,m=h>0&&h-t<h*.25?t+h*.25:h;if(o.accept)return mf(i,r,e,t,m,c,a,f,o.accept);if(m>0&&s>=t+m){let p=Math.min(Math.floor((s-t)/m)+1,24),y=t+m*(p-1),b=(s-y)/2;for(let g=0;g<p;g++,b+=m){let v=b/l,x=Kr(i,r,e,t,v,c,a,f);x&&u.push({glyphs:x,path:x.map(C=>({x:C.x,y:C.y})),at:v});}if(u.length)return u}let d=(n-t)/2;for(let p of df){let y=d+d*p,b=Kr(i,r,e,t,y,c,a,f);if(b)return [{glyphs:b,path:b.map(g=>({x:g.x,y:g.y})),at:y}];if(d===0)break}return []}function mf(i,e,t,o,r,n,a,l,s){let c=e[e.length-1],f=Math.max(o/3,r/8,12),u=[],h=-1/0;for(let m=0;m+o<=c;m+=f){if(m-h<r)continue;let d=Kr(i,e,t,o,m,n,a,l);if(!d)continue;let p={glyphs:d,path:d.map(y=>({x:y.x,y:y.y})),at:m};if(s(p)&&(u.push(p),h=m,u.length>=24))break}return u}function Kr(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!pf(i,e,r,r+o,n,a))return null;let s=Kt(i,e,r),c=Kt(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return Ua(i,e,t,r,l);let f=e[e.length-1];return Ua([...i].reverse(),gf(e),t,f-(r+o),l)}function pf(i,e,t,o,r,n){if(r<=0)return true;let a=[],l=0;for(let s=1;s+1<i.length;s++){let c=e[s];if(c<=t)continue;if(c>=o)break;let f=Math.atan2(i[s].y-i[s-1].y,i[s].x-i[s-1].x),u=Math.atan2(i[s+1].y-i[s].y,i[s+1].x-i[s].x),h=Math.abs((u-f)*180/Math.PI+540)%360-180,m=Math.abs(h);for(a.push({at:c,delta:m}),l+=m;a.length&&c-a[0].at>r;)l-=a.shift().delta;if(l>n)return false}return true}function Ua(i,e,t,o,r){let n=[];for(let c of t){let f=ja(i,e,o+c.offset,c.width);if(!f)return null;n.push(f);}if(!n.length)return null;if(r<=0)return n;let a=[],l=o,s=0;for(let c=0;c<t.length;c++){if(c>0){let u=Math.abs(bf(n[c].angle,n[c-1].angle))*(Math.PI/180);s+=r*2*Math.tan(Math.min(u,Math.PI/3)/2);}l=o+t[c].offset+s;let f=ja(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function ja(i,e,t,o){let r=Kt(i,e,t+o/2);if(!r)return null;let n=Kt(i,e,t),a=Kt(i,e,t+o);if(!n||!a)return r;let l=a.x-n.x,s=a.y-n.y;return l===0&&s===0?r:{x:r.x,y:r.y,angle:Math.atan2(s,l)*180/Math.PI}}function bf(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function yf(i){let e=new Array(i.length);e[0]=0;for(let t=1;t<i.length;t++)e[t]=e[t-1]+Math.hypot(i[t].x-i[t-1].x,i[t].y-i[t-1].y);return e}function gf(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function Kt(i,e,t){if(t<0||t>e[e.length-1])return null;let o=1;for(;o<e.length-1&&e[o]<t;)o++;let r=e[o]-e[o-1];if(r<=0)return null;let n=(t-e[o-1])/r,a=i[o-1],l=i[o],s=l.x-a.x,c=l.y-a.y;return {x:a.x+s*n,y:a.y+c*n,angle:Math.atan2(c,s)*180/Math.PI}}var Zr=20,Xa={stride:Zr,attribs:[{name:"a_pos",size:2,type:5126,offset:0},{name:"a_tex",size:2,type:5123,offset:8},{name:"a_scale",size:1,type:5126,offset:12},{name:"a_fade",size:1,type:5126,offset:16}]},vf=220,Ye=64,Ya=2,wf=1.22,xf=128,_f=.7;function Cf(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return D(o,e,0)*Ve;let r=D(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*_f/(t/Ve)}var Sf=256,Mf=200,qr="frame-circle",vt=class i{constructor(e,t){this.shader=null;this.locations=new B;this.atlas=new Ut(1024);this.vbo=null;this.ibo=null;this.vao=null;this.capacityQuads=0;this.onAssetsReady=null;this.pendingText=new Set;this.pendingIcons=new Set;this.highlightFootprint=null;this.placedCount=0;this.placed=[];this.hoverKey=null;this.hiddenKey=null;this.padding={top:0,right:0,bottom:0,left:0};this.viewport={width:0,height:0};this.stickyKeys=new Set;this.now=0;this.shownAt=new B;this.fading=false;this.styleOrder=new B;this.glyphs=new jt(e,t),this.icons=new Yt(tt);}init(e){this.shader=new me(e,"symbol",ga,va);for(let t of Xa.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.mercX.toFixed(9)}|${e.mercY.toFixed(9)}`}setHover(e){return this.hoverKey===e?false:(this.hoverKey=e,true)}setHidden(e){return this.hiddenKey===e?false:(this.hiddenKey=e,true)}querySymbol(e,t=2){let o=null;for(let r of this.placed)e.x<r.box.x1-t||e.x>r.box.x2+t||e.y<r.box.y1-t||e.y>r.box.y2+t||(!o||r.order>=o.order)&&(o=r);return o}fadeOf(e,t){let o=this.shownAt.get(e);if(o===void 0)return this.shownAt.set(e,t),this.fading=true,0;let r=(t-o)/vf;return r<1?(this.fading=true,r):1}order(e){let t=o=>o.priority+(this.stickyKeys.has(i.keyOf({layerId:o.layer.id,mercX:o.mercX,mercY:o.mercY}))?Mf:0);e.sort((o,r)=>t(r)-t(o));}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(e=>i.keyOf(e)));for(let e of [...this.shownAt.keys()])this.stickyKeys.has(e)||this.shownAt.delete(e);}render(e,t,o,r){let n=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},!n)return;let a=t.zoom,l=r.layers.filter(m=>m.type==="symbol"&&r.layerVisibleAt(m,a));if(!l.length)return;let s=this.collect(t,o,r,l);if(!s.length)return;this.now=performance.now(),this.fading=false,this.order(s);let c=new B,f=new B,u=new B;l.forEach((m,d)=>u.set(m.id,d));let h=0;for(let m of s){let d=this.place(m,a,c);if(!d)continue;this.placed.push({layerId:m.layer.id,text:m.text,icon:m.icon,mercX:m.mercX,mercY:m.mercY,box:d.box,order:u.get(m.layer.id)??0});let p=f.get(m.layer.id);p||f.set(m.layer.id,p={layer:m.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),p.verts.push(...d.verts),p.texs.push(...d.texs),p.iconVerts.push(...d.iconVerts),p.iconTexs.push(...d.iconTexs),p.frameVerts.push(...d.frameVerts),p.frameTexs.push(...d.frameTexs),h+=d.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),h&&(this.styleOrder=u,this.draw(e,t,f,h,a));}collect(e,t,o,r){let n=[],l=this.padding,s=mt(e,o).far,[c,f,u]=e.cameraPositionPx;for(let h of r){let m=(h.layout?.priority??0)*Sf,d=t.get(h.source??K);if(!d)continue;let p=h.layout?.showFor==="highlight",y=h.layout?.placement==="map",{shift:b,drop:g}=y?Za(h,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(p&&!this.highlightFootprint)continue;let v=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,x=o.bucketKeyFor(h);if(x!==null)for(let C of d.visibleTiles){if(!o.layerVisibleAt(h,e.detailZoom(e.distanceToTile(C))))continue;let M=d.getTile(C)?.data?.buckets?.[x];if(!M||!So(M))continue;let w=new Int16Array(M.anchors),_=new Uint8Array(M.priorities),T=M.rotations?new Int16Array(M.rotations):null,L=M.lines?new Int16Array(M.lines):null,k=M.lineStarts?new Uint32Array(M.lineStarts):null,z=C.bounds(),A=e.worldSize,I=(z.maxX-z.minX)*A/M.extent,E=z.minX*A,F=z.minY*A;for(let P=0;P<_.length;P++){let R=E+w[P*2]*I,W=F+w[P*2+1]*I;if(s!==1/0&&Math.hypot(R-c,W-f,u)>s||p&&!We(this.highlightFootprint,R/A,W/A,v))continue;let G=R,O=W;if(y&&T){let $=T[P]*Math.PI/180,Q=b;G-=Math.sin($)*Q,O+=Math.cos($)*Q;}let H=e.worldPxToPoint(G,O),V=L&&k?Tf(e,L,k,P,E,F,I):void 0;if(h.layout?.textPlacement==="line"){if(!V)continue}else if(!H||H.x<l.left-64||H.y<l.top-64||H.x>e.width-l.right+64||H.y>e.height-l.bottom+64)continue;n.push({layer:h,screenX:H?H.x:V[0].x,screenY:(H?H.y:V[0].y)+g,text:M.texts[P]??"",icon:M.icons[P]??"",priority:_[P]+m,rotate:Qa(h,T,P,e.bearing),mercX:R/A,mercY:W/A,line:V});}}}return n}place(e,t,o){let r=e.layer.layout??{},n=i.keyOf({layerId:e.layer.id,mercX:e.mercX,mercY:e.mercY});if(this.hiddenKey!==null&&this.hiddenKey===n)return null;let a=this.fadeOf(n,this.now),l=this.hoverKey!==null&&this.hoverKey===n,s=D(r.textSize,t,13),c=D(r.iconSize,t,16),f=r.iconTextGap??5,[u,h]=r.offset??[0,0],m=r.placement==="map",d=null;if(e.icon&&!m){this.icons.isDefined(e.icon)||(e.icon="dot");let q=`icon:${e.icon}`,U=this.atlas.get(q);if(!U){let j=this.icons.get(e.icon);j?U=this.atlas.add(q,j.data,j.width,j.height)??void 0:this.pendingIcons.add(e.icon);}U&&(d=U);}let p=null;if(d&&r.iconFrame==="circle"){let q=`icon:${qr}`,U=this.atlas.get(q);if(!U){let j=this.icons.get(qr);j?U=this.atlas.add(q,j.data,j.width,j.height)??void 0:this.pendingIcons.add(qr);}U&&(p=U);}let y=p?Math.max(r.iconFrameScale??1.6,1):1,b=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),b=Xr(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,Cf(e.layer,t,s)),!b&&!d)||!b&&!d)return null;let g=s/Ve,v=b?b.width*g:0,x=b?b.height*g:0;if(e.layer.layout?.textPlacement==="line")return b&&e.line?this.placeOnLine(e,b,g,x,o,t,a):null;let C=r.iconPlacement??"top",S=C==="behind"&&!!d&&!!b,M=C==="top"&&!!d&&!!b,w=d?d.width/Math.max(d.height,1):1,_=S?x+f*2:c,T=d?_*w:0,L=Math.max(T,d?c*y:0),k=Math.max(_,d?c*y:0),z=S?Math.max(T,v+f*2):M?Math.max(L,v):L+(d&&b?f:0)+v,A=S?Math.max(_,x):M?k+f+x:Math.max(d?k:0,x),I=e.screenX+u,E=e.screenY+h,F=Ya+(r.collisionPadding??0),P={x1:I-z/2-F,y1:E-A/2-F,x2:I+z/2+F,y2:E+A/2+F},R=this.padding;if(P.x1<R.left||P.y1<R.top||P.x2>this.viewport.width-R.right||P.y2>this.viewport.height-R.bottom)return null;if(!r.allowOverlap){if(Ka(o,P))return null;$a(o,P);}let W=[],G=[],O=[],H=[],V=[],Y=[],$=0,Q=I-z/2,ue=M?(k+f)/2:0,J=1/0,X=1/0,te=-1/0,ie=-1/0;if(b){let q=M||S?I:Q+(d?L+f:0)+v/2;for(let U of b.glyphs){let j=U.glyph,le=`g:${j.id}`,ae=this.atlas.get(le);if(!ae&&(!j.bitmap||(ae=this.atlas.add(le,j.bitmap,j.width+be*2,j.height+be*2)??void 0,!ae)))continue;let se=q+(U.x+j.left-be)*g,oe=E+ue+(U.y-j.top-be)*g,ge=ae.width*g,Ee=ae.height*g;Po(W,G,se,oe,ge,Ee,ae,0,a),$++;let ve=be*g;J=Math.min(J,se+ve),X=Math.min(X,oe+ve),te=Math.max(te,se+ge-ve),ie=Math.max(ie,oe+Ee-ve);}if(M&&d&&X<1/0){let U=E-A/2+k+f-X;if(U!==0){for(let j=1;j<W.length;j+=4)W[j]+=U;X+=U,ie+=U;}}}if(d){let q=l?wf:1,U=T*q,j=_*q,le=(M?I-T/2:Q+(L-T)/2)-(U-T)/2,ae=(M?E-A/2+(k-_)/2:E-_/2)-(j-_)/2;if(p){let oe=c*y*q,ge=le+U/2-oe/2,Ee=ae+j/2-oe/2,ve=be/Math.max(p.height-be*2,1)*oe;Po(V,Y,ge-ve,Ee-ve,oe+ve*2,oe+ve*2,p,0,a),$++;}if(S&&te>J){let oe=f*1.6,ge=f;U=(te-J+oe*2)*q,j=(ie-X+ge*2)*q,le=J-oe,ae=X-ge;}let se=be/Math.max(d.height-be*2,1)*j;Po(O,H,le-se,ae-se,U+se*2,j+se*2,d,e.rotate,a),$++;}return $?{verts:W,texs:G,iconVerts:O,iconTexs:H,frameVerts:V,frameTexs:Y,quads:$,box:P}:null}placeOnLine(e,t,o,r,n,a,l){let s=e.line,c=t.glyphs.map(T=>({offset:(T.x+t.width/2)*o,width:Math.max(T.glyph.advance,1)*o})),f=c.length?c[c.length-1].offset+c[c.length-1].width:0,u=e.layer.layout??{},h=[],m=[],d=[],p=0,y=r/2+Ya,b=this.padding,g=T=>{let L=T.path.map(k=>({x1:k.x-y,y1:k.y-y,x2:k.x+y,y2:k.y+y}));for(let k of L)if(k.x1<b.left||k.y1<b.top||k.x2>this.viewport.width-b.right||k.y2>this.viewport.height-b.bottom||!u.allowOverlap&&Ka(n,k))return false;if(!u.allowOverlap)for(let k of L)$a(n,k);return d.push(...L),true},v=-1/0,x=1/0;for(let T of t.glyphs)T.glyph.height<=0||(v=Math.max(v,T.glyph.top),x=Math.min(x,T.glyph.top-T.glyph.height));let C=Number.isFinite(v)?(v+x)/2*o:0,M=Yr(s,this.viewport.width,this.viewport.height,xf).flatMap(T=>$r(T,c,f,{spacing:u.symbolSpacing,fontSize:Ve*o,stableScale:Math.pow(2,Math.round(a)-a),accept:g}));if(!M.length)return null;for(let T of M)for(let L=0;L<t.glyphs.length;L++){let k=t.glyphs[L].glyph,z=T.glyphs[L],A=`g:${k.id}`,I=this.atlas.get(A);if(!I&&(!k.bitmap||(I=this.atlas.add(A,k.bitmap,k.width+be*2,k.height+be*2)??void 0,!I)))continue;let E=I.width*o,F=I.height*o,P=(k.height/2-k.top)*o+C,R=z.angle*Math.PI/180;Po(h,m,z.x-E/2-Math.sin(R)*P,z.y-F/2+Math.cos(R)*P,E,F,I,z.angle,l),p++;}if(!p)return null;let w=d.map(T=>(T.x1+T.x2)/2),_=d.map(T=>(T.y1+T.y2)/2);return {verts:h,texs:m,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:p,box:{x1:Math.min(...w)-y,y1:Math.min(..._)-y,x2:Math.max(...w)+y,y2:Math.max(..._)+y}}}inStyleOrder(e){return [...e.values()].sort((t,o)=>(this.styleOrder.get(t.layer.id)??0)-(this.styleOrder.get(o.layer.id)??0))}draw(e,t,o,r,n){let a=this.shader,l=e.gl;this.ensureBuffers(e,r);let s=this.vbo,c=this.vao;if(!s||!c||!this.ibo)return;let f=new ArrayBuffer(r*4*Zr),u=new Float32Array(f),h=new Uint16Array(f),m=[],d=0,p=(y,b,g,v)=>{let x=y.length/16;if(x){m.push({layer:g,role:v,first:d/4*6,count:x*6});for(let C=0;C<x*4;C++){let S=d*5;u[S]=y[C*4],u[S+1]=y[C*4+1],h[S*2+4]=b[C*2],h[S*2+5]=b[C*2+1],u[S+3]=y[C*4+2],u[S+4]=y[C*4+3],d++;}}};for(let y of this.inStyleOrder(o))p(y.frameVerts,y.frameTexs,y.layer,"frame"),p(y.iconVerts,y.iconTexs,y.layer,"icon"),p(y.verts,y.texs,y.layer,"text");s.update(new Uint8Array(f)),a.use(),this.atlas.bind(e,0),a.setInt("u_atlas",0),a.setVec2("u_viewport",t.width,t.height),a.setFloat("u_atlas_size",this.atlas.size),a.setFloat("u_edge",Ur),a.setFloat("u_dpr",t.width>0?l.drawingBufferWidth/t.width:1),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),c.bind();for(let y of m){let b=y.layer.paint,g=D(b.opacity,n,1),v=y.role==="icon",x=y.role==="frame",C=(L,k,z)=>x?k??L??z:v?L??z:z,S=ke(x?b.frameColor??b.haloColor??b.color:C(b.iconColor,void 0,b.color),n,[.15,.15,.15,1]),M=x?b.frameHaloColor:C(b.iconHaloColor,void 0,b.haloColor),w=ke(M??(x?b.iconColor??b.color:b.haloColor),n,[1,1,1,1]);x&&b.frameHaloColor===void 0&&(w[3]*=.35),x&&(S[3]*=D(b.frameOpacity,n,1));let _=D(x?b.frameHaloWidth??1.1:C(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),T=D(y.layer.layout?.textSize,n,13);a.setVec4v("u_color",_e([S[0],S[1],S[2],S[3]*g])),a.setVec4v("u_halo_color",_e([w[0],w[1],w[2],w[3]*g])),a.setFloat("u_halo",_/(Xt*(T/Ve))),l.drawElements(l.TRIANGLES,y.count,l.UNSIGNED_INT,y.first*4);}e.bindVAO(null);}ensureBuffers(e,t){if(this.vao&&t<=this.capacityQuads)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacityQuads=Math.max(1024,Math.ceil(t*1.5)),this.vbo=new ye(e,new Uint8Array(this.capacityQuads*4*Zr),Xa,true);let o=new Uint32Array(this.capacityQuads*6);for(let r=0;r<this.capacityQuads;r++){let n=r*4;o.set([n,n+1,n+2,n,n+2,n+3],r*6);}this.ibo=new de(e,o),this.vao=new fe(e,[{buffer:this.vbo,locations:this.locations}],this.ibo);}requestMissing(){if(this.pendingText.size){let e=[...this.pendingText].join("");this.pendingText.clear(),this.glyphs.ensure(e).then(t=>{t&&this.onAssetsReady?.();});}if(this.pendingIcons.size){let e=[...this.pendingIcons];this.pendingIcons.clear(),Promise.all(e.map(t=>this.icons.ensure(t))).then(t=>{t.some(Boolean)&&this.onAssetsReady?.();});}}destroy(e){this.shader?.destroy(),this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.atlas.destroy(e),this.shader=null,this.vao=null;}};function Po(i,e,t,o,r,n,a,l=0,s=1){let c=n/Math.max(a.height,1);if(l){let f=l*Math.PI/180,u=Math.cos(f),h=Math.sin(f),m=t+r/2,d=o+n/2;for(let[p,y]of [[t,o],[t+r,o],[t+r,o+n],[t,o+n]]){let b=p-m,g=y-d;i.push(m+b*u-g*h,d+b*h+g*u,c,s);}}else i.push(t,o,c,s,t+r,o,c,s,t+r,o+n,c,s,t,o+n,c,s);e.push(a.x,a.y,a.x+a.width,a.y,a.x+a.width,a.y+a.height,a.x,a.y+a.height);}function Tf(i,e,t,o,r,n,a){if(o+1>=t.length)return;let l=t[o],s=t[o+1],c=[];for(let f=l;f<s;f++){let u=i.worldPxToPoint(r+e[f*2]*a,n+e[f*2+1]*a);if(!u)break;c.push(u);}return c.length>=2?c:void 0}var qa=(i,e)=>i*4096+e;function Ka(i,e){let t=Math.floor(e.x1/Ye),o=Math.floor(e.y1/Ye),r=Math.floor(e.x2/Ye),n=Math.floor(e.y2/Ye);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(qa(a,l));if(s){for(let c of s)if(e.x1<c.x2&&e.x2>c.x1&&e.y1<c.y2&&e.y2>c.y1)return true}}return false}function $a(i,e){let t=Math.floor(e.x1/Ye),o=Math.floor(e.y1/Ye),r=Math.floor(e.x2/Ye),n=Math.floor(e.y2/Ye);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=qa(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function Za(i,e,t){let r=i.layout?.arrowUnits!=="meters"?1:t,n=D(i.layout?.arrowLength,e,50)*r;return {shift:D(i.layout?.arrowGap,e,20)*r+n/2,drop:n/2+(i.layout?.iconTextGap??4)}}function Qa(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var wt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new B;}get size(){return this.map.size}has(e){return this.map.has(e)}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}peek(e){return this.map.get(e)}set(e,t){let o=this.map.get(e);o!==void 0&&(this.map.delete(e),o!==t&&this.onEvict?.(e,o)),this.map.set(e,t),this.trim();}delete(e){let t=this.map.get(e);return t===void 0?false:(this.map.delete(e),this.onEvict?.(e,t),true)}setCapacity(e){this.capacity=e,this.trim();}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}clear(){for(let[e,t]of this.map)this.onEvict?.(e,t);this.map.clear();}trim(){for(;this.map.size>this.capacity;){let e=this.map.keys().next();if(e.done)break;let t=e.value,o=this.map.get(t);this.map.delete(t),this.onEvict?.(t,o);}}};var xt=class i{constructor(e,t,o,r=0){this.z=e;this.x=t;this.y=o;this.wrap=r;this.dataKey=`${e}/${t}/${o}`,this.key=r===0?this.dataKey:`${this.dataKey}@${r}`;}parent(){return this.z===0?null:new i(this.z-1,this.x>>1,this.y>>1,this.wrap)}children(){let e=this.z+1,t=this.x*2,o=this.y*2;return [new i(e,t,o,this.wrap),new i(e,t+1,o,this.wrap),new i(e,t,o+1,this.wrap),new i(e,t+1,o+1,this.wrap)]}scaledTo(e){if(e>=this.z)return this;let t=this.z-e;return new i(e,this.x>>t,this.y>>t,this.wrap)}isAncestorOf(e){if(e.z<=this.z||e.wrap!==this.wrap)return false;let t=e.z-this.z;return e.x>>t===this.x&&e.y>>t===this.y}bounds(){let t=1/Math.pow(2,this.z);return {minX:this.x*t+this.wrap,minY:this.y*t,maxX:(this.x+1)*t+this.wrap,maxY:(this.y+1)*t}}toString(){return this.key}};function Ef(i,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,n=[],a=128;for(let l=0;l<o;l++)for(let s=0;s<o;s++){let c=new xt(t,s,l),f=c.bounds(),u=(f.minX+f.maxX)/2,h=(f.minY+f.maxY)/2,m=[[u,h],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],d=false;for(let[y,b]of m)if(i.isOnGlobeFront(Se(y),Ce(b))){d=true;break}if(!d)continue;let p=false;for(let[y,b]of m){let g=i.localToPoint(i.globeLocal(y,b));if(g&&g.x>-a&&g.y>-a&&g.x<i.width+a&&g.y<i.height+a){p=true;break}}if(p&&(n.push(c),n.length>=r))return n}return n}function $t(i,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,n=e.maxTiles??512,a=512*r,l=Math.min(Math.round(i.zoom),t);if(l<o)return [];if(i.globeActive)return Ef(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],u=[];for(let m=s;m<=c;m++)u.push(new xt(0,0,0,m));let h=0;for(;u.length&&!(++h>2e4||f.length>=n);){let m=u.pop();if(!i.isTileVisible(m))continue;if(m.z>=l){m.z>=o&&f.push(m);continue}if(i.tileScreenSize(m.z,i.distanceToTile(m))<=a&&m.z>=o){f.push(m);continue}for(let p of m.children())u.push(p);}return f.sort((m,d)=>i.distanceToTile(m)-i.distanceToTile(d)),f}var Qr=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new B;}get hasGeometry(){return this.state==="loaded"&&!!this.data&&Object.keys(this.data.buckets).length>0}destroy(){for(let e of this.buckets.values())e.destroy();this.buckets.clear(),this.data=null;}},kf=1500,Ho=class extends De{constructor(t,o){super();this.pool=t;this.visible=[];this.holdSince=0;this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,...o},this.cache=new wt(this.opts.cacheSize,(r,n)=>{n.state==="loading"&&this.pool.abort(n.requestId),n.destroy();});}get visibleTiles(){return this.visible}get dataVersion(){return this.version+this.visible.length*1e6}get warm(){return this.warmed}getTile(t){return this.cache.peek(t.dataKey)}splitValues(t){let o=[];for(let r of this.visible){let n=this.getTile(r)?.data?.splits?.[t];if(n)for(let a of n)o.includes(a)||o.push(a);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=$t(t,this.opts),r=new ee;for(let s of o)r.add(s.dataKey);for(let[s,c]of this.cache.entries())c.state==="loading"&&!r.has(s)&&(this.pool.abort(c.requestId),this.cache.delete(s));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);for(let s of o)this.cache.get(s.dataKey)||this.loadTile(s);let a=this.visible.length>0&&this.covers(o),l=performance.now();this.readyFor(o)||!a||this.holdSince&&l-this.holdSince>kf?(this.visible=o,this.holdSince=0,this.readyFor(o)&&o.length&&(this.warmed=true)):this.holdSince||(this.holdSince=l);}readyFor(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(!r||r.state==="loading")return false}return true}covers(t){let o=new ee;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let n=r.parent(),a=false;for(let l=0;n&&l<4;l++){if(o.has(n.dataKey)){a=true;break}n=n.parent();}if(!a)for(let l of this.visible){let s=l.parent();for(let c=0;s&&c<4;c++){if(s.dataKey===r.dataKey){a=true;break}s=s.parent();}if(a)break}if(!a)return false}return true}loadTile(t){let o=new Qr(t);this.cache.set(t.dataKey,o);let r=Af(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));o.requestId=this.pool.load({url:r,zoom:t.z,metersPerTile:Sn(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},n=>{if(this.cache.peek(t.dataKey)===o){if(n.type==="error"){if(n.aborted)return;o.state="error",o.error=n.message,this.emit("error",{tile:t,message:n.message});}else o.data=n,o.state=Object.keys(n.buckets).length?"loaded":"empty",this.version++,n.diag?.failed?.length&&console.warn(`[osmgl] \u0442\u0430\u0439\u043B ${t.z}/${t.x}/${t.y}: \u0441\u043B\u043E\u0438 \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0438\u0441\u044C \u2014 ${n.diag.failed.join("; ")}`),this.emit("data",{tile:o});this.pendingCount===0&&this.emit("idle",void 0);}});}findReadyAncestor(t,o=5){let r=t.parent();for(let n=0;r&&n<o;n++){let a=this.cache.peek(r.dataKey);if(a&&a.hasGeometry)return a;r=r.parent();}return null}setCoverOptions(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setPlan(t){this.opts.plan=t,this.cache.clear();}reload(){this.cache.clear();}destroy(){this.cache.clear(),this.removeAllListeners();}};function Af(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var Oo=class{constructor(e){this.id=e;this.state="loading";this.image=null;this.error=null;this.texture=null;}destroy(){this.texture?.destroy(),this.texture=null,this.image?.close(),this.image=null;}},qt=class extends De{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new wt(this.opts.cacheSize,(o,r)=>{this.aborts.get(o)?.abort(),this.aborts.delete(o),r.destroy();});}get visibleTiles(){return this.visible}getTile(t){return this.cache.peek(t.dataKey)}update(t){this.visible=$t(t,this.opts);let o=new ee;for(let r of this.visible)o.add(r.dataKey);for(let[r,n]of this.cache.entries())n.state==="loading"&&!o.has(r)&&(this.aborts.get(r)?.abort(),this.aborts.delete(r),this.cache.delete(r));this.cache.setCapacity(Math.max(this.opts.cacheSize,o.size*2));for(let r of this.visible)this.cache.get(r.dataKey)||this.loadTile(r);}reload(){for(let t of this.aborts.values())t.abort();this.aborts.clear(),this.cache.clear();}destroy(){this.reload(),this.removeAllListeners();}loadTile(t){let o=new Oo(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(Ja(this.opts.url,t),r.signal).then(n=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){n.close();return}o.image=n,o.state="loaded",this.emit("data",{tile:o});}).catch(n=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=n instanceof Error?n.message:String(n),this.emit("error",{tile:t,message:o.error}));});}async fetchImage(t,o){let r=await fetch(t,{signal:o});if(!r.ok)throw new Error(`\u0442\u0430\u0439\u043B \u043F\u043E\u0434\u043B\u043E\u0436\u043A\u0438 ${r.status} ${r.statusText}`);return createImageBitmap(await r.blob())}};function Ja(i,e){let t=i.replace("{z}",String(e.z)).replace("{x}",String(e.x)).replace("{y}",String(e.y));if(typeof location>"u")return t;try{return new URL(t,location.href).href}catch{return t}}var Lf="osmgl-assets",_t="assets";var Wo=null;function tl(){return Wo||(Wo=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(Lf,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(_t)||t.createObjectStore(_t,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),Wo)}function If(i){return tl().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(_t,"readonly").objectStore(_t).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function Ff(i){tl().then(e=>{if(e)try{e.transaction(_t,"readwrite").objectStore(_t).put(i);}catch{}});}var el=i=>{let e=atob(i),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t};async function Rf(i,e,t){let o=await crypto.subtle.importKey("raw",el(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:el(t),tagLength:128},o,i)}var Zt=class{constructor(e){this.keys=new Map;this.variants=null;this.inflight=new Map;this.endpoint=e.endpoint.replace(/\/+$/,""),this.apiKey=e.apiKey??null;}withKey(e){return this.apiKey?e+(e.includes("?")?"&":"?")+"key="+encodeURIComponent(this.apiKey):e}loadVariants(){return this.variants??(this.variants=fetch(this.withKey(`${this.endpoint}/variants`),{credentials:"same-origin"}).then(e=>e.ok?e.json():{}).catch(()=>({}))),this.variants}async resolve(e,t){return t?(await this.loadVariants())[String(e)]?.[t]??e:e}async load(e,t,o="",r){let n=await this.resolve(e,o),a=`${n}:${t}`,l=this.inflight.get(a);if(l)return l;let s=this.fetchAsset(a,n,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,s),s}async fetchAsset(e,t,o,r){let n,a,l=await If(e);if(l)n=l.bytes,a=l.encrypted;else {let c=await fetch(this.withKey(`${this.endpoint}/files/${t}/data?lod=${o}`),{signal:r,credentials:"same-origin"});if(!c.ok)throw new Error(`data ${c.status}`);a=(c.headers.get("X-Enc")??"none")!=="none",n=await c.arrayBuffer(),Ff({key:e,bytes:n,encrypted:a,savedAt:Date.now()});}if(!a)return n;let s=await this.getKey(t,r);if(!s)throw new Error("\u043D\u0435\u0442 \u043A\u043B\u044E\u0447\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438");return Rf(n,s.key,s.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let n=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!n.ok)return null;let a=await n.json();return a.encrypted&&a.key&&a.iv?{key:a.key,iv:a.iv}:null})();return r.catch(()=>this.keys.delete(e)),this.keys.set(e,r),r}};var zf=1,Qt=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=N();this.grow=1;this.growTarget=1;this.animateIn=false;this.shrinkFrom=1;this.growStart=-1;this.fade=1;this.fadeTarget=1;this.fadeFrom=1;this.fadeStart=-1;this.matrix32=new Float32Array(16);this.nodeMatrix32=new Float32Array(16);this.normal32=new Float32Array(9);this.id=e.id??`model-${zf++}`,this.url=e.url,this.fetchBytes=e.fetchBytes,this.coordinates=e.coordinates,this.altitude=e.altitude??0,this.rotation=e.rotation??0,this.rotationTiltX=e.rotationTiltX??0,this.rotationTiltZ=e.rotationTiltZ??0,e.growIn&&(this.animateIn=true,this.grow=0),this.scale=e.scale??1,this.fitHeight=e.fitHeight,this.visible=e.visible!==false,this.userData=e.userData??{};}get isLoaded(){return this.mesh!==null}load(e){return this.loading?(e&&this.loading.then(e),this.loading):(this.loading=(async()=>{try{let t=this.fetchBytes?await this.fetchBytes():await(async()=>{let r=await fetch(this.url);if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.arrayBuffer()})(),o=await Pr(t);this.bitmaps=await Promise.all(o.images.map(async r=>{if(!r.length)return null;try{return await createImageBitmap(new Blob([r]))}catch{return null}})),this.mesh=o;}catch(t){this.error=t instanceof Error?t.message:String(t),console.warn(`[osmgl] \u043C\u043E\u0434\u0435\u043B\u044C ${this.url} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C: ${this.error}`);}e?.();})(),this.loading)}advanceGrow(e){if(!this.mesh)return false;if(!this.animateIn&&this.growTarget===1)return this.grow=1,false;if(e<=0)return this.grow=1,false;let t=performance.now()/1e3;this.growStart<0&&(this.growStart=t);let o=(t-this.growStart)/e;if(this.growTarget===0){if(o>=1)return this.grow=0,false;let n=Math.max(o,0);return this.grow=this.shrinkFrom*(1-n*n*(3-2*n)),true}if(o>=1)return this.grow=1,false;let r=Math.max(o,0)-1;return this.grow=1+r*r*(2.70158*r+1.70158),true}retire(){this.growTarget!==0&&(this.growTarget=0,this.shrinkFrom=this.grow,this.growStart=performance.now()/1e3);}setHidden(e){let t=e?0:1;this.fadeTarget!==t&&(this.fadeTarget=t,this.fadeFrom=this.fade,this.fadeStart=performance.now()/1e3);}advanceFade(e){if(this.fadeStart<0)return false;if(e<=0)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let t=(performance.now()/1e3-this.fadeStart)/e;if(t>=1)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let o=Math.max(t,0),r=o*o*(3-2*o);return this.fade=this.fadeFrom+(this.fadeTarget-this.fadeFrom)*r,true}markGrown(){this.grow=1,this.growTarget=1,this.growStart=-1/0;}revive(){this.growTarget!==1&&(this.growTarget=1,this.growStart=performance.now()/1e3-(this.animateIn?0:1e9));}effectiveScale(){if(!this.mesh||this.fitHeight===void 0)return this.scale;let e=this.mesh.max[1]-this.mesh.min[1];return e>1e-6?this.fitHeight/e:this.scale}boundingRadiusM(){let e=this.mesh;if(!e)return 0;let t=this.effectiveScale(),o=Math.max(Math.abs(e.min[0]),Math.abs(e.max[0])),r=Math.max(Math.abs(e.min[1]),Math.abs(e.max[1])),n=Math.max(Math.abs(e.min[2]),Math.abs(e.max[2]));return Math.hypot(o,r,n)*t}origin(){let e=Z(this.coordinates);return {x:re(e.lng),y:ne(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/Ae(e),r=[o,0,0,0,0,t*this.grow,0,o,0],n=c=>c*Math.PI/180,a=en(n(-this.rotation));this.rotationTiltX&&(a=Ke(Jr(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=Ke(tn(n(this.rotationTiltZ)),a));let l=Ke(r,a),s=this.matrix;return Pe(s),s[0]=l[0],s[1]=l[1],s[2]=l[2],s[4]=l[3],s[5]=l[4],s[6]=l[5],s[8]=l[6],s[9]=l[7],s[10]=l[8],s[15]=1,s}matrixInSpace(e,t){let o=Z(this.coordinates),r=N();for(let a=0;a<16;a++)r[a]=e[a];let n=N();return xe(n,r,this.localMatrix(o.lat)),He(t??this.matrix32,n)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=Z(this.coordinates),n=Ae(r.lat),a=e.worldSize,l=e.cameraPositionPx,s=(l[0]/a-o.x)*n,c=(l[1]/a-o.y)*n,f=l[2]/e.pixelsPerMeter-this.altitude,u=s,h=f,m=c,d=y=>y*Math.PI/180,p=en(d(-this.rotation));return this.rotationTiltX&&(p=Ke(Jr(d(this.rotationTiltX)),p)),this.rotationTiltZ&&(p=Ke(tn(d(this.rotationTiltZ)),p)),[(p[0]*u+p[1]*h+p[2]*m)/t,(p[3]*u+p[4]*h+p[5]*m)/t,(p[6]*u+p[7]*h+p[8]*m)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),n=e-r.x,a=t-r.y,l=Z(this.coordinates),s=this.localMatrix(l.lat),c=s[0],f=s[1],u=s[8],h=s[9],m=c*h-f*u;if(Math.abs(m)<1e-30)return false;let d=(n*h-a*u)/m,p=(c*a-f*n)/m,y=1.05,b=(o.min[0]+o.max[0])/2,g=(o.min[2]+o.max[2])/2,v=(o.max[0]-o.min[0])/2*y,x=(o.max[2]-o.min[2])/2*y;return Math.abs(d-b)<=v&&Math.abs(p-g)<=x}get isAnimated(){return this.mesh?.animation!=null}matrixForNode(e,t,o){let r=this.origin();return this.matrixInSpaceForNode(e.objectMatrix(r.x,r.y,this.altitude),t,o,this.nodeMatrix32)}matrixInSpaceForNode(e,t,o,r){let n=this.mesh?.animation;if(!n||!n.nodes.has(t))return this.matrixInSpace(e,r);let a=N();for(let u=0;u<16;u++)a[u]=e[u];let l=Z(this.coordinates),s=N();xe(s,a,this.localMatrix(l.lat));let c=N();Hr(n,t,n.duration>0?o%n.duration:0,c);let f=N();return xe(f,s,c),He(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=en(e(-this.rotation));this.rotationTiltX&&(t=Ke(Jr(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=Ke(tn(e(this.rotationTiltZ)),t));let o=Ke([1,0,0,0,0,1,0,1,0],t),r=this.normal32;for(let n=0;n<9;n++)r[n]=o[n];return r}};function Ke(i,e){let t=new Array(9);for(let o=0;o<3;o++)for(let r=0;r<3;r++)t[o*3+r]=i[r]*e[o*3]+i[3+r]*e[o*3+1]+i[6+r]*e[o*3+2];return t}var Jr=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},en=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},tn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var Vo=class{constructor(){this.hit=new B;this.miss=new ee;this.stamp="";}find(e,t){if(!t)return null;let o=this.hit.get(e.id);if(o!==void 0)return o;let r=t.source.visibleTiles.map(n=>n.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let n of t.source.visibleTiles){let a=t.source.getTile(n)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let l=n.bounds();if(e.mercX<l.minX||e.mercX>l.maxX||e.mercY<l.minY||e.mercY>l.maxY)continue;let s=(e.mercX-l.minX)/(l.maxX-l.minX)*a.extent,c=(e.mercY-l.minY)/(l.maxY-l.minY)*a.extent,f=new Int16Array(a.vertices),u=new Uint32Array(a.indices),h=new Float64Array(a.featureIds),m=f.length/a.vertexCount;for(let d=0;d*3+2<u.length;d++){let p=u[d*3]*m,y=u[d*3+1]*m,b=u[d*3+2]*m;if(!Df(s,c,f[p],f[p+1],f[y],f[y+1],f[b],f[b+1]))continue;let g=h[d];return this.hit.set(e.id,g),g}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},Pf=14,Hf=2e3,Of=4e3,ol=160,Wf=50,Bf=4e3,on=6,Do=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new B;this.loading=0;this.pending=[];this.known=new B;this.underBuilding=new Vo;this.underVenue=new Vo;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=ol;this.replacedBuildings=new ee;this.replacedVenues=new ee;this.onReady=null;this.stats={found:0,kept:0,live:0,tooFar:0,overBudget:0,queued:0,rules:0,loadingNow:0,pendingNow:0,replaced:0};this.loader=new Zt(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,n,a,l){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(n));let s=e.layout??{},c=s.minZoom??Pf,f=s.loadRadius??Hf,u=Math.max(s.keepRadius??Of,f),h=Math.min(1,Math.max(.25,(o.zoom-c)/3)),m=Math.max(8,Math.round((s.budget??ol)*this.budgetScale*h));this.budget=m,this.addModel=r;let d=s.maskReplaced!==false,p=performance.now();if(o.zoom<c){for(let E of [...this.entries.values()])E.model.retire(),E.model.grow<=0&&this.release(E,n);this.replacedBuildings.clear(),this.replacedVenues.clear();return}let y=o.center,b=this.lodFor(o.zoom,c);this.lod=b;let g="";for(let E of t.visibleTiles)g+=E.dataKey+(t.getTile(E)?.data?"+":"-");let v=this.rulesInScan;if(g!==this.tilesStamp){this.tilesStamp=g;let E=new ee;v=0;for(let F of t.visibleTiles){let P=t.getTile(F)?.data?.buckets?.[e.id];if(!P||!wa(P))continue;let R=new Int16Array(P.anchors),W=F.bounds(),G=W.maxX-W.minX,O=W.maxY-W.minY;for(let H=0;H<P.props.length;H++){let V=P.props[H],Y=ot(V.file,NaN);if(!Number.isFinite(Y))continue;let $=String(V.kind??"model"),Q=$==="rule"?`t-${V.rid}-${V.oid}`:`m-${V.mid}`;if(E.has(Q))continue;E.add(Q),$==="rule"&&v++;let ue=W.minX+R[H*2]/P.extent*G,J=W.minY+R[H*2+1]/P.extent*O,X=Vf(ue,J);this.known.set(Q,{id:Q,fileId:Y,lng:X.lng,lat:X.lat,mercX:ue,mercY:J,altitude:ot(V.alt,0),scale:ot(V.scale,1),rotation:ot(V.rx,0),tiltX:ot(V.rz,0),tiltZ:ot(V.ry,0),kind:$==="rule"?"rule":"model",target:Bo($==="rule"?V.oid:V.replaces),replaces:d?$==="rule"?Bo(V.oid):String(V.anchor??"replace")==="replace"?Bo(V.replaces):null:null});}}this.rulesInScan=v;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let x=this.found,C=new ee;for(let E of x)E.kind==="model"&&E.target!==null&&C.add(E.target);let S=111320,M=Math.cos(y.lat*Math.PI/180),w=E=>Math.hypot((E.lng-y.lng)*S*M,(E.lat-y.lat)*S);this.replacedBuildings.clear(),this.replacedVenues.clear();let _=new ee,T=[],L=0,k=0;(this.sortedAt===null||Math.hypot((y.lng-this.sortedAt.lng)*S*M,(y.lat-this.sortedAt.lat)*S)>Wf)&&(x.sort((E,F)=>w(E)-w(F)),this.sortedAt={lng:y.lng,lat:y.lat});let A=0;for(let E of x){let F=w(E);if(F>u){L++;continue}if(E.kind==="rule"&&E.target!==null&&C.has(E.target)){let G=this.entries.get(E.id);G&&G.model.retire();continue}let P=this.entries.get(E.id);if(A>=m){k++,P&&P.model.retire();continue}A++,_.add(E.id);let R=()=>{if(E.replaces===null)return;this.replacedBuildings.add(E.replaces);let G=this.underBuilding.find(E,a);G!==null&&this.replacedBuildings.add(G);let O=this.underVenue.find(E,l);O!==null&&this.replacedVenues.add(O);},W=P;if(W){R(),W.distance=F,W.leftAt=0,W.model.revive(),b<W.lod&&!W.upgrading&&this.loading<on&&this.upgrade(W,b,r,n);continue}if(F>f){L++;continue}if(this.loading>=on){T.push(E),R();continue}R(),this.spawn(E,F,b,r);}for(let E of [...this.entries.values()])if(!_.has(E.placement.id)){if(E.leftAt===0){E.leftAt=p;continue}p-E.leftAt>Bf&&E.model.retire();}for(let E of [...this.entries.values()])E.model.growTarget===0&&E.model.grow<=0&&this.release(E,n);if(this.known.size>4e3)for(let[E,F]of [...this.known.entries()])w(F)>u*3&&this.known.delete(E);let I=this.stats;I.found=x.length,I.kept=_.size,I.live=this.entries.size,I.tooFar=L,I.overBudget=k,I.queued=T.length,I.rules=v,I.loadingNow=this.loading,I.pendingNow=T.length,I.replaced=this.replacedBuildings.size,this.pending=T;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<on&&this.entries.size<this.budget;){let t=this.pending.shift();this.entries.has(t.id)||this.spawn(t,0,this.lod,e);}}lodFor(e,t){return e>=t+2?0:1}upgrade(e,t,o,r){let n=this.makeModel(e.placement,t,true);e.upgrading=n,this.loading++,n.load(()=>{this.loading--,this.pump(),this.entries.get(e.placement.id)===e&&(e.upgrading=null,n.isLoaded&&(r(e.model),e.model=n,e.lod=t,o(n),this.onReady?.()));});}makeModel(e,t,o){let r=new Qt({id:`objects3d-${e.id}`,url:`objects3d:${e.fileId}/${this.modelKey}/lod${t}`,fetchBytes:()=>this.loader.load(e.fileId,t,this.modelKey),coordinates:[e.lng,e.lat],altitude:e.altitude,scale:e.scale,rotation:e.rotation,rotationTiltX:e.tiltX,rotationTiltZ:e.tiltZ,growIn:!o});return o&&r.markGrown(),r}spawn(e,t,o,r,n=false){let a=this.makeModel(e,o,n);this.entries.set(e.id,{placement:e,model:a,distance:t,leftAt:0,lod:o,upgrading:null}),this.loading++,r(a),a.load(()=>{this.loading--,this.pump(),this.onReady?.();});}release(e,t){this.entries.delete(e.placement.id),e.upgrading=null,t(e.model);}setModelKey(e){this.wantKey=e??"";}clear(e){for(let t of [...this.entries.values()])this.release(t,e);this.replacedBuildings.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},ot=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Bo=i=>{let e=ot(i,NaN);return Number.isFinite(e)?e:null};function Vf(i,e){let t=i*360-180,o=Math.PI*(1-2*e),r=Math.atan(Math.sinh(o))*180/Math.PI;return {lng:t,lat:r}}function Df(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),u=s<0||c<0||f<0,h=s>0||c>0||f>0;return !(u&&h)}var Gf=200,Nf={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},Jt=class{constructor(e){this.attachedTo=null;this.culled=false;this._visible=true;this._coordinates=e.coordinates,this.altitude=e.altitude??0,this.offset=e.offset??[0,0],this.anchorTransform=Nf[e.anchor??"bottom"],this.userData=e.userData??{};let t=e.element??document.createElement("div");e.element||(t.className="osmgl-marker-default",t.innerHTML=e.html??Uf),t.classList.add("osmgl-marker"),e.className&&t.classList.add(e.className),t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.willChange="transform",e.zIndex!==void 0&&(t.style.zIndex=String(e.zIndex)),this.element=t;}get coordinates(){return this._coordinates}setCoordinates(e){return this._coordinates=e,this}setVisible(e){return this._visible=e,this.applyVisibility(),this}get visible(){return this._visible}attach(e){this.attachedTo!==e&&(e.appendChild(this.element),this.attachedTo=e);}detach(){this.element.remove(),this.attachedTo=null;}update(e){let t=Z(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(re(t.lng)*o,ne(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=Gf;if(r.x<-n||r.y<-n||r.x>e.width+n||r.y>e.height+n){this.culled=true,this.applyVisibility();return}this.culled=false,this.applyVisibility(),this.element.style.transform=`translate(${Math.round(r.x+this.offset[0])}px, ${Math.round(r.y+this.offset[1])}px) ${this.anchorTransform}`;}applyVisibility(){this.element.style.display=this._visible&&!this.culled?"":"none";}},Uf='<svg width="24" height="32" viewBox="0 0 24 32" xmlns="http://www.w3.org/2000/svg"><path d="M12 0C5.4 0 0 5.4 0 12c0 9 12 20 12 20s12-11 12-20c0-6.6-5.4-12-12-12z" fill="#2f6df6"/><circle cx="12" cy="12" r="4.5" fill="#fff"/></svg>';var eo=class extends Jt{constructor(t){let o=document.createElement("div");o.className="osmgl-popup",o.style.pointerEvents="auto";let r=document.createElement("div");if(r.className="osmgl-popup-content",t.element?r.appendChild(t.element):r.innerHTML=t.html??"",o.appendChild(r),t.closeButton!==false){let a=document.createElement("button");a.className="osmgl-popup-close",a.type="button",a.setAttribute("aria-label","\u0417\u0430\u043A\u0440\u044B\u0442\u044C"),a.textContent="\xD7",o.appendChild(a);}let n=document.createElement("div");n.className="osmgl-popup-tip",o.appendChild(n);super({coordinates:t.coordinates,element:o,anchor:t.anchor??"bottom",offset:t.offset??[0,-12],altitude:t.altitude,zIndex:t.zIndex??10,className:t.className,userData:t.userData});this.onClose=null;this.content=r,this.closeOnClick=t.closeOnClick!==false,o.querySelector(".osmgl-popup-close")?.addEventListener("click",()=>this.onClose?.());}onCloseRequest(t){return this.onClose=t,this}setHtml(t){return this.content.innerHTML=t,this}setContent(t){return this.content.replaceChildren(t),this}};var jf=[["\u0443\u043B\u0438\u0446\u0430","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u044B","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u0435","\u0443\u043B."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442\u0430","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043E\u043A","\u043F\u0435\u0440."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043A\u0430","\u043F\u0435\u0440."],["\u043F\u0440\u043E\u0435\u0437\u0434","\u043F\u0440-\u0434"],["\u043F\u0440\u043E\u0435\u0437\u0434\u0430","\u043F\u0440-\u0434"],["\u043F\u043B\u043E\u0449\u0430\u0434\u044C","\u043F\u043B."],["\u043F\u043B\u043E\u0449\u0430\u0434\u0438","\u043F\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440","\u0431\u0443\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440\u0430","\u0431\u0443\u043B."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u0430\u044F","\u043D\u0430\u0431."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u043E\u0439","\u043D\u0430\u0431."],["\u0448\u043E\u0441\u0441\u0435","\u0448."],["\u0442\u0443\u043F\u0438\u043A","\u0442\u0443\u043F."],["\u0442\u0443\u043F\u0438\u043A\u0430","\u0442\u0443\u043F."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D","\u043C\u043A\u0440."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D\u0430","\u043C\u043A\u0440."],["\u043A\u04EF\u0447\u0430\u0438","\u043A."],["\u043A\u0443\u0447\u0430\u0438","\u043A."],["\u0445\u0438\u0451\u0431\u043E\u043D\u0438","\u0445\u0438\u0451\u0431."],["\u0448\u043E\u04B3\u0440\u043E\u04B3\u0438","\u0448\u043E\u04B3."],["\u0433\u0443\u0437\u0430\u0440\u0433\u043E\u04B3\u0438","\u0433\u0443\u0437."],["\u043C\u0430\u0439\u0434\u043E\u043D\u0438","\u043C\u0430\u0439\u0434."]],rl=new Map(jf);function rn(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=rl.get(n.toLowerCase());return a?(t=true,n[0]===n[0].toUpperCase()?a[0].toUpperCase()+a.slice(1):a):n});return !t||!e.filter(n=>rl.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function an(i,e){let t=[],o=[],r=[],n=[],a=[],l=e.textPlacement==="line",s=[],c=[],f=[];for(let u of i.features()){if(!pe(e.filter,u.properties))continue;let h=u.loadGeometry(),m=Kf(u.type,h);if(!m)continue;let d=e.textField?nn(e.textField,u.properties):"",p=d&&e.abbreviate?rn(d):d,y=e.iconImage?nn(e.iconImage,u.properties):"";if(!(!p&&!y)){if(l){let b=Yf(u.type,h);if(!b)continue;f.push({text:p,line:b});continue}t.push(m[0],m[1]),o.push(p),r.push(y),n.push($f(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:u,line:h}of Xf(f)){c.push(s.length/2);for(let m of h)s.push(m);t.push(Math.round(h[0]),Math.round(h[1])),o.push(u),r.push(""),n.push(128),a.push(0);}c.push(s.length/2);}return o.length?{anchors:new Int16Array(t).buffer,texts:o,icons:r,priorities:new Uint8Array(n).buffer,rotations:new Int16Array(a).buffer,...l?{lines:new Int16Array(s).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function Xf(i){let e=[],t=new Map,o=new Map,r=(n,a,l)=>`${n}\u241F${a}\u241F${l}`;for(let{text:n,line:a}of i){let l=r(n,a[0],a[1]),s=r(n,a[a.length-2],a[a.length-1]),c=t.get(s),f=o.get(l);if(f!==void 0){let u=e[f];if(u.line.push(...a.slice(2)),o.delete(l),o.set(r(n,u.line[u.line.length-2],u.line[u.line.length-1]),f),c!==void 0&&c!==f){let h=e[c];u.line.push(...h.line.slice(2)),h.line=[],t.delete(s),o.set(r(n,u.line[u.line.length-2],u.line[u.line.length-1]),f);}continue}if(c!==void 0){let u=e[c];u.line.unshift(...a.slice(0,a.length-2)),t.delete(s),t.set(r(n,u.line[0],u.line[1]),c);continue}t.set(l,e.length),o.set(s,e.length),e.push({text:n,line:a});}return e.filter(n=>n.line.length>=4)}function Yf(i,e){if(i!==2)return null;let t=null,o=0;for(let r of e){if(r.length<4)continue;let n=0;for(let a=0;a+3<r.length;a+=2)n+=Math.hypot(r[a+2]-r[a],r[a+3]-r[a+1]);n>o&&(o=n,t=r);}return t}function Kf(i,e){if(!e.length)return null;if(i===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(i===2){let a=-1,l=0,s=0;for(let c of e)for(let f=0;f+3<c.length;f+=2){let u=c[f+2]-c[f],h=c[f+3]-c[f+1],m=u*u+h*h;m>a&&(a=m,l=c[f]+u/2,s=c[f+1]+h/2);}return a>0?[Math.round(l),Math.round(s)]:null}let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+n)/2)]:null}function $f(i){let e=i.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function nn(i,e){let t=Array.isArray(i)?i:[i];for(let o of t){let r=true,a=o.replace(/\{([^}]+)\}/g,(l,s)=>{let c=e[s];return c==null||c===""?(r=false,""):String(c)}).trim();if(r&&a)return a}return ""}function nl(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&pe(e,n.properties))for(let a of n.loadGeometry())for(let l=0;l+1<a.length;l+=2)t.push(a[l],a[l+1]),o.push(n.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function qf(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function il(i,e){let t=performance.now(),o=qf(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(b,g,v,x,C=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:x,parseMs:C},diag:{status:b,bytes:g,layers:v,built:0}});if(!r.ok){if(r.status===404||r.status===204)return n(r.status,0,[],performance.now()-t);throw new Error(`HTTP ${r.status} \u0434\u043B\u044F ${i.url}`)}let a=await r.arrayBuffer(),l=performance.now()-t;if(a.byteLength===0)return n(r.status,0,[],l);let s=performance.now(),c=new kt(a),f=Object.keys(c.layers),u={},h={},m=new Set,d=[],y=i.plan.some(b=>b.type==="surface"&&(b.elevation??0)>0)&&i.plan.some(b=>b.type==="line"&&b.ground)?dr(i.metersPerTile):void 0;for(let b of i.plan){if(!Qf(b,i.zoom,i.sourceMaxZoom))continue;let g=c.layers[b.sourceLayer];if(!g)continue;let v=Jf(i.zoom,g.extent);try{if(b.splitBy){let C=eu(g,b.splitBy,b.filter);if(!C.length)continue;let S=h[b.splitBy]??(h[b.splitBy]=[]);for(let M of C){S.includes(M)||S.push(M);let w={...b,splitBy:void 0,filter:ou(b.filter,b.splitBy,M)},_=ln(w,g,v,i.metersPerTile,y);_&&(u[ze(b.id,M)]=_);}continue}if(b.network&&b.type==="line"){for(let C of tu(g,b.filter)){let S=ln(b,g,v,i.metersPerTile,y,C);S&&(u[ze(b.id,C)]=S,m.add(C));}continue}let x=ln(b,g,v,i.metersPerTile,y);x&&(u[b.id]=x);}catch(x){d.push(`${b.id}: ${x instanceof Error?x.message:String(x)}`);}}return {type:"loaded",id:i.id,buckets:u,...Object.keys(h).length?{splits:h}:{},...m.size?{levels:[...m].sort((b,g)=>b-g)}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(u).length,...d.length?{failed:d}:{}}}}function Zf(i){return e=>{let t=e.on;if(typeof t!="string"||!t)return 0;let o=0;for(let r of t.split(",")){let n=i[r];typeof n=="number"&&n>o&&(o=n);}return o}}function Qf(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function Jf(i,e){return i<=6?Math.max(64,e/24):0}function ln(i,e,t,o,r,n){{if(i.type==="fill"){let l=o>0?o/e.extent:0,s=i.cornerRadius&&l>0?{radius:i.cornerRadius/l,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:Un/l}:void 0,c=hr(e,i.filter,t,s,i.clipToTile===true,e.extent);return c?{kind:"fill",...c,extent:e.extent}:null}if(i.type==="surface"){let l=ur(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,elevation:i.elevation??0,base:i.base,bevel:i.bevel,weld:i.weld,bevelDrop:i.bevelDrop,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments,...r?{onShapes:s=>mr(r,s,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:Zf(i.groundBy)}:{}});return l?{kind:"surface",...l}:null}if(i.type==="line"){let l=br(e,i.filter,t,i.ground?r:void 0,o>0?o/e.extent:0,{level:n});return l?{kind:"line",...l,extent:e.extent}:null}if(i.type==="model"){let l=nl(e,i.filter);return l?{kind:"placement",...l,extent:e.extent}:null}if(i.type==="symbol"){let l=an(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return l?{kind:"symbol",...l,extent:e.extent}:null}let a=ir(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments});return a?{kind:"fill-extrusion",vertices:a.vertices,indices:a.indices,featureIds:a.featureIds,vertexCount:a.vertexCount,indexCount:a.indexCount,extent:a.extent}:null}}function eu(i,e,t){let o=[];for(let r of i.features()){if(!pe(t,r.properties))continue;let n=r.properties[e];typeof n!="string"&&typeof n!="number"||o.includes(n)||o.push(n);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}function tu(i,e){let t=[];for(let o of i.features()){if(!pe(e,o.properties))continue;let r=et(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function ou(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var sn='"use strict";(()=>{var or=Object.create;var Qt=Object.defineProperty;var sr=Object.getOwnPropertyDescriptor;var ur=Object.getOwnPropertyNames;var lr=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty;var fr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ar=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ur(e))!cr.call(t,i)&&i!==n&&Qt(t,i,{get:()=>e[i],enumerable:!(r=sr(e,i))||r.enumerable});return t};var hr=(t,e,n)=>(n=t!=null?or(lr(t)):{},ar(e||!t||!t.__esModule?Qt(n,"default",{value:t,enumerable:!0}):n,t));var _n=fr((Ut,Gt)=>{(function(t,e){typeof Ut=="object"&&typeof Gt<"u"?Gt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.polygonClipping=e())})(Ut,function(){"use strict";function t(g,o){var u={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},f,m,h,S;return S={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function v(M){return function(V){return F([M,V])}}function F(M){if(f)throw new TypeError("Generator is already executing.");for(;u;)try{if(f=1,m&&(h=M[0]&2?m.return:M[0]?m.throw||((h=m.return)&&h.call(m),0):m.next)&&!(h=h.call(m,M[1])).done)return h;switch(m=0,h&&(M=[M[0]&2,h.value]),M[0]){case 0:case 1:h=M;break;case 4:return u.label++,{value:M[1],done:!1};case 5:u.label++,m=M[1],M=[0];continue;case 7:M=u.ops.pop(),u.trys.pop();continue;default:if(h=u.trys,!(h=h.length>0&&h[h.length-1])&&(M[0]===6||M[0]===2)){u=0;continue}if(M[0]===3&&(!h||M[1]>h[0]&&M[1]<h[3])){u.label=M[1];break}if(M[0]===6&&u.label<h[1]){u.label=h[1],h=M;break}if(h&&u.label<h[2]){u.label=h[2],u.ops.push(M);break}h[2]&&u.ops.pop(),u.trys.pop();continue}M=o.call(g,u)}catch(V){M=[6,V],m=0}finally{f=h=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}}var e=function(){function g(o,u){this.next=null,this.key=o,this.data=u,this.left=null,this.right=null}return g}();function n(g,o){return g>o?1:g<o?-1:0}function r(g,o,u){for(var f=new e(null,null),m=f,h=f;;){var S=u(g,o.key);if(S<0){if(o.left===null)break;if(u(g,o.left.key)<0){var v=o.left;if(o.left=v.right,v.right=o,o=v,o.left===null)break}h.left=o,h=o,o=o.left}else if(S>0){if(o.right===null)break;if(u(g,o.right.key)>0){var v=o.right;if(o.right=v.left,v.left=o,o=v,o.right===null)break}m.right=o,m=o,o=o.right}else break}return m.right=o.left,h.left=o.right,o.left=f.right,o.right=f.left,o}function i(g,o,u,f){var m=new e(g,o);if(u===null)return m.left=m.right=null,m;u=r(g,u,f);var h=f(g,u.key);return h<0?(m.left=u.left,m.right=u,u.left=null):h>=0&&(m.right=u.right,m.left=u,u.right=null),m}function s(g,o,u){var f=null,m=null;if(o){o=r(g,o,u);var h=u(o.key,g);h===0?(f=o.left,m=o.right):h<0?(m=o.right,o.right=null,f=o):(f=o.left,o.left=null,m=o)}return{left:f,right:m}}function l(g,o,u){return o===null?g:(g===null||(o=r(g.key,o,u),o.left=g),o)}function c(g,o,u,f,m){if(g){f(""+o+(u?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+m(g)+`\n`);var h=o+(u?" ":"\\u2502 ");g.left&&c(g.left,h,!1,f,m),g.right&&c(g.right,h,!0,f,m)}}var a=function(){function g(o){o===void 0&&(o=n),this._root=null,this._size=0,this._comparator=o}return g.prototype.insert=function(o,u){return this._size++,this._root=i(o,u,this._root,this._comparator)},g.prototype.add=function(o,u){var f=new e(o,u);this._root===null&&(f.left=f.right=null,this._size++,this._root=f);var m=this._comparator,h=r(o,this._root,m),S=m(o,h.key);return S===0?this._root=h:(S<0?(f.left=h.left,f.right=h,h.left=null):S>0&&(f.right=h.right,f.left=h,h.right=null),this._size++,this._root=f),this._root},g.prototype.remove=function(o){this._root=this._remove(o,this._root,this._comparator)},g.prototype._remove=function(o,u,f){var m;if(u===null)return null;u=r(o,u,f);var h=f(o,u.key);return h===0?(u.left===null?m=u.right:(m=r(o,u.left,f),m.right=u.right),this._size--,m):u},g.prototype.pop=function(){var o=this._root;if(o){for(;o.left;)o=o.left;return this._root=r(o.key,this._root,this._comparator),this._root=this._remove(o.key,this._root,this._comparator),{key:o.key,data:o.data}}return null},g.prototype.findStatic=function(o){for(var u=this._root,f=this._comparator;u;){var m=f(o,u.key);if(m===0)return u;m<0?u=u.left:u=u.right}return null},g.prototype.find=function(o){return this._root&&(this._root=r(o,this._root,this._comparator),this._comparator(o,this._root.key)!==0)?null:this._root},g.prototype.contains=function(o){for(var u=this._root,f=this._comparator;u;){var m=f(o,u.key);if(m===0)return!0;m<0?u=u.left:u=u.right}return!1},g.prototype.forEach=function(o,u){for(var f=this._root,m=[],h=!1;!h;)f!==null?(m.push(f),f=f.left):m.length!==0?(f=m.pop(),o.call(u,f),f=f.right):h=!0;return this},g.prototype.range=function(o,u,f,m){for(var h=[],S=this._comparator,v=this._root,F;h.length!==0||v;)if(v)h.push(v),v=v.left;else{if(v=h.pop(),F=S(v.key,u),F>0)break;if(S(v.key,o)>=0&&f.call(m,v))return this;v=v.right}return this},g.prototype.keys=function(){var o=[];return this.forEach(function(u){var f=u.key;return o.push(f)}),o},g.prototype.values=function(){var o=[];return this.forEach(function(u){var f=u.data;return o.push(f)}),o},g.prototype.min=function(){return this._root?this.minNode(this._root).key:null},g.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},g.prototype.minNode=function(o){if(o===void 0&&(o=this._root),o)for(;o.left;)o=o.left;return o},g.prototype.maxNode=function(o){if(o===void 0&&(o=this._root),o)for(;o.right;)o=o.right;return o},g.prototype.at=function(o){for(var u=this._root,f=!1,m=0,h=[];!f;)if(u)h.push(u),u=u.left;else if(h.length>0){if(u=h.pop(),m===o)return u;m++,u=u.right}else f=!0;return null},g.prototype.next=function(o){var u=this._root,f=null;if(o.right){for(f=o.right;f.left;)f=f.left;return f}for(var m=this._comparator;u;){var h=m(o.key,u.key);if(h===0)break;h<0?(f=u,u=u.left):u=u.right}return f},g.prototype.prev=function(o){var u=this._root,f=null;if(o.left!==null){for(f=o.left;f.right;)f=f.right;return f}for(var m=this._comparator;u;){var h=m(o.key,u.key);if(h===0)break;h<0?u=u.left:(f=u,u=u.right)}return f},g.prototype.clear=function(){return this._root=null,this._size=0,this},g.prototype.toList=function(){return y(this._root)},g.prototype.load=function(o,u,f){u===void 0&&(u=[]),f===void 0&&(f=!1);var m=o.length,h=this._comparator;if(f&&E(o,u,0,m-1,h),this._root===null)this._root=p(o,u,0,m),this._size=m;else{var S=b(this.toList(),x(o,u),h);m=this._size+m,this._root=d({head:S},0,m)}return this},g.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(g.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(g.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),g.prototype.toString=function(o){o===void 0&&(o=function(f){return String(f.key)});var u=[];return c(this._root,"",!0,function(f){return u.push(f)},o),u.join("")},g.prototype.update=function(o,u,f){var m=this._comparator,h=s(o,this._root,m),S=h.left,v=h.right;m(o,u)<0?v=i(u,f,v,m):S=i(u,f,S,m),this._root=l(S,v,m)},g.prototype.split=function(o){return s(o,this._root,this._comparator)},g.prototype[Symbol.iterator]=function(){var o,u,f;return t(this,function(m){switch(m.label){case 0:o=this._root,u=[],f=!1,m.label=1;case 1:return f?[3,6]:o===null?[3,2]:(u.push(o),o=o.left,[3,5]);case 2:return u.length===0?[3,4]:(o=u.pop(),[4,o]);case 3:return m.sent(),o=o.right,[3,5];case 4:f=!0,m.label=5;case 5:return[3,1];case 6:return[2]}})},g}();function p(g,o,u,f){var m=f-u;if(m>0){var h=u+Math.floor(m/2),S=g[h],v=o[h],F=new e(S,v);return F.left=p(g,o,u,h),F.right=p(g,o,h+1,f),F}return null}function x(g,o){for(var u=new e(null,null),f=u,m=0;m<g.length;m++)f=f.next=new e(g[m],o[m]);return f.next=null,u.next}function y(g){for(var o=g,u=[],f=!1,m=new e(null,null),h=m;!f;)o?(u.push(o),o=o.left):u.length>0?(o=h=h.next=u.pop(),o=o.right):f=!0;return h.next=null,m.next}function d(g,o,u){var f=u-o;if(f>0){var m=o+Math.floor(f/2),h=d(g,o,m),S=g.head;return S.left=h,g.head=g.head.next,S.right=d(g,m+1,u),S}return null}function b(g,o,u){for(var f=new e(null,null),m=f,h=g,S=o;h!==null&&S!==null;)u(h.key,S.key)<0?(m.next=h,h=h.next):(m.next=S,S=S.next),m=m.next;return h!==null?m.next=h:S!==null&&(m.next=S),f.next}function E(g,o,u,f,m){if(!(u>=f)){for(var h=g[u+f>>1],S=u-1,v=f+1;;){do S++;while(m(g[S],h)<0);do v--;while(m(g[v],h)>0);if(S>=v)break;var F=g[S];g[S]=g[v],g[v]=F,F=o[S],o[S]=o[v],o[v]=F}E(g,o,u,v,m),E(g,o,v+1,f,m)}}let A=(g,o)=>g.ll.x<=o.x&&o.x<=g.ur.x&&g.ll.y<=o.y&&o.y<=g.ur.y,_=(g,o)=>{if(o.ur.x<g.ll.x||g.ur.x<o.ll.x||o.ur.y<g.ll.y||g.ur.y<o.ll.y)return null;let u=g.ll.x<o.ll.x?o.ll.x:g.ll.x,f=g.ur.x<o.ur.x?g.ur.x:o.ur.x,m=g.ll.y<o.ll.y?o.ll.y:g.ll.y,h=g.ur.y<o.ur.y?g.ur.y:o.ur.y;return{ll:{x:u,y:m},ur:{x:f,y:h}}},R=Number.EPSILON;R===void 0&&(R=Math.pow(2,-52));let L=R*R,k=(g,o)=>{if(-R<g&&g<R&&-R<o&&o<R)return 0;let u=g-o;return u*u<L*g*o?0:g<o?-1:1};class T{constructor(){this.reset()}reset(){this.xRounder=new O,this.yRounder=new O}round(o,u){return{x:this.xRounder.round(o),y:this.yRounder.round(u)}}}class O{constructor(){this.tree=new a,this.round(0)}round(o){let u=this.tree.add(o),f=this.tree.prev(u);if(f!==null&&k(u.key,f.key)===0)return this.tree.remove(o),f.key;let m=this.tree.next(u);return m!==null&&k(u.key,m.key)===0?(this.tree.remove(o),m.key):o}}let D=new T,U=11102230246251565e-32,P=134217729,C=(3+8*U)*U;function Y(g,o,u,f,m){let h,S,v,F,M=o[0],V=f[0],w=0,I=0;V>M==V>-M?(h=M,M=o[++w]):(h=V,V=f[++I]);let B=0;if(w<g&&I<u)for(V>M==V>-M?(S=M+h,v=h-(S-M),M=o[++w]):(S=V+h,v=h-(S-V),V=f[++I]),h=S,v!==0&&(m[B++]=v);w<g&&I<u;)V>M==V>-M?(S=h+M,F=S-h,v=h-(S-F)+(M-F),M=o[++w]):(S=h+V,F=S-h,v=h-(S-F)+(V-F),V=f[++I]),h=S,v!==0&&(m[B++]=v);for(;w<g;)S=h+M,F=S-h,v=h-(S-F)+(M-F),M=o[++w],h=S,v!==0&&(m[B++]=v);for(;I<u;)S=h+V,F=S-h,v=h-(S-F)+(V-F),V=f[++I],h=S,v!==0&&(m[B++]=v);return(h!==0||B===0)&&(m[B++]=h),B}function Q(g,o){let u=o[0];for(let f=1;f<g;f++)u+=o[f];return u}function Z(g){return new Float64Array(g)}let re=(3+16*U)*U,X=(2+12*U)*U,$=(9+64*U)*U*U,z=Z(4),N=Z(8),q=Z(12),te=Z(16),K=Z(4);function oe(g,o,u,f,m,h,S){let v,F,M,V,w,I,B,H,G,W,j,ne,ae,ue,he,pe,ge,me,Se=g-m,Ee=u-m,Me=o-h,Re=f-h;ue=Se*Re,I=P*Se,B=I-(I-Se),H=Se-B,I=P*Re,G=I-(I-Re),W=Re-G,he=H*W-(ue-B*G-H*G-B*W),pe=Me*Ee,I=P*Me,B=I-(I-Me),H=Me-B,I=P*Ee,G=I-(I-Ee),W=Ee-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,z[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,z[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,z[2]=ne-(me-w)+(j-w),z[3]=me;let ke=Q(4,z),Je=X*S;if(ke>=Je||-ke>=Je||(w=g-Se,v=g-(Se+w)+(w-m),w=u-Ee,M=u-(Ee+w)+(w-m),w=o-Me,F=o-(Me+w)+(w-h),w=f-Re,V=f-(Re+w)+(w-h),v===0&&F===0&&M===0&&V===0)||(Je=$*S+C*Math.abs(ke),ke+=Se*V+Re*v-(Me*M+Ee*F),ke>=Je||-ke>=Je))return ke;ue=v*Re,I=P*v,B=I-(I-v),H=v-B,I=P*Re,G=I-(I-Re),W=Re-G,he=H*W-(ue-B*G-H*G-B*W),pe=F*Ee,I=P*F,B=I-(I-F),H=F-B,I=P*Ee,G=I-(I-Ee),W=Ee-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,K[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,K[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,K[2]=ne-(me-w)+(j-w),K[3]=me;let nr=Y(4,z,4,K,N);ue=Se*V,I=P*Se,B=I-(I-Se),H=Se-B,I=P*V,G=I-(I-V),W=V-G,he=H*W-(ue-B*G-H*G-B*W),pe=Me*M,I=P*Me,B=I-(I-Me),H=Me-B,I=P*M,G=I-(I-M),W=M-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,K[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,K[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,K[2]=ne-(me-w)+(j-w),K[3]=me;let rr=Y(nr,N,4,K,q);ue=v*V,I=P*v,B=I-(I-v),H=v-B,I=P*V,G=I-(I-V),W=V-G,he=H*W-(ue-B*G-H*G-B*W),pe=F*M,I=P*F,B=I-(I-F),H=F-B,I=P*M,G=I-(I-M),W=M-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,K[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,K[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,K[2]=ne-(me-w)+(j-w),K[3]=me;let ir=Y(rr,q,4,K,te);return te[ir-1]}function ee(g,o,u,f,m,h){let S=(o-h)*(u-m),v=(g-m)*(f-h),F=S-v,M=Math.abs(S+v);return Math.abs(F)>=re*M?F:-oe(g,o,u,f,m,h,M)}let J=(g,o)=>g.x*o.y-g.y*o.x,fe=(g,o)=>g.x*o.x+g.y*o.y,be=(g,o,u)=>{let f=ee(g.x,g.y,o.x,o.y,u.x,u.y);return f>0?-1:f<0?1:0},de=g=>Math.sqrt(fe(g,g)),Fe=(g,o,u)=>{let f={x:o.x-g.x,y:o.y-g.y},m={x:u.x-g.x,y:u.y-g.y};return J(m,f)/de(m)/de(f)},Ce=(g,o,u)=>{let f={x:o.x-g.x,y:o.y-g.y},m={x:u.x-g.x,y:u.y-g.y};return fe(m,f)/de(m)/de(f)},Le=(g,o,u)=>o.y===0?null:{x:g.x+o.x/o.y*(u-g.y),y:u},Ve=(g,o,u)=>o.x===0?null:{x:u,y:g.y+o.y/o.x*(u-g.x)},we=(g,o,u,f)=>{if(o.x===0)return Ve(u,f,g.x);if(f.x===0)return Ve(g,o,u.x);if(o.y===0)return Le(u,f,g.y);if(f.y===0)return Le(g,o,u.y);let m=J(o,f);if(m==0)return null;let h={x:u.x-g.x,y:u.y-g.y},S=J(h,o)/m,v=J(h,f)/m,F=g.x+v*o.x,M=u.x+S*f.x,V=g.y+v*o.y,w=u.y+S*f.y,I=(F+M)/2,B=(V+w)/2;return{x:I,y:B}};class se{static compare(o,u){let f=se.comparePoints(o.point,u.point);return f!==0?f:(o.point!==u.point&&o.link(u),o.isLeft!==u.isLeft?o.isLeft?1:-1:xe.compare(o.segment,u.segment))}static comparePoints(o,u){return o.x<u.x?-1:o.x>u.x?1:o.y<u.y?-1:o.y>u.y?1:0}constructor(o,u){o.events===void 0?o.events=[this]:o.events.push(this),this.point=o,this.isLeft=u}link(o){if(o.point===this.point)throw new Error("Tried to link already linked events");let u=o.point.events;for(let f=0,m=u.length;f<m;f++){let h=u[f];this.point.events.push(h),h.point=this.point}this.checkForConsuming()}checkForConsuming(){let o=this.point.events.length;for(let u=0;u<o;u++){let f=this.point.events[u];if(f.segment.consumedBy===void 0)for(let m=u+1;m<o;m++){let h=this.point.events[m];h.consumedBy===void 0&&f.otherSE.point.events===h.otherSE.point.events&&f.segment.consume(h.segment)}}}getAvailableLinkedEvents(){let o=[];for(let u=0,f=this.point.events.length;u<f;u++){let m=this.point.events[u];m!==this&&!m.segment.ringOut&&m.segment.isInResult()&&o.push(m)}return o}getLeftmostComparator(o){let u=new Map,f=m=>{let h=m.otherSE;u.set(m,{sine:Fe(this.point,o.point,h.point),cosine:Ce(this.point,o.point,h.point)})};return(m,h)=>{u.has(m)||f(m),u.has(h)||f(h);let{sine:S,cosine:v}=u.get(m),{sine:F,cosine:M}=u.get(h);return S>=0&&F>=0?v<M?1:v>M?-1:0:S<0&&F<0?v<M?-1:v>M?1:0:F<S?-1:F>S?1:0}}}let Pe=0;class xe{static compare(o,u){let f=o.leftSE.point.x,m=u.leftSE.point.x,h=o.rightSE.point.x,S=u.rightSE.point.x;if(S<f)return 1;if(h<m)return-1;let v=o.leftSE.point.y,F=u.leftSE.point.y,M=o.rightSE.point.y,V=u.rightSE.point.y;if(f<m){if(F<v&&F<M)return 1;if(F>v&&F>M)return-1;let w=o.comparePoint(u.leftSE.point);if(w<0)return 1;if(w>0)return-1;let I=u.comparePoint(o.rightSE.point);return I!==0?I:-1}if(f>m){if(v<F&&v<V)return-1;if(v>F&&v>V)return 1;let w=u.comparePoint(o.leftSE.point);if(w!==0)return w;let I=o.comparePoint(u.rightSE.point);return I<0?1:I>0?-1:1}if(v<F)return-1;if(v>F)return 1;if(h<S){let w=u.comparePoint(o.rightSE.point);if(w!==0)return w}if(h>S){let w=o.comparePoint(u.rightSE.point);if(w<0)return 1;if(w>0)return-1}if(h!==S){let w=M-v,I=h-f,B=V-F,H=S-m;if(w>I&&B<H)return 1;if(w<I&&B>H)return-1}return h>S?1:h<S||M<V?-1:M>V?1:o.id<u.id?-1:o.id>u.id?1:0}constructor(o,u,f,m){this.id=++Pe,this.leftSE=o,o.segment=this,o.otherSE=u,this.rightSE=u,u.segment=this,u.otherSE=o,this.rings=f,this.windings=m}static fromRing(o,u,f){let m,h,S,v=se.comparePoints(o,u);if(v<0)m=o,h=u,S=1;else if(v>0)m=u,h=o,S=-1;else throw new Error(`Tried to create degenerate segment at [${o.x}, ${o.y}]`);let F=new se(m,!0),M=new se(h,!1);return new xe(F,M,[f],[S])}replaceRightSE(o){this.rightSE=o,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let o=this.leftSE.point.y,u=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:o<u?o:u},ur:{x:this.rightSE.point.x,y:o>u?o:u}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(o){return o.x===this.leftSE.point.x&&o.y===this.leftSE.point.y||o.x===this.rightSE.point.x&&o.y===this.rightSE.point.y}comparePoint(o){if(this.isAnEndpoint(o))return 0;let u=this.leftSE.point,f=this.rightSE.point,m=this.vector();if(u.x===f.x)return o.x===u.x?0:o.x<u.x?1:-1;let h=(o.y-u.y)/m.y,S=u.x+h*m.x;if(o.x===S)return 0;let v=(o.x-u.x)/m.x,F=u.y+v*m.y;return o.y===F?0:o.y<F?-1:1}getIntersection(o){let u=this.bbox(),f=o.bbox(),m=_(u,f);if(m===null)return null;let h=this.leftSE.point,S=this.rightSE.point,v=o.leftSE.point,F=o.rightSE.point,M=A(u,v)&&this.comparePoint(v)===0,V=A(f,h)&&o.comparePoint(h)===0,w=A(u,F)&&this.comparePoint(F)===0,I=A(f,S)&&o.comparePoint(S)===0;if(V&&M)return I&&!w?S:!I&&w?F:null;if(V)return w&&h.x===F.x&&h.y===F.y?null:h;if(M)return I&&S.x===v.x&&S.y===v.y?null:v;if(I&&w)return null;if(I)return S;if(w)return F;let B=we(h,this.vector(),v,o.vector());return B===null||!A(m,B)?null:D.round(B.x,B.y)}split(o){let u=[],f=o.events!==void 0,m=new se(o,!0),h=new se(o,!1),S=this.rightSE;this.replaceRightSE(h),u.push(h),u.push(m);let v=new xe(m,S,this.rings.slice(),this.windings.slice());return se.comparePoints(v.leftSE.point,v.rightSE.point)>0&&v.swapEvents(),se.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),f&&(m.checkForConsuming(),h.checkForConsuming()),u}swapEvents(){let o=this.rightSE;this.rightSE=this.leftSE,this.leftSE=o,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let u=0,f=this.windings.length;u<f;u++)this.windings[u]*=-1}consume(o){let u=this,f=o;for(;u.consumedBy;)u=u.consumedBy;for(;f.consumedBy;)f=f.consumedBy;let m=xe.compare(u,f);if(m!==0){if(m>0){let h=u;u=f,f=h}if(u.prev===f){let h=u;u=f,f=h}for(let h=0,S=f.rings.length;h<S;h++){let v=f.rings[h],F=f.windings[h],M=u.rings.indexOf(v);M===-1?(u.rings.push(v),u.windings.push(F)):u.windings[M]+=F}f.rings=null,f.windings=null,f.consumedBy=u,f.leftSE.consumedBy=u.leftSE,f.rightSE.consumedBy=u.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let o=this.prev.consumedBy||this.prev;this._beforeState=o.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let o=this.beforeState();this._afterState={rings:o.rings.slice(0),windings:o.windings.slice(0),multiPolys:[]};let u=this._afterState.rings,f=this._afterState.windings,m=this._afterState.multiPolys;for(let v=0,F=this.rings.length;v<F;v++){let M=this.rings[v],V=this.windings[v],w=u.indexOf(M);w===-1?(u.push(M),f.push(V)):f[w]+=V}let h=[],S=[];for(let v=0,F=u.length;v<F;v++){if(f[v]===0)continue;let M=u[v],V=M.poly;if(S.indexOf(V)===-1)if(M.isExterior)h.push(V);else{S.indexOf(V)===-1&&S.push(V);let w=h.indexOf(M.poly);w!==-1&&h.splice(w,1)}}for(let v=0,F=h.length;v<F;v++){let M=h[v].multiPoly;m.indexOf(M)===-1&&m.push(M)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let o=this.beforeState().multiPolys,u=this.afterState().multiPolys;switch(ve.type){case"union":{let f=o.length===0,m=u.length===0;this._isInResult=f!==m;break}case"intersection":{let f,m;o.length<u.length?(f=o.length,m=u.length):(f=u.length,m=o.length),this._isInResult=m===ve.numMultiPolys&&f<m;break}case"xor":{let f=Math.abs(o.length-u.length);this._isInResult=f%2===1;break}case"difference":{let f=m=>m.length===1&&m[0].isSubject;this._isInResult=f(o)!==f(u);break}default:throw new Error(`Unrecognized operation type found ${ve.type}`)}return this._isInResult}}class Be{constructor(o,u,f){if(!Array.isArray(o)||o.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=u,this.isExterior=f,this.segments=[],typeof o[0][0]!="number"||typeof o[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let m=D.round(o[0][0],o[0][1]);this.bbox={ll:{x:m.x,y:m.y},ur:{x:m.x,y:m.y}};let h=m;for(let S=1,v=o.length;S<v;S++){if(typeof o[S][0]!="number"||typeof o[S][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let F=D.round(o[S][0],o[S][1]);F.x===h.x&&F.y===h.y||(this.segments.push(xe.fromRing(h,F,this)),F.x<this.bbox.ll.x&&(this.bbox.ll.x=F.x),F.y<this.bbox.ll.y&&(this.bbox.ll.y=F.y),F.x>this.bbox.ur.x&&(this.bbox.ur.x=F.x),F.y>this.bbox.ur.y&&(this.bbox.ur.y=F.y),h=F)}(m.x!==h.x||m.y!==h.y)&&this.segments.push(xe.fromRing(h,m,this))}getSweepEvents(){let o=[];for(let u=0,f=this.segments.length;u<f;u++){let m=this.segments[u];o.push(m.leftSE),o.push(m.rightSE)}return o}}class Oe{constructor(o,u){if(!Array.isArray(o))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Be(o[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let f=1,m=o.length;f<m;f++){let h=new Be(o[f],this,!1);h.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=h.bbox.ll.x),h.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=h.bbox.ll.y),h.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=h.bbox.ur.x),h.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=h.bbox.ur.y),this.interiorRings.push(h)}this.multiPoly=u}getSweepEvents(){let o=this.exteriorRing.getSweepEvents();for(let u=0,f=this.interiorRings.length;u<f;u++){let m=this.interiorRings[u].getSweepEvents();for(let h=0,S=m.length;h<S;h++)o.push(m[h])}return o}}class De{constructor(o,u){if(!Array.isArray(o))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof o[0][0][0]=="number"&&(o=[o])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let f=0,m=o.length;f<m;f++){let h=new Oe(o[f],this);h.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=h.bbox.ll.x),h.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=h.bbox.ll.y),h.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=h.bbox.ur.x),h.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=h.bbox.ur.y),this.polys.push(h)}this.isSubject=u}getSweepEvents(){let o=[];for(let u=0,f=this.polys.length;u<f;u++){let m=this.polys[u].getSweepEvents();for(let h=0,S=m.length;h<S;h++)o.push(m[h])}return o}}class Ie{static factory(o){let u=[];for(let f=0,m=o.length;f<m;f++){let h=o[f];if(!h.isInResult()||h.ringOut)continue;let S=null,v=h.leftSE,F=h.rightSE,M=[v],V=v.point,w=[];for(;S=v,v=F,M.push(v),v.point!==V;)for(;;){let I=v.getAvailableLinkedEvents();if(I.length===0){let G=M[0].point,W=M[M.length-1].point;throw new Error(`Unable to complete output ring starting at [${G.x}, ${G.y}]. Last matching segment found ends at [${W.x}, ${W.y}].`)}if(I.length===1){F=I[0].otherSE;break}let B=null;for(let G=0,W=w.length;G<W;G++)if(w[G].point===v.point){B=G;break}if(B!==null){let G=w.splice(B)[0],W=M.splice(G.index);W.unshift(W[0].otherSE),u.push(new Ie(W.reverse()));continue}w.push({index:M.length,point:v.point});let H=v.getLeftmostComparator(S);F=I.sort(H)[0].otherSE;break}u.push(new Ie(M))}return u}constructor(o){this.events=o;for(let u=0,f=o.length;u<f;u++)o[u].segment.ringOut=this;this.poly=null}getGeom(){let o=this.events[0].point,u=[o];for(let M=1,V=this.events.length-1;M<V;M++){let w=this.events[M].point,I=this.events[M+1].point;be(w,o,I)!==0&&(u.push(w),o=w)}if(u.length===1)return null;let f=u[0],m=u[1];be(f,o,m)===0&&u.shift(),u.push(u[0]);let h=this.isExteriorRing()?1:-1,S=this.isExteriorRing()?0:u.length-1,v=this.isExteriorRing()?u.length:-1,F=[];for(let M=S;M!=v;M+=h)F.push([u[M].x,u[M].y]);return F}isExteriorRing(){if(this._isExteriorRing===void 0){let o=this.enclosingRing();this._isExteriorRing=o?!o.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let o=this.events[0];for(let m=1,h=this.events.length;m<h;m++){let S=this.events[m];se.compare(o,S)>0&&(o=S)}let u=o.segment.prevInResult(),f=u?u.prevInResult():null;for(;;){if(!u)return null;if(!f)return u.ringOut;if(f.ringOut!==u.ringOut)return f.ringOut.enclosingRing()!==u.ringOut?u.ringOut:u.ringOut.enclosingRing();u=f.prevInResult(),f=u?u.prevInResult():null}}}class ze{constructor(o){this.exteriorRing=o,o.poly=this,this.interiorRings=[]}addInterior(o){this.interiorRings.push(o),o.poly=this}getGeom(){let o=[this.exteriorRing.getGeom()];if(o[0]===null)return null;for(let u=0,f=this.interiorRings.length;u<f;u++){let m=this.interiorRings[u].getGeom();m!==null&&o.push(m)}return o}}class vt{constructor(o){this.rings=o,this.polys=this._composePolys(o)}getGeom(){let o=[];for(let u=0,f=this.polys.length;u<f;u++){let m=this.polys[u].getGeom();m!==null&&o.push(m)}return o}_composePolys(o){let u=[];for(let f=0,m=o.length;f<m;f++){let h=o[f];if(!h.poly)if(h.isExteriorRing())u.push(new ze(h));else{let S=h.enclosingRing();S.poly||u.push(new ze(S)),S.poly.addInterior(h)}}return u}}class ft{constructor(o){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xe.compare;this.queue=o,this.tree=new a(u),this.segments=[]}process(o){let u=o.segment,f=[];if(o.consumedBy)return o.isLeft?this.queue.remove(o.otherSE):this.tree.remove(u),f;let m=o.isLeft?this.tree.add(u):this.tree.find(u);if(!m)throw new Error(`Unable to find segment #${u.id} [${u.leftSE.point.x}, ${u.leftSE.point.y}] -> [${u.rightSE.point.x}, ${u.rightSE.point.y}] in SweepLine tree.`);let h=m,S=m,v,F;for(;v===void 0;)h=this.tree.prev(h),h===null?v=null:h.key.consumedBy===void 0&&(v=h.key);for(;F===void 0;)S=this.tree.next(S),S===null?F=null:S.key.consumedBy===void 0&&(F=S.key);if(o.isLeft){let M=null;if(v){let w=v.getIntersection(u);if(w!==null&&(u.isAnEndpoint(w)||(M=w),!v.isAnEndpoint(w))){let I=this._splitSafely(v,w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}}let V=null;if(F){let w=F.getIntersection(u);if(w!==null&&(u.isAnEndpoint(w)||(V=w),!F.isAnEndpoint(w))){let I=this._splitSafely(F,w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}}if(M!==null||V!==null){let w=null;M===null?w=V:V===null?w=M:w=se.comparePoints(M,V)<=0?M:V,this.queue.remove(u.rightSE),f.push(u.rightSE);let I=u.split(w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}f.length>0?(this.tree.remove(u),f.push(o)):(this.segments.push(u),u.prev=v)}else{if(v&&F){let M=v.getIntersection(F);if(M!==null){if(!v.isAnEndpoint(M)){let V=this._splitSafely(v,M);for(let w=0,I=V.length;w<I;w++)f.push(V[w])}if(!F.isAnEndpoint(M)){let V=this._splitSafely(F,M);for(let w=0,I=V.length;w<I;w++)f.push(V[w])}}}this.tree.remove(u)}return f}_splitSafely(o,u){this.tree.remove(o);let f=o.rightSE;this.queue.remove(f);let m=o.split(u);return m.push(f),o.consumedBy===void 0&&this.tree.add(o),m}}let Wt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,qn=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class er{run(o,u,f){ve.type=o,D.reset();let m=[new De(u,!0)];for(let w=0,I=f.length;w<I;w++)m.push(new De(f[w],!1));if(ve.numMultiPolys=m.length,ve.type==="difference"){let w=m[0],I=1;for(;I<m.length;)_(m[I].bbox,w.bbox)!==null?I++:m.splice(I,1)}if(ve.type==="intersection")for(let w=0,I=m.length;w<I;w++){let B=m[w];for(let H=w+1,G=m.length;H<G;H++)if(_(B.bbox,m[H].bbox)===null)return[]}let h=new a(se.compare);for(let w=0,I=m.length;w<I;w++){let B=m[w].getSweepEvents();for(let H=0,G=B.length;H<G;H++)if(h.insert(B[H]),h.size>Wt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let S=new ft(h),v=h.size,F=h.pop();for(;F;){let w=F.key;if(h.size===v){let B=w.segment;throw new Error(`Unable to pop() ${w.isLeft?"left":"right"} SweepEvent [${w.point.x}, ${w.point.y}] from segment #${B.id} [${B.leftSE.point.x}, ${B.leftSE.point.y}] -> [${B.rightSE.point.x}, ${B.rightSE.point.y}] from queue.`)}if(h.size>Wt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(S.segments.length>qn)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let I=S.process(w);for(let B=0,H=I.length;B<H;B++){let G=I[B];G.consumedBy===void 0&&h.insert(G)}v=h.size,F=h.pop()}D.reset();let M=Ie.factory(S.segments);return new vt(M).getGeom()}}let ve=new er;var tr={union:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("union",g,u)},intersection:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("intersection",g,u)},xor:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("xor",g,u)},difference:function(g){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("difference",g,u)}};return tr})});var nt=new Set,St=!1;function Te(t,e,n=2){let r=e&&e.length,i=r?e[0]*n:t.length;nt.size&&nt.clear();let s=en(t,0,i,n,!0),l=[];if(!s||s.next===s.prev)return l;let c=0,a=0,p=0;if(r&&(s=gr(t,e,s,n)),t.length>80*n){c=t[0],a=t[1];let x=c,y=a;for(let d=n;d<i;d+=n){let b=t[d],E=t[d+1];b<c&&(c=b),E<a&&(a=E),b>x&&(x=b),E>y&&(y=E)}p=Math.max(x-c,y-a),p=p!==0?32767/p:0}return Et(s,l,c,a,p),l}function en(t,e,n,r,i){let s=null;if(i===_r(t,e,n,r)>0)for(let l=e;l<n;l+=r)s=qt(l/r|0,t[l],t[l+1],s);else for(let l=n-r;l>=e;l-=r)s=qt(l/r|0,t[l],t[l+1],s);return s&&rt(s,s.next)&&(ot(s),s=s.next),s}function Ge(t,e=t){let n=e===t,r=t,i;do i=!1,r!==r.next&&(nt.size===0||!nt.has(r))&&(rt(r,r.next)||le(r.prev,r,r.next)===0)?((n||r===e)&&(e=r.prev),St=!0,ot(r),r=r.prev,i=!0):(n||r!==e)&&(r=r.next,i=!n);while(i||r!==e);return e}function Et(t,e,n,r,i){i&&Mr(t,n,r,i);let s=t,l=!1;for(;t.prev!==t.next;){let c=t.prev,a=t.next;if(le(c,t,a)<0&&(i?mr(t,n,r,i):pr(t))){e.push(c.i,t.i,a.i),ot(t),t=a,s=a;continue}if(t=a,t===s){if(St=!1,t=Ge(t),St){s=t;continue}if(!l){t=xr(t,e),s=t,l=!0;continue}dr(t,e,n,r,i);break}}}function pr(t){let e=t.prev,n=t,r=t.next,i=e.x,s=n.x,l=r.x,c=e.y,a=n.y,p=r.y,x=Math.min(i,s,l),y=Math.min(c,a,p),d=Math.max(i,s,l),b=Math.max(c,a,p),E=r.next;for(;E!==e;){if(E.x>=x&&E.x<=d&&E.y>=y&&E.y<=b&&!(i===E.x&&c===E.y)&&mt(i,c,s,a,l,p,E.x,E.y)&&le(E.prev,E,E.next)>=0)return!1;E=E.next}return!0}function mr(t,e,n,r){let i=t.prev,s=t,l=t.next,c=i.x,a=s.x,p=l.x,x=i.y,y=s.y,d=l.y,b=Math.min(c,a,p),E=Math.min(x,y,d),A=Math.max(c,a,p),_=Math.max(x,y,d),R=It(b,E,e,n,r),L=It(A,_,e,n,r),k=t.prevZ;for(;k&&k.z>=R;){if(k.x>=b&&k.x<=A&&k.y>=E&&k.y<=_&&k!==l&&!(c===k.x&&x===k.y)&&mt(c,x,a,y,p,d,k.x,k.y)&&le(k.prev,k,k.next)>=0)return!1;k=k.prevZ}let T=t.nextZ;for(;T&&T.z<=L;){if(T.x>=b&&T.x<=A&&T.y>=E&&T.y<=_&&T!==l&&!(c===T.x&&x===T.y)&&mt(c,x,a,y,p,d,T.x,T.y)&&le(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function xr(t,e){let n=t,r=!1;do{let i=n.prev,s=n.next.next;rn(i,n,n.next,s,!1)&&it(i,s)&&it(s,i)&&(e.push(i.i,n.i,s.i),ot(n),ot(n.next),n=t=s,r=!0),n=n.next}while(n!==t);return r?Ge(n):n}function dr(t,e,n,r,i){let s=t;do{let l=s.next.next;for(;l!==s.prev;){if(s.i!==l.i&&Ir(s,l)){let c=on(s,l);s=Ge(s,s.next),c=Ge(c,c.next),Et(s,e,n,r,i),Et(c,e,n,r,i);return}l=l.next}s=s.next}while(s!==t)}var Mt=!1;function gr(t,e,n,r){let i=[];for(let s=0,l=e.length;s<l;s++){let c=e[s]*r,a=s<l-1?e[s+1]*r:t.length,p=en(t,c,a,r,!1);p===p.next&&nt.add(p),i.push(Fr(p))}i.sort(yr),wr(t.length/r,e.length),nn(n,n),Mt=!0;for(let s=0;s<i.length;s++)n=br(i[s],n);return Mt=!1,Ge(n)}function yr(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function br(t,e){let n=Sr(t,e);if(!n)return e;let r=on(n,t),i=r.next;return nn(n,i.next),Ge(r,r.next),Ge(n,n.next)}var tn=16,ie=new Float64Array(0),pt=0,Rt=[],Ft=[];function wr(t,e){let n=Math.ceil((t+2*e)/tn)+e+2;ie.length<n*4&&(ie=new Float64Array(n*4)),pt=0}function nn(t,e){let n=t;do{let r=pt++;Rt[r]=n;let i=1/0,s=1/0,l=-1/0,c=-1/0,a=0;do{let x=n.next;n.z=r,n.x<i&&(i=n.x),n.x>l&&(l=n.x),n.y<s&&(s=n.y),n.y>c&&(c=n.y),x.x<i&&(i=x.x),x.x>l&&(l=x.x),x.y<s&&(s=x.y),x.y>c&&(c=x.y),n=x}while(++a<tn&&n!==e);Ft[r]=n;let p=r*4;ie[p]=i,ie[p+1]=s,ie[p+2]=l,ie[p+3]=c}while(n!==e)}function vr(t,e){let n=t.z*4;e.x<ie[n]&&(ie[n]=e.x),e.y<ie[n+1]&&(ie[n+1]=e.y),e.x>ie[n+2]&&(ie[n+2]=e.x),e.y>ie[n+3]&&(ie[n+3]=e.y)}function Kt(t){let e=Ft[t];for(;e.prev.next!==e;)e=e.next;return Ft[t]=e,e}function Jt(t){let e=Rt[t];for(;e.prev.next!==e;)e=e.next;return Rt[t]=e,e}function Sr(t,e){let n=e,r=t.x,i=t.y,s=-1/0,l;if(rt(t,n))return n;for(let d=0,b=0;d<pt;d++,b+=4){if(i<ie[b+1]||i>ie[b+3]||ie[b]>r||ie[b+2]<=s)continue;let E=Kt(d);n=Jt(d);do{if(n.prev.next===n){if(rt(t,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let A=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(A<=r&&A>s&&(s=A,l=n.x<n.next.x?n:n.next,A===r))return l}}n=n.next}while(n!==E)}if(!l)return null;let c=l.x,a=l.y,p=Math.min(i,a),x=Math.max(i,a),y=1/0;for(let d=0,b=0;d<pt;d++,b+=4){if(ie[b+2]<c||ie[b]>r||ie[b+3]<p||ie[b+1]>x)continue;let E=Kt(d);n=Jt(d);do{if(n.prev.next===n&&r>=n.x&&n.x>=c&&r!==n.x&&mt(i<a?r:s,i,c,a,i<a?s:r,i,n.x,n.y)){let A=Math.abs(i-n.y)/(r-n.x);(it(n,t)||n.y===i&&n.next.y===i&&n.next.x>r)&&(A<y||A===y&&(n.x>l.x||n.x===l.x&&Er(l,n)))&&(l=n,y=A)}n=n.next}while(n!==E)}return l}function Er(t,e){return le(t.prev,t,e.prev)<0&&le(e.next,t,t.next)<0}var ye=[],qe=[],Ue=new Uint32Array(0),et=new Uint32Array(0),tt=new Uint32Array(256);function Mr(t,e,n,r){let i=t,s=0;do i.z=It(i.x,i.y,e,n,r),ye[s++]=i,i=i.next;while(i!==t);Rr(s);let l=null;for(let c=0;c<s;c++){let a=ye[c];a.prevZ=l,l&&(l.nextZ=a),l=a}l.nextZ=null}function Rr(t){if(t<=32){for(let e=1;e<t;e++){let n=ye[e],r=n.z,i=e-1;for(;i>=0&&ye[i].z>r;)ye[i+1]=ye[i],i--;ye[i+1]=n}return}Ue.length<t&&(Ue=new Uint32Array(t),et=new Uint32Array(t),qe=new Array(t));for(let e=0;e<t;e++)Ue[e]=ye[e].z;at(t,ye,Ue,qe,et,0),at(t,qe,et,ye,Ue,8),at(t,ye,Ue,qe,et,16),at(t,qe,et,ye,Ue,24)}function at(t,e,n,r,i,s){tt.fill(0);for(let c=0;c<t;c++)tt[n[c]>>>s&255]++;let l=0;for(let c=0;c<256;c++){let a=tt[c];tt[c]=l,l+=a}for(let c=0;c<t;c++){let a=n[c],p=tt[a>>>s&255]++;r[p]=e[c],i[p]=a}}function It(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*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}function Fr(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function mt(t,e,n,r,i,s,l,c){return(i-l)*(e-c)>=(t-l)*(s-c)&&(t-l)*(r-c)>=(n-l)*(e-c)&&(n-l)*(s-c)>=(i-l)*(r-c)}function Ir(t,e){let n=rt(t,e)&&le(t.prev,t,t.next)>0&&le(e.prev,e,e.next)>0;return t.next.i!==e.i&&(n||it(t,e)&&it(e,t)&&(le(t.prev,t,e.prev)!==0||le(t,e.prev,e)!==0))&&!Pr(t,e)&&(n||kr(t,e))}function le(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function rt(t,e){return t.x===e.x&&t.y===e.y}function rn(t,e,n,r,i=!0){let s=le(t,e,n),l=le(t,e,r),c=le(n,r,t),a=le(n,r,e);return(s>0&&l<0||s<0&&l>0)&&(c>0&&a<0||c<0&&a>0)?!0:i?!!(s===0&&ht(t,n,e)||l===0&&ht(t,r,e)||c===0&&ht(n,t,r)||a===0&&ht(n,e,r)):!1}function ht(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Pr(t,e){let n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),s=Math.max(t.y,e.y),l=t;do{let c=l.next;if(l.x>r&&c.x>r||l.x<n&&c.x<n||l.y>s&&c.y>s||l.y<i&&c.y<i){l=c;continue}if(l.i!==t.i&&c.i!==t.i&&l.i!==e.i&&c.i!==e.i&&rn(l,c,t,e))return!0;l=c}while(l!==t);return!1}function it(t,e){return le(t.prev,t,t.next)<0?le(t,e,t.next)>=0&&le(t,t.prev,e)>=0:le(t,e,t.prev)<0||le(t,t.next,e)<0}function kr(t,e){let n=t,r=!1,i=(t.x+e.x)/2,s=(t.y+e.y)/2;do{let l=n.next;n.y>s!=l.y>s&&i<(l.x-n.x)*(s-n.y)/(l.y-n.y)+n.x&&(r=!r),n=l}while(n!==t);return r}function on(t,e){let n=Pt(t.i,t.x,t.y),r=Pt(e.i,e.x,e.y),i=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function qt(t,e,n,r){let i=Pt(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ot(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),Mt&&vr(t.prev,t.next)}function Pt(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function _r(t,e,n,r){let i=0;for(let s=e,l=n-r;s<n;s+=r)i+=(t[l]-t[s])*(t[s+1]+t[l+1]),l=s;return i}var sn=23283064365386963e-26,Ar=12,un=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),kt=0,xt=1,st=2,dt=5,ut=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,n,r=this.length){for(;this.pos<r;){let i=this.readVarint(),s=i>>3,l=this.pos;this.type=i&7,e(s,n,this),this.pos===l&&this.skip(i)}return n}readMessage(e,n){return this.readFields(e,n,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let n=this.buf,r,i;return i=n[this.pos++],r=i&127,i<128||(i=n[this.pos++],r|=(i&127)<<7,i<128)||(i=n[this.pos++],r|=(i&127)<<14,i<128)||(i=n[this.pos++],r|=(i&127)<<21,i<128)?r:(i=n[this.pos],r|=(i&15)<<28,Lr(r,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,n=this.pos;return this.pos=e,e-n>=Ar&&un?un.decode(this.buf.subarray(n,e)):jr(this.buf,n,e)}readBytes(){let e=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,e);return this.pos=e,n}readPackedVarint(e=[],n){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(n));return e}readPackedSVarint(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===st?this.readVarint()+this.pos:this.pos+1}skip(e){let n=e&7;if(n===kt)for(;this.buf[this.pos++]>127;);else if(n===st)this.pos=this.readVarint()+this.pos;else if(n===dt)this.pos+=4;else if(n===xt)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(e,n){this.writeVarint(e<<3|n)}realloc(e){let n=this.length||16;for(;n<this.pos+e;)n*=2;if(n!==this.length){let r=new Uint8Array(n);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=n}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*sn),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*sn),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Br(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;let n=this.pos;this.pos=Xr(this.buf,e,this.pos);let r=this.pos-n;r>=128&&ln(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let n=e.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,n){this.pos++;let r=this.pos;e(n,this);let i=this.pos-r;i>=128&&ln(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(e,n,r){this.writeTag(e,st),this.writeRawMessage(n,r)}writePackedVarint(e,n){n.length&&this.writeMessage(e,Vr,n)}writePackedSVarint(e,n){n.length&&this.writeMessage(e,Or,n)}writePackedBoolean(e,n){n.length&&this.writeMessage(e,Gr,n)}writePackedFloat(e,n){n.length&&this.writeMessage(e,Dr,n)}writePackedDouble(e,n){n.length&&this.writeMessage(e,Ur,n)}writePackedFixed32(e,n){n.length&&this.writeMessage(e,Nr,n)}writePackedSFixed32(e,n){n.length&&this.writeMessage(e,zr,n)}writePackedFixed64(e,n){n.length&&this.writeMessage(e,Hr,n)}writePackedSFixed64(e,n){n.length&&this.writeMessage(e,$r,n)}writeBytesField(e,n){this.writeTag(e,st),this.writeBytes(n)}writeFixed32Field(e,n){this.writeTag(e,dt),this.writeFixed32(n)}writeSFixed32Field(e,n){this.writeTag(e,dt),this.writeSFixed32(n)}writeFixed64Field(e,n){this.writeTag(e,xt),this.writeFixed64(n)}writeSFixed64Field(e,n){this.writeTag(e,xt),this.writeSFixed64(n)}writeVarintField(e,n){this.writeTag(e,kt),this.writeVarint(n)}writeSVarintField(e,n){this.writeTag(e,kt),this.writeSVarint(n)}writeStringField(e,n){this.writeTag(e,st),this.writeString(n)}writeFloatField(e,n){this.writeTag(e,dt),this.writeFloat(n)}writeDoubleField(e,n){this.writeTag(e,xt),this.writeDouble(n)}writeBooleanField(e,n){this.writeVarintField(e,+n)}};function Lr(t,e,n){let r=n.buf,i,s;if(s=r[n.pos++],i=(s&112)>>4,s<128||(s=r[n.pos++],i|=(s&127)<<3,s<128)||(s=r[n.pos++],i|=(s&127)<<10,s<128)||(s=r[n.pos++],i|=(s&127)<<17,s<128)||(s=r[n.pos++],i|=(s&127)<<24,s<128)||(s=r[n.pos++],i|=(s&1)<<31,s<128))return He(t,i,e);throw new Error("Expected varint not more than 10 bytes")}function He(t,e,n){return n?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Br(t,e){let n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(n=~(-t%4294967296),r=~(-t/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),Tr(n,r,e),Cr(r,e)}function Tr(t,e,n){n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos]=t&127}function Cr(t,e){let n=(t&7)<<4;e.buf[e.pos++]|=n|((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)))))}function ln(t,e,n){let r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));n.realloc(r);for(let i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function Vr(t,e){for(let n=0;n<t.length;n++)e.writeVarint(t[n])}function Or(t,e){for(let n=0;n<t.length;n++)e.writeSVarint(t[n])}function Dr(t,e){for(let n=0;n<t.length;n++)e.writeFloat(t[n])}function Ur(t,e){for(let n=0;n<t.length;n++)e.writeDouble(t[n])}function Gr(t,e){for(let n=0;n<t.length;n++)e.writeBoolean(t[n])}function Nr(t,e){for(let n=0;n<t.length;n++)e.writeFixed32(t[n])}function zr(t,e){for(let n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Hr(t,e){for(let n=0;n<t.length;n++)e.writeFixed64(t[n])}function $r(t,e){for(let n=0;n<t.length;n++)e.writeSFixed64(t[n])}function jr(t,e,n){let r="",i=e;for(;i<n;){let s=t[i],l=null,c=s>239?4:s>223?3:s>191?2:1;if(i+c>n)break;let a,p,x;c===1?s<128&&(l=s):c===2?(a=t[i+1],(a&192)===128&&(l=(s&31)<<6|a&63,l<=127&&(l=null))):c===3?(a=t[i+1],p=t[i+2],(a&192)===128&&(p&192)===128&&(l=(s&15)<<12|(a&63)<<6|p&63,(l<=2047||l>=55296&&l<=57343)&&(l=null))):c===4&&(a=t[i+1],p=t[i+2],x=t[i+3],(a&192)===128&&(p&192)===128&&(x&192)===128&&(l=(s&15)<<18|(a&63)<<12|(p&63)<<6|x&63,(l<=65535||l>=1114112)&&(l=null))),l===null?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|l&1023),r+=String.fromCharCode(l),i+=c}return r}function Xr(t,e,n){for(let r=0,i,s;r<e.length;r++){if(i=e.charCodeAt(r),i>55295&&i<57344)if(s)if(i<56320){t[n++]=239,t[n++]=191,t[n++]=189,s=i;continue}else i=s-55296<<10|i-56320|65536,s=null;else{i>56319||r+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):s=i;continue}else s&&(t[n++]=239,t[n++]=191,t[n++]=189,s=null);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:(i<65536?t[n++]=i>>12|224:(t[n++]=i>>18|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128),t[n++]=i&63|128)}return n}var _t=class t{constructor(e,n,r,i){this.pbf=e;this.keys=n;this.values=r;this.extent=i;this.type=0;this.properties={};this.geomOffset=-1}static read(e,n,r,i,s){let l=new t(e,r,i,s);return e.readFields(Yr,l,n),l}loadGeometry(){if(this.geomOffset<0)return[];let e=this.pbf,n=e.pos;e.pos=this.geomOffset;let r=e.readVarint()+e.pos,i=1,s=0,l=0,c=0,a=[],p=[];for(;e.pos<r;){if(s<=0){let x=e.readVarint();i=x&7,s=x>>3}if(s--,i===1||i===2)l+=e.readSVarint(),c+=e.readSVarint(),i===1&&(p.length&&a.push(p),p=[]),p.push(l,c);else if(i===7)p.length>=2&&p.push(p[0],p[1]);else throw new Error(`[osmgl] \\u043D\\u0435\\u0438\\u0437\\u0432\\u0435\\u0441\\u0442\\u043D\\u0430\\u044F \\u043A\\u043E\\u043C\\u0430\\u043D\\u0434\\u0430 \\u0433\\u0435\\u043E\\u043C\\u0435\\u0442\\u0440\\u0438\\u0438 MVT: ${i}`)}return p.length&&a.push(p),e.pos=n,a}bbox(){let e=this.loadGeometry(),n=1/0,r=1/0,i=-1/0,s=-1/0;for(let l of e)for(let c=0;c<l.length;c+=2)l[c]<n&&(n=l[c]),l[c]>i&&(i=l[c]),l[c+1]<r&&(r=l[c+1]),l[c+1]>s&&(s=l[c+1]);return[n,r,i,s]}};function Yr(t,e,n){n&&(t===1?e.id=n.readVarint():t===2?Zr(n,e):t===3?e.type=n.readVarint():t===4&&(e.geomOffset=n.pos,n.skip(2)))}function Zr(t,e){let n=t.readVarint()+t.pos;for(;t.pos<n;){let r=e.keys[t.readVarint()],i=e.values[t.readVarint()];r!==void 0&&(e.properties[r]=i)}}var At=class t{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(e,n){let r=new t(e);return e.readFields(Wr,r,n),r}get length(){return this.featureOffsets.length}feature(e){let n=this.pbf;n.pos=this.featureOffsets[e];let r=n.readVarint()+n.pos;return _t.read(n,r,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e)}};function Wr(t,e,n){n&&(t===15?e.version=n.readVarint():t===1?e.name=n.readString():t===5?e.extent=n.readVarint():t===2?e.featureOffsets.push(n.pos):t===3?e.keys.push(n.readString()):t===4&&e.values.push(Qr(n)))}function Qr(t){let e=t.readVarint()+t.pos,n=null;for(;t.pos<e;){let r=t.readVarint()>>3;r===1?n=t.readString():r===2?n=t.readFloat():r===3?n=t.readDouble():r===4?n=t.readVarint64():r===5?n=t.readVarint():r===6?n=t.readSVarint():r===7?n=t.readBoolean():t.skip(r)}return n}var gt=class{constructor(e){this.layers={};new ut(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((r,i,s)=>{if(r===3&&s){let l=At.read(s,s.readVarint()+s.pos);l.length&&(this.layers[l.name]=l)}},null)}};function $e(t){let e=[],n=null;for(let r of t){if(r.length<6)continue;let i=Kr(r);i!==0&&(i>0?(n&&e.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&e.push(n),e}function Kr(t){let e=0;for(let n=0,r=t.length-2;n<t.length;r=n,n+=2)e+=(t[r]-t[n])*(t[n+1]+t[r+1]);return e/2}function ce(t,e){if(!t)return!0;let n=t[0];switch(n){case"all":return t.slice(1).every(r=>ce(r,e));case"any":return t.slice(1).some(r=>ce(r,e));case"!":return!ce(t[1],e);case"has":return e[t[1]]!=null;case"!has":return e[t[1]]==null;case"in":{let r=e[t[1]];return r==null?!1:t.slice(2).includes(r)}case"!in":{let r=e[t[1]];return r==null?!0:!t.slice(2).includes(r)}default:{let r=e[t[1]],i=t[2];if(r==null)return n==="!=";switch(n){case"==":return r===i;case"!=":return r!==i;case">":return r>i;case">=":return r>=i;case"<":return r<i;case"<=":return r<=i;default:return!0}}}}var Jr=Math.PI/8,qr=.35,ei=32,cn=.25,fn=.5,an=.07;function _e(t,e){let n=e.radius;if(!(n>0))return t;let r=t.length/2-1;if(r<3)return t;let i=Math.max(2,Math.round(e.segments??4)),s=Math.max(e.minCutRatio??qr,0),l=e.extent,c=e.margin??0,a=[];for(let p=0;p<r;p++){let x=t[p*2],y=t[p*2+1],d=t[(p+r-1)%r*2],b=t[(p+r-1)%r*2+1],E=t[(p+1)%r*2],A=t[(p+1)%r*2+1],_=x-d,R=y-b,L=E-x,k=A-y,T=Math.hypot(_,R),O=Math.hypot(L,k);if(T<1e-6||O<1e-6){a.push(x,y);continue}let D=_/T,U=R/T,P=L/O,C=k/O;if(e.keep?.[p]){a.push(x,y);continue}let Y=D*P+U*C;if(Y>.985){a.push(x,y);continue}if(l!==void 0&&(Lt(x,y,l,c)||Lt(d,b,l,c)||Lt(E,A,l,c))){a.push(x,y);continue}let Q=Math.min(n,T*.4,O*.4);if(Q<n*s){a.push(x,y);continue}let Z=x-D*Q,re=y-U*Q,X=x+P*Q,$=y+C*Q,z=Math.acos(Math.max(-1,Math.min(1,Y))),N=Math.min(Jr,Math.PI/2/i),q=Math.ceil(z/N-1e-6),te=e.maxChord&&e.maxChord>0?Math.ceil(Q/Math.tan(z/2)*z/e.maxChord):0,K=Math.max(1,Math.min(ei,Math.max(Math.min(i,q),te)));a.push(Z,re);for(let oe=1;oe<K;oe++){let ee=oe/K,J=1-ee;a.push(J*J*Z+2*J*ee*x+ee*ee*X,J*J*re+2*J*ee*y+ee*ee*$)}a.push(X,$)}return a.length<6?t:(a.push(a[0],a[1]),a)}var Lt=(t,e,n,r)=>t<=-r||e<=-r||t>=n+r||e>=n+r;var Ae=t=>t/64;function je(t,e,n=0){let r=hn(t.outer,e,n);if(!r)return null;let i=[];for(let s of t.holes){let l=hn(s,e,n);l&&i.push(l)}return{outer:r,holes:i}}function hn(t,e,n){let r=[];for(let i=0;i<t.length-2;i+=2)r.push(t[i],t[i+1]);if(r.length<6)return null;for(let i=0;i<4;i++){let s=r;r=[];let l=s.length/2;if(l===0)return null;for(let c=0;c<l;c++){let a=s[c*2],p=s[c*2+1],x=s[(c+l-1)%l*2],y=s[(c+l-1)%l*2+1],d=pn(a,p,i,e,n),b=pn(x,y,i,e,n);if(d!==b){let E=ti(x,y,a,p,i,e,n);r.push(x+(a-x)*E,y+(p-y)*E)}d&&r.push(a,p)}}return r.length<6?null:(r.push(r[0],r[1]),r)}function pn(t,e,n,r,i){return n===0?t>=-i:n===1?t<=r+i:n===2?e>=-i:e<=r+i}function ti(t,e,n,r,i,s,l){return i===0?(-l-t)/(n-t):i===1?(s+l-t)/(n-t):i===2?(-l-e)/(r-e):(s+l-e)/(r-e)}function yt(t,e,n,r,i,s=0){let l=-s,c=i+s;return t===l&&n===l||t===c&&n===c||e===l&&r===l||e===c&&r===c}function mn(t,e){for(let n=0;n<t.length;n+=2)if(t[n]<=0||t[n]>=e||t[n+1]<=0||t[n+1]>=e)return!0;return!1}var Ct=18,Vt=32,xn=8,vn=65535/Vt,ni=9,ri=1,ii=0,oi=1,si=2;var dn=0,ui=1,gn=2,li=3,ci=.47;function Sn(t,e,n,r={}){let i=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:ci,s=Math.max(1024,t.length*48),l=new ArrayBuffer(s*Ct),c={verts:new DataView(l),vertsU8:new Uint8Array(l),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};c.ensure=d=>a(d);let a=d=>{if(c.vertexCount+d<=s)return;s=Math.max(s*2,c.vertexCount+d);let b=new ArrayBuffer(s*Ct);new Uint8Array(b).set(c.vertsU8.subarray(0,c.vertOffset)),l=b,c.verts=new DataView(b),c.vertsU8=new Uint8Array(b)};for(let d of t.features()){if(d.type!==3||!ce(n,d.properties))continue;let b=_i(d.properties),E=Ai(d.properties,b);if(b<=E)continue;let A=Bi(d.properties)??Number(d.id??0),_=ki(A>>>0),R=Pi(_,d.properties),L=Ii(d.properties,b),k=$e(d.loadGeometry());for(let T of k){let O=je(T,e);if(!O)continue;let D=mn(O.outer,e),U=(r.cornerRadius??0)/i,P={radius:U,segments:r.cornerSegments,extent:e,minCutRatio:0,maxChord:i>0?fn/i:0},C=U>0?{outer:_e(O.outer,P),holes:O.holes.map($=>_e($,P))}:O,Y=C.outer.length/2+C.holes.reduce(($,z)=>$+z.length/2,0);a(Y*5+32);let Q=C.holes.length||D?null:pi(C.outer),Z=Q?bi(d.properties,Q,b,_,i):null,re=null,X=[];if(Z&&Q){let $=En(Si(C.outer,i),Q,Z.shape);X=Ei($,C.outer);let z=Mi($,X);if(z>1e-6){let N=Math.min(Math.max(z*i*di,yi),gi);re=Ri($,N/z,b)}}bn(c,C.outer,E,b,A,R,L,i,e,re);for(let $ of C.holes)bn(c,$,E,b,A,R,L,i,e,null);re?Fi(c,X,re,b,A,R,L,i):hi(c,C.outer,C.holes,b,A,R,L)}}if(!c.indices.length)return null;let p=new Uint32Array(c.indices),x=new Float64Array(c.featureIds);return{vertices:l.slice(0,c.vertOffset),indices:p.buffer,featureIds:x.buffer,vertexCount:c.vertexCount,indexCount:p.length,extent:e}}var Ot=(t,e)=>t|e<<2,yn=t=>Math.max(-32768,Math.min(32767,t)),Bt=t=>Math.max(0,Math.min(65535,Math.round(Math.min(t,vn)*Vt)));function Xe(t,e,n,r,i,s,l,c,a,p,x=0,y=0,d=0){let b=t.vertOffset;return t.verts.setInt16(b,yn(Math.round(e*xn)),!0),t.verts.setInt16(b+2,yn(Math.round(n*xn)),!0),t.verts.setUint16(b+4,Math.round(Math.min(r,vn)*Vt),!0),t.vertsU8[b+6]=a,t.vertsU8[b+7]=c,t.verts.setInt8(b+8,Tt(Math.round(i*127))),t.verts.setInt8(b+9,Tt(Math.round(s*127))),t.verts.setInt8(b+10,Tt(Math.round(l*127))),t.vertsU8[b+11]=p,t.verts.setUint16(b+12,Bt(x),!0),t.verts.setUint16(b+14,Bt(y),!0),t.verts.setUint16(b+16,Bt(d),!0),t.vertOffset+=Ct,t.vertexCount++}function bn(t,e,n,r,i,s,l,c,a,p=null){let x=e.length/2;if(x<3)return;let y=Ot(ii,l),d=ai(e,c),b=r-n,E=new Float64Array(x*2),A=new Uint8Array(x);{let _=new Float64Array(x*2);for(let R=0;R<x-1;R++){let L=e[R*2+2]-e[R*2],k=e[R*2+3]-e[R*2+1],T=Math.hypot(L,k)||1;_[R*2]=k/T,_[R*2+1]=-L/T}for(let R=0;R<x-1;R++){let L=(R+x-2)%(x-1),k=_[L*2]*_[R*2]+_[L*2+1]*_[R*2+1],T=_[L*2]+_[R*2],O=_[L*2+1]+_[R*2+1],D=Math.hypot(T,O);k>.5&&D>1e-6&&(E[R*2]=T/D,E[R*2+1]=O/D,A[R]=1)}}for(let _=0;_<x-1;_++){let R=e[_*2],L=e[_*2+1],k=e[_*2+2],T=e[_*2+3];if(R===k&&L===T||yt(R,L,k,T,a))continue;let O=k-R,D=T-L,U=Math.hypot(O,D)||1,P=D/U,C=-O/U,Y=d.offset[_],Q=d.width[_],Z=[0,1];if(p){for(let X=0;X<p.length;X++)for(let $=X+1;$<p.length;$++){let z=Ne(p[X],R,L)-Ne(p[$],R,L),N=Ne(p[X],k,T)-Ne(p[$],k,T);if(z===N)continue;let q=z/(z-N);q>1e-4&&q<1-1e-4&&Z.push(q)}Z.sort((X,$)=>X-$)}let re=(X,$)=>{if(!p)return r;let z=1/0;for(let N of p)z=Math.min(z,Ne(N,X,$));return Math.max(r,z)};for(let X=0;X+1<Z.length;X++){let $=Z[X],z=Z[X+1];if(z-$<1e-6)continue;let N=R+O*$,q=L+D*$,te=R+O*z,K=L+D*z,oe=Y+U*$*c,ee=Y+U*z*c,J=(_+1)%(x-1),fe=A[_]?E[_*2]:P,be=A[_]?E[_*2+1]:C,de=A[J]?E[J*2]:P,Fe=A[J]?E[J*2+1]:C,Ce=P+(fe-P)*(1-$),Le=C+(be-C)*(1-$),Ve=P+(de-P)*z,we=C+(Fe-C)*z,se=Math.hypot(Ce,Le)||1,Pe=Math.hypot(Ve,we)||1,xe=Ce/se,Be=Le/se,Oe=Ve/Pe,De=we/Pe;t.ensure(4);let Ie=Xe(t,N,q,n,xe,Be,0,0,s,y,oe,Q,b),ze=Xe(t,te,K,n,Oe,De,0,0,s,y,ee,Q,b),vt=Xe(t,N,q,re(N,q),xe,Be,0,255,s,y,oe,Q,b),ft=Xe(t,te,K,re(te,K),Oe,De,0,255,s,y,ee,Q,b);t.indices.push(Ie,ft,ze,Ie,vt,ft),t.featureIds.push(i,i)}}}var fi=.9976;function ai(t,e){let n=t.length/2-1,r=[];for(let a=0;a<n;a++){let p=t[a*2+2]-t[a*2],x=t[a*2+3]-t[a*2+1],y=Math.hypot(p,x);r.push(y>0?{x:p/y,y:x/y,len:y*e}:{x:0,y:0,len:0})}let i=(a,p)=>r[a].len>0&&r[p].len>0&&r[a].x*r[p].x+r[a].y*r[p].y>=fi,s=0;for(;s<n&&i((s-1+n)%n,s);)s++;s>=n&&(s=0);let l=new Array(n).fill(0),c=new Array(n).fill(0);for(let a=0;a<n;){let p=(s+a)%n,x=[p],y=r[p].len,d=a+1;for(;d<n;){let E=(s+d)%n;if(!i((s+d-1)%n,E))break;x.push(E),y+=r[E].len,d++}let b=0;for(let E of x)l[E]=b,c[E]=y,b+=r[E].len;a=d}return{offset:l,width:c}}function hi(t,e,n,r,i,s,l){let c=[],a=[];for(let d=0;d<e.length;d++)c.push(e[d]);for(let d of n){a.push(c.length/2);for(let b=0;b<d.length;b++)c.push(d[b])}let p=Te(c,a.length?a:void 0,2);if(!p.length)return;let x=Ot(oi,l),y=t.vertexCount;for(let d=0;d<c.length;d+=2)Xe(t,c[d],c[d+1],r,0,0,1,255,s,x);for(let d=0;d<p.length;d+=3)t.indices.push(y+p[d],y+p[d+2],y+p[d+1]),t.featureIds.push(i)}function pi(t){let e=mi(t);if(e.length<3)return null;let n=Math.abs(xi(t));if(n<=0)return null;let r=null,i=1/0;for(let s=0;s<e.length;s++){let l=(s+1)%e.length,c=e[l].x-e[s].x,a=e[l].y-e[s].y,p=Math.hypot(c,a);if(p<1e-6)continue;c/=p,a/=p;let x=1/0,y=-1/0,d=1/0,b=-1/0;for(let T of e){let O=T.x*c+T.y*a,D=-T.x*a+T.y*c;O<x&&(x=O),O>y&&(y=O),D<d&&(d=D),D>b&&(b=D)}let E=y-x,A=b-d,_=E*A;if(_<=0||_>=i)continue;i=_;let R=(x+y)/2,L=(d+b)/2,k=E>=A;r={cx:R*c-L*a,cy:R*a+L*c,ax:k?c:-a,ay:k?a:c,halfLong:(k?E:A)/2,halfShort:(k?A:E)/2,fill:n/_}}return r}function mi(t){let e=[];for(let s=0;s<t.length-2;s+=2)e.push({x:t[s],y:t[s+1]});if(e.length<3)return e;e.sort((s,l)=>s.x===l.x?s.y-l.y:s.x-l.x);let n=(s,l,c)=>(l.x-s.x)*(c.y-s.y)-(l.y-s.y)*(c.x-s.x),r=[];for(let s of e){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],s)<=0;)r.pop();r.push(s)}let i=[];for(let s=e.length-1;s>=0;s--){let l=e[s];for(;i.length>=2&&n(i[i.length-2],i[i.length-1],l)<=0;)i.pop();i.push(l)}return r.pop(),i.pop(),r.concat(i)}function xi(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var di=Math.tan(30*Math.PI/180),gi=3.5,yi=.9;function bi(t,e,n,r,i){if(e.fill<.86)return null;let s=e.halfShort*2*i,l=e.halfLong*2*i,c=s*l,a=e.halfShort>0?e.halfLong/e.halfShort:99,p=wi(t);if(!p){if(n>15||c>600||s<3)return null;let x=r%1e3/1e3;c<30?p=x<.5?"skillion":"gabled":a<1.25?p=x<.35?"pyramidal":"hipped":p=x<.8?"gabled":"hipped"}return p==="flat"?null:{shape:p}}function wi(t){let e=String(t.roof_shape??t["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var Ne=(t,e,n)=>t.a*e+t.b*n+t.c;function vi(t,e,n,r){let i=t.length/2;if(i<3)return[];let s=[],l=c=>[t[c*2],t[c*2+1]];for(let c=0;c<i;c++){let[a,p]=l(c),[x,y]=l((c+i-1)%i),d=e*a+n*p+r,b=e*x+n*y+r;if(d<=0!=b<=0){let E=b/(b-d);s.push(x+(a-x)*E,y+(p-y)*E)}d<=0&&s.push(a,p)}return s}function Si(t,e){let n=.5/Math.max(e,1e-6),r=t.length/2-1;if(r<5)return t;let i=[],s=0;i.push(t[0],t[1]);for(let l=1;l<r;l++){let c=t[s*2],a=t[s*2+1],p=t[l*2],x=t[l*2+1],y=p-c,d=x-a,b=Math.hypot(y,d),E=b>1e-6;if(E){for(let A=s+1;A<l;A++)if(Math.abs((t[A*2]-c)*d-(t[A*2+1]-a)*y)/b>=n){E=!1;break}}E||(i.push(t[(l-1)*2],t[(l-1)*2+1]),s=l-1)}return i.length/2<3?t:(i.push(i[0],i[1]),i)}function En(t,e,n){let{ax:r,ay:i,halfLong:s}=e;if(n==="skillion"){let a=-i,p=r;return[{a,b:p,c:-(a*e.cx+p*e.cy)+e.halfShort}]}let l=[],c=t.length/2-1;for(let a=0;a<c;a++){let p=t[a*2],x=t[a*2+1],y=t[(a+1)%c*2],d=t[(a+1)%c*2+1],b=y-p,E=d-x,A=Math.hypot(b,E);if(A<1e-6||n==="gabled"&&Math.abs((b*r+E*i)/A)<.86)continue;let _=-E/A,R=b/A;l.push({a:_,b:R,c:-(_*p+R*x)})}return!l.length&&s>0?En(t,e,"hipped"):l}function Ei(t,e){let n=[];for(let i=0;i<e.length-2;i+=2)n.push(e[i],e[i+1]);if(n.length<6)return[];let r=[];for(let i=0;i<t.length;i++){let s=n;for(let l=0;l<t.length&&s.length>=6;l++)l!==i&&(s=vi(s,t[i].a-t[l].a,t[i].b-t[l].b,t[i].c-t[l].c));r.push(s.length>=6?s:[])}return r}function Mi(t,e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];for(let s=0;s<i.length;s+=2){let l=Ne(t[r],i[s],i[s+1]);l>n&&(n=l)}}return n}function Ri(t,e,n){return t.map(r=>({a:r.a*e,b:r.b*e,c:r.c*e+n}))}function Fi(t,e,n,r,i,s,l,c){let a=Ot(si,l);for(let p=0;p<n.length;p++){let x=e[p];if(!x||x.length<6)continue;let y=Te(x,void 0,2);if(!y.length)continue;let d=-n[p].a/c,b=-n[p].b/c,E=Math.hypot(d,b,1),A={x:d/E,y:b/E,z:1/E};t.ensure(x.length/2);let _=t.vertexCount;for(let R=0;R<x.length;R+=2){let L=Math.max(r,Ne(n[p],x[R],x[R+1]));Xe(t,x[R],x[R+1],L,A.x,A.y,A.z,255,s,a)}for(let R=0;R<y.length;R+=3)t.indices.push(_+y[R],_+y[R+2],_+y[R+1]),t.featureIds.push(i)}}function Ii(t,e){let n=String(t.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?li:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?gn:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||e<=7?dn:e>=40?gn:ui}function Pi(t,e){let n=String(e.class??""),r=128;return n==="industrial"||n==="warehouse"||n==="construction"?r=96:n==="commercial"||n==="office"||n==="retail"?r=150:(n==="apartments"||n==="residential"||n==="house")&&(r=134),Math.max(0,Math.min(255,r+(t%121-60)))}function ki(t){let e=t>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function _i(t){let e=Ye(t.render_height)??Ye(t.height)??Li(t.levels??t.building_levels??t["building:levels"]);return e&&e>0?Math.max(e,ri):ni}function Ai(t,e){let n=Ye(t.render_min_height)??Ye(t.min_height)??Ye(t.base)??0;return n>0&&n<e?n:0}function Li(t){let e=Ye(t);return e&&e>0?e*3:null}function Ye(t){if(typeof t=="number"&&isFinite(t))return t;if(typeof t=="string"){let e=parseFloat(t);if(isFinite(e))return e}return null}var Tt=t=>t>127?127:t<-127?-127:t;function Bi(t){let e=t.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let n=Number(e);if(Number.isFinite(n))return n}return null}function Ti(t,e,n,r,i){let s=r*r,l=[],c=x=>t[x*2],a=x=>t[x*2+1],p=(x,y)=>{let d=t.length/2;return t.push((c(x)+c(y))/2,(a(x)+a(y))/2),d};for(let x=0;x<e.length;x+=3){l.push([n+e[x],n+e[x+1],n+e[x+2]]);let y=0;for(;l.length&&!(++y>2e4);){let[d,b,E]=l.pop(),A=(c(d)-c(b))**2+(a(d)-a(b))**2,_=(c(b)-c(E))**2+(a(b)-a(E))**2,R=(c(E)-c(d))**2+(a(E)-a(d))**2,L=Math.max(A,_,R);if(L<=s){i.push(d,b,E);continue}if(L===A){let k=p(d,b);l.push([d,k,E],[k,b,E])}else if(L===_){let k=p(b,E);l.push([b,k,d],[k,E,d])}else{let k=p(E,d);l.push([E,k,b],[k,d,b])}}}}function Mn(t,e,n=0,r,i=!1,s=4096){let l=[],c=[],a=[];for(let b of t.features()){if(b.type!==3||!ce(e,b.properties))continue;let E=b.properties.osm_id,A=typeof E=="number"?E:typeof E=="string"?Number(E):NaN,_=Number.isFinite(A)?A:Number(b.id??0);for(let R of $e(b.loadGeometry())){let L=i?je(R,s):R;if(!L)continue;let k=[],T=[],O=r?_e(L.outer,r):L.outer;for(let P=0;P<O.length;P++)k.push(O[P]);for(let P of L.holes){let C=r?_e(P,r):P;T.push(k.length/2);for(let Y=0;Y<C.length;Y++)k.push(C[Y])}let D=Te(k,T.length?T:void 0,2);if(!D.length)continue;let U=l.length/2;for(let P=0;P<k.length;P++)l.push(k[P]);if(n>0){let P=[];Ti(l,D,U,n,P);for(let C=0;C<P.length;C+=3)c.push(P[C],P[C+2],P[C+1]),a.push(_);continue}for(let P=0;P<D.length;P+=3)c.push(U+D[P],U+D[P+2],U+D[P+1]),a.push(_)}}if(!c.length)return null;let p=l.length/2,x=new Int16Array(l),y=new Uint32Array(c);return{featureIds:new Float64Array(a).buffer,vertices:x.buffer,indices:y.buffer,vertexCount:p,indexCount:y.length}}function Fn(t){return{shapes:[],cells:[],extent:0,metersPerTile:t}}function In(t,e,n,r){if(!(n<=0)){t.extent=r;for(let i of e){let s=i.outer;if(s.length<6)continue;let l=1/0,c=1/0,a=-1/0,p=-1/0;for(let x=0;x<s.length;x+=2)s[x]<l&&(l=s[x]),s[x]>a&&(a=s[x]),s[x+1]<c&&(c=s[x+1]),s[x+1]>p&&(p=s[x+1]);t.shapes.push({outer:s,holes:i.holes,level:n,minX:l,minY:c,maxX:a,maxY:p})}t.cells=[]}}function Ci(t){t.cells=Array.from({length:32*32},()=>[]);let e=t.extent/32;for(let n=0;n<t.shapes.length;n++){let r=t.shapes[n],i=Ze(Math.floor(r.minX/e)),s=Ze(Math.floor(r.maxX/e)),l=Ze(Math.floor(r.minY/e)),c=Ze(Math.floor(r.maxY/e));for(let a=l;a<=c;a++)for(let p=i;p<=s;p++)t.cells[a*32+p].push(n)}}var Pn=t=>t.shapes.length===0;function Dt(t,e,n){!t.cells.length&&t.shapes.length&&Ci(t);let r=t.extent/32,i=t.cells[Ze(Math.floor(n/r))*32+Ze(Math.floor(e/r))];if(!i||!i.length)return 0;let s=0;for(let l of i){let c=t.shapes[l];if(c.level<=s||e<c.minX||e>c.maxX||n<c.minY||n>c.maxY||!Rn(c.outer,e,n))continue;let a=!1;for(let p of c.holes)if(Rn(p,e,n)){a=!0;break}a||(s=c.level)}return Math.min(Math.round(s*100),127)}function kn(t,e){let n=[],r=[],i=t.extent>0?t.metersPerTile/t.extent:0,s=i>0?2/i:0,l=Dt(t,e[0],e[1]);n.push(e[0],e[1]),r.push(l);for(let c=0;c+3<e.length;c+=2){let a=e[c],p=e[c+1],x=e[c+2],y=e[c+3],d=Dt(t,x,y);if(d!==l&&s>0){let b=Math.hypot(x-a,y-p),E=Math.min(Math.ceil(b/s),64),A=l;for(let _=1;_<E;_++){let R=_/E,L=a+(x-a)*R,k=p+(y-p)*R,T=Dt(t,L,k);T!==A&&(n.push(L,k),r.push(T),A=T)}}n.push(x,y),r.push(d),l=d}return{pts:n,levels:r}}var Ze=t=>t<0?0:t>31?31:t;function Rn(t,e,n){let r=!1,i=t.length/2;for(let s=0,l=i-1;s<i;l=s++){let c=t[s*2],a=t[s*2+1],p=t[l*2],x=t[l*2+1];a>n!=x>n&&e<(p-c)*(n-a)/(x-a)+c&&(r=!r)}return r}var Bn=hr(_n(),1);function An(t){let e=[];for(let n=0;n+1<t.length;n+=2)e.push([t[n],t[n+1]]);return e}function Ln(t){let e=[];for(let r of t)e.push(r[0],r[1]);let n=e.length;return n>=4&&(e[0]!==e[n-2]||e[1]!==e[n-1])&&e.push(e[0],e[1]),e}function Tn(t,e,n=0){if(t.length<2)return t;let r=new Map;for(let s of t){let l=s.lift??0,c=r.get(l);c?c.push(s):r.set(l,[s])}let i=[];for(let[s,l]of r){if(l.length<2){i.push(...l);continue}let a=(n>0&&e?l.map(y=>({outer:e(y.outer,-n)??y.outer,holes:y.holes.map(d=>e(d,n)??d)})):l).map(y=>[An(y.outer),...y.holes.map(An)]),p;try{p=Bn.union(a[0],...a.slice(1))}catch{i.push(...l);continue}let x=p;if(!Array.isArray(x)||x.length===0){i.push(...l);continue}for(let y of x){if(!y.length)continue;let d=Ln(y[0]);if(d.length<8)continue;let b=[];for(let E=1;E<y.length;E++){let A=Ln(y[E]);A.length>=8&&b.push(A)}i.push(s?{outer:d,holes:b,lift:s}:{outer:d,holes:b})}}return i}var jt=16,Vi=64,Oi=0,Di=1,Cn=2,Ui=3,bt=1,Gi=.6;function Gn(t,e,n,r){let i=r.metersPerUnit>0?r.metersPerUnit:.5,s=r.elevation,l=r.base??0,c=Math.max(r.bevel??0,0)/i,a=Math.max(r.bevelDrop??0,0),p=Math.max(r.cornerRadius??0,0)/i,x=Math.max(512,t.length*24),y=new ArrayBuffer(x*jt),d={view:new DataView(y),bytes:new Uint8Array(y),offset:0,count:0,indices:[],extent:e,ensure(P){if(d.count+P<=x)return;x=Math.max(x*2,d.count+P);let C=new ArrayBuffer(x*jt);new Uint8Array(C).set(d.bytes.subarray(0,d.offset)),y=C,d.view=new DataView(C),d.bytes=new Uint8Array(C)}},b=[],E=new Map;for(let P of t.features()){if(P.type!==3||!ce(n,P.properties))continue;let C=r.liftBy?.(P.properties)??0;for(let Y of $e(P.loadGeometry())){let Q=je(Y,e,Ae(e));Q&&b.push(C?{...Q,lift:C}:Q)}}let A=new Set,_=Math.max(r.weld??Gi,0),R=Tn(b,(P,C)=>zt(P,C,e,A),_/i),L=_>0?R.map(P=>({...P,outer:Un(P.outer,_/i,e),holes:P.holes.map(C=>Un(C,_/i,e))})):R;for(let P of L){Vn(P.outer,E);for(let C of P.holes)Vn(C,E)}r.onShapes?.(L);let k=new Set;for(let[P,C]of E)C>1&&k.add(P);let T=[],O={radius:p,segments:r.cornerSegments,extent:e,margin:Ae(e),minCutRatio:0,maxChord:cn/i};for(let P of L){let C=p>0?{outer:_e(P.outer,{...O,keep:On(P.outer,k)}),holes:P.holes.map(N=>_e(N,{...O,keep:On(N,k)}))}:P,Y=c>0?zt(C.outer,c,e,k):C.outer,Q=C.holes.map(N=>c>0?zt(N,-c,e,k):N),Z=P.lift??0,re=s+Z,X=l+Z;Dn(d,Y??C.outer,Q.map((N,q)=>N??C.holes[q]),re);let $=re,z=re-a;Y&&c>0&&a>0&&Nt(d,Y,C.outer,$,z,Di,e,k),z!==X&&Nt(d,C.outer,C.outer,z,X,Cn,e,k);for(let N of C.holes)if(z!==X&&Nt(d,N,N,z,X,Cn,e,k),re<X){let q=d.indices.length;Dn(d,N,[],X,Ui);for(let te=q;te<d.indices.length;te++)T.push(d.indices[te]);d.indices.length=q}}if(!d.indices.length&&!T.length)return null;let D=d.indices.length,U=new Uint32Array(D+T.length);return U.set(d.indices,0),U.set(T,D),{vertices:y.slice(0,d.offset),indices:U.buffer,vertexCount:d.count,indexCount:U.length,extent:e,capIndexOffset:D}}function We(t,e,n,r){let i=`${Math.round(t*100)},${Math.round(e*100)}`,s=`${Math.round(n*100)},${Math.round(r*100)}`;return i<s?`${i}|${s}`:`${s}|${i}`}function Vn(t,e){for(let n=0;n+3<t.length;n+=2){let r=We(t[n],t[n+1],t[n+2],t[n+3]);e.set(r,(e.get(r)??0)+1)}}function On(t,e){if(!e.size)return;let n=t.length/2-1,r=new Array(n).fill(!1);for(let i=0;i<n;i++){let s=We(t[(i+n-1)%n*2],t[(i+n-1)%n*2+1],t[i*2],t[i*2+1]),l=We(t[i*2],t[i*2+1],t[(i+1)%n*2],t[(i+1)%n*2+1]);(e.has(s)||e.has(l))&&(r[i]=!0)}return r}function lt(t,e,n,r,i,s,l,c){let a=t.offset;return t.view.setFloat32(a,e,!0),t.view.setFloat32(a+4,n,!0),t.view.setInt16(a+8,Ni(Math.round(r*Vi)),!0),t.view.setInt8(a+10,$t(Math.round(i*127))),t.view.setInt8(a+11,$t(Math.round(s*127))),t.view.setInt8(a+12,$t(Math.round(l*127))),t.bytes[a+13]=c,t.view.setInt8(a+14,e<=0?-bt:e>=t.extent?bt:0),t.view.setInt8(a+15,n<=0?-bt:n>=t.extent?bt:0),t.offset+=jt,t.count++}function Dn(t,e,n,r,i=Oi){let s=[],l=[];for(let p=0;p<e.length;p++)s.push(e[p]);for(let p of n){l.push(s.length/2);for(let x=0;x<p.length;x++)s.push(p[x])}let c=Te(s,l.length?l:void 0,2);if(!c.length)return;t.ensure(s.length/2);let a=t.count;for(let p=0;p<s.length;p+=2)lt(t,s[p],s[p+1],r,0,0,1,i);for(let p=0;p<c.length;p+=3)t.indices.push(a+c[p],a+c[p+2],a+c[p+1])}function Nt(t,e,n,r,i,s,l,c){let a=Math.min(e.length,n.length)/2;if(!(a<3)){t.ensure((a-1)*4);for(let p=0;p<a-1;p++){let x=n[p*2],y=n[p*2+1],d=n[p*2+2],b=n[p*2+3];if(x===d&&y===b||yt(x,y,d,b,l,Ae(l))||c.has(We(x,y,d,b)))continue;let E=d-x,A=b-y,_=Math.hypot(E,A)||1,R=A/_,L=-E/_,k=r-i,T=Math.hypot(e[p*2]-x,e[p*2+1]-y)||0,O=0;if(T>1e-6&&k!==0){let Y=1/Math.hypot(1,k/T);O=T/Math.hypot(T,k)*Math.sign(k),R*=Y,L*=Y}let D=lt(t,e[p*2],e[p*2+1],r,R,L,O,s),U=lt(t,e[p*2+2],e[p*2+3],r,R,L,O,s),P=lt(t,x,y,i,R,L,O,s),C=lt(t,d,b,i,R,L,O,s);t.indices.push(P,U,C,P,D,U)}}}function zt(t,e,n,r){let i=t.length/2-1;if(i<3)return null;let s=[];for(let x=0;x<i;x++){let y=t[x*2],d=t[x*2+1],b=t[(x+i-1)%i*2],E=t[(x+i-1)%i*2+1],A=t[(x+1)%i*2],_=t[(x+1)%i*2+1],R=Math.hypot(y-b,d-E)||1,L=Math.hypot(A-y,_-d)||1,k=(d-E)/R,T=-(y-b)/R,O=(_-d)/L,D=-(A-y)/L,U=k+O,P=T+D,C=Math.hypot(U,P);if(C<1e-6){s.push(y,d);continue}U/=C,P/=C;let Y=Math.min(1/Math.max(U*k+P*T,.35),3),Q=y-U*e*Y,Z=d-P*e*Y,re=We(b,E,y,d),X=We(y,d,A,_);if(r.has(re)||r.has(X)){s.push(y,d);continue}let $=-Ae(n),z=n+Ae(n),N=(q,te)=>q<=$||q>=z||te<=$||te>=z;(N(y,d)||N(b,E)||N(A,_))&&(Q=y,Z=d),s.push(Q,Z)}s.push(s[0],s[1]);let l=Math.abs(Ht(t)),c=Ht(s);if(Math.sign(c)!==Math.sign(Ht(t))||Math.abs(c)<l*.25)return null;let a=-Ae(n),p=n+Ae(n);for(let x=0;x<s.length;x+=2)s[x]=Math.max(a,Math.min(p,s[x])),s[x+1]=Math.max(a,Math.min(p,s[x+1]));return s}function Ht(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var $t=t=>t>127?127:t<-127?-127:t,Ni=t=>t>32767?32767:t<-32768?-32768:t;function Un(t,e,n){if(!(e>0))return t;let r=Ae(n),i=-r,s=n+r,l=t;for(let c=0;c<3;c++){let a=l.length/2-1;if(a<6)break;let p=new Array(a).fill(!0),x=a;for(let d=0;d<a&&!(x<=5);d++){let b=l[d*2],E=l[d*2+1];if(b<=i||b>=s||E<=i||E>=s)continue;let A=(d+a-1)%a;for(;!p[A]&&A!==d;)A=(A+a-1)%a;let _=(d+1)%a;for(;!p[_]&&_!==d;)_=(_+1)%a;if(A===d||_===d)break;let R=l[A*2],L=l[A*2+1],k=l[_*2]-R,T=l[_*2+1]-L,O=Math.hypot(k,T);O<1e-6||Math.abs((b-R)*T-(E-L)*k)/O<e&&(p[d]=!1,x--)}if(x===a)break;let y=[];for(let d=0;d<a;d++)p[d]&&y.push(l[d*2],l[d*2+1]);y.push(y[0],y[1]),l=y}return l}function Qe(t){let e=t.layer,n=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let r=t.brunnel;return r==="bridge"?1:r==="tunnel"?-1:0}var ct=20;function Hn(t,e,n=0,r,i=0,s={}){let{level:l}=s,c=Math.max(256,t.length*24),a=new ArrayBuffer(c*ct),p=new DataView(a),x=0,y=[],d=L=>{if(x+L<=c)return;c=Math.max(c*2,x+L);let k=new ArrayBuffer(c*ct);new Uint8Array(k).set(new Uint8Array(a,0,x*ct)),a=k,p=new DataView(k)},b=(L,k,T,O,D,U,P,C=0,Y=0,Q=0)=>{let Z=x*ct;return p.setInt16(Z,L,!0),p.setInt16(Z+2,k,!0),p.setInt16(Z+4,T,!0),p.setInt16(Z+6,O,!0),p.setInt8(Z+8,D),p.setInt8(Z+9,U),p.setInt8(Z+10,C),p.setInt8(Z+11,Y),p.setFloat32(Z+12,P,!0),p.setFloat32(Z+16,Q,!0),x++},E=0,A=i>0?12/i:0,_=A>0?Xi(t):null;for(let L of t.features()){if(L.type!==2&&L.type!==3||!ce(e,L.properties)||l!==void 0&&Qe(L.properties)!==l)continue;let k=L.properties.width;E=typeof k=="number"&&k>.5&&k<100?k:0;let T=L.type===3;for(let O of L.loadGeometry()){let D=n>0?Hi(Nn(O),n):Nn(O);if(D.length<4)continue;let U=r&&!Pn(r)?kn(r,D):null,P=U?U.pts:D,C=U?.levels,Y=P.length/2;if(Y<2)continue;let Q=Qe(L.properties),Z=wt(Math.round(P[0]),Math.round(P[1])),re=wt(Math.round(P[Y*2-2]),Math.round(P[Y*2-1])),X=null,$=E;if(_&&E>0&&!T){let N=0;for(let ee=0;ee<Y-1;ee++)N+=Math.hypot(P[ee*2+2]-P[ee*2],P[ee*2+3]-P[ee*2+1]);$=$n(Q,E,Z,re,_);let q=ee=>Math.min(_.width.get(ee)??0,$*2),te=q(Z)-$,K=q(re)-$,oe=Math.min(A,N/2);if(oe>0&&(te>0||K>0)){X=J=>{let fe=0;return te>0&&J<oe&&(fe=te*(1-J/oe)),K>0&&N-J<oe&&(fe=Math.max(fe,K*(1-(N-J)/oe))),$+fe};let ee=[];for(let J of[oe,N-oe])J>.01&&J<N-.01&&ee.push(J);if(ee.length){let J=zi(P,C,ee);P=J.pts,C=J.levels,Y=P.length/2}}}d((Y-1)*4);let z=0;for(let N=0;N<Y-1;N++){let q=P[N*2],te=P[N*2+1],K=P[N*2+2],oe=P[N*2+3],ee=Math.hypot(K-q,oe-te);if(T&&ji(q,te,K,oe,t.extent)){z+=ee;continue}let J=$i(q,te,K,oe,t.extent);if(!J){z+=ee;continue}let[fe,be,de,Fe]=J,Ce=Math.hypot(fe-q,be-te),Le=Math.hypot(de-fe,Fe-be),Ve=Math.hypot(K-de,oe-Fe),we=z+Ce,se=C?C[N]:0,Pe=C?C[N+1]:0,xe=X?X(we):$,Be=X?X(we+Le):$,Oe=b(fe,be,de,Fe,0,-1,we,se,Pe,xe),De=b(fe,be,de,Fe,0,1,we,se,Pe,xe),Ie=b(fe,be,de,Fe,1,1,we,se,Pe,Be),ze=b(fe,be,de,Fe,1,-1,we,se,Pe,Be);z+=Ce+Le+Ve,y.push(Oe,De,Ie,Oe,Ie,ze)}}}if(!y.length)return null;let R=new Uint32Array(y);return{vertices:a.slice(0,x*ct),indices:R.buffer,vertexCount:x,indexCount:R.length}}function zi(t,e,n){let r=[...n].sort((a,p)=>a-p),i=[t[0],t[1]],s=e?[e[0]]:void 0,l=0,c=0;for(let a=0;a+3<t.length;a+=2){let p=t[a],x=t[a+1],y=t[a+2],d=t[a+3],b=Math.hypot(y-p,d-x);for(;c<r.length&&r[c]<=l+.01;)c++;for(;c<r.length&&r[c]<l+b-.01;){let E=(r[c]-l)/b;i.push(p+(y-p)*E,x+(d-x)*E),s&&e&&s.push(Math.round(e[a/2]+(e[a/2+1]-e[a/2])*E)),c++}l+=b,i.push(y,d),s&&e&&s.push(e[a/2+1])}return{pts:i,levels:s}}function Hi(t,e){let n=[];for(let r=0;r+3<t.length;r+=2){let i=t[r],s=t[r+1],l=t[r+2],c=t[r+3];n.push(i,s);let a=Math.min(64,Math.floor(Math.hypot(l-i,c-s)/e));for(let p=1;p<a;p++){let x=p/a;n.push(i+(l-i)*x,s+(c-s)*x)}}return n.push(t[t.length-2],t[t.length-1]),n}function Nn(t){let e=[];for(let n=0;n<t.length;n+=2){let r=t[n],i=t[n+1],s=e.length;s>=2&&e[s-2]===r&&e[s-1]===i||e.push(r,i)}return e}function $i(t,e,n,r,i){let s=n-t,l=r-e,c=0,a=1,p=[[-s,t],[s,i-t],[-l,e],[l,i-e]];for(let[x,y]of p){if(x===0){if(y<0)return null;continue}let d=y/x;if(x<0){if(d>a)return null;d>c&&(c=d)}else{if(d<c)return null;d<a&&(a=d)}}return a-c<1e-6?null:[Math.round(t+s*c),Math.round(e+l*c),Math.round(t+s*a),Math.round(e+l*a)]}function ji(t,e,n,r,i){return t===n&&(t<=0||t>=i)?!0:e===r&&(e<=0||e>=i)}var zn=new WeakMap,wt=(t,e)=>(t+512)*65536+(e+512);function $n(t,e,n,r,i){if(t===0||e<=0)return e;let s=8*4294967296,l=Math.max(i.raw.get(n+s)??0,i.raw.get(r+s)??0);return l>0&&e>l?l:e}function Xi(t){let e=zn.get(t);if(e)return e;let n={width:new Map,ends:new Map,raw:new Map},r=[];for(let i of t.features()){if(i.type!==2)continue;let s=i.properties.width,l=typeof s=="number"&&s>.5&&s<100?s:0,c=Qe(i.properties);for(let a of i.loadGeometry()){if(a.length<4)continue;let p=wt(Math.round(a[0]),Math.round(a[1])),x=wt(Math.round(a[a.length-2]),Math.round(a[a.length-1]));for(let y of[p,x]){let d=y+(c+8)*4294967296;n.ends.set(d,(n.ends.get(d)??0)+1),l>0&&n.raw.set(d,Math.max(n.raw.get(d)??0,l))}r.push({h:p,t:x,lv:c,w:l})}}for(let i of r){let s=$n(i.lv,i.w,i.h,i.t,n);if(!(s<=0))for(let l of[i.h,i.t]){let c=n.width.get(l);(c===void 0||s>c)&&n.width.set(l,s)}}return zn.set(t,n),n}var Yi=[["\\u0443\\u043B\\u0438\\u0446\\u0430","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u044B","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u0435","\\u0443\\u043B."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442\\u0430","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043E\\u043A","\\u043F\\u0435\\u0440."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043A\\u0430","\\u043F\\u0435\\u0440."],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434","\\u043F\\u0440-\\u0434"],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434\\u0430","\\u043F\\u0440-\\u0434"],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u044C","\\u043F\\u043B."],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u0438","\\u043F\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440","\\u0431\\u0443\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440\\u0430","\\u0431\\u0443\\u043B."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u0430\\u044F","\\u043D\\u0430\\u0431."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u043E\\u0439","\\u043D\\u0430\\u0431."],["\\u0448\\u043E\\u0441\\u0441\\u0435","\\u0448."],["\\u0442\\u0443\\u043F\\u0438\\u043A","\\u0442\\u0443\\u043F."],["\\u0442\\u0443\\u043F\\u0438\\u043A\\u0430","\\u0442\\u0443\\u043F."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D","\\u043C\\u043A\\u0440."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D\\u0430","\\u043C\\u043A\\u0440."],["\\u043A\\u04EF\\u0447\\u0430\\u0438","\\u043A."],["\\u043A\\u0443\\u0447\\u0430\\u0438","\\u043A."],["\\u0445\\u0438\\u0451\\u0431\\u043E\\u043D\\u0438","\\u0445\\u0438\\u0451\\u0431."],["\\u0448\\u043E\\u04B3\\u0440\\u043E\\u04B3\\u0438","\\u0448\\u043E\\u04B3."],["\\u0433\\u0443\\u0437\\u0430\\u0440\\u0433\\u043E\\u04B3\\u0438","\\u0433\\u0443\\u0437."],["\\u043C\\u0430\\u0439\\u0434\\u043E\\u043D\\u0438","\\u043C\\u0430\\u0439\\u0434."]],jn=new Map(Yi);function Xn(t){let e=t.split(" ");if(e.length<2)return t;let n=!1,r=e.map(s=>{let l=jn.get(s.toLowerCase());return l?(n=!0,s[0]===s[0].toUpperCase()?l[0].toUpperCase()+l.slice(1):l):s});return!n||!e.filter(s=>jn.get(s.toLowerCase())===void 0).length?t:r.join(" ")}function Zn(t,e){let n=[],r=[],i=[],s=[],l=[],c=e.textPlacement==="line",a=[],p=[],x=[];for(let y of t.features()){if(!ce(e.filter,y.properties))continue;let d=y.loadGeometry(),b=Qi(y.type,d);if(!b)continue;let E=e.textField?Yn(e.textField,y.properties):"",A=E&&e.abbreviate?Xn(E):E,_=e.iconImage?Yn(e.iconImage,y.properties):"";if(!(!A&&!_)){if(c){let R=Wi(y.type,d);if(!R)continue;x.push({text:A,line:R});continue}n.push(b[0],b[1]),r.push(A),i.push(_),s.push(Ki(y.properties)),l.push(e.iconRotate&&Math.round(Number(y.properties[e.iconRotate]??0))||0)}}if(c){for(let{text:y,line:d}of Zi(x)){p.push(a.length/2);for(let b of d)a.push(b);n.push(Math.round(d[0]),Math.round(d[1])),r.push(y),i.push(""),s.push(128),l.push(0)}p.push(a.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:i,priorities:new Uint8Array(s).buffer,rotations:new Int16Array(l).buffer,...c?{lines:new Int16Array(a).buffer,lineStarts:new Uint32Array(p).buffer}:{}}:null}function Zi(t){let e=[],n=new Map,r=new Map,i=(s,l,c)=>`${s}\\u241F${l}\\u241F${c}`;for(let{text:s,line:l}of t){let c=i(s,l[0],l[1]),a=i(s,l[l.length-2],l[l.length-1]),p=n.get(a),x=r.get(c);if(x!==void 0){let y=e[x];if(y.line.push(...l.slice(2)),r.delete(c),r.set(i(s,y.line[y.line.length-2],y.line[y.line.length-1]),x),p!==void 0&&p!==x){let d=e[p];y.line.push(...d.line.slice(2)),d.line=[],n.delete(a),r.set(i(s,y.line[y.line.length-2],y.line[y.line.length-1]),x)}continue}if(p!==void 0){let y=e[p];y.line.unshift(...l.slice(0,l.length-2)),n.delete(a),n.set(i(s,y.line[0],y.line[1]),p);continue}n.set(c,e.length),r.set(a,e.length),e.push({text:s,line:l})}return e.filter(s=>s.line.length>=4)}function Wi(t,e){if(t!==2)return null;let n=null,r=0;for(let i of e){if(i.length<4)continue;let s=0;for(let l=0;l+3<i.length;l+=2)s+=Math.hypot(i[l+2]-i[l],i[l+3]-i[l+1]);s>r&&(r=s,n=i)}return n}function Qi(t,e){if(!e.length)return null;if(t===1){let l=e[0];return l.length>=2?[l[0],l[1]]:null}if(t===2){let l=-1,c=0,a=0;for(let p of e)for(let x=0;x+3<p.length;x+=2){let y=p[x+2]-p[x],d=p[x+3]-p[x+1],b=y*y+d*d;b>l&&(l=b,c=p[x]+y/2,a=p[x+1]+d/2)}return l>0?[Math.round(c),Math.round(a)]:null}let n=1/0,r=1/0,i=-1/0,s=-1/0;for(let l of e)for(let c=0;c<l.length;c+=2)l[c]<n&&(n=l[c]),l[c]>i&&(i=l[c]),l[c+1]<r&&(r=l[c+1]),l[c+1]>s&&(s=l[c+1]);return isFinite(n)?[Math.round((n+i)/2),Math.round((r+s)/2)]:null}function Ki(t){let e=t.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Yn(t,e){let n=Array.isArray(t)?t:[t];for(let r of n){let i=!0,l=r.replace(/\\{([^}]+)\\}/g,(c,a)=>{let p=e[a];return p==null||p===""?(i=!1,""):String(p)}).trim();if(i&&l)return l}return""}function Wn(t,e){let n=[],r=[];for(let i=0;i<t.length;i++){let s=t.feature(i);if(s.type===1&&ce(e,s.properties))for(let l of s.loadGeometry())for(let c=0;c+1<l.length;c+=2)n.push(l[c],l[c+1]),r.push(s.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var Ji="\\u241F",Xt=(t,e)=>t+Ji+String(e);function qi(){let t=typeof self<"u"?self.origin:void 0;return t&&t!=="null"&&!t.startsWith("blob:")?t+"/":void 0}async function Qn(t,e){let n=performance.now(),r=qi(),i=await fetch(t.url,{signal:e,credentials:"same-origin",...r?{referrer:r}:{}}),s=(R,L,k,T,O=0)=>({type:"loaded",id:t.id,buckets:{},timing:{fetchMs:T,parseMs:O},diag:{status:R,bytes:L,layers:k,built:0}});if(!i.ok){if(i.status===404||i.status===204)return s(i.status,0,[],performance.now()-n);throw new Error(`HTTP ${i.status} \\u0434\\u043B\\u044F ${t.url}`)}let l=await i.arrayBuffer(),c=performance.now()-n;if(l.byteLength===0)return s(i.status,0,[],c);let a=performance.now(),p=new gt(l),x=Object.keys(p.layers),y={},d={},b=new Set,E=[],_=t.plan.some(R=>R.type==="surface"&&(R.elevation??0)>0)&&t.plan.some(R=>R.type==="line"&&R.ground)?Fn(t.metersPerTile):void 0;for(let R of t.plan){if(!to(R,t.zoom,t.sourceMaxZoom))continue;let L=p.layers[R.sourceLayer];if(!L)continue;let k=no(t.zoom,L.extent);try{if(R.splitBy){let O=ro(L,R.splitBy,R.filter);if(!O.length)continue;let D=d[R.splitBy]??(d[R.splitBy]=[]);for(let U of O){D.includes(U)||D.push(U);let P={...R,splitBy:void 0,filter:oo(R.filter,R.splitBy,U)},C=Yt(P,L,k,t.metersPerTile,_);C&&(y[Xt(R.id,U)]=C)}continue}if(R.network&&R.type==="line"){for(let O of io(L,R.filter)){let D=Yt(R,L,k,t.metersPerTile,_,O);D&&(y[Xt(R.id,O)]=D,b.add(O))}continue}let T=Yt(R,L,k,t.metersPerTile,_);T&&(y[R.id]=T)}catch(T){E.push(`${R.id}: ${T instanceof Error?T.message:String(T)}`)}}return{type:"loaded",id:t.id,buckets:y,...Object.keys(d).length?{splits:d}:{},...b.size?{levels:[...b].sort((R,L)=>R-L)}:{},timing:{fetchMs:c,parseMs:performance.now()-a},diag:{status:i.status,bytes:l.byteLength,layers:x,built:Object.keys(y).length,...E.length?{failed:E}:{}}}}function eo(t){return e=>{let n=e.on;if(typeof n!="string"||!n)return 0;let r=0;for(let i of n.split(",")){let s=t[i];typeof s=="number"&&s>r&&(r=s)}return r}}function to(t,e,n){let r=e-1,i=e<n?e+1:24;return!(t.maxzoom<r||t.minzoom>i)}function no(t,e){return t<=6?Math.max(64,e/24):0}function Yt(t,e,n,r,i,s){{if(t.type==="fill"){let c=r>0?r/e.extent:0,a=t.cornerRadius&&c>0?{radius:t.cornerRadius/c,segments:t.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:an/c}:void 0,p=Mn(e,t.filter,n,a,t.clipToTile===!0,e.extent);return p?{kind:"fill",...p,extent:e.extent}:null}if(t.type==="surface"){let c=Gn(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,elevation:t.elevation??0,base:t.base,bevel:t.bevel,weld:t.weld,bevelDrop:t.bevelDrop,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments,...i?{onShapes:a=>In(i,a,t.elevation??0,e.extent)}:{},...t.groundBy?{liftBy:eo(t.groundBy)}:{}});return c?{kind:"surface",...c}:null}if(t.type==="line"){let c=Hn(e,t.filter,n,t.ground?i:void 0,r>0?r/e.extent:0,{level:s});return c?{kind:"line",...c,extent:e.extent}:null}if(t.type==="model"){let c=Wn(e,t.filter);return c?{kind:"placement",...c,extent:e.extent}:null}if(t.type==="symbol"){let c=Zn(e,{filter:t.filter,textField:t.textField,iconImage:t.iconImage,iconRotate:t.iconRotate,textPlacement:t.textPlacement,abbreviate:t.abbreviate});return c?{kind:"symbol",...c,extent:e.extent}:null}let l=Sn(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments});return l?{kind:"fill-extrusion",vertices:l.vertices,indices:l.indices,featureIds:l.featureIds,vertexCount:l.vertexCount,indexCount:l.indexCount,extent:l.extent}:null}}function ro(t,e,n){let r=[];for(let i of t.features()){if(!ce(n,i.properties))continue;let s=i.properties[e];typeof s!="string"&&typeof s!="number"||r.includes(s)||r.push(s)}return r.sort((i,s)=>typeof i=="number"&&typeof s=="number"?i-s:String(i).localeCompare(String(s))),r}function io(t,e){let n=[];for(let r of t.features()){if(!ce(e,r.properties))continue;let i=Qe(r.properties);n.includes(i)||n.push(i)}return n.sort((r,i)=>r-i)}function oo(t,e,n){let r=["==",e,n];return t?["all",t,r]:r}var so=t=>t.kind==="symbol",uo=t=>t.kind==="placement";function Kn(t){let e=[];for(let n of Object.values(t.buckets)){if(uo(n)){e.push(n.anchors);continue}if(so(n)){e.push(n.anchors,n.priorities),n.lines&&e.push(n.lines),n.lineStarts&&e.push(n.lineStarts);continue}e.push(n.vertices,n.indices),n.featureIds&&e.push(n.featureIds)}return e}var Jn=Map;var Ke=new Jn,Zt=self;Zt.onmessage=t=>{let e=t.data;if(e.type==="abort"){Ke.get(e.id)?.abort(),Ke.delete(e.id);return}let n=new AbortController;Ke.set(e.id,n),Qn(e,n.signal).then(r=>{Ke.has(e.id)&&(Ke.delete(e.id),Zt.postMessage(r,Kn(r)))}).catch(r=>{let i=n.signal.aborted;Ke.delete(e.id);let s={type:"error",id:e.id,message:r instanceof Error?r.message:String(r),aborted:i};Zt.postMessage(s)})};})();\n';var Go=class{constructor(e=cn()){this.workers=[];this.blobUrl=null;this.pending=new B;this.nextId=1;this.cursor=0;this.mainThreadAborts=new B;this.destroyed=false;try{let t=new Blob([sn],{type:"text/javascript"});this.blobUrl=URL.createObjectURL(t);for(let o=0;o<e;o++){let r=new Worker(this.blobUrl);r.onmessage=n=>this.onMessage(n.data),r.onerror=n=>console.error("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440 \u0443\u043F\u0430\u043B:",n.message),this.workers.push(r);}}catch(t){console.warn("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B, \u0440\u0430\u0437\u0431\u043E\u0440 \u0442\u0430\u0439\u043B\u043E\u0432 \u043F\u043E\u0439\u0434\u0451\u0442 \u0432 \u0433\u043B\u0430\u0432\u043D\u043E\u043C \u043F\u043E\u0442\u043E\u043A\u0435:",t),this.disposeWorkers();}this.usingWorkers=this.workers.length>0;}get size(){return this.workers.length}load(e,t){let o=this.nextId++,r={type:"load",id:o,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(o,a),il(r,a.signal).then(l=>{this.mainThreadAborts.has(o)&&(this.mainThreadAborts.delete(o),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(o),t({type:"error",id:o,message:l instanceof Error?l.message:String(l),aborted:s});}),o}let n=this.cursor++%this.workers.length;return this.pending.set(o,{resolve:t,workerIndex:n}),this.workers[n].postMessage(r),o}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}let t=this.pending.get(e);if(!t)return;this.pending.delete(e);let o={type:"abort",id:e};this.workers[t.workerIndex].postMessage(o);}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),t.resolve(e));}disposeWorkers(){for(let e of this.workers)e.terminate();this.workers=[],this.blobUrl&&URL.revokeObjectURL(this.blobUrl),this.blobUrl=null;}destroy(){this.destroyed=true;for(let e of this.mainThreadAborts.values())e.abort();this.mainThreadAborts.clear(),this.pending.clear(),this.disposeWorkers();}};function cn(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function al(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function fn(i,e){let t=al(i.zoom),o=[Math.round(i.zoom*100)/100,i.center.lat.toFixed(t),i.center.lng.toFixed(t)],r=Math.round(i.bearing*10)/10,n=Math.round(i.pitch*10)/10;(r!==0||n!==0)&&(o.push(r),n!==0&&o.push(n));let a=o.join("/");return e?`${e}=${a}`:a}function un(i,e){let t=i.replace(/^#/,"");if(!t)return null;if(e){let s=t.split("&").map(c=>c.split("=")).find(([c])=>c===e);if(!s||s.length<2)return null;t=s[1];}let o=t.split("/");if(o.length<3)return null;let r=Number(o[0]),n=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(n)||!isFinite(a)||Math.abs(n)>90||Math.abs(a)>180)return null;let l={center:{lng:a,lat:n},zoom:r};return o.length>3&&isFinite(Number(o[3]))&&(l.bearing=Number(o[3])),o.length>4&&isFinite(Number(o[4]))&&(l.pitch=Number(o[4])),l}function ll(i){if(typeof window>"u"||!window.history?.replaceState)return;let e=new URL(window.location.href);e.hash=i,window.history.replaceState(window.history.state,"",e.toString());}var sl={high:{name:"high",maxPixelRatio:2,maxCanvasPixels:16777216,antialias:true,maxWorkers:6,shadowMapSize:1024,detail:1,tileCacheSize:64,allowShadows:true,detailBias:1,maxTiles:512,modelBudget:1,simpleGeometry:false},balanced:{name:"balanced",maxPixelRatio:1.75,maxCanvasPixels:5529600,antialias:true,maxWorkers:4,shadowMapSize:1024,detail:.85,tileCacheSize:40,allowShadows:true,detailBias:1.1,maxTiles:192,modelBudget:.7,simpleGeometry:false},low:{name:"low",maxPixelRatio:1.25,maxCanvasPixels:2592e3,antialias:true,maxWorkers:2,shadowMapSize:512,detail:.5,tileCacheSize:24,allowShadows:false,detailBias:1.25,maxTiles:96,modelBudget:.4,simpleGeometry:true},minimal:{name:"minimal",maxPixelRatio:1,maxCanvasPixels:1152e3,antialias:false,maxWorkers:2,shadowMapSize:512,detail:0,tileCacheSize:16,allowShadows:false,detailBias:1.7,maxTiles:48,modelBudget:.2,simpleGeometry:true}},Ct=i=>sl[i]??sl.high;function No(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r}=i;return e<=2||t!==void 0&&t<=2?"minimal":o?e<=4||t!==void 0&&t<=3?"minimal":e<=6||t!==void 0&&t<=4||r>=3?"low":"balanced":e<=4||t!==void 0&&t<=4?"balanced":"high"}function Uo(){if(typeof navigator>"u")return {cores:4,mobile:false,devicePixelRatio:1};let i=navigator,e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches&&typeof screen<"u"&&Math.min(screen.width,screen.height)<=820,t=i.userAgentData?.mobile===true||e;return {cores:i.hardwareConcurrency||4,memory:i.deviceMemory,mobile:t,devicePixelRatio:typeof devicePixelRatio=="number"?devicePixelRatio:1}}function hn(i,e,t,o){let r=Math.min(t||1,o.maxPixelRatio),n=Math.max(i*e,1),a=Math.sqrt(o.maxCanvasPixels/n);return Math.max(Math.min(r,a),1)}function dn(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function cl(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function mn(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var ru=1,to=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${ru++}`,this.zIndex=e.zIndex??0,this.altitude=e.altitude??0,this.visible=e.visible!==false,this.userData=e.userData??{},this.paint=e;}get ghostOpacity(){return this.paint.ghostOpacity??0}get revision(){return this._revision}invalidate(){this._revision++;}setPaint(e){return Object.assign(this.paint,e),this.invalidate(),this}setOriginFromCoords(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l of a){let s=Z(l),c=re(s.lng),f=ne(s.lat);c<t&&(t=c),c>r&&(r=c),f<o&&(o=f),f>n&&(n=f);}if(!isFinite(t)){this.originX=0,this.originY=0;return}this.originX=(t+r)/2,this.originY=(o+n)/2;}toLocal(e){let t=[];for(let o of e){let r=Z(o);t.push(re(r.lng)-this.originX,ne(r.lat)-this.originY);}return t}color(e,t){let o=he(this.paint[e]??t),r=this.paint.opacity??1;return [o[0],o[1],o[2],o[3]*r]}linePaint(e){return e.dashArray=this.paint.dashArray,e.offset=this.paint.offset,this.paint.arrow&&(e.arrow=true,e.arrowColor=this.color("arrowColor","#ffffff"),e.arrowPeriod=this.paint.arrowPeriod??46,e.arrowSize=this.paint.arrowSize??5),e}},bn=class extends to{constructor(e){super(e),this.coordinates=e.coordinates,this.segments=e.segments??[],this.setOriginFromCoords([this.coordinates]);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords([e]),this.invalidate(),this}setSegments(e){return this.segments=e,this.invalidate(),this}getCoordinates(){return this.coordinates}rings(){return [this.coordinates]}build(){let e=Ht([this.toLocal(this.coordinates)]);if(!e)return [];let t=this.paint.width??6,o=[],r=this.paint.strokeWidth??0;r>0&&o.push({kind:"line",mesh:e,color:this.color("strokeColor","#ffffff"),width:t+r*2,offset:this.paint.offset});let n=this.colorRuns();if(!n.length)return o.push(this.linePaint({kind:"line",mesh:e,color:this.color("color","#2f6df6"),width:t})),o;let a=this.paint.opacity??1;for(let l of n){let s=Ht([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=he(l.color);o.push(this.linePaint({kind:"line",mesh:s,color:[c[0],c[1],c[2],c[3]*a],width:t}));}return o}colorRuns(){if(this.segments.length===0||this.coordinates.length<2)return [];let e=this.coordinates.length-1,t=this.segments.filter(r=>Number.isInteger(r.at)&&r.at>=0&&r.at<e).sort((r,n)=>r.at-n.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let n=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>n&&o.push({from:n,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,n=gn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(fl(e,n[a],n[a+1])<=r)return true;return false}},jo=class extends to{constructor(e){super(e),this.coordinates=e.coordinates,this.setOriginFromCoords(this.coordinates);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords(e),this.invalidate(),this}rings(){return this.coordinates}build(){let e=[],t=Fr(this.coordinates.map(r=>this.toLocal(r)));t&&e.push({kind:"fill",mesh:t,color:this.color("color","#2f6df6"),width:0});let o=this.paint.strokeWidth??this.paint.width??0;if(o>0){let r=this.coordinates.map(a=>this.toLocal(pn(a))),n=Ht(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=gn(pn(this.coordinates[0]??[]),this.altitude,t);if(!vn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(vn(e,gn(pn(this.coordinates[r]),this.altitude,t)))return false;return true}},yn=class extends jo{constructor(e){super({...e,coordinates:[nu(e.center,e.radius,e.segments)]});}};function nu(i,e,t){let o=Z(i),r=e/Ae(o.lat),n=re(o.lng),a=ne(o.lat),l=Math.max(12,t??Math.min(128,Math.round(24+e/20))),s=[];for(let c=0;c<l;c++){let f=c/l*Math.PI*2;s.push([Se(n+Math.cos(f)*r),Ce(a+Math.sin(f)*r)]);}return s}function gn(i,e,t){let o=[];for(let r of i){let n=Z(r),a=t(n.lng,n.lat,e);a&&o.push(a);}return o}function pn(i){if(i.length<2)return i;let e=Z(i[0]),t=Z(i[i.length-1]);return e.lng===t.lng&&e.lat===t.lat?i:[...i,i[0]]}function fl(i,e,t){let o=t.x-e.x,r=t.y-e.y,n=o*o+r*r;if(n<1e-12)return Math.hypot(i.x-e.x,i.y-e.y);let a=((i.x-e.x)*o+(i.y-e.y)*r)/n;return a=a<0?0:a>1?1:a,Math.hypot(i.x-(e.x+a*o),i.y-(e.y+a*r))}function vn(i,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let n=e[o].x,a=e[o].y,l=e[r].x,s=e[r].y;a>i.y!=s>i.y&&i.x<(l-n)*(i.y-a)/(s-a)+n&&(t=!t);}return t}var ul="objects3d",St="level",iu=32,au=100,wn=120,lu=40,su=.35,cu=.02,fu=150,uu=250;function hl(i){return typeof i=="number"?{top:i,right:i,bottom:i,left:i}:{top:i?.top??0,right:i?.right??0,bottom:i?.bottom??0,left:i?.left??0}}function hu(i){let e={...i};return delete e.cornerRadius,delete e.cornerSegments,e.type==="surface"&&(e.type="fill",delete e.elevation,delete e.base,delete e.bevel,delete e.bevelDrop),e}var xn=class extends De{constructor(t){super();this.options=t;this.transform=new Et;this.ctx=null;this.sources=new B;this.rasterSources=new B;this.renderer=new Nt;this.objects=new Wt;this.markerHost=null;this.gestures=null;this.resizeObserver=null;this.frameHandle=0;this.needsRepaint=true;this.padding={top:0,right:0,bottom:0,left:0};this.animation=null;this.loaded=false;this.destroyed=false;this.objects3d=null;this.objects3dEnabled=true;this.frameRing=new Uint8Array(wn);this.ringAt=0;this.ringSum=0;this.ringFilled=0;this.steadyFrames=0;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new B;this.autoIndoorLevel=true;this.debugFB=null;let o=typeof t.container=="string"?document.getElementById(t.container):t.container;if(!o)throw new Error(`[osmgl] \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: ${String(t.container)}`);this.container=o,this.qualityAuto=(t.quality??"auto")==="auto";let r=this.qualityAuto?No(Uo()):t.quality;this.qualityCeiling=r,this.quality=Ct(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new ht(t.theme?_o(t.theme,t.style):t.style),this.background=t.background?he(t.background):null,this.canvas=document.createElement("canvas"),this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.outline="none",getComputedStyle(this.container).position==="static"&&(this.container.style.position="relative"),this.container.appendChild(this.canvas);let n=document.createElement("div");n.className="osmgl-markers",n.style.cssText="position:absolute;inset:0;overflow:hidden;pointer-events:none",this.container.appendChild(n),this.markerHost=n,this.objects.setMarkerHost(n);let a=this.transform;a.minZoom=t.minZoom??0,a.maxZoom=t.maxZoom??22,a.maxPitch=t.maxPitch??75,a.projection=t.projection??"mercator",a.center=Z(t.center??[0,0]),a.zoom=t.zoom??2,a.bearing=t.bearing??0,a.pitch=t.pitch??0,this.hashName=typeof t.hash=="string"?t.hash:void 0,t.hash&&this.applyHash(false),this.pool=new Go(t.workerCount??Math.min(cn(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}initGL(){let t=this.canvas.getContext("webgl2",{alpha:false,antialias:this.quality.antialias,depth:true,stencil:true,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false});if(!t)throw new Error("[osmgl] WebGL2 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435");this.ctx=new ao(t);let o=new vt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...tt,...this.options.icons}),o.onAssetsReady=()=>this.triggerRepaint(),this.renderer.symbols=o,this.renderer.objects=this.objects,this.renderer.models.onLoaded=()=>this.triggerRepaint(),this.renderer.init(this.ctx),this.canvas.addEventListener("webglcontextlost",r=>{r.preventDefault(),this.stopFrameLoop(),this.emit("contextlost",void 0),this.emit("error",{message:"\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442 WebGL \u043F\u043E\u0442\u0435\u0440\u044F\u043D"});});}initSource(){this.options.tiles&&this.addSource(K,{url:this.options.tiles,minzoom:this.options.sourceMinZoom??0,maxzoom:this.options.sourceMaxZoom??14});for(let[o,r]of Object.entries({...this._style.spec.sources??{},...this.options.sources??{}}))this.addSource(o,r);let t=this.options.objects3d;if(t){this.objects3d=new Do({endpoint:t.endpoint??"/objects3d",apiKey:t.apiKey??null}),this.objects3d.onReady=()=>this.triggerRepaint(),this.objects3d.setModelKey(this._style.spec.model3dKey??"");let o=t.sourceMaxZoom??14;this.addSource(this.objects3dSource,{url:t.tiles,minzoom:o,maxzoom:o});}}get objects3dSource(){return this.options.objects3d?this.options.objects3d.source??"model3d":null}objects3dPlan(){let t=this.options.objects3d;return {id:ul,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(hu):n}updateObjects3D(){let t=this.objects3d,o=this.objects3dSource;if(!t||!o)return;let r=this.sources.get(o);if(!r)return;if(!this.objects3dEnabled){t.models.length&&t.clear(l=>this.renderer.models.remove(l,this.ctx?.gl)),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=null;return}let n=this.venuesForMask();t.update({id:ul,"source-layer":this.options.objects3d.sourceLayer??"model3d",layout:this.options.objects3d.layout},r,this.transform,l=>this.renderer.models.add(l),l=>this.renderer.models.remove(l,this.ctx?.gl),this.buildingsForMask(),n),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=n?.key??null;let a=this.renderer.indoorMask.footprint();if(a){let l=this.transform.worldSize>0?this.transform.pixelsPerMeter/this.transform.worldSize*1.5:0;for(let s of t.models){let c=s.origin();s.setHidden(We(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get(K);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??K)!==K)continue;let r=this._style.bucketKeyFor(o);if(r!==null)return {source:t,key:r}}return null}venuesForMask(){let t=new Set;for(let o of this._style.layers)"splitBy"in o&&o.splitBy===St&&t.add(o.source??K);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??K;if(!t.has(r))continue;let n=this.sources.get(r),a=this._style.bucketKeyFor(o);if(n&&a!==null)return {source:n,key:a}}return null}addSource(t,o){if(this.sources.get(t)?.destroy(),this.sources.delete(t),this.rasterSources.get(t)?.destroy(),this.rasterSources.delete(t),o.type==="raster"){let n=new qt({url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return n.on("data",()=>this.triggerRepaint()),n.on("error",({message:a})=>this.emit("error",{message:a})),this.rasterSources.set(t,n),this.triggerRepaint(),this}let r=new Ho(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t)});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:n})=>this.emit("error",{message:n})),t===K&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new po(this.canvas,this.transform,t=>{this.animation=null,t==="zoom"&&this.emit("zoom",void 0),this.emitMove(),this.triggerRepaint();},()=>this.emit("moveend",void 0),this.options.gestures),this.initClicks(),this.initHash();}initClicks(){let t=null;this.canvas.addEventListener("pointerdown",r=>{r.button===0&&(t={x:r.clientX,y:r.clientY,t:performance.now()});}),this.canvas.addEventListener("pointerup",r=>{let n=t;if(t=null,r.button!==0||!n||Math.hypot(r.clientX-n.x,r.clientY-n.y)>4||performance.now()-n.t>500)return;let a=this.canvas.getBoundingClientRect(),l={x:r.clientX-a.left,y:r.clientY-a.top},s=this.objects.hitTest(this.transform,l),c=s?null:this.queryRoom(l),f=s||c?null:this.queryBuilding(l);this.options.highlightBuildings!==false&&(this.setHighlight(f),this.setRoomHighlight(c));for(let u of this.getPopups())u.closeOnClick&&this.removePopup(u);this.emit("click",{point:l,lngLat:this.transform.unproject(l),object:s,building:f,symbol:this.querySymbol(l,4)});}),this.canvas.addEventListener("dblclick",r=>{let n=this.pointOf(r);this.emit("dblclick",{point:n,lngLat:this.transform.unproject(n)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let n=this.pointOf(r);this.emit("contextmenu",{point:n,lngLat:this.transform.unproject(n)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let n=performance.now();if(n-o<16)return;o=n;let a=this.pointOf(r),l=this.querySymbol(a);this.setSymbolHover(l),this.emit("mousemove",{point:a,lngLat:this.transform.unproject(a),object:this.objects.hitTest(this.transform,a),symbol:l});});}pointOf(t){let o=this.canvas.getBoundingClientRect();return {x:t.clientX-o.left,y:t.clientY-o.top}}initResize(){this.resizeObserver=new ResizeObserver(()=>this.resize()),this.resizeObserver.observe(this.container),this.resize();}resize(){if(this.destroyed)return;let t=this.container.clientWidth||1,o=this.container.clientHeight||1,r=hn(t,o,Math.min(window.devicePixelRatio||1,this.maxPixelRatio),this.densityQuality);this.canvas.width=Math.round(t*r),this.canvas.height=Math.round(o*r),this.transform.resize(t,o),this.triggerRepaint();}getCenter(){return this.transform.center}getZoom(){return this.transform.zoom}getBearing(){return this.transform.bearing}getPitch(){return this.transform.pitch}setCenter(t){return this.transform.center=Z(t),this.afterCameraChange()}setZoom(t){return this.transform.zoom=t,this.emit("zoom",void 0),this.afterCameraChange()}setBearing(t){return this.transform.bearing=t,this.afterCameraChange()}setPitch(t){return this.transform.pitch=t,this.afterCameraChange()}jumpTo(t){let o=this.transform;return t.center!==void 0&&(o.center=Z(t.center)),t.zoom!==void 0&&(o.zoom=t.zoom),t.bearing!==void 0&&(o.bearing=t.bearing),t.pitch!==void 0&&(o.pitch=t.pitch),this.animation=null,this.afterCameraChange()}easeTo(t){let o=t.duration??0;if(o<=0)return this.jumpTo(t);let r=this.transform,n={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},l={center:t.center!==void 0?Z(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+rt((t.bearing??r.bearing)-n.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:n,to:l},this.triggerRepaint(),this}flyTo(t){let o=this.transform,r={center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch},a={center:t.center!==void 0?Z(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+rt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=Ge(r.zoom),s=(re(a.center.lng)-re(r.center.lng))*l,c=(ne(a.center.lat)-ne(r.center.lat))*l,f=Math.hypot(s,c),u=Math.max(o.width,o.height),h=u*Math.pow(2,r.zoom-a.zoom),m=1.42,d=m*m,p,y=null;if(f<1e-6){let g=Math.log(h/u);p=Math.abs(g)/m,y=v=>({u:0,w:u*Math.exp(m*Math.sign(g)*v)});}else {let g=w=>{let _=w===0?u:h,T=w===0?h:u;return (T*T-_*_+(w===0?1:-1)*d*d*f*f)/(2*_*d*f)},v=w=>Math.log(-g(w)+Math.sqrt(g(w)*g(w)+1)),x=v(0);p=(v(1)-x)/m;let S=w=>(Math.exp(w)+Math.exp(-w))/2,M=w=>(Math.exp(2*w)-1)/(Math.exp(2*w)+1);y=w=>{let _=m*w+x;return {u:u*S(x)*M(_)/d-u*Math.sinh(x)/d,w:u*S(x)/S(_)}};}if(!Number.isFinite(p)||p<=0)return this.jumpTo(t);let b=t.duration??Math.min(3e3,p/1.2*1e3);return this.animation={start:performance.now(),duration:b,from:r,to:a,fly:{S:p,u1:f,curve:y,w0:u}},this.triggerRepaint(),this}setPadding(t){return this.padding=hl(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Mt;for(let[r,n]of [[0,0],[t.width,0],[t.width,t.height],[0,t.height]])o.extend(t.unproject({x:r,y:n}));return o}cameraForBounds(t,o={}){let r=this.transform,n=Ko(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?hl(o.padding):this.padding,maxZoom:Math.min(o.maxZoom??r.maxZoom,r.maxZoom),minZoom:r.minZoom});return n?{...n,pitch:o.pitch??r.pitch}:null}fitBounds(t,o={}){let r=this.cameraForBounds(t,o);if(!r)return this;let n={...r,duration:o.duration??600};return o.fly?this.flyTo(n):this.easeTo(n)}stepAnimation(t){let o=this.animation;if(!o)return false;let r=we((t-o.start)/o.duration,0,1),n=o.fly?r:io(r),a=this.transform,l=Z(o.from.center),s=Z(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),u=o.fly.u1>1e-6?we(c/o.fly.u1,0,1):r;return a.center={lng:l.lng+(s.lng-l.lng)*u,lat:l.lat+(s.lat-l.lat)*u},a.zoom=o.from.zoom+Math.log2(o.fly.w0/f),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*io(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*io(r),r>=1&&(a.center=s,a.zoom=o.to.zoom),this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}return a.center={lng:l.lng+(s.lng-l.lng)*n,lat:l.lat+(s.lat-l.lat)*n},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*n,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*n,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*n,this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}afterCameraChange(){return this.emitMove(),this.triggerRepaint(),this}emitMove(){let t=performance.now();t-this.lastMoveEmit<8||(this.lastMoveEmit=t,this.emit("move",void 0));}project(t,o=0){return this.transform.project(Z(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new ht(t);Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[n,a]of this.sources.entries()){let l=JSON.stringify(o.workerPlan(n)),s=JSON.stringify(r.workerPlan(n));l!==s&&a.setPlan(this.planFor(n,r));}return this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}setTheme(t){return this.setStyle(_o(t,this.options.style))}static get themes(){return Object.keys(dt)}static get themeList(){return Object.entries(dt).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let n=this._style.layers.find(l=>l.id===t);if(!n)return console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this;let a=n.layout??(n.layout={});if(a[o]=r,this.rememberOverride(t,{layout:{[o]:r}}),o==="textField"||o==="iconImage"||o==="splitBy")for(let[l,s]of this.sources)s.setPlan(this.planFor(l));return this.triggerRepaint(),this}setPaintProperty(t,o,r){let n=this._style.layers.find(a=>a.id===t);return n?(n.paint[o]=r,this.rememberOverride(t,{paint:{[o]:r}}),this.triggerRepaint(),this):(console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this)}setShadows(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this.renderer.shadows,o),this.triggerRepaint(),this}querySymbol(t,o=2){let r=this.renderer.symbols?.querySymbol(t,o);return r?{layerId:r.layerId,text:r.text,icon:r.icon,lngLat:{lng:Se(r.mercX),lat:Ce(r.mercY)},key:vt.keyOf(r)}:null}setSymbolHover(t){return this.renderer.symbols?.setHover(t?.key??null)&&this.triggerRepaint(),this}setSymbolHidden(t){return this.renderer.symbols?.setHidden(t?.key??null)&&this.triggerRepaint(),this}queryBuilding(t){let o=null;for(let r of this._style.layers){if(r.type!=="fill-extrusion"||r.overlay||!this._style.layerVisibleAt(r,this.transform.zoom))continue;let n=this.sources.get(r.source??K);if(!n)continue;let a=Ar(this.transform,n,r.id,t);a&&(!o||a.distance<o.distance)&&(o=a);}return o}setHighlight(t,o={}){return this.renderer.highlight=t?{layerId:t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.45}:null,this.triggerRepaint(),this}queryRoom(t){if(!this.renderer.indoorOpen)return null;let o=[],r=new B,n;for(let l of this._style.layers){if(l.type!=="fill"||!l.id.startsWith("indoor-")||l.id==="indoor-shell"||!this._style.layerVisibleAt(l,this.transform.zoom))continue;let s=this._style.bucketKeyFor(l);s&&(o.push(s),r.set(s,l.id),n??(n=this.sources.get(l.source??K)));}if(!n||!o.length)return null;let a=Lr(this.transform,n,o,t);return a?{...a,layerId:r.get(a.layerId)??a.layerId,bucketKey:a.layerId}:null}setRoomHighlight(t,o={}){return this.renderer.highlightFill=t?{layerId:t.layerId,bucketKey:t.bucketKey??t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.5}:null,this.triggerRepaint(),this}getHighlight(){let t=this.renderer.highlight;return t?{featureId:t.featureId,layerId:t.layerId}:null}initHash(){this.options.hash&&(this.on("move",()=>this.scheduleHash()),this.on("moveend",()=>this.scheduleHash(true)),this.onHashChange=()=>{this.writingHash||this.applyHash(true);},window.addEventListener("hashchange",this.onHashChange),this.scheduleHash(true));}scheduleHash(t=false){if(!(!this.options.hash||this.destroyed)){if(this.hashTimer){if(!t)return;clearTimeout(this.hashTimer);}this.hashTimer=setTimeout(()=>{this.hashTimer=0,this.writeHash();},t?0:300);}}writeHash(){if(!this.options.hash||this.destroyed)return;let t=this.transform,o=fn({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,ll("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=un(window.location.hash,this.hashName);if(!o)return;let r=this.transform;o.center&&(r.center=o.center),o.zoom!==void 0&&(r.zoom=o.zoom),o.bearing!==void 0&&(r.bearing=o.bearing),o.pitch!==void 0&&(r.pitch=o.pitch),t&&(this.emitMove(),this.triggerRepaint());}setQuality(t){this.qualityAuto=t==="auto";let o=t==="auto"?No(Uo()):t;return this.qualityCeiling=o,this.resetFrameWindow(),this.applyQuality(Ct(o)),this}getQuality(){return {auto:this.qualityAuto,profile:{...this.quality},pixelRatio:this.transform.width>0?this.canvas.width/this.transform.width:1}}applyQuality(t,o=false){let r=this.quality.simpleGeometry,n=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:n},this.resetFrameWindow(),this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==n)for(let[a,l]of this.sources.entries())l.setPlan(this.planFor(a));o||(this.densityQuality=t,this.options.maxPixelRatio===void 0&&(this.maxPixelRatio=t.maxPixelRatio)),this.renderer.detailScale=t.detail,this.renderer.allowShadows=t.allowShadows,this.renderer.shadows.resolution!==t.shadowMapSize&&this.setShadows({resolution:t.shadowMapSize});for(let a of this.sources.values())a.setCoverOptions({detailBias:t.detailBias,maxTiles:t.maxTiles});this.resize();}resetFrameWindow(){this.frameRing.fill(0),this.ringAt=0,this.ringSum=0,this.ringFilled=0,this.steadyFrames=0;}checkFrameBudget(t){if(!this.qualityAuto||this.sum(a=>a.pendingCount)>0)return;let o=t>au?3:t>iu?1:0;if(this.ringSum+=o-this.frameRing[this.ringAt],this.frameRing[this.ringAt]=o,this.ringAt=(this.ringAt+1)%wn,this.ringFilled<wn&&this.ringFilled++,this.steadyFrames++,this.ringFilled<lu)return;let r=this.ringSum/this.ringFilled;if(r>=su){let a=mn(this.quality.name);if(!a)return;console.info(`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${(r*100).toFixed(0)}% \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${a}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F)`),this.applyQuality(Ct(a),true);return}if(r>cu||this.steadyFrames<fu)return;let n=cl(this.quality.name);!n||dn(n)>dn(this.qualityCeiling)||(console.info(`[osmgl] \u043A\u0430\u0434\u0440\u044B \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0432 \u0431\u044E\u0434\u0436\u0435\u0442 \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u043E \u0434\u043E \xAB${n}\xBB`),this.applyQuality(Ct(n),true));}getShadows(){return {...this.renderer.shadows}}setSky(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this._style.sky,o),this.triggerRepaint(),this}getSky(){return {...this._style.sky}}setLight(t){return Object.assign(this._style.light,t),this.triggerRepaint(),this}setLayerVisible(t,o){let r=this._style.layers.find(n=>n.id===t);return r&&(r.visible=o,this.rememberOverride(t,{visible:o}),this.triggerRepaint()),this}setObjects3DEnabled(t){return this.objects3dEnabled===t?this:(this.objects3dEnabled=t,this.triggerRepaint(),this)}get objects3DEnabled(){return this.objects3dEnabled}rasterLayerVisible(t){let o=this.transform.zoom;return this._style.layers.some(r=>r.type==="raster"&&r.source===t&&this._style.layerVisibleAt(r,o))}rememberOverride(t,o){let r=this.layerOverrides.get(t)??{};this.layerOverrides.set(t,{...r,...o,paint:{...r.paint??{},...o.paint??{}},layout:{...r.layout??{},...o.layout??{}}});}applyLayerOverrides(){if(this.layerOverrides.size)for(let t of this._style.layers){let o=this.layerOverrides.get(t.id);if(o&&(o.visible!==void 0&&(t.visible=o.visible),o.paint&&Object.assign(t.paint??(t.paint={}),o.paint),o.layout)){let r=t;Object.assign(r.layout??(r.layout={}),o.layout);}}}setBackground(t){return this.background=he(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(n=>(n.source??K)===o&&"splitBy"in n&&n.splitBy===St))for(let n of r.splitValues(St)){let a=Number(n);Number.isFinite(a)&&!t.includes(a)&&t.push(a);}return t.sort((o,r)=>o-r)}getIndoorLevel(){let t=this._style.splitValues[St];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[St]:this._style.splitValues[St]=t,this.triggerRepaint(),this}syncIndoor(){let t=this.getIndoorLevels(),o=t.join(",");if(o!==this.lastIndoorKey){if(this.lastIndoorKey=o,this.autoIndoorLevel){let r=this.getIndoorLevel();t.length?(r===null||!t.includes(r))&&this.setIndoorLevel(t.includes(0)?0:t.find(n=>n>=0)??t[0]):r!==null&&this.setIndoorLevel(null);}this.emit("indoor",{levels:t,level:this.getIndoorLevel()});}}addObject(t){return this.objects.add(t),this.triggerRepaint(),this}removeObject(t){return this.objects.remove(t),this.triggerRepaint(),this}getObjects(){return this.objects.all}updateObject(){return this.triggerRepaint(),this}addModel(t){return this.renderer.models.add(t),this.triggerRepaint(),this}removeModel(t){return this.renderer.models.remove(t,this.ctx?.gl),this.triggerRepaint(),this}getObjects3DStats(){return this.objects3d?.stats??null}getModels(){return this.renderer.models.all}addMarker(t){return this.objects.addMarker(t),t.update(this.transform),this}removeMarker(t){return this.objects.removeMarker(t),this}getMarkers(){return this.objects.allMarkers}addPopup(t){return t.onCloseRequest(()=>this.removePopup(t)),this.objects.addMarker(t),t.update(this.transform),this}removePopup(t){return this.objects.removeMarker(t),this}getPopups(){return this.objects.allMarkers.filter(t=>t instanceof eo)}objectAt(t,o=4){return this.objects.hitTest(this.transform,t,o)}setProjection(t){let o=this.transform;if(o.projection===t)return this;o.projection=t;let r=o.effectiveMinZoom(),n=t==="globe"?Math.min(o.maxPitch,Tt):o.maxPitch,a=o.zoom<r,l=o.pitch>n;return a||l?this.easeTo({zoom:a?r:o.zoom,pitch:l?n:o.pitch,duration:600}):(this.emit("move",void 0),this.triggerRepaint()),this}getProjection(){return this.transform.projection}refreshSource(t){return this.sources.get(t)?.reload(),this.rasterSources.get(t)?.reload(),this.triggerRepaint(),this}refresh(){for(let t of this.sources.values())t.reload();for(let t of this.rasterSources.values())t.reload();return this.renderer.refreshHighlight(),this.triggerRepaint(),this}sum(t){let o=0;for(let r of this.sources.values())o+=t(r);return o}getStats(){return {pendingTiles:this.sum(t=>t.pendingCount),visibleTiles:this.sum(t=>t.visibleTiles.length),labels:this.renderer.symbols?.placedCount??0,models:this.renderer.models.readyCount,workers:this.pool.usingWorkers?this.pool.size:0,renderer:this.ctx?.caps.rendererName??"\u043D\u0435\u0442 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430"}}triggerRepaint(){this.destroyed||(this.needsRepaint=true,!this.frameHandle&&(this.frameHandle=requestAnimationFrame(t=>{this.frameHandle=0,this.renderFrame(t);})));}debugFloatPixels(t,o,r,n){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let l=a.gl,s=this.canvas.width,c=this.canvas.height,f=!!l.getExtension("EXT_float_blend"),u=f?l.RGBA32F:l.RGBA16F,h=f?l.FLOAT:l.HALF_FLOAT;if(this.debugFB&&(this.debugFB.w!==s||this.debugFB.h!==c)&&(l.deleteFramebuffer(this.debugFB.fb),l.deleteTexture(this.debugFB.tex),l.deleteRenderbuffer(this.debugFB.rb),this.debugFB=null),!this.debugFB){let m=l.createTexture(),d=l.createFramebuffer(),p=l.createRenderbuffer();if(!m||!d||!p)return null;l.bindTexture(l.TEXTURE_2D,m),l.texImage2D(l.TEXTURE_2D,0,u,s,c,0,l.RGBA,h,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.bindTexture(l.TEXTURE_2D,null),l.bindRenderbuffer(l.RENDERBUFFER,p),l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH24_STENCIL8,s,c),l.bindRenderbuffer(l.RENDERBUFFER,null),l.bindFramebuffer(l.FRAMEBUFFER,d),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,m,0),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,p);let y=l.checkFramebufferStatus(l.FRAMEBUFFER);if(l.bindFramebuffer(l.FRAMEBUFFER,null),a.invalidateState(),y!==l.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:d,tex:m,rb:p,w:s,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let m=new Float32Array(r*n*4);return l.readPixels(t,o,r,n,l.RGBA,l.FLOAT,m),{data:m,format:f?"rgba32f":"rgba16f"}}finally{a.screen=null,this.triggerRepaint();}}renderFrame(t){if(this.destroyed||!this.ctx)return;let o=performance.now();this.needsRepaint=false;let r=this.stepAnimation(t),n=this.ctx;n.bindFramebuffer(null),n.viewport(0,0,this.canvas.width,this.canvas.height),n.setDepthMask(true),n.clear(this.background??this._style.background,true,true);for(let m of this.sources.values())m.update(this.transform);this.updateObjects3D();for(let[m,d]of this.rasterSources)this.rasterLayerVisible(m)&&d.update(this.transform);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(n,this.transform,this.sources,this._style,t,this.rasterSources),l=performance.now()-o,s=r||a||this.needsRepaint,c=this.lastFrameAt>0?t-this.lastFrameAt:0,f=c>0&&c<uu,u=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let h=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(h),this.emit("render",{frameMs:l,intervalMs:u}),s&&this.triggerRepaint();}stopFrameLoop(){this.frameHandle&&cancelAnimationFrame(this.frameHandle),this.frameHandle=0;}get isLoaded(){return this.loaded}destroy(){if(this.onHashChange&&(window.removeEventListener("hashchange",this.onHashChange),this.onHashChange=null),this.hashTimer&&clearTimeout(this.hashTimer),!this.destroyed){this.destroyed=true,this.stopFrameLoop(),this.resizeObserver?.disconnect(),this.gestures?.destroy();for(let t of this.sources.values())t.destroy();this.sources.clear();for(let t of this.rasterSources.values())t.destroy();this.rasterSources.clear(),this.objects.destroy(),this.markerHost?.remove(),this.pool.destroy(),this.ctx&&this.renderer.destroy(this.ctx),this.removeAllListeners(),this.canvas.remove();}}},J0=xn;
2013
- export{Zt as AssetLoader,K as BASE_SOURCE,st as BUILDING_HEIGHT_SCALE,lt as BUILDING_POS_SCALE,Me as BUILDING_VERTEX_STRIDE,cc as CITY_STYLE,yn as Circle,tt as DEFAULT_ICONS,gr as DEFAULT_LIGHT,Wa as DEFAULT_SHADOWS,yr as DEFAULT_SKY,vr as DEFAULT_STYLE,Ft as DepthTarget,lo as EARTH_CIRCUMFERENCE,Ne as FILL_VERTEX_STRIDE,Tt as GLOBE_MAX_PITCH,Ze as GLOBE_ZOOM_MAX,fo as GLOBE_ZOOM_MIN,be as GLYPH_BORDER,Ve as GLYPH_SIZE,Ms as GROUND_SCALE,At as GeomType,jt as GlyphSource,zt as GroundArrows,Yt as IconSource,Pt as IndoorMask,Es as LEVEL_LIMIT,Ue as LINE_VERTEX_STRIDE,Nt as LayerRenderer,Mt as LngLatBounds,Cn as MAX_LATITUDE,Ao as MODEL_VERTEX_STRIDE,xn as Map,to as MapObject,Jt as Marker,Qt as Model,Xe as ModelLayer,Wt as ObjectManager,jo as Polygon,bn as Polyline,eo as Popup,sc as RELIEF_STYLE,Ir as RUNTIME_FILL_STRIDE,pt as RUNTIME_LINE_STRIDE,qt as RasterSource,Oo as RasterTile,Ur as SDF_EDGE,Xt as SDF_PX,lc as SOFT_STYLE,ji as SPLIT_SEP,Lt as SURFACE_CUT_BLEED,fi as SURFACE_LEVEL_SCALE,ct as SURFACE_VERTEX_STRIDE,Ut as SdfAtlas,ht as Style,vt as SymbolRenderer,dt as THEMES,qe as TILE_SIZE,xt as TileID,Et as Transform,kt as VectorTile,bo as VectorTileFeature,yo as VectorTileLayer,rn as abbreviateStreet,mr as addGround,vu as altitudeFromMercatorZ,xo as applyTheme,Za as arrowLabelOffset,xc as arrowVertices,Fr as buildRuntimeFill,Ht as buildRuntimeLine,Ko as cameraForBounds,Ae as circumferenceAtLatitude,so as clampLat,hn as clampPixelRatio,Yr as clipLineToRect,al as coordinateDigits,$t as coveringTiles,dr as createGround,J0 as default,Uo as deviceHints,fl as distToSegment,ke as evaluateColor,D as evaluateNumber,To as extractFeature,et as featureLevel,Sr as fillFootprint,mt as fogPlanes,Mr as footprintOf,fn as formatHash,ir as generateBuildings,hr as generateFill,br as generateLine,ur as generateSurface,an as generateSymbols,Jo as globeBasis,ho as globeFlatMix,uo as globeRadius,In as globeToLocal,vo as groundAt,Qa as iconRotation,We as insideFootprint,Ce as latFromMercatorY,Se as lngFromMercatorX,mo as lngLatToUnit,pe as matchesFilter,Yo as mercatorMetersPerTile,re as mercatorX,ne as mercatorY,Xo as mercatorZFromAltitude,xu as metersPerPixel,Sn as metersPerTile,mn as nextQualityDown,Dc as parseGlb,Pr as parseGlbAsync,Va as parseGlyphs,un as parseHash,Sa as patchUV,Ar as pickBuilding,Lr as pickFill,Wn as pitchIntent,wu as pixelsPerMeter,$r as placeAlongLine,vn as pointInRing,No as qualityFor,Ct as qualityProfile,er as raySphere,nn as resolveTemplate,Re as roundRing,jr as sdfFromAlpha,Xr as shapeText,ze as splitBucketKey,pr as splitByGround,Qe as splitPolygons,_o as styleWithTheme,Mn as tileOriginMeters,Ja as tileUrl,Z as toLngLat,Qo as unitToLngLat,Ge as worldSize};//# sourceMappingURL=osmgl.js.map
2306
+ `;var Mo=i=>i.kind==="symbol",Ma=i=>i.kind==="placement";function Ve(i,e,t,o){for(let r of i)for(let n=0;n+5<r.length;n+=6){let a=r[n],l=r[n+1],s=r[n+2],c=r[n+3],f=r[n+4],u=r[n+5];if(hc(e,t,a,l,s,c,f,u)||o>0&&(Tr(e,t,a,l,s,c)<=o||Tr(e,t,s,c,f,u)<=o||Tr(e,t,f,u,a,l)<=o))return true}return false}function hc(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),u=s<0||c<0||f<0,d=s>0||c>0||f>0;return !(u&&d)}function Tr(i,e,t,o,r,n){let a=r-t,l=n-o,s=a*a+l*l,c=s>0?Math.max(0,Math.min(1,((i-t)*a+(e-o)*l)/s)):0;return Math.hypot(i-(t+a*c),e-(o+l*c))}function Er(i,e){let t=new DataView(i.vertices),o=new Uint32Array(i.indices),r=e.bounds(),n=(r.maxX-r.minX)/i.extent,a=new Float64Array(o.length*2);for(let l=0;l<o.length;l++){let s=o[l]*Ue;a[l*2]=r.minX+t.getInt16(s,true)*n,a[l*2+1]=r.minY+t.getInt16(s+2,true)*n;}return a}function kr(i,e,t){let o=new DataView(i.vertices),r=t.bounds(),n=(r.maxX-r.minX)/e,a=r.minX,l=r.minY,s=new Float64Array(i.indices.length*2);for(let c=0;c<i.indices.length;c++){let f=i.indices[c]*Me;s[c*2]=a+o.getInt16(f,true)*n,s[c*2+1]=l+o.getInt16(f+2,true)*n;}return s}var pc={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},bc=40,yc=10.5,Ta=2.5,gc=16,vc=4,wc=7,Pt=class{constructor(){this.vbo=null;this.ibo=null;this.vao=null;this.capacity=0;this.perArrow=0;this.indicesPerArrow=0;this.highlightFootprint=null;this.count=0;}render(e,t,o,r,n,a,l,s=false){this.count=0;let c=t.zoom,f=r.layers.filter(x=>x.type==="symbol"&&x.layout?.placement==="map"&&r.layerVisibleAt(x,c));if(!f.length)return;let u=t.center,d=oe(u.lng),h=re(u.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let y=[];for(let x of f){let C=o.get(x.source??K);if(!C)continue;let S=r.bucketKeyFor(x);if(S===null)continue;let M=x.layout?.showFor==="highlight";if(M&&!this.highlightFootprint)continue;let w=m*1.5,T=x.layout?.arrowUnits==="meters"?m:1/t.worldSize,L=V(x.layout?.arrowLength,c,bc)*T,k=V(x.layout?.arrowWidth,c,yc)*T,z=V(x.layout?.arrowOutline,c,Ta)*T,A=V(x.layout?.arrowGap,c,gc)*T,I=V(x.layout?.arrowDotRadius,c,vc)*T,E=V(x.layout?.arrowDotGap,c,wc)*T,F=Lr(L,k,I,A-E),P=z>0?Lr(L,k,I,A-E,z).outline:null,R={layer:x,verts:[],shape:F};for(let W of C.visibleTiles){let O=C.getTile(W)?.data?.buckets?.[S];if(!O||!Mo(O))continue;let H=new Int16Array(O.anchors),D=O.rotations?new Int16Array(O.rotations):null,Y=W.bounds(),$=(Y.maxX-Y.minX)/O.extent,Q=Y.minX,de=Y.minY;for(let J=0;J<H.length/2;J++){let X=Q+H[J*2]*$,te=de+H[J*2+1]*$;if(M&&!Ve(this.highlightFootprint,X,te,w))continue;let ie=(D?D[J]:0)*Math.PI/180,q=Math.sin(ie),U=-Math.cos(ie),j=X-d-q*A,le=te-h-U*A;P&&Ir(R,P,j,le,q,U),Ir(R,F.outline,j,le,q,U),this.count++;}}R.verts.length&&y.push(R);}if(!y.length)return;let p=y[0].shape,b=p.outline.length/2,g=[],v=[];for(let x of y){let C=g.length/2/b;for(let S of x.verts)g.push(S);v.push({layer:x.layer,first:C,count:x.verts.length/2/b});}if(this.ensureBuffers(e,g.length/2/b,p,a),!(!this.vao||!this.vbo)){this.vbo.update(new Uint8Array(new Float32Array(g).buffer)),n.use(),l?.(n),s&&n.setMat4("u_shadow_matrix",t.shadowObjectMatrix(d,h,0)),n.setMat4("u_matrix",t.objectMatrix(d,h,0)),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.vao.bind();for(let x of v){let C=x.layer.paint,S=V(C.opacity,c,1),M=ke(C.color,c,[.18,.45,.76,1]),w=ke(C.haloColor,c,[1,1,1,1]),_=V(x.layer.layout?.arrowOutline,c,Ta)>0;xc(e,n,x,w,M,S,_,this.indicesPerArrow);}e.bindVAO(null),e.setDepthTest(true);}}ensureBuffers(e,t,o,r){let n=o.outline.length/2;if(this.vao&&t<=this.capacity&&n===this.perArrow)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacity=Math.max(256,Math.ceil(t*1.5)),this.perArrow=n,this.indicesPerArrow=o.indices.length,this.vbo=new ye(e,new Uint8Array(this.capacity*n*8),pc,true);let a=new Uint32Array(this.capacity*o.indices.length);for(let l=0;l<this.capacity;l++){let s=l*n;for(let c=0;c<o.indices.length;c++)a[l*o.indices.length+c]=s+o.indices[c];}this.ibo=new he(e,a),this.vao=new ue(e,[{buffer:this.vbo,locations:r}],this.ibo);}destroy(){this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.vao=null,this.vbo=null,this.ibo=null,this.capacity=0;}};function xc(i,e,t,o,r,n,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",_e([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=s)Ea(i,t.first+c,l);}e.setVec4v("u_color",_e([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=s)Ea(i,t.first+c,l);}function Ea(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var ka=4,Ar=12;function Lr(i,e,t,o,r=0){let n=i*.38,a=e*1.35,l=n*.3,s=e*.32,c=e/2,f=-i+s,u=[],d=(b,g)=>u.push(b,g);d(0,0),d(-n,a),d(-n+l,c),d(f,s);for(let b=1;b<ka;b++){let g=b/ka*Math.PI;d(f-Math.sin(g)*s,Math.cos(g)*s);}d(f,-s),d(-n+l,-c),d(-n,-a);let h=r>0?_c(u,r):u,m=ti(u,void 0,2);if(t<=0)return {outline:h,indices:m};let y=h.length/2,p=t+r;for(let b=0;b<Ar;b++){let g=b/Ar*Math.PI*2;h.push(o+Math.cos(g)*p,Math.sin(g)*p);}for(let b=1;b<Ar-1;b++)m.push(y,y+b,y+b+1);return {outline:h,indices:m}}function _c(i,e){let t=i.length/2,o=0;for(let a=0;a<t;a++){let l=(a+1)%t;o+=i[a*2]*i[l*2+1]-i[l*2]*i[a*2+1];}let r=o<0?-1:1,n=[];for(let a=0;a<t;a++){let l=i[(a+t-1)%t*2],s=i[(a+t-1)%t*2+1],c=i[a*2],f=i[a*2+1],u=i[(a+1)%t*2],d=i[(a+1)%t*2+1],h=Math.hypot(c-l,f-s)||1,m=Math.hypot(u-c,d-f)||1,y=r*(f-s)/h,p=-r*(c-l)/h,b=r*(d-f)/m,g=-r*(u-c)/m,v=y+b,x=p+g,C=Math.hypot(v,x);if(C<1e-9){n.push(c,f);continue}v/=C,x/=C;let S=Math.min(1/Math.max(v*y+x*p,.35),3);n.push(c+v*e*S,f+x*e*S);}return n}function Ir(i,e,t,o,r,n){let a=-n,l=r;for(let s=0;s<e.length;s+=2){let c=e[s],f=e[s+1];i.verts.push(t+r*c+a*f,o+n*c+l*f);}}function Cc(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return Ir(s,Lr(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var Sc=5;function Aa(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var To=class{constructor(){this.anisotropy=0;this.anisotropyPname=0;this.anisotropyChecked=false;}render(e,t,o,r,n,a,l,s=false){if(!a.size)return;let c=n.layers.filter(f=>f.type==="raster"&&!!f.overlay===s&&n.layerVisibleAt(f,l));if(c.length){r.use(),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),r.setInt("u_image",0);for(let f of c){let u=a.get(f.source);if(!u)continue;let d=V(f.paint?.opacity,l,1);if(!(d<=.001)){r.setFloat("u_opacity",d),o.bind();for(let h of u.visibleTiles){let m=this.patchFor(e,u,h);m&&(e.bindTexture(0,m.texture),r.setVec3("u_uv_transform",m.uv[0],m.uv[1],m.uv[2]),r.setMat4("u_matrix",t.tileMatrix(h,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0));}}}e.bindVAO(null);}}patchFor(e,t,o){let r=t.getTile(o),n=r&&r.state==="loaded"?this.textureFor(e,r):null;if(n)return {texture:n,uv:[0,0,1]};for(let a=1;a<=Sc&&a<=o.z;a++){let l=o.scaledTo(o.z-a),s=t.getTile(l);if(!s||s.state!=="loaded")continue;let c=this.textureFor(e,s);if(c)return {texture:c,uv:Aa(o,a)}}return null}textureFor(e,t){let o=t.texture;if(o)return o.handle;if(!t.image)return null;let r=e.gl,n=r.createTexture();if(!n)return null;e.bindTexture(0,n),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t.image),r.generateMipmap(r.TEXTURE_2D),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),this.applyAnisotropy(r);let a={handle:n,destroy:()=>r.deleteTexture(n)};return t.texture=a,t.image.close(),t.image=null,n}applyAnisotropy(e){if(!this.anisotropyChecked){this.anisotropyChecked=true;let t=e.getExtension("EXT_texture_filter_anisotropic");t&&(this.anisotropyPname=t.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropy=Math.min(4,e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT)));}this.anisotropy>0&&e.texParameterf(e.TEXTURE_2D,this.anisotropyPname,this.anisotropy);}};var Mc="indoor-",Ht=class{constructor(){this.parts=null;this.stamp="";this.cache=new B;this.box=null;this.hidden=new ee;this.collected=new ee;}get active(){return this.parts!==null}footprint(){return this.parts}get hiddenCount(){return this.hidden.size}sync(e,t,o){let r=[],n;for(let d of t.layers){if(!d.id.startsWith(Mc)||d.type!=="fill"||!t.layerVisibleAt(d,o))continue;let h=t.bucketKeyFor(d);h&&(r.push(h),n??(n=e.get(d.source??K)));}if(!r.length||!n){this.parts&&this.destroy();return}let a=r.join(",")+"|"+n.visibleTiles.map(d=>d.dataKey+(n.getTile(d)?.data?"+":"-")).join(",");if(a===this.stamp)return;this.stamp=a,this.free();let l=[],s=1/0,c=1/0,f=-1/0,u=-1/0;for(let d of n.visibleTiles){let h=n.getTile(d)?.data?.buckets;if(h)for(let m of r){let y=h[m];if(!y||y.kind!=="fill")continue;let p=Er(y,d);l.push(p);for(let b=0;b<p.length;b+=2)p[b]<s&&(s=p[b]),p[b]>f&&(f=p[b]),p[b+1]<c&&(c=p[b+1]),p[b+1]>u&&(u=p[b+1]);}}this.parts=l.length?l:null,this.box=l.length?[s,c,f,u]:null,this.hidden.clear(),this.collected.clear();}collectHidden(e,t){let o=this.parts;if(!o||!e.featureIds)return;let r=new Uint32Array(e.indices),n=new Float64Array(e.featureIds),a=new DataView(e.vertices),l=t.bounds(),s=(l.maxX-l.minX)/e.extent,c=this.box,f=new B;for(let u=0;u*3<r.length;u++){let d=n[u];if(this.hidden.has(d))continue;let h=f.get(d);h||f.set(d,h=[1/0,1/0,-1/0,-1/0]);for(let m=0;m<3;m++){let y=r[u*3+m]*Me,p=a.getInt16(y,true),b=a.getInt16(y+2,true);p<h[0]&&(h[0]=p),b<h[1]&&(h[1]=b),p>h[2]&&(h[2]=p),b>h[3]&&(h[3]=b);}}for(let[u,d]of f){let h=l.minX+(d[0]+d[2])/2*s,m=l.minY+(d[1]+d[3])/2*s;c&&(h<c[0]||h>c[2]||m<c[1]||m>c[3])||Ve(o,h,m,0)&&this.hidden.add(u);}}destroy(){this.parts=null,this.hidden.clear(),this.collected.clear(),this.box=null,this.stamp="",this.free();}free(){this.cache.forEach(e=>{e?.vao.destroy(),e?.ibo.destroy();}),this.cache.clear();}prepare(e,t){if(!this.parts)return;let o=this.hidden.size;for(let r of e.visibleTiles){if(this.collected.has(r.dataKey))continue;let n=e.getTile(r)?.data?.buckets?.[t];!n||n.kind!=="fill-extrusion"||(this.collected.add(r.dataKey),this.collectHidden(n,r));}this.hidden.size!==o&&this.free();}indicesFor(e,t,o,r,n,a){if(!this.parts)return null;let l=this.cache.get(r.dataKey);if(l!==void 0)return l;let s=t.data?.buckets?.[o];if(!s)return null;let c=null;if(s.kind==="fill-extrusion"&&s.featureIds&&this.hidden.size){let f=new Uint32Array(s.indices),u=new Float64Array(s.featureIds),d=[];for(let h=0;h*3<f.length;h++)this.hidden.has(u[h])||d.push(f[h*3],f[h*3+1],f[h*3+2]);if(d.length<f.length){let h=new he(e,new Uint32Array(d));c={vao:new ue(e,[{buffer:n,locations:a}],h),ibo:h,count:d.length};}}return this.cache.set(r.dataKey,c),c}};var La=35,Tc=70,Ec=.35,kc=.5,Ac=1.1;function mt(i,e){let t=e.sky;if(!t.enabled||t.fogIntensity<=0)return {near:0,far:1/0,intensity:0,cutoff:1/0};let o=i.cameraToCenterDistance,r=we((i.pitch-La)/(Tc-La),0,1),n=t.fogRange[0]*(1-Ec*r)*o,a=t.fogRange[1]*(1-kc*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*Ac:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function Fr(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let u=e.getTile(f),d=u&&Ia(u,t);if(!d||!ze(l,i.tileMatrix64(f,d.extent))||(fe(s,l,[r,n,-1,1]),fe(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let h=s[0]/s[3],m=s[1]/s[3],y=s[2]/s[3],p=c[0]/c[3]-h,b=c[1]/c[3]-m,g=c[2]/c[3]-y,v=Ic(d,h,m,y,p,b,g);v&&(!a||v.t<a.distance)&&(a={featureId:v.featureId,tile:f,layerId:t,distance:v.t});}return a}function Rr(i,e,t,o){let r=o.x/Math.max(i.width,1)*2-1,n=1-o.y/Math.max(i.height,1)*2,a=null,l=new Float64Array(16),s=[0,0,0,0],c=[0,0,0,0];for(let f of e.visibleTiles){let u=e.getTile(f);if(u)for(let d of t){let h=u.data?.buckets?.[d];if(!h||h.kind!=="fill"||!h.featureIds||!ze(l,i.tileMatrix64(f,h.extent))||(fe(s,l,[r,n,-1,1]),fe(c,l,[r,n,1,1]),s[3]===0||c[3]===0))continue;let m=s[0]/s[3],y=s[1]/s[3],p=s[2]/s[3],b=c[2]/c[3]-p;if(Math.abs(b)<1e-9)continue;let g=-p/b;if(g<0||g>1)continue;let v=m+(c[0]/c[3]-m)*g,x=y+(c[1]/c[3]-y)*g,C=Lc(h,v,x);C!==null&&(!a||g<a.distance)&&(a={featureId:C,tile:f,layerId:d,distance:g});}}return a}function Lc(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*Ue,true),l=s=>o.getInt16(s*Ue+2,true);for(let s=0;s*3<r.length;s++){let c=r[s*3],f=r[s*3+1],u=r[s*3+2],d=a(c),h=l(c),m=a(f),y=l(f),p=a(u),b=l(u),g=(e-m)*(h-y)-(d-m)*(t-y),v=(e-p)*(y-b)-(m-p)*(t-b),x=(e-d)*(b-h)-(p-d)*(t-h),C=g<0||v<0||x<0,S=g>0||v>0||x>0;if(!(C&&S))return n[s]}return null}function Ia(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function Ic(i,e,t,o,r,n,a){let l=new DataView(i.vertices),s=new Uint32Array(i.indices),c=new Float64Array(i.featureIds),f=y=>l.getInt16(y*Me,true)/lt,u=y=>l.getInt16(y*Me+2,true)/lt,d=y=>l.getUint16(y*Me+4,true)/st,h=1/0,m=-1;for(let y=0;y+2<s.length;y+=3){let p=s[y],b=s[y+1],g=s[y+2],v=f(p),x=u(p),C=d(p),S=f(b)-v,M=u(b)-x,w=d(b)-C,_=f(g)-v,T=u(g)-x,L=d(g)-C,k=n*L-a*T,z=a*_-r*L,A=r*T-n*_,I=S*k+M*z+w*A;if(I>-1e-9&&I<1e-9)continue;let E=1/I,F=e-v,P=t-x,R=o-C,W=(F*k+P*z+R*A)*E;if(W<0||W>1)continue;let G=P*w-R*M,O=R*S-F*w,H=F*M-P*S,D=(r*G+n*O+a*H)*E;if(D<0||W+D>1)continue;let Y=(_*G+T*O+L*H)*E;Y<0||Y>1||Y>=h||(h=Y,m=c[y/3]??0);}return m>=0?{featureId:m,t:h}:null}function Eo(i,e,t){let o=Ia(i,e);if(!o)return null;let r=new Uint32Array(o.indices),n=new Float64Array(o.featureIds),a=[];for(let l=0;l+2<r.length;l+=3)n[l/3]===t&&a.push(r[l],r[l+1],r[l+2]);return a.length?{vertices:o.vertices,indices:new Uint32Array(a)}:null}var pt=24,zr=8,Rc=2,zc=12,ko=8,Ao=8;function Ot(i){let e=0;for(let h of i)e+=h.length/2;if(e<2)return null;let t=(ko+2)*2,o=e*t+i.length*(Ao+2)*2+8,r=e*(ko+2)*6+i.length*Ao*6+24,n=new ArrayBuffer(o*pt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(h,m,y,p,b,g)=>{let v=s*pt;return a.setFloat32(v,h,true),a.setFloat32(v+4,m,true),a.setFloat32(v+8,y,true),a.setFloat32(v+12,p,true),a.setFloat32(v+16,b,true),a.setFloat32(v+20,g,true),s++},u=(h,m,y,p)=>{l[c++]=h,l[c++]=m,l[c++]=p,l[c++]=h,l[c++]=p,l[c++]=y;},d=(h,m,y,p,b,g,v)=>{let x=f(h,m,0,0,0,v),C=f(h,m,y,p,1,v);for(let S=1;S<=Ao;S++){let M=Math.PI*S/Ao,w=y*Math.cos(M)+b*Math.sin(M),_=p*Math.cos(M)+g*Math.sin(M),T=f(h,m,w,_,1,v);l[c++]=x,l[c++]=C,l[c++]=T,C=T;}};for(let h of i){let m=Pc(h),y=m.length/2;if(y<2)continue;let p=new Float64Array(y-1),b=new Float64Array(y-1);for(let S=0;S<y-1;S++){let M=m[S*2+2]-m[S*2],w=m[S*2+3]-m[S*2+1],_=Math.hypot(M,w)||1;p[S]=M/_,b[S]=w/_;}let g=0,v=-1,x=-1;for(let S=0;S<y;S++){let M=m[S*2],w=m[S*2+1];S>0&&(g+=Math.hypot(M-m[S*2-2],w-m[S*2-1]));let _=S>0?S-1:0,T=S<y-1?S:y-2,L=-b[_],k=p[_],z=-b[T],A=p[T],I=L+z,E=k+A,F=Math.hypot(I,E);F>1e-9?(I/=F,E/=F):(I=L,E=k);let P=I*z+E*A,R=P>1e-6?1/P:1/0,W=Math.acos(Math.min(1,Math.max(-1,p[_]*p[T]+b[_]*b[T])));if(!(W>zc*Math.PI/180)&&R<=Rc){let O=f(M,w,I*R,E*R,1,g),H=f(M,w,-I*R,-E*R,-1,g);v>=0&&u(v,x,O,H),v=O,x=H;}else {let O=Math.max(1,Math.min(ko,Math.ceil(W/(Math.PI/ko)))),D=p[_]*b[T]-b[_]*p[T]>=0?1:-1,Y=f(M,w,L,k,1,g),$=f(M,w,-L,-k,-1,g);v>=0&&u(v,x,Y,$);for(let Q=1;Q<=O;Q++){let de=D*W*(Q/O),J=Math.cos(de),X=Math.sin(de),te=L*J-k*X,ie=L*X+k*J,q=f(M,w,te,ie,1,g),U=f(M,w,-te,-ie,-1,g);u(Y,$,q,U),Y=q,$=U;}v=Y,x=$;}}let C=y-2;d(m[0],m[1],-b[0],p[0],-p[0],-b[0],0),d(m[(y-1)*2],m[(y-1)*2+1],-b[C],p[C],p[C],b[C],g);}return c?{vertices:n.slice(0,s*pt),indices:l.slice(0,c),vertexCount:s}:null}function Pr(i){if(!i.length||i[0].length<6)return null;let e=[],t=[];for(let n=0;n<i[0].length;n++)e.push(i[0][n]);for(let n=1;n<i.length;n++)if(!(i[n].length<6)){t.push(e.length/2);for(let a=0;a<i[n].length;a++)e.push(i[n][a]);}let o=ti(e,t.length?t:void 0,2);if(!o.length)return null;let r=new Uint32Array(o.length);for(let n=0;n<o.length;n+=3)r[n]=o[n],r[n+1]=o[n+2],r[n+2]=o[n+1];return {vertices:new Float32Array(e).buffer,indices:r,vertexCount:e.length/2}}function Pc(i){let e=[];for(let t=0;t<i.length;t+=2){let o=i[t],r=i[t+1],n=e.length;n>=2&&e[n-2]===o&&e[n-1]===r||e.push(o,r);}return e}var Wt=5126,Hc={stride:zr,attribs:[{name:"a_pos",size:2,type:Wt,offset:0}]},Or={stride:pt,attribs:[{name:"a_pos",size:2,type:Wt,offset:0},{name:"a_extrude",size:2,type:Wt,offset:8},{name:"a_side",size:1,type:Wt,offset:16},{name:"a_dist",size:1,type:Wt,offset:20}]},Hr=class{constructor(e,t){this.revision=e;this.parts=t;}destroy(){for(let e of this.parts)e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy();}},Oc=(i,e)=>[i[0],i[1],i[2],i[3]*e],Bt=class{constructor(){this.objects=[];this.markers=[];this.gpu=new B;this.markerHost=null;}setMarkerHost(e){this.markerHost=e;for(let t of this.markers)t.attach(e);}add(e){this.objects.includes(e)||this.objects.push(e);}remove(e){let t=this.objects.indexOf(e);t<0||(this.objects.splice(t,1),this.gpu.get(e.id)?.destroy(),this.gpu.delete(e.id));}addMarker(e){this.markers.includes(e)||(this.markers.push(e),this.markerHost&&e.attach(this.markerHost));}removeMarker(e){let t=this.markers.indexOf(e);t<0||(this.markers.splice(t,1),e.detach());}get all(){return this.objects}get allMarkers(){return this.markers}get isEmpty(){return this.objects.length===0}updateMarkers(e){for(let t of this.markers)t.update(e);}render(e,t,o,r,n,a,l,s=false,c=false){if(!this.objects.length||c&&!this.objects.some(m=>m.ghostOpacity>0))return;this.objects.length>1&&this.objects.sort((m,y)=>m.zIndex-y.zIndex);let f=e.gl.drawingBufferWidth,u=t.width>0?f/t.width:1,d=t.worldSize*u,h=null;for(let m of this.objects){if(!m.visible)continue;let y=m.ghostOpacity;if(c&&y<=0)continue;let p=this.gpuFor(e,m,r,a);if(!p)continue;let b=s?t.shadowObjectMatrix(m.originX,m.originY,m.altitude):null,g=t.objectMatrix(m.originX,m.originY,m.altitude);for(let{part:v,vao:x,ibo:C}of p.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let S=c?Oc(v.color,y):v.color;if(v.kind==="fill")h!==o&&(o.use(),l?.(o),h=o),o.setVec4v("u_color",_e(S)),b&&o.setMat4("u_shadow_matrix",b),o.setMat4("u_matrix",g);else {h!==n&&(n.use(),l?.(n),h=n);let M=v.width/2*u,w=d>1e-9?1/d:1;if(n.setVec4v("u_color",_e(S)),n.setFloat("u_half_width",M),n.setFloat("u_offset",(v.offset??0)*u),n.setFloat("u_aa",1),n.setFloat("u_units_per_px",w),n.setFloat("u_units_to_px",d),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[_,T]=v.dashArray;n.setVec2("u_dash",_*u,(_+T)*u);}if(v.arrow){n.setVec4v("u_arrow_color",_e(v.arrowColor??[1,1,1,1]));let _=(v.arrowSize??5)*u;n.setVec3("u_arrow",(v.arrowPeriod??46)*u,Math.max(_*.4,1),Math.min(_,M*.72));}b&&n.setMat4("u_shadow_matrix",b),n.setMat4("u_matrix",g);}x.bind(),e.gl.drawElements(e.gl.TRIANGLES,C.count,C.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=(a,l,s)=>e.worldPxToPoint(oe(a)*r,re(l)*r,s);for(let a=this.objects.length-1;a>=0;a--){let l=this.objects[a];if(l.visible&&l.hitTest(t,n,o))return l}return null}boundsOf(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e.rings())for(let l of a){let s=Z(l);s.lng<t&&(t=s.lng),s.lng>r&&(r=s.lng),s.lat<o&&(o=s.lat),s.lat>n&&(n=s.lat);}return isFinite(t)?{west:t,south:o,east:r,north:n}:null}gpuFor(e,t,o,r){let n=this.gpu.get(t.id);if(n&&n.revision===t.revision)return n;n?.destroy();let a=[];for(let s of t.build()){let c=s.kind==="fill"?Hc:Or,f=s.kind==="fill"?o:r,u=new ye(e,new Uint8Array(s.mesh.vertices),c),d=new he(e,s.mesh.indices),h=new ue(e,[{buffer:u,locations:f}],d);a.push({part:s,vao:h,vbo:u,ibo:d});}let l=new Hr(t.revision,a);return this.gpu.set(t.id,l),a.length?l:null}destroy(){for(let e of this.gpu.values())e.destroy();this.gpu.clear();for(let e of this.markers)e.detach();this.markers=[],this.objects=[];}};var Lo=32,Wc=1179937895,Bc=1313821514,Vc=5130562,Dc={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Gc={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function Wr(i){let{json:e,bin:t}=Fa(i),o=await Uc(e,t);return za(e,t,o)}function Nc(i){let{json:e,bin:t}=Fa(i);for(let o of e.bufferViews??[])if(o.extensions?.EXT_meshopt_compression)throw new Error("[osmgl] GLB \u0441\u0436\u0430\u0442 meshopt \u2014 \u043D\u0443\u0436\u0435\u043D parseGlbAsync");return za(e,t,null)}function Fa(i){let e=new DataView(i);if(e.getUint32(0,true)!==Wc)throw new Error("[osmgl] \u044D\u0442\u043E \u043D\u0435 GLB: \u043D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0438\u0433\u043D\u0430\u0442\u0443\u0440\u0430");if(e.getUint32(4,true)!==2)throw new Error("[osmgl] \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E glTF 2.0");let t=null,o=null,r=12;for(;r+8<=i.byteLength;){let n=e.getUint32(r,true),a=e.getUint32(r+4,true),l=r+8;a===Bc?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,l,n))):a===Vc&&(o=new Uint8Array(i,l,n)),r=l+n+(4-n%4)%4;}if(!t)throw new Error("[osmgl] \u0432 GLB \u043D\u0435\u0442 JSON-\u043A\u0443\u0441\u043A\u0430");return {json:t,bin:o??new Uint8Array(0)}}async function Uc(i,e){let t=i.bufferViews??[],o=[];for(let a=0;a<t.length;a++)t[a].extensions?.EXT_meshopt_compression&&o.push(a);if(!o.length)return null;let{MeshoptDecoder:r}=await import('meshoptimizer');await r.ready;let n=new Map;for(let a of o){let l=t[a].extensions.EXT_meshopt_compression,s=l.byteOffset??0,c=e.subarray(s,s+l.byteLength),f=new Uint8Array(l.count*l.byteStride);r.decodeGltfBuffer(f,l.count,l.byteStride,c,l.mode,l.filter??"NONE"),n.set(a,f);}return n}function Ra(i){let e=N();if(i.matrix){for(let w=0;w<16;w++)e[w]=i.matrix[w];return e}Oe(e);let[t,o,r]=i.translation??[0,0,0],[n,a,l,s]=i.rotation??[0,0,0,1],[c,f,u]=i.scale??[1,1,1],d=n+n,h=a+a,m=l+l,y=n*d,p=n*h,b=n*m,g=a*h,v=a*m,x=l*m,C=s*d,S=s*h,M=s*m;return e[0]=(1-(g+x))*c,e[1]=(p+M)*c,e[2]=(b-S)*c,e[4]=(p-M)*f,e[5]=(1-(y+x))*f,e[6]=(v+C)*f,e[8]=(b+S)*u,e[9]=(v-C)*u,e[10]=(1-(y+g))*u,e[12]=t,e[13]=o,e[14]=r,e}var jc={5120:127,5121:255,5122:32767,5123:65535};function Xc(i){let e=i[0],t=i[1],o=i[2],r=i[4],n=i[5],a=i[6],l=i[8],s=i[9],c=i[10],f=e*(n*c-a*s)-r*(t*c-o*s)+l*(t*a-o*n);if(Math.abs(f)<1e-20)return [1,0,0,0,1,0,0,0,1];let u=1/f;return [(n*c-a*s)*u,(a*l-r*c)*u,(r*s-n*l)*u,(o*s-t*c)*u,(e*c-o*l)*u,(t*l-e*s)*u,(t*a-o*n)*u,(o*r-e*a)*u,(e*n-t*r)*u]}function za(i,e,t){let o=w=>{let _=t?.get(w);if(_)return _;let T=i.bufferViews?.[w];if(!T)return null;let L=T.byteOffset??0;return e.subarray(L,L+T.byteLength)},r=[],n=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],u=w=>{if(w===void 0)return null;let _=i.accessors?.[w];if(!_)return null;let T=Gc[_.type]??1,L=new Float64Array(_.count*T),k=_.bufferView!==void 0?i.bufferViews?.[_.bufferView]:void 0;if(!k||_.bufferView===void 0)return {data:L,components:T};let z=o(_.bufferView);if(!z)return {data:L,components:T};let A=Dc[_.componentType]??4,I=k.extensions?.EXT_meshopt_compression,E=I?I.byteStride:k.byteStride,F=E&&E>0?E:A*T,P=_.byteOffset??0,R=new DataView(z.buffer,z.byteOffset,z.byteLength),W=_.normalized?jc[_.componentType]??1:1;for(let G=0;G<_.count;G++)for(let O=0;O<T;O++){let H=P+G*F+O*A,D;switch(_.componentType){case 5120:D=R.getInt8(H);break;case 5121:D=R.getUint8(H);break;case 5122:D=R.getInt16(H,true);break;case 5123:D=R.getUint16(H,true);break;case 5125:D=R.getUint32(H,true);break;default:D=R.getFloat32(H,true);}L[G*T+O]=W===1?D:Math.max(D/W,-1);}return {data:L,components:T}},d=(w,_,T=-1)=>{if(w.mode!==void 0&&w.mode!==4)return;let L=u(w.attributes.POSITION);if(!L)return;let k=u(w.attributes.NORMAL),z=u(w.attributes.TEXCOORD_0),A=u(w.indices),I=r.length/3,E=L.data.length/3,F=Xc(_),R=(w.material!==void 0?i.materials?.[w.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,W=R?{ox:R.offset?.[0]??0,oy:R.offset?.[1]??0,sx:R.scale?.[0]??1,sy:R.scale?.[1]??1,rot:R.rotation??0}:null;for(let X=0;X<E;X++){let te=L.data[X*3],ie=L.data[X*3+1],q=L.data[X*3+2],U=_[0]*te+_[4]*ie+_[8]*q+_[12],j=_[1]*te+_[5]*ie+_[9]*q+_[13],le=_[2]*te+_[6]*ie+_[10]*q+_[14];if(r.push(U,j,le),U<c[0]&&(c[0]=U),j<c[1]&&(c[1]=j),le<c[2]&&(c[2]=le),U>f[0]&&(f[0]=U),j>f[1]&&(f[1]=j),le>f[2]&&(f[2]=le),k){let ne=k.data[X*3],ge=k.data[X*3+1],Ee=k.data[X*3+2],ve=F[0]*ne+F[3]*ge+F[6]*Ee,ro=F[1]*ne+F[4]*ge+F[7]*Ee,no=F[2]*ne+F[5]*ge+F[8]*Ee,io=Math.hypot(ve,ro,no);io>1e-12?(ve/=io,ro/=io,no/=io):(ve=0,ro=1,no=0),n.push(ve,ro,no);}else n.push(0,1,0);let ae=z?z.data[X*2]:0,se=z?z.data[X*2+1]:0;if(W){if(W.rot!==0){let ne=Math.cos(W.rot),ge=Math.sin(W.rot),Ee=ne*ae+ge*se,ve=-ge*ae+ne*se;ae=Ee,se=ve;}ae=ae*W.sx+W.ox,se=se*W.sy+W.oy;}a.push(ae,se);}let G=l.length;if(A)for(let X=0;X<A.data.length;X++)l.push(I+A.data[X]);else for(let X=0;X<E;X++)l.push(I+X);let O=w.material!==void 0?i.materials?.[w.material]:void 0,H=O?.pbrMetallicRoughness,D=H?.metallicFactor!==void 0||H?.roughnessFactor!==void 0,Y=H?.baseColorFactor??[1,1,1,1],$=H?.baseColorTexture?.index,Q=$!==void 0?i.textures?.[$]?.source:void 0,de=O?.emissiveFactor??[0,0,0],J=O?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:G,indexCount:l.length-G,baseColor:[Y[0],Y[1],Y[2],Y[3]??1],metallic:D?H?.metallicFactor??1:0,roughness:D?H?.roughnessFactor??1:1,emissive:[de[0]*J,de[1]*J,de[2]*J],texture:Q??-1,doubleSided:O?.doubleSided===true,blend:O?.alphaMode==="BLEND",alphaCutoff:O?.alphaMode==="MASK"?O.alphaCutoff??.5:.02,node:T});},h=i.skins?.length?null:Yc(i,u),m=h?h.nodes:null,y=(w,_,T,L)=>{let k=i.nodes?.[w];if(!k)return;let z=Ra(k),A=N();xe(A,_,z);let I=N(),E=L,F=m?.get(w);if(F?(F.parentNode=L,F.parent=T.slice(),Oe(I),E=w):xe(I,T,z),k.mesh!==void 0)for(let R of i.meshes?.[k.mesh]?.primitives??[])d(R,I,E);let P=k.extensions?.KHR_lights_punctual?.light;if(P!==void 0){let R=i.extensions?.KHR_lights_punctual?.lights?.[P],W=R?.type;if(R&&(W==="point"||W==="spot"||W==="directional")){let G=-A[8],O=-A[9],H=-A[10],D=Math.hypot(G,O,H)||1,Y=R.spot?.innerConeAngle??0,$=R.spot?.outerConeAngle??Math.PI/4;p.push({type:W,color:[R.color?.[0]??1,R.color?.[1]??1,R.color?.[2]??1],intensity:R.intensity??1,range:R.range??0,position:[A[12],A[13],A[14]],direction:[G/D,O/D,H/D],cosInner:Math.cos(Y),cosOuter:Math.cos($)});}}for(let R of k.children??[])y(R,A,I,E);},p=[],b=N();Oe(b);let g=N();Oe(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((w,_)=>_)??[];for(let w of v)y(w,b,g,-1);let x=[];for(let w of i.images??[]){if(w.bufferView===void 0){x.push(new Uint8Array(0));continue}let _=o(w.bufferView);x.push(_?_.slice():new Uint8Array(0));}let C=r.length/3,S=new ArrayBuffer(C*Lo),M=new Float32Array(S);for(let w=0;w<C;w++){let _=w*8;M[_]=r[w*3],M[_+1]=r[w*3+1],M[_+2]=r[w*3+2],M[_+3]=n[w*3],M[_+4]=n[w*3+1],M[_+5]=n[w*3+2],M[_+6]=a[w*2],M[_+7]=a[w*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,f[0]=f[1]=f[2]=0),{vertices:S,indices:new Uint32Array(l),primitives:s,images:x,min:c,max:f,animation:h,lights:p}}function Yc(i,e){let t=i.animations?.[0];if(!t||!t.channels.length)return null;let o=new Map,r=0;for(let n of t.channels){let a=n.target.node,l=n.target.path;if(a===void 0||l!=="translation"&&l!=="rotation"&&l!=="scale")continue;let s=t.samplers[n.sampler];if(!s)continue;let c=e(s.input),f=e(s.output);if(!c||!f||!c.data.length)continue;let u=l==="rotation"?4:3,d=s.interpolation==="CUBICSPLINE",h=c.data.length,m=new Float32Array(h*u);for(let p=0;p<h;p++){let b=d?(p*3+1)*u:p*u;for(let g=0;g<u;g++)m[p*u+g]=f.data[b+g];}let y=o.get(a)??{parentNode:-1,parent:Oe(N()),base:Kc(i.nodes?.[a]),channels:[]};y.channels.push({path:l,times:Float32Array.from(c.data),values:m,step:s.interpolation==="STEP"}),o.set(a,y),r=Math.max(r,c.data[h-1]);}return o.size?{duration:r||1,nodes:o}:null}function Kc(i){let e=i?.translation,t=i?.rotation,o=i?.scale;return {t:[e?.[0]??0,e?.[1]??0,e?.[2]??0],r:[t?.[0]??0,t?.[1]??0,t?.[2]??0,t?.[3]??1],s:[o?.[0]??1,o?.[1]??1,o?.[2]??1]}}function Br(i,e,t,o){let r=i.nodes.get(e);if(!r)return Oe(o);let n=N();$c(r,t,n);let a=N();if(xe(a,r.parent,n),r.parentNode<0)return Pa(o,a);let l=N();return Br(i,r.parentNode,t,l),xe(o,l,a)}var Pa=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function $c(i,e,t){let o=[...i.base.t],r=[...i.base.r],n=[...i.base.s];for(let a of i.channels){let l=a.times.length,s=a.path==="rotation"?4:3,c=0;for(;c<l-1&&a.times[c+1]<e;)c++;let f=Math.min(c+1,l-1),u=a.times[f]-a.times[c],d=a.step||u<=0?0:Math.min(Math.max((e-a.times[c])/u,0),1),h=c*s,m=f*s;if(a.path==="rotation"){let y=0;for(let g=0;g<4;g++)y+=a.values[h+g]*a.values[m+g];let p=y<0?-1:1,b=0;for(let g=0;g<4;g++)r[g]=a.values[h+g]*(1-d)+a.values[m+g]*p*d,b+=r[g]*r[g];b=Math.sqrt(b)||1;for(let g=0;g<4;g++)r[g]/=b;}else {let y=a.path==="translation"?o:n;for(let p=0;p<3;p++)y[p]=a.values[h+p]*(1-d)+a.values[m+p]*d;}}return Pa(t,Ra({translation:o,rotation:r,scale:n}))}var Te=5126,qc=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Ha={stride:Lo,attribs:[{name:"a_pos",size:3,type:Te,offset:0},{name:"a_normal",size:3,type:Te,offset:12},{name:"a_tex",size:2,type:Te,offset:24}]},Dr=class{constructor(e,t,o,r){this.vao=e;this.vbo=t;this.ibo=o;this.textures=r;this.users=0;this.instVao=null;}destroy(e){this.vao.destroy(),this.instVao?.destroy(),this.vbo.destroy(),this.ibo.destroy();for(let t of this.textures)t&&e.deleteTexture(t);}},Vr=256,Io=41,Oa={stride:Io*4,attribs:[{name:"a_i_m0",size:4,type:Te,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Te,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Te,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Te,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Te,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Te,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Te,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Te,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Te,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Te,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Te,offset:152,divisor:1}]},Vt=2,bt=16,Ye=class{constructor(){this.models=[];this.gpu=new B;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Vr*Io);this.drawnInstanced=new Set;this.onLoaded=null;this.growDurationSec=.45;this.fadeDurationSec=.6;this.transitioning=false;this.depthTimeSec=0;this.lightPacks=new WeakMap;this.shadow32=new Float32Array(16);this.shadowNode32=new Float32Array(16);this.shadowNodeColor32=new Float32Array(16);}add(e){this.models.includes(e)||(this.models.push(e),e.isLoaded||e.load(()=>this.onLoaded?.()));}remove(e,t){let o=this.models.indexOf(e);if(o<0)return;this.models.splice(o,1);let r=this.gpu.get(e.url);r&&(this.counted.delete(e)&&r.users--,!(r.users>0)&&(t&&r.destroy(t),this.gpu.delete(e.url)));}get all(){return this.models}get hasTransitions(){return this.transitioning}get hasAnimated(){return this.models.some(e=>e.isAnimated)}get isEmpty(){return this.models.length===0}get readyCount(){return this.models.filter(e=>e.visible&&e.isLoaded).length}render(e,t,o,r,n,a,l=0,s){if(this.models.length){this.drawnInstanced.clear(),s&&this.renderInstanced(e,t,s.shader,s.locations,n,a),o.use(),n(o),o.setInt("u_base_texture",Vt);for(let c of this.models){if(this.drawnInstanced.has(c)||!this.inView(t,c))continue;let f=c.visible&&c.fade>0?this.gpuFor(e,c,r):null;if(!f||!c.mesh)continue;let u=c.fade<1;o.setFloat("u_opacity",c.fade);let d=c.matrixFor(t);o.setMat4("u_matrix",d),o.setMat3("u_normal_matrix",c.normalMatrix());let h=a?this.shadowMatrix(t,c):null;this.uploadLights(o,c.mesh);let m=c.cameraInModelSpace(t);o.setVec3("u_camera_model",m[0],m[1],m[2]),o.setFloat("u_reflect",1),f.vao.bind();for(let y of [false,true])if(!(u&&!y))for(let p of c.mesh.primitives){if(!u&&p.blend!==y)continue;o.setMat4("u_matrix",p.node>=0?c.matrixForNode(t,p.node,l):d),h&&o.setMat4("u_shadow_matrix",p.node>=0?this.shadowMatrixForNodeAt(t,c,p.node,l):h);let b=p.texture>=0?f.textures[p.texture]:null;o.setFloat("u_has_texture",b?1:0),o.setFloat("u_alpha_cutoff",p.alphaCutoff),b&&e.bindTexture(Vt,b),o.setVec4v("u_base_color",p.baseColor),o.setVec3("u_emissive",p.emissive[0],p.emissive[1],p.emissive[2]),o.setFloat("u_metallic",p.metallic),o.setFloat("u_roughness",p.roughness),e.setCull(p.doubleSided?"none":"back"),e.setBlend(y?"premultiplied":"none"),e.setDepthMask(!y),e.gl.drawElements(e.gl.TRIANGLES,p.indexCount,e.gl.UNSIGNED_INT,p.indexOffset*4);}}e.bindVAO(null),e.setCull("back"),e.setBlend("premultiplied"),e.setDepthMask(true);}}renderInstanced(e,t,o,r,n,a){let l=new B;for(let c of this.models){if(!c.visible||c.fade<1||!c.mesh||!c.isLoaded||!this.inView(t,c)||c.mesh.primitives.some(u=>u.blend||u.node>=0))continue;let f=l.get(c.url);f?f.push(c):l.set(c.url,[c]);}let s=false;o.setFloat("u_reflect",0);for(let[,c]of l){if(c.length<2)continue;let f=this.gpuFor(e,c[0],r);if(!f||!c[0].mesh)continue;this.instBuffer||(this.instBuffer=new ye(e,this.instScratch,Oa,true)),f.instVao||(f.instVao=new ue(e,[{buffer:f.vbo,locations:r},{buffer:this.instBuffer,locations:r}],f.ibo)),s||(o.use(),n(o),o.setInt("u_base_texture",Vt),o.setFloat("u_opacity",1),s=true);let u=c[0].mesh;for(let d=0;d<c.length;d+=Vr){let h=Math.min(Vr,c.length-d);for(let m=0;m<h;m++){let y=c[d+m],p=m*Io;this.instScratch.set(y.matrixFor(t),p);let b=a?this.shadowMatrix(t,y):qc;this.instScratch.set(b,p+16),this.instScratch.set(y.normalMatrix(),p+32),this.drawnInstanced.add(y);}this.instBuffer.update(this.instScratch.subarray(0,h*Io)),e.bindVAO(f.instVao.vao);for(let m of u.primitives){let y=m.texture>=0?f.textures[m.texture]:null;o.setFloat("u_has_texture",y?1:0),o.setFloat("u_alpha_cutoff",m.alphaCutoff),y&&e.bindTexture(Vt,y),o.setVec4v("u_base_color",m.baseColor),o.setVec3("u_emissive",m.emissive[0],m.emissive[1],m.emissive[2]),o.setFloat("u_metallic",m.metallic),o.setFloat("u_roughness",m.roughness),e.setCull(m.doubleSided?"none":"back"),e.setBlend("none"),e.setDepthMask(true),e.gl.drawElementsInstanced(e.gl.TRIANGLES,m.indexCount,e.gl.UNSIGNED_INT,m.indexOffset*4,h);}}}s&&e.bindVAO(null);}uploadLights(e,t){let o=this.lightPacks.get(t);if(!o){let r=t.lights.filter(f=>f.type!=="directional"),n=r.length<=bt?r:[...r].sort((f,u)=>u.intensity-f.intensity).slice(0,bt),a=new Float32Array(bt*4),l=new Float32Array(bt*4),s=new Float32Array(bt*4),c=new Float32Array(bt*4);n.forEach((f,u)=>{let d=u*4;a[d]=f.position[0],a[d+1]=f.position[1],a[d+2]=f.position[2],a[d+3]=f.range,l[d]=f.color[0]*f.intensity,l[d+1]=f.color[1]*f.intensity,l[d+2]=f.color[2]*f.intensity,l[d+3]=f.type==="spot"?1:0,s[d]=f.direction[0],s[d+1]=f.direction[1],s[d+2]=f.direction[2],c[d]=f.cosInner,c[d+1]=f.cosOuter;}),o={count:n.length,pos:a,color:l,dir:s,cone:c},this.lightPacks.set(t,o);}e.setInt("u_light_count",o.count),o.count!==0&&(e.setVec4Array("u_light_pos",o.pos),e.setVec4Array("u_light_color",o.color),e.setVec4Array("u_light_dir",o.dir),e.setVec4Array("u_light_cone",o.cone));}inView(e,t){if(!t.mesh)return false;let r=t.origin(),n=t.boundingRadiusM();return e.isSphereVisible(r.x,r.y,t.altitude+n*.5,n)}advanceTransitions(){this.transitioning=false;for(let e of this.models)e.advanceGrow(this.growDurationSec)&&(this.transitioning=true),e.advanceFade(this.fadeDurationSec)&&(this.transitioning=true);}renderDepth(e,t,o,r){if(this.models.length){o.use();for(let n of this.models){let a=n.visible&&n.fade>.5?this.gpuFor(e,n,r):null;if(!a||!n.mesh)continue;let l=this.shadowMatrix(t,n);o.setMat4("u_matrix",l),a.vao.bind();for(let s of n.mesh.primitives)s.blend||(o.setMat4("u_matrix",s.node>=0?this.shadowMatrixForNode(t,n,s.node):l),e.gl.drawElements(e.gl.TRIANGLES,s.indexCount,e.gl.UNSIGNED_INT,s.indexOffset*4));}e.bindVAO(null);}}shadowMatrix(e,t){let o=t.origin();return t.matrixInSpace(e.shadowObjectMatrix(o.x,o.y,t.altitude),this.shadow32)}shadowMatrixForNode(e,t,o){return this.shadowMatrixForNodeInto(e,t,o,this.depthTimeSec,this.shadowNode32)}shadowMatrixForNodeAt(e,t,o,r){return this.shadowMatrixForNodeInto(e,t,o,r,this.shadowNodeColor32)}shadowMatrixForNodeInto(e,t,o,r,n){let a=t.origin();return t.matrixInSpaceForNode(e.shadowObjectMatrix(a.x,a.y,t.altitude),o,r,n)}gpuFor(e,t,o){let r=this.gpu.get(t.url);if(r)return this.counted.has(t)||(this.counted.add(t),r.users++),r;if(!t.mesh)return null;let n=e.gl,a=new ye(e,new Uint8Array(t.mesh.vertices),Ha),l=new he(e,t.mesh.indices),s=new ue(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(u=>{if(!u)return null;let d=n.createTexture();return d?(e.bindTexture(Vt,d),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,u),n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.REPEAT),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.REPEAT),d):null}),f=new Dr(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return Ha}static get instanceLayout(){return Oa}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Gr=4,Wa=new ee;function Zc(i){Wa.has(i)||(Wa.add(i),console.warn(`[osmgl] ${i}`));}var Qc=.5,Jc=.01,ef=300,Nr=127,Ur=128,Dt=5120,Ro=5121,Gt=5122,Ba=5123,Nt=5126,tf={stride:8,attribs:[{name:"a_pos",size:2,type:Nt,offset:0}]},jr={stride:Ue,attribs:[{name:"a_pos",size:2,type:Gt,offset:0}]},Va={stride:je,attribs:[{name:"a_p0",size:2,type:Gt,offset:0},{name:"a_p1",size:2,type:Gt,offset:4},{name:"a_corner",size:2,type:Dt,offset:8},{name:"a_ground",size:2,type:Dt,offset:10},{name:"a_dist",size:1,type:Nt,offset:12},{name:"a_width",size:1,type:Nt,offset:16}]},Fo={stride:Me,attribs:[{name:"a_pos",size:2,type:Gt,offset:0},{name:"a_height",size:1,type:Ba,offset:4},{name:"a_tint",size:1,type:Ro,normalized:true,offset:6},{name:"a_ao",size:1,type:Ro,normalized:true,offset:7},{name:"a_normal",size:3,type:Dt,normalized:true,offset:8},{name:"a_kind",size:1,type:Ro,offset:11},{name:"a_wall",size:3,type:Ba,offset:12}]},of={flat:0,water:1,foliage:2,sand:3,asphalt:4},rf=[1,9,14,26,3],Da={stride:ct,attribs:[{name:"a_pos",size:2,type:Nt,offset:0},{name:"a_level",size:1,type:Gt,offset:8},{name:"a_normal",size:3,type:Dt,normalized:true,offset:10},{name:"a_kind",size:1,type:Ro,offset:13},{name:"a_bleed",size:2,type:Dt,offset:14}]},Xr=class{constructor(e,t,o,r,n,a,l=r){this.vao=e;this.buffer=t;this.ibo=o;this.indexCount=r;this.indexType=n;this.extent=a;this.capIndexOffset=l;this.firstDrawTime=0;}destroy(){this.vao.destroy(),this.buffer.destroy(),this.ibo.destroy();}},Ga={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Ut=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new B;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new To;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new B;this.lineLocs=new B;this.objectLine=null;this.objectLineLocs=new B;this.buildingLocs=new B;this.shadows={...Ga};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new B;this.patternScale=1;this.cameraMeters=[0,0,0];this.dpr=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new B;this.highlightKey="";this.groundArrows=new Pt;this.highlightTris=new B;this.fillHighlightGpu=new B;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Ht;this.hiddenBuildings=new Set;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new B;this.hiddenStamp="";this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new Ye;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new B;this.modelInstLocs=new B;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=o=>[...o].sort((r,n)=>r-n).join(","),t=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues);if(t!==this.hiddenStamp){this.hiddenStamp=t;for(let o of this.hiddenCut.values())o?.vao.destroy(),o?.ibo.destroy();this.hiddenCut.clear();}}hiddenFor(e,t){return t?this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.hiddenCut.get(l);if(s!==void 0&&(s===null||s.vbo===n))return s;s&&(s.vao.destroy(),s.ibo.destroy());let c=t.data?.buckets?.[o];if(!c||c.kind!=="fill-extrusion"||!c.featureIds)return null;let f=new Uint32Array(c.indices),u=new Float64Array(c.featureIds),d=[];for(let m=0;m*3<f.length;m++)a.has(u[m])||d.push(f[m*3],f[m*3+1],f[m*3+2]);let h=null;if(d.length<f.length){let m=new he(e,new Uint32Array(d));h={vao:new ue(e,[{buffer:n,locations:this.buildingLocs}],m),ibo:m,count:d.length,vbo:n};}return this.hiddenCut.set(l,h),h}init(e){this.symbols?.init(e),this.fill=new me(e,"fill",ha,ma),this.surface=new me(e,"surface",xa,_a),this.line=new me(e,"line",pa,ba),this.objectLine=new me(e,"objectLine",ya,ga),this.building=new me(e,"buildings",va,wa),this.depth=new me(e,"depth",oa,Sr),this.groundShadow=new me(e,"groundShadow",ua,da),this.sky=new me(e,"sky",la,sa),this.raster=new me(e,"raster",ca,fa),this.globeBody=new me(e,"globeBody",Qi,Ji),this.globeClip=new me(e,"globeClip",ea,ta),this.globeMesh=nf(e,this.globeBody),this.model=new me(e,"model",na,Mr),this.modelInstanced=new me(e,"model-instanced",ia,Mr),this.modelDepth=new me(e,"modelDepth",aa,Sr);for(let n of Ye.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...Ye.layout.attribs,...Ye.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=qi(e);let t=new B([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new ye(e,new Float32Array([0,0,1,0,1,1,0,1]),tf),r=new he(e,new Uint16Array([0,1,2,0,2,3]));this.quad={vao:new ue(e,[{buffer:o,locations:t}],r),vbo:o,ibo:r};for(let n of jr.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of Da.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of Va.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of Or.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of Fo.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));}render(e,t,o,r,n,a=new B){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=n/1e3,this.materialAnimating=false,this.fog=mt(t,r),this.patternScale=so/Math.max(Le(t.center.lat),1),this.dpr=t.width>0?e.gl.drawingBufferWidth/t.width:1;let c=Math.max(t.pixelsPerMeter,1e-9),f=t.cameraPositionPx;this.cameraMeters=[f[0]/c,f[1]/c,f[2]/c];let u=p=>o.get(p.source??K);this.syncHighlightFootprint(o,r),this.indoorMask.sync(o,r,l),this.syncHiddenStamp(),this.models.advanceTransitions(),this.renderShadowMap(e,t,o,r,n),this.drawSky(e,t,r),this.drawGlobeBody(e,t,r),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l),this.drawTileStencil(e,t,o),e.setDepthTest(t.globeActive),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let d=p=>p.type==="line"&&V(p.paint.elevation,l,0)!==0,h=new Set;for(let p of r.layers){if(p.type==="raster"||p.type==="fill-extrusion"||p.type==="symbol"||p.overlay||d(p)||!r.layerVisibleAt(p,l))continue;let b=u(p);if(b){if(p.type==="line"&&p.network){if(h.has(p.network))continue;h.add(p.network),this.drawNetwork(e,t,r,u,p.network,l,g=>!g.overlay&&!d(g)&&r.layerVisibleAt(g,l));continue}if(p.type==="surface"){if(!this.flattened(b,r,p))continue;this.drawFill(e,t,b,r,p,l);continue}p.type==="fill"?this.drawFill(e,t,b,r,p,l):this.drawLine(e,t,b,r,p,l);}}this.drawFillHighlight(e,t,o,r),this.groundArrows&&(this.groundArrows.highlightFootprint=this.highlightFootprint(),this.groundArrows.render(e,t,o,r,this.fill,this.fillLocs,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.setVec2("u_world_origin",0,0);},this.shadowActive)),this.drawGroundShadow(e,t,o,r),this.drawEarthDepth(e,t,o,r),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("lequal"),e.setCull("back");for(let p of r.layers){if(p.type!=="surface"||p.overlay||!r.layerVisibleAt(p,l))continue;let b=u(p);b&&(this.flattened(b,r,p)||this.drawSurface(e,t,b,r,p,l));}e.setStencilTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),e.setDepthTest(false);let m=new Set;for(let p of r.layers){if(p.type==="raster"||!d(p)||p.overlay||!r.layerVisibleAt(p,l))continue;let b=u(p);if(b){if(p.type==="line"&&p.network){if(m.has(p.network))continue;m.add(p.network),this.drawNetwork(e,t,r,u,p.network,l,g=>!g.overlay&&d(g)&&r.layerVisibleAt(g,l));continue}this.drawLine(e,t,b,r,p,l);}}this.drawOverlay(e,t,r,u,l,"roads"),e.setDepthTest(true),e.setDepthMask(true),e.setCull("back");for(let p of r.layers){if(p.type!=="fill-extrusion"||!r.layerVisibleAt(p,l))continue;let b=u(p);b&&(this.drawBuildings(e,t,b,r,p,l,n)&&(s=true),this.drawHighlight(e,t,b,r,p,l));}this.model&&!this.models.isEmpty&&(this.models.render(e,t,this.model,this.modelLocs,p=>{this.applyShadowUniforms(p),this.applyFogUniforms(p,t,r),this.applyLight(p,r);},this.shadowActive,n/1e3,this.modelInstanced?{shader:this.modelInstanced,locations:this.modelInstLocs}:void 0),(this.models.hasAnimated||this.models.hasTransitions)&&(s=true)),this.drawOverlay(e,t,r,u,l,"volume"),this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.setVec2("u_world_origin",0,0);},this.shadowActive),e.setDepthTest(false)),this.raster&&this.quad&&this.rasterLayer.render(e,t,this.quad.vao,this.raster,r,a,l,true);let y=r.layers.filter(p=>p.type==="line"&&V(p.paint.ghostOpacity,l,0)>.001&&r.layerVisibleAt(p,l));if(y.length){e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");for(let p of y){let b=u(p);b&&this.drawLine(e,t,b,r,p,l,V(p.paint.ghostOpacity,l,0));}e.setDepthFunc("lequal"),e.setDepthTest(false);}return this.objects&&!this.objects.isEmpty&&(e.setDepthTest(true),e.setDepthFunc("greater"),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.objects.render(e,t,this.fill,this.fillLocs,this.objectLine,this.objectLineLocs,p=>{this.applyFogUniforms(p,t,r),p.setVec4("u_globe",0,0,0,0),p.setInt("u_material",0),p.setFloat("u_elevation",0),p.setVec2("u_world_origin",0,0);},this.shadowActive,true),e.setDepthFunc("lequal"),e.setDepthTest(false)),this.symbols&&(this.symbols.highlightFootprint=this.highlightFootprint()),this.symbols?.render(e,t,o,r),e.bindVAO(null),s||this.materialAnimating}renderShadowMap(e,t,o,r,n){if(this.shadowPlaceholder&&e.bindTexture(Gr,this.shadowPlaceholder),this.shadowActive=false,!this.shadows.enabled||!this.allowShadows||!this.depth)return;let a=r.layers.filter(u=>u.type==="fill-extrusion"&&!u.overlay&&r.layerVisibleAt(u,t.zoom));if(!a.length&&this.models.isEmpty)return;this.shadowTarget?this.shadowTarget.resize(this.shadows.resolution):this.shadowTarget=new Rt(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(yt(l.keyAzimuth,l.keyAltitude),ef),!t.shadowReady)return;let s=this.shadowTarget;s.bind(),e.setDepthFunc("lequal"),e.setBlend("none"),e.setCull("none");let c=e.gl;c.enable(c.POLYGON_OFFSET_FILL),c.polygonOffset(2,4);let f=this.depth;f.use();for(let u of a){let d=o.get(u.source??K);if(!d)continue;let h=r.bucketKeyFor(u);if(h===null)continue;let m=V(u.paint.heightScale,t.zoom,1);(u.source??K)===K&&this.indoorMask.prepare(d,h);for(let y of d.visibleTiles){if(!this.drawsTile(t,r,u,y))continue;let p=d.getTile(y),b=p&&this.bucketFor(e,p,h,Fo,this.buildingLocs,"fill-extrusion");if(!b)continue;f.setFloat("u_height_scale",this.growScale(b,n,!d.warm)*m),f.setMat4("u_matrix",t.shadowTileMatrix(y,b.extent));let g=(u.source??K)===K,v=this.cutHidden(e,p,h,y.dataKey,b.buffer,this.hiddenFor(h,g)),x=g?v??this.indoorMask.indicesFor(e,p,h,y,b.buffer,this.buildingLocs):v;x?(x.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,e.gl.UNSIGNED_INT,0)):(b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.indexCount,b.indexType,0));}}this.modelDepth&&(this.models.depthTimeSec=n/1e3,e.gl.polygonOffset(6,96),this.models.renderDepth(e,t,this.modelDepth,this.modelLocs),e.gl.polygonOffset(2,4)),c.disable(c.POLYGON_OFFSET_FILL),e.bindFramebuffer(null),e.viewport(0,0,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),s.bindTexture(Gr),this.shadowDepthPerMeter=t.shadowDepthPerMeter(),this.shadowTexelMeters=Math.abs(t.shadowTexelWorldSize(s.size))/(t.pixelsPerMeter||1),this.shadowActive=true;}drawGlobeBody(e,t,o){if(!t.globeActive||!this.globeBody||!this.globeMesh)return;let r=this.globeBody;r.use(),this.applyGlobeUniforms(r,t,o),r.setMat4("u_matrix",t.localMatrix());let n=o.background;r.setVec3("u_body_color",n[0],n[1],n[2]),Fe(r,"u_atmo_color",o.sky.horizonColor),r.setFloat("u_atmo_strength",o.sky.enabled?1-t.globeFlatMix:0),e.setBlend("none"),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("less"),e.setCull("none"),this.globeMesh.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,this.globeMesh.count,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null),this.drawGlobeClip(e,t),e.setBlend("premultiplied"),e.setDepthTest(false),e.setDepthMask(false);}drawGlobeClip(e,t){if(!this.globeClip||!this.quad)return;let o=e.gl,r=[0,0,-t.globeRadiusPx,1],n=[0,0,0,0];if(fe(n,t.localProjMatrix,r),n[3]<=1e-6)return;let a=this.globeClip;a.use(),a.setFloat("u_center_depth",n[2]/n[3]),o.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthMask(true),e.setDepthFunc("always"),this.quad.vao.bind(),o.drawElements(o.TRIANGLES,6,o.UNSIGNED_SHORT,0),o.colorMask(true,true,true,true),e.bindVAO(null);}applyAtmosphere(e,t,o){let r=t.cameraRay();e.setVec3("u_cam_ray",r.axisElev,r.focal*this.dpr,t.height*this.dpr/2),e.setFloat("u_haze_exp",1/Math.max(o.sky.horizonBlend,.01));}skyBand(e,t){let o=e.horizonScreenY(),r=e.height*this.dpr/Math.max(Ae(e.fov),.001);return [(e.height-o)*this.dpr,Math.max(o,1)*this.dpr,Math.max(t.sky.horizonBlend*r,1)]}drawSky(e,t,o){if(!this.sky||!this.quad||!o.sky.enabled)return;let r=this.sky;r.use(),Fe(r,"u_sky_color",o.sky.skyColor),Fe(r,"u_horizon_color",o.sky.horizonColor),af(r,o.sky);let[n,a]=this.skyBand(t,o),l=Math.min(a*.5,t.height*this.dpr*.1);r.setVec3("u_sky_params",n,a,l),this.applyAtmosphere(r,t,o);let s=t.cameraRay();r.setVec3("u_cam_right",s.right[0],s.right[1],s.right[2]),r.setVec3("u_cam_up",s.up[0],s.up[1],s.up[2]),r.setVec3("u_cam_fwd",s.fwd[0],s.fwd[1],s.fwd[2]),r.setVec2("u_cam_center",t.width*this.dpr/2,t.height*this.dpr/2);let c=yt(o.light.keyAzimuth,o.light.keyAltitude);r.setVec3("u_sun_dir",-c[0],-c[1],-c[2]),Fe(r,"u_sun_color",o.light.keyColor),r.setFloat("u_sun_glow",o.light.keyIntensity);let f=t.globeActive?1-t.globeFlatMix:0;if(r.setVec2("u_space",f,o.sky.starIntensity),f>.001){Fe(r,"u_space_color",o.sky.spaceColor),Fe(r,"u_atmo_color",o.sky.atmosphereColor);let u=t.globeDisc();r.setVec4("u_globe_disc",u.dir[0],u.dir[1],u.dir[2],u.angle);let[d,h,m,y]=t.localRayCorners();r.setVec3("u_ray_tl",d[0],d[1],d[2]),r.setVec3("u_ray_tr",h[0],h[1],h[2]),r.setVec3("u_ray_bl",m[0],m[1],m[2]),r.setVec3("u_ray_br",y[0],y[1],y[2]);}e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),this.quad.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0),e.bindVAO(null);}applyGlobeUniforms(e,t,o){if(!t.globeActive){e.setVec4("u_globe",0,0,0,0);return}let r=t.globeBasis,n=t.worldSize;e.setVec4("u_globe",1,t.globeFlatMix,t.globeRadiusPx,n),e.setVec2("u_globe_center",t.centerPointPx.x/n,t.centerPointPx.y/n);let a=t.globeCamera();e.setVec4("u_globe_cam",a.dir[0],a.dir[1],a.dir[2],a.horizonCos);let l=yt(o.light.keyAzimuth,o.light.keyAltitude);e.setVec3("u_globe_sun",-l[0],-l[1],-l[2]),e.setVec2("u_globe_light",.16,.14),e.setMat3("u_globe_basis",[r.east[0],r.south[0],r.up[0],r.east[1],r.south[1],r.up[1],r.east[2],r.south[2],r.up[2]]);}applyTileMatrix(e,t,o,r){if(t.globeActive){let n=o.bounds();e.setVec3("u_tile_merc",n.minX,n.minY,(n.maxX-n.minX)/r),e.setMat4("u_matrix",t.localMatrix());return}e.setMat4("u_matrix",t.tileMatrix(o,r));}applyFogUniforms(e,t,o){let r=this.fog??mt(t,o);if(r.intensity<=0){e.setVec3("u_fog_range",0,1,0),e.setVec2("u_fog_vertical",0,0),this.applyAtmosphere(e,t,o);return}Fe(e,"u_fog_color",o.sky.horizonColor),e.setVec3("u_fog_range",r.near,r.far,r.intensity);let[n,a]=o.sky.fogVerticalRange;e.setVec2("u_fog_vertical",n,a),this.applyAtmosphere(e,t,o);}drawsTile(e,t,o,r){let n=this.fog;if(!n)return true;let a=e.distanceToTile(r);return a>n.cutoff?false:t.layerVisibleAt(o,e.detailZoom(a))}earthDepthLevel(e,t){let o=0;for(let n of e.layers)n.type==="surface"?o=Math.min(o,(n.elevation-(n.bevelDrop??0))*this.reliefScale):n.type==="line"&&(o=Math.min(o,V(n.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(Qc/Math.max(t.pixelsPerMeter,1e-9),Jc);return o-r}clipToTile(e,t){let o=this.stencilIds.get(t.dataKey);e.setStencilTest(o!==void 0),o!==void 0&&e.gl.stencilFunc(e.gl.EQUAL,o,Nr);}drawTileStencil(e,t,o){if(this.stencilIds.clear(),t.globeActive){e.gl.stencilMask(255),e.clear(null,false,true),e.setStencilTest(false);return}let r=o.get(K);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>Nr)return;let a=e.gl;a.stencilMask(255),e.clear(null,false,true),e.setStencilTest(true),a.stencilOp(a.KEEP,a.KEEP,a.REPLACE),e.setColorMask(false),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none");let l=this.fill;l.use(),l.setVec4("u_globe",0,0,0,0),l.setInt("u_material",0),l.setVec2("u_world_origin",0,0),l.setVec4("u_color",0,0,0,1),l.setFloat("u_elevation",0),this.quad.vao.bind();let s=0;for(let c of n)s++,this.stencilIds.set(c.dataKey,s),a.stencilFunc(a.ALWAYS,s,Nr),l.setMat4("u_matrix",t.tileMatrix(c,1)),a.drawElements(a.TRIANGLES,6,a.UNSIGNED_SHORT,0);e.bindVAO(null),e.setColorMask(true),a.stencilOp(a.KEEP,a.KEEP,a.KEEP),e.setStencilTest(false);}drawEarthDepth(e,t,o,r){if(!this.fill||!this.quad||t.globeActive)return;let n=o.get(K);if(!n)return;let a=this.fill;a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setVec2("u_world_origin",0,0),a.setVec4("u_color",0,0,0,1),a.setFloat("u_elevation",0);let l=this.earthDepthLevel(r,t);e.gl.colorMask(false,false,false,false),e.setDepthTest(true),e.setDepthFunc("lequal"),e.setDepthMask(true),e.setCull("none"),e.gl.enable(e.gl.POLYGON_OFFSET_FILL),e.gl.polygonOffset(1,8),this.quad.vao.bind();let s=new Float32Array(16);for(let c of n.visibleTiles){let f=t.tileMatrix(c,1);s.set(f);for(let u=0;u<4;u++)s[12+u]+=l*f[8+u];a.setMat4("u_matrix",s),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);}e.bindVAO(null),e.gl.disable(e.gl.POLYGON_OFFSET_FILL),e.gl.colorMask(true,true,true,true);}drawGroundShadow(e,t,o,r){if(!this.shadowActive||!this.groundShadow||!this.quad)return;let n=o.get(K);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=yt(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=ce(l.ambientColor),u=ce(l.keyColor),d=[0,0,0];for(let h=0;h<3;h++){let m=f[h]*l.ambientIntensity,y=u[h]*l.keyIntensity*c;d[h]=m>0?m/(m+y):1;}a.setVec3("u_shadow_ground",d[0],d[1],d[2]),a.setFloat("u_ground_ndotl",c),e.setBlend("multiply"),e.setDepthTest(false),e.setDepthMask(false),e.setCull("none"),this.quad.vao.bind();for(let h of n.visibleTiles)a.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,1)),a.setMat4("u_matrix",t.tileMatrix(h,1)),e.gl.drawElements(e.gl.TRIANGLES,6,e.gl.UNSIGNED_SHORT,0);e.setBlend("premultiplied");}applyShadowUniforms(e){if(e.setInt("u_shadow_map",Gr),!this.shadowActive){e.setVec4("u_shadow_params",0,0,0,0);return}let t=this.shadowTarget?.size??1,r=Math.max(this.shadows.bias,1.5*this.shadowTexelMeters)*(this.shadowDepthPerMeter||1);e.setVec4("u_shadow_params",this.shadows.strength,1/t,r,1),e.setFloat("u_shadow_normal_offset",1.5*2/t);let n=ce(this.shadows.color);e.setVec3("u_shadow_color",n[0],n[1],n[2]);}get shadowsActive(){return this.shadowActive}drawOverlay(e,t,o,r,n,a){let l=()=>{e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");};l();for(let s of o.layers){if(s.type==="raster"||s.type==="symbol"||s.type==="fill-extrusion"||!s.overlay||(s.overlay===true?"volume":s.overlay)!==a||!o.layerVisibleAt(s,n))continue;let c=r(s);if(c){if(s.type==="surface"){this.flattened(c,o,s)?this.drawFill(e,t,c,o,s,n):this.drawSurface(e,t,c,o,s,n),l();continue}s.type==="fill"?this.drawFill(e,t,c,o,s,n):this.drawLine(e,t,c,o,s,n);}}}applyTileScale(e,t,o){let r=Ko(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=kn(t.z,t.x,t.y);e.setVec2("u_world_origin",n/this.patternScale,a/this.patternScale);let l=this.cameraMeters;e.setVec3("u_camera_local",l[0]-t.x*r,l[1]-t.y*r,l[2]);}applyMaterial(e,t,o){let r=t.paint&&"material"in t.paint?t.paint.material:void 0,n=this.detailScale<=0?0:of[r??"flat"]??0;if(e.setInt("u_material",n),n===0)return;let a=t.paint,l=V(a.materialStrength,o,1)*this.detailScale,s=V(a.materialScale,o,rf[n]),c=V(a.materialSpeed,o,n===1?1:0);e.setVec4("u_material_params",l,s,c,this.materialTime),c>0&&l>.004&&(this.materialAnimating=true);}drawFill(e,t,o,r,n,a){let l=this.fill,s=r.colorAt(n,a),c=V(n.paint?.opacity,a,1);if(c<=.001)return;l.use(),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(l,t,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",_e([s[0],s[1],s[2],s[3]*c]));let f=r.bucketKeyFor(n);if(f!==null){for(let u of o.visibleTiles){if(!this.drawsTile(t,r,n,u))continue;let d=o.getTile(u),h=d&&this.bucketFor(e,d,f,jr,this.fillLocs,"fill");h&&(this.clipToTile(e,u),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,h.extent)),this.applyTileScale(l,u,h.extent),this.applyTileMatrix(l,t,u,h.extent),h.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,h.indexCount,h.indexType,0));}e.setStencilTest(false);}}drawLine(e,t,o,r,n,a,l=0,s){let c=this.line,f=r.colorAt(n,a),u=V(n.paint.opacity,a,1)*(l||1),d=V(n.paint.width,a,1);if(u<=.001||d<=.01)return;let h=e.gl.drawingBufferWidth,m=e.gl.drawingBufferHeight,y=t.width>0?h/t.width:1,p=d/2*y;c.use(),this.applyFogUniforms(c,t,r),this.applyGlobeUniforms(c,t,r),this.applyLight(c,r),this.applyMaterial(c,n,a),c.setVec4v("u_color",_e([f[0],f[1],f[2],f[3]*u])),c.setFloat("u_center_w",t.cameraToCenterDistance);let b=V(n.paint.offset,a,0)*y,g=Math.max(V(n.paint.blur,a,0),0)*y;c.setFloat("u_elevation",V(n.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",h,m);let v=n.paint.dashArray,x=n.paint.arrow===true,C=n.paint.arrowStyle,S=x&&(C==="head"||C==="headOnly"),M=x&&C==="dash";if(c.setInt("u_pattern",M?5:v?1:C==="headOnly"&&x?4:S?3:x?2:0),v){let[_,T]=v;c.setVec2("u_dash",_*y,(_+T)*y);}if(x){let _=ke(n.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",_e(_));let T=V(n.paint.arrowPeriod,a,46)*y,L=V(n.paint.arrowSize,a,5)*y;if(M){let k=V(n.paint.arrowGap,a,24)*y,z=Math.max(T-k,1),A=Math.min(L,z),I=V(n.paint.arrowShaft,a,2)*y,E=V(n.paint.arrowHead,a,4)*y,F=V(n.paint.arrowOutline,a,0)*y;c.setVec4("u_arrow",I,A,E,z),c.setVec2("u_dash",F,T);}else S?c.setVec4("u_arrow",T,L,p,0):c.setVec4("u_arrow",T,Math.max(L*.4,1),Math.min(L,p*.72),0);}let w=r.bucketKeyFor(n);if(w!==null)for(let _ of o.visibleTiles){if(!this.drawsTile(t,r,n,_))continue;let T=o.getTile(_);if(!T)continue;let L=n.network?s!==void 0?[He(n.id,s)]:(T.data?.levels??[]).map(k=>He(n.id,k)):[w];for(let k of L){let z=this.bucketFor(e,T,k,Va,this.lineLocs,"line");if(!z)continue;let A=_.bounds(),I=(A.maxX-A.minX)*t.worldSize/z.extent*y;c.setFloat("u_tile_to_px",I);let E=I>1e-6?1/I:1;c.setFloat("u_half_width",p*E),c.setFloat("u_blur",g*E),c.setFloat("u_meters_to_units",t.pixelsPerMeter*E),c.setFloat("u_width_from_data",n.paint.widthFromData===true?1:0),c.setFloat("u_width_extra",V(n.paint.widthExtra,a,0)*E),c.setFloat("u_offset",b*E),c.setFloat("u_tile_per_px",E),this.applyTileScale(c,_,z.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(_,z.extent)),this.applyTileMatrix(c,t,_,z.extent),z.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,z.indexCount,z.indexType,0);}}}drawNetwork(e,t,o,r,n,a,l){let s=o.layers.filter(f=>f.type==="line"&&f.network===n&&l(f));if(!s.length)return;let c=new Set;for(let f of s){let u=r(f);if(u)for(let d of u.visibleTiles){let h=u.getTile(d);for(let m of h?.data?.levels??[])c.add(m);}}if(c.size)for(let f of [...c].sort((u,d)=>u-d))for(let u of s){let d=r(u);d&&this.drawLine(e,t,d,o,u,a,0,f);}}drawHighlight(e,t,o,r,n,a){let l=this.highlight;if(!l||!this.building||l.layerId!==n.id)return;let s=`${n.id}/${l.featureId}`;this.highlightKey!==s&&(this.disposeHighlight(),this.highlightKey=s);let c=ce(l.color)??[.31,.79,.5,1],f=this.building;f.use(),this.applyShadowUniforms(f),this.applyFogUniforms(f,t,r),this.applyLight(f,r),f.setVec4v("u_wall_color",[c[0],c[1],c[2],1]),f.setVec4v("u_roof_color",[c[0],c[1],c[2],1]),f.setFloat("u_opacity",l.opacity),f.setFloat("u_ao_strength",V(n.paint.aoStrength,a,.4)),f.setFloat("u_tint_variation",0),f.setFloat("u_facade_detail",0),f.setFloat("u_window_glow",0),f.setFloat("u_roof_variation",0),f.setFloat("u_height_scale",V(n.paint.heightScale,a,1)),e.setDepthFunc("lequal"),e.setDepthMask(false),e.setBlend("alpha");for(let u of o.visibleTiles){let d=o.getTile(u);if(!d)continue;let h=d.data?.buckets?.[n.id];if(!h)continue;let m=u.dataKey,y=this.highlightGpu.get(m);if(y===void 0){let p=Eo(d,n.id,l.featureId);if(p){let b=new ye(e,new Uint8Array(p.vertices),Fo),g=new he(e,p.indices);y={vao:new ue(e,[{buffer:b,locations:this.buildingLocs}],g),vbo:b,ibo:g,count:p.indices.length};}else y=null;this.highlightGpu.set(m,y);}y&&(this.applyTileScale(f,u,h.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(u,h.extent)),f.setMat4("u_matrix",t.tileMatrix(u,h.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.count,e.gl.UNSIGNED_INT,0));}e.setBlend("none"),e.setDepthMask(true);}refreshHighlight(){this.disposeHighlight();}disposeHighlight(){for(let e of this.highlightGpu.values())e&&(e.vao.destroy(),e.vbo.destroy(),e.ibo.destroy());this.highlightGpu.clear(),this.highlightTris.clear(),this.highlightKey="";}syncHighlightFootprint(e,t){let o=this.highlight;if(!o){this.highlightTris.size&&this.highlightTris.clear();return}let r=`${o.layerId}/${o.featureId}`;this.footprintKey!==r&&(this.highlightTris.clear(),this.footprintKey=r);let n=t.layers.find(s=>s.id===o.layerId),a=e.get(n?.source??K);if(!a)return;let l=new ee;for(let s of a.visibleTiles){if(l.add(s.dataKey),this.highlightTris.has(s.dataKey))continue;let c=a.getTile(s),f=c?.data?.buckets?.[o.layerId];if(!c||!f)continue;let u=Eo(c,o.layerId,o.featureId);u&&this.highlightTris.set(s.dataKey,kr(u,f.extent,s));}for(let s of [...this.highlightTris.keys()])l.has(s)||this.highlightTris.delete(s);}drawFillHighlight(e,t,o,r){let n=this.highlightFill,a=this.fill;if(!n||!a)return;let l=r.layers.find(d=>d.id===n.layerId),s=l?o.get(l.source??K):void 0;if(!l||!s)return;let c=n.bucketKey,f=ce(n.color)??[.31,.79,.5,1];a.use(),this.applyFogUniforms(a,t,r),a.setVec4("u_globe",0,0,0,0),a.setInt("u_material",0),a.setFloat("u_elevation",0),a.setVec2("u_world_origin",0,0),a.setVec4v("u_color",_e([f[0],f[1],f[2],n.opacity])),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,Ur,Ur),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(Ur);for(let d of s.visibleTiles){let h=s.getTile(d),m=h?.data?.buckets?.[c];if(!h||!m||m.kind!=="fill"||!m.featureIds)continue;let y=this.fillHighlightFor(e,m,d,n.featureId,c);y&&(a.setMat4("u_matrix",t.tileMatrix(d,m.extent)),y.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,y.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),e.bindVAO(null);}fillHighlightFor(e,t,o,r,n){let a=`${n}/${r}/${o.dataKey}`;this.fillHighlightKey!==`${n}/${r}`&&(this.fillHighlightGpu.forEach(d=>{d?.vao.destroy(),d?.ibo.destroy(),d?.vbo.destroy();}),this.fillHighlightGpu.clear(),this.fillHighlightKey=`${n}/${r}`);let l=this.fillHighlightGpu.get(a);if(l!==void 0)return l;let s=new Uint32Array(t.indices),c=new Float64Array(t.featureIds),f=[];for(let d=0;d*3<s.length;d++)c[d]===r&&f.push(s[d*3],s[d*3+1],s[d*3+2]);let u=null;if(f.length){let d=new ye(e,new Uint8Array(t.vertices),jr),h=new he(e,new Uint32Array(f));u={vao:new ue(e,[{buffer:d,locations:this.fillLocs}],h),vbo:d,ibo:h,count:f.length};}return this.fillHighlightGpu.set(a,u),u}highlightFootprint(){return this.highlight&&this.highlightTris.size?[...this.highlightTris.values()]:this.indoorMask.footprint()}drawSurface(e,t,o,r,n,a){let l=this.surface,s=r.colorAt(n,a,[.7,.8,.7,1]),c=V(n.paint.opacity,a,1);if(c<=.001)return;l.use(),this.applyShadowUniforms(l),this.applyFogUniforms(l,t,r),this.applyGlobeUniforms(l,t,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",s),l.setFloat("u_opacity",c),l.setFloat("u_side_shade",V(n.paint.sideShade,a,.12));let f=n.elevation<(n.base??0),u=n.paint.sideColor?ke(n.paint.sideColor,a,s):s;l.setVec3("u_side_color",u[0],u[1],u[2]),l.setFloat("u_side_light",V(n.paint.sideLight,a,f?1:0)),l.setFloat("u_relief",this.reliefScale);let d=r.bucketKeyFor(n);if(d===null)return;let h=c>=1&&!n.overlay;e.setDepthMask(h),e.setBlend(h?"none":"premultiplied"),e.setCull("none");let m=[];for(let b of o.visibleTiles){if(!this.drawsTile(t,r,n,b))continue;let g=o.getTile(b),v=g&&this.bucketFor(e,g,d,Da,this.surfaceLocs,"surface");v&&m.push({id:b,bucket:v});}let y=(b,g)=>{this.clipToTile(e,b),this.applyTileScale(l,b,g.extent),this.shadowActive&&l.setMat4("u_shadow_matrix",t.shadowTileMatrix(b,g.extent)),this.applyTileMatrix(l,t,b,g.extent),g.vao.bind();},p=m.filter(({bucket:b})=>b.capIndexOffset<b.indexCount);if(p.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g}of p){y(b,g);let v=g.indexType===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,g.indexCount-g.capIndexOffset,g.indexType,g.capIndexOffset*v);}e.setColorMask(true),e.setDepthMask(h);}for(let{id:b,bucket:g}of m)y(b,g),e.gl.drawElements(e.gl.TRIANGLES,g.capIndexOffset,g.indexType,0);e.setCull("back"),e.setDepthMask(true),e.setBlend("none");}drawBuildings(e,t,o,r,n,a,l){let s=this.building,c=r.colorAt(n,a,[.86,.84,.8,1]),f=n.paint.roofColor?r.colorAt({...n,paint:{...n.paint,color:n.paint.roofColor}},a,c):c,u=V(n.paint.opacity,a,1);if(u<=.001)return false;s.use(),this.applyShadowUniforms(s),this.applyFogUniforms(s,t,r),s.setVec4v("u_wall_color",c),s.setVec4v("u_roof_color",f),s.setFloat("u_opacity",u),s.setFloat("u_ao_strength",V(n.paint.aoStrength,a,.4)),s.setFloat("u_tint_variation",V(n.paint.tintVariation,a,.07));let d=(x,C)=>n.paint[x]?r.colorAt({...n,paint:{...n.paint,color:n.paint[x]}},a,C):C,h=d("windowColor",[.62,.71,.8,1]),m=d("windowFrameColor",[c[0]*1.1,c[1]*1.1,c[2]*1.1,1]);s.setVec3("u_window_color",h[0],h[1],h[2]),s.setVec3("u_window_frame",m[0],m[1],m[2]),s.setFloat("u_facade_detail",V(n.paint.facadeDetail,a,1)*this.detailScale),s.setFloat("u_window_glow",V(n.paint.windowGlow,a,0)),s.setFloat("u_floor_height",V(n.paint.floorHeight,a,3.2)),s.setFloat("u_window_recess",V(n.paint.windowRecess,a,.18)),s.setFloat("u_window_recess_shade",V(n.paint.windowRecessShade,a,.16)),s.setFloat("u_plinth_height",V(n.paint.plinthHeight,a,4)),s.setFloat("u_plinth_shade",V(n.paint.plinthShade,a,.14)),s.setFloat("u_roof_variation",V(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let y=u>=1;e.setDepthMask(y),e.setBlend(y?"none":"premultiplied");let p=V(n.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(n);if(g===null)return b;let v=(n.source??K)===K;v&&this.indoorMask.prepare(o,g);for(let x of o.visibleTiles){if(!this.drawsTile(t,r,n,x))continue;let C=o.getTile(x),S=C&&this.bucketFor(e,C,g,Fo,this.buildingLocs,"fill-extrusion");if(!S)continue;let M=this.growScale(S,l,!o.warm);M<1&&(b=true),s.setFloat("u_height_scale",M*p),this.applyTileScale(s,x,S.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(x,S.extent)),s.setMat4("u_matrix",t.tileMatrix(x,S.extent));let _=this.cutHidden(e,C,g,x.dataKey,S.buffer,this.hiddenFor(g,v))??(C&&v?this.indoorMask.indicesFor(e,C,g,x,S.buffer,this.buildingLocs):null);_?(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.count,e.gl.UNSIGNED_INT,0)):(S.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,S.indexCount,S.indexType,0));}return b}growScale(e,t,o=true){if(e.firstDrawTime===0&&(e.firstDrawTime=t),!o||this.growDurationMs<=0)return 1;let r=(t-e.firstDrawTime)/this.growDurationMs;return r<1?lf(Math.max(r,0)):1}applyLight(e,t){let o=t.light;Fe(e,"u_ambient_color",o.ambientColor),e.setFloat("u_ambient_intensity",o.ambientIntensity);let[r,n,a]=yt(o.keyAzimuth,o.keyAltitude);e.setVec3("u_key_dir",r,n,a),Fe(e,"u_key_color",o.keyColor),e.setFloat("u_key_intensity",o.keyIntensity);let[l,s,c]=yt(o.fillAzimuth,o.fillAltitude);e.setVec3("u_fill_dir",l,s,c),Fe(e,"u_fill_color",o.fillColor),e.setFloat("u_fill_intensity",o.fillIntensity);}flattened(e,t,o){let r=t.bucketKeyFor(o);if(r===null)return false;for(let n of e.visibleTiles){let a=e.getTile(n)?.data?.buckets?.[r];if(a)return a.kind==="fill"}return false}bucketFor(e,t,o,r,n,a){let l=t.buckets.get(o);if(l)return l;let s=t.data?.buckets?.[o];if(!s||s.kind==="symbol"||s.kind==="placement")return null;if(s.kind!==a)return Zc(`\u0441\u043B\u043E\u0439 ${o}: \u0432 \u0442\u0430\u0439\u043B\u0435 \u043C\u0435\u0448 \xAB${s.kind}\xBB, \u0430 \u0440\u0438\u0441\u0443\u044E\u0442 \u043A\u0430\u043A \xAB${a}\xBB \u2014 \u043F\u0440\u043E\u043F\u0443\u0449\u0435\u043D`),null;let c=new ye(e,new Uint8Array(s.vertices),r),f=new he(e,new Uint32Array(s.indices)),u=new ue(e,[{buffer:c,locations:n}],f),d=new Xr(u,c,f,f.count,f.type,s.extent,s.capIndexOffset??f.count);return t.buckets.set(o,d),d}destroy(e){this.disposeHighlight(),this.fill?.destroy(),this.surface?.destroy(),this.line?.destroy(),this.objectLine?.destroy(),this.building?.destroy(),this.symbols?.destroy(e),this.models.destroy(e.gl),this.shadowTarget?.destroy(),this.shadowTarget=null,this.shadowPlaceholder&&e.gl.deleteTexture(this.shadowPlaceholder),this.shadowPlaceholder=null,this.quad&&(this.quad.vao.destroy(),this.quad.vbo.destroy(),this.quad.ibo.destroy(),this.quad=null),this.globeMesh&&(this.globeMesh.vao.destroy(),this.globeMesh.vbo.destroy(),this.globeMesh.ibo.destroy(),this.globeMesh=null),this.fill=this.line=this.building=null,this.objectLine=null;}},zo=new B;function nf(i,e){let r=new Float32Array(66306),n=0;for(let d=0;d<=128;d++){let h=(d/128-.5)*Math.PI;for(let m=0;m<=256;m++)r[n++]=m/256*2*Math.PI-Math.PI,r[n++]=h;}let a=new Uint16Array(256*128*6),l=0;for(let d=0;d<128;d++)for(let h=0;h<256;h++){let m=d*257+h,y=m+256+1;a[l++]=m,a[l++]=m+1,a[l++]=y,a[l++]=m+1,a[l++]=y+1,a[l++]=y;}let s={stride:8,attribs:[{name:"a_lnglat",size:2,type:Nt,offset:0}]},c=new B([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new ye(i,r,s),u=new he(i,a);return {vao:new ue(i,[{buffer:f,locations:c}],u),vbo:f,ibo:u,count:a.length}}function af(i,e){if(e.highColor){Fe(i,"u_high_color",e.highColor);return}let t=zo.get(e.skyColor);t||(t=ce(e.skyColor),zo.set(e.skyColor,t)),i.setVec3("u_high_color",t[0]*.6,t[1]*.74,Math.min(1,t[2]*.99+.02));}function Fe(i,e,t){let o=zo.get(t);o||(o=ce(t),zo.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function yt(i,e){let t=i*Math.PI/180,o=e*Math.PI/180,r=Math.cos(o);return [-Math.sin(t)*r,Math.cos(t)*r,-Math.sin(o)]}function lf(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var Po=1,jt=class{constructor(e=1024){this.entries=new B;this.shelfY=0;this.shelfX=0;this.shelfHeight=0;this.texture=null;this.dirty=true;this.full=false;this.size=e,this.data=new Uint8Array(e*e);}get(e){return this.entries.get(e)}add(e,t,o,r){let n=this.entries.get(e);if(n)return n;if(this.full||o>this.size)return null;if(this.shelfX+o+Po>this.size&&(this.shelfY+=this.shelfHeight+Po,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Po>this.size)return this.full||console.warn("[osmgl] \u0430\u0442\u043B\u0430\u0441 SDF \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D, \u043D\u043E\u0432\u044B\u0435 \u0441\u0438\u043C\u0432\u043E\u043B\u044B \u043D\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u044E\u0442\u0441\u044F"),this.full=true,null;let a={x:this.shelfX,y:this.shelfY,width:o,height:r};for(let l=0;l<r;l++){let s=l*o,c=(a.y+l)*this.size+a.x;this.data.set(t.subarray(s,s+o),c);}return this.shelfX+=o+Po,r>this.shelfHeight&&(this.shelfHeight=r),this.entries.set(e,a),this.dirty=true,a}bind(e,t){let o=e.gl;this.texture?e.bindTexture(t,this.texture):(this.texture=o.createTexture(),e.bindTexture(t,this.texture),o.texStorage2D(o.TEXTURE_2D,1,o.R8,this.size,this.size),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),this.dirty=true),this.dirty&&(o.pixelStorei(o.UNPACK_ALIGNMENT,1),o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.size,this.size,o.RED,o.UNSIGNED_BYTE,this.data),this.dirty=false);}destroy(e){this.texture&&e.gl.deleteTexture(this.texture),this.texture=null,this.entries.clear(),this.data=new Uint8Array(0);}};var Yr=.75,Yt=8,be=3,De=24,gt=256,Na=255,Xt=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new B;this.loaded=new ee;this.inflight=new B;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/gt))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/gt);if(r<=Na&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new ee;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let n=Math.floor(r/gt);n>Na||this.loaded.has(n)||t.add(n);}return t.size?(await Promise.all([...t].map(o=>this.loadRange(o))),true):false}loadRange(e){let t=this.inflight.get(e);if(t)return t;let o=this.urlTemplate.replace("{fontstack}",encodeURIComponent(this.fontstack)).replace("{range}",`${e*gt}-${e*gt+gt-1}`),r=fetch(o,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.arrayBuffer()}).then(n=>{for(let a of Ua(n))this.glyphs.set(a.id,a);this.loaded.add(e);}).catch(n=>{this.loaded.add(e),console.warn(`[osmgl] \u0433\u043B\u0438\u0444\u044B ${o} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0438\u0441\u044C:`,n instanceof Error?n.message:n);}).finally(()=>{this.inflight.delete(e);});return this.inflight.set(e,r),r}};function Ua(i){let e=new Rl(i instanceof Uint8Array?i:new Uint8Array(i)),t=[];return e.readFields((o,r,n)=>{if(o!==1||!n)return;let a=n.readVarint()+n.pos;n.readFields((l,s,c)=>{if(l!==3||!c)return;let f=c.readVarint()+c.pos,u={id:0,bitmap:null,width:0,height:0,left:0,top:0,advance:0};c.readFields((d,h,m)=>{m&&(d===1?u.id=m.readVarint():d===2?u.bitmap=m.readBytes():d===3?u.width=m.readVarint():d===4?u.height=m.readVarint():d===5?u.left=m.readSVarint():d===6?u.top=m.readSVarint():d===7&&(u.advance=m.readVarint()));},null,f),t.push(u);},null,a);},null),t}var cf=.25,vt=1e20;function Kr(i,e,t){let o=e+be*2,r=t+be*2,n=o*r,a=new Float64Array(n),l=new Float64Array(n);a.fill(vt),l.fill(0);for(let c=0;c<t;c++)for(let f=0;f<e;f++){let u=i[c*e+f]/255,d=(c+be)*o+(f+be);if(u>=1)a[d]=0,l[d]=vt;else if(u>0){let h=.5-u;a[d]=h>0?h*h:0,l[d]=h<0?h*h:0;}else a[d]=vt,l[d]=0;}ja(a,o,r),ja(l,o,r);let s=new Uint8Array(n);for(let c=0;c<n;c++){let f=Math.sqrt(a[c])-Math.sqrt(l[c]);s[c]=ff(Math.round(255-255*(f/Yt+cf)));}return {data:s,width:o,height:r}}function ja(i,e,t){let o=Math.max(e,t),r=new Float64Array(o),n=new Float64Array(o),a=new Int32Array(o),l=new Float64Array(o+1);for(let s=0;s<e;s++){for(let c=0;c<t;c++)r[c]=i[c*e+s];Xa(r,n,a,l,t);for(let c=0;c<t;c++)i[c*e+s]=n[c];}for(let s=0;s<t;s++){for(let c=0;c<e;c++)r[c]=i[s*e+c];Xa(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function Xa(i,e,t,o,r){t[0]=0,o[0]=-vt,o[1]=vt;for(let n=1,a=0;n<r;n++){let l=0;do{let s=t[a];l=(i[n]-i[s]+n*n-s*s)/(n-s)/2;}while(l<=o[a]&&--a>-1);a++,t[a]=n,o[a]=l,o[a+1]=vt;}for(let n=0,a=0;n<r;n++){for(;o[a+1]<n;)a++;let l=t[a];e[n]=(n-l)*(n-l)+i[l];}}var ff=i=>i<0?0:i>255?255:i;var Ya=48,Kt=class{constructor(e={}){this.defs=e;this.sdfs=new B;this.pending=new ee;this.failed=new ee;}setIcons(e){this.defs=e,this.sdfs.clear(),this.failed.clear();}has(e){return this.sdfs.has(e)}get(e){return this.sdfs.get(e)}isDefined(e){return this.defs[e]!==void 0}async ensure(e){if(this.sdfs.has(e)||this.pending.has(e)||this.failed.has(e))return false;let t=this.defs[e];if(t===void 0)return this.failed.add(e),false;this.pending.add(e);try{let o=typeof t=="string"?t:t.svg,r=/viewBox="0 0 ([\d.]+) ([\d.]+)"/.exec(o),n=r?Number(r[1])/Number(r[2]):1,a=Math.max(8,Math.round(Ya*(n>1?n:1))),l=Math.max(8,Math.round(Ya/(n<1?n:1))),s=await uf(o,a,l);return this.sdfs.set(e,Kr(s,a,l)),!0}catch(o){return this.failed.add(e),console.warn(`[osmgl] \u0438\u043A\u043E\u043D\u043A\u0430 \xAB${e}\xBB \u043D\u0435 \u0440\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u043E\u0432\u0430\u043B\u0430\u0441\u044C:`,o instanceof Error?o.message:o),false}finally{this.pending.delete(e);}}};async function uf(i,e,t){let o=i.includes("width=")?i:i.replace("<svg",`<svg width="${e}" height="${t}"`),r=new Blob([o],{type:"image/svg+xml;charset=utf-8"}),n=URL.createObjectURL(r);try{let a=new Image;a.width=e,a.height=t,await new Promise((u,d)=>{a.onload=()=>u(),a.onerror=()=>d(new Error("\u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0434\u0435\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u0442\u044C SVG")),a.src=n;});let l=document.createElement("canvas");l.width=e,l.height=t;let s=l.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("\u043D\u0435\u0442 2D-\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430");s.clearRect(0,0,e,t),s.drawImage(a,0,0,e,t);let c=s.getImageData(0,0,e,t).data,f=new Uint8ClampedArray(e*t);for(let u=0;u<f.length;u++)f[u]=c[u*4+3];return f}finally{URL.revokeObjectURL(n);}}var tt={dot:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="5"/></svg>',entrance:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2.5 19.5 10l-2.1 2.1-3.9-3.9V21h-3V8.2l-3.9 3.9L4.5 10 12 2.5z"/></svg>',door:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h11a3 3 0 0 1 3 3v17H5V2zm9 9.2a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4z"/></svg>',elevator:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h14v18H5V3zm7 2.2L9.2 9h5.6L12 5.2zM9.2 15h5.6L12 18.8 9.2 15z"/></svg>',"frame-circle":'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="11"/></svg>',cafe:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 6h12v6a6 6 0 0 1-12 0V6zm12 1h2.5a2.5 2.5 0 0 1 0 5H16V7zM3 20h14v2H3z"/></svg>',restaurant:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2h2v8a2 2 0 0 1-4 0V2h2zM5 2v6h2V2zm7 0h2v20h-2V13a4 4 0 0 1 0-8V2zM6 12h2v10H6z"/></svg>',shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h16l-1.5 12h-13L4 8zm4-3a4 4 0 0 1 8 0v2h-2V5a2 2 0 0 0-4 0v2H8V5z"/></svg>',grocery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h3l3 11h9l2-8H8m1 15a2 2 0 1 0 4 0 2 2 0 0 0-4 0zm8 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0z"/></svg>',fuel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h9v18H4V3zm2 2v5h5V5H6zm10 2 3 3v8a2 2 0 0 1-4 0V9h1V7z"/></svg>',parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h6a5 5 0 0 1 0 10H9v8H6V3zm3 3v4h3a2 2 0 0 0 0-4H9z"/></svg>',hospital:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 3h4v7h7v4h-7v7h-4v-7H3v-4h7V3z"/></svg>',pharmacy:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 4h2v5h5v2h-5v5h-2v-5H6V9h5V4zM5 18h14v3H5z"/></svg>',school:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12z"/></svg>',bank:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2 2 8h20L12 2zM4 10h3v8H4v-8zm6.5 0h3v8h-3v-8zM17 10h3v8h-3v-8zM2 20h20v2H2z"/></svg>',bus:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 5a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10a2 2 0 0 1-2 2v2h-3v-2H9v2H6v-2a2 2 0 0 1-2-2V5zm2 2v5h12V7H6zm1 8a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0zm7 0a1.5 1.5 0 1 0 3 0 1.5 1.5 0 0 0-3 0z"/></svg>',railway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3h12v11a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3V3zm2 3v4h8V6H8zm-2 15 3-3h6l3 3H6z"/></svg>',park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a6 6 0 0 1 5.2 9 4.5 4.5 0 0 1-2.4 8.3H13V22h-2v-2.7H9.2A4.5 4.5 0 0 1 6.8 11 6 6 0 0 1 12 2z"/></svg>',hotel:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3v7h10a4 4 0 0 1 4 4v3h-3v-3H5v3H2V6zm5 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',place_of_worship:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 3 5 5 5 8v12h-4v-5a1 1 0 0 0-2 0v5H7V10c0-3 2-5 5-8z"/></svg>',police:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l8 3v7c0 5-3.5 8.5-8 10-4.5-1.5-8-5-8-10V5l8-3z"/></svg>',stadium:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 4c5.5 0 10 1.8 10 4v4c0 2.2-4.5 4-10 4S2 14.2 2 12V8c0-2.2 4.5-4 10-4zm0 2C7.6 6 4 7.1 4 8s3.6 2 8 2 8-1.1 8-2-3.6-2-8-2z"/></svg>',fast_food:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 9a9 9 0 0 1 18 0H3zm-1 3h20v2H2v-2zm2 4h16a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3z"/></svg>',bakery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 9c0-2 1.5-3 3-3h10c1.5 0 3 1 3 3l-1 9H5L4 9zm4-1v9h2V8H8zm4 0v9h2V8h-2z"/></svg>',ice_cream:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a5 5 0 0 1 5 5H7a5 5 0 0 1 5-5zM7 9h10l-5 13L7 9z"/></svg>',bar:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h18l-8 9v6h4v2H7v-2h4v-6L3 4zm3.5 2 2 2h7l2-2h-11z"/></svg>',butcher:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3h6l2 5-3 3-5-3V3zm8 7 6 6-2 2-6-6 2-2zM3 17h8v4H3v-4z"/></svg>',alcohol_shop:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4v4l3 5v11H7V11l3-5V2zm-1 11h6v7H9v-7z"/></svg>',clothing_store:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 3h6l5 3-2 4-2-1v12H8V9L6 10 4 6l5-3zm1 1.5L12 6l2-1.5h-4z"/></svg>',hairdresser:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 3l9 9-2 2-2-2-2 2 2 2-1 1a3 3 0 1 1-2-2l1-1-1-1a3 3 0 1 1 2-2L5 3zm14 0l-6 6 2 2 5-6V3zM6 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3zm0-11a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"/></svg>',laundry:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 2h14v20H5V2zm2 2v2h10V4H7zm5 4a6 6 0 1 0 0 12 6 6 0 0 0 0-12zm0 3a3 3 0 1 1 0 6 3 3 0 0 1 0-6z"/></svg>',music:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 4l11-2v13a3.5 3.5 0 1 1-2-3.2V6L11 7.4v10.1A3.5 3.5 0 1 1 9 14.3V4z"/></svg>',car:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M5 11l2-5a2 2 0 0 1 2-1h6a2 2 0 0 1 2 1l2 5v7h-3v-2H8v2H5v-7zm2.5-1h9l-1.2-3H8.7L7.5 10zM7 13a1.3 1.3 0 1 0 0 2.6A1.3 1.3 0 0 0 7 13zm10 0a1.3 1.3 0 1 0 0 2.6 1.3 1.3 0 0 0 0-2.6z"/></svg>',bicycle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 12a5 5 0 1 0 0 10 5 5 0 0 0 0-10zm12 0a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM6 15a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm12 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM9 4h4l4 8-2 1-3-6H9V4z"/></svg>',atm:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v3h16V7H4zm0 5v5h16v-5H4zm2 2h5v2H6v-2z"/></svg>',post:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2.5 2 7.5 6 7.5-6h-15z"/></svg>',telephone:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2c1 0 2 3 2 4s-2 2-2 3 4 6 5 6 2-2 3-2 4 1 4 2-1 4-3 4C9 19 5 15 3 5c0-2 3-3 4-3z"/></svg>',office:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h11v20H4V2zm2 3v3h3V5H6zm5 0v3h3V5h-3zM6 10v3h3v-3H6zm5 0v3h3v-3h-3zM6 15v3h3v-3H6zm5 0v7h3v-7h-3zM17 8h4v14h-4V8z"/></svg>',town_hall:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 5v2H3V7l9-5zM5 11h3v7H5v-7zm5.5 0h3v7h-3v-7zM16 11h3v7h-3v-7zM3 20h18v2H3v-2z"/></svg>',doctors:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 2v6a5 5 0 0 0 4 4.9V16a3 3 0 1 0 6 0v-1.2a2.5 2.5 0 1 0-2 0V16a1 1 0 1 1-2 0v-3.1A5 5 0 0 0 17 8V2h-3v6a2 2 0 0 1-4 0V2H7z"/></svg>',dentist:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 4-1 6 0 2 1 2 4 1 8l-1 5c-1 4-3 4-3.5 1L14 12c-.4-2-1.6-2-2 0l-.5 4c-.5 3-2.5 3-3.5-1l-1-5C6 6 6 3 8 2c2-1 3 0 4 0z"/></svg>',veterinary:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 11c3 0 6 3 6 6a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3c0-3 3-6 6-6zM6 5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm12 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zM10 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5zm4 0a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"/></svg>',library:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 3h5c1.5 0 2.5.5 3 1.2.5-.7 1.5-1.2 3-1.2h5v16h-5c-1.5 0-2.5.6-3 1.5-.5-.9-1.5-1.5-3-1.5H4V3zm2 2v12h3c1 0 2 .2 2.5.5V5.8C11 5.3 10 5 9 5H6z"/></svg>',college:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 3 2 8l10 5 10-5-10-5zM5 12v5c0 2 3 4 7 4s7-2 7-4v-5l-7 3.5L5 12zm15-2v7h2v-7h-2z"/></svg>',museum:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 5v2H2V7l10-5zM5 11h2.5v7H5v-7zm5 0h2.5v7H10v-7zm5 0h2.5v7H15v-7zM3 20h18v2H3v-2z"/></svg>',art_gallery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 0 0 0 20c1.7 0 2-1 1.4-2-.7-1.2 0-2.5 1.6-2.5H18a4 4 0 0 0 4-4c0-6-4.5-11.5-10-11.5zM7 9a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 7 9zm3-4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 10 5zm5 0a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 15 5zm3 4a1.7 1.7 0 1 1 0 3.4A1.7 1.7 0 0 1 18 9z"/></svg>',theatre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2zM13 5h8v9a4 4 0 0 1-8 0V5zm2.5 3a1 1 0 1 0 0 2 1 1 0 0 0 0-2zm3 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"/></svg>',cinema:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h20v16H2V4zm3 2v2h2V6H5zm0 5v2h2v-2H5zm0 5v2h2v-2H5zm12-10v2h2V6h-2zm0 5v2h2v-2h-2zm0 5v2h2v-2h-2zM9 6v12h6V6H9z"/></svg>',monument:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M10 2h4l1 13H9l1-13zM7 17h10v2H7v-2zm-2 3h14v2H5v-2z"/></svg>',castle:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 6h3V3h2v3h3V3h2v3h3V3h2v3h3v16H2V6zm7 8h6v8H9v-8z"/></svg>',attraction:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l2.9 6.3 6.9.8-5.1 4.7 1.4 6.8L12 17.2 5.9 20.6l1.4-6.8L2.2 9.1l6.9-.8L12 2z"/></svg>',zoo:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 12c3.3 0 6 2.7 6 5.5S15.3 21 12 21s-6-.7-6-3.5S8.7 12 12 12zM5 6a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 5 6zm14 0a2.7 2.7 0 1 1 0 5.4A2.7 2.7 0 0 1 19 6zM9.5 2a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4zm5 0a2.7 2.7 0 1 1 0 5.4 2.7 2.7 0 0 1 0-5.4z"/></svg>',theme_park:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v6h-2V2zM4 20a8 8 0 0 1 16 0v2H4v-2zm3.5-2h9A6 6 0 0 0 12 14a6 6 0 0 0-4.5 4zM3 9l3-2 3 2-3 2-3-2zm12 0l3-2 3 2-3 2-3-2z"/></svg>',information:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm-1.5 4h3v3h-3V6zm0 5h3v8h-3v-8z"/></svg>',garden:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c2 2 3 4 3 6a3 3 0 0 1-6 0c0-2 1-4 3-6zM4 9c2.5 0 5 1.5 6 4H8c-2.5 0-4-1.5-4-4zm16 0c0 2.5-1.5 4-4 4h-2c1-2.5 3.5-4 6-4zm-9 5h2v8h-2v-8z"/></svg>',pitch:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 5h20v14H2V5zm2 2v10h7V7H4zm9 0v10h7V7h-7zm-1 3a2 2 0 1 1 0 4 2 2 0 0 1 0-4z"/></svg>',playground:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 4h2v16H3V4zm16 0h2v16h-2V4zM5 6h14v2H5V6zm2 3 3 11H8L5 9h2zm10 0-3 11h2l3-11h-2z"/></svg>',swimming_pool:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 3a3 3 0 0 1 6 0v3h4a3 3 0 0 1 3 3h-3a1 1 0 0 0-1 1v3H12V6a1 1 0 0 0-2 0v8H6V3zm-4 14c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',sports_centre:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 8h3v8H4V8zM2 10h2v4H2v-4zm15-2h3v8h-3V8zm3 2h2v4h-2v-4zM8 11h8v2H8v-2z"/></svg>',bicycle_parking:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 2h5a4 4 0 0 1 0 8H7v5H4V2zm3 3v2h2a1 1 0 0 0 0-2H7zm-2 13a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm10 0a4 4 0 1 1 8 0 4 4 0 0 1-8 0z"/></svg>',aerialway:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4l20-2v2L13 5v2h1l4 3v6a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2v-6l4-3h1V5.3L2 6V4zm7 8v3h6v-3H9z"/></svg>',ferry_terminal:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M11 2h2v3h4v4h-4v5l7 2-2 6c-2 0-2-1-4-1s-2 1-4 1-2-1-4-1-2 1-4 1l-2-6 7-2V9H3V5h4V2h4zM9 7v2h6V7H9z"/></svg>',traffic_signals:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M8 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-3v3h4v2H7v-2h4v-3H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm4 1.6a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.6 1.6 0 1 0 0 3.2 1.6 1.6 0 0 0 0-3.2zm0 4.3a1.4 1.4 0 1 0 0 2.8 1.4 1.4 0 0 0 0-2.8z"/></svg>',road_closed:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M4 10.1h16v3.8H4z"/></svg>',gate:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 4h3v16H2V4zm17 0h3v16h-3V4zM6 8h12v2H6V8zm0 5h12v2H6v-2z"/></svg>',toilets:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zM4 7h4l2 7H8v8H4v-8H2l2-7zm12-5a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm-3 5h6l1 8h-2v7h-4v-7h-2l1-8z"/></svg>',drinking_water:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c4 5 6 8 6 11a6 6 0 0 1-12 0c0-3 2-6 6-11zm0 5c-2 3-3 4.6-3 6a3 3 0 0 0 6 0c0-1.4-1-3-3-6z"/></svg>',waste_basket:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 2h6l1 2h4v3H4V4h4l1-2zM5 8h14l-1 14H6L5 8zm4 3v8h2v-8H9zm4 0v8h2v-8h-2z"/></svg>',recycling:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l4 7h-3v4h-2V9H8l4-7zM3 18l3-6 2 1-1.4 2.5H10v2H6.6L8 20l-2 1-3-3zm18 0-3 3-2-1 1.4-2.5H14v-2h3.4L16 13l2-1 3 6z"/></svg>',campsite:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l9 18h-4l-5-10-5 10H3L12 2zm0 9 5 9H7l5-9z"/></svg>',shelter:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2l10 8-1.5 2L19 11v9H5v-9l-1.5 1L2 10l10-8zm0 3.5L7 9.5V18h10V9.5l-5-4z"/></svg>',fire_station:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M13 2c0 3-4 4-4 8 0 1 .4 2 1 2.6C9.4 11 10 9.5 11 9c0 2 3 3 3 6a3.5 3.5 0 0 1-1 2.5c2.5-.6 4-2.8 4-5.5 0-5-4-7-4-10zM7 15c0 4 2.5 7 5 7s5-3 5-7c0 2-1 3-2 3.5.3-.6.5-1.2.5-2 0-2.5-2-3.5-2.5-5.5-1 1-2 2.5-2 4 0 .8.2 1.5.6 2C10.2 17.5 9 16.5 9 15H7z"/></svg>',prison:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M3 3h2v18H3V3zm4 0h2v18H7V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zm4 0h2v18h-2V3zM2 10h20v2H2v-2z"/></svg>',cemetery:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2c3 0 5 2 5 5v13H7V7c0-3 2-5 5-5zm-1 3v2H9v2h2v7h2v-7h2V7h-2V5h-2zM5 21h14v2H5v-2z"/></svg>',basin:'<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M2 8c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2V8zm0 7c2 0 2 2 5 2s3-2 5-2 3 2 5 2 3-2 5-2v3c-2 0-2 2-5 2s-3-2-5-2-3 2-5 2-3-2-5-2v-3z"/></svg>',"shield-2":'<svg viewBox="0 0 32 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="30" height="18" rx="4"/></svg>',"shield-3":'<svg viewBox="0 0 41 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="39" height="18" rx="4"/></svg>',"shield-4":'<svg viewBox="0 0 50 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="48" height="18" rx="4"/></svg>',"shield-5":'<svg viewBox="0 0 59 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="57" height="18" rx="4"/></svg>',"shield-6":'<svg viewBox="0 0 68 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="66" height="18" rx="4"/></svg>',"shield-7":'<svg viewBox="0 0 77 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="75" height="18" rx="4"/></svg>',"shield-8":'<svg viewBox="0 0 86 24" xmlns="http://www.w3.org/2000/svg"><rect x="1" y="3" width="84" height="18" rx="4"/></svg>'},df={lodging:"hotel",beer:"bar",pub:"bar",kindergarten:"school",university:"college",lift_gate:"gate",toll_booth:"gate",border_control:"gate",bollard:"gate",picnic_site:"campsite",motorcycle_parking:"parking",bicycle_rental:"bicycle",harbor:"ferry_terminal",reservoir:"basin",water_park:"swimming_pool",volleyball:"pitch",basketball:"pitch",tennis:"pitch",horse_racing:"pitch",athletics:"sports_centre",running:"sports_centre",cycling:"bicycle",climbing:"sports_centre",climbing_adventure:"sports_centre",winter_sports:"sports_centre",ice_rink:"sports_centre",karting:"car",motor:"car",escape_game:"attraction"};for(let[i,e]of Object.entries(df)){let t=tt[e];t?tt[i]=t:console.warn(`[osmgl] \u043F\u0441\u0435\u0432\u0434\u043E\u043D\u0438\u043C \u0438\u043A\u043E\u043D\u043A\u0438 \xAB${i}\xBB \u0441\u0441\u044B\u043B\u0430\u0435\u0442\u0441\u044F \u043D\u0430 \u043D\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0443\u044E \xAB${e}\xBB`);}var hf=1.2;function $r(i,e,t=16,o=0){let r=mf(i,t),n=[],a=[],l=0;for(let f of r){let u=0,d=0;for(let h of f){let m=h.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(u+=y.advance,d++);}d>1&&(u+=o*(d-1)),a.push(u),u>l&&(l=u);}if(l===0)return null;let s=De*hf,c=r.length*s;for(let f=0;f<r.length;f++){let u=-a[f]/2,d=-c/2+f*s+s/2;for(let h of r[f]){let m=h.codePointAt(0);if(m===void 0)continue;let y=e.get(m);y&&(y.width>0&&y.height>0&&y.bitmap&&n.push({glyph:y,x:u,y:d}),u+=y.advance+o);}}return n.length?{glyphs:n,width:l,height:c}:null}function mf(i,e){let t=i.replace(/\s+/g," ").trim();if(t.length<=e)return [t];let o=t.split(" "),r=[],n="";for(let a of o)n?n.length+1+a.length<=e?n+=" "+a:(r.push(n),n=a):n=a;return n&&r.push(n),r.slice(0,3)}function qr(i,e,t,o){if(i.length<2)return [];let r=-o,n=-o,a=e+o,l=t+o,s=d=>d.x>=r&&d.x<=a&&d.y>=n&&d.y<=l,c=[],f=[],u=()=>{f.length>=2&&c.push(f),f=[];};for(let d=0;d+1<i.length;d++){let h=i[d],m=i[d+1],y=s(h),p=s(m);if(y&&p){f.length||f.push(h),f.push(m);continue}let b=pf(h,m,r,n,a,l);if(!b){u();continue}f.length||f.push(b[0]),f.push(b[1]),p||u();}return u(),c}function pf(i,e,t,o,r,n){let a=e.x-i.x,l=e.y-i.y,s=0,c=1,f=[[-a,i.x-t],[a,r-i.x],[-l,i.y-o],[l,n-i.y]];for(let[u,d]of f){if(u===0){if(d<0)return null;continue}let h=d/u;if(u<0){if(h>c)return null;h>s&&(s=h);}else {if(h<s)return null;h<c&&(c=h);}}return [{x:i.x+a*s,y:i.y+l*s},{x:i.x+a*c,y:i.y+l*c}]}var bf=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function Qr(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=wf(i),n=r[r.length-1];if(n<t)return [];let a=o.maxAngle??25,l=o.stableScale&&o.stableScale>0?o.stableScale:1,s=n*l,c=o.fontSize?o.fontSize*.6:t/e.length,f=(o.fontSize??0)*.85,u=[],d=o.spacing??250,h=d>0&&d-t<d*.25?t+d*.25:d;if(o.accept)return yf(i,r,e,t,h,c,a,f,o.accept);if(h>0&&s>=t+h){let y=Math.min(Math.floor((s-t)/h)+1,24),p=t+h*(y-1),b=(s-p)/2;for(let g=0;g<y;g++,b+=h){let v=b/l,x=Zr(i,r,e,t,v,c,a,f);x&&u.push({glyphs:x,path:x.map(C=>({x:C.x,y:C.y})),at:v});}if(u.length)return u}let m=(n-t)/2;for(let y of bf){let p=m+m*y,b=Zr(i,r,e,t,p,c,a,f);if(b)return [{glyphs:b,path:b.map(g=>({x:g.x,y:g.y})),at:p}];if(m===0)break}return []}function yf(i,e,t,o,r,n,a,l,s){let c=e[e.length-1],f=Math.max(o/3,r/8,12),u=[],d=-1/0;for(let h=0;h+o<=c;h+=f){if(h-d<r)continue;let m=Zr(i,e,t,o,h,n,a,l);if(!m)continue;let y={glyphs:m,path:m.map(p=>({x:p.x,y:p.y})),at:h};if(s(y)&&(u.push(y),d=h,u.length>=24))break}return u}function Zr(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!gf(i,e,r,r+o,n,a))return null;let s=$t(i,e,r),c=$t(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return Ka(i,e,t,r,l);let f=e[e.length-1];return Ka([...i].reverse(),xf(e),t,f-(r+o),l)}function gf(i,e,t,o,r,n){if(r<=0)return true;let a=[],l=0;for(let s=1;s+1<i.length;s++){let c=e[s];if(c<=t)continue;if(c>=o)break;let f=Math.atan2(i[s].y-i[s-1].y,i[s].x-i[s-1].x),u=Math.atan2(i[s+1].y-i[s].y,i[s+1].x-i[s].x),d=Math.abs((u-f)*180/Math.PI+540)%360-180,h=Math.abs(d);for(a.push({at:c,delta:h}),l+=h;a.length&&c-a[0].at>r;)l-=a.shift().delta;if(l>n)return false}return true}function Ka(i,e,t,o,r){let n=[];for(let c of t){let f=$a(i,e,o+c.offset,c.width);if(!f)return null;n.push(f);}if(!n.length)return null;if(r<=0)return n;let a=[],l=o,s=0;for(let c=0;c<t.length;c++){if(c>0){let u=Math.abs(vf(n[c].angle,n[c-1].angle))*(Math.PI/180);s+=r*2*Math.tan(Math.min(u,Math.PI/3)/2);}l=o+t[c].offset+s;let f=$a(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function $a(i,e,t,o){let r=$t(i,e,t+o/2);if(!r)return null;let n=$t(i,e,t),a=$t(i,e,t+o);if(!n||!a)return r;let l=a.x-n.x,s=a.y-n.y;return l===0&&s===0?r:{x:r.x,y:r.y,angle:Math.atan2(s,l)*180/Math.PI}}function vf(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function wf(i){let e=new Array(i.length);e[0]=0;for(let t=1;t<i.length;t++)e[t]=e[t-1]+Math.hypot(i[t].x-i[t-1].x,i[t].y-i[t-1].y);return e}function xf(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function $t(i,e,t){if(t<0||t>e[e.length-1])return null;let o=1;for(;o<e.length-1&&e[o]<t;)o++;let r=e[o]-e[o-1];if(r<=0)return null;let n=(t-e[o-1])/r,a=i[o-1],l=i[o],s=l.x-a.x,c=l.y-a.y;return {x:a.x+s*n,y:a.y+c*n,angle:Math.atan2(c,s)*180/Math.PI}}var en=20,qa={stride:en,attribs:[{name:"a_pos",size:2,type:5126,offset:0},{name:"a_tex",size:2,type:5123,offset:8},{name:"a_scale",size:1,type:5126,offset:12},{name:"a_fade",size:1,type:5126,offset:16}]},_f=220,Ke=64,Za=2,Cf=1.22,Sf=128,Mf=.7;function Tf(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return V(o,e,0)*De;let r=V(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*Mf/(t/De)}var Ef=256,kf=200,Jr="frame-circle",wt=class i{constructor(e,t){this.shader=null;this.locations=new B;this.atlas=new jt(1024);this.vbo=null;this.ibo=null;this.vao=null;this.capacityQuads=0;this.onAssetsReady=null;this.pendingText=new Set;this.pendingIcons=new Set;this.highlightFootprint=null;this.placedCount=0;this.placed=[];this.hoverKey=null;this.hiddenKey=null;this.padding={top:0,right:0,bottom:0,left:0};this.viewport={width:0,height:0};this.stickyKeys=new Set;this.now=0;this.shownAt=new B;this.fading=false;this.styleOrder=new B;this.glyphs=new Xt(e,t),this.icons=new Kt(tt);}init(e){this.shader=new me(e,"symbol",Ca,Sa);for(let t of qa.attribs)this.locations.set(t.name,this.shader.attribLocation(t.name));}static keyOf(e){return `${e.layerId}|${e.mercX.toFixed(9)}|${e.mercY.toFixed(9)}`}setHover(e){return this.hoverKey===e?false:(this.hoverKey=e,true)}setHidden(e){return this.hiddenKey===e?false:(this.hiddenKey=e,true)}querySymbol(e,t=2){let o=null;for(let r of this.placed)e.x<r.box.x1-t||e.x>r.box.x2+t||e.y<r.box.y1-t||e.y>r.box.y2+t||(!o||r.order>=o.order)&&(o=r);return o}fadeOf(e,t){let o=this.shownAt.get(e);if(o===void 0)return this.shownAt.set(e,t),this.fading=true,0;let r=(t-o)/_f;return r<1?(this.fading=true,r):1}order(e){let t=o=>o.priority+(this.stickyKeys.has(i.keyOf({layerId:o.layer.id,mercX:o.mercX,mercY:o.mercY}))?kf:0);e.sort((o,r)=>t(r)-t(o));}rememberPlaced(){this.stickyKeys=new Set(this.placed.map(e=>i.keyOf(e)));for(let e of [...this.shownAt.keys()])this.stickyKeys.has(e)||this.shownAt.delete(e);}render(e,t,o,r){let n=this.shader;if(this.placedCount=0,this.placed=[],this.viewport={width:t.width,height:t.height},!n)return;let a=t.zoom,l=r.layers.filter(h=>h.type==="symbol"&&r.layerVisibleAt(h,a));if(!l.length)return;let s=this.collect(t,o,r,l);if(!s.length)return;this.now=performance.now(),this.fading=false,this.order(s);let c=new B,f=new B,u=new B;l.forEach((h,m)=>u.set(h.id,m));let d=0;for(let h of s){let m=this.place(h,a,c);if(!m)continue;this.placed.push({layerId:h.layer.id,text:h.text,icon:h.icon,mercX:h.mercX,mercY:h.mercY,box:m.box,order:u.get(h.layer.id)??0});let y=f.get(h.layer.id);y||f.set(h.layer.id,y={layer:h.layer,verts:[],texs:[],iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[]}),y.verts.push(...m.verts),y.texs.push(...m.texs),y.iconVerts.push(...m.iconVerts),y.iconTexs.push(...m.iconTexs),y.frameVerts.push(...m.frameVerts),y.frameTexs.push(...m.frameTexs),d+=m.quads,this.placedCount++;}this.rememberPlaced(),this.fading&&this.onAssetsReady?.(),this.requestMissing(),d&&(this.styleOrder=u,this.draw(e,t,f,d,a));}collect(e,t,o,r){let n=[],l=this.padding,s=mt(e,o).far,[c,f,u]=e.cameraPositionPx;for(let d of r){let h=(d.layout?.priority??0)*Ef,m=t.get(d.source??K);if(!m)continue;let y=d.layout?.showFor==="highlight",p=d.layout?.placement==="map",{shift:b,drop:g}=p?tl(d,e.zoom,e.pixelsPerMeter):{shift:0,drop:0};if(y&&!this.highlightFootprint)continue;let v=e.worldSize>0?e.pixelsPerMeter/e.worldSize*1.5:0,x=o.bucketKeyFor(d);if(x!==null)for(let C of m.visibleTiles){if(!o.layerVisibleAt(d,e.detailZoom(e.distanceToTile(C))))continue;let M=m.getTile(C)?.data?.buckets?.[x];if(!M||!Mo(M))continue;let w=new Int16Array(M.anchors),_=new Uint8Array(M.priorities),T=M.rotations?new Int16Array(M.rotations):null,L=M.lines?new Int16Array(M.lines):null,k=M.lineStarts?new Uint32Array(M.lineStarts):null,z=C.bounds(),A=e.worldSize,I=(z.maxX-z.minX)*A/M.extent,E=z.minX*A,F=z.minY*A;for(let P=0;P<_.length;P++){let R=E+w[P*2]*I,W=F+w[P*2+1]*I;if(s!==1/0&&Math.hypot(R-c,W-f,u)>s||y&&!Ve(this.highlightFootprint,R/A,W/A,v))continue;let G=R,O=W;if(p&&T){let $=T[P]*Math.PI/180,Q=b;G-=Math.sin($)*Q,O+=Math.cos($)*Q;}let H=e.worldPxToPoint(G,O),D=L&&k?Af(e,L,k,P,E,F,I):void 0;if(d.layout?.textPlacement==="line"){if(!D)continue}else if(!H||H.x<l.left-64||H.y<l.top-64||H.x>e.width-l.right+64||H.y>e.height-l.bottom+64)continue;n.push({layer:d,screenX:H?H.x:D[0].x,screenY:(H?H.y:D[0].y)+g,text:M.texts[P]??"",icon:M.icons[P]??"",priority:_[P]+h,rotate:ol(d,T,P,e.bearing),mercX:R/A,mercY:W/A,line:D});}}}return n}place(e,t,o){let r=e.layer.layout??{},n=i.keyOf({layerId:e.layer.id,mercX:e.mercX,mercY:e.mercY});if(this.hiddenKey!==null&&this.hiddenKey===n)return null;let a=this.fadeOf(n,this.now),l=this.hoverKey!==null&&this.hoverKey===n,s=V(r.textSize,t,13),c=V(r.iconSize,t,16),f=r.iconTextGap??5,[u,d]=r.offset??[0,0],h=r.placement==="map",m=null;if(e.icon&&!h){this.icons.isDefined(e.icon)||(e.icon="dot");let q=`icon:${e.icon}`,U=this.atlas.get(q);if(!U){let j=this.icons.get(e.icon);j?U=this.atlas.add(q,j.data,j.width,j.height)??void 0:this.pendingIcons.add(e.icon);}U&&(m=U);}let y=null;if(m&&r.iconFrame==="circle"){let q=`icon:${Jr}`,U=this.atlas.get(q);if(!U){let j=this.icons.get(Jr);j?U=this.atlas.add(q,j.data,j.width,j.height)??void 0:this.pendingIcons.add(Jr);}U&&(y=U);}let p=y?Math.max(r.iconFrameScale??1.6,1):1,b=null;if(e.text&&(this.glyphs.needsLoad(e.text)&&this.pendingText.add(e.text),b=$r(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,Tf(e.layer,t,s)),!b&&!m)||!b&&!m)return null;let g=s/De,v=b?b.width*g:0,x=b?b.height*g:0;if(e.layer.layout?.textPlacement==="line")return b&&e.line?this.placeOnLine(e,b,g,x,o,t,a):null;let C=r.iconPlacement??"top",S=C==="behind"&&!!m&&!!b,M=C==="top"&&!!m&&!!b,w=m?m.width/Math.max(m.height,1):1,_=S?x+f*2:c,T=m?_*w:0,L=Math.max(T,m?c*p:0),k=Math.max(_,m?c*p:0),z=S?Math.max(T,v+f*2):M?Math.max(L,v):L+(m&&b?f:0)+v,A=S?Math.max(_,x):M?k+f+x:Math.max(m?k:0,x),I=e.screenX+u,E=e.screenY+d,F=Za+(r.collisionPadding??0),P={x1:I-z/2-F,y1:E-A/2-F,x2:I+z/2+F,y2:E+A/2+F},R=this.padding;if(P.x1<R.left||P.y1<R.top||P.x2>this.viewport.width-R.right||P.y2>this.viewport.height-R.bottom)return null;if(!r.allowOverlap){if(Qa(o,P))return null;Ja(o,P);}let W=[],G=[],O=[],H=[],D=[],Y=[],$=0,Q=I-z/2,de=M?(k+f)/2:0,J=1/0,X=1/0,te=-1/0,ie=-1/0;if(b){let q=M||S?I:Q+(m?L+f:0)+v/2;for(let U of b.glyphs){let j=U.glyph,le=`g:${j.id}`,ae=this.atlas.get(le);if(!ae&&(!j.bitmap||(ae=this.atlas.add(le,j.bitmap,j.width+be*2,j.height+be*2)??void 0,!ae)))continue;let se=q+(U.x+j.left-be)*g,ne=E+de+(U.y-j.top-be)*g,ge=ae.width*g,Ee=ae.height*g;Ho(W,G,se,ne,ge,Ee,ae,0,a),$++;let ve=be*g;J=Math.min(J,se+ve),X=Math.min(X,ne+ve),te=Math.max(te,se+ge-ve),ie=Math.max(ie,ne+Ee-ve);}if(M&&m&&X<1/0){let U=E-A/2+k+f-X;if(U!==0){for(let j=1;j<W.length;j+=4)W[j]+=U;X+=U,ie+=U;}}}if(m){let q=l?Cf:1,U=T*q,j=_*q,le=(M?I-T/2:Q+(L-T)/2)-(U-T)/2,ae=(M?E-A/2+(k-_)/2:E-_/2)-(j-_)/2;if(y){let ne=c*p*q,ge=le+U/2-ne/2,Ee=ae+j/2-ne/2,ve=be/Math.max(y.height-be*2,1)*ne;Ho(D,Y,ge-ve,Ee-ve,ne+ve*2,ne+ve*2,y,0,a),$++;}if(S&&te>J){let ne=f*1.6,ge=f;U=(te-J+ne*2)*q,j=(ie-X+ge*2)*q,le=J-ne,ae=X-ge;}let se=be/Math.max(m.height-be*2,1)*j;Ho(O,H,le-se,ae-se,U+se*2,j+se*2,m,e.rotate,a),$++;}return $?{verts:W,texs:G,iconVerts:O,iconTexs:H,frameVerts:D,frameTexs:Y,quads:$,box:P}:null}placeOnLine(e,t,o,r,n,a,l){let s=e.line,c=t.glyphs.map(T=>({offset:(T.x+t.width/2)*o,width:Math.max(T.glyph.advance,1)*o})),f=c.length?c[c.length-1].offset+c[c.length-1].width:0,u=e.layer.layout??{},d=[],h=[],m=[],y=0,p=r/2+Za,b=this.padding,g=T=>{let L=T.path.map(k=>({x1:k.x-p,y1:k.y-p,x2:k.x+p,y2:k.y+p}));for(let k of L)if(k.x1<b.left||k.y1<b.top||k.x2>this.viewport.width-b.right||k.y2>this.viewport.height-b.bottom||!u.allowOverlap&&Qa(n,k))return false;if(!u.allowOverlap)for(let k of L)Ja(n,k);return m.push(...L),true},v=-1/0,x=1/0;for(let T of t.glyphs)T.glyph.height<=0||(v=Math.max(v,T.glyph.top),x=Math.min(x,T.glyph.top-T.glyph.height));let C=Number.isFinite(v)?(v+x)/2*o:0,M=qr(s,this.viewport.width,this.viewport.height,Sf).flatMap(T=>Qr(T,c,f,{spacing:u.symbolSpacing,fontSize:De*o,stableScale:Math.pow(2,Math.round(a)-a),accept:g}));if(!M.length)return null;for(let T of M)for(let L=0;L<t.glyphs.length;L++){let k=t.glyphs[L].glyph,z=T.glyphs[L],A=`g:${k.id}`,I=this.atlas.get(A);if(!I&&(!k.bitmap||(I=this.atlas.add(A,k.bitmap,k.width+be*2,k.height+be*2)??void 0,!I)))continue;let E=I.width*o,F=I.height*o,P=(k.height/2-k.top)*o+C,R=z.angle*Math.PI/180;Ho(d,h,z.x-E/2-Math.sin(R)*P,z.y-F/2+Math.cos(R)*P,E,F,I,z.angle,l),y++;}if(!y)return null;let w=m.map(T=>(T.x1+T.x2)/2),_=m.map(T=>(T.y1+T.y2)/2);return {verts:d,texs:h,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:y,box:{x1:Math.min(...w)-p,y1:Math.min(..._)-p,x2:Math.max(...w)+p,y2:Math.max(..._)+p}}}inStyleOrder(e){return [...e.values()].sort((t,o)=>(this.styleOrder.get(t.layer.id)??0)-(this.styleOrder.get(o.layer.id)??0))}draw(e,t,o,r,n){let a=this.shader,l=e.gl;this.ensureBuffers(e,r);let s=this.vbo,c=this.vao;if(!s||!c||!this.ibo)return;let f=new ArrayBuffer(r*4*en),u=new Float32Array(f),d=new Uint16Array(f),h=[],m=0,y=(p,b,g,v)=>{let x=p.length/16;if(x){h.push({layer:g,role:v,first:m/4*6,count:x*6});for(let C=0;C<x*4;C++){let S=m*5;u[S]=p[C*4],u[S+1]=p[C*4+1],d[S*2+4]=b[C*2],d[S*2+5]=b[C*2+1],u[S+3]=p[C*4+2],u[S+4]=p[C*4+3],m++;}}};for(let p of this.inStyleOrder(o))y(p.frameVerts,p.frameTexs,p.layer,"frame"),y(p.iconVerts,p.iconTexs,p.layer,"icon"),y(p.verts,p.texs,p.layer,"text");s.update(new Uint8Array(f)),a.use(),this.atlas.bind(e,0),a.setInt("u_atlas",0),a.setVec2("u_viewport",t.width,t.height),a.setFloat("u_atlas_size",this.atlas.size),a.setFloat("u_edge",Yr),a.setFloat("u_dpr",t.width>0?l.drawingBufferWidth/t.width:1),e.setDepthTest(false),e.setDepthMask(false),e.setBlend("premultiplied"),e.setCull("none"),c.bind();for(let p of h){let b=p.layer.paint,g=V(b.opacity,n,1),v=p.role==="icon",x=p.role==="frame",C=(L,k,z)=>x?k??L??z:v?L??z:z,S=ke(x?b.frameColor??b.haloColor??b.color:C(b.iconColor,void 0,b.color),n,[.15,.15,.15,1]),M=x?b.frameHaloColor:C(b.iconHaloColor,void 0,b.haloColor),w=ke(M??(x?b.iconColor??b.color:b.haloColor),n,[1,1,1,1]);x&&b.frameHaloColor===void 0&&(w[3]*=.35),x&&(S[3]*=V(b.frameOpacity,n,1));let _=V(x?b.frameHaloWidth??1.1:C(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),T=V(p.layer.layout?.textSize,n,13);a.setVec4v("u_color",_e([S[0],S[1],S[2],S[3]*g])),a.setVec4v("u_halo_color",_e([w[0],w[1],w[2],w[3]*g])),a.setFloat("u_halo",_/(Yt*(T/De))),l.drawElements(l.TRIANGLES,p.count,l.UNSIGNED_INT,p.first*4);}e.bindVAO(null);}ensureBuffers(e,t){if(this.vao&&t<=this.capacityQuads)return;this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.capacityQuads=Math.max(1024,Math.ceil(t*1.5)),this.vbo=new ye(e,new Uint8Array(this.capacityQuads*4*en),qa,true);let o=new Uint32Array(this.capacityQuads*6);for(let r=0;r<this.capacityQuads;r++){let n=r*4;o.set([n,n+1,n+2,n,n+2,n+3],r*6);}this.ibo=new he(e,o),this.vao=new ue(e,[{buffer:this.vbo,locations:this.locations}],this.ibo);}requestMissing(){if(this.pendingText.size){let e=[...this.pendingText].join("");this.pendingText.clear(),this.glyphs.ensure(e).then(t=>{t&&this.onAssetsReady?.();});}if(this.pendingIcons.size){let e=[...this.pendingIcons];this.pendingIcons.clear(),Promise.all(e.map(t=>this.icons.ensure(t))).then(t=>{t.some(Boolean)&&this.onAssetsReady?.();});}}destroy(e){this.shader?.destroy(),this.vao?.destroy(),this.vbo?.destroy(),this.ibo?.destroy(),this.atlas.destroy(e),this.shader=null,this.vao=null;}};function Ho(i,e,t,o,r,n,a,l=0,s=1){let c=n/Math.max(a.height,1);if(l){let f=l*Math.PI/180,u=Math.cos(f),d=Math.sin(f),h=t+r/2,m=o+n/2;for(let[y,p]of [[t,o],[t+r,o],[t+r,o+n],[t,o+n]]){let b=y-h,g=p-m;i.push(h+b*u-g*d,m+b*d+g*u,c,s);}}else i.push(t,o,c,s,t+r,o,c,s,t+r,o+n,c,s,t,o+n,c,s);e.push(a.x,a.y,a.x+a.width,a.y,a.x+a.width,a.y+a.height,a.x,a.y+a.height);}function Af(i,e,t,o,r,n,a){if(o+1>=t.length)return;let l=t[o],s=t[o+1],c=[];for(let f=l;f<s;f++){let u=i.worldPxToPoint(r+e[f*2]*a,n+e[f*2+1]*a);if(!u)break;c.push(u);}return c.length>=2?c:void 0}var el=(i,e)=>i*4096+e;function Qa(i,e){let t=Math.floor(e.x1/Ke),o=Math.floor(e.y1/Ke),r=Math.floor(e.x2/Ke),n=Math.floor(e.y2/Ke);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(el(a,l));if(s){for(let c of s)if(e.x1<c.x2&&e.x2>c.x1&&e.y1<c.y2&&e.y2>c.y1)return true}}return false}function Ja(i,e){let t=Math.floor(e.x1/Ke),o=Math.floor(e.y1/Ke),r=Math.floor(e.x2/Ke),n=Math.floor(e.y2/Ke);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=el(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function tl(i,e,t){let r=i.layout?.arrowUnits!=="meters"?1:t,n=V(i.layout?.arrowLength,e,50)*r;return {shift:V(i.layout?.arrowGap,e,20)*r+n/2,drop:n/2+(i.layout?.iconTextGap??4)}}function ol(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var xt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new B;}get size(){return this.map.size}has(e){return this.map.has(e)}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}peek(e){return this.map.get(e)}set(e,t){let o=this.map.get(e);o!==void 0&&(this.map.delete(e),o!==t&&this.onEvict?.(e,o)),this.map.set(e,t),this.trim();}delete(e){let t=this.map.get(e);return t===void 0?false:(this.map.delete(e),this.onEvict?.(e,t),true)}setCapacity(e){this.capacity=e,this.trim();}keys(){return this.map.keys()}values(){return this.map.values()}entries(){return this.map.entries()}clear(){for(let[e,t]of this.map)this.onEvict?.(e,t);this.map.clear();}trim(){for(;this.map.size>this.capacity;){let e=this.map.keys().next();if(e.done)break;let t=e.value,o=this.map.get(t);this.map.delete(t),this.onEvict?.(t,o);}}};var _t=class i{constructor(e,t,o,r=0){this.z=e;this.x=t;this.y=o;this.wrap=r;this.dataKey=`${e}/${t}/${o}`,this.key=r===0?this.dataKey:`${this.dataKey}@${r}`;}parent(){return this.z===0?null:new i(this.z-1,this.x>>1,this.y>>1,this.wrap)}children(){let e=this.z+1,t=this.x*2,o=this.y*2;return [new i(e,t,o,this.wrap),new i(e,t+1,o,this.wrap),new i(e,t,o+1,this.wrap),new i(e,t+1,o+1,this.wrap)]}scaledTo(e){if(e>=this.z)return this;let t=this.z-e;return new i(e,this.x>>t,this.y>>t,this.wrap)}isAncestorOf(e){if(e.z<=this.z||e.wrap!==this.wrap)return false;let t=e.z-this.z;return e.x>>t===this.x&&e.y>>t===this.y}bounds(){let t=1/Math.pow(2,this.z);return {minX:this.x*t+this.wrap,minY:this.y*t,maxX:(this.x+1)*t+this.wrap,maxY:(this.y+1)*t}}toString(){return this.key}};function Lf(i,e,t){let o=Math.pow(2,t),r=e.maxTiles??512,n=[],a=128;for(let l=0;l<o;l++)for(let s=0;s<o;s++){let c=new _t(t,s,l),f=c.bounds(),u=(f.minX+f.maxX)/2,d=(f.minY+f.maxY)/2,h=[[u,d],[f.minX,f.minY],[f.maxX,f.minY],[f.minX,f.maxY],[f.maxX,f.maxY]],m=false;for(let[p,b]of h)if(i.isOnGlobeFront(Se(p),Ce(b))){m=true;break}if(!m)continue;let y=false;for(let[p,b]of h){let g=i.localToPoint(i.globeLocal(p,b));if(g&&g.x>-a&&g.y>-a&&g.x<i.width+a&&g.y<i.height+a){y=true;break}}if(y&&(n.push(c),n.length>=r))return n}return n}function qt(i,e){let t=Math.min(e.maxzoom,24),o=Math.max(0,Math.min(e.minzoom,t)),r=e.detailBias??1,n=e.maxTiles??512,a=512*r,l=Math.min(Math.round(i.zoom),t);if(l<o)return [];if(i.globeActive)return Lf(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],u=[];for(let h=s;h<=c;h++)u.push(new _t(0,0,0,h));let d=0;for(;u.length&&!(++d>2e4||f.length>=n);){let h=u.pop();if(!i.isTileVisible(h))continue;if(h.z>=l){h.z>=o&&f.push(h);continue}if(i.tileScreenSize(h.z,i.distanceToTile(h))<=a&&h.z>=o){f.push(h);continue}for(let y of h.children())u.push(y);}return f.sort((h,m)=>i.distanceToTile(h)-i.distanceToTile(m)),f}var tn=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new B;}get hasGeometry(){return this.state==="loaded"&&!!this.data&&Object.keys(this.data.buckets).length>0}destroy(){for(let e of this.buckets.values())e.destroy();this.buckets.clear(),this.data=null;}},If=1500,Oo=class extends Ge{constructor(t,o){super();this.pool=t;this.visible=[];this.holdSince=0;this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,...o},this.cache=new xt(this.opts.cacheSize,(r,n)=>{n.state==="loading"&&this.pool.abort(n.requestId),n.destroy();});}get visibleTiles(){return this.visible}get dataVersion(){return this.version+this.visible.length*1e6}get warm(){return this.warmed}getTile(t){return this.cache.peek(t.dataKey)}splitValues(t){let o=[];for(let r of this.visible){let n=this.getTile(r)?.data?.splits?.[t];if(n)for(let a of n)o.includes(a)||o.push(a);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=qt(t,this.opts),r=new ee;for(let s of o)r.add(s.dataKey);for(let[s,c]of this.cache.entries())c.state==="loading"&&!r.has(s)&&(this.pool.abort(c.requestId),this.cache.delete(s));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);for(let s of o)this.cache.get(s.dataKey)||this.loadTile(s);let a=this.visible.length>0&&this.covers(o),l=performance.now();this.readyFor(o)||!a||this.holdSince&&l-this.holdSince>If?(this.visible=o,this.holdSince=0,this.readyFor(o)&&o.length&&(this.warmed=true)):this.holdSince||(this.holdSince=l);}readyFor(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(!r||r.state==="loading")return false}return true}covers(t){let o=new ee;for(let r of this.visible)o.add(r.dataKey);for(let r of t){if(o.has(r.dataKey))continue;let n=r.parent(),a=false;for(let l=0;n&&l<4;l++){if(o.has(n.dataKey)){a=true;break}n=n.parent();}if(!a)for(let l of this.visible){let s=l.parent();for(let c=0;s&&c<4;c++){if(s.dataKey===r.dataKey){a=true;break}s=s.parent();}if(a)break}if(!a)return false}return true}loadTile(t){let o=new tn(t);this.cache.set(t.dataKey,o);let r=Ff(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));o.requestId=this.pool.load({url:r,zoom:t.z,metersPerTile:En(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},n=>{if(this.cache.peek(t.dataKey)===o){if(n.type==="error"){if(n.aborted)return;o.state="error",o.error=n.message,this.emit("error",{tile:t,message:n.message});}else o.data=n,o.state=Object.keys(n.buckets).length?"loaded":"empty",this.version++,n.diag?.failed?.length&&console.warn(`[osmgl] \u0442\u0430\u0439\u043B ${t.z}/${t.x}/${t.y}: \u0441\u043B\u043E\u0438 \u043D\u0435 \u0441\u043E\u0431\u0440\u0430\u043B\u0438\u0441\u044C \u2014 ${n.diag.failed.join("; ")}`),this.emit("data",{tile:o});this.pendingCount===0&&this.emit("idle",void 0);}});}findReadyAncestor(t,o=5){let r=t.parent();for(let n=0;r&&n<o;n++){let a=this.cache.peek(r.dataKey);if(a&&a.hasGeometry)return a;r=r.parent();}return null}setCoverOptions(t){t.detailBias!==void 0&&(this.opts.detailBias=t.detailBias),t.maxTiles!==void 0&&(this.opts.maxTiles=t.maxTiles);}setPlan(t){this.opts.plan=t,this.cache.clear();}reload(){this.cache.clear();}destroy(){this.cache.clear(),this.removeAllListeners();}};function Ff(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var Wo=class{constructor(e){this.id=e;this.state="loading";this.image=null;this.error=null;this.texture=null;}destroy(){this.texture?.destroy(),this.texture=null,this.image?.close(),this.image=null;}},Zt=class extends Ge{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new xt(this.opts.cacheSize,(o,r)=>{this.aborts.get(o)?.abort(),this.aborts.delete(o),r.destroy();});}get visibleTiles(){return this.visible}getTile(t){return this.cache.peek(t.dataKey)}update(t){this.visible=qt(t,this.opts);let o=new ee;for(let r of this.visible)o.add(r.dataKey);for(let[r,n]of this.cache.entries())n.state==="loading"&&!o.has(r)&&(this.aborts.get(r)?.abort(),this.aborts.delete(r),this.cache.delete(r));this.cache.setCapacity(Math.max(this.opts.cacheSize,o.size*2));for(let r of this.visible)this.cache.get(r.dataKey)||this.loadTile(r);}reload(){for(let t of this.aborts.values())t.abort();this.aborts.clear(),this.cache.clear();}destroy(){this.reload(),this.removeAllListeners();}loadTile(t){let o=new Wo(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(rl(this.opts.url,t),r.signal).then(n=>{if(this.aborts.delete(t.dataKey),this.cache.peek(t.dataKey)!==o){n.close();return}o.image=n,o.state="loaded",this.emit("data",{tile:o});}).catch(n=>{this.aborts.delete(t.dataKey),!r.signal.aborted&&this.cache.peek(t.dataKey)===o&&(o.state="error",o.error=n instanceof Error?n.message:String(n),this.emit("error",{tile:t,message:o.error}));});}async fetchImage(t,o){let r=await fetch(t,{signal:o});if(!r.ok)throw new Error(`\u0442\u0430\u0439\u043B \u043F\u043E\u0434\u043B\u043E\u0436\u043A\u0438 ${r.status} ${r.statusText}`);return createImageBitmap(await r.blob())}};function rl(i,e){let t=i.replace("{z}",String(e.z)).replace("{x}",String(e.x)).replace("{y}",String(e.y));if(typeof location>"u")return t;try{return new URL(t,location.href).href}catch{return t}}var Rf="osmgl-assets",Ct="assets";var Bo=null;function il(){return Bo||(Bo=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(Rf,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(Ct)||t.createObjectStore(Ct,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),Bo)}function zf(i){return il().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(Ct,"readonly").objectStore(Ct).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function Pf(i){il().then(e=>{if(e)try{e.transaction(Ct,"readwrite").objectStore(Ct).put(i);}catch{}});}var nl=i=>{let e=atob(i),t=new Uint8Array(e.length);for(let o=0;o<e.length;o++)t[o]=e.charCodeAt(o);return t};async function Hf(i,e,t){let o=await crypto.subtle.importKey("raw",nl(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:nl(t),tagLength:128},o,i)}var Qt=class{constructor(e){this.keys=new Map;this.variants=null;this.inflight=new Map;this.endpoint=e.endpoint.replace(/\/+$/,""),this.apiKey=e.apiKey??null;}withKey(e){return this.apiKey?e+(e.includes("?")?"&":"?")+"key="+encodeURIComponent(this.apiKey):e}loadVariants(){return this.variants??(this.variants=fetch(this.withKey(`${this.endpoint}/variants`),{credentials:"same-origin"}).then(e=>e.ok?e.json():{}).catch(()=>({}))),this.variants}async resolve(e,t){return t?(await this.loadVariants())[String(e)]?.[t]??e:e}async load(e,t,o="",r){let n=await this.resolve(e,o),a=`${n}:${t}`,l=this.inflight.get(a);if(l)return l;let s=this.fetchAsset(a,n,t,r).finally(()=>this.inflight.delete(a));return this.inflight.set(a,s),s}async fetchAsset(e,t,o,r){let n,a,l=await zf(e);if(l)n=l.bytes,a=l.encrypted;else {let c=await fetch(this.withKey(`${this.endpoint}/files/${t}/data?lod=${o}`),{signal:r,credentials:"same-origin"});if(!c.ok)throw new Error(`data ${c.status}`);a=(c.headers.get("X-Enc")??"none")!=="none",n=await c.arrayBuffer(),Pf({key:e,bytes:n,encrypted:a,savedAt:Date.now()});}if(!a)return n;let s=await this.getKey(t,r);if(!s)throw new Error("\u043D\u0435\u0442 \u043A\u043B\u044E\u0447\u0430 \u0440\u0430\u0441\u0448\u0438\u0444\u0440\u043E\u0432\u043A\u0438");return Hf(n,s.key,s.iv)}getKey(e,t){let o=this.keys.get(e);if(o)return o;let r=(async()=>{let n=await fetch(this.withKey(`${this.endpoint}/files/${e}/key`),{signal:t,credentials:"same-origin"});if(!n.ok)return null;let a=await n.json();return a.encrypted&&a.key&&a.iv?{key:a.key,iv:a.iv}:null})();return r.catch(()=>this.keys.delete(e)),this.keys.set(e,r),r}};var Of=1,Jt=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=N();this.grow=1;this.growTarget=1;this.animateIn=false;this.shrinkFrom=1;this.growStart=-1;this.fade=1;this.fadeTarget=1;this.fadeFrom=1;this.fadeStart=-1;this.matrix32=new Float32Array(16);this.nodeMatrix32=new Float32Array(16);this.normal32=new Float32Array(9);this.id=e.id??`model-${Of++}`,this.url=e.url,this.fetchBytes=e.fetchBytes,this.coordinates=e.coordinates,this.altitude=e.altitude??0,this.rotation=e.rotation??0,this.rotationTiltX=e.rotationTiltX??0,this.rotationTiltZ=e.rotationTiltZ??0,e.growIn&&(this.animateIn=true,this.grow=0),this.scale=e.scale??1,this.fitHeight=e.fitHeight,this.visible=e.visible!==false,this.userData=e.userData??{};}get isLoaded(){return this.mesh!==null}load(e){return this.loading?(e&&this.loading.then(e),this.loading):(this.loading=(async()=>{try{let t=this.fetchBytes?await this.fetchBytes():await(async()=>{let r=await fetch(this.url);if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.arrayBuffer()})(),o=await Wr(t);this.bitmaps=await Promise.all(o.images.map(async r=>{if(!r.length)return null;try{return await createImageBitmap(new Blob([r]))}catch{return null}})),this.mesh=o;}catch(t){this.error=t instanceof Error?t.message:String(t),console.warn(`[osmgl] \u043C\u043E\u0434\u0435\u043B\u044C ${this.url} \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043B\u0430\u0441\u044C: ${this.error}`);}e?.();})(),this.loading)}advanceGrow(e){if(!this.mesh)return false;if(!this.animateIn&&this.growTarget===1)return this.grow=1,false;if(e<=0)return this.grow=1,false;let t=performance.now()/1e3;this.growStart<0&&(this.growStart=t);let o=(t-this.growStart)/e;if(this.growTarget===0){if(o>=1)return this.grow=0,false;let n=Math.max(o,0);return this.grow=this.shrinkFrom*(1-n*n*(3-2*n)),true}if(o>=1)return this.grow=1,false;let r=Math.max(o,0)-1;return this.grow=1+r*r*(2.70158*r+1.70158),true}retire(){this.growTarget!==0&&(this.growTarget=0,this.shrinkFrom=this.grow,this.growStart=performance.now()/1e3);}setHidden(e){let t=e?0:1;this.fadeTarget!==t&&(this.fadeTarget=t,this.fadeFrom=this.fade,this.fadeStart=performance.now()/1e3);}advanceFade(e){if(this.fadeStart<0)return false;if(e<=0)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let t=(performance.now()/1e3-this.fadeStart)/e;if(t>=1)return this.fade=this.fadeTarget,this.fadeStart=-1,false;let o=Math.max(t,0),r=o*o*(3-2*o);return this.fade=this.fadeFrom+(this.fadeTarget-this.fadeFrom)*r,true}markGrown(){this.grow=1,this.growTarget=1,this.growStart=-1/0;}revive(){this.growTarget!==1&&(this.growTarget=1,this.growStart=performance.now()/1e3-(this.animateIn?0:1e9));}effectiveScale(){if(!this.mesh||this.fitHeight===void 0)return this.scale;let e=this.mesh.max[1]-this.mesh.min[1];return e>1e-6?this.fitHeight/e:this.scale}boundingRadiusM(){let e=this.mesh;if(!e)return 0;let t=this.effectiveScale(),o=Math.max(Math.abs(e.min[0]),Math.abs(e.max[0])),r=Math.max(Math.abs(e.min[1]),Math.abs(e.max[1])),n=Math.max(Math.abs(e.min[2]),Math.abs(e.max[2]));return Math.hypot(o,r,n)*t}origin(){let e=Z(this.coordinates);return {x:oe(e.lng),y:re(e.lat)}}localMatrix(e){let t=this.effectiveScale(),o=t/Le(e),r=[o,0,0,0,0,t*this.grow,0,o,0],n=c=>c*Math.PI/180,a=rn(n(-this.rotation));this.rotationTiltX&&(a=$e(on(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=$e(nn(n(this.rotationTiltZ)),a));let l=$e(r,a),s=this.matrix;return Oe(s),s[0]=l[0],s[1]=l[1],s[2]=l[2],s[4]=l[3],s[5]=l[4],s[6]=l[5],s[8]=l[6],s[9]=l[7],s[10]=l[8],s[15]=1,s}matrixInSpace(e,t){let o=Z(this.coordinates),r=N();for(let a=0;a<16;a++)r[a]=e[a];let n=N();return xe(n,r,this.localMatrix(o.lat)),We(t??this.matrix32,n)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=Z(this.coordinates),n=Le(r.lat),a=e.worldSize,l=e.cameraPositionPx,s=(l[0]/a-o.x)*n,c=(l[1]/a-o.y)*n,f=l[2]/e.pixelsPerMeter-this.altitude,u=s,d=f,h=c,m=p=>p*Math.PI/180,y=rn(m(-this.rotation));return this.rotationTiltX&&(y=$e(on(m(this.rotationTiltX)),y)),this.rotationTiltZ&&(y=$e(nn(m(this.rotationTiltZ)),y)),[(y[0]*u+y[1]*d+y[2]*h)/t,(y[3]*u+y[4]*d+y[5]*h)/t,(y[6]*u+y[7]*d+y[8]*h)/t]}matrixFor(e){let t=this.origin();return this.matrixInSpace(e.objectMatrix(t.x,t.y,this.altitude))}coversPoint(e,t){let o=this.mesh;if(!o)return false;let r=this.origin(),n=e-r.x,a=t-r.y,l=Z(this.coordinates),s=this.localMatrix(l.lat),c=s[0],f=s[1],u=s[8],d=s[9],h=c*d-f*u;if(Math.abs(h)<1e-30)return false;let m=(n*d-a*u)/h,y=(c*a-f*n)/h,p=1.05,b=(o.min[0]+o.max[0])/2,g=(o.min[2]+o.max[2])/2,v=(o.max[0]-o.min[0])/2*p,x=(o.max[2]-o.min[2])/2*p;return Math.abs(m-b)<=v&&Math.abs(y-g)<=x}get isAnimated(){return this.mesh?.animation!=null}matrixForNode(e,t,o){let r=this.origin();return this.matrixInSpaceForNode(e.objectMatrix(r.x,r.y,this.altitude),t,o,this.nodeMatrix32)}matrixInSpaceForNode(e,t,o,r){let n=this.mesh?.animation;if(!n||!n.nodes.has(t))return this.matrixInSpace(e,r);let a=N();for(let u=0;u<16;u++)a[u]=e[u];let l=Z(this.coordinates),s=N();xe(s,a,this.localMatrix(l.lat));let c=N();Br(n,t,n.duration>0?o%n.duration:0,c);let f=N();return xe(f,s,c),We(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=rn(e(-this.rotation));this.rotationTiltX&&(t=$e(on(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=$e(nn(e(this.rotationTiltZ)),t));let o=$e([1,0,0,0,0,1,0,1,0],t),r=this.normal32;for(let n=0;n<9;n++)r[n]=o[n];return r}};function $e(i,e){let t=new Array(9);for(let o=0;o<3;o++)for(let r=0;r<3;r++)t[o*3+r]=i[r]*e[o*3]+i[3+r]*e[o*3+1]+i[6+r]*e[o*3+2];return t}var on=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},rn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},nn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var Do=class{constructor(){this.hit=new B;this.miss=new ee;this.stamp="";}find(e,t){if(!t)return null;let o=this.hit.get(e.id);if(o!==void 0)return o;let r=t.source.visibleTiles.map(n=>n.dataKey).join(",");if(r!==this.stamp&&(this.stamp=r,this.miss.clear()),this.miss.has(e.id))return null;for(let n of t.source.visibleTiles){let a=t.source.getTile(n)?.data?.buckets?.[t.key];if(!a||a.kind!=="fill-extrusion"||!a.featureIds)continue;let l=n.bounds();if(e.mercX<l.minX||e.mercX>l.maxX||e.mercY<l.minY||e.mercY>l.maxY)continue;let s=(e.mercX-l.minX)/(l.maxX-l.minX)*a.extent,c=(e.mercY-l.minY)/(l.maxY-l.minY)*a.extent,f=new Int16Array(a.vertices),u=new Uint32Array(a.indices),d=new Float64Array(a.featureIds),h=f.length/a.vertexCount;for(let m=0;m*3+2<u.length;m++){let y=u[m*3]*h,p=u[m*3+1]*h,b=u[m*3+2]*h;if(!Uf(s,c,f[y],f[y+1],f[p],f[p+1],f[b],f[b+1]))continue;let g=d[m];return this.hit.set(e.id,g),g}}return this.miss.add(e.id),null}clear(){this.hit.clear(),this.miss.clear(),this.stamp="";}},Wf=14,Bf=2e3,Vf=4e3,al=160,Df=50,Gf=4e3,an=6,Go=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new B;this.loading=0;this.pending=[];this.known=new B;this.underBuilding=new Do;this.underVenue=new Do;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=al;this.replacedBuildings=new ee;this.replacedVenues=new ee;this.onReady=null;this.stats={found:0,kept:0,live:0,tooFar:0,overBudget:0,queued:0,rules:0,loadingNow:0,pendingNow:0,replaced:0};this.loader=new Qt(e);}get models(){let e=[];for(let t of this.entries.values())e.push(t.model);return e}update(e,t,o,r,n,a,l){this.wantKey!==this.modelKey&&(this.modelKey=this.wantKey,this.clear(n));let s=e.layout??{},c=s.minZoom??Wf,f=s.loadRadius??Bf,u=Math.max(s.keepRadius??Vf,f),d=Math.min(1,Math.max(.25,(o.zoom-c)/3)),h=Math.max(8,Math.round((s.budget??al)*this.budgetScale*d));this.budget=h,this.addModel=r;let m=s.maskReplaced!==false,y=performance.now();if(o.zoom<c){for(let E of [...this.entries.values()])E.model.retire(),E.model.grow<=0&&this.release(E,n);this.replacedBuildings.clear(),this.replacedVenues.clear();return}let p=o.center,b=this.lodFor(o.zoom,c);this.lod=b;let g="";for(let E of t.visibleTiles)g+=E.dataKey+(t.getTile(E)?.data?"+":"-");let v=this.rulesInScan;if(g!==this.tilesStamp){this.tilesStamp=g;let E=new ee;v=0;for(let F of t.visibleTiles){let P=t.getTile(F)?.data?.buckets?.[e.id];if(!P||!Ma(P))continue;let R=new Int16Array(P.anchors),W=F.bounds(),G=W.maxX-W.minX,O=W.maxY-W.minY;for(let H=0;H<P.props.length;H++){let D=P.props[H],Y=ot(D.file,NaN);if(!Number.isFinite(Y))continue;let $=String(D.kind??"model"),Q=$==="rule"?`t-${D.rid}-${D.oid}`:`m-${D.mid}`;if(E.has(Q))continue;E.add(Q),$==="rule"&&v++;let de=W.minX+R[H*2]/P.extent*G,J=W.minY+R[H*2+1]/P.extent*O,X=Nf(de,J);this.known.set(Q,{id:Q,fileId:Y,lng:X.lng,lat:X.lat,mercX:de,mercY:J,altitude:ot(D.alt,0),scale:ot(D.scale,1),rotation:ot(D.rx,0),tiltX:ot(D.rz,0),tiltZ:ot(D.ry,0),kind:$==="rule"?"rule":"model",target:Vo($==="rule"?D.oid:D.replaces),replaces:m?$==="rule"?Vo(D.oid):String(D.anchor??"replace")==="replace"?Vo(D.replaces):null:null});}}this.rulesInScan=v;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let x=this.found,C=new ee;for(let E of x)E.kind==="model"&&E.target!==null&&C.add(E.target);let S=111320,M=Math.cos(p.lat*Math.PI/180),w=E=>Math.hypot((E.lng-p.lng)*S*M,(E.lat-p.lat)*S);this.replacedBuildings.clear(),this.replacedVenues.clear();let _=new ee,T=[],L=0,k=0;(this.sortedAt===null||Math.hypot((p.lng-this.sortedAt.lng)*S*M,(p.lat-this.sortedAt.lat)*S)>Df)&&(x.sort((E,F)=>w(E)-w(F)),this.sortedAt={lng:p.lng,lat:p.lat});let A=0;for(let E of x){let F=w(E);if(F>u){L++;continue}if(E.kind==="rule"&&E.target!==null&&C.has(E.target)){let G=this.entries.get(E.id);G&&G.model.retire();continue}let P=this.entries.get(E.id);if(A>=h){k++,P&&P.model.retire();continue}A++,_.add(E.id);let R=()=>{if(E.replaces===null)return;this.replacedBuildings.add(E.replaces);let G=this.underBuilding.find(E,a);G!==null&&this.replacedBuildings.add(G);let O=this.underVenue.find(E,l);O!==null&&this.replacedVenues.add(O);},W=P;if(W){R(),W.distance=F,W.leftAt=0,W.model.revive(),b<W.lod&&!W.upgrading&&this.loading<an&&this.upgrade(W,b,r,n);continue}if(F>f){L++;continue}if(this.loading>=an){T.push(E),R();continue}R(),this.spawn(E,F,b,r);}for(let E of [...this.entries.values()])if(!_.has(E.placement.id)){if(E.leftAt===0){E.leftAt=y;continue}y-E.leftAt>Gf&&E.model.retire();}for(let E of [...this.entries.values()])E.model.growTarget===0&&E.model.grow<=0&&this.release(E,n);if(this.known.size>4e3)for(let[E,F]of [...this.known.entries()])w(F)>u*3&&this.known.delete(E);let I=this.stats;I.found=x.length,I.kept=_.size,I.live=this.entries.size,I.tooFar=L,I.overBudget=k,I.queued=T.length,I.rules=v,I.loadingNow=this.loading,I.pendingNow=T.length,I.replaced=this.replacedBuildings.size,this.pending=T;}pump(){let e=this.addModel;if(this.stats.loadingNow=this.loading,this.stats.pendingNow=this.pending.length,!!e)for(;this.pending.length&&this.loading<an&&this.entries.size<this.budget;){let t=this.pending.shift();this.entries.has(t.id)||this.spawn(t,0,this.lod,e);}}lodFor(e,t){return e>=t+2?0:1}upgrade(e,t,o,r){let n=this.makeModel(e.placement,t,true);e.upgrading=n,this.loading++,n.load(()=>{this.loading--,this.pump(),this.entries.get(e.placement.id)===e&&(e.upgrading=null,n.isLoaded&&(r(e.model),e.model=n,e.lod=t,o(n),this.onReady?.()));});}makeModel(e,t,o){let r=new Jt({id:`objects3d-${e.id}`,url:`objects3d:${e.fileId}/${this.modelKey}/lod${t}`,fetchBytes:()=>this.loader.load(e.fileId,t,this.modelKey),coordinates:[e.lng,e.lat],altitude:e.altitude,scale:e.scale,rotation:e.rotation,rotationTiltX:e.tiltX,rotationTiltZ:e.tiltZ,growIn:!o});return o&&r.markGrown(),r}spawn(e,t,o,r,n=false){let a=this.makeModel(e,o,n);this.entries.set(e.id,{placement:e,model:a,distance:t,leftAt:0,lod:o,upgrading:null}),this.loading++,r(a),a.load(()=>{this.loading--,this.pump(),this.onReady?.();});}release(e,t){this.entries.delete(e.placement.id),e.upgrading=null,t(e.model);}setModelKey(e){this.wantKey=e??"";}clear(e){for(let t of [...this.entries.values()])this.release(t,e);this.replacedBuildings.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},ot=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Vo=i=>{let e=ot(i,NaN);return Number.isFinite(e)?e:null};function Nf(i,e){let t=i*360-180,o=Math.PI*(1-2*e),r=Math.atan(Math.sinh(o))*180/Math.PI;return {lng:t,lat:r}}function Uf(i,e,t,o,r,n,a,l){let s=(i-r)*(o-n)-(t-r)*(e-n),c=(i-a)*(n-l)-(r-a)*(e-l),f=(i-t)*(l-o)-(a-t)*(e-o),u=s<0||c<0||f<0,d=s>0||c>0||f>0;return !(u&&d)}var jf=200,Xf={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},eo=class{constructor(e){this.attachedTo=null;this.culled=false;this._visible=true;this._coordinates=e.coordinates,this.altitude=e.altitude??0,this.offset=e.offset??[0,0],this.anchorTransform=Xf[e.anchor??"bottom"],this.userData=e.userData??{};let t=e.element??document.createElement("div");e.element||(t.className="osmgl-marker-default",t.innerHTML=e.html??Yf),t.classList.add("osmgl-marker"),e.className&&t.classList.add(e.className),t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.willChange="transform",e.zIndex!==void 0&&(t.style.zIndex=String(e.zIndex)),this.element=t;}get coordinates(){return this._coordinates}setCoordinates(e){return this._coordinates=e,this}setVisible(e){return this._visible=e,this.applyVisibility(),this}get visible(){return this._visible}attach(e){this.attachedTo!==e&&(e.appendChild(this.element),this.attachedTo=e);}detach(){this.element.remove(),this.attachedTo=null;}update(e){let t=Z(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(oe(t.lng)*o,re(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=jf;if(r.x<-n||r.y<-n||r.x>e.width+n||r.y>e.height+n){this.culled=true,this.applyVisibility();return}this.culled=false,this.applyVisibility(),this.element.style.transform=`translate(${Math.round(r.x+this.offset[0])}px, ${Math.round(r.y+this.offset[1])}px) ${this.anchorTransform}`;}applyVisibility(){this.element.style.display=this._visible&&!this.culled?"":"none";}},Yf='<svg width="24" height="32" viewBox="0 0 24 32" xmlns="http://www.w3.org/2000/svg"><path d="M12 0C5.4 0 0 5.4 0 12c0 9 12 20 12 20s12-11 12-20c0-6.6-5.4-12-12-12z" fill="#2f6df6"/><circle cx="12" cy="12" r="4.5" fill="#fff"/></svg>';var to=class extends eo{constructor(t){let o=document.createElement("div");o.className="osmgl-popup",o.style.pointerEvents="auto";let r=document.createElement("div");if(r.className="osmgl-popup-content",t.element?r.appendChild(t.element):r.innerHTML=t.html??"",o.appendChild(r),t.closeButton!==false){let a=document.createElement("button");a.className="osmgl-popup-close",a.type="button",a.setAttribute("aria-label","\u0417\u0430\u043A\u0440\u044B\u0442\u044C"),a.textContent="\xD7",o.appendChild(a);}let n=document.createElement("div");n.className="osmgl-popup-tip",o.appendChild(n);super({coordinates:t.coordinates,element:o,anchor:t.anchor??"bottom",offset:t.offset??[0,-12],altitude:t.altitude,zIndex:t.zIndex??10,className:t.className,userData:t.userData});this.onClose=null;this.content=r,this.closeOnClick=t.closeOnClick!==false,o.querySelector(".osmgl-popup-close")?.addEventListener("click",()=>this.onClose?.());}onCloseRequest(t){return this.onClose=t,this}setHtml(t){return this.content.innerHTML=t,this}setContent(t){return this.content.replaceChildren(t),this}};var Kf=[["\u0443\u043B\u0438\u0446\u0430","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u044B","\u0443\u043B."],["\u0443\u043B\u0438\u0446\u0435","\u0443\u043B."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0440\u043E\u0441\u043F\u0435\u043A\u0442\u0430","\u043F\u0440\u043E\u0441\u043F."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043E\u043A","\u043F\u0435\u0440."],["\u043F\u0435\u0440\u0435\u0443\u043B\u043A\u0430","\u043F\u0435\u0440."],["\u043F\u0440\u043E\u0435\u0437\u0434","\u043F\u0440-\u0434"],["\u043F\u0440\u043E\u0435\u0437\u0434\u0430","\u043F\u0440-\u0434"],["\u043F\u043B\u043E\u0449\u0430\u0434\u044C","\u043F\u043B."],["\u043F\u043B\u043E\u0449\u0430\u0434\u0438","\u043F\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440","\u0431\u0443\u043B."],["\u0431\u0443\u043B\u044C\u0432\u0430\u0440\u0430","\u0431\u0443\u043B."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u0430\u044F","\u043D\u0430\u0431."],["\u043D\u0430\u0431\u0435\u0440\u0435\u0436\u043D\u043E\u0439","\u043D\u0430\u0431."],["\u0448\u043E\u0441\u0441\u0435","\u0448."],["\u0442\u0443\u043F\u0438\u043A","\u0442\u0443\u043F."],["\u0442\u0443\u043F\u0438\u043A\u0430","\u0442\u0443\u043F."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D","\u043C\u043A\u0440."],["\u043C\u0438\u043A\u0440\u043E\u0440\u0430\u0439\u043E\u043D\u0430","\u043C\u043A\u0440."],["\u043A\u04EF\u0447\u0430\u0438","\u043A."],["\u043A\u0443\u0447\u0430\u0438","\u043A."],["\u0445\u0438\u0451\u0431\u043E\u043D\u0438","\u0445\u0438\u0451\u0431."],["\u0448\u043E\u04B3\u0440\u043E\u04B3\u0438","\u0448\u043E\u04B3."],["\u0433\u0443\u0437\u0430\u0440\u0433\u043E\u04B3\u0438","\u0433\u0443\u0437."],["\u043C\u0430\u0439\u0434\u043E\u043D\u0438","\u043C\u0430\u0439\u0434."]],ll=new Map(Kf);function ln(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=ll.get(n.toLowerCase());return a?(t=true,n[0]===n[0].toUpperCase()?a[0].toUpperCase()+a.slice(1):a):n});return !t||!e.filter(n=>ll.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function cn(i,e){let t=[],o=[],r=[],n=[],a=[],l=e.textPlacement==="line",s=[],c=[],f=[];for(let u of i.features()){if(!pe(e.filter,u.properties))continue;let d=u.loadGeometry(),h=Zf(u.type,d);if(!h)continue;let m=e.textField?sn(e.textField,u.properties):"",y=m&&e.abbreviate?ln(m):m,p=e.iconImage?sn(e.iconImage,u.properties):"";if(!(!y&&!p)){if(l){let b=qf(u.type,d);if(!b)continue;f.push({text:y,line:b});continue}t.push(h[0],h[1]),o.push(y),r.push(p),n.push(Qf(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:u,line:d}of $f(f)){c.push(s.length/2);for(let h of d)s.push(h);t.push(Math.round(d[0]),Math.round(d[1])),o.push(u),r.push(""),n.push(128),a.push(0);}c.push(s.length/2);}return o.length?{anchors:new Int16Array(t).buffer,texts:o,icons:r,priorities:new Uint8Array(n).buffer,rotations:new Int16Array(a).buffer,...l?{lines:new Int16Array(s).buffer,lineStarts:new Uint32Array(c).buffer}:{}}:null}function $f(i){let e=[],t=new Map,o=new Map,r=(n,a,l)=>`${n}\u241F${a}\u241F${l}`;for(let{text:n,line:a}of i){let l=r(n,a[0],a[1]),s=r(n,a[a.length-2],a[a.length-1]),c=t.get(s),f=o.get(l);if(f!==void 0){let u=e[f];if(u.line.push(...a.slice(2)),o.delete(l),o.set(r(n,u.line[u.line.length-2],u.line[u.line.length-1]),f),c!==void 0&&c!==f){let d=e[c];u.line.push(...d.line.slice(2)),d.line=[],t.delete(s),o.set(r(n,u.line[u.line.length-2],u.line[u.line.length-1]),f);}continue}if(c!==void 0){let u=e[c];u.line.unshift(...a.slice(0,a.length-2)),t.delete(s),t.set(r(n,u.line[0],u.line[1]),c);continue}t.set(l,e.length),o.set(s,e.length),e.push({text:n,line:a});}return e.filter(n=>n.line.length>=4)}function qf(i,e){if(i!==2)return null;let t=null,o=0;for(let r of e){if(r.length<4)continue;let n=0;for(let a=0;a+3<r.length;a+=2)n+=Math.hypot(r[a+2]-r[a],r[a+3]-r[a+1]);n>o&&(o=n,t=r);}return t}function Zf(i,e){if(!e.length)return null;if(i===1){let a=e[0];return a.length>=2?[a[0],a[1]]:null}if(i===2){let a=-1,l=0,s=0;for(let c of e)for(let f=0;f+3<c.length;f+=2){let u=c[f+2]-c[f],d=c[f+3]-c[f+1],h=u*u+d*d;h>a&&(a=h,l=c[f]+u/2,s=c[f+1]+d/2);}return a>0?[Math.round(l),Math.round(s)]:null}let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l=0;l<a.length;l+=2)a[l]<t&&(t=a[l]),a[l]>r&&(r=a[l]),a[l+1]<o&&(o=a[l+1]),a[l+1]>n&&(n=a[l+1]);return isFinite(t)?[Math.round((t+r)/2),Math.round((o+n)/2)]:null}function Qf(i){let e=i.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function sn(i,e){let t=Array.isArray(i)?i:[i];for(let o of t){let r=true,a=o.replace(/\{([^}]+)\}/g,(l,s)=>{let c=e[s];return c==null||c===""?(r=false,""):String(c)}).trim();if(r&&a)return a}return ""}function sl(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&pe(e,n.properties))for(let a of n.loadGeometry())for(let l=0;l+1<a.length;l+=2)t.push(a[l],a[l+1]),o.push(n.properties);}return o.length?{anchors:Int16Array.from(t).buffer,props:o}:null}function Jf(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function cl(i,e){let t=performance.now(),o=Jf(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(b,g,v,x,C=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:x,parseMs:C},diag:{status:b,bytes:g,layers:v,built:0}});if(!r.ok){if(r.status===404||r.status===204)return n(r.status,0,[],performance.now()-t);throw new Error(`HTTP ${r.status} \u0434\u043B\u044F ${i.url}`)}let a=await r.arrayBuffer(),l=performance.now()-t;if(a.byteLength===0)return n(r.status,0,[],l);let s=performance.now(),c=new At(a),f=Object.keys(c.layers),u={},d={},h=new Set,m=[],p=i.plan.some(b=>b.type==="surface"&&(b.elevation??0)>0)&&i.plan.some(b=>b.type==="line"&&b.ground)?pr(i.metersPerTile):void 0;for(let b of i.plan){if(!tu(b,i.zoom,i.sourceMaxZoom))continue;let g=c.layers[b.sourceLayer];if(!g)continue;let v=ou(i.zoom,g.extent);try{if(b.splitBy){let C=ru(g,b.splitBy,b.filter);if(!C.length)continue;let S=d[b.splitBy]??(d[b.splitBy]=[]);for(let M of C){S.includes(M)||S.push(M);let w={...b,splitBy:void 0,filter:iu(b.filter,b.splitBy,M)},_=fn(w,g,v,i.metersPerTile,p);_&&(u[He(b.id,M)]=_);}continue}if(b.network&&b.type==="line"){for(let C of nu(g,b.filter)){let S=fn(b,g,v,i.metersPerTile,p,C);S&&(u[He(b.id,C)]=S,h.add(C));}continue}let x=fn(b,g,v,i.metersPerTile,p);x&&(u[b.id]=x);}catch(x){m.push(`${b.id}: ${x instanceof Error?x.message:String(x)}`);}}return {type:"loaded",id:i.id,buckets:u,...Object.keys(d).length?{splits:d}:{},...h.size?{levels:[...h].sort((b,g)=>b-g)}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(u).length,...m.length?{failed:m}:{}}}}function eu(i){return e=>{let t=e.on;if(typeof t!="string"||!t)return 0;let o=0;for(let r of t.split(",")){let n=i[r];typeof n=="number"&&n>o&&(o=n);}return o}}function tu(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function ou(i,e){return i<=6?Math.max(64,e/24):0}function fn(i,e,t,o,r,n){{if(i.type==="fill"){let l=o>0?o/e.extent:0,s=i.cornerRadius&&l>0?{radius:i.cornerRadius/l,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:Yn/l}:void 0,c=cr(e,i.filter,t,s,i.clipToTile===true,e.extent);return c?{kind:"fill",...c,extent:e.extent}:null}if(i.type==="surface"){let l=mr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,maxSegment:t,elevation:i.elevation??0,base:i.base,bevel:i.bevel,weld:i.weld,bevelDrop:i.bevelDrop,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments,...r?{onShapes:s=>br(r,s,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:eu(i.groundBy)}:{}});return l?{kind:"surface",...l}:null}if(i.type==="line"){let l=gr(e,i.filter,t,i.ground?r:void 0,o>0?o/e.extent:0,{level:n});return l?{kind:"line",...l,extent:e.extent}:null}if(i.type==="model"){let l=sl(e,i.filter);return l?{kind:"placement",...l,extent:e.extent}:null}if(i.type==="symbol"){let l=cn(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return l?{kind:"symbol",...l,extent:e.extent}:null}let a=ar(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments});return a?{kind:"fill-extrusion",vertices:a.vertices,indices:a.indices,featureIds:a.featureIds,vertexCount:a.vertexCount,indexCount:a.indexCount,extent:a.extent}:null}}function ru(i,e,t){let o=[];for(let r of i.features()){if(!pe(t,r.properties))continue;let n=r.properties[e];typeof n!="string"&&typeof n!="number"||o.includes(n)||o.push(n);}return o.sort((r,n)=>typeof r=="number"&&typeof n=="number"?r-n:String(r).localeCompare(String(n))),o}function nu(i,e){let t=[];for(let o of i.features()){if(!pe(e,o.properties))continue;let r=et(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function iu(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var un='"use strict";(()=>{var ur=Object.create;var Kt=Object.defineProperty;var lr=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var fr=Object.getPrototypeOf,ar=Object.prototype.hasOwnProperty;var hr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var pr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cr(e))!ar.call(t,i)&&i!==n&&Kt(t,i,{get:()=>e[i],enumerable:!(r=lr(e,i))||r.enumerable});return t};var mr=(t,e,n)=>(n=t!=null?ur(fr(t)):{},pr(e||!t||!t.__esModule?Kt(n,"default",{value:t,enumerable:!0}):n,t));var An=hr((Gt,Nt)=>{(function(t,e){typeof Gt=="object"&&typeof Nt<"u"?Nt.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.polygonClipping=e())})(Gt,function(){"use strict";function t(y,o){var u={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},f,p,h,S;return S={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function v(M){return function(V){return F([M,V])}}function F(M){if(f)throw new TypeError("Generator is already executing.");for(;u;)try{if(f=1,p&&(h=M[0]&2?p.return:M[0]?p.throw||((h=p.return)&&h.call(p),0):p.next)&&!(h=h.call(p,M[1])).done)return h;switch(p=0,h&&(M=[M[0]&2,h.value]),M[0]){case 0:case 1:h=M;break;case 4:return u.label++,{value:M[1],done:!1};case 5:u.label++,p=M[1],M=[0];continue;case 7:M=u.ops.pop(),u.trys.pop();continue;default:if(h=u.trys,!(h=h.length>0&&h[h.length-1])&&(M[0]===6||M[0]===2)){u=0;continue}if(M[0]===3&&(!h||M[1]>h[0]&&M[1]<h[3])){u.label=M[1];break}if(M[0]===6&&u.label<h[1]){u.label=h[1],h=M;break}if(h&&u.label<h[2]){u.label=h[2],u.ops.push(M);break}h[2]&&u.ops.pop(),u.trys.pop();continue}M=o.call(y,u)}catch(V){M=[6,V],p=0}finally{f=h=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}}var e=function(){function y(o,u){this.next=null,this.key=o,this.data=u,this.left=null,this.right=null}return y}();function n(y,o){return y>o?1:y<o?-1:0}function r(y,o,u){for(var f=new e(null,null),p=f,h=f;;){var S=u(y,o.key);if(S<0){if(o.left===null)break;if(u(y,o.left.key)<0){var v=o.left;if(o.left=v.right,v.right=o,o=v,o.left===null)break}h.left=o,h=o,o=o.left}else if(S>0){if(o.right===null)break;if(u(y,o.right.key)>0){var v=o.right;if(o.right=v.left,v.left=o,o=v,o.right===null)break}p.right=o,p=o,o=o.right}else break}return p.right=o.left,h.left=o.right,o.left=f.right,o.right=f.left,o}function i(y,o,u,f){var p=new e(y,o);if(u===null)return p.left=p.right=null,p;u=r(y,u,f);var h=f(y,u.key);return h<0?(p.left=u.left,p.right=u,u.left=null):h>=0&&(p.right=u.right,p.left=u,u.right=null),p}function s(y,o,u){var f=null,p=null;if(o){o=r(y,o,u);var h=u(o.key,y);h===0?(f=o.left,p=o.right):h<0?(p=o.right,o.right=null,f=o):(f=o.left,o.left=null,p=o)}return{left:f,right:p}}function l(y,o,u){return o===null?y:(y===null||(o=r(y.key,o,u),o.left=y),o)}function c(y,o,u,f,p){if(y){f(""+o+(u?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+p(y)+`\n`);var h=o+(u?" ":"\\u2502 ");y.left&&c(y.left,h,!1,f,p),y.right&&c(y.right,h,!0,f,p)}}var a=function(){function y(o){o===void 0&&(o=n),this._root=null,this._size=0,this._comparator=o}return y.prototype.insert=function(o,u){return this._size++,this._root=i(o,u,this._root,this._comparator)},y.prototype.add=function(o,u){var f=new e(o,u);this._root===null&&(f.left=f.right=null,this._size++,this._root=f);var p=this._comparator,h=r(o,this._root,p),S=p(o,h.key);return S===0?this._root=h:(S<0?(f.left=h.left,f.right=h,h.left=null):S>0&&(f.right=h.right,f.left=h,h.right=null),this._size++,this._root=f),this._root},y.prototype.remove=function(o){this._root=this._remove(o,this._root,this._comparator)},y.prototype._remove=function(o,u,f){var p;if(u===null)return null;u=r(o,u,f);var h=f(o,u.key);return h===0?(u.left===null?p=u.right:(p=r(o,u.left,f),p.right=u.right),this._size--,p):u},y.prototype.pop=function(){var o=this._root;if(o){for(;o.left;)o=o.left;return this._root=r(o.key,this._root,this._comparator),this._root=this._remove(o.key,this._root,this._comparator),{key:o.key,data:o.data}}return null},y.prototype.findStatic=function(o){for(var u=this._root,f=this._comparator;u;){var p=f(o,u.key);if(p===0)return u;p<0?u=u.left:u=u.right}return null},y.prototype.find=function(o){return this._root&&(this._root=r(o,this._root,this._comparator),this._comparator(o,this._root.key)!==0)?null:this._root},y.prototype.contains=function(o){for(var u=this._root,f=this._comparator;u;){var p=f(o,u.key);if(p===0)return!0;p<0?u=u.left:u=u.right}return!1},y.prototype.forEach=function(o,u){for(var f=this._root,p=[],h=!1;!h;)f!==null?(p.push(f),f=f.left):p.length!==0?(f=p.pop(),o.call(u,f),f=f.right):h=!0;return this},y.prototype.range=function(o,u,f,p){for(var h=[],S=this._comparator,v=this._root,F;h.length!==0||v;)if(v)h.push(v),v=v.left;else{if(v=h.pop(),F=S(v.key,u),F>0)break;if(S(v.key,o)>=0&&f.call(p,v))return this;v=v.right}return this},y.prototype.keys=function(){var o=[];return this.forEach(function(u){var f=u.key;return o.push(f)}),o},y.prototype.values=function(){var o=[];return this.forEach(function(u){var f=u.data;return o.push(f)}),o},y.prototype.min=function(){return this._root?this.minNode(this._root).key:null},y.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},y.prototype.minNode=function(o){if(o===void 0&&(o=this._root),o)for(;o.left;)o=o.left;return o},y.prototype.maxNode=function(o){if(o===void 0&&(o=this._root),o)for(;o.right;)o=o.right;return o},y.prototype.at=function(o){for(var u=this._root,f=!1,p=0,h=[];!f;)if(u)h.push(u),u=u.left;else if(h.length>0){if(u=h.pop(),p===o)return u;p++,u=u.right}else f=!0;return null},y.prototype.next=function(o){var u=this._root,f=null;if(o.right){for(f=o.right;f.left;)f=f.left;return f}for(var p=this._comparator;u;){var h=p(o.key,u.key);if(h===0)break;h<0?(f=u,u=u.left):u=u.right}return f},y.prototype.prev=function(o){var u=this._root,f=null;if(o.left!==null){for(f=o.left;f.right;)f=f.right;return f}for(var p=this._comparator;u;){var h=p(o.key,u.key);if(h===0)break;h<0?u=u.left:(f=u,u=u.right)}return f},y.prototype.clear=function(){return this._root=null,this._size=0,this},y.prototype.toList=function(){return g(this._root)},y.prototype.load=function(o,u,f){u===void 0&&(u=[]),f===void 0&&(f=!1);var p=o.length,h=this._comparator;if(f&&E(o,u,0,p-1,h),this._root===null)this._root=m(o,u,0,p),this._size=p;else{var S=b(this.toList(),x(o,u),h);p=this._size+p,this._root=d({head:S},0,p)}return this},y.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(y.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(y.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),y.prototype.toString=function(o){o===void 0&&(o=function(f){return String(f.key)});var u=[];return c(this._root,"",!0,function(f){return u.push(f)},o),u.join("")},y.prototype.update=function(o,u,f){var p=this._comparator,h=s(o,this._root,p),S=h.left,v=h.right;p(o,u)<0?v=i(u,f,v,p):S=i(u,f,S,p),this._root=l(S,v,p)},y.prototype.split=function(o){return s(o,this._root,this._comparator)},y.prototype[Symbol.iterator]=function(){var o,u,f;return t(this,function(p){switch(p.label){case 0:o=this._root,u=[],f=!1,p.label=1;case 1:return f?[3,6]:o===null?[3,2]:(u.push(o),o=o.left,[3,5]);case 2:return u.length===0?[3,4]:(o=u.pop(),[4,o]);case 3:return p.sent(),o=o.right,[3,5];case 4:f=!0,p.label=5;case 5:return[3,1];case 6:return[2]}})},y}();function m(y,o,u,f){var p=f-u;if(p>0){var h=u+Math.floor(p/2),S=y[h],v=o[h],F=new e(S,v);return F.left=m(y,o,u,h),F.right=m(y,o,h+1,f),F}return null}function x(y,o){for(var u=new e(null,null),f=u,p=0;p<y.length;p++)f=f.next=new e(y[p],o[p]);return f.next=null,u.next}function g(y){for(var o=y,u=[],f=!1,p=new e(null,null),h=p;!f;)o?(u.push(o),o=o.left):u.length>0?(o=h=h.next=u.pop(),o=o.right):f=!0;return h.next=null,p.next}function d(y,o,u){var f=u-o;if(f>0){var p=o+Math.floor(f/2),h=d(y,o,p),S=y.head;return S.left=h,y.head=y.head.next,S.right=d(y,p+1,u),S}return null}function b(y,o,u){for(var f=new e(null,null),p=f,h=y,S=o;h!==null&&S!==null;)u(h.key,S.key)<0?(p.next=h,h=h.next):(p.next=S,S=S.next),p=p.next;return h!==null?p.next=h:S!==null&&(p.next=S),f.next}function E(y,o,u,f,p){if(!(u>=f)){for(var h=y[u+f>>1],S=u-1,v=f+1;;){do S++;while(p(y[S],h)<0);do v--;while(p(y[v],h)>0);if(S>=v)break;var F=y[S];y[S]=y[v],y[v]=F,F=o[S],o[S]=o[v],o[v]=F}E(y,o,u,v,p),E(y,o,v+1,f,p)}}let A=(y,o)=>y.ll.x<=o.x&&o.x<=y.ur.x&&y.ll.y<=o.y&&o.y<=y.ur.y,_=(y,o)=>{if(o.ur.x<y.ll.x||y.ur.x<o.ll.x||o.ur.y<y.ll.y||y.ur.y<o.ll.y)return null;let u=y.ll.x<o.ll.x?o.ll.x:y.ll.x,f=y.ur.x<o.ur.x?y.ur.x:o.ur.x,p=y.ll.y<o.ll.y?o.ll.y:y.ll.y,h=y.ur.y<o.ur.y?y.ur.y:o.ur.y;return{ll:{x:u,y:p},ur:{x:f,y:h}}},R=Number.EPSILON;R===void 0&&(R=Math.pow(2,-52));let L=R*R,k=(y,o)=>{if(-R<y&&y<R&&-R<o&&o<R)return 0;let u=y-o;return u*u<L*y*o?0:y<o?-1:1};class T{constructor(){this.reset()}reset(){this.xRounder=new O,this.yRounder=new O}round(o,u){return{x:this.xRounder.round(o),y:this.yRounder.round(u)}}}class O{constructor(){this.tree=new a,this.round(0)}round(o){let u=this.tree.add(o),f=this.tree.prev(u);if(f!==null&&k(u.key,f.key)===0)return this.tree.remove(o),f.key;let p=this.tree.next(u);return p!==null&&k(u.key,p.key)===0?(this.tree.remove(o),p.key):o}}let D=new T,U=11102230246251565e-32,P=134217729,C=(3+8*U)*U;function Y(y,o,u,f,p){let h,S,v,F,M=o[0],V=f[0],w=0,I=0;V>M==V>-M?(h=M,M=o[++w]):(h=V,V=f[++I]);let B=0;if(w<y&&I<u)for(V>M==V>-M?(S=M+h,v=h-(S-M),M=o[++w]):(S=V+h,v=h-(S-V),V=f[++I]),h=S,v!==0&&(p[B++]=v);w<y&&I<u;)V>M==V>-M?(S=h+M,F=S-h,v=h-(S-F)+(M-F),M=o[++w]):(S=h+V,F=S-h,v=h-(S-F)+(V-F),V=f[++I]),h=S,v!==0&&(p[B++]=v);for(;w<y;)S=h+M,F=S-h,v=h-(S-F)+(M-F),M=o[++w],h=S,v!==0&&(p[B++]=v);for(;I<u;)S=h+V,F=S-h,v=h-(S-F)+(V-F),V=f[++I],h=S,v!==0&&(p[B++]=v);return(h!==0||B===0)&&(p[B++]=h),B}function Q(y,o){let u=o[0];for(let f=1;f<y;f++)u+=o[f];return u}function Z(y){return new Float64Array(y)}let re=(3+16*U)*U,X=(2+12*U)*U,$=(9+64*U)*U*U,z=Z(4),N=Z(8),q=Z(12),te=Z(16),K=Z(4);function oe(y,o,u,f,p,h,S){let v,F,M,V,w,I,B,H,G,W,j,ne,ae,ue,he,pe,ge,me,Se=y-p,Ee=u-p,Me=o-h,Re=f-h;ue=Se*Re,I=P*Se,B=I-(I-Se),H=Se-B,I=P*Re,G=I-(I-Re),W=Re-G,he=H*W-(ue-B*G-H*G-B*W),pe=Me*Ee,I=P*Me,B=I-(I-Me),H=Me-B,I=P*Ee,G=I-(I-Ee),W=Ee-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,z[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,z[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,z[2]=ne-(me-w)+(j-w),z[3]=me;let ke=Q(4,z),Je=X*S;if(ke>=Je||-ke>=Je||(w=y-Se,v=y-(Se+w)+(w-p),w=u-Ee,M=u-(Ee+w)+(w-p),w=o-Me,F=o-(Me+w)+(w-h),w=f-Re,V=f-(Re+w)+(w-h),v===0&&F===0&&M===0&&V===0)||(Je=$*S+C*Math.abs(ke),ke+=Se*V+Re*v-(Me*M+Ee*F),ke>=Je||-ke>=Je))return ke;ue=v*Re,I=P*v,B=I-(I-v),H=v-B,I=P*Re,G=I-(I-Re),W=Re-G,he=H*W-(ue-B*G-H*G-B*W),pe=F*Ee,I=P*F,B=I-(I-F),H=F-B,I=P*Ee,G=I-(I-Ee),W=Ee-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,K[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,K[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,K[2]=ne-(me-w)+(j-w),K[3]=me;let ir=Y(4,z,4,K,N);ue=Se*V,I=P*Se,B=I-(I-Se),H=Se-B,I=P*V,G=I-(I-V),W=V-G,he=H*W-(ue-B*G-H*G-B*W),pe=Me*M,I=P*Me,B=I-(I-Me),H=Me-B,I=P*M,G=I-(I-M),W=M-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,K[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,K[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,K[2]=ne-(me-w)+(j-w),K[3]=me;let or=Y(ir,N,4,K,q);ue=v*V,I=P*v,B=I-(I-v),H=v-B,I=P*V,G=I-(I-V),W=V-G,he=H*W-(ue-B*G-H*G-B*W),pe=F*M,I=P*F,B=I-(I-F),H=F-B,I=P*M,G=I-(I-M),W=M-G,ge=H*W-(pe-B*G-H*G-B*W),j=he-ge,w=he-j,K[0]=he-(j+w)+(w-ge),ne=ue+j,w=ne-ue,ae=ue-(ne-w)+(j-w),j=ae-pe,w=ae-j,K[1]=ae-(j+w)+(w-pe),me=ne+j,w=me-ne,K[2]=ne-(me-w)+(j-w),K[3]=me;let sr=Y(or,q,4,K,te);return te[sr-1]}function ee(y,o,u,f,p,h){let S=(o-h)*(u-p),v=(y-p)*(f-h),F=S-v,M=Math.abs(S+v);return Math.abs(F)>=re*M?F:-oe(y,o,u,f,p,h,M)}let J=(y,o)=>y.x*o.y-y.y*o.x,fe=(y,o)=>y.x*o.x+y.y*o.y,be=(y,o,u)=>{let f=ee(y.x,y.y,o.x,o.y,u.x,u.y);return f>0?-1:f<0?1:0},de=y=>Math.sqrt(fe(y,y)),Fe=(y,o,u)=>{let f={x:o.x-y.x,y:o.y-y.y},p={x:u.x-y.x,y:u.y-y.y};return J(p,f)/de(p)/de(f)},Ce=(y,o,u)=>{let f={x:o.x-y.x,y:o.y-y.y},p={x:u.x-y.x,y:u.y-y.y};return fe(p,f)/de(p)/de(f)},Le=(y,o,u)=>o.y===0?null:{x:y.x+o.x/o.y*(u-y.y),y:u},Ve=(y,o,u)=>o.x===0?null:{x:u,y:y.y+o.y/o.x*(u-y.x)},we=(y,o,u,f)=>{if(o.x===0)return Ve(u,f,y.x);if(f.x===0)return Ve(y,o,u.x);if(o.y===0)return Le(u,f,y.y);if(f.y===0)return Le(y,o,u.y);let p=J(o,f);if(p==0)return null;let h={x:u.x-y.x,y:u.y-y.y},S=J(h,o)/p,v=J(h,f)/p,F=y.x+v*o.x,M=u.x+S*f.x,V=y.y+v*o.y,w=u.y+S*f.y,I=(F+M)/2,B=(V+w)/2;return{x:I,y:B}};class se{static compare(o,u){let f=se.comparePoints(o.point,u.point);return f!==0?f:(o.point!==u.point&&o.link(u),o.isLeft!==u.isLeft?o.isLeft?1:-1:xe.compare(o.segment,u.segment))}static comparePoints(o,u){return o.x<u.x?-1:o.x>u.x?1:o.y<u.y?-1:o.y>u.y?1:0}constructor(o,u){o.events===void 0?o.events=[this]:o.events.push(this),this.point=o,this.isLeft=u}link(o){if(o.point===this.point)throw new Error("Tried to link already linked events");let u=o.point.events;for(let f=0,p=u.length;f<p;f++){let h=u[f];this.point.events.push(h),h.point=this.point}this.checkForConsuming()}checkForConsuming(){let o=this.point.events.length;for(let u=0;u<o;u++){let f=this.point.events[u];if(f.segment.consumedBy===void 0)for(let p=u+1;p<o;p++){let h=this.point.events[p];h.consumedBy===void 0&&f.otherSE.point.events===h.otherSE.point.events&&f.segment.consume(h.segment)}}}getAvailableLinkedEvents(){let o=[];for(let u=0,f=this.point.events.length;u<f;u++){let p=this.point.events[u];p!==this&&!p.segment.ringOut&&p.segment.isInResult()&&o.push(p)}return o}getLeftmostComparator(o){let u=new Map,f=p=>{let h=p.otherSE;u.set(p,{sine:Fe(this.point,o.point,h.point),cosine:Ce(this.point,o.point,h.point)})};return(p,h)=>{u.has(p)||f(p),u.has(h)||f(h);let{sine:S,cosine:v}=u.get(p),{sine:F,cosine:M}=u.get(h);return S>=0&&F>=0?v<M?1:v>M?-1:0:S<0&&F<0?v<M?-1:v>M?1:0:F<S?-1:F>S?1:0}}}let Pe=0;class xe{static compare(o,u){let f=o.leftSE.point.x,p=u.leftSE.point.x,h=o.rightSE.point.x,S=u.rightSE.point.x;if(S<f)return 1;if(h<p)return-1;let v=o.leftSE.point.y,F=u.leftSE.point.y,M=o.rightSE.point.y,V=u.rightSE.point.y;if(f<p){if(F<v&&F<M)return 1;if(F>v&&F>M)return-1;let w=o.comparePoint(u.leftSE.point);if(w<0)return 1;if(w>0)return-1;let I=u.comparePoint(o.rightSE.point);return I!==0?I:-1}if(f>p){if(v<F&&v<V)return-1;if(v>F&&v>V)return 1;let w=u.comparePoint(o.leftSE.point);if(w!==0)return w;let I=o.comparePoint(u.rightSE.point);return I<0?1:I>0?-1:1}if(v<F)return-1;if(v>F)return 1;if(h<S){let w=u.comparePoint(o.rightSE.point);if(w!==0)return w}if(h>S){let w=o.comparePoint(u.rightSE.point);if(w<0)return 1;if(w>0)return-1}if(h!==S){let w=M-v,I=h-f,B=V-F,H=S-p;if(w>I&&B<H)return 1;if(w<I&&B>H)return-1}return h>S?1:h<S||M<V?-1:M>V?1:o.id<u.id?-1:o.id>u.id?1:0}constructor(o,u,f,p){this.id=++Pe,this.leftSE=o,o.segment=this,o.otherSE=u,this.rightSE=u,u.segment=this,u.otherSE=o,this.rings=f,this.windings=p}static fromRing(o,u,f){let p,h,S,v=se.comparePoints(o,u);if(v<0)p=o,h=u,S=1;else if(v>0)p=u,h=o,S=-1;else throw new Error(`Tried to create degenerate segment at [${o.x}, ${o.y}]`);let F=new se(p,!0),M=new se(h,!1);return new xe(F,M,[f],[S])}replaceRightSE(o){this.rightSE=o,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let o=this.leftSE.point.y,u=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:o<u?o:u},ur:{x:this.rightSE.point.x,y:o>u?o:u}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(o){return o.x===this.leftSE.point.x&&o.y===this.leftSE.point.y||o.x===this.rightSE.point.x&&o.y===this.rightSE.point.y}comparePoint(o){if(this.isAnEndpoint(o))return 0;let u=this.leftSE.point,f=this.rightSE.point,p=this.vector();if(u.x===f.x)return o.x===u.x?0:o.x<u.x?1:-1;let h=(o.y-u.y)/p.y,S=u.x+h*p.x;if(o.x===S)return 0;let v=(o.x-u.x)/p.x,F=u.y+v*p.y;return o.y===F?0:o.y<F?-1:1}getIntersection(o){let u=this.bbox(),f=o.bbox(),p=_(u,f);if(p===null)return null;let h=this.leftSE.point,S=this.rightSE.point,v=o.leftSE.point,F=o.rightSE.point,M=A(u,v)&&this.comparePoint(v)===0,V=A(f,h)&&o.comparePoint(h)===0,w=A(u,F)&&this.comparePoint(F)===0,I=A(f,S)&&o.comparePoint(S)===0;if(V&&M)return I&&!w?S:!I&&w?F:null;if(V)return w&&h.x===F.x&&h.y===F.y?null:h;if(M)return I&&S.x===v.x&&S.y===v.y?null:v;if(I&&w)return null;if(I)return S;if(w)return F;let B=we(h,this.vector(),v,o.vector());return B===null||!A(p,B)?null:D.round(B.x,B.y)}split(o){let u=[],f=o.events!==void 0,p=new se(o,!0),h=new se(o,!1),S=this.rightSE;this.replaceRightSE(h),u.push(h),u.push(p);let v=new xe(p,S,this.rings.slice(),this.windings.slice());return se.comparePoints(v.leftSE.point,v.rightSE.point)>0&&v.swapEvents(),se.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),f&&(p.checkForConsuming(),h.checkForConsuming()),u}swapEvents(){let o=this.rightSE;this.rightSE=this.leftSE,this.leftSE=o,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let u=0,f=this.windings.length;u<f;u++)this.windings[u]*=-1}consume(o){let u=this,f=o;for(;u.consumedBy;)u=u.consumedBy;for(;f.consumedBy;)f=f.consumedBy;let p=xe.compare(u,f);if(p!==0){if(p>0){let h=u;u=f,f=h}if(u.prev===f){let h=u;u=f,f=h}for(let h=0,S=f.rings.length;h<S;h++){let v=f.rings[h],F=f.windings[h],M=u.rings.indexOf(v);M===-1?(u.rings.push(v),u.windings.push(F)):u.windings[M]+=F}f.rings=null,f.windings=null,f.consumedBy=u,f.leftSE.consumedBy=u.leftSE,f.rightSE.consumedBy=u.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let o=this.prev.consumedBy||this.prev;this._beforeState=o.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let o=this.beforeState();this._afterState={rings:o.rings.slice(0),windings:o.windings.slice(0),multiPolys:[]};let u=this._afterState.rings,f=this._afterState.windings,p=this._afterState.multiPolys;for(let v=0,F=this.rings.length;v<F;v++){let M=this.rings[v],V=this.windings[v],w=u.indexOf(M);w===-1?(u.push(M),f.push(V)):f[w]+=V}let h=[],S=[];for(let v=0,F=u.length;v<F;v++){if(f[v]===0)continue;let M=u[v],V=M.poly;if(S.indexOf(V)===-1)if(M.isExterior)h.push(V);else{S.indexOf(V)===-1&&S.push(V);let w=h.indexOf(M.poly);w!==-1&&h.splice(w,1)}}for(let v=0,F=h.length;v<F;v++){let M=h[v].multiPoly;p.indexOf(M)===-1&&p.push(M)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let o=this.beforeState().multiPolys,u=this.afterState().multiPolys;switch(ve.type){case"union":{let f=o.length===0,p=u.length===0;this._isInResult=f!==p;break}case"intersection":{let f,p;o.length<u.length?(f=o.length,p=u.length):(f=u.length,p=o.length),this._isInResult=p===ve.numMultiPolys&&f<p;break}case"xor":{let f=Math.abs(o.length-u.length);this._isInResult=f%2===1;break}case"difference":{let f=p=>p.length===1&&p[0].isSubject;this._isInResult=f(o)!==f(u);break}default:throw new Error(`Unrecognized operation type found ${ve.type}`)}return this._isInResult}}class Be{constructor(o,u,f){if(!Array.isArray(o)||o.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=u,this.isExterior=f,this.segments=[],typeof o[0][0]!="number"||typeof o[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let p=D.round(o[0][0],o[0][1]);this.bbox={ll:{x:p.x,y:p.y},ur:{x:p.x,y:p.y}};let h=p;for(let S=1,v=o.length;S<v;S++){if(typeof o[S][0]!="number"||typeof o[S][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let F=D.round(o[S][0],o[S][1]);F.x===h.x&&F.y===h.y||(this.segments.push(xe.fromRing(h,F,this)),F.x<this.bbox.ll.x&&(this.bbox.ll.x=F.x),F.y<this.bbox.ll.y&&(this.bbox.ll.y=F.y),F.x>this.bbox.ur.x&&(this.bbox.ur.x=F.x),F.y>this.bbox.ur.y&&(this.bbox.ur.y=F.y),h=F)}(p.x!==h.x||p.y!==h.y)&&this.segments.push(xe.fromRing(h,p,this))}getSweepEvents(){let o=[];for(let u=0,f=this.segments.length;u<f;u++){let p=this.segments[u];o.push(p.leftSE),o.push(p.rightSE)}return o}}class Oe{constructor(o,u){if(!Array.isArray(o))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Be(o[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let f=1,p=o.length;f<p;f++){let h=new Be(o[f],this,!1);h.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=h.bbox.ll.x),h.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=h.bbox.ll.y),h.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=h.bbox.ur.x),h.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=h.bbox.ur.y),this.interiorRings.push(h)}this.multiPoly=u}getSweepEvents(){let o=this.exteriorRing.getSweepEvents();for(let u=0,f=this.interiorRings.length;u<f;u++){let p=this.interiorRings[u].getSweepEvents();for(let h=0,S=p.length;h<S;h++)o.push(p[h])}return o}}class De{constructor(o,u){if(!Array.isArray(o))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof o[0][0][0]=="number"&&(o=[o])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let f=0,p=o.length;f<p;f++){let h=new Oe(o[f],this);h.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=h.bbox.ll.x),h.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=h.bbox.ll.y),h.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=h.bbox.ur.x),h.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=h.bbox.ur.y),this.polys.push(h)}this.isSubject=u}getSweepEvents(){let o=[];for(let u=0,f=this.polys.length;u<f;u++){let p=this.polys[u].getSweepEvents();for(let h=0,S=p.length;h<S;h++)o.push(p[h])}return o}}class Ie{static factory(o){let u=[];for(let f=0,p=o.length;f<p;f++){let h=o[f];if(!h.isInResult()||h.ringOut)continue;let S=null,v=h.leftSE,F=h.rightSE,M=[v],V=v.point,w=[];for(;S=v,v=F,M.push(v),v.point!==V;)for(;;){let I=v.getAvailableLinkedEvents();if(I.length===0){let G=M[0].point,W=M[M.length-1].point;throw new Error(`Unable to complete output ring starting at [${G.x}, ${G.y}]. Last matching segment found ends at [${W.x}, ${W.y}].`)}if(I.length===1){F=I[0].otherSE;break}let B=null;for(let G=0,W=w.length;G<W;G++)if(w[G].point===v.point){B=G;break}if(B!==null){let G=w.splice(B)[0],W=M.splice(G.index);W.unshift(W[0].otherSE),u.push(new Ie(W.reverse()));continue}w.push({index:M.length,point:v.point});let H=v.getLeftmostComparator(S);F=I.sort(H)[0].otherSE;break}u.push(new Ie(M))}return u}constructor(o){this.events=o;for(let u=0,f=o.length;u<f;u++)o[u].segment.ringOut=this;this.poly=null}getGeom(){let o=this.events[0].point,u=[o];for(let M=1,V=this.events.length-1;M<V;M++){let w=this.events[M].point,I=this.events[M+1].point;be(w,o,I)!==0&&(u.push(w),o=w)}if(u.length===1)return null;let f=u[0],p=u[1];be(f,o,p)===0&&u.shift(),u.push(u[0]);let h=this.isExteriorRing()?1:-1,S=this.isExteriorRing()?0:u.length-1,v=this.isExteriorRing()?u.length:-1,F=[];for(let M=S;M!=v;M+=h)F.push([u[M].x,u[M].y]);return F}isExteriorRing(){if(this._isExteriorRing===void 0){let o=this.enclosingRing();this._isExteriorRing=o?!o.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let o=this.events[0];for(let p=1,h=this.events.length;p<h;p++){let S=this.events[p];se.compare(o,S)>0&&(o=S)}let u=o.segment.prevInResult(),f=u?u.prevInResult():null;for(;;){if(!u)return null;if(!f)return u.ringOut;if(f.ringOut!==u.ringOut)return f.ringOut.enclosingRing()!==u.ringOut?u.ringOut:u.ringOut.enclosingRing();u=f.prevInResult(),f=u?u.prevInResult():null}}}class ze{constructor(o){this.exteriorRing=o,o.poly=this,this.interiorRings=[]}addInterior(o){this.interiorRings.push(o),o.poly=this}getGeom(){let o=[this.exteriorRing.getGeom()];if(o[0]===null)return null;for(let u=0,f=this.interiorRings.length;u<f;u++){let p=this.interiorRings[u].getGeom();p!==null&&o.push(p)}return o}}class vt{constructor(o){this.rings=o,this.polys=this._composePolys(o)}getGeom(){let o=[];for(let u=0,f=this.polys.length;u<f;u++){let p=this.polys[u].getGeom();p!==null&&o.push(p)}return o}_composePolys(o){let u=[];for(let f=0,p=o.length;f<p;f++){let h=o[f];if(!h.poly)if(h.isExteriorRing())u.push(new ze(h));else{let S=h.enclosingRing();S.poly||u.push(new ze(S)),S.poly.addInterior(h)}}return u}}class ft{constructor(o){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:xe.compare;this.queue=o,this.tree=new a(u),this.segments=[]}process(o){let u=o.segment,f=[];if(o.consumedBy)return o.isLeft?this.queue.remove(o.otherSE):this.tree.remove(u),f;let p=o.isLeft?this.tree.add(u):this.tree.find(u);if(!p)throw new Error(`Unable to find segment #${u.id} [${u.leftSE.point.x}, ${u.leftSE.point.y}] -> [${u.rightSE.point.x}, ${u.rightSE.point.y}] in SweepLine tree.`);let h=p,S=p,v,F;for(;v===void 0;)h=this.tree.prev(h),h===null?v=null:h.key.consumedBy===void 0&&(v=h.key);for(;F===void 0;)S=this.tree.next(S),S===null?F=null:S.key.consumedBy===void 0&&(F=S.key);if(o.isLeft){let M=null;if(v){let w=v.getIntersection(u);if(w!==null&&(u.isAnEndpoint(w)||(M=w),!v.isAnEndpoint(w))){let I=this._splitSafely(v,w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}}let V=null;if(F){let w=F.getIntersection(u);if(w!==null&&(u.isAnEndpoint(w)||(V=w),!F.isAnEndpoint(w))){let I=this._splitSafely(F,w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}}if(M!==null||V!==null){let w=null;M===null?w=V:V===null?w=M:w=se.comparePoints(M,V)<=0?M:V,this.queue.remove(u.rightSE),f.push(u.rightSE);let I=u.split(w);for(let B=0,H=I.length;B<H;B++)f.push(I[B])}f.length>0?(this.tree.remove(u),f.push(o)):(this.segments.push(u),u.prev=v)}else{if(v&&F){let M=v.getIntersection(F);if(M!==null){if(!v.isAnEndpoint(M)){let V=this._splitSafely(v,M);for(let w=0,I=V.length;w<I;w++)f.push(V[w])}if(!F.isAnEndpoint(M)){let V=this._splitSafely(F,M);for(let w=0,I=V.length;w<I;w++)f.push(V[w])}}}this.tree.remove(u)}return f}_splitSafely(o,u){this.tree.remove(o);let f=o.rightSE;this.queue.remove(f);let p=o.split(u);return p.push(f),o.consumedBy===void 0&&this.tree.add(o),p}}let Qt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,tr=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class nr{run(o,u,f){ve.type=o,D.reset();let p=[new De(u,!0)];for(let w=0,I=f.length;w<I;w++)p.push(new De(f[w],!1));if(ve.numMultiPolys=p.length,ve.type==="difference"){let w=p[0],I=1;for(;I<p.length;)_(p[I].bbox,w.bbox)!==null?I++:p.splice(I,1)}if(ve.type==="intersection")for(let w=0,I=p.length;w<I;w++){let B=p[w];for(let H=w+1,G=p.length;H<G;H++)if(_(B.bbox,p[H].bbox)===null)return[]}let h=new a(se.compare);for(let w=0,I=p.length;w<I;w++){let B=p[w].getSweepEvents();for(let H=0,G=B.length;H<G;H++)if(h.insert(B[H]),h.size>Qt)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let S=new ft(h),v=h.size,F=h.pop();for(;F;){let w=F.key;if(h.size===v){let B=w.segment;throw new Error(`Unable to pop() ${w.isLeft?"left":"right"} SweepEvent [${w.point.x}, ${w.point.y}] from segment #${B.id} [${B.leftSE.point.x}, ${B.leftSE.point.y}] -> [${B.rightSE.point.x}, ${B.rightSE.point.y}] from queue.`)}if(h.size>Qt)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(S.segments.length>tr)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let I=S.process(w);for(let B=0,H=I.length;B<H;B++){let G=I[B];G.consumedBy===void 0&&h.insert(G)}v=h.size,F=h.pop()}D.reset();let M=Ie.factory(S.segments);return new vt(M).getGeom()}}let ve=new nr;var rr={union:function(y){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("union",y,u)},intersection:function(y){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("intersection",y,u)},xor:function(y){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("xor",y,u)},difference:function(y){for(var o=arguments.length,u=new Array(o>1?o-1:0),f=1;f<o;f++)u[f-1]=arguments[f];return ve.run("difference",y,u)}};return rr})});var nt=new Set,St=!1;function Te(t,e,n=2){let r=e&&e.length,i=r?e[0]*n:t.length;nt.size&&nt.clear();let s=tn(t,0,i,n,!0),l=[];if(!s||s.next===s.prev)return l;let c=0,a=0,m=0;if(r&&(s=br(t,e,s,n)),t.length>80*n){c=t[0],a=t[1];let x=c,g=a;for(let d=n;d<i;d+=n){let b=t[d],E=t[d+1];b<c&&(c=b),E<a&&(a=E),b>x&&(x=b),E>g&&(g=E)}m=Math.max(x-c,g-a),m=m!==0?32767/m:0}return Et(s,l,c,a,m),l}function tn(t,e,n,r,i){let s=null;if(i===Lr(t,e,n,r)>0)for(let l=e;l<n;l+=r)s=en(l/r|0,t[l],t[l+1],s);else for(let l=n-r;l>=e;l-=r)s=en(l/r|0,t[l],t[l+1],s);return s&&rt(s,s.next)&&(ot(s),s=s.next),s}function Ge(t,e=t){let n=e===t,r=t,i;do i=!1,r!==r.next&&(nt.size===0||!nt.has(r))&&(rt(r,r.next)||le(r.prev,r,r.next)===0)?((n||r===e)&&(e=r.prev),St=!0,ot(r),r=r.prev,i=!0):(n||r!==e)&&(r=r.next,i=!n);while(i||r!==e);return e}function Et(t,e,n,r,i){i&&Fr(t,n,r,i);let s=t,l=!1;for(;t.prev!==t.next;){let c=t.prev,a=t.next;if(le(c,t,a)<0&&(i?dr(t,n,r,i):xr(t))){e.push(c.i,t.i,a.i),ot(t),t=a,s=a;continue}if(t=a,t===s){if(St=!1,t=Ge(t),St){s=t;continue}if(!l){t=gr(t,e),s=t,l=!0;continue}yr(t,e,n,r,i);break}}}function xr(t){let e=t.prev,n=t,r=t.next,i=e.x,s=n.x,l=r.x,c=e.y,a=n.y,m=r.y,x=Math.min(i,s,l),g=Math.min(c,a,m),d=Math.max(i,s,l),b=Math.max(c,a,m),E=r.next;for(;E!==e;){if(E.x>=x&&E.x<=d&&E.y>=g&&E.y<=b&&!(i===E.x&&c===E.y)&&mt(i,c,s,a,l,m,E.x,E.y)&&le(E.prev,E,E.next)>=0)return!1;E=E.next}return!0}function dr(t,e,n,r){let i=t.prev,s=t,l=t.next,c=i.x,a=s.x,m=l.x,x=i.y,g=s.y,d=l.y,b=Math.min(c,a,m),E=Math.min(x,g,d),A=Math.max(c,a,m),_=Math.max(x,g,d),R=It(b,E,e,n,r),L=It(A,_,e,n,r),k=t.prevZ;for(;k&&k.z>=R;){if(k.x>=b&&k.x<=A&&k.y>=E&&k.y<=_&&k!==l&&!(c===k.x&&x===k.y)&&mt(c,x,a,g,m,d,k.x,k.y)&&le(k.prev,k,k.next)>=0)return!1;k=k.prevZ}let T=t.nextZ;for(;T&&T.z<=L;){if(T.x>=b&&T.x<=A&&T.y>=E&&T.y<=_&&T!==l&&!(c===T.x&&x===T.y)&&mt(c,x,a,g,m,d,T.x,T.y)&&le(T.prev,T,T.next)>=0)return!1;T=T.nextZ}return!0}function gr(t,e){let n=t,r=!1;do{let i=n.prev,s=n.next.next;on(i,n,n.next,s,!1)&&it(i,s)&&it(s,i)&&(e.push(i.i,n.i,s.i),ot(n),ot(n.next),n=t=s,r=!0),n=n.next}while(n!==t);return r?Ge(n):n}function yr(t,e,n,r,i){let s=t;do{let l=s.next.next;for(;l!==s.prev;){if(s.i!==l.i&&kr(s,l)){let c=sn(s,l);s=Ge(s,s.next),c=Ge(c,c.next),Et(s,e,n,r,i),Et(c,e,n,r,i);return}l=l.next}s=s.next}while(s!==t)}var Mt=!1;function br(t,e,n,r){let i=[];for(let s=0,l=e.length;s<l;s++){let c=e[s]*r,a=s<l-1?e[s+1]*r:t.length,m=tn(t,c,a,r,!1);m===m.next&&nt.add(m),i.push(Pr(m))}i.sort(wr),Sr(t.length/r,e.length),rn(n,n),Mt=!0;for(let s=0;s<i.length;s++)n=vr(i[s],n);return Mt=!1,Ge(n)}function wr(t,e){return t.x-e.x||t.y-e.y||(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)}function vr(t,e){let n=Mr(t,e);if(!n)return e;let r=sn(n,t),i=r.next;return rn(n,i.next),Ge(r,r.next),Ge(n,n.next)}var nn=16,ie=new Float64Array(0),pt=0,Rt=[],Ft=[];function Sr(t,e){let n=Math.ceil((t+2*e)/nn)+e+2;ie.length<n*4&&(ie=new Float64Array(n*4)),pt=0}function rn(t,e){let n=t;do{let r=pt++;Rt[r]=n;let i=1/0,s=1/0,l=-1/0,c=-1/0,a=0;do{let x=n.next;n.z=r,n.x<i&&(i=n.x),n.x>l&&(l=n.x),n.y<s&&(s=n.y),n.y>c&&(c=n.y),x.x<i&&(i=x.x),x.x>l&&(l=x.x),x.y<s&&(s=x.y),x.y>c&&(c=x.y),n=x}while(++a<nn&&n!==e);Ft[r]=n;let m=r*4;ie[m]=i,ie[m+1]=s,ie[m+2]=l,ie[m+3]=c}while(n!==e)}function Er(t,e){let n=t.z*4;e.x<ie[n]&&(ie[n]=e.x),e.y<ie[n+1]&&(ie[n+1]=e.y),e.x>ie[n+2]&&(ie[n+2]=e.x),e.y>ie[n+3]&&(ie[n+3]=e.y)}function Jt(t){let e=Ft[t];for(;e.prev.next!==e;)e=e.next;return Ft[t]=e,e}function qt(t){let e=Rt[t];for(;e.prev.next!==e;)e=e.next;return Rt[t]=e,e}function Mr(t,e){let n=e,r=t.x,i=t.y,s=-1/0,l;if(rt(t,n))return n;for(let d=0,b=0;d<pt;d++,b+=4){if(i<ie[b+1]||i>ie[b+3]||ie[b]>r||ie[b+2]<=s)continue;let E=Jt(d);n=qt(d);do{if(n.prev.next===n){if(rt(t,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let A=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(A<=r&&A>s&&(s=A,l=n.x<n.next.x?n:n.next,A===r))return l}}n=n.next}while(n!==E)}if(!l)return null;let c=l.x,a=l.y,m=Math.min(i,a),x=Math.max(i,a),g=1/0;for(let d=0,b=0;d<pt;d++,b+=4){if(ie[b+2]<c||ie[b]>r||ie[b+3]<m||ie[b+1]>x)continue;let E=Jt(d);n=qt(d);do{if(n.prev.next===n&&r>=n.x&&n.x>=c&&r!==n.x&&mt(i<a?r:s,i,c,a,i<a?s:r,i,n.x,n.y)){let A=Math.abs(i-n.y)/(r-n.x);(it(n,t)||n.y===i&&n.next.y===i&&n.next.x>r)&&(A<g||A===g&&(n.x>l.x||n.x===l.x&&Rr(l,n)))&&(l=n,g=A)}n=n.next}while(n!==E)}return l}function Rr(t,e){return le(t.prev,t,e.prev)<0&&le(e.next,t,t.next)<0}var ye=[],qe=[],Ue=new Uint32Array(0),et=new Uint32Array(0),tt=new Uint32Array(256);function Fr(t,e,n,r){let i=t,s=0;do i.z=It(i.x,i.y,e,n,r),ye[s++]=i,i=i.next;while(i!==t);Ir(s);let l=null;for(let c=0;c<s;c++){let a=ye[c];a.prevZ=l,l&&(l.nextZ=a),l=a}l.nextZ=null}function Ir(t){if(t<=32){for(let e=1;e<t;e++){let n=ye[e],r=n.z,i=e-1;for(;i>=0&&ye[i].z>r;)ye[i+1]=ye[i],i--;ye[i+1]=n}return}Ue.length<t&&(Ue=new Uint32Array(t),et=new Uint32Array(t),qe=new Array(t));for(let e=0;e<t;e++)Ue[e]=ye[e].z;at(t,ye,Ue,qe,et,0),at(t,qe,et,ye,Ue,8),at(t,ye,Ue,qe,et,16),at(t,qe,et,ye,Ue,24)}function at(t,e,n,r,i,s){tt.fill(0);for(let c=0;c<t;c++)tt[n[c]>>>s&255]++;let l=0;for(let c=0;c<256;c++){let a=tt[c];tt[c]=l,l+=a}for(let c=0;c<t;c++){let a=n[c],m=tt[a>>>s&255]++;r[m]=e[c],i[m]=a}}function It(t,e,n,r,i){return t=(t-n)*i|0,e=(e-r)*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}function Pr(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function mt(t,e,n,r,i,s,l,c){return(i-l)*(e-c)>=(t-l)*(s-c)&&(t-l)*(r-c)>=(n-l)*(e-c)&&(n-l)*(s-c)>=(i-l)*(r-c)}function kr(t,e){let n=rt(t,e)&&le(t.prev,t,t.next)>0&&le(e.prev,e,e.next)>0;return t.next.i!==e.i&&(n||it(t,e)&&it(e,t)&&(le(t.prev,t,e.prev)!==0||le(t,e.prev,e)!==0))&&!_r(t,e)&&(n||Ar(t,e))}function le(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function rt(t,e){return t.x===e.x&&t.y===e.y}function on(t,e,n,r,i=!0){let s=le(t,e,n),l=le(t,e,r),c=le(n,r,t),a=le(n,r,e);return(s>0&&l<0||s<0&&l>0)&&(c>0&&a<0||c<0&&a>0)?!0:i?!!(s===0&&ht(t,n,e)||l===0&&ht(t,r,e)||c===0&&ht(n,t,r)||a===0&&ht(n,e,r)):!1}function ht(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function _r(t,e){let n=Math.min(t.x,e.x),r=Math.max(t.x,e.x),i=Math.min(t.y,e.y),s=Math.max(t.y,e.y),l=t;do{let c=l.next;if(l.x>r&&c.x>r||l.x<n&&c.x<n||l.y>s&&c.y>s||l.y<i&&c.y<i){l=c;continue}if(l.i!==t.i&&c.i!==t.i&&l.i!==e.i&&c.i!==e.i&&on(l,c,t,e))return!0;l=c}while(l!==t);return!1}function it(t,e){return le(t.prev,t,t.next)<0?le(t,e,t.next)>=0&&le(t,t.prev,e)>=0:le(t,e,t.prev)<0||le(t,t.next,e)<0}function Ar(t,e){let n=t,r=!1,i=(t.x+e.x)/2,s=(t.y+e.y)/2;do{let l=n.next;n.y>s!=l.y>s&&i<(l.x-n.x)*(s-n.y)/(l.y-n.y)+n.x&&(r=!r),n=l}while(n!==t);return r}function sn(t,e){let n=Pt(t.i,t.x,t.y),r=Pt(e.i,e.x,e.y),i=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,s.next=r,r.prev=s,r}function en(t,e,n,r){let i=Pt(t,e,n);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function ot(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),Mt&&Er(t.prev,t.next)}function Pt(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Lr(t,e,n,r){let i=0;for(let s=e,l=n-r;s<n;s+=r)i+=(t[l]-t[s])*(t[s+1]+t[l+1]),l=s;return i}var un=23283064365386963e-26,Br=12,ln=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),kt=0,xt=1,st=2,dt=5,ut=class{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,n,r=this.length){for(;this.pos<r;){let i=this.readVarint(),s=i>>3,l=this.pos;this.type=i&7,e(s,n,this),this.pos===l&&this.skip(i)}return n}readMessage(e,n){return this.readFields(e,n,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let n=this.buf,r,i;return i=n[this.pos++],r=i&127,i<128||(i=n[this.pos++],r|=(i&127)<<7,i<128)||(i=n[this.pos++],r|=(i&127)<<14,i<128)||(i=n[this.pos++],r|=(i&127)<<21,i<128)?r:(i=n[this.pos],r|=(i&15)<<28,Tr(r,e,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2===1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,n=this.pos;return this.pos=e,e-n>=Br&&ln?ln.decode(this.buf.subarray(n,e)):Yr(this.buf,n,e)}readBytes(){let e=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,e);return this.pos=e,n}readPackedVarint(e=[],n){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(n));return e}readPackedSVarint(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let n=this.readPackedEnd();for(;this.pos<n;)e.push(this.readSFixed64());return e}readPackedEnd(){return this.type===st?this.readVarint()+this.pos:this.pos+1}skip(e){let n=e&7;if(n===kt)for(;this.buf[this.pos++]>127;);else if(n===st)this.pos=this.readVarint()+this.pos;else if(n===dt)this.pos+=4;else if(n===xt)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(e,n){this.writeVarint(e<<3|n)}realloc(e){let n=this.length||16;for(;n<this.pos+e;)n*=2;if(n!==this.length){let r=new Uint8Array(n);r.set(this.buf),this.buf=r,this.dataView=new DataView(r.buffer),this.length=n}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*un),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,e&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*un),!0),this.pos+=8}writeVarint(e){if(e=+e||0,e>268435455||e<0){Cr(e,this);return}this.realloc(4),this.buf[this.pos++]=e&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=(e>>>=7)&127|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127)))}writeSVarint(e){this.writeVarint(e<0?-e*2-1:e*2)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(e.length*4),this.pos++;let n=this.pos;this.pos=Zr(this.buf,e,this.pos);let r=this.pos-n;r>=128&&cn(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let n=e.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,n){this.pos++;let r=this.pos;e(n,this);let i=this.pos-r;i>=128&&cn(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(e,n,r){this.writeTag(e,st),this.writeRawMessage(n,r)}writePackedVarint(e,n){n.length&&this.writeMessage(e,Dr,n)}writePackedSVarint(e,n){n.length&&this.writeMessage(e,Ur,n)}writePackedBoolean(e,n){n.length&&this.writeMessage(e,zr,n)}writePackedFloat(e,n){n.length&&this.writeMessage(e,Gr,n)}writePackedDouble(e,n){n.length&&this.writeMessage(e,Nr,n)}writePackedFixed32(e,n){n.length&&this.writeMessage(e,Hr,n)}writePackedSFixed32(e,n){n.length&&this.writeMessage(e,$r,n)}writePackedFixed64(e,n){n.length&&this.writeMessage(e,jr,n)}writePackedSFixed64(e,n){n.length&&this.writeMessage(e,Xr,n)}writeBytesField(e,n){this.writeTag(e,st),this.writeBytes(n)}writeFixed32Field(e,n){this.writeTag(e,dt),this.writeFixed32(n)}writeSFixed32Field(e,n){this.writeTag(e,dt),this.writeSFixed32(n)}writeFixed64Field(e,n){this.writeTag(e,xt),this.writeFixed64(n)}writeSFixed64Field(e,n){this.writeTag(e,xt),this.writeSFixed64(n)}writeVarintField(e,n){this.writeTag(e,kt),this.writeVarint(n)}writeSVarintField(e,n){this.writeTag(e,kt),this.writeSVarint(n)}writeStringField(e,n){this.writeTag(e,st),this.writeString(n)}writeFloatField(e,n){this.writeTag(e,dt),this.writeFloat(n)}writeDoubleField(e,n){this.writeTag(e,xt),this.writeDouble(n)}writeBooleanField(e,n){this.writeVarintField(e,+n)}};function Tr(t,e,n){let r=n.buf,i,s;if(s=r[n.pos++],i=(s&112)>>4,s<128||(s=r[n.pos++],i|=(s&127)<<3,s<128)||(s=r[n.pos++],i|=(s&127)<<10,s<128)||(s=r[n.pos++],i|=(s&127)<<17,s<128)||(s=r[n.pos++],i|=(s&127)<<24,s<128)||(s=r[n.pos++],i|=(s&1)<<31,s<128))return He(t,i,e);throw new Error("Expected varint not more than 10 bytes")}function He(t,e,n){return n?e*4294967296+(t>>>0):(e>>>0)*4294967296+(t>>>0)}function Cr(t,e){let n,r;if(t>=0?(n=t%4294967296|0,r=t/4294967296|0):(n=~(-t%4294967296),r=~(-t/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");e.realloc(10),Vr(n,r,e),Or(r,e)}function Vr(t,e,n){n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos++]=t&127|128,t>>>=7,n.buf[n.pos]=t&127}function Or(t,e){let n=(t&7)<<4;e.buf[e.pos++]|=n|((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)))))}function cn(t,e,n){let r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(Math.LN2*7));n.realloc(r);for(let i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function Dr(t,e){for(let n=0;n<t.length;n++)e.writeVarint(t[n])}function Ur(t,e){for(let n=0;n<t.length;n++)e.writeSVarint(t[n])}function Gr(t,e){for(let n=0;n<t.length;n++)e.writeFloat(t[n])}function Nr(t,e){for(let n=0;n<t.length;n++)e.writeDouble(t[n])}function zr(t,e){for(let n=0;n<t.length;n++)e.writeBoolean(t[n])}function Hr(t,e){for(let n=0;n<t.length;n++)e.writeFixed32(t[n])}function $r(t,e){for(let n=0;n<t.length;n++)e.writeSFixed32(t[n])}function jr(t,e){for(let n=0;n<t.length;n++)e.writeFixed64(t[n])}function Xr(t,e){for(let n=0;n<t.length;n++)e.writeSFixed64(t[n])}function Yr(t,e,n){let r="",i=e;for(;i<n;){let s=t[i],l=null,c=s>239?4:s>223?3:s>191?2:1;if(i+c>n)break;let a,m,x;c===1?s<128&&(l=s):c===2?(a=t[i+1],(a&192)===128&&(l=(s&31)<<6|a&63,l<=127&&(l=null))):c===3?(a=t[i+1],m=t[i+2],(a&192)===128&&(m&192)===128&&(l=(s&15)<<12|(a&63)<<6|m&63,(l<=2047||l>=55296&&l<=57343)&&(l=null))):c===4&&(a=t[i+1],m=t[i+2],x=t[i+3],(a&192)===128&&(m&192)===128&&(x&192)===128&&(l=(s&15)<<18|(a&63)<<12|(m&63)<<6|x&63,(l<=65535||l>=1114112)&&(l=null))),l===null?(l=65533,c=1):l>65535&&(l-=65536,r+=String.fromCharCode(l>>>10&1023|55296),l=56320|l&1023),r+=String.fromCharCode(l),i+=c}return r}function Zr(t,e,n){for(let r=0,i,s;r<e.length;r++){if(i=e.charCodeAt(r),i>55295&&i<57344)if(s)if(i<56320){t[n++]=239,t[n++]=191,t[n++]=189,s=i;continue}else i=s-55296<<10|i-56320|65536,s=null;else{i>56319||r+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):s=i;continue}else s&&(t[n++]=239,t[n++]=191,t[n++]=189,s=null);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:(i<65536?t[n++]=i>>12|224:(t[n++]=i>>18|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128),t[n++]=i&63|128)}return n}var _t=class t{constructor(e,n,r,i){this.pbf=e;this.keys=n;this.values=r;this.extent=i;this.type=0;this.properties={};this.geomOffset=-1}static read(e,n,r,i,s){let l=new t(e,r,i,s);return e.readFields(Wr,l,n),l}loadGeometry(){if(this.geomOffset<0)return[];let e=this.pbf,n=e.pos;e.pos=this.geomOffset;let r=e.readVarint()+e.pos,i=1,s=0,l=0,c=0,a=[],m=[];for(;e.pos<r;){if(s<=0){let x=e.readVarint();i=x&7,s=x>>3}if(s--,i===1||i===2)l+=e.readSVarint(),c+=e.readSVarint(),i===1&&(m.length&&a.push(m),m=[]),m.push(l,c);else if(i===7)m.length>=2&&m.push(m[0],m[1]);else throw new Error(`[osmgl] \\u043D\\u0435\\u0438\\u0437\\u0432\\u0435\\u0441\\u0442\\u043D\\u0430\\u044F \\u043A\\u043E\\u043C\\u0430\\u043D\\u0434\\u0430 \\u0433\\u0435\\u043E\\u043C\\u0435\\u0442\\u0440\\u0438\\u0438 MVT: ${i}`)}return m.length&&a.push(m),e.pos=n,a}bbox(){let e=this.loadGeometry(),n=1/0,r=1/0,i=-1/0,s=-1/0;for(let l of e)for(let c=0;c<l.length;c+=2)l[c]<n&&(n=l[c]),l[c]>i&&(i=l[c]),l[c+1]<r&&(r=l[c+1]),l[c+1]>s&&(s=l[c+1]);return[n,r,i,s]}};function Wr(t,e,n){n&&(t===1?e.id=n.readVarint():t===2?Qr(n,e):t===3?e.type=n.readVarint():t===4&&(e.geomOffset=n.pos,n.skip(2)))}function Qr(t,e){let n=t.readVarint()+t.pos;for(;t.pos<n;){let r=e.keys[t.readVarint()],i=e.values[t.readVarint()];r!==void 0&&(e.properties[r]=i)}}var At=class t{constructor(e){this.pbf=e;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(e,n){let r=new t(e);return e.readFields(Kr,r,n),r}get length(){return this.featureOffsets.length}feature(e){let n=this.pbf;n.pos=this.featureOffsets[e];let r=n.readVarint()+n.pos;return _t.read(n,r,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e)}};function Kr(t,e,n){n&&(t===15?e.version=n.readVarint():t===1?e.name=n.readString():t===5?e.extent=n.readVarint():t===2?e.featureOffsets.push(n.pos):t===3?e.keys.push(n.readString()):t===4&&e.values.push(Jr(n)))}function Jr(t){let e=t.readVarint()+t.pos,n=null;for(;t.pos<e;){let r=t.readVarint()>>3;r===1?n=t.readString():r===2?n=t.readFloat():r===3?n=t.readDouble():r===4?n=t.readVarint64():r===5?n=t.readVarint():r===6?n=t.readSVarint():r===7?n=t.readBoolean():t.skip(r)}return n}var gt=class{constructor(e){this.layers={};new ut(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((r,i,s)=>{if(r===3&&s){let l=At.read(s,s.readVarint()+s.pos);l.length&&(this.layers[l.name]=l)}},null)}};function $e(t){let e=[],n=null;for(let r of t){if(r.length<6)continue;let i=qr(r);i!==0&&(i>0?(n&&e.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&e.push(n),e}function qr(t){let e=0;for(let n=0,r=t.length-2;n<t.length;r=n,n+=2)e+=(t[r]-t[n])*(t[n+1]+t[r+1]);return e/2}function ce(t,e){if(!t)return!0;let n=t[0];switch(n){case"all":return t.slice(1).every(r=>ce(r,e));case"any":return t.slice(1).some(r=>ce(r,e));case"!":return!ce(t[1],e);case"has":return e[t[1]]!=null;case"!has":return e[t[1]]==null;case"in":{let r=e[t[1]];return r==null?!1:t.slice(2).includes(r)}case"!in":{let r=e[t[1]];return r==null?!0:!t.slice(2).includes(r)}default:{let r=e[t[1]],i=t[2];if(r==null)return n==="!=";switch(n){case"==":return r===i;case"!=":return r!==i;case">":return r>i;case">=":return r>=i;case"<":return r<i;case"<=":return r<=i;default:return!0}}}}var ei=Math.PI/8,ti=.35,ni=32,fn=.25,an=.5,hn=.07;function _e(t,e){let n=e.radius;if(!(n>0))return t;let r=t.length/2-1;if(r<3)return t;let i=Math.max(2,Math.round(e.segments??4)),s=Math.max(e.minCutRatio??ti,0),l=e.extent,c=e.margin??0,a=[];for(let m=0;m<r;m++){let x=t[m*2],g=t[m*2+1],d=t[(m+r-1)%r*2],b=t[(m+r-1)%r*2+1],E=t[(m+1)%r*2],A=t[(m+1)%r*2+1],_=x-d,R=g-b,L=E-x,k=A-g,T=Math.hypot(_,R),O=Math.hypot(L,k);if(T<1e-6||O<1e-6){a.push(x,g);continue}let D=_/T,U=R/T,P=L/O,C=k/O;if(e.keep?.[m]){a.push(x,g);continue}let Y=D*P+U*C;if(Y>.985){a.push(x,g);continue}if(l!==void 0&&(Lt(x,g,l,c)||Lt(d,b,l,c)||Lt(E,A,l,c))){a.push(x,g);continue}let Q=Math.min(n,T*.4,O*.4);if(Q<n*s){a.push(x,g);continue}let Z=x-D*Q,re=g-U*Q,X=x+P*Q,$=g+C*Q,z=Math.acos(Math.max(-1,Math.min(1,Y))),N=Math.min(ei,Math.PI/2/i),q=Math.ceil(z/N-1e-6),te=e.maxChord&&e.maxChord>0?Math.ceil(Q/Math.tan(z/2)*z/e.maxChord):0,K=Math.max(1,Math.min(ni,Math.max(Math.min(i,q),te)));a.push(Z,re);for(let oe=1;oe<K;oe++){let ee=oe/K,J=1-ee;a.push(J*J*Z+2*J*ee*x+ee*ee*X,J*J*re+2*J*ee*g+ee*ee*$)}a.push(X,$)}return a.length<6?t:(a.push(a[0],a[1]),a)}var Lt=(t,e,n,r)=>t<=-r||e<=-r||t>=n+r||e>=n+r;var Ae=t=>t/64;function je(t,e,n=0){let r=pn(t.outer,e,n);if(!r)return null;let i=[];for(let s of t.holes){let l=pn(s,e,n);l&&i.push(l)}return{outer:r,holes:i}}function pn(t,e,n){let r=[];for(let i=0;i<t.length-2;i+=2)r.push(t[i],t[i+1]);if(r.length<6)return null;for(let i=0;i<4;i++){let s=r;r=[];let l=s.length/2;if(l===0)return null;for(let c=0;c<l;c++){let a=s[c*2],m=s[c*2+1],x=s[(c+l-1)%l*2],g=s[(c+l-1)%l*2+1],d=mn(a,m,i,e,n),b=mn(x,g,i,e,n);if(d!==b){let E=ri(x,g,a,m,i,e,n);r.push(x+(a-x)*E,g+(m-g)*E)}d&&r.push(a,m)}}return r.length<6?null:(r.push(r[0],r[1]),r)}function mn(t,e,n,r,i){return n===0?t>=-i:n===1?t<=r+i:n===2?e>=-i:e<=r+i}function ri(t,e,n,r,i,s,l){return i===0?(-l-t)/(n-t):i===1?(s+l-t)/(n-t):i===2?(-l-e)/(r-e):(s+l-e)/(r-e)}function yt(t,e,n,r,i,s=0){let l=-s,c=i+s;return t===l&&n===l||t===c&&n===c||e===l&&r===l||e===c&&r===c}function xn(t,e){for(let n=0;n<t.length;n+=2)if(t[n]<=0||t[n]>=e||t[n+1]<=0||t[n+1]>=e)return!0;return!1}var Ct=18,Vt=32,dn=8,Sn=65535/Vt,ii=9,oi=1,si=0,ui=1,li=2;var gn=0,ci=1,yn=2,fi=3,ai=.47;function En(t,e,n,r={}){let i=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:ai,s=Math.max(1024,t.length*48),l=new ArrayBuffer(s*Ct),c={verts:new DataView(l),vertsU8:new Uint8Array(l),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}};c.ensure=d=>a(d);let a=d=>{if(c.vertexCount+d<=s)return;s=Math.max(s*2,c.vertexCount+d);let b=new ArrayBuffer(s*Ct);new Uint8Array(b).set(c.vertsU8.subarray(0,c.vertOffset)),l=b,c.verts=new DataView(b),c.vertsU8=new Uint8Array(b)};for(let d of t.features()){if(d.type!==3||!ce(n,d.properties))continue;let b=Li(d.properties),E=Bi(d.properties,b);if(b<=E)continue;let A=Ci(d.properties)??Number(d.id??0),_=Ai(A>>>0),R=_i(_,d.properties),L=ki(d.properties,b),k=$e(d.loadGeometry());for(let T of k){let O=je(T,e);if(!O)continue;let D=xn(O.outer,e),U=(r.cornerRadius??0)/i,P={radius:U,segments:r.cornerSegments,extent:e,minCutRatio:0,maxChord:i>0?an/i:0},C=U>0?{outer:_e(O.outer,P),holes:O.holes.map($=>_e($,P))}:O,Y=C.outer.length/2+C.holes.reduce(($,z)=>$+z.length/2,0);a(Y*5+32);let Q=C.holes.length||D?null:xi(C.outer),Z=Q?vi(d.properties,Q,b,_,i):null,re=null,X=[];if(Z&&Q){let $=Mn(Mi(C.outer,i),Q,Z.shape);X=Ri($,C.outer);let z=Fi($,X);if(z>1e-6){let N=Math.min(Math.max(z*i*yi,wi),bi);re=Ii($,N/z,b)}}wn(c,C.outer,E,b,A,R,L,i,e,re);for(let $ of C.holes)wn(c,$,E,b,A,R,L,i,e,null);re?Pi(c,X,re,b,A,R,L,i):mi(c,C.outer,C.holes,b,A,R,L)}}if(!c.indices.length)return null;let m=new Uint32Array(c.indices),x=new Float64Array(c.featureIds);return{vertices:l.slice(0,c.vertOffset),indices:m.buffer,featureIds:x.buffer,vertexCount:c.vertexCount,indexCount:m.length,extent:e}}var Ot=(t,e)=>t|e<<2,bn=t=>Math.max(-32768,Math.min(32767,t)),Bt=t=>Math.max(0,Math.min(65535,Math.round(Math.min(t,Sn)*Vt)));function Xe(t,e,n,r,i,s,l,c,a,m,x=0,g=0,d=0){let b=t.vertOffset;return t.verts.setInt16(b,bn(Math.round(e*dn)),!0),t.verts.setInt16(b+2,bn(Math.round(n*dn)),!0),t.verts.setUint16(b+4,Math.round(Math.min(r,Sn)*Vt),!0),t.vertsU8[b+6]=a,t.vertsU8[b+7]=c,t.verts.setInt8(b+8,Tt(Math.round(i*127))),t.verts.setInt8(b+9,Tt(Math.round(s*127))),t.verts.setInt8(b+10,Tt(Math.round(l*127))),t.vertsU8[b+11]=m,t.verts.setUint16(b+12,Bt(x),!0),t.verts.setUint16(b+14,Bt(g),!0),t.verts.setUint16(b+16,Bt(d),!0),t.vertOffset+=Ct,t.vertexCount++}function wn(t,e,n,r,i,s,l,c,a,m=null){let x=e.length/2;if(x<3)return;let g=Ot(si,l),d=pi(e,c),b=r-n,E=new Float64Array(x*2),A=new Uint8Array(x);{let _=new Float64Array(x*2);for(let R=0;R<x-1;R++){let L=e[R*2+2]-e[R*2],k=e[R*2+3]-e[R*2+1],T=Math.hypot(L,k)||1;_[R*2]=k/T,_[R*2+1]=-L/T}for(let R=0;R<x-1;R++){let L=(R+x-2)%(x-1),k=_[L*2]*_[R*2]+_[L*2+1]*_[R*2+1],T=_[L*2]+_[R*2],O=_[L*2+1]+_[R*2+1],D=Math.hypot(T,O);k>.5&&D>1e-6&&(E[R*2]=T/D,E[R*2+1]=O/D,A[R]=1)}}for(let _=0;_<x-1;_++){let R=e[_*2],L=e[_*2+1],k=e[_*2+2],T=e[_*2+3];if(R===k&&L===T||yt(R,L,k,T,a))continue;let O=k-R,D=T-L,U=Math.hypot(O,D)||1,P=D/U,C=-O/U,Y=d.offset[_],Q=d.width[_],Z=[0,1];if(m){for(let X=0;X<m.length;X++)for(let $=X+1;$<m.length;$++){let z=Ne(m[X],R,L)-Ne(m[$],R,L),N=Ne(m[X],k,T)-Ne(m[$],k,T);if(z===N)continue;let q=z/(z-N);q>1e-4&&q<1-1e-4&&Z.push(q)}Z.sort((X,$)=>X-$)}let re=(X,$)=>{if(!m)return r;let z=1/0;for(let N of m)z=Math.min(z,Ne(N,X,$));return Math.max(r,z)};for(let X=0;X+1<Z.length;X++){let $=Z[X],z=Z[X+1];if(z-$<1e-6)continue;let N=R+O*$,q=L+D*$,te=R+O*z,K=L+D*z,oe=Y+U*$*c,ee=Y+U*z*c,J=(_+1)%(x-1),fe=A[_]?E[_*2]:P,be=A[_]?E[_*2+1]:C,de=A[J]?E[J*2]:P,Fe=A[J]?E[J*2+1]:C,Ce=P+(fe-P)*(1-$),Le=C+(be-C)*(1-$),Ve=P+(de-P)*z,we=C+(Fe-C)*z,se=Math.hypot(Ce,Le)||1,Pe=Math.hypot(Ve,we)||1,xe=Ce/se,Be=Le/se,Oe=Ve/Pe,De=we/Pe;t.ensure(4);let Ie=Xe(t,N,q,n,xe,Be,0,0,s,g,oe,Q,b),ze=Xe(t,te,K,n,Oe,De,0,0,s,g,ee,Q,b),vt=Xe(t,N,q,re(N,q),xe,Be,0,255,s,g,oe,Q,b),ft=Xe(t,te,K,re(te,K),Oe,De,0,255,s,g,ee,Q,b);t.indices.push(Ie,ft,ze,Ie,vt,ft),t.featureIds.push(i,i)}}}var hi=.9976;function pi(t,e){let n=t.length/2-1,r=[];for(let a=0;a<n;a++){let m=t[a*2+2]-t[a*2],x=t[a*2+3]-t[a*2+1],g=Math.hypot(m,x);r.push(g>0?{x:m/g,y:x/g,len:g*e}:{x:0,y:0,len:0})}let i=(a,m)=>r[a].len>0&&r[m].len>0&&r[a].x*r[m].x+r[a].y*r[m].y>=hi,s=0;for(;s<n&&i((s-1+n)%n,s);)s++;s>=n&&(s=0);let l=new Array(n).fill(0),c=new Array(n).fill(0);for(let a=0;a<n;){let m=(s+a)%n,x=[m],g=r[m].len,d=a+1;for(;d<n;){let E=(s+d)%n;if(!i((s+d-1)%n,E))break;x.push(E),g+=r[E].len,d++}let b=0;for(let E of x)l[E]=b,c[E]=g,b+=r[E].len;a=d}return{offset:l,width:c}}function mi(t,e,n,r,i,s,l){let c=[],a=[];for(let d=0;d<e.length;d++)c.push(e[d]);for(let d of n){a.push(c.length/2);for(let b=0;b<d.length;b++)c.push(d[b])}let m=Te(c,a.length?a:void 0,2);if(!m.length)return;let x=Ot(ui,l),g=t.vertexCount;for(let d=0;d<c.length;d+=2)Xe(t,c[d],c[d+1],r,0,0,1,255,s,x);for(let d=0;d<m.length;d+=3)t.indices.push(g+m[d],g+m[d+2],g+m[d+1]),t.featureIds.push(i)}function xi(t){let e=di(t);if(e.length<3)return null;let n=Math.abs(gi(t));if(n<=0)return null;let r=null,i=1/0;for(let s=0;s<e.length;s++){let l=(s+1)%e.length,c=e[l].x-e[s].x,a=e[l].y-e[s].y,m=Math.hypot(c,a);if(m<1e-6)continue;c/=m,a/=m;let x=1/0,g=-1/0,d=1/0,b=-1/0;for(let T of e){let O=T.x*c+T.y*a,D=-T.x*a+T.y*c;O<x&&(x=O),O>g&&(g=O),D<d&&(d=D),D>b&&(b=D)}let E=g-x,A=b-d,_=E*A;if(_<=0||_>=i)continue;i=_;let R=(x+g)/2,L=(d+b)/2,k=E>=A;r={cx:R*c-L*a,cy:R*a+L*c,ax:k?c:-a,ay:k?a:c,halfLong:(k?E:A)/2,halfShort:(k?A:E)/2,fill:n/_}}return r}function di(t){let e=[];for(let s=0;s<t.length-2;s+=2)e.push({x:t[s],y:t[s+1]});if(e.length<3)return e;e.sort((s,l)=>s.x===l.x?s.y-l.y:s.x-l.x);let n=(s,l,c)=>(l.x-s.x)*(c.y-s.y)-(l.y-s.y)*(c.x-s.x),r=[];for(let s of e){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],s)<=0;)r.pop();r.push(s)}let i=[];for(let s=e.length-1;s>=0;s--){let l=e[s];for(;i.length>=2&&n(i[i.length-2],i[i.length-1],l)<=0;)i.pop();i.push(l)}return r.pop(),i.pop(),r.concat(i)}function gi(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var yi=Math.tan(30*Math.PI/180),bi=3.5,wi=.9;function vi(t,e,n,r,i){if(e.fill<.86)return null;let s=e.halfShort*2*i,l=e.halfLong*2*i,c=s*l,a=e.halfShort>0?e.halfLong/e.halfShort:99,m=Si(t);if(!m){if(n>15||c>600||s<3)return null;let x=r%1e3/1e3;c<30?m=x<.5?"skillion":"gabled":a<1.25?m=x<.35?"pyramidal":"hipped":m=x<.8?"gabled":"hipped"}return m==="flat"?null:{shape:m}}function Si(t){let e=String(t.roof_shape??t["roof:shape"]??"").toLowerCase();return e?e==="flat"?"flat":e==="skillion"||e==="lean_to"||e==="shed"?"skillion":e==="hipped"||e==="half-hipped"||e==="gambrel"?"hipped":e==="pyramidal"||e==="dome"||e==="conical"||e==="onion"?"pyramidal":e==="gabled"||e==="mansard"||e==="round"?"gabled":null:null}var Ne=(t,e,n)=>t.a*e+t.b*n+t.c;function Ei(t,e,n,r){let i=t.length/2;if(i<3)return[];let s=[],l=c=>[t[c*2],t[c*2+1]];for(let c=0;c<i;c++){let[a,m]=l(c),[x,g]=l((c+i-1)%i),d=e*a+n*m+r,b=e*x+n*g+r;if(d<=0!=b<=0){let E=b/(b-d);s.push(x+(a-x)*E,g+(m-g)*E)}d<=0&&s.push(a,m)}return s}function Mi(t,e){let n=.5/Math.max(e,1e-6),r=t.length/2-1;if(r<5)return t;let i=[],s=0;i.push(t[0],t[1]);for(let l=1;l<r;l++){let c=t[s*2],a=t[s*2+1],m=t[l*2],x=t[l*2+1],g=m-c,d=x-a,b=Math.hypot(g,d),E=b>1e-6;if(E){for(let A=s+1;A<l;A++)if(Math.abs((t[A*2]-c)*d-(t[A*2+1]-a)*g)/b>=n){E=!1;break}}E||(i.push(t[(l-1)*2],t[(l-1)*2+1]),s=l-1)}return i.length/2<3?t:(i.push(i[0],i[1]),i)}function Mn(t,e,n){let{ax:r,ay:i,halfLong:s}=e;if(n==="skillion"){let a=-i,m=r;return[{a,b:m,c:-(a*e.cx+m*e.cy)+e.halfShort}]}let l=[],c=t.length/2-1;for(let a=0;a<c;a++){let m=t[a*2],x=t[a*2+1],g=t[(a+1)%c*2],d=t[(a+1)%c*2+1],b=g-m,E=d-x,A=Math.hypot(b,E);if(A<1e-6||n==="gabled"&&Math.abs((b*r+E*i)/A)<.86)continue;let _=-E/A,R=b/A;l.push({a:_,b:R,c:-(_*m+R*x)})}return!l.length&&s>0?Mn(t,e,"hipped"):l}function Ri(t,e){let n=[];for(let i=0;i<e.length-2;i+=2)n.push(e[i],e[i+1]);if(n.length<6)return[];let r=[];for(let i=0;i<t.length;i++){let s=n;for(let l=0;l<t.length&&s.length>=6;l++)l!==i&&(s=Ei(s,t[i].a-t[l].a,t[i].b-t[l].b,t[i].c-t[l].c));r.push(s.length>=6?s:[])}return r}function Fi(t,e){let n=0;for(let r=0;r<e.length;r++){let i=e[r];for(let s=0;s<i.length;s+=2){let l=Ne(t[r],i[s],i[s+1]);l>n&&(n=l)}}return n}function Ii(t,e,n){return t.map(r=>({a:r.a*e,b:r.b*e,c:r.c*e+n}))}function Pi(t,e,n,r,i,s,l,c){let a=Ot(li,l);for(let m=0;m<n.length;m++){let x=e[m];if(!x||x.length<6)continue;let g=Te(x,void 0,2);if(!g.length)continue;let d=-n[m].a/c,b=-n[m].b/c,E=Math.hypot(d,b,1),A={x:d/E,y:b/E,z:1/E};t.ensure(x.length/2);let _=t.vertexCount;for(let R=0;R<x.length;R+=2){let L=Math.max(r,Ne(n[m],x[R],x[R+1]));Xe(t,x[R],x[R+1],L,A.x,A.y,A.z,255,s,a)}for(let R=0;R<g.length;R+=3)t.indices.push(_+g[R],_+g[R+2],_+g[R+1]),t.featureIds.push(i)}}function ki(t,e){let n=String(t.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?fi:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?yn:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||e<=7?gn:e>=40?yn:ci}function _i(t,e){let n=String(e.class??""),r=128;return n==="industrial"||n==="warehouse"||n==="construction"?r=96:n==="commercial"||n==="office"||n==="retail"?r=150:(n==="apartments"||n==="residential"||n==="house")&&(r=134),Math.max(0,Math.min(255,r+(t%121-60)))}function Ai(t){let e=t>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Li(t){let e=Ye(t.render_height)??Ye(t.height)??Ti(t.levels??t.building_levels??t["building:levels"]);return e&&e>0?Math.max(e,oi):ii}function Bi(t,e){let n=Ye(t.render_min_height)??Ye(t.min_height)??Ye(t.base)??0;return n>0&&n<e?n:0}function Ti(t){let e=Ye(t);return e&&e>0?e*3:null}function Ye(t){if(typeof t=="number"&&isFinite(t))return t;if(typeof t=="string"){let e=parseFloat(t);if(isFinite(e))return e}return null}var Tt=t=>t>127?127:t<-127?-127:t;function Ci(t){let e=t.osm_id;if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let n=Number(e);if(Number.isFinite(n))return n}return null}function Dt(t,e,n,r,i){let s=r*r,l=[],c=x=>t[x*2],a=x=>t[x*2+1],m=(x,g)=>{let d=t.length/2;return t.push((c(x)+c(g))/2,(a(x)+a(g))/2),d};for(let x=0;x<e.length;x+=3){l.push([n+e[x],n+e[x+1],n+e[x+2]]);let g=0;for(;l.length&&!(++g>2e4);){let[d,b,E]=l.pop(),A=(c(d)-c(b))**2+(a(d)-a(b))**2,_=(c(b)-c(E))**2+(a(b)-a(E))**2,R=(c(E)-c(d))**2+(a(E)-a(d))**2,L=Math.max(A,_,R);if(L<=s){i.push(d,b,E);continue}if(L===A){let k=m(d,b);l.push([d,k,E],[k,b,E])}else if(L===_){let k=m(b,E);l.push([b,k,d],[k,E,d])}else{let k=m(E,d);l.push([E,k,b],[k,d,b])}}}}function Rn(t,e,n=0,r,i=!1,s=4096){let l=[],c=[],a=[];for(let b of t.features()){if(b.type!==3||!ce(e,b.properties))continue;let E=b.properties.osm_id,A=typeof E=="number"?E:typeof E=="string"?Number(E):NaN,_=Number.isFinite(A)?A:Number(b.id??0);for(let R of $e(b.loadGeometry())){let L=i?je(R,s):R;if(!L)continue;let k=[],T=[],O=r?_e(L.outer,r):L.outer;for(let P=0;P<O.length;P++)k.push(O[P]);for(let P of L.holes){let C=r?_e(P,r):P;T.push(k.length/2);for(let Y=0;Y<C.length;Y++)k.push(C[Y])}let D=Te(k,T.length?T:void 0,2);if(!D.length)continue;let U=l.length/2;for(let P=0;P<k.length;P++)l.push(k[P]);if(n>0){let P=[];Dt(l,D,U,n,P);for(let C=0;C<P.length;C+=3)c.push(P[C],P[C+2],P[C+1]),a.push(_);continue}for(let P=0;P<D.length;P+=3)c.push(U+D[P],U+D[P+2],U+D[P+1]),a.push(_)}}if(!c.length)return null;let m=l.length/2,x=new Int16Array(l),g=new Uint32Array(c);return{featureIds:new Float64Array(a).buffer,vertices:x.buffer,indices:g.buffer,vertexCount:m,indexCount:g.length}}function In(t){return{shapes:[],cells:[],extent:0,metersPerTile:t}}function Pn(t,e,n,r){if(!(n<=0)){t.extent=r;for(let i of e){let s=i.outer;if(s.length<6)continue;let l=1/0,c=1/0,a=-1/0,m=-1/0;for(let x=0;x<s.length;x+=2)s[x]<l&&(l=s[x]),s[x]>a&&(a=s[x]),s[x+1]<c&&(c=s[x+1]),s[x+1]>m&&(m=s[x+1]);t.shapes.push({outer:s,holes:i.holes,level:n,minX:l,minY:c,maxX:a,maxY:m})}t.cells=[]}}function Vi(t){t.cells=Array.from({length:32*32},()=>[]);let e=t.extent/32;for(let n=0;n<t.shapes.length;n++){let r=t.shapes[n],i=Ze(Math.floor(r.minX/e)),s=Ze(Math.floor(r.maxX/e)),l=Ze(Math.floor(r.minY/e)),c=Ze(Math.floor(r.maxY/e));for(let a=l;a<=c;a++)for(let m=i;m<=s;m++)t.cells[a*32+m].push(n)}}var kn=t=>t.shapes.length===0;function Ut(t,e,n){!t.cells.length&&t.shapes.length&&Vi(t);let r=t.extent/32,i=t.cells[Ze(Math.floor(n/r))*32+Ze(Math.floor(e/r))];if(!i||!i.length)return 0;let s=0;for(let l of i){let c=t.shapes[l];if(c.level<=s||e<c.minX||e>c.maxX||n<c.minY||n>c.maxY||!Fn(c.outer,e,n))continue;let a=!1;for(let m of c.holes)if(Fn(m,e,n)){a=!0;break}a||(s=c.level)}return Math.min(Math.round(s*100),127)}function _n(t,e){let n=[],r=[],i=t.extent>0?t.metersPerTile/t.extent:0,s=i>0?2/i:0,l=Ut(t,e[0],e[1]);n.push(e[0],e[1]),r.push(l);for(let c=0;c+3<e.length;c+=2){let a=e[c],m=e[c+1],x=e[c+2],g=e[c+3],d=Ut(t,x,g);if(d!==l&&s>0){let b=Math.hypot(x-a,g-m),E=Math.min(Math.ceil(b/s),64),A=l;for(let _=1;_<E;_++){let R=_/E,L=a+(x-a)*R,k=m+(g-m)*R,T=Ut(t,L,k);T!==A&&(n.push(L,k),r.push(T),A=T)}}n.push(x,g),r.push(d),l=d}return{pts:n,levels:r}}var Ze=t=>t<0?0:t>31?31:t;function Fn(t,e,n){let r=!1,i=t.length/2;for(let s=0,l=i-1;s<i;l=s++){let c=t[s*2],a=t[s*2+1],m=t[l*2],x=t[l*2+1];a>n!=x>n&&e<(m-c)*(n-a)/(x-a)+c&&(r=!r)}return r}var Tn=mr(An(),1);function Ln(t){let e=[];for(let n=0;n+1<t.length;n+=2)e.push([t[n],t[n+1]]);return e}function Bn(t){let e=[];for(let r of t)e.push(r[0],r[1]);let n=e.length;return n>=4&&(e[0]!==e[n-2]||e[1]!==e[n-1])&&e.push(e[0],e[1]),e}function Cn(t,e,n=0){if(t.length<2)return t;let r=new Map;for(let s of t){let l=s.lift??0,c=r.get(l);c?c.push(s):r.set(l,[s])}let i=[];for(let[s,l]of r){if(l.length<2){i.push(...l);continue}let a=(n>0&&e?l.map(g=>({outer:e(g.outer,-n)??g.outer,holes:g.holes.map(d=>e(d,n)??d)})):l).map(g=>[Ln(g.outer),...g.holes.map(Ln)]),m;try{m=Tn.union(a[0],...a.slice(1))}catch{i.push(...l);continue}let x=m;if(!Array.isArray(x)||x.length===0){i.push(...l);continue}for(let g of x){if(!g.length)continue;let d=Bn(g[0]);if(d.length<8)continue;let b=[];for(let E=1;E<g.length;E++){let A=Bn(g[E]);A.length>=8&&b.push(A)}i.push(s?{outer:d,holes:b,lift:s}:{outer:d,holes:b})}}return i}var Xt=16,Oi=64,Nn=0,Di=1,Vn=2,Ui=3,bt=1,Gi=.6;function zn(t,e,n,r){let i=r.metersPerUnit>0?r.metersPerUnit:.5,s=r.elevation,l=r.base??0,c=Math.max(r.bevel??0,0)/i,a=Math.max(r.bevelDrop??0,0),m=Math.max(r.cornerRadius??0,0)/i,x=Math.max(512,t.length*24),g=new ArrayBuffer(x*Xt),d={view:new DataView(g),bytes:new Uint8Array(g),offset:0,count:0,indices:[],extent:e,ensure(P){if(d.count+P<=x)return;x=Math.max(x*2,d.count+P);let C=new ArrayBuffer(x*Xt);new Uint8Array(C).set(d.bytes.subarray(0,d.offset)),g=C,d.view=new DataView(C),d.bytes=new Uint8Array(C)}},b=[],E=new Map;for(let P of t.features()){if(P.type!==3||!ce(n,P.properties))continue;let C=r.liftBy?.(P.properties)??0;for(let Y of $e(P.loadGeometry())){let Q=je(Y,e,Ae(e));Q&&b.push(C?{...Q,lift:C}:Q)}}let A=new Set,_=Math.max(r.weld??Gi,0),R=Cn(b,(P,C)=>Ht(P,C,e,A),_/i),L=_>0?R.map(P=>({...P,outer:Gn(P.outer,_/i,e),holes:P.holes.map(C=>Gn(C,_/i,e))})):R;for(let P of L){On(P.outer,E);for(let C of P.holes)On(C,E)}r.onShapes?.(L);let k=new Set;for(let[P,C]of E)C>1&&k.add(P);let T=[],O={radius:m,segments:r.cornerSegments,extent:e,margin:Ae(e),minCutRatio:0,maxChord:fn/i};for(let P of L){let C=m>0?{outer:_e(P.outer,{...O,keep:Dn(P.outer,k)}),holes:P.holes.map(N=>_e(N,{...O,keep:Dn(N,k)}))}:P,Y=c>0?Ht(C.outer,c,e,k):C.outer,Q=C.holes.map(N=>c>0?Ht(N,-c,e,k):N),Z=P.lift??0,re=s+Z,X=l+Z;Un(d,Y??C.outer,Q.map((N,q)=>N??C.holes[q]),re,Nn,r.maxSegment??0);let $=re,z=re-a;Y&&c>0&&a>0&&zt(d,Y,C.outer,$,z,Di,e,k),z!==X&&zt(d,C.outer,C.outer,z,X,Vn,e,k);for(let N of C.holes)if(z!==X&&zt(d,N,N,z,X,Vn,e,k),re<X){let q=d.indices.length;Un(d,N,[],X,Ui);for(let te=q;te<d.indices.length;te++)T.push(d.indices[te]);d.indices.length=q}}if(!d.indices.length&&!T.length)return null;let D=d.indices.length,U=new Uint32Array(D+T.length);return U.set(d.indices,0),U.set(T,D),{vertices:g.slice(0,d.offset),indices:U.buffer,vertexCount:d.count,indexCount:U.length,extent:e,capIndexOffset:D}}function We(t,e,n,r){let i=`${Math.round(t*100)},${Math.round(e*100)}`,s=`${Math.round(n*100)},${Math.round(r*100)}`;return i<s?`${i}|${s}`:`${s}|${i}`}function On(t,e){for(let n=0;n+3<t.length;n+=2){let r=We(t[n],t[n+1],t[n+2],t[n+3]);e.set(r,(e.get(r)??0)+1)}}function Dn(t,e){if(!e.size)return;let n=t.length/2-1,r=new Array(n).fill(!1);for(let i=0;i<n;i++){let s=We(t[(i+n-1)%n*2],t[(i+n-1)%n*2+1],t[i*2],t[i*2+1]),l=We(t[i*2],t[i*2+1],t[(i+1)%n*2],t[(i+1)%n*2+1]);(e.has(s)||e.has(l))&&(r[i]=!0)}return r}function lt(t,e,n,r,i,s,l,c){let a=t.offset;return t.view.setFloat32(a,e,!0),t.view.setFloat32(a+4,n,!0),t.view.setInt16(a+8,Ni(Math.round(r*Oi)),!0),t.view.setInt8(a+10,jt(Math.round(i*127))),t.view.setInt8(a+11,jt(Math.round(s*127))),t.view.setInt8(a+12,jt(Math.round(l*127))),t.bytes[a+13]=c,t.view.setInt8(a+14,e<=0?-bt:e>=t.extent?bt:0),t.view.setInt8(a+15,n<=0?-bt:n>=t.extent?bt:0),t.offset+=Xt,t.count++}function Un(t,e,n,r,i=Nn,s=0){let l=[],c=[];for(let g=0;g<e.length;g++)l.push(e[g]);for(let g of n){c.push(l.length/2);for(let d=0;d<g.length;d++)l.push(g[d])}let a=Te(l,c.length?c:void 0,2);if(!a.length)return;let m=a;if(s>0){let g=[];Dt(l,a,0,s,g),m=g}t.ensure(l.length/2);let x=t.count;for(let g=0;g<l.length;g+=2)lt(t,l[g],l[g+1],r,0,0,1,i);for(let g=0;g<m.length;g+=3)t.indices.push(x+m[g],x+m[g+2],x+m[g+1])}function zt(t,e,n,r,i,s,l,c){let a=Math.min(e.length,n.length)/2;if(!(a<3)){t.ensure((a-1)*4);for(let m=0;m<a-1;m++){let x=n[m*2],g=n[m*2+1],d=n[m*2+2],b=n[m*2+3];if(x===d&&g===b||yt(x,g,d,b,l,Ae(l))||c.has(We(x,g,d,b)))continue;let E=d-x,A=b-g,_=Math.hypot(E,A)||1,R=A/_,L=-E/_,k=r-i,T=Math.hypot(e[m*2]-x,e[m*2+1]-g)||0,O=0;if(T>1e-6&&k!==0){let Y=1/Math.hypot(1,k/T);O=T/Math.hypot(T,k)*Math.sign(k),R*=Y,L*=Y}let D=lt(t,e[m*2],e[m*2+1],r,R,L,O,s),U=lt(t,e[m*2+2],e[m*2+3],r,R,L,O,s),P=lt(t,x,g,i,R,L,O,s),C=lt(t,d,b,i,R,L,O,s);t.indices.push(P,U,C,P,D,U)}}}function Ht(t,e,n,r){let i=t.length/2-1;if(i<3)return null;let s=[];for(let x=0;x<i;x++){let g=t[x*2],d=t[x*2+1],b=t[(x+i-1)%i*2],E=t[(x+i-1)%i*2+1],A=t[(x+1)%i*2],_=t[(x+1)%i*2+1],R=Math.hypot(g-b,d-E)||1,L=Math.hypot(A-g,_-d)||1,k=(d-E)/R,T=-(g-b)/R,O=(_-d)/L,D=-(A-g)/L,U=k+O,P=T+D,C=Math.hypot(U,P);if(C<1e-6){s.push(g,d);continue}U/=C,P/=C;let Y=Math.min(1/Math.max(U*k+P*T,.35),3),Q=g-U*e*Y,Z=d-P*e*Y,re=We(b,E,g,d),X=We(g,d,A,_);if(r.has(re)||r.has(X)){s.push(g,d);continue}let $=-Ae(n),z=n+Ae(n),N=(q,te)=>q<=$||q>=z||te<=$||te>=z;(N(g,d)||N(b,E)||N(A,_))&&(Q=g,Z=d),s.push(Q,Z)}s.push(s[0],s[1]);let l=Math.abs($t(t)),c=$t(s);if(Math.sign(c)!==Math.sign($t(t))||Math.abs(c)<l*.25)return null;let a=-Ae(n),m=n+Ae(n);for(let x=0;x<s.length;x+=2)s[x]=Math.max(a,Math.min(m,s[x])),s[x+1]=Math.max(a,Math.min(m,s[x+1]));return s}function $t(t){let e=0;for(let n=0;n<t.length-2;n+=2)e+=t[n]*t[n+3]-t[n+2]*t[n+1];return e/2}var jt=t=>t>127?127:t<-127?-127:t,Ni=t=>t>32767?32767:t<-32768?-32768:t;function Gn(t,e,n){if(!(e>0))return t;let r=Ae(n),i=-r,s=n+r,l=t;for(let c=0;c<3;c++){let a=l.length/2-1;if(a<6)break;let m=new Array(a).fill(!0),x=a;for(let d=0;d<a&&!(x<=5);d++){let b=l[d*2],E=l[d*2+1];if(b<=i||b>=s||E<=i||E>=s)continue;let A=(d+a-1)%a;for(;!m[A]&&A!==d;)A=(A+a-1)%a;let _=(d+1)%a;for(;!m[_]&&_!==d;)_=(_+1)%a;if(A===d||_===d)break;let R=l[A*2],L=l[A*2+1],k=l[_*2]-R,T=l[_*2+1]-L,O=Math.hypot(k,T);O<1e-6||Math.abs((b-R)*T-(E-L)*k)/O<e&&(m[d]=!1,x--)}if(x===a)break;let g=[];for(let d=0;d<a;d++)m[d]&&g.push(l[d*2],l[d*2+1]);g.push(g[0],g[1]),l=g}return l}function Qe(t){let e=t.layer,n=typeof e=="number"?e:typeof e=="string"?Number(e):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let r=t.brunnel;return r==="bridge"?1:r==="tunnel"?-1:0}var ct=20;function jn(t,e,n=0,r,i=0,s={}){let{level:l}=s,c=Math.max(256,t.length*24),a=new ArrayBuffer(c*ct),m=new DataView(a),x=0,g=[],d=L=>{if(x+L<=c)return;c=Math.max(c*2,x+L);let k=new ArrayBuffer(c*ct);new Uint8Array(k).set(new Uint8Array(a,0,x*ct)),a=k,m=new DataView(k)},b=(L,k,T,O,D,U,P,C=0,Y=0,Q=0)=>{let Z=x*ct;return m.setInt16(Z,L,!0),m.setInt16(Z+2,k,!0),m.setInt16(Z+4,T,!0),m.setInt16(Z+6,O,!0),m.setInt8(Z+8,D),m.setInt8(Z+9,U),m.setInt8(Z+10,C),m.setInt8(Z+11,Y),m.setFloat32(Z+12,P,!0),m.setFloat32(Z+16,Q,!0),x++},E=0,A=i>0?12/i:0,_=A>0?Xi(t):null;for(let L of t.features()){if(L.type!==2&&L.type!==3||!ce(e,L.properties)||l!==void 0&&Qe(L.properties)!==l)continue;let k=L.properties.width;E=typeof k=="number"&&k>.5&&k<100?k:0;let T=L.type===3;for(let O of L.loadGeometry()){let D=n>0?Hi(Hn(O),n):Hn(O);if(D.length<4)continue;let U=r&&!kn(r)?_n(r,D):null,P=U?U.pts:D,C=U?.levels,Y=P.length/2;if(Y<2)continue;let Q=Qe(L.properties),Z=wt(Math.round(P[0]),Math.round(P[1])),re=wt(Math.round(P[Y*2-2]),Math.round(P[Y*2-1])),X=null,$=E;if(_&&E>0&&!T){let N=0;for(let ee=0;ee<Y-1;ee++)N+=Math.hypot(P[ee*2+2]-P[ee*2],P[ee*2+3]-P[ee*2+1]);$=Xn(Q,E,Z,re,_);let q=ee=>Math.min(_.width.get(ee)??0,$*2),te=q(Z)-$,K=q(re)-$,oe=Math.min(A,N/2);if(oe>0&&(te>0||K>0)){X=J=>{let fe=0;return te>0&&J<oe&&(fe=te*(1-J/oe)),K>0&&N-J<oe&&(fe=Math.max(fe,K*(1-(N-J)/oe))),$+fe};let ee=[];for(let J of[oe,N-oe])J>.01&&J<N-.01&&ee.push(J);if(ee.length){let J=zi(P,C,ee);P=J.pts,C=J.levels,Y=P.length/2}}}d((Y-1)*4);let z=0;for(let N=0;N<Y-1;N++){let q=P[N*2],te=P[N*2+1],K=P[N*2+2],oe=P[N*2+3],ee=Math.hypot(K-q,oe-te);if(T&&ji(q,te,K,oe,t.extent)){z+=ee;continue}let J=$i(q,te,K,oe,t.extent);if(!J){z+=ee;continue}let[fe,be,de,Fe]=J,Ce=Math.hypot(fe-q,be-te),Le=Math.hypot(de-fe,Fe-be),Ve=Math.hypot(K-de,oe-Fe),we=z+Ce,se=C?C[N]:0,Pe=C?C[N+1]:0,xe=X?X(we):$,Be=X?X(we+Le):$,Oe=b(fe,be,de,Fe,0,-1,we,se,Pe,xe),De=b(fe,be,de,Fe,0,1,we,se,Pe,xe),Ie=b(fe,be,de,Fe,1,1,we,se,Pe,Be),ze=b(fe,be,de,Fe,1,-1,we,se,Pe,Be);z+=Ce+Le+Ve,g.push(Oe,De,Ie,Oe,Ie,ze)}}}if(!g.length)return null;let R=new Uint32Array(g);return{vertices:a.slice(0,x*ct),indices:R.buffer,vertexCount:x,indexCount:R.length}}function zi(t,e,n){let r=[...n].sort((a,m)=>a-m),i=[t[0],t[1]],s=e?[e[0]]:void 0,l=0,c=0;for(let a=0;a+3<t.length;a+=2){let m=t[a],x=t[a+1],g=t[a+2],d=t[a+3],b=Math.hypot(g-m,d-x);for(;c<r.length&&r[c]<=l+.01;)c++;for(;c<r.length&&r[c]<l+b-.01;){let E=(r[c]-l)/b;i.push(m+(g-m)*E,x+(d-x)*E),s&&e&&s.push(Math.round(e[a/2]+(e[a/2+1]-e[a/2])*E)),c++}l+=b,i.push(g,d),s&&e&&s.push(e[a/2+1])}return{pts:i,levels:s}}function Hi(t,e){let n=[];for(let r=0;r+3<t.length;r+=2){let i=t[r],s=t[r+1],l=t[r+2],c=t[r+3];n.push(i,s);let a=Math.min(64,Math.floor(Math.hypot(l-i,c-s)/e));for(let m=1;m<a;m++){let x=m/a;n.push(i+(l-i)*x,s+(c-s)*x)}}return n.push(t[t.length-2],t[t.length-1]),n}function Hn(t){let e=[];for(let n=0;n<t.length;n+=2){let r=t[n],i=t[n+1],s=e.length;s>=2&&e[s-2]===r&&e[s-1]===i||e.push(r,i)}return e}function $i(t,e,n,r,i){let s=n-t,l=r-e,c=0,a=1,m=[[-s,t],[s,i-t],[-l,e],[l,i-e]];for(let[x,g]of m){if(x===0){if(g<0)return null;continue}let d=g/x;if(x<0){if(d>a)return null;d>c&&(c=d)}else{if(d<c)return null;d<a&&(a=d)}}return a-c<1e-6?null:[Math.round(t+s*c),Math.round(e+l*c),Math.round(t+s*a),Math.round(e+l*a)]}function ji(t,e,n,r,i){return t===n&&(t<=0||t>=i)?!0:e===r&&(e<=0||e>=i)}var $n=new WeakMap,wt=(t,e)=>(t+512)*65536+(e+512);function Xn(t,e,n,r,i){if(t===0||e<=0)return e;let s=8*4294967296,l=Math.max(i.raw.get(n+s)??0,i.raw.get(r+s)??0);return l>0&&e>l?l:e}function Xi(t){let e=$n.get(t);if(e)return e;let n={width:new Map,ends:new Map,raw:new Map},r=[];for(let i of t.features()){if(i.type!==2)continue;let s=i.properties.width,l=typeof s=="number"&&s>.5&&s<100?s:0,c=Qe(i.properties);for(let a of i.loadGeometry()){if(a.length<4)continue;let m=wt(Math.round(a[0]),Math.round(a[1])),x=wt(Math.round(a[a.length-2]),Math.round(a[a.length-1]));for(let g of[m,x]){let d=g+(c+8)*4294967296;n.ends.set(d,(n.ends.get(d)??0)+1),l>0&&n.raw.set(d,Math.max(n.raw.get(d)??0,l))}r.push({h:m,t:x,lv:c,w:l})}}for(let i of r){let s=Xn(i.lv,i.w,i.h,i.t,n);if(!(s<=0))for(let l of[i.h,i.t]){let c=n.width.get(l);(c===void 0||s>c)&&n.width.set(l,s)}}return $n.set(t,n),n}var Yi=[["\\u0443\\u043B\\u0438\\u0446\\u0430","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u044B","\\u0443\\u043B."],["\\u0443\\u043B\\u0438\\u0446\\u0435","\\u0443\\u043B."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0440\\u043E\\u0441\\u043F\\u0435\\u043A\\u0442\\u0430","\\u043F\\u0440\\u043E\\u0441\\u043F."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043E\\u043A","\\u043F\\u0435\\u0440."],["\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043A\\u0430","\\u043F\\u0435\\u0440."],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434","\\u043F\\u0440-\\u0434"],["\\u043F\\u0440\\u043E\\u0435\\u0437\\u0434\\u0430","\\u043F\\u0440-\\u0434"],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u044C","\\u043F\\u043B."],["\\u043F\\u043B\\u043E\\u0449\\u0430\\u0434\\u0438","\\u043F\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440","\\u0431\\u0443\\u043B."],["\\u0431\\u0443\\u043B\\u044C\\u0432\\u0430\\u0440\\u0430","\\u0431\\u0443\\u043B."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u0430\\u044F","\\u043D\\u0430\\u0431."],["\\u043D\\u0430\\u0431\\u0435\\u0440\\u0435\\u0436\\u043D\\u043E\\u0439","\\u043D\\u0430\\u0431."],["\\u0448\\u043E\\u0441\\u0441\\u0435","\\u0448."],["\\u0442\\u0443\\u043F\\u0438\\u043A","\\u0442\\u0443\\u043F."],["\\u0442\\u0443\\u043F\\u0438\\u043A\\u0430","\\u0442\\u0443\\u043F."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D","\\u043C\\u043A\\u0440."],["\\u043C\\u0438\\u043A\\u0440\\u043E\\u0440\\u0430\\u0439\\u043E\\u043D\\u0430","\\u043C\\u043A\\u0440."],["\\u043A\\u04EF\\u0447\\u0430\\u0438","\\u043A."],["\\u043A\\u0443\\u0447\\u0430\\u0438","\\u043A."],["\\u0445\\u0438\\u0451\\u0431\\u043E\\u043D\\u0438","\\u0445\\u0438\\u0451\\u0431."],["\\u0448\\u043E\\u04B3\\u0440\\u043E\\u04B3\\u0438","\\u0448\\u043E\\u04B3."],["\\u0433\\u0443\\u0437\\u0430\\u0440\\u0433\\u043E\\u04B3\\u0438","\\u0433\\u0443\\u0437."],["\\u043C\\u0430\\u0439\\u0434\\u043E\\u043D\\u0438","\\u043C\\u0430\\u0439\\u0434."]],Yn=new Map(Yi);function Zn(t){let e=t.split(" ");if(e.length<2)return t;let n=!1,r=e.map(s=>{let l=Yn.get(s.toLowerCase());return l?(n=!0,s[0]===s[0].toUpperCase()?l[0].toUpperCase()+l.slice(1):l):s});return!n||!e.filter(s=>Yn.get(s.toLowerCase())===void 0).length?t:r.join(" ")}function Qn(t,e){let n=[],r=[],i=[],s=[],l=[],c=e.textPlacement==="line",a=[],m=[],x=[];for(let g of t.features()){if(!ce(e.filter,g.properties))continue;let d=g.loadGeometry(),b=Qi(g.type,d);if(!b)continue;let E=e.textField?Wn(e.textField,g.properties):"",A=E&&e.abbreviate?Zn(E):E,_=e.iconImage?Wn(e.iconImage,g.properties):"";if(!(!A&&!_)){if(c){let R=Wi(g.type,d);if(!R)continue;x.push({text:A,line:R});continue}n.push(b[0],b[1]),r.push(A),i.push(_),s.push(Ki(g.properties)),l.push(e.iconRotate&&Math.round(Number(g.properties[e.iconRotate]??0))||0)}}if(c){for(let{text:g,line:d}of Zi(x)){m.push(a.length/2);for(let b of d)a.push(b);n.push(Math.round(d[0]),Math.round(d[1])),r.push(g),i.push(""),s.push(128),l.push(0)}m.push(a.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:i,priorities:new Uint8Array(s).buffer,rotations:new Int16Array(l).buffer,...c?{lines:new Int16Array(a).buffer,lineStarts:new Uint32Array(m).buffer}:{}}:null}function Zi(t){let e=[],n=new Map,r=new Map,i=(s,l,c)=>`${s}\\u241F${l}\\u241F${c}`;for(let{text:s,line:l}of t){let c=i(s,l[0],l[1]),a=i(s,l[l.length-2],l[l.length-1]),m=n.get(a),x=r.get(c);if(x!==void 0){let g=e[x];if(g.line.push(...l.slice(2)),r.delete(c),r.set(i(s,g.line[g.line.length-2],g.line[g.line.length-1]),x),m!==void 0&&m!==x){let d=e[m];g.line.push(...d.line.slice(2)),d.line=[],n.delete(a),r.set(i(s,g.line[g.line.length-2],g.line[g.line.length-1]),x)}continue}if(m!==void 0){let g=e[m];g.line.unshift(...l.slice(0,l.length-2)),n.delete(a),n.set(i(s,g.line[0],g.line[1]),m);continue}n.set(c,e.length),r.set(a,e.length),e.push({text:s,line:l})}return e.filter(s=>s.line.length>=4)}function Wi(t,e){if(t!==2)return null;let n=null,r=0;for(let i of e){if(i.length<4)continue;let s=0;for(let l=0;l+3<i.length;l+=2)s+=Math.hypot(i[l+2]-i[l],i[l+3]-i[l+1]);s>r&&(r=s,n=i)}return n}function Qi(t,e){if(!e.length)return null;if(t===1){let l=e[0];return l.length>=2?[l[0],l[1]]:null}if(t===2){let l=-1,c=0,a=0;for(let m of e)for(let x=0;x+3<m.length;x+=2){let g=m[x+2]-m[x],d=m[x+3]-m[x+1],b=g*g+d*d;b>l&&(l=b,c=m[x]+g/2,a=m[x+1]+d/2)}return l>0?[Math.round(c),Math.round(a)]:null}let n=1/0,r=1/0,i=-1/0,s=-1/0;for(let l of e)for(let c=0;c<l.length;c+=2)l[c]<n&&(n=l[c]),l[c]>i&&(i=l[c]),l[c+1]<r&&(r=l[c+1]),l[c+1]>s&&(s=l[c+1]);return isFinite(n)?[Math.round((n+i)/2),Math.round((r+s)/2)]:null}function Ki(t){let e=t.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function Wn(t,e){let n=Array.isArray(t)?t:[t];for(let r of n){let i=!0,l=r.replace(/\\{([^}]+)\\}/g,(c,a)=>{let m=e[a];return m==null||m===""?(i=!1,""):String(m)}).trim();if(i&&l)return l}return""}function Kn(t,e){let n=[],r=[];for(let i=0;i<t.length;i++){let s=t.feature(i);if(s.type===1&&ce(e,s.properties))for(let l of s.loadGeometry())for(let c=0;c+1<l.length;c+=2)n.push(l[c],l[c+1]),r.push(s.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var Ji="\\u241F",Yt=(t,e)=>t+Ji+String(e);function qi(){let t=typeof self<"u"?self.origin:void 0;return t&&t!=="null"&&!t.startsWith("blob:")?t+"/":void 0}async function Jn(t,e){let n=performance.now(),r=qi(),i=await fetch(t.url,{signal:e,credentials:"same-origin",...r?{referrer:r}:{}}),s=(R,L,k,T,O=0)=>({type:"loaded",id:t.id,buckets:{},timing:{fetchMs:T,parseMs:O},diag:{status:R,bytes:L,layers:k,built:0}});if(!i.ok){if(i.status===404||i.status===204)return s(i.status,0,[],performance.now()-n);throw new Error(`HTTP ${i.status} \\u0434\\u043B\\u044F ${t.url}`)}let l=await i.arrayBuffer(),c=performance.now()-n;if(l.byteLength===0)return s(i.status,0,[],c);let a=performance.now(),m=new gt(l),x=Object.keys(m.layers),g={},d={},b=new Set,E=[],_=t.plan.some(R=>R.type==="surface"&&(R.elevation??0)>0)&&t.plan.some(R=>R.type==="line"&&R.ground)?In(t.metersPerTile):void 0;for(let R of t.plan){if(!to(R,t.zoom,t.sourceMaxZoom))continue;let L=m.layers[R.sourceLayer];if(!L)continue;let k=no(t.zoom,L.extent);try{if(R.splitBy){let O=ro(L,R.splitBy,R.filter);if(!O.length)continue;let D=d[R.splitBy]??(d[R.splitBy]=[]);for(let U of O){D.includes(U)||D.push(U);let P={...R,splitBy:void 0,filter:oo(R.filter,R.splitBy,U)},C=Zt(P,L,k,t.metersPerTile,_);C&&(g[Yt(R.id,U)]=C)}continue}if(R.network&&R.type==="line"){for(let O of io(L,R.filter)){let D=Zt(R,L,k,t.metersPerTile,_,O);D&&(g[Yt(R.id,O)]=D,b.add(O))}continue}let T=Zt(R,L,k,t.metersPerTile,_);T&&(g[R.id]=T)}catch(T){E.push(`${R.id}: ${T instanceof Error?T.message:String(T)}`)}}return{type:"loaded",id:t.id,buckets:g,...Object.keys(d).length?{splits:d}:{},...b.size?{levels:[...b].sort((R,L)=>R-L)}:{},timing:{fetchMs:c,parseMs:performance.now()-a},diag:{status:i.status,bytes:l.byteLength,layers:x,built:Object.keys(g).length,...E.length?{failed:E}:{}}}}function eo(t){return e=>{let n=e.on;if(typeof n!="string"||!n)return 0;let r=0;for(let i of n.split(",")){let s=t[i];typeof s=="number"&&s>r&&(r=s)}return r}}function to(t,e,n){let r=e-1,i=e<n?e+1:24;return!(t.maxzoom<r||t.minzoom>i)}function no(t,e){return t<=6?Math.max(64,e/24):0}function Zt(t,e,n,r,i,s){{if(t.type==="fill"){let c=r>0?r/e.extent:0,a=t.cornerRadius&&c>0?{radius:t.cornerRadius/c,segments:t.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:hn/c}:void 0,m=Rn(e,t.filter,n,a,t.clipToTile===!0,e.extent);return m?{kind:"fill",...m,extent:e.extent}:null}if(t.type==="surface"){let c=zn(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,maxSegment:n,elevation:t.elevation??0,base:t.base,bevel:t.bevel,weld:t.weld,bevelDrop:t.bevelDrop,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments,...i?{onShapes:a=>Pn(i,a,t.elevation??0,e.extent)}:{},...t.groundBy?{liftBy:eo(t.groundBy)}:{}});return c?{kind:"surface",...c}:null}if(t.type==="line"){let c=jn(e,t.filter,n,t.ground?i:void 0,r>0?r/e.extent:0,{level:s});return c?{kind:"line",...c,extent:e.extent}:null}if(t.type==="model"){let c=Kn(e,t.filter);return c?{kind:"placement",...c,extent:e.extent}:null}if(t.type==="symbol"){let c=Qn(e,{filter:t.filter,textField:t.textField,iconImage:t.iconImage,iconRotate:t.iconRotate,textPlacement:t.textPlacement,abbreviate:t.abbreviate});return c?{kind:"symbol",...c,extent:e.extent}:null}let l=En(e,e.extent,t.filter,{metersPerUnit:r>0?r/e.extent:0,cornerRadius:t.cornerRadius,cornerSegments:t.cornerSegments});return l?{kind:"fill-extrusion",vertices:l.vertices,indices:l.indices,featureIds:l.featureIds,vertexCount:l.vertexCount,indexCount:l.indexCount,extent:l.extent}:null}}function ro(t,e,n){let r=[];for(let i of t.features()){if(!ce(n,i.properties))continue;let s=i.properties[e];typeof s!="string"&&typeof s!="number"||r.includes(s)||r.push(s)}return r.sort((i,s)=>typeof i=="number"&&typeof s=="number"?i-s:String(i).localeCompare(String(s))),r}function io(t,e){let n=[];for(let r of t.features()){if(!ce(e,r.properties))continue;let i=Qe(r.properties);n.includes(i)||n.push(i)}return n.sort((r,i)=>r-i)}function oo(t,e,n){let r=["==",e,n];return t?["all",t,r]:r}var so=t=>t.kind==="symbol",uo=t=>t.kind==="placement";function qn(t){let e=[];for(let n of Object.values(t.buckets)){if(uo(n)){e.push(n.anchors);continue}if(so(n)){e.push(n.anchors,n.priorities),n.lines&&e.push(n.lines),n.lineStarts&&e.push(n.lineStarts);continue}e.push(n.vertices,n.indices),n.featureIds&&e.push(n.featureIds)}return e}var er=Map;var Ke=new er,Wt=self;Wt.onmessage=t=>{let e=t.data;if(e.type==="abort"){Ke.get(e.id)?.abort(),Ke.delete(e.id);return}let n=new AbortController;Ke.set(e.id,n),Jn(e,n.signal).then(r=>{Ke.has(e.id)&&(Ke.delete(e.id),Wt.postMessage(r,qn(r)))}).catch(r=>{let i=n.signal.aborted;Ke.delete(e.id);let s={type:"error",id:e.id,message:r instanceof Error?r.message:String(r),aborted:i};Wt.postMessage(s)})};})();\n';var No=class{constructor(e=dn()){this.workers=[];this.blobUrl=null;this.pending=new B;this.nextId=1;this.cursor=0;this.mainThreadAborts=new B;this.destroyed=false;try{let t=new Blob([un],{type:"text/javascript"});this.blobUrl=URL.createObjectURL(t);for(let o=0;o<e;o++){let r=new Worker(this.blobUrl);r.onmessage=n=>this.onMessage(n.data),r.onerror=n=>console.error("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440 \u0443\u043F\u0430\u043B:",n.message),this.workers.push(r);}}catch(t){console.warn("[osmgl] \u0432\u043E\u0440\u043A\u0435\u0440\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B, \u0440\u0430\u0437\u0431\u043E\u0440 \u0442\u0430\u0439\u043B\u043E\u0432 \u043F\u043E\u0439\u0434\u0451\u0442 \u0432 \u0433\u043B\u0430\u0432\u043D\u043E\u043C \u043F\u043E\u0442\u043E\u043A\u0435:",t),this.disposeWorkers();}this.usingWorkers=this.workers.length>0;}get size(){return this.workers.length}load(e,t){let o=this.nextId++,r={type:"load",id:o,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(o,a),cl(r,a.signal).then(l=>{this.mainThreadAborts.has(o)&&(this.mainThreadAborts.delete(o),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(o),t({type:"error",id:o,message:l instanceof Error?l.message:String(l),aborted:s});}),o}let n=this.cursor++%this.workers.length;return this.pending.set(o,{resolve:t,workerIndex:n}),this.workers[n].postMessage(r),o}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}let t=this.pending.get(e);if(!t)return;this.pending.delete(e);let o={type:"abort",id:e};this.workers[t.workerIndex].postMessage(o);}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),t.resolve(e));}disposeWorkers(){for(let e of this.workers)e.terminate();this.workers=[],this.blobUrl&&URL.revokeObjectURL(this.blobUrl),this.blobUrl=null;}destroy(){this.destroyed=true;for(let e of this.mainThreadAborts.values())e.abort();this.mainThreadAborts.clear(),this.pending.clear(),this.disposeWorkers();}};function dn(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function fl(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function hn(i,e){let t=fl(i.zoom),o=[Math.round(i.zoom*100)/100,i.center.lat.toFixed(t),i.center.lng.toFixed(t)],r=Math.round(i.bearing*10)/10,n=Math.round(i.pitch*10)/10;(r!==0||n!==0)&&(o.push(r),n!==0&&o.push(n));let a=o.join("/");return e?`${e}=${a}`:a}function mn(i,e){let t=i.replace(/^#/,"");if(!t)return null;if(e){let s=t.split("&").map(c=>c.split("=")).find(([c])=>c===e);if(!s||s.length<2)return null;t=s[1];}let o=t.split("/");if(o.length<3)return null;let r=Number(o[0]),n=Number(o[1]),a=Number(o[2]);if(!isFinite(r)||!isFinite(n)||!isFinite(a)||Math.abs(n)>90||Math.abs(a)>180)return null;let l={center:{lng:a,lat:n},zoom:r};return o.length>3&&isFinite(Number(o[3]))&&(l.bearing=Number(o[3])),o.length>4&&isFinite(Number(o[4]))&&(l.pitch=Number(o[4])),l}function ul(i){if(typeof window>"u"||!window.history?.replaceState)return;let e=new URL(window.location.href);e.hash=i,window.history.replaceState(window.history.state,"",e.toString());}var dl={high:{name:"high",maxPixelRatio:2,maxCanvasPixels:16777216,antialias:true,maxWorkers:6,shadowMapSize:1024,detail:1,tileCacheSize:64,allowShadows:true,detailBias:1,maxTiles:512,modelBudget:1,simpleGeometry:false},balanced:{name:"balanced",maxPixelRatio:1.75,maxCanvasPixels:5529600,antialias:true,maxWorkers:4,shadowMapSize:1024,detail:.85,tileCacheSize:40,allowShadows:true,detailBias:1.1,maxTiles:192,modelBudget:.7,simpleGeometry:false},low:{name:"low",maxPixelRatio:1.25,maxCanvasPixels:2592e3,antialias:true,maxWorkers:2,shadowMapSize:512,detail:.5,tileCacheSize:24,allowShadows:false,detailBias:1.25,maxTiles:96,modelBudget:.4,simpleGeometry:true},minimal:{name:"minimal",maxPixelRatio:1,maxCanvasPixels:1152e3,antialias:false,maxWorkers:2,shadowMapSize:512,detail:0,tileCacheSize:16,allowShadows:false,detailBias:1.7,maxTiles:48,modelBudget:.2,simpleGeometry:true}},St=i=>dl[i]??dl.high;function Uo(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r}=i;return e<=2||t!==void 0&&t<=2?"minimal":o?e<=4||t!==void 0&&t<=3?"minimal":e<=6||t!==void 0&&t<=4||r>=3?"low":"balanced":e<=4||t!==void 0&&t<=4?"balanced":"high"}function jo(){if(typeof navigator>"u")return {cores:4,mobile:false,devicePixelRatio:1};let i=navigator,e=typeof matchMedia=="function"&&matchMedia("(pointer: coarse)").matches&&typeof screen<"u"&&Math.min(screen.width,screen.height)<=820,t=i.userAgentData?.mobile===true||e;return {cores:i.hardwareConcurrency||4,memory:i.deviceMemory,mobile:t,devicePixelRatio:typeof devicePixelRatio=="number"?devicePixelRatio:1}}function pn(i,e,t,o){let r=Math.min(t||1,o.maxPixelRatio),n=Math.max(i*e,1),a=Math.sqrt(o.maxCanvasPixels/n);return Math.max(Math.min(r,a),1)}function bn(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function hl(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function yn(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var au=1,oo=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${au++}`,this.zIndex=e.zIndex??0,this.altitude=e.altitude??0,this.visible=e.visible!==false,this.userData=e.userData??{},this.paint=e;}get ghostOpacity(){return this.paint.ghostOpacity??0}get revision(){return this._revision}invalidate(){this._revision++;}setPaint(e){return Object.assign(this.paint,e),this.invalidate(),this}setOriginFromCoords(e){let t=1/0,o=1/0,r=-1/0,n=-1/0;for(let a of e)for(let l of a){let s=Z(l),c=oe(s.lng),f=re(s.lat);c<t&&(t=c),c>r&&(r=c),f<o&&(o=f),f>n&&(n=f);}if(!isFinite(t)){this.originX=0,this.originY=0;return}this.originX=(t+r)/2,this.originY=(o+n)/2;}toLocal(e){let t=[];for(let o of e){let r=Z(o);t.push(oe(r.lng)-this.originX,re(r.lat)-this.originY);}return t}color(e,t){let o=ce(this.paint[e]??t),r=this.paint.opacity??1;return [o[0],o[1],o[2],o[3]*r]}linePaint(e){return e.dashArray=this.paint.dashArray,e.offset=this.paint.offset,this.paint.arrow&&(e.arrow=true,e.arrowColor=this.color("arrowColor","#ffffff"),e.arrowPeriod=this.paint.arrowPeriod??46,e.arrowSize=this.paint.arrowSize??5),e}},vn=class extends oo{constructor(e){super(e),this.coordinates=e.coordinates,this.segments=e.segments??[],this.setOriginFromCoords([this.coordinates]);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords([e]),this.invalidate(),this}setSegments(e){return this.segments=e,this.invalidate(),this}getCoordinates(){return this.coordinates}rings(){return [this.coordinates]}build(){let e=Ot([this.toLocal(this.coordinates)]);if(!e)return [];let t=this.paint.width??6,o=[],r=this.paint.strokeWidth??0;r>0&&o.push({kind:"line",mesh:e,color:this.color("strokeColor","#ffffff"),width:t+r*2,offset:this.paint.offset});let n=this.colorRuns();if(!n.length)return o.push(this.linePaint({kind:"line",mesh:e,color:this.color("color","#2f6df6"),width:t})),o;let a=this.paint.opacity??1;for(let l of n){let s=Ot([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=ce(l.color);o.push(this.linePaint({kind:"line",mesh:s,color:[c[0],c[1],c[2],c[3]*a],width:t}));}return o}colorRuns(){if(this.segments.length===0||this.coordinates.length<2)return [];let e=this.coordinates.length-1,t=this.segments.filter(r=>Number.isInteger(r.at)&&r.at>=0&&r.at<e).sort((r,n)=>r.at-n.at);if(!t.length)return [];let o=[];for(let r=0;r<t.length;r++){let n=r===0?0:t[r].at,a=r+1<t.length?t[r+1].at:e;a>n&&o.push({from:n,to:a,color:t[r].color});}return o}hitTest(e,t,o){let r=(this.paint.width??6)/2+(this.paint.strokeWidth??0)+o,n=xn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(ml(e,n[a],n[a+1])<=r)return true;return false}},Xo=class extends oo{constructor(e){super(e),this.coordinates=e.coordinates,this.setOriginFromCoords(this.coordinates);}setCoordinates(e){return this.coordinates=e,this.setOriginFromCoords(e),this.invalidate(),this}rings(){return this.coordinates}build(){let e=[],t=Pr(this.coordinates.map(r=>this.toLocal(r)));t&&e.push({kind:"fill",mesh:t,color:this.color("color","#2f6df6"),width:0});let o=this.paint.strokeWidth??this.paint.width??0;if(o>0){let r=this.coordinates.map(a=>this.toLocal(gn(a))),n=Ot(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=xn(gn(this.coordinates[0]??[]),this.altitude,t);if(!_n(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(_n(e,xn(gn(this.coordinates[r]),this.altitude,t)))return false;return true}},wn=class extends Xo{constructor(e){super({...e,coordinates:[lu(e.center,e.radius,e.segments)]});}};function lu(i,e,t){let o=Z(i),r=e/Le(o.lat),n=oe(o.lng),a=re(o.lat),l=Math.max(12,t??Math.min(128,Math.round(24+e/20))),s=[];for(let c=0;c<l;c++){let f=c/l*Math.PI*2;s.push([Se(n+Math.cos(f)*r),Ce(a+Math.sin(f)*r)]);}return s}function xn(i,e,t){let o=[];for(let r of i){let n=Z(r),a=t(n.lng,n.lat,e);a&&o.push(a);}return o}function gn(i){if(i.length<2)return i;let e=Z(i[0]),t=Z(i[i.length-1]);return e.lng===t.lng&&e.lat===t.lat?i:[...i,i[0]]}function ml(i,e,t){let o=t.x-e.x,r=t.y-e.y,n=o*o+r*r;if(n<1e-12)return Math.hypot(i.x-e.x,i.y-e.y);let a=((i.x-e.x)*o+(i.y-e.y)*r)/n;return a=a<0?0:a>1?1:a,Math.hypot(i.x-(e.x+a*o),i.y-(e.y+a*r))}function _n(i,e){let t=false;for(let o=0,r=e.length-1;o<e.length;r=o++){let n=e[o].x,a=e[o].y,l=e[r].x,s=e[r].y;a>i.y!=s>i.y&&i.x<(l-n)*(i.y-a)/(s-a)+n&&(t=!t);}return t}var pl="objects3d",Mt="level",su=32,cu=100,Cn=120,fu=40,uu=.35,du=.02,hu=150,mu=250;function bl(i){return typeof i=="number"?{top:i,right:i,bottom:i,left:i}:{top:i?.top??0,right:i?.right??0,bottom:i?.bottom??0,left:i?.left??0}}function pu(i){let e={...i};return delete e.cornerRadius,delete e.cornerSegments,e.type==="surface"&&(e.type="fill",delete e.elevation,delete e.base,delete e.bevel,delete e.bevelDrop),e}var Sn=class extends Ge{constructor(t){super();this.options=t;this.transform=new kt;this.ctx=null;this.sources=new B;this.rasterSources=new B;this.renderer=new Ut;this.objects=new Bt;this.markerHost=null;this.gestures=null;this.resizeObserver=null;this.frameHandle=0;this.needsRepaint=true;this.padding={top:0,right:0,bottom:0,left:0};this.animation=null;this.loaded=false;this.destroyed=false;this.objects3d=null;this.objects3dEnabled=true;this.frameRing=new Uint8Array(Cn);this.ringAt=0;this.ringSum=0;this.ringFilled=0;this.steadyFrames=0;this.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new B;this.autoIndoorLevel=true;this.debugFB=null;let o=typeof t.container=="string"?document.getElementById(t.container):t.container;if(!o)throw new Error(`[osmgl] \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: ${String(t.container)}`);this.container=o,this.qualityAuto=(t.quality??"auto")==="auto";let r=this.qualityAuto?Uo(jo()):t.quality;this.qualityCeiling=r,this.quality=St(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new dt(t.theme?Co(t.theme,t.style):t.style),this.background=t.background?ce(t.background):null,this.canvas=document.createElement("canvas"),this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.display="block",this.canvas.style.outline="none",getComputedStyle(this.container).position==="static"&&(this.container.style.position="relative"),this.container.appendChild(this.canvas);let n=document.createElement("div");n.className="osmgl-markers",n.style.cssText="position:absolute;inset:0;overflow:hidden;pointer-events:none",this.container.appendChild(n),this.markerHost=n,this.objects.setMarkerHost(n);let a=this.transform;a.minZoom=t.minZoom??0,a.maxZoom=t.maxZoom??22,a.maxPitch=t.maxPitch??75,a.projection=t.projection??"mercator",a.center=Z(t.center??[0,0]),a.zoom=t.zoom??2,a.bearing=t.bearing??0,a.pitch=t.pitch??0,this.hashName=typeof t.hash=="string"?t.hash:void 0,t.hash&&this.applyHash(false),this.pool=new No(t.workerCount??Math.min(dn(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}initGL(){let t=this.canvas.getContext("webgl2",{alpha:false,antialias:this.quality.antialias,depth:true,stencil:true,preserveDrawingBuffer:false,powerPreference:"high-performance",failIfMajorPerformanceCaveat:false});if(!t)throw new Error("[osmgl] WebGL2 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u0432 \u044D\u0442\u043E\u043C \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435");this.ctx=new lo(t);let o=new wt(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...tt,...this.options.icons}),o.onAssetsReady=()=>this.triggerRepaint(),this.renderer.symbols=o,this.renderer.objects=this.objects,this.renderer.models.onLoaded=()=>this.triggerRepaint(),this.renderer.init(this.ctx),this.canvas.addEventListener("webglcontextlost",r=>{r.preventDefault(),this.stopFrameLoop(),this.emit("contextlost",void 0),this.emit("error",{message:"\u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442 WebGL \u043F\u043E\u0442\u0435\u0440\u044F\u043D"});});}initSource(){this.options.tiles&&this.addSource(K,{url:this.options.tiles,minzoom:this.options.sourceMinZoom??0,maxzoom:this.options.sourceMaxZoom??14});for(let[o,r]of Object.entries({...this._style.spec.sources??{},...this.options.sources??{}}))this.addSource(o,r);let t=this.options.objects3d;if(t){this.objects3d=new Go({endpoint:t.endpoint??"/objects3d",apiKey:t.apiKey??null}),this.objects3d.onReady=()=>this.triggerRepaint(),this.objects3d.setModelKey(this._style.spec.model3dKey??"");let o=t.sourceMaxZoom??14;this.addSource(this.objects3dSource,{url:t.tiles,minzoom:o,maxzoom:o});}}get objects3dSource(){return this.options.objects3d?this.options.objects3d.source??"model3d":null}objects3dPlan(){let t=this.options.objects3d;return {id:pl,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(pu):n}updateObjects3D(){let t=this.objects3d,o=this.objects3dSource;if(!t||!o)return;let r=this.sources.get(o);if(!r)return;if(!this.objects3dEnabled){t.models.length&&t.clear(l=>this.renderer.models.remove(l,this.ctx?.gl)),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=null;return}let n=this.venuesForMask();t.update({id:pl,"source-layer":this.options.objects3d.sourceLayer??"model3d",layout:this.options.objects3d.layout},r,this.transform,l=>this.renderer.models.add(l),l=>this.renderer.models.remove(l,this.ctx?.gl),this.buildingsForMask(),n),this.renderer.hiddenBuildings=t.replacedBuildings,this.renderer.hiddenVenues=t.replacedVenues,this.renderer.hiddenVenueLayer=n?.key??null;let a=this.renderer.indoorMask.footprint();if(a){let l=this.transform.worldSize>0?this.transform.pixelsPerMeter/this.transform.worldSize*1.5:0;for(let s of t.models){let c=s.origin();s.setHidden(Ve(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get(K);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??K)!==K)continue;let r=this._style.bucketKeyFor(o);if(r!==null)return {source:t,key:r}}return null}venuesForMask(){let t=new Set;for(let o of this._style.layers)"splitBy"in o&&o.splitBy===Mt&&t.add(o.source??K);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??K;if(!t.has(r))continue;let n=this.sources.get(r),a=this._style.bucketKeyFor(o);if(n&&a!==null)return {source:n,key:a}}return null}addSource(t,o){if(this.sources.get(t)?.destroy(),this.sources.delete(t),this.rasterSources.get(t)?.destroy(),this.rasterSources.delete(t),o.type==="raster"){let n=new Zt({url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??19,cacheSize:this.quality.tileCacheSize*2});return n.on("data",()=>this.triggerRepaint()),n.on("error",({message:a})=>this.emit("error",{message:a})),this.rasterSources.set(t,n),this.triggerRepaint(),this}let r=new Oo(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t)});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:n})=>this.emit("error",{message:n})),t===K&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new bo(this.canvas,this.transform,t=>{this.animation=null,t==="zoom"&&this.emit("zoom",void 0),this.emitMove(),this.triggerRepaint();},()=>this.emit("moveend",void 0),this.options.gestures),this.initClicks(),this.initHash();}initClicks(){let t=null;this.canvas.addEventListener("pointerdown",r=>{r.button===0&&(t={x:r.clientX,y:r.clientY,t:performance.now()});}),this.canvas.addEventListener("pointerup",r=>{let n=t;if(t=null,r.button!==0||!n||Math.hypot(r.clientX-n.x,r.clientY-n.y)>4||performance.now()-n.t>500)return;let a=this.canvas.getBoundingClientRect(),l={x:r.clientX-a.left,y:r.clientY-a.top},s=this.objects.hitTest(this.transform,l),c=s?null:this.queryRoom(l),f=s||c?null:this.queryBuilding(l);this.options.highlightBuildings!==false&&(this.setHighlight(f),this.setRoomHighlight(c));for(let u of this.getPopups())u.closeOnClick&&this.removePopup(u);this.emit("click",{point:l,lngLat:this.transform.unproject(l),object:s,building:f,symbol:this.querySymbol(l,4)});}),this.canvas.addEventListener("dblclick",r=>{let n=this.pointOf(r);this.emit("dblclick",{point:n,lngLat:this.transform.unproject(n)});}),this.canvas.addEventListener("contextmenu",r=>{r.preventDefault();let n=this.pointOf(r);this.emit("contextmenu",{point:n,lngLat:this.transform.unproject(n)});});let o=0;this.canvas.addEventListener("pointermove",r=>{if(r.pointerType==="touch")return;let n=performance.now();if(n-o<16)return;o=n;let a=this.pointOf(r),l=this.querySymbol(a);this.setSymbolHover(l),this.emit("mousemove",{point:a,lngLat:this.transform.unproject(a),object:this.objects.hitTest(this.transform,a),symbol:l});});}pointOf(t){let o=this.canvas.getBoundingClientRect();return {x:t.clientX-o.left,y:t.clientY-o.top}}initResize(){this.resizeObserver=new ResizeObserver(()=>this.resize()),this.resizeObserver.observe(this.container),this.resize();}resize(){if(this.destroyed)return;let t=this.container.clientWidth||1,o=this.container.clientHeight||1,r=pn(t,o,Math.min(window.devicePixelRatio||1,this.maxPixelRatio),this.densityQuality);this.canvas.width=Math.round(t*r),this.canvas.height=Math.round(o*r),this.transform.resize(t,o),this.triggerRepaint();}getCenter(){return this.transform.center}getZoom(){return this.transform.zoom}getBearing(){return this.transform.bearing}getPitch(){return this.transform.pitch}setCenter(t){return this.transform.center=Z(t),this.afterCameraChange()}setZoom(t){return this.transform.zoom=t,this.emit("zoom",void 0),this.afterCameraChange()}setBearing(t){return this.transform.bearing=t,this.afterCameraChange()}setPitch(t){return this.transform.pitch=t,this.afterCameraChange()}jumpTo(t){let o=this.transform;return t.center!==void 0&&(o.center=Z(t.center)),t.zoom!==void 0&&(o.zoom=t.zoom),t.bearing!==void 0&&(o.bearing=t.bearing),t.pitch!==void 0&&(o.pitch=t.pitch),this.animation=null,this.afterCameraChange()}easeTo(t){let o=t.duration??0;if(o<=0)return this.jumpTo(t);let r=this.transform,n={center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch},l={center:t.center!==void 0?Z(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+rt((t.bearing??r.bearing)-n.bearing),pitch:t.pitch??r.pitch};return this.animation={start:performance.now(),duration:o,from:n,to:l},this.triggerRepaint(),this}flyTo(t){let o=this.transform,r={center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch},a={center:t.center!==void 0?Z(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+rt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=Ne(r.zoom),s=(oe(a.center.lng)-oe(r.center.lng))*l,c=(re(a.center.lat)-re(r.center.lat))*l,f=Math.hypot(s,c),u=Math.max(o.width,o.height),d=u*Math.pow(2,r.zoom-a.zoom),h=1.42,m=h*h,y,p=null;if(f<1e-6){let g=Math.log(d/u);y=Math.abs(g)/h,p=v=>({u:0,w:u*Math.exp(h*Math.sign(g)*v)});}else {let g=w=>{let _=w===0?u:d,T=w===0?d:u;return (T*T-_*_+(w===0?1:-1)*m*m*f*f)/(2*_*m*f)},v=w=>Math.log(-g(w)+Math.sqrt(g(w)*g(w)+1)),x=v(0);y=(v(1)-x)/h;let S=w=>(Math.exp(w)+Math.exp(-w))/2,M=w=>(Math.exp(2*w)-1)/(Math.exp(2*w)+1);p=w=>{let _=h*w+x;return {u:u*S(x)*M(_)/m-u*Math.sinh(x)/m,w:u*S(x)/S(_)}};}if(!Number.isFinite(y)||y<=0)return this.jumpTo(t);let b=t.duration??Math.min(3e3,y/1.2*1e3);return this.animation={start:performance.now(),duration:b,from:r,to:a,fly:{S:y,u1:f,curve:p,w0:u}},this.triggerRepaint(),this}setPadding(t){return this.padding=bl(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new Tt;for(let[r,n]of [[0,0],[t.width,0],[t.width,t.height],[0,t.height]])o.extend(t.unproject({x:r,y:n}));return o}cameraForBounds(t,o={}){let r=this.transform,n=$o(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?bl(o.padding):this.padding,maxZoom:Math.min(o.maxZoom??r.maxZoom,r.maxZoom),minZoom:r.minZoom});return n?{...n,pitch:o.pitch??r.pitch}:null}fitBounds(t,o={}){let r=this.cameraForBounds(t,o);if(!r)return this;let n={...r,duration:o.duration??600};return o.fly?this.flyTo(n):this.easeTo(n)}stepAnimation(t){let o=this.animation;if(!o)return false;let r=we((t-o.start)/o.duration,0,1),n=o.fly?r:ao(r),a=this.transform,l=Z(o.from.center),s=Z(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),u=o.fly.u1>1e-6?we(c/o.fly.u1,0,1):r;return a.center={lng:l.lng+(s.lng-l.lng)*u,lat:l.lat+(s.lat-l.lat)*u},a.zoom=o.from.zoom+Math.log2(o.fly.w0/f),a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*ao(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*ao(r),r>=1&&(a.center=s,a.zoom=o.to.zoom),this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}return a.center={lng:l.lng+(s.lng-l.lng)*n,lat:l.lat+(s.lat-l.lat)*n},a.zoom=o.from.zoom+(o.to.zoom-o.from.zoom)*n,a.bearing=o.from.bearing+(o.to.bearing-o.from.bearing)*n,a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*n,this.emitMove(),r>=1?(this.animation=null,this.emit("moveend",void 0),false):true}afterCameraChange(){return this.emitMove(),this.triggerRepaint(),this}emitMove(){let t=performance.now();t-this.lastMoveEmit<8||(this.lastMoveEmit=t,this.emit("move",void 0));}project(t,o=0){return this.transform.project(Z(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new dt(t);Object.assign(r.splitValues,o.splitValues),this._style=r,this.applyLayerOverrides();for(let[n,a]of this.sources.entries()){let l=JSON.stringify(o.workerPlan(n)),s=JSON.stringify(r.workerPlan(n));l!==s&&a.setPlan(this.planFor(n,r));}return this.objects3d?.setModelKey(t.model3dKey??""),this.triggerRepaint(),this}setTheme(t){return this.setStyle(Co(t,this.options.style))}static get themes(){return Object.keys(ht)}static get themeList(){return Object.entries(ht).map(([t,o])=>({id:t,name:o.name||t}))}setLayoutProperty(t,o,r){let n=this._style.layers.find(l=>l.id===t);if(!n)return console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this;let a=n.layout??(n.layout={});if(a[o]=r,this.rememberOverride(t,{layout:{[o]:r}}),o==="textField"||o==="iconImage"||o==="splitBy")for(let[l,s]of this.sources)s.setPlan(this.planFor(l));return this.triggerRepaint(),this}setPaintProperty(t,o,r){let n=this._style.layers.find(a=>a.id===t);return n?(n.paint[o]=r,this.rememberOverride(t,{paint:{[o]:r}}),this.triggerRepaint(),this):(console.warn(`[osmgl] \u0441\u043B\u043E\u0439 \u0441\u0442\u0438\u043B\u044F "${t}" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D`),this)}setShadows(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this.renderer.shadows,o),this.triggerRepaint(),this}querySymbol(t,o=2){let r=this.renderer.symbols?.querySymbol(t,o);return r?{layerId:r.layerId,text:r.text,icon:r.icon,lngLat:{lng:Se(r.mercX),lat:Ce(r.mercY)},key:wt.keyOf(r)}:null}setSymbolHover(t){return this.renderer.symbols?.setHover(t?.key??null)&&this.triggerRepaint(),this}setSymbolHidden(t){return this.renderer.symbols?.setHidden(t?.key??null)&&this.triggerRepaint(),this}queryBuilding(t){let o=null;for(let r of this._style.layers){if(r.type!=="fill-extrusion"||r.overlay||!this._style.layerVisibleAt(r,this.transform.zoom))continue;let n=this.sources.get(r.source??K);if(!n)continue;let a=Fr(this.transform,n,r.id,t);a&&(!o||a.distance<o.distance)&&(o=a);}return o}setHighlight(t,o={}){return this.renderer.highlight=t?{layerId:t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.45}:null,this.triggerRepaint(),this}queryRoom(t){if(!this.renderer.indoorOpen)return null;let o=[],r=new B,n;for(let l of this._style.layers){if(l.type!=="fill"||!l.id.startsWith("indoor-")||l.id==="indoor-shell"||!this._style.layerVisibleAt(l,this.transform.zoom))continue;let s=this._style.bucketKeyFor(l);s&&(o.push(s),r.set(s,l.id),n??(n=this.sources.get(l.source??K)));}if(!n||!o.length)return null;let a=Rr(this.transform,n,o,t);return a?{...a,layerId:r.get(a.layerId)??a.layerId,bucketKey:a.layerId}:null}setRoomHighlight(t,o={}){return this.renderer.highlightFill=t?{layerId:t.layerId,bucketKey:t.bucketKey??t.layerId,featureId:t.featureId,color:o.color??this.options.highlightColor??"#4ec97f",opacity:o.opacity??.5}:null,this.triggerRepaint(),this}getHighlight(){let t=this.renderer.highlight;return t?{featureId:t.featureId,layerId:t.layerId}:null}initHash(){this.options.hash&&(this.on("move",()=>this.scheduleHash()),this.on("moveend",()=>this.scheduleHash(true)),this.onHashChange=()=>{this.writingHash||this.applyHash(true);},window.addEventListener("hashchange",this.onHashChange),this.scheduleHash(true));}scheduleHash(t=false){if(!(!this.options.hash||this.destroyed)){if(this.hashTimer){if(!t)return;clearTimeout(this.hashTimer);}this.hashTimer=setTimeout(()=>{this.hashTimer=0,this.writeHash();},t?0:300);}}writeHash(){if(!this.options.hash||this.destroyed)return;let t=this.transform,o=hn({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch},this.hashName);this.writingHash=true,ul("#"+o),setTimeout(()=>this.writingHash=false,0);}applyHash(t){if(typeof window>"u")return;let o=mn(window.location.hash,this.hashName);if(!o)return;let r=this.transform;o.center&&(r.center=o.center),o.zoom!==void 0&&(r.zoom=o.zoom),o.bearing!==void 0&&(r.bearing=o.bearing),o.pitch!==void 0&&(r.pitch=o.pitch),t&&(this.emitMove(),this.triggerRepaint());}setQuality(t){this.qualityAuto=t==="auto";let o=t==="auto"?Uo(jo()):t;return this.qualityCeiling=o,this.resetFrameWindow(),this.applyQuality(St(o)),this}getQuality(){return {auto:this.qualityAuto,profile:{...this.quality},pixelRatio:this.transform.width>0?this.canvas.width/this.transform.width:1}}applyQuality(t,o=false){let r=this.quality.simpleGeometry,n=o?r:t.simpleGeometry;if(this.quality={...t,simpleGeometry:n},this.resetFrameWindow(),this.objects3d&&(this.objects3d.budgetScale=t.modelBudget),r!==n)for(let[a,l]of this.sources.entries())l.setPlan(this.planFor(a));o||(this.densityQuality=t,this.options.maxPixelRatio===void 0&&(this.maxPixelRatio=t.maxPixelRatio)),this.renderer.detailScale=t.detail,this.renderer.allowShadows=t.allowShadows,this.renderer.shadows.resolution!==t.shadowMapSize&&this.setShadows({resolution:t.shadowMapSize});for(let a of this.sources.values())a.setCoverOptions({detailBias:t.detailBias,maxTiles:t.maxTiles});this.resize();}resetFrameWindow(){this.frameRing.fill(0),this.ringAt=0,this.ringSum=0,this.ringFilled=0,this.steadyFrames=0;}checkFrameBudget(t){if(!this.qualityAuto||this.sum(a=>a.pendingCount)>0)return;let o=t>cu?3:t>su?1:0;if(this.ringSum+=o-this.frameRing[this.ringAt],this.frameRing[this.ringAt]=o,this.ringAt=(this.ringAt+1)%Cn,this.ringFilled<Cn&&this.ringFilled++,this.steadyFrames++,this.ringFilled<fu)return;let r=this.ringSum/this.ringFilled;if(r>=uu){let a=yn(this.quality.name);if(!a)return;console.info(`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${(r*100).toFixed(0)}% \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${a}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F)`),this.applyQuality(St(a),true);return}if(r>du||this.steadyFrames<hu)return;let n=hl(this.quality.name);!n||bn(n)>bn(this.qualityCeiling)||(console.info(`[osmgl] \u043A\u0430\u0434\u0440\u044B \u0443\u043A\u043B\u0430\u0434\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u0432 \u0431\u044E\u0434\u0436\u0435\u0442 \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0434\u043D\u044F\u0442\u043E \u0434\u043E \xAB${n}\xBB`),this.applyQuality(St(n),true));}getShadows(){return {...this.renderer.shadows}}setSky(t){let o=typeof t=="boolean"?{enabled:t}:t;return Object.assign(this._style.sky,o),this.triggerRepaint(),this}getSky(){return {...this._style.sky}}setLight(t){return Object.assign(this._style.light,t),this.triggerRepaint(),this}setLayerVisible(t,o){let r=this._style.layers.find(n=>n.id===t);return r&&(r.visible=o,this.rememberOverride(t,{visible:o}),this.triggerRepaint()),this}setObjects3DEnabled(t){return this.objects3dEnabled===t?this:(this.objects3dEnabled=t,this.triggerRepaint(),this)}get objects3DEnabled(){return this.objects3dEnabled}rasterLayerVisible(t){let o=this.transform.zoom;return this._style.layers.some(r=>r.type==="raster"&&r.source===t&&this._style.layerVisibleAt(r,o))}rememberOverride(t,o){let r=this.layerOverrides.get(t)??{};this.layerOverrides.set(t,{...r,...o,paint:{...r.paint??{},...o.paint??{}},layout:{...r.layout??{},...o.layout??{}}});}applyLayerOverrides(){if(this.layerOverrides.size)for(let t of this._style.layers){let o=this.layerOverrides.get(t.id);if(o&&(o.visible!==void 0&&(t.visible=o.visible),o.paint&&Object.assign(t.paint??(t.paint={}),o.paint),o.layout)){let r=t;Object.assign(r.layout??(r.layout={}),o.layout);}}}setBackground(t){return this.background=ce(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(n=>(n.source??K)===o&&"splitBy"in n&&n.splitBy===Mt))for(let n of r.splitValues(Mt)){let a=Number(n);Number.isFinite(a)&&!t.includes(a)&&t.push(a);}return t.sort((o,r)=>o-r)}getIndoorLevel(){let t=this._style.splitValues[Mt];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Mt]:this._style.splitValues[Mt]=t,this.triggerRepaint(),this}syncIndoor(){let t=this.getIndoorLevels(),o=t.join(",");if(o!==this.lastIndoorKey){if(this.lastIndoorKey=o,this.autoIndoorLevel){let r=this.getIndoorLevel();t.length?(r===null||!t.includes(r))&&this.setIndoorLevel(t.includes(0)?0:t.find(n=>n>=0)??t[0]):r!==null&&this.setIndoorLevel(null);}this.emit("indoor",{levels:t,level:this.getIndoorLevel()});}}addObject(t){return this.objects.add(t),this.triggerRepaint(),this}removeObject(t){return this.objects.remove(t),this.triggerRepaint(),this}getObjects(){return this.objects.all}updateObject(){return this.triggerRepaint(),this}addModel(t){return this.renderer.models.add(t),this.triggerRepaint(),this}removeModel(t){return this.renderer.models.remove(t,this.ctx?.gl),this.triggerRepaint(),this}getObjects3DStats(){return this.objects3d?.stats??null}getModels(){return this.renderer.models.all}addMarker(t){return this.objects.addMarker(t),t.update(this.transform),this}removeMarker(t){return this.objects.removeMarker(t),this}getMarkers(){return this.objects.allMarkers}addPopup(t){return t.onCloseRequest(()=>this.removePopup(t)),this.objects.addMarker(t),t.update(this.transform),this}removePopup(t){return this.objects.removeMarker(t),this}getPopups(){return this.objects.allMarkers.filter(t=>t instanceof to)}objectAt(t,o=4){return this.objects.hitTest(this.transform,t,o)}setProjection(t){let o=this.transform;if(o.projection===t)return this;o.projection=t;let r=o.effectiveMinZoom(),n=t==="globe"?Math.min(o.maxPitch,Et):o.maxPitch,a=o.zoom<r,l=o.pitch>n;return a||l?this.easeTo({zoom:a?r:o.zoom,pitch:l?n:o.pitch,duration:600}):(this.emit("move",void 0),this.triggerRepaint()),this}getProjection(){return this.transform.projection}refreshSource(t){return this.sources.get(t)?.reload(),this.rasterSources.get(t)?.reload(),this.triggerRepaint(),this}refresh(){for(let t of this.sources.values())t.reload();for(let t of this.rasterSources.values())t.reload();return this.renderer.refreshHighlight(),this.triggerRepaint(),this}sum(t){let o=0;for(let r of this.sources.values())o+=t(r);return o}getStats(){return {pendingTiles:this.sum(t=>t.pendingCount),visibleTiles:this.sum(t=>t.visibleTiles.length),labels:this.renderer.symbols?.placedCount??0,models:this.renderer.models.readyCount,workers:this.pool.usingWorkers?this.pool.size:0,renderer:this.ctx?.caps.rendererName??"\u043D\u0435\u0442 \u043A\u043E\u043D\u0442\u0435\u043A\u0441\u0442\u0430"}}triggerRepaint(){this.destroyed||(this.needsRepaint=true,!this.frameHandle&&(this.frameHandle=requestAnimationFrame(t=>{this.frameHandle=0,this.renderFrame(t);})));}debugFloatPixels(t,o,r,n){let a=this.ctx;if(!a||!a.caps.colorBufferFloat)return null;let l=a.gl,s=this.canvas.width,c=this.canvas.height,f=!!l.getExtension("EXT_float_blend"),u=f?l.RGBA32F:l.RGBA16F,d=f?l.FLOAT:l.HALF_FLOAT;if(this.debugFB&&(this.debugFB.w!==s||this.debugFB.h!==c)&&(l.deleteFramebuffer(this.debugFB.fb),l.deleteTexture(this.debugFB.tex),l.deleteRenderbuffer(this.debugFB.rb),this.debugFB=null),!this.debugFB){let h=l.createTexture(),m=l.createFramebuffer(),y=l.createRenderbuffer();if(!h||!m||!y)return null;l.bindTexture(l.TEXTURE_2D,h),l.texImage2D(l.TEXTURE_2D,0,u,s,c,0,l.RGBA,d,null),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MIN_FILTER,l.NEAREST),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_MAG_FILTER,l.NEAREST),l.bindTexture(l.TEXTURE_2D,null),l.bindRenderbuffer(l.RENDERBUFFER,y),l.renderbufferStorage(l.RENDERBUFFER,l.DEPTH24_STENCIL8,s,c),l.bindRenderbuffer(l.RENDERBUFFER,null),l.bindFramebuffer(l.FRAMEBUFFER,m),l.framebufferTexture2D(l.FRAMEBUFFER,l.COLOR_ATTACHMENT0,l.TEXTURE_2D,h,0),l.framebufferRenderbuffer(l.FRAMEBUFFER,l.DEPTH_STENCIL_ATTACHMENT,l.RENDERBUFFER,y);let p=l.checkFramebufferStatus(l.FRAMEBUFFER);if(l.bindFramebuffer(l.FRAMEBUFFER,null),a.invalidateState(),p!==l.FRAMEBUFFER_COMPLETE)return null;this.debugFB={fb:m,tex:h,rb:y,w:s,h:c};}a.screen=this.debugFB.fb;try{this.renderFrame(performance.now()),a.bindFramebuffer(this.debugFB.fb);let h=new Float32Array(r*n*4);return l.readPixels(t,o,r,n,l.RGBA,l.FLOAT,h),{data:h,format:f?"rgba32f":"rgba16f"}}finally{a.screen=null,this.triggerRepaint();}}renderFrame(t){if(this.destroyed||!this.ctx)return;let o=performance.now();this.needsRepaint=false;let r=this.stepAnimation(t),n=this.ctx;n.bindFramebuffer(null),n.viewport(0,0,this.canvas.width,this.canvas.height),n.setDepthMask(true),n.clear(this.background??this._style.background,true,true);for(let h of this.sources.values())h.update(this.transform);this.updateObjects3D();for(let[h,m]of this.rasterSources)this.rasterLayerVisible(h)&&m.update(this.transform);this.syncIndoor(),this.objects.updateMarkers(this.transform);let a=(this.sources.size>0||this.rasterSources.size>0)&&this.renderer.render(n,this.transform,this.sources,this._style,t,this.rasterSources),l=performance.now()-o,s=r||a||this.needsRepaint,c=this.lastFrameAt>0?t-this.lastFrameAt:0,f=c>0&&c<mu,u=f?c:0;this.continuousFrames=f?this.continuousFrames+1:0;let d=this.continuousFrames>1?c:l;this.lastFrameAt=t,this.checkFrameBudget(d),this.emit("render",{frameMs:l,intervalMs:u}),s&&this.triggerRepaint();}stopFrameLoop(){this.frameHandle&&cancelAnimationFrame(this.frameHandle),this.frameHandle=0;}get isLoaded(){return this.loaded}destroy(){if(this.onHashChange&&(window.removeEventListener("hashchange",this.onHashChange),this.onHashChange=null),this.hashTimer&&clearTimeout(this.hashTimer),!this.destroyed){this.destroyed=true,this.stopFrameLoop(),this.resizeObserver?.disconnect(),this.gestures?.destroy();for(let t of this.sources.values())t.destroy();this.sources.clear();for(let t of this.rasterSources.values())t.destroy();this.rasterSources.clear(),this.objects.destroy(),this.markerHost?.remove(),this.pool.destroy(),this.ctx&&this.renderer.destroy(this.ctx),this.removeAllListeners(),this.canvas.remove();}}},r1=Sn;
2307
+ export{Qt as AssetLoader,K as BASE_SOURCE,st as BUILDING_HEIGHT_SCALE,lt as BUILDING_POS_SCALE,Me as BUILDING_VERTEX_STRIDE,uc as CITY_STYLE,wn as Circle,tt as DEFAULT_ICONS,wr as DEFAULT_LIGHT,Ga as DEFAULT_SHADOWS,vr as DEFAULT_SKY,xr as DEFAULT_STYLE,Rt as DepthTarget,so as EARTH_CIRCUMFERENCE,Ue as FILL_VERTEX_STRIDE,Et as GLOBE_MAX_PITCH,Ze as GLOBE_ZOOM_MAX,uo as GLOBE_ZOOM_MIN,be as GLYPH_BORDER,De as GLYPH_SIZE,Es as GROUND_SCALE,Lt as GeomType,Xt as GlyphSource,Pt as GroundArrows,Kt as IconSource,Ht as IndoorMask,As as LEVEL_LIMIT,je as LINE_VERTEX_STRIDE,Ut as LayerRenderer,Tt as LngLatBounds,Tn as MAX_LATITUDE,Lo as MODEL_VERTEX_STRIDE,Sn as Map,oo as MapObject,eo as Marker,Jt as Model,Ye as ModelLayer,Bt as ObjectManager,Xo as Polygon,vn as Polyline,to as Popup,fc as RELIEF_STYLE,zr as RUNTIME_FILL_STRIDE,pt as RUNTIME_LINE_STRIDE,Zt as RasterSource,Wo as RasterTile,Yr as SDF_EDGE,Yt as SDF_PX,cc as SOFT_STYLE,$i as SPLIT_SEP,It as SURFACE_CUT_BLEED,hi as SURFACE_LEVEL_SCALE,ct as SURFACE_VERTEX_STRIDE,jt as SdfAtlas,dt as Style,wt as SymbolRenderer,ht as THEMES,qe as TILE_SIZE,_t as TileID,kt as Transform,At as VectorTile,yo as VectorTileFeature,go as VectorTileLayer,ln as abbreviateStreet,br as addGround,_u as altitudeFromMercatorZ,_o as applyTheme,tl as arrowLabelOffset,Cc as arrowVertices,Pr as buildRuntimeFill,Ot as buildRuntimeLine,$o as cameraForBounds,Le as circumferenceAtLatitude,co as clampLat,pn as clampPixelRatio,qr as clipLineToRect,fl as coordinateDigits,qt as coveringTiles,pr as createGround,r1 as default,jo as deviceHints,ml as distToSegment,ke as evaluateColor,V as evaluateNumber,Eo as extractFeature,et as featureLevel,Er as fillFootprint,mt as fogPlanes,kr as footprintOf,hn as formatHash,ar as generateBuildings,cr as generateFill,gr as generateLine,mr as generateSurface,cn as generateSymbols,er as globeBasis,mo as globeFlatMix,ho as globeRadius,zn as globeToLocal,wo as groundAt,ol as iconRotation,Ve as insideFootprint,Ce as latFromMercatorY,Se as lngFromMercatorX,po as lngLatToUnit,pe as matchesFilter,Ko as mercatorMetersPerTile,oe as mercatorX,re as mercatorY,Yo as mercatorZFromAltitude,Su as metersPerPixel,En as metersPerTile,yn as nextQualityDown,Nc as parseGlb,Wr as parseGlbAsync,Ua as parseGlyphs,mn as parseHash,Aa as patchUV,Fr as pickBuilding,Rr as pickFill,Dn as pitchIntent,Cu as pixelsPerMeter,Qr as placeAlongLine,_n as pointInRing,Uo as qualityFor,St as qualityProfile,tr as raySphere,sn as resolveTemplate,Pe as roundRing,Kr as sdfFromAlpha,$r as shapeText,He as splitBucketKey,yr as splitByGround,Qe as splitPolygons,Co as styleWithTheme,kn as tileOriginMeters,rl as tileUrl,Z as toLngLat,Jo as unitToLngLat,Ne as worldSize};//# sourceMappingURL=osmgl.js.map
2014
2308
  //# sourceMappingURL=osmgl.js.map