osmgl 0.8.0 → 0.8.1

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.cjs CHANGED
@@ -1,11 +1,11 @@
1
- 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var mi=require('earcut'),es=require('pbf'),Gs=require('polygon-clipping');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var mi__default=/*#__PURE__*/_interopDefault(mi);var es__default=/*#__PURE__*/_interopDefault(es);var Gs__namespace=/*#__PURE__*/_interopNamespace(Gs);var z=Map,ee=Set;var Ue=class{constructor(){this.listeners=new z;}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 xe=(i,e,t)=>i<e?e:i>t?t:i;var Ie=i=>i*Math.PI/180,Pn=i=>i*180/Math.PI;function lt(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var co=i=>1-Math.pow(1-i,3);function de(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 Ce(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var fo=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 z;this._stencilTest=false;this.screen=null;this.gl=e,this.caps=Bl(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 Bl(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 Je=512,uo=40075016686e-3,Hn=85.051129;function te(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var je=i=>512*Math.pow(2,i),ho=i=>Math.max(-Hn,Math.min(Hn,i));function le(i){return (180+i)/360}function se(i){let e=ho(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Te(i){return i*360-180}function Se(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Le(i){return uo*Math.cos(i*Math.PI/180)}function er(i,e){return i/Le(e)}function ed(i,e){return i*Le(e)}function td(i,e){return er(1,i)*je(e)}function od(i,e){return Le(i)/je(e)}function On(i,e){let t=Math.pow(2,i);return Le(Se((e+.5)/t))/t}function mo(i){return uo/Math.pow(2,i)}function Bn(i,e,t){let o=mo(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var At=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=te(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=te(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:le(this.west),maxX:le(this.east),minY:se(this.north),maxY:se(this.south)}}};function tr(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,Wn),r=Math.max(e.height-t.top-t.bottom,Wn),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,w]of [[n.minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]){let x=(v-f)*s-(w-u)*c,_=(v-f)*c+(w-u)*s;d=Math.max(d,Math.abs(x)*2),h=Math.max(h,Math.abs(_)*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=je(y),b=(t.left-t.right)/2/p,g=(t.top-t.bottom)/2/p;return {center:{lng:Te(f-(b*s+g*c)),lat:Se(u-(-b*c+g*s))},zoom:y,bearing:a}}var Wn=32;function G(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function We(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function _e(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 w=t[v*4],x=t[v*4+1],_=t[v*4+2],M=t[v*4+3];i[v*4]=w*o+x*l+_*u+M*y,i[v*4+1]=w*r+x*s+_*d+M*p,i[v*4+2]=w*n+x*c+_*h+M*b,i[v*4+3]=w*a+x*f+_*m+M*g;}return i}function ze(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 Re(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 rr(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 nr(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 Dn(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 Nn(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 Pe(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,w=t*c-n*a,x=o*s-r*l,_=o*c-n*l,M=r*c-n*s,C=f*y-u*m,S=f*p-d*m,T=f*b-h*m,A=u*p-d*y,k=u*b-h*y,L=d*b-h*p,R=g*L-v*k+w*A+x*T-_*S+M*C;return R?(R=1/R,i[0]=(l*L-s*k+c*A)*R,i[1]=(r*k-o*L-n*A)*R,i[2]=(y*M-p*_+b*x)*R,i[3]=(d*_-u*M-h*x)*R,i[4]=(s*T-a*L-c*S)*R,i[5]=(t*L-r*T+n*S)*R,i[6]=(p*w-m*M-b*v)*R,i[7]=(f*M-d*w+h*v)*R,i[8]=(a*k-l*T+c*C)*R,i[9]=(o*T-t*k-n*C)*R,i[10]=(m*_-y*w+b*g)*R,i[11]=(u*w-f*_-h*g)*R,i[12]=(l*S-a*A-s*C)*R,i[13]=(t*A-o*S+r*C)*R,i[14]=(y*v-m*x-p*g)*R,i[15]=(f*x-u*v+d*g)*R,i):null}function he(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 Ve(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function po(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function Vn(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 Wl(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function or(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function Gn(i,e,t,o){let r=po(Wl(t,e)),n=po(Vn(r,o)),a=Vn(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]=-or(n,e),i[13]=-or(a,e),i[14]=or(r,e),i[15]=1,i}var It=60,bo=4.5,et=6,yo=i=>i/(2*Math.PI);function go(i){if(i<=bo)return 0;if(i>=et)return 1;let e=(i-bo)/(et-bo);return e*e*(3-2*e)}function vo(i,e){let t=i*Math.PI/180,o=ho(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function ir(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 vo(Te(i),Se(e))}function ar(i,e){let t=i*Math.PI/180,o=ho(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 Un(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 Dl(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 jn(i,e,t,o,r,n,a,l){let s=Un(Vl(i,e),r,a);if(l<=0)return s;let c=Dl(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 lr(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 Xn=1e3,Nl=2,Kn=84,Gl=.42,Lt=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=Ie(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=G();this._viewProjPx=G();this._viewMatrix=G();this._pixelMatrix=G();this._pixelMatrixInverse=G();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=G();this._localView=G();this._localProj=G();this._localPixel=G();this._localPixelInverse=G();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=G();this._shadowView=G();this._shadowProj=G();this._shadowVP=G();this._shadowVPm=G();this._shadowTile=G();this._shadowObject=G();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=xe(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=lt(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<et?Math.min(this.maxPitch,It):this.maxPitch,o=xe(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return Pn(this._fov)}set fov(e){let t=Ie(xe(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(le(e.lng),se(e.lat));a[2]+=t*this._pixelsPerMeter;let l=this.localToPoint(a);if(l)return l}let o=[le(e.lng)*this._worldSize,se(e.lat)*this._worldSize,t,1],r=[0,0,0,0];he(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:Te(e/this._worldSize),lat:Se(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 he(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:Te(t.x/this._worldSize),lat:Se(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];he(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),he(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=xe(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=lt(this._center.lng+(e.lng-l.lng)),c=xe(this._center.lat+(e.lat-l.lat),-Kn,Kn);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:le(e.lng)*this._worldSize,y:se(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Te((this._centerX+n)/this._worldSize),lat:Se((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 ze(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Re(n,n,r,r,1),Ve(this._f32,n)}tileMatrix64(e,t,o=G()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return ze(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Re(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return ze(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Re(r,r,this._worldSize,this._worldSize,1),Ve(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Ie(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Ie(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<et}get globeFlatMix(){return this._ensure(),go(this._zoom)}get globeRadiusPx(){return this._ensure(),yo(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=G();if(!Pe(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];he(a,this._localPixelInverse,[r,n,0,1]),he(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=Ie(this._pitch),t=Ie(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(),Ve(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),jn(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,go(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return he(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];he(t,this._localPixelInverse,[e.x,e.y,0,1]),he(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=lr(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 ir(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=vo(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)*Nl,r=G();if(!Pe(r,this._viewProjPx))return;let n=this._cameraPosPx,a=[],l=[0,0,0,0];for(let x of [-1,1])for(let _ of [-1,1])for(let M of [-1,1]){if(he(l,r,[x,_,M,1]),l[3]===0)continue;let C=l[0]/l[3],S=l[1]/l[3],T=C-n[0],A=S-n[1],k=Math.hypot(T,A);if(k>o){let L=o/k;C=n[0]+T*L,S=n[1]+A*L;}a.push({x:C,y:S,z:0});}if(!a.length)return;let s=po(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;Gn(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 x of a)for(let _ of [0,u])he(g,f,[x.x,x.y,_,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,w=this._shadowProj;Nn(w,d,y,h,p,-b-v,-m+v),_e(this._shadowVP,w,f),Re(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 ze(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Re(r,r,this._worldSize,this._worldSize,1),Ve(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return ze(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Re(n,n,r,r,1),Ve(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=Xn*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-Xn*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=je(this._zoom);this._worldSize=e,this._pixelsPerMeter=er(1,this._center.lat)*e,this._centerX=le(this._center.lng)*e,this._centerY=se(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Ie(this._pitch),n=-Ie(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(xe(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<et){let g=yo(e);d=Math.max(a-g*1.6,a*.02),u=a+g*2.4;}let h=this._viewMatrix;Re(h,G(),1,-1,1),ze(h,h,0,0,-a),rr(h,h,r),nr(h,h,n),ze(h,h,-this._centerX,-this._centerY,0);let m=G();Dn(m,this._fov,t/o,d,u),_e(this._viewProjPx,m,h);let y=G();Re(y,h,1,1,this._pixelsPerMeter),_e(this._projMatrix,m,y);let p=this._localView;Re(p,G(),1,-1,1),ze(p,p,0,0,-a),rr(p,p,r),nr(p,p,n),_e(this._localProj,m,p),this._globeBasis=ar(this._center.lng,this._center.lat);let b=G();Re(b,G(),t/2,-o/2,1),ze(b,b,1,-1,0),_e(this._pixelMatrix,b,this._projMatrix),Pe(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"),_e(this._localPixel,b,this._localProj),Pe(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=G();if(!Pe(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=G();if(!Pe(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];he(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,w=y*p-h*g,x=h*b-m*p,_=Math.hypot(v,w,x)||1;v/=_,w/=_,x/=_;let M=new Float64Array(4);return M[0]=v,M[1]=w,M[2]=x,M[3]=-(v*f[0]+w*f[1]+x*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:xe(t,-3,3),max:xe(o,-3,3)}}};var Ul={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},Yn=2,jl=100,Xl=.5,Kl=.1,Yl=25,$n=i=>Math.abs(i.y)>Math.abs(i.x);function Zn(i,e,t){let o=Math.hypot(i.x,i.y)>=Yn,r=Math.hypot(e.x,e.y)>=Yn;return !o&&!r?void 0:!o||!r?t<jl?void 0:false:i.y>0==e.y>0&&$n(i)&&$n(e)}function qn(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var $l=160,sr=4,wo=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new z;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=xe(-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={...Ul,...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?Zn(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))>=Kl&&(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=Yl/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(qn(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=qn(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>$l;)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>sr&&(r=r/a*sr,n=n/a*sr);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 pe=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);}},ue=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 Zl=["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"],be=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new z;this.attribs=new z;let a=e.gl,l=Ql(n),s=Jn(a,a.VERTEX_SHADER,Qn(o,l),`${t}.vert`),c=Jn(a,a.FRAGMENT_SHADER,Qn(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),Zl.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 Ql(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(`
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var mi=require('earcut'),es=require('pbf'),Gs=require('polygon-clipping');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var mi__default=/*#__PURE__*/_interopDefault(mi);var es__default=/*#__PURE__*/_interopDefault(es);var Gs__namespace=/*#__PURE__*/_interopNamespace(Gs);var z=Map,J=Set;var Ue=class{constructor(){this.listeners=new z;}on(e,t){let o=this.listeners.get(e);return o||this.listeners.set(e,o=new J),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 xe=(i,e,t)=>i<e?e:i>t?t:i;var Ie=i=>i*Math.PI/180,Pn=i=>i*180/Math.PI;function lt(i){let e=((i+180)%360+360)%360-180;return e===-180?180:e}var co=i=>1-Math.pow(1-i,3);function de(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 Ce(i){return [i[0]*i[3],i[1]*i[3],i[2]*i[3],i[3]]}var fo=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 z;this._stencilTest=false;this.screen=null;this.gl=e,this.caps=Bl(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 Bl(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 Je=512,uo=40075016686e-3,Hn=85.051129;function te(i){return Array.isArray(i)?{lng:i[0],lat:i[1]}:i}var je=i=>512*Math.pow(2,i),ho=i=>Math.max(-Hn,Math.min(Hn,i));function le(i){return (180+i)/360}function se(i){let e=ho(i);return (180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Te(i){return i*360-180}function Se(i){let e=180-i*360;return 360/Math.PI*Math.atan(Math.exp(e*Math.PI/180))-90}function Le(i){return uo*Math.cos(i*Math.PI/180)}function er(i,e){return i/Le(e)}function ed(i,e){return i*Le(e)}function td(i,e){return er(1,i)*je(e)}function od(i,e){return Le(i)/je(e)}function On(i,e){let t=Math.pow(2,i);return Le(Se((e+.5)/t))/t}function mo(i){return uo/Math.pow(2,i)}function Bn(i,e,t){let o=mo(i),r=65536;return [(e*o%r+r)%r,(t*o%r+r)%r]}var At=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=te(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=te(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:le(this.west),maxX:le(this.east),minY:se(this.north),maxY:se(this.south)}}};function tr(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,Wn),r=Math.max(e.height-t.top-t.bottom,Wn),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,w]of [[n.minX,n.minY],[n.maxX,n.minY],[n.maxX,n.maxY],[n.minX,n.maxY]]){let x=(v-f)*s-(w-u)*c,_=(v-f)*c+(w-u)*s;d=Math.max(d,Math.abs(x)*2),h=Math.max(h,Math.abs(_)*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=je(y),b=(t.left-t.right)/2/p,g=(t.top-t.bottom)/2/p;return {center:{lng:Te(f-(b*s+g*c)),lat:Se(u-(-b*c+g*s))},zoom:y,bearing:a}}var Wn=32;function G(){let i=new Float64Array(16);return i[0]=i[5]=i[10]=i[15]=1,i}function We(i){return i.fill(0),i[0]=i[5]=i[10]=i[15]=1,i}function _e(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 w=t[v*4],x=t[v*4+1],_=t[v*4+2],M=t[v*4+3];i[v*4]=w*o+x*l+_*u+M*y,i[v*4+1]=w*r+x*s+_*d+M*p,i[v*4+2]=w*n+x*c+_*h+M*b,i[v*4+3]=w*a+x*f+_*m+M*g;}return i}function ze(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 Re(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 rr(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 nr(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 Dn(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 Nn(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 Pe(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,w=t*c-n*a,x=o*s-r*l,_=o*c-n*l,M=r*c-n*s,C=f*y-u*m,S=f*p-d*m,T=f*b-h*m,A=u*p-d*y,k=u*b-h*y,L=d*b-h*p,R=g*L-v*k+w*A+x*T-_*S+M*C;return R?(R=1/R,i[0]=(l*L-s*k+c*A)*R,i[1]=(r*k-o*L-n*A)*R,i[2]=(y*M-p*_+b*x)*R,i[3]=(d*_-u*M-h*x)*R,i[4]=(s*T-a*L-c*S)*R,i[5]=(t*L-r*T+n*S)*R,i[6]=(p*w-m*M-b*v)*R,i[7]=(f*M-d*w+h*v)*R,i[8]=(a*k-l*T+c*C)*R,i[9]=(o*T-t*k-n*C)*R,i[10]=(m*_-y*w+b*g)*R,i[11]=(u*w-f*_-h*g)*R,i[12]=(l*S-a*A-s*C)*R,i[13]=(t*A-o*S+r*C)*R,i[14]=(y*v-m*x-p*g)*R,i[15]=(f*x-u*v+d*g)*R,i):null}function he(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 Ve(i,e){for(let t=0;t<16;t++)i[t]=e[t];return i}function po(i){let e=Math.hypot(i[0],i[1],i[2])||1;return [i[0]/e,i[1]/e,i[2]/e]}function Vn(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 Wl(i,e){return [i[0]-e[0],i[1]-e[1],i[2]-e[2]]}function or(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function Gn(i,e,t,o){let r=po(Wl(t,e)),n=po(Vn(r,o)),a=Vn(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]=-or(n,e),i[13]=-or(a,e),i[14]=or(r,e),i[15]=1,i}var It=60,bo=4.5,et=6,yo=i=>i/(2*Math.PI);function go(i){if(i<=bo)return 0;if(i>=et)return 1;let e=(i-bo)/(et-bo);return e*e*(3-2*e)}function vo(i,e){let t=i*Math.PI/180,o=ho(e)*Math.PI/180,r=Math.cos(o);return [r*Math.sin(t),-Math.sin(o),r*Math.cos(t)]}function ir(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 vo(Te(i),Se(e))}function ar(i,e){let t=i*Math.PI/180,o=ho(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 Un(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 Dl(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 jn(i,e,t,o,r,n,a,l){let s=Un(Vl(i,e),r,a);if(l<=0)return s;let c=Dl(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 lr(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 Xn=1e3,Nl=2,Kn=84,Gl=.42,Lt=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=Ie(36.87);this._worldSize=512;this._pixelsPerMeter=1;this._cameraToCenterDistance=0;this._centerX=0;this._centerY=0;this._projMatrix=G();this._viewProjPx=G();this._viewMatrix=G();this._pixelMatrix=G();this._pixelMatrixInverse=G();this._cameraPosPx=[0,0,0];this._frustumPlanes=[];this._dirty=true;this.projection="mercator";this._f32=new Float32Array(16);this._tileMatrix=G();this._localView=G();this._localProj=G();this._localPixel=G();this._localPixelInverse=G();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=G();this._shadowView=G();this._shadowProj=G();this._shadowVP=G();this._shadowVPm=G();this._shadowTile=G();this._shadowObject=G();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=xe(e,this.effectiveMinZoom(),this.maxZoom);t!==this._zoom&&(this._zoom=t,this._dirty=true);}get bearing(){return this._bearing}set bearing(e){let t=lt(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<et?Math.min(this.maxPitch,It):this.maxPitch,o=xe(e,this.minPitch,t);o!==this._pitch&&(this._pitch=o,this._dirty=true);}get fov(){return Pn(this._fov)}set fov(e){let t=Ie(xe(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(le(e.lng),se(e.lat));a[2]+=t*this._pixelsPerMeter;let l=this.localToPoint(a);if(l)return l}let o=[le(e.lng)*this._worldSize,se(e.lat)*this._worldSize,t,1],r=[0,0,0,0];he(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:Te(e/this._worldSize),lat:Se(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 he(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:Te(t.x/this._worldSize),lat:Se(t.y/this._worldSize)}}pointToWorldPx(e){this._ensure();let t=[0,0,0,0],o=[0,0,0,0];he(t,this._pixelMatrixInverse,[e.x,e.y,0,1]),he(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=xe(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=lt(this._center.lng+(e.lng-l.lng)),c=xe(this._center.lat+(e.lat-l.lat),-Kn,Kn);this._center={lng:s,lat:c},this._dirty=true;return}let o=this.pointToWorldPx(t),r={x:le(e.lng)*this._worldSize,y:se(e.lat)*this._worldSize},n=r.x-o.x,a=r.y-o.y;this._center={lng:Te((this._centerX+n)/this._worldSize),lat:Se((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 ze(n,this._projMatrix,o.minX*this._worldSize,o.minY*this._worldSize,0),Re(n,n,r,r,1),Ve(this._f32,n)}tileMatrix64(e,t,o=G()){this._ensure();let r=e.bounds(),n=(r.maxX-r.minX)*this._worldSize/t;return ze(o,this._projMatrix,r.minX*this._worldSize,r.minY*this._worldSize,0),Re(o,o,n,n,1),o}objectMatrix(e,t,o=0){this._ensure();let r=this._objectMatrix;return ze(r,this._projMatrix,e*this._worldSize,t*this._worldSize,o),Re(r,r,this._worldSize,this._worldSize,1),Ve(this._objectF32,r)}horizonScreenY(){this._ensure();let e=Math.PI/2-Ie(this._pitch),o=this.height/2/Math.tan(this._fov/2)*Math.tan(Math.min(e,Ie(89.5)));return this.height/2-Math.min(o,this.height*50)}get globeActive(){return this._ensure(),this.projection==="globe"&&this._zoom<et}get globeFlatMix(){return this._ensure(),go(this._zoom)}get globeRadiusPx(){return this._ensure(),yo(this._worldSize)}get globeBasis(){return this._ensure(),this._globeBasis}get localProjMatrix(){return this._ensure(),this._localProj}globeCamera(){this._ensure();let e=this.globeRadiusPx,t=G();if(!Pe(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];he(a,this._localPixelInverse,[r,n,0,1]),he(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=Ie(this._pitch),t=Ie(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(),Ve(this._localF32,this._localProj)}globeLocal(e,t){return this._ensure(),jn(e,t,this._centerX/this._worldSize,this._centerY/this._worldSize,this.globeRadiusPx,this._worldSize,this._globeBasis,go(this._zoom))}localToPoint(e){this._ensure();let t=[0,0,0,0];return he(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];he(t,this._localPixelInverse,[e.x,e.y,0,1]),he(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=lr(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 ir(m)}isOnGlobeFront(e,t,o=.06){this._ensure();let r=this.globeCamera(),n=this._globeBasis,a=vo(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)*Nl,r=G();if(!Pe(r,this._viewProjPx))return;let n=this._cameraPosPx,a=[],l=[0,0,0,0];for(let x of [-1,1])for(let _ of [-1,1])for(let M of [-1,1]){if(he(l,r,[x,_,M,1]),l[3]===0)continue;let C=l[0]/l[3],S=l[1]/l[3],T=C-n[0],A=S-n[1],k=Math.hypot(T,A);if(k>o){let L=o/k;C=n[0]+T*L,S=n[1]+A*L;}a.push({x:C,y:S,z:0});}if(!a.length)return;let s=po(e),c=Math.abs(s[2])>.999?[0,1,0]:[0,0,1],f=this._shadowView;Gn(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 x of a)for(let _ of [0,u])he(g,f,[x.x,x.y,_,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,w=this._shadowProj;Nn(w,d,y,h,p,-b-v,-m+v),_e(this._shadowVP,w,f),Re(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 ze(r,this._shadowVPm,e*this._worldSize,t*this._worldSize,o),Re(r,r,this._worldSize,this._worldSize,1),Ve(this._shadowObject32,r)}shadowTileMatrix(e,t){this._ensure();let o=e.bounds(),r=(o.maxX-o.minX)*this._worldSize/t,n=this._shadowTile;return ze(n,this._shadowVPm,o.minX*this._worldSize,o.minY*this._worldSize,0),Re(n,n,r,r,1),Ve(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=Xn*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-Xn*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=je(this._zoom);this._worldSize=e,this._pixelsPerMeter=er(1,this._center.lat)*e,this._centerX=le(this._center.lng)*e,this._centerY=se(this._center.lat)*e;let t=Math.max(this.width,1),o=Math.max(this.height,1),r=Ie(this._pitch),n=-Ie(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(xe(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<et){let g=yo(e);d=Math.max(a-g*1.6,a*.02),u=a+g*2.4;}let h=this._viewMatrix;Re(h,G(),1,-1,1),ze(h,h,0,0,-a),rr(h,h,r),nr(h,h,n),ze(h,h,-this._centerX,-this._centerY,0);let m=G();Dn(m,this._fov,t/o,d,u),_e(this._viewProjPx,m,h);let y=G();Re(y,h,1,1,this._pixelsPerMeter),_e(this._projMatrix,m,y);let p=this._localView;Re(p,G(),1,-1,1),ze(p,p,0,0,-a),rr(p,p,r),nr(p,p,n),_e(this._localProj,m,p),this._globeBasis=ar(this._center.lng,this._center.lat);let b=G();Re(b,G(),t/2,-o/2,1),ze(b,b,1,-1,0),_e(this._pixelMatrix,b,this._projMatrix),Pe(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"),_e(this._localPixel,b,this._localProj),Pe(this._localPixelInverse,this._localPixel),this._calcCameraPosition(),this._calcFrustum();}_calcCameraPosition(){let e=G();if(!Pe(e,this._viewMatrix)){this._cameraPosPx=[this._centerX,this._centerY,this._cameraToCenterDistance];return}this._cameraPosPx=[e[12],e[13],e[14]];}_calcFrustum(){let e=G();if(!Pe(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];he(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,w=y*p-h*g,x=h*b-m*p,_=Math.hypot(v,w,x)||1;v/=_,w/=_,x/=_;let M=new Float64Array(4);return M[0]=v,M[1]=w,M[2]=x,M[3]=-(v*f[0]+w*f[1]+x*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:xe(t,-3,3),max:xe(o,-3,3)}}};var Ul={dragPan:true,scrollZoom:true,dragRotate:true,touchZoomRotate:true,touchPitch:true,doubleClickZoom:true,keyboard:true,inertia:1},Yn=2,jl=100,Xl=.5,Kl=.1,Yl=25,$n=i=>Math.abs(i.y)>Math.abs(i.x);function Zn(i,e,t){let o=Math.hypot(i.x,i.y)>=Yn,r=Math.hypot(e.x,e.y)>=Yn;return !o&&!r?void 0:!o||!r?t<jl?void 0:false:i.y>0==e.y>0&&$n(i)&&$n(e)}function qn(i,e){let t=(i-e)*(180/Math.PI);for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}var $l=160,sr=4,wo=class{constructor(e,t,o,r,n={}){this.canvas=e;this.tr=t;this.onChange=o;this.onInteractionEnd=r;this.pointers=new z;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=xe(-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={...Ul,...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?Zn(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))>=Kl&&(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=Yl/Math.max(Math.PI*e.minDist,1)*360;if(!e.rotateActive&&Math.abs(qn(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=qn(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>$l;)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>sr&&(r=r/a*sr,n=n/a*sr);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 pe=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);}},ue=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 Zl=["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"],be=class{constructor(e,t,o,r,n={}){this.ctx=e;this.name=t;this.uniforms=new z;this.attribs=new z;let a=e.gl,l=Ql(n),s=Jn(a,a.VERTEX_SHADER,Qn(o,l),`${t}.vert`),c=Jn(a,a.FRAGMENT_SHADER,Qn(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),Zl.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 Ql(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
2
  `)}function Qn(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
4
  ${i}`}function Jn(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
6
  ${Jl(t)}`)}return r}function Jl(i){return i.split(`
7
7
  `).map((e,t)=>`${String(t+1).padStart(4)} | ${e}`).join(`
8
- `)}var Ft=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Ft||{}),xo=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(ts,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 ts(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?os(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function os(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 _o=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(rs,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 xo.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function rs(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(ns(t)));}function ns(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 Rt=class{constructor(e){this.layers={};new es__default.default(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=_o.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function tt(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=is(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 is(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:ei(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function Ae(i,e,t){return i===void 0?t:typeof i=="string"?de(i):ei(i.stops,e,(o,r,n)=>{let a=de(o),l=de(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 ei(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 ye(i,e){if(!i)return true;let t=i[0];switch(t){case "all":return i.slice(1).every(o=>ye(o,e));case "any":return i.slice(1).some(o=>ye(o,e));case "!":return !ye(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 as=Math.PI/8,ls=.35,ss=32,oi=.25,ri=.5,ni=.07;function He(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??ls,0),a=e.extent,l=[];for(let s=0;s<o;s++){let c=i[s*2],f=i[s*2+1],u=i[(s+o-1)%o*2],d=i[(s+o-1)%o*2+1],h=i[(s+1)%o*2],m=i[(s+1)%o*2+1],y=c-u,p=f-d,b=h-c,g=m-f,v=Math.hypot(y,p),w=Math.hypot(b,g);if(v<1e-6||w<1e-6){l.push(c,f);continue}let x=y/v,_=p/v,M=b/w,C=g/w;if(e.keep?.[s]){l.push(c,f);continue}let S=x*M+_*C;if(S>.985){l.push(c,f);continue}if(a!==void 0&&(c<=0||c>=a||f<=0||f>=a)){l.push(c,f);continue}let T=Math.min(t,v*ti,w*ti);if(T<t*n){l.push(c,f);continue}let A=c-x*T,k=f-_*T,L=c+M*T,R=f+C*T,I=Math.acos(Math.max(-1,Math.min(1,S))),E=Math.min(as,Math.PI/2/r),H=Math.ceil(I/E-1e-6),W=e.maxChord&&e.maxChord>0?Math.ceil(T/Math.tan(I/2)*I/e.maxChord):0,F=Math.max(1,Math.min(ss,Math.max(Math.min(r,H),W)));l.push(A,k);for(let P=1;P<F;P++){let N=P/F,O=1-N;l.push(O*O*A+2*O*N*c+N*N*L,O*O*k+2*O*N*f+N*N*R);}l.push(L,R);}return l.length<6?i:(l.push(l[0],l[1]),l)}var ti=.4;var Me=i=>i/64;function De(i,e,t=0){let o=ii(i.outer,e,t);if(!o)return null;let r=[];for(let n of i.holes){let a=ii(n,e,t);a&&r.push(a);}return {outer:o,holes:r}}function ii(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=ai(s,c,r,e,t),h=ai(f,u,r,e,t);if(d!==h){let m=cs(f,u,s,c,r,e,t),y=r===0?-t:r===1?e+t:f+(s-f)*m,p=r===2?-t:r===3?e+t:u+(c-u)*m;o.push(y,p);}d&&o.push(s,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function ai(i,e,t,o,r){return t===0?i>=-r:t===1?i<=o+r:t===2?e>=-r:e<=o+r}function cs(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 Co(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 cr(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 li=1,ke=18,ut=32,ft=8,pi=65535/ut,fs=9,us=1,ds=0,hs=1,ms=2;var si=0,ps=1,ci=2,bs=3,bi=.47;function dr(i,e,t,o={},r){let n=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:bi,{b:a,ensure:l,take:s}=yi(Math.max(1024,i.length*48));for(let c of i.features()){if(c.type!==3||!ye(t,c.properties))continue;let f=Os(c.properties),u=Bs(c.properties,f);if(f<=u)continue;let d=Vs(c.properties)??Number(c.id??0),h=Hs(d>>>0),m=Ps(h,c.properties),y=zs(c.properties,f),p=tt(c.loadGeometry()),b=r?p.some(g=>{let v=De(g,e,Me(e));return v?cr(v.outer,e):false}):false;for(let g of p){if(r&&b){let v=Ds(g,e,f,u,d,h,m,y);v&&r.push(v);}wi(a,g,l,{extent:e,metersPerUnit:n,height:f,minHeight:u,featureId:d,seed:h,tint:m,facade:y,props:c.properties,cornerRadius:o.cornerRadius??0,cornerSegments:o.cornerSegments,whole:false});}}return s(e)}function yi(i){let e=i,t=new ArrayBuffer(e*ke),o={verts:new DataView(t),vertsU8:new Uint8Array(t),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},r=a=>{if(o.vertexCount+a<=e)return;e=Math.max(e*2,o.vertexCount+a);let l=new ArrayBuffer(e*ke);new Uint8Array(l).set(o.vertsU8.subarray(0,o.vertOffset)),t=l,o.verts=new DataView(l),o.vertsU8=new Uint8Array(l);};return o.ensure=r,{b:o,ensure:r,take:a=>{if(!o.indices.length)return null;let l=new Uint32Array(o.indices),s=new Float64Array(o.featureIds);return {vertices:t.slice(0,o.vertOffset),indices:l.buffer,featureIds:s.buffer,vertexCount:o.vertexCount,indexCount:l.length,extent:a}}}}function gi(i,e,t={}){let o=t.metersPerUnit&&t.metersPerUnit>0?t.metersPerUnit:bi,{b:r,ensure:n,take:a}=yi(Math.max(1024,i.length*64));for(let{rings:l,seam:s}of i)wi(r,l,n,{extent:e,metersPerUnit:o,height:s.height,minHeight:s.minHeight,featureId:s.osmId,seed:s.seed,tint:s.tint,facade:s.facade,props:{},cornerRadius:t.cornerRadius??0,cornerSegments:t.cornerSegments,whole:true});return a(e)}var hr=(i,e)=>i|e<<2,fi=i=>Math.max(-32768,Math.min(32767,i)),fr=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,pi)*ut)));function st(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,fi(Math.round(e*ft)),true),i.verts.setInt16(h+2,fi(Math.round(t*ft)),true),i.verts.setUint16(h+4,Math.round(Math.min(o,pi)*ut),true),i.vertsU8[h+6]=s,i.vertsU8[h+7]=l,i.verts.setInt8(h+8,ur(Math.round(r*127))),i.verts.setInt8(h+9,ur(Math.round(n*127))),i.verts.setInt8(h+10,ur(Math.round(a*127))),i.vertsU8[h+11]=c,i.verts.setUint16(h+12,fr(f),true),i.verts.setUint16(h+14,fr(u),true),i.verts.setUint16(h+16,fr(d),true),i.vertOffset+=ke,i.vertexCount++}function ui(i,e,t,o,r,n,a,l,s,c){let f=e.length/2;if(f<3)return;let u=hr(ds,a),d=gs(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],w=Math.hypot(g,v)||1;p[b*2]=v/w,p[b*2+1]=-g/w;}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],w=p[g*2]+p[b*2],x=p[g*2+1]+p[b*2+1],_=Math.hypot(w,x);v>.5&&_>1e-6&&(m[b*2]=w/_,m[b*2+1]=x/_,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],w=e[p*2+3];if(b===v&&g===w||c[p])continue;let x=v-b,_=w-g,M=Math.hypot(x,_)||1,C=_/M,S=-x/M,T=d.offset[p],A=d.width[p],k=[0,1];if(s){for(let R=0;R<s.length;R++)for(let I=R+1;I<s.length;I++){let E=ot(s[R],b,g)-ot(s[I],b,g),H=ot(s[R],v,w)-ot(s[I],v,w);if(E===H)continue;let W=E/(E-H);W>1e-4&&W<1-1e-4&&k.push(W);}k.sort((R,I)=>R-I);}let L=(R,I)=>{if(!s)return o;let E=1/0;for(let H of s)E=Math.min(E,ot(H,R,I));return Math.max(o,E)};for(let R=0;R+1<k.length;R++){let I=k[R],E=k[R+1];if(E-I<1e-6)continue;let H=b+x*I,W=g+_*I,F=b+x*E,P=g+_*E,N=T+M*I*l,O=T+M*E*l,B=(p+1)%(f-1),V=y[p]?m[p*2]:C,j=y[p]?m[p*2+1]:S,X=y[B]?m[B*2]:C,q=y[B]?m[B*2+1]:S,Q=C+(V-C)*(1-I),Z=S+(j-S)*(1-I),U=C+(X-C)*E,ne=S+(q-S)*E,ie=Math.hypot(Q,Z)||1,J=Math.hypot(U,ne)||1,K=Q/ie,Y=Z/ie,oe=U/J,re=ne/J;i.ensure(4);let ce=st(i,H,W,t,K,Y,0,0,n,u,N,A,h),ae=st(i,F,P,t,oe,re,0,0,n,u,O,A,h),me=st(i,H,W,L(H,W),K,Y,0,255,n,u,N,A,h),we=st(i,F,P,L(F,P),oe,re,0,255,n,u,O,A,h);i.indices.push(ce,we,ae,ce,me,we),i.featureIds.push(r,r);}}}var ys=.9976;function gs(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>=ys,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 vs(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=mi__default.default(l,s.length?s:void 0,2);if(!c.length)return;let f=hr(hs,a),u=i.vertexCount;for(let d=0;d<l.length;d+=2)st(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 ws(i){let e=xs(i);if(e.length<3)return null;let t=Math.abs(_s(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 w of e){let x=w.x*l+w.y*s,_=-w.x*s+w.y*l;x<f&&(f=x),x>u&&(u=x),_<d&&(d=_),_>h&&(h=_);}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 xs(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 _s(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 Cs=Math.tan(30*Math.PI/180),Ss=3.5,Ms=.9;function Ts(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=ks(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 ks(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 ot=(i,e,t)=>i.a*e+i.b*t+i.c;function Es(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 As(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 vi(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?vi(i,e,"hipped"):a}function Is(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=Es(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=ot(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function Rs(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function Fs(i,e,t,o,r,n,a,l){let s=hr(ms,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let u=mi__default.default(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,ot(t[c],f[b],f[b+1]));st(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 zs(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?bs:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?ci:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?si:e>=40?ci:ps}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 Hs(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Os(i){let e=ct(i.render_height)??ct(i.height)??Ws(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,us):fs}function Bs(i,e){let t=ct(i.render_min_height)??ct(i.min_height)??ct(i.base)??0;return t>0&&t<e?t:0}function Ws(i){let e=ct(i);return e&&e>0?e*3:null}function ct(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 ur=i=>i>127?127:i<-127?-127:i;function Vs(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 di(i,e){let t=i.length/2-1,o=new Array(Math.max(t,0)).fill(false);if(t<3)return {ring:i,cut:o};let r=(a,l)=>a===0?1:a===e?2:l===0?3:l===e?4:0,n=i.slice();for(let a=0;a<t;a++){let l=i[a*2],s=i[a*2+1],c=r(l,s);if(!c)continue;let f=(a+t-1)%t,u=(a+1)%t,d=r(i[f*2],i[f*2+1])===c,h=r(i[u*2],i[u*2+1])===c;h&&(o[a]=true);let m=d===h?-1:d?u:f;if(m<0)continue;let y=l-i[m*2],p=s-i[m*2+1],b=Math.hypot(y,p);b<1e-6||(n[a*2]=l+y/b*li,n[a*2+1]=s+p/b*li);}return n[t*2]=n[0],n[t*2+1]=n[1],{ring:n,cut:o}}function wi(i,e,t,o){let{extent:r,metersPerUnit:n,height:a,minHeight:l,featureId:s,seed:c,tint:f,facade:u}=o,d=o.whole?e:De(e,r,Me(r));if(!d)return;let h=o.cornerRadius/n,m={radius:h,segments:o.cornerSegments,minCutRatio:0,maxChord:n>0?ri/n:0,...o.whole?{}:{extent:r,margin:Me(r)}},y=h>0?{outer:He(d.outer,m),holes:d.holes.map(A=>He(A,m))}:d,p=o.whole?y:De(y,r);if(!p)return;let b=A=>({ring:A,cut:new Array(Math.max(A.length/2-1,0)).fill(false)}),g=o.whole?b(p.outer):di(p.outer,r),v=p.holes.map(A=>o.whole?b(A):di(A,r)),w={outer:g.ring,holes:v.map(A=>A.ring)},x=o.whole?true:cr(w.outer,r),_=w.outer.length/2+w.holes.reduce((A,k)=>A+k.length/2,0);t(_*5+32);let M=w.holes.length||x?null:ws(w.outer),C=M?Ts(o.props,M,a,c,n):null,S=null,T=[];if(C&&M){let A=vi(As(w.outer,n),M,C.shape);T=Is(A,w.outer);let k=Ls(A,T);if(k>1e-6){let L=Math.min(Math.max(k*n*Cs,Ms),Ss);S=Rs(A,L/k,a);}}ui(i,w.outer,l,a,s,f,u,n,S,g.cut);for(let A=0;A<w.holes.length;A++)ui(i,w.holes[A],l,a,s,f,u,n,null,v[A].cut);S?Fs(i,T,S,a,s,f,u,n):vs(i,w.outer,w.holes,a,s,f,u);}function hi(i,e){let t=Me(e),o=Math.max(i.length/2-1,0),r=new Array(o);for(let n=0;n<o;n++)r[n]=Co(i[n*2],i[n*2+1],i[n*2+2],i[n*2+3],e,t);return r}function Ds(i,e,t,o,r,n,a,l){let s=De(i,e,Me(e));if(!s)return null;let c=hi(s.outer,e);return {osmId:r,height:t,minHeight:o,seed:n,tint:a,facade:l,outer:s.outer,holes:s.holes,outerCut:c,holeCuts:s.holes.map(f=>hi(f,e))}}var Xe=4;function mr(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 pr(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let h of i.features()){if(h.type!==3||!ye(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 tt(h.loadGeometry())){let g=r?De(b,n):b;if(!g)continue;let v=[],w=[],x=o?He(g.outer,o):g.outer;for(let C=0;C<x.length;C++)v.push(x[C]);for(let C of g.holes){let S=o?He(C,o):C;w.push(v.length/2);for(let T=0;T<S.length;T++)v.push(S[T]);}let _=mi__default.default(v,w.length?w:void 0,2);if(!_.length)continue;let M=a.length/2;for(let C=0;C<v.length;C++)a.push(v[C]);if(t>0){let C=[];mr(a,_,M,t,C);for(let S=0;S<C.length;S+=3)l.push(C[S],C[S+2],C[S+1]),s.push(p);continue}for(let C=0;C<_.length;C+=3)l.push(M+_[C],M+_[C+2],M+_[C+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}}var xi=Gs__namespace,br=xi.union??xi.default?.union??null;br||console.warn("[osmgl] polygon-clipping \u0431\u0435\u0437 union \u2014 \u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0444\u0438\u0433\u0443\u0440 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u043E");function _i(i){let e=[];for(let t=0;t+1<i.length;t+=2)e.push([i[t],i[t+1]]);return e}function Ci(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 So(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=>[_i(u.outer),...u.holes.map(_i)]),c;try{if(!br)throw new Error("\u043D\u0435\u0442 union");c=br(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=Ci(u[0]);if(d.length<8)continue;let h=[];for(let m=1;m<u.length;m++){let y=Ci(u[m]);y.length>=8&&h.push(y);}r.push(n?{outer:d,holes:h,lift:n}:{outer:d,holes:h});}}return r}var dt=16,Ii=64,Li=0,js=1,Si=2,Xs=3,zt=1,Ks=.6;function _r(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*dt),d={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(k){if(d.count+k<=f)return;f=Math.max(f*2,d.count+k);let L=new ArrayBuffer(f*dt);new Uint8Array(L).set(d.bytes.subarray(0,d.offset)),u=L,d.view=new DataView(L),d.bytes=new Uint8Array(L);}},h=[],m=[],y=new Map;for(let k of i.features()){if(k.type!==3||!ye(t,k.properties))continue;let L=o.liftBy?.(k.properties)??0,R=k.properties.osm_id,I=typeof R=="number"?R:typeof R=="string"?Number(R):NaN,E=Number.isFinite(I)?I:Number(k.id??0);for(let H of tt(k.loadGeometry())){let W=De(H,e,Me(e));W&&(h.push(L?{...W,lift:L}:W),m.push(E));}}let p=new Set,b=Math.max(o.weld??Ks,0),g=So(h,(k,L)=>gr(k,L,e,p),b/r),v=b>0?g.map(k=>({...k,outer:Ai(k.outer,b/r,e),holes:k.holes.map(L=>Ai(L,b/r,e))})):g;for(let k of v){Ti(k.outer,y);for(let L of k.holes)Ti(L,y);}o.onShapes?.(v);let w=Ys(v,h,m),x=new Set;for(let[k,L]of y)L>1&&x.add(k);let _=[],M={radius:c,segments:o.cornerSegments,extent:e,margin:Me(e),minCutRatio:0,maxChord:oi/r},C=[];for(let k of v){let L=d.indices.length,R=_.length,I=c>0?{outer:He(k.outer,{...M,keep:ki(k.outer,x)}),holes:k.holes.map(B=>He(B,{...M,keep:ki(B,x)}))}:k,E=l>0?gr(I.outer,l,e,x):I.outer,H=I.holes.map(B=>l>0?gr(B,-l,e,x):B),W=k.lift??0,F=n+W,P=a+W;Ei(d,E??I.outer,H.map((B,V)=>B??I.holes[V]),F,Li,o.maxSegment??0);let N=F,O=F-s;E&&l>0&&s>0&&yr(d,E,I.outer,N,O,js,e,x),O!==P&&yr(d,I.outer,I.outer,O,P,Si,e,x);for(let B of I.holes)if(O!==P&&yr(d,B,B,O,P,Si,e,x),F<P){let V=d.indices.length;Ei(d,B,[],P,Xs);for(let j=V;j<d.indices.length;j++)_.push(d.indices[j]);d.indices.length=V;}C.push(L,d.indices.length,R,_.length);}if(!d.indices.length&&!_.length)return null;let S=d.indices.length;for(let k=0;k<C.length;k+=4)C[k+2]+=S,C[k+3]+=S;let T=[];for(let k of w){T.push(k.length);for(let L of k)T.push(L);}let A=new Uint32Array(S+_.length);return A.set(d.indices,0),A.set(_,S),{vertices:u.slice(0,d.offset),indices:A.buffer,vertexCount:d.count,indexCount:A.length,extent:e,capIndexOffset:S,shapeFeatures:new Float64Array(T).buffer,shapeRanges:new Uint32Array(C).buffer}}function Ys(i,e,t){let o=i.map(()=>[]);if(!i.length)return o;let r=i.map(n=>Mi(n.outer));for(let n=0;n<e.length;n++){let a=$s(e[n].outer);if(!a)continue;let l=-1;for(let s=0;s<i.length;s++){let c=r[s];if(a[0]<c[0]||a[0]>c[2]||a[1]<c[1]||a[1]>c[3]||!xr(i[s].outer,a[0],a[1]))continue;let f=false;for(let u of i[s].holes)if(xr(u,a[0],a[1])){f=true;break}if(!f){l=s;break}}if(l<0){let s=Mi(e[n].outer),c=0;for(let f=0;f<i.length;f++){let u=r[f],d=Math.min(s[2],u[2])-Math.max(s[0],u[0]),h=Math.min(s[3],u[3])-Math.max(s[1],u[1]),m=d>0&&h>0?d*h:0;m>c&&(c=m,l=f);}}l<0&&(l=0),o[l].includes(t[n])||o[l].push(t[n]);}return o}function Mi(i){let e=1/0,t=1/0,o=-1/0,r=-1/0;for(let n=0;n<i.length;n+=2)i[n]<e&&(e=i[n]),i[n]>o&&(o=i[n]),i[n+1]<t&&(t=i[n+1]),i[n+1]>r&&(r=i[n+1]);return [e,t,o,r]}function $s(i){let e=i.length/2-1;if(e<3)return null;let t=0;for(let r=0;r<e;r++){let n=(r+1)%e;t+=i[r*2]*i[n*2+1]-i[n*2]*i[r*2+1];}let o=t>0;for(let r=0;r<e;r++){let n=(r+e-1)%e*2,a=r*2,l=(r+1)%e*2,s=(i[a]-i[n])*(i[l+1]-i[n+1])-(i[a+1]-i[n+1])*(i[l]-i[n]);if(s===0||s>0!==o)continue;let c=(i[n]+i[a]+i[l])/3,f=(i[n+1]+i[a+1]+i[l+1])/3;if(xr(i,c,f))return [c,f]}return null}function xr(i,e,t){let o=false,r=i.length/2-1;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}function ht(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 Ti(i,e){for(let t=0;t+3<i.length;t+=2){let o=ht(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function ki(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=ht(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=ht(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 Pt(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,qs(Math.round(o*Ii)),true),i.view.setInt8(s+10,wr(Math.round(r*127))),i.view.setInt8(s+11,wr(Math.round(n*127))),i.view.setInt8(s+12,wr(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-zt:e>=i.extent?zt:0),i.view.setInt8(s+15,t<=0?-zt:t>=i.extent?zt:0),i.offset+=dt,i.count++}function Ei(i,e,t,o,r=Li,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=mi__default.default(a,l.length?l:void 0,2);if(!s.length)return;let c=s;if(n>0){let u=[];mr(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)Pt(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 yr(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||Co(f,u,d,h,a,Me(a))||l.has(ht(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,w=Math.hypot(e[c*2]-f,e[c*2+1]-u)||0,x=0;if(w>1e-6&&v!==0){let T=1/Math.hypot(1,v/w);x=w/Math.hypot(w,v)*Math.sign(v),b*=T,g*=T;}let _=Pt(i,e[c*2],e[c*2+1],o,b,g,x,n),M=Pt(i,e[c*2+2],e[c*2+3],o,b,g,x,n),C=Pt(i,f,u,r,b,g,x,n),S=Pt(i,d,h,r,b,g,x,n);i.indices.push(C,M,S,C,_,M);}}}function gr(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,w=-(u-h)/b,x=(p-d)/g,_=-(y-u)/g,M=v+x,C=w+_,S=Math.hypot(M,C);if(S<1e-6){n.push(u,d);continue}M/=S,C/=S;let T=Math.min(1/Math.max(M*v+C*w,.35),3),A=u-M*e*T,k=d-C*e*T,L=ht(h,m,u,d),R=ht(u,d,y,p);if(o.has(L)||o.has(R)){n.push(u,d);continue}let I=-Me(t),E=t+Me(t);((W,F)=>W<=I||W>=E||F<=I||F>=E)(u,d)&&(A=u,k=d),n.push(A,k);}n.push(n[0],n[1]);let a=Math.abs(vr(i)),l=vr(n);if(Math.sign(l)!==Math.sign(vr(i))||Math.abs(l)<a*.25)return null;let s=-Me(t),c=t+Me(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 vr(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 wr=i=>i>127?127:i<-127?-127:i,qs=i=>i>32767?32767:i<-32768?-32768:i;function Ai(i,e,t){if(!(e>0))return i;let o=Me(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,w=a[p*2+1]-g,x=Math.hypot(v,w);x<1e-6||Math.abs((h-b)*w-(m-g)*v)/x<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 Zs=100;function Cr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function Sr(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 Qs(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=mt(Math.floor(o.minX/e)),n=mt(Math.floor(o.maxX/e)),a=mt(Math.floor(o.minY/e)),l=mt(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 Fi=i=>i.shapes.length===0;function Mo(i,e,t){!i.cells.length&&i.shapes.length&&Qs(i);let o=i.extent/32,r=i.cells[mt(Math.floor(t/o))*32+mt(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||!Ri(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(Ri(c,e,t)){s=true;break}s||(n=l.level);}return Math.min(Math.round(n*100),127)}function Mr(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=Mo(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=Mo(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,w=Mo(i,g,v);w!==y&&(t.push(g,v),o.push(w),y=w);}}t.push(f,u),o.push(d),a=d;}return {pts:t,levels:o}}var mt=i=>i<0?0:i>31?31:i;function Ri(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 Js=5;function rt(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 Ke=20;function Tr(i,e,t=0,o,r=0,n={}){let{level:a}=n,l=Math.max(256,i.length*24),s=new ArrayBuffer(l*Ke),c=new DataView(s),f=0,u=[],d=[],h=x=>{if(f+x<=l)return;l=Math.max(l*2,f+x);let _=new ArrayBuffer(l*Ke);new Uint8Array(_).set(new Uint8Array(s,0,f*Ke)),s=_,c=new DataView(_);},m=(x,_,M,C,S,T,A,k=0,L=0,R=0)=>{let I=f*Ke;return c.setInt16(I,x,true),c.setInt16(I+2,_,true),c.setInt16(I+4,M,true),c.setInt16(I+6,C,true),c.setInt8(I+8,S),c.setInt8(I+9,T),c.setInt8(I+10,k),c.setInt8(I+11,L),c.setFloat32(I+12,A,true),c.setFloat32(I+16,R,true),f++},y=0,p=0,b=r>0?12/r:0,g=b>0?nc(i):null;for(let x of i.features()){if(x.type!==2&&x.type!==3||!ye(e,x.properties)||a!==void 0&&rt(x.properties)!==a)continue;let _=x.properties.osm_id,M=typeof _=="number"?_:typeof _=="string"?Number(_):NaN;p=Number.isFinite(M)?M:Number(x.id??0);let C=x.properties.width;y=typeof C=="number"&&C>.5&&C<100?C:0;let S=x.type===3;for(let T of x.loadGeometry()){let A=t>0?tc(zi(T),t):zi(T);if(A.length<4)continue;let k=o&&!Fi(o)?Mr(o,A):null,L=k?k.pts:A,R=k?.levels,I=L.length/2;if(I<2)continue;let E=rt(x.properties),H=To(Math.round(L[0]),Math.round(L[1])),W=To(Math.round(L[I*2-2]),Math.round(L[I*2-1])),F=null,P=y;if(g&&y>0&&!S){let O=0;for(let q=0;q<I-1;q++)O+=Math.hypot(L[q*2+2]-L[q*2],L[q*2+3]-L[q*2+1]);P=Hi(E,y,H,W,g);let B=q=>Math.min(g.width.get(q)??0,P*2),V=B(H)-P,j=B(W)-P,X=Math.min(b,O/2);if(X>0&&(V>0||j>0)){F=Q=>{let Z=0;return V>0&&Q<X&&(Z=V*(1-Q/X)),j>0&&O-Q<X&&(Z=Math.max(Z,j*(1-(O-Q)/X))),P+Z};let q=[];for(let Q of [X,O-X])Q>.01&&Q<O-.01&&q.push(Q);if(q.length){let Q=ec(L,R,q);L=Q.pts,R=Q.levels,I=L.length/2;}}}h((I-1)*4);let N=0;for(let O=0;O<I-1;O++){let B=L[O*2],V=L[O*2+1],j=L[O*2+2],X=L[O*2+3],q=Math.hypot(j-B,X-V);if(S&&rc(B,V,j,X,i.extent)){N+=q;continue}let Q=oc(B,V,j,X,i.extent);if(!Q){N+=q;continue}let[Z,U,ne,ie]=Q,J=Math.hypot(Z-B,U-V),K=Math.hypot(ne-Z,ie-U),Y=Math.hypot(j-ne,X-ie),oe=N+J,re=R?R[O]:0,ce=R?R[O+1]:0,ae=F?F(oe):P,me=F?F(oe+K):P,we=m(Z,U,ne,ie,0,-1,oe,re,ce,ae),ge=m(Z,U,ne,ie,0,1,oe,re,ce,ae),Qe=m(Z,U,ne,ie,1,1,oe,re,ce,me),at=m(Z,U,ne,ie,1,-1,oe,re,ce,me);N+=J+K+Y,u.push(we,ge,Qe,we,Qe,at),d.push(p,p);}}}if(!u.length)return null;let v=new Uint32Array(u),w=new Float64Array(d);return {vertices:s.slice(0,f*Ke),indices:v.buffer,vertexCount:f,indexCount:v.length,featureIds:w.buffer}}function ec(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 tc(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 zi(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 oc(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 rc(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var Pi=new WeakMap,To=(i,e)=>(i+512)*65536+(e+512);function Hi(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 nc(i){let e=Pi.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=rt(r.properties);for(let s of r.loadGeometry()){if(s.length<4)continue;let c=To(Math.round(s[0]),Math.round(s[1])),f=To(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=Hi(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 Pi.set(i,t),t}function kr(i){if(!i.length)return null;for(let t of i)if(!t.cut.some(Boolean))return [{outer:t.ring,holes:t.holes??[]}];if(i.length<2)return null;let e=So(i.map(t=>({outer:t.ring,holes:t.holes??[]})));return e.length?e:null}var ko=class{constructor(){this.meshes=new z;this.stitched=new ee;this.hiddenByTile=new z;this.changed=new ee;this.signature="";this.meshSig=new z;this.cache=new z;}update(e,t,o){let r=new z,n=0,a="";for(let[u,d]of e.loadedTiles()){if(d.id.z!==o.zoom)continue;let h=d.data?.seams;if(h?.length){a+=u+";",n=d.data?.buckets?.[t]?.extent??n;for(let m of h){let y=r.get(m.osmId);y?y.push({seam:m,tile:d.id}):r.set(m.osmId,[{seam:m,tile:d.id}]);}}}if(a===this.signature)return false;if(this.signature=a,this.changed.clear(),this.stitched.clear(),this.hiddenByTile.clear(),!n||!r.size){for(let u of this.meshes.keys())this.changed.add(u);return this.meshes.clear(),this.meshSig.clear(),this.cache.clear(),true}let l=new z,s=new z,c=new z,f=new ee;for(let[u,d]of r){f.add(u);let h=d.map(b=>b.tile.dataKey).sort().join(","),m=this.cache.get(u);if(!m||m.sig!==h){let b=d[0].tile,g=d.map(({seam:w,tile:x})=>({ring:Oi(w.outer,x,b,n),holes:w.holes.map(_=>Oi(_,x,b,n)),cut:w.outerCut})),v=kr(g);if(v?.length)m={sig:h,shapes:v,owner:b,seam:d[0].seam,tiles:d.map(w=>w.tile.dataKey)},this.cache.set(u,m);else if(!m)continue}let y=m.owner.dataKey;s.set(y,m.owner);let p=l.get(y)??[];for(let b of m.shapes)p.push({rings:{outer:b.outer,holes:b.holes},seam:m.seam});l.set(y,p),c.set(y,(c.get(y)??"")+u+":"+m.sig+";"),this.stitched.add(u);for(let b of [...m.tiles,...d.map(g=>g.tile.dataKey)]){let g=this.hiddenByTile.get(b);g?g.add(u):this.hiddenByTile.set(b,new Set([u]));}}for(let u of [...this.cache.keys()])f.has(u)||this.cache.delete(u);for(let[u,d]of l){let h=c.get(u);if(this.meshSig.get(u)===h&&this.meshes.has(u))continue;let m=gi(d,n,{metersPerUnit:o.metersPerTile>0?o.metersPerTile/n:0,cornerRadius:o.cornerRadius,cornerSegments:o.cornerSegments});this.changed.add(u),m?(this.meshes.set(u,{tile:s.get(u),mesh:m}),this.meshSig.set(u,h)):(this.meshes.delete(u),this.meshSig.delete(u));}for(let u of [...this.meshes.keys()])l.has(u)||(this.meshes.delete(u),this.meshSig.delete(u),this.changed.add(u));return true}reset(){this.meshes.clear(),this.stitched.clear(),this.hiddenByTile.clear(),this.cache.clear();for(let e of this.meshSig.keys())this.changed.add(e);this.meshSig.clear(),this.signature="";}};function Oi(i,e,t,o){let r=(e.x-t.x)*o,n=(e.y-t.y)*o,a=new Array(i.length);for(let l=0;l<i.length;l+=2)a[l]=i[l]+r,a[l+1]=i[l+1]+n;return a}var Er={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},Ar={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:"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 Wi={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 Vi={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,weld:0,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 Di={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,weld:0,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 Ni={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 Gi={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 Ui={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 ji={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 Xi={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 Ki={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 Yi={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 $i={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 qi={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 Zi={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 Qi={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 Ji={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 ea={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 ta={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 oa={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 ra={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 na={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 ia={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 aa={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 la={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 sa={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 ca={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 fa={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 ua={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 da={"3d":ji,cartoon:Xi,cyberpunk:Ki,dawn:Yi,dusk:$i,earth:qi,future:Zi,"glass-refined":Qi,glass:Ji,"harmony-black":ea,"harmony-blue":ta,"harmony-green":oa,lunar:ra,matte:na,minimal:ia,ocean:aa,premium:la,realistic:sa,space:ca,volcano:fa,white:ua};function Eo(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 $="base",ha="\u241F",Oe=(i,e)=>i+"\u241F"+String(e);var pt=class{constructor(e=Ir){this.splitValues={};this.spec=e,this.light={...Ar,...e.light??{}},this.sky={...Er,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return de(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=Ae(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 Ae(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=$){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??$)===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??$))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:Oe(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},Ir=Bi,Fc=Wi,zc=Vi,Pc=Di;function Hc(i,e){if(typeof i!="string")return i;let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(i);if(!t)return i;let o=r=>Math.round(parseInt(t[r],16)*e).toString(16).padStart(2,"0");return `#${o(1)}${o(2)}${o(3)}`}function ma(i,e,t,o){let r=i.paint?.building;return r?{...i,name:e,paint:{...i.paint,building:{...r,windowColor:Hc(r.color,t),windowGlow:0,...o}}}:{...i,name:e}}var Be={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:Ni,mono:Gi,pale:Ui,...da};Be["3d-tone"]=ma(Be["3d"],"\u0421\u0432\u0435\u0442\u043B\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});Be["night-tone"]=ma(Be.night,"\u0422\u0451\u043C\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:1,seamStrength:0});function Ao(i,e=Ir){if(typeof i!="string")return Eo(e,i);if(i==="day")return e;let t=Be[i];return t?Eo(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(Be).join(", ")}`),e)}var Ht=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 pa(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 Ot=`
8
+ `)}var Ft=(r=>(r[r.Unknown=0]="Unknown",r[r.Point=1]="Point",r[r.LineString=2]="LineString",r[r.Polygon=3]="Polygon",r))(Ft||{}),xo=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(ts,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 ts(i,e,t){t&&(i===1?e.id=t.readVarint():i===2?os(t,e):i===3?e.type=t.readVarint():i===4&&(e.geomOffset=t.pos,t.skip(2)));}function os(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 _o=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(rs,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 xo.read(t,o,this.keys,this.values,this.extent)}*features(){for(let e=0;e<this.featureOffsets.length;e++)yield this.feature(e);}};function rs(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(ns(t)));}function ns(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 Rt=class{constructor(e){this.layers={};new es__default.default(e instanceof Uint8Array?e:new Uint8Array(e)).readFields((o,r,n)=>{if(o===3&&n){let a=_o.read(n,n.readVarint()+n.pos);a.length&&(this.layers[a.name]=a);}},null);}};function tt(i){let e=[],t=null;for(let o of i){if(o.length<6)continue;let r=is(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 is(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:ei(i.stops,e,(o,r,n)=>o+(r-o)*n,t)}function Ae(i,e,t){return i===void 0?t:typeof i=="string"?de(i):ei(i.stops,e,(o,r,n)=>{let a=de(o),l=de(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 ei(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 ye(i,e){if(!i)return true;let t=i[0];switch(t){case "all":return i.slice(1).every(o=>ye(o,e));case "any":return i.slice(1).some(o=>ye(o,e));case "!":return !ye(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 as=Math.PI/8,ls=.35,ss=32,oi=.25,ri=.5,ni=.07;function He(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??ls,0),a=e.extent,l=[];for(let s=0;s<o;s++){let c=i[s*2],f=i[s*2+1],u=i[(s+o-1)%o*2],d=i[(s+o-1)%o*2+1],h=i[(s+1)%o*2],m=i[(s+1)%o*2+1],y=c-u,p=f-d,b=h-c,g=m-f,v=Math.hypot(y,p),w=Math.hypot(b,g);if(v<1e-6||w<1e-6){l.push(c,f);continue}let x=y/v,_=p/v,M=b/w,C=g/w;if(e.keep?.[s]){l.push(c,f);continue}let S=x*M+_*C;if(S>.985){l.push(c,f);continue}if(a!==void 0&&(c<=0||c>=a||f<=0||f>=a)){l.push(c,f);continue}let T=Math.min(t,v*ti,w*ti);if(T<t*n){l.push(c,f);continue}let A=c-x*T,k=f-_*T,L=c+M*T,R=f+C*T,I=Math.acos(Math.max(-1,Math.min(1,S))),E=Math.min(as,Math.PI/2/r),O=Math.ceil(I/E-1e-6),W=e.maxChord&&e.maxChord>0?Math.ceil(T/Math.tan(I/2)*I/e.maxChord):0,F=Math.max(1,Math.min(ss,Math.max(Math.min(r,O),W)));l.push(A,k);for(let P=1;P<F;P++){let N=P/F,B=1-N;l.push(B*B*A+2*B*N*c+N*N*L,B*B*k+2*B*N*f+N*N*R);}l.push(L,R);}return l.length<6?i:(l.push(l[0],l[1]),l)}var ti=.4;var Me=i=>i/64;function De(i,e,t=0){let o=ii(i.outer,e,t);if(!o)return null;let r=[];for(let n of i.holes){let a=ii(n,e,t);a&&r.push(a);}return {outer:o,holes:r}}function ii(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=ai(s,c,r,e,t),h=ai(f,u,r,e,t);if(d!==h){let m=cs(f,u,s,c,r,e,t),y=r===0?-t:r===1?e+t:f+(s-f)*m,p=r===2?-t:r===3?e+t:u+(c-u)*m;o.push(y,p);}d&&o.push(s,c);}}return o.length<6?null:(o.push(o[0],o[1]),o)}function ai(i,e,t,o,r){return t===0?i>=-r:t===1?i<=o+r:t===2?e>=-r:e<=o+r}function cs(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 Co(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 cr(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 li=1,ke=18,ut=32,ft=8,pi=65535/ut,fs=9,us=1,ds=0,hs=1,ms=2;var si=0,ps=1,ci=2,bs=3,bi=.47;function dr(i,e,t,o={},r){let n=o.metersPerUnit&&o.metersPerUnit>0?o.metersPerUnit:bi,{b:a,ensure:l,take:s}=yi(Math.max(1024,i.length*48));for(let c of i.features()){if(c.type!==3||!ye(t,c.properties))continue;let f=Os(c.properties),u=Bs(c.properties,f);if(f<=u)continue;let d=Vs(c.properties)??Number(c.id??0),h=Hs(d>>>0),m=Ps(h,c.properties),y=zs(c.properties,f),p=tt(c.loadGeometry()),b=r?p.some(g=>{let v=De(g,e,Me(e));return v?cr(v.outer,e):false}):false;for(let g of p){if(r&&b){let v=Ds(g,e,f,u,d,h,m,y);v&&r.push(v);}wi(a,g,l,{extent:e,metersPerUnit:n,height:f,minHeight:u,featureId:d,seed:h,tint:m,facade:y,props:c.properties,cornerRadius:o.cornerRadius??0,cornerSegments:o.cornerSegments,whole:false});}}return s(e)}function yi(i){let e=i,t=new ArrayBuffer(e*ke),o={verts:new DataView(t),vertsU8:new Uint8Array(t),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},r=a=>{if(o.vertexCount+a<=e)return;e=Math.max(e*2,o.vertexCount+a);let l=new ArrayBuffer(e*ke);new Uint8Array(l).set(o.vertsU8.subarray(0,o.vertOffset)),t=l,o.verts=new DataView(l),o.vertsU8=new Uint8Array(l);};return o.ensure=r,{b:o,ensure:r,take:a=>{if(!o.indices.length)return null;let l=new Uint32Array(o.indices),s=new Float64Array(o.featureIds);return {vertices:t.slice(0,o.vertOffset),indices:l.buffer,featureIds:s.buffer,vertexCount:o.vertexCount,indexCount:l.length,extent:a}}}}function gi(i,e,t={}){let o=t.metersPerUnit&&t.metersPerUnit>0?t.metersPerUnit:bi,{b:r,ensure:n,take:a}=yi(Math.max(1024,i.length*64));for(let{rings:l,seam:s}of i)wi(r,l,n,{extent:e,metersPerUnit:o,height:s.height,minHeight:s.minHeight,featureId:s.osmId,seed:s.seed,tint:s.tint,facade:s.facade,props:{},cornerRadius:t.cornerRadius??0,cornerSegments:t.cornerSegments,whole:true});return a(e)}var hr=(i,e)=>i|e<<2,fi=i=>Math.max(-32768,Math.min(32767,i)),fr=i=>Math.max(0,Math.min(65535,Math.round(Math.min(i,pi)*ut)));function st(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,fi(Math.round(e*ft)),true),i.verts.setInt16(h+2,fi(Math.round(t*ft)),true),i.verts.setUint16(h+4,Math.round(Math.min(o,pi)*ut),true),i.vertsU8[h+6]=s,i.vertsU8[h+7]=l,i.verts.setInt8(h+8,ur(Math.round(r*127))),i.verts.setInt8(h+9,ur(Math.round(n*127))),i.verts.setInt8(h+10,ur(Math.round(a*127))),i.vertsU8[h+11]=c,i.verts.setUint16(h+12,fr(f),true),i.verts.setUint16(h+14,fr(u),true),i.verts.setUint16(h+16,fr(d),true),i.vertOffset+=ke,i.vertexCount++}function ui(i,e,t,o,r,n,a,l,s,c){let f=e.length/2;if(f<3)return;let u=hr(ds,a),d=gs(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],w=Math.hypot(g,v)||1;p[b*2]=v/w,p[b*2+1]=-g/w;}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],w=p[g*2]+p[b*2],x=p[g*2+1]+p[b*2+1],_=Math.hypot(w,x);v>.5&&_>1e-6&&(m[b*2]=w/_,m[b*2+1]=x/_,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],w=e[p*2+3];if(b===v&&g===w||c[p])continue;let x=v-b,_=w-g,M=Math.hypot(x,_)||1,C=_/M,S=-x/M,T=d.offset[p],A=d.width[p],k=[0,1];if(s){for(let R=0;R<s.length;R++)for(let I=R+1;I<s.length;I++){let E=ot(s[R],b,g)-ot(s[I],b,g),O=ot(s[R],v,w)-ot(s[I],v,w);if(E===O)continue;let W=E/(E-O);W>1e-4&&W<1-1e-4&&k.push(W);}k.sort((R,I)=>R-I);}let L=(R,I)=>{if(!s)return o;let E=1/0;for(let O of s)E=Math.min(E,ot(O,R,I));return Math.max(o,E)};for(let R=0;R+1<k.length;R++){let I=k[R],E=k[R+1];if(E-I<1e-6)continue;let O=b+x*I,W=g+_*I,F=b+x*E,P=g+_*E,N=T+M*I*l,B=T+M*E*l,H=(p+1)%(f-1),V=y[p]?m[p*2]:C,j=y[p]?m[p*2+1]:S,X=y[H]?m[H*2]:C,q=y[H]?m[H*2+1]:S,Q=C+(V-C)*(1-I),Z=S+(j-S)*(1-I),U=C+(X-C)*E,ne=S+(q-S)*E,ie=Math.hypot(Q,Z)||1,ee=Math.hypot(U,ne)||1,K=Q/ie,Y=Z/ie,oe=U/ee,re=ne/ee;i.ensure(4);let ce=st(i,O,W,t,K,Y,0,0,n,u,N,A,h),ae=st(i,F,P,t,oe,re,0,0,n,u,B,A,h),me=st(i,O,W,L(O,W),K,Y,0,255,n,u,N,A,h),we=st(i,F,P,L(F,P),oe,re,0,255,n,u,B,A,h);i.indices.push(ce,we,ae,ce,me,we),i.featureIds.push(r,r);}}}var ys=.9976;function gs(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>=ys,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 vs(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=mi__default.default(l,s.length?s:void 0,2);if(!c.length)return;let f=hr(hs,a),u=i.vertexCount;for(let d=0;d<l.length;d+=2)st(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 ws(i){let e=xs(i);if(e.length<3)return null;let t=Math.abs(_s(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 w of e){let x=w.x*l+w.y*s,_=-w.x*s+w.y*l;x<f&&(f=x),x>u&&(u=x),_<d&&(d=_),_>h&&(h=_);}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 xs(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 _s(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 Cs=Math.tan(30*Math.PI/180),Ss=3.5,Ms=.9;function Ts(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=ks(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 ks(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 ot=(i,e,t)=>i.a*e+i.b*t+i.c;function Es(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 As(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 vi(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?vi(i,e,"hipped"):a}function Is(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=Es(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=ot(i[o],r[n],r[n+1]);a>t&&(t=a);}}return t}function Rs(i,e,t){return i.map(o=>({a:o.a*e,b:o.b*e,c:o.c*e+t}))}function Fs(i,e,t,o,r,n,a,l){let s=hr(ms,a);for(let c=0;c<t.length;c++){let f=e[c];if(!f||f.length<6)continue;let u=mi__default.default(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,ot(t[c],f[b],f[b+1]));st(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 zs(i,e){let t=String(i.class??"").toLowerCase();return t==="industrial"||t==="warehouse"||t==="hangar"||t==="construction"?bs:t==="commercial"||t==="office"||t==="retail"||t==="supermarket"?ci:t==="house"||t==="detached"||t==="garage"||t==="hut"||t==="shed"||e<=7?si:e>=40?ci:ps}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 Hs(i){let e=i>>>0;return e=(e>>>16^e)*73244475,e=(e>>>16^e)*73244475,e=e>>>16^e,e>>>0}function Os(i){let e=ct(i.render_height)??ct(i.height)??Ws(i.levels??i.building_levels??i["building:levels"]);return e&&e>0?Math.max(e,us):fs}function Bs(i,e){let t=ct(i.render_min_height)??ct(i.min_height)??ct(i.base)??0;return t>0&&t<e?t:0}function Ws(i){let e=ct(i);return e&&e>0?e*3:null}function ct(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 ur=i=>i>127?127:i<-127?-127:i;function Vs(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 di(i,e){let t=i.length/2-1,o=new Array(Math.max(t,0)).fill(false);if(t<3)return {ring:i,cut:o};let r=(a,l)=>a===0?1:a===e?2:l===0?3:l===e?4:0,n=i.slice();for(let a=0;a<t;a++){let l=i[a*2],s=i[a*2+1],c=r(l,s);if(!c)continue;let f=(a+t-1)%t,u=(a+1)%t,d=r(i[f*2],i[f*2+1])===c,h=r(i[u*2],i[u*2+1])===c;h&&(o[a]=true);let m=d===h?-1:d?u:f;if(m<0)continue;let y=l-i[m*2],p=s-i[m*2+1],b=Math.hypot(y,p);b<1e-6||(n[a*2]=l+y/b*li,n[a*2+1]=s+p/b*li);}return n[t*2]=n[0],n[t*2+1]=n[1],{ring:n,cut:o}}function wi(i,e,t,o){let{extent:r,metersPerUnit:n,height:a,minHeight:l,featureId:s,seed:c,tint:f,facade:u}=o,d=o.whole?e:De(e,r,Me(r));if(!d)return;let h=o.cornerRadius/n,m={radius:h,segments:o.cornerSegments,minCutRatio:0,maxChord:n>0?ri/n:0,...o.whole?{}:{extent:r,margin:Me(r)}},y=h>0?{outer:He(d.outer,m),holes:d.holes.map(A=>He(A,m))}:d,p=o.whole?y:De(y,r);if(!p)return;let b=A=>({ring:A,cut:new Array(Math.max(A.length/2-1,0)).fill(false)}),g=o.whole?b(p.outer):di(p.outer,r),v=p.holes.map(A=>o.whole?b(A):di(A,r)),w={outer:g.ring,holes:v.map(A=>A.ring)},x=o.whole?true:cr(w.outer,r),_=w.outer.length/2+w.holes.reduce((A,k)=>A+k.length/2,0);t(_*5+32);let M=w.holes.length||x?null:ws(w.outer),C=M?Ts(o.props,M,a,c,n):null,S=null,T=[];if(C&&M){let A=vi(As(w.outer,n),M,C.shape);T=Is(A,w.outer);let k=Ls(A,T);if(k>1e-6){let L=Math.min(Math.max(k*n*Cs,Ms),Ss);S=Rs(A,L/k,a);}}ui(i,w.outer,l,a,s,f,u,n,S,g.cut);for(let A=0;A<w.holes.length;A++)ui(i,w.holes[A],l,a,s,f,u,n,null,v[A].cut);S?Fs(i,T,S,a,s,f,u,n):vs(i,w.outer,w.holes,a,s,f,u);}function hi(i,e){let t=Me(e),o=Math.max(i.length/2-1,0),r=new Array(o);for(let n=0;n<o;n++)r[n]=Co(i[n*2],i[n*2+1],i[n*2+2],i[n*2+3],e,t);return r}function Ds(i,e,t,o,r,n,a,l){let s=De(i,e,Me(e));if(!s)return null;let c=hi(s.outer,e);return {osmId:r,height:t,minHeight:o,seed:n,tint:a,facade:l,outer:s.outer,holes:s.holes,outerCut:c,holeCuts:s.holes.map(f=>hi(f,e))}}var Xe=4;function mr(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 pr(i,e,t=0,o,r=false,n=4096){let a=[],l=[],s=[];for(let h of i.features()){if(h.type!==3||!ye(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 tt(h.loadGeometry())){let g=r?De(b,n):b;if(!g)continue;let v=[],w=[],x=o?He(g.outer,o):g.outer;for(let C=0;C<x.length;C++)v.push(x[C]);for(let C of g.holes){let S=o?He(C,o):C;w.push(v.length/2);for(let T=0;T<S.length;T++)v.push(S[T]);}let _=mi__default.default(v,w.length?w:void 0,2);if(!_.length)continue;let M=a.length/2;for(let C=0;C<v.length;C++)a.push(v[C]);if(t>0){let C=[];mr(a,_,M,t,C);for(let S=0;S<C.length;S+=3)l.push(C[S],C[S+2],C[S+1]),s.push(p);continue}for(let C=0;C<_.length;C+=3)l.push(M+_[C],M+_[C+2],M+_[C+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}}var xi=Gs__namespace,br=xi.union??xi.default?.union??null;br||console.warn("[osmgl] polygon-clipping \u0431\u0435\u0437 union \u2014 \u043E\u0431\u044A\u0435\u0434\u0438\u043D\u0435\u043D\u0438\u0435 \u0444\u0438\u0433\u0443\u0440 \u0432\u044B\u043A\u043B\u044E\u0447\u0435\u043D\u043E");function _i(i){let e=[];for(let t=0;t+1<i.length;t+=2)e.push([i[t],i[t+1]]);return e}function Ci(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 So(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=>[_i(u.outer),...u.holes.map(_i)]),c;try{if(!br)throw new Error("\u043D\u0435\u0442 union");c=br(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=Ci(u[0]);if(d.length<8)continue;let h=[];for(let m=1;m<u.length;m++){let y=Ci(u[m]);y.length>=8&&h.push(y);}r.push(n?{outer:d,holes:h,lift:n}:{outer:d,holes:h});}}return r}var dt=16,Ii=64,Li=0,js=1,Si=2,Xs=3,zt=1,Ks=.6;function _r(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*dt),d={view:new DataView(u),bytes:new Uint8Array(u),offset:0,count:0,indices:[],extent:e,ensure(k){if(d.count+k<=f)return;f=Math.max(f*2,d.count+k);let L=new ArrayBuffer(f*dt);new Uint8Array(L).set(d.bytes.subarray(0,d.offset)),u=L,d.view=new DataView(L),d.bytes=new Uint8Array(L);}},h=[],m=[],y=new Map;for(let k of i.features()){if(k.type!==3||!ye(t,k.properties))continue;let L=o.liftBy?.(k.properties)??0,R=k.properties.osm_id,I=typeof R=="number"?R:typeof R=="string"?Number(R):NaN,E=Number.isFinite(I)?I:Number(k.id??0);for(let O of tt(k.loadGeometry())){let W=De(O,e,Me(e));W&&(h.push(L?{...W,lift:L}:W),m.push(E));}}let p=new Set,b=Math.max(o.weld??Ks,0),g=So(h,(k,L)=>gr(k,L,e,p),b/r),v=b>0?g.map(k=>({...k,outer:Ai(k.outer,b/r,e),holes:k.holes.map(L=>Ai(L,b/r,e))})):g;for(let k of v){Ti(k.outer,y);for(let L of k.holes)Ti(L,y);}o.onShapes?.(v);let w=Ys(v,h,m),x=new Set;for(let[k,L]of y)L>1&&x.add(k);let _=[],M={radius:c,segments:o.cornerSegments,extent:e,margin:Me(e),minCutRatio:0,maxChord:oi/r},C=[];for(let k of v){let L=d.indices.length,R=_.length,I=c>0?{outer:He(k.outer,{...M,keep:ki(k.outer,x)}),holes:k.holes.map(H=>He(H,{...M,keep:ki(H,x)}))}:k,E=l>0?gr(I.outer,l,e,x):I.outer,O=I.holes.map(H=>l>0?gr(H,-l,e,x):H),W=k.lift??0,F=n+W,P=a+W;Ei(d,E??I.outer,O.map((H,V)=>H??I.holes[V]),F,Li,o.maxSegment??0);let N=F,B=F-s;E&&l>0&&s>0&&yr(d,E,I.outer,N,B,js,e,x),B!==P&&yr(d,I.outer,I.outer,B,P,Si,e,x);for(let H of I.holes)if(B!==P&&yr(d,H,H,B,P,Si,e,x),F<P){let V=d.indices.length;Ei(d,H,[],P,Xs);for(let j=V;j<d.indices.length;j++)_.push(d.indices[j]);d.indices.length=V;}C.push(L,d.indices.length,R,_.length);}if(!d.indices.length&&!_.length)return null;let S=d.indices.length;for(let k=0;k<C.length;k+=4)C[k+2]+=S,C[k+3]+=S;let T=[];for(let k of w){T.push(k.length);for(let L of k)T.push(L);}let A=new Uint32Array(S+_.length);return A.set(d.indices,0),A.set(_,S),{vertices:u.slice(0,d.offset),indices:A.buffer,vertexCount:d.count,indexCount:A.length,extent:e,capIndexOffset:S,shapeFeatures:new Float64Array(T).buffer,shapeRanges:new Uint32Array(C).buffer}}function Ys(i,e,t){let o=i.map(()=>[]);if(!i.length)return o;let r=i.map(n=>Mi(n.outer));for(let n=0;n<e.length;n++){let a=$s(e[n].outer);if(!a)continue;let l=-1;for(let s=0;s<i.length;s++){let c=r[s];if(a[0]<c[0]||a[0]>c[2]||a[1]<c[1]||a[1]>c[3]||!xr(i[s].outer,a[0],a[1]))continue;let f=false;for(let u of i[s].holes)if(xr(u,a[0],a[1])){f=true;break}if(!f){l=s;break}}if(l<0){let s=Mi(e[n].outer),c=0;for(let f=0;f<i.length;f++){let u=r[f],d=Math.min(s[2],u[2])-Math.max(s[0],u[0]),h=Math.min(s[3],u[3])-Math.max(s[1],u[1]),m=d>0&&h>0?d*h:0;m>c&&(c=m,l=f);}}l<0&&(l=0),o[l].includes(t[n])||o[l].push(t[n]);}return o}function Mi(i){let e=1/0,t=1/0,o=-1/0,r=-1/0;for(let n=0;n<i.length;n+=2)i[n]<e&&(e=i[n]),i[n]>o&&(o=i[n]),i[n+1]<t&&(t=i[n+1]),i[n+1]>r&&(r=i[n+1]);return [e,t,o,r]}function $s(i){let e=i.length/2-1;if(e<3)return null;let t=0;for(let r=0;r<e;r++){let n=(r+1)%e;t+=i[r*2]*i[n*2+1]-i[n*2]*i[r*2+1];}let o=t>0;for(let r=0;r<e;r++){let n=(r+e-1)%e*2,a=r*2,l=(r+1)%e*2,s=(i[a]-i[n])*(i[l+1]-i[n+1])-(i[a+1]-i[n+1])*(i[l]-i[n]);if(s===0||s>0!==o)continue;let c=(i[n]+i[a]+i[l])/3,f=(i[n+1]+i[a+1]+i[l+1])/3;if(xr(i,c,f))return [c,f]}return null}function xr(i,e,t){let o=false,r=i.length/2-1;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}function ht(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 Ti(i,e){for(let t=0;t+3<i.length;t+=2){let o=ht(i[t],i[t+1],i[t+2],i[t+3]);e.set(o,(e.get(o)??0)+1);}}function ki(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=ht(i[(r+t-1)%t*2],i[(r+t-1)%t*2+1],i[r*2],i[r*2+1]),a=ht(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 Pt(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,qs(Math.round(o*Ii)),true),i.view.setInt8(s+10,wr(Math.round(r*127))),i.view.setInt8(s+11,wr(Math.round(n*127))),i.view.setInt8(s+12,wr(Math.round(a*127))),i.bytes[s+13]=l,i.view.setInt8(s+14,e<=0?-zt:e>=i.extent?zt:0),i.view.setInt8(s+15,t<=0?-zt:t>=i.extent?zt:0),i.offset+=dt,i.count++}function Ei(i,e,t,o,r=Li,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=mi__default.default(a,l.length?l:void 0,2);if(!s.length)return;let c=s;if(n>0){let u=[];mr(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)Pt(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 yr(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||Co(f,u,d,h,a,Me(a))||l.has(ht(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,w=Math.hypot(e[c*2]-f,e[c*2+1]-u)||0,x=0;if(w>1e-6&&v!==0){let T=1/Math.hypot(1,v/w);x=w/Math.hypot(w,v)*Math.sign(v),b*=T,g*=T;}let _=Pt(i,e[c*2],e[c*2+1],o,b,g,x,n),M=Pt(i,e[c*2+2],e[c*2+3],o,b,g,x,n),C=Pt(i,f,u,r,b,g,x,n),S=Pt(i,d,h,r,b,g,x,n);i.indices.push(C,M,S,C,_,M);}}}function gr(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,w=-(u-h)/b,x=(p-d)/g,_=-(y-u)/g,M=v+x,C=w+_,S=Math.hypot(M,C);if(S<1e-6){n.push(u,d);continue}M/=S,C/=S;let T=Math.min(1/Math.max(M*v+C*w,.35),3),A=u-M*e*T,k=d-C*e*T,L=ht(h,m,u,d),R=ht(u,d,y,p);if(o.has(L)||o.has(R)){n.push(u,d);continue}let I=-Me(t),E=t+Me(t);((W,F)=>W<=I||W>=E||F<=I||F>=E)(u,d)&&(A=u,k=d),n.push(A,k);}n.push(n[0],n[1]);let a=Math.abs(vr(i)),l=vr(n);if(Math.sign(l)!==Math.sign(vr(i))||Math.abs(l)<a*.25)return null;let s=-Me(t),c=t+Me(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 vr(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 wr=i=>i>127?127:i<-127?-127:i,qs=i=>i>32767?32767:i<-32768?-32768:i;function Ai(i,e,t){if(!(e>0))return i;let o=Me(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,w=a[p*2+1]-g,x=Math.hypot(v,w);x<1e-6||Math.abs((h-b)*w-(m-g)*v)/x<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 Zs=100;function Cr(i){return {shapes:[],cells:[],extent:0,metersPerTile:i}}function Sr(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 Qs(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=mt(Math.floor(o.minX/e)),n=mt(Math.floor(o.maxX/e)),a=mt(Math.floor(o.minY/e)),l=mt(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 Fi=i=>i.shapes.length===0;function Mo(i,e,t){!i.cells.length&&i.shapes.length&&Qs(i);let o=i.extent/32,r=i.cells[mt(Math.floor(t/o))*32+mt(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||!Ri(l.outer,e,t))continue;let s=false;for(let c of l.holes)if(Ri(c,e,t)){s=true;break}s||(n=l.level);}return Math.min(Math.round(n*100),127)}function Mr(i,e){let t=[],o=[],r=i.extent>0?i.metersPerTile/i.extent:0,n=r>0?2/r:0,a=Mo(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=Mo(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,w=Mo(i,g,v);w!==y&&(t.push(g,v),o.push(w),y=w);}}t.push(f,u),o.push(d),a=d;}return {pts:t,levels:o}}var mt=i=>i<0?0:i>31?31:i;function Ri(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 Js=5;function rt(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 Ke=20;function Tr(i,e,t=0,o,r=0,n={}){let{level:a}=n,l=Math.max(256,i.length*24),s=new ArrayBuffer(l*Ke),c=new DataView(s),f=0,u=[],d=[],h=x=>{if(f+x<=l)return;l=Math.max(l*2,f+x);let _=new ArrayBuffer(l*Ke);new Uint8Array(_).set(new Uint8Array(s,0,f*Ke)),s=_,c=new DataView(_);},m=(x,_,M,C,S,T,A,k=0,L=0,R=0)=>{let I=f*Ke;return c.setInt16(I,x,true),c.setInt16(I+2,_,true),c.setInt16(I+4,M,true),c.setInt16(I+6,C,true),c.setInt8(I+8,S),c.setInt8(I+9,T),c.setInt8(I+10,k),c.setInt8(I+11,L),c.setFloat32(I+12,A,true),c.setFloat32(I+16,R,true),f++},y=0,p=0,b=r>0?12/r:0,g=b>0?nc(i):null;for(let x of i.features()){if(x.type!==2&&x.type!==3||!ye(e,x.properties)||a!==void 0&&rt(x.properties)!==a)continue;let _=x.properties.osm_id,M=typeof _=="number"?_:typeof _=="string"?Number(_):NaN;p=Number.isFinite(M)?M:Number(x.id??0);let C=x.properties.width;y=typeof C=="number"&&C>.5&&C<100?C:0;let S=x.type===3;for(let T of x.loadGeometry()){let A=t>0?tc(zi(T),t):zi(T);if(A.length<4)continue;let k=o&&!Fi(o)?Mr(o,A):null,L=k?k.pts:A,R=k?.levels,I=L.length/2;if(I<2)continue;let E=rt(x.properties),O=To(Math.round(L[0]),Math.round(L[1])),W=To(Math.round(L[I*2-2]),Math.round(L[I*2-1])),F=null,P=y;if(g&&y>0&&!S){let B=0;for(let q=0;q<I-1;q++)B+=Math.hypot(L[q*2+2]-L[q*2],L[q*2+3]-L[q*2+1]);P=Hi(E,y,O,W,g);let H=q=>Math.min(g.width.get(q)??0,P*2),V=H(O)-P,j=H(W)-P,X=Math.min(b,B/2);if(X>0&&(V>0||j>0)){F=Q=>{let Z=0;return V>0&&Q<X&&(Z=V*(1-Q/X)),j>0&&B-Q<X&&(Z=Math.max(Z,j*(1-(B-Q)/X))),P+Z};let q=[];for(let Q of [X,B-X])Q>.01&&Q<B-.01&&q.push(Q);if(q.length){let Q=ec(L,R,q);L=Q.pts,R=Q.levels,I=L.length/2;}}}h((I-1)*4);let N=0;for(let B=0;B<I-1;B++){let H=L[B*2],V=L[B*2+1],j=L[B*2+2],X=L[B*2+3],q=Math.hypot(j-H,X-V);if(S&&rc(H,V,j,X,i.extent)){N+=q;continue}let Q=oc(H,V,j,X,i.extent);if(!Q){N+=q;continue}let[Z,U,ne,ie]=Q,ee=Math.hypot(Z-H,U-V),K=Math.hypot(ne-Z,ie-U),Y=Math.hypot(j-ne,X-ie),oe=N+ee,re=R?R[B]:0,ce=R?R[B+1]:0,ae=F?F(oe):P,me=F?F(oe+K):P,we=m(Z,U,ne,ie,0,-1,oe,re,ce,ae),ge=m(Z,U,ne,ie,0,1,oe,re,ce,ae),Qe=m(Z,U,ne,ie,1,1,oe,re,ce,me),at=m(Z,U,ne,ie,1,-1,oe,re,ce,me);N+=ee+K+Y,u.push(we,ge,Qe,we,Qe,at),d.push(p,p);}}}if(!u.length)return null;let v=new Uint32Array(u),w=new Float64Array(d);return {vertices:s.slice(0,f*Ke),indices:v.buffer,vertexCount:f,indexCount:v.length,featureIds:w.buffer}}function ec(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 tc(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 zi(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 oc(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 rc(i,e,t,o,r){return i===t&&(i<=0||i>=r)?true:e===o&&(e<=0||e>=r)}var Pi=new WeakMap,To=(i,e)=>(i+512)*65536+(e+512);function Hi(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 nc(i){let e=Pi.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=rt(r.properties);for(let s of r.loadGeometry()){if(s.length<4)continue;let c=To(Math.round(s[0]),Math.round(s[1])),f=To(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=Hi(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 Pi.set(i,t),t}function kr(i){if(!i.length)return null;for(let t of i)if(!t.cut.some(Boolean))return [{outer:t.ring,holes:t.holes??[]}];if(i.length<2)return null;let e=So(i.map(t=>({outer:t.ring,holes:t.holes??[]})));return e.length?e:null}var ko=class{constructor(){this.meshes=new z;this.stitched=new J;this.hiddenByTile=new z;this.changed=new J;this.signature="";this.meshSig=new z;this.cache=new z;}update(e,t,o){let r=new z,n=0,a="";for(let[u,d]of e.loadedTiles()){if(d.id.z!==o.zoom)continue;let h=d.data?.seams;if(h?.length){a+=u+";",n=d.data?.buckets?.[t]?.extent??n;for(let m of h){let y=r.get(m.osmId);y?y.push({seam:m,tile:d.id}):r.set(m.osmId,[{seam:m,tile:d.id}]);}}}if(a===this.signature)return false;if(this.signature=a,this.changed.clear(),this.stitched.clear(),this.hiddenByTile.clear(),!n||!r.size){for(let u of this.meshes.keys())this.changed.add(u);return this.meshes.clear(),this.meshSig.clear(),this.cache.clear(),true}let l=new z,s=new z,c=new z,f=new J;for(let[u,d]of r){f.add(u);let h=d.map(b=>b.tile.dataKey).sort().join(","),m=this.cache.get(u);if(!m||m.sig!==h){let b=d[0].tile,g=d.map(({seam:w,tile:x})=>({ring:Oi(w.outer,x,b,n),holes:w.holes.map(_=>Oi(_,x,b,n)),cut:w.outerCut})),v=kr(g);if(v?.length)m={sig:h,shapes:v,owner:b,seam:d[0].seam,tiles:d.map(w=>w.tile.dataKey)},this.cache.set(u,m);else if(!m)continue}let y=m.owner.dataKey;s.set(y,m.owner);let p=l.get(y)??[];for(let b of m.shapes)p.push({rings:{outer:b.outer,holes:b.holes},seam:m.seam});l.set(y,p),c.set(y,(c.get(y)??"")+u+":"+m.sig+";"),this.stitched.add(u);for(let b of [...m.tiles,...d.map(g=>g.tile.dataKey)]){let g=this.hiddenByTile.get(b);g?g.add(u):this.hiddenByTile.set(b,new Set([u]));}}for(let u of [...this.cache.keys()])f.has(u)||this.cache.delete(u);for(let[u,d]of l){let h=c.get(u);if(this.meshSig.get(u)===h&&this.meshes.has(u))continue;let m=gi(d,n,{metersPerUnit:o.metersPerTile>0?o.metersPerTile/n:0,cornerRadius:o.cornerRadius,cornerSegments:o.cornerSegments});this.changed.add(u),m?(this.meshes.set(u,{tile:s.get(u),mesh:m}),this.meshSig.set(u,h)):(this.meshes.delete(u),this.meshSig.delete(u));}for(let u of [...this.meshes.keys()])l.has(u)||(this.meshes.delete(u),this.meshSig.delete(u),this.changed.add(u));return true}reset(){this.meshes.clear(),this.stitched.clear(),this.hiddenByTile.clear(),this.cache.clear();for(let e of this.meshSig.keys())this.changed.add(e);this.meshSig.clear(),this.signature="";}};function Oi(i,e,t,o){let r=(e.x-t.x)*o,n=(e.y-t.y)*o,a=new Array(i.length);for(let l=0;l<i.length;l+=2)a[l]=i[l]+r,a[l+1]=i[l+1]+n;return a}var Er={enabled:true,skyColor:"#7fb2e5",horizonColor:"#dfe6ee",fogRange:[2.43,10.1],fogIntensity:.92,fogVerticalRange:[35,220],spaceColor:"#05070f",atmosphereColor:"#79b8f5",starIntensity:.55,horizonBlend:.14},Ar={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:"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 Wi={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 Vi={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,weld:0,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 Di={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,weld:0,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 Ni={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 Gi={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 Ui={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 ji={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 Xi={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 Ki={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 Yi={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 $i={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 qi={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 Zi={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 Qi={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 Ji={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 ea={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 ta={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 oa={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 ra={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 na={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 ia={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 aa={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 la={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 sa={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 ca={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 fa={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 ua={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 da={"3d":ji,cartoon:Xi,cyberpunk:Ki,dawn:Yi,dusk:$i,earth:qi,future:Zi,"glass-refined":Qi,glass:Ji,"harmony-black":ea,"harmony-blue":ta,"harmony-green":oa,lunar:ra,matte:na,minimal:ia,ocean:aa,premium:la,realistic:sa,space:ca,volcano:fa,white:ua};function Eo(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 $="base",ha="\u241F",Oe=(i,e)=>i+"\u241F"+String(e);var pt=class{constructor(e=Ir){this.splitValues={};this.spec=e,this.light={...Ar,...e.light??{}},this.sky={...Er,...e.sky??{}},this.layers=e.layers.map(t=>({...t,paint:{...t.paint}}));}get background(){return de(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=Ae(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 Ae(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=$){return this.layers.filter(t=>t.type!=="raster").filter(t=>(t.source??$)===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??$))]}bucketKeyFor(e){if(e.type==="raster"||!e.splitBy)return e.id;let t=this.splitValues[e.splitBy];return t===void 0?null:Oe(e.id,t)}sourceLayers(){return [...new Set(this.layers.flatMap(e=>e.type==="raster"?[]:[e["source-layer"]]))]}},Ir=Bi,Fc=Wi,zc=Vi,Pc=Di;function Hc(i,e){if(typeof i!="string")return i;let t=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(i);if(!t)return i;let o=r=>Math.round(parseInt(t[r],16)*e).toString(16).padStart(2,"0");return `#${o(1)}${o(2)}${o(3)}`}function ma(i,e,t,o){let r=i.paint?.building;return r?{...i,name:e,paint:{...i.paint,building:{...r,windowColor:Hc(r.color,t),windowGlow:0,...o}}}:{...i,name:e}}var Be={day:{name:"\u0414\u043D\u0435\u0432\u043D\u0430\u044F"},night:Ni,mono:Gi,pale:Ui,...da};Be["3d-tone"]=ma(Be["3d"],"\u0421\u0432\u0435\u0442\u043B\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:0,windowRecess:.12,windowRecessShade:0,seamStrength:0});Be["night-tone"]=ma(Be.night,"\u0422\u0451\u043C\u043D\u0430\u044F, \u043E\u043A\u043D\u0430 \u0432 \u0442\u043E\u043D",1,{windowVariation:1,seamStrength:0});function Ao(i,e=Ir){if(typeof i!="string")return Eo(e,i);if(i==="day")return e;let t=Be[i];return t?Eo(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(Be).join(", ")}`),e)}var Ht=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 pa(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 Ot=`
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
@@ -2333,6 +2333,6 @@ void main() {
2333
2333
  if (color.a <= 0.001) discard;
2334
2334
  fragColor = color;
2335
2335
  }
2336
- `;var Lo=i=>i.kind==="symbol",Ua=i=>i.kind==="placement";function Ne(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(Bc(e,t,a,l,s,c,f,u)||o>0&&(Hr(e,t,a,l,s,c)<=o||Hr(e,t,s,c,f,u)<=o||Hr(e,t,f,u,a,l)<=o))return true}return false}function Bc(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 Hr(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 Or(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]*Xe;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 Br(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]*ke;s[c*2]=a+o.getInt16(f,true)*n,s[c*2+1]=l+o.getInt16(f+2,true)*n;}return s}var Vc={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},Dc=40,Nc=10.5,ja=2.5,Gc=16,Uc=4,jc=7,Bt=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(w=>w.type==="symbol"&&w.layout?.placement==="map"&&r.layerVisibleAt(w,c));if(!f.length)return;let u=t.center,d=le(u.lng),h=se(u.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let y=[];for(let w of f){let x=o.get(w.source??$);if(!x)continue;let _=r.bucketKeyFor(w);if(_===null)continue;let M=w.layout?.showFor==="highlight";if(M&&!this.highlightFootprint)continue;let C=m*1.5,T=w.layout?.arrowUnits==="meters"?m:1/t.worldSize,A=D(w.layout?.arrowLength,c,Dc)*T,k=D(w.layout?.arrowWidth,c,Nc)*T,L=D(w.layout?.arrowOutline,c,ja)*T,R=D(w.layout?.arrowGap,c,Gc)*T,I=D(w.layout?.arrowDotRadius,c,Uc)*T,E=D(w.layout?.arrowDotGap,c,jc)*T,H=Vr(A,k,I,R-E),W=L>0?Vr(A,k,I,R-E,L).outline:null,F={layer:w,verts:[],shape:H};for(let P of x.visibleTiles){let O=x.getTile(P)?.data?.buckets?.[_];if(!O||!Lo(O))continue;let B=new Int16Array(O.anchors),V=O.rotations?new Int16Array(O.rotations):null,j=P.bounds(),X=(j.maxX-j.minX)/O.extent,q=j.minX,Q=j.minY;for(let Z=0;Z<B.length/2;Z++){let U=q+B[Z*2]*X,ne=Q+B[Z*2+1]*X;if(M&&!Ne(this.highlightFootprint,U,ne,C))continue;let ie=(V?V[Z]:0)*Math.PI/180,J=Math.sin(ie),K=-Math.cos(ie),Y=U-d-J*R,oe=ne-h-K*R;W&&Dr(F,W,Y,oe,J,K),Dr(F,H.outline,Y,oe,J,K),this.count++;}}F.verts.length&&y.push(F);}if(!y.length)return;let p=y[0].shape,b=p.outline.length/2,g=[],v=[];for(let w of y){let x=g.length/2/b;for(let _ of w.verts)g.push(_);v.push({layer:w.layer,first:x,count:w.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 w of v){let x=w.layer.paint,_=D(x.opacity,c,1),M=Ae(x.color,c,[.18,.45,.76,1]),C=Ae(x.haloColor,c,[1,1,1,1]),S=D(w.layer.layout?.arrowOutline,c,ja)>0;Xc(e,n,w,C,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 pe(e,new Uint8Array(this.capacity*n*8),Vc,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 ue(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 Xc(i,e,t,o,r,n,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",Ce([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=s)Xa(i,t.first+c,l);}e.setVec4v("u_color",Ce([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=s)Xa(i,t.first+c,l);}function Xa(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var Ka=4,Wr=12;function Vr(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?Kc(u,r):u,m=mi__default.default(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<Wr;b++){let g=b/Wr*Math.PI*2;h.push(o+Math.cos(g)*p,Math.sin(g)*p);}for(let b=1;b<Wr-1;b++)m.push(y,y+b,y+b+1);return {outline:h,indices:m}}function Kc(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,w=p+g,x=Math.hypot(v,w);if(x<1e-9){n.push(c,f);continue}v/=x,w/=x;let _=Math.min(1/Math.max(v*y+w*p,.35),3);n.push(c+v*e*_,f+w*e*_);}return n}function Dr(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 Yc(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return Dr(s,Vr(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var $c=5;function Ya(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var Ro=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=D(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<=$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:Ya(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 qc="indoor-",Wt=class{constructor(){this.parts=null;this.stamp="";this.cache=new z;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(qc)||d.type!=="fill"||!t.layerVisibleAt(d,o))continue;let h=t.bucketKeyFor(d);h&&(r.push(h),n??(n=e.get(d.source??$)));}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=Or(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 z;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]*ke,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])||Ne(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 ue(e,new Uint32Array(d));c={vao:new fe(e,[{buffer:n,locations:a}],h),ibo:h,count:d.length};}}return this.cache.set(r.dataKey,c),c}};var $a=35,Zc=70,Qc=.35,Jc=.5,ef=1.1;function bt(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=xe((i.pitch-$a)/(Zc-$a),0,1),n=t.fogRange[0]*(1-Qc*r)*o,a=t.fogRange[1]*(1-Jc*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*ef:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function Nr(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&&qa(u,t);if(!d||!Pe(l,i.tileMatrix64(f,d.extent))||(he(s,l,[r,n,-1,1]),he(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=of(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 Gr(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||!Pe(l,i.tileMatrix64(f,h.extent))||(he(s,l,[r,n,-1,1]),he(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,w=y+(c[1]/c[3]-y)*g,x=tf(h,v,w);x!==null&&(!a||g<a.distance)&&(a={featureId:x,tile:f,layerId:d,distance:g});}}return a}function tf(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*Xe,true),l=s=>o.getInt16(s*Xe+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),w=(e-d)*(b-h)-(p-d)*(t-h),x=g<0||v<0||w<0,_=g>0||v>0||w>0;if(!(x&&_))return n[s]}return null}function qa(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function of(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*ke,true)/ft,u=y=>l.getInt16(y*ke+2,true)/ft,d=y=>l.getUint16(y*ke+4,true)/ut,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),w=u(p),x=d(p),_=f(b)-v,M=u(b)-w,C=d(b)-x,S=f(g)-v,T=u(g)-w,A=d(g)-x,k=n*A-a*T,L=a*S-r*A,R=r*T-n*S,I=_*k+M*L+C*R;if(I>-1e-9&&I<1e-9)continue;let E=1/I,H=e-v,W=t-w,F=o-x,P=(H*k+W*L+F*R)*E;if(P<0||P>1)continue;let N=W*C-F*M,O=F*_-H*C,B=H*M-W*_,V=(r*N+n*O+a*B)*E;if(V<0||P+V>1)continue;let j=(S*N+T*O+A*B)*E;j<0||j>1||j>=h||(h=j,m=c[y/3]??0);}return m>=0?{featureId:m,t:h}:null}function Fo(i,e,t){let o=qa(i,e);return o?Ur(o,t):null}function Ur(i,e){if(!i.featureIds)return null;let t=new Uint32Array(i.indices),o=new Float64Array(i.featureIds),r=[];for(let n=0;n+2<t.length;n+=3)o[n/3]===e&&r.push(t[n],t[n+1],t[n+2]);return r.length?{vertices:i.vertices,indices:new Uint32Array(r)}:null}var yt=24,jr=8,nf=2,af=12,zo=8,Po=8;function Vt(i){let e=0;for(let h of i)e+=h.length/2;if(e<2)return null;let t=(zo+2)*2,o=e*t+i.length*(Po+2)*2+8,r=e*(zo+2)*6+i.length*Po*6+24,n=new ArrayBuffer(o*yt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(h,m,y,p,b,g)=>{let v=s*yt;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 w=f(h,m,0,0,0,v),x=f(h,m,y,p,1,v);for(let _=1;_<=Po;_++){let M=Math.PI*_/Po,C=y*Math.cos(M)+b*Math.sin(M),S=p*Math.cos(M)+g*Math.sin(M),T=f(h,m,C,S,1,v);l[c++]=w,l[c++]=x,l[c++]=T,x=T;}};for(let h of i){let m=lf(h),y=m.length/2;if(y<2)continue;let p=new Float64Array(y-1),b=new Float64Array(y-1);for(let _=0;_<y-1;_++){let M=m[_*2+2]-m[_*2],C=m[_*2+3]-m[_*2+1],S=Math.hypot(M,C)||1;p[_]=M/S,b[_]=C/S;}let g=0,v=-1,w=-1;for(let _=0;_<y;_++){let M=m[_*2],C=m[_*2+1];_>0&&(g+=Math.hypot(M-m[_*2-2],C-m[_*2-1]));let S=_>0?_-1:0,T=_<y-1?_:y-2,A=-b[S],k=p[S],L=-b[T],R=p[T],I=A+L,E=k+R,H=Math.hypot(I,E);H>1e-9?(I/=H,E/=H):(I=A,E=k);let W=I*L+E*R,F=W>1e-6?1/W:1/0,P=Math.acos(Math.min(1,Math.max(-1,p[S]*p[T]+b[S]*b[T])));if(!(P>af*Math.PI/180)&&F<=nf){let O=f(M,C,I*F,E*F,1,g),B=f(M,C,-I*F,-E*F,-1,g);v>=0&&u(v,w,O,B),v=O,w=B;}else {let O=Math.max(1,Math.min(zo,Math.ceil(P/(Math.PI/zo)))),V=p[S]*b[T]-b[S]*p[T]>=0?1:-1,j=f(M,C,A,k,1,g),X=f(M,C,-A,-k,-1,g);v>=0&&u(v,w,j,X);for(let q=1;q<=O;q++){let Q=V*P*(q/O),Z=Math.cos(Q),U=Math.sin(Q),ne=A*Z-k*U,ie=A*U+k*Z,J=f(M,C,ne,ie,1,g),K=f(M,C,-ne,-ie,-1,g);u(j,X,J,K),j=J,X=K;}v=j,w=X;}}let x=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[x],p[x],p[x],b[x],g);}return c?{vertices:n.slice(0,s*yt),indices:l.slice(0,c),vertexCount:s}:null}function Xr(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=mi__default.default(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 lf(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 Dt=5126,sf={stride:jr,attribs:[{name:"a_pos",size:2,type:Dt,offset:0}]},Yr={stride:yt,attribs:[{name:"a_pos",size:2,type:Dt,offset:0},{name:"a_extrude",size:2,type:Dt,offset:8},{name:"a_side",size:1,type:Dt,offset:16},{name:"a_dist",size:1,type:Dt,offset:20}]},Kr=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();}},cf=(i,e)=>[i[0],i[1],i[2],i[3]*e],Nt=class{constructor(){this.objects=[];this.markers=[];this.gpu=new z;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:w,ibo:x}of p.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let _=c?cf(v.color,y):v.color;if(v.kind==="fill")h!==o&&(o.use(),l?.(o),h=o),o.setVec4v("u_color",Ce(_)),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,C=d>1e-9?1/d:1;if(n.setVec4v("u_color",Ce(_)),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",C),n.setFloat("u_units_to_px",d),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[S,T]=v.dashArray;n.setVec2("u_dash",S*u,(S+T)*u);}if(v.arrow){n.setVec4v("u_arrow_color",Ce(v.arrowColor??[1,1,1,1]));let S=(v.arrowSize??5)*u;n.setVec3("u_arrow",(v.arrowPeriod??46)*u,Math.max(S*.4,1),Math.min(S,M*.72));}b&&n.setMat4("u_shadow_matrix",b),n.setMat4("u_matrix",g);}w.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,x.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=(a,l,s)=>e.worldPxToPoint(le(a)*r,se(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=te(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"?sf:Yr,f=s.kind==="fill"?o:r,u=new pe(e,new Uint8Array(s.mesh.vertices),c),d=new ue(e,s.mesh.indices),h=new fe(e,[{buffer:u,locations:f}],d);a.push({part:s,vao:h,vbo:u,ibo:d});}let l=new Kr(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 Ho=32,ff=1179937895,uf=1313821514,df=5130562,hf={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},mf={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function $r(i){let{json:e,bin:t}=Za(i),o=await bf(e,t);return Ja(e,t,o)}function pf(i){let{json:e,bin:t}=Za(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 Ja(e,t,null)}function Za(i){let e=new DataView(i);if(e.getUint32(0,true)!==ff)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===uf?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,l,n))):a===df&&(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 bf(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 Qa(i){let e=G();if(i.matrix){for(let C=0;C<16;C++)e[C]=i.matrix[C];return e}We(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,w=l*m,x=s*d,_=s*h,M=s*m;return e[0]=(1-(g+w))*c,e[1]=(p+M)*c,e[2]=(b-_)*c,e[4]=(p-M)*f,e[5]=(1-(y+w))*f,e[6]=(v+x)*f,e[8]=(b+_)*u,e[9]=(v-x)*u,e[10]=(1-(y+g))*u,e[12]=t,e[13]=o,e[14]=r,e}var yf={5120:127,5121:255,5122:32767,5123:65535};function gf(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 Ja(i,e,t){let o=C=>{let S=t?.get(C);if(S)return S;let T=i.bufferViews?.[C];if(!T)return null;let A=T.byteOffset??0;return e.subarray(A,A+T.byteLength)},r=[],n=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],u=C=>{if(C===void 0)return null;let S=i.accessors?.[C];if(!S)return null;let T=mf[S.type]??1,A=new Float64Array(S.count*T),k=S.bufferView!==void 0?i.bufferViews?.[S.bufferView]:void 0;if(!k||S.bufferView===void 0)return {data:A,components:T};let L=o(S.bufferView);if(!L)return {data:A,components:T};let R=hf[S.componentType]??4,I=k.extensions?.EXT_meshopt_compression,E=I?I.byteStride:k.byteStride,H=E&&E>0?E:R*T,W=S.byteOffset??0,F=new DataView(L.buffer,L.byteOffset,L.byteLength),P=S.normalized?yf[S.componentType]??1:1;for(let N=0;N<S.count;N++)for(let O=0;O<T;O++){let B=W+N*H+O*R,V;switch(S.componentType){case 5120:V=F.getInt8(B);break;case 5121:V=F.getUint8(B);break;case 5122:V=F.getInt16(B,true);break;case 5123:V=F.getUint16(B,true);break;case 5125:V=F.getUint32(B,true);break;default:V=F.getFloat32(B,true);}A[N*T+O]=P===1?V:Math.max(V/P,-1);}return {data:A,components:T}},d=(C,S,T=-1)=>{if(C.mode!==void 0&&C.mode!==4)return;let A=u(C.attributes.POSITION);if(!A)return;let k=u(C.attributes.NORMAL),L=u(C.attributes.TEXCOORD_0),R=u(C.indices),I=r.length/3,E=A.data.length/3,H=gf(S),F=(C.material!==void 0?i.materials?.[C.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,P=F?{ox:F.offset?.[0]??0,oy:F.offset?.[1]??0,sx:F.scale?.[0]??1,sy:F.scale?.[1]??1,rot:F.rotation??0}:null;for(let U=0;U<E;U++){let ne=A.data[U*3],ie=A.data[U*3+1],J=A.data[U*3+2],K=S[0]*ne+S[4]*ie+S[8]*J+S[12],Y=S[1]*ne+S[5]*ie+S[9]*J+S[13],oe=S[2]*ne+S[6]*ie+S[10]*J+S[14];if(r.push(K,Y,oe),K<c[0]&&(c[0]=K),Y<c[1]&&(c[1]=Y),oe<c[2]&&(c[2]=oe),K>f[0]&&(f[0]=K),Y>f[1]&&(f[1]=Y),oe>f[2]&&(f[2]=oe),k){let ae=k.data[U*3],me=k.data[U*3+1],we=k.data[U*3+2],ge=H[0]*ae+H[3]*me+H[6]*we,Qe=H[1]*ae+H[4]*me+H[7]*we,at=H[2]*ae+H[5]*me+H[8]*we,so=Math.hypot(ge,Qe,at);so>1e-12?(ge/=so,Qe/=so,at/=so):(ge=0,Qe=1,at=0),n.push(ge,Qe,at);}else n.push(0,1,0);let re=L?L.data[U*2]:0,ce=L?L.data[U*2+1]:0;if(P){if(P.rot!==0){let ae=Math.cos(P.rot),me=Math.sin(P.rot),we=ae*re+me*ce,ge=-me*re+ae*ce;re=we,ce=ge;}re=re*P.sx+P.ox,ce=ce*P.sy+P.oy;}a.push(re,ce);}let N=l.length;if(R)for(let U=0;U<R.data.length;U++)l.push(I+R.data[U]);else for(let U=0;U<E;U++)l.push(I+U);let O=C.material!==void 0?i.materials?.[C.material]:void 0,B=O?.pbrMetallicRoughness,V=B?.metallicFactor!==void 0||B?.roughnessFactor!==void 0,j=B?.baseColorFactor??[1,1,1,1],X=B?.baseColorTexture?.index,q=X!==void 0?i.textures?.[X]?.source:void 0,Q=O?.emissiveFactor??[0,0,0],Z=O?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:N,indexCount:l.length-N,baseColor:[j[0],j[1],j[2],j[3]??1],metallic:V?B?.metallicFactor??1:0,roughness:V?B?.roughnessFactor??1:1,emissive:[Q[0]*Z,Q[1]*Z,Q[2]*Z],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:vf(i,u),m=h?h.nodes:null,y=(C,S,T,A)=>{let k=i.nodes?.[C];if(!k)return;let L=Qa(k),R=G();_e(R,S,L);let I=G(),E=A,H=m?.get(C);if(H?(H.parentNode=A,H.parent=T.slice(),We(I),E=C):_e(I,T,L),k.mesh!==void 0)for(let F of i.meshes?.[k.mesh]?.primitives??[])d(F,I,E);let W=k.extensions?.KHR_lights_punctual?.light;if(W!==void 0){let F=i.extensions?.KHR_lights_punctual?.lights?.[W],P=F?.type;if(F&&(P==="point"||P==="spot"||P==="directional")){let N=-R[8],O=-R[9],B=-R[10],V=Math.hypot(N,O,B)||1,j=F.spot?.innerConeAngle??0,X=F.spot?.outerConeAngle??Math.PI/4;p.push({type:P,color:[F.color?.[0]??1,F.color?.[1]??1,F.color?.[2]??1],intensity:F.intensity??1,range:F.range??0,position:[R[12],R[13],R[14]],direction:[N/V,O/V,B/V],cosInner:Math.cos(j),cosOuter:Math.cos(X)});}}for(let F of k.children??[])y(F,R,I,E);},p=[],b=G();We(b);let g=G();We(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((C,S)=>S)??[];for(let C of v)y(C,b,g,-1);let w=[];for(let C of i.images??[]){if(C.bufferView===void 0){w.push(new Uint8Array(0));continue}let S=o(C.bufferView);w.push(S?S.slice():new Uint8Array(0));}let x=r.length/3,_=new ArrayBuffer(x*Ho),M=new Float32Array(_);for(let C=0;C<x;C++){let S=C*8;M[S]=r[C*3],M[S+1]=r[C*3+1],M[S+2]=r[C*3+2],M[S+3]=n[C*3],M[S+4]=n[C*3+1],M[S+5]=n[C*3+2],M[S+6]=a[C*2],M[S+7]=a[C*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,f[0]=f[1]=f[2]=0),{vertices:_,indices:new Uint32Array(l),primitives:s,images:w,min:c,max:f,animation:h,lights:p}}function vf(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:We(G()),base:wf(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 wf(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 qr(i,e,t,o){let r=i.nodes.get(e);if(!r)return We(o);let n=G();xf(r,t,n);let a=G();if(_e(a,r.parent,n),r.parentNode<0)return el(o,a);let l=G();return qr(i,r.parentNode,t,l),_e(o,l,a)}var el=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function xf(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 el(t,Qa({translation:o,rotation:r,scale:n}))}var Ee=5126,_f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),tl={stride:Ho,attribs:[{name:"a_pos",size:3,type:Ee,offset:0},{name:"a_normal",size:3,type:Ee,offset:12},{name:"a_tex",size:2,type:Ee,offset:24}]},Qr=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);}},Zr=256,Oo=41,ol={stride:Oo*4,attribs:[{name:"a_i_m0",size:4,type:Ee,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Ee,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Ee,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Ee,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Ee,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Ee,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Ee,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Ee,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Ee,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Ee,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Ee,offset:152,divisor:1}]},Gt=2,gt=16,$e=class{constructor(){this.models=[];this.gpu=new z;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Zr*Oo);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",Gt);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(Gt,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 z;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 pe(e,this.instScratch,ol,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",Gt),o.setFloat("u_opacity",1),s=true);let u=c[0].mesh;for(let d=0;d<c.length;d+=Zr){let h=Math.min(Zr,c.length-d);for(let m=0;m<h;m++){let y=c[d+m],p=m*Oo;this.instScratch.set(y.matrixFor(t),p);let b=a?this.shadowMatrix(t,y):_f;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*Oo)),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(Gt,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<=gt?r:[...r].sort((f,u)=>u.intensity-f.intensity).slice(0,gt),a=new Float32Array(gt*4),l=new Float32Array(gt*4),s=new Float32Array(gt*4),c=new Float32Array(gt*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 pe(e,new Uint8Array(t.mesh.vertices),tl),l=new ue(e,t.mesh.indices),s=new fe(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(u=>{if(!u)return null;let d=n.createTexture();return d?(e.bindTexture(Gt,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 Qr(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return tl}static get instanceLayout(){return ol}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Jr=4,rl=new ee;function Cf(i){rl.has(i)||(rl.add(i),console.warn(`[osmgl] ${i}`));}var Sf=.5,Mf=.01,Tf=300,en=127,kf=.5,vt=128,Ut=5120,Bo=5121,jt=5122,nl=5123,Xt=5126,Ef={stride:8,attribs:[{name:"a_pos",size:2,type:Xt,offset:0}]},tn={stride:Xe,attribs:[{name:"a_pos",size:2,type:jt,offset:0}]},il={stride:Ke,attribs:[{name:"a_p0",size:2,type:jt,offset:0},{name:"a_p1",size:2,type:jt,offset:4},{name:"a_corner",size:2,type:Ut,offset:8},{name:"a_ground",size:2,type:Ut,offset:10},{name:"a_dist",size:1,type:Xt,offset:12},{name:"a_width",size:1,type:Xt,offset:16}]},wt={stride:ke,attribs:[{name:"a_pos",size:2,type:jt,offset:0},{name:"a_height",size:1,type:nl,offset:4},{name:"a_tint",size:1,type:Bo,normalized:true,offset:6},{name:"a_ao",size:1,type:Bo,normalized:true,offset:7},{name:"a_normal",size:3,type:Ut,normalized:true,offset:8},{name:"a_kind",size:1,type:Bo,offset:11},{name:"a_wall",size:3,type:nl,offset:12}]},Af={flat:0,water:1,foliage:2,sand:3,asphalt:4},If=[1,9,14,26,3],al={stride:dt,attribs:[{name:"a_pos",size:2,type:Xt,offset:0},{name:"a_level",size:1,type:jt,offset:8},{name:"a_normal",size:3,type:Ut,normalized:true,offset:10},{name:"a_kind",size:1,type:Bo,offset:13},{name:"a_bleed",size:2,type:Ut,offset:14}]},Wo=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();}},ll={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Kt=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new z;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new Ro;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new z;this.lineLocs=new z;this.objectLine=null;this.objectLineLocs=new z;this.buildingLocs=new z;this.shadows={...ll};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new z;this.patternScale=1;this.debugTiles=false;this.cameraMeters=[0,0,0];this.dpr=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new z;this.highlightKey="";this.groundArrows=new Bt;this.highlightTris=new z;this.fillHighlightGpu=new z;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Wt;this.hiddenBuildings=new Set;this.seams=new ko;this.seamGpu=new z;this.hiddenWithSeams=new z;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new z;this.hiddenStamp="";this.bucketIdCache=new z;this.surfaceCut=new z;this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new $e;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new z;this.modelInstLocs=new z;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=r=>[...r].sort((n,a)=>n-a).join(","),t="";for(let[r,n]of this.seams.hiddenByTile)t+=`${r}=${e(n)};`;let o=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues)+"#"+t;if(o!==this.hiddenStamp){this.hiddenStamp=o,this.hiddenWithSeams.clear();for(let[r,n]of this.seams.hiddenByTile){let a=new Set(this.hiddenBuildings);for(let l of n)a.add(l);this.hiddenWithSeams.set(r,a);}for(let r of this.hiddenCut.values())r?.vao.destroy(),r?.ibo.destroy();this.hiddenCut.clear();for(let r of this.surfaceCut.values())r?.vao.destroy(),r?.ibo.destroy();this.surfaceCut.clear();}}cutSurface(e,t,o,r,n,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.surfaceCut.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!=="surface"||!c.shapeFeatures||!c.shapeRanges)return null;let f=new Float64Array(c.shapeFeatures),u=new Uint32Array(c.shapeRanges),d=[],h=0;for(let x=0;x<f.length;h++){let _=f[x++],M=_>0;for(let C=0;C<_;C++)if(!a.has(f[x+C])){M=false;break}x+=_,M&&d.push(h);}if(!d.length)return this.surfaceCut.set(l,null),null;let m=new Uint32Array(c.indices),y=c.capIndexOffset??m.length,p=new Uint8Array(m.length);for(let x of d){for(let _=u[x*4];_<u[x*4+1];_++)p[_]=1;for(let _=u[x*4+2];_<u[x*4+3];_++)p[_]=1;}let b=[];for(let x=0;x<y;x++)p[x]||b.push(m[x]);let g=b.length;for(let x=y;x<m.length;x++)p[x]||b.push(m[x]);let v=new ue(e,new Uint32Array(b)),w={vao:new fe(e,[{buffer:n,locations:this.surfaceLocs}],v),ibo:v,vbo:n,mainCount:g,capCount:b.length-g};return this.surfaceCut.set(l,w),w}bucketIds(e,t,o){let r=this.bucketIdCache.get(e);if(r&&r.vbo===o)return r.ids;this.bucketIdCache.size>2e3&&this.bucketIdCache.clear();let n=new Set(new Float64Array(t));return this.bucketIdCache.set(e,{ids:n,vbo:o}),n}replacedIds(){return this.hiddenBuildings.size?this.hiddenBuildings:null}hiddenFor(e,t,o){return t?(o?this.hiddenWithSeams.get(o):void 0)??this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a,l=this.buildingLocs){if(!a||!a.size)return null;let s=r+"|"+o,c=this.hiddenCut.get(s);if(c!==void 0&&(c===null||c.vbo===n))return c;c&&(c.vao.destroy(),c.ibo.destroy());let f=t.data?.buckets?.[o];if(!f||!("featureIds"in f)||!f.featureIds)return null;let u=this.bucketIds(s,f.featureIds,n),d=false;for(let b of a)if(u.has(b)){d=true;break}if(!d)return this.hiddenCut.set(s,null),null;let h=new Uint32Array(f.indices),m=new Float64Array(f.featureIds),y=[];for(let b=0;b*3<h.length;b++)a.has(m[b])||y.push(h[b*3],h[b*3+1],h[b*3+2]);let p=null;if(y.length<h.length){let b=new ue(e,new Uint32Array(y));p={vao:new fe(e,[{buffer:n,locations:l}],b),ibo:b,count:y.length,vbo:n};}return this.hiddenCut.set(s,p),p}init(e){this.symbols?.init(e),this.fill=new be(e,"fill",Ra,Fa),this.surface=new be(e,"surface",Va,Da),this.line=new be(e,"line",za,Pa),this.objectLine=new be(e,"objectLine",Ha,Oa),this.building=new be(e,"buildings",Ba,Wa),this.depth=new be(e,"depth",xa,Fr),this.groundShadow=new be(e,"groundShadow",Ia,La),this.sky=new be(e,"sky",Ta,ka),this.raster=new be(e,"raster",Ea,Aa),this.globeBody=new be(e,"globeBody",ya,ga),this.globeClip=new be(e,"globeClip",va,wa),this.globeMesh=Lf(e,this.globeBody),this.model=new be(e,"model",Ca,Pr),this.modelInstanced=new be(e,"model-instanced",Sa,Pr),this.modelDepth=new be(e,"modelDepth",Ma,Fr);for(let n of $e.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...$e.layout.attribs,...$e.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=pa(e);let t=new z([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new pe(e,new Float32Array([0,0,1,0,1,1,0,1]),Ef),r=new ue(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 tn.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of al.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of il.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of Yr.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of wt.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));}render(e,t,o,r,n,a=new z){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=n/1e3,this.materialAnimating=false,this.fog=bt(t,r),this.patternScale=uo/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??$);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"&&D(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"&&D(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,D(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(Jr,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 Ht(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(xt(l.keyAzimuth,l.keyAltitude),Tf),!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??$);if(!d)continue;let h=r.bucketKeyFor(u);if(h===null)continue;let m=D(u.paint.heightScale,t.zoom,1);(u.source??$)===$&&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,wt,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??$)===$,v=this.cutHidden(e,p,h,y.dataKey,b.buffer,this.hiddenFor(h,g,y.dataKey)),w=g?v??this.indoorMask.indicesFor(e,p,h,y,b.buffer,this.buildingLocs):v;w?(w.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,w.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(Jr),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(he(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(Ie(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),Rf(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=xt(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=xt(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??bt(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,D(n.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(Sf/Math.max(t.pixelsPerMeter,1e-9),Mf);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,en);}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($);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>en)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,en),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($);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($);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=xt(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=de(l.ambientColor),u=de(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",Jr),!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=de(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);}}}tileTint(e){let o=((e.x%3+3)%3*2+(e.y%2+2)%2)/6,r=n=>{let a=(n+o*6)%6;return 1-Math.max(0,Math.min(1,Math.min(a,4-a)))};return [r(5),r(3),r(1)]}applyTileScale(e,t,o){if(this.debugTiles){let[s,c,f]=this.tileTint(t);e.setVec4("u_tile_tint",s,c,f,kf);}else e.setVec4("u_tile_tint",0,0,0,0);let r=mo(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=Bn(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:Af[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,If[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,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",Ce([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,tn,this.fillLocs,"fill");if(!h)continue;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);let m=this.cutHidden(e,d,f,u.dataKey,h.buffer,this.replacedIds(),this.fillLocs);m?(m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.count,e.gl.UNSIGNED_INT,0)):(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=D(n.paint.opacity,a,1)*(l||1),d=D(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",Ce([f[0],f[1],f[2],f[3]*u])),c.setFloat("u_center_w",t.cameraToCenterDistance);let b=D(n.paint.offset,a,0)*y,g=Math.max(D(n.paint.blur,a,0),0)*y;c.setFloat("u_elevation",D(n.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",h,m);let v=n.paint.dashArray,w=n.paint.arrow===true,x=n.paint.arrowStyle,_=w&&(x==="head"||x==="headOnly"),M=w&&x==="dash";if(c.setInt("u_pattern",M?5:v?1:x==="headOnly"&&w?4:_?3:w?2:0),v){let[S,T]=v;c.setVec2("u_dash",S*y,(S+T)*y);}if(w){let S=Ae(n.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",Ce(S));let T=D(n.paint.arrowPeriod,a,46)*y,A=D(n.paint.arrowSize,a,5)*y;if(M){let k=D(n.paint.arrowGap,a,24)*y,L=Math.max(T-k,1),R=Math.min(A,L),I=D(n.paint.arrowShaft,a,2)*y,E=D(n.paint.arrowHead,a,4)*y,H=D(n.paint.arrowOutline,a,0)*y;c.setVec4("u_arrow",I,R,E,L),c.setVec2("u_dash",H,T);}else _?c.setVec4("u_arrow",T,A,p,0):c.setVec4("u_arrow",T,Math.max(A*.4,1),Math.min(A,p*.72),0);}let C=r.bucketKeyFor(n);if(C!==null)for(let S of o.visibleTiles){if(!this.drawsTile(t,r,n,S))continue;let T=o.getTile(S);if(!T)continue;let A=n.network?s!==void 0?[Oe(n.id,s)]:(T.data?.levels??[]).map(k=>Oe(n.id,k)):[C];for(let k of A){let L=this.bucketFor(e,T,k,il,this.lineLocs,"line");if(!L)continue;let R=S.bounds(),I=(R.maxX-R.minX)*t.worldSize/L.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",D(n.paint.widthExtra,a,0)*E),c.setFloat("u_offset",b*E),c.setFloat("u_tile_per_px",E),this.applyTileScale(c,S,L.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(S,L.extent)),this.applyTileMatrix(c,t,S,L.extent);let H=this.cutHidden(e,T,k,S.dataKey,L.buffer,this.replacedIds(),this.lineLocs);H?(H.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,H.count,e.gl.UNSIGNED_INT,0)):(L.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,L.indexCount,L.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=de(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");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,vt,vt),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(vt);let d=this.seams.stitched.has(l.featureId);d&&this.drawSeamHighlight(e,t,f,l.featureId);for(let h of d?[]:o.visibleTiles){let m=o.getTile(h);if(!m)continue;let y=m.data?.buckets?.[n.id];if(!y)continue;let p=h.dataKey,b=this.highlightGpu.get(p);if(b===void 0){let g=Fo(m,n.id,l.featureId);if(g){let v=new pe(e,new Uint8Array(g.vertices),wt),w=new ue(e,g.indices);b={vao:new fe(e,[{buffer:v,locations:this.buildingLocs}],w),vbo:v,ibo:w,count:g.indices.length};}else b=null;this.highlightGpu.set(p,b);}b&&(this.applyTileScale(f,h,y.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,y.extent)),f.setMat4("u_matrix",t.tileMatrix(h,y.extent)),b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),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??$);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=Fo(c,o.layerId,o.featureId);u&&this.highlightTris.set(s.dataKey,Br(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??$):void 0;if(!l||!s)return;let c=n.bucketKey,f=de(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",Ce([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,vt,vt),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(vt);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 pe(e,new Uint8Array(t.vertices),tn),h=new ue(e,new Uint32Array(f));u={vao:new fe(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=D(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",D(n.paint.sideShade,a,.12));let f=n.elevation<(n.base??0),u=n.paint.sideColor?Ae(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 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,al,this.surfaceLocs,"surface");v&&m.push({id:b,bucket:v,cut:g?this.cutSurface(e,g,d,b.dataKey,v.buffer,this.replacedIds()):null});}let y=(b,g,v)=>{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),(v??g).vao.bind();},p=m.filter(({bucket:b,cut:g})=>g?g.capCount>0:b.capIndexOffset<b.indexCount);if(p.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g,cut:v}of p){y(b,g,v);let w=v?e.gl.UNSIGNED_INT:g.indexType,x=w===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,v?v.capCount:g.indexCount-g.capIndexOffset,w,(v?v.mainCount:g.capIndexOffset)*x);}e.setColorMask(true),e.setDepthMask(h);}for(let{id:b,bucket:g,cut:v}of m)y(b,g,v),e.gl.drawElements(e.gl.TRIANGLES,v?v.mainCount:g.capIndexOffset,v?e.gl.UNSIGNED_INT: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 d=(w,x)=>n.paint[w]?r.colorAt({...n,paint:{...n.paint,color:n.paint[w]}},a,x):x,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",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_window_variation",D(n.paint.windowVariation,a,1)),s.setFloat("u_seam_strength",D(n.paint.seamStrength,a,1)),s.setFloat("u_window_recess",D(n.paint.windowRecess,a,.18)),s.setFloat("u_window_recess_shade",D(n.paint.windowRecessShade,a,.16)),s.setFloat("u_plinth_height",D(n.paint.plinthHeight,a,4)),s.setFloat("u_plinth_shade",D(n.paint.plinthShade,a,.14)),s.setFloat("u_roof_variation",D(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let y=u>=1;e.setDepthMask(y),e.setBlend(y?"none":"premultiplied");let p=D(n.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(n);if(g===null)return b;let v=(n.source??$)===$;if(v&&this.indoorMask.prepare(o,g),v&&o.visibleTiles.length){let w=o.visibleTiles[0].z;this.seams.update(o,g,{zoom:w,metersPerTile:mo(w),cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments})&&this.syncSeamGpu();}for(let w of o.visibleTiles){if(!this.drawsTile(t,r,n,w))continue;let x=o.getTile(w),_=x&&this.bucketFor(e,x,g,wt,this.buildingLocs,"fill-extrusion");if(!_)continue;let M=this.growScale(_,l,!o.warm);M<1&&(b=true),s.setFloat("u_height_scale",M*p),this.applyTileScale(s,w,_.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(w,_.extent)),s.setMat4("u_matrix",t.tileMatrix(w,_.extent));let S=this.cutHidden(e,x,g,w.dataKey,_.buffer,this.hiddenFor(g,v,w.dataKey))??(x&&v?this.indoorMask.indicesFor(e,x,g,w,_.buffer,this.buildingLocs):null);S?(S.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,S.count,e.gl.UNSIGNED_INT,0)):(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.indexCount,_.indexType,0));}return v&&this.drawSeams(e,t,s,p),b}drawSeamHighlight(e,t,o,r){for(let[n,{tile:a,mesh:l}]of this.seams.meshes){let s=`${n}\u241F${r}`,c=this.highlightGpu.get(s);if(c===void 0){let f=Ur(l,r);if(f){let u=new pe(e,new Uint8Array(f.vertices),wt),d=new ue(e,f.indices);c={vao:new fe(e,[{buffer:u,locations:this.buildingLocs}],d),vbo:u,ibo:d,count:f.indices.length};}else c=null;this.highlightGpu.set(s,c);}c&&(this.applyTileScale(o,a,l.extent),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,l.extent)),o.setMat4("u_matrix",t.tileMatrix(a,l.extent)),c.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,c.count,e.gl.UNSIGNED_INT,0));}}drawSeams(e,t,o,r){for(let[n,{tile:a,mesh:l}]of this.seams.meshes){let s=this.seamGpu.get(n);if(!s){let c=new pe(e,new Uint8Array(l.vertices),wt),f=new ue(e,new Uint32Array(l.indices)),u=new fe(e,[{buffer:c,locations:this.buildingLocs}],f);s=new Wo(u,c,f,l.indexCount,e.gl.UNSIGNED_INT,l.extent),this.seamGpu.set(n,s);}o.setFloat("u_height_scale",r),this.applyTileScale(o,a,l.extent),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,l.extent)),o.setMat4("u_matrix",t.tileMatrix(a,l.extent)),s.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,l.indexCount,e.gl.UNSIGNED_INT,0);}}syncSeamGpu(){for(let e of this.seams.changed){let t=this.seamGpu.get(e);t&&(t.destroy(),this.seamGpu.delete(e));for(let o of [...this.highlightGpu.keys()]){if(!o.startsWith(e+"\u241F"))continue;let r=this.highlightGpu.get(o);r&&(r.vao.destroy(),r.vbo.destroy(),r.ibo.destroy()),this.highlightGpu.delete(o);}}}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?Ff(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]=xt(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]=xt(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 Cf(`\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 pe(e,new Uint8Array(s.vertices),r),f=new ue(e,new Uint32Array(s.indices)),u=new fe(e,[{buffer:c,locations:n}],f),d=new Wo(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;}},Vo=new z;function Lf(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:Xt,offset:0}]},c=new z([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new pe(i,r,s),u=new ue(i,a);return {vao:new fe(i,[{buffer:f,locations:c}],u),vbo:f,ibo:u,count:a.length}}function Rf(i,e){if(e.highColor){Fe(i,"u_high_color",e.highColor);return}let t=Vo.get(e.skyColor);t||(t=de(e.skyColor),Vo.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=Vo.get(t);o||(o=de(t),Vo.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function xt(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 Ff(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var Do=1,Yt=class{constructor(e=1024){this.entries=new z;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+Do>this.size&&(this.shelfY+=this.shelfHeight+Do,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Do>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+Do,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 on=.75,qt=8,ve=3,Ge=24,_t=256,sl=255,$t=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new z;this.loaded=new ee;this.inflight=new z;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/_t))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/_t);if(r<=sl&&!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/_t);n>sl||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*_t}-${e*_t+_t-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 cl(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 cl(i){let e=new es__default.default(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 Pf=.25,Ct=1e20;function rn(i,e,t){let o=e+ve*2,r=t+ve*2,n=o*r,a=new Float64Array(n),l=new Float64Array(n);a.fill(Ct),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+ve)*o+(f+ve);if(u>=1)a[d]=0,l[d]=Ct;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]=Ct,l[d]=0;}fl(a,o,r),fl(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]=Hf(Math.round(255-255*(f/qt+Pf)));}return {data:s,width:o,height:r}}function fl(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];ul(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];ul(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function ul(i,e,t,o,r){t[0]=0,o[0]=-Ct,o[1]=Ct;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]=Ct;}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 Hf=i=>i<0?0:i>255?255:i;var dl=48,Zt=class{constructor(e={}){this.defs=e;this.sdfs=new z;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(dl*(n>1?n:1))),l=Math.max(8,Math.round(dl/(n<1?n:1))),s=await Of(o,a,l);return this.sdfs.set(e,rn(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 Of(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 nt={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>'},Bf={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(Bf)){let t=nt[e];t?nt[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 Wf=1.2;function nn(i,e,t=16,o=0){let r=Vf(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=Ge*Wf,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 Vf(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 an(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=Df(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 Df(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 Nf=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function sn(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=Xf(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 Gf(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,w=ln(i,r,e,t,v,c,a,f);w&&u.push({glyphs:w,path:w.map(x=>({x:x.x,y:x.y})),at:v});}if(u.length)return u}let m=(n-t)/2;for(let y of Nf){let p=m+m*y,b=ln(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 Gf(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=ln(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 ln(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!Uf(i,e,r,r+o,n,a))return null;let s=Qt(i,e,r),c=Qt(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return hl(i,e,t,r,l);let f=e[e.length-1];return hl([...i].reverse(),Kf(e),t,f-(r+o),l)}function Uf(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 hl(i,e,t,o,r){let n=[];for(let c of t){let f=ml(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(jf(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=ml(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function ml(i,e,t,o){let r=Qt(i,e,t+o/2);if(!r)return null;let n=Qt(i,e,t),a=Qt(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 jf(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function Xf(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 Kf(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function Qt(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 fn=20,pl={stride:fn,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}]},Yf=220,qe=64,bl=2,$f=1.22,qf=128,Zf=.7;function Qf(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return D(o,e,0)*Ge;let r=D(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*Zf/(t/Ge)}var Jf=256,eu=200,cn="frame-circle",St=class i{constructor(e,t){this.shader=null;this.locations=new z;this.atlas=new Yt(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 z;this.fading=false;this.styleOrder=new z;this.glyphs=new $t(e,t),this.icons=new Zt(nt);}init(e){this.shader=new be(e,"symbol",Na,Ga);for(let t of pl.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)/Yf;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}))?eu: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 z,f=new z,u=new z;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=bt(e,o).far,[c,f,u]=e.cameraPositionPx;for(let d of r){let h=(d.layout?.priority??0)*Jf,m=t.get(d.source??$);if(!m)continue;let y=d.layout?.showFor==="highlight",p=d.layout?.placement==="map",{shift:b,drop:g}=p?wl(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,w=o.bucketKeyFor(d);if(w!==null)for(let x of m.visibleTiles){if(!o.layerVisibleAt(d,e.detailZoom(e.distanceToTile(x))))continue;let M=m.getTile(x)?.data?.buckets?.[w];if(!M||!Lo(M))continue;let C=new Int16Array(M.anchors),S=new Uint8Array(M.priorities),T=M.rotations?new Int16Array(M.rotations):null,A=M.lines?new Int16Array(M.lines):null,k=M.lineStarts?new Uint32Array(M.lineStarts):null,L=x.bounds(),R=e.worldSize,I=(L.maxX-L.minX)*R/M.extent,E=L.minX*R,H=L.minY*R;for(let W=0;W<S.length;W++){let F=E+C[W*2]*I,P=H+C[W*2+1]*I;if(s!==1/0&&Math.hypot(F-c,P-f,u)>s||y&&!Ne(this.highlightFootprint,F/R,P/R,v))continue;let N=F,O=P;if(p&&T){let X=T[W]*Math.PI/180,q=b;N-=Math.sin(X)*q,O+=Math.cos(X)*q;}let B=e.worldPxToPoint(N,O),V=A&&k?tu(e,A,k,W,E,H,I):void 0;if(d.layout?.textPlacement==="line"){if(!V)continue}else if(!B||B.x<l.left-64||B.y<l.top-64||B.x>e.width-l.right+64||B.y>e.height-l.bottom+64)continue;n.push({layer:d,screenX:B?B.x:V[0].x,screenY:(B?B.y:V[0].y)+g,text:M.texts[W]??"",icon:M.icons[W]??"",priority:S[W]+h,rotate:xl(d,T,W,e.bearing),mercX:F/R,mercY:P/R,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,d]=r.offset??[0,0],h=r.placement==="map",m=null;if(e.icon&&!h){this.icons.isDefined(e.icon)||(e.icon="dot");let J=`icon:${e.icon}`,K=this.atlas.get(J);if(!K){let Y=this.icons.get(e.icon);Y?K=this.atlas.add(J,Y.data,Y.width,Y.height)??void 0:this.pendingIcons.add(e.icon);}K&&(m=K);}let y=null;if(m&&r.iconFrame==="circle"){let J=`icon:${cn}`,K=this.atlas.get(J);if(!K){let Y=this.icons.get(cn);Y?K=this.atlas.add(J,Y.data,Y.width,Y.height)??void 0:this.pendingIcons.add(cn);}K&&(y=K);}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=nn(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,Qf(e.layer,t,s)),!b&&!m)||!b&&!m)return null;let g=s/Ge,v=b?b.width*g:0,w=b?b.height*g:0;if(e.layer.layout?.textPlacement==="line")return b&&e.line?this.placeOnLine(e,b,g,w,o,t,a):null;let x=r.iconPlacement??"top",_=x==="behind"&&!!m&&!!b,M=x==="top"&&!!m&&!!b,C=m?m.width/Math.max(m.height,1):1,S=_?w+f*2:c,T=m?S*C:0,A=Math.max(T,m?c*p:0),k=Math.max(S,m?c*p:0),L=_?Math.max(T,v+f*2):M?Math.max(A,v):A+(m&&b?f:0)+v,R=_?Math.max(S,w):M?k+f+w:Math.max(m?k:0,w),I=e.screenX+u,E=e.screenY+d,H=bl+(r.collisionPadding??0),W={x1:I-L/2-H,y1:E-R/2-H,x2:I+L/2+H,y2:E+R/2+H},F=this.padding;if(W.x1<F.left||W.y1<F.top||W.x2>this.viewport.width-F.right||W.y2>this.viewport.height-F.bottom)return null;if(!r.allowOverlap){if(yl(o,W))return null;gl(o,W);}let P=[],N=[],O=[],B=[],V=[],j=[],X=0,q=I-L/2,Q=M?(k+f)/2:0,Z=1/0,U=1/0,ne=-1/0,ie=-1/0;if(b){let J=M||_?I:q+(m?A+f:0)+v/2;for(let K of b.glyphs){let Y=K.glyph,oe=`g:${Y.id}`,re=this.atlas.get(oe);if(!re&&(!Y.bitmap||(re=this.atlas.add(oe,Y.bitmap,Y.width+ve*2,Y.height+ve*2)??void 0,!re)))continue;let ce=J+(K.x+Y.left-ve)*g,ae=E+Q+(K.y-Y.top-ve)*g,me=re.width*g,we=re.height*g;No(P,N,ce,ae,me,we,re,0,a),X++;let ge=ve*g;Z=Math.min(Z,ce+ge),U=Math.min(U,ae+ge),ne=Math.max(ne,ce+me-ge),ie=Math.max(ie,ae+we-ge);}if(M&&m&&U<1/0){let K=E-R/2+k+f-U;if(K!==0){for(let Y=1;Y<P.length;Y+=4)P[Y]+=K;U+=K,ie+=K;}}}if(m){let J=l?$f:1,K=T*J,Y=S*J,oe=(M?I-T/2:q+(A-T)/2)-(K-T)/2,re=(M?E-R/2+(k-S)/2:E-S/2)-(Y-S)/2;if(y){let ae=c*p*J,me=oe+K/2-ae/2,we=re+Y/2-ae/2,ge=ve/Math.max(y.height-ve*2,1)*ae;No(V,j,me-ge,we-ge,ae+ge*2,ae+ge*2,y,0,a),X++;}if(_&&ne>Z){let ae=f*1.6,me=f;K=(ne-Z+ae*2)*J,Y=(ie-U+me*2)*J,oe=Z-ae,re=U-me;}let ce=ve/Math.max(m.height-ve*2,1)*Y;No(O,B,oe-ce,re-ce,K+ce*2,Y+ce*2,m,e.rotate,a),X++;}return X?{verts:P,texs:N,iconVerts:O,iconTexs:B,frameVerts:V,frameTexs:j,quads:X,box:W}: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+bl,b=this.padding,g=T=>{let A=T.path.map(k=>({x1:k.x-p,y1:k.y-p,x2:k.x+p,y2:k.y+p}));for(let k of A)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&&yl(n,k))return false;if(!u.allowOverlap)for(let k of A)gl(n,k);return m.push(...A),true},v=-1/0,w=1/0;for(let T of t.glyphs)T.glyph.height<=0||(v=Math.max(v,T.glyph.top),w=Math.min(w,T.glyph.top-T.glyph.height));let x=Number.isFinite(v)?(v+w)/2*o:0,M=an(s,this.viewport.width,this.viewport.height,qf).flatMap(T=>sn(T,c,f,{spacing:u.symbolSpacing,fontSize:Ge*o,stableScale:Math.pow(2,Math.round(a)-a),accept:g}));if(!M.length)return null;for(let T of M)for(let A=0;A<t.glyphs.length;A++){let k=t.glyphs[A].glyph,L=T.glyphs[A],R=`g:${k.id}`,I=this.atlas.get(R);if(!I&&(!k.bitmap||(I=this.atlas.add(R,k.bitmap,k.width+ve*2,k.height+ve*2)??void 0,!I)))continue;let E=I.width*o,H=I.height*o,W=(k.height/2-k.top)*o+x,F=L.angle*Math.PI/180;No(d,h,L.x-E/2-Math.sin(F)*W,L.y-H/2+Math.cos(F)*W,E,H,I,L.angle,l),y++;}if(!y)return null;let C=m.map(T=>(T.x1+T.x2)/2),S=m.map(T=>(T.y1+T.y2)/2);return {verts:d,texs:h,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:y,box:{x1:Math.min(...C)-p,y1:Math.min(...S)-p,x2:Math.max(...C)+p,y2:Math.max(...S)+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*fn),u=new Float32Array(f),d=new Uint16Array(f),h=[],m=0,y=(p,b,g,v)=>{let w=p.length/16;if(w){h.push({layer:g,role:v,first:m/4*6,count:w*6});for(let x=0;x<w*4;x++){let _=m*5;u[_]=p[x*4],u[_+1]=p[x*4+1],d[_*2+4]=b[x*2],d[_*2+5]=b[x*2+1],u[_+3]=p[x*4+2],u[_+4]=p[x*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",on),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=D(b.opacity,n,1),v=p.role==="icon",w=p.role==="frame",x=(A,k,L)=>w?k??A??L:v?A??L:L,_=Ae(w?b.frameColor??b.haloColor??b.color:x(b.iconColor,void 0,b.color),n,[.15,.15,.15,1]),M=w?b.frameHaloColor:x(b.iconHaloColor,void 0,b.haloColor),C=Ae(M??(w?b.iconColor??b.color:b.haloColor),n,[1,1,1,1]);w&&b.frameHaloColor===void 0&&(C[3]*=.35),w&&(_[3]*=D(b.frameOpacity,n,1));let S=D(w?b.frameHaloWidth??1.1:x(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),T=D(p.layer.layout?.textSize,n,13);a.setVec4v("u_color",Ce([_[0],_[1],_[2],_[3]*g])),a.setVec4v("u_halo_color",Ce([C[0],C[1],C[2],C[3]*g])),a.setFloat("u_halo",S/(qt*(T/Ge))),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 pe(e,new Uint8Array(this.capacityQuads*4*fn),pl,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 ue(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 No(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 tu(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 vl=(i,e)=>i*4096+e;function yl(i,e){let t=Math.floor(e.x1/qe),o=Math.floor(e.y1/qe),r=Math.floor(e.x2/qe),n=Math.floor(e.y2/qe);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(vl(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 gl(i,e){let t=Math.floor(e.x1/qe),o=Math.floor(e.y1/qe),r=Math.floor(e.x2/qe),n=Math.floor(e.y2/qe);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=vl(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function wl(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 xl(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var Mt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new z;}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 Tt=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 ou(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 Tt(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(Te(p),Se(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 Jt(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 ou(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],u=[];for(let h=s;h<=c;h++)u.push(new Tt(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 dn=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new z;}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;}},un=6,ru=24,Go=class extends Ue{constructor(t,o){super();this.pool=t;this.visible=[];this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,rank:1,...o},this.cache=new Mt(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}loadedTiles(){return this.cache.entries()}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=Jt(t,this.opts),r=new ee;for(let c of o)r.add(c.dataKey);for(let[c,f]of this.cache.entries())f.state==="loading"&&!r.has(c)&&(this.pool.abort(f.requestId),this.cache.delete(c));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);let a=this.opts.rank*1e9;for(let c of o)this.cache.get(c.dataKey)||this.loadTile(c,a+t.distanceToTile(c));let l=this.coverFor(o),s=this.readyFor(o);(this.anyReady(l)||this.visible.length===0||!this.covers(o))&&(this.visible=l,s&&o.length&&(this.warmed=true));}coverFor(t){let o=c=>{let f=this.cache.peek(c.dataKey);return !!f&&f.state!=="loading"},r=(c,f)=>{let u=f.parent();for(let d=0;u&&d<=un;d++){if(u.dataKey===c.dataKey)return true;u=u.parent();}return false},n=new z,a=[];for(let c of t)o(c)?n.set(c.dataKey,c):a.push(c);let l=this.descendantsOf(a);for(let c of a){let f=l.get(c.dataKey);if(f&&f.length){for(let m of f)n.set(m.dataKey,m),this.cache.get(m.dataKey);continue}let u=c.parent(),d=null;for(let m=1;u&&m<=un;m++,u=u.parent()){if(!o(u))continue;let y=u;if(m>1&&t.some(p=>p!==c&&o(p)&&r(y,p)))break;d=y;break}let h=d??c;n.set(h.dataKey,h);}let s=[];for(let[,c]of n){let f=c.parent(),u=false;for(let d=0;f&&d<=un;d++){if(n.has(f.dataKey)){u=true;break}f=f.parent();}u||(s.push(c),this.cache.get(c.dataKey));}return s}descendantsOf(t){let o=new z;for(let n of t)o.set(n.dataKey,n);let r=new z;if(!o.size)return r;for(let[n,a]of this.cache.entries()){if(a.state==="loading")continue;let l=a.id.parent();for(let s=0;l&&s<ru;s++){let c=o.get(l.dataKey);if(c){let f=r.get(c.dataKey);f?f.push(a.id):r.set(c.dataKey,[a.id]);break}l=l.parent();}}return r}anyReady(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(r&&r.state!=="loading")return true}return t.length===0}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}deactivate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&(this.pool.abort(o.requestId),this.cache.delete(t));this.visible=[];}loadTile(t,o=0){let r=new dn(t);this.cache.set(t.dataKey,r);let n=nu(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));r.requestId=this.pool.load({url:n,zoom:t.z,metersPerTile:On(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},a=>{if(this.cache.peek(t.dataKey)===r){if(a.type==="error"){if(a.aborted)return;r.state="error",r.error=a.message,this.emit("error",{tile:t,message:a.message});}else r.data=a,r.state=Object.keys(a.buckets).length?"loaded":"empty",this.version++,a.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 ${a.diag.failed.join("; ")}`),this.emit("data",{tile:r});this.pendingCount===0&&this.emit("idle",void 0);}},o);}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 nu(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var Uo=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;}},eo=class extends Ue{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new Mt(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=Jt(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 Uo(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(_l(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 _l(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 iu="osmgl-assets",kt="assets";var jo=null;function Sl(){return jo||(jo=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(iu,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(kt)||t.createObjectStore(kt,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),jo)}function au(i){return Sl().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(kt,"readonly").objectStore(kt).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function lu(i){Sl().then(e=>{if(e)try{e.transaction(kt,"readwrite").objectStore(kt).put(i);}catch{}});}var Cl=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 su(i,e,t){let o=await crypto.subtle.importKey("raw",Cl(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Cl(t),tagLength:128},o,i)}var to=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 au(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(),lu({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 su(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 cu=1,oo=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=G();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-${cu++}`,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 $r(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=te(this.coordinates);return {x:le(e.lng),y:se(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=mn(n(-this.rotation));this.rotationTiltX&&(a=Ze(hn(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=Ze(pn(n(this.rotationTiltZ)),a));let l=Ze(r,a),s=this.matrix;return We(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=te(this.coordinates),r=G();for(let a=0;a<16;a++)r[a]=e[a];let n=G();return _e(n,r,this.localMatrix(o.lat)),Ve(t??this.matrix32,n)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=te(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=mn(m(-this.rotation));return this.rotationTiltX&&(y=Ze(hn(m(this.rotationTiltX)),y)),this.rotationTiltZ&&(y=Ze(pn(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=te(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,w=(o.max[2]-o.min[2])/2*p;return Math.abs(m-b)<=v&&Math.abs(y-g)<=w}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=G();for(let u=0;u<16;u++)a[u]=e[u];let l=te(this.coordinates),s=G();_e(s,a,this.localMatrix(l.lat));let c=G();qr(n,t,n.duration>0?o%n.duration:0,c);let f=G();return _e(f,s,c),Ve(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=mn(e(-this.rotation));this.rotationTiltX&&(t=Ze(hn(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=Ze(pn(e(this.rotationTiltZ)),t));let o=Ze([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 Ze(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 hn=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},mn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},pn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var Ko=class{constructor(){this.hit=new z;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(!bu(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="";}},fu=14,uu=2e3,du=4e3,Ml=160,hu=50,mu=4e3,bn=6,Yo=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new z;this.loading=0;this.pending=[];this.known=new z;this.underBuilding=new Ko;this.underVenue=new Ko;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Ml;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 to(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??fu,f=s.loadRadius??uu,u=Math.max(s.keepRadius??du,f),d=Math.min(1,Math.max(.25,(o.zoom-c)/3)),h=Math.max(8,Math.round((s.budget??Ml)*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 H of t.visibleTiles){let W=t.getTile(H)?.data?.buckets?.[e.id];if(!W||!Ua(W))continue;let F=new Int16Array(W.anchors),P=H.bounds(),N=P.maxX-P.minX,O=P.maxY-P.minY;for(let B=0;B<W.props.length;B++){let V=W.props[B],j=it(V.file,NaN);if(!Number.isFinite(j))continue;let X=String(V.kind??"model"),q=X==="rule"?`t-${V.rid}-${V.oid}`:`m-${V.mid}`;if(E.has(q))continue;E.add(q),X==="rule"&&v++;let Q=P.minX+F[B*2]/W.extent*N,Z=P.minY+F[B*2+1]/W.extent*O,U=pu(Q,Z);this.known.set(q,{id:q,fileId:j,lng:U.lng,lat:U.lat,mercX:Q,mercY:Z,altitude:it(V.alt,0),scale:it(V.scale,1),rotation:it(V.rx,0),tiltX:it(V.rz,0),tiltZ:it(V.ry,0),kind:X==="rule"?"rule":"model",target:Tl(X==="rule"?V.oid:V.replaces),replaces:m?X==="rule"?Xo(V.oid):String(V.anchor??"replace")==="replace"?Xo(V.replaces_all).length?Xo(V.replaces_all):Xo(V.replaces):[]:[]});}}this.rulesInScan=v;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let w=this.found,x=new ee;for(let E of w)E.kind==="model"&&E.target!==null&&x.add(E.target);let _=111320,M=Math.cos(p.lat*Math.PI/180),C=E=>Math.hypot((E.lng-p.lng)*_*M,(E.lat-p.lat)*_);this.replacedBuildings.clear(),this.replacedVenues.clear();let S=new ee,T=[],A=0,k=0;(this.sortedAt===null||Math.hypot((p.lng-this.sortedAt.lng)*_*M,(p.lat-this.sortedAt.lat)*_)>hu)&&(w.sort((E,H)=>C(E)-C(H)),this.sortedAt={lng:p.lng,lat:p.lat});let R=0;for(let E of w){let H=C(E);if(H>u){A++;continue}if(E.kind==="rule"&&E.target!==null&&x.has(E.target)){let N=this.entries.get(E.id);N&&N.model.retire();continue}let W=this.entries.get(E.id);if(R>=h){k++,W&&W.model.retire();continue}R++,S.add(E.id);let F=()=>{if(!E.replaces.length)return;for(let B of E.replaces)this.replacedBuildings.add(B);let N=this.underBuilding.find(E,a);N!==null&&this.replacedBuildings.add(N);let O=this.underVenue.find(E,l);O!==null&&this.replacedVenues.add(O);},P=W;if(P){F(),P.distance=H,P.leftAt=0,P.model.revive(),b<P.lod&&!P.upgrading&&this.loading<bn&&this.upgrade(P,b,r,n);continue}if(H>f){A++;continue}if(this.loading>=bn){T.push(E),F();continue}F(),this.spawn(E,H,b,r);}for(let E of [...this.entries.values()])if(!S.has(E.placement.id)){if(E.leftAt===0){E.leftAt=y;continue}y-E.leftAt>mu&&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,H]of [...this.known.entries()])C(H)>u*3&&this.known.delete(E);let I=this.stats;I.found=w.length,I.kept=S.size,I.live=this.entries.size,I.tooFar=A,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<bn&&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 oo({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;}},it=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Xo=i=>{if(i==null)return [];let e=[];for(let t of String(i).split(",")){let o=Number(t);Number.isFinite(o)&&o!==0&&e.push(o);}return e},Tl=i=>{let e=it(i,NaN);return Number.isFinite(e)?e:null};function pu(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 bu(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 yu=200,gu={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},ro=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=gu[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??vu),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=te(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(le(t.lng)*o,se(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=yu;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";}},vu='<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 no=class extends ro{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 wu=[["\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."]],kl=new Map(wu);function yn(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=kl.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=>kl.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function vn(i,e){let t=[],o=[],r=[],n=[],a=[],l=e.textPlacement==="line",s=[],c=[],f=[];for(let u of i.features()){if(!ye(e.filter,u.properties))continue;let d=u.loadGeometry(),h=Cu(u.type,d);if(!h)continue;let m=e.textField?gn(e.textField,u.properties):"",y=m&&e.abbreviate?yn(m):m,p=e.iconImage?gn(e.iconImage,u.properties):"";if(!(!y&&!p)){if(l){let b=_u(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(Su(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:u,line:d}of xu(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 xu(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 _u(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 Cu(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 Su(i){let e=i.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function gn(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 El(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&ye(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 Mu(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function Al(i,e){let t=performance.now(),o=Mu(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(g,v,w,x,_=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:x,parseMs:_},diag:{status:g,bytes:v,layers:w,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 Rt(a),f=Object.keys(c.layers),u={},d=[],h={},m=new Set,y=[],b=i.plan.some(g=>g.type==="surface"&&(g.elevation??0)>0)&&i.plan.some(g=>g.type==="line"&&g.ground)?Cr(i.metersPerTile):void 0;for(let g of i.plan){if(!ku(g,i.zoom,i.sourceMaxZoom))continue;let v=c.layers[g.sourceLayer];if(!v)continue;let w=Eu(i.zoom,v.extent);try{if(g.splitBy){let _=Au(v,g.splitBy,g.filter);if(!_.length)continue;let M=h[g.splitBy]??(h[g.splitBy]=[]);for(let C of _){M.includes(C)||M.push(C);let S={...g,splitBy:void 0,filter:Lu(g.filter,g.splitBy,C)},T=wn(S,v,w,i.metersPerTile,b,void 0,d);T&&(u[Oe(g.id,C)]=T);}continue}if(g.network&&g.type==="line"){for(let _ of Iu(v,g.filter)){let M=wn(g,v,w,i.metersPerTile,b,_,d);M&&(u[Oe(g.id,_)]=M,m.add(_));}continue}let x=wn(g,v,w,i.metersPerTile,b,void 0,d);x&&(u[g.id]=x);}catch(x){y.push(`${g.id}: ${x instanceof Error?x.message:String(x)}`);}}return {type:"loaded",id:i.id,buckets:u,...d.length?{seams:d}:{},...Object.keys(h).length?{splits:h}:{},...m.size?{levels:[...m].sort((g,v)=>g-v)}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(u).length,...y.length?{failed:y}:{}}}}function Tu(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 ku(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function Eu(i,e){return i<=6?Math.max(64,e/24):0}function wn(i,e,t,o,r,n,a){{if(i.type==="fill"){let s=o>0?o/e.extent:0,c=i.cornerRadius&&s>0?{radius:i.cornerRadius/s,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:ni/s}:void 0,f=pr(e,i.filter,t,c,i.clipToTile===true,e.extent);return f?{kind:"fill",...f,extent:e.extent}:null}if(i.type==="surface"){let s=_r(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:c=>Sr(r,c,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:Tu(i.groundBy)}:{}});return s?{kind:"surface",...s}:null}if(i.type==="line"){let s=Tr(e,i.filter,t,i.ground?r:void 0,o>0?o/e.extent:0,{level:n});return s?{kind:"line",...s,extent:e.extent}:null}if(i.type==="model"){let s=El(e,i.filter);return s?{kind:"placement",...s,extent:e.extent}:null}if(i.type==="symbol"){let s=vn(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return s?{kind:"symbol",...s,extent:e.extent}:null}let l=dr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments},a);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 Au(i,e,t){let o=[];for(let r of i.features()){if(!ye(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 Iu(i,e){let t=[];for(let o of i.features()){if(!ye(e,o.properties))continue;let r=rt(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function Lu(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var xn='"use strict";(()=>{var pr=Object.create;var tn=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var dr=Object.getOwnPropertyNames;var xr=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty;var yr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var br=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of dr(t))!gr.call(e,i)&&i!==n&&tn(e,i,{get:()=>t[i],enumerable:!(r=mr(t,i))||r.enumerable});return e};var wr=(e,t,n)=>(n=e!=null?pr(xr(e)):{},br(t||!e||!e.__esModule?tn(n,"default",{value:e,enumerable:!0}):n,e));var Un=yr((zt,jt)=>{(function(e,t){typeof zt=="object"&&typeof jt<"u"?jt.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(zt,function(){"use strict";function e(y,s){var l={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},a,d,p,M;return M={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function w(E){return function(C){return R([E,C])}}function R(E){if(a)throw new TypeError("Generator is already executing.");for(;l;)try{if(a=1,d&&(p=E[0]&2?d.return:E[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,E[1])).done)return p;switch(d=0,p&&(E=[E[0]&2,p.value]),E[0]){case 0:case 1:p=E;break;case 4:return l.label++,{value:E[1],done:!1};case 5:l.label++,d=E[1],E=[0];continue;case 7:E=l.ops.pop(),l.trys.pop();continue;default:if(p=l.trys,!(p=p.length>0&&p[p.length-1])&&(E[0]===6||E[0]===2)){l=0;continue}if(E[0]===3&&(!p||E[1]>p[0]&&E[1]<p[3])){l.label=E[1];break}if(E[0]===6&&l.label<p[1]){l.label=p[1],p=E;break}if(p&&l.label<p[2]){l.label=p[2],l.ops.push(E);break}p[2]&&l.ops.pop(),l.trys.pop();continue}E=s.call(y,l)}catch(C){E=[6,C],d=0}finally{a=p=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}}var t=function(){function y(s,l){this.next=null,this.key=s,this.data=l,this.left=null,this.right=null}return y}();function n(y,s){return y>s?1:y<s?-1:0}function r(y,s,l){for(var a=new t(null,null),d=a,p=a;;){var M=l(y,s.key);if(M<0){if(s.left===null)break;if(l(y,s.left.key)<0){var w=s.left;if(s.left=w.right,w.right=s,s=w,s.left===null)break}p.left=s,p=s,s=s.left}else if(M>0){if(s.right===null)break;if(l(y,s.right.key)>0){var w=s.right;if(s.right=w.left,w.left=s,s=w,s.right===null)break}d.right=s,d=s,s=s.right}else break}return d.right=s.left,p.left=s.right,s.left=a.right,s.right=a.left,s}function i(y,s,l,a){var d=new t(y,s);if(l===null)return d.left=d.right=null,d;l=r(y,l,a);var p=a(y,l.key);return p<0?(d.left=l.left,d.right=l,l.left=null):p>=0&&(d.right=l.right,d.left=l,l.right=null),d}function o(y,s,l){var a=null,d=null;if(s){s=r(y,s,l);var p=l(s.key,y);p===0?(a=s.left,d=s.right):p<0?(d=s.right,s.right=null,a=s):(a=s.left,s.left=null,d=s)}return{left:a,right:d}}function u(y,s,l){return s===null?y:(y===null||(s=r(y.key,s,l),s.left=y),s)}function c(y,s,l,a,d){if(y){a(""+s+(l?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+d(y)+`\n`);var p=s+(l?" ":"\\u2502 ");y.left&&c(y.left,p,!1,a,d),y.right&&c(y.right,p,!0,a,d)}}var f=function(){function y(s){s===void 0&&(s=n),this._root=null,this._size=0,this._comparator=s}return y.prototype.insert=function(s,l){return this._size++,this._root=i(s,l,this._root,this._comparator)},y.prototype.add=function(s,l){var a=new t(s,l);this._root===null&&(a.left=a.right=null,this._size++,this._root=a);var d=this._comparator,p=r(s,this._root,d),M=d(s,p.key);return M===0?this._root=p:(M<0?(a.left=p.left,a.right=p,p.left=null):M>0&&(a.right=p.right,a.left=p,p.right=null),this._size++,this._root=a),this._root},y.prototype.remove=function(s){this._root=this._remove(s,this._root,this._comparator)},y.prototype._remove=function(s,l,a){var d;if(l===null)return null;l=r(s,l,a);var p=a(s,l.key);return p===0?(l.left===null?d=l.right:(d=r(s,l.left,a),d.right=l.right),this._size--,d):l},y.prototype.pop=function(){var s=this._root;if(s){for(;s.left;)s=s.left;return this._root=r(s.key,this._root,this._comparator),this._root=this._remove(s.key,this._root,this._comparator),{key:s.key,data:s.data}}return null},y.prototype.findStatic=function(s){for(var l=this._root,a=this._comparator;l;){var d=a(s,l.key);if(d===0)return l;d<0?l=l.left:l=l.right}return null},y.prototype.find=function(s){return this._root&&(this._root=r(s,this._root,this._comparator),this._comparator(s,this._root.key)!==0)?null:this._root},y.prototype.contains=function(s){for(var l=this._root,a=this._comparator;l;){var d=a(s,l.key);if(d===0)return!0;d<0?l=l.left:l=l.right}return!1},y.prototype.forEach=function(s,l){for(var a=this._root,d=[],p=!1;!p;)a!==null?(d.push(a),a=a.left):d.length!==0?(a=d.pop(),s.call(l,a),a=a.right):p=!0;return this},y.prototype.range=function(s,l,a,d){for(var p=[],M=this._comparator,w=this._root,R;p.length!==0||w;)if(w)p.push(w),w=w.left;else{if(w=p.pop(),R=M(w.key,l),R>0)break;if(M(w.key,s)>=0&&a.call(d,w))return this;w=w.right}return this},y.prototype.keys=function(){var s=[];return this.forEach(function(l){var a=l.key;return s.push(a)}),s},y.prototype.values=function(){var s=[];return this.forEach(function(l){var a=l.data;return s.push(a)}),s},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(s){if(s===void 0&&(s=this._root),s)for(;s.left;)s=s.left;return s},y.prototype.maxNode=function(s){if(s===void 0&&(s=this._root),s)for(;s.right;)s=s.right;return s},y.prototype.at=function(s){for(var l=this._root,a=!1,d=0,p=[];!a;)if(l)p.push(l),l=l.left;else if(p.length>0){if(l=p.pop(),d===s)return l;d++,l=l.right}else a=!0;return null},y.prototype.next=function(s){var l=this._root,a=null;if(s.right){for(a=s.right;a.left;)a=a.left;return a}for(var d=this._comparator;l;){var p=d(s.key,l.key);if(p===0)break;p<0?(a=l,l=l.left):l=l.right}return a},y.prototype.prev=function(s){var l=this._root,a=null;if(s.left!==null){for(a=s.left;a.right;)a=a.right;return a}for(var d=this._comparator;l;){var p=d(s.key,l.key);if(p===0)break;p<0?l=l.left:(a=l,l=l.right)}return a},y.prototype.clear=function(){return this._root=null,this._size=0,this},y.prototype.toList=function(){return g(this._root)},y.prototype.load=function(s,l,a){l===void 0&&(l=[]),a===void 0&&(a=!1);var d=s.length,p=this._comparator;if(a&&S(s,l,0,d-1,p),this._root===null)this._root=h(s,l,0,d),this._size=d;else{var M=v(this.toList(),m(s,l),p);d=this._size+d,this._root=x({head:M},0,d)}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(s){s===void 0&&(s=function(a){return String(a.key)});var l=[];return c(this._root,"",!0,function(a){return l.push(a)},s),l.join("")},y.prototype.update=function(s,l,a){var d=this._comparator,p=o(s,this._root,d),M=p.left,w=p.right;d(s,l)<0?w=i(l,a,w,d):M=i(l,a,M,d),this._root=u(M,w,d)},y.prototype.split=function(s){return o(s,this._root,this._comparator)},y.prototype[Symbol.iterator]=function(){var s,l,a;return e(this,function(d){switch(d.label){case 0:s=this._root,l=[],a=!1,d.label=1;case 1:return a?[3,6]:s===null?[3,2]:(l.push(s),s=s.left,[3,5]);case 2:return l.length===0?[3,4]:(s=l.pop(),[4,s]);case 3:return d.sent(),s=s.right,[3,5];case 4:a=!0,d.label=5;case 5:return[3,1];case 6:return[2]}})},y}();function h(y,s,l,a){var d=a-l;if(d>0){var p=l+Math.floor(d/2),M=y[p],w=s[p],R=new t(M,w);return R.left=h(y,s,l,p),R.right=h(y,s,p+1,a),R}return null}function m(y,s){for(var l=new t(null,null),a=l,d=0;d<y.length;d++)a=a.next=new t(y[d],s[d]);return a.next=null,l.next}function g(y){for(var s=y,l=[],a=!1,d=new t(null,null),p=d;!a;)s?(l.push(s),s=s.left):l.length>0?(s=p=p.next=l.pop(),s=s.right):a=!0;return p.next=null,d.next}function x(y,s,l){var a=l-s;if(a>0){var d=s+Math.floor(a/2),p=x(y,s,d),M=y.head;return M.left=p,y.head=y.head.next,M.right=x(y,d+1,l),M}return null}function v(y,s,l){for(var a=new t(null,null),d=a,p=y,M=s;p!==null&&M!==null;)l(p.key,M.key)<0?(d.next=p,p=p.next):(d.next=M,M=M.next),d=d.next;return p!==null?d.next=p:M!==null&&(d.next=M),a.next}function S(y,s,l,a,d){if(!(l>=a)){for(var p=y[l+a>>1],M=l-1,w=a+1;;){do M++;while(d(y[M],p)<0);do w--;while(d(y[w],p)>0);if(M>=w)break;var R=y[M];y[M]=y[w],y[w]=R,R=s[M],s[M]=s[w],s[w]=R}S(y,s,l,w,d),S(y,s,w+1,a,d)}}let P=(y,s)=>y.ll.x<=s.x&&s.x<=y.ur.x&&y.ll.y<=s.y&&s.y<=y.ur.y,_=(y,s)=>{if(s.ur.x<y.ll.x||y.ur.x<s.ll.x||s.ur.y<y.ll.y||y.ur.y<s.ll.y)return null;let l=y.ll.x<s.ll.x?s.ll.x:y.ll.x,a=y.ur.x<s.ur.x?y.ur.x:s.ur.x,d=y.ll.y<s.ll.y?s.ll.y:y.ll.y,p=y.ur.y<s.ur.y?y.ur.y:s.ur.y;return{ll:{x:l,y:d},ur:{x:a,y:p}}},I=Number.EPSILON;I===void 0&&(I=Math.pow(2,-52));let A=I*I,k=(y,s)=>{if(-I<y&&y<I&&-I<s&&s<I)return 0;let l=y-s;return l*l<A*y*s?0:y<s?-1:1};class L{constructor(){this.reset()}reset(){this.xRounder=new V,this.yRounder=new V}round(s,l){return{x:this.xRounder.round(s),y:this.yRounder.round(l)}}}class V{constructor(){this.tree=new f,this.round(0)}round(s){let l=this.tree.add(s),a=this.tree.prev(l);if(a!==null&&k(l.key,a.key)===0)return this.tree.remove(s),a.key;let d=this.tree.next(l);return d!==null&&k(l.key,d.key)===0?(this.tree.remove(s),d.key):s}}let U=new L,N=11102230246251565e-32,T=134217729,j=(3+8*N)*N;function Y(y,s,l,a,d){let p,M,w,R,E=s[0],C=a[0],b=0,F=0;C>E==C>-E?(p=E,E=s[++b]):(p=C,C=a[++F]);let B=0;if(b<y&&F<l)for(C>E==C>-E?(M=E+p,w=p-(M-E),E=s[++b]):(M=C+p,w=p-(M-C),C=a[++F]),p=M,w!==0&&(d[B++]=w);b<y&&F<l;)C>E==C>-E?(M=p+E,R=M-p,w=p-(M-R)+(E-R),E=s[++b]):(M=p+C,R=M-p,w=p-(M-R)+(C-R),C=a[++F]),p=M,w!==0&&(d[B++]=w);for(;b<y;)M=p+E,R=M-p,w=p-(M-R)+(E-R),E=s[++b],p=M,w!==0&&(d[B++]=w);for(;F<l;)M=p+C,R=M-p,w=p-(M-R)+(C-R),C=a[++F],p=M,w!==0&&(d[B++]=w);return(p!==0||B===0)&&(d[B++]=p),B}function $(y,s){let l=s[0];for(let a=1;a<y;a++)l+=s[a];return l}function O(y){return new Float64Array(y)}let G=(3+16*N)*N,W=(2+12*N)*N,D=(9+64*N)*N*N,Q=O(4),oe=O(8),ee=O(12),ne=O(16),Z=O(4);function le(y,s,l,a,d,p,M){let w,R,E,C,b,F,B,z,H,J,X,te,xe,se,ge,ye,Ee,be,ke=y-d,_e=l-d,Ae=s-p,Be=a-p;se=ke*Be,F=T*ke,B=F-(F-ke),z=ke-B,F=T*Be,H=F-(F-Be),J=Be-H,ge=z*J-(se-B*H-z*H-B*J),ye=Ae*_e,F=T*Ae,B=F-(F-Ae),z=Ae-B,F=T*_e,H=F-(F-_e),J=_e-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Q[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Q[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Q[2]=te-(be-b)+(X-b),Q[3]=be;let Te=$(4,Q),et=W*M;if(Te>=et||-Te>=et||(b=y-ke,w=y-(ke+b)+(b-d),b=l-_e,E=l-(_e+b)+(b-d),b=s-Ae,R=s-(Ae+b)+(b-p),b=a-Be,C=a-(Be+b)+(b-p),w===0&&R===0&&E===0&&C===0)||(et=D*M+j*Math.abs(Te),Te+=ke*C+Be*w-(Ae*E+_e*R),Te>=et||-Te>=et))return Te;se=w*Be,F=T*w,B=F-(F-w),z=w-B,F=T*Be,H=F-(F-Be),J=Be-H,ge=z*J-(se-B*H-z*H-B*J),ye=R*_e,F=T*R,B=F-(F-R),z=R-B,F=T*_e,H=F-(F-_e),J=_e-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-b),Z[3]=be;let fr=Y(4,Q,4,Z,oe);se=ke*C,F=T*ke,B=F-(F-ke),z=ke-B,F=T*C,H=F-(F-C),J=C-H,ge=z*J-(se-B*H-z*H-B*J),ye=Ae*E,F=T*Ae,B=F-(F-Ae),z=Ae-B,F=T*E,H=F-(F-E),J=E-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-b),Z[3]=be;let ar=Y(fr,oe,4,Z,ee);se=w*C,F=T*w,B=F-(F-w),z=w-B,F=T*C,H=F-(F-C),J=C-H,ge=z*J-(se-B*H-z*H-B*J),ye=R*E,F=T*R,B=F-(F-R),z=R-B,F=T*E,H=F-(F-E),J=E-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-b),Z[3]=be;let hr=Y(ar,ee,4,Z,ne);return ne[hr-1]}function K(y,s,l,a,d,p){let M=(s-p)*(l-d),w=(y-d)*(a-p),R=M-w,E=Math.abs(M+w);return Math.abs(R)>=G*E?R:-le(y,s,l,a,d,p,E)}let q=(y,s)=>y.x*s.y-y.y*s.x,he=(y,s)=>y.x*s.x+y.y*s.y,me=(y,s,l)=>{let a=K(y.x,y.y,s.x,s.y,l.x,l.y);return a>0?-1:a<0?1:0},ce=y=>Math.sqrt(he(y,y)),fe=(y,s,l)=>{let a={x:s.x-y.x,y:s.y-y.y},d={x:l.x-y.x,y:l.y-y.y};return q(d,a)/ce(d)/ce(a)},ae=(y,s,l)=>{let a={x:s.x-y.x,y:s.y-y.y},d={x:l.x-y.x,y:l.y-y.y};return he(d,a)/ce(d)/ce(a)},de=(y,s,l)=>s.y===0?null:{x:y.x+s.x/s.y*(l-y.y),y:l},Se=(y,s,l)=>s.x===0?null:{x:l,y:y.y+s.y/s.x*(l-y.x)},Fe=(y,s,l,a)=>{if(s.x===0)return Se(l,a,y.x);if(a.x===0)return Se(y,s,l.x);if(s.y===0)return de(l,a,y.y);if(a.y===0)return de(y,s,l.y);let d=q(s,a);if(d==0)return null;let p={x:l.x-y.x,y:l.y-y.y},M=q(p,s)/d,w=q(p,a)/d,R=y.x+w*s.x,E=l.x+M*a.x,C=y.y+w*s.y,b=l.y+M*a.y,F=(R+E)/2,B=(C+b)/2;return{x:F,y:B}};class re{static compare(s,l){let a=re.comparePoints(s.point,l.point);return a!==0?a:(s.point!==l.point&&s.link(l),s.isLeft!==l.isLeft?s.isLeft?1:-1:ve.compare(s.segment,l.segment))}static comparePoints(s,l){return s.x<l.x?-1:s.x>l.x?1:s.y<l.y?-1:s.y>l.y?1:0}constructor(s,l){s.events===void 0?s.events=[this]:s.events.push(this),this.point=s,this.isLeft=l}link(s){if(s.point===this.point)throw new Error("Tried to link already linked events");let l=s.point.events;for(let a=0,d=l.length;a<d;a++){let p=l[a];this.point.events.push(p),p.point=this.point}this.checkForConsuming()}checkForConsuming(){let s=this.point.events.length;for(let l=0;l<s;l++){let a=this.point.events[l];if(a.segment.consumedBy===void 0)for(let d=l+1;d<s;d++){let p=this.point.events[d];p.consumedBy===void 0&&a.otherSE.point.events===p.otherSE.point.events&&a.segment.consume(p.segment)}}}getAvailableLinkedEvents(){let s=[];for(let l=0,a=this.point.events.length;l<a;l++){let d=this.point.events[l];d!==this&&!d.segment.ringOut&&d.segment.isInResult()&&s.push(d)}return s}getLeftmostComparator(s){let l=new Map,a=d=>{let p=d.otherSE;l.set(d,{sine:fe(this.point,s.point,p.point),cosine:ae(this.point,s.point,p.point)})};return(d,p)=>{l.has(d)||a(d),l.has(p)||a(p);let{sine:M,cosine:w}=l.get(d),{sine:R,cosine:E}=l.get(p);return M>=0&&R>=0?w<E?1:w>E?-1:0:M<0&&R<0?w<E?-1:w>E?1:0:R<M?-1:R>M?1:0}}}let Ue=0;class ve{static compare(s,l){let a=s.leftSE.point.x,d=l.leftSE.point.x,p=s.rightSE.point.x,M=l.rightSE.point.x;if(M<a)return 1;if(p<d)return-1;let w=s.leftSE.point.y,R=l.leftSE.point.y,E=s.rightSE.point.y,C=l.rightSE.point.y;if(a<d){if(R<w&&R<E)return 1;if(R>w&&R>E)return-1;let b=s.comparePoint(l.leftSE.point);if(b<0)return 1;if(b>0)return-1;let F=l.comparePoint(s.rightSE.point);return F!==0?F:-1}if(a>d){if(w<R&&w<C)return-1;if(w>R&&w>C)return 1;let b=l.comparePoint(s.leftSE.point);if(b!==0)return b;let F=s.comparePoint(l.rightSE.point);return F<0?1:F>0?-1:1}if(w<R)return-1;if(w>R)return 1;if(p<M){let b=l.comparePoint(s.rightSE.point);if(b!==0)return b}if(p>M){let b=s.comparePoint(l.rightSE.point);if(b<0)return 1;if(b>0)return-1}if(p!==M){let b=E-w,F=p-a,B=C-R,z=M-d;if(b>F&&B<z)return 1;if(b<F&&B>z)return-1}return p>M?1:p<M||E<C?-1:E>C?1:s.id<l.id?-1:s.id>l.id?1:0}constructor(s,l,a,d){this.id=++Ue,this.leftSE=s,s.segment=this,s.otherSE=l,this.rightSE=l,l.segment=this,l.otherSE=s,this.rings=a,this.windings=d}static fromRing(s,l,a){let d,p,M,w=re.comparePoints(s,l);if(w<0)d=s,p=l,M=1;else if(w>0)d=l,p=s,M=-1;else throw new Error(`Tried to create degenerate segment at [${s.x}, ${s.y}]`);let R=new re(d,!0),E=new re(p,!1);return new ve(R,E,[a],[M])}replaceRightSE(s){this.rightSE=s,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let s=this.leftSE.point.y,l=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:s<l?s:l},ur:{x:this.rightSE.point.x,y:s>l?s:l}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(s){return s.x===this.leftSE.point.x&&s.y===this.leftSE.point.y||s.x===this.rightSE.point.x&&s.y===this.rightSE.point.y}comparePoint(s){if(this.isAnEndpoint(s))return 0;let l=this.leftSE.point,a=this.rightSE.point,d=this.vector();if(l.x===a.x)return s.x===l.x?0:s.x<l.x?1:-1;let p=(s.y-l.y)/d.y,M=l.x+p*d.x;if(s.x===M)return 0;let w=(s.x-l.x)/d.x,R=l.y+w*d.y;return s.y===R?0:s.y<R?-1:1}getIntersection(s){let l=this.bbox(),a=s.bbox(),d=_(l,a);if(d===null)return null;let p=this.leftSE.point,M=this.rightSE.point,w=s.leftSE.point,R=s.rightSE.point,E=P(l,w)&&this.comparePoint(w)===0,C=P(a,p)&&s.comparePoint(p)===0,b=P(l,R)&&this.comparePoint(R)===0,F=P(a,M)&&s.comparePoint(M)===0;if(C&&E)return F&&!b?M:!F&&b?R:null;if(C)return b&&p.x===R.x&&p.y===R.y?null:p;if(E)return F&&M.x===w.x&&M.y===w.y?null:w;if(F&&b)return null;if(F)return M;if(b)return R;let B=Fe(p,this.vector(),w,s.vector());return B===null||!P(d,B)?null:U.round(B.x,B.y)}split(s){let l=[],a=s.events!==void 0,d=new re(s,!0),p=new re(s,!1),M=this.rightSE;this.replaceRightSE(p),l.push(p),l.push(d);let w=new ve(d,M,this.rings.slice(),this.windings.slice());return re.comparePoints(w.leftSE.point,w.rightSE.point)>0&&w.swapEvents(),re.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),a&&(d.checkForConsuming(),p.checkForConsuming()),l}swapEvents(){let s=this.rightSE;this.rightSE=this.leftSE,this.leftSE=s,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let l=0,a=this.windings.length;l<a;l++)this.windings[l]*=-1}consume(s){let l=this,a=s;for(;l.consumedBy;)l=l.consumedBy;for(;a.consumedBy;)a=a.consumedBy;let d=ve.compare(l,a);if(d!==0){if(d>0){let p=l;l=a,a=p}if(l.prev===a){let p=l;l=a,a=p}for(let p=0,M=a.rings.length;p<M;p++){let w=a.rings[p],R=a.windings[p],E=l.rings.indexOf(w);E===-1?(l.rings.push(w),l.windings.push(R)):l.windings[E]+=R}a.rings=null,a.windings=null,a.consumedBy=l,a.leftSE.consumedBy=l.leftSE,a.rightSE.consumedBy=l.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 s=this.prev.consumedBy||this.prev;this._beforeState=s.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let s=this.beforeState();this._afterState={rings:s.rings.slice(0),windings:s.windings.slice(0),multiPolys:[]};let l=this._afterState.rings,a=this._afterState.windings,d=this._afterState.multiPolys;for(let w=0,R=this.rings.length;w<R;w++){let E=this.rings[w],C=this.windings[w],b=l.indexOf(E);b===-1?(l.push(E),a.push(C)):a[b]+=C}let p=[],M=[];for(let w=0,R=l.length;w<R;w++){if(a[w]===0)continue;let E=l[w],C=E.poly;if(M.indexOf(C)===-1)if(E.isExterior)p.push(C);else{M.indexOf(C)===-1&&M.push(C);let b=p.indexOf(E.poly);b!==-1&&p.splice(b,1)}}for(let w=0,R=p.length;w<R;w++){let E=p[w].multiPoly;d.indexOf(E)===-1&&d.push(E)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let s=this.beforeState().multiPolys,l=this.afterState().multiPolys;switch(Pe.type){case"union":{let a=s.length===0,d=l.length===0;this._isInResult=a!==d;break}case"intersection":{let a,d;s.length<l.length?(a=s.length,d=l.length):(a=l.length,d=s.length),this._isInResult=d===Pe.numMultiPolys&&a<d;break}case"xor":{let a=Math.abs(s.length-l.length);this._isInResult=a%2===1;break}case"difference":{let a=d=>d.length===1&&d[0].isSubject;this._isInResult=a(s)!==a(l);break}default:throw new Error(`Unrecognized operation type found ${Pe.type}`)}return this._isInResult}}class De{constructor(s,l,a){if(!Array.isArray(s)||s.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=l,this.isExterior=a,this.segments=[],typeof s[0][0]!="number"||typeof s[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let d=U.round(s[0][0],s[0][1]);this.bbox={ll:{x:d.x,y:d.y},ur:{x:d.x,y:d.y}};let p=d;for(let M=1,w=s.length;M<w;M++){if(typeof s[M][0]!="number"||typeof s[M][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let R=U.round(s[M][0],s[M][1]);R.x===p.x&&R.y===p.y||(this.segments.push(ve.fromRing(p,R,this)),R.x<this.bbox.ll.x&&(this.bbox.ll.x=R.x),R.y<this.bbox.ll.y&&(this.bbox.ll.y=R.y),R.x>this.bbox.ur.x&&(this.bbox.ur.x=R.x),R.y>this.bbox.ur.y&&(this.bbox.ur.y=R.y),p=R)}(d.x!==p.x||d.y!==p.y)&&this.segments.push(ve.fromRing(p,d,this))}getSweepEvents(){let s=[];for(let l=0,a=this.segments.length;l<a;l++){let d=this.segments[l];s.push(d.leftSE),s.push(d.rightSE)}return s}}class Ie{constructor(s,l){if(!Array.isArray(s))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new De(s[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 a=1,d=s.length;a<d;a++){let p=new De(s[a],this,!1);p.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=p.bbox.ll.x),p.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=p.bbox.ll.y),p.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=p.bbox.ur.x),p.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=p.bbox.ur.y),this.interiorRings.push(p)}this.multiPoly=l}getSweepEvents(){let s=this.exteriorRing.getSweepEvents();for(let l=0,a=this.interiorRings.length;l<a;l++){let d=this.interiorRings[l].getSweepEvents();for(let p=0,M=d.length;p<M;p++)s.push(d[p])}return s}}class Le{constructor(s,l){if(!Array.isArray(s))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof s[0][0][0]=="number"&&(s=[s])}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 a=0,d=s.length;a<d;a++){let p=new Ie(s[a],this);p.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=p.bbox.ll.x),p.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=p.bbox.ll.y),p.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=p.bbox.ur.x),p.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=p.bbox.ur.y),this.polys.push(p)}this.isSubject=l}getSweepEvents(){let s=[];for(let l=0,a=this.polys.length;l<a;l++){let d=this.polys[l].getSweepEvents();for(let p=0,M=d.length;p<M;p++)s.push(d[p])}return s}}class Me{static factory(s){let l=[];for(let a=0,d=s.length;a<d;a++){let p=s[a];if(!p.isInResult()||p.ringOut)continue;let M=null,w=p.leftSE,R=p.rightSE,E=[w],C=w.point,b=[];for(;M=w,w=R,E.push(w),w.point!==C;)for(;;){let F=w.getAvailableLinkedEvents();if(F.length===0){let H=E[0].point,J=E[E.length-1].point;throw new Error(`Unable to complete output ring starting at [${H.x}, ${H.y}]. Last matching segment found ends at [${J.x}, ${J.y}].`)}if(F.length===1){R=F[0].otherSE;break}let B=null;for(let H=0,J=b.length;H<J;H++)if(b[H].point===w.point){B=H;break}if(B!==null){let H=b.splice(B)[0],J=E.splice(H.index);J.unshift(J[0].otherSE),l.push(new Me(J.reverse()));continue}b.push({index:E.length,point:w.point});let z=w.getLeftmostComparator(M);R=F.sort(z)[0].otherSE;break}l.push(new Me(E))}return l}constructor(s){this.events=s;for(let l=0,a=s.length;l<a;l++)s[l].segment.ringOut=this;this.poly=null}getGeom(){let s=this.events[0].point,l=[s];for(let E=1,C=this.events.length-1;E<C;E++){let b=this.events[E].point,F=this.events[E+1].point;me(b,s,F)!==0&&(l.push(b),s=b)}if(l.length===1)return null;let a=l[0],d=l[1];me(a,s,d)===0&&l.shift(),l.push(l[0]);let p=this.isExteriorRing()?1:-1,M=this.isExteriorRing()?0:l.length-1,w=this.isExteriorRing()?l.length:-1,R=[];for(let E=M;E!=w;E+=p)R.push([l[E].x,l[E].y]);return R}isExteriorRing(){if(this._isExteriorRing===void 0){let s=this.enclosingRing();this._isExteriorRing=s?!s.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let s=this.events[0];for(let d=1,p=this.events.length;d<p;d++){let M=this.events[d];re.compare(s,M)>0&&(s=M)}let l=s.segment.prevInResult(),a=l?l.prevInResult():null;for(;;){if(!l)return null;if(!a)return l.ringOut;if(a.ringOut!==l.ringOut)return a.ringOut.enclosingRing()!==l.ringOut?l.ringOut:l.ringOut.enclosingRing();l=a.prevInResult(),a=l?l.prevInResult():null}}}class Ge{constructor(s){this.exteriorRing=s,s.poly=this,this.interiorRings=[]}addInterior(s){this.interiorRings.push(s),s.poly=this}getGeom(){let s=[this.exteriorRing.getGeom()];if(s[0]===null)return null;for(let l=0,a=this.interiorRings.length;l<a;l++){let d=this.interiorRings[l].getGeom();d!==null&&s.push(d)}return s}}class $e{constructor(s){this.rings=s,this.polys=this._composePolys(s)}getGeom(){let s=[];for(let l=0,a=this.polys.length;l<a;l++){let d=this.polys[l].getGeom();d!==null&&s.push(d)}return s}_composePolys(s){let l=[];for(let a=0,d=s.length;a<d;a++){let p=s[a];if(!p.poly)if(p.isExteriorRing())l.push(new Ge(p));else{let M=p.enclosingRing();M.poly||l.push(new Ge(M)),M.poly.addInterior(p)}}return l}}class Ne{constructor(s){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ve.compare;this.queue=s,this.tree=new f(l),this.segments=[]}process(s){let l=s.segment,a=[];if(s.consumedBy)return s.isLeft?this.queue.remove(s.otherSE):this.tree.remove(l),a;let d=s.isLeft?this.tree.add(l):this.tree.find(l);if(!d)throw new Error(`Unable to find segment #${l.id} [${l.leftSE.point.x}, ${l.leftSE.point.y}] -> [${l.rightSE.point.x}, ${l.rightSE.point.y}] in SweepLine tree.`);let p=d,M=d,w,R;for(;w===void 0;)p=this.tree.prev(p),p===null?w=null:p.key.consumedBy===void 0&&(w=p.key);for(;R===void 0;)M=this.tree.next(M),M===null?R=null:M.key.consumedBy===void 0&&(R=M.key);if(s.isLeft){let E=null;if(w){let b=w.getIntersection(l);if(b!==null&&(l.isAnEndpoint(b)||(E=b),!w.isAnEndpoint(b))){let F=this._splitSafely(w,b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}}let C=null;if(R){let b=R.getIntersection(l);if(b!==null&&(l.isAnEndpoint(b)||(C=b),!R.isAnEndpoint(b))){let F=this._splitSafely(R,b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}}if(E!==null||C!==null){let b=null;E===null?b=C:C===null?b=E:b=re.comparePoints(E,C)<=0?E:C,this.queue.remove(l.rightSE),a.push(l.rightSE);let F=l.split(b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}a.length>0?(this.tree.remove(l),a.push(s)):(this.segments.push(l),l.prev=w)}else{if(w&&R){let E=w.getIntersection(R);if(E!==null){if(!w.isAnEndpoint(E)){let C=this._splitSafely(w,E);for(let b=0,F=C.length;b<F;b++)a.push(C[b])}if(!R.isAnEndpoint(E)){let C=this._splitSafely(R,E);for(let b=0,F=C.length;b<F;b++)a.push(C[b])}}}this.tree.remove(l)}return a}_splitSafely(s,l){this.tree.remove(s);let a=s.rightSE;this.queue.remove(a);let d=s.split(l);return d.push(a),s.consumedBy===void 0&&this.tree.add(s),d}}let ht=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,pt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Et{run(s,l,a){Pe.type=s,U.reset();let d=[new Le(l,!0)];for(let b=0,F=a.length;b<F;b++)d.push(new Le(a[b],!1));if(Pe.numMultiPolys=d.length,Pe.type==="difference"){let b=d[0],F=1;for(;F<d.length;)_(d[F].bbox,b.bbox)!==null?F++:d.splice(F,1)}if(Pe.type==="intersection")for(let b=0,F=d.length;b<F;b++){let B=d[b];for(let z=b+1,H=d.length;z<H;z++)if(_(B.bbox,d[z].bbox)===null)return[]}let p=new f(re.compare);for(let b=0,F=d.length;b<F;b++){let B=d[b].getSweepEvents();for(let z=0,H=B.length;z<H;z++)if(p.insert(B[z]),p.size>ht)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let M=new Ne(p),w=p.size,R=p.pop();for(;R;){let b=R.key;if(p.size===w){let B=b.segment;throw new Error(`Unable to pop() ${b.isLeft?"left":"right"} SweepEvent [${b.point.x}, ${b.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(p.size>ht)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(M.segments.length>pt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let F=M.process(b);for(let B=0,z=F.length;B<z;B++){let H=F[B];H.consumedBy===void 0&&p.insert(H)}w=p.size,R=p.pop()}U.reset();let E=Me.factory(M.segments);return new $e(E).getGeom()}}let Pe=new Et;var cr={union:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("union",y,l)},intersection:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("intersection",y,l)},xor:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("xor",y,l)},difference:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("difference",y,l)}};return cr})});var it=new Set,Rt=!1;function Oe(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length;it.size&&it.clear();let o=sn(e,0,i,n,!0),u=[];if(!o||o.next===o.prev)return u;let c=0,f=0,h=0;if(r&&(o=Rr(e,t,o,n)),e.length>80*n){c=e[0],f=e[1];let m=c,g=f;for(let x=n;x<i;x+=n){let v=e[x],S=e[x+1];v<c&&(c=v),S<f&&(f=S),v>m&&(m=v),S>g&&(g=S)}h=Math.max(m-c,g-f),h=h!==0?32767/h:0}return Ft(o,u,c,f,h),u}function sn(e,t,n,r,i){let o=null;if(i===Ur(e,t,n,r)>0)for(let u=t;u<n;u+=r)o=on(u/r|0,e[u],e[u+1],o);else for(let u=n-r;u>=t;u-=r)o=on(u/r|0,e[u],e[u+1],o);return o&&ot(o,o.next)&&(ut(o),o=o.next),o}function ze(e,t=e){let n=t===e,r=e,i;do i=!1,r!==r.next&&(it.size===0||!it.has(r))&&(ot(r,r.next)||ue(r.prev,r,r.next)===0)?((n||r===t)&&(t=r.prev),Rt=!0,ut(r),r=r.prev,i=!0):(n||r!==t)&&(r=r.next,i=!n);while(i||r!==t);return t}function Ft(e,t,n,r,i){i&&Br(e,n,r,i);let o=e,u=!1;for(;e.prev!==e.next;){let c=e.prev,f=e.next;if(ue(c,e,f)<0&&(i?Sr(e,n,r,i):vr(e))){t.push(c.i,e.i,f.i),ut(e),e=f,o=f;continue}if(e=f,e===o){if(Rt=!1,e=ze(e),Rt){o=e;continue}if(!u){e=Mr(e,t),o=e,u=!0;continue}Er(e,t,n,r,i);break}}}function vr(e){let t=e.prev,n=e,r=e.next,i=t.x,o=n.x,u=r.x,c=t.y,f=n.y,h=r.y,m=Math.min(i,o,u),g=Math.min(c,f,h),x=Math.max(i,o,u),v=Math.max(c,f,h),S=r.next;for(;S!==t;){if(S.x>=m&&S.x<=x&&S.y>=g&&S.y<=v&&!(i===S.x&&c===S.y)&&gt(i,c,o,f,u,h,S.x,S.y)&&ue(S.prev,S,S.next)>=0)return!1;S=S.next}return!0}function Sr(e,t,n,r){let i=e.prev,o=e,u=e.next,c=i.x,f=o.x,h=u.x,m=i.y,g=o.y,x=u.y,v=Math.min(c,f,h),S=Math.min(m,g,x),P=Math.max(c,f,h),_=Math.max(m,g,x),I=_t(v,S,t,n,r),A=_t(P,_,t,n,r),k=e.prevZ;for(;k&&k.z>=I;){if(k.x>=v&&k.x<=P&&k.y>=S&&k.y<=_&&k!==u&&!(c===k.x&&m===k.y)&&gt(c,m,f,g,h,x,k.x,k.y)&&ue(k.prev,k,k.next)>=0)return!1;k=k.prevZ}let L=e.nextZ;for(;L&&L.z<=A;){if(L.x>=v&&L.x<=P&&L.y>=S&&L.y<=_&&L!==u&&!(c===L.x&&m===L.y)&&gt(c,m,f,g,h,x,L.x,L.y)&&ue(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function Mr(e,t){let n=e,r=!1;do{let i=n.prev,o=n.next.next;cn(i,n,n.next,o,!1)&&st(i,o)&&st(o,i)&&(t.push(i.i,n.i,o.i),ut(n),ut(n.next),n=e=o,r=!0),n=n.next}while(n!==e);return r?ze(n):n}function Er(e,t,n,r,i){let o=e;do{let u=o.next.next;for(;u!==o.prev;){if(o.i!==u.i&&Cr(o,u)){let c=fn(o,u);o=ze(o,o.next),c=ze(c,c.next),Ft(o,t,n,r,i),Ft(c,t,n,r,i);return}u=u.next}o=o.next}while(o!==e)}var It=!1;function Rr(e,t,n,r){let i=[];for(let o=0,u=t.length;o<u;o++){let c=t[o]*r,f=o<u-1?t[o+1]*r:e.length,h=sn(e,c,f,r,!1);h===h.next&&it.add(h),i.push(Tr(h))}i.sort(Fr),Pr(e.length/r,t.length),ln(n,n),It=!0;for(let o=0;o<i.length;o++)n=Ir(i[o],n);return It=!1,ze(n)}function Fr(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function Ir(e,t){let n=_r(e,t);if(!n)return t;let r=fn(n,e),i=r.next;return ln(n,i.next),ze(r,r.next),ze(n,n.next)}var un=16,ie=new Float64Array(0),xt=0,Pt=[],kt=[];function Pr(e,t){let n=Math.ceil((e+2*t)/un)+t+2;ie.length<n*4&&(ie=new Float64Array(n*4)),xt=0}function ln(e,t){let n=e;do{let r=xt++;Pt[r]=n;let i=1/0,o=1/0,u=-1/0,c=-1/0,f=0;do{let m=n.next;n.z=r,n.x<i&&(i=n.x),n.x>u&&(u=n.x),n.y<o&&(o=n.y),n.y>c&&(c=n.y),m.x<i&&(i=m.x),m.x>u&&(u=m.x),m.y<o&&(o=m.y),m.y>c&&(c=m.y),n=m}while(++f<un&&n!==t);kt[r]=n;let h=r*4;ie[h]=i,ie[h+1]=o,ie[h+2]=u,ie[h+3]=c}while(n!==t)}function kr(e,t){let n=e.z*4;t.x<ie[n]&&(ie[n]=t.x),t.y<ie[n+1]&&(ie[n+1]=t.y),t.x>ie[n+2]&&(ie[n+2]=t.x),t.y>ie[n+3]&&(ie[n+3]=t.y)}function nn(e){let t=kt[e];for(;t.prev.next!==t;)t=t.next;return kt[e]=t,t}function rn(e){let t=Pt[e];for(;t.prev.next!==t;)t=t.next;return Pt[e]=t,t}function _r(e,t){let n=t,r=e.x,i=e.y,o=-1/0,u;if(ot(e,n))return n;for(let x=0,v=0;x<xt;x++,v+=4){if(i<ie[v+1]||i>ie[v+3]||ie[v]>r||ie[v+2]<=o)continue;let S=nn(x);n=rn(x);do{if(n.prev.next===n){if(ot(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let P=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(P<=r&&P>o&&(o=P,u=n.x<n.next.x?n:n.next,P===r))return u}}n=n.next}while(n!==S)}if(!u)return null;let c=u.x,f=u.y,h=Math.min(i,f),m=Math.max(i,f),g=1/0;for(let x=0,v=0;x<xt;x++,v+=4){if(ie[v+2]<c||ie[v]>r||ie[v+3]<h||ie[v+1]>m)continue;let S=nn(x);n=rn(x);do{if(n.prev.next===n&&r>=n.x&&n.x>=c&&r!==n.x&&gt(i<f?r:o,i,c,f,i<f?o:r,i,n.x,n.y)){let P=Math.abs(i-n.y)/(r-n.x);(st(n,e)||n.y===i&&n.next.y===i&&n.next.x>r)&&(P<g||P===g&&(n.x>u.x||n.x===u.x&&Ar(u,n)))&&(u=n,g=P)}n=n.next}while(n!==S)}return u}function Ar(e,t){return ue(e.prev,e,t.prev)<0&&ue(t.next,e,e.next)<0}var Re=[],tt=[],He=new Uint32Array(0),nt=new Uint32Array(0),rt=new Uint32Array(256);function Br(e,t,n,r){let i=e,o=0;do i.z=_t(i.x,i.y,t,n,r),Re[o++]=i,i=i.next;while(i!==e);Lr(o);let u=null;for(let c=0;c<o;c++){let f=Re[c];f.prevZ=u,u&&(u.nextZ=f),u=f}u.nextZ=null}function Lr(e){if(e<=32){for(let t=1;t<e;t++){let n=Re[t],r=n.z,i=t-1;for(;i>=0&&Re[i].z>r;)Re[i+1]=Re[i],i--;Re[i+1]=n}return}He.length<e&&(He=new Uint32Array(e),nt=new Uint32Array(e),tt=new Array(e));for(let t=0;t<e;t++)He[t]=Re[t].z;mt(e,Re,He,tt,nt,0),mt(e,tt,nt,Re,He,8),mt(e,Re,He,tt,nt,16),mt(e,tt,nt,Re,He,24)}function mt(e,t,n,r,i,o){rt.fill(0);for(let c=0;c<e;c++)rt[n[c]>>>o&255]++;let u=0;for(let c=0;c<256;c++){let f=rt[c];rt[c]=u,u+=f}for(let c=0;c<e;c++){let f=n[c],h=rt[f>>>o&255]++;r[h]=t[c],i[h]=f}}function _t(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Tr(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function gt(e,t,n,r,i,o,u,c){return(i-u)*(t-c)>=(e-u)*(o-c)&&(e-u)*(r-c)>=(n-u)*(t-c)&&(n-u)*(o-c)>=(i-u)*(r-c)}function Cr(e,t){let n=ot(e,t)&&ue(e.prev,e,e.next)>0&&ue(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||st(e,t)&&st(t,e)&&(ue(e.prev,e,t.prev)!==0||ue(e,t.prev,t)!==0))&&!Vr(e,t)&&(n||Or(e,t))}function ue(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ot(e,t){return e.x===t.x&&e.y===t.y}function cn(e,t,n,r,i=!0){let o=ue(e,t,n),u=ue(e,t,r),c=ue(n,r,e),f=ue(n,r,t);return(o>0&&u<0||o<0&&u>0)&&(c>0&&f<0||c<0&&f>0)?!0:i?!!(o===0&&dt(e,n,t)||u===0&&dt(e,r,t)||c===0&&dt(n,e,r)||f===0&&dt(n,t,r)):!1}function dt(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Vr(e,t){let n=Math.min(e.x,t.x),r=Math.max(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.y,t.y),u=e;do{let c=u.next;if(u.x>r&&c.x>r||u.x<n&&c.x<n||u.y>o&&c.y>o||u.y<i&&c.y<i){u=c;continue}if(u.i!==e.i&&c.i!==e.i&&u.i!==t.i&&c.i!==t.i&&cn(u,c,e,t))return!0;u=c}while(u!==e);return!1}function st(e,t){return ue(e.prev,e,e.next)<0?ue(e,t,e.next)>=0&&ue(e,e.prev,t)>=0:ue(e,t,e.prev)<0||ue(e,e.next,t)<0}function Or(e,t){let n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{let u=n.next;n.y>o!=u.y>o&&i<(u.x-n.x)*(o-n.y)/(u.y-n.y)+n.x&&(r=!r),n=u}while(n!==e);return r}function fn(e,t){let n=At(e.i,e.x,e.y),r=At(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function on(e,t,n,r){let i=At(e,t,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 ut(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),It&&kr(e.prev,e.next)}function At(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Ur(e,t,n,r){let i=0;for(let o=t,u=n-r;o<n;o+=r)i+=(e[u]-e[o])*(e[o+1]+e[u+1]),u=o;return i}var an=23283064365386963e-26,Dr=12,hn=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Bt=0,yt=1,lt=2,bt=5,ct=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,n,r=this.length){for(;this.pos<r;){let i=this.readVarint(),o=i>>3,u=this.pos;this.type=i&7,t(o,n,this),this.pos===u&&this.skip(i)}return n}readMessage(t,n){return this.readFields(t,n,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){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,Gr(r,t,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let t=this.readVarint();return t%2===1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=Dr&&hn?hn.decode(this.buf.subarray(n,t)):qr(this.buf,n,t)}readBytes(){let t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n}readPackedVarint(t=[],n){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readVarint(n));return t}readPackedSVarint(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===lt?this.readVarint()+this.pos:this.pos+1}skip(t){let n=t&7;if(n===Bt)for(;this.buf[this.pos++]>127;);else if(n===lt)this.pos=this.readVarint()+this.pos;else if(n===bt)this.pos+=4;else if(n===yt)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(t,n){this.writeVarint(t<<3|n)}realloc(t){let n=this.length||16;for(;n<this.pos+t;)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(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*an),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*an),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>268435455||t<0){Nr(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let n=this.pos;this.pos=ei(this.buf,t,this.pos);let r=this.pos-n;r>=128&&pn(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let n=t.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=t[r]}writeRawMessage(t,n){this.pos++;let r=this.pos;t(n,this);let i=this.pos-r;i>=128&&pn(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,n,r){this.writeTag(t,lt),this.writeRawMessage(n,r)}writePackedVarint(t,n){n.length&&this.writeMessage(t,jr,n)}writePackedSVarint(t,n){n.length&&this.writeMessage(t,$r,n)}writePackedBoolean(t,n){n.length&&this.writeMessage(t,Zr,n)}writePackedFloat(t,n){n.length&&this.writeMessage(t,Xr,n)}writePackedDouble(t,n){n.length&&this.writeMessage(t,Yr,n)}writePackedFixed32(t,n){n.length&&this.writeMessage(t,Wr,n)}writePackedSFixed32(t,n){n.length&&this.writeMessage(t,Qr,n)}writePackedFixed64(t,n){n.length&&this.writeMessage(t,Kr,n)}writePackedSFixed64(t,n){n.length&&this.writeMessage(t,Jr,n)}writeBytesField(t,n){this.writeTag(t,lt),this.writeBytes(n)}writeFixed32Field(t,n){this.writeTag(t,bt),this.writeFixed32(n)}writeSFixed32Field(t,n){this.writeTag(t,bt),this.writeSFixed32(n)}writeFixed64Field(t,n){this.writeTag(t,yt),this.writeFixed64(n)}writeSFixed64Field(t,n){this.writeTag(t,yt),this.writeSFixed64(n)}writeVarintField(t,n){this.writeTag(t,Bt),this.writeVarint(n)}writeSVarintField(t,n){this.writeTag(t,Bt),this.writeSVarint(n)}writeStringField(t,n){this.writeTag(t,lt),this.writeString(n)}writeFloatField(t,n){this.writeTag(t,bt),this.writeFloat(n)}writeDoubleField(t,n){this.writeTag(t,yt),this.writeDouble(n)}writeBooleanField(t,n){this.writeVarintField(t,+n)}};function Gr(e,t,n){let r=n.buf,i,o;if(o=r[n.pos++],i=(o&112)>>4,o<128||(o=r[n.pos++],i|=(o&127)<<3,o<128)||(o=r[n.pos++],i|=(o&127)<<10,o<128)||(o=r[n.pos++],i|=(o&127)<<17,o<128)||(o=r[n.pos++],i|=(o&127)<<24,o<128)||(o=r[n.pos++],i|=(o&1)<<31,o<128))return Xe(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function Xe(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Nr(e,t){let n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(n=~(-e%4294967296),r=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");t.realloc(10),Hr(n,r,t),zr(r,t)}function Hr(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function zr(e,t){let n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function pn(e,t,n){let r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(r);for(let i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function jr(e,t){for(let n=0;n<e.length;n++)t.writeVarint(e[n])}function $r(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function Xr(e,t){for(let n=0;n<e.length;n++)t.writeFloat(e[n])}function Yr(e,t){for(let n=0;n<e.length;n++)t.writeDouble(e[n])}function Zr(e,t){for(let n=0;n<e.length;n++)t.writeBoolean(e[n])}function Wr(e,t){for(let n=0;n<e.length;n++)t.writeFixed32(e[n])}function Qr(e,t){for(let n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Kr(e,t){for(let n=0;n<e.length;n++)t.writeFixed64(e[n])}function Jr(e,t){for(let n=0;n<e.length;n++)t.writeSFixed64(e[n])}function qr(e,t,n){let r="",i=t;for(;i<n;){let o=e[i],u=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c>n)break;let f,h,m;c===1?o<128&&(u=o):c===2?(f=e[i+1],(f&192)===128&&(u=(o&31)<<6|f&63,u<=127&&(u=null))):c===3?(f=e[i+1],h=e[i+2],(f&192)===128&&(h&192)===128&&(u=(o&15)<<12|(f&63)<<6|h&63,(u<=2047||u>=55296&&u<=57343)&&(u=null))):c===4&&(f=e[i+1],h=e[i+2],m=e[i+3],(f&192)===128&&(h&192)===128&&(m&192)===128&&(u=(o&15)<<18|(f&63)<<12|(h&63)<<6|m&63,(u<=65535||u>=1114112)&&(u=null))),u===null?(u=65533,c=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|u&1023),r+=String.fromCharCode(u),i+=c}return r}function ei(e,t,n){for(let r=0,i,o;r<t.length;r++){if(i=t.charCodeAt(r),i>55295&&i<57344)if(o)if(i<56320){e[n++]=239,e[n++]=191,e[n++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||r+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):o=i;continue}else o&&(e[n++]=239,e[n++]=191,e[n++]=189,o=null);i<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:(i<65536?e[n++]=i>>12|224:(e[n++]=i>>18|240,e[n++]=i>>12&63|128),e[n++]=i>>6&63|128),e[n++]=i&63|128)}return n}var Lt=class e{constructor(t,n,r,i){this.pbf=t;this.keys=n;this.values=r;this.extent=i;this.type=0;this.properties={};this.geomOffset=-1}static read(t,n,r,i,o){let u=new e(t,r,i,o);return t.readFields(ti,u,n),u}loadGeometry(){if(this.geomOffset<0)return[];let t=this.pbf,n=t.pos;t.pos=this.geomOffset;let r=t.readVarint()+t.pos,i=1,o=0,u=0,c=0,f=[],h=[];for(;t.pos<r;){if(o<=0){let m=t.readVarint();i=m&7,o=m>>3}if(o--,i===1||i===2)u+=t.readSVarint(),c+=t.readSVarint(),i===1&&(h.length&&f.push(h),h=[]),h.push(u,c);else if(i===7)h.length>=2&&h.push(h[0],h[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 h.length&&f.push(h),t.pos=n,f}bbox(){let t=this.loadGeometry(),n=1/0,r=1/0,i=-1/0,o=-1/0;for(let u of t)for(let c=0;c<u.length;c+=2)u[c]<n&&(n=u[c]),u[c]>i&&(i=u[c]),u[c+1]<r&&(r=u[c+1]),u[c+1]>o&&(o=u[c+1]);return[n,r,i,o]}};function ti(e,t,n){n&&(e===1?t.id=n.readVarint():e===2?ni(n,t):e===3?t.type=n.readVarint():e===4&&(t.geomOffset=n.pos,n.skip(2)))}function ni(e,t){let n=e.readVarint()+e.pos;for(;e.pos<n;){let r=t.keys[e.readVarint()],i=t.values[e.readVarint()];r!==void 0&&(t.properties[r]=i)}}var Tt=class e{constructor(t){this.pbf=t;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(t,n){let r=new e(t);return t.readFields(ri,r,n),r}get length(){return this.featureOffsets.length}feature(t){let n=this.pbf;n.pos=this.featureOffsets[t];let r=n.readVarint()+n.pos;return Lt.read(n,r,this.keys,this.values,this.extent)}*features(){for(let t=0;t<this.featureOffsets.length;t++)yield this.feature(t)}};function ri(e,t,n){n&&(e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t.featureOffsets.push(n.pos):e===3?t.keys.push(n.readString()):e===4&&t.values.push(ii(n)))}function ii(e){let t=e.readVarint()+e.pos,n=null;for(;e.pos<t;){let r=e.readVarint()>>3;r===1?n=e.readString():r===2?n=e.readFloat():r===3?n=e.readDouble():r===4?n=e.readVarint64():r===5?n=e.readVarint():r===6?n=e.readSVarint():r===7?n=e.readBoolean():e.skip(r)}return n}var wt=class{constructor(t){this.layers={};new ct(t instanceof Uint8Array?t:new Uint8Array(t)).readFields((r,i,o)=>{if(r===3&&o){let u=Tt.read(o,o.readVarint()+o.pos);u.length&&(this.layers[u.name]=u)}},null)}};function Ye(e){let t=[],n=null;for(let r of e){if(r.length<6)continue;let i=oi(r);i!==0&&(i>0?(n&&t.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&t.push(n),t}function oi(e){let t=0;for(let n=0,r=e.length-2;n<e.length;r=n,n+=2)t+=(e[r]-e[n])*(e[n+1]+e[r+1]);return t/2}function pe(e,t){if(!e)return!0;let n=e[0];switch(n){case"all":return e.slice(1).every(r=>pe(r,t));case"any":return e.slice(1).some(r=>pe(r,t));case"!":return!pe(e[1],t);case"has":return t[e[1]]!=null;case"!has":return t[e[1]]==null;case"in":{let r=t[e[1]];return r==null?!1:e.slice(2).includes(r)}case"!in":{let r=t[e[1]];return r==null?!0:!e.slice(2).includes(r)}default:{let r=t[e[1]],i=e[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 si=Math.PI/8,ui=.35,li=32,dn=.25,xn=.5,gn=.07;function Ce(e,t){let n=t.radius;if(!(n>0))return e;let r=e.length/2-1;if(r<3)return e;let i=Math.max(2,Math.round(t.segments??4)),o=Math.max(t.minCutRatio??ui,0),u=t.extent,c=[];for(let f=0;f<r;f++){let h=e[f*2],m=e[f*2+1],g=e[(f+r-1)%r*2],x=e[(f+r-1)%r*2+1],v=e[(f+1)%r*2],S=e[(f+1)%r*2+1],P=h-g,_=m-x,I=v-h,A=S-m,k=Math.hypot(P,_),L=Math.hypot(I,A);if(k<1e-6||L<1e-6){c.push(h,m);continue}let V=P/k,U=_/k,N=I/L,T=A/L;if(t.keep?.[f]){c.push(h,m);continue}let j=V*N+U*T;if(j>.985){c.push(h,m);continue}if(u!==void 0&&(h<=0||h>=u||m<=0||m>=u)){c.push(h,m);continue}let Y=Math.min(n,k*mn,L*mn);if(Y<n*o){c.push(h,m);continue}let $=h-V*Y,O=m-U*Y,G=h+N*Y,W=m+T*Y,D=Math.acos(Math.max(-1,Math.min(1,j))),Q=Math.min(si,Math.PI/2/i),oe=Math.ceil(D/Q-1e-6),ee=t.maxChord&&t.maxChord>0?Math.ceil(Y/Math.tan(D/2)*D/t.maxChord):0,ne=Math.max(1,Math.min(li,Math.max(Math.min(i,oe),ee)));c.push($,O);for(let Z=1;Z<ne;Z++){let le=Z/ne,K=1-le;c.push(K*K*$+2*K*le*h+le*le*G,K*K*O+2*K*le*m+le*le*W)}c.push(G,W)}return c.length<6?e:(c.push(c[0],c[1]),c)}var mn=.4;var we=e=>e/64;function Ve(e,t,n=0){let r=yn(e.outer,t,n);if(!r)return null;let i=[];for(let o of e.holes){let u=yn(o,t,n);u&&i.push(u)}return{outer:r,holes:i}}function yn(e,t,n){let r=[];for(let i=0;i<e.length-2;i+=2)r.push(e[i],e[i+1]);if(r.length<6)return null;for(let i=0;i<4;i++){let o=r;r=[];let u=o.length/2;if(u===0)return null;for(let c=0;c<u;c++){let f=o[c*2],h=o[c*2+1],m=o[(c+u-1)%u*2],g=o[(c+u-1)%u*2+1],x=bn(f,h,i,t,n),v=bn(m,g,i,t,n);if(x!==v){let S=ci(m,g,f,h,i,t,n),P=i===0?-n:i===1?t+n:m+(f-m)*S,_=i===2?-n:i===3?t+n:g+(h-g)*S;r.push(P,_)}x&&r.push(f,h)}}return r.length<6?null:(r.push(r[0],r[1]),r)}function bn(e,t,n,r,i){return n===0?e>=-i:n===1?e<=r+i:n===2?t>=-i:t<=r+i}function ci(e,t,n,r,i,o,u){return i===0?(-u-e)/(n-e):i===1?(o+u-e)/(n-e):i===2?(-u-t)/(r-t):(o+u-t)/(r-t)}function vt(e,t,n,r,i,o=0){let u=-o,c=i+o;return e===u&&n===u||e===c&&n===c||t===u&&r===u||t===c&&r===c}function Ct(e,t){for(let n=0;n<e.length;n+=2)if(e[n]<=0||e[n]>=t||e[n+1]<=0||e[n+1]>=t)return!0;return!1}var wn=1,Ut=18,Dt=32,vn=8,kn=65535/Dt,fi=9,ai=1,hi=0,pi=1,mi=2;var Sn=0,di=1,Mn=2,xi=3,gi=.47;function _n(e,t,n,r={},i){let o=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:gi,{b:u,ensure:c,take:f}=yi(Math.max(1024,e.length*48));for(let h of e.features()){if(h.type!==3||!pe(n,h.properties))continue;let m=Di(h.properties),g=Gi(h.properties,m);if(m<=g)continue;let x=Hi(h.properties)??Number(h.id??0),v=Ui(x>>>0),S=Oi(v,h.properties),P=Vi(h.properties,m),_=Ye(h.loadGeometry()),I=i?_.some(A=>{let k=Ve(A,t,we(t));return k?Ct(k.outer,t):!1}):!1;for(let A of _){if(i&&I){let k=ji(A,t,m,g,x,v,S,P);k&&i.push(k)}zi(u,A,c,{extent:t,metersPerUnit:o,height:m,minHeight:g,featureId:x,seed:v,tint:S,facade:P,props:h.properties,cornerRadius:r.cornerRadius??0,cornerSegments:r.cornerSegments,whole:!1})}}return f(t)}function yi(e){let t=e,n=new ArrayBuffer(t*Ut),r={verts:new DataView(n),vertsU8:new Uint8Array(n),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},i=u=>{if(r.vertexCount+u<=t)return;t=Math.max(t*2,r.vertexCount+u);let c=new ArrayBuffer(t*Ut);new Uint8Array(c).set(r.vertsU8.subarray(0,r.vertOffset)),n=c,r.verts=new DataView(c),r.vertsU8=new Uint8Array(c)};return r.ensure=i,{b:r,ensure:i,take:u=>{if(!r.indices.length)return null;let c=new Uint32Array(r.indices),f=new Float64Array(r.featureIds);return{vertices:n.slice(0,r.vertOffset),indices:c.buffer,featureIds:f.buffer,vertexCount:r.vertexCount,indexCount:c.length,extent:u}}}}var Gt=(e,t)=>e|t<<2,En=e=>Math.max(-32768,Math.min(32767,e)),Vt=e=>Math.max(0,Math.min(65535,Math.round(Math.min(e,kn)*Dt)));function Ze(e,t,n,r,i,o,u,c,f,h,m=0,g=0,x=0){let v=e.vertOffset;return e.verts.setInt16(v,En(Math.round(t*vn)),!0),e.verts.setInt16(v+2,En(Math.round(n*vn)),!0),e.verts.setUint16(v+4,Math.round(Math.min(r,kn)*Dt),!0),e.vertsU8[v+6]=f,e.vertsU8[v+7]=c,e.verts.setInt8(v+8,Ot(Math.round(i*127))),e.verts.setInt8(v+9,Ot(Math.round(o*127))),e.verts.setInt8(v+10,Ot(Math.round(u*127))),e.vertsU8[v+11]=h,e.verts.setUint16(v+12,Vt(m),!0),e.verts.setUint16(v+14,Vt(g),!0),e.verts.setUint16(v+16,Vt(x),!0),e.vertOffset+=Ut,e.vertexCount++}function Rn(e,t,n,r,i,o,u,c,f,h){let m=t.length/2;if(m<3)return;let g=Gt(hi,u),x=wi(t,c),v=r-n,S=new Float64Array(m*2),P=new Uint8Array(m);{let _=new Float64Array(m*2);for(let I=0;I<m-1;I++){let A=t[I*2+2]-t[I*2],k=t[I*2+3]-t[I*2+1],L=Math.hypot(A,k)||1;_[I*2]=k/L,_[I*2+1]=-A/L}for(let I=0;I<m-1;I++){let A=(I+m-2)%(m-1),k=_[A*2]*_[I*2]+_[A*2+1]*_[I*2+1],L=_[A*2]+_[I*2],V=_[A*2+1]+_[I*2+1],U=Math.hypot(L,V);k>.5&&U>1e-6&&(S[I*2]=L/U,S[I*2+1]=V/U,P[I]=1)}}for(let _=0;_<m-1;_++){let I=t[_*2],A=t[_*2+1],k=t[_*2+2],L=t[_*2+3];if(I===k&&A===L||h[_])continue;let V=k-I,U=L-A,N=Math.hypot(V,U)||1,T=U/N,j=-V/N,Y=x.offset[_],$=x.width[_],O=[0,1];if(f){for(let W=0;W<f.length;W++)for(let D=W+1;D<f.length;D++){let Q=je(f[W],I,A)-je(f[D],I,A),oe=je(f[W],k,L)-je(f[D],k,L);if(Q===oe)continue;let ee=Q/(Q-oe);ee>1e-4&&ee<1-1e-4&&O.push(ee)}O.sort((W,D)=>W-D)}let G=(W,D)=>{if(!f)return r;let Q=1/0;for(let oe of f)Q=Math.min(Q,je(oe,W,D));return Math.max(r,Q)};for(let W=0;W+1<O.length;W++){let D=O[W],Q=O[W+1];if(Q-D<1e-6)continue;let oe=I+V*D,ee=A+U*D,ne=I+V*Q,Z=A+U*Q,le=Y+N*D*c,K=Y+N*Q*c,q=(_+1)%(m-1),he=P[_]?S[_*2]:T,me=P[_]?S[_*2+1]:j,ce=P[q]?S[q*2]:T,fe=P[q]?S[q*2+1]:j,ae=T+(he-T)*(1-D),de=j+(me-j)*(1-D),Se=T+(ce-T)*Q,Fe=j+(fe-j)*Q,re=Math.hypot(ae,de)||1,Ue=Math.hypot(Se,Fe)||1,ve=ae/re,De=de/re,Ie=Se/Ue,Le=Fe/Ue;e.ensure(4);let Me=Ze(e,oe,ee,n,ve,De,0,0,o,g,le,$,v),Ge=Ze(e,ne,Z,n,Ie,Le,0,0,o,g,K,$,v),$e=Ze(e,oe,ee,G(oe,ee),ve,De,0,255,o,g,le,$,v),Ne=Ze(e,ne,Z,G(ne,Z),Ie,Le,0,255,o,g,K,$,v);e.indices.push(Me,Ne,Ge,Me,$e,Ne),e.featureIds.push(i,i)}}}var bi=.9976;function wi(e,t){let n=e.length/2-1,r=[];for(let f=0;f<n;f++){let h=e[f*2+2]-e[f*2],m=e[f*2+3]-e[f*2+1],g=Math.hypot(h,m);r.push(g>0?{x:h/g,y:m/g,len:g*t}:{x:0,y:0,len:0})}let i=(f,h)=>r[f].len>0&&r[h].len>0&&r[f].x*r[h].x+r[f].y*r[h].y>=bi,o=0;for(;o<n&&i((o-1+n)%n,o);)o++;o>=n&&(o=0);let u=new Array(n).fill(0),c=new Array(n).fill(0);for(let f=0;f<n;){let h=(o+f)%n,m=[h],g=r[h].len,x=f+1;for(;x<n;){let S=(o+x)%n;if(!i((o+x-1)%n,S))break;m.push(S),g+=r[S].len,x++}let v=0;for(let S of m)u[S]=v,c[S]=g,v+=r[S].len;f=x}return{offset:u,width:c}}function vi(e,t,n,r,i,o,u){let c=[],f=[];for(let x=0;x<t.length;x++)c.push(t[x]);for(let x of n){f.push(c.length/2);for(let v=0;v<x.length;v++)c.push(x[v])}let h=Oe(c,f.length?f:void 0,2);if(!h.length)return;let m=Gt(pi,u),g=e.vertexCount;for(let x=0;x<c.length;x+=2)Ze(e,c[x],c[x+1],r,0,0,1,255,o,m);for(let x=0;x<h.length;x+=3)e.indices.push(g+h[x],g+h[x+2],g+h[x+1]),e.featureIds.push(i)}function Si(e){let t=Mi(e);if(t.length<3)return null;let n=Math.abs(Ei(e));if(n<=0)return null;let r=null,i=1/0;for(let o=0;o<t.length;o++){let u=(o+1)%t.length,c=t[u].x-t[o].x,f=t[u].y-t[o].y,h=Math.hypot(c,f);if(h<1e-6)continue;c/=h,f/=h;let m=1/0,g=-1/0,x=1/0,v=-1/0;for(let L of t){let V=L.x*c+L.y*f,U=-L.x*f+L.y*c;V<m&&(m=V),V>g&&(g=V),U<x&&(x=U),U>v&&(v=U)}let S=g-m,P=v-x,_=S*P;if(_<=0||_>=i)continue;i=_;let I=(m+g)/2,A=(x+v)/2,k=S>=P;r={cx:I*c-A*f,cy:I*f+A*c,ax:k?c:-f,ay:k?f:c,halfLong:(k?S:P)/2,halfShort:(k?P:S)/2,fill:n/_}}return r}function Mi(e){let t=[];for(let o=0;o<e.length-2;o+=2)t.push({x:e[o],y:e[o+1]});if(t.length<3)return t;t.sort((o,u)=>o.x===u.x?o.y-u.y:o.x-u.x);let n=(o,u,c)=>(u.x-o.x)*(c.y-o.y)-(u.y-o.y)*(c.x-o.x),r=[];for(let o of t){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],o)<=0;)r.pop();r.push(o)}let i=[];for(let o=t.length-1;o>=0;o--){let u=t[o];for(;i.length>=2&&n(i[i.length-2],i[i.length-1],u)<=0;)i.pop();i.push(u)}return r.pop(),i.pop(),r.concat(i)}function Ei(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var Ri=Math.tan(30*Math.PI/180),Fi=3.5,Ii=.9;function Pi(e,t,n,r,i){if(t.fill<.86)return null;let o=t.halfShort*2*i,u=t.halfLong*2*i,c=o*u,f=t.halfShort>0?t.halfLong/t.halfShort:99,h=ki(e);if(!h){if(n>15||c>600||o<3)return null;let m=r%1e3/1e3;c<30?h=m<.5?"skillion":"gabled":f<1.25?h=m<.35?"pyramidal":"hipped":h=m<.8?"gabled":"hipped"}return h==="flat"?null:{shape:h}}function ki(e){let t=String(e.roof_shape??e["roof:shape"]??"").toLowerCase();return t?t==="flat"?"flat":t==="skillion"||t==="lean_to"||t==="shed"?"skillion":t==="hipped"||t==="half-hipped"||t==="gambrel"?"hipped":t==="pyramidal"||t==="dome"||t==="conical"||t==="onion"?"pyramidal":t==="gabled"||t==="mansard"||t==="round"?"gabled":null:null}var je=(e,t,n)=>e.a*t+e.b*n+e.c;function _i(e,t,n,r){let i=e.length/2;if(i<3)return[];let o=[],u=c=>[e[c*2],e[c*2+1]];for(let c=0;c<i;c++){let[f,h]=u(c),[m,g]=u((c+i-1)%i),x=t*f+n*h+r,v=t*m+n*g+r;if(x<=0!=v<=0){let S=v/(v-x);o.push(m+(f-m)*S,g+(h-g)*S)}x<=0&&o.push(f,h)}return o}function Ai(e,t){let n=.5/Math.max(t,1e-6),r=e.length/2-1;if(r<5)return e;let i=[],o=0;i.push(e[0],e[1]);for(let u=1;u<r;u++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1],g=h-c,x=m-f,v=Math.hypot(g,x),S=v>1e-6;if(S){for(let P=o+1;P<u;P++)if(Math.abs((e[P*2]-c)*x-(e[P*2+1]-f)*g)/v>=n){S=!1;break}}S||(i.push(e[(u-1)*2],e[(u-1)*2+1]),o=u-1)}return i.length/2<3?e:(i.push(i[0],i[1]),i)}function An(e,t,n){let{ax:r,ay:i,halfLong:o}=t;if(n==="skillion"){let f=-i,h=r;return[{a:f,b:h,c:-(f*t.cx+h*t.cy)+t.halfShort}]}let u=[],c=e.length/2-1;for(let f=0;f<c;f++){let h=e[f*2],m=e[f*2+1],g=e[(f+1)%c*2],x=e[(f+1)%c*2+1],v=g-h,S=x-m,P=Math.hypot(v,S);if(P<1e-6||n==="gabled"&&Math.abs((v*r+S*i)/P)<.86)continue;let _=-S/P,I=v/P;u.push({a:_,b:I,c:-(_*h+I*m)})}return!u.length&&o>0?An(e,t,"hipped"):u}function Bi(e,t){let n=[];for(let i=0;i<t.length-2;i+=2)n.push(t[i],t[i+1]);if(n.length<6)return[];let r=[];for(let i=0;i<e.length;i++){let o=n;for(let u=0;u<e.length&&o.length>=6;u++)u!==i&&(o=_i(o,e[i].a-e[u].a,e[i].b-e[u].b,e[i].c-e[u].c));r.push(o.length>=6?o:[])}return r}function Li(e,t){let n=0;for(let r=0;r<t.length;r++){let i=t[r];for(let o=0;o<i.length;o+=2){let u=je(e[r],i[o],i[o+1]);u>n&&(n=u)}}return n}function Ti(e,t,n){return e.map(r=>({a:r.a*t,b:r.b*t,c:r.c*t+n}))}function Ci(e,t,n,r,i,o,u,c){let f=Gt(mi,u);for(let h=0;h<n.length;h++){let m=t[h];if(!m||m.length<6)continue;let g=Oe(m,void 0,2);if(!g.length)continue;let x=-n[h].a/c,v=-n[h].b/c,S=Math.hypot(x,v,1),P={x:x/S,y:v/S,z:1/S};e.ensure(m.length/2);let _=e.vertexCount;for(let I=0;I<m.length;I+=2){let A=Math.max(r,je(n[h],m[I],m[I+1]));Ze(e,m[I],m[I+1],A,P.x,P.y,P.z,255,o,f)}for(let I=0;I<g.length;I+=3)e.indices.push(_+g[I],_+g[I+2],_+g[I+1]),e.featureIds.push(i)}}function Vi(e,t){let n=String(e.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?xi:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?Mn:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||t<=7?Sn:t>=40?Mn:di}function Oi(e,t){let n=String(t.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+(e%121-60)))}function Ui(e){let t=e>>>0;return t=(t>>>16^t)*73244475,t=(t>>>16^t)*73244475,t=t>>>16^t,t>>>0}function Di(e){let t=We(e.render_height)??We(e.height)??Ni(e.levels??e.building_levels??e["building:levels"]);return t&&t>0?Math.max(t,ai):fi}function Gi(e,t){let n=We(e.render_min_height)??We(e.min_height)??We(e.base)??0;return n>0&&n<t?n:0}function Ni(e){let t=We(e);return t&&t>0?t*3:null}function We(e){if(typeof e=="number"&&isFinite(e))return e;if(typeof e=="string"){let t=parseFloat(e);if(isFinite(t))return t}return null}var Ot=e=>e>127?127:e<-127?-127:e;function Hi(e){let t=e.osm_id;if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){let n=Number(t);if(Number.isFinite(n))return n}return null}function Fn(e,t){let n=e.length/2-1,r=new Array(Math.max(n,0)).fill(!1);if(n<3)return{ring:e,cut:r};let i=(u,c)=>u===0?1:u===t?2:c===0?3:c===t?4:0,o=e.slice();for(let u=0;u<n;u++){let c=e[u*2],f=e[u*2+1],h=i(c,f);if(!h)continue;let m=(u+n-1)%n,g=(u+1)%n,x=i(e[m*2],e[m*2+1])===h,v=i(e[g*2],e[g*2+1])===h;v&&(r[u]=!0);let S=x===v?-1:x?g:m;if(S<0)continue;let P=c-e[S*2],_=f-e[S*2+1],I=Math.hypot(P,_);I<1e-6||(o[u*2]=c+P/I*wn,o[u*2+1]=f+_/I*wn)}return o[n*2]=o[0],o[n*2+1]=o[1],{ring:o,cut:r}}function zi(e,t,n,r){let{extent:i,metersPerUnit:o,height:u,minHeight:c,featureId:f,seed:h,tint:m,facade:g}=r,x=r.whole?t:Ve(t,i,we(i));if(!x)return;let v=r.cornerRadius/o,S={radius:v,segments:r.cornerSegments,minCutRatio:0,maxChord:o>0?xn/o:0,...r.whole?{}:{extent:i,margin:we(i)}},P=v>0?{outer:Ce(x.outer,S),holes:x.holes.map($=>Ce($,S))}:x,_=r.whole?P:Ve(P,i);if(!_)return;let I=$=>({ring:$,cut:new Array(Math.max($.length/2-1,0)).fill(!1)}),A=r.whole?I(_.outer):Fn(_.outer,i),k=_.holes.map($=>r.whole?I($):Fn($,i)),L={outer:A.ring,holes:k.map($=>$.ring)},V=r.whole?!0:Ct(L.outer,i),U=L.outer.length/2+L.holes.reduce(($,O)=>$+O.length/2,0);n(U*5+32);let N=L.holes.length||V?null:Si(L.outer),T=N?Pi(r.props,N,u,h,o):null,j=null,Y=[];if(T&&N){let $=An(Ai(L.outer,o),N,T.shape);Y=Bi($,L.outer);let O=Li($,Y);if(O>1e-6){let G=Math.min(Math.max(O*o*Ri,Ii),Fi);j=Ti($,G/O,u)}}Rn(e,L.outer,c,u,f,m,g,o,j,A.cut);for(let $=0;$<L.holes.length;$++)Rn(e,L.holes[$],c,u,f,m,g,o,null,k[$].cut);j?Ci(e,Y,j,u,f,m,g,o):vi(e,L.outer,L.holes,u,f,m,g)}function In(e,t){let n=we(t),r=Math.max(e.length/2-1,0),i=new Array(r);for(let o=0;o<r;o++)i[o]=vt(e[o*2],e[o*2+1],e[o*2+2],e[o*2+3],t,n);return i}function ji(e,t,n,r,i,o,u,c){let f=Ve(e,t,we(t));if(!f)return null;let h=In(f.outer,t);return{osmId:i,height:n,minHeight:r,seed:o,tint:u,facade:c,outer:f.outer,holes:f.holes,outerCut:h,holeCuts:f.holes.map(m=>In(m,t))}}function Nt(e,t,n,r,i){let o=r*r,u=[],c=m=>e[m*2],f=m=>e[m*2+1],h=(m,g)=>{let x=e.length/2;return e.push((c(m)+c(g))/2,(f(m)+f(g))/2),x};for(let m=0;m<t.length;m+=3){u.push([n+t[m],n+t[m+1],n+t[m+2]]);let g=0;for(;u.length&&!(++g>2e4);){let[x,v,S]=u.pop(),P=(c(x)-c(v))**2+(f(x)-f(v))**2,_=(c(v)-c(S))**2+(f(v)-f(S))**2,I=(c(S)-c(x))**2+(f(S)-f(x))**2,A=Math.max(P,_,I);if(A<=o){i.push(x,v,S);continue}if(A===P){let k=h(x,v);u.push([x,k,S],[k,v,S])}else if(A===_){let k=h(v,S);u.push([v,k,x],[k,S,x])}else{let k=h(S,x);u.push([S,k,v],[k,x,v])}}}}function Bn(e,t,n=0,r,i=!1,o=4096){let u=[],c=[],f=[];for(let v of e.features()){if(v.type!==3||!pe(t,v.properties))continue;let S=v.properties.osm_id,P=typeof S=="number"?S:typeof S=="string"?Number(S):NaN,_=Number.isFinite(P)?P:Number(v.id??0);for(let I of Ye(v.loadGeometry())){let A=i?Ve(I,o):I;if(!A)continue;let k=[],L=[],V=r?Ce(A.outer,r):A.outer;for(let T=0;T<V.length;T++)k.push(V[T]);for(let T of A.holes){let j=r?Ce(T,r):T;L.push(k.length/2);for(let Y=0;Y<j.length;Y++)k.push(j[Y])}let U=Oe(k,L.length?L:void 0,2);if(!U.length)continue;let N=u.length/2;for(let T=0;T<k.length;T++)u.push(k[T]);if(n>0){let T=[];Nt(u,U,N,n,T);for(let j=0;j<T.length;j+=3)c.push(T[j],T[j+2],T[j+1]),f.push(_);continue}for(let T=0;T<U.length;T+=3)c.push(N+U[T],N+U[T+2],N+U[T+1]),f.push(_)}}if(!c.length)return null;let h=u.length/2,m=new Int16Array(u),g=new Uint32Array(c);return{featureIds:new Float64Array(f).buffer,vertices:m.buffer,indices:g.buffer,vertexCount:h,indexCount:g.length}}function Tn(e){return{shapes:[],cells:[],extent:0,metersPerTile:e}}function Cn(e,t,n,r){if(!(n<=0)){e.extent=r;for(let i of t){let o=i.outer;if(o.length<6)continue;let u=1/0,c=1/0,f=-1/0,h=-1/0;for(let m=0;m<o.length;m+=2)o[m]<u&&(u=o[m]),o[m]>f&&(f=o[m]),o[m+1]<c&&(c=o[m+1]),o[m+1]>h&&(h=o[m+1]);e.shapes.push({outer:o,holes:i.holes,level:n,minX:u,minY:c,maxX:f,maxY:h})}e.cells=[]}}function $i(e){e.cells=Array.from({length:32*32},()=>[]);let t=e.extent/32;for(let n=0;n<e.shapes.length;n++){let r=e.shapes[n],i=Qe(Math.floor(r.minX/t)),o=Qe(Math.floor(r.maxX/t)),u=Qe(Math.floor(r.minY/t)),c=Qe(Math.floor(r.maxY/t));for(let f=u;f<=c;f++)for(let h=i;h<=o;h++)e.cells[f*32+h].push(n)}}var Vn=e=>e.shapes.length===0;function Ht(e,t,n){!e.cells.length&&e.shapes.length&&$i(e);let r=e.extent/32,i=e.cells[Qe(Math.floor(n/r))*32+Qe(Math.floor(t/r))];if(!i||!i.length)return 0;let o=0;for(let u of i){let c=e.shapes[u];if(c.level<=o||t<c.minX||t>c.maxX||n<c.minY||n>c.maxY||!Ln(c.outer,t,n))continue;let f=!1;for(let h of c.holes)if(Ln(h,t,n)){f=!0;break}f||(o=c.level)}return Math.min(Math.round(o*100),127)}function On(e,t){let n=[],r=[],i=e.extent>0?e.metersPerTile/e.extent:0,o=i>0?2/i:0,u=Ht(e,t[0],t[1]);n.push(t[0],t[1]),r.push(u);for(let c=0;c+3<t.length;c+=2){let f=t[c],h=t[c+1],m=t[c+2],g=t[c+3],x=Ht(e,m,g);if(x!==u&&o>0){let v=Math.hypot(m-f,g-h),S=Math.min(Math.ceil(v/o),64),P=u;for(let _=1;_<S;_++){let I=_/S,A=f+(m-f)*I,k=h+(g-h)*I,L=Ht(e,A,k);L!==P&&(n.push(A,k),r.push(L),P=L)}}n.push(m,g),r.push(x),u=x}return{pts:n,levels:r}}var Qe=e=>e<0?0:e>31?31:e;function Ln(e,t,n){let r=!1,i=e.length/2;for(let o=0,u=i-1;o<i;u=o++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1];f>n!=m>n&&t<(h-c)*(n-f)/(m-f)+c&&(r=!r)}return r}var Xi=wr(Un(),1),Dn=Xi,$t=Dn.union??Dn.default?.union??null;$t||console.warn("[osmgl] polygon-clipping \\u0431\\u0435\\u0437 union \\u2014 \\u043E\\u0431\\u044A\\u0435\\u0434\\u0438\\u043D\\u0435\\u043D\\u0438\\u0435 \\u0444\\u0438\\u0433\\u0443\\u0440 \\u0432\\u044B\\u043A\\u043B\\u044E\\u0447\\u0435\\u043D\\u043E");function Gn(e){let t=[];for(let n=0;n+1<e.length;n+=2)t.push([e[n],e[n+1]]);return t}function Nn(e){let t=[];for(let r of e)t.push(r[0],r[1]);let n=t.length;return n>=4&&(t[0]!==t[n-2]||t[1]!==t[n-1])&&t.push(t[0],t[1]),t}function Hn(e,t,n=0){if(e.length<2)return e;let r=new Map;for(let o of e){let u=o.lift??0,c=r.get(u);c?c.push(o):r.set(u,[o])}let i=[];for(let[o,u]of r){if(u.length<2){i.push(...u);continue}let f=(n>0&&t?u.map(g=>({outer:t(g.outer,-n)??g.outer,holes:g.holes.map(x=>t(x,n)??x)})):u).map(g=>[Gn(g.outer),...g.holes.map(Gn)]),h;try{if(!$t)throw new Error("\\u043D\\u0435\\u0442 union");h=$t(f[0],...f.slice(1))}catch{i.push(...u);continue}let m=h;if(!Array.isArray(m)||m.length===0){i.push(...u);continue}for(let g of m){if(!g.length)continue;let x=Nn(g[0]);if(x.length<8)continue;let v=[];for(let S=1;S<g.length;S++){let P=Nn(g[S]);P.length>=8&&v.push(P)}i.push(o?{outer:x,holes:v,lift:o}:{outer:x,holes:v})}}return i}var Qt=16,Yi=64,Wn=0,Zi=1,zn=2,Wi=3,St=1,Qi=.6;function Qn(e,t,n,r){let i=r.metersPerUnit>0?r.metersPerUnit:.5,o=r.elevation,u=r.base??0,c=Math.max(r.bevel??0,0)/i,f=Math.max(r.bevelDrop??0,0),h=Math.max(r.cornerRadius??0,0)/i,m=Math.max(512,e.length*24),g=new ArrayBuffer(m*Qt),x={view:new DataView(g),bytes:new Uint8Array(g),offset:0,count:0,indices:[],extent:t,ensure(O){if(x.count+O<=m)return;m=Math.max(m*2,x.count+O);let G=new ArrayBuffer(m*Qt);new Uint8Array(G).set(x.bytes.subarray(0,x.offset)),g=G,x.view=new DataView(G),x.bytes=new Uint8Array(G)}},v=[],S=[],P=new Map;for(let O of e.features()){if(O.type!==3||!pe(n,O.properties))continue;let G=r.liftBy?.(O.properties)??0,W=O.properties.osm_id,D=typeof W=="number"?W:typeof W=="string"?Number(W):NaN,Q=Number.isFinite(D)?D:Number(O.id??0);for(let oe of Ye(O.loadGeometry())){let ee=Ve(oe,t,we(t));ee&&(v.push(G?{...ee,lift:G}:ee),S.push(Q))}}let _=new Set,I=Math.max(r.weld??Qi,0),A=Hn(v,(O,G)=>Yt(O,G,t,_),I/i),k=I>0?A.map(O=>({...O,outer:Zn(O.outer,I/i,t),holes:O.holes.map(G=>Zn(G,I/i,t))})):A;for(let O of k){$n(O.outer,P);for(let G of O.holes)$n(G,P)}r.onShapes?.(k);let L=Ki(k,v,S),V=new Set;for(let[O,G]of P)G>1&&V.add(O);let U=[],N={radius:h,segments:r.cornerSegments,extent:t,margin:we(t),minCutRatio:0,maxChord:dn/i},T=[];for(let O of k){let G=x.indices.length,W=U.length,D=h>0?{outer:Ce(O.outer,{...N,keep:Xn(O.outer,V)}),holes:O.holes.map(q=>Ce(q,{...N,keep:Xn(q,V)}))}:O,Q=c>0?Yt(D.outer,c,t,V):D.outer,oe=D.holes.map(q=>c>0?Yt(q,-c,t,V):q),ee=O.lift??0,ne=o+ee,Z=u+ee;Yn(x,Q??D.outer,oe.map((q,he)=>q??D.holes[he]),ne,Wn,r.maxSegment??0);let le=ne,K=ne-f;Q&&c>0&&f>0&&Xt(x,Q,D.outer,le,K,Zi,t,V),K!==Z&&Xt(x,D.outer,D.outer,K,Z,zn,t,V);for(let q of D.holes)if(K!==Z&&Xt(x,q,q,K,Z,zn,t,V),ne<Z){let he=x.indices.length;Yn(x,q,[],Z,Wi);for(let me=he;me<x.indices.length;me++)U.push(x.indices[me]);x.indices.length=he}T.push(G,x.indices.length,W,U.length)}if(!x.indices.length&&!U.length)return null;let j=x.indices.length;for(let O=0;O<T.length;O+=4)T[O+2]+=j,T[O+3]+=j;let Y=[];for(let O of L){Y.push(O.length);for(let G of O)Y.push(G)}let $=new Uint32Array(j+U.length);return $.set(x.indices,0),$.set(U,j),{vertices:g.slice(0,x.offset),indices:$.buffer,vertexCount:x.count,indexCount:$.length,extent:t,capIndexOffset:j,shapeFeatures:new Float64Array(Y).buffer,shapeRanges:new Uint32Array(T).buffer}}function Ki(e,t,n){let r=e.map(()=>[]);if(!e.length)return r;let i=e.map(o=>jn(o.outer));for(let o=0;o<t.length;o++){let u=Ji(t[o].outer);if(!u)continue;let c=-1;for(let f=0;f<e.length;f++){let h=i[f];if(u[0]<h[0]||u[0]>h[2]||u[1]<h[1]||u[1]>h[3]||!Kt(e[f].outer,u[0],u[1]))continue;let m=!1;for(let g of e[f].holes)if(Kt(g,u[0],u[1])){m=!0;break}if(!m){c=f;break}}if(c<0){let f=jn(t[o].outer),h=0;for(let m=0;m<e.length;m++){let g=i[m],x=Math.min(f[2],g[2])-Math.max(f[0],g[0]),v=Math.min(f[3],g[3])-Math.max(f[1],g[1]),S=x>0&&v>0?x*v:0;S>h&&(h=S,c=m)}}c<0&&(c=0),r[c].includes(n[o])||r[c].push(n[o])}return r}function jn(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let o=0;o<e.length;o+=2)e[o]<t&&(t=e[o]),e[o]>r&&(r=e[o]),e[o+1]<n&&(n=e[o+1]),e[o+1]>i&&(i=e[o+1]);return[t,n,r,i]}function Ji(e){let t=e.length/2-1;if(t<3)return null;let n=0;for(let i=0;i<t;i++){let o=(i+1)%t;n+=e[i*2]*e[o*2+1]-e[o*2]*e[i*2+1]}let r=n>0;for(let i=0;i<t;i++){let o=(i+t-1)%t*2,u=i*2,c=(i+1)%t*2,f=(e[u]-e[o])*(e[c+1]-e[o+1])-(e[u+1]-e[o+1])*(e[c]-e[o]);if(f===0||f>0!==r)continue;let h=(e[o]+e[u]+e[c])/3,m=(e[o+1]+e[u+1]+e[c+1])/3;if(Kt(e,h,m))return[h,m]}return null}function Kt(e,t,n){let r=!1,i=e.length/2-1;for(let o=0,u=i-1;o<i;u=o++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1];f>n!=m>n&&t<(h-c)*(n-f)/(m-f)+c&&(r=!r)}return r}function Ke(e,t,n,r){let i=`${Math.round(e*100)},${Math.round(t*100)}`,o=`${Math.round(n*100)},${Math.round(r*100)}`;return i<o?`${i}|${o}`:`${o}|${i}`}function $n(e,t){for(let n=0;n+3<e.length;n+=2){let r=Ke(e[n],e[n+1],e[n+2],e[n+3]);t.set(r,(t.get(r)??0)+1)}}function Xn(e,t){if(!t.size)return;let n=e.length/2-1,r=new Array(n).fill(!1);for(let i=0;i<n;i++){let o=Ke(e[(i+n-1)%n*2],e[(i+n-1)%n*2+1],e[i*2],e[i*2+1]),u=Ke(e[i*2],e[i*2+1],e[(i+1)%n*2],e[(i+1)%n*2+1]);(t.has(o)||t.has(u))&&(r[i]=!0)}return r}function ft(e,t,n,r,i,o,u,c){let f=e.offset;return e.view.setFloat32(f,t,!0),e.view.setFloat32(f+4,n,!0),e.view.setInt16(f+8,qi(Math.round(r*Yi)),!0),e.view.setInt8(f+10,Wt(Math.round(i*127))),e.view.setInt8(f+11,Wt(Math.round(o*127))),e.view.setInt8(f+12,Wt(Math.round(u*127))),e.bytes[f+13]=c,e.view.setInt8(f+14,t<=0?-St:t>=e.extent?St:0),e.view.setInt8(f+15,n<=0?-St:n>=e.extent?St:0),e.offset+=Qt,e.count++}function Yn(e,t,n,r,i=Wn,o=0){let u=[],c=[];for(let g=0;g<t.length;g++)u.push(t[g]);for(let g of n){c.push(u.length/2);for(let x=0;x<g.length;x++)u.push(g[x])}let f=Oe(u,c.length?c:void 0,2);if(!f.length)return;let h=f;if(o>0){let g=[];Nt(u,f,0,o,g),h=g}e.ensure(u.length/2);let m=e.count;for(let g=0;g<u.length;g+=2)ft(e,u[g],u[g+1],r,0,0,1,i);for(let g=0;g<h.length;g+=3)e.indices.push(m+h[g],m+h[g+2],m+h[g+1])}function Xt(e,t,n,r,i,o,u,c){let f=Math.min(t.length,n.length)/2;if(!(f<3)){e.ensure((f-1)*4);for(let h=0;h<f-1;h++){let m=n[h*2],g=n[h*2+1],x=n[h*2+2],v=n[h*2+3];if(m===x&&g===v||vt(m,g,x,v,u,we(u))||c.has(Ke(m,g,x,v)))continue;let S=x-m,P=v-g,_=Math.hypot(S,P)||1,I=P/_,A=-S/_,k=r-i,L=Math.hypot(t[h*2]-m,t[h*2+1]-g)||0,V=0;if(L>1e-6&&k!==0){let Y=1/Math.hypot(1,k/L);V=L/Math.hypot(L,k)*Math.sign(k),I*=Y,A*=Y}let U=ft(e,t[h*2],t[h*2+1],r,I,A,V,o),N=ft(e,t[h*2+2],t[h*2+3],r,I,A,V,o),T=ft(e,m,g,i,I,A,V,o),j=ft(e,x,v,i,I,A,V,o);e.indices.push(T,N,j,T,U,N)}}}function Yt(e,t,n,r){let i=e.length/2-1;if(i<3)return null;let o=[];for(let m=0;m<i;m++){let g=e[m*2],x=e[m*2+1],v=e[(m+i-1)%i*2],S=e[(m+i-1)%i*2+1],P=e[(m+1)%i*2],_=e[(m+1)%i*2+1],I=Math.hypot(g-v,x-S)||1,A=Math.hypot(P-g,_-x)||1,k=(x-S)/I,L=-(g-v)/I,V=(_-x)/A,U=-(P-g)/A,N=k+V,T=L+U,j=Math.hypot(N,T);if(j<1e-6){o.push(g,x);continue}N/=j,T/=j;let Y=Math.min(1/Math.max(N*k+T*L,.35),3),$=g-N*t*Y,O=x-T*t*Y,G=Ke(v,S,g,x),W=Ke(g,x,P,_);if(r.has(G)||r.has(W)){o.push(g,x);continue}let D=-we(n),Q=n+we(n);((ee,ne)=>ee<=D||ee>=Q||ne<=D||ne>=Q)(g,x)&&($=g,O=x),o.push($,O)}o.push(o[0],o[1]);let u=Math.abs(Zt(e)),c=Zt(o);if(Math.sign(c)!==Math.sign(Zt(e))||Math.abs(c)<u*.25)return null;let f=-we(n),h=n+we(n);for(let m=0;m<o.length;m+=2)o[m]=Math.max(f,Math.min(h,o[m])),o[m+1]=Math.max(f,Math.min(h,o[m+1]));return o}function Zt(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var Wt=e=>e>127?127:e<-127?-127:e,qi=e=>e>32767?32767:e<-32768?-32768:e;function Zn(e,t,n){if(!(t>0))return e;let r=we(n),i=-r,o=n+r,u=e;for(let c=0;c<3;c++){let f=u.length/2-1;if(f<6)break;let h=new Array(f).fill(!0),m=f;for(let x=0;x<f&&!(m<=5);x++){let v=u[x*2],S=u[x*2+1];if(v<=i||v>=o||S<=i||S>=o)continue;let P=(x+f-1)%f;for(;!h[P]&&P!==x;)P=(P+f-1)%f;let _=(x+1)%f;for(;!h[_]&&_!==x;)_=(_+1)%f;if(P===x||_===x)break;let I=u[P*2],A=u[P*2+1],k=u[_*2]-I,L=u[_*2+1]-A,V=Math.hypot(k,L);V<1e-6||Math.abs((v-I)*L-(S-A)*k)/V<t&&(h[x]=!1,m--)}if(m===f)break;let g=[];for(let x=0;x<f;x++)h[x]&&g.push(u[x*2],u[x*2+1]);g.push(g[0],g[1]),u=g}return u}function Je(e){let t=e.layer,n=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let r=e.brunnel;return r==="bridge"?1:r==="tunnel"?-1:0}var at=20;function qn(e,t,n=0,r,i=0,o={}){let{level:u}=o,c=Math.max(256,e.length*24),f=new ArrayBuffer(c*at),h=new DataView(f),m=0,g=[],x=[],v=V=>{if(m+V<=c)return;c=Math.max(c*2,m+V);let U=new ArrayBuffer(c*at);new Uint8Array(U).set(new Uint8Array(f,0,m*at)),f=U,h=new DataView(U)},S=(V,U,N,T,j,Y,$,O=0,G=0,W=0)=>{let D=m*at;return h.setInt16(D,V,!0),h.setInt16(D+2,U,!0),h.setInt16(D+4,N,!0),h.setInt16(D+6,T,!0),h.setInt8(D+8,j),h.setInt8(D+9,Y),h.setInt8(D+10,O),h.setInt8(D+11,G),h.setFloat32(D+12,$,!0),h.setFloat32(D+16,W,!0),m++},P=0,_=0,I=i>0?12/i:0,A=I>0?io(e):null;for(let V of e.features()){if(V.type!==2&&V.type!==3||!pe(t,V.properties)||u!==void 0&&Je(V.properties)!==u)continue;let U=V.properties.osm_id,N=typeof U=="number"?U:typeof U=="string"?Number(U):NaN;_=Number.isFinite(N)?N:Number(V.id??0);let T=V.properties.width;P=typeof T=="number"&&T>.5&&T<100?T:0;let j=V.type===3;for(let Y of V.loadGeometry()){let $=n>0?to(Kn(Y),n):Kn(Y);if($.length<4)continue;let O=r&&!Vn(r)?On(r,$):null,G=O?O.pts:$,W=O?.levels,D=G.length/2;if(D<2)continue;let Q=Je(V.properties),oe=Mt(Math.round(G[0]),Math.round(G[1])),ee=Mt(Math.round(G[D*2-2]),Math.round(G[D*2-1])),ne=null,Z=P;if(A&&P>0&&!j){let K=0;for(let fe=0;fe<D-1;fe++)K+=Math.hypot(G[fe*2+2]-G[fe*2],G[fe*2+3]-G[fe*2+1]);Z=er(Q,P,oe,ee,A);let q=fe=>Math.min(A.width.get(fe)??0,Z*2),he=q(oe)-Z,me=q(ee)-Z,ce=Math.min(I,K/2);if(ce>0&&(he>0||me>0)){ne=ae=>{let de=0;return he>0&&ae<ce&&(de=he*(1-ae/ce)),me>0&&K-ae<ce&&(de=Math.max(de,me*(1-(K-ae)/ce))),Z+de};let fe=[];for(let ae of[ce,K-ce])ae>.01&&ae<K-.01&&fe.push(ae);if(fe.length){let ae=eo(G,W,fe);G=ae.pts,W=ae.levels,D=G.length/2}}}v((D-1)*4);let le=0;for(let K=0;K<D-1;K++){let q=G[K*2],he=G[K*2+1],me=G[K*2+2],ce=G[K*2+3],fe=Math.hypot(me-q,ce-he);if(j&&ro(q,he,me,ce,e.extent)){le+=fe;continue}let ae=no(q,he,me,ce,e.extent);if(!ae){le+=fe;continue}let[de,Se,Fe,re]=ae,Ue=Math.hypot(de-q,Se-he),ve=Math.hypot(Fe-de,re-Se),De=Math.hypot(me-Fe,ce-re),Ie=le+Ue,Le=W?W[K]:0,Me=W?W[K+1]:0,Ge=ne?ne(Ie):Z,$e=ne?ne(Ie+ve):Z,Ne=S(de,Se,Fe,re,0,-1,Ie,Le,Me,Ge),ht=S(de,Se,Fe,re,0,1,Ie,Le,Me,Ge),pt=S(de,Se,Fe,re,1,1,Ie,Le,Me,$e),Et=S(de,Se,Fe,re,1,-1,Ie,Le,Me,$e);le+=Ue+ve+De,g.push(Ne,ht,pt,Ne,pt,Et),x.push(_,_)}}}if(!g.length)return null;let k=new Uint32Array(g),L=new Float64Array(x);return{vertices:f.slice(0,m*at),indices:k.buffer,vertexCount:m,indexCount:k.length,featureIds:L.buffer}}function eo(e,t,n){let r=[...n].sort((f,h)=>f-h),i=[e[0],e[1]],o=t?[t[0]]:void 0,u=0,c=0;for(let f=0;f+3<e.length;f+=2){let h=e[f],m=e[f+1],g=e[f+2],x=e[f+3],v=Math.hypot(g-h,x-m);for(;c<r.length&&r[c]<=u+.01;)c++;for(;c<r.length&&r[c]<u+v-.01;){let S=(r[c]-u)/v;i.push(h+(g-h)*S,m+(x-m)*S),o&&t&&o.push(Math.round(t[f/2]+(t[f/2+1]-t[f/2])*S)),c++}u+=v,i.push(g,x),o&&t&&o.push(t[f/2+1])}return{pts:i,levels:o}}function to(e,t){let n=[];for(let r=0;r+3<e.length;r+=2){let i=e[r],o=e[r+1],u=e[r+2],c=e[r+3];n.push(i,o);let f=Math.min(64,Math.floor(Math.hypot(u-i,c-o)/t));for(let h=1;h<f;h++){let m=h/f;n.push(i+(u-i)*m,o+(c-o)*m)}}return n.push(e[e.length-2],e[e.length-1]),n}function Kn(e){let t=[];for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1],o=t.length;o>=2&&t[o-2]===r&&t[o-1]===i||t.push(r,i)}return t}function no(e,t,n,r,i){let o=n-e,u=r-t,c=0,f=1,h=[[-o,e],[o,i-e],[-u,t],[u,i-t]];for(let[m,g]of h){if(m===0){if(g<0)return null;continue}let x=g/m;if(m<0){if(x>f)return null;x>c&&(c=x)}else{if(x<c)return null;x<f&&(f=x)}}return f-c<1e-6?null:[Math.round(e+o*c),Math.round(t+u*c),Math.round(e+o*f),Math.round(t+u*f)]}function ro(e,t,n,r,i){return e===n&&(e<=0||e>=i)?!0:t===r&&(t<=0||t>=i)}var Jn=new WeakMap,Mt=(e,t)=>(e+512)*65536+(t+512);function er(e,t,n,r,i){if(e===0||t<=0)return t;let o=8*4294967296,u=Math.max(i.raw.get(n+o)??0,i.raw.get(r+o)??0);return u>0&&t>u?u:t}function io(e){let t=Jn.get(e);if(t)return t;let n={width:new Map,ends:new Map,raw:new Map},r=[];for(let i of e.features()){if(i.type!==2)continue;let o=i.properties.width,u=typeof o=="number"&&o>.5&&o<100?o:0,c=Je(i.properties);for(let f of i.loadGeometry()){if(f.length<4)continue;let h=Mt(Math.round(f[0]),Math.round(f[1])),m=Mt(Math.round(f[f.length-2]),Math.round(f[f.length-1]));for(let g of[h,m]){let x=g+(c+8)*4294967296;n.ends.set(x,(n.ends.get(x)??0)+1),u>0&&n.raw.set(x,Math.max(n.raw.get(x)??0,u))}r.push({h,t:m,lv:c,w:u})}}for(let i of r){let o=er(i.lv,i.w,i.h,i.t,n);if(!(o<=0))for(let u of[i.h,i.t]){let c=n.width.get(u);(c===void 0||o>c)&&n.width.set(u,o)}}return Jn.set(e,n),n}var oo=[["\\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."]],tr=new Map(oo);function nr(e){let t=e.split(" ");if(t.length<2)return e;let n=!1,r=t.map(o=>{let u=tr.get(o.toLowerCase());return u?(n=!0,o[0]===o[0].toUpperCase()?u[0].toUpperCase()+u.slice(1):u):o});return!n||!t.filter(o=>tr.get(o.toLowerCase())===void 0).length?e:r.join(" ")}function ir(e,t){let n=[],r=[],i=[],o=[],u=[],c=t.textPlacement==="line",f=[],h=[],m=[];for(let g of e.features()){if(!pe(t.filter,g.properties))continue;let x=g.loadGeometry(),v=lo(g.type,x);if(!v)continue;let S=t.textField?rr(t.textField,g.properties):"",P=S&&t.abbreviate?nr(S):S,_=t.iconImage?rr(t.iconImage,g.properties):"";if(!(!P&&!_)){if(c){let I=uo(g.type,x);if(!I)continue;m.push({text:P,line:I});continue}n.push(v[0],v[1]),r.push(P),i.push(_),o.push(co(g.properties)),u.push(t.iconRotate&&Math.round(Number(g.properties[t.iconRotate]??0))||0)}}if(c){for(let{text:g,line:x}of so(m)){h.push(f.length/2);for(let v of x)f.push(v);n.push(Math.round(x[0]),Math.round(x[1])),r.push(g),i.push(""),o.push(128),u.push(0)}h.push(f.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:i,priorities:new Uint8Array(o).buffer,rotations:new Int16Array(u).buffer,...c?{lines:new Int16Array(f).buffer,lineStarts:new Uint32Array(h).buffer}:{}}:null}function so(e){let t=[],n=new Map,r=new Map,i=(o,u,c)=>`${o}\\u241F${u}\\u241F${c}`;for(let{text:o,line:u}of e){let c=i(o,u[0],u[1]),f=i(o,u[u.length-2],u[u.length-1]),h=n.get(f),m=r.get(c);if(m!==void 0){let g=t[m];if(g.line.push(...u.slice(2)),r.delete(c),r.set(i(o,g.line[g.line.length-2],g.line[g.line.length-1]),m),h!==void 0&&h!==m){let x=t[h];g.line.push(...x.line.slice(2)),x.line=[],n.delete(f),r.set(i(o,g.line[g.line.length-2],g.line[g.line.length-1]),m)}continue}if(h!==void 0){let g=t[h];g.line.unshift(...u.slice(0,u.length-2)),n.delete(f),n.set(i(o,g.line[0],g.line[1]),h);continue}n.set(c,t.length),r.set(f,t.length),t.push({text:o,line:u})}return t.filter(o=>o.line.length>=4)}function uo(e,t){if(e!==2)return null;let n=null,r=0;for(let i of t){if(i.length<4)continue;let o=0;for(let u=0;u+3<i.length;u+=2)o+=Math.hypot(i[u+2]-i[u],i[u+3]-i[u+1]);o>r&&(r=o,n=i)}return n}function lo(e,t){if(!t.length)return null;if(e===1){let u=t[0];return u.length>=2?[u[0],u[1]]:null}if(e===2){let u=-1,c=0,f=0;for(let h of t)for(let m=0;m+3<h.length;m+=2){let g=h[m+2]-h[m],x=h[m+3]-h[m+1],v=g*g+x*x;v>u&&(u=v,c=h[m]+g/2,f=h[m+1]+x/2)}return u>0?[Math.round(c),Math.round(f)]:null}let n=1/0,r=1/0,i=-1/0,o=-1/0;for(let u of t)for(let c=0;c<u.length;c+=2)u[c]<n&&(n=u[c]),u[c]>i&&(i=u[c]),u[c+1]<r&&(r=u[c+1]),u[c+1]>o&&(o=u[c+1]);return isFinite(n)?[Math.round((n+i)/2),Math.round((r+o)/2)]:null}function co(e){let t=e.rank;return typeof t=="number"&&isFinite(t)?Math.max(0,255-Math.min(t,255)):128}function rr(e,t){let n=Array.isArray(e)?e:[e];for(let r of n){let i=!0,u=r.replace(/\\{([^}]+)\\}/g,(c,f)=>{let h=t[f];return h==null||h===""?(i=!1,""):String(h)}).trim();if(i&&u)return u}return""}function or(e,t){let n=[],r=[];for(let i=0;i<e.length;i++){let o=e.feature(i);if(o.type===1&&pe(t,o.properties))for(let u of o.loadGeometry())for(let c=0;c+1<u.length;c+=2)n.push(u[c],u[c+1]),r.push(o.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var fo="\\u241F",Jt=(e,t)=>e+fo+String(t);function ao(){let e=typeof self<"u"?self.origin:void 0;return e&&e!=="null"&&!e.startsWith("blob:")?e+"/":void 0}async function sr(e,t){let n=performance.now(),r=ao(),i=await fetch(e.url,{signal:t,credentials:"same-origin",...r?{referrer:r}:{}}),o=(A,k,L,V,U=0)=>({type:"loaded",id:e.id,buckets:{},timing:{fetchMs:V,parseMs:U},diag:{status:A,bytes:k,layers:L,built:0}});if(!i.ok){if(i.status===404||i.status===204)return o(i.status,0,[],performance.now()-n);throw new Error(`HTTP ${i.status} \\u0434\\u043B\\u044F ${e.url}`)}let u=await i.arrayBuffer(),c=performance.now()-n;if(u.byteLength===0)return o(i.status,0,[],c);let f=performance.now(),h=new wt(u),m=Object.keys(h.layers),g={},x=[],v={},S=new Set,P=[],I=e.plan.some(A=>A.type==="surface"&&(A.elevation??0)>0)&&e.plan.some(A=>A.type==="line"&&A.ground)?Tn(e.metersPerTile):void 0;for(let A of e.plan){if(!po(A,e.zoom,e.sourceMaxZoom))continue;let k=h.layers[A.sourceLayer];if(!k)continue;let L=mo(e.zoom,k.extent);try{if(A.splitBy){let U=xo(k,A.splitBy,A.filter);if(!U.length)continue;let N=v[A.splitBy]??(v[A.splitBy]=[]);for(let T of U){N.includes(T)||N.push(T);let j={...A,splitBy:void 0,filter:yo(A.filter,A.splitBy,T)},Y=qt(j,k,L,e.metersPerTile,I,void 0,x);Y&&(g[Jt(A.id,T)]=Y)}continue}if(A.network&&A.type==="line"){for(let U of go(k,A.filter)){let N=qt(A,k,L,e.metersPerTile,I,U,x);N&&(g[Jt(A.id,U)]=N,S.add(U))}continue}let V=qt(A,k,L,e.metersPerTile,I,void 0,x);V&&(g[A.id]=V)}catch(V){P.push(`${A.id}: ${V instanceof Error?V.message:String(V)}`)}}return{type:"loaded",id:e.id,buckets:g,...x.length?{seams:x}:{},...Object.keys(v).length?{splits:v}:{},...S.size?{levels:[...S].sort((A,k)=>A-k)}:{},timing:{fetchMs:c,parseMs:performance.now()-f},diag:{status:i.status,bytes:u.byteLength,layers:m,built:Object.keys(g).length,...P.length?{failed:P}:{}}}}function ho(e){return t=>{let n=t.on;if(typeof n!="string"||!n)return 0;let r=0;for(let i of n.split(",")){let o=e[i];typeof o=="number"&&o>r&&(r=o)}return r}}function po(e,t,n){let r=t-1,i=t<n?t+1:24;return!(e.maxzoom<r||e.minzoom>i)}function mo(e,t){return e<=6?Math.max(64,t/24):0}function qt(e,t,n,r,i,o,u){{if(e.type==="fill"){let f=r>0?r/t.extent:0,h=e.cornerRadius&&f>0?{radius:e.cornerRadius/f,segments:e.cornerSegments,extent:t.extent,minCutRatio:0,maxChord:gn/f}:void 0,m=Bn(t,e.filter,n,h,e.clipToTile===!0,t.extent);return m?{kind:"fill",...m,extent:t.extent}:null}if(e.type==="surface"){let f=Qn(t,t.extent,e.filter,{metersPerUnit:r>0?r/t.extent:0,maxSegment:n,elevation:e.elevation??0,base:e.base,bevel:e.bevel,weld:e.weld,bevelDrop:e.bevelDrop,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments,...i?{onShapes:h=>Cn(i,h,e.elevation??0,t.extent)}:{},...e.groundBy?{liftBy:ho(e.groundBy)}:{}});return f?{kind:"surface",...f}:null}if(e.type==="line"){let f=qn(t,e.filter,n,e.ground?i:void 0,r>0?r/t.extent:0,{level:o});return f?{kind:"line",...f,extent:t.extent}:null}if(e.type==="model"){let f=or(t,e.filter);return f?{kind:"placement",...f,extent:t.extent}:null}if(e.type==="symbol"){let f=ir(t,{filter:e.filter,textField:e.textField,iconImage:e.iconImage,iconRotate:e.iconRotate,textPlacement:e.textPlacement,abbreviate:e.abbreviate});return f?{kind:"symbol",...f,extent:t.extent}:null}let c=_n(t,t.extent,e.filter,{metersPerUnit:r>0?r/t.extent:0,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments},u);return c?{kind:"fill-extrusion",vertices:c.vertices,indices:c.indices,featureIds:c.featureIds,vertexCount:c.vertexCount,indexCount:c.indexCount,extent:c.extent}:null}}function xo(e,t,n){let r=[];for(let i of e.features()){if(!pe(n,i.properties))continue;let o=i.properties[t];typeof o!="string"&&typeof o!="number"||r.includes(o)||r.push(o)}return r.sort((i,o)=>typeof i=="number"&&typeof o=="number"?i-o:String(i).localeCompare(String(o))),r}function go(e,t){let n=[];for(let r of e.features()){if(!pe(t,r.properties))continue;let i=Je(r.properties);n.includes(i)||n.push(i)}return n.sort((r,i)=>r-i)}function yo(e,t,n){let r=["==",t,n];return e?["all",e,r]:r}var bo=e=>e.kind==="symbol",wo=e=>e.kind==="placement";function ur(e){let t=[];for(let n of Object.values(e.buckets)){if(wo(n)){t.push(n.anchors);continue}if(bo(n)){t.push(n.anchors,n.priorities),n.lines&&t.push(n.lines),n.lineStarts&&t.push(n.lineStarts);continue}t.push(n.vertices,n.indices),n.featureIds&&t.push(n.featureIds),n.shapeFeatures&&t.push(n.shapeFeatures),n.shapeRanges&&t.push(n.shapeRanges)}return t}var lr=Map;var qe=new lr,en=self;en.onmessage=e=>{let t=e.data;if(t.type==="abort"){qe.get(t.id)?.abort(),qe.delete(t.id);return}let n=new AbortController;qe.set(t.id,n),sr(t,n.signal).then(r=>{qe.has(t.id)&&(qe.delete(t.id),en.postMessage(r,ur(r)))}).catch(r=>{let i=n.signal.aborted;qe.delete(t.id);let o={type:"error",id:t.id,message:r instanceof Error?r.message:String(r),aborted:i};en.postMessage(o)})};})();\n';var Ru=2,$o=class{constructor(e=_n()){this.workers=[];this.blobUrl=null;this.pending=new z;this.queue=new z;this.busy=[];this.nextId=1;this.mainThreadAborts=new z;this.destroyed=false;try{let t=new Blob([xn],{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,this.busy=new Array(this.workers.length).fill(0);}get size(){return this.workers.length}load(e,t,o=0){let r=this.nextId++,n={type:"load",id:r,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(r,a),Al(n,a.signal).then(l=>{this.mainThreadAborts.has(r)&&(this.mainThreadAborts.delete(r),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(r),t({type:"error",id:r,message:l instanceof Error?l.message:String(l),aborted:s});}),r}return this.queue.set(r,{message:n,resolve:t,priority:o}),this.pump(),r}pump(){for(;;){if(!this.queue.size)return;let e=-1;for(let r=0;r<this.busy.length;r++)this.busy[r]>=Ru||(e<0||this.busy[r]<this.busy[e])&&(e=r);if(e<0)return;let t=-1,o=null;for(let[r,n]of this.queue.entries())o&&n.priority>=o.priority||(t=r,o=n);if(!o)return;this.queue.delete(t),this.busy[e]++,this.pending.set(t,{resolve:o.resolve,workerIndex:e}),this.workers[e].postMessage(o.message);}}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}if(this.queue.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),this.busy[t.workerIndex]--,this.pump();}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),this.busy[t.workerIndex]--,this.pump(),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.queue.clear(),this.busy=[],this.disposeWorkers();}};function _n(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function Il(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function Cn(i,e){let t=Il(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 Sn(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 Rl={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}},ao=i=>Rl[i]??Rl.high;function Fl(i){let e=i.toLowerCase();return e?/swiftshader|llvmpipe|software|basic render|microsoft basic|mesa offscreen/.test(e)?"software":/rtx|geforce gtx (9|10|16|20|30|40|50)|radeon rx|radeon pro|arc a\d|apple m\d/.test(e)?"strong":/intel\(r\) hd graphics|hd graphics [2-5]\d{3}|uhd graphics 6\d\d/.test(e)||/mali-t\d|mali-g[35]\d|adreno \(tm\) [3-5]\d\d|powervr/.test(e)?"weak":"unknown":"unknown"}function Zo(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r,gpu:n}=i;if(n==="software")return "minimal";let a=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";return n==="weak"?En(a)??a:n==="strong"&&!o?zl(a)??a:a}function Qo(){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,gpu:Fu()}}function Fu(){if(typeof document>"u")return "unknown";let i=null;try{let e=document.createElement("canvas");if(e.width=1,e.height=1,i=e.getContext("webgl2")??e.getContext("webgl"),!i)return "software";let t=i.getExtension("WEBGL_debug_renderer_info"),o=t?i.getParameter(t.UNMASKED_RENDERER_WEBGL):i.getParameter(i.RENDERER);return typeof o=="string"?Fl(o):"unknown"}catch{return "unknown"}finally{i?.getExtension("WEBGL_lose_context")?.loseContext();}}function kn(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 qo(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function zl(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function En(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var Mn=120,zu=40,Pu=.35,Hu=.02,Ou=150,Bu=30,Wu=1,Vu=1800,Tn=30,Du=1.25,io=class{constructor(e,t,o,r){this.current=e;this.ceiling=t;this.slowMs=o;this.verySlowMs=r;this.ring=new Uint8Array(Mn);this.at=0;this.sum=0;this.filled=0;this.steady=0;this.warmup=0;this.attempts={};this.arrivedByUp=false;this.recent=new Float32Array(Tn);this.recentAt=0;this.recentFilled=0;this.refreshMs=0;}get limit(){return this.ceiling}reset(e,t){this.current=e,this.ceiling=t,this.attempts={},this.arrivedByUp=false,this.restart();}frame(e,t){if(t)return null;if(this.warmup>0)return this.warmup--,null;let o=this.threshold(e),r=e>o*(this.verySlowMs/this.slowMs)?3:e>o?1:0;if(this.sum+=r-this.ring[this.at],this.ring[this.at]=r,this.at=(this.at+1)%Mn,this.filled<Mn&&this.filled++,this.steady++,this.steady===Vu&&(this.attempts[this.current]=0),this.filled<zu)return null;let n=this.sum/this.filled;return n>=Pu?this.down(n):n>Hu?null:this.up(n)}threshold(e){this.recent[this.recentAt]=e,this.recentAt=(this.recentAt+1)%Tn,this.recentFilled<Tn&&this.recentFilled++;let t=this.refreshMs;if(!t){t=1/0;for(let o=0;o<this.recentFilled;o++)t=Math.min(t,this.recent[o]);}return Math.max(this.slowMs,t*Du)}setRefresh(e){e>=1e3/240&&e<=50&&(this.refreshMs=e);}down(e){let t=En(this.current);if(!t)return null;if(this.arrivedByUp){let o=(this.attempts[this.current]??0)+1;this.attempts[this.current]=o,o>=Wu&&qo(t)<qo(this.ceiling)&&(this.ceiling=t);}return this.moveTo(t,false),{to:t,direction:"down",share:e}}up(e){let t=zl(this.current);if(!t||qo(t)>qo(this.ceiling))return null;let o=Ou*2**(this.attempts[t]??0);return this.steady<o?null:(this.moveTo(t,true),{to:t,direction:"up",share:e})}moveTo(e,t){this.current=e,this.arrivedByUp=t,this.restart();}restart(){this.ring.fill(0),this.at=0,this.sum=0,this.filled=0,this.steady=0,this.warmup=Bu;}};var Nu=1,lo=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${Nu++}`,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=te(l),c=le(s.lng),f=se(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=te(o);t.push(le(r.lng)-this.originX,se(r.lat)-this.originY);}return t}color(e,t){let o=de(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}},In=class extends lo{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=Vt([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=Vt([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=de(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=Rn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(Pl(e,n[a],n[a+1])<=r)return true;return false}},Jo=class extends lo{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=Xr(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(An(a))),n=Vt(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=Rn(An(this.coordinates[0]??[]),this.altitude,t);if(!Fn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Fn(e,Rn(An(this.coordinates[r]),this.altitude,t)))return false;return true}},Ln=class extends Jo{constructor(e){super({...e,coordinates:[Gu(e.center,e.radius,e.segments)]});}};function Gu(i,e,t){let o=te(i),r=e/Le(o.lat),n=le(o.lng),a=se(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([Te(n+Math.cos(f)*r),Se(a+Math.sin(f)*r)]);}return s}function Rn(i,e,t){let o=[];for(let r of i){let n=te(r),a=t(n.lng,n.lat,e);a&&o.push(a);}return o}function An(i){if(i.length<2)return i;let e=te(i[0]),t=te(i[i.length-1]);return e.lng===t.lng&&e.lat===t.lat?i:[...i,i[0]]}function Pl(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 Fn(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 Hl="objects3d",Et="level",Uu=32,ju=100,Xu=250;function Ol(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 Ku(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 zn=class extends Ue{constructor(t){super();this.options=t;this.transform=new Lt;this.ctx=null;this.sources=new z;this.rasterSources=new z;this.renderer=new Kt;this.objects=new Nt;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.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new z;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?Zo(Qo()):t.quality;this.governor=new io(r,r,Uu,ju),this.quality=ao(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new pt(t.theme?Ao(t.theme,t.style):t.style),this.background=t.background?de(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=te(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 $o(t.workerCount??Math.min(_n(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),this.measureRefresh(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}measureRefresh(){if(typeof requestAnimationFrame!="function")return;let t=[],o=r=>{if(this.destroyed)return;if(t.push(r),t.length<12){requestAnimationFrame(o);return}let n=1/0;for(let a=1;a<t.length;a++)n=Math.min(n,t[a]-t[a-1]);this.governor.setRefresh(n);};requestAnimationFrame(o);}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 fo(t);let o=new St(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...nt,...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($,{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 Yo({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:Hl,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}sourceDrawn(t,o){for(let r of this._style.layers)if(r.type!=="raster"&&(r.source??$)===t&&this._style.layerVisibleAt(r,o))return true;return t===this.objects3dSource&&this.objects3dEnabled?o>=(this.options.objects3d?.layout?.minZoom??0):false}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(Ku):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:Hl,"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(Ne(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get($);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??$)!==$)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===Et&&t.add(o.source??$);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??$;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 eo({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 Go(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t),rank:t===$?0:1});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:n})=>this.emit("error",{message:n})),t===$&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new wo(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=kn(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=te(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=te(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?te(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+lt((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?te(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+lt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=je(r.zoom),s=(le(a.center.lng)-le(r.center.lng))*l,c=(se(a.center.lat)-se(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=C=>{let S=C===0?u:d,T=C===0?d:u;return (T*T-S*S+(C===0?1:-1)*m*m*f*f)/(2*S*m*f)},v=C=>Math.log(-g(C)+Math.sqrt(g(C)*g(C)+1)),w=v(0);y=(v(1)-w)/h;let _=C=>(Math.exp(C)+Math.exp(-C))/2,M=C=>(Math.exp(2*C)-1)/(Math.exp(2*C)+1);p=C=>{let S=h*C+w;return {u:u*_(w)*M(S)/m-u*Math.sinh(w)/m,w:u*_(w)/_(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=Ol(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new At;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=tr(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?Ol(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=xe((t-o.start)/o.duration,0,1),n=o.fly?r:co(r),a=this.transform,l=te(o.from.center),s=te(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),u=o.fly.u1>1e-6?xe(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)*co(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*co(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(te(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new pt(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(Ao(t,this.options.style))}static get themes(){return Object.keys(Be)}static get themeList(){return Object.entries(Be).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)}setDebugTiles(t){return this.renderer.debugTiles=t,this.triggerRepaint(),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:Te(r.mercX),lat:Se(r.mercY)},key:St.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??$);if(!n)continue;let a=Nr(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 z,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??$)));}if(!n||!o.length)return null;let a=Gr(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=Cn({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=Sn(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"?Zo(Qo()):t;return this.governor.reset(o,o),this.applyQuality(ao(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.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();}checkFrameBudget(t){if(!this.qualityAuto)return;let o=this.governor.frame(t,this.sum(n=>n.pendingCount)>0);if(!o)return;let r=`${(o.share*100).toFixed(0)}%`;console.info(o.direction==="down"?`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${r} \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${o.to}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F, \u043F\u043E\u0442\u043E\u043B\u043E\u043A \xAB${this.governor.limit}\xBB)`:`[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${o.to}\xBB`),this.applyQuality(ao(o.to),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=de(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(n=>(n.source??$)===o&&"splitBy"in n&&n.splitBy===Et))for(let n of r.splitValues(Et)){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[Et];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Et]:this._style.splitValues[Et]=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 no)}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,It):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,m]of this.sources)this.sourceDrawn(h,this.transform.zoom)?m.update(this.transform):m.deactivate();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<Xu,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();}}},N1=zn;
2336
+ `;var Lo=i=>i.kind==="symbol",Ua=i=>i.kind==="placement";function Ne(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(Bc(e,t,a,l,s,c,f,u)||o>0&&(Hr(e,t,a,l,s,c)<=o||Hr(e,t,s,c,f,u)<=o||Hr(e,t,f,u,a,l)<=o))return true}return false}function Bc(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 Hr(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 Or(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]*Xe;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 Br(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]*ke;s[c*2]=a+o.getInt16(f,true)*n,s[c*2+1]=l+o.getInt16(f+2,true)*n;}return s}var Vc={stride:8,attribs:[{name:"a_pos",size:2,type:5126,offset:0}]},Dc=40,Nc=10.5,ja=2.5,Gc=16,Uc=4,jc=7,Bt=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(w=>w.type==="symbol"&&w.layout?.placement==="map"&&r.layerVisibleAt(w,c));if(!f.length)return;let u=t.center,d=le(u.lng),h=se(u.lat),m=t.worldSize>0?t.pixelsPerMeter/t.worldSize:0;if(!(m>0))return;let y=[];for(let w of f){let x=o.get(w.source??$);if(!x)continue;let _=r.bucketKeyFor(w);if(_===null)continue;let M=w.layout?.showFor==="highlight";if(M&&!this.highlightFootprint)continue;let C=m*1.5,T=w.layout?.arrowUnits==="meters"?m:1/t.worldSize,A=D(w.layout?.arrowLength,c,Dc)*T,k=D(w.layout?.arrowWidth,c,Nc)*T,L=D(w.layout?.arrowOutline,c,ja)*T,R=D(w.layout?.arrowGap,c,Gc)*T,I=D(w.layout?.arrowDotRadius,c,Uc)*T,E=D(w.layout?.arrowDotGap,c,jc)*T,O=Vr(A,k,I,R-E),W=L>0?Vr(A,k,I,R-E,L).outline:null,F={layer:w,verts:[],shape:O};for(let P of x.visibleTiles){let B=x.getTile(P)?.data?.buckets?.[_];if(!B||!Lo(B))continue;let H=new Int16Array(B.anchors),V=B.rotations?new Int16Array(B.rotations):null,j=P.bounds(),X=(j.maxX-j.minX)/B.extent,q=j.minX,Q=j.minY;for(let Z=0;Z<H.length/2;Z++){let U=q+H[Z*2]*X,ne=Q+H[Z*2+1]*X;if(M&&!Ne(this.highlightFootprint,U,ne,C))continue;let ie=(V?V[Z]:0)*Math.PI/180,ee=Math.sin(ie),K=-Math.cos(ie),Y=U-d-ee*R,oe=ne-h-K*R;W&&Dr(F,W,Y,oe,ee,K),Dr(F,O.outline,Y,oe,ee,K),this.count++;}}F.verts.length&&y.push(F);}if(!y.length)return;let p=y[0].shape,b=p.outline.length/2,g=[],v=[];for(let w of y){let x=g.length/2/b;for(let _ of w.verts)g.push(_);v.push({layer:w.layer,first:x,count:w.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 w of v){let x=w.layer.paint,_=D(x.opacity,c,1),M=Ae(x.color,c,[.18,.45,.76,1]),C=Ae(x.haloColor,c,[1,1,1,1]),S=D(w.layer.layout?.arrowOutline,c,ja)>0;Xc(e,n,w,C,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 pe(e,new Uint8Array(this.capacity*n*8),Vc,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 ue(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 Xc(i,e,t,o,r,n,a,l){let s=a?2:1;if(a){e.setVec4v("u_color",Ce([o[0],o[1],o[2],o[3]*n]));for(let c=0;c<t.count;c+=s)Xa(i,t.first+c,l);}e.setVec4v("u_color",Ce([r[0],r[1],r[2],r[3]*n]));for(let c=a?1:0;c<t.count;c+=s)Xa(i,t.first+c,l);}function Xa(i,e,t){i.gl.drawElements(i.gl.TRIANGLES,t,i.gl.UNSIGNED_INT,e*t*4);}var Ka=4,Wr=12;function Vr(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?Kc(u,r):u,m=mi__default.default(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<Wr;b++){let g=b/Wr*Math.PI*2;h.push(o+Math.cos(g)*p,Math.sin(g)*p);}for(let b=1;b<Wr-1;b++)m.push(y,y+b,y+b+1);return {outline:h,indices:m}}function Kc(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,w=p+g,x=Math.hypot(v,w);if(x<1e-9){n.push(c,f);continue}v/=x,w/=x;let _=Math.min(1/Math.max(v*y+w*p,.35),3);n.push(c+v*e*_,f+w*e*_);}return n}function Dr(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 Yc(i,e,t,o,r,n=0,a=0){let l=t*Math.PI/180,s={verts:[]};return Dr(s,Vr(o,r,n,a).outline,i,e,Math.sin(l),-Math.cos(l)),s.verts}var $c=5;function Ya(i,e){let t=1/(1<<e),o=(1<<e)-1;return [(i.x&o)*t,(i.y&o)*t,t]}var Ro=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=D(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<=$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:Ya(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 qc="indoor-",Wt=class{constructor(){this.parts=null;this.stamp="";this.cache=new z;this.box=null;this.hidden=new J;this.collected=new J;}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(qc)||d.type!=="fill"||!t.layerVisibleAt(d,o))continue;let h=t.bucketKeyFor(d);h&&(r.push(h),n??(n=e.get(d.source??$)));}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=Or(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 z;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]*ke,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])||Ne(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 ue(e,new Uint32Array(d));c={vao:new fe(e,[{buffer:n,locations:a}],h),ibo:h,count:d.length};}}return this.cache.set(r.dataKey,c),c}};var $a=35,Zc=70,Qc=.35,Jc=.5,ef=1.1;function bt(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=xe((i.pitch-$a)/(Zc-$a),0,1),n=t.fogRange[0]*(1-Qc*r)*o,a=t.fogRange[1]*(1-Jc*r)*o,l=Math.min(1,t.fogIntensity+(1-t.fogIntensity)*Math.min(1,r*2)),s=l>=.995?a*ef:1/0;return {near:n,far:a,intensity:l,cutoff:s}}function Nr(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&&qa(u,t);if(!d||!Pe(l,i.tileMatrix64(f,d.extent))||(he(s,l,[r,n,-1,1]),he(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=of(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 Gr(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||!Pe(l,i.tileMatrix64(f,h.extent))||(he(s,l,[r,n,-1,1]),he(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,w=y+(c[1]/c[3]-y)*g,x=tf(h,v,w);x!==null&&(!a||g<a.distance)&&(a={featureId:x,tile:f,layerId:d,distance:g});}}return a}function tf(i,e,t){let o=new DataView(i.vertices),r=new Uint32Array(i.indices),n=new Float64Array(i.featureIds),a=s=>o.getInt16(s*Xe,true),l=s=>o.getInt16(s*Xe+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),w=(e-d)*(b-h)-(p-d)*(t-h),x=g<0||v<0||w<0,_=g>0||v>0||w>0;if(!(x&&_))return n[s]}return null}function qa(i,e){let t=i.data?.buckets?.[e];return !t||t.kind!=="fill-extrusion"||!t.featureIds?null:t}function of(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*ke,true)/ft,u=y=>l.getInt16(y*ke+2,true)/ft,d=y=>l.getUint16(y*ke+4,true)/ut,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),w=u(p),x=d(p),_=f(b)-v,M=u(b)-w,C=d(b)-x,S=f(g)-v,T=u(g)-w,A=d(g)-x,k=n*A-a*T,L=a*S-r*A,R=r*T-n*S,I=_*k+M*L+C*R;if(I>-1e-9&&I<1e-9)continue;let E=1/I,O=e-v,W=t-w,F=o-x,P=(O*k+W*L+F*R)*E;if(P<0||P>1)continue;let N=W*C-F*M,B=F*_-O*C,H=O*M-W*_,V=(r*N+n*B+a*H)*E;if(V<0||P+V>1)continue;let j=(S*N+T*B+A*H)*E;j<0||j>1||j>=h||(h=j,m=c[y/3]??0);}return m>=0?{featureId:m,t:h}:null}function Fo(i,e,t){let o=qa(i,e);return o?Ur(o,t):null}function Ur(i,e){if(!i.featureIds)return null;let t=new Uint32Array(i.indices),o=new Float64Array(i.featureIds),r=[];for(let n=0;n+2<t.length;n+=3)o[n/3]===e&&r.push(t[n],t[n+1],t[n+2]);return r.length?{vertices:i.vertices,indices:new Uint32Array(r)}:null}var yt=24,jr=8,nf=2,af=12,zo=8,Po=8;function Vt(i){let e=0;for(let h of i)e+=h.length/2;if(e<2)return null;let t=(zo+2)*2,o=e*t+i.length*(Po+2)*2+8,r=e*(zo+2)*6+i.length*Po*6+24,n=new ArrayBuffer(o*yt),a=new DataView(n),l=new Uint32Array(r),s=0,c=0,f=(h,m,y,p,b,g)=>{let v=s*yt;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 w=f(h,m,0,0,0,v),x=f(h,m,y,p,1,v);for(let _=1;_<=Po;_++){let M=Math.PI*_/Po,C=y*Math.cos(M)+b*Math.sin(M),S=p*Math.cos(M)+g*Math.sin(M),T=f(h,m,C,S,1,v);l[c++]=w,l[c++]=x,l[c++]=T,x=T;}};for(let h of i){let m=lf(h),y=m.length/2;if(y<2)continue;let p=new Float64Array(y-1),b=new Float64Array(y-1);for(let _=0;_<y-1;_++){let M=m[_*2+2]-m[_*2],C=m[_*2+3]-m[_*2+1],S=Math.hypot(M,C)||1;p[_]=M/S,b[_]=C/S;}let g=0,v=-1,w=-1;for(let _=0;_<y;_++){let M=m[_*2],C=m[_*2+1];_>0&&(g+=Math.hypot(M-m[_*2-2],C-m[_*2-1]));let S=_>0?_-1:0,T=_<y-1?_:y-2,A=-b[S],k=p[S],L=-b[T],R=p[T],I=A+L,E=k+R,O=Math.hypot(I,E);O>1e-9?(I/=O,E/=O):(I=A,E=k);let W=I*L+E*R,F=W>1e-6?1/W:1/0,P=Math.acos(Math.min(1,Math.max(-1,p[S]*p[T]+b[S]*b[T])));if(!(P>af*Math.PI/180)&&F<=nf){let B=f(M,C,I*F,E*F,1,g),H=f(M,C,-I*F,-E*F,-1,g);v>=0&&u(v,w,B,H),v=B,w=H;}else {let B=Math.max(1,Math.min(zo,Math.ceil(P/(Math.PI/zo)))),V=p[S]*b[T]-b[S]*p[T]>=0?1:-1,j=f(M,C,A,k,1,g),X=f(M,C,-A,-k,-1,g);v>=0&&u(v,w,j,X);for(let q=1;q<=B;q++){let Q=V*P*(q/B),Z=Math.cos(Q),U=Math.sin(Q),ne=A*Z-k*U,ie=A*U+k*Z,ee=f(M,C,ne,ie,1,g),K=f(M,C,-ne,-ie,-1,g);u(j,X,ee,K),j=ee,X=K;}v=j,w=X;}}let x=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[x],p[x],p[x],b[x],g);}return c?{vertices:n.slice(0,s*yt),indices:l.slice(0,c),vertexCount:s}:null}function Xr(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=mi__default.default(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 lf(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 Dt=5126,sf={stride:jr,attribs:[{name:"a_pos",size:2,type:Dt,offset:0}]},Yr={stride:yt,attribs:[{name:"a_pos",size:2,type:Dt,offset:0},{name:"a_extrude",size:2,type:Dt,offset:8},{name:"a_side",size:1,type:Dt,offset:16},{name:"a_dist",size:1,type:Dt,offset:20}]},Kr=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();}},cf=(i,e)=>[i[0],i[1],i[2],i[3]*e],Nt=class{constructor(){this.objects=[];this.markers=[];this.gpu=new z;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:w,ibo:x}of p.parts){if(c&&(v.kind!=="line"||v.arrow))continue;let _=c?cf(v.color,y):v.color;if(v.kind==="fill")h!==o&&(o.use(),l?.(o),h=o),o.setVec4v("u_color",Ce(_)),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,C=d>1e-9?1/d:1;if(n.setVec4v("u_color",Ce(_)),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",C),n.setFloat("u_units_to_px",d),n.setInt("u_pattern",c?0:v.dashArray?1:v.arrow?2:0),v.dashArray){let[S,T]=v.dashArray;n.setVec2("u_dash",S*u,(S+T)*u);}if(v.arrow){n.setVec4v("u_arrow_color",Ce(v.arrowColor??[1,1,1,1]));let S=(v.arrowSize??5)*u;n.setVec3("u_arrow",(v.arrowPeriod??46)*u,Math.max(S*.4,1),Math.min(S,M*.72));}b&&n.setMat4("u_shadow_matrix",b),n.setMat4("u_matrix",g);}w.bind(),e.gl.drawElements(e.gl.TRIANGLES,x.count,x.type,0);}}e.bindVAO(null);}hitTest(e,t,o=4){let r=e.worldSize,n=(a,l,s)=>e.worldPxToPoint(le(a)*r,se(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=te(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"?sf:Yr,f=s.kind==="fill"?o:r,u=new pe(e,new Uint8Array(s.mesh.vertices),c),d=new ue(e,s.mesh.indices),h=new fe(e,[{buffer:u,locations:f}],d);a.push({part:s,vao:h,vbo:u,ibo:d});}let l=new Kr(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 Ho=32,ff=1179937895,uf=1313821514,df=5130562,hf={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},mf={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT4:16};async function $r(i){let{json:e,bin:t}=Za(i),o=await bf(e,t);return Ja(e,t,o)}function pf(i){let{json:e,bin:t}=Za(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 Ja(e,t,null)}function Za(i){let e=new DataView(i);if(e.getUint32(0,true)!==ff)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===uf?t=JSON.parse(new TextDecoder().decode(new Uint8Array(i,l,n))):a===df&&(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 bf(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 Qa(i){let e=G();if(i.matrix){for(let C=0;C<16;C++)e[C]=i.matrix[C];return e}We(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,w=l*m,x=s*d,_=s*h,M=s*m;return e[0]=(1-(g+w))*c,e[1]=(p+M)*c,e[2]=(b-_)*c,e[4]=(p-M)*f,e[5]=(1-(y+w))*f,e[6]=(v+x)*f,e[8]=(b+_)*u,e[9]=(v-x)*u,e[10]=(1-(y+g))*u,e[12]=t,e[13]=o,e[14]=r,e}var yf={5120:127,5121:255,5122:32767,5123:65535};function gf(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 Ja(i,e,t){let o=C=>{let S=t?.get(C);if(S)return S;let T=i.bufferViews?.[C];if(!T)return null;let A=T.byteOffset??0;return e.subarray(A,A+T.byteLength)},r=[],n=[],a=[],l=[],s=[],c=[1/0,1/0,1/0],f=[-1/0,-1/0,-1/0],u=C=>{if(C===void 0)return null;let S=i.accessors?.[C];if(!S)return null;let T=mf[S.type]??1,A=new Float64Array(S.count*T),k=S.bufferView!==void 0?i.bufferViews?.[S.bufferView]:void 0;if(!k||S.bufferView===void 0)return {data:A,components:T};let L=o(S.bufferView);if(!L)return {data:A,components:T};let R=hf[S.componentType]??4,I=k.extensions?.EXT_meshopt_compression,E=I?I.byteStride:k.byteStride,O=E&&E>0?E:R*T,W=S.byteOffset??0,F=new DataView(L.buffer,L.byteOffset,L.byteLength),P=S.normalized?yf[S.componentType]??1:1;for(let N=0;N<S.count;N++)for(let B=0;B<T;B++){let H=W+N*O+B*R,V;switch(S.componentType){case 5120:V=F.getInt8(H);break;case 5121:V=F.getUint8(H);break;case 5122:V=F.getInt16(H,true);break;case 5123:V=F.getUint16(H,true);break;case 5125:V=F.getUint32(H,true);break;default:V=F.getFloat32(H,true);}A[N*T+B]=P===1?V:Math.max(V/P,-1);}return {data:A,components:T}},d=(C,S,T=-1)=>{if(C.mode!==void 0&&C.mode!==4)return;let A=u(C.attributes.POSITION);if(!A)return;let k=u(C.attributes.NORMAL),L=u(C.attributes.TEXCOORD_0),R=u(C.indices),I=r.length/3,E=A.data.length/3,O=gf(S),F=(C.material!==void 0?i.materials?.[C.material]:void 0)?.pbrMetallicRoughness?.baseColorTexture?.extensions?.KHR_texture_transform,P=F?{ox:F.offset?.[0]??0,oy:F.offset?.[1]??0,sx:F.scale?.[0]??1,sy:F.scale?.[1]??1,rot:F.rotation??0}:null;for(let U=0;U<E;U++){let ne=A.data[U*3],ie=A.data[U*3+1],ee=A.data[U*3+2],K=S[0]*ne+S[4]*ie+S[8]*ee+S[12],Y=S[1]*ne+S[5]*ie+S[9]*ee+S[13],oe=S[2]*ne+S[6]*ie+S[10]*ee+S[14];if(r.push(K,Y,oe),K<c[0]&&(c[0]=K),Y<c[1]&&(c[1]=Y),oe<c[2]&&(c[2]=oe),K>f[0]&&(f[0]=K),Y>f[1]&&(f[1]=Y),oe>f[2]&&(f[2]=oe),k){let ae=k.data[U*3],me=k.data[U*3+1],we=k.data[U*3+2],ge=O[0]*ae+O[3]*me+O[6]*we,Qe=O[1]*ae+O[4]*me+O[7]*we,at=O[2]*ae+O[5]*me+O[8]*we,so=Math.hypot(ge,Qe,at);so>1e-12?(ge/=so,Qe/=so,at/=so):(ge=0,Qe=1,at=0),n.push(ge,Qe,at);}else n.push(0,1,0);let re=L?L.data[U*2]:0,ce=L?L.data[U*2+1]:0;if(P){if(P.rot!==0){let ae=Math.cos(P.rot),me=Math.sin(P.rot),we=ae*re+me*ce,ge=-me*re+ae*ce;re=we,ce=ge;}re=re*P.sx+P.ox,ce=ce*P.sy+P.oy;}a.push(re,ce);}let N=l.length;if(R)for(let U=0;U<R.data.length;U++)l.push(I+R.data[U]);else for(let U=0;U<E;U++)l.push(I+U);let B=C.material!==void 0?i.materials?.[C.material]:void 0,H=B?.pbrMetallicRoughness,V=H?.metallicFactor!==void 0||H?.roughnessFactor!==void 0,j=H?.baseColorFactor??[1,1,1,1],X=H?.baseColorTexture?.index,q=X!==void 0?i.textures?.[X]?.source:void 0,Q=B?.emissiveFactor??[0,0,0],Z=B?.extensions?.KHR_materials_emissive_strength?.emissiveStrength??1;s.push({indexOffset:N,indexCount:l.length-N,baseColor:[j[0],j[1],j[2],j[3]??1],metallic:V?H?.metallicFactor??1:0,roughness:V?H?.roughnessFactor??1:1,emissive:[Q[0]*Z,Q[1]*Z,Q[2]*Z],texture:q??-1,doubleSided:B?.doubleSided===true,blend:B?.alphaMode==="BLEND",alphaCutoff:B?.alphaMode==="MASK"?B.alphaCutoff??.5:.02,node:T});},h=i.skins?.length?null:vf(i,u),m=h?h.nodes:null,y=(C,S,T,A)=>{let k=i.nodes?.[C];if(!k)return;let L=Qa(k),R=G();_e(R,S,L);let I=G(),E=A,O=m?.get(C);if(O?(O.parentNode=A,O.parent=T.slice(),We(I),E=C):_e(I,T,L),k.mesh!==void 0)for(let F of i.meshes?.[k.mesh]?.primitives??[])d(F,I,E);let W=k.extensions?.KHR_lights_punctual?.light;if(W!==void 0){let F=i.extensions?.KHR_lights_punctual?.lights?.[W],P=F?.type;if(F&&(P==="point"||P==="spot"||P==="directional")){let N=-R[8],B=-R[9],H=-R[10],V=Math.hypot(N,B,H)||1,j=F.spot?.innerConeAngle??0,X=F.spot?.outerConeAngle??Math.PI/4;p.push({type:P,color:[F.color?.[0]??1,F.color?.[1]??1,F.color?.[2]??1],intensity:F.intensity??1,range:F.range??0,position:[R[12],R[13],R[14]],direction:[N/V,B/V,H/V],cosInner:Math.cos(j),cosOuter:Math.cos(X)});}}for(let F of k.children??[])y(F,R,I,E);},p=[],b=G();We(b);let g=G();We(g);let v=i.scenes?.[i.scene??0]?.nodes??i.nodes?.map((C,S)=>S)??[];for(let C of v)y(C,b,g,-1);let w=[];for(let C of i.images??[]){if(C.bufferView===void 0){w.push(new Uint8Array(0));continue}let S=o(C.bufferView);w.push(S?S.slice():new Uint8Array(0));}let x=r.length/3,_=new ArrayBuffer(x*Ho),M=new Float32Array(_);for(let C=0;C<x;C++){let S=C*8;M[S]=r[C*3],M[S+1]=r[C*3+1],M[S+2]=r[C*3+2],M[S+3]=n[C*3],M[S+4]=n[C*3+1],M[S+5]=n[C*3+2],M[S+6]=a[C*2],M[S+7]=a[C*2+1];}return isFinite(c[0])||(c[0]=c[1]=c[2]=0,f[0]=f[1]=f[2]=0),{vertices:_,indices:new Uint32Array(l),primitives:s,images:w,min:c,max:f,animation:h,lights:p}}function vf(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:We(G()),base:wf(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 wf(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 qr(i,e,t,o){let r=i.nodes.get(e);if(!r)return We(o);let n=G();xf(r,t,n);let a=G();if(_e(a,r.parent,n),r.parentNode<0)return el(o,a);let l=G();return qr(i,r.parentNode,t,l),_e(o,l,a)}var el=(i,e)=>{for(let t=0;t<16;t++)i[t]=e[t];return i};function xf(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 el(t,Qa({translation:o,rotation:r,scale:n}))}var Ee=5126,_f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),tl={stride:Ho,attribs:[{name:"a_pos",size:3,type:Ee,offset:0},{name:"a_normal",size:3,type:Ee,offset:12},{name:"a_tex",size:2,type:Ee,offset:24}]},Qr=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);}},Zr=256,Oo=41,ol={stride:Oo*4,attribs:[{name:"a_i_m0",size:4,type:Ee,offset:0,divisor:1},{name:"a_i_m1",size:4,type:Ee,offset:16,divisor:1},{name:"a_i_m2",size:4,type:Ee,offset:32,divisor:1},{name:"a_i_m3",size:4,type:Ee,offset:48,divisor:1},{name:"a_i_s0",size:4,type:Ee,offset:64,divisor:1},{name:"a_i_s1",size:4,type:Ee,offset:80,divisor:1},{name:"a_i_s2",size:4,type:Ee,offset:96,divisor:1},{name:"a_i_s3",size:4,type:Ee,offset:112,divisor:1},{name:"a_i_n0",size:3,type:Ee,offset:128,divisor:1},{name:"a_i_n1",size:3,type:Ee,offset:140,divisor:1},{name:"a_i_n2",size:3,type:Ee,offset:152,divisor:1}]},Gt=2,gt=16,$e=class{constructor(){this.models=[];this.gpu=new z;this.counted=new Set;this.instBuffer=null;this.instScratch=new Float32Array(Zr*Oo);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",Gt);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(Gt,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 z;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 pe(e,this.instScratch,ol,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",Gt),o.setFloat("u_opacity",1),s=true);let u=c[0].mesh;for(let d=0;d<c.length;d+=Zr){let h=Math.min(Zr,c.length-d);for(let m=0;m<h;m++){let y=c[d+m],p=m*Oo;this.instScratch.set(y.matrixFor(t),p);let b=a?this.shadowMatrix(t,y):_f;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*Oo)),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(Gt,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<=gt?r:[...r].sort((f,u)=>u.intensity-f.intensity).slice(0,gt),a=new Float32Array(gt*4),l=new Float32Array(gt*4),s=new Float32Array(gt*4),c=new Float32Array(gt*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 pe(e,new Uint8Array(t.mesh.vertices),tl),l=new ue(e,t.mesh.indices),s=new fe(e,[{buffer:a,locations:o}],l),c=t.bitmaps.map(u=>{if(!u)return null;let d=n.createTexture();return d?(e.bindTexture(Gt,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 Qr(s,a,l,c);return f.users=1,this.counted.add(t),this.gpu.set(t.url,f),f}static get layout(){return tl}static get instanceLayout(){return ol}destroy(e){for(let t of this.gpu.values())t.destroy(e);this.gpu.clear(),this.models=[];}};var Jr=4,rl=new J;function Cf(i){rl.has(i)||(rl.add(i),console.warn(`[osmgl] ${i}`));}var Sf=.5,Mf=.01,Tf=300,en=127,kf=.5,vt=128,Ut=5120,Bo=5121,jt=5122,nl=5123,Xt=5126,Ef={stride:8,attribs:[{name:"a_pos",size:2,type:Xt,offset:0}]},tn={stride:Xe,attribs:[{name:"a_pos",size:2,type:jt,offset:0}]},il={stride:Ke,attribs:[{name:"a_p0",size:2,type:jt,offset:0},{name:"a_p1",size:2,type:jt,offset:4},{name:"a_corner",size:2,type:Ut,offset:8},{name:"a_ground",size:2,type:Ut,offset:10},{name:"a_dist",size:1,type:Xt,offset:12},{name:"a_width",size:1,type:Xt,offset:16}]},wt={stride:ke,attribs:[{name:"a_pos",size:2,type:jt,offset:0},{name:"a_height",size:1,type:nl,offset:4},{name:"a_tint",size:1,type:Bo,normalized:true,offset:6},{name:"a_ao",size:1,type:Bo,normalized:true,offset:7},{name:"a_normal",size:3,type:Ut,normalized:true,offset:8},{name:"a_kind",size:1,type:Bo,offset:11},{name:"a_wall",size:3,type:nl,offset:12}]},Af={flat:0,water:1,foliage:2,sand:3,asphalt:4},If=[1,9,14,26,3],al={stride:dt,attribs:[{name:"a_pos",size:2,type:Xt,offset:0},{name:"a_level",size:1,type:jt,offset:8},{name:"a_normal",size:3,type:Ut,normalized:true,offset:10},{name:"a_kind",size:1,type:Bo,offset:13},{name:"a_bleed",size:2,type:Ut,offset:14}]},Wo=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();}},ll={enabled:false,resolution:1024,strength:.75,color:"#5a6b86",bias:.25},Kt=class{constructor(){this.fill=null;this.surface=null;this.surfaceLocs=new z;this.line=null;this.building=null;this.depth=null;this.groundShadow=null;this.sky=null;this.raster=null;this.rasterLayer=new Ro;this.globeBody=null;this.globeClip=null;this.globeMesh=null;this.quad=null;this.fillLocs=new z;this.lineLocs=new z;this.objectLine=null;this.objectLineLocs=new z;this.buildingLocs=new z;this.shadows={...ll};this.shadowTarget=null;this.shadowPlaceholder=null;this.fog=null;this.shadowActive=false;this.materialTime=0;this.materialAnimating=false;this.stencilIds=new z;this.patternScale=1;this.debugTiles=false;this.cameraMeters=[0,0,0];this.dpr=1;this.detailScale=1;this.reliefScale=1;this.allowShadows=true;this.highlight=null;this.highlightGpu=new z;this.highlightKey="";this.groundArrows=new Bt;this.highlightTris=new z;this.fillHighlightGpu=new z;this.fillHighlightKey="";this.footprintKey="";this.highlightFill=null;this.indoorMask=new Wt;this.hiddenBuildings=new Set;this.seams=new ko;this.seamGpu=new z;this.hiddenWithSeams=new z;this.hiddenVenues=new Set;this.hiddenVenueLayer=null;this.hiddenCut=new z;this.hiddenStamp="";this.bucketIdCache=new z;this.surfaceCut=new z;this.shadowDepthPerMeter=1;this.shadowTexelMeters=0;this.growDurationMs=350;this.symbols=null;this.objects=null;this.models=new $e;this.model=null;this.modelInstanced=null;this.modelDepth=null;this.modelLocs=new z;this.modelInstLocs=new z;}get indoorOpen(){return this.indoorMask.active}syncHiddenStamp(){let e=r=>[...r].sort((n,a)=>n-a).join(","),t="";for(let[r,n]of this.seams.hiddenByTile)t+=`${r}=${e(n)};`;let o=e(this.hiddenBuildings)+"#"+e(this.hiddenVenues)+"#"+t;if(o!==this.hiddenStamp){this.hiddenStamp=o,this.hiddenWithSeams.clear();for(let[r,n]of this.seams.hiddenByTile){let a=new Set(this.hiddenBuildings);for(let l of n)a.add(l);this.hiddenWithSeams.set(r,a);}for(let r of this.hiddenCut.values())r?.vao.destroy(),r?.ibo.destroy();this.hiddenCut.clear();for(let r of this.surfaceCut.values())r?.vao.destroy(),r?.ibo.destroy();this.surfaceCut.clear();}}cutSurface(e,t,o,r,n,a){if(!a||!a.size)return null;let l=r+"|"+o,s=this.surfaceCut.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!=="surface"||!c.shapeFeatures||!c.shapeRanges)return null;let f=new Float64Array(c.shapeFeatures),u=new Uint32Array(c.shapeRanges),d=[],h=0;for(let x=0;x<f.length;h++){let _=f[x++],M=_>0;for(let C=0;C<_;C++)if(!a.has(f[x+C])){M=false;break}x+=_,M&&d.push(h);}if(!d.length)return this.surfaceCut.set(l,null),null;let m=new Uint32Array(c.indices),y=c.capIndexOffset??m.length,p=new Uint8Array(m.length);for(let x of d){for(let _=u[x*4];_<u[x*4+1];_++)p[_]=1;for(let _=u[x*4+2];_<u[x*4+3];_++)p[_]=1;}let b=[];for(let x=0;x<y;x++)p[x]||b.push(m[x]);let g=b.length;for(let x=y;x<m.length;x++)p[x]||b.push(m[x]);let v=new ue(e,new Uint32Array(b)),w={vao:new fe(e,[{buffer:n,locations:this.surfaceLocs}],v),ibo:v,vbo:n,mainCount:g,capCount:b.length-g};return this.surfaceCut.set(l,w),w}bucketIds(e,t,o){let r=this.bucketIdCache.get(e);if(r&&r.vbo===o)return r.ids;this.bucketIdCache.size>2e3&&this.bucketIdCache.clear();let n=new Set(new Float64Array(t));return this.bucketIdCache.set(e,{ids:n,vbo:o}),n}replacedIds(){return this.hiddenBuildings.size?this.hiddenBuildings:null}hiddenFor(e,t,o){return t?(o?this.hiddenWithSeams.get(o):void 0)??this.hiddenBuildings:e===this.hiddenVenueLayer?this.hiddenVenues:null}cutHidden(e,t,o,r,n,a,l=this.buildingLocs){if(!a||!a.size)return null;let s=r+"|"+o,c=this.hiddenCut.get(s);if(c!==void 0&&(c===null||c.vbo===n))return c;c&&(c.vao.destroy(),c.ibo.destroy());let f=t.data?.buckets?.[o];if(!f||!("featureIds"in f)||!f.featureIds)return null;let u=this.bucketIds(s,f.featureIds,n),[d,h]=a.size<u.size?[a,u]:[u,a],m=false;for(let v of d)if(h.has(v)){m=true;break}if(!m)return this.hiddenCut.set(s,null),null;let y=new Uint32Array(f.indices),p=new Float64Array(f.featureIds),b=[];for(let v=0;v*3<y.length;v++)a.has(p[v])||b.push(y[v*3],y[v*3+1],y[v*3+2]);let g=null;if(b.length<y.length){let v=new ue(e,new Uint32Array(b));g={vao:new fe(e,[{buffer:n,locations:l}],v),ibo:v,count:b.length,vbo:n};}return this.hiddenCut.set(s,g),g}init(e){this.symbols?.init(e),this.fill=new be(e,"fill",Ra,Fa),this.surface=new be(e,"surface",Va,Da),this.line=new be(e,"line",za,Pa),this.objectLine=new be(e,"objectLine",Ha,Oa),this.building=new be(e,"buildings",Ba,Wa),this.depth=new be(e,"depth",xa,Fr),this.groundShadow=new be(e,"groundShadow",Ia,La),this.sky=new be(e,"sky",Ta,ka),this.raster=new be(e,"raster",Ea,Aa),this.globeBody=new be(e,"globeBody",ya,ga),this.globeClip=new be(e,"globeClip",va,wa),this.globeMesh=Lf(e,this.globeBody),this.model=new be(e,"model",Ca,Pr),this.modelInstanced=new be(e,"model-instanced",Sa,Pr),this.modelDepth=new be(e,"modelDepth",Ma,Fr);for(let n of $e.layout.attribs)this.modelLocs.set(n.name,this.model.attribLocation(n.name));for(let n of [...$e.layout.attribs,...$e.instanceLayout.attribs])this.modelInstLocs.set(n.name,this.modelInstanced.attribLocation(n.name));this.shadowPlaceholder=pa(e);let t=new z([["a_pos",this.groundShadow.attribLocation("a_pos")]]),o=new pe(e,new Float32Array([0,0,1,0,1,1,0,1]),Ef),r=new ue(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 tn.attribs)this.fillLocs.set(n.name,this.fill.attribLocation(n.name));for(let n of al.attribs)this.surfaceLocs.set(n.name,this.surface.attribLocation(n.name));for(let n of il.attribs)this.lineLocs.set(n.name,this.line.attribLocation(n.name));for(let n of Yr.attribs)this.objectLineLocs.set(n.name,this.objectLine.attribLocation(n.name));for(let n of wt.attribs)this.buildingLocs.set(n.name,this.building.attribLocation(n.name));}render(e,t,o,r,n,a=new z){if(!this.fill||!this.line||!this.building)return false;let l=t.zoom,s=false;this.materialTime=n/1e3,this.materialAnimating=false,this.fog=bt(t,r),this.patternScale=uo/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??$);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"&&D(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"&&D(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,D(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(Jr,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 Ht(e,this.shadows.resolution);let l=r.light;if(t.updateShadow(xt(l.keyAzimuth,l.keyAltitude),Tf),!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??$);if(!d)continue;let h=r.bucketKeyFor(u);if(h===null)continue;let m=D(u.paint.heightScale,t.zoom,1);(u.source??$)===$&&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,wt,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??$)===$,v=this.cutHidden(e,p,h,y.dataKey,b.buffer,this.hiddenFor(h,g,y.dataKey)),w=g?v??this.indoorMask.indicesFor(e,p,h,y,b.buffer,this.buildingLocs):v;w?(w.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,w.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(Jr),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(he(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(Ie(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),Rf(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=xt(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=xt(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??bt(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,D(n.paint.elevation,t.zoom,0)*this.reliefScale));let r=Math.max(Sf/Math.max(t.pixelsPerMeter,1e-9),Mf);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,en);}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($);if(!r||!this.fill||!this.quad)return;let n=r.visibleTiles;if(!n.length||n.length>en)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,en),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($);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($);if(!n)return;let a=this.groundShadow;a.use(),this.applyShadowUniforms(a),this.applyFogUniforms(a,t,r);let l=r.light,[,,s]=xt(l.keyAzimuth,l.keyAltitude),c=Math.max(-s,0),f=de(l.ambientColor),u=de(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",Jr),!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=de(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);}}}tileTint(e){let o=((e.x%3+3)%3*2+(e.y%2+2)%2)/6,r=n=>{let a=(n+o*6)%6;return 1-Math.max(0,Math.min(1,Math.min(a,4-a)))};return [r(5),r(3),r(1)]}applyTileScale(e,t,o){if(this.debugTiles){let[s,c,f]=this.tileTint(t);e.setVec4("u_tile_tint",s,c,f,kf);}else e.setVec4("u_tile_tint",0,0,0,0);let r=mo(t.z)/this.patternScale;e.setFloat("u_meters_per_unit",r/o);let[n,a]=Bn(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:Af[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,If[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,r),this.applyLight(l,r),this.applyMaterial(l,n,a),l.setVec4v("u_color",Ce([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,tn,this.fillLocs,"fill");if(!h)continue;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);let m=this.cutHidden(e,d,f,u.dataKey,h.buffer,this.replacedIds(),this.fillLocs);m?(m.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,m.count,e.gl.UNSIGNED_INT,0)):(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=D(n.paint.opacity,a,1)*(l||1),d=D(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",Ce([f[0],f[1],f[2],f[3]*u])),c.setFloat("u_center_w",t.cameraToCenterDistance);let b=D(n.paint.offset,a,0)*y,g=Math.max(D(n.paint.blur,a,0),0)*y;c.setFloat("u_elevation",D(n.paint.elevation,a,0)*this.reliefScale),c.setFloat("u_relief",this.reliefScale),c.setVec2("u_viewport",h,m);let v=n.paint.dashArray,w=n.paint.arrow===true,x=n.paint.arrowStyle,_=w&&(x==="head"||x==="headOnly"),M=w&&x==="dash";if(c.setInt("u_pattern",M?5:v?1:x==="headOnly"&&w?4:_?3:w?2:0),v){let[S,T]=v;c.setVec2("u_dash",S*y,(S+T)*y);}if(w){let S=Ae(n.paint.arrowColor,a,[1,1,1,1]);c.setVec4v("u_arrow_color",Ce(S));let T=D(n.paint.arrowPeriod,a,46)*y,A=D(n.paint.arrowSize,a,5)*y;if(M){let k=D(n.paint.arrowGap,a,24)*y,L=Math.max(T-k,1),R=Math.min(A,L),I=D(n.paint.arrowShaft,a,2)*y,E=D(n.paint.arrowHead,a,4)*y,O=D(n.paint.arrowOutline,a,0)*y;c.setVec4("u_arrow",I,R,E,L),c.setVec2("u_dash",O,T);}else _?c.setVec4("u_arrow",T,A,p,0):c.setVec4("u_arrow",T,Math.max(A*.4,1),Math.min(A,p*.72),0);}let C=r.bucketKeyFor(n);if(C!==null)for(let S of o.visibleTiles){if(!this.drawsTile(t,r,n,S))continue;let T=o.getTile(S);if(!T)continue;let A=n.network?s!==void 0?[Oe(n.id,s)]:(T.data?.levels??[]).map(k=>Oe(n.id,k)):[C];for(let k of A){let L=this.bucketFor(e,T,k,il,this.lineLocs,"line");if(!L)continue;let R=S.bounds(),I=(R.maxX-R.minX)*t.worldSize/L.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",D(n.paint.widthExtra,a,0)*E),c.setFloat("u_offset",b*E),c.setFloat("u_tile_per_px",E),this.applyTileScale(c,S,L.extent),this.shadowActive&&c.setMat4("u_shadow_matrix",t.shadowTileMatrix(S,L.extent)),this.applyTileMatrix(c,t,S,L.extent);let O=this.cutHidden(e,T,k,S.dataKey,L.buffer,this.replacedIds(),this.lineLocs);O?(O.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,O.count,e.gl.UNSIGNED_INT,0)):(L.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,L.indexCount,L.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=de(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");let u=e.gl;e.setStencilTest(true),u.stencilFunc(u.NOTEQUAL,vt,vt),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(vt);let d=this.seams.stitched.has(l.featureId);d&&this.drawSeamHighlight(e,t,f,l.featureId);for(let h of d?[]:o.visibleTiles){let m=o.getTile(h);if(!m)continue;let y=m.data?.buckets?.[n.id];if(!y)continue;let p=h.dataKey,b=this.highlightGpu.get(p);if(b===void 0){let g=Fo(m,n.id,l.featureId);if(g){let v=new pe(e,new Uint8Array(g.vertices),wt),w=new ue(e,g.indices);b={vao:new fe(e,[{buffer:v,locations:this.buildingLocs}],w),vbo:v,ibo:w,count:g.indices.length};}else b=null;this.highlightGpu.set(p,b);}b&&(this.applyTileScale(f,h,y.extent),this.shadowActive&&f.setMat4("u_shadow_matrix",t.shadowTileMatrix(h,y.extent)),f.setMat4("u_matrix",t.tileMatrix(h,y.extent)),b.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,b.count,e.gl.UNSIGNED_INT,0));}e.setStencilTest(false),u.stencilOp(u.KEEP,u.KEEP,u.KEEP),u.stencilMask(255),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??$);if(!a)return;let l=new J;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=Fo(c,o.layerId,o.featureId);u&&this.highlightTris.set(s.dataKey,Br(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??$):void 0;if(!l||!s)return;let c=n.bucketKey,f=de(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",Ce([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,vt,vt),u.stencilOp(u.KEEP,u.KEEP,u.REPLACE),u.stencilMask(vt);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 pe(e,new Uint8Array(t.vertices),tn),h=new ue(e,new Uint32Array(f));u={vao:new fe(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=D(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",D(n.paint.sideShade,a,.12));let f=n.elevation<(n.base??0),u=n.paint.sideColor?Ae(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 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,al,this.surfaceLocs,"surface");v&&m.push({id:b,bucket:v,cut:g?this.cutSurface(e,g,d,b.dataKey,v.buffer,this.replacedIds()):null});}let y=(b,g,v)=>{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),(v??g).vao.bind();},p=m.filter(({bucket:b,cut:g})=>g?g.capCount>0:b.capIndexOffset<b.indexCount);if(p.length){e.setColorMask(false),e.setDepthMask(true);for(let{id:b,bucket:g,cut:v}of p){y(b,g,v);let w=v?e.gl.UNSIGNED_INT:g.indexType,x=w===e.gl.UNSIGNED_INT?4:2;e.gl.drawElements(e.gl.TRIANGLES,v?v.capCount:g.indexCount-g.capIndexOffset,w,(v?v.mainCount:g.capIndexOffset)*x);}e.setColorMask(true),e.setDepthMask(h);}for(let{id:b,bucket:g,cut:v}of m)y(b,g,v),e.gl.drawElements(e.gl.TRIANGLES,v?v.mainCount:g.capIndexOffset,v?e.gl.UNSIGNED_INT: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 d=(w,x)=>n.paint[w]?r.colorAt({...n,paint:{...n.paint,color:n.paint[w]}},a,x):x,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",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_window_variation",D(n.paint.windowVariation,a,1)),s.setFloat("u_seam_strength",D(n.paint.seamStrength,a,1)),s.setFloat("u_window_recess",D(n.paint.windowRecess,a,.18)),s.setFloat("u_window_recess_shade",D(n.paint.windowRecessShade,a,.16)),s.setFloat("u_plinth_height",D(n.paint.plinthHeight,a,4)),s.setFloat("u_plinth_shade",D(n.paint.plinthShade,a,.14)),s.setFloat("u_roof_variation",D(n.paint.roofVariation,a,.3)),this.applyLight(s,r);let y=u>=1;e.setDepthMask(y),e.setBlend(y?"none":"premultiplied");let p=D(n.paint.heightScale,a,1),b=false,g=r.bucketKeyFor(n);if(g===null)return b;let v=(n.source??$)===$;if(v&&this.indoorMask.prepare(o,g),v&&o.visibleTiles.length){let w=o.visibleTiles[0].z;this.seams.update(o,g,{zoom:w,metersPerTile:mo(w),cornerRadius:n.cornerRadius,cornerSegments:n.cornerSegments})&&this.syncSeamGpu();}for(let w of o.visibleTiles){if(!this.drawsTile(t,r,n,w))continue;let x=o.getTile(w),_=x&&this.bucketFor(e,x,g,wt,this.buildingLocs,"fill-extrusion");if(!_)continue;let M=this.growScale(_,l,!o.warm);M<1&&(b=true),s.setFloat("u_height_scale",M*p),this.applyTileScale(s,w,_.extent),this.shadowActive&&s.setMat4("u_shadow_matrix",t.shadowTileMatrix(w,_.extent)),s.setMat4("u_matrix",t.tileMatrix(w,_.extent));let S=this.cutHidden(e,x,g,w.dataKey,_.buffer,this.hiddenFor(g,v,w.dataKey))??(x&&v?this.indoorMask.indicesFor(e,x,g,w,_.buffer,this.buildingLocs):null);S?(S.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,S.count,e.gl.UNSIGNED_INT,0)):(_.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,_.indexCount,_.indexType,0));}return v&&this.drawSeams(e,t,s,p),b}drawSeamHighlight(e,t,o,r){for(let[n,{tile:a,mesh:l}]of this.seams.meshes){let s=`${n}\u241F${r}`,c=this.highlightGpu.get(s);if(c===void 0){let f=Ur(l,r);if(f){let u=new pe(e,new Uint8Array(f.vertices),wt),d=new ue(e,f.indices);c={vao:new fe(e,[{buffer:u,locations:this.buildingLocs}],d),vbo:u,ibo:d,count:f.indices.length};}else c=null;this.highlightGpu.set(s,c);}c&&(this.applyTileScale(o,a,l.extent),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,l.extent)),o.setMat4("u_matrix",t.tileMatrix(a,l.extent)),c.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,c.count,e.gl.UNSIGNED_INT,0));}}drawSeams(e,t,o,r){for(let[n,{tile:a,mesh:l}]of this.seams.meshes){let s=this.seamGpu.get(n);if(!s){let c=new pe(e,new Uint8Array(l.vertices),wt),f=new ue(e,new Uint32Array(l.indices)),u=new fe(e,[{buffer:c,locations:this.buildingLocs}],f);s=new Wo(u,c,f,l.indexCount,e.gl.UNSIGNED_INT,l.extent),this.seamGpu.set(n,s);}o.setFloat("u_height_scale",r),this.applyTileScale(o,a,l.extent),this.shadowActive&&o.setMat4("u_shadow_matrix",t.shadowTileMatrix(a,l.extent)),o.setMat4("u_matrix",t.tileMatrix(a,l.extent)),s.vao.bind(),e.gl.drawElements(e.gl.TRIANGLES,l.indexCount,e.gl.UNSIGNED_INT,0);}}syncSeamGpu(){for(let e of this.seams.changed){let t=this.seamGpu.get(e);t&&(t.destroy(),this.seamGpu.delete(e));for(let o of [...this.highlightGpu.keys()]){if(!o.startsWith(e+"\u241F"))continue;let r=this.highlightGpu.get(o);r&&(r.vao.destroy(),r.vbo.destroy(),r.ibo.destroy()),this.highlightGpu.delete(o);}}}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?Ff(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]=xt(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]=xt(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 Cf(`\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 pe(e,new Uint8Array(s.vertices),r),f=new ue(e,new Uint32Array(s.indices)),u=new fe(e,[{buffer:c,locations:n}],f),d=new Wo(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;}},Vo=new z;function Lf(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:Xt,offset:0}]},c=new z([["a_lnglat",e.attribLocation("a_lnglat")]]),f=new pe(i,r,s),u=new ue(i,a);return {vao:new fe(i,[{buffer:f,locations:c}],u),vbo:f,ibo:u,count:a.length}}function Rf(i,e){if(e.highColor){Fe(i,"u_high_color",e.highColor);return}let t=Vo.get(e.skyColor);t||(t=de(e.skyColor),Vo.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=Vo.get(t);o||(o=de(t),Vo.set(t,o)),i.setVec3(e,o[0],o[1],o[2]);}function xt(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 Ff(i){let o=i-1;return 1+2.20158*o*o*o+1.20158*o*o}var Do=1,Yt=class{constructor(e=1024){this.entries=new z;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+Do>this.size&&(this.shelfY+=this.shelfHeight+Do,this.shelfX=0,this.shelfHeight=0),this.shelfY+r+Do>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+Do,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 on=.75,qt=8,ve=3,Ge=24,_t=256,sl=255,$t=class{constructor(e,t="Noto Sans Regular"){this.urlTemplate=e;this.fontstack=t;this.glyphs=new z;this.loaded=new J;this.inflight=new z;}get(e){return this.glyphs.get(e)}hasRange(e){return this.loaded.has(Math.floor(e/_t))}needsLoad(e){for(let t of e){let o=t.codePointAt(0);if(o===void 0)continue;let r=Math.floor(o/_t);if(r<=sl&&!this.loaded.has(r))return true}return false}async ensure(e){let t=new J;for(let o of e){let r=o.codePointAt(0);if(r===void 0)continue;let n=Math.floor(r/_t);n>sl||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*_t}-${e*_t+_t-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 cl(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 cl(i){let e=new es__default.default(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 Pf=.25,Ct=1e20;function rn(i,e,t){let o=e+ve*2,r=t+ve*2,n=o*r,a=new Float64Array(n),l=new Float64Array(n);a.fill(Ct),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+ve)*o+(f+ve);if(u>=1)a[d]=0,l[d]=Ct;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]=Ct,l[d]=0;}fl(a,o,r),fl(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]=Hf(Math.round(255-255*(f/qt+Pf)));}return {data:s,width:o,height:r}}function fl(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];ul(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];ul(r,n,a,l,e);for(let c=0;c<e;c++)i[s*e+c]=n[c];}}function ul(i,e,t,o,r){t[0]=0,o[0]=-Ct,o[1]=Ct;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]=Ct;}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 Hf=i=>i<0?0:i>255?255:i;var dl=48,Zt=class{constructor(e={}){this.defs=e;this.sdfs=new z;this.pending=new J;this.failed=new J;}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(dl*(n>1?n:1))),l=Math.max(8,Math.round(dl/(n<1?n:1))),s=await Of(o,a,l);return this.sdfs.set(e,rn(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 Of(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 nt={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>'},Bf={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(Bf)){let t=nt[e];t?nt[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 Wf=1.2;function nn(i,e,t=16,o=0){let r=Vf(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=Ge*Wf,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 Vf(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 an(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=Df(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 Df(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 Nf=[0,.25,-0.25,.5,-0.5,.75,-0.75,1,-1];function sn(i,e,t,o={}){if(i.length<2||!e.length||t<=0)return [];let r=Xf(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 Gf(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,w=ln(i,r,e,t,v,c,a,f);w&&u.push({glyphs:w,path:w.map(x=>({x:x.x,y:x.y})),at:v});}if(u.length)return u}let m=(n-t)/2;for(let y of Nf){let p=m+m*y,b=ln(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 Gf(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=ln(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 ln(i,e,t,o,r,n,a,l){if(r<0||r+o>e[e.length-1]||!Uf(i,e,r,r+o,n,a))return null;let s=Qt(i,e,r),c=Qt(i,e,r+o);if(!s||!c)return null;if(c.x>=s.x)return hl(i,e,t,r,l);let f=e[e.length-1];return hl([...i].reverse(),Kf(e),t,f-(r+o),l)}function Uf(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 hl(i,e,t,o,r){let n=[];for(let c of t){let f=ml(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(jf(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=ml(i,e,l,t[c].width);if(!f)return null;a.push(f);}return a}function ml(i,e,t,o){let r=Qt(i,e,t+o/2);if(!r)return null;let n=Qt(i,e,t),a=Qt(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 jf(i,e){let t=i-e;for(;t>180;)t-=360;for(;t<=-180;)t+=360;return t}function Xf(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 Kf(i){let e=i[i.length-1];return i.map(t=>e-t).reverse()}function Qt(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 fn=20,pl={stride:fn,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}]},Yf=220,qe=64,bl=2,$f=1.22,qf=128,Zf=.7;function Qf(i,e,t){let o=i.layout?.letterSpacing;if(o!==void 0)return D(o,e,0)*Ge;let r=D(i.paint?.haloWidth,e,0);return r<=0||t<=0?0:r*Zf/(t/Ge)}var Jf=256,eu=200,cn="frame-circle",St=class i{constructor(e,t){this.shader=null;this.locations=new z;this.atlas=new Yt(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 z;this.fading=false;this.styleOrder=new z;this.glyphs=new $t(e,t),this.icons=new Zt(nt);}init(e){this.shader=new be(e,"symbol",Na,Ga);for(let t of pl.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)/Yf;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}))?eu: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 z,f=new z,u=new z;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=bt(e,o).far,[c,f,u]=e.cameraPositionPx;for(let d of r){let h=(d.layout?.priority??0)*Jf,m=t.get(d.source??$);if(!m)continue;let y=d.layout?.showFor==="highlight",p=d.layout?.placement==="map",{shift:b,drop:g}=p?wl(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,w=o.bucketKeyFor(d);if(w!==null)for(let x of m.visibleTiles){if(!o.layerVisibleAt(d,e.detailZoom(e.distanceToTile(x))))continue;let M=m.getTile(x)?.data?.buckets?.[w];if(!M||!Lo(M))continue;let C=new Int16Array(M.anchors),S=new Uint8Array(M.priorities),T=M.rotations?new Int16Array(M.rotations):null,A=M.lines?new Int16Array(M.lines):null,k=M.lineStarts?new Uint32Array(M.lineStarts):null,L=x.bounds(),R=e.worldSize,I=(L.maxX-L.minX)*R/M.extent,E=L.minX*R,O=L.minY*R;for(let W=0;W<S.length;W++){let F=E+C[W*2]*I,P=O+C[W*2+1]*I;if(s!==1/0&&Math.hypot(F-c,P-f,u)>s||y&&!Ne(this.highlightFootprint,F/R,P/R,v))continue;let N=F,B=P;if(p&&T){let X=T[W]*Math.PI/180,q=b;N-=Math.sin(X)*q,B+=Math.cos(X)*q;}let H=e.worldPxToPoint(N,B),V=A&&k?tu(e,A,k,W,E,O,I):void 0;if(d.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:d,screenX:H?H.x:V[0].x,screenY:(H?H.y:V[0].y)+g,text:M.texts[W]??"",icon:M.icons[W]??"",priority:S[W]+h,rotate:xl(d,T,W,e.bearing),mercX:F/R,mercY:P/R,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,d]=r.offset??[0,0],h=r.placement==="map",m=null;if(e.icon&&!h){this.icons.isDefined(e.icon)||(e.icon="dot");let ee=`icon:${e.icon}`,K=this.atlas.get(ee);if(!K){let Y=this.icons.get(e.icon);Y?K=this.atlas.add(ee,Y.data,Y.width,Y.height)??void 0:this.pendingIcons.add(e.icon);}K&&(m=K);}let y=null;if(m&&r.iconFrame==="circle"){let ee=`icon:${cn}`,K=this.atlas.get(ee);if(!K){let Y=this.icons.get(cn);Y?K=this.atlas.add(ee,Y.data,Y.width,Y.height)??void 0:this.pendingIcons.add(cn);}K&&(y=K);}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=nn(e.text,this.glyphs,r.textPlacement==="line"?Number.MAX_SAFE_INTEGER:r.maxLineChars??15,Qf(e.layer,t,s)),!b&&!m)||!b&&!m)return null;let g=s/Ge,v=b?b.width*g:0,w=b?b.height*g:0;if(e.layer.layout?.textPlacement==="line")return b&&e.line?this.placeOnLine(e,b,g,w,o,t,a):null;let x=r.iconPlacement??"top",_=x==="behind"&&!!m&&!!b,M=x==="top"&&!!m&&!!b,C=m?m.width/Math.max(m.height,1):1,S=_?w+f*2:c,T=m?S*C:0,A=Math.max(T,m?c*p:0),k=Math.max(S,m?c*p:0),L=_?Math.max(T,v+f*2):M?Math.max(A,v):A+(m&&b?f:0)+v,R=_?Math.max(S,w):M?k+f+w:Math.max(m?k:0,w),I=e.screenX+u,E=e.screenY+d,O=bl+(r.collisionPadding??0),W={x1:I-L/2-O,y1:E-R/2-O,x2:I+L/2+O,y2:E+R/2+O},F=this.padding;if(W.x1<F.left||W.y1<F.top||W.x2>this.viewport.width-F.right||W.y2>this.viewport.height-F.bottom)return null;if(!r.allowOverlap){if(yl(o,W))return null;gl(o,W);}let P=[],N=[],B=[],H=[],V=[],j=[],X=0,q=I-L/2,Q=M?(k+f)/2:0,Z=1/0,U=1/0,ne=-1/0,ie=-1/0;if(b){let ee=M||_?I:q+(m?A+f:0)+v/2;for(let K of b.glyphs){let Y=K.glyph,oe=`g:${Y.id}`,re=this.atlas.get(oe);if(!re&&(!Y.bitmap||(re=this.atlas.add(oe,Y.bitmap,Y.width+ve*2,Y.height+ve*2)??void 0,!re)))continue;let ce=ee+(K.x+Y.left-ve)*g,ae=E+Q+(K.y-Y.top-ve)*g,me=re.width*g,we=re.height*g;No(P,N,ce,ae,me,we,re,0,a),X++;let ge=ve*g;Z=Math.min(Z,ce+ge),U=Math.min(U,ae+ge),ne=Math.max(ne,ce+me-ge),ie=Math.max(ie,ae+we-ge);}if(M&&m&&U<1/0){let K=E-R/2+k+f-U;if(K!==0){for(let Y=1;Y<P.length;Y+=4)P[Y]+=K;U+=K,ie+=K;}}}if(m){let ee=l?$f:1,K=T*ee,Y=S*ee,oe=(M?I-T/2:q+(A-T)/2)-(K-T)/2,re=(M?E-R/2+(k-S)/2:E-S/2)-(Y-S)/2;if(y){let ae=c*p*ee,me=oe+K/2-ae/2,we=re+Y/2-ae/2,ge=ve/Math.max(y.height-ve*2,1)*ae;No(V,j,me-ge,we-ge,ae+ge*2,ae+ge*2,y,0,a),X++;}if(_&&ne>Z){let ae=f*1.6,me=f;K=(ne-Z+ae*2)*ee,Y=(ie-U+me*2)*ee,oe=Z-ae,re=U-me;}let ce=ve/Math.max(m.height-ve*2,1)*Y;No(B,H,oe-ce,re-ce,K+ce*2,Y+ce*2,m,e.rotate,a),X++;}return X?{verts:P,texs:N,iconVerts:B,iconTexs:H,frameVerts:V,frameTexs:j,quads:X,box:W}: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+bl,b=this.padding,g=T=>{let A=T.path.map(k=>({x1:k.x-p,y1:k.y-p,x2:k.x+p,y2:k.y+p}));for(let k of A)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&&yl(n,k))return false;if(!u.allowOverlap)for(let k of A)gl(n,k);return m.push(...A),true},v=-1/0,w=1/0;for(let T of t.glyphs)T.glyph.height<=0||(v=Math.max(v,T.glyph.top),w=Math.min(w,T.glyph.top-T.glyph.height));let x=Number.isFinite(v)?(v+w)/2*o:0,M=an(s,this.viewport.width,this.viewport.height,qf).flatMap(T=>sn(T,c,f,{spacing:u.symbolSpacing,fontSize:Ge*o,stableScale:Math.pow(2,Math.round(a)-a),accept:g}));if(!M.length)return null;for(let T of M)for(let A=0;A<t.glyphs.length;A++){let k=t.glyphs[A].glyph,L=T.glyphs[A],R=`g:${k.id}`,I=this.atlas.get(R);if(!I&&(!k.bitmap||(I=this.atlas.add(R,k.bitmap,k.width+ve*2,k.height+ve*2)??void 0,!I)))continue;let E=I.width*o,O=I.height*o,W=(k.height/2-k.top)*o+x,F=L.angle*Math.PI/180;No(d,h,L.x-E/2-Math.sin(F)*W,L.y-O/2+Math.cos(F)*W,E,O,I,L.angle,l),y++;}if(!y)return null;let C=m.map(T=>(T.x1+T.x2)/2),S=m.map(T=>(T.y1+T.y2)/2);return {verts:d,texs:h,iconVerts:[],iconTexs:[],frameVerts:[],frameTexs:[],quads:y,box:{x1:Math.min(...C)-p,y1:Math.min(...S)-p,x2:Math.max(...C)+p,y2:Math.max(...S)+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*fn),u=new Float32Array(f),d=new Uint16Array(f),h=[],m=0,y=(p,b,g,v)=>{let w=p.length/16;if(w){h.push({layer:g,role:v,first:m/4*6,count:w*6});for(let x=0;x<w*4;x++){let _=m*5;u[_]=p[x*4],u[_+1]=p[x*4+1],d[_*2+4]=b[x*2],d[_*2+5]=b[x*2+1],u[_+3]=p[x*4+2],u[_+4]=p[x*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",on),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=D(b.opacity,n,1),v=p.role==="icon",w=p.role==="frame",x=(A,k,L)=>w?k??A??L:v?A??L:L,_=Ae(w?b.frameColor??b.haloColor??b.color:x(b.iconColor,void 0,b.color),n,[.15,.15,.15,1]),M=w?b.frameHaloColor:x(b.iconHaloColor,void 0,b.haloColor),C=Ae(M??(w?b.iconColor??b.color:b.haloColor),n,[1,1,1,1]);w&&b.frameHaloColor===void 0&&(C[3]*=.35),w&&(_[3]*=D(b.frameOpacity,n,1));let S=D(w?b.frameHaloWidth??1.1:x(b.iconHaloWidth,void 0,b.haloWidth),n,1.2),T=D(p.layer.layout?.textSize,n,13);a.setVec4v("u_color",Ce([_[0],_[1],_[2],_[3]*g])),a.setVec4v("u_halo_color",Ce([C[0],C[1],C[2],C[3]*g])),a.setFloat("u_halo",S/(qt*(T/Ge))),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 pe(e,new Uint8Array(this.capacityQuads*4*fn),pl,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 ue(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 No(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 tu(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 vl=(i,e)=>i*4096+e;function yl(i,e){let t=Math.floor(e.x1/qe),o=Math.floor(e.y1/qe),r=Math.floor(e.x2/qe),n=Math.floor(e.y2/qe);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=i.get(vl(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 gl(i,e){let t=Math.floor(e.x1/qe),o=Math.floor(e.y1/qe),r=Math.floor(e.x2/qe),n=Math.floor(e.y2/qe);for(let a=t;a<=r;a++)for(let l=o;l<=n;l++){let s=vl(a,l),c=i.get(s);c||i.set(s,c=[]),c.push(e);}}function wl(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 xl(i,e,t,o){return !i.layout?.iconRotate||!e?0:e[t]-o}var Mt=class{constructor(e,t){this.capacity=e;this.onEvict=t;this.map=new z;}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 Tt=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 ou(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 Tt(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(Te(p),Se(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 Jt(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 ou(i,e,l);let{min:s,max:c}=i.visibleWrapRange(),f=[],u=[];for(let h=s;h<=c;h++)u.push(new Tt(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 dn=class{constructor(e){this.id=e;this.state="loading";this.data=null;this.error=null;this.requestId=0;this.buckets=new z;}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;}},un=6,ru=24,Go=class extends Ue{constructor(t,o){super();this.pool=t;this.visible=[];this.warmed=false;this.version=0;this.opts={cacheSize:160,detailBias:1,maxTiles:512,rank:1,...o},this.cache=new Mt(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}loadedTiles(){return this.cache.entries()}get pendingCount(){let t=0;for(let o of this.cache.values())o.state==="loading"&&t++;return t}update(t){let o=Jt(t,this.opts),r=new J;for(let c of o)r.add(c.dataKey);for(let[c,f]of this.cache.entries())f.state==="loading"&&!r.has(c)&&(this.pool.abort(f.requestId),this.cache.delete(c));let n=Math.max(this.opts.cacheSize,r.size*2);this.cache.setCapacity(n);let a=this.opts.rank*1e9;for(let c of o)this.cache.get(c.dataKey)||this.loadTile(c,a+t.distanceToTile(c));let l=this.coverFor(o),s=this.readyFor(o);(this.anyReady(l)||this.visible.length===0||!this.covers(o))&&(this.visible=l,s&&o.length&&(this.warmed=true));}coverFor(t){let o=c=>{let f=this.cache.peek(c.dataKey);return !!f&&f.state!=="loading"},r=(c,f)=>{let u=f.parent();for(let d=0;u&&d<=un;d++){if(u.dataKey===c.dataKey)return true;u=u.parent();}return false},n=new z,a=[];for(let c of t)o(c)?n.set(c.dataKey,c):a.push(c);let l=this.descendantsOf(a);for(let c of a){let f=l.get(c.dataKey);if(f&&f.length){for(let m of f)n.set(m.dataKey,m),this.cache.get(m.dataKey);continue}let u=c.parent(),d=null;for(let m=1;u&&m<=un;m++,u=u.parent()){if(!o(u))continue;let y=u;if(m>1&&t.some(p=>p!==c&&o(p)&&r(y,p)))break;d=y;break}let h=d??c;n.set(h.dataKey,h);}let s=[];for(let[,c]of n){let f=c.parent(),u=false;for(let d=0;f&&d<=un;d++){if(n.has(f.dataKey)){u=true;break}f=f.parent();}u||(s.push(c),this.cache.get(c.dataKey));}return s}descendantsOf(t){let o=new z;for(let n of t)o.set(n.dataKey,n);let r=new z;if(!o.size)return r;for(let[n,a]of this.cache.entries()){if(a.state==="loading")continue;let l=a.id.parent();for(let s=0;l&&s<ru;s++){let c=o.get(l.dataKey);if(c){let f=r.get(c.dataKey);f?f.push(a.id):r.set(c.dataKey,[a.id]);break}l=l.parent();}}return r}anyReady(t){for(let o of t){let r=this.cache.peek(o.dataKey);if(r&&r.state!=="loading")return true}return t.length===0}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 J;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}deactivate(){for(let[t,o]of this.cache.entries())o.state==="loading"&&(this.pool.abort(o.requestId),this.cache.delete(t));this.visible=[];}loadTile(t,o=0){let r=new dn(t);this.cache.set(t.dataKey,r);let n=nu(this.opts.url.replace("{z}",String(t.z)).replace("{x}",String(t.x)).replace("{y}",String(t.y)));r.requestId=this.pool.load({url:n,zoom:t.z,metersPerTile:On(t.z,t.y),sourceMaxZoom:this.opts.maxzoom,plan:this.opts.plan},a=>{if(this.cache.peek(t.dataKey)===r){if(a.type==="error"){if(a.aborted)return;r.state="error",r.error=a.message,this.emit("error",{tile:t,message:a.message});}else r.data=a,r.state=Object.keys(a.buckets).length?"loaded":"empty",this.version++,a.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 ${a.diag.failed.join("; ")}`),this.emit("data",{tile:r});this.pendingCount===0&&this.emit("idle",void 0);}},o);}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 nu(i){if(typeof location>"u")return i;try{return new URL(i,location.href).href}catch{return i}}var Uo=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;}},eo=class extends Ue{constructor(t){super();this.visible=[];this.aborts=new Map;this.opts={cacheSize:128,detailBias:1,maxTiles:256,...t},this.cache=new Mt(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=Jt(t,this.opts);let o=new J;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 Uo(t);this.cache.set(t.dataKey,o);let r=new AbortController;this.aborts.set(t.dataKey,r),this.fetchImage(_l(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 _l(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 iu="osmgl-assets",kt="assets";var jo=null;function Sl(){return jo||(jo=new Promise(i=>{if(typeof indexedDB>"u")return i(null);try{let e=indexedDB.open(iu,1);e.onupgradeneeded=()=>{let t=e.result;t.objectStoreNames.contains(kt)||t.createObjectStore(kt,{keyPath:"key"});},e.onsuccess=()=>i(e.result),e.onerror=()=>i(null);}catch{i(null);}}),jo)}function au(i){return Sl().then(e=>new Promise(t=>{if(!e)return t(null);try{let o=e.transaction(kt,"readonly").objectStore(kt).get(i);o.onsuccess=()=>t(o.result??null),o.onerror=()=>t(null);}catch{t(null);}}))}function lu(i){Sl().then(e=>{if(e)try{e.transaction(kt,"readwrite").objectStore(kt).put(i);}catch{}});}var Cl=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 su(i,e,t){let o=await crypto.subtle.importKey("raw",Cl(e),"AES-GCM",false,["decrypt"]);return crypto.subtle.decrypt({name:"AES-GCM",iv:Cl(t),tagLength:128},o,i)}var to=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 au(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(),lu({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 su(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 cu=1,oo=class{constructor(e){this.mesh=null;this.bitmaps=[];this.error=null;this.loading=null;this.matrix=G();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-${cu++}`,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 $r(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=te(this.coordinates);return {x:le(e.lng),y:se(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=mn(n(-this.rotation));this.rotationTiltX&&(a=Ze(hn(n(this.rotationTiltX)),a)),this.rotationTiltZ&&(a=Ze(pn(n(this.rotationTiltZ)),a));let l=Ze(r,a),s=this.matrix;return We(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=te(this.coordinates),r=G();for(let a=0;a<16;a++)r[a]=e[a];let n=G();return _e(n,r,this.localMatrix(o.lat)),Ve(t??this.matrix32,n)}cameraInModelSpace(e){let t=this.effectiveScale();if(!(t>0))return [0,0,0];let o=this.origin(),r=te(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=mn(m(-this.rotation));return this.rotationTiltX&&(y=Ze(hn(m(this.rotationTiltX)),y)),this.rotationTiltZ&&(y=Ze(pn(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=te(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,w=(o.max[2]-o.min[2])/2*p;return Math.abs(m-b)<=v&&Math.abs(y-g)<=w}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=G();for(let u=0;u<16;u++)a[u]=e[u];let l=te(this.coordinates),s=G();_e(s,a,this.localMatrix(l.lat));let c=G();qr(n,t,n.duration>0?o%n.duration:0,c);let f=G();return _e(f,s,c),Ve(r,f)}normalMatrix(){let e=n=>n*Math.PI/180,t=mn(e(-this.rotation));this.rotationTiltX&&(t=Ze(hn(e(this.rotationTiltX)),t)),this.rotationTiltZ&&(t=Ze(pn(e(this.rotationTiltZ)),t));let o=Ze([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 Ze(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 hn=i=>{let e=Math.cos(i),t=Math.sin(i);return [1,0,0,0,e,t,0,-t,e]},mn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,0,-t,0,1,0,t,0,e]},pn=i=>{let e=Math.cos(i),t=Math.sin(i);return [e,t,0,-t,e,0,0,0,1]};var Ko=class{constructor(){this.hit=new z;this.miss=new J;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(!bu(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="";}},fu=14,uu=2e3,du=4e3,Ml=160,hu=50,mu=4e3,bn=6,Yo=class{constructor(e){this.wantKey="";this.modelKey="";this.entries=new z;this.loading=0;this.pending=[];this.known=new z;this.underBuilding=new Ko;this.underVenue=new Ko;this.tilesStamp="";this.rulesInScan=0;this.found=[];this.foundStamp="";this.sortedAt=null;this.budgetScale=1;this.addModel=null;this.lod=0;this.budget=Ml;this.replacedBuildings=new J;this.replacedReal=new J;this.replacedVenues=new J;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 to(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??fu,f=s.loadRadius??uu,u=Math.max(s.keepRadius??du,f),d=Math.min(1,Math.max(.25,(o.zoom-c)/3)),h=Math.max(8,Math.round((s.budget??Ml)*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.replacedReal.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 J;v=0;for(let O of t.visibleTiles){let W=t.getTile(O)?.data?.buckets?.[e.id];if(!W||!Ua(W))continue;let F=new Int16Array(W.anchors),P=O.bounds(),N=P.maxX-P.minX,B=P.maxY-P.minY;for(let H=0;H<W.props.length;H++){let V=W.props[H],j=it(V.file,NaN);if(!Number.isFinite(j))continue;let X=String(V.kind??"model"),q=X==="rule"?`t-${V.rid}-${V.oid}`:`m-${V.mid}`;if(E.has(q))continue;E.add(q),X==="rule"&&v++;let Q=P.minX+F[H*2]/W.extent*N,Z=P.minY+F[H*2+1]/W.extent*B,U=pu(Q,Z);this.known.set(q,{id:q,fileId:j,lng:U.lng,lat:U.lat,mercX:Q,mercY:Z,altitude:it(V.alt,0),scale:it(V.scale,1),rotation:it(V.rx,0),tiltX:it(V.rz,0),tiltZ:it(V.ry,0),kind:X==="rule"?"rule":"model",target:Tl(X==="rule"?V.oid:V.replaces),replaces:m?X==="rule"?Xo(V.oid):String(V.anchor??"replace")==="replace"?Xo(V.replaces_all).length?Xo(V.replaces_all):Xo(V.replaces):[]:[]});}}this.rulesInScan=v;}g!==this.foundStamp&&(this.foundStamp=g,this.found=[...this.known.values()],this.sortedAt=null);let w=this.found,x=new J;for(let E of w)E.kind==="model"&&E.target!==null&&x.add(E.target);let _=111320,M=Math.cos(p.lat*Math.PI/180),C=E=>Math.hypot((E.lng-p.lng)*_*M,(E.lat-p.lat)*_);this.replacedBuildings.clear(),this.replacedReal.clear(),this.replacedVenues.clear();let S=new J,T=[],A=0,k=0;(this.sortedAt===null||Math.hypot((p.lng-this.sortedAt.lng)*_*M,(p.lat-this.sortedAt.lat)*_)>hu)&&(w.sort((E,O)=>C(E)-C(O)),this.sortedAt={lng:p.lng,lat:p.lat});let R=0;for(let E of w){let O=C(E);if(O>u){A++;continue}if(E.kind==="rule"&&E.target!==null&&x.has(E.target)){let N=this.entries.get(E.id);N&&N.model.retire();continue}let W=this.entries.get(E.id);if(R>=h){k++,W&&W.model.retire();continue}R++,S.add(E.id);let F=()=>{if(!E.replaces.length)return;for(let H of E.replaces){this.replacedBuildings.add(H),this.replacedReal.add(H);for(let V=0;V<10;V++)this.replacedBuildings.add(H*10+V);}let N=this.underBuilding.find(E,a);N!==null&&this.replacedBuildings.add(N);let B=this.underVenue.find(E,l);B!==null&&this.replacedVenues.add(B);},P=W;if(P){F(),P.distance=O,P.leftAt=0,P.model.revive(),b<P.lod&&!P.upgrading&&this.loading<bn&&this.upgrade(P,b,r,n);continue}if(O>f){A++;continue}if(this.loading>=bn){T.push(E),F();continue}F(),this.spawn(E,O,b,r);}for(let E of [...this.entries.values()])if(!S.has(E.placement.id)){if(E.leftAt===0){E.leftAt=y;continue}y-E.leftAt>mu&&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,O]of [...this.known.entries()])C(O)>u*3&&this.known.delete(E);let I=this.stats;I.found=w.length,I.kept=S.size,I.live=this.entries.size,I.tooFar=A,I.overBudget=k,I.queued=T.length,I.rules=v,I.loadingNow=this.loading,I.pendingNow=T.length,I.replaced=this.replacedReal.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<bn&&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 oo({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.replacedReal.clear(),this.replacedVenues.clear(),this.underBuilding.clear(),this.underVenue.clear();for(let t of Object.keys(this.stats))this.stats[t]=0;}},it=(i,e)=>{let t=typeof i=="number"?i:Number(i);return Number.isFinite(t)?t:e},Xo=i=>{if(i==null)return [];let e=[];for(let t of String(i).split(",")){let o=Number(t);Number.isFinite(o)&&o!==0&&e.push(o);}return e},Tl=i=>{let e=it(i,NaN);return Number.isFinite(e)?e:null};function pu(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 bu(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 yu=200,gu={center:"translate(-50%, -50%)",top:"translate(-50%, 0)",bottom:"translate(-50%, -100%)",left:"translate(0, -50%)",right:"translate(-100%, -50%)"},ro=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=gu[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??vu),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=te(this._coordinates),o=e.worldSize,r=e.worldPxToPoint(le(t.lng)*o,se(t.lat)*o,this.altitude);if(!r){this.culled=true,this.applyVisibility();return}let n=yu;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";}},vu='<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 no=class extends ro{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 wu=[["\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."]],kl=new Map(wu);function yn(i){let e=i.split(" ");if(e.length<2)return i;let t=false,o=e.map(n=>{let a=kl.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=>kl.get(n.toLowerCase())===void 0).length?i:o.join(" ")}function vn(i,e){let t=[],o=[],r=[],n=[],a=[],l=e.textPlacement==="line",s=[],c=[],f=[];for(let u of i.features()){if(!ye(e.filter,u.properties))continue;let d=u.loadGeometry(),h=Cu(u.type,d);if(!h)continue;let m=e.textField?gn(e.textField,u.properties):"",y=m&&e.abbreviate?yn(m):m,p=e.iconImage?gn(e.iconImage,u.properties):"";if(!(!y&&!p)){if(l){let b=_u(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(Su(u.properties)),a.push(e.iconRotate&&Math.round(Number(u.properties[e.iconRotate]??0))||0);}}if(l){for(let{text:u,line:d}of xu(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 xu(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 _u(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 Cu(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 Su(i){let e=i.rank;return typeof e=="number"&&isFinite(e)?Math.max(0,255-Math.min(e,255)):128}function gn(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 El(i,e){let t=[],o=[];for(let r=0;r<i.length;r++){let n=i.feature(r);if(n.type===1&&ye(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 Mu(){let i=typeof self<"u"?self.origin:void 0;return i&&i!=="null"&&!i.startsWith("blob:")?i+"/":void 0}async function Al(i,e){let t=performance.now(),o=Mu(),r=await fetch(i.url,{signal:e,credentials:"same-origin",...o?{referrer:o}:{}}),n=(g,v,w,x,_=0)=>({type:"loaded",id:i.id,buckets:{},timing:{fetchMs:x,parseMs:_},diag:{status:g,bytes:v,layers:w,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 Rt(a),f=Object.keys(c.layers),u={},d=[],h={},m=new Set,y=[],b=i.plan.some(g=>g.type==="surface"&&(g.elevation??0)>0)&&i.plan.some(g=>g.type==="line"&&g.ground)?Cr(i.metersPerTile):void 0;for(let g of i.plan){if(!ku(g,i.zoom,i.sourceMaxZoom))continue;let v=c.layers[g.sourceLayer];if(!v)continue;let w=Eu(i.zoom,v.extent);try{if(g.splitBy){let _=Au(v,g.splitBy,g.filter);if(!_.length)continue;let M=h[g.splitBy]??(h[g.splitBy]=[]);for(let C of _){M.includes(C)||M.push(C);let S={...g,splitBy:void 0,filter:Lu(g.filter,g.splitBy,C)},T=wn(S,v,w,i.metersPerTile,b,void 0,d);T&&(u[Oe(g.id,C)]=T);}continue}if(g.network&&g.type==="line"){for(let _ of Iu(v,g.filter)){let M=wn(g,v,w,i.metersPerTile,b,_,d);M&&(u[Oe(g.id,_)]=M,m.add(_));}continue}let x=wn(g,v,w,i.metersPerTile,b,void 0,d);x&&(u[g.id]=x);}catch(x){y.push(`${g.id}: ${x instanceof Error?x.message:String(x)}`);}}return {type:"loaded",id:i.id,buckets:u,...d.length?{seams:d}:{},...Object.keys(h).length?{splits:h}:{},...m.size?{levels:[...m].sort((g,v)=>g-v)}:{},timing:{fetchMs:l,parseMs:performance.now()-s},diag:{status:r.status,bytes:a.byteLength,layers:f,built:Object.keys(u).length,...y.length?{failed:y}:{}}}}function Tu(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 ku(i,e,t){let o=e-1,r=e<t?e+1:24;return !(i.maxzoom<o||i.minzoom>r)}function Eu(i,e){return i<=6?Math.max(64,e/24):0}function wn(i,e,t,o,r,n,a){{if(i.type==="fill"){let s=o>0?o/e.extent:0,c=i.cornerRadius&&s>0?{radius:i.cornerRadius/s,segments:i.cornerSegments,extent:e.extent,minCutRatio:0,maxChord:ni/s}:void 0,f=pr(e,i.filter,t,c,i.clipToTile===true,e.extent);return f?{kind:"fill",...f,extent:e.extent}:null}if(i.type==="surface"){let s=_r(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:c=>Sr(r,c,i.elevation??0,e.extent)}:{},...i.groundBy?{liftBy:Tu(i.groundBy)}:{}});return s?{kind:"surface",...s}:null}if(i.type==="line"){let s=Tr(e,i.filter,t,i.ground?r:void 0,o>0?o/e.extent:0,{level:n});return s?{kind:"line",...s,extent:e.extent}:null}if(i.type==="model"){let s=El(e,i.filter);return s?{kind:"placement",...s,extent:e.extent}:null}if(i.type==="symbol"){let s=vn(e,{filter:i.filter,textField:i.textField,iconImage:i.iconImage,iconRotate:i.iconRotate,textPlacement:i.textPlacement,abbreviate:i.abbreviate});return s?{kind:"symbol",...s,extent:e.extent}:null}let l=dr(e,e.extent,i.filter,{metersPerUnit:o>0?o/e.extent:0,cornerRadius:i.cornerRadius,cornerSegments:i.cornerSegments},a);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 Au(i,e,t){let o=[];for(let r of i.features()){if(!ye(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 Iu(i,e){let t=[];for(let o of i.features()){if(!ye(e,o.properties))continue;let r=rt(o.properties);t.includes(r)||t.push(r);}return t.sort((o,r)=>o-r)}function Lu(i,e,t){let o=["==",e,t];return i?["all",i,o]:o}var xn='"use strict";(()=>{var pr=Object.create;var tn=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var dr=Object.getOwnPropertyNames;var xr=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty;var yr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var br=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of dr(t))!gr.call(e,i)&&i!==n&&tn(e,i,{get:()=>t[i],enumerable:!(r=mr(t,i))||r.enumerable});return e};var wr=(e,t,n)=>(n=e!=null?pr(xr(e)):{},br(t||!e||!e.__esModule?tn(n,"default",{value:e,enumerable:!0}):n,e));var Un=yr((zt,jt)=>{(function(e,t){typeof zt=="object"&&typeof jt<"u"?jt.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.polygonClipping=t())})(zt,function(){"use strict";function e(y,s){var l={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},a,d,p,M;return M={next:w(0),throw:w(1),return:w(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function w(E){return function(C){return R([E,C])}}function R(E){if(a)throw new TypeError("Generator is already executing.");for(;l;)try{if(a=1,d&&(p=E[0]&2?d.return:E[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,E[1])).done)return p;switch(d=0,p&&(E=[E[0]&2,p.value]),E[0]){case 0:case 1:p=E;break;case 4:return l.label++,{value:E[1],done:!1};case 5:l.label++,d=E[1],E=[0];continue;case 7:E=l.ops.pop(),l.trys.pop();continue;default:if(p=l.trys,!(p=p.length>0&&p[p.length-1])&&(E[0]===6||E[0]===2)){l=0;continue}if(E[0]===3&&(!p||E[1]>p[0]&&E[1]<p[3])){l.label=E[1];break}if(E[0]===6&&l.label<p[1]){l.label=p[1],p=E;break}if(p&&l.label<p[2]){l.label=p[2],l.ops.push(E);break}p[2]&&l.ops.pop(),l.trys.pop();continue}E=s.call(y,l)}catch(C){E=[6,C],d=0}finally{a=p=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}}var t=function(){function y(s,l){this.next=null,this.key=s,this.data=l,this.left=null,this.right=null}return y}();function n(y,s){return y>s?1:y<s?-1:0}function r(y,s,l){for(var a=new t(null,null),d=a,p=a;;){var M=l(y,s.key);if(M<0){if(s.left===null)break;if(l(y,s.left.key)<0){var w=s.left;if(s.left=w.right,w.right=s,s=w,s.left===null)break}p.left=s,p=s,s=s.left}else if(M>0){if(s.right===null)break;if(l(y,s.right.key)>0){var w=s.right;if(s.right=w.left,w.left=s,s=w,s.right===null)break}d.right=s,d=s,s=s.right}else break}return d.right=s.left,p.left=s.right,s.left=a.right,s.right=a.left,s}function i(y,s,l,a){var d=new t(y,s);if(l===null)return d.left=d.right=null,d;l=r(y,l,a);var p=a(y,l.key);return p<0?(d.left=l.left,d.right=l,l.left=null):p>=0&&(d.right=l.right,d.left=l,l.right=null),d}function o(y,s,l){var a=null,d=null;if(s){s=r(y,s,l);var p=l(s.key,y);p===0?(a=s.left,d=s.right):p<0?(d=s.right,s.right=null,a=s):(a=s.left,s.left=null,d=s)}return{left:a,right:d}}function u(y,s,l){return s===null?y:(y===null||(s=r(y.key,s,l),s.left=y),s)}function c(y,s,l,a,d){if(y){a(""+s+(l?"\\u2514\\u2500\\u2500 ":"\\u251C\\u2500\\u2500 ")+d(y)+`\n`);var p=s+(l?" ":"\\u2502 ");y.left&&c(y.left,p,!1,a,d),y.right&&c(y.right,p,!0,a,d)}}var f=function(){function y(s){s===void 0&&(s=n),this._root=null,this._size=0,this._comparator=s}return y.prototype.insert=function(s,l){return this._size++,this._root=i(s,l,this._root,this._comparator)},y.prototype.add=function(s,l){var a=new t(s,l);this._root===null&&(a.left=a.right=null,this._size++,this._root=a);var d=this._comparator,p=r(s,this._root,d),M=d(s,p.key);return M===0?this._root=p:(M<0?(a.left=p.left,a.right=p,p.left=null):M>0&&(a.right=p.right,a.left=p,p.right=null),this._size++,this._root=a),this._root},y.prototype.remove=function(s){this._root=this._remove(s,this._root,this._comparator)},y.prototype._remove=function(s,l,a){var d;if(l===null)return null;l=r(s,l,a);var p=a(s,l.key);return p===0?(l.left===null?d=l.right:(d=r(s,l.left,a),d.right=l.right),this._size--,d):l},y.prototype.pop=function(){var s=this._root;if(s){for(;s.left;)s=s.left;return this._root=r(s.key,this._root,this._comparator),this._root=this._remove(s.key,this._root,this._comparator),{key:s.key,data:s.data}}return null},y.prototype.findStatic=function(s){for(var l=this._root,a=this._comparator;l;){var d=a(s,l.key);if(d===0)return l;d<0?l=l.left:l=l.right}return null},y.prototype.find=function(s){return this._root&&(this._root=r(s,this._root,this._comparator),this._comparator(s,this._root.key)!==0)?null:this._root},y.prototype.contains=function(s){for(var l=this._root,a=this._comparator;l;){var d=a(s,l.key);if(d===0)return!0;d<0?l=l.left:l=l.right}return!1},y.prototype.forEach=function(s,l){for(var a=this._root,d=[],p=!1;!p;)a!==null?(d.push(a),a=a.left):d.length!==0?(a=d.pop(),s.call(l,a),a=a.right):p=!0;return this},y.prototype.range=function(s,l,a,d){for(var p=[],M=this._comparator,w=this._root,R;p.length!==0||w;)if(w)p.push(w),w=w.left;else{if(w=p.pop(),R=M(w.key,l),R>0)break;if(M(w.key,s)>=0&&a.call(d,w))return this;w=w.right}return this},y.prototype.keys=function(){var s=[];return this.forEach(function(l){var a=l.key;return s.push(a)}),s},y.prototype.values=function(){var s=[];return this.forEach(function(l){var a=l.data;return s.push(a)}),s},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(s){if(s===void 0&&(s=this._root),s)for(;s.left;)s=s.left;return s},y.prototype.maxNode=function(s){if(s===void 0&&(s=this._root),s)for(;s.right;)s=s.right;return s},y.prototype.at=function(s){for(var l=this._root,a=!1,d=0,p=[];!a;)if(l)p.push(l),l=l.left;else if(p.length>0){if(l=p.pop(),d===s)return l;d++,l=l.right}else a=!0;return null},y.prototype.next=function(s){var l=this._root,a=null;if(s.right){for(a=s.right;a.left;)a=a.left;return a}for(var d=this._comparator;l;){var p=d(s.key,l.key);if(p===0)break;p<0?(a=l,l=l.left):l=l.right}return a},y.prototype.prev=function(s){var l=this._root,a=null;if(s.left!==null){for(a=s.left;a.right;)a=a.right;return a}for(var d=this._comparator;l;){var p=d(s.key,l.key);if(p===0)break;p<0?l=l.left:(a=l,l=l.right)}return a},y.prototype.clear=function(){return this._root=null,this._size=0,this},y.prototype.toList=function(){return g(this._root)},y.prototype.load=function(s,l,a){l===void 0&&(l=[]),a===void 0&&(a=!1);var d=s.length,p=this._comparator;if(a&&S(s,l,0,d-1,p),this._root===null)this._root=h(s,l,0,d),this._size=d;else{var M=v(this.toList(),m(s,l),p);d=this._size+d,this._root=x({head:M},0,d)}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(s){s===void 0&&(s=function(a){return String(a.key)});var l=[];return c(this._root,"",!0,function(a){return l.push(a)},s),l.join("")},y.prototype.update=function(s,l,a){var d=this._comparator,p=o(s,this._root,d),M=p.left,w=p.right;d(s,l)<0?w=i(l,a,w,d):M=i(l,a,M,d),this._root=u(M,w,d)},y.prototype.split=function(s){return o(s,this._root,this._comparator)},y.prototype[Symbol.iterator]=function(){var s,l,a;return e(this,function(d){switch(d.label){case 0:s=this._root,l=[],a=!1,d.label=1;case 1:return a?[3,6]:s===null?[3,2]:(l.push(s),s=s.left,[3,5]);case 2:return l.length===0?[3,4]:(s=l.pop(),[4,s]);case 3:return d.sent(),s=s.right,[3,5];case 4:a=!0,d.label=5;case 5:return[3,1];case 6:return[2]}})},y}();function h(y,s,l,a){var d=a-l;if(d>0){var p=l+Math.floor(d/2),M=y[p],w=s[p],R=new t(M,w);return R.left=h(y,s,l,p),R.right=h(y,s,p+1,a),R}return null}function m(y,s){for(var l=new t(null,null),a=l,d=0;d<y.length;d++)a=a.next=new t(y[d],s[d]);return a.next=null,l.next}function g(y){for(var s=y,l=[],a=!1,d=new t(null,null),p=d;!a;)s?(l.push(s),s=s.left):l.length>0?(s=p=p.next=l.pop(),s=s.right):a=!0;return p.next=null,d.next}function x(y,s,l){var a=l-s;if(a>0){var d=s+Math.floor(a/2),p=x(y,s,d),M=y.head;return M.left=p,y.head=y.head.next,M.right=x(y,d+1,l),M}return null}function v(y,s,l){for(var a=new t(null,null),d=a,p=y,M=s;p!==null&&M!==null;)l(p.key,M.key)<0?(d.next=p,p=p.next):(d.next=M,M=M.next),d=d.next;return p!==null?d.next=p:M!==null&&(d.next=M),a.next}function S(y,s,l,a,d){if(!(l>=a)){for(var p=y[l+a>>1],M=l-1,w=a+1;;){do M++;while(d(y[M],p)<0);do w--;while(d(y[w],p)>0);if(M>=w)break;var R=y[M];y[M]=y[w],y[w]=R,R=s[M],s[M]=s[w],s[w]=R}S(y,s,l,w,d),S(y,s,w+1,a,d)}}let P=(y,s)=>y.ll.x<=s.x&&s.x<=y.ur.x&&y.ll.y<=s.y&&s.y<=y.ur.y,_=(y,s)=>{if(s.ur.x<y.ll.x||y.ur.x<s.ll.x||s.ur.y<y.ll.y||y.ur.y<s.ll.y)return null;let l=y.ll.x<s.ll.x?s.ll.x:y.ll.x,a=y.ur.x<s.ur.x?y.ur.x:s.ur.x,d=y.ll.y<s.ll.y?s.ll.y:y.ll.y,p=y.ur.y<s.ur.y?y.ur.y:s.ur.y;return{ll:{x:l,y:d},ur:{x:a,y:p}}},I=Number.EPSILON;I===void 0&&(I=Math.pow(2,-52));let A=I*I,k=(y,s)=>{if(-I<y&&y<I&&-I<s&&s<I)return 0;let l=y-s;return l*l<A*y*s?0:y<s?-1:1};class L{constructor(){this.reset()}reset(){this.xRounder=new V,this.yRounder=new V}round(s,l){return{x:this.xRounder.round(s),y:this.yRounder.round(l)}}}class V{constructor(){this.tree=new f,this.round(0)}round(s){let l=this.tree.add(s),a=this.tree.prev(l);if(a!==null&&k(l.key,a.key)===0)return this.tree.remove(s),a.key;let d=this.tree.next(l);return d!==null&&k(l.key,d.key)===0?(this.tree.remove(s),d.key):s}}let U=new L,N=11102230246251565e-32,T=134217729,j=(3+8*N)*N;function Y(y,s,l,a,d){let p,M,w,R,E=s[0],C=a[0],b=0,F=0;C>E==C>-E?(p=E,E=s[++b]):(p=C,C=a[++F]);let B=0;if(b<y&&F<l)for(C>E==C>-E?(M=E+p,w=p-(M-E),E=s[++b]):(M=C+p,w=p-(M-C),C=a[++F]),p=M,w!==0&&(d[B++]=w);b<y&&F<l;)C>E==C>-E?(M=p+E,R=M-p,w=p-(M-R)+(E-R),E=s[++b]):(M=p+C,R=M-p,w=p-(M-R)+(C-R),C=a[++F]),p=M,w!==0&&(d[B++]=w);for(;b<y;)M=p+E,R=M-p,w=p-(M-R)+(E-R),E=s[++b],p=M,w!==0&&(d[B++]=w);for(;F<l;)M=p+C,R=M-p,w=p-(M-R)+(C-R),C=a[++F],p=M,w!==0&&(d[B++]=w);return(p!==0||B===0)&&(d[B++]=p),B}function $(y,s){let l=s[0];for(let a=1;a<y;a++)l+=s[a];return l}function O(y){return new Float64Array(y)}let G=(3+16*N)*N,W=(2+12*N)*N,D=(9+64*N)*N*N,Q=O(4),oe=O(8),ee=O(12),ne=O(16),Z=O(4);function le(y,s,l,a,d,p,M){let w,R,E,C,b,F,B,z,H,J,X,te,xe,se,ge,ye,Ee,be,ke=y-d,_e=l-d,Ae=s-p,Be=a-p;se=ke*Be,F=T*ke,B=F-(F-ke),z=ke-B,F=T*Be,H=F-(F-Be),J=Be-H,ge=z*J-(se-B*H-z*H-B*J),ye=Ae*_e,F=T*Ae,B=F-(F-Ae),z=Ae-B,F=T*_e,H=F-(F-_e),J=_e-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Q[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Q[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Q[2]=te-(be-b)+(X-b),Q[3]=be;let Te=$(4,Q),et=W*M;if(Te>=et||-Te>=et||(b=y-ke,w=y-(ke+b)+(b-d),b=l-_e,E=l-(_e+b)+(b-d),b=s-Ae,R=s-(Ae+b)+(b-p),b=a-Be,C=a-(Be+b)+(b-p),w===0&&R===0&&E===0&&C===0)||(et=D*M+j*Math.abs(Te),Te+=ke*C+Be*w-(Ae*E+_e*R),Te>=et||-Te>=et))return Te;se=w*Be,F=T*w,B=F-(F-w),z=w-B,F=T*Be,H=F-(F-Be),J=Be-H,ge=z*J-(se-B*H-z*H-B*J),ye=R*_e,F=T*R,B=F-(F-R),z=R-B,F=T*_e,H=F-(F-_e),J=_e-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-b),Z[3]=be;let fr=Y(4,Q,4,Z,oe);se=ke*C,F=T*ke,B=F-(F-ke),z=ke-B,F=T*C,H=F-(F-C),J=C-H,ge=z*J-(se-B*H-z*H-B*J),ye=Ae*E,F=T*Ae,B=F-(F-Ae),z=Ae-B,F=T*E,H=F-(F-E),J=E-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-b),Z[3]=be;let ar=Y(fr,oe,4,Z,ee);se=w*C,F=T*w,B=F-(F-w),z=w-B,F=T*C,H=F-(F-C),J=C-H,ge=z*J-(se-B*H-z*H-B*J),ye=R*E,F=T*R,B=F-(F-R),z=R-B,F=T*E,H=F-(F-E),J=E-H,Ee=z*J-(ye-B*H-z*H-B*J),X=ge-Ee,b=ge-X,Z[0]=ge-(X+b)+(b-Ee),te=se+X,b=te-se,xe=se-(te-b)+(X-b),X=xe-ye,b=xe-X,Z[1]=xe-(X+b)+(b-ye),be=te+X,b=be-te,Z[2]=te-(be-b)+(X-b),Z[3]=be;let hr=Y(ar,ee,4,Z,ne);return ne[hr-1]}function K(y,s,l,a,d,p){let M=(s-p)*(l-d),w=(y-d)*(a-p),R=M-w,E=Math.abs(M+w);return Math.abs(R)>=G*E?R:-le(y,s,l,a,d,p,E)}let q=(y,s)=>y.x*s.y-y.y*s.x,he=(y,s)=>y.x*s.x+y.y*s.y,me=(y,s,l)=>{let a=K(y.x,y.y,s.x,s.y,l.x,l.y);return a>0?-1:a<0?1:0},ce=y=>Math.sqrt(he(y,y)),fe=(y,s,l)=>{let a={x:s.x-y.x,y:s.y-y.y},d={x:l.x-y.x,y:l.y-y.y};return q(d,a)/ce(d)/ce(a)},ae=(y,s,l)=>{let a={x:s.x-y.x,y:s.y-y.y},d={x:l.x-y.x,y:l.y-y.y};return he(d,a)/ce(d)/ce(a)},de=(y,s,l)=>s.y===0?null:{x:y.x+s.x/s.y*(l-y.y),y:l},Se=(y,s,l)=>s.x===0?null:{x:l,y:y.y+s.y/s.x*(l-y.x)},Fe=(y,s,l,a)=>{if(s.x===0)return Se(l,a,y.x);if(a.x===0)return Se(y,s,l.x);if(s.y===0)return de(l,a,y.y);if(a.y===0)return de(y,s,l.y);let d=q(s,a);if(d==0)return null;let p={x:l.x-y.x,y:l.y-y.y},M=q(p,s)/d,w=q(p,a)/d,R=y.x+w*s.x,E=l.x+M*a.x,C=y.y+w*s.y,b=l.y+M*a.y,F=(R+E)/2,B=(C+b)/2;return{x:F,y:B}};class re{static compare(s,l){let a=re.comparePoints(s.point,l.point);return a!==0?a:(s.point!==l.point&&s.link(l),s.isLeft!==l.isLeft?s.isLeft?1:-1:ve.compare(s.segment,l.segment))}static comparePoints(s,l){return s.x<l.x?-1:s.x>l.x?1:s.y<l.y?-1:s.y>l.y?1:0}constructor(s,l){s.events===void 0?s.events=[this]:s.events.push(this),this.point=s,this.isLeft=l}link(s){if(s.point===this.point)throw new Error("Tried to link already linked events");let l=s.point.events;for(let a=0,d=l.length;a<d;a++){let p=l[a];this.point.events.push(p),p.point=this.point}this.checkForConsuming()}checkForConsuming(){let s=this.point.events.length;for(let l=0;l<s;l++){let a=this.point.events[l];if(a.segment.consumedBy===void 0)for(let d=l+1;d<s;d++){let p=this.point.events[d];p.consumedBy===void 0&&a.otherSE.point.events===p.otherSE.point.events&&a.segment.consume(p.segment)}}}getAvailableLinkedEvents(){let s=[];for(let l=0,a=this.point.events.length;l<a;l++){let d=this.point.events[l];d!==this&&!d.segment.ringOut&&d.segment.isInResult()&&s.push(d)}return s}getLeftmostComparator(s){let l=new Map,a=d=>{let p=d.otherSE;l.set(d,{sine:fe(this.point,s.point,p.point),cosine:ae(this.point,s.point,p.point)})};return(d,p)=>{l.has(d)||a(d),l.has(p)||a(p);let{sine:M,cosine:w}=l.get(d),{sine:R,cosine:E}=l.get(p);return M>=0&&R>=0?w<E?1:w>E?-1:0:M<0&&R<0?w<E?-1:w>E?1:0:R<M?-1:R>M?1:0}}}let Ue=0;class ve{static compare(s,l){let a=s.leftSE.point.x,d=l.leftSE.point.x,p=s.rightSE.point.x,M=l.rightSE.point.x;if(M<a)return 1;if(p<d)return-1;let w=s.leftSE.point.y,R=l.leftSE.point.y,E=s.rightSE.point.y,C=l.rightSE.point.y;if(a<d){if(R<w&&R<E)return 1;if(R>w&&R>E)return-1;let b=s.comparePoint(l.leftSE.point);if(b<0)return 1;if(b>0)return-1;let F=l.comparePoint(s.rightSE.point);return F!==0?F:-1}if(a>d){if(w<R&&w<C)return-1;if(w>R&&w>C)return 1;let b=l.comparePoint(s.leftSE.point);if(b!==0)return b;let F=s.comparePoint(l.rightSE.point);return F<0?1:F>0?-1:1}if(w<R)return-1;if(w>R)return 1;if(p<M){let b=l.comparePoint(s.rightSE.point);if(b!==0)return b}if(p>M){let b=s.comparePoint(l.rightSE.point);if(b<0)return 1;if(b>0)return-1}if(p!==M){let b=E-w,F=p-a,B=C-R,z=M-d;if(b>F&&B<z)return 1;if(b<F&&B>z)return-1}return p>M?1:p<M||E<C?-1:E>C?1:s.id<l.id?-1:s.id>l.id?1:0}constructor(s,l,a,d){this.id=++Ue,this.leftSE=s,s.segment=this,s.otherSE=l,this.rightSE=l,l.segment=this,l.otherSE=s,this.rings=a,this.windings=d}static fromRing(s,l,a){let d,p,M,w=re.comparePoints(s,l);if(w<0)d=s,p=l,M=1;else if(w>0)d=l,p=s,M=-1;else throw new Error(`Tried to create degenerate segment at [${s.x}, ${s.y}]`);let R=new re(d,!0),E=new re(p,!1);return new ve(R,E,[a],[M])}replaceRightSE(s){this.rightSE=s,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let s=this.leftSE.point.y,l=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:s<l?s:l},ur:{x:this.rightSE.point.x,y:s>l?s:l}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(s){return s.x===this.leftSE.point.x&&s.y===this.leftSE.point.y||s.x===this.rightSE.point.x&&s.y===this.rightSE.point.y}comparePoint(s){if(this.isAnEndpoint(s))return 0;let l=this.leftSE.point,a=this.rightSE.point,d=this.vector();if(l.x===a.x)return s.x===l.x?0:s.x<l.x?1:-1;let p=(s.y-l.y)/d.y,M=l.x+p*d.x;if(s.x===M)return 0;let w=(s.x-l.x)/d.x,R=l.y+w*d.y;return s.y===R?0:s.y<R?-1:1}getIntersection(s){let l=this.bbox(),a=s.bbox(),d=_(l,a);if(d===null)return null;let p=this.leftSE.point,M=this.rightSE.point,w=s.leftSE.point,R=s.rightSE.point,E=P(l,w)&&this.comparePoint(w)===0,C=P(a,p)&&s.comparePoint(p)===0,b=P(l,R)&&this.comparePoint(R)===0,F=P(a,M)&&s.comparePoint(M)===0;if(C&&E)return F&&!b?M:!F&&b?R:null;if(C)return b&&p.x===R.x&&p.y===R.y?null:p;if(E)return F&&M.x===w.x&&M.y===w.y?null:w;if(F&&b)return null;if(F)return M;if(b)return R;let B=Fe(p,this.vector(),w,s.vector());return B===null||!P(d,B)?null:U.round(B.x,B.y)}split(s){let l=[],a=s.events!==void 0,d=new re(s,!0),p=new re(s,!1),M=this.rightSE;this.replaceRightSE(p),l.push(p),l.push(d);let w=new ve(d,M,this.rings.slice(),this.windings.slice());return re.comparePoints(w.leftSE.point,w.rightSE.point)>0&&w.swapEvents(),re.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),a&&(d.checkForConsuming(),p.checkForConsuming()),l}swapEvents(){let s=this.rightSE;this.rightSE=this.leftSE,this.leftSE=s,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let l=0,a=this.windings.length;l<a;l++)this.windings[l]*=-1}consume(s){let l=this,a=s;for(;l.consumedBy;)l=l.consumedBy;for(;a.consumedBy;)a=a.consumedBy;let d=ve.compare(l,a);if(d!==0){if(d>0){let p=l;l=a,a=p}if(l.prev===a){let p=l;l=a,a=p}for(let p=0,M=a.rings.length;p<M;p++){let w=a.rings[p],R=a.windings[p],E=l.rings.indexOf(w);E===-1?(l.rings.push(w),l.windings.push(R)):l.windings[E]+=R}a.rings=null,a.windings=null,a.consumedBy=l,a.leftSE.consumedBy=l.leftSE,a.rightSE.consumedBy=l.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 s=this.prev.consumedBy||this.prev;this._beforeState=s.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let s=this.beforeState();this._afterState={rings:s.rings.slice(0),windings:s.windings.slice(0),multiPolys:[]};let l=this._afterState.rings,a=this._afterState.windings,d=this._afterState.multiPolys;for(let w=0,R=this.rings.length;w<R;w++){let E=this.rings[w],C=this.windings[w],b=l.indexOf(E);b===-1?(l.push(E),a.push(C)):a[b]+=C}let p=[],M=[];for(let w=0,R=l.length;w<R;w++){if(a[w]===0)continue;let E=l[w],C=E.poly;if(M.indexOf(C)===-1)if(E.isExterior)p.push(C);else{M.indexOf(C)===-1&&M.push(C);let b=p.indexOf(E.poly);b!==-1&&p.splice(b,1)}}for(let w=0,R=p.length;w<R;w++){let E=p[w].multiPoly;d.indexOf(E)===-1&&d.push(E)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let s=this.beforeState().multiPolys,l=this.afterState().multiPolys;switch(Pe.type){case"union":{let a=s.length===0,d=l.length===0;this._isInResult=a!==d;break}case"intersection":{let a,d;s.length<l.length?(a=s.length,d=l.length):(a=l.length,d=s.length),this._isInResult=d===Pe.numMultiPolys&&a<d;break}case"xor":{let a=Math.abs(s.length-l.length);this._isInResult=a%2===1;break}case"difference":{let a=d=>d.length===1&&d[0].isSubject;this._isInResult=a(s)!==a(l);break}default:throw new Error(`Unrecognized operation type found ${Pe.type}`)}return this._isInResult}}class De{constructor(s,l,a){if(!Array.isArray(s)||s.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=l,this.isExterior=a,this.segments=[],typeof s[0][0]!="number"||typeof s[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let d=U.round(s[0][0],s[0][1]);this.bbox={ll:{x:d.x,y:d.y},ur:{x:d.x,y:d.y}};let p=d;for(let M=1,w=s.length;M<w;M++){if(typeof s[M][0]!="number"||typeof s[M][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let R=U.round(s[M][0],s[M][1]);R.x===p.x&&R.y===p.y||(this.segments.push(ve.fromRing(p,R,this)),R.x<this.bbox.ll.x&&(this.bbox.ll.x=R.x),R.y<this.bbox.ll.y&&(this.bbox.ll.y=R.y),R.x>this.bbox.ur.x&&(this.bbox.ur.x=R.x),R.y>this.bbox.ur.y&&(this.bbox.ur.y=R.y),p=R)}(d.x!==p.x||d.y!==p.y)&&this.segments.push(ve.fromRing(p,d,this))}getSweepEvents(){let s=[];for(let l=0,a=this.segments.length;l<a;l++){let d=this.segments[l];s.push(d.leftSE),s.push(d.rightSE)}return s}}class Ie{constructor(s,l){if(!Array.isArray(s))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new De(s[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 a=1,d=s.length;a<d;a++){let p=new De(s[a],this,!1);p.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=p.bbox.ll.x),p.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=p.bbox.ll.y),p.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=p.bbox.ur.x),p.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=p.bbox.ur.y),this.interiorRings.push(p)}this.multiPoly=l}getSweepEvents(){let s=this.exteriorRing.getSweepEvents();for(let l=0,a=this.interiorRings.length;l<a;l++){let d=this.interiorRings[l].getSweepEvents();for(let p=0,M=d.length;p<M;p++)s.push(d[p])}return s}}class Le{constructor(s,l){if(!Array.isArray(s))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof s[0][0][0]=="number"&&(s=[s])}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 a=0,d=s.length;a<d;a++){let p=new Ie(s[a],this);p.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=p.bbox.ll.x),p.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=p.bbox.ll.y),p.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=p.bbox.ur.x),p.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=p.bbox.ur.y),this.polys.push(p)}this.isSubject=l}getSweepEvents(){let s=[];for(let l=0,a=this.polys.length;l<a;l++){let d=this.polys[l].getSweepEvents();for(let p=0,M=d.length;p<M;p++)s.push(d[p])}return s}}class Me{static factory(s){let l=[];for(let a=0,d=s.length;a<d;a++){let p=s[a];if(!p.isInResult()||p.ringOut)continue;let M=null,w=p.leftSE,R=p.rightSE,E=[w],C=w.point,b=[];for(;M=w,w=R,E.push(w),w.point!==C;)for(;;){let F=w.getAvailableLinkedEvents();if(F.length===0){let H=E[0].point,J=E[E.length-1].point;throw new Error(`Unable to complete output ring starting at [${H.x}, ${H.y}]. Last matching segment found ends at [${J.x}, ${J.y}].`)}if(F.length===1){R=F[0].otherSE;break}let B=null;for(let H=0,J=b.length;H<J;H++)if(b[H].point===w.point){B=H;break}if(B!==null){let H=b.splice(B)[0],J=E.splice(H.index);J.unshift(J[0].otherSE),l.push(new Me(J.reverse()));continue}b.push({index:E.length,point:w.point});let z=w.getLeftmostComparator(M);R=F.sort(z)[0].otherSE;break}l.push(new Me(E))}return l}constructor(s){this.events=s;for(let l=0,a=s.length;l<a;l++)s[l].segment.ringOut=this;this.poly=null}getGeom(){let s=this.events[0].point,l=[s];for(let E=1,C=this.events.length-1;E<C;E++){let b=this.events[E].point,F=this.events[E+1].point;me(b,s,F)!==0&&(l.push(b),s=b)}if(l.length===1)return null;let a=l[0],d=l[1];me(a,s,d)===0&&l.shift(),l.push(l[0]);let p=this.isExteriorRing()?1:-1,M=this.isExteriorRing()?0:l.length-1,w=this.isExteriorRing()?l.length:-1,R=[];for(let E=M;E!=w;E+=p)R.push([l[E].x,l[E].y]);return R}isExteriorRing(){if(this._isExteriorRing===void 0){let s=this.enclosingRing();this._isExteriorRing=s?!s.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let s=this.events[0];for(let d=1,p=this.events.length;d<p;d++){let M=this.events[d];re.compare(s,M)>0&&(s=M)}let l=s.segment.prevInResult(),a=l?l.prevInResult():null;for(;;){if(!l)return null;if(!a)return l.ringOut;if(a.ringOut!==l.ringOut)return a.ringOut.enclosingRing()!==l.ringOut?l.ringOut:l.ringOut.enclosingRing();l=a.prevInResult(),a=l?l.prevInResult():null}}}class Ge{constructor(s){this.exteriorRing=s,s.poly=this,this.interiorRings=[]}addInterior(s){this.interiorRings.push(s),s.poly=this}getGeom(){let s=[this.exteriorRing.getGeom()];if(s[0]===null)return null;for(let l=0,a=this.interiorRings.length;l<a;l++){let d=this.interiorRings[l].getGeom();d!==null&&s.push(d)}return s}}class $e{constructor(s){this.rings=s,this.polys=this._composePolys(s)}getGeom(){let s=[];for(let l=0,a=this.polys.length;l<a;l++){let d=this.polys[l].getGeom();d!==null&&s.push(d)}return s}_composePolys(s){let l=[];for(let a=0,d=s.length;a<d;a++){let p=s[a];if(!p.poly)if(p.isExteriorRing())l.push(new Ge(p));else{let M=p.enclosingRing();M.poly||l.push(new Ge(M)),M.poly.addInterior(p)}}return l}}class Ne{constructor(s){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ve.compare;this.queue=s,this.tree=new f(l),this.segments=[]}process(s){let l=s.segment,a=[];if(s.consumedBy)return s.isLeft?this.queue.remove(s.otherSE):this.tree.remove(l),a;let d=s.isLeft?this.tree.add(l):this.tree.find(l);if(!d)throw new Error(`Unable to find segment #${l.id} [${l.leftSE.point.x}, ${l.leftSE.point.y}] -> [${l.rightSE.point.x}, ${l.rightSE.point.y}] in SweepLine tree.`);let p=d,M=d,w,R;for(;w===void 0;)p=this.tree.prev(p),p===null?w=null:p.key.consumedBy===void 0&&(w=p.key);for(;R===void 0;)M=this.tree.next(M),M===null?R=null:M.key.consumedBy===void 0&&(R=M.key);if(s.isLeft){let E=null;if(w){let b=w.getIntersection(l);if(b!==null&&(l.isAnEndpoint(b)||(E=b),!w.isAnEndpoint(b))){let F=this._splitSafely(w,b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}}let C=null;if(R){let b=R.getIntersection(l);if(b!==null&&(l.isAnEndpoint(b)||(C=b),!R.isAnEndpoint(b))){let F=this._splitSafely(R,b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}}if(E!==null||C!==null){let b=null;E===null?b=C:C===null?b=E:b=re.comparePoints(E,C)<=0?E:C,this.queue.remove(l.rightSE),a.push(l.rightSE);let F=l.split(b);for(let B=0,z=F.length;B<z;B++)a.push(F[B])}a.length>0?(this.tree.remove(l),a.push(s)):(this.segments.push(l),l.prev=w)}else{if(w&&R){let E=w.getIntersection(R);if(E!==null){if(!w.isAnEndpoint(E)){let C=this._splitSafely(w,E);for(let b=0,F=C.length;b<F;b++)a.push(C[b])}if(!R.isAnEndpoint(E)){let C=this._splitSafely(R,E);for(let b=0,F=C.length;b<F;b++)a.push(C[b])}}}this.tree.remove(l)}return a}_splitSafely(s,l){this.tree.remove(s);let a=s.rightSE;this.queue.remove(a);let d=s.split(l);return d.push(a),s.consumedBy===void 0&&this.tree.add(s),d}}let ht=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,pt=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class Et{run(s,l,a){Pe.type=s,U.reset();let d=[new Le(l,!0)];for(let b=0,F=a.length;b<F;b++)d.push(new Le(a[b],!1));if(Pe.numMultiPolys=d.length,Pe.type==="difference"){let b=d[0],F=1;for(;F<d.length;)_(d[F].bbox,b.bbox)!==null?F++:d.splice(F,1)}if(Pe.type==="intersection")for(let b=0,F=d.length;b<F;b++){let B=d[b];for(let z=b+1,H=d.length;z<H;z++)if(_(B.bbox,d[z].bbox)===null)return[]}let p=new f(re.compare);for(let b=0,F=d.length;b<F;b++){let B=d[b].getSweepEvents();for(let z=0,H=B.length;z<H;z++)if(p.insert(B[z]),p.size>ht)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}let M=new Ne(p),w=p.size,R=p.pop();for(;R;){let b=R.key;if(p.size===w){let B=b.segment;throw new Error(`Unable to pop() ${b.isLeft?"left":"right"} SweepEvent [${b.point.x}, ${b.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(p.size>ht)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(M.segments.length>pt)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");let F=M.process(b);for(let B=0,z=F.length;B<z;B++){let H=F[B];H.consumedBy===void 0&&p.insert(H)}w=p.size,R=p.pop()}U.reset();let E=Me.factory(M.segments);return new $e(E).getGeom()}}let Pe=new Et;var cr={union:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("union",y,l)},intersection:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("intersection",y,l)},xor:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("xor",y,l)},difference:function(y){for(var s=arguments.length,l=new Array(s>1?s-1:0),a=1;a<s;a++)l[a-1]=arguments[a];return Pe.run("difference",y,l)}};return cr})});var it=new Set,Rt=!1;function Oe(e,t,n=2){let r=t&&t.length,i=r?t[0]*n:e.length;it.size&&it.clear();let o=sn(e,0,i,n,!0),u=[];if(!o||o.next===o.prev)return u;let c=0,f=0,h=0;if(r&&(o=Rr(e,t,o,n)),e.length>80*n){c=e[0],f=e[1];let m=c,g=f;for(let x=n;x<i;x+=n){let v=e[x],S=e[x+1];v<c&&(c=v),S<f&&(f=S),v>m&&(m=v),S>g&&(g=S)}h=Math.max(m-c,g-f),h=h!==0?32767/h:0}return Ft(o,u,c,f,h),u}function sn(e,t,n,r,i){let o=null;if(i===Ur(e,t,n,r)>0)for(let u=t;u<n;u+=r)o=on(u/r|0,e[u],e[u+1],o);else for(let u=n-r;u>=t;u-=r)o=on(u/r|0,e[u],e[u+1],o);return o&&ot(o,o.next)&&(ut(o),o=o.next),o}function ze(e,t=e){let n=t===e,r=e,i;do i=!1,r!==r.next&&(it.size===0||!it.has(r))&&(ot(r,r.next)||ue(r.prev,r,r.next)===0)?((n||r===t)&&(t=r.prev),Rt=!0,ut(r),r=r.prev,i=!0):(n||r!==t)&&(r=r.next,i=!n);while(i||r!==t);return t}function Ft(e,t,n,r,i){i&&Br(e,n,r,i);let o=e,u=!1;for(;e.prev!==e.next;){let c=e.prev,f=e.next;if(ue(c,e,f)<0&&(i?Sr(e,n,r,i):vr(e))){t.push(c.i,e.i,f.i),ut(e),e=f,o=f;continue}if(e=f,e===o){if(Rt=!1,e=ze(e),Rt){o=e;continue}if(!u){e=Mr(e,t),o=e,u=!0;continue}Er(e,t,n,r,i);break}}}function vr(e){let t=e.prev,n=e,r=e.next,i=t.x,o=n.x,u=r.x,c=t.y,f=n.y,h=r.y,m=Math.min(i,o,u),g=Math.min(c,f,h),x=Math.max(i,o,u),v=Math.max(c,f,h),S=r.next;for(;S!==t;){if(S.x>=m&&S.x<=x&&S.y>=g&&S.y<=v&&!(i===S.x&&c===S.y)&&gt(i,c,o,f,u,h,S.x,S.y)&&ue(S.prev,S,S.next)>=0)return!1;S=S.next}return!0}function Sr(e,t,n,r){let i=e.prev,o=e,u=e.next,c=i.x,f=o.x,h=u.x,m=i.y,g=o.y,x=u.y,v=Math.min(c,f,h),S=Math.min(m,g,x),P=Math.max(c,f,h),_=Math.max(m,g,x),I=_t(v,S,t,n,r),A=_t(P,_,t,n,r),k=e.prevZ;for(;k&&k.z>=I;){if(k.x>=v&&k.x<=P&&k.y>=S&&k.y<=_&&k!==u&&!(c===k.x&&m===k.y)&&gt(c,m,f,g,h,x,k.x,k.y)&&ue(k.prev,k,k.next)>=0)return!1;k=k.prevZ}let L=e.nextZ;for(;L&&L.z<=A;){if(L.x>=v&&L.x<=P&&L.y>=S&&L.y<=_&&L!==u&&!(c===L.x&&m===L.y)&&gt(c,m,f,g,h,x,L.x,L.y)&&ue(L.prev,L,L.next)>=0)return!1;L=L.nextZ}return!0}function Mr(e,t){let n=e,r=!1;do{let i=n.prev,o=n.next.next;cn(i,n,n.next,o,!1)&&st(i,o)&&st(o,i)&&(t.push(i.i,n.i,o.i),ut(n),ut(n.next),n=e=o,r=!0),n=n.next}while(n!==e);return r?ze(n):n}function Er(e,t,n,r,i){let o=e;do{let u=o.next.next;for(;u!==o.prev;){if(o.i!==u.i&&Cr(o,u)){let c=fn(o,u);o=ze(o,o.next),c=ze(c,c.next),Ft(o,t,n,r,i),Ft(c,t,n,r,i);return}u=u.next}o=o.next}while(o!==e)}var It=!1;function Rr(e,t,n,r){let i=[];for(let o=0,u=t.length;o<u;o++){let c=t[o]*r,f=o<u-1?t[o+1]*r:e.length,h=sn(e,c,f,r,!1);h===h.next&&it.add(h),i.push(Tr(h))}i.sort(Fr),Pr(e.length/r,t.length),ln(n,n),It=!0;for(let o=0;o<i.length;o++)n=Ir(i[o],n);return It=!1,ze(n)}function Fr(e,t){return e.x-t.x||e.y-t.y||(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)}function Ir(e,t){let n=_r(e,t);if(!n)return t;let r=fn(n,e),i=r.next;return ln(n,i.next),ze(r,r.next),ze(n,n.next)}var un=16,ie=new Float64Array(0),xt=0,Pt=[],kt=[];function Pr(e,t){let n=Math.ceil((e+2*t)/un)+t+2;ie.length<n*4&&(ie=new Float64Array(n*4)),xt=0}function ln(e,t){let n=e;do{let r=xt++;Pt[r]=n;let i=1/0,o=1/0,u=-1/0,c=-1/0,f=0;do{let m=n.next;n.z=r,n.x<i&&(i=n.x),n.x>u&&(u=n.x),n.y<o&&(o=n.y),n.y>c&&(c=n.y),m.x<i&&(i=m.x),m.x>u&&(u=m.x),m.y<o&&(o=m.y),m.y>c&&(c=m.y),n=m}while(++f<un&&n!==t);kt[r]=n;let h=r*4;ie[h]=i,ie[h+1]=o,ie[h+2]=u,ie[h+3]=c}while(n!==t)}function kr(e,t){let n=e.z*4;t.x<ie[n]&&(ie[n]=t.x),t.y<ie[n+1]&&(ie[n+1]=t.y),t.x>ie[n+2]&&(ie[n+2]=t.x),t.y>ie[n+3]&&(ie[n+3]=t.y)}function nn(e){let t=kt[e];for(;t.prev.next!==t;)t=t.next;return kt[e]=t,t}function rn(e){let t=Pt[e];for(;t.prev.next!==t;)t=t.next;return Pt[e]=t,t}function _r(e,t){let n=t,r=e.x,i=e.y,o=-1/0,u;if(ot(e,n))return n;for(let x=0,v=0;x<xt;x++,v+=4){if(i<ie[v+1]||i>ie[v+3]||ie[v]>r||ie[v+2]<=o)continue;let S=nn(x);n=rn(x);do{if(n.prev.next===n){if(ot(e,n.next))return n.next;if(i<=n.y&&i>=n.next.y&&n.next.y!==n.y){let P=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(P<=r&&P>o&&(o=P,u=n.x<n.next.x?n:n.next,P===r))return u}}n=n.next}while(n!==S)}if(!u)return null;let c=u.x,f=u.y,h=Math.min(i,f),m=Math.max(i,f),g=1/0;for(let x=0,v=0;x<xt;x++,v+=4){if(ie[v+2]<c||ie[v]>r||ie[v+3]<h||ie[v+1]>m)continue;let S=nn(x);n=rn(x);do{if(n.prev.next===n&&r>=n.x&&n.x>=c&&r!==n.x&&gt(i<f?r:o,i,c,f,i<f?o:r,i,n.x,n.y)){let P=Math.abs(i-n.y)/(r-n.x);(st(n,e)||n.y===i&&n.next.y===i&&n.next.x>r)&&(P<g||P===g&&(n.x>u.x||n.x===u.x&&Ar(u,n)))&&(u=n,g=P)}n=n.next}while(n!==S)}return u}function Ar(e,t){return ue(e.prev,e,t.prev)<0&&ue(t.next,e,e.next)<0}var Re=[],tt=[],He=new Uint32Array(0),nt=new Uint32Array(0),rt=new Uint32Array(256);function Br(e,t,n,r){let i=e,o=0;do i.z=_t(i.x,i.y,t,n,r),Re[o++]=i,i=i.next;while(i!==e);Lr(o);let u=null;for(let c=0;c<o;c++){let f=Re[c];f.prevZ=u,u&&(u.nextZ=f),u=f}u.nextZ=null}function Lr(e){if(e<=32){for(let t=1;t<e;t++){let n=Re[t],r=n.z,i=t-1;for(;i>=0&&Re[i].z>r;)Re[i+1]=Re[i],i--;Re[i+1]=n}return}He.length<e&&(He=new Uint32Array(e),nt=new Uint32Array(e),tt=new Array(e));for(let t=0;t<e;t++)He[t]=Re[t].z;mt(e,Re,He,tt,nt,0),mt(e,tt,nt,Re,He,8),mt(e,Re,He,tt,nt,16),mt(e,tt,nt,Re,He,24)}function mt(e,t,n,r,i,o){rt.fill(0);for(let c=0;c<e;c++)rt[n[c]>>>o&255]++;let u=0;for(let c=0;c<256;c++){let f=rt[c];rt[c]=u,u+=f}for(let c=0;c<e;c++){let f=n[c],h=rt[f>>>o&255]++;r[h]=t[c],i[h]=f}}function _t(e,t,n,r,i){return e=(e-n)*i|0,t=(t-r)*i|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function Tr(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function gt(e,t,n,r,i,o,u,c){return(i-u)*(t-c)>=(e-u)*(o-c)&&(e-u)*(r-c)>=(n-u)*(t-c)&&(n-u)*(o-c)>=(i-u)*(r-c)}function Cr(e,t){let n=ot(e,t)&&ue(e.prev,e,e.next)>0&&ue(t.prev,t,t.next)>0;return e.next.i!==t.i&&(n||st(e,t)&&st(t,e)&&(ue(e.prev,e,t.prev)!==0||ue(e,t.prev,t)!==0))&&!Vr(e,t)&&(n||Or(e,t))}function ue(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function ot(e,t){return e.x===t.x&&e.y===t.y}function cn(e,t,n,r,i=!0){let o=ue(e,t,n),u=ue(e,t,r),c=ue(n,r,e),f=ue(n,r,t);return(o>0&&u<0||o<0&&u>0)&&(c>0&&f<0||c<0&&f>0)?!0:i?!!(o===0&&dt(e,n,t)||u===0&&dt(e,r,t)||c===0&&dt(n,e,r)||f===0&&dt(n,t,r)):!1}function dt(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function Vr(e,t){let n=Math.min(e.x,t.x),r=Math.max(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.y,t.y),u=e;do{let c=u.next;if(u.x>r&&c.x>r||u.x<n&&c.x<n||u.y>o&&c.y>o||u.y<i&&c.y<i){u=c;continue}if(u.i!==e.i&&c.i!==e.i&&u.i!==t.i&&c.i!==t.i&&cn(u,c,e,t))return!0;u=c}while(u!==e);return!1}function st(e,t){return ue(e.prev,e,e.next)<0?ue(e,t,e.next)>=0&&ue(e,e.prev,t)>=0:ue(e,t,e.prev)<0||ue(e,e.next,t)<0}function Or(e,t){let n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{let u=n.next;n.y>o!=u.y>o&&i<(u.x-n.x)*(o-n.y)/(u.y-n.y)+n.x&&(r=!r),n=u}while(n!==e);return r}function fn(e,t){let n=At(e.i,e.x,e.y),r=At(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function on(e,t,n,r){let i=At(e,t,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 ut(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),It&&kr(e.prev,e.next)}function At(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null}}function Ur(e,t,n,r){let i=0;for(let o=t,u=n-r;o<n;o+=r)i+=(e[u]-e[o])*(e[o+1]+e[u+1]),u=o;return i}var an=23283064365386963e-26,Dr=12,hn=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),Bt=0,yt=1,lt=2,bt=5,ct=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,n,r=this.length){for(;this.pos<r;){let i=this.readVarint(),o=i>>3,u=this.pos;this.type=i&7,t(o,n,this),this.pos===u&&this.skip(i)}return n}readMessage(t,n){return this.readFields(t,n,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){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,Gr(r,t,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let t=this.readVarint();return t%2===1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=Dr&&hn?hn.decode(this.buf.subarray(n,t)):qr(this.buf,n,t)}readBytes(){let t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n}readPackedVarint(t=[],n){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readVarint(n));return t}readPackedSVarint(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===lt?this.readVarint()+this.pos:this.pos+1}skip(t){let n=t&7;if(n===Bt)for(;this.buf[this.pos++]>127;);else if(n===lt)this.pos=this.readVarint()+this.pos;else if(n===bt)this.pos+=4;else if(n===yt)this.pos+=8;else throw new Error(`Unimplemented type: ${n}`)}writeTag(t,n){this.writeVarint(t<<3|n)}realloc(t){let n=this.length||16;for(;n<this.pos+t;)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(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*an),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*an),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>268435455||t<0){Nr(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let n=this.pos;this.pos=ei(this.buf,t,this.pos);let r=this.pos-n;r>=128&&pn(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let n=t.length;this.writeVarint(n),this.realloc(n);for(let r=0;r<n;r++)this.buf[this.pos++]=t[r]}writeRawMessage(t,n){this.pos++;let r=this.pos;t(n,this);let i=this.pos-r;i>=128&&pn(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(t,n,r){this.writeTag(t,lt),this.writeRawMessage(n,r)}writePackedVarint(t,n){n.length&&this.writeMessage(t,jr,n)}writePackedSVarint(t,n){n.length&&this.writeMessage(t,$r,n)}writePackedBoolean(t,n){n.length&&this.writeMessage(t,Zr,n)}writePackedFloat(t,n){n.length&&this.writeMessage(t,Xr,n)}writePackedDouble(t,n){n.length&&this.writeMessage(t,Yr,n)}writePackedFixed32(t,n){n.length&&this.writeMessage(t,Wr,n)}writePackedSFixed32(t,n){n.length&&this.writeMessage(t,Qr,n)}writePackedFixed64(t,n){n.length&&this.writeMessage(t,Kr,n)}writePackedSFixed64(t,n){n.length&&this.writeMessage(t,Jr,n)}writeBytesField(t,n){this.writeTag(t,lt),this.writeBytes(n)}writeFixed32Field(t,n){this.writeTag(t,bt),this.writeFixed32(n)}writeSFixed32Field(t,n){this.writeTag(t,bt),this.writeSFixed32(n)}writeFixed64Field(t,n){this.writeTag(t,yt),this.writeFixed64(n)}writeSFixed64Field(t,n){this.writeTag(t,yt),this.writeSFixed64(n)}writeVarintField(t,n){this.writeTag(t,Bt),this.writeVarint(n)}writeSVarintField(t,n){this.writeTag(t,Bt),this.writeSVarint(n)}writeStringField(t,n){this.writeTag(t,lt),this.writeString(n)}writeFloatField(t,n){this.writeTag(t,bt),this.writeFloat(n)}writeDoubleField(t,n){this.writeTag(t,yt),this.writeDouble(n)}writeBooleanField(t,n){this.writeVarintField(t,+n)}};function Gr(e,t,n){let r=n.buf,i,o;if(o=r[n.pos++],i=(o&112)>>4,o<128||(o=r[n.pos++],i|=(o&127)<<3,o<128)||(o=r[n.pos++],i|=(o&127)<<10,o<128)||(o=r[n.pos++],i|=(o&127)<<17,o<128)||(o=r[n.pos++],i|=(o&127)<<24,o<128)||(o=r[n.pos++],i|=(o&1)<<31,o<128))return Xe(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function Xe(e,t,n){return n?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function Nr(e,t){let n,r;if(e>=0?(n=e%4294967296|0,r=e/4294967296|0):(n=~(-e%4294967296),r=~(-e/4294967296),n^4294967295?n=n+1|0:(n=0,r=r+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn\'t fit into 10 bytes");t.realloc(10),Hr(n,r,t),zr(r,t)}function Hr(e,t,n){n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos++]=e&127|128,e>>>=7,n.buf[n.pos]=e&127}function zr(e,t){let n=(e&7)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function pn(e,t,n){let r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));n.realloc(r);for(let i=n.pos-1;i>=e;i--)n.buf[i+r]=n.buf[i]}function jr(e,t){for(let n=0;n<e.length;n++)t.writeVarint(e[n])}function $r(e,t){for(let n=0;n<e.length;n++)t.writeSVarint(e[n])}function Xr(e,t){for(let n=0;n<e.length;n++)t.writeFloat(e[n])}function Yr(e,t){for(let n=0;n<e.length;n++)t.writeDouble(e[n])}function Zr(e,t){for(let n=0;n<e.length;n++)t.writeBoolean(e[n])}function Wr(e,t){for(let n=0;n<e.length;n++)t.writeFixed32(e[n])}function Qr(e,t){for(let n=0;n<e.length;n++)t.writeSFixed32(e[n])}function Kr(e,t){for(let n=0;n<e.length;n++)t.writeFixed64(e[n])}function Jr(e,t){for(let n=0;n<e.length;n++)t.writeSFixed64(e[n])}function qr(e,t,n){let r="",i=t;for(;i<n;){let o=e[i],u=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c>n)break;let f,h,m;c===1?o<128&&(u=o):c===2?(f=e[i+1],(f&192)===128&&(u=(o&31)<<6|f&63,u<=127&&(u=null))):c===3?(f=e[i+1],h=e[i+2],(f&192)===128&&(h&192)===128&&(u=(o&15)<<12|(f&63)<<6|h&63,(u<=2047||u>=55296&&u<=57343)&&(u=null))):c===4&&(f=e[i+1],h=e[i+2],m=e[i+3],(f&192)===128&&(h&192)===128&&(m&192)===128&&(u=(o&15)<<18|(f&63)<<12|(h&63)<<6|m&63,(u<=65535||u>=1114112)&&(u=null))),u===null?(u=65533,c=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|u&1023),r+=String.fromCharCode(u),i+=c}return r}function ei(e,t,n){for(let r=0,i,o;r<t.length;r++){if(i=t.charCodeAt(r),i>55295&&i<57344)if(o)if(i<56320){e[n++]=239,e[n++]=191,e[n++]=189,o=i;continue}else i=o-55296<<10|i-56320|65536,o=null;else{i>56319||r+1===t.length?(e[n++]=239,e[n++]=191,e[n++]=189):o=i;continue}else o&&(e[n++]=239,e[n++]=191,e[n++]=189,o=null);i<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:(i<65536?e[n++]=i>>12|224:(e[n++]=i>>18|240,e[n++]=i>>12&63|128),e[n++]=i>>6&63|128),e[n++]=i&63|128)}return n}var Lt=class e{constructor(t,n,r,i){this.pbf=t;this.keys=n;this.values=r;this.extent=i;this.type=0;this.properties={};this.geomOffset=-1}static read(t,n,r,i,o){let u=new e(t,r,i,o);return t.readFields(ti,u,n),u}loadGeometry(){if(this.geomOffset<0)return[];let t=this.pbf,n=t.pos;t.pos=this.geomOffset;let r=t.readVarint()+t.pos,i=1,o=0,u=0,c=0,f=[],h=[];for(;t.pos<r;){if(o<=0){let m=t.readVarint();i=m&7,o=m>>3}if(o--,i===1||i===2)u+=t.readSVarint(),c+=t.readSVarint(),i===1&&(h.length&&f.push(h),h=[]),h.push(u,c);else if(i===7)h.length>=2&&h.push(h[0],h[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 h.length&&f.push(h),t.pos=n,f}bbox(){let t=this.loadGeometry(),n=1/0,r=1/0,i=-1/0,o=-1/0;for(let u of t)for(let c=0;c<u.length;c+=2)u[c]<n&&(n=u[c]),u[c]>i&&(i=u[c]),u[c+1]<r&&(r=u[c+1]),u[c+1]>o&&(o=u[c+1]);return[n,r,i,o]}};function ti(e,t,n){n&&(e===1?t.id=n.readVarint():e===2?ni(n,t):e===3?t.type=n.readVarint():e===4&&(t.geomOffset=n.pos,n.skip(2)))}function ni(e,t){let n=e.readVarint()+e.pos;for(;e.pos<n;){let r=t.keys[e.readVarint()],i=t.values[e.readVarint()];r!==void 0&&(t.properties[r]=i)}}var Tt=class e{constructor(t){this.pbf=t;this.version=1;this.name="";this.extent=4096;this.featureOffsets=[];this.keys=[];this.values=[]}static read(t,n){let r=new e(t);return t.readFields(ri,r,n),r}get length(){return this.featureOffsets.length}feature(t){let n=this.pbf;n.pos=this.featureOffsets[t];let r=n.readVarint()+n.pos;return Lt.read(n,r,this.keys,this.values,this.extent)}*features(){for(let t=0;t<this.featureOffsets.length;t++)yield this.feature(t)}};function ri(e,t,n){n&&(e===15?t.version=n.readVarint():e===1?t.name=n.readString():e===5?t.extent=n.readVarint():e===2?t.featureOffsets.push(n.pos):e===3?t.keys.push(n.readString()):e===4&&t.values.push(ii(n)))}function ii(e){let t=e.readVarint()+e.pos,n=null;for(;e.pos<t;){let r=e.readVarint()>>3;r===1?n=e.readString():r===2?n=e.readFloat():r===3?n=e.readDouble():r===4?n=e.readVarint64():r===5?n=e.readVarint():r===6?n=e.readSVarint():r===7?n=e.readBoolean():e.skip(r)}return n}var wt=class{constructor(t){this.layers={};new ct(t instanceof Uint8Array?t:new Uint8Array(t)).readFields((r,i,o)=>{if(r===3&&o){let u=Tt.read(o,o.readVarint()+o.pos);u.length&&(this.layers[u.name]=u)}},null)}};function Ye(e){let t=[],n=null;for(let r of e){if(r.length<6)continue;let i=oi(r);i!==0&&(i>0?(n&&t.push(n),n={outer:r,holes:[]}):n&&n.holes.push(r))}return n&&t.push(n),t}function oi(e){let t=0;for(let n=0,r=e.length-2;n<e.length;r=n,n+=2)t+=(e[r]-e[n])*(e[n+1]+e[r+1]);return t/2}function pe(e,t){if(!e)return!0;let n=e[0];switch(n){case"all":return e.slice(1).every(r=>pe(r,t));case"any":return e.slice(1).some(r=>pe(r,t));case"!":return!pe(e[1],t);case"has":return t[e[1]]!=null;case"!has":return t[e[1]]==null;case"in":{let r=t[e[1]];return r==null?!1:e.slice(2).includes(r)}case"!in":{let r=t[e[1]];return r==null?!0:!e.slice(2).includes(r)}default:{let r=t[e[1]],i=e[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 si=Math.PI/8,ui=.35,li=32,dn=.25,xn=.5,gn=.07;function Ce(e,t){let n=t.radius;if(!(n>0))return e;let r=e.length/2-1;if(r<3)return e;let i=Math.max(2,Math.round(t.segments??4)),o=Math.max(t.minCutRatio??ui,0),u=t.extent,c=[];for(let f=0;f<r;f++){let h=e[f*2],m=e[f*2+1],g=e[(f+r-1)%r*2],x=e[(f+r-1)%r*2+1],v=e[(f+1)%r*2],S=e[(f+1)%r*2+1],P=h-g,_=m-x,I=v-h,A=S-m,k=Math.hypot(P,_),L=Math.hypot(I,A);if(k<1e-6||L<1e-6){c.push(h,m);continue}let V=P/k,U=_/k,N=I/L,T=A/L;if(t.keep?.[f]){c.push(h,m);continue}let j=V*N+U*T;if(j>.985){c.push(h,m);continue}if(u!==void 0&&(h<=0||h>=u||m<=0||m>=u)){c.push(h,m);continue}let Y=Math.min(n,k*mn,L*mn);if(Y<n*o){c.push(h,m);continue}let $=h-V*Y,O=m-U*Y,G=h+N*Y,W=m+T*Y,D=Math.acos(Math.max(-1,Math.min(1,j))),Q=Math.min(si,Math.PI/2/i),oe=Math.ceil(D/Q-1e-6),ee=t.maxChord&&t.maxChord>0?Math.ceil(Y/Math.tan(D/2)*D/t.maxChord):0,ne=Math.max(1,Math.min(li,Math.max(Math.min(i,oe),ee)));c.push($,O);for(let Z=1;Z<ne;Z++){let le=Z/ne,K=1-le;c.push(K*K*$+2*K*le*h+le*le*G,K*K*O+2*K*le*m+le*le*W)}c.push(G,W)}return c.length<6?e:(c.push(c[0],c[1]),c)}var mn=.4;var we=e=>e/64;function Ve(e,t,n=0){let r=yn(e.outer,t,n);if(!r)return null;let i=[];for(let o of e.holes){let u=yn(o,t,n);u&&i.push(u)}return{outer:r,holes:i}}function yn(e,t,n){let r=[];for(let i=0;i<e.length-2;i+=2)r.push(e[i],e[i+1]);if(r.length<6)return null;for(let i=0;i<4;i++){let o=r;r=[];let u=o.length/2;if(u===0)return null;for(let c=0;c<u;c++){let f=o[c*2],h=o[c*2+1],m=o[(c+u-1)%u*2],g=o[(c+u-1)%u*2+1],x=bn(f,h,i,t,n),v=bn(m,g,i,t,n);if(x!==v){let S=ci(m,g,f,h,i,t,n),P=i===0?-n:i===1?t+n:m+(f-m)*S,_=i===2?-n:i===3?t+n:g+(h-g)*S;r.push(P,_)}x&&r.push(f,h)}}return r.length<6?null:(r.push(r[0],r[1]),r)}function bn(e,t,n,r,i){return n===0?e>=-i:n===1?e<=r+i:n===2?t>=-i:t<=r+i}function ci(e,t,n,r,i,o,u){return i===0?(-u-e)/(n-e):i===1?(o+u-e)/(n-e):i===2?(-u-t)/(r-t):(o+u-t)/(r-t)}function vt(e,t,n,r,i,o=0){let u=-o,c=i+o;return e===u&&n===u||e===c&&n===c||t===u&&r===u||t===c&&r===c}function Ct(e,t){for(let n=0;n<e.length;n+=2)if(e[n]<=0||e[n]>=t||e[n+1]<=0||e[n+1]>=t)return!0;return!1}var wn=1,Ut=18,Dt=32,vn=8,kn=65535/Dt,fi=9,ai=1,hi=0,pi=1,mi=2;var Sn=0,di=1,Mn=2,xi=3,gi=.47;function _n(e,t,n,r={},i){let o=r.metersPerUnit&&r.metersPerUnit>0?r.metersPerUnit:gi,{b:u,ensure:c,take:f}=yi(Math.max(1024,e.length*48));for(let h of e.features()){if(h.type!==3||!pe(n,h.properties))continue;let m=Di(h.properties),g=Gi(h.properties,m);if(m<=g)continue;let x=Hi(h.properties)??Number(h.id??0),v=Ui(x>>>0),S=Oi(v,h.properties),P=Vi(h.properties,m),_=Ye(h.loadGeometry()),I=i?_.some(A=>{let k=Ve(A,t,we(t));return k?Ct(k.outer,t):!1}):!1;for(let A of _){if(i&&I){let k=ji(A,t,m,g,x,v,S,P);k&&i.push(k)}zi(u,A,c,{extent:t,metersPerUnit:o,height:m,minHeight:g,featureId:x,seed:v,tint:S,facade:P,props:h.properties,cornerRadius:r.cornerRadius??0,cornerSegments:r.cornerSegments,whole:!1})}}return f(t)}function yi(e){let t=e,n=new ArrayBuffer(t*Ut),r={verts:new DataView(n),vertsU8:new Uint8Array(n),vertOffset:0,vertexCount:0,indices:[],featureIds:[],ensure:()=>{}},i=u=>{if(r.vertexCount+u<=t)return;t=Math.max(t*2,r.vertexCount+u);let c=new ArrayBuffer(t*Ut);new Uint8Array(c).set(r.vertsU8.subarray(0,r.vertOffset)),n=c,r.verts=new DataView(c),r.vertsU8=new Uint8Array(c)};return r.ensure=i,{b:r,ensure:i,take:u=>{if(!r.indices.length)return null;let c=new Uint32Array(r.indices),f=new Float64Array(r.featureIds);return{vertices:n.slice(0,r.vertOffset),indices:c.buffer,featureIds:f.buffer,vertexCount:r.vertexCount,indexCount:c.length,extent:u}}}}var Gt=(e,t)=>e|t<<2,En=e=>Math.max(-32768,Math.min(32767,e)),Vt=e=>Math.max(0,Math.min(65535,Math.round(Math.min(e,kn)*Dt)));function Ze(e,t,n,r,i,o,u,c,f,h,m=0,g=0,x=0){let v=e.vertOffset;return e.verts.setInt16(v,En(Math.round(t*vn)),!0),e.verts.setInt16(v+2,En(Math.round(n*vn)),!0),e.verts.setUint16(v+4,Math.round(Math.min(r,kn)*Dt),!0),e.vertsU8[v+6]=f,e.vertsU8[v+7]=c,e.verts.setInt8(v+8,Ot(Math.round(i*127))),e.verts.setInt8(v+9,Ot(Math.round(o*127))),e.verts.setInt8(v+10,Ot(Math.round(u*127))),e.vertsU8[v+11]=h,e.verts.setUint16(v+12,Vt(m),!0),e.verts.setUint16(v+14,Vt(g),!0),e.verts.setUint16(v+16,Vt(x),!0),e.vertOffset+=Ut,e.vertexCount++}function Rn(e,t,n,r,i,o,u,c,f,h){let m=t.length/2;if(m<3)return;let g=Gt(hi,u),x=wi(t,c),v=r-n,S=new Float64Array(m*2),P=new Uint8Array(m);{let _=new Float64Array(m*2);for(let I=0;I<m-1;I++){let A=t[I*2+2]-t[I*2],k=t[I*2+3]-t[I*2+1],L=Math.hypot(A,k)||1;_[I*2]=k/L,_[I*2+1]=-A/L}for(let I=0;I<m-1;I++){let A=(I+m-2)%(m-1),k=_[A*2]*_[I*2]+_[A*2+1]*_[I*2+1],L=_[A*2]+_[I*2],V=_[A*2+1]+_[I*2+1],U=Math.hypot(L,V);k>.5&&U>1e-6&&(S[I*2]=L/U,S[I*2+1]=V/U,P[I]=1)}}for(let _=0;_<m-1;_++){let I=t[_*2],A=t[_*2+1],k=t[_*2+2],L=t[_*2+3];if(I===k&&A===L||h[_])continue;let V=k-I,U=L-A,N=Math.hypot(V,U)||1,T=U/N,j=-V/N,Y=x.offset[_],$=x.width[_],O=[0,1];if(f){for(let W=0;W<f.length;W++)for(let D=W+1;D<f.length;D++){let Q=je(f[W],I,A)-je(f[D],I,A),oe=je(f[W],k,L)-je(f[D],k,L);if(Q===oe)continue;let ee=Q/(Q-oe);ee>1e-4&&ee<1-1e-4&&O.push(ee)}O.sort((W,D)=>W-D)}let G=(W,D)=>{if(!f)return r;let Q=1/0;for(let oe of f)Q=Math.min(Q,je(oe,W,D));return Math.max(r,Q)};for(let W=0;W+1<O.length;W++){let D=O[W],Q=O[W+1];if(Q-D<1e-6)continue;let oe=I+V*D,ee=A+U*D,ne=I+V*Q,Z=A+U*Q,le=Y+N*D*c,K=Y+N*Q*c,q=(_+1)%(m-1),he=P[_]?S[_*2]:T,me=P[_]?S[_*2+1]:j,ce=P[q]?S[q*2]:T,fe=P[q]?S[q*2+1]:j,ae=T+(he-T)*(1-D),de=j+(me-j)*(1-D),Se=T+(ce-T)*Q,Fe=j+(fe-j)*Q,re=Math.hypot(ae,de)||1,Ue=Math.hypot(Se,Fe)||1,ve=ae/re,De=de/re,Ie=Se/Ue,Le=Fe/Ue;e.ensure(4);let Me=Ze(e,oe,ee,n,ve,De,0,0,o,g,le,$,v),Ge=Ze(e,ne,Z,n,Ie,Le,0,0,o,g,K,$,v),$e=Ze(e,oe,ee,G(oe,ee),ve,De,0,255,o,g,le,$,v),Ne=Ze(e,ne,Z,G(ne,Z),Ie,Le,0,255,o,g,K,$,v);e.indices.push(Me,Ne,Ge,Me,$e,Ne),e.featureIds.push(i,i)}}}var bi=.9976;function wi(e,t){let n=e.length/2-1,r=[];for(let f=0;f<n;f++){let h=e[f*2+2]-e[f*2],m=e[f*2+3]-e[f*2+1],g=Math.hypot(h,m);r.push(g>0?{x:h/g,y:m/g,len:g*t}:{x:0,y:0,len:0})}let i=(f,h)=>r[f].len>0&&r[h].len>0&&r[f].x*r[h].x+r[f].y*r[h].y>=bi,o=0;for(;o<n&&i((o-1+n)%n,o);)o++;o>=n&&(o=0);let u=new Array(n).fill(0),c=new Array(n).fill(0);for(let f=0;f<n;){let h=(o+f)%n,m=[h],g=r[h].len,x=f+1;for(;x<n;){let S=(o+x)%n;if(!i((o+x-1)%n,S))break;m.push(S),g+=r[S].len,x++}let v=0;for(let S of m)u[S]=v,c[S]=g,v+=r[S].len;f=x}return{offset:u,width:c}}function vi(e,t,n,r,i,o,u){let c=[],f=[];for(let x=0;x<t.length;x++)c.push(t[x]);for(let x of n){f.push(c.length/2);for(let v=0;v<x.length;v++)c.push(x[v])}let h=Oe(c,f.length?f:void 0,2);if(!h.length)return;let m=Gt(pi,u),g=e.vertexCount;for(let x=0;x<c.length;x+=2)Ze(e,c[x],c[x+1],r,0,0,1,255,o,m);for(let x=0;x<h.length;x+=3)e.indices.push(g+h[x],g+h[x+2],g+h[x+1]),e.featureIds.push(i)}function Si(e){let t=Mi(e);if(t.length<3)return null;let n=Math.abs(Ei(e));if(n<=0)return null;let r=null,i=1/0;for(let o=0;o<t.length;o++){let u=(o+1)%t.length,c=t[u].x-t[o].x,f=t[u].y-t[o].y,h=Math.hypot(c,f);if(h<1e-6)continue;c/=h,f/=h;let m=1/0,g=-1/0,x=1/0,v=-1/0;for(let L of t){let V=L.x*c+L.y*f,U=-L.x*f+L.y*c;V<m&&(m=V),V>g&&(g=V),U<x&&(x=U),U>v&&(v=U)}let S=g-m,P=v-x,_=S*P;if(_<=0||_>=i)continue;i=_;let I=(m+g)/2,A=(x+v)/2,k=S>=P;r={cx:I*c-A*f,cy:I*f+A*c,ax:k?c:-f,ay:k?f:c,halfLong:(k?S:P)/2,halfShort:(k?P:S)/2,fill:n/_}}return r}function Mi(e){let t=[];for(let o=0;o<e.length-2;o+=2)t.push({x:e[o],y:e[o+1]});if(t.length<3)return t;t.sort((o,u)=>o.x===u.x?o.y-u.y:o.x-u.x);let n=(o,u,c)=>(u.x-o.x)*(c.y-o.y)-(u.y-o.y)*(c.x-o.x),r=[];for(let o of t){for(;r.length>=2&&n(r[r.length-2],r[r.length-1],o)<=0;)r.pop();r.push(o)}let i=[];for(let o=t.length-1;o>=0;o--){let u=t[o];for(;i.length>=2&&n(i[i.length-2],i[i.length-1],u)<=0;)i.pop();i.push(u)}return r.pop(),i.pop(),r.concat(i)}function Ei(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var Ri=Math.tan(30*Math.PI/180),Fi=3.5,Ii=.9;function Pi(e,t,n,r,i){if(t.fill<.86)return null;let o=t.halfShort*2*i,u=t.halfLong*2*i,c=o*u,f=t.halfShort>0?t.halfLong/t.halfShort:99,h=ki(e);if(!h){if(n>15||c>600||o<3)return null;let m=r%1e3/1e3;c<30?h=m<.5?"skillion":"gabled":f<1.25?h=m<.35?"pyramidal":"hipped":h=m<.8?"gabled":"hipped"}return h==="flat"?null:{shape:h}}function ki(e){let t=String(e.roof_shape??e["roof:shape"]??"").toLowerCase();return t?t==="flat"?"flat":t==="skillion"||t==="lean_to"||t==="shed"?"skillion":t==="hipped"||t==="half-hipped"||t==="gambrel"?"hipped":t==="pyramidal"||t==="dome"||t==="conical"||t==="onion"?"pyramidal":t==="gabled"||t==="mansard"||t==="round"?"gabled":null:null}var je=(e,t,n)=>e.a*t+e.b*n+e.c;function _i(e,t,n,r){let i=e.length/2;if(i<3)return[];let o=[],u=c=>[e[c*2],e[c*2+1]];for(let c=0;c<i;c++){let[f,h]=u(c),[m,g]=u((c+i-1)%i),x=t*f+n*h+r,v=t*m+n*g+r;if(x<=0!=v<=0){let S=v/(v-x);o.push(m+(f-m)*S,g+(h-g)*S)}x<=0&&o.push(f,h)}return o}function Ai(e,t){let n=.5/Math.max(t,1e-6),r=e.length/2-1;if(r<5)return e;let i=[],o=0;i.push(e[0],e[1]);for(let u=1;u<r;u++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1],g=h-c,x=m-f,v=Math.hypot(g,x),S=v>1e-6;if(S){for(let P=o+1;P<u;P++)if(Math.abs((e[P*2]-c)*x-(e[P*2+1]-f)*g)/v>=n){S=!1;break}}S||(i.push(e[(u-1)*2],e[(u-1)*2+1]),o=u-1)}return i.length/2<3?e:(i.push(i[0],i[1]),i)}function An(e,t,n){let{ax:r,ay:i,halfLong:o}=t;if(n==="skillion"){let f=-i,h=r;return[{a:f,b:h,c:-(f*t.cx+h*t.cy)+t.halfShort}]}let u=[],c=e.length/2-1;for(let f=0;f<c;f++){let h=e[f*2],m=e[f*2+1],g=e[(f+1)%c*2],x=e[(f+1)%c*2+1],v=g-h,S=x-m,P=Math.hypot(v,S);if(P<1e-6||n==="gabled"&&Math.abs((v*r+S*i)/P)<.86)continue;let _=-S/P,I=v/P;u.push({a:_,b:I,c:-(_*h+I*m)})}return!u.length&&o>0?An(e,t,"hipped"):u}function Bi(e,t){let n=[];for(let i=0;i<t.length-2;i+=2)n.push(t[i],t[i+1]);if(n.length<6)return[];let r=[];for(let i=0;i<e.length;i++){let o=n;for(let u=0;u<e.length&&o.length>=6;u++)u!==i&&(o=_i(o,e[i].a-e[u].a,e[i].b-e[u].b,e[i].c-e[u].c));r.push(o.length>=6?o:[])}return r}function Li(e,t){let n=0;for(let r=0;r<t.length;r++){let i=t[r];for(let o=0;o<i.length;o+=2){let u=je(e[r],i[o],i[o+1]);u>n&&(n=u)}}return n}function Ti(e,t,n){return e.map(r=>({a:r.a*t,b:r.b*t,c:r.c*t+n}))}function Ci(e,t,n,r,i,o,u,c){let f=Gt(mi,u);for(let h=0;h<n.length;h++){let m=t[h];if(!m||m.length<6)continue;let g=Oe(m,void 0,2);if(!g.length)continue;let x=-n[h].a/c,v=-n[h].b/c,S=Math.hypot(x,v,1),P={x:x/S,y:v/S,z:1/S};e.ensure(m.length/2);let _=e.vertexCount;for(let I=0;I<m.length;I+=2){let A=Math.max(r,je(n[h],m[I],m[I+1]));Ze(e,m[I],m[I+1],A,P.x,P.y,P.z,255,o,f)}for(let I=0;I<g.length;I+=3)e.indices.push(_+g[I],_+g[I+2],_+g[I+1]),e.featureIds.push(i)}}function Vi(e,t){let n=String(e.class??"").toLowerCase();return n==="industrial"||n==="warehouse"||n==="hangar"||n==="construction"?xi:n==="commercial"||n==="office"||n==="retail"||n==="supermarket"?Mn:n==="house"||n==="detached"||n==="garage"||n==="hut"||n==="shed"||t<=7?Sn:t>=40?Mn:di}function Oi(e,t){let n=String(t.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+(e%121-60)))}function Ui(e){let t=e>>>0;return t=(t>>>16^t)*73244475,t=(t>>>16^t)*73244475,t=t>>>16^t,t>>>0}function Di(e){let t=We(e.render_height)??We(e.height)??Ni(e.levels??e.building_levels??e["building:levels"]);return t&&t>0?Math.max(t,ai):fi}function Gi(e,t){let n=We(e.render_min_height)??We(e.min_height)??We(e.base)??0;return n>0&&n<t?n:0}function Ni(e){let t=We(e);return t&&t>0?t*3:null}function We(e){if(typeof e=="number"&&isFinite(e))return e;if(typeof e=="string"){let t=parseFloat(e);if(isFinite(t))return t}return null}var Ot=e=>e>127?127:e<-127?-127:e;function Hi(e){let t=e.osm_id;if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){let n=Number(t);if(Number.isFinite(n))return n}return null}function Fn(e,t){let n=e.length/2-1,r=new Array(Math.max(n,0)).fill(!1);if(n<3)return{ring:e,cut:r};let i=(u,c)=>u===0?1:u===t?2:c===0?3:c===t?4:0,o=e.slice();for(let u=0;u<n;u++){let c=e[u*2],f=e[u*2+1],h=i(c,f);if(!h)continue;let m=(u+n-1)%n,g=(u+1)%n,x=i(e[m*2],e[m*2+1])===h,v=i(e[g*2],e[g*2+1])===h;v&&(r[u]=!0);let S=x===v?-1:x?g:m;if(S<0)continue;let P=c-e[S*2],_=f-e[S*2+1],I=Math.hypot(P,_);I<1e-6||(o[u*2]=c+P/I*wn,o[u*2+1]=f+_/I*wn)}return o[n*2]=o[0],o[n*2+1]=o[1],{ring:o,cut:r}}function zi(e,t,n,r){let{extent:i,metersPerUnit:o,height:u,minHeight:c,featureId:f,seed:h,tint:m,facade:g}=r,x=r.whole?t:Ve(t,i,we(i));if(!x)return;let v=r.cornerRadius/o,S={radius:v,segments:r.cornerSegments,minCutRatio:0,maxChord:o>0?xn/o:0,...r.whole?{}:{extent:i,margin:we(i)}},P=v>0?{outer:Ce(x.outer,S),holes:x.holes.map($=>Ce($,S))}:x,_=r.whole?P:Ve(P,i);if(!_)return;let I=$=>({ring:$,cut:new Array(Math.max($.length/2-1,0)).fill(!1)}),A=r.whole?I(_.outer):Fn(_.outer,i),k=_.holes.map($=>r.whole?I($):Fn($,i)),L={outer:A.ring,holes:k.map($=>$.ring)},V=r.whole?!0:Ct(L.outer,i),U=L.outer.length/2+L.holes.reduce(($,O)=>$+O.length/2,0);n(U*5+32);let N=L.holes.length||V?null:Si(L.outer),T=N?Pi(r.props,N,u,h,o):null,j=null,Y=[];if(T&&N){let $=An(Ai(L.outer,o),N,T.shape);Y=Bi($,L.outer);let O=Li($,Y);if(O>1e-6){let G=Math.min(Math.max(O*o*Ri,Ii),Fi);j=Ti($,G/O,u)}}Rn(e,L.outer,c,u,f,m,g,o,j,A.cut);for(let $=0;$<L.holes.length;$++)Rn(e,L.holes[$],c,u,f,m,g,o,null,k[$].cut);j?Ci(e,Y,j,u,f,m,g,o):vi(e,L.outer,L.holes,u,f,m,g)}function In(e,t){let n=we(t),r=Math.max(e.length/2-1,0),i=new Array(r);for(let o=0;o<r;o++)i[o]=vt(e[o*2],e[o*2+1],e[o*2+2],e[o*2+3],t,n);return i}function ji(e,t,n,r,i,o,u,c){let f=Ve(e,t,we(t));if(!f)return null;let h=In(f.outer,t);return{osmId:i,height:n,minHeight:r,seed:o,tint:u,facade:c,outer:f.outer,holes:f.holes,outerCut:h,holeCuts:f.holes.map(m=>In(m,t))}}function Nt(e,t,n,r,i){let o=r*r,u=[],c=m=>e[m*2],f=m=>e[m*2+1],h=(m,g)=>{let x=e.length/2;return e.push((c(m)+c(g))/2,(f(m)+f(g))/2),x};for(let m=0;m<t.length;m+=3){u.push([n+t[m],n+t[m+1],n+t[m+2]]);let g=0;for(;u.length&&!(++g>2e4);){let[x,v,S]=u.pop(),P=(c(x)-c(v))**2+(f(x)-f(v))**2,_=(c(v)-c(S))**2+(f(v)-f(S))**2,I=(c(S)-c(x))**2+(f(S)-f(x))**2,A=Math.max(P,_,I);if(A<=o){i.push(x,v,S);continue}if(A===P){let k=h(x,v);u.push([x,k,S],[k,v,S])}else if(A===_){let k=h(v,S);u.push([v,k,x],[k,S,x])}else{let k=h(S,x);u.push([S,k,v],[k,x,v])}}}}function Bn(e,t,n=0,r,i=!1,o=4096){let u=[],c=[],f=[];for(let v of e.features()){if(v.type!==3||!pe(t,v.properties))continue;let S=v.properties.osm_id,P=typeof S=="number"?S:typeof S=="string"?Number(S):NaN,_=Number.isFinite(P)?P:Number(v.id??0);for(let I of Ye(v.loadGeometry())){let A=i?Ve(I,o):I;if(!A)continue;let k=[],L=[],V=r?Ce(A.outer,r):A.outer;for(let T=0;T<V.length;T++)k.push(V[T]);for(let T of A.holes){let j=r?Ce(T,r):T;L.push(k.length/2);for(let Y=0;Y<j.length;Y++)k.push(j[Y])}let U=Oe(k,L.length?L:void 0,2);if(!U.length)continue;let N=u.length/2;for(let T=0;T<k.length;T++)u.push(k[T]);if(n>0){let T=[];Nt(u,U,N,n,T);for(let j=0;j<T.length;j+=3)c.push(T[j],T[j+2],T[j+1]),f.push(_);continue}for(let T=0;T<U.length;T+=3)c.push(N+U[T],N+U[T+2],N+U[T+1]),f.push(_)}}if(!c.length)return null;let h=u.length/2,m=new Int16Array(u),g=new Uint32Array(c);return{featureIds:new Float64Array(f).buffer,vertices:m.buffer,indices:g.buffer,vertexCount:h,indexCount:g.length}}function Tn(e){return{shapes:[],cells:[],extent:0,metersPerTile:e}}function Cn(e,t,n,r){if(!(n<=0)){e.extent=r;for(let i of t){let o=i.outer;if(o.length<6)continue;let u=1/0,c=1/0,f=-1/0,h=-1/0;for(let m=0;m<o.length;m+=2)o[m]<u&&(u=o[m]),o[m]>f&&(f=o[m]),o[m+1]<c&&(c=o[m+1]),o[m+1]>h&&(h=o[m+1]);e.shapes.push({outer:o,holes:i.holes,level:n,minX:u,minY:c,maxX:f,maxY:h})}e.cells=[]}}function $i(e){e.cells=Array.from({length:32*32},()=>[]);let t=e.extent/32;for(let n=0;n<e.shapes.length;n++){let r=e.shapes[n],i=Qe(Math.floor(r.minX/t)),o=Qe(Math.floor(r.maxX/t)),u=Qe(Math.floor(r.minY/t)),c=Qe(Math.floor(r.maxY/t));for(let f=u;f<=c;f++)for(let h=i;h<=o;h++)e.cells[f*32+h].push(n)}}var Vn=e=>e.shapes.length===0;function Ht(e,t,n){!e.cells.length&&e.shapes.length&&$i(e);let r=e.extent/32,i=e.cells[Qe(Math.floor(n/r))*32+Qe(Math.floor(t/r))];if(!i||!i.length)return 0;let o=0;for(let u of i){let c=e.shapes[u];if(c.level<=o||t<c.minX||t>c.maxX||n<c.minY||n>c.maxY||!Ln(c.outer,t,n))continue;let f=!1;for(let h of c.holes)if(Ln(h,t,n)){f=!0;break}f||(o=c.level)}return Math.min(Math.round(o*100),127)}function On(e,t){let n=[],r=[],i=e.extent>0?e.metersPerTile/e.extent:0,o=i>0?2/i:0,u=Ht(e,t[0],t[1]);n.push(t[0],t[1]),r.push(u);for(let c=0;c+3<t.length;c+=2){let f=t[c],h=t[c+1],m=t[c+2],g=t[c+3],x=Ht(e,m,g);if(x!==u&&o>0){let v=Math.hypot(m-f,g-h),S=Math.min(Math.ceil(v/o),64),P=u;for(let _=1;_<S;_++){let I=_/S,A=f+(m-f)*I,k=h+(g-h)*I,L=Ht(e,A,k);L!==P&&(n.push(A,k),r.push(L),P=L)}}n.push(m,g),r.push(x),u=x}return{pts:n,levels:r}}var Qe=e=>e<0?0:e>31?31:e;function Ln(e,t,n){let r=!1,i=e.length/2;for(let o=0,u=i-1;o<i;u=o++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1];f>n!=m>n&&t<(h-c)*(n-f)/(m-f)+c&&(r=!r)}return r}var Xi=wr(Un(),1),Dn=Xi,$t=Dn.union??Dn.default?.union??null;$t||console.warn("[osmgl] polygon-clipping \\u0431\\u0435\\u0437 union \\u2014 \\u043E\\u0431\\u044A\\u0435\\u0434\\u0438\\u043D\\u0435\\u043D\\u0438\\u0435 \\u0444\\u0438\\u0433\\u0443\\u0440 \\u0432\\u044B\\u043A\\u043B\\u044E\\u0447\\u0435\\u043D\\u043E");function Gn(e){let t=[];for(let n=0;n+1<e.length;n+=2)t.push([e[n],e[n+1]]);return t}function Nn(e){let t=[];for(let r of e)t.push(r[0],r[1]);let n=t.length;return n>=4&&(t[0]!==t[n-2]||t[1]!==t[n-1])&&t.push(t[0],t[1]),t}function Hn(e,t,n=0){if(e.length<2)return e;let r=new Map;for(let o of e){let u=o.lift??0,c=r.get(u);c?c.push(o):r.set(u,[o])}let i=[];for(let[o,u]of r){if(u.length<2){i.push(...u);continue}let f=(n>0&&t?u.map(g=>({outer:t(g.outer,-n)??g.outer,holes:g.holes.map(x=>t(x,n)??x)})):u).map(g=>[Gn(g.outer),...g.holes.map(Gn)]),h;try{if(!$t)throw new Error("\\u043D\\u0435\\u0442 union");h=$t(f[0],...f.slice(1))}catch{i.push(...u);continue}let m=h;if(!Array.isArray(m)||m.length===0){i.push(...u);continue}for(let g of m){if(!g.length)continue;let x=Nn(g[0]);if(x.length<8)continue;let v=[];for(let S=1;S<g.length;S++){let P=Nn(g[S]);P.length>=8&&v.push(P)}i.push(o?{outer:x,holes:v,lift:o}:{outer:x,holes:v})}}return i}var Qt=16,Yi=64,Wn=0,Zi=1,zn=2,Wi=3,St=1,Qi=.6;function Qn(e,t,n,r){let i=r.metersPerUnit>0?r.metersPerUnit:.5,o=r.elevation,u=r.base??0,c=Math.max(r.bevel??0,0)/i,f=Math.max(r.bevelDrop??0,0),h=Math.max(r.cornerRadius??0,0)/i,m=Math.max(512,e.length*24),g=new ArrayBuffer(m*Qt),x={view:new DataView(g),bytes:new Uint8Array(g),offset:0,count:0,indices:[],extent:t,ensure(O){if(x.count+O<=m)return;m=Math.max(m*2,x.count+O);let G=new ArrayBuffer(m*Qt);new Uint8Array(G).set(x.bytes.subarray(0,x.offset)),g=G,x.view=new DataView(G),x.bytes=new Uint8Array(G)}},v=[],S=[],P=new Map;for(let O of e.features()){if(O.type!==3||!pe(n,O.properties))continue;let G=r.liftBy?.(O.properties)??0,W=O.properties.osm_id,D=typeof W=="number"?W:typeof W=="string"?Number(W):NaN,Q=Number.isFinite(D)?D:Number(O.id??0);for(let oe of Ye(O.loadGeometry())){let ee=Ve(oe,t,we(t));ee&&(v.push(G?{...ee,lift:G}:ee),S.push(Q))}}let _=new Set,I=Math.max(r.weld??Qi,0),A=Hn(v,(O,G)=>Yt(O,G,t,_),I/i),k=I>0?A.map(O=>({...O,outer:Zn(O.outer,I/i,t),holes:O.holes.map(G=>Zn(G,I/i,t))})):A;for(let O of k){$n(O.outer,P);for(let G of O.holes)$n(G,P)}r.onShapes?.(k);let L=Ki(k,v,S),V=new Set;for(let[O,G]of P)G>1&&V.add(O);let U=[],N={radius:h,segments:r.cornerSegments,extent:t,margin:we(t),minCutRatio:0,maxChord:dn/i},T=[];for(let O of k){let G=x.indices.length,W=U.length,D=h>0?{outer:Ce(O.outer,{...N,keep:Xn(O.outer,V)}),holes:O.holes.map(q=>Ce(q,{...N,keep:Xn(q,V)}))}:O,Q=c>0?Yt(D.outer,c,t,V):D.outer,oe=D.holes.map(q=>c>0?Yt(q,-c,t,V):q),ee=O.lift??0,ne=o+ee,Z=u+ee;Yn(x,Q??D.outer,oe.map((q,he)=>q??D.holes[he]),ne,Wn,r.maxSegment??0);let le=ne,K=ne-f;Q&&c>0&&f>0&&Xt(x,Q,D.outer,le,K,Zi,t,V),K!==Z&&Xt(x,D.outer,D.outer,K,Z,zn,t,V);for(let q of D.holes)if(K!==Z&&Xt(x,q,q,K,Z,zn,t,V),ne<Z){let he=x.indices.length;Yn(x,q,[],Z,Wi);for(let me=he;me<x.indices.length;me++)U.push(x.indices[me]);x.indices.length=he}T.push(G,x.indices.length,W,U.length)}if(!x.indices.length&&!U.length)return null;let j=x.indices.length;for(let O=0;O<T.length;O+=4)T[O+2]+=j,T[O+3]+=j;let Y=[];for(let O of L){Y.push(O.length);for(let G of O)Y.push(G)}let $=new Uint32Array(j+U.length);return $.set(x.indices,0),$.set(U,j),{vertices:g.slice(0,x.offset),indices:$.buffer,vertexCount:x.count,indexCount:$.length,extent:t,capIndexOffset:j,shapeFeatures:new Float64Array(Y).buffer,shapeRanges:new Uint32Array(T).buffer}}function Ki(e,t,n){let r=e.map(()=>[]);if(!e.length)return r;let i=e.map(o=>jn(o.outer));for(let o=0;o<t.length;o++){let u=Ji(t[o].outer);if(!u)continue;let c=-1;for(let f=0;f<e.length;f++){let h=i[f];if(u[0]<h[0]||u[0]>h[2]||u[1]<h[1]||u[1]>h[3]||!Kt(e[f].outer,u[0],u[1]))continue;let m=!1;for(let g of e[f].holes)if(Kt(g,u[0],u[1])){m=!0;break}if(!m){c=f;break}}if(c<0){let f=jn(t[o].outer),h=0;for(let m=0;m<e.length;m++){let g=i[m],x=Math.min(f[2],g[2])-Math.max(f[0],g[0]),v=Math.min(f[3],g[3])-Math.max(f[1],g[1]),S=x>0&&v>0?x*v:0;S>h&&(h=S,c=m)}}c<0&&(c=0),r[c].includes(n[o])||r[c].push(n[o])}return r}function jn(e){let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let o=0;o<e.length;o+=2)e[o]<t&&(t=e[o]),e[o]>r&&(r=e[o]),e[o+1]<n&&(n=e[o+1]),e[o+1]>i&&(i=e[o+1]);return[t,n,r,i]}function Ji(e){let t=e.length/2-1;if(t<3)return null;let n=0;for(let i=0;i<t;i++){let o=(i+1)%t;n+=e[i*2]*e[o*2+1]-e[o*2]*e[i*2+1]}let r=n>0;for(let i=0;i<t;i++){let o=(i+t-1)%t*2,u=i*2,c=(i+1)%t*2,f=(e[u]-e[o])*(e[c+1]-e[o+1])-(e[u+1]-e[o+1])*(e[c]-e[o]);if(f===0||f>0!==r)continue;let h=(e[o]+e[u]+e[c])/3,m=(e[o+1]+e[u+1]+e[c+1])/3;if(Kt(e,h,m))return[h,m]}return null}function Kt(e,t,n){let r=!1,i=e.length/2-1;for(let o=0,u=i-1;o<i;u=o++){let c=e[o*2],f=e[o*2+1],h=e[u*2],m=e[u*2+1];f>n!=m>n&&t<(h-c)*(n-f)/(m-f)+c&&(r=!r)}return r}function Ke(e,t,n,r){let i=`${Math.round(e*100)},${Math.round(t*100)}`,o=`${Math.round(n*100)},${Math.round(r*100)}`;return i<o?`${i}|${o}`:`${o}|${i}`}function $n(e,t){for(let n=0;n+3<e.length;n+=2){let r=Ke(e[n],e[n+1],e[n+2],e[n+3]);t.set(r,(t.get(r)??0)+1)}}function Xn(e,t){if(!t.size)return;let n=e.length/2-1,r=new Array(n).fill(!1);for(let i=0;i<n;i++){let o=Ke(e[(i+n-1)%n*2],e[(i+n-1)%n*2+1],e[i*2],e[i*2+1]),u=Ke(e[i*2],e[i*2+1],e[(i+1)%n*2],e[(i+1)%n*2+1]);(t.has(o)||t.has(u))&&(r[i]=!0)}return r}function ft(e,t,n,r,i,o,u,c){let f=e.offset;return e.view.setFloat32(f,t,!0),e.view.setFloat32(f+4,n,!0),e.view.setInt16(f+8,qi(Math.round(r*Yi)),!0),e.view.setInt8(f+10,Wt(Math.round(i*127))),e.view.setInt8(f+11,Wt(Math.round(o*127))),e.view.setInt8(f+12,Wt(Math.round(u*127))),e.bytes[f+13]=c,e.view.setInt8(f+14,t<=0?-St:t>=e.extent?St:0),e.view.setInt8(f+15,n<=0?-St:n>=e.extent?St:0),e.offset+=Qt,e.count++}function Yn(e,t,n,r,i=Wn,o=0){let u=[],c=[];for(let g=0;g<t.length;g++)u.push(t[g]);for(let g of n){c.push(u.length/2);for(let x=0;x<g.length;x++)u.push(g[x])}let f=Oe(u,c.length?c:void 0,2);if(!f.length)return;let h=f;if(o>0){let g=[];Nt(u,f,0,o,g),h=g}e.ensure(u.length/2);let m=e.count;for(let g=0;g<u.length;g+=2)ft(e,u[g],u[g+1],r,0,0,1,i);for(let g=0;g<h.length;g+=3)e.indices.push(m+h[g],m+h[g+2],m+h[g+1])}function Xt(e,t,n,r,i,o,u,c){let f=Math.min(t.length,n.length)/2;if(!(f<3)){e.ensure((f-1)*4);for(let h=0;h<f-1;h++){let m=n[h*2],g=n[h*2+1],x=n[h*2+2],v=n[h*2+3];if(m===x&&g===v||vt(m,g,x,v,u,we(u))||c.has(Ke(m,g,x,v)))continue;let S=x-m,P=v-g,_=Math.hypot(S,P)||1,I=P/_,A=-S/_,k=r-i,L=Math.hypot(t[h*2]-m,t[h*2+1]-g)||0,V=0;if(L>1e-6&&k!==0){let Y=1/Math.hypot(1,k/L);V=L/Math.hypot(L,k)*Math.sign(k),I*=Y,A*=Y}let U=ft(e,t[h*2],t[h*2+1],r,I,A,V,o),N=ft(e,t[h*2+2],t[h*2+3],r,I,A,V,o),T=ft(e,m,g,i,I,A,V,o),j=ft(e,x,v,i,I,A,V,o);e.indices.push(T,N,j,T,U,N)}}}function Yt(e,t,n,r){let i=e.length/2-1;if(i<3)return null;let o=[];for(let m=0;m<i;m++){let g=e[m*2],x=e[m*2+1],v=e[(m+i-1)%i*2],S=e[(m+i-1)%i*2+1],P=e[(m+1)%i*2],_=e[(m+1)%i*2+1],I=Math.hypot(g-v,x-S)||1,A=Math.hypot(P-g,_-x)||1,k=(x-S)/I,L=-(g-v)/I,V=(_-x)/A,U=-(P-g)/A,N=k+V,T=L+U,j=Math.hypot(N,T);if(j<1e-6){o.push(g,x);continue}N/=j,T/=j;let Y=Math.min(1/Math.max(N*k+T*L,.35),3),$=g-N*t*Y,O=x-T*t*Y,G=Ke(v,S,g,x),W=Ke(g,x,P,_);if(r.has(G)||r.has(W)){o.push(g,x);continue}let D=-we(n),Q=n+we(n);((ee,ne)=>ee<=D||ee>=Q||ne<=D||ne>=Q)(g,x)&&($=g,O=x),o.push($,O)}o.push(o[0],o[1]);let u=Math.abs(Zt(e)),c=Zt(o);if(Math.sign(c)!==Math.sign(Zt(e))||Math.abs(c)<u*.25)return null;let f=-we(n),h=n+we(n);for(let m=0;m<o.length;m+=2)o[m]=Math.max(f,Math.min(h,o[m])),o[m+1]=Math.max(f,Math.min(h,o[m+1]));return o}function Zt(e){let t=0;for(let n=0;n<e.length-2;n+=2)t+=e[n]*e[n+3]-e[n+2]*e[n+1];return t/2}var Wt=e=>e>127?127:e<-127?-127:e,qi=e=>e>32767?32767:e<-32768?-32768:e;function Zn(e,t,n){if(!(t>0))return e;let r=we(n),i=-r,o=n+r,u=e;for(let c=0;c<3;c++){let f=u.length/2-1;if(f<6)break;let h=new Array(f).fill(!0),m=f;for(let x=0;x<f&&!(m<=5);x++){let v=u[x*2],S=u[x*2+1];if(v<=i||v>=o||S<=i||S>=o)continue;let P=(x+f-1)%f;for(;!h[P]&&P!==x;)P=(P+f-1)%f;let _=(x+1)%f;for(;!h[_]&&_!==x;)_=(_+1)%f;if(P===x||_===x)break;let I=u[P*2],A=u[P*2+1],k=u[_*2]-I,L=u[_*2+1]-A,V=Math.hypot(k,L);V<1e-6||Math.abs((v-I)*L-(S-A)*k)/V<t&&(h[x]=!1,m--)}if(m===f)break;let g=[];for(let x=0;x<f;x++)h[x]&&g.push(u[x*2],u[x*2+1]);g.push(g[0],g[1]),u=g}return u}function Je(e){let t=e.layer,n=typeof t=="number"?t:typeof t=="string"?Number(t):NaN;if(Number.isFinite(n)&&n!==0)return Math.max(-5,Math.min(5,Math.trunc(n)));let r=e.brunnel;return r==="bridge"?1:r==="tunnel"?-1:0}var at=20;function qn(e,t,n=0,r,i=0,o={}){let{level:u}=o,c=Math.max(256,e.length*24),f=new ArrayBuffer(c*at),h=new DataView(f),m=0,g=[],x=[],v=V=>{if(m+V<=c)return;c=Math.max(c*2,m+V);let U=new ArrayBuffer(c*at);new Uint8Array(U).set(new Uint8Array(f,0,m*at)),f=U,h=new DataView(U)},S=(V,U,N,T,j,Y,$,O=0,G=0,W=0)=>{let D=m*at;return h.setInt16(D,V,!0),h.setInt16(D+2,U,!0),h.setInt16(D+4,N,!0),h.setInt16(D+6,T,!0),h.setInt8(D+8,j),h.setInt8(D+9,Y),h.setInt8(D+10,O),h.setInt8(D+11,G),h.setFloat32(D+12,$,!0),h.setFloat32(D+16,W,!0),m++},P=0,_=0,I=i>0?12/i:0,A=I>0?io(e):null;for(let V of e.features()){if(V.type!==2&&V.type!==3||!pe(t,V.properties)||u!==void 0&&Je(V.properties)!==u)continue;let U=V.properties.osm_id,N=typeof U=="number"?U:typeof U=="string"?Number(U):NaN;_=Number.isFinite(N)?N:Number(V.id??0);let T=V.properties.width;P=typeof T=="number"&&T>.5&&T<100?T:0;let j=V.type===3;for(let Y of V.loadGeometry()){let $=n>0?to(Kn(Y),n):Kn(Y);if($.length<4)continue;let O=r&&!Vn(r)?On(r,$):null,G=O?O.pts:$,W=O?.levels,D=G.length/2;if(D<2)continue;let Q=Je(V.properties),oe=Mt(Math.round(G[0]),Math.round(G[1])),ee=Mt(Math.round(G[D*2-2]),Math.round(G[D*2-1])),ne=null,Z=P;if(A&&P>0&&!j){let K=0;for(let fe=0;fe<D-1;fe++)K+=Math.hypot(G[fe*2+2]-G[fe*2],G[fe*2+3]-G[fe*2+1]);Z=er(Q,P,oe,ee,A);let q=fe=>Math.min(A.width.get(fe)??0,Z*2),he=q(oe)-Z,me=q(ee)-Z,ce=Math.min(I,K/2);if(ce>0&&(he>0||me>0)){ne=ae=>{let de=0;return he>0&&ae<ce&&(de=he*(1-ae/ce)),me>0&&K-ae<ce&&(de=Math.max(de,me*(1-(K-ae)/ce))),Z+de};let fe=[];for(let ae of[ce,K-ce])ae>.01&&ae<K-.01&&fe.push(ae);if(fe.length){let ae=eo(G,W,fe);G=ae.pts,W=ae.levels,D=G.length/2}}}v((D-1)*4);let le=0;for(let K=0;K<D-1;K++){let q=G[K*2],he=G[K*2+1],me=G[K*2+2],ce=G[K*2+3],fe=Math.hypot(me-q,ce-he);if(j&&ro(q,he,me,ce,e.extent)){le+=fe;continue}let ae=no(q,he,me,ce,e.extent);if(!ae){le+=fe;continue}let[de,Se,Fe,re]=ae,Ue=Math.hypot(de-q,Se-he),ve=Math.hypot(Fe-de,re-Se),De=Math.hypot(me-Fe,ce-re),Ie=le+Ue,Le=W?W[K]:0,Me=W?W[K+1]:0,Ge=ne?ne(Ie):Z,$e=ne?ne(Ie+ve):Z,Ne=S(de,Se,Fe,re,0,-1,Ie,Le,Me,Ge),ht=S(de,Se,Fe,re,0,1,Ie,Le,Me,Ge),pt=S(de,Se,Fe,re,1,1,Ie,Le,Me,$e),Et=S(de,Se,Fe,re,1,-1,Ie,Le,Me,$e);le+=Ue+ve+De,g.push(Ne,ht,pt,Ne,pt,Et),x.push(_,_)}}}if(!g.length)return null;let k=new Uint32Array(g),L=new Float64Array(x);return{vertices:f.slice(0,m*at),indices:k.buffer,vertexCount:m,indexCount:k.length,featureIds:L.buffer}}function eo(e,t,n){let r=[...n].sort((f,h)=>f-h),i=[e[0],e[1]],o=t?[t[0]]:void 0,u=0,c=0;for(let f=0;f+3<e.length;f+=2){let h=e[f],m=e[f+1],g=e[f+2],x=e[f+3],v=Math.hypot(g-h,x-m);for(;c<r.length&&r[c]<=u+.01;)c++;for(;c<r.length&&r[c]<u+v-.01;){let S=(r[c]-u)/v;i.push(h+(g-h)*S,m+(x-m)*S),o&&t&&o.push(Math.round(t[f/2]+(t[f/2+1]-t[f/2])*S)),c++}u+=v,i.push(g,x),o&&t&&o.push(t[f/2+1])}return{pts:i,levels:o}}function to(e,t){let n=[];for(let r=0;r+3<e.length;r+=2){let i=e[r],o=e[r+1],u=e[r+2],c=e[r+3];n.push(i,o);let f=Math.min(64,Math.floor(Math.hypot(u-i,c-o)/t));for(let h=1;h<f;h++){let m=h/f;n.push(i+(u-i)*m,o+(c-o)*m)}}return n.push(e[e.length-2],e[e.length-1]),n}function Kn(e){let t=[];for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1],o=t.length;o>=2&&t[o-2]===r&&t[o-1]===i||t.push(r,i)}return t}function no(e,t,n,r,i){let o=n-e,u=r-t,c=0,f=1,h=[[-o,e],[o,i-e],[-u,t],[u,i-t]];for(let[m,g]of h){if(m===0){if(g<0)return null;continue}let x=g/m;if(m<0){if(x>f)return null;x>c&&(c=x)}else{if(x<c)return null;x<f&&(f=x)}}return f-c<1e-6?null:[Math.round(e+o*c),Math.round(t+u*c),Math.round(e+o*f),Math.round(t+u*f)]}function ro(e,t,n,r,i){return e===n&&(e<=0||e>=i)?!0:t===r&&(t<=0||t>=i)}var Jn=new WeakMap,Mt=(e,t)=>(e+512)*65536+(t+512);function er(e,t,n,r,i){if(e===0||t<=0)return t;let o=8*4294967296,u=Math.max(i.raw.get(n+o)??0,i.raw.get(r+o)??0);return u>0&&t>u?u:t}function io(e){let t=Jn.get(e);if(t)return t;let n={width:new Map,ends:new Map,raw:new Map},r=[];for(let i of e.features()){if(i.type!==2)continue;let o=i.properties.width,u=typeof o=="number"&&o>.5&&o<100?o:0,c=Je(i.properties);for(let f of i.loadGeometry()){if(f.length<4)continue;let h=Mt(Math.round(f[0]),Math.round(f[1])),m=Mt(Math.round(f[f.length-2]),Math.round(f[f.length-1]));for(let g of[h,m]){let x=g+(c+8)*4294967296;n.ends.set(x,(n.ends.get(x)??0)+1),u>0&&n.raw.set(x,Math.max(n.raw.get(x)??0,u))}r.push({h,t:m,lv:c,w:u})}}for(let i of r){let o=er(i.lv,i.w,i.h,i.t,n);if(!(o<=0))for(let u of[i.h,i.t]){let c=n.width.get(u);(c===void 0||o>c)&&n.width.set(u,o)}}return Jn.set(e,n),n}var oo=[["\\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."]],tr=new Map(oo);function nr(e){let t=e.split(" ");if(t.length<2)return e;let n=!1,r=t.map(o=>{let u=tr.get(o.toLowerCase());return u?(n=!0,o[0]===o[0].toUpperCase()?u[0].toUpperCase()+u.slice(1):u):o});return!n||!t.filter(o=>tr.get(o.toLowerCase())===void 0).length?e:r.join(" ")}function ir(e,t){let n=[],r=[],i=[],o=[],u=[],c=t.textPlacement==="line",f=[],h=[],m=[];for(let g of e.features()){if(!pe(t.filter,g.properties))continue;let x=g.loadGeometry(),v=lo(g.type,x);if(!v)continue;let S=t.textField?rr(t.textField,g.properties):"",P=S&&t.abbreviate?nr(S):S,_=t.iconImage?rr(t.iconImage,g.properties):"";if(!(!P&&!_)){if(c){let I=uo(g.type,x);if(!I)continue;m.push({text:P,line:I});continue}n.push(v[0],v[1]),r.push(P),i.push(_),o.push(co(g.properties)),u.push(t.iconRotate&&Math.round(Number(g.properties[t.iconRotate]??0))||0)}}if(c){for(let{text:g,line:x}of so(m)){h.push(f.length/2);for(let v of x)f.push(v);n.push(Math.round(x[0]),Math.round(x[1])),r.push(g),i.push(""),o.push(128),u.push(0)}h.push(f.length/2)}return r.length?{anchors:new Int16Array(n).buffer,texts:r,icons:i,priorities:new Uint8Array(o).buffer,rotations:new Int16Array(u).buffer,...c?{lines:new Int16Array(f).buffer,lineStarts:new Uint32Array(h).buffer}:{}}:null}function so(e){let t=[],n=new Map,r=new Map,i=(o,u,c)=>`${o}\\u241F${u}\\u241F${c}`;for(let{text:o,line:u}of e){let c=i(o,u[0],u[1]),f=i(o,u[u.length-2],u[u.length-1]),h=n.get(f),m=r.get(c);if(m!==void 0){let g=t[m];if(g.line.push(...u.slice(2)),r.delete(c),r.set(i(o,g.line[g.line.length-2],g.line[g.line.length-1]),m),h!==void 0&&h!==m){let x=t[h];g.line.push(...x.line.slice(2)),x.line=[],n.delete(f),r.set(i(o,g.line[g.line.length-2],g.line[g.line.length-1]),m)}continue}if(h!==void 0){let g=t[h];g.line.unshift(...u.slice(0,u.length-2)),n.delete(f),n.set(i(o,g.line[0],g.line[1]),h);continue}n.set(c,t.length),r.set(f,t.length),t.push({text:o,line:u})}return t.filter(o=>o.line.length>=4)}function uo(e,t){if(e!==2)return null;let n=null,r=0;for(let i of t){if(i.length<4)continue;let o=0;for(let u=0;u+3<i.length;u+=2)o+=Math.hypot(i[u+2]-i[u],i[u+3]-i[u+1]);o>r&&(r=o,n=i)}return n}function lo(e,t){if(!t.length)return null;if(e===1){let u=t[0];return u.length>=2?[u[0],u[1]]:null}if(e===2){let u=-1,c=0,f=0;for(let h of t)for(let m=0;m+3<h.length;m+=2){let g=h[m+2]-h[m],x=h[m+3]-h[m+1],v=g*g+x*x;v>u&&(u=v,c=h[m]+g/2,f=h[m+1]+x/2)}return u>0?[Math.round(c),Math.round(f)]:null}let n=1/0,r=1/0,i=-1/0,o=-1/0;for(let u of t)for(let c=0;c<u.length;c+=2)u[c]<n&&(n=u[c]),u[c]>i&&(i=u[c]),u[c+1]<r&&(r=u[c+1]),u[c+1]>o&&(o=u[c+1]);return isFinite(n)?[Math.round((n+i)/2),Math.round((r+o)/2)]:null}function co(e){let t=e.rank;return typeof t=="number"&&isFinite(t)?Math.max(0,255-Math.min(t,255)):128}function rr(e,t){let n=Array.isArray(e)?e:[e];for(let r of n){let i=!0,u=r.replace(/\\{([^}]+)\\}/g,(c,f)=>{let h=t[f];return h==null||h===""?(i=!1,""):String(h)}).trim();if(i&&u)return u}return""}function or(e,t){let n=[],r=[];for(let i=0;i<e.length;i++){let o=e.feature(i);if(o.type===1&&pe(t,o.properties))for(let u of o.loadGeometry())for(let c=0;c+1<u.length;c+=2)n.push(u[c],u[c+1]),r.push(o.properties)}return r.length?{anchors:Int16Array.from(n).buffer,props:r}:null}var fo="\\u241F",Jt=(e,t)=>e+fo+String(t);function ao(){let e=typeof self<"u"?self.origin:void 0;return e&&e!=="null"&&!e.startsWith("blob:")?e+"/":void 0}async function sr(e,t){let n=performance.now(),r=ao(),i=await fetch(e.url,{signal:t,credentials:"same-origin",...r?{referrer:r}:{}}),o=(A,k,L,V,U=0)=>({type:"loaded",id:e.id,buckets:{},timing:{fetchMs:V,parseMs:U},diag:{status:A,bytes:k,layers:L,built:0}});if(!i.ok){if(i.status===404||i.status===204)return o(i.status,0,[],performance.now()-n);throw new Error(`HTTP ${i.status} \\u0434\\u043B\\u044F ${e.url}`)}let u=await i.arrayBuffer(),c=performance.now()-n;if(u.byteLength===0)return o(i.status,0,[],c);let f=performance.now(),h=new wt(u),m=Object.keys(h.layers),g={},x=[],v={},S=new Set,P=[],I=e.plan.some(A=>A.type==="surface"&&(A.elevation??0)>0)&&e.plan.some(A=>A.type==="line"&&A.ground)?Tn(e.metersPerTile):void 0;for(let A of e.plan){if(!po(A,e.zoom,e.sourceMaxZoom))continue;let k=h.layers[A.sourceLayer];if(!k)continue;let L=mo(e.zoom,k.extent);try{if(A.splitBy){let U=xo(k,A.splitBy,A.filter);if(!U.length)continue;let N=v[A.splitBy]??(v[A.splitBy]=[]);for(let T of U){N.includes(T)||N.push(T);let j={...A,splitBy:void 0,filter:yo(A.filter,A.splitBy,T)},Y=qt(j,k,L,e.metersPerTile,I,void 0,x);Y&&(g[Jt(A.id,T)]=Y)}continue}if(A.network&&A.type==="line"){for(let U of go(k,A.filter)){let N=qt(A,k,L,e.metersPerTile,I,U,x);N&&(g[Jt(A.id,U)]=N,S.add(U))}continue}let V=qt(A,k,L,e.metersPerTile,I,void 0,x);V&&(g[A.id]=V)}catch(V){P.push(`${A.id}: ${V instanceof Error?V.message:String(V)}`)}}return{type:"loaded",id:e.id,buckets:g,...x.length?{seams:x}:{},...Object.keys(v).length?{splits:v}:{},...S.size?{levels:[...S].sort((A,k)=>A-k)}:{},timing:{fetchMs:c,parseMs:performance.now()-f},diag:{status:i.status,bytes:u.byteLength,layers:m,built:Object.keys(g).length,...P.length?{failed:P}:{}}}}function ho(e){return t=>{let n=t.on;if(typeof n!="string"||!n)return 0;let r=0;for(let i of n.split(",")){let o=e[i];typeof o=="number"&&o>r&&(r=o)}return r}}function po(e,t,n){let r=t-1,i=t<n?t+1:24;return!(e.maxzoom<r||e.minzoom>i)}function mo(e,t){return e<=6?Math.max(64,t/24):0}function qt(e,t,n,r,i,o,u){{if(e.type==="fill"){let f=r>0?r/t.extent:0,h=e.cornerRadius&&f>0?{radius:e.cornerRadius/f,segments:e.cornerSegments,extent:t.extent,minCutRatio:0,maxChord:gn/f}:void 0,m=Bn(t,e.filter,n,h,e.clipToTile===!0,t.extent);return m?{kind:"fill",...m,extent:t.extent}:null}if(e.type==="surface"){let f=Qn(t,t.extent,e.filter,{metersPerUnit:r>0?r/t.extent:0,maxSegment:n,elevation:e.elevation??0,base:e.base,bevel:e.bevel,weld:e.weld,bevelDrop:e.bevelDrop,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments,...i?{onShapes:h=>Cn(i,h,e.elevation??0,t.extent)}:{},...e.groundBy?{liftBy:ho(e.groundBy)}:{}});return f?{kind:"surface",...f}:null}if(e.type==="line"){let f=qn(t,e.filter,n,e.ground?i:void 0,r>0?r/t.extent:0,{level:o});return f?{kind:"line",...f,extent:t.extent}:null}if(e.type==="model"){let f=or(t,e.filter);return f?{kind:"placement",...f,extent:t.extent}:null}if(e.type==="symbol"){let f=ir(t,{filter:e.filter,textField:e.textField,iconImage:e.iconImage,iconRotate:e.iconRotate,textPlacement:e.textPlacement,abbreviate:e.abbreviate});return f?{kind:"symbol",...f,extent:t.extent}:null}let c=_n(t,t.extent,e.filter,{metersPerUnit:r>0?r/t.extent:0,cornerRadius:e.cornerRadius,cornerSegments:e.cornerSegments},u);return c?{kind:"fill-extrusion",vertices:c.vertices,indices:c.indices,featureIds:c.featureIds,vertexCount:c.vertexCount,indexCount:c.indexCount,extent:c.extent}:null}}function xo(e,t,n){let r=[];for(let i of e.features()){if(!pe(n,i.properties))continue;let o=i.properties[t];typeof o!="string"&&typeof o!="number"||r.includes(o)||r.push(o)}return r.sort((i,o)=>typeof i=="number"&&typeof o=="number"?i-o:String(i).localeCompare(String(o))),r}function go(e,t){let n=[];for(let r of e.features()){if(!pe(t,r.properties))continue;let i=Je(r.properties);n.includes(i)||n.push(i)}return n.sort((r,i)=>r-i)}function yo(e,t,n){let r=["==",t,n];return e?["all",e,r]:r}var bo=e=>e.kind==="symbol",wo=e=>e.kind==="placement";function ur(e){let t=[];for(let n of Object.values(e.buckets)){if(wo(n)){t.push(n.anchors);continue}if(bo(n)){t.push(n.anchors,n.priorities),n.lines&&t.push(n.lines),n.lineStarts&&t.push(n.lineStarts);continue}t.push(n.vertices,n.indices),n.featureIds&&t.push(n.featureIds),n.shapeFeatures&&t.push(n.shapeFeatures),n.shapeRanges&&t.push(n.shapeRanges)}return t}var lr=Map;var qe=new lr,en=self;en.onmessage=e=>{let t=e.data;if(t.type==="abort"){qe.get(t.id)?.abort(),qe.delete(t.id);return}let n=new AbortController;qe.set(t.id,n),sr(t,n.signal).then(r=>{qe.has(t.id)&&(qe.delete(t.id),en.postMessage(r,ur(r)))}).catch(r=>{let i=n.signal.aborted;qe.delete(t.id);let o={type:"error",id:t.id,message:r instanceof Error?r.message:String(r),aborted:i};en.postMessage(o)})};})();\n';var Ru=2,$o=class{constructor(e=_n()){this.workers=[];this.blobUrl=null;this.pending=new z;this.queue=new z;this.busy=[];this.nextId=1;this.mainThreadAborts=new z;this.destroyed=false;try{let t=new Blob([xn],{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,this.busy=new Array(this.workers.length).fill(0);}get size(){return this.workers.length}load(e,t,o=0){let r=this.nextId++,n={type:"load",id:r,...e};if(!this.usingWorkers){let a=new AbortController;return this.mainThreadAborts.set(r,a),Al(n,a.signal).then(l=>{this.mainThreadAborts.has(r)&&(this.mainThreadAborts.delete(r),t(l));}).catch(l=>{let s=a.signal.aborted;this.mainThreadAborts.delete(r),t({type:"error",id:r,message:l instanceof Error?l.message:String(l),aborted:s});}),r}return this.queue.set(r,{message:n,resolve:t,priority:o}),this.pump(),r}pump(){for(;;){if(!this.queue.size)return;let e=-1;for(let r=0;r<this.busy.length;r++)this.busy[r]>=Ru||(e<0||this.busy[r]<this.busy[e])&&(e=r);if(e<0)return;let t=-1,o=null;for(let[r,n]of this.queue.entries())o&&n.priority>=o.priority||(t=r,o=n);if(!o)return;this.queue.delete(t),this.busy[e]++,this.pending.set(t,{resolve:o.resolve,workerIndex:e}),this.workers[e].postMessage(o.message);}}abort(e){if(!this.usingWorkers){this.mainThreadAborts.get(e)?.abort(),this.mainThreadAborts.delete(e);return}if(this.queue.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),this.busy[t.workerIndex]--,this.pump();}onMessage(e){if(this.destroyed)return;let t=this.pending.get(e.id);t&&(this.pending.delete(e.id),this.busy[t.workerIndex]--,this.pump(),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.queue.clear(),this.busy=[],this.disposeWorkers();}};function _n(){let i=typeof navigator<"u"&&navigator.hardwareConcurrency||4;return Math.max(1,Math.min(i-1,6))}function Il(i){return Math.max(0,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10))}function Cn(i,e){let t=Il(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 Sn(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 Rl={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}},ao=i=>Rl[i]??Rl.high;function Fl(i){let e=i.toLowerCase();return e?/swiftshader|llvmpipe|software|basic render|microsoft basic|mesa offscreen/.test(e)?"software":/rtx|geforce gtx (9|10|16|20|30|40|50)|radeon rx|radeon pro|arc a\d|apple m\d/.test(e)?"strong":/intel\(r\) hd graphics|hd graphics [2-5]\d{3}|uhd graphics 6\d\d/.test(e)||/mali-t\d|mali-g[35]\d|adreno \(tm\) [3-5]\d\d|powervr/.test(e)?"weak":"unknown":"unknown"}function Zo(i){let{cores:e,memory:t,mobile:o,devicePixelRatio:r,gpu:n}=i;if(n==="software")return "minimal";let a=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";return n==="weak"?En(a)??a:n==="strong"&&!o?zl(a)??a:a}function Qo(){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,gpu:Fu()}}function Fu(){if(typeof document>"u")return "unknown";let i=null;try{let e=document.createElement("canvas");if(e.width=1,e.height=1,i=e.getContext("webgl2")??e.getContext("webgl"),!i)return "software";let t=i.getExtension("WEBGL_debug_renderer_info"),o=t?i.getParameter(t.UNMASKED_RENDERER_WEBGL):i.getParameter(i.RENDERER);return typeof o=="string"?Fl(o):"unknown"}catch{return "unknown"}finally{i?.getExtension("WEBGL_lose_context")?.loseContext();}}function kn(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 qo(i){return i==="high"?3:i==="balanced"?2:i==="low"?1:0}function zl(i){return i==="minimal"?"low":i==="low"?"balanced":i==="balanced"?"high":null}function En(i){return i==="high"?"balanced":i==="balanced"?"low":i==="low"?"minimal":null}var Mn=120,zu=40,Pu=.35,Hu=.02,Ou=150,Bu=30,Wu=1,Vu=1800,Tn=30,Du=1.25,io=class{constructor(e,t,o,r){this.current=e;this.ceiling=t;this.slowMs=o;this.verySlowMs=r;this.ring=new Uint8Array(Mn);this.at=0;this.sum=0;this.filled=0;this.steady=0;this.warmup=0;this.attempts={};this.arrivedByUp=false;this.recent=new Float32Array(Tn);this.recentAt=0;this.recentFilled=0;this.refreshMs=0;}get limit(){return this.ceiling}reset(e,t){this.current=e,this.ceiling=t,this.attempts={},this.arrivedByUp=false,this.restart();}frame(e,t){if(t)return null;if(this.warmup>0)return this.warmup--,null;let o=this.threshold(e),r=e>o*(this.verySlowMs/this.slowMs)?3:e>o?1:0;if(this.sum+=r-this.ring[this.at],this.ring[this.at]=r,this.at=(this.at+1)%Mn,this.filled<Mn&&this.filled++,this.steady++,this.steady===Vu&&(this.attempts[this.current]=0),this.filled<zu)return null;let n=this.sum/this.filled;return n>=Pu?this.down(n):n>Hu?null:this.up(n)}threshold(e){this.recent[this.recentAt]=e,this.recentAt=(this.recentAt+1)%Tn,this.recentFilled<Tn&&this.recentFilled++;let t=this.refreshMs;if(!t){t=1/0;for(let o=0;o<this.recentFilled;o++)t=Math.min(t,this.recent[o]);}return Math.max(this.slowMs,t*Du)}setRefresh(e){e>=1e3/240&&e<=50&&(this.refreshMs=e);}down(e){let t=En(this.current);if(!t)return null;if(this.arrivedByUp){let o=(this.attempts[this.current]??0)+1;this.attempts[this.current]=o,o>=Wu&&qo(t)<qo(this.ceiling)&&(this.ceiling=t);}return this.moveTo(t,false),{to:t,direction:"down",share:e}}up(e){let t=zl(this.current);if(!t||qo(t)>qo(this.ceiling))return null;let o=Ou*2**(this.attempts[t]??0);return this.steady<o?null:(this.moveTo(t,true),{to:t,direction:"up",share:e})}moveTo(e,t){this.current=e,this.arrivedByUp=t,this.restart();}restart(){this.ring.fill(0),this.at=0,this.sum=0,this.filled=0,this.steady=0,this.warmup=Bu;}};var Nu=1,lo=class{constructor(e){this.originX=0;this.originY=0;this._revision=0;this.id=e.id??`obj-${Nu++}`,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=te(l),c=le(s.lng),f=se(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=te(o);t.push(le(r.lng)-this.originX,se(r.lat)-this.originY);}return t}color(e,t){let o=de(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}},In=class extends lo{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=Vt([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=Vt([this.toLocal(this.coordinates.slice(l.from,l.to+1))]);if(!s)continue;let c=de(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=Rn(this.coordinates,this.altitude,t);for(let a=0;a+1<n.length;a++)if(Pl(e,n[a],n[a+1])<=r)return true;return false}},Jo=class extends lo{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=Xr(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(An(a))),n=Vt(r);n&&e.push(this.linePaint({kind:"line",mesh:n,color:this.color("strokeColor","#2f6df6"),width:o}));}return e}hitTest(e,t){let o=Rn(An(this.coordinates[0]??[]),this.altitude,t);if(!Fn(e,o))return false;for(let r=1;r<this.coordinates.length;r++)if(Fn(e,Rn(An(this.coordinates[r]),this.altitude,t)))return false;return true}},Ln=class extends Jo{constructor(e){super({...e,coordinates:[Gu(e.center,e.radius,e.segments)]});}};function Gu(i,e,t){let o=te(i),r=e/Le(o.lat),n=le(o.lng),a=se(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([Te(n+Math.cos(f)*r),Se(a+Math.sin(f)*r)]);}return s}function Rn(i,e,t){let o=[];for(let r of i){let n=te(r),a=t(n.lng,n.lat,e);a&&o.push(a);}return o}function An(i){if(i.length<2)return i;let e=te(i[0]),t=te(i[i.length-1]);return e.lng===t.lng&&e.lat===t.lat?i:[...i,i[0]]}function Pl(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 Fn(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 Hl="objects3d",Et="level",Uu=32,ju=100,Xu=250;function Ol(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 Ku(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 zn=class extends Ue{constructor(t){super();this.options=t;this.transform=new Lt;this.ctx=null;this.sources=new z;this.rasterSources=new z;this.renderer=new Kt;this.objects=new Nt;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.lastFrameAt=0;this.continuousFrames=0;this.onHashChange=null;this.lastMoveEmit=0;this.lastIndoorKey="";this.writingHash=false;this.hashTimer=0;this.layerOverrides=new z;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?Zo(Qo()):t.quality;this.governor=new io(r,r,Uu,ju),this.quality=ao(r),this.densityQuality=this.quality,this.maxPixelRatio=t.maxPixelRatio??this.quality.maxPixelRatio,this._style=new pt(t.theme?Ao(t.theme,t.style):t.style),this.background=t.background?de(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=te(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 $o(t.workerCount??Math.min(_n(),this.quality.maxWorkers)),this.initGL(),this.initSource(),this.initInput(),this.initResize(),this.measureRefresh(),queueMicrotask(()=>{this.destroyed||(this.loaded=true,this.emit("load",void 0),this.triggerRepaint());});}measureRefresh(){if(typeof requestAnimationFrame!="function")return;let t=[],o=r=>{if(this.destroyed)return;if(t.push(r),t.length<12){requestAnimationFrame(o);return}let n=1/0;for(let a=1;a<t.length;a++)n=Math.min(n,t[a]-t[a-1]);this.governor.setRefresh(n);};requestAnimationFrame(o);}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 fo(t);let o=new St(this.options.fonts??"/tileserver/fonts/{fontstack}/{range}.pbf",this.options.fontstack);this.options.icons&&o.icons.setIcons({...nt,...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($,{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 Yo({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:Hl,type:"model",sourceLayer:t.sourceLayer??"model3d",minzoom:0,maxzoom:24}}sourceDrawn(t,o){for(let r of this._style.layers)if(r.type!=="raster"&&(r.source??$)===t&&this._style.layerVisibleAt(r,o))return true;return t===this.objects3dSource&&this.objects3dEnabled?o>=(this.options.objects3d?.layout?.minZoom??0):false}planFor(t,o=this._style){let r=o.workerPlan(t),n=t===this.objects3dSource?[...r,this.objects3dPlan()]:r;return this.quality.simpleGeometry?n.map(Ku):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:Hl,"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(Ne(a,c.x,c.y,l));}}else for(let l of t.models)l.setHidden(false);}buildingsForMask(){let t=this.sources.get($);if(!t)return null;for(let o of this._style.layers){if(o.type!=="fill-extrusion"||(o.source??$)!==$)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===Et&&t.add(o.source??$);for(let o of this._style.layers){if(o.type!=="fill-extrusion"||"splitBy"in o&&o.splitBy)continue;let r=o.source??$;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 eo({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 Go(this.pool,{url:o.url,minzoom:o.minzoom??0,maxzoom:o.maxzoom??14,cacheSize:this.quality.tileCacheSize*2,plan:this.planFor(t),rank:t===$?0:1});return r.on("data",()=>this.triggerRepaint()),r.on("error",({message:n})=>this.emit("error",{message:n})),t===$&&r.on("idle",()=>this.emit("idle",void 0)),this.sources.set(t,r),this.triggerRepaint(),this}initInput(){this.gestures=new wo(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=kn(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=te(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=te(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?te(t.center):r.center,zoom:t.zoom??r.zoom,bearing:n.bearing+lt((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?te(t.center):o.center,zoom:t.zoom??o.zoom,bearing:r.bearing+lt((t.bearing??o.bearing)-r.bearing),pitch:t.pitch??o.pitch},l=je(r.zoom),s=(le(a.center.lng)-le(r.center.lng))*l,c=(se(a.center.lat)-se(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=C=>{let S=C===0?u:d,T=C===0?d:u;return (T*T-S*S+(C===0?1:-1)*m*m*f*f)/(2*S*m*f)},v=C=>Math.log(-g(C)+Math.sqrt(g(C)*g(C)+1)),w=v(0);y=(v(1)-w)/h;let _=C=>(Math.exp(C)+Math.exp(-C))/2,M=C=>(Math.exp(2*C)-1)/(Math.exp(2*C)+1);p=C=>{let S=h*C+w;return {u:u*_(w)*M(S)/m-u*Math.sinh(w)/m,w:u*_(w)/_(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=Ol(t),this.renderer.symbols&&(this.renderer.symbols.padding=this.padding),this.triggerRepaint(),this}getPadding(){return {...this.padding}}getBounds(){let t=this.transform,o=new At;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=tr(t,{width:r.width,height:r.height,bearing:o.bearing??r.bearing,padding:o.padding!==void 0?Ol(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=xe((t-o.start)/o.duration,0,1),n=o.fly?r:co(r),a=this.transform,l=te(o.from.center),s=te(o.to.center);if(o.fly){let{u:c,w:f}=o.fly.curve(o.fly.S*r),u=o.fly.u1>1e-6?xe(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)*co(r),a.pitch=o.from.pitch+(o.to.pitch-o.from.pitch)*co(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(te(t),o)}unproject(t){return this.transform.unproject(t)}get style(){return this._style}setStyle(t){let o=this._style,r=new pt(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(Ao(t,this.options.style))}static get themes(){return Object.keys(Be)}static get themeList(){return Object.entries(Be).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)}setDebugTiles(t){return this.renderer.debugTiles=t,this.triggerRepaint(),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:Te(r.mercX),lat:Se(r.mercY)},key:St.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??$);if(!n)continue;let a=Nr(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 z,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??$)));}if(!n||!o.length)return null;let a=Gr(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=Cn({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=Sn(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"?Zo(Qo()):t;return this.governor.reset(o,o),this.applyQuality(ao(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.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();}checkFrameBudget(t){if(!this.qualityAuto)return;let o=this.governor.frame(t,this.sum(n=>n.pendingCount)>0);if(!o)return;let r=`${(o.share*100).toFixed(0)}%`;console.info(o.direction==="down"?`[osmgl] \u0442\u044F\u0436\u0451\u043B\u044B\u0445 \u043A\u0430\u0434\u0440\u043E\u0432 ${r} \u2014 \u043A\u0430\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u043D\u0438\u0436\u0435\u043D\u043E \u0434\u043E \xAB${o.to}\xBB (\u043F\u043B\u043E\u0442\u043D\u043E\u0441\u0442\u044C \u0431\u0443\u0444\u0435\u0440\u0430 \u043F\u0440\u0435\u0436\u043D\u044F\u044F, \u043F\u043E\u0442\u043E\u043B\u043E\u043A \xAB${this.governor.limit}\xBB)`:`[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${o.to}\xBB`),this.applyQuality(ao(o.to),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=de(t),this.triggerRepaint(),this}getIndoorLevels(){let t=[];for(let[o,r]of this.sources.entries())if(this._style.layers.some(n=>(n.source??$)===o&&"splitBy"in n&&n.splitBy===Et))for(let n of r.splitValues(Et)){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[Et];return typeof t=="number"?t:null}setIndoorLevel(t){return t===null?delete this._style.splitValues[Et]:this._style.splitValues[Et]=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 no)}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,It):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,m]of this.sources)this.sourceDrawn(h,this.transform.zoom)?m.update(this.transform):m.deactivate();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<Xu,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();}}},N1=zn;
2337
2337
  exports.AssetLoader=to;exports.BASE_SOURCE=$;exports.BUILDING_HEIGHT_SCALE=ut;exports.BUILDING_POS_SCALE=ft;exports.BUILDING_VERTEX_STRIDE=ke;exports.CITY_STYLE=Pc;exports.Circle=Ln;exports.DEFAULT_ICONS=nt;exports.DEFAULT_LIGHT=Ar;exports.DEFAULT_SHADOWS=ll;exports.DEFAULT_SKY=Er;exports.DEFAULT_STYLE=Ir;exports.DepthTarget=Ht;exports.EARTH_CIRCUMFERENCE=uo;exports.FILL_VERTEX_STRIDE=Xe;exports.GLOBE_MAX_PITCH=It;exports.GLOBE_ZOOM_MAX=et;exports.GLOBE_ZOOM_MIN=bo;exports.GLYPH_BORDER=ve;exports.GLYPH_SIZE=Ge;exports.GROUND_SCALE=Zs;exports.GeomType=Ft;exports.GlyphSource=$t;exports.GroundArrows=Bt;exports.IconSource=Zt;exports.IndoorMask=Wt;exports.LEVEL_LIMIT=Js;exports.LINE_VERTEX_STRIDE=Ke;exports.LayerRenderer=Kt;exports.LngLatBounds=At;exports.MAX_LATITUDE=Hn;exports.MODEL_VERTEX_STRIDE=Ho;exports.Map=zn;exports.MapObject=lo;exports.Marker=ro;exports.Model=oo;exports.ModelLayer=$e;exports.ObjectManager=Nt;exports.Polygon=Jo;exports.Polyline=In;exports.Popup=no;exports.QualityGovernor=io;exports.RELIEF_STYLE=zc;exports.RUNTIME_FILL_STRIDE=jr;exports.RUNTIME_LINE_STRIDE=yt;exports.RasterSource=eo;exports.RasterTile=Uo;exports.SDF_EDGE=on;exports.SDF_PX=qt;exports.SOFT_STYLE=Fc;exports.SPLIT_SEP=ha;exports.SURFACE_CUT_BLEED=zt;exports.SURFACE_LEVEL_SCALE=Ii;exports.SURFACE_VERTEX_STRIDE=dt;exports.SdfAtlas=Yt;exports.Style=pt;exports.SymbolRenderer=St;exports.THEMES=Be;exports.TILE_SIZE=Je;exports.TileID=Tt;exports.Transform=Lt;exports.VectorTile=Rt;exports.VectorTileFeature=xo;exports.VectorTileLayer=_o;exports.abbreviateStreet=yn;exports.addGround=Sr;exports.altitudeFromMercatorZ=ed;exports.applyTheme=Eo;exports.arrowLabelOffset=wl;exports.arrowVertices=Yc;exports.buildRuntimeFill=Xr;exports.buildRuntimeLine=Vt;exports.cameraForBounds=tr;exports.circumferenceAtLatitude=Le;exports.clampLat=ho;exports.clampPixelRatio=kn;exports.classifyRenderer=Fl;exports.clipLineToRect=an;exports.coordinateDigits=Il;exports.coveringTiles=Jt;exports.createGround=Cr;exports.default=N1;exports.deviceHints=Qo;exports.distToSegment=Pl;exports.evaluateColor=Ae;exports.evaluateNumber=D;exports.extractFeature=Fo;exports.featureLevel=rt;exports.fillFootprint=Or;exports.fogPlanes=bt;exports.footprintOf=Br;exports.formatHash=Cn;exports.generateBuildings=dr;exports.generateFill=pr;exports.generateLine=Tr;exports.generateSurface=_r;exports.generateSymbols=vn;exports.globeBasis=ar;exports.globeFlatMix=go;exports.globeRadius=yo;exports.globeToLocal=Un;exports.groundAt=Mo;exports.iconRotation=xl;exports.insideFootprint=Ne;exports.latFromMercatorY=Se;exports.lngFromMercatorX=Te;exports.lngLatToUnit=vo;exports.matchesFilter=ye;exports.mercatorMetersPerTile=mo;exports.mercatorX=le;exports.mercatorY=se;exports.mercatorZFromAltitude=er;exports.metersPerPixel=od;exports.metersPerTile=On;exports.nextQualityDown=En;exports.parseGlb=pf;exports.parseGlbAsync=$r;exports.parseGlyphs=cl;exports.parseHash=Sn;exports.patchUV=Ya;exports.pickBuilding=Nr;exports.pickFill=Gr;exports.pitchIntent=Zn;exports.pixelsPerMeter=td;exports.placeAlongLine=sn;exports.pointInRing=Fn;exports.qualityFor=Zo;exports.qualityProfile=ao;exports.raySphere=lr;exports.resolveTemplate=gn;exports.roundRing=He;exports.sdfFromAlpha=rn;exports.shapeText=nn;exports.splitBucketKey=Oe;exports.splitByGround=Mr;exports.splitPolygons=tt;exports.stitchPieces=kr;exports.styleWithTheme=Ao;exports.tileOriginMeters=Bn;exports.tileUrl=_l;exports.toLngLat=te;exports.unitToLngLat=ir;exports.worldSize=je;//# sourceMappingURL=osmgl.cjs.map
2338
2338
  //# sourceMappingURL=osmgl.cjs.map